├── .gitignore ├── README.md ├── doc └── 问题记录.md ├── include └── README ├── lib ├── README ├── ble_kb │ ├── BleKeyboard.cpp │ └── BleKeyboard.h ├── button │ ├── EventType.inc │ ├── button_event.cpp │ └── button_event.h └── lvgl │ ├── .codecov.yml │ ├── .editorconfig │ ├── .github │ ├── FUNDING.yml │ ├── ISSUE_TEMPLATE │ │ ├── bug-report.md │ │ ├── config.yml │ │ └── dev-discussion.md │ ├── auto-comment.yml │ ├── pull_request_template.md │ └── workflows │ │ ├── build_micropython.yml │ │ ├── ccpp.yml │ │ ├── check_conf.yml │ │ ├── close_old_issues.yml │ │ ├── compile_docs.yml │ │ ├── esp_upload_component.yml │ │ ├── main.yml │ │ └── release.yml │ ├── .gitignore │ ├── .piopm │ ├── CMakeLists.txt │ ├── Kconfig │ ├── LICENCE.txt │ ├── README.md │ ├── SConscript │ ├── component.mk │ ├── examples │ ├── anim │ │ ├── index.rst │ │ ├── lv_example_anim.h │ │ ├── lv_example_anim_1.c │ │ ├── lv_example_anim_1.py │ │ ├── lv_example_anim_2.c │ │ ├── lv_example_anim_2.py │ │ ├── lv_example_anim_3.c │ │ ├── lv_example_anim_3.py │ │ ├── lv_example_anim_timeline_1.c │ │ └── lv_example_anim_timeline_1.py │ ├── arduino │ │ └── LVGL_Arduino │ │ │ └── LVGL_Arduino.ino │ ├── assets │ │ ├── animimg001.c │ │ ├── animimg002.c │ │ ├── animimg003.c │ │ ├── font │ │ │ ├── lv_font_simsun_16_cjk.fnt │ │ │ ├── montserrat-16.fnt │ │ │ └── montserrat-22.fnt │ │ ├── img_caret_down.c │ │ ├── img_cogwheel_alpha16.c │ │ ├── img_cogwheel_argb.c │ │ ├── img_cogwheel_chroma_keyed.c │ │ ├── img_cogwheel_indexed16.c │ │ ├── img_cogwheel_rgb.c │ │ ├── img_hand.c │ │ ├── img_skew_strip.c │ │ ├── img_skew_strip_80x20_argb8888.fnt │ │ ├── img_star.c │ │ ├── imgbtn_left.c │ │ ├── imgbtn_mid.c │ │ └── imgbtn_right.c │ ├── event │ │ ├── index.rst │ │ ├── lv_example_event.h │ │ ├── lv_example_event_1.c │ │ ├── lv_example_event_1.py │ │ ├── lv_example_event_2.c │ │ ├── lv_example_event_2.py │ │ ├── lv_example_event_3.c │ │ └── lv_example_event_3.py │ ├── examples.mk │ ├── get_started │ │ ├── index.rst │ │ ├── lv_example_get_started.h │ │ ├── lv_example_get_started_1.c │ │ ├── lv_example_get_started_1.py │ │ ├── lv_example_get_started_2.c │ │ ├── lv_example_get_started_2.py │ │ ├── lv_example_get_started_3.c │ │ └── lv_example_get_started_3.py │ ├── header.py │ ├── layouts │ │ ├── flex │ │ │ ├── index.rst │ │ │ ├── lv_example_flex.h │ │ │ ├── lv_example_flex_1.c │ │ │ ├── lv_example_flex_1.py │ │ │ ├── lv_example_flex_2.c │ │ │ ├── lv_example_flex_2.py │ │ │ ├── lv_example_flex_3.c │ │ │ ├── lv_example_flex_3.py │ │ │ ├── lv_example_flex_4.c │ │ │ ├── lv_example_flex_4.py │ │ │ ├── lv_example_flex_5.c │ │ │ ├── lv_example_flex_5.py │ │ │ ├── lv_example_flex_6.c │ │ │ └── lv_example_flex_6.py │ │ ├── grid │ │ │ ├── index.rst │ │ │ ├── lv_example_grid.h │ │ │ ├── lv_example_grid_1.c │ │ │ ├── lv_example_grid_1.py │ │ │ ├── lv_example_grid_2.c │ │ │ ├── lv_example_grid_2.py │ │ │ ├── lv_example_grid_3.c │ │ │ ├── lv_example_grid_3.py │ │ │ ├── lv_example_grid_4.c │ │ │ ├── lv_example_grid_4.py │ │ │ ├── lv_example_grid_5.c │ │ │ ├── lv_example_grid_5.py │ │ │ ├── lv_example_grid_6.c │ │ │ └── lv_example_grid_6.py │ │ └── lv_example_layout.h │ ├── libs │ │ ├── bmp │ │ │ ├── example_16bit.bmp │ │ │ ├── example_24bit.bmp │ │ │ ├── example_32bit.bmp │ │ │ ├── index.rst │ │ │ ├── lv_example_bmp.h │ │ │ └── lv_example_bmp_1.c │ │ ├── freetype │ │ │ ├── arial.ttf │ │ │ ├── index.rst │ │ │ ├── lv_example_freetype.h │ │ │ └── lv_example_freetype_1.c │ │ ├── gif │ │ │ ├── img_bulb_gif.c │ │ │ ├── index.rst │ │ │ ├── lv_example_gif.h │ │ │ └── lv_example_gif_1.c │ │ ├── lv_example_libs.h │ │ ├── png │ │ │ ├── img_wing_png.c │ │ │ ├── index.rst │ │ │ ├── lv_example_png.h │ │ │ └── lv_example_png_1.c │ │ ├── qrcode │ │ │ ├── index.rst │ │ │ ├── lv_example_qrcode.h │ │ │ └── lv_example_qrcode_1.c │ │ ├── rlottie │ │ │ ├── index.rst │ │ │ ├── lv_example_rlottie.h │ │ │ ├── lv_example_rlottie_1.c │ │ │ ├── lv_example_rlottie_2.c │ │ │ ├── lv_example_rlottie_approve.c │ │ │ └── lv_example_rlottie_approve.json │ │ └── sjpg │ │ │ ├── index.rst │ │ │ ├── lv_example_sjpg.h │ │ │ ├── lv_example_sjpg_1.c │ │ │ └── small_image.sjpg │ ├── lv_examples.h │ ├── others │ │ ├── lv_example_others.h │ │ └── snapshot │ │ │ ├── index.rst │ │ │ ├── lv_example_snapshot.h │ │ │ ├── lv_example_snapshot_1.c │ │ │ └── lv_example_snapshot_1.py │ ├── porting │ │ ├── lv_port_disp_template.c │ │ ├── lv_port_disp_template.h │ │ ├── lv_port_fs_template.c │ │ ├── lv_port_fs_template.h │ │ ├── lv_port_indev_template.c │ │ └── lv_port_indev_template.h │ ├── scroll │ │ ├── index.rst │ │ ├── lv_example_scroll.h │ │ ├── lv_example_scroll_1.c │ │ ├── lv_example_scroll_1.py │ │ ├── lv_example_scroll_2.c │ │ ├── lv_example_scroll_2.py │ │ ├── lv_example_scroll_3.c │ │ ├── lv_example_scroll_3.py │ │ ├── lv_example_scroll_4.c │ │ ├── lv_example_scroll_4.py │ │ ├── lv_example_scroll_5.c │ │ ├── lv_example_scroll_5.py │ │ ├── lv_example_scroll_6.c │ │ └── lv_example_scroll_6.py │ ├── styles │ │ ├── index.rst │ │ ├── lv_example_style.h │ │ ├── lv_example_style_1.c │ │ ├── lv_example_style_1.py │ │ ├── lv_example_style_10.c │ │ ├── lv_example_style_10.py │ │ ├── lv_example_style_11.c │ │ ├── lv_example_style_11.py │ │ ├── lv_example_style_12.c │ │ ├── lv_example_style_12.py │ │ ├── lv_example_style_13.c │ │ ├── lv_example_style_13.py │ │ ├── lv_example_style_14.c │ │ ├── lv_example_style_14.py │ │ ├── lv_example_style_2.c │ │ ├── lv_example_style_2.py │ │ ├── lv_example_style_3.c │ │ ├── lv_example_style_3.py │ │ ├── lv_example_style_4.c │ │ ├── lv_example_style_4.py │ │ ├── lv_example_style_5.c │ │ ├── lv_example_style_5.py │ │ ├── lv_example_style_6.c │ │ ├── lv_example_style_6.py │ │ ├── lv_example_style_7.c │ │ ├── lv_example_style_7.py │ │ ├── lv_example_style_8.c │ │ ├── lv_example_style_8.py │ │ ├── lv_example_style_9.c │ │ └── lv_example_style_9.py │ ├── test_ex.sh │ └── widgets │ │ ├── animimg │ │ ├── index.rst │ │ ├── lv_example_animimg_1.c │ │ └── lv_example_animimg_1.py │ │ ├── arc │ │ ├── index.rst │ │ ├── lv_example_arc_1.c │ │ ├── lv_example_arc_1.py │ │ ├── lv_example_arc_2.c │ │ └── lv_example_arc_2.py │ │ ├── bar │ │ ├── index.rst │ │ ├── lv_example_bar_1.c │ │ ├── lv_example_bar_1.py │ │ ├── lv_example_bar_2.c │ │ ├── lv_example_bar_2.py │ │ ├── lv_example_bar_3.c │ │ ├── lv_example_bar_3.py │ │ ├── lv_example_bar_4.c │ │ ├── lv_example_bar_4.py │ │ ├── lv_example_bar_5.c │ │ ├── lv_example_bar_5.py │ │ ├── lv_example_bar_6.c │ │ ├── lv_example_bar_6.py │ │ └── test.py │ │ ├── btn │ │ ├── index.rst │ │ ├── lv_example_btn_1.c │ │ ├── lv_example_btn_1.py │ │ ├── lv_example_btn_2.c │ │ ├── lv_example_btn_2.py │ │ ├── lv_example_btn_3.c │ │ └── lv_example_btn_3.py │ │ ├── btnmatrix │ │ ├── index.rst │ │ ├── lv_example_btnmatrix_1.c │ │ ├── lv_example_btnmatrix_1.py │ │ ├── lv_example_btnmatrix_2.c │ │ ├── lv_example_btnmatrix_2.py │ │ ├── lv_example_btnmatrix_3.c │ │ └── lv_example_btnmatrix_3.py │ │ ├── calendar │ │ ├── index.rst │ │ ├── lv_example_calendar_1.c │ │ └── lv_example_calendar_1.py │ │ ├── canvas │ │ ├── index.rst │ │ ├── lv_example_canvas_1.c │ │ ├── lv_example_canvas_1.py │ │ ├── lv_example_canvas_2.c │ │ └── lv_example_canvas_2.py │ │ ├── chart │ │ ├── index.rst │ │ ├── lv_example_chart_1.c │ │ ├── lv_example_chart_1.py │ │ ├── lv_example_chart_2.c │ │ ├── lv_example_chart_2.py │ │ ├── lv_example_chart_3.c │ │ ├── lv_example_chart_3.py │ │ ├── lv_example_chart_4.c │ │ ├── lv_example_chart_4.py │ │ ├── lv_example_chart_5.c │ │ ├── lv_example_chart_5.py │ │ ├── lv_example_chart_6.c │ │ ├── lv_example_chart_6.py │ │ ├── lv_example_chart_7.c │ │ ├── lv_example_chart_7.py │ │ ├── lv_example_chart_8.c │ │ ├── lv_example_chart_8.py │ │ ├── lv_example_chart_9.c │ │ └── lv_example_chart_9.py │ │ ├── checkbox │ │ ├── index.rst │ │ ├── lv_example_checkbox_1.c │ │ ├── lv_example_checkbox_1.py │ │ └── lv_example_checkbox_2.c │ │ ├── colorwheel │ │ ├── index.rst │ │ ├── lv_example_colorwheel_1.c │ │ └── lv_example_colorwheel_1.py │ │ ├── dropdown │ │ ├── index.rst │ │ ├── lv_example_dropdown_1.c │ │ ├── lv_example_dropdown_1.py │ │ ├── lv_example_dropdown_2.c │ │ ├── lv_example_dropdown_2.py │ │ ├── lv_example_dropdown_3.c │ │ └── lv_example_dropdown_3.py │ │ ├── img │ │ ├── index.rst │ │ ├── lv_example_img_1.c │ │ ├── lv_example_img_1.py │ │ ├── lv_example_img_2.c │ │ ├── lv_example_img_2.py │ │ ├── lv_example_img_3.c │ │ ├── lv_example_img_3.py │ │ ├── lv_example_img_4.c │ │ └── lv_example_img_4.py │ │ ├── imgbtn │ │ ├── index.rst │ │ ├── lv_example_imgbtn_1.c │ │ └── lv_example_imgbtn_1.py │ │ ├── keyboard │ │ ├── index.rst │ │ ├── lv_example_keyboard_1.c │ │ └── lv_example_keyboard_1.py │ │ ├── label │ │ ├── index.rst │ │ ├── lv_example_label_1.c │ │ ├── lv_example_label_1.py │ │ ├── lv_example_label_2.c │ │ ├── lv_example_label_2.py │ │ ├── lv_example_label_3.c │ │ ├── lv_example_label_3.py │ │ └── lv_example_label_4.c │ │ ├── led │ │ ├── index.rst │ │ ├── lv_example_led_1.c │ │ └── lv_example_led_1.py │ │ ├── line │ │ ├── index.rst │ │ ├── lv_example_line_1.c │ │ └── lv_example_line_1.py │ │ ├── list │ │ ├── index.rst │ │ ├── lv_example_list_1.c │ │ ├── lv_example_list_1.py │ │ ├── lv_example_list_2.c │ │ ├── lv_example_list_2.py │ │ └── test.py │ │ ├── lv_example_widgets.h │ │ ├── meter │ │ ├── index.rst │ │ ├── lv_example_meter_1.c │ │ ├── lv_example_meter_1.py │ │ ├── lv_example_meter_2.c │ │ ├── lv_example_meter_2.py │ │ ├── lv_example_meter_3.c │ │ ├── lv_example_meter_3.py │ │ ├── lv_example_meter_4.c │ │ └── lv_example_meter_4.py │ │ ├── msgbox │ │ ├── index.rst │ │ ├── lv_example_msgbox_1.c │ │ └── lv_example_msgbox_1.py │ │ ├── obj │ │ ├── index.rst │ │ ├── lv_example_obj_1.c │ │ ├── lv_example_obj_1.py │ │ ├── lv_example_obj_2.c │ │ └── lv_example_obj_2.py │ │ ├── roller │ │ ├── index.rst │ │ ├── lv_example_roller_1.c │ │ ├── lv_example_roller_1.py │ │ ├── lv_example_roller_2.c │ │ ├── lv_example_roller_2.py │ │ ├── lv_example_roller_3.c │ │ └── lv_example_roller_3.py │ │ ├── slider │ │ ├── index.rst │ │ ├── lv_example_slider_1.c │ │ ├── lv_example_slider_1.py │ │ ├── lv_example_slider_2.c │ │ ├── lv_example_slider_2.py │ │ ├── lv_example_slider_3.c │ │ └── lv_example_slider_3.py │ │ ├── span │ │ ├── index.rst │ │ ├── lv_example_span_1.c │ │ └── lv_example_span_1.py │ │ ├── spinbox │ │ ├── index.rst │ │ ├── lv_example_spinbox_1.c │ │ └── lv_example_spinbox_1.py │ │ ├── spinner │ │ ├── index.rst │ │ ├── lv_example_spinner_1.c │ │ └── lv_example_spinner_1.py │ │ ├── switch │ │ ├── index.rst │ │ ├── lv_example_switch_1.c │ │ └── lv_example_switch_1.py │ │ ├── table │ │ ├── index.rst │ │ ├── lv_example_table_1.c │ │ ├── lv_example_table_1.py │ │ ├── lv_example_table_2.c │ │ └── lv_example_table_2.py │ │ ├── tabview │ │ ├── index.rst │ │ ├── lv_example_tabview_1.c │ │ ├── lv_example_tabview_1.py │ │ ├── lv_example_tabview_2.c │ │ └── lv_example_tabview_2.py │ │ ├── textarea │ │ ├── index.rst │ │ ├── lv_example_textarea_1.c │ │ ├── lv_example_textarea_1.py │ │ ├── lv_example_textarea_2.c │ │ ├── lv_example_textarea_2.py │ │ ├── lv_example_textarea_3.c │ │ └── lv_example_textarea_3.py │ │ ├── tileview │ │ ├── index.rst │ │ ├── lv_example_tileview_1.c │ │ └── lv_example_tileview_1.py │ │ └── win │ │ ├── index.rst │ │ ├── lv_example_win_1.c │ │ └── lv_example_win_1.py │ ├── idf_component.yml │ ├── library.json │ ├── library.properties │ ├── lv_conf.h │ ├── lv_conf_template.h │ ├── lvgl.h │ ├── lvgl.mk │ ├── rt-thread │ ├── SConscript │ ├── lv_rt_thread_conf.h │ └── lv_rt_thread_port.c │ ├── scripts │ ├── .gitignore │ ├── Doxyfile │ ├── build_html_examples.sh │ ├── built_in_font │ │ ├── DejaVuSans.ttf │ │ ├── FontAwesome5-Solid+Brands+Regular.woff │ │ ├── Montserrat-Medium.ttf │ │ ├── SimSun.woff │ │ ├── built_in_font_gen.py │ │ ├── generate_all.py │ │ └── unscii-8.ttf │ ├── changelog-template.hbs │ ├── changelog_gen.sh │ ├── code-format.cfg │ ├── code-format.sh │ ├── cppcheck_run.sh │ ├── filetohex.py │ ├── find_version.sh │ ├── genexamplelist.sh │ ├── infer_run.sh │ ├── install-prerequisites.sh │ ├── jpg_to_sjpg.py │ ├── lv_conf_internal_gen.py │ ├── release │ │ ├── com.py │ │ ├── commits.txt │ │ ├── patch.py │ │ └── release.py │ └── style_api_gen.py │ ├── src │ ├── core │ │ ├── lv_core.mk │ │ ├── lv_disp.c │ │ ├── lv_disp.h │ │ ├── lv_event.c │ │ ├── lv_event.h │ │ ├── lv_group.c │ │ ├── lv_group.h │ │ ├── lv_indev.c │ │ ├── lv_indev.h │ │ ├── lv_indev_scroll.c │ │ ├── lv_indev_scroll.h │ │ ├── lv_obj.c │ │ ├── lv_obj.h │ │ ├── lv_obj_class.c │ │ ├── lv_obj_class.h │ │ ├── lv_obj_draw.c │ │ ├── lv_obj_draw.h │ │ ├── lv_obj_pos.c │ │ ├── lv_obj_pos.h │ │ ├── lv_obj_scroll.c │ │ ├── lv_obj_scroll.h │ │ ├── lv_obj_style.c │ │ ├── lv_obj_style.h │ │ ├── lv_obj_style_gen.c │ │ ├── lv_obj_style_gen.h │ │ ├── lv_obj_tree.c │ │ ├── lv_obj_tree.h │ │ ├── lv_refr.c │ │ ├── lv_refr.h │ │ ├── lv_theme.c │ │ └── lv_theme.h │ ├── draw │ │ ├── lv_draw.h │ │ ├── lv_draw.mk │ │ ├── lv_draw_arc.c │ │ ├── lv_draw_arc.h │ │ ├── lv_draw_blend.c │ │ ├── lv_draw_blend.h │ │ ├── lv_draw_img.c │ │ ├── lv_draw_img.h │ │ ├── lv_draw_label.c │ │ ├── lv_draw_label.h │ │ ├── lv_draw_line.c │ │ ├── lv_draw_line.h │ │ ├── lv_draw_mask.c │ │ ├── lv_draw_mask.h │ │ ├── lv_draw_rect.c │ │ ├── lv_draw_rect.h │ │ ├── lv_draw_triangle.c │ │ ├── lv_draw_triangle.h │ │ ├── lv_img_buf.c │ │ ├── lv_img_buf.h │ │ ├── lv_img_cache.c │ │ ├── lv_img_cache.h │ │ ├── lv_img_decoder.c │ │ └── lv_img_decoder.h │ ├── extra │ │ ├── README.md │ │ ├── extra.mk │ │ ├── layouts │ │ │ ├── flex │ │ │ │ ├── lv_flex.c │ │ │ │ └── lv_flex.h │ │ │ ├── grid │ │ │ │ ├── lv_grid.c │ │ │ │ └── lv_grid.h │ │ │ └── lv_layouts.h │ │ ├── libs │ │ │ ├── bmp │ │ │ │ ├── lv_bmp.c │ │ │ │ └── lv_bmp.h │ │ │ ├── freetype │ │ │ │ ├── arial.ttf │ │ │ │ ├── lv_freetype.c │ │ │ │ └── lv_freetype.h │ │ │ ├── fsdrv │ │ │ │ ├── lv_fs_fatfs.c │ │ │ │ ├── lv_fs_posix.c │ │ │ │ ├── lv_fs_stdio.c │ │ │ │ ├── lv_fs_win32.c │ │ │ │ └── lv_fsdrv.h │ │ │ ├── gif │ │ │ │ ├── gifdec.c │ │ │ │ ├── gifdec.h │ │ │ │ ├── lv_gif.c │ │ │ │ └── lv_gif.h │ │ │ ├── lv_libs.h │ │ │ ├── png │ │ │ │ ├── lodepng.c │ │ │ │ ├── lodepng.h │ │ │ │ ├── lv_png.c │ │ │ │ └── lv_png.h │ │ │ ├── qrcode │ │ │ │ ├── lv_qrcode.c │ │ │ │ ├── lv_qrcode.h │ │ │ │ ├── qrcodegen.c │ │ │ │ └── qrcodegen.h │ │ │ ├── rlottie │ │ │ │ ├── lv_rlottie.c │ │ │ │ └── lv_rlottie.h │ │ │ └── sjpg │ │ │ │ ├── lv_sjpg.c │ │ │ │ ├── lv_sjpg.h │ │ │ │ ├── tjpgd.c │ │ │ │ ├── tjpgd.h │ │ │ │ └── tjpgdcnf.h │ │ ├── lv_extra.c │ │ ├── lv_extra.h │ │ ├── others │ │ │ ├── lv_others.h │ │ │ └── snapshot │ │ │ │ ├── lv_snapshot.c │ │ │ │ └── lv_snapshot.h │ │ ├── themes │ │ │ ├── basic │ │ │ │ ├── lv_theme_basic.c │ │ │ │ └── lv_theme_basic.h │ │ │ ├── default │ │ │ │ ├── lv_theme_default.c │ │ │ │ └── lv_theme_default.h │ │ │ ├── lv_themes.h │ │ │ └── mono │ │ │ │ ├── lv_theme_mono.c │ │ │ │ └── lv_theme_mono.h │ │ └── widgets │ │ │ ├── animimg │ │ │ ├── lv_animimg.c │ │ │ └── lv_animimg.h │ │ │ ├── calendar │ │ │ ├── lv_calendar.c │ │ │ ├── lv_calendar.h │ │ │ ├── lv_calendar_header_arrow.c │ │ │ ├── lv_calendar_header_arrow.h │ │ │ ├── lv_calendar_header_dropdown.c │ │ │ └── lv_calendar_header_dropdown.h │ │ │ ├── chart │ │ │ ├── lv_chart.c │ │ │ └── lv_chart.h │ │ │ ├── colorwheel │ │ │ ├── lv_colorwheel.c │ │ │ └── lv_colorwheel.h │ │ │ ├── imgbtn │ │ │ ├── lv_imgbtn.c │ │ │ └── lv_imgbtn.h │ │ │ ├── keyboard │ │ │ ├── lv_keyboard.c │ │ │ └── lv_keyboard.h │ │ │ ├── led │ │ │ ├── lv_led.c │ │ │ └── lv_led.h │ │ │ ├── list │ │ │ ├── lv_list.c │ │ │ └── lv_list.h │ │ │ ├── lv_widgets.h │ │ │ ├── meter │ │ │ ├── lv_meter.c │ │ │ └── lv_meter.h │ │ │ ├── msgbox │ │ │ ├── lv_msgbox.c │ │ │ └── lv_msgbox.h │ │ │ ├── span │ │ │ ├── lv_span.c │ │ │ └── lv_span.h │ │ │ ├── spinbox │ │ │ ├── lv_spinbox.c │ │ │ └── lv_spinbox.h │ │ │ ├── spinner │ │ │ ├── lv_spinner.c │ │ │ └── lv_spinner.h │ │ │ ├── tabview │ │ │ ├── lv_tabview.c │ │ │ └── lv_tabview.h │ │ │ ├── tileview │ │ │ ├── lv_tileview.c │ │ │ └── lv_tileview.h │ │ │ └── win │ │ │ ├── lv_win.c │ │ │ └── lv_win.h │ ├── font │ │ ├── lv_font.c │ │ ├── lv_font.h │ │ ├── lv_font.mk │ │ ├── lv_font_dejavu_16_persian_hebrew.c │ │ ├── lv_font_fmt_txt.c │ │ ├── lv_font_fmt_txt.h │ │ ├── lv_font_loader.c │ │ ├── lv_font_loader.h │ │ ├── lv_font_montserrat_10.c │ │ ├── lv_font_montserrat_12.c │ │ ├── lv_font_montserrat_12_subpx.c │ │ ├── lv_font_montserrat_14.c │ │ ├── lv_font_montserrat_16.c │ │ ├── lv_font_montserrat_18.c │ │ ├── lv_font_montserrat_20.c │ │ ├── lv_font_montserrat_22.c │ │ ├── lv_font_montserrat_24.c │ │ ├── lv_font_montserrat_26.c │ │ ├── lv_font_montserrat_28.c │ │ ├── lv_font_montserrat_28_compressed.c │ │ ├── lv_font_montserrat_30.c │ │ ├── lv_font_montserrat_32.c │ │ ├── lv_font_montserrat_34.c │ │ ├── lv_font_montserrat_36.c │ │ ├── lv_font_montserrat_38.c │ │ ├── lv_font_montserrat_40.c │ │ ├── lv_font_montserrat_42.c │ │ ├── lv_font_montserrat_44.c │ │ ├── lv_font_montserrat_46.c │ │ ├── lv_font_montserrat_48.c │ │ ├── lv_font_montserrat_8.c │ │ ├── lv_font_simsun_16_cjk.c │ │ ├── lv_font_unscii_16.c │ │ ├── lv_font_unscii_8.c │ │ └── lv_symbol_def.h │ ├── gpu │ │ ├── lv_gpu.mk │ │ ├── lv_gpu_nxp_pxp.c │ │ ├── lv_gpu_nxp_pxp.h │ │ ├── lv_gpu_nxp_pxp_osa.c │ │ ├── lv_gpu_nxp_pxp_osa.h │ │ ├── lv_gpu_nxp_vglite.c │ │ ├── lv_gpu_nxp_vglite.h │ │ ├── lv_gpu_sdl.c │ │ ├── lv_gpu_sdl.h │ │ ├── lv_gpu_stm32_dma2d.c │ │ ├── lv_gpu_stm32_dma2d.h │ │ └── sdl │ │ │ ├── README.md │ │ │ ├── lv_gpu_sdl.mk │ │ │ ├── lv_gpu_sdl_draw_arc.c │ │ │ ├── lv_gpu_sdl_draw_blend.c │ │ │ ├── lv_gpu_sdl_draw_img.c │ │ │ ├── lv_gpu_sdl_draw_label.c │ │ │ ├── lv_gpu_sdl_draw_line.c │ │ │ ├── lv_gpu_sdl_draw_rect.c │ │ │ ├── lv_gpu_sdl_lru.c │ │ │ ├── lv_gpu_sdl_lru.h │ │ │ ├── lv_gpu_sdl_mask.c │ │ │ ├── lv_gpu_sdl_mask.h │ │ │ ├── lv_gpu_sdl_stack_blur.c │ │ │ ├── lv_gpu_sdl_stack_blur.h │ │ │ ├── lv_gpu_sdl_texture_cache.c │ │ │ ├── lv_gpu_sdl_texture_cache.h │ │ │ ├── lv_gpu_sdl_utils.c │ │ │ └── lv_gpu_sdl_utils.h │ ├── hal │ │ ├── lv_hal.h │ │ ├── lv_hal.mk │ │ ├── lv_hal_disp.c │ │ ├── lv_hal_disp.h │ │ ├── lv_hal_indev.c │ │ ├── lv_hal_indev.h │ │ ├── lv_hal_tick.c │ │ └── lv_hal_tick.h │ ├── lv_api_map.h │ ├── lv_conf_internal.h │ ├── lv_conf_kconfig.h │ ├── lvgl.h │ ├── misc │ │ ├── lv_anim.c │ │ ├── lv_anim.h │ │ ├── lv_anim_timeline.c │ │ ├── lv_anim_timeline.h │ │ ├── lv_area.c │ │ ├── lv_area.h │ │ ├── lv_assert.h │ │ ├── lv_async.c │ │ ├── lv_async.h │ │ ├── lv_bidi.c │ │ ├── lv_bidi.h │ │ ├── lv_color.c │ │ ├── lv_color.h │ │ ├── lv_fs.c │ │ ├── lv_fs.h │ │ ├── lv_gc.c │ │ ├── lv_gc.h │ │ ├── lv_ll.c │ │ ├── lv_ll.h │ │ ├── lv_log.c │ │ ├── lv_log.h │ │ ├── lv_math.c │ │ ├── lv_math.h │ │ ├── lv_mem.c │ │ ├── lv_mem.h │ │ ├── lv_misc.mk │ │ ├── lv_printf.c │ │ ├── lv_printf.h │ │ ├── lv_style.c │ │ ├── lv_style.h │ │ ├── lv_style_gen.c │ │ ├── lv_style_gen.h │ │ ├── lv_templ.c │ │ ├── lv_templ.h │ │ ├── lv_timer.c │ │ ├── lv_timer.h │ │ ├── lv_tlsf.c │ │ ├── lv_tlsf.h │ │ ├── lv_txt.c │ │ ├── lv_txt.h │ │ ├── lv_txt_ap.c │ │ ├── lv_txt_ap.h │ │ ├── lv_types.h │ │ ├── lv_utils.c │ │ └── lv_utils.h │ └── widgets │ │ ├── lv_arc.c │ │ ├── lv_arc.h │ │ ├── lv_bar.c │ │ ├── lv_bar.h │ │ ├── lv_btn.c │ │ ├── lv_btn.h │ │ ├── lv_btnmatrix.c │ │ ├── lv_btnmatrix.h │ │ ├── lv_canvas.c │ │ ├── lv_canvas.h │ │ ├── lv_checkbox.c │ │ ├── lv_checkbox.h │ │ ├── lv_dropdown.c │ │ ├── lv_dropdown.h │ │ ├── lv_img.c │ │ ├── lv_img.h │ │ ├── lv_label.c │ │ ├── lv_label.h │ │ ├── lv_line.c │ │ ├── lv_line.h │ │ ├── lv_objx_templ.c │ │ ├── lv_objx_templ.h │ │ ├── lv_roller.c │ │ ├── lv_roller.h │ │ ├── lv_slider.c │ │ ├── lv_slider.h │ │ ├── lv_switch.c │ │ ├── lv_switch.h │ │ ├── lv_table.c │ │ ├── lv_table.h │ │ ├── lv_textarea.c │ │ ├── lv_textarea.h │ │ └── lv_widgets.mk │ ├── tests │ ├── .gitignore │ ├── CMakeLists.txt │ ├── README.md │ ├── config.yml │ ├── main.py │ ├── src │ │ ├── lv_test_conf.h │ │ ├── lv_test_indev.c │ │ ├── lv_test_indev.h │ │ ├── lv_test_init.c │ │ ├── lv_test_init.h │ │ ├── test_cases │ │ │ ├── _test_template.c │ │ │ ├── test_arc.c │ │ │ ├── test_checkbox.c │ │ │ ├── test_config.c │ │ │ ├── test_dropdown.c │ │ │ ├── test_font_loader.c │ │ │ ├── test_obj_tree.c │ │ │ ├── test_style.c │ │ │ └── test_txt.c │ │ └── test_fonts │ │ │ ├── font_1.c │ │ │ ├── font_1.fnt │ │ │ ├── font_2.c │ │ │ ├── font_2.fnt │ │ │ ├── font_3.c │ │ │ └── font_3.fnt │ └── unity │ │ ├── generate_test_runner.rb │ │ ├── run_test.erb │ │ ├── type_sanitizer.rb │ │ ├── unity.c │ │ ├── unity.h │ │ ├── unity_internals.h │ │ ├── unity_support.c │ │ └── unity_support.h │ └── zephyr │ └── module.yml ├── platformio.ini ├── src ├── README.md ├── app │ ├── Accounts │ │ ├── ACT_Def.h │ │ ├── ACT_IMU.cpp │ │ ├── ACT_Motor.cpp │ │ ├── ACT_Music.cpp │ │ ├── ACT_SysConfig.cpp │ │ ├── Account_Master.cpp │ │ ├── Account_Master.h │ │ └── _ACT_LIST.inc │ ├── Configs │ │ ├── Config.h │ │ └── Version.h │ ├── Pages │ │ ├── AppFactory.cpp │ │ ├── AppFactory.h │ │ ├── HASS │ │ │ ├── Hass.cpp │ │ │ ├── Hass.h │ │ │ ├── HassModel.cpp │ │ │ ├── HassModel.h │ │ │ ├── HassView.cpp │ │ │ └── HassView.h │ │ ├── Menu │ │ │ ├── Menu.cpp │ │ │ ├── Menu.h │ │ │ ├── MenuModel.cpp │ │ │ ├── MenuModel.h │ │ │ ├── MenuView.cpp │ │ │ └── MenuView.h │ │ ├── Page.h │ │ ├── Playground │ │ │ ├── Playground.cpp │ │ │ ├── Playground.h │ │ │ ├── PlaygroundModel.cpp │ │ │ ├── PlaygroundModel.h │ │ │ ├── PlaygroundView.cpp │ │ │ └── PlaygroundView.h │ │ ├── Setting │ │ │ ├── Setting.cpp │ │ │ ├── Setting.h │ │ │ ├── SettingModel.cpp │ │ │ ├── SettingModel.h │ │ │ ├── SettingView.cpp │ │ │ └── SettingView.h │ │ ├── StartUp │ │ │ ├── StartUp.cpp │ │ │ ├── StartUp.h │ │ │ ├── StartUpModel.cpp │ │ │ ├── StartUpModel.h │ │ │ ├── StartUpView.cpp │ │ │ └── StartUpView.h │ │ ├── StatusBar │ │ │ ├── StatusBar.cpp │ │ │ └── StatusBar.h │ │ ├── SurfaceDial │ │ │ ├── SurfaceDial.cpp │ │ │ ├── SurfaceDial.h │ │ │ ├── SurfaceDialModel.cpp │ │ │ ├── SurfaceDialModel.h │ │ │ ├── SurfaceDialView.cpp │ │ │ └── SurfaceDialView.h │ │ ├── SystemInfos │ │ │ ├── SystemInfos.cpp │ │ │ ├── SystemInfos.h │ │ │ ├── SystemInfosModel.cpp │ │ │ ├── SystemInfosModel.h │ │ │ ├── SystemInfosView.cpp │ │ │ └── SystemInfosView.h │ │ └── _Template │ │ │ ├── Template.cpp │ │ │ ├── Template.h │ │ │ ├── TemplateModel.cpp │ │ │ ├── TemplateModel.h │ │ │ ├── TemplateView.cpp │ │ │ └── TemplateView.h │ ├── Resources │ │ ├── Font │ │ │ ├── font_agencyb_36.c │ │ │ ├── font_bahnschrift_13.c │ │ │ ├── font_bahnschrift_17.c │ │ │ ├── font_bahnschrift_32.c │ │ │ └── font_bahnschrift_65.c │ │ ├── Image │ │ │ ├── img_src_alarm.c │ │ │ ├── img_src_battery.c │ │ │ ├── img_src_battery_info.c │ │ │ ├── img_src_bicycle.c │ │ │ ├── img_src_bluetooth.c │ │ │ ├── img_src_circle_blue.c │ │ │ ├── img_src_compass.c │ │ │ ├── img_src_dialpad.c │ │ │ ├── img_src_dot_blue.c │ │ │ ├── img_src_emoji.c │ │ │ ├── img_src_gps_arrow_dark.c │ │ │ ├── img_src_gps_arrow_default.c │ │ │ ├── img_src_gps_arrow_light.c │ │ │ ├── img_src_gps_pin.c │ │ │ ├── img_src_gyroscope.c │ │ │ ├── img_src_home.c │ │ │ ├── img_src_home_air_cond.c │ │ │ ├── img_src_home_bulb.c │ │ │ ├── img_src_home_fan.c │ │ │ ├── img_src_home_wash_machine.c │ │ │ ├── img_src_joints.c │ │ │ ├── img_src_locate.c │ │ │ ├── img_src_map_location.c │ │ │ ├── img_src_menu.c │ │ │ ├── img_src_miku.c │ │ │ ├── img_src_origin_point.c │ │ │ ├── img_src_pause.c │ │ │ ├── img_src_pose6d.c │ │ │ ├── img_src_satellite.c │ │ │ ├── img_src_sd_card.c │ │ │ ├── img_src_setting.c │ │ │ ├── img_src_setting_brightness.c │ │ │ ├── img_src_setting_timer.c │ │ │ ├── img_src_setting_wifi.c │ │ │ ├── img_src_start.c │ │ │ ├── img_src_stop.c │ │ │ ├── img_src_storage.c │ │ │ ├── img_src_switches.c │ │ │ ├── img_src_system_info.c │ │ │ ├── img_src_time_info.c │ │ │ └── img_src_trip.c │ │ ├── ResourcePool.cpp │ │ └── ResourcePool.h │ ├── Utils │ │ ├── AccountSystem │ │ │ ├── Account.cpp │ │ │ ├── Account.h │ │ │ ├── AccountBroker.cpp │ │ │ ├── AccountBroker.h │ │ │ ├── AccountSystemLog.h │ │ │ └── PingPongBuffer │ │ │ │ ├── PingPongBuffer.c │ │ │ │ └── PingPongBuffer.h │ │ ├── PageManager │ │ │ ├── PM_Anim.cpp │ │ │ ├── PM_Base.cpp │ │ │ ├── PM_Drag.cpp │ │ │ ├── PM_Log.h │ │ │ ├── PM_Router.cpp │ │ │ ├── PM_State.cpp │ │ │ ├── PageBase.h │ │ │ ├── PageFactory.h │ │ │ ├── PageManager.h │ │ │ ├── ResourceManager.cpp │ │ │ └── ResourceManager.h │ │ ├── TonePlayer │ │ │ ├── MusicCode.h │ │ │ ├── ToneMap.h │ │ │ ├── TonePlayer.cpp │ │ │ └── TonePlayer.h │ │ └── lv_ext │ │ │ ├── lv_anim_timeline_wrapper.c │ │ │ ├── lv_anim_timeline_wrapper.h │ │ │ ├── lv_label_anim_effect.cpp │ │ │ ├── lv_label_anim_effect.h │ │ │ ├── lv_obj_ext_func.cpp │ │ │ └── lv_obj_ext_func.h │ ├── app.cpp │ ├── app.h │ └── bot │ │ ├── bot.cpp │ │ ├── bot.h │ │ ├── comm │ │ ├── espnow_comm.cpp │ │ ├── espnow_comm.h │ │ ├── serial_comm.cpp │ │ ├── serial_comm.h │ │ ├── simple_comm.h │ │ ├── udp_comm.cpp │ │ └── udp_comm.h │ │ ├── controller.cpp │ │ └── controller.h ├── config.h ├── hal │ ├── CommonMacro.h │ ├── HAL_Def.h │ ├── audio.cpp │ ├── buzz.cpp │ ├── encoder.cpp │ ├── hal.cpp │ ├── hal.h │ ├── imu.cpp │ ├── knob.cpp │ ├── lcd.cpp │ ├── led.cpp │ ├── motor.cpp │ ├── motor.h │ ├── mqtt.cpp │ ├── network.cpp │ ├── nvs.cpp │ ├── nvs.h │ ├── power.cpp │ ├── sd_card.cpp │ ├── sd_card.h │ ├── surface_dial.cpp │ ├── system.cpp │ ├── tuning.cpp │ └── tuning.h ├── main.cpp └── port │ ├── display.cpp │ ├── display.h │ └── lv_port │ ├── lv_port_disp.cpp │ ├── lv_port_fatfs.cpp │ └── lv_port_indev.cpp └── test ├── README └── lv_conf.h /.gitignore: -------------------------------------------------------------------------------- 1 | .pio 2 | .vscode 3 | src/secrets.h 4 | .DS_Store -------------------------------------------------------------------------------- /doc/问题记录.md: -------------------------------------------------------------------------------- 1 | ## 其他 2 | 3 | ### 开发过程的一些问题记录 4 | 5 | 1. Stack canary watchpoint triggered 通常是因为 FreeRTOS 的 task 栈设置得太小,适当增大 stack depth 即可解决。 6 | 7 | - [Why do I get the Debug exception reason: Stack canary watchpoint triggered (main)?](https://stackoverflow.com/questions/56779459/why-do-i-get-the-debug-exception-reason-stack-canary-watchpoint-triggered-main) 8 | 9 | ``` 10 | Guru Meditation Error: Core 1 panic'ed (Unhandled debug exception). 11 | Debug exception reason: Stack canary watchpoint triggered (BuzzerThread) 12 | ``` 13 | 14 | 2. esp32 debug,打印出错的栈信息 15 | 16 | ```bash 17 | export PATH=$PATH:~/.platformio/packages/toolchain-xtensa-esp32s3/bin 18 | xtensa-esp32s3-elf-addr2line.exe -pfiaC -e .pio/build/esp32-s3-devkitc-1/firmware.elf 0x42007e97 19 | ``` 20 | 21 | 3. MPU6050 Z 轴(YAW)零漂问题,最好每次都进行陀螺仪的静止校准`mpu.calcGyroOffsets(true);`,不然在控制指定角度转动时会不准(yaw 角会不断上涨/下降); 22 | 23 | ### 一些工具 24 | 25 | 1. [在线钢琴模拟器](https://www.xiwnn.com/piano/) -------------------------------------------------------------------------------- /lib/button/EventType.inc: -------------------------------------------------------------------------------- 1 | 2 | EVENT_DEF(EVENT_NONE), 3 | EVENT_DEF(EVENT_PRESSED), 4 | EVENT_DEF(EVENT_PRESSING), 5 | EVENT_DEF(EVENT_LONG_PRESSED), 6 | EVENT_DEF(EVENT_LONG_PRESSED_REPEAT), 7 | EVENT_DEF(EVENT_LONG_PRESSED_RELEASED), 8 | EVENT_DEF(EVENT_RELEASED), 9 | EVENT_DEF(EVENT_CHANGED), 10 | EVENT_DEF(EVENT_CLICKED), 11 | EVENT_DEF(EVENT_SHORT_CLICKED), 12 | EVENT_DEF(EVENT_DOUBLE_CLICKED), 13 | -------------------------------------------------------------------------------- /lib/lvgl/.codecov.yml: -------------------------------------------------------------------------------- 1 | codecov: 2 | notify: 3 | require_ci_to_pass: true 4 | comment: off 5 | coverage: 6 | status: 7 | patch: off 8 | project: off 9 | -------------------------------------------------------------------------------- /lib/lvgl/.editorconfig: -------------------------------------------------------------------------------- 1 | [*.{c,h,ino}] 2 | indent_style = space 3 | indent_size = 4 4 | end_of_line = lf 5 | insert_final_newline = true 6 | trim_trailing_whitespace = true 7 | -------------------------------------------------------------------------------- /lib/lvgl/.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | open_collective: lvgl 2 | -------------------------------------------------------------------------------- /lib/lvgl/.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: Documentation 4 | url: https://docs.lvgl.io 5 | about: Be sure to read to documentation first 6 | - name: Forum 7 | url: https://forum.lvgl.io 8 | about: For topics like How-to, Getting started, Feature request 9 | - name: CONTIBUTING.md 10 | url: https://github.com/lvgl/lvgl/blob/master/docs/CONTRIBUTING.md#faq-about-contributing 11 | about: The basic rules of contributing 12 | - name: CODING_STYLE.md 13 | url: https://github.com/lvgl/lvgl/blob/master/docs/CODING_STYLE.md 14 | about: Quick summary of LVGL's code style 15 | -------------------------------------------------------------------------------- /lib/lvgl/.github/ISSUE_TEMPLATE/dev-discussion.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Development discussion 3 | about: Discussion strictly related to the development of the LVGL. 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 15 | 16 | ### Introduce the problem 17 | 20 | 21 | ### Examples and cases 22 | 25 | 26 | ### Suggested solution 27 | 30 | -------------------------------------------------------------------------------- /lib/lvgl/.github/auto-comment.yml: -------------------------------------------------------------------------------- 1 | # Comment to a new issue. 2 | pullRequestOpened: | 3 | Thank you for raising your pull request. 4 | 5 | To ensure that all licensing criteria is met all repositories of the LVGL project apply a process called DCO (Developer's Certificate of Origin). 6 | 7 | The text of DCO can be read here: https://developercertificate.org/ 8 | For a more detailed description see the [Documentation](https://docs.lvgl.io/latest/en/html/contributing/index.html#developer-certification-of-origin-dco) site. 9 | 10 | By contributing to any repositories of the LVGL project you state that your contribution corresponds with the DCO. 11 | 12 | No further action is required if your contribution fulfills the DCO. If you are not sure about it feel free to ask us in a comment. 13 | -------------------------------------------------------------------------------- /lib/lvgl/.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | ### Description of the feature or fix 2 | 3 | A clear and concise description of what the bug or new feature is. 4 | 5 | ### Checkpoints 6 | - [ ] Follow the [styling guide](https://github.com/lvgl/lvgl/blob/master/docs/CODING_STYLE.md) 7 | - [ ] Update [CHANGELOG.md](https://github.com/lvgl/lvgl/blob/master/docs/CHANGELOG.md) 8 | - [ ] Update the documentation 9 | -------------------------------------------------------------------------------- /lib/lvgl/.github/workflows/check_conf.yml: -------------------------------------------------------------------------------- 1 | name: Verify that lv_conf_internal.h matches repository state 2 | on: 3 | push: 4 | pull_request: 5 | 6 | jobs: 7 | verify-conf-internal: 8 | runs-on: ubuntu-latest 9 | steps: 10 | - name: Checkout 11 | uses: actions/checkout@v2 12 | with: 13 | persist-credentials: false 14 | fetch-depth: 0 15 | - name: Setup Python 16 | uses: actions/setup-python@v1 17 | with: 18 | python-version: 3.7 19 | - name: Generate lv_conf_internal.h 20 | run: python lv_conf_internal_gen.py 21 | working-directory: scripts 22 | - name: Check that repository is clean 23 | run: git diff --exit-code >/dev/null 2>&1 || (echo "Please regenerate lv_conf_internal.h using scripts/lv_conf_internal_gen.py"; false) 24 | -------------------------------------------------------------------------------- /lib/lvgl/.github/workflows/close_old_issues.yml: -------------------------------------------------------------------------------- 1 | name: 'Close stale issues and PRs' 2 | on: 3 | schedule: 4 | - cron: '30 1 * * *' 5 | workflow_dispatch: 6 | 7 | jobs: 8 | stale: 9 | if: github.repository == 'lvgl/lvgl' 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: actions/stale@v3 13 | with: 14 | repo-token: ${{ secrets.LVGL_BOT_TOKEN }} 15 | stale-issue-message: 'This issue is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 7 days.' 16 | stale-pr-message: 'This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 7 days.' 17 | close-issue-message: 'This issue was closed because it has been stalled for 7 days with no activity.' 18 | days-before-stale: 14 19 | days-before-close: 7 20 | exempt-issue-labels: 'pinned' 21 | exempt-pr-labels: 'pinned' 22 | -------------------------------------------------------------------------------- /lib/lvgl/.github/workflows/esp_upload_component.yml: -------------------------------------------------------------------------------- 1 | name: Push LVGL release to Espressif Component Service 2 | 3 | # Upload on successful release 4 | on: 5 | release: 6 | types: 7 | - released 8 | 9 | jobs: 10 | upload_components: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - uses: actions/checkout@master 14 | - name: Upload component to component service 15 | uses: espressif/github-actions/upload_components@master 16 | with: 17 | name: "lvgl" 18 | namespace: "lvgl" 19 | api_token: ${{ secrets.ESP_IDF_COMPONENT_API_TOKEN }} 20 | -------------------------------------------------------------------------------- /lib/lvgl/.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | on: 2 | issues: 3 | types: [opened, edited] 4 | 5 | jobs: 6 | auto_close_issues: 7 | runs-on: ubuntu-latest 8 | steps: 9 | - name: Checkout 10 | uses: actions/checkout@v1 11 | - name: Automatically close issues that don't follow the issue template 12 | uses: lucasbento/auto-close-issues@v1.0.2 13 | with: 14 | github-token: ${{ secrets.GITHUB_TOKEN }} 15 | issue-close-message: "@${issue.user.login}: hello! :wave:\n\nThis issue is being automatically closed because it does not follow the issue template." # optional property 16 | closed-issues-label: "not-template" 17 | -------------------------------------------------------------------------------- /lib/lvgl/.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | on: 2 | push: 3 | # Sequence of patterns matched against refs/tags 4 | tags: 5 | - "v[0-9]+.[0-9]+.[0-9]+" # Push events to matching v*, i.e. v1.0, v20.15.10 6 | 7 | name: Create Release 8 | 9 | jobs: 10 | build: 11 | name: Create Release 12 | runs-on: ubuntu-latest 13 | steps: 14 | - name: Checkout code 15 | uses: actions/checkout@v2 16 | - name: Create Release 17 | id: create_release 18 | uses: actions/create-release@v1 19 | env: 20 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token 21 | with: 22 | tag_name: ${{ github.ref }} 23 | release_name: Release ${{ github.ref }} 24 | body: | 25 | See the [CHANGELOG](https://github.com/lvgl/lvgl/blob/master/docs/CHANGELOG.md) 26 | draft: false 27 | prerelease: false 28 | -------------------------------------------------------------------------------- /lib/lvgl/.gitignore: -------------------------------------------------------------------------------- 1 | **/*.o 2 | **/*bin 3 | **/*.swp 4 | **/*.swo 5 | **/*.gcda 6 | **/*.gcno 7 | tags 8 | docs/api_doc 9 | scripts/cppcheck_res.txt 10 | scripts/built_in_font/lv_font_* 11 | docs/doxygen_html 12 | docs/xml 13 | docs/examples.md 14 | docs/out_latex 15 | docs/_static/built_lv_examples 16 | docs/LVGL.pdf 17 | docs/env 18 | out_html 19 | __pycache__ 20 | /emscripten_builder 21 | test_screenshot_error.h 22 | build/ 23 | tests/build_*/ 24 | tests/report/ 25 | -------------------------------------------------------------------------------- /lib/lvgl/.piopm: -------------------------------------------------------------------------------- 1 | {"type": "library", "name": "lvgl", "version": "8.1.0", "spec": {"owner": "lvgl", "id": 6598, "name": "lvgl", "requirements": null, "uri": null}} -------------------------------------------------------------------------------- /lib/lvgl/LICENCE.txt: -------------------------------------------------------------------------------- 1 | MIT licence 2 | Copyright (c) 2021 LVGL Kft 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 5 | 6 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 7 | 8 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 9 | -------------------------------------------------------------------------------- /lib/lvgl/SConscript: -------------------------------------------------------------------------------- 1 | # RT-Thread building script for bridge 2 | 3 | import os 4 | from building import * 5 | 6 | objs = [] 7 | cwd = GetCurrentDir() 8 | 9 | objs = objs + SConscript(cwd + '/rt-thread/SConscript') 10 | 11 | Return('objs') 12 | -------------------------------------------------------------------------------- /lib/lvgl/examples/anim/index.rst: -------------------------------------------------------------------------------- 1 | 2 | Start animation on an event 3 | """""""""""""""""""""""""""" 4 | 5 | .. lv_example:: anim/lv_example_anim_1 6 | :language: c 7 | 8 | Playback animation 9 | """"""""""""""""""" 10 | .. lv_example:: anim/lv_example_anim_2 11 | :language: c 12 | 13 | Animation timeline 14 | """"""""""""""""""" 15 | .. lv_example:: anim/lv_example_anim_timeline_1 16 | :language: c 17 | 18 | -------------------------------------------------------------------------------- /lib/lvgl/examples/anim/lv_example_anim.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_example_anim.h 3 | * 4 | */ 5 | 6 | #ifndef LV_EXAMPLE_ANIM_H 7 | #define LV_EXAMPLE_ANIM_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | 17 | /********************* 18 | * DEFINES 19 | *********************/ 20 | 21 | /********************** 22 | * TYPEDEFS 23 | **********************/ 24 | 25 | /********************** 26 | * GLOBAL PROTOTYPES 27 | **********************/ 28 | void lv_example_anim_1(void); 29 | void lv_example_anim_2(void); 30 | void lv_example_anim_3(void); 31 | void lv_example_anim_timeline_1(void); 32 | 33 | /********************** 34 | * MACROS 35 | **********************/ 36 | 37 | #ifdef __cplusplus 38 | } /*extern "C"*/ 39 | #endif 40 | 41 | #endif /*LV_EXAMPLE_ANIM_H*/ 42 | -------------------------------------------------------------------------------- /lib/lvgl/examples/anim/lv_example_anim_2.py: -------------------------------------------------------------------------------- 1 | def anim_x_cb(obj, v): 2 | obj.set_x(v) 3 | 4 | def anim_size_cb(obj, v): 5 | obj.set_size(v, v) 6 | 7 | 8 | # 9 | # Create a playback animation 10 | # 11 | obj = lv.obj(lv.scr_act()) 12 | obj.set_style_bg_color(lv.palette_main(lv.PALETTE.RED), 0) 13 | obj.set_style_radius(lv.RADIUS.CIRCLE, 0) 14 | 15 | obj.align(lv.ALIGN.LEFT_MID, 10, 0) 16 | 17 | a1 = lv.anim_t() 18 | a1.init() 19 | a1.set_var(obj) 20 | a1.set_values(10, 50) 21 | a1.set_time(1000) 22 | a1.set_playback_delay(100) 23 | a1.set_playback_time(300) 24 | a1.set_repeat_delay(500) 25 | a1.set_repeat_count(lv.ANIM_REPEAT.INFINITE) 26 | a1.set_path_cb(lv.anim_t.path_ease_in_out) 27 | a1.set_custom_exec_cb(lambda a1,val: anim_size_cb(obj,val)) 28 | lv.anim_t.start(a1) 29 | 30 | a2 = lv.anim_t() 31 | a2.init() 32 | a2.set_var(obj) 33 | a2.set_values(10, 240) 34 | a2.set_time(1000) 35 | a2.set_playback_delay(100) 36 | a2.set_playback_time(300) 37 | a2.set_repeat_delay(500) 38 | a2.set_repeat_count(lv.ANIM_REPEAT.INFINITE) 39 | a2.set_path_cb(lv.anim_t.path_ease_in_out) 40 | a2.set_custom_exec_cb(lambda a1,val: anim_x_cb(obj,val)) 41 | lv.anim_t.start(a2) 42 | -------------------------------------------------------------------------------- /lib/lvgl/examples/assets/font/lv_font_simsun_16_cjk.fnt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmallPond/D-BOT/98ec7958c368b6205f710f60df76f6b4479b677d/lib/lvgl/examples/assets/font/lv_font_simsun_16_cjk.fnt -------------------------------------------------------------------------------- /lib/lvgl/examples/assets/font/montserrat-16.fnt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmallPond/D-BOT/98ec7958c368b6205f710f60df76f6b4479b677d/lib/lvgl/examples/assets/font/montserrat-16.fnt -------------------------------------------------------------------------------- /lib/lvgl/examples/assets/font/montserrat-22.fnt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmallPond/D-BOT/98ec7958c368b6205f710f60df76f6b4479b677d/lib/lvgl/examples/assets/font/montserrat-22.fnt -------------------------------------------------------------------------------- /lib/lvgl/examples/assets/img_skew_strip_80x20_argb8888.fnt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmallPond/D-BOT/98ec7958c368b6205f710f60df76f6b4479b677d/lib/lvgl/examples/assets/img_skew_strip_80x20_argb8888.fnt -------------------------------------------------------------------------------- /lib/lvgl/examples/event/index.rst: -------------------------------------------------------------------------------- 1 | 2 | Button click event 3 | """"""""""""""""""" 4 | 5 | .. lv_example:: event/lv_example_event_1 6 | :language: c 7 | 8 | Handle multiple events 9 | """""""""""""""""""""""" 10 | .. lv_example:: event/lv_example_event_2 11 | :language: c 12 | 13 | 14 | Event bubbling 15 | """""""""""""""""""""""" 16 | .. lv_example:: event/lv_example_event_3 17 | :language: c 18 | 19 | 20 | -------------------------------------------------------------------------------- /lib/lvgl/examples/event/lv_example_event.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_example_event.h 3 | * 4 | */ 5 | 6 | #ifndef LV_EXAMPLE_EVENT_H 7 | #define LV_EXAMPLE_EVENT_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | 17 | /********************* 18 | * DEFINES 19 | *********************/ 20 | 21 | /********************** 22 | * TYPEDEFS 23 | **********************/ 24 | 25 | /********************** 26 | * GLOBAL PROTOTYPES 27 | **********************/ 28 | void lv_example_event_1(void); 29 | void lv_example_event_2(void); 30 | void lv_example_event_3(void); 31 | 32 | /********************** 33 | * MACROS 34 | **********************/ 35 | 36 | #ifdef __cplusplus 37 | } /*extern "C"*/ 38 | #endif 39 | 40 | #endif /*LV_EXAMPLE_EVENT_H*/ 41 | -------------------------------------------------------------------------------- /lib/lvgl/examples/event/lv_example_event_1.c: -------------------------------------------------------------------------------- 1 | #include "../lv_examples.h" 2 | #if LV_BUILD_EXAMPLES && LV_USE_SWITCH 3 | 4 | static void event_cb(lv_event_t * e) 5 | { 6 | LV_LOG_USER("Clicked"); 7 | 8 | static unsigned int cnt = 1; 9 | lv_obj_t * btn = lv_event_get_target(e); 10 | lv_obj_t * label = lv_obj_get_child(btn, 0); 11 | lv_label_set_text_fmt(label, "%u", cnt); 12 | cnt++; 13 | } 14 | 15 | /** 16 | * Add click event to a button 17 | */ 18 | void lv_example_event_1(void) 19 | { 20 | lv_obj_t * btn = lv_btn_create(lv_scr_act()); 21 | lv_obj_set_size(btn, 100, 50); 22 | lv_obj_center(btn); 23 | lv_obj_add_event_cb(btn, event_cb, LV_EVENT_CLICKED, NULL); 24 | 25 | lv_obj_t * label = lv_label_create(btn); 26 | lv_label_set_text(label, "Click me!"); 27 | lv_obj_center(label); 28 | } 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /lib/lvgl/examples/event/lv_example_event_1.py: -------------------------------------------------------------------------------- 1 | class Event_1(): 2 | def __init__(self): 3 | self.cnt = 1 4 | # 5 | # Add click event to a button 6 | # 7 | 8 | btn = lv.btn(lv.scr_act()) 9 | btn.set_size(100, 50) 10 | btn.center() 11 | btn.add_event_cb(self.event_cb, lv.EVENT.CLICKED, None) 12 | 13 | label = lv.label(btn) 14 | label.set_text("Click me!"); 15 | label.center() 16 | 17 | def event_cb(self,e): 18 | print("Clicked"); 19 | 20 | btn = e.get_target() 21 | label = btn.get_child(0) 22 | label.set_text(str(self.cnt)) 23 | self.cnt += 1 24 | 25 | evt1 = Event_1() 26 | -------------------------------------------------------------------------------- /lib/lvgl/examples/event/lv_example_event_2.py: -------------------------------------------------------------------------------- 1 | def event_cb(e,label): 2 | code = e.get_code() 3 | if code == lv.EVENT.PRESSED: 4 | label.set_text("The last button event:\nLV_EVENT_PRESSED") 5 | elif code == lv.EVENT.CLICKED: 6 | label.set_text("The last button event:\nLV_EVENT_CLICKED") 7 | elif code == lv.EVENT.LONG_PRESSED: 8 | label.set_text("The last button event:\nLV_EVENT_LONG_PRESSED") 9 | elif code == lv.EVENT.LONG_PRESSED_REPEAT: 10 | label.set_text("The last button event:\nLV_EVENT_LONG_PRESSED_REPEAT") 11 | btn = lv.btn(lv.scr_act()) 12 | btn.set_size(100, 50) 13 | btn.center() 14 | 15 | btn_label = lv.label(btn) 16 | btn_label.set_text("Click me!") 17 | btn_label.center() 18 | 19 | info_label = lv.label(lv.scr_act()) 20 | info_label.set_text("The last button event:\nNone"); 21 | 22 | btn.add_event_cb(lambda e: event_cb(e,info_label), lv.EVENT.ALL, None) 23 | -------------------------------------------------------------------------------- /lib/lvgl/examples/event/lv_example_event_3.py: -------------------------------------------------------------------------------- 1 | def event_cb(e): 2 | 3 | # The original target of the event. Can be the buttons or the container 4 | target = e.get_target() 5 | # print(type(target)) 6 | 7 | # If container was clicked do nothing 8 | if type(target) != type(lv.btn()): 9 | return 10 | 11 | # Make the clicked buttons red 12 | target.set_style_bg_color(lv.palette_main(lv.PALETTE.RED), 0) 13 | 14 | # 15 | # Demonstrate event bubbling 16 | # 17 | 18 | cont = lv.obj(lv.scr_act()) 19 | cont.set_size(320, 200) 20 | cont.center() 21 | cont.set_flex_flow(lv.FLEX_FLOW.ROW_WRAP) 22 | 23 | for i in range(30): 24 | btn = lv.btn(cont) 25 | btn.set_size(80, 50) 26 | btn.add_flag(lv.obj.FLAG.EVENT_BUBBLE) 27 | 28 | label = lv.label(btn) 29 | label.set_text(str(i)) 30 | label.center() 31 | cont.add_event_cb(event_cb, lv.EVENT.CLICKED, None) 32 | -------------------------------------------------------------------------------- /lib/lvgl/examples/examples.mk: -------------------------------------------------------------------------------- 1 | CSRCS += $(shell find -L $(LVGL_DIR)/$(LVGL_DIR_NAME)/examples -name \*.c) 2 | -------------------------------------------------------------------------------- /lib/lvgl/examples/get_started/index.rst: -------------------------------------------------------------------------------- 1 | 2 | A button with a label and react on click event 3 | """"""""""""""""""""""""""""""""""""""""""""""""" 4 | 5 | .. lv_example:: get_started/lv_example_get_started_1 6 | :language: c 7 | 8 | Create styles from scratch for buttons 9 | """"""""""""""""""""""""""""""""""""""" 10 | .. lv_example:: get_started/lv_example_get_started_2 11 | :language: c 12 | 13 | Create a slider and write its value on a label 14 | """"""""""""""""""""""""""""""""""""""""""""""" 15 | .. lv_example:: get_started/lv_example_get_started_3 16 | :language: c 17 | 18 | 19 | -------------------------------------------------------------------------------- /lib/lvgl/examples/get_started/lv_example_get_started.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_example_get_started.h 3 | * 4 | */ 5 | 6 | #ifndef LV_EX_GET_STARTED_H 7 | #define LV_EX_GET_STARTED_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | 17 | /********************* 18 | * DEFINES 19 | *********************/ 20 | 21 | /********************** 22 | * TYPEDEFS 23 | **********************/ 24 | 25 | /********************** 26 | * GLOBAL PROTOTYPES 27 | **********************/ 28 | void lv_example_get_started_1(void); 29 | void lv_example_get_started_2(void); 30 | void lv_example_get_started_3(void); 31 | 32 | /********************** 33 | * MACROS 34 | **********************/ 35 | 36 | #ifdef __cplusplus 37 | } /*extern "C"*/ 38 | #endif 39 | 40 | #endif /*LV_EX_GET_STARTED_H*/ 41 | -------------------------------------------------------------------------------- /lib/lvgl/examples/get_started/lv_example_get_started_3.py: -------------------------------------------------------------------------------- 1 | def slider_event_cb(evt): 2 | slider = evt.get_target() 3 | 4 | # Refresh the text 5 | label.set_text(str(slider.get_value())) 6 | 7 | # 8 | # Create a slider and write its value on a label. 9 | # 10 | 11 | # Create a slider in the center of the display 12 | slider = lv.slider(lv.scr_act()) 13 | slider.set_width(200) # Set the width 14 | slider.center() # Align to the center of the parent (screen) 15 | slider.add_event_cb(slider_event_cb, lv.EVENT.VALUE_CHANGED, None) # Assign an event function 16 | 17 | # Create a label below the slider 18 | label = lv.label(lv.scr_act()); 19 | label.set_text("0") 20 | label.align_to(slider, lv.ALIGN.OUT_TOP_MID, 0, -15) # Align below the slider 21 | 22 | 23 | -------------------------------------------------------------------------------- /lib/lvgl/examples/header.py: -------------------------------------------------------------------------------- 1 | #!/opt/bin/lv_micropython -i 2 | 3 | import lvgl as lv 4 | 5 | import display_driver 6 | -------------------------------------------------------------------------------- /lib/lvgl/examples/layouts/flex/index.rst: -------------------------------------------------------------------------------- 1 | A simple row and a column layout with flexbox 2 | """"""""""""""""""""""""""""""""""""""""""""""" 3 | 4 | .. lv_example:: layouts/flex/lv_example_flex_1 5 | :language: c 6 | 7 | Arrange items in rows with wrap and even spacing 8 | """"""""""""""""""""""""""""""""""""""""""""""""" 9 | 10 | .. lv_example:: layouts/flex/lv_example_flex_2 11 | :language: c 12 | 13 | Demonstrate flex grow 14 | """"""""""""""""""""""" 15 | 16 | .. lv_example:: layouts/flex/lv_example_flex_3 17 | :language: c 18 | 19 | Demonstrate flex grow. 20 | """"""""""""""""""""""" 21 | 22 | .. lv_example:: layouts/flex/lv_example_flex_4 23 | :language: c 24 | 25 | Demonstrate column and row gap style properties 26 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 27 | 28 | .. lv_example:: layouts/flex/lv_example_flex_5 29 | :language: c 30 | 31 | RTL base direction changes order of the items 32 | """"""""""""""""""""""""""""""""""""""""""""""" 33 | 34 | .. lv_example:: layouts/flex/lv_example_flex_6 35 | :language: c 36 | 37 | 38 | -------------------------------------------------------------------------------- /lib/lvgl/examples/layouts/flex/lv_example_flex.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_example_flex.h 3 | * 4 | */ 5 | 6 | #ifndef LV_EXAMPLE_FLEX_H 7 | #define LV_EXAMPLE_FLEX_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | 17 | /********************* 18 | * DEFINES 19 | *********************/ 20 | 21 | /********************** 22 | * TYPEDEFS 23 | **********************/ 24 | 25 | /********************** 26 | * GLOBAL PROTOTYPES 27 | **********************/ 28 | void lv_example_flex_1(void); 29 | void lv_example_flex_2(void); 30 | void lv_example_flex_3(void); 31 | void lv_example_flex_4(void); 32 | void lv_example_flex_5(void); 33 | void lv_example_flex_6(void); 34 | 35 | /********************** 36 | * MACROS 37 | **********************/ 38 | 39 | #ifdef __cplusplus 40 | } /*extern "C"*/ 41 | #endif 42 | 43 | #endif /*LV_EXAMPLE_FLEX_H*/ 44 | -------------------------------------------------------------------------------- /lib/lvgl/examples/layouts/flex/lv_example_flex_1.py: -------------------------------------------------------------------------------- 1 | # 2 | # A simple row and a column layout with flexbox 3 | # 4 | 5 | # Create a container with ROW flex direction 6 | cont_row = lv.obj(lv.scr_act()) 7 | cont_row.set_size(300, 75) 8 | cont_row.align(lv.ALIGN.TOP_MID, 0, 5) 9 | cont_row.set_flex_flow(lv.FLEX_FLOW.ROW) 10 | 11 | # Create a container with COLUMN flex direction 12 | cont_col = lv.obj(lv.scr_act()) 13 | cont_col.set_size(200, 150) 14 | cont_col.align_to(cont_row, lv.ALIGN.OUT_BOTTOM_MID, 0, 5) 15 | cont_col.set_flex_flow(lv.FLEX_FLOW.COLUMN) 16 | 17 | for i in range(10): 18 | # Add items to the row 19 | obj = lv.btn(cont_row) 20 | obj.set_size(100, lv.pct(100)) 21 | 22 | label = lv.label(obj) 23 | label.set_text("Item: {:d}".format(i)) 24 | label.center() 25 | 26 | # Add items to the column 27 | obj = lv.btn(cont_col) 28 | obj.set_size(lv.pct(100), lv.SIZE.CONTENT) 29 | 30 | label = lv.label(obj) 31 | label.set_text("Item: {:d}".format(i)) 32 | label.center() 33 | 34 | -------------------------------------------------------------------------------- /lib/lvgl/examples/layouts/flex/lv_example_flex_2.c: -------------------------------------------------------------------------------- 1 | #include "../../lv_examples.h" 2 | #if LV_USE_FLEX && LV_BUILD_EXAMPLES 3 | 4 | /** 5 | * Arrange items in rows with wrap and place the items to get even space around them. 6 | */ 7 | void lv_example_flex_2(void) 8 | { 9 | static lv_style_t style; 10 | lv_style_init(&style); 11 | lv_style_set_flex_flow(&style, LV_FLEX_FLOW_ROW_WRAP); 12 | lv_style_set_flex_main_place(&style, LV_FLEX_ALIGN_SPACE_EVENLY); 13 | lv_style_set_layout(&style, LV_LAYOUT_FLEX); 14 | 15 | lv_obj_t * cont = lv_obj_create(lv_scr_act()); 16 | lv_obj_set_size(cont, 300, 220); 17 | lv_obj_center(cont); 18 | lv_obj_add_style(cont, &style, 0); 19 | 20 | unsigned int i; 21 | for(i = 0; i < 8; i++) { 22 | lv_obj_t * obj = lv_obj_create(cont); 23 | lv_obj_set_size(obj, 70, LV_SIZE_CONTENT); 24 | 25 | lv_obj_t * label = lv_label_create(obj); 26 | lv_label_set_text_fmt(label, "%u", i); 27 | lv_obj_center(label); 28 | } 29 | } 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /lib/lvgl/examples/layouts/flex/lv_example_flex_2.py: -------------------------------------------------------------------------------- 1 | # 2 | # Arrange items in rows with wrap and place the items to get even space around them. 3 | # 4 | style = lv.style_t() 5 | style.init() 6 | style.set_flex_flow(lv.FLEX_FLOW.ROW_WRAP) 7 | style.set_flex_main_place(lv.FLEX_ALIGN.SPACE_EVENLY) 8 | style.set_layout(lv.LAYOUT_FLEX.value) 9 | 10 | cont = lv.obj(lv.scr_act()) 11 | cont.set_size(300, 220) 12 | cont.center() 13 | cont.add_style(style, 0) 14 | 15 | for i in range(8): 16 | obj = lv.obj(cont) 17 | obj.set_size(70, lv.SIZE.CONTENT) 18 | 19 | label = lv.label(obj) 20 | label.set_text("{:d}".format(i)) 21 | label.center() 22 | 23 | -------------------------------------------------------------------------------- /lib/lvgl/examples/layouts/flex/lv_example_flex_3.c: -------------------------------------------------------------------------------- 1 | #include "../../lv_examples.h" 2 | #if LV_USE_FLEX && LV_BUILD_EXAMPLES 3 | 4 | /** 5 | * Demonstrate flex grow. 6 | */ 7 | void lv_example_flex_3(void) 8 | { 9 | lv_obj_t * cont = lv_obj_create(lv_scr_act()); 10 | lv_obj_set_size(cont, 300, 220); 11 | lv_obj_center(cont); 12 | lv_obj_set_flex_flow(cont, LV_FLEX_FLOW_ROW); 13 | 14 | lv_obj_t * obj; 15 | obj = lv_obj_create(cont); 16 | lv_obj_set_size(obj, 40, 40); /*Fix size*/ 17 | 18 | obj = lv_obj_create(cont); 19 | lv_obj_set_height(obj, 40); 20 | lv_obj_set_flex_grow(obj, 1); /*1 portion from the free space*/ 21 | 22 | obj = lv_obj_create(cont); 23 | lv_obj_set_height(obj, 40); 24 | lv_obj_set_flex_grow(obj, 2); /*2 portion from the free space*/ 25 | 26 | obj = lv_obj_create(cont); 27 | lv_obj_set_size(obj, 40, 40); /*Fix size. It is flushed to the right by the "grow" items*/ 28 | } 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /lib/lvgl/examples/layouts/flex/lv_example_flex_3.py: -------------------------------------------------------------------------------- 1 | # 2 | # Demonstrate flex grow. 3 | # 4 | 5 | cont = lv.obj(lv.scr_act()) 6 | cont.set_size(300, 220) 7 | cont.center() 8 | cont.set_flex_flow(lv.FLEX_FLOW.ROW) 9 | 10 | obj = lv.obj(cont) 11 | obj.set_size(40, 40) # Fix size 12 | 13 | obj = lv.obj(cont) 14 | obj.set_height(40) 15 | obj.set_flex_grow(1) # 1 portion from the free space 16 | 17 | obj = lv.obj(cont) 18 | obj.set_height(40) 19 | obj.set_flex_grow(2) # 2 portion from the free space 20 | 21 | obj = lv.obj(cont) 22 | obj.set_size(40, 40) # Fix size. It is flushed to the right by the "grow" items 23 | 24 | -------------------------------------------------------------------------------- /lib/lvgl/examples/layouts/flex/lv_example_flex_4.c: -------------------------------------------------------------------------------- 1 | #include "../../lv_examples.h" 2 | #if LV_USE_FLEX && LV_BUILD_EXAMPLES 3 | 4 | /** 5 | * Reverse the order of flex items 6 | */ 7 | void lv_example_flex_4(void) 8 | { 9 | 10 | lv_obj_t * cont = lv_obj_create(lv_scr_act()); 11 | lv_obj_set_size(cont, 300, 220); 12 | lv_obj_center(cont); 13 | lv_obj_set_flex_flow(cont, LV_FLEX_FLOW_COLUMN_REVERSE); 14 | 15 | unsigned int i; 16 | for(i = 0; i < 6; i++) { 17 | lv_obj_t * obj = lv_obj_create(cont); 18 | lv_obj_set_size(obj, 100, 50); 19 | 20 | lv_obj_t * label = lv_label_create(obj); 21 | lv_label_set_text_fmt(label, "Item: %u", i); 22 | lv_obj_center(label); 23 | } 24 | } 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /lib/lvgl/examples/layouts/flex/lv_example_flex_4.py: -------------------------------------------------------------------------------- 1 | # 2 | # Reverse the order of flex items 3 | # 4 | cont = lv.obj(lv.scr_act()) 5 | cont.set_size(300, 220) 6 | cont.center() 7 | cont.set_flex_flow(lv.FLEX_FLOW.COLUMN_REVERSE) 8 | 9 | for i in range(6): 10 | obj = lv.obj(cont) 11 | obj.set_size(100, 50) 12 | 13 | label = lv.label(obj) 14 | label.set_text("Item: " + str(i)) 15 | label.center() 16 | 17 | -------------------------------------------------------------------------------- /lib/lvgl/examples/layouts/flex/lv_example_flex_6.c: -------------------------------------------------------------------------------- 1 | #include "../../lv_examples.h" 2 | #if LV_USE_FLEX && LV_BUILD_EXAMPLES 3 | 4 | /** 5 | * RTL base direction changes order of the items. 6 | * Also demonstrate how horizontal scrolling works with RTL. 7 | */ 8 | void lv_example_flex_6(void) 9 | { 10 | lv_obj_t * cont = lv_obj_create(lv_scr_act()); 11 | lv_obj_set_style_base_dir(cont, LV_BASE_DIR_RTL, 0); 12 | lv_obj_set_size(cont, 300, 220); 13 | lv_obj_center(cont); 14 | lv_obj_set_flex_flow(cont, LV_FLEX_FLOW_ROW_WRAP); 15 | 16 | unsigned int i; 17 | for(i = 0; i < 20; i++) { 18 | lv_obj_t * obj = lv_obj_create(cont); 19 | lv_obj_set_size(obj, 70, LV_SIZE_CONTENT); 20 | 21 | lv_obj_t * label = lv_label_create(obj); 22 | lv_label_set_text_fmt(label, "%u", i); 23 | lv_obj_center(label); 24 | } 25 | } 26 | #endif 27 | -------------------------------------------------------------------------------- /lib/lvgl/examples/layouts/flex/lv_example_flex_6.py: -------------------------------------------------------------------------------- 1 | # 2 | # RTL base direction changes order of the items. 3 | # Also demonstrate how horizontal scrolling works with RTL. 4 | # 5 | 6 | cont = lv.obj(lv.scr_act()) 7 | cont.set_style_base_dir(lv.BASE_DIR.RTL,0) 8 | cont.set_size(300, 220) 9 | cont.center() 10 | cont.set_flex_flow(lv.FLEX_FLOW.ROW_WRAP) 11 | 12 | for i in range(20): 13 | obj = lv.obj(cont) 14 | obj.set_size(70, lv.SIZE.CONTENT) 15 | 16 | label = lv.label(obj) 17 | label.set_text(str(i)) 18 | label.center() 19 | 20 | -------------------------------------------------------------------------------- /lib/lvgl/examples/layouts/grid/index.rst: -------------------------------------------------------------------------------- 1 | A simple grid 2 | """"""""""""""" 3 | 4 | .. lv_example:: layouts/grid/lv_example_grid_1 5 | :language: c 6 | 7 | Demonstrate cell placement and span 8 | """"""""""""""""""""""""""""""""""""""""""""""""" 9 | 10 | .. lv_example:: layouts/grid/lv_example_grid_2 11 | :language: c 12 | 13 | Demonstrate grid's "free unit" 14 | """""""""""""""""""""""""""""" 15 | 16 | .. lv_example:: layouts/grid/lv_example_grid_3 17 | :language: c 18 | 19 | Demonstrate track placement 20 | """"""""""""""""""""""""""" 21 | 22 | .. lv_example:: layouts/grid/lv_example_grid_4 23 | :language: c 24 | 25 | Demonstrate column and row gap 26 | """""""""""""""""""""""""""""" 27 | 28 | .. lv_example:: layouts/grid/lv_example_grid_5 29 | :language: c 30 | 31 | Demonstrate RTL direction on grid 32 | """""""""""""""""""""""""""""""""" 33 | 34 | .. lv_example:: layouts/grid/lv_example_grid_6 35 | :language: c 36 | 37 | 38 | -------------------------------------------------------------------------------- /lib/lvgl/examples/layouts/grid/lv_example_grid.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_example_grid.h 3 | * 4 | */ 5 | 6 | #ifndef LV_EXAMPLE_GRID_H 7 | #define LV_EXAMPLE_GRID_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | 17 | /********************* 18 | * DEFINES 19 | *********************/ 20 | 21 | /********************** 22 | * TYPEDEFS 23 | **********************/ 24 | 25 | /********************** 26 | * GLOBAL PROTOTYPES 27 | **********************/ 28 | void lv_example_grid_1(void); 29 | void lv_example_grid_2(void); 30 | void lv_example_grid_3(void); 31 | void lv_example_grid_4(void); 32 | void lv_example_grid_5(void); 33 | void lv_example_grid_6(void); 34 | 35 | /********************** 36 | * MACROS 37 | **********************/ 38 | 39 | #ifdef __cplusplus 40 | } /*extern "C"*/ 41 | #endif 42 | 43 | #endif /*LV_EXAMPLE_GRID_H*/ 44 | -------------------------------------------------------------------------------- /lib/lvgl/examples/layouts/grid/lv_example_grid_1.py: -------------------------------------------------------------------------------- 1 | # 2 | # A simple grid 3 | # 4 | 5 | col_dsc = [70, 70, 70, lv.GRID_TEMPLATE.LAST] 6 | row_dsc = [50, 50, 50, lv.GRID_TEMPLATE.LAST] 7 | 8 | # Create a container with grid 9 | cont = lv.obj(lv.scr_act()) 10 | cont.set_style_grid_column_dsc_array(col_dsc, 0) 11 | cont.set_style_grid_row_dsc_array(row_dsc, 0) 12 | cont.set_size(300, 220) 13 | cont.center() 14 | cont.set_layout(lv.LAYOUT_GRID.value) 15 | 16 | for i in range(9): 17 | col = i % 3 18 | row = i // 3 19 | 20 | obj = lv.btn(cont) 21 | # Stretch the cell horizontally and vertically too 22 | # Set span to 1 to make the cell 1 column/row sized 23 | obj.set_grid_cell(lv.GRID_ALIGN.STRETCH, col, 1, 24 | lv.GRID_ALIGN.STRETCH, row, 1) 25 | 26 | label = lv.label(obj) 27 | label.set_text("c" +str(col) + "r" +str(row)) 28 | label.center() 29 | 30 | -------------------------------------------------------------------------------- /lib/lvgl/examples/layouts/grid/lv_example_grid_3.py: -------------------------------------------------------------------------------- 1 | # 2 | # Demonstrate grid's "free unit" 3 | # 4 | 5 | # Column 1: fix width 60 px 6 | # Column 2: 1 unit from the remaining free space 7 | # Column 3: 2 unit from the remaining free space 8 | 9 | col_dsc = [60, lv.grid_fr(1), lv.grid_fr(2), lv.GRID_TEMPLATE.LAST] 10 | 11 | # Row 1: fix width 60 px 12 | # Row 2: 1 unit from the remaining free space 13 | # Row 3: fix width 60 px 14 | 15 | row_dsc = [40, lv.grid_fr(1), 40, lv.GRID_TEMPLATE.LAST] 16 | 17 | # Create a container with grid 18 | cont = lv.obj(lv.scr_act()) 19 | cont.set_size(300, 220) 20 | cont.center() 21 | cont.set_grid_dsc_array(col_dsc, row_dsc) 22 | 23 | for i in range(9): 24 | col = i % 3 25 | row = i // 3 26 | 27 | obj = lv.obj(cont) 28 | # Stretch the cell horizontally and vertically too 29 | # Set span to 1 to make the cell 1 column/row sized 30 | obj.set_grid_cell(lv.GRID_ALIGN.STRETCH, col, 1, 31 | lv.GRID_ALIGN.STRETCH, row, 1) 32 | 33 | label = lv.label(obj) 34 | label.set_text("%d,%d"%(col, row)) 35 | label.center() 36 | 37 | -------------------------------------------------------------------------------- /lib/lvgl/examples/layouts/grid/lv_example_grid_4.py: -------------------------------------------------------------------------------- 1 | # 2 | # Demonstrate track placement 3 | # 4 | 5 | col_dsc = [60, 60, 60, lv.GRID_TEMPLATE.LAST] 6 | row_dsc = [40, 40, 40, lv.GRID_TEMPLATE.LAST] 7 | 8 | 9 | # Add space between the columns and move the rows to the bottom (end) 10 | 11 | # Create a container with grid 12 | cont = lv.obj(lv.scr_act()) 13 | cont.set_grid_align(lv.GRID_ALIGN.SPACE_BETWEEN, lv.GRID_ALIGN.END) 14 | cont.set_grid_dsc_array(col_dsc, row_dsc) 15 | cont.set_size(300, 220) 16 | cont.center() 17 | 18 | 19 | for i in range(9): 20 | col = i % 3 21 | row = i // 3 22 | 23 | obj = lv.obj(cont) 24 | # Stretch the cell horizontally and vertically too 25 | # Set span to 1 to make the cell 1 column/row sized 26 | obj.set_grid_cell(lv.GRID_ALIGN.STRETCH, col, 1, 27 | lv.GRID_ALIGN.STRETCH, row, 1) 28 | 29 | label = lv.label(obj) 30 | label.set_text("{:d}{:d}".format(col, row)) 31 | label.center() 32 | 33 | -------------------------------------------------------------------------------- /lib/lvgl/examples/layouts/grid/lv_example_grid_6.py: -------------------------------------------------------------------------------- 1 | # 2 | # Demonstrate RTL direction on grid 3 | # 4 | col_dsc = [60, 60, 60, lv.GRID_TEMPLATE.LAST] 5 | row_dsc = [40, 40, 40, lv.GRID_TEMPLATE.LAST] 6 | 7 | # Create a container with grid 8 | cont = lv.obj(lv.scr_act()) 9 | cont.set_size(300, 220) 10 | cont.center() 11 | cont.set_style_base_dir(lv.BASE_DIR.RTL,0) 12 | cont.set_grid_dsc_array(col_dsc, row_dsc) 13 | 14 | for i in range(9): 15 | col = i % 3 16 | row = i // 3 17 | 18 | obj = lv.obj(cont) 19 | # Stretch the cell horizontally and vertically too 20 | # Set span to 1 to make the cell 1 column/row sized 21 | obj.set_grid_cell(lv.GRID_ALIGN.STRETCH, col, 1, 22 | lv.GRID_ALIGN.STRETCH, row, 1); 23 | 24 | label = lv.label(obj) 25 | label.set_text("{:d},{:d}".format(col, row)) 26 | label.center() 27 | 28 | -------------------------------------------------------------------------------- /lib/lvgl/examples/layouts/lv_example_layout.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_example_layout.h 3 | * 4 | */ 5 | 6 | #ifndef LV_EXAMPLE_LAYOUT_H 7 | #define LV_EXAMPLE_LAYOUT_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "flex/lv_example_flex.h" 17 | #include "grid/lv_example_grid.h" 18 | 19 | /********************* 20 | * DEFINES 21 | *********************/ 22 | 23 | /********************** 24 | * TYPEDEFS 25 | **********************/ 26 | 27 | /********************** 28 | * GLOBAL PROTOTYPES 29 | **********************/ 30 | 31 | /********************** 32 | * MACROS 33 | **********************/ 34 | 35 | #ifdef __cplusplus 36 | } /*extern "C"*/ 37 | #endif 38 | 39 | #endif /*LV_EXAMPLE_LAYOUT_H*/ 40 | -------------------------------------------------------------------------------- /lib/lvgl/examples/libs/bmp/example_16bit.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmallPond/D-BOT/98ec7958c368b6205f710f60df76f6b4479b677d/lib/lvgl/examples/libs/bmp/example_16bit.bmp -------------------------------------------------------------------------------- /lib/lvgl/examples/libs/bmp/example_24bit.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmallPond/D-BOT/98ec7958c368b6205f710f60df76f6b4479b677d/lib/lvgl/examples/libs/bmp/example_24bit.bmp -------------------------------------------------------------------------------- /lib/lvgl/examples/libs/bmp/example_32bit.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmallPond/D-BOT/98ec7958c368b6205f710f60df76f6b4479b677d/lib/lvgl/examples/libs/bmp/example_32bit.bmp -------------------------------------------------------------------------------- /lib/lvgl/examples/libs/bmp/index.rst: -------------------------------------------------------------------------------- 1 | Open a BMP image from file 2 | """"""""""""""""""""""""""""""""""""""""""""""" 3 | 4 | .. lv_example:: libs/bmp/lv_example_bmp_1 5 | :language: c 6 | 7 | -------------------------------------------------------------------------------- /lib/lvgl/examples/libs/bmp/lv_example_bmp.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_example_bmp.h 3 | * 4 | */ 5 | 6 | #ifndef LV_EXAMPLE_BMP_H 7 | #define LV_EXAMPLE_BMP_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | 17 | /********************* 18 | * DEFINES 19 | *********************/ 20 | 21 | /********************** 22 | * TYPEDEFS 23 | **********************/ 24 | 25 | /********************** 26 | * GLOBAL PROTOTYPES 27 | **********************/ 28 | void lv_example_bmp_1(void); 29 | 30 | /********************** 31 | * MACROS 32 | **********************/ 33 | 34 | #ifdef __cplusplus 35 | } /*extern "C"*/ 36 | #endif 37 | 38 | #endif /*LV_EXAMPLE_BMP_H*/ 39 | -------------------------------------------------------------------------------- /lib/lvgl/examples/libs/bmp/lv_example_bmp_1.c: -------------------------------------------------------------------------------- 1 | #include "../../lv_examples.h" 2 | #if LV_USE_BMP && LV_BUILD_EXAMPLES 3 | 4 | /** 5 | * Open a BMP file from a file 6 | */ 7 | void lv_example_bmp_1(void) 8 | { 9 | lv_obj_t * img = lv_img_create(lv_scr_act()); 10 | /* Assuming a File system is attached to letter 'A' 11 | * E.g. set LV_USE_FS_STDIO 'A' in lv_conf.h */ 12 | lv_img_set_src(img, "A:lvgl/examples/libs/bmp/example_32bit.bmp"); 13 | lv_obj_center(img); 14 | 15 | } 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /lib/lvgl/examples/libs/freetype/arial.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmallPond/D-BOT/98ec7958c368b6205f710f60df76f6b4479b677d/lib/lvgl/examples/libs/freetype/arial.ttf -------------------------------------------------------------------------------- /lib/lvgl/examples/libs/freetype/index.rst: -------------------------------------------------------------------------------- 1 | Open a front with FreeTpye 2 | """"""""""""""""""""""""""""""""""""""""""""""" 3 | 4 | .. lv_example:: libs/freetype/lv_example_freetype_1 5 | :language: c 6 | 7 | -------------------------------------------------------------------------------- /lib/lvgl/examples/libs/freetype/lv_example_freetype.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_example_freetype.h 3 | * 4 | */ 5 | 6 | #ifndef LV_EXAMPLE_FREETYPE_H 7 | #define LV_EXAMPLE_FREETYPE_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | 17 | /********************* 18 | * DEFINES 19 | *********************/ 20 | 21 | /********************** 22 | * TYPEDEFS 23 | **********************/ 24 | 25 | /********************** 26 | * GLOBAL PROTOTYPES 27 | **********************/ 28 | void lv_example_freetype_1(void); 29 | 30 | /********************** 31 | * MACROS 32 | **********************/ 33 | 34 | #ifdef __cplusplus 35 | } /*extern "C"*/ 36 | #endif 37 | 38 | #endif /*LV_EXAMPLE_FREETYPE_H*/ 39 | -------------------------------------------------------------------------------- /lib/lvgl/examples/libs/gif/index.rst: -------------------------------------------------------------------------------- 1 | Open a GIF image from file and variable 2 | """"""""""""""""""""""""""""""""""""""""""""""" 3 | 4 | .. lv_example:: libs/gif/lv_example_gif_1 5 | :language: c 6 | 7 | -------------------------------------------------------------------------------- /lib/lvgl/examples/libs/gif/lv_example_gif.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_example_gif.h 3 | * 4 | */ 5 | 6 | #ifndef LV_EXAMPLE_GIF_H 7 | #define LV_EXAMPLE_GIF_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | 17 | /********************* 18 | * DEFINES 19 | *********************/ 20 | 21 | /********************** 22 | * TYPEDEFS 23 | **********************/ 24 | 25 | /********************** 26 | * GLOBAL PROTOTYPES 27 | **********************/ 28 | void lv_example_gif_1(void); 29 | 30 | /********************** 31 | * MACROS 32 | **********************/ 33 | 34 | #ifdef __cplusplus 35 | } /*extern "C"*/ 36 | #endif 37 | 38 | #endif /*LV_EXAMPLE_GIF_H*/ 39 | -------------------------------------------------------------------------------- /lib/lvgl/examples/libs/gif/lv_example_gif_1.c: -------------------------------------------------------------------------------- 1 | #include "../../lv_examples.h" 2 | #if LV_USE_GIF && LV_BUILD_EXAMPLES 3 | 4 | /** 5 | * Open a GIF image from a file and a variable 6 | */ 7 | void lv_example_gif_1(void) 8 | { 9 | LV_IMG_DECLARE(img_bulb_gif); 10 | lv_obj_t * img; 11 | 12 | img = lv_gif_create(lv_scr_act()); 13 | lv_gif_set_src(img, &img_bulb_gif); 14 | lv_obj_align(img, LV_ALIGN_LEFT_MID, 20, 0); 15 | 16 | img = lv_gif_create(lv_scr_act()); 17 | /* Assuming a File system is attached to letter 'A' 18 | * E.g. set LV_USE_FS_STDIO 'A' in lv_conf.h */ 19 | lv_gif_set_src(img, "A:lvgl/examples/libs/gif/bulb.gif"); 20 | lv_obj_align(img, LV_ALIGN_RIGHT_MID, -20, 0); 21 | } 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /lib/lvgl/examples/libs/lv_example_libs.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_example_libs.h 3 | * 4 | */ 5 | 6 | #ifndef LV_EXAMPLE_LIBS_H 7 | #define LV_EXAMPLE_LIBS_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "bmp/lv_example_bmp.h" 17 | #include "gif/lv_example_gif.h" 18 | #include "png/lv_example_png.h" 19 | #include "sjpg/lv_example_sjpg.h" 20 | #include "qrcode/lv_example_qrcode.h" 21 | #include "freetype/lv_example_freetype.h" 22 | #include "rlottie/lv_example_rlottie.h" 23 | 24 | /********************* 25 | * DEFINES 26 | *********************/ 27 | 28 | /********************** 29 | * TYPEDEFS 30 | **********************/ 31 | 32 | /********************** 33 | * GLOBAL PROTOTYPES 34 | **********************/ 35 | 36 | /********************** 37 | * MACROS 38 | **********************/ 39 | 40 | #ifdef __cplusplus 41 | } /*extern "C"*/ 42 | #endif 43 | 44 | #endif /*LV_EXAMPLE_LIBS_H*/ 45 | -------------------------------------------------------------------------------- /lib/lvgl/examples/libs/png/index.rst: -------------------------------------------------------------------------------- 1 | Open a PNG image from file and variable 2 | """"""""""""""""""""""""""""""""""""""""""""""" 3 | 4 | .. lv_example:: libs/png/lv_example_png_1 5 | :language: c 6 | 7 | -------------------------------------------------------------------------------- /lib/lvgl/examples/libs/png/lv_example_png.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_example_png.h 3 | * 4 | */ 5 | 6 | #ifndef LV_EXAMPLE_PNG_H 7 | #define LV_EXAMPLE_PNG_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | 17 | /********************* 18 | * DEFINES 19 | *********************/ 20 | 21 | /********************** 22 | * TYPEDEFS 23 | **********************/ 24 | 25 | /********************** 26 | * GLOBAL PROTOTYPES 27 | **********************/ 28 | void lv_example_png_1(void); 29 | 30 | /********************** 31 | * MACROS 32 | **********************/ 33 | 34 | #ifdef __cplusplus 35 | } /*extern "C"*/ 36 | #endif 37 | 38 | #endif /*LV_EXAMPLE_PNG_H*/ 39 | -------------------------------------------------------------------------------- /lib/lvgl/examples/libs/png/lv_example_png_1.c: -------------------------------------------------------------------------------- 1 | #include "../../lv_examples.h" 2 | #if LV_USE_PNG && LV_BUILD_EXAMPLES 3 | 4 | /** 5 | * Open a PNG image from a file and a variable 6 | */ 7 | void lv_example_png_1(void) 8 | { 9 | LV_IMG_DECLARE(img_wink_png); 10 | lv_obj_t * img; 11 | 12 | img = lv_img_create(lv_scr_act()); 13 | lv_img_set_src(img, &img_wink_png); 14 | lv_obj_align(img, LV_ALIGN_LEFT_MID, 20, 0); 15 | 16 | img = lv_img_create(lv_scr_act()); 17 | /* Assuming a File system is attached to letter 'A' 18 | * E.g. set LV_USE_FS_STDIO 'A' in lv_conf.h */ 19 | lv_img_set_src(img, "A:lvgl/examples/libs/png/wink.png"); 20 | lv_obj_align(img, LV_ALIGN_RIGHT_MID, -20, 0); 21 | } 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /lib/lvgl/examples/libs/qrcode/index.rst: -------------------------------------------------------------------------------- 1 | Create a QR Code 2 | """"""""""""""""""""""""""""""""""""""""""""""" 3 | 4 | .. lv_example:: libs/qrcode/lv_example_qrcode_1 5 | :language: c 6 | 7 | -------------------------------------------------------------------------------- /lib/lvgl/examples/libs/qrcode/lv_example_qrcode.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_example_qrcode.h 3 | * 4 | */ 5 | 6 | #ifndef LV_EXAMPLE_QRCODE_H 7 | #define LV_EXAMPLE_QRCODE_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | 17 | /********************* 18 | * DEFINES 19 | *********************/ 20 | 21 | /********************** 22 | * TYPEDEFS 23 | **********************/ 24 | 25 | /********************** 26 | * GLOBAL PROTOTYPES 27 | **********************/ 28 | void lv_example_qrcode_1(void); 29 | 30 | /********************** 31 | * MACROS 32 | **********************/ 33 | 34 | #ifdef __cplusplus 35 | } /*extern "C"*/ 36 | #endif 37 | 38 | #endif /*LV_EXAMPLE_QRCODE_H*/ 39 | -------------------------------------------------------------------------------- /lib/lvgl/examples/libs/qrcode/lv_example_qrcode_1.c: -------------------------------------------------------------------------------- 1 | #include "../../lv_examples.h" 2 | #if LV_USE_QRCODE && LV_BUILD_EXAMPLES 3 | 4 | /** 5 | * Create a QR Code 6 | */ 7 | void lv_example_qrcode_1(void) 8 | { 9 | lv_color_t bg_color = lv_palette_lighten(LV_PALETTE_LIGHT_BLUE, 5); 10 | lv_color_t fg_color = lv_palette_darken(LV_PALETTE_BLUE, 4); 11 | 12 | lv_obj_t * qr = lv_qrcode_create(lv_scr_act(), 150, fg_color, bg_color); 13 | 14 | /*Set data*/ 15 | const char * data = "https://lvgl.io"; 16 | lv_qrcode_update(qr, data, strlen(data)); 17 | lv_obj_center(qr); 18 | 19 | /*Add a border with bg_color*/ 20 | lv_obj_set_style_border_color(qr, bg_color, 0); 21 | lv_obj_set_style_border_width(qr, 5, 0); 22 | } 23 | 24 | #endif 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /lib/lvgl/examples/libs/rlottie/index.rst: -------------------------------------------------------------------------------- 1 | Load a Lottie animation from raw data 2 | """"""""""""""""""""""""""""""""""""" 3 | 4 | .. lv_example:: libs/rlottie/lv_example_rlottie_1 5 | :language: c 6 | 7 | Load a Lottie animation from a file 8 | """"""""""""""""""""""""""""""""""" 9 | 10 | .. lv_example:: libs/rlottie/lv_example_rlottie_2 11 | :language: c 12 | 13 | -------------------------------------------------------------------------------- /lib/lvgl/examples/libs/rlottie/lv_example_rlottie.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_example_rlottie.h 3 | * 4 | */ 5 | 6 | #ifndef LV_EXAMPLE_RLOTTIE_H 7 | #define LV_EXAMPLE_RLOTTIE_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | 17 | /********************* 18 | * DEFINES 19 | *********************/ 20 | 21 | /********************** 22 | * TYPEDEFS 23 | **********************/ 24 | 25 | /********************** 26 | * GLOBAL PROTOTYPES 27 | **********************/ 28 | void lv_example_rlottie_1(void); 29 | void lv_example_rlottie_2(void); 30 | 31 | /********************** 32 | * MACROS 33 | **********************/ 34 | 35 | #ifdef __cplusplus 36 | } /*extern "C"*/ 37 | #endif 38 | 39 | #endif /*LV_EXAMPLE_SJPG_H*/ 40 | -------------------------------------------------------------------------------- /lib/lvgl/examples/libs/rlottie/lv_example_rlottie_1.c: -------------------------------------------------------------------------------- 1 | #include "../../lv_examples.h" 2 | #if LV_USE_RLOTTIE && LV_BUILD_EXAMPLES 3 | 4 | /** 5 | * Load an lottie animation from flash 6 | */ 7 | void lv_example_rlottie_1(void) 8 | { 9 | extern const uint8_t lv_example_rlottie_approve[]; 10 | lv_obj_t * lottie = lv_rlottie_create_from_raw(lv_scr_act(), 100, 100, (const void *)lv_example_rlottie_approve); 11 | lv_obj_center(lottie); 12 | } 13 | 14 | #else 15 | void lv_example_rlottie_1(void) 16 | { 17 | /*TODO 18 | *fallback for online examples*/ 19 | 20 | lv_obj_t * label = lv_label_create(lv_scr_act()); 21 | lv_label_set_text(label, "Rlottie is not installed"); 22 | lv_obj_center(label); 23 | } 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /lib/lvgl/examples/libs/rlottie/lv_example_rlottie_2.c: -------------------------------------------------------------------------------- 1 | #include "../../lv_examples.h" 2 | #if LV_USE_RLOTTIE && LV_BUILD_EXAMPLES 3 | 4 | /** 5 | * Load an lottie animation from file 6 | */ 7 | void lv_example_rlottie_2(void) 8 | { 9 | /*The rlottie library uses STDIO file API, so there is no drievr letter for LVGL*/ 10 | lv_obj_t * lottie = lv_rlottie_create_from_file(lv_scr_act(), 100, 100, 11 | "lvgl/examples/libs/rlottie/lv_example_rlottie_approve.json"); 12 | lv_obj_center(lottie); 13 | } 14 | 15 | #else 16 | void lv_example_rlottie_2(void) 17 | { 18 | /*TODO 19 | *fallback for online examples*/ 20 | 21 | lv_obj_t * label = lv_label_create(lv_scr_act()); 22 | lv_label_set_text(label, "Rlottie is not installed"); 23 | lv_obj_center(label); 24 | } 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /lib/lvgl/examples/libs/sjpg/index.rst: -------------------------------------------------------------------------------- 1 | Load an SJPG image 2 | """"""""""""""""""""""""""""""""""""""""""""""" 3 | 4 | .. lv_example:: libs/sjpg/lv_example_sjpg_1 5 | :language: c 6 | 7 | -------------------------------------------------------------------------------- /lib/lvgl/examples/libs/sjpg/lv_example_sjpg.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_example_sjpg.h 3 | * 4 | */ 5 | 6 | #ifndef LV_EXAMPLE_SJPG_H 7 | #define LV_EXAMPLE_SJPG_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | 17 | /********************* 18 | * DEFINES 19 | *********************/ 20 | 21 | /********************** 22 | * TYPEDEFS 23 | **********************/ 24 | 25 | /********************** 26 | * GLOBAL PROTOTYPES 27 | **********************/ 28 | void lv_example_sjpg_1(void); 29 | 30 | /********************** 31 | * MACROS 32 | **********************/ 33 | 34 | #ifdef __cplusplus 35 | } /*extern "C"*/ 36 | #endif 37 | 38 | #endif /*LV_EXAMPLE_SJPG_H*/ 39 | -------------------------------------------------------------------------------- /lib/lvgl/examples/libs/sjpg/lv_example_sjpg_1.c: -------------------------------------------------------------------------------- 1 | #include "../../lv_examples.h" 2 | #if LV_USE_SJPG && LV_BUILD_EXAMPLES 3 | 4 | /** 5 | * Load an SJPG image 6 | */ 7 | void lv_example_sjpg_1(void) 8 | { 9 | lv_obj_t * wp; 10 | 11 | wp = lv_img_create(lv_scr_act()); 12 | /* Assuming a File system is attached to letter 'A' 13 | * E.g. set LV_USE_FS_STDIO 'A' in lv_conf.h */ 14 | lv_img_set_src(wp, "A:lvgl/examples/libs/sjpg/small_image.sjpg"); 15 | } 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /lib/lvgl/examples/libs/sjpg/small_image.sjpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmallPond/D-BOT/98ec7958c368b6205f710f60df76f6b4479b677d/lib/lvgl/examples/libs/sjpg/small_image.sjpg -------------------------------------------------------------------------------- /lib/lvgl/examples/lv_examples.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_examples.h 3 | * 4 | */ 5 | 6 | #ifndef LV_EXAMPLES_H 7 | #define LV_EXAMPLES_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "../lvgl.h" 17 | 18 | #include "styles/lv_example_style.h" 19 | #include "get_started/lv_example_get_started.h" 20 | #include "widgets/lv_example_widgets.h" 21 | #include "layouts/lv_example_layout.h" 22 | #include "scroll/lv_example_scroll.h" 23 | #include "anim/lv_example_anim.h" 24 | #include "event/lv_example_event.h" 25 | #include "styles/lv_example_style.h" 26 | #include "others/lv_example_others.h" 27 | #include "libs/lv_example_libs.h" 28 | 29 | /********************* 30 | * DEFINES 31 | *********************/ 32 | 33 | /********************** 34 | * TYPEDEFS 35 | **********************/ 36 | 37 | /********************** 38 | * GLOBAL PROTOTYPES 39 | **********************/ 40 | 41 | /********************** 42 | * MACROS 43 | **********************/ 44 | 45 | #ifdef __cplusplus 46 | } /*extern "C"*/ 47 | #endif 48 | 49 | #endif /*LV_EXAMPLES_H*/ 50 | -------------------------------------------------------------------------------- /lib/lvgl/examples/others/lv_example_others.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_example_others.h 3 | * 4 | */ 5 | 6 | #ifndef LV_EXAMPLE_OTHERS_H 7 | #define LV_EXAMPLE_OTHERS_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "snapshot/lv_example_snapshot.h" 17 | /********************* 18 | * DEFINES 19 | *********************/ 20 | 21 | /********************** 22 | * TYPEDEFS 23 | **********************/ 24 | 25 | /********************** 26 | * GLOBAL PROTOTYPES 27 | **********************/ 28 | 29 | /********************** 30 | * MACROS 31 | **********************/ 32 | 33 | #ifdef __cplusplus 34 | } /*extern "C"*/ 35 | #endif 36 | 37 | #endif /*LV_EX_OTHERS_H*/ 38 | -------------------------------------------------------------------------------- /lib/lvgl/examples/others/snapshot/index.rst: -------------------------------------------------------------------------------- 1 | 2 | Simple snapshot example 3 | """"""""""""""""""" 4 | 5 | .. lv_example:: others/snapshot/lv_example_snapshot_1 6 | :language: c 7 | 8 | 9 | -------------------------------------------------------------------------------- /lib/lvgl/examples/others/snapshot/lv_example_snapshot.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_example_snapshot.h 3 | * 4 | */ 5 | 6 | #ifndef LV_EX_SNAPSHOT_H 7 | #define LV_EX_SNAPSHOT_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | 17 | /********************* 18 | * DEFINES 19 | *********************/ 20 | 21 | /********************** 22 | * TYPEDEFS 23 | **********************/ 24 | 25 | /********************** 26 | * GLOBAL PROTOTYPES 27 | **********************/ 28 | void lv_example_snapshot_1(void); 29 | 30 | /********************** 31 | * MACROS 32 | **********************/ 33 | 34 | #ifdef __cplusplus 35 | } /*extern "C"*/ 36 | #endif 37 | 38 | #endif /*LV_EX_GET_STARTED_H*/ 39 | -------------------------------------------------------------------------------- /lib/lvgl/examples/porting/lv_port_disp_template.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_port_disp_templ.h 3 | * 4 | */ 5 | 6 | /*Copy this file as "lv_port_disp.h" and set this value to "1" to enable content*/ 7 | #if 0 8 | 9 | #ifndef LV_PORT_DISP_TEMPL_H 10 | #define LV_PORT_DISP_TEMPL_H 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif 15 | 16 | /********************* 17 | * INCLUDES 18 | *********************/ 19 | #include "lvgl/lvgl.h" 20 | 21 | /********************* 22 | * DEFINES 23 | *********************/ 24 | 25 | /********************** 26 | * TYPEDEFS 27 | **********************/ 28 | 29 | /********************** 30 | * GLOBAL PROTOTYPES 31 | **********************/ 32 | 33 | /********************** 34 | * MACROS 35 | **********************/ 36 | 37 | #ifdef __cplusplus 38 | } /*extern "C"*/ 39 | #endif 40 | 41 | #endif /*LV_PORT_DISP_TEMPL_H*/ 42 | 43 | #endif /*Disable/Enable content*/ 44 | -------------------------------------------------------------------------------- /lib/lvgl/examples/porting/lv_port_fs_template.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_port_fs_templ.h 3 | * 4 | */ 5 | 6 | /*Copy this file as "lv_port_fs.h" and set this value to "1" to enable content*/ 7 | #if 0 8 | 9 | #ifndef LV_PORT_FS_TEMPL_H 10 | #define LV_PORT_FS_TEMPL_H 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif 15 | 16 | /********************* 17 | * INCLUDES 18 | *********************/ 19 | #include "lvgl/lvgl.h" 20 | 21 | /********************* 22 | * DEFINES 23 | *********************/ 24 | 25 | /********************** 26 | * TYPEDEFS 27 | **********************/ 28 | 29 | /********************** 30 | * GLOBAL PROTOTYPES 31 | **********************/ 32 | 33 | /********************** 34 | * MACROS 35 | **********************/ 36 | 37 | #ifdef __cplusplus 38 | } /*extern "C"*/ 39 | #endif 40 | 41 | #endif /*LV_PORT_FS_TEMPL_H*/ 42 | 43 | #endif /*Disable/Enable content*/ 44 | -------------------------------------------------------------------------------- /lib/lvgl/examples/porting/lv_port_indev_template.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * @file lv_port_indev_templ.h 4 | * 5 | */ 6 | 7 | /*Copy this file as "lv_port_indev.h" and set this value to "1" to enable content*/ 8 | #if 0 9 | 10 | #ifndef LV_PORT_INDEV_TEMPL_H 11 | #define LV_PORT_INDEV_TEMPL_H 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | /********************* 18 | * INCLUDES 19 | *********************/ 20 | #include "lvgl/lvgl.h" 21 | 22 | /********************* 23 | * DEFINES 24 | *********************/ 25 | 26 | /********************** 27 | * TYPEDEFS 28 | **********************/ 29 | 30 | /********************** 31 | * GLOBAL PROTOTYPES 32 | **********************/ 33 | 34 | /********************** 35 | * MACROS 36 | **********************/ 37 | 38 | #ifdef __cplusplus 39 | } /*extern "C"*/ 40 | #endif 41 | 42 | #endif /*LV_PORT_INDEV_TEMPL_H*/ 43 | 44 | #endif /*Disable/Enable content*/ 45 | -------------------------------------------------------------------------------- /lib/lvgl/examples/scroll/index.rst: -------------------------------------------------------------------------------- 1 | 2 | Nested scrolling 3 | """""""""""""""" 4 | 5 | .. lv_example:: scroll/lv_example_scroll_1 6 | :language: c 7 | 8 | Snapping 9 | """""""""""""""" 10 | .. lv_example:: scroll/lv_example_scroll_2 11 | :language: c 12 | 13 | Floating button 14 | """""""""""""""" 15 | .. lv_example:: scroll/lv_example_scroll_3 16 | :language: c 17 | 18 | Styling the scrollbars 19 | """""""""""""""""""""""" 20 | .. lv_example:: scroll/lv_example_scroll_4 21 | :language: c 22 | 23 | Right to left scrolling 24 | """""""""""""""""""""""" 25 | .. lv_example:: scroll/lv_example_scroll_5 26 | :language: c 27 | 28 | Translate on scroll 29 | """""""""""""""""""""""" 30 | .. lv_example:: scroll/lv_example_scroll_6 31 | :language: c 32 | 33 | 34 | -------------------------------------------------------------------------------- /lib/lvgl/examples/scroll/lv_example_scroll.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_example_scroll.h 3 | * 4 | */ 5 | 6 | #ifndef LV_EXAMPLE_SCROLL_H 7 | #define LV_EXAMPLE_SCROLL_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | 17 | /********************* 18 | * DEFINES 19 | *********************/ 20 | 21 | /********************** 22 | * TYPEDEFS 23 | **********************/ 24 | 25 | /********************** 26 | * GLOBAL PROTOTYPES 27 | **********************/ 28 | void lv_example_scroll_1(void); 29 | void lv_example_scroll_2(void); 30 | void lv_example_scroll_3(void); 31 | void lv_example_scroll_4(void); 32 | void lv_example_scroll_5(void); 33 | void lv_example_scroll_6(void); 34 | 35 | 36 | /********************** 37 | * MACROS 38 | **********************/ 39 | 40 | #ifdef __cplusplus 41 | } /*extern "C"*/ 42 | #endif 43 | 44 | #endif /*LV_EXAMPLE_SCROLL_H*/ 45 | -------------------------------------------------------------------------------- /lib/lvgl/examples/scroll/lv_example_scroll_1.py: -------------------------------------------------------------------------------- 1 | # 2 | # Demonstrate how scrolling appears automatically 3 | # 4 | # Create an object with the new style 5 | panel = lv.obj(lv.scr_act()) 6 | panel.set_size(200, 200) 7 | panel.center() 8 | 9 | child = lv.obj(panel) 10 | child.set_pos(0, 0) 11 | label = lv.label(child) 12 | label.set_text("Zero") 13 | label.center() 14 | 15 | child = lv.obj(panel) 16 | child.set_pos(-40, 100) 17 | label = lv.label(child) 18 | label.set_text("Left") 19 | label.center() 20 | 21 | child = lv.obj(panel) 22 | child.set_pos(90, -30) 23 | label = lv.label(child) 24 | label.set_text("Top") 25 | label.center() 26 | 27 | child = lv.obj(panel) 28 | child.set_pos(150, 80) 29 | label = lv.label(child) 30 | label.set_text("Right") 31 | label.center() 32 | 33 | child = lv.obj(panel) 34 | child.set_pos(60, 170) 35 | label = lv.label(child) 36 | label.set_text("Bottom") 37 | label.center() 38 | 39 | -------------------------------------------------------------------------------- /lib/lvgl/examples/scroll/lv_example_scroll_5.c: -------------------------------------------------------------------------------- 1 | #include "../lv_examples.h" 2 | #if LV_BUILD_EXAMPLES && LV_FONT_DEJAVU_16_PERSIAN_HEBREW 3 | 4 | 5 | /** 6 | * Scrolling with Right To Left base direction 7 | */ 8 | void lv_example_scroll_5(void) 9 | { 10 | lv_obj_t * obj = lv_obj_create(lv_scr_act()); 11 | lv_obj_set_style_base_dir(obj, LV_BASE_DIR_RTL, 0); 12 | lv_obj_set_size(obj, 200, 100); 13 | lv_obj_center(obj); 14 | 15 | lv_obj_t * label = lv_label_create(obj); 16 | lv_label_set_text(label,"میکروکُنترولر (به انگلیسی: Microcontroller) گونه‌ای ریزپردازنده است که دارای حافظهٔ دسترسی تصادفی (RAM) و حافظهٔ فقط‌خواندنی (ROM)، تایمر، پورت‌های ورودی و خروجی (I/O) و درگاه ترتیبی (Serial Port پورت سریال)، درون خود تراشه است، و می‌تواند به تنهایی ابزارهای دیگر را کنترل کند. به عبارت دیگر یک میکروکنترلر، مدار مجتمع کوچکی است که از یک CPU کوچک و اجزای دیگری مانند تایمر، درگاه‌های ورودی و خروجی آنالوگ و دیجیتال و حافظه تشکیل شده‌است."); 17 | lv_obj_set_width(label, 400); 18 | lv_obj_set_style_text_font(label, &lv_font_dejavu_16_persian_hebrew, 0); 19 | 20 | } 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /lib/lvgl/examples/scroll/lv_example_scroll_5.py: -------------------------------------------------------------------------------- 1 | # 2 | # Scrolling with Right To Left base direction 3 | # 4 | obj = lv.obj(lv.scr_act()) 5 | obj.set_style_base_dir(lv.BASE_DIR.RTL, 0) 6 | obj.set_size(200, 100) 7 | obj.center() 8 | 9 | label = lv.label(obj) 10 | label.set_text("میکروکُنترولر (به انگلیسی: Microcontroller) گونه‌ای ریزپردازنده است که دارای حافظهٔ دسترسی تصادفی (RAM) و حافظهٔ فقط‌خواندنی (ROM)، تایمر، پورت‌های ورودی و خروجی (I/O) و درگاه ترتیبی (Serial Port پورت سریال)، درون خود تراشه است، و می‌تواند به تنهایی ابزارهای دیگر را کنترل کند. به عبارت دیگر یک میکروکنترلر، مدار مجتمع کوچکی است که از یک CPU کوچک و اجزای دیگری مانند تایمر، درگاه‌های ورودی و خروجی آنالوگ و دیجیتال و حافظه تشکیل شده‌است.") 11 | label.set_width(400) 12 | label.set_style_text_font(lv.font_dejavu_16_persian_hebrew, 0) 13 | 14 | -------------------------------------------------------------------------------- /lib/lvgl/examples/styles/lv_example_style_1.c: -------------------------------------------------------------------------------- 1 | #include "../lv_examples.h" 2 | #if LV_BUILD_EXAMPLES && LV_USE_IMG 3 | 4 | /** 5 | * Using the Size, Position and Padding style properties 6 | */ 7 | void lv_example_style_1(void) 8 | { 9 | static lv_style_t style; 10 | lv_style_init(&style); 11 | lv_style_set_radius(&style, 5); 12 | 13 | /*Make a gradient*/ 14 | lv_style_set_width(&style, 150); 15 | lv_style_set_height(&style, LV_SIZE_CONTENT); 16 | 17 | lv_style_set_pad_ver(&style, 20); 18 | lv_style_set_pad_left(&style, 5); 19 | 20 | lv_style_set_x(&style, lv_pct(50)); 21 | lv_style_set_y(&style, 80); 22 | 23 | /*Create an object with the new style*/ 24 | lv_obj_t * obj = lv_obj_create(lv_scr_act()); 25 | lv_obj_add_style(obj, &style, 0); 26 | 27 | lv_obj_t * label = lv_label_create(obj); 28 | lv_label_set_text(label, "Hello"); 29 | } 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /lib/lvgl/examples/styles/lv_example_style_1.py: -------------------------------------------------------------------------------- 1 | # 2 | # Using the Size, Position and Padding style properties 3 | # 4 | style = lv.style_t() 5 | style.init() 6 | style.set_radius(5) 7 | 8 | # Make a gradient 9 | style.set_width(150) 10 | style.set_height(lv.SIZE.CONTENT) 11 | 12 | style.set_pad_ver(20) 13 | style.set_pad_left(5) 14 | 15 | style.set_x(lv.pct(50)) 16 | style.set_y(80) 17 | 18 | # Create an object with the new style 19 | obj = lv.obj(lv.scr_act()) 20 | obj.add_style(style, 0) 21 | 22 | label = lv.label(obj) 23 | label.set_text("Hello"); 24 | 25 | -------------------------------------------------------------------------------- /lib/lvgl/examples/styles/lv_example_style_10.py: -------------------------------------------------------------------------------- 1 | # 2 | # Creating a transition 3 | # 4 | 5 | props = [lv.STYLE.BG_COLOR, lv.STYLE.BORDER_COLOR, lv.STYLE.BORDER_WIDTH, 0] 6 | 7 | # A default transition 8 | # Make it fast (100ms) and start with some delay (200 ms) 9 | 10 | trans_def = lv.style_transition_dsc_t() 11 | trans_def.init(props, lv.anim_t.path_linear, 100, 200, None) 12 | 13 | # A special transition when going to pressed state 14 | # Make it slow (500 ms) but start without delay 15 | 16 | trans_pr = lv.style_transition_dsc_t() 17 | trans_pr.init(props, lv.anim_t.path_linear, 500, 0, None) 18 | 19 | style_def = lv.style_t() 20 | style_def.init() 21 | style_def.set_transition(trans_def) 22 | 23 | style_pr = lv.style_t() 24 | style_pr.init() 25 | style_pr.set_bg_color(lv.palette_main(lv.PALETTE.RED)) 26 | style_pr.set_border_width(6) 27 | style_pr.set_border_color(lv.palette_darken(lv.PALETTE.RED, 3)) 28 | style_pr.set_transition(trans_pr) 29 | 30 | # Create an object with the new style_pr 31 | obj = lv.obj(lv.scr_act()) 32 | obj.add_style(style_def, 0) 33 | obj.add_style(style_pr, lv.STATE.PRESSED) 34 | 35 | obj.center() 36 | 37 | -------------------------------------------------------------------------------- /lib/lvgl/examples/styles/lv_example_style_12.c: -------------------------------------------------------------------------------- 1 | #include "../lv_examples.h" 2 | #if LV_BUILD_EXAMPLES && LV_USE_IMG 3 | 4 | /** 5 | * Local styles 6 | */ 7 | void lv_example_style_12(void) 8 | { 9 | static lv_style_t style; 10 | lv_style_init(&style); 11 | lv_style_set_bg_color(&style, lv_palette_main(LV_PALETTE_GREEN)); 12 | lv_style_set_border_color(&style, lv_palette_lighten(LV_PALETTE_GREEN, 3)); 13 | lv_style_set_border_width(&style, 3); 14 | 15 | lv_obj_t * obj = lv_obj_create(lv_scr_act()); 16 | lv_obj_add_style(obj, &style, 0); 17 | 18 | /*Overwrite the background color locally*/ 19 | lv_obj_set_style_bg_color(obj,lv_palette_main(LV_PALETTE_ORANGE), LV_PART_MAIN); 20 | 21 | lv_obj_center(obj); 22 | } 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /lib/lvgl/examples/styles/lv_example_style_12.py: -------------------------------------------------------------------------------- 1 | # 2 | # Local styles 3 | # 4 | 5 | style = lv.style_t() 6 | style.init() 7 | style.set_bg_color(lv.palette_main(lv.PALETTE.GREEN)) 8 | style.set_border_color(lv.palette_lighten(lv.PALETTE.GREEN, 3)) 9 | style.set_border_width(3) 10 | 11 | obj = lv.obj(lv.scr_act()) 12 | obj.add_style(style, 0) 13 | 14 | # Overwrite the background color locally 15 | obj.set_style_bg_color(lv.palette_main(lv.PALETTE.ORANGE), lv.PART.MAIN) 16 | 17 | obj.center() 18 | 19 | -------------------------------------------------------------------------------- /lib/lvgl/examples/styles/lv_example_style_13.c: -------------------------------------------------------------------------------- 1 | #include "../lv_examples.h" 2 | #if LV_BUILD_EXAMPLES && LV_USE_IMG 3 | 4 | /** 5 | * Add styles to parts and states 6 | */ 7 | void lv_example_style_13(void) 8 | { 9 | static lv_style_t style_indic; 10 | lv_style_init(&style_indic); 11 | lv_style_set_bg_color(&style_indic, lv_palette_lighten(LV_PALETTE_RED, 3)); 12 | lv_style_set_bg_grad_color(&style_indic, lv_palette_main(LV_PALETTE_RED)); 13 | lv_style_set_bg_grad_dir(&style_indic, LV_GRAD_DIR_HOR); 14 | 15 | static lv_style_t style_indic_pr; 16 | lv_style_init(&style_indic_pr); 17 | lv_style_set_shadow_color(&style_indic_pr, lv_palette_main(LV_PALETTE_RED)); 18 | lv_style_set_shadow_width(&style_indic_pr, 10); 19 | lv_style_set_shadow_spread(&style_indic_pr, 3); 20 | 21 | /*Create an object with the new style_pr*/ 22 | lv_obj_t * obj = lv_slider_create(lv_scr_act()); 23 | lv_obj_add_style(obj, &style_indic, LV_PART_INDICATOR); 24 | lv_obj_add_style(obj, &style_indic_pr, LV_PART_INDICATOR | LV_STATE_PRESSED); 25 | lv_slider_set_value(obj, 70, LV_ANIM_OFF); 26 | lv_obj_center(obj); 27 | } 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /lib/lvgl/examples/styles/lv_example_style_13.py: -------------------------------------------------------------------------------- 1 | # 2 | # Add styles to parts and states 3 | # 4 | 5 | style_indic = lv.style_t() 6 | style_indic.init() 7 | style_indic.set_bg_color(lv.palette_lighten(lv.PALETTE.RED, 3)) 8 | style_indic.set_bg_grad_color(lv.palette_main(lv.PALETTE.RED)) 9 | style_indic.set_bg_grad_dir(lv.GRAD_DIR.HOR) 10 | 11 | style_indic_pr = lv.style_t() 12 | style_indic_pr.init() 13 | style_indic_pr.set_shadow_color(lv.palette_main(lv.PALETTE.RED)) 14 | style_indic_pr.set_shadow_width(10) 15 | style_indic_pr.set_shadow_spread(3) 16 | 17 | # Create an object with the new style_pr 18 | obj = lv.slider(lv.scr_act()) 19 | obj.add_style(style_indic, lv.PART.INDICATOR) 20 | obj.add_style(style_indic_pr, lv.PART.INDICATOR | lv.STATE.PRESSED) 21 | obj.set_value(70, lv.ANIM.OFF) 22 | obj.center() 23 | 24 | -------------------------------------------------------------------------------- /lib/lvgl/examples/styles/lv_example_style_2.c: -------------------------------------------------------------------------------- 1 | #include "../lv_examples.h" 2 | #if LV_BUILD_EXAMPLES 3 | 4 | /** 5 | * Using the background style properties 6 | */ 7 | void lv_example_style_2(void) 8 | { 9 | static lv_style_t style; 10 | lv_style_init(&style); 11 | lv_style_set_radius(&style, 5); 12 | 13 | /*Make a gradient*/ 14 | lv_style_set_bg_opa(&style, LV_OPA_COVER); 15 | lv_style_set_bg_color(&style, lv_palette_lighten(LV_PALETTE_GREY, 1)); 16 | lv_style_set_bg_grad_color(&style, lv_palette_main(LV_PALETTE_BLUE)); 17 | lv_style_set_bg_grad_dir(&style, LV_GRAD_DIR_VER); 18 | 19 | /*Shift the gradient to the bottom*/ 20 | lv_style_set_bg_main_stop(&style, 128); 21 | lv_style_set_bg_grad_stop(&style, 192); 22 | 23 | /*Create an object with the new style*/ 24 | lv_obj_t * obj = lv_obj_create(lv_scr_act()); 25 | lv_obj_add_style(obj, &style, 0); 26 | lv_obj_center(obj); 27 | } 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /lib/lvgl/examples/styles/lv_example_style_2.py: -------------------------------------------------------------------------------- 1 | # 2 | # Using the background style properties 3 | # 4 | style = lv.style_t() 5 | style.init() 6 | style.set_radius(5) 7 | 8 | # Make a gradient 9 | style.set_bg_opa(lv.OPA.COVER) 10 | style.set_bg_color(lv.palette_lighten(lv.PALETTE.GREY, 1)) 11 | style.set_bg_grad_color(lv.palette_main(lv.PALETTE.BLUE)) 12 | style.set_bg_grad_dir(lv.GRAD_DIR.VER) 13 | 14 | # Shift the gradient to the bottom 15 | style.set_bg_main_stop(128) 16 | style.set_bg_grad_stop(192) 17 | 18 | # Create an object with the new style 19 | obj = lv.obj(lv.scr_act()) 20 | obj.add_style(style, 0) 21 | obj.center() 22 | 23 | -------------------------------------------------------------------------------- /lib/lvgl/examples/styles/lv_example_style_3.c: -------------------------------------------------------------------------------- 1 | #include "../lv_examples.h" 2 | #if LV_BUILD_EXAMPLES 3 | 4 | /** 5 | * Using the border style properties 6 | */ 7 | void lv_example_style_3(void) 8 | { 9 | static lv_style_t style; 10 | lv_style_init(&style); 11 | 12 | /*Set a background color and a radius*/ 13 | lv_style_set_radius(&style, 10); 14 | lv_style_set_bg_opa(&style, LV_OPA_COVER); 15 | lv_style_set_bg_color(&style, lv_palette_lighten(LV_PALETTE_GREY, 1)); 16 | 17 | /*Add border to the bottom+right*/ 18 | lv_style_set_border_color(&style, lv_palette_main(LV_PALETTE_BLUE)); 19 | lv_style_set_border_width(&style, 5); 20 | lv_style_set_border_opa(&style, LV_OPA_50); 21 | lv_style_set_border_side(&style, LV_BORDER_SIDE_BOTTOM | LV_BORDER_SIDE_RIGHT); 22 | 23 | /*Create an object with the new style*/ 24 | lv_obj_t * obj = lv_obj_create(lv_scr_act()); 25 | lv_obj_add_style(obj, &style, 0); 26 | lv_obj_center(obj); 27 | } 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /lib/lvgl/examples/styles/lv_example_style_3.py: -------------------------------------------------------------------------------- 1 | # 2 | # Using the border style properties 3 | # 4 | style = lv.style_t() 5 | style.init() 6 | 7 | # Set a background color and a radius 8 | style.set_radius(10) 9 | style.set_bg_opa(lv.OPA.COVER) 10 | style.set_bg_color(lv.palette_lighten(lv.PALETTE.GREY, 1)) 11 | 12 | # Add border to the bottom+right 13 | style.set_border_color(lv.palette_main(lv.PALETTE.BLUE)) 14 | style.set_border_width(5) 15 | style.set_border_opa(lv.OPA._50) 16 | style.set_border_side(lv.BORDER_SIDE.BOTTOM | lv.BORDER_SIDE.RIGHT) 17 | 18 | # Create an object with the new style 19 | obj = lv.obj(lv.scr_act()) 20 | obj.add_style(style, 0) 21 | obj.center() 22 | 23 | -------------------------------------------------------------------------------- /lib/lvgl/examples/styles/lv_example_style_4.c: -------------------------------------------------------------------------------- 1 | #include "../lv_examples.h" 2 | #if LV_BUILD_EXAMPLES 3 | 4 | /** 5 | * Using the outline style properties 6 | */ 7 | void lv_example_style_4(void) 8 | { 9 | static lv_style_t style; 10 | lv_style_init(&style); 11 | 12 | /*Set a background color and a radius*/ 13 | lv_style_set_radius(&style, 5); 14 | lv_style_set_bg_opa(&style, LV_OPA_COVER); 15 | lv_style_set_bg_color(&style, lv_palette_lighten(LV_PALETTE_GREY, 1)); 16 | 17 | /*Add outline*/ 18 | lv_style_set_outline_width(&style, 2); 19 | lv_style_set_outline_color(&style, lv_palette_main(LV_PALETTE_BLUE)); 20 | lv_style_set_outline_pad(&style, 8); 21 | 22 | /*Create an object with the new style*/ 23 | lv_obj_t * obj = lv_obj_create(lv_scr_act()); 24 | lv_obj_add_style(obj, &style, 0); 25 | lv_obj_center(obj); 26 | } 27 | 28 | #endif 29 | 30 | -------------------------------------------------------------------------------- /lib/lvgl/examples/styles/lv_example_style_4.py: -------------------------------------------------------------------------------- 1 | # 2 | # Using the outline style properties 3 | # 4 | 5 | style = lv.style_t() 6 | style.init() 7 | 8 | # Set a background color and a radius 9 | style.set_radius(5) 10 | style.set_bg_opa(lv.OPA.COVER) 11 | style.set_bg_color(lv.palette_lighten(lv.PALETTE.GREY, 1)) 12 | 13 | # Add outline 14 | style.set_outline_width(2) 15 | style.set_outline_color(lv.palette_main(lv.PALETTE.BLUE)) 16 | style.set_outline_pad(8) 17 | 18 | # Create an object with the new style 19 | obj = lv.obj(lv.scr_act()) 20 | obj.add_style(style, 0) 21 | obj.center() 22 | 23 | 24 | -------------------------------------------------------------------------------- /lib/lvgl/examples/styles/lv_example_style_5.c: -------------------------------------------------------------------------------- 1 | #include "../lv_examples.h" 2 | #if LV_BUILD_EXAMPLES 3 | 4 | /** 5 | * Using the Shadow style properties 6 | */ 7 | void lv_example_style_5(void) 8 | { 9 | static lv_style_t style; 10 | lv_style_init(&style); 11 | 12 | /*Set a background color and a radius*/ 13 | lv_style_set_radius(&style, 5); 14 | lv_style_set_bg_opa(&style, LV_OPA_COVER); 15 | lv_style_set_bg_color(&style, lv_palette_lighten(LV_PALETTE_GREY, 1)); 16 | 17 | /*Add a shadow*/ 18 | lv_style_set_shadow_width(&style, 25); 19 | lv_style_set_shadow_color(&style, lv_palette_main(LV_PALETTE_BLUE)); 20 | lv_style_set_shadow_ofs_x(&style, 10); 21 | lv_style_set_shadow_ofs_y(&style, 20); 22 | 23 | /*Create an object with the new style*/ 24 | lv_obj_t * obj = lv_obj_create(lv_scr_act()); 25 | lv_obj_add_style(obj, &style, 0); 26 | lv_obj_center(obj); 27 | } 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /lib/lvgl/examples/styles/lv_example_style_5.py: -------------------------------------------------------------------------------- 1 | # 2 | # Using the Shadow style properties 3 | # 4 | 5 | style = lv.style_t() 6 | style.init() 7 | 8 | # Set a background color and a radius 9 | style.set_radius(5) 10 | style.set_bg_opa(lv.OPA.COVER) 11 | style.set_bg_color(lv.palette_lighten(lv.PALETTE.GREY, 1)) 12 | 13 | # Add a shadow 14 | style.set_shadow_width(8) 15 | style.set_shadow_color(lv.palette_main(lv.PALETTE.BLUE)) 16 | style.set_shadow_ofs_x(10) 17 | style.set_shadow_ofs_y(20) 18 | 19 | # Create an object with the new style 20 | obj = lv.obj(lv.scr_act()) 21 | obj.add_style(style, 0) 22 | obj.center() 23 | 24 | -------------------------------------------------------------------------------- /lib/lvgl/examples/styles/lv_example_style_6.c: -------------------------------------------------------------------------------- 1 | #include "../lv_examples.h" 2 | #if LV_BUILD_EXAMPLES && LV_USE_IMG 3 | 4 | /** 5 | * Using the Image style properties 6 | */ 7 | void lv_example_style_6(void) 8 | { 9 | static lv_style_t style; 10 | lv_style_init(&style); 11 | 12 | /*Set a background color and a radius*/ 13 | lv_style_set_radius(&style, 5); 14 | lv_style_set_bg_opa(&style, LV_OPA_COVER); 15 | lv_style_set_bg_color(&style, lv_palette_lighten(LV_PALETTE_GREY, 3)); 16 | lv_style_set_border_width(&style, 2); 17 | lv_style_set_border_color(&style, lv_palette_main(LV_PALETTE_BLUE)); 18 | 19 | lv_style_set_img_recolor(&style, lv_palette_main(LV_PALETTE_BLUE)); 20 | lv_style_set_img_recolor_opa(&style, LV_OPA_50); 21 | lv_style_set_transform_angle(&style, 300); 22 | 23 | /*Create an object with the new style*/ 24 | lv_obj_t * obj = lv_img_create(lv_scr_act()); 25 | lv_obj_add_style(obj, &style, 0); 26 | 27 | LV_IMG_DECLARE(img_cogwheel_argb); 28 | lv_img_set_src(obj, &img_cogwheel_argb); 29 | 30 | lv_obj_center(obj); 31 | } 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /lib/lvgl/examples/styles/lv_example_style_7.c: -------------------------------------------------------------------------------- 1 | #include "../lv_examples.h" 2 | #if LV_BUILD_EXAMPLES && LV_USE_ARC 3 | 4 | /** 5 | * Using the Arc style properties 6 | */ 7 | void lv_example_style_7(void) 8 | { 9 | static lv_style_t style; 10 | lv_style_init(&style); 11 | 12 | lv_style_set_arc_color(&style, lv_palette_main(LV_PALETTE_RED)); 13 | lv_style_set_arc_width(&style, 4); 14 | 15 | /*Create an object with the new style*/ 16 | lv_obj_t * obj = lv_arc_create(lv_scr_act()); 17 | lv_obj_add_style(obj, &style, 0); 18 | lv_obj_center(obj); 19 | } 20 | #endif 21 | 22 | -------------------------------------------------------------------------------- /lib/lvgl/examples/styles/lv_example_style_7.py: -------------------------------------------------------------------------------- 1 | # 2 | # Using the Arc style properties 3 | # 4 | style = lv.style_t() 5 | style.init() 6 | 7 | style.set_arc_color(lv.palette_main(lv.PALETTE.RED)) 8 | style.set_arc_width(4) 9 | 10 | # Create an object with the new style 11 | obj = lv.arc(lv.scr_act()) 12 | obj.add_style(style, 0) 13 | obj.center() 14 | 15 | 16 | -------------------------------------------------------------------------------- /lib/lvgl/examples/styles/lv_example_style_8.c: -------------------------------------------------------------------------------- 1 | #include "../lv_examples.h" 2 | #if LV_BUILD_EXAMPLES && LV_USE_LABEL 3 | 4 | /** 5 | * Using the text style properties 6 | */ 7 | void lv_example_style_8(void) 8 | { 9 | static lv_style_t style; 10 | lv_style_init(&style); 11 | 12 | lv_style_set_radius(&style, 5); 13 | lv_style_set_bg_opa(&style, LV_OPA_COVER); 14 | lv_style_set_bg_color(&style, lv_palette_lighten(LV_PALETTE_GREY, 2)); 15 | lv_style_set_border_width(&style, 2); 16 | lv_style_set_border_color(&style, lv_palette_main(LV_PALETTE_BLUE)); 17 | lv_style_set_pad_all(&style, 10); 18 | 19 | lv_style_set_text_color(&style, lv_palette_main(LV_PALETTE_BLUE)); 20 | lv_style_set_text_letter_space(&style, 5); 21 | lv_style_set_text_line_space(&style, 20); 22 | lv_style_set_text_decor(&style, LV_TEXT_DECOR_UNDERLINE); 23 | 24 | /*Create an object with the new style*/ 25 | lv_obj_t * obj = lv_label_create(lv_scr_act()); 26 | lv_obj_add_style(obj, &style, 0); 27 | lv_label_set_text(obj, "Text of\n" 28 | "a label"); 29 | 30 | lv_obj_center(obj); 31 | } 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /lib/lvgl/examples/styles/lv_example_style_8.py: -------------------------------------------------------------------------------- 1 | # 2 | # Using the text style properties 3 | # 4 | 5 | style = lv.style_t() 6 | style.init() 7 | 8 | style.set_radius(5) 9 | style.set_bg_opa(lv.OPA.COVER) 10 | style.set_bg_color(lv.palette_lighten(lv.PALETTE.GREY, 3)) 11 | style.set_border_width(2) 12 | style.set_border_color(lv.palette_main(lv.PALETTE.BLUE)) 13 | style.set_pad_all(10) 14 | 15 | style.set_text_color(lv.palette_main(lv.PALETTE.BLUE)) 16 | style.set_text_letter_space(5) 17 | style.set_text_line_space(20) 18 | style.set_text_decor(lv.TEXT_DECOR.UNDERLINE) 19 | 20 | # Create an object with the new style 21 | obj = lv.label(lv.scr_act()) 22 | obj.add_style(style, 0) 23 | obj.set_text("Text of\n" 24 | "a label"); 25 | 26 | obj.center() 27 | 28 | -------------------------------------------------------------------------------- /lib/lvgl/examples/styles/lv_example_style_9.c: -------------------------------------------------------------------------------- 1 | #include "../lv_examples.h" 2 | #if LV_BUILD_EXAMPLES && LV_USE_LINE 3 | 4 | /** 5 | * Using the line style properties 6 | */ 7 | void lv_example_style_9(void) 8 | { 9 | static lv_style_t style; 10 | lv_style_init(&style); 11 | 12 | lv_style_set_line_color(&style, lv_palette_main(LV_PALETTE_GREY)); 13 | lv_style_set_line_width(&style, 6); 14 | lv_style_set_line_rounded(&style, true); 15 | 16 | /*Create an object with the new style*/ 17 | lv_obj_t * obj = lv_line_create(lv_scr_act()); 18 | lv_obj_add_style(obj, &style, 0); 19 | 20 | static lv_point_t p[] = {{10, 30}, {30, 50}, {100, 0}}; 21 | lv_line_set_points(obj, p, 3); 22 | 23 | lv_obj_center(obj); 24 | } 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /lib/lvgl/examples/styles/lv_example_style_9.py: -------------------------------------------------------------------------------- 1 | # 2 | # Using the line style properties 3 | # 4 | 5 | style = lv.style_t() 6 | style.init() 7 | 8 | style.set_line_color(lv.palette_main(lv.PALETTE.GREY)) 9 | style.set_line_width(6) 10 | style.set_line_rounded(True) 11 | 12 | # Create an object with the new style 13 | obj = lv.line(lv.scr_act()) 14 | obj.add_style(style, 0) 15 | p = [ {"x":10, "y":30}, 16 | {"x":30, "y":50}, 17 | {"x":100, "y":0}] 18 | 19 | obj.set_points(p, 3) 20 | 21 | obj.center() 22 | 23 | -------------------------------------------------------------------------------- /lib/lvgl/examples/test_ex.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cat ../../header.py $1 > test.py 3 | chmod +x test.py 4 | ./test.py 5 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/animimg/index.rst: -------------------------------------------------------------------------------- 1 | 2 | Simple Animation Image 3 | """""""""""""""" 4 | 5 | .. lv_example:: widgets/animimg/lv_example_animimg_1 6 | :language: c 7 | :description: A simple example to demonstrate the use of an animation image. 8 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/animimg/lv_example_animimg_1.c: -------------------------------------------------------------------------------- 1 | #include "../../lv_examples.h" 2 | #if LV_USE_ANIMIMG && LV_BUILD_EXAMPLES 3 | LV_IMG_DECLARE(animimg001) 4 | LV_IMG_DECLARE(animimg002) 5 | LV_IMG_DECLARE(animimg003) 6 | 7 | static const lv_img_dsc_t* anim_imgs[3] = { 8 | &animimg001, 9 | &animimg002, 10 | &animimg003, 11 | }; 12 | 13 | void lv_example_animimg_1(void) 14 | { 15 | lv_obj_t * animimg0 = lv_animimg_create(lv_scr_act()); 16 | lv_obj_center(animimg0); 17 | lv_animimg_set_src(animimg0, (lv_img_dsc_t**) anim_imgs, 3); 18 | lv_animimg_set_duration(animimg0, 1000); 19 | lv_animimg_set_repeat_count(animimg0, LV_ANIM_REPEAT_INFINITE); 20 | lv_animimg_start(animimg0); 21 | } 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/arc/index.rst: -------------------------------------------------------------------------------- 1 | 2 | Simple Arc 3 | """""""""""""""" 4 | 5 | .. lv_example:: widgets/arc/lv_example_arc_1 6 | :language: c 7 | :description: A simple example to demonstrate the use of an arc. 8 | 9 | Loader with Arc 10 | """""""""""""""" 11 | 12 | .. lv_example:: widgets/arc/lv_example_arc_2 13 | :language: c 14 | 15 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/arc/lv_example_arc_1.c: -------------------------------------------------------------------------------- 1 | #include "../../lv_examples.h" 2 | 3 | #if LV_USE_ARC && LV_BUILD_EXAMPLES 4 | 5 | void lv_example_arc_1(void) 6 | { 7 | /*Create an Arc*/ 8 | lv_obj_t * arc = lv_arc_create(lv_scr_act()); 9 | lv_obj_set_size(arc, 150, 150); 10 | lv_arc_set_rotation(arc, 135); 11 | lv_arc_set_bg_angles(arc, 0, 270); 12 | lv_arc_set_value(arc, 40); 13 | lv_obj_center(arc); 14 | } 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/arc/lv_example_arc_1.py: -------------------------------------------------------------------------------- 1 | # Create an Arc 2 | arc = lv.arc(lv.scr_act()) 3 | arc.set_end_angle(200) 4 | arc.set_size(150, 150) 5 | arc.center() 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/arc/lv_example_arc_2.c: -------------------------------------------------------------------------------- 1 | #include "../../lv_examples.h" 2 | 3 | #if LV_USE_ARC && LV_BUILD_EXAMPLES 4 | 5 | static void set_angle(void * obj, int32_t v) 6 | { 7 | lv_arc_set_value(obj, v); 8 | } 9 | 10 | /** 11 | * Create an arc which acts as a loader. 12 | */ 13 | void lv_example_arc_2(void) 14 | { 15 | /*Create an Arc*/ 16 | lv_obj_t * arc = lv_arc_create(lv_scr_act()); 17 | lv_arc_set_rotation(arc, 270); 18 | lv_arc_set_bg_angles(arc, 0, 360); 19 | lv_obj_remove_style(arc, NULL, LV_PART_KNOB); /*Be sure the knob is not displayed*/ 20 | lv_obj_clear_flag(arc, LV_OBJ_FLAG_CLICKABLE); /*To not allow adjusting by click*/ 21 | lv_obj_center(arc); 22 | 23 | lv_anim_t a; 24 | lv_anim_init(&a); 25 | lv_anim_set_var(&a, arc); 26 | lv_anim_set_exec_cb(&a, set_angle); 27 | lv_anim_set_time(&a, 1000); 28 | lv_anim_set_repeat_count(&a, LV_ANIM_REPEAT_INFINITE); /*Just for the demo*/ 29 | lv_anim_set_repeat_delay(&a, 500); 30 | lv_anim_set_values(&a, 0, 100); 31 | lv_anim_start(&a); 32 | 33 | 34 | 35 | } 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/arc/lv_example_arc_2.py: -------------------------------------------------------------------------------- 1 | # 2 | # An `lv_timer` to call periodically to set the angles of the arc 3 | # 4 | class ArcLoader(): 5 | def __init__(self): 6 | self.a = 270 7 | 8 | def arc_loader_cb(self,tim,arc): 9 | # print(tim,arc) 10 | self.a += 5 11 | 12 | arc.set_end_angle(self.a) 13 | 14 | if self.a >= 270 + 360: 15 | tim._del() 16 | 17 | 18 | # 19 | # Create an arc which acts as a loader. 20 | # 21 | 22 | # Create an Arc 23 | arc = lv.arc(lv.scr_act()) 24 | arc.set_bg_angles(0, 360) 25 | arc.set_angles(270, 270) 26 | arc.center() 27 | 28 | # create the loader 29 | arc_loader = ArcLoader() 30 | 31 | # Create an `lv_timer` to update the arc. 32 | 33 | timer = lv.timer_create_basic() 34 | timer.set_period(20) 35 | timer.set_cb(lambda src: arc_loader.arc_loader_cb(timer,arc)) 36 | 37 | 38 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/bar/index.rst: -------------------------------------------------------------------------------- 1 | Simple Bar 2 | """""""""""""""" 3 | 4 | .. lv_example:: widgets/bar/lv_example_bar_1 5 | :language: c 6 | 7 | Styling a bar 8 | """""""""""""""" 9 | 10 | .. lv_example:: widgets/bar/lv_example_bar_2 11 | :language: c 12 | 13 | Temperature meter 14 | """""""""""""""""" 15 | 16 | .. lv_example:: widgets/bar/lv_example_bar_3 17 | :language: c 18 | 19 | Stripe pattern and range value 20 | """""""""""""""""""""""""""""""" 21 | 22 | .. lv_example:: widgets/bar/lv_example_bar_4 23 | :language: c 24 | 25 | Bar with LTR and RTL base direction 26 | """""""""""""""""""""""""""""""""""" 27 | 28 | .. lv_example:: widgets/bar/lv_example_bar_5 29 | :language: c 30 | 31 | Custom drawer to show the current value 32 | """"""""""""""""""""""""""""""""""""""" 33 | 34 | .. lv_example:: widgets/bar/lv_example_bar_6 35 | :language: c 36 | 37 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/bar/lv_example_bar_1.c: -------------------------------------------------------------------------------- 1 | #include "../../lv_examples.h" 2 | #if LV_USE_BAR && LV_BUILD_EXAMPLES 3 | 4 | void lv_example_bar_1(void) 5 | { 6 | lv_obj_t * bar1 = lv_bar_create(lv_scr_act()); 7 | lv_obj_set_size(bar1, 200, 20); 8 | lv_obj_center(bar1); 9 | lv_bar_set_value(bar1, 70, LV_ANIM_OFF); 10 | } 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/bar/lv_example_bar_1.py: -------------------------------------------------------------------------------- 1 | bar1 = lv.bar(lv.scr_act()) 2 | bar1.set_size(200, 20) 3 | bar1.center() 4 | bar1.set_value(70, lv.ANIM.OFF) 5 | 6 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/bar/lv_example_bar_2.py: -------------------------------------------------------------------------------- 1 | # 2 | # Example of styling the bar 3 | # 4 | style_bg = lv.style_t() 5 | style_indic = lv.style_t() 6 | 7 | style_bg.init() 8 | style_bg.set_border_color(lv.palette_main(lv.PALETTE.BLUE)) 9 | style_bg.set_border_width(2) 10 | style_bg.set_pad_all(6) # To make the indicator smaller 11 | style_bg.set_radius(6) 12 | style_bg.set_anim_time(1000) 13 | 14 | style_indic.init() 15 | style_indic.set_bg_opa(lv.OPA.COVER) 16 | style_indic.set_bg_color(lv.palette_main(lv.PALETTE.BLUE)) 17 | style_indic.set_radius(3) 18 | 19 | bar = lv.bar(lv.scr_act()) 20 | bar.remove_style_all() # To have a clean start 21 | bar.add_style(style_bg, 0) 22 | bar.add_style(style_indic, lv.PART.INDICATOR) 23 | 24 | bar.set_size(200, 20) 25 | bar.center() 26 | bar.set_value(100, lv.ANIM.ON) 27 | 28 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/bar/lv_example_bar_3.py: -------------------------------------------------------------------------------- 1 | def set_temp(bar, temp): 2 | bar.set_value(temp, lv.ANIM.ON) 3 | 4 | # 5 | # A temperature meter example 6 | # 7 | 8 | 9 | style_indic = lv.style_t() 10 | 11 | style_indic.init() 12 | style_indic.set_bg_opa(lv.OPA.COVER) 13 | style_indic.set_bg_color(lv.palette_main(lv.PALETTE.RED)) 14 | style_indic.set_bg_grad_color(lv.palette_main(lv.PALETTE.BLUE)) 15 | style_indic.set_bg_grad_dir(lv.GRAD_DIR.VER) 16 | 17 | bar = lv.bar(lv.scr_act()) 18 | bar.add_style(style_indic, lv.PART.INDICATOR) 19 | bar.set_size(20, 200) 20 | bar.center() 21 | bar.set_range(-20, 40) 22 | 23 | a = lv.anim_t() 24 | a.init() 25 | a.set_time(3000) 26 | a.set_playback_time(3000) 27 | a.set_var(bar) 28 | a.set_values(-20, 40) 29 | a.set_repeat_count(lv.ANIM_REPEAT.INFINITE) 30 | a.set_custom_exec_cb(lambda a, val: set_temp(bar,val)) 31 | lv.anim_t.start(a) 32 | 33 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/bar/lv_example_bar_4.c: -------------------------------------------------------------------------------- 1 | #include "../../lv_examples.h" 2 | #if LV_USE_BAR && LV_BUILD_EXAMPLES 3 | 4 | /** 5 | * Bar with stripe pattern and ranged value 6 | */ 7 | void lv_example_bar_4(void) 8 | { 9 | LV_IMG_DECLARE(img_skew_strip); 10 | static lv_style_t style_indic; 11 | 12 | lv_style_init(&style_indic); 13 | lv_style_set_bg_img_src(&style_indic, &img_skew_strip); 14 | lv_style_set_bg_img_tiled(&style_indic, true); 15 | lv_style_set_bg_img_opa(&style_indic, LV_OPA_30); 16 | 17 | lv_obj_t * bar = lv_bar_create(lv_scr_act()); 18 | lv_obj_add_style(bar, &style_indic, LV_PART_INDICATOR); 19 | 20 | lv_obj_set_size(bar, 260, 20); 21 | lv_obj_center(bar); 22 | lv_bar_set_mode(bar, LV_BAR_MODE_RANGE); 23 | lv_bar_set_value(bar, 90, LV_ANIM_OFF); 24 | lv_bar_set_start_value(bar, 20, LV_ANIM_OFF); 25 | } 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/bar/lv_example_bar_5.c: -------------------------------------------------------------------------------- 1 | #include "../../lv_examples.h" 2 | #if LV_USE_BAR && LV_BUILD_EXAMPLES 3 | 4 | /** 5 | * Bar with LTR and RTL base direction 6 | */ 7 | void lv_example_bar_5(void) 8 | { 9 | lv_obj_t * label; 10 | 11 | 12 | lv_obj_t * bar_ltr = lv_bar_create(lv_scr_act()); 13 | lv_obj_set_size(bar_ltr, 200, 20); 14 | lv_bar_set_value(bar_ltr, 70, LV_ANIM_OFF); 15 | lv_obj_align(bar_ltr, LV_ALIGN_CENTER, 0, -30); 16 | 17 | label = lv_label_create(lv_scr_act()); 18 | lv_label_set_text(label, "Left to Right base direction"); 19 | lv_obj_align_to(label, bar_ltr, LV_ALIGN_OUT_TOP_MID, 0, -5); 20 | 21 | lv_obj_t * bar_rtl = lv_bar_create(lv_scr_act()); 22 | lv_obj_set_style_base_dir(bar_rtl, LV_BASE_DIR_RTL, 0); 23 | lv_obj_set_size(bar_rtl, 200, 20); 24 | lv_bar_set_value(bar_rtl, 70, LV_ANIM_OFF); 25 | lv_obj_align(bar_rtl, LV_ALIGN_CENTER, 0, 30); 26 | 27 | label = lv_label_create(lv_scr_act()); 28 | lv_label_set_text(label, "Right to Left base direction"); 29 | lv_obj_align_to(label, bar_rtl, LV_ALIGN_OUT_TOP_MID, 0, -5); 30 | } 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/bar/lv_example_bar_5.py: -------------------------------------------------------------------------------- 1 | # 2 | # Bar with LTR and RTL base direction 3 | # 4 | 5 | bar_ltr = lv.bar(lv.scr_act()) 6 | bar_ltr.set_size(200, 20) 7 | bar_ltr.set_value(70, lv.ANIM.OFF) 8 | bar_ltr.align(lv.ALIGN.CENTER, 0, -30) 9 | 10 | label = lv.label(lv.scr_act()) 11 | label.set_text("Left to Right base direction") 12 | label.align_to(bar_ltr, lv.ALIGN.OUT_TOP_MID, 0, -5) 13 | 14 | bar_rtl = lv.bar(lv.scr_act()) 15 | bar_rtl.set_style_base_dir(lv.BASE_DIR.RTL,0) 16 | bar_rtl.set_size(200, 20) 17 | bar_rtl.set_value(70, lv.ANIM.OFF) 18 | bar_rtl.align(lv.ALIGN.CENTER, 0, 30) 19 | 20 | label = lv.label(lv.scr_act()) 21 | label.set_text("Right to Left base direction") 22 | label.align_to(bar_rtl, lv.ALIGN.OUT_TOP_MID, 0, -5) 23 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/btn/index.rst: -------------------------------------------------------------------------------- 1 | 2 | Simple Buttons 3 | """""""""""""""" 4 | 5 | .. lv_example:: widgets/btn/lv_example_btn_1 6 | :language: c 7 | 8 | 9 | Styling buttons 10 | """""""""""""""" 11 | 12 | .. lv_example:: widgets/btn/lv_example_btn_2 13 | :language: c 14 | 15 | Gummy button 16 | """""""""""""""" 17 | 18 | .. lv_example:: widgets/btn/lv_example_btn_3 19 | :language: c 20 | 21 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/btn/lv_example_btn_1.py: -------------------------------------------------------------------------------- 1 | def event_handler(evt): 2 | code = evt.get_code() 3 | 4 | if code == lv.EVENT.CLICKED: 5 | print("Clicked event seen") 6 | elif code == lv.EVENT.VALUE_CHANGED: 7 | print("Value changed seen") 8 | 9 | # create a simple button 10 | btn1 = lv.btn(lv.scr_act()) 11 | 12 | # attach the callback 13 | btn1.add_event_cb(event_handler,lv.EVENT.ALL, None) 14 | 15 | btn1.align(lv.ALIGN.CENTER,0,-40) 16 | label=lv.label(btn1) 17 | label.set_text("Button") 18 | 19 | # create a toggle button 20 | btn2 = lv.btn(lv.scr_act()) 21 | 22 | # attach the callback 23 | #btn2.add_event_cb(event_handler,lv.EVENT.VALUE_CHANGED,None) 24 | btn2.add_event_cb(event_handler,lv.EVENT.ALL, None) 25 | 26 | btn2.align(lv.ALIGN.CENTER,0,40) 27 | btn2.add_flag(lv.obj.FLAG.CHECKABLE) 28 | btn2.set_height(lv.SIZE.CONTENT) 29 | 30 | label=lv.label(btn2) 31 | label.set_text("Toggle") 32 | label.center() 33 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/btnmatrix/index.rst: -------------------------------------------------------------------------------- 1 | 2 | Simple Button matrix 3 | """""""""""""""""""""" 4 | 5 | .. lv_example:: widgets/btnmatrix/lv_example_btnmatrix_1 6 | :language: c 7 | 8 | 9 | Custom buttons 10 | """""""""""""""""""""" 11 | 12 | .. lv_example:: widgets/btnmatrix/lv_example_btnmatrix_2 13 | :language: c 14 | 15 | 16 | Pagination 17 | """""""""""""""""""""" 18 | 19 | .. lv_example:: widgets/btnmatrix/lv_example_btnmatrix_3 20 | :language: c 21 | 22 | 23 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/btnmatrix/lv_example_btnmatrix_1.py: -------------------------------------------------------------------------------- 1 | def event_handler(evt): 2 | code = evt.get_code() 3 | obj = evt.get_target() 4 | 5 | if code == lv.EVENT.VALUE_CHANGED : 6 | id = obj.get_selected_btn() 7 | txt = obj.get_btn_text(id) 8 | 9 | print("%s was pressed"%txt) 10 | 11 | btnm_map = ["1", "2", "3", "4", "5", "\n", 12 | "6", "7", "8", "9", "0", "\n", 13 | "Action1", "Action2", ""] 14 | 15 | btnm1 = lv.btnmatrix(lv.scr_act()) 16 | btnm1.set_map(btnm_map) 17 | btnm1.set_btn_width(10, 2) # Make "Action1" twice as wide as "Action2" 18 | btnm1.set_btn_ctrl(10, lv.btnmatrix.CTRL.CHECKABLE) 19 | btnm1.set_btn_ctrl(11, lv.btnmatrix.CTRL.CHECKED) 20 | btnm1.align(lv.ALIGN.CENTER, 0, 0) 21 | btnm1.add_event_cb(event_handler, lv.EVENT.ALL, None) 22 | 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/calendar/index.rst: -------------------------------------------------------------------------------- 1 | 2 | Calendar with header 3 | """""""""""""""""""""" 4 | 5 | .. lv_example:: widgets/calendar/lv_example_calendar_1 6 | :language: c 7 | 8 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/calendar/lv_example_calendar_1.py: -------------------------------------------------------------------------------- 1 | 2 | def event_handler(evt): 3 | code = evt.get_code() 4 | 5 | if code == lv.EVENT.VALUE_CHANGED: 6 | source = evt.get_current_target() 7 | date = lv.calendar_date_t() 8 | if source.get_pressed_date(date) == lv.RES.OK: 9 | calendar.set_today_date(date.year, date.month, date.day) 10 | print("Clicked date: %02d.%02d.%02d"%(date.day, date.month, date.year)) 11 | 12 | 13 | calendar = lv.calendar(lv.scr_act()) 14 | calendar.set_size(200, 200) 15 | calendar.align(lv.ALIGN.CENTER, 0, 20) 16 | calendar.add_event_cb(event_handler, lv.EVENT.ALL, None) 17 | 18 | calendar.set_today_date(2021, 02, 23) 19 | calendar.set_showed_date(2021, 02) 20 | 21 | # Highlight a few days 22 | highlighted_days=[ 23 | lv.calendar_date_t({'year':2021, 'month':2, 'day':6}), 24 | lv.calendar_date_t({'year':2021, 'month':2, 'day':11}), 25 | lv.calendar_date_t({'year':2021, 'month':2, 'day':22}) 26 | ] 27 | 28 | calendar.set_highlighted_dates(highlighted_days, len(highlighted_days)) 29 | 30 | lv.calendar_header_dropdown(calendar) 31 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/canvas/index.rst: -------------------------------------------------------------------------------- 1 | 2 | Drawing on the Canvas and rotate 3 | """""""""""""""""""""""""""""""""" 4 | 5 | .. lv_example:: widgets/canvas/lv_example_canvas_1 6 | :language: c 7 | 8 | Transparent Canvas with chroma keying 9 | """""""""""""""""""""""""""""""""""""" 10 | 11 | .. lv_example:: widgets/canvas/lv_example_canvas_2 12 | :language: c 13 | 14 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/chart/lv_example_chart_1.py: -------------------------------------------------------------------------------- 1 | # Create a chart 2 | chart = lv.chart(lv.scr_act()) 3 | chart.set_size(200, 150) 4 | chart.center() 5 | chart.set_type(lv.chart.TYPE.LINE) # Show lines and points too 6 | 7 | # Add two data series 8 | ser1 = chart.add_series(lv.palette_main(lv.PALETTE.RED), lv.chart.AXIS.PRIMARY_Y); 9 | ser2 = chart.add_series(lv.palette_main(lv.PALETTE.GREEN), lv.chart.AXIS.SECONDARY_Y) 10 | print(ser2) 11 | # Set next points on ser1 12 | chart.set_next_value(ser1,10) 13 | chart.set_next_value(ser1,10) 14 | chart.set_next_value(ser1,10) 15 | chart.set_next_value(ser1,10) 16 | chart.set_next_value(ser1,10) 17 | chart.set_next_value(ser1,10) 18 | chart.set_next_value(ser1,10) 19 | chart.set_next_value(ser1,30) 20 | chart.set_next_value(ser1,70) 21 | chart.set_next_value(ser1,90) 22 | 23 | # Directly set points on 'ser2' 24 | ser2.y_points = [90, 70, 65, 65, 65, 65, 65, 65, 65, 65] 25 | chart.refresh() # Required after direct set 26 | 27 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/chart/lv_example_chart_9.py: -------------------------------------------------------------------------------- 1 | import display_driver 2 | import lvgl as lv 3 | 4 | def add_data(t): 5 | chart.set_next_value(ser, lv.rand(10, 90)) 6 | 7 | p = chart.get_point_count() 8 | s = chart.get_x_start_point(ser) 9 | a = chart.get_y_array(ser) 10 | 11 | a[(s + 1) % p] = lv.CHART_POINT.NONE 12 | a[(s + 2) % p] = lv.CHART_POINT.NONE 13 | a[(s + 3) % p] = lv.CHART_POINT.NONE 14 | chart.refresh() 15 | 16 | # 17 | # Circular line chart with gap 18 | # 19 | chart = lv.chart(lv.scr_act()) 20 | 21 | chart.set_update_mode(lv.chart.UPDATE_MODE.CIRCULAR) 22 | chart.set_size(200, 150) 23 | chart.center() 24 | 25 | chart.set_point_count(30) 26 | ser = chart.add_series(lv.palette_main(lv.PALETTE.RED), lv.chart.AXIS.PRIMARY_Y) 27 | #Prefill with data 28 | for i in range(0, 30): 29 | chart.set_next_value(ser, lv.rand(10, 90)) 30 | 31 | lv.timer_create(add_data, 200, None) 32 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/checkbox/index.rst: -------------------------------------------------------------------------------- 1 | 2 | Simple Checkboxes 3 | """"""""""""""""" 4 | 5 | .. lv_example:: widgets/checkbox/lv_example_checkbox_1 6 | :language: c 7 | 8 | Checkboxes as radio buttons 9 | """"""""""""""""""""""""""" 10 | .. lv_example:: widgets/checkbox/lv_example_checkbox_2 11 | :language: c 12 | 13 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/colorwheel/index.rst: -------------------------------------------------------------------------------- 1 | 2 | Simple Colorwheel 3 | """"""""""""""""" 4 | 5 | .. lv_example:: widgets/colorwheel/lv_example_colorwheel_1 6 | :language: c 7 | 8 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/colorwheel/lv_example_colorwheel_1.c: -------------------------------------------------------------------------------- 1 | #include "../../lv_examples.h" 2 | #if LV_USE_COLORWHEEL && LV_BUILD_EXAMPLES 3 | 4 | void lv_example_colorwheel_1(void) 5 | { 6 | lv_obj_t * cw; 7 | 8 | cw = lv_colorwheel_create(lv_scr_act(), true); 9 | lv_obj_set_size(cw, 200, 200); 10 | lv_obj_center(cw); 11 | } 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/colorwheel/lv_example_colorwheel_1.py: -------------------------------------------------------------------------------- 1 | cw = lv.colorwheel(lv.scr_act(), True) 2 | cw.set_size(200, 200) 3 | cw.center() 4 | 5 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/dropdown/index.rst: -------------------------------------------------------------------------------- 1 | 2 | Simple Drop down list 3 | """""""""""""""""""""" 4 | 5 | .. lv_example:: widgets/dropdown/lv_example_dropdown_1 6 | :language: c 7 | 8 | Drop down in four directions 9 | """""""""""""""""""""""""""" 10 | 11 | .. lv_example:: widgets/dropdown/lv_example_dropdown_2 12 | :language: c 13 | 14 | 15 | Menu 16 | """""""""""" 17 | 18 | .. lv_example:: widgets/dropdown/lv_example_dropdown_3 19 | :language: c 20 | 21 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/dropdown/lv_example_dropdown_1.py: -------------------------------------------------------------------------------- 1 | def event_handler(e): 2 | code = e.get_code() 3 | obj = e.get_target() 4 | if code == lv.EVENT.VALUE_CHANGED: 5 | option = " "*10 # should be large enough to store the option 6 | obj.get_selected_str(option, len(option)) 7 | # .strip() removes trailing spaces 8 | print("Option: \"%s\"" % option.strip()) 9 | 10 | # Create a normal drop down list 11 | dd = lv.dropdown(lv.scr_act()) 12 | dd.set_options("\n".join([ 13 | "Apple", 14 | "Banana", 15 | "Orange", 16 | "Cherry", 17 | "Grape", 18 | "Raspberry", 19 | "Melon", 20 | "Orange", 21 | "Lemon", 22 | "Nuts"])) 23 | 24 | dd.align(lv.ALIGN.TOP_MID, 0, 20) 25 | dd.add_event_cb(event_handler, lv.EVENT.ALL, None) 26 | 27 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/dropdown/lv_example_dropdown_2.py: -------------------------------------------------------------------------------- 1 | # 2 | # Create a drop down, up, left and right menus 3 | # 4 | 5 | opts = "\n".join([ 6 | "Apple", 7 | "Banana", 8 | "Orange", 9 | "Melon", 10 | "Grape", 11 | "Raspberry"]) 12 | 13 | dd = lv.dropdown(lv.scr_act()) 14 | dd.set_options_static(opts) 15 | dd.align(lv.ALIGN.TOP_MID, 0, 10) 16 | dd = lv.dropdown(lv.scr_act()) 17 | dd.set_options_static(opts) 18 | dd.set_dir(lv.DIR.BOTTOM) 19 | dd.set_symbol(lv.SYMBOL.UP) 20 | dd.align(lv.ALIGN.BOTTOM_MID, 0, -10) 21 | 22 | dd = lv.dropdown(lv.scr_act()) 23 | dd.set_options_static(opts) 24 | dd.set_dir(lv.DIR.RIGHT) 25 | dd.set_symbol(lv.SYMBOL.RIGHT) 26 | dd.align(lv.ALIGN.LEFT_MID, 10, 0) 27 | 28 | dd = lv.dropdown(lv.scr_act()) 29 | dd.set_options_static(opts) 30 | dd.set_dir(lv.DIR.LEFT) 31 | dd.set_symbol(lv.SYMBOL.LEFT) 32 | dd.align(lv.ALIGN.RIGHT_MID, -10, 0) 33 | 34 | 35 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/img/index.rst: -------------------------------------------------------------------------------- 1 | 2 | Image from variable and symbol 3 | """"""""""""""""""""""""""""""" 4 | 5 | .. lv_example:: widgets/img/lv_example_img_1 6 | :language: c 7 | 8 | 9 | Image recoloring 10 | """""""""""""""" 11 | 12 | .. lv_example:: widgets/img/lv_example_img_2 13 | :language: c 14 | 15 | 16 | Rotate and zoom 17 | """""""""""""""" 18 | 19 | .. lv_example:: widgets/img/lv_example_img_3 20 | :language: c 21 | 22 | Image offset and styling 23 | """""""""""""""""""""""" 24 | 25 | .. lv_example:: widgets/img/lv_example_img_4 26 | :language: c 27 | 28 | 29 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/img/lv_example_img_1.c: -------------------------------------------------------------------------------- 1 | #include "../../lv_examples.h" 2 | #if LV_USE_IMG && LV_BUILD_EXAMPLES 3 | 4 | 5 | void lv_example_img_1(void) 6 | { 7 | LV_IMG_DECLARE(img_cogwheel_argb); 8 | lv_obj_t * img1 = lv_img_create(lv_scr_act()); 9 | lv_img_set_src(img1, &img_cogwheel_argb); 10 | lv_obj_align(img1, LV_ALIGN_CENTER, 0, -20); 11 | lv_obj_set_size(img1, 200, 200); 12 | 13 | lv_obj_t * img2 = lv_img_create(lv_scr_act()); 14 | lv_img_set_src(img2, LV_SYMBOL_OK "Accept"); 15 | lv_obj_align_to(img2, img1, LV_ALIGN_OUT_BOTTOM_MID, 0, 20); 16 | } 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/img/lv_example_img_1.py: -------------------------------------------------------------------------------- 1 | #!/opt/bin/lv_micropython -i 2 | import usys as sys 3 | import lvgl as lv 4 | import display_driver 5 | from imagetools import get_png_info, open_png 6 | 7 | # Register PNG image decoder 8 | decoder = lv.img.decoder_create() 9 | decoder.info_cb = get_png_info 10 | decoder.open_cb = open_png 11 | 12 | # Create an image from the png file 13 | try: 14 | with open('../../assets/img_cogwheel_argb.png','rb') as f: 15 | png_data = f.read() 16 | except: 17 | print("Could not find img_cogwheel_argb.png") 18 | sys.exit() 19 | 20 | img_cogwheel_argb = lv.img_dsc_t({ 21 | 'data_size': len(png_data), 22 | 'data': png_data 23 | }) 24 | 25 | img1 = lv.img(lv.scr_act()) 26 | img1.set_src(img_cogwheel_argb) 27 | img1.align(lv.ALIGN.CENTER, 0, -20) 28 | img1.set_size(200, 200) 29 | 30 | img2 = lv.img(lv.scr_act()) 31 | img2.set_src(lv.SYMBOL.OK + "Accept") 32 | img2.align_to(img1, lv.ALIGN.OUT_BOTTOM_MID, 0, 20) 33 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/imgbtn/index.rst: -------------------------------------------------------------------------------- 1 | 2 | Simple Image button 3 | """"""""""""""""""" 4 | 5 | .. lv_example:: widgets/imgbtn/lv_example_imgbtn_1 6 | :language: c 7 | 8 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/keyboard/index.rst: -------------------------------------------------------------------------------- 1 | 2 | Keyboard with text area 3 | """"""""""""""""""""""" 4 | 5 | .. lv_example:: widgets/keyboard/lv_example_keyboard_1 6 | :language: c 7 | 8 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/keyboard/lv_example_keyboard_1.py: -------------------------------------------------------------------------------- 1 | def ta_event_cb(e,kb): 2 | code = e.get_code() 3 | ta = e.get_target() 4 | if code == lv.EVENT.FOCUSED: 5 | kb.set_textarea(ta) 6 | kb.clear_flag(lv.obj.FLAG.HIDDEN) 7 | 8 | if code == lv.EVENT.DEFOCUSED: 9 | kb.set_textarea(None) 10 | kb.add_flag(lv.obj.FLAG.HIDDEN) 11 | 12 | # Create a keyboard to use it with an of the text areas 13 | kb = lv.keyboard(lv.scr_act()) 14 | 15 | # Create a text area. The keyboard will write here 16 | ta = lv.textarea(lv.scr_act()) 17 | ta.set_width(200) 18 | ta.align(lv.ALIGN.TOP_LEFT, 10, 10) 19 | ta.add_event_cb(lambda e: ta_event_cb(e,kb), lv.EVENT.ALL, None) 20 | ta.set_placeholder_text("Hello") 21 | 22 | ta = lv.textarea(lv.scr_act()) 23 | ta.set_width(200) 24 | ta.align(lv.ALIGN.TOP_RIGHT, -10, 10) 25 | ta.add_event_cb(lambda e: ta_event_cb(e,kb), lv.EVENT.ALL, None) 26 | 27 | kb.set_textarea(ta) 28 | 29 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/label/index.rst: -------------------------------------------------------------------------------- 1 | 2 | Line wrap, recoloring and scrolling 3 | """"""""""""""""""""""""""""""""""" 4 | 5 | .. lv_example:: widgets/label/lv_example_label_1 6 | :language: c 7 | 8 | Text shadow 9 | """""""""""" 10 | 11 | .. lv_example:: widgets/label/lv_example_label_2 12 | :language: c 13 | 14 | Show LTR, RTL and Chinese texts 15 | """""""""""""""""""""""""""""""""""" 16 | 17 | .. lv_example:: widgets/label/lv_example_label_3 18 | :language: c 19 | 20 | Draw label with gradient color 21 | """""""""""""""""""""""""""""""""""" 22 | 23 | .. lv_example:: widgets/label/lv_example_label_4 24 | :language: c 25 | 26 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/label/lv_example_label_1.py: -------------------------------------------------------------------------------- 1 | # 2 | # Show line wrap, re-color, line align and text scrolling. 3 | # 4 | label1 = lv.label(lv.scr_act()) 5 | label1.set_long_mode(lv.label.LONG.WRAP); # Break the long lines*/ 6 | label1.set_recolor(True) # Enable re-coloring by commands in the text 7 | label1.set_text("#0000ff Re-color# #ff00ff words# #ff0000 of a# label, align the lines to the center" 8 | "and wrap long text automatically.") 9 | label1.set_width(150) # Set smaller width to make the lines wrap 10 | label1.set_style_text_align(lv.ALIGN.CENTER, 0) 11 | label1.align(lv.ALIGN.CENTER, 0, -40) 12 | 13 | 14 | label2 = lv.label(lv.scr_act()) 15 | label2.set_long_mode(lv.label.LONG.SCROLL_CIRCULAR) # Circular scroll 16 | label2.set_width(150) 17 | label2.set_text("It is a circularly scrolling text. ") 18 | label2.align(lv.ALIGN.CENTER, 0, 40) 19 | 20 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/label/lv_example_label_2.py: -------------------------------------------------------------------------------- 1 | # 2 | # Create a fake text shadow 3 | # 4 | 5 | # Create a style for the shadow 6 | style_shadow = lv.style_t() 7 | style_shadow.init() 8 | style_shadow.set_text_opa(lv.OPA._30) 9 | style_shadow.set_text_color(lv.color_black()) 10 | 11 | # Create a label for the shadow first (it's in the background) 12 | shadow_label = lv.label(lv.scr_act()) 13 | shadow_label.add_style(style_shadow, 0) 14 | 15 | # Create the main label 16 | main_label = lv.label(lv.scr_act()) 17 | main_label.set_text("A simple method to create\n" 18 | "shadows on a text.\n" 19 | "It even works with\n\n" 20 | "newlines and spaces.") 21 | 22 | # Set the same text for the shadow label 23 | shadow_label.set_text(lv.label.get_text(main_label)) 24 | 25 | # Position the main label 26 | main_label.align(lv.ALIGN.CENTER, 0, 0) 27 | 28 | # Shift the second label down and to the right by 2 pixel 29 | shadow_label.align_to(main_label, lv.ALIGN.TOP_LEFT, 2, 2) 30 | 31 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/led/index.rst: -------------------------------------------------------------------------------- 1 | 2 | LED with custom style 3 | """"""""""""""""""""" 4 | 5 | .. lv_example:: widgets/led/lv_example_led_1 6 | :language: c 7 | 8 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/led/lv_example_led_1.c: -------------------------------------------------------------------------------- 1 | #include "../../lv_examples.h" 2 | #if LV_USE_LED && LV_BUILD_EXAMPLES 3 | 4 | /** 5 | * Create LED's with different brightness and color 6 | */ 7 | void lv_example_led_1(void) 8 | { 9 | /*Create a LED and switch it OFF*/ 10 | lv_obj_t * led1 = lv_led_create(lv_scr_act()); 11 | lv_obj_align(led1, LV_ALIGN_CENTER, -80, 0); 12 | lv_led_off(led1); 13 | 14 | /*Copy the previous LED and set a brightness*/ 15 | lv_obj_t * led2 = lv_led_create(lv_scr_act()); 16 | lv_obj_align(led2, LV_ALIGN_CENTER, 0, 0); 17 | lv_led_set_brightness(led2, 150); 18 | lv_led_set_color(led2, lv_palette_main(LV_PALETTE_RED)); 19 | 20 | /*Copy the previous LED and switch it ON*/ 21 | lv_obj_t * led3 = lv_led_create(lv_scr_act()); 22 | lv_obj_align(led3, LV_ALIGN_CENTER, 80, 0); 23 | lv_led_on(led3); 24 | } 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/led/lv_example_led_1.py: -------------------------------------------------------------------------------- 1 | # 2 | # Create LED's with different brightness and color 3 | # 4 | 5 | # Create a LED and switch it OFF 6 | led1 = lv.led(lv.scr_act()) 7 | led1.align(lv.ALIGN.CENTER, -80, 0) 8 | led1.off() 9 | 10 | # Copy the previous LED and set a brightness 11 | led2 = lv.led(lv.scr_act()) 12 | led2.align(lv.ALIGN.CENTER, 0, 0) 13 | led2.set_brightness(150) 14 | led2.set_color(lv.palette_main(lv.PALETTE.RED)) 15 | 16 | # Copy the previous LED and switch it ON 17 | led3 = lv.led(lv.scr_act()) 18 | led3.align(lv.ALIGN.CENTER, 80, 0) 19 | led3.on() 20 | 21 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/line/index.rst: -------------------------------------------------------------------------------- 1 | 2 | Simple Line 3 | """""""""""""""" 4 | 5 | .. lv_example:: widgets/line/lv_example_line_1 6 | :language: c 7 | 8 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/line/lv_example_line_1.c: -------------------------------------------------------------------------------- 1 | #include "../../lv_examples.h" 2 | #if LV_USE_LINE && LV_BUILD_EXAMPLES 3 | 4 | void lv_example_line_1(void) 5 | { 6 | /*Create an array for the points of the line*/ 7 | static lv_point_t line_points[] = { {5, 5}, {70, 70}, {120, 10}, {180, 60}, {240, 10} }; 8 | 9 | /*Create style*/ 10 | static lv_style_t style_line; 11 | lv_style_init(&style_line); 12 | lv_style_set_line_width(&style_line, 8); 13 | lv_style_set_line_color(&style_line, lv_palette_main(LV_PALETTE_BLUE)); 14 | lv_style_set_line_rounded(&style_line, true); 15 | 16 | /*Create a line and apply the new style*/ 17 | lv_obj_t * line1; 18 | line1 = lv_line_create(lv_scr_act()); 19 | lv_line_set_points(line1, line_points, 5); /*Set the points*/ 20 | lv_obj_add_style(line1, &style_line, 0); 21 | lv_obj_center(line1); 22 | } 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/line/lv_example_line_1.py: -------------------------------------------------------------------------------- 1 | # Create an array for the points of the line 2 | line_points = [ {"x":5, "y":5}, 3 | {"x":70, "y":70}, 4 | {"x":120, "y":10}, 5 | {"x":180, "y":60}, 6 | {"x":240, "y":10}] 7 | 8 | # Create style 9 | style_line = lv.style_t() 10 | style_line.init() 11 | style_line.set_line_width(8) 12 | style_line.set_line_color(lv.palette_main(lv.PALETTE.BLUE)) 13 | style_line.set_line_rounded(True) 14 | 15 | # Create a line and apply the new style 16 | line1 = lv.line(lv.scr_act()) 17 | line1.set_points(line_points, 5) # Set the points 18 | line1.add_style(style_line, 0) 19 | line1.center() 20 | 21 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/list/index.rst: -------------------------------------------------------------------------------- 1 | 2 | Simple List 3 | """""""""""""""" 4 | 5 | .. lv_example:: widgets/list/lv_example_list_1 6 | :language: c 7 | 8 | 9 | Sorting a List using up and down buttons 10 | """""""""""""""" 11 | 12 | .. lv_example:: widgets/list/lv_example_list_2 13 | :language: c 14 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/meter/index.rst: -------------------------------------------------------------------------------- 1 | 2 | Simple meter 3 | """"""""""""""""""""""" 4 | 5 | .. lv_example:: widgets/meter/lv_example_meter_1 6 | :language: c 7 | 8 | 9 | A meter with multiple arcs 10 | """"""""""""""""""""""""""" 11 | 12 | .. lv_example:: widgets/meter/lv_example_meter_2 13 | :language: c 14 | 15 | 16 | A clock from a meter 17 | """"""""""""""""""""""" 18 | 19 | .. lv_example:: widgets/meter/lv_example_meter_3 20 | :language: c 21 | 22 | 23 | Pie chart 24 | """"""""""""""""""""""" 25 | 26 | .. lv_example:: widgets/meter/lv_example_meter_4 27 | :language: c 28 | 29 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/msgbox/index.rst: -------------------------------------------------------------------------------- 1 | 2 | Simple Message box 3 | """"""""""""""""""" 4 | 5 | .. lv_example:: widgets/msgbox/lv_example_msgbox_1 6 | :language: c 7 | 8 | 9 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/msgbox/lv_example_msgbox_1.c: -------------------------------------------------------------------------------- 1 | #include "../../lv_examples.h" 2 | #if LV_USE_MSGBOX && LV_BUILD_EXAMPLES 3 | 4 | static void event_cb(lv_event_t * e) 5 | { 6 | lv_obj_t * obj = lv_event_get_current_target(e); 7 | LV_LOG_USER("Button %s clicked", lv_msgbox_get_active_btn_text(obj)); 8 | } 9 | 10 | void lv_example_msgbox_1(void) 11 | { 12 | static const char * btns[] ={"Apply", "Close", ""}; 13 | 14 | lv_obj_t * mbox1 = lv_msgbox_create(NULL, "Hello", "This is a message box with two buttons.", btns, true); 15 | lv_obj_add_event_cb(mbox1, event_cb, LV_EVENT_VALUE_CHANGED, NULL); 16 | lv_obj_center(mbox1); 17 | } 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/msgbox/lv_example_msgbox_1.py: -------------------------------------------------------------------------------- 1 | def event_cb(e): 2 | mbox = e.get_current_target() 3 | print("Button %s clicked" % mbox.get_active_btn_text()) 4 | 5 | btns = ["Apply", "Close", ""] 6 | 7 | mbox1 = lv.msgbox(lv.scr_act(), "Hello", "This is a message box with two buttons.", btns, True) 8 | mbox1.add_event_cb(event_cb, lv.EVENT.VALUE_CHANGED, None) 9 | mbox1.center() 10 | 11 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/obj/index.rst: -------------------------------------------------------------------------------- 1 | 2 | Base objects with custom styles 3 | """""""""""""""""""""""""""""""" 4 | 5 | .. lv_example:: widgets/obj/lv_example_obj_1 6 | :language: c 7 | 8 | Make an object draggable 9 | """""""""""""""""""""""""""" 10 | 11 | .. lv_example:: widgets/obj/lv_example_obj_2 12 | :language: c 13 | 14 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/obj/lv_example_obj_1.c: -------------------------------------------------------------------------------- 1 | #include "../../lv_examples.h" 2 | #if LV_BUILD_EXAMPLES 3 | 4 | void lv_example_obj_1(void) 5 | { 6 | lv_obj_t * obj1; 7 | obj1 = lv_obj_create(lv_scr_act()); 8 | lv_obj_set_size(obj1, 100, 50); 9 | lv_obj_align(obj1, LV_ALIGN_CENTER, -60, -30); 10 | 11 | static lv_style_t style_shadow; 12 | lv_style_init(&style_shadow); 13 | lv_style_set_shadow_width(&style_shadow, 10); 14 | lv_style_set_shadow_spread(&style_shadow, 5); 15 | lv_style_set_shadow_color(&style_shadow, lv_palette_main(LV_PALETTE_BLUE)); 16 | 17 | lv_obj_t * obj2; 18 | obj2 = lv_obj_create(lv_scr_act()); 19 | lv_obj_add_style(obj2, &style_shadow, 0); 20 | lv_obj_align(obj2, LV_ALIGN_CENTER, 60, 30); 21 | } 22 | #endif 23 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/obj/lv_example_obj_1.py: -------------------------------------------------------------------------------- 1 | obj1 = lv.obj(lv.scr_act()) 2 | obj1.set_size(100, 50) 3 | obj1.align(lv.ALIGN.CENTER, -60, -30) 4 | 5 | style_shadow = lv.style_t() 6 | style_shadow.init() 7 | style_shadow.set_shadow_width(10) 8 | style_shadow.set_shadow_spread(5) 9 | style_shadow.set_shadow_color(lv.palette_main(lv.PALETTE.BLUE)) 10 | 11 | obj2 = lv.obj(lv.scr_act()) 12 | obj2.add_style(style_shadow, 0) 13 | obj2.align(lv.ALIGN.CENTER, 60, 30) 14 | 15 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/obj/lv_example_obj_2.c: -------------------------------------------------------------------------------- 1 | #include "../../lv_examples.h" 2 | #if LV_BUILD_EXAMPLES 3 | 4 | static void drag_event_handler(lv_event_t * e) 5 | { 6 | lv_obj_t * obj = lv_event_get_target(e); 7 | 8 | lv_indev_t * indev = lv_indev_get_act(); 9 | lv_point_t vect; 10 | lv_indev_get_vect(indev, &vect); 11 | 12 | lv_coord_t x = lv_obj_get_x(obj) + vect.x; 13 | lv_coord_t y = lv_obj_get_y(obj) + vect.y; 14 | lv_obj_set_pos(obj, x, y); 15 | } 16 | 17 | 18 | /** 19 | * Make an object dragable. 20 | */ 21 | void lv_example_obj_2(void) 22 | { 23 | lv_obj_t * obj; 24 | obj = lv_obj_create(lv_scr_act()); 25 | lv_obj_set_size(obj, 150, 100); 26 | lv_obj_add_event_cb(obj, drag_event_handler, LV_EVENT_PRESSING, NULL); 27 | 28 | lv_obj_t * label = lv_label_create(obj); 29 | lv_label_set_text(label, "Drag me"); 30 | lv_obj_center(label); 31 | 32 | } 33 | #endif 34 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/obj/lv_example_obj_2.py: -------------------------------------------------------------------------------- 1 | def drag_event_handler(e): 2 | 3 | obj = e.get_target() 4 | 5 | indev = lv.indev_get_act() 6 | 7 | vect = lv.point_t() 8 | indev.get_vect(vect) 9 | x = obj.get_x() + vect.x 10 | y = obj.get_y() + vect.y 11 | obj.set_pos(x, y) 12 | 13 | 14 | # 15 | # Make an object dragable. 16 | # 17 | 18 | obj = lv.obj(lv.scr_act()) 19 | obj.set_size(150, 100) 20 | obj.add_event_cb(drag_event_handler, lv.EVENT.PRESSING, None) 21 | 22 | label = lv.label(obj) 23 | label.set_text("Drag me") 24 | label.center() 25 | 26 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/roller/index.rst: -------------------------------------------------------------------------------- 1 | 2 | Simple Roller 3 | """""""""""""""" 4 | 5 | .. lv_example:: widgets/roller/lv_example_roller_1 6 | :language: c 7 | 8 | Styling the roller 9 | """""""""""""""""" 10 | 11 | .. lv_example:: widgets/roller/lv_example_roller_2 12 | :language: c 13 | 14 | add fade mask to roller 15 | """"""""""""""""""""""" 16 | 17 | .. lv_example:: widgets/roller/lv_example_roller_3 18 | :language: c 19 | 20 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/roller/lv_example_roller_1.py: -------------------------------------------------------------------------------- 1 | def event_handler(e): 2 | code = e.get_code() 3 | obj = e.get_target() 4 | if code == lv.EVENT.VALUE_CHANGED: 5 | option = " "*10 6 | obj.get_selected_str(option, len(option)) 7 | print("Selected month: " + option.strip()) 8 | 9 | # 10 | # An infinite roller with the name of the months 11 | # 12 | 13 | roller1 = lv.roller(lv.scr_act()) 14 | roller1.set_options("\n".join([ 15 | "January", 16 | "February", 17 | "March", 18 | "April", 19 | "May", 20 | "June", 21 | "July", 22 | "August", 23 | "September", 24 | "October", 25 | "November", 26 | "December"]),lv.roller.MODE.INFINITE) 27 | 28 | roller1.set_visible_row_count(4) 29 | roller1.center() 30 | roller1.add_event_cb(event_handler, lv.EVENT.ALL, None) 31 | 32 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/slider/index.rst: -------------------------------------------------------------------------------- 1 | 2 | Simple Slider 3 | """"""""""""""""""""""""" 4 | 5 | .. lv_example:: widgets/slider/lv_example_slider_1 6 | :language: c 7 | 8 | Slider with custom style 9 | """"""""""""""""""""""""" 10 | 11 | .. lv_example:: widgets/slider/lv_example_slider_2 12 | :language: c 13 | 14 | Slider with extended drawer 15 | """""""""""""""""""""""""""" 16 | 17 | .. lv_example:: widgets/slider/lv_example_slider_3 18 | :language: c 19 | 20 | 21 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/slider/lv_example_slider_1.py: -------------------------------------------------------------------------------- 1 | # 2 | # A default slider with a label displaying the current value 3 | # 4 | def slider_event_cb(e): 5 | 6 | slider = e.get_target() 7 | slider_label.set_text("{:d}%".format(slider.get_value())) 8 | slider_label.align_to(slider, lv.ALIGN.OUT_BOTTOM_MID, 0, 10) 9 | 10 | # Create a slider in the center of the display 11 | slider = lv.slider(lv.scr_act()) 12 | slider.center() 13 | slider.add_event_cb(slider_event_cb, lv.EVENT.VALUE_CHANGED, None) 14 | 15 | # Create a label below the slider 16 | slider_label = lv.label(lv.scr_act()) 17 | slider_label.set_text("0%") 18 | 19 | slider_label.align_to(slider, lv.ALIGN.OUT_BOTTOM_MID, 0, 10) 20 | 21 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/span/index.rst: -------------------------------------------------------------------------------- 1 | 2 | Span with custom styles 3 | """""""""""""""""""""""" 4 | 5 | .. lv_example:: widgets/span/lv_example_span_1 6 | :language: c 7 | 8 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/spinbox/index.rst: -------------------------------------------------------------------------------- 1 | 2 | Simple Spinbox 3 | """"""""""""""""""""""" 4 | 5 | .. lv_example:: widgets/spinbox/lv_example_spinbox_1 6 | :language: c 7 | 8 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/spinbox/lv_example_spinbox_1.py: -------------------------------------------------------------------------------- 1 | def increment_event_cb(e): 2 | code = e.get_code() 3 | if code == lv.EVENT.SHORT_CLICKED or code == lv.EVENT.LONG_PRESSED_REPEAT: 4 | spinbox.increment() 5 | 6 | def decrement_event_cb(e): 7 | code = e.get_code() 8 | if code == lv.EVENT.SHORT_CLICKED or code == lv.EVENT.LONG_PRESSED_REPEAT: 9 | spinbox.decrement() 10 | 11 | spinbox = lv.spinbox(lv.scr_act()) 12 | spinbox.set_range(-1000, 25000) 13 | spinbox.set_digit_format(5, 2) 14 | spinbox.step_prev() 15 | spinbox.set_width(100) 16 | spinbox.center() 17 | 18 | h = spinbox.get_height() 19 | 20 | btn = lv.btn(lv.scr_act()) 21 | btn.set_size(h, h) 22 | btn.align_to(spinbox, lv.ALIGN.OUT_RIGHT_MID, 5, 0) 23 | btn.set_style_bg_img_src(lv.SYMBOL.PLUS, 0) 24 | btn.add_event_cb(increment_event_cb, lv.EVENT.ALL, None) 25 | 26 | btn = lv.btn(lv.scr_act()) 27 | btn.set_size(h, h) 28 | btn.align_to(spinbox, lv.ALIGN.OUT_LEFT_MID, -5, 0) 29 | btn.set_style_bg_img_src(lv.SYMBOL.MINUS, 0) 30 | btn.add_event_cb(decrement_event_cb, lv.EVENT.ALL, None) 31 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/spinner/index.rst: -------------------------------------------------------------------------------- 1 | 2 | Simple spinner 3 | """""""""""""""""""""""""""" 4 | 5 | .. lv_example:: widgets/spinner/lv_example_spinner_1 6 | :language: c 7 | 8 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/spinner/lv_example_spinner_1.c: -------------------------------------------------------------------------------- 1 | #include "../../lv_examples.h" 2 | #if LV_USE_SPINNER && LV_BUILD_EXAMPLES 3 | 4 | void lv_example_spinner_1(void) 5 | { 6 | /*Create a spinner*/ 7 | lv_obj_t * spinner = lv_spinner_create(lv_scr_act(), 1000, 60); 8 | lv_obj_set_size(spinner, 100, 100); 9 | lv_obj_center(spinner); 10 | } 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/spinner/lv_example_spinner_1.py: -------------------------------------------------------------------------------- 1 | # Create a spinner 2 | spinner = lv.spinner(lv.scr_act(), 1000, 60) 3 | spinner.set_size(100, 100) 4 | spinner.center() 5 | 6 | 7 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/switch/index.rst: -------------------------------------------------------------------------------- 1 | 2 | Simple Switch 3 | """"""""""""""""""""""" 4 | 5 | .. lv_example:: widgets/switch/lv_example_switch_1 6 | :language: c 7 | 8 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/switch/lv_example_switch_1.py: -------------------------------------------------------------------------------- 1 | def event_handler(e): 2 | code = e.get_code() 3 | obj = e.get_target() 4 | if code == lv.EVENT.VALUE_CHANGED: 5 | if obj.has_state(lv.STATE.CHECKED): 6 | print("State: on") 7 | else: 8 | print("State: off") 9 | 10 | 11 | lv.scr_act().set_flex_flow(lv.FLEX_FLOW.COLUMN) 12 | lv.scr_act().set_flex_align(lv.FLEX_ALIGN.CENTER, lv.FLEX_ALIGN.CENTER, lv.FLEX_ALIGN.CENTER) 13 | 14 | sw = lv.switch(lv.scr_act()) 15 | sw.add_event_cb(event_handler,lv.EVENT.ALL, None) 16 | 17 | sw = lv.switch(lv.scr_act()) 18 | sw.add_state(lv.STATE.CHECKED) 19 | sw.add_event_cb(event_handler, lv.EVENT.ALL, None) 20 | 21 | sw = lv.switch(lv.scr_act()) 22 | sw.add_state(lv.STATE.DISABLED) 23 | sw.add_event_cb(event_handler, lv.EVENT.ALL, None) 24 | 25 | sw = lv.switch(lv.scr_act()) 26 | sw.add_state(lv.STATE.CHECKED | lv.STATE.DISABLED) 27 | sw.add_event_cb(event_handler, lv.EVENT.ALL, None) 28 | 29 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/table/index.rst: -------------------------------------------------------------------------------- 1 | 2 | 3 | Simple table 4 | """"""""""""""""""""""" 5 | 6 | .. lv_example:: widgets/table/lv_example_table_1 7 | :language: c 8 | 9 | Lightweighted list from table 10 | """""""""""""""""""""""""""""" 11 | 12 | .. lv_example:: widgets/table/lv_example_table_2 13 | :language: c 14 | 15 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/tabview/index.rst: -------------------------------------------------------------------------------- 1 | 2 | Simple Tabview 3 | """"""""""""""""""""""" 4 | 5 | .. lv_example:: widgets/tabview/lv_example_tabview_1 6 | :language: c 7 | 8 | Tabs on the left, styling and no scrolling 9 | """"""""""""""""""""""""""""""""""""""""""""" 10 | 11 | .. lv_example:: widgets/tabview/lv_example_tabview_2 12 | :language: c 13 | 14 | 15 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/tabview/lv_example_tabview_1.py: -------------------------------------------------------------------------------- 1 | # Create a Tab view object 2 | tabview = lv.tabview(lv.scr_act(), lv.DIR.TOP, 50) 3 | 4 | # Add 3 tabs (the tabs are page (lv_page) and can be scrolled 5 | tab1 = tabview.add_tab("Tab 1") 6 | tab2 = tabview.add_tab("Tab 2") 7 | tab3 = tabview.add_tab("Tab 3") 8 | 9 | # Add content to the tabs 10 | label = lv.label(tab1) 11 | label.set_text("""This the first tab 12 | 13 | If the content 14 | of a tab 15 | becomes too 16 | longer 17 | than the 18 | container 19 | then it 20 | automatically 21 | becomes 22 | scrollable. 23 | 24 | 25 | 26 | Can you see it?""") 27 | 28 | label = lv.label(tab2) 29 | label.set_text("Second tab") 30 | 31 | label = lv.label(tab3) 32 | label.set_text("Third tab"); 33 | 34 | label.scroll_to_view_recursive(lv.ANIM.ON) 35 | 36 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/textarea/index.rst: -------------------------------------------------------------------------------- 1 | 2 | Simple Text area 3 | """"""""""""""""""""""" 4 | 5 | .. lv_example:: widgets/textarea/lv_example_textarea_1 6 | :language: c 7 | 8 | 9 | Text area with password field 10 | """"""""""""""""""""""""""""" 11 | 12 | .. lv_example:: widgets/textarea/lv_example_textarea_2 13 | :language: c 14 | 15 | Text auto-formatting 16 | """"""""""""""""""""""""""""" 17 | 18 | .. lv_example:: widgets/textarea/lv_example_textarea_3 19 | :language: c 20 | 21 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/tileview/index.rst: -------------------------------------------------------------------------------- 1 | 2 | Tileview with content 3 | """"""""""""""""""""""""""" 4 | 5 | .. lv_example:: widgets/tileview/lv_example_tileview_1 6 | :language: c 7 | 8 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/win/index.rst: -------------------------------------------------------------------------------- 1 | 2 | Simple window 3 | """"""""""""""" 4 | 5 | .. lv_example:: widgets/win/lv_example_win_1 6 | :language: c 7 | 8 | -------------------------------------------------------------------------------- /lib/lvgl/examples/widgets/win/lv_example_win_1.py: -------------------------------------------------------------------------------- 1 | def event_handler(e): 2 | code = e.get_code() 3 | obj = e.get_target() 4 | if code == lv.EVENT.CLICKED: 5 | print("Button {:d} clicked".format(obj.get_child_id())) 6 | 7 | win = lv.win(lv.scr_act(), 60) 8 | btn1 = win.add_btn(lv.SYMBOL.LEFT, 40) 9 | btn1.add_event_cb(event_handler,lv.EVENT.ALL, None) 10 | win.add_title("A title") 11 | btn2=win.add_btn(lv.SYMBOL.RIGHT, 40) 12 | btn2.add_event_cb(event_handler,lv.EVENT.ALL, None) 13 | btn3 = win.add_btn(lv.SYMBOL.CLOSE, 60) 14 | btn3.add_event_cb(event_handler,lv.EVENT.ALL, None) 15 | 16 | cont = win.get_content() #Content can be aded here 17 | label = lv.label(cont) 18 | label.set_text("""This is 19 | a pretty 20 | long text 21 | to see how 22 | the window 23 | becomes 24 | scrollable. 25 | 26 | 27 | We need 28 | quite some text 29 | and we will 30 | even put 31 | some more 32 | text to be 33 | sure it 34 | overflows. 35 | """) 36 | 37 | -------------------------------------------------------------------------------- /lib/lvgl/idf_component.yml: -------------------------------------------------------------------------------- 1 | version: "8.0.2" 2 | description: LVGL - Light and Versatile Graphics Library 3 | url: https://github.com/lvgl/lvgl -------------------------------------------------------------------------------- /lib/lvgl/library.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "lvgl", 3 | "version": "8.1.0", 4 | "keywords": "graphics, gui, embedded, tft, lvgl", 5 | "description": "Graphics library to create embedded GUI with easy-to-use graphical elements, beautiful visual effects and low memory footprint. It offers anti-aliasing, opacity, and animations using only one frame buffer.", 6 | "repository": { 7 | "type": "git", 8 | "url": "https://github.com/lvgl/lvgl.git" 9 | }, 10 | "build": { 11 | "includeDir": "." 12 | }, 13 | "license": "MIT", 14 | "homepage": "https://lvgl.io", 15 | "frameworks": "*", 16 | "platforms": "*" 17 | } 18 | -------------------------------------------------------------------------------- /lib/lvgl/library.properties: -------------------------------------------------------------------------------- 1 | name=lvgl 2 | version=8.1.0 3 | author=kisvegabor 4 | maintainer=kisvegabor,embeddedt,pete-pjb 5 | sentence=Full-featured Graphics Library for Embedded Systems 6 | paragraph=Powerful and easy-to-use embedded GUI with many widgets, advanced visual effects (opacity, antialiasing, animations) and low memory requirements (16K RAM, 64K Flash). 7 | category=Display 8 | url=https://lvgl.io 9 | architectures=* 10 | includes=lvgl.h 11 | -------------------------------------------------------------------------------- /lib/lvgl/lvgl.mk: -------------------------------------------------------------------------------- 1 | include $(LVGL_DIR)/$(LVGL_DIR_NAME)/examples/examples.mk 2 | include $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/extra/extra.mk 3 | include $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/core/lv_core.mk 4 | include $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/draw/lv_draw.mk 5 | include $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/font/lv_font.mk 6 | include $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/gpu/lv_gpu.mk 7 | include $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/hal/lv_hal.mk 8 | include $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/misc/lv_misc.mk 9 | include $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/widgets/lv_widgets.mk 10 | -------------------------------------------------------------------------------- /lib/lvgl/scripts/.gitignore: -------------------------------------------------------------------------------- 1 | CHANGELOG_LAST.md 2 | -------------------------------------------------------------------------------- /lib/lvgl/scripts/build_html_examples.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" 4 | CURRENT_REF="$(git rev-parse HEAD)" 5 | rm -rf emscripten_builder 6 | git clone https://github.com/lvgl/lv_sim_emscripten.git emscripten_builder 7 | scripts/genexamplelist.sh > emscripten_builder/examplelist.c 8 | cd emscripten_builder 9 | git submodule update --init -- lvgl 10 | cd lvgl 11 | git checkout $CURRENT_REF 12 | cd .. 13 | git submodule update --init -- lv_drivers 14 | mkdir cmbuild 15 | cd cmbuild 16 | emcmake cmake .. -DLVGL_CHOSEN_DEMO=lv_example_noop -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache 17 | emmake make -j$(nproc) 18 | rm -rf CMakeFiles 19 | cd ../.. 20 | cp -a emscripten_builder/cmbuild docs/_static/built_lv_examples 21 | -------------------------------------------------------------------------------- /lib/lvgl/scripts/built_in_font/DejaVuSans.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmallPond/D-BOT/98ec7958c368b6205f710f60df76f6b4479b677d/lib/lvgl/scripts/built_in_font/DejaVuSans.ttf -------------------------------------------------------------------------------- /lib/lvgl/scripts/built_in_font/FontAwesome5-Solid+Brands+Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmallPond/D-BOT/98ec7958c368b6205f710f60df76f6b4479b677d/lib/lvgl/scripts/built_in_font/FontAwesome5-Solid+Brands+Regular.woff -------------------------------------------------------------------------------- /lib/lvgl/scripts/built_in_font/Montserrat-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmallPond/D-BOT/98ec7958c368b6205f710f60df76f6b4479b677d/lib/lvgl/scripts/built_in_font/Montserrat-Medium.ttf -------------------------------------------------------------------------------- /lib/lvgl/scripts/built_in_font/SimSun.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmallPond/D-BOT/98ec7958c368b6205f710f60df76f6b4479b677d/lib/lvgl/scripts/built_in_font/SimSun.woff -------------------------------------------------------------------------------- /lib/lvgl/scripts/built_in_font/unscii-8.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmallPond/D-BOT/98ec7958c368b6205f710f60df76f6b4479b677d/lib/lvgl/scripts/built_in_font/unscii-8.ttf -------------------------------------------------------------------------------- /lib/lvgl/scripts/changelog_gen.sh: -------------------------------------------------------------------------------- 1 | # Generate CHANGELOG_LAST.md from changes since the last version tag. (vx.y.z-dev tags are ignored) 2 | # CHANGELOG_LAST.md can be edited manually if required and manually added to docs/CHANGELOG.md 3 | # 4 | # Requirements: 5 | # npm install -g auto-changelog 6 | # 7 | # Usage: 8 | # changelog-gen 9 | # 10 | # Example: if the latest verision is v5.6.7 the followings can be used for bugfix, minor or major versions: 11 | # changelog-gen v5.6.8 12 | # changelog-gen v5.7.0 13 | # changelog-gen v6.0.0 14 | 15 | auto-changelog -t changelog-template.hbs -l false --latest-version $1 --unreleased-only --tag-pattern ^v[0-9]+.[0-9]+.[0-9]+$ -o CHANGELOG_LAST.md 16 | -------------------------------------------------------------------------------- /lib/lvgl/scripts/code-format.sh: -------------------------------------------------------------------------------- 1 | astyle --options=code-format.cfg "../src/*.c,*.h" 2 | -------------------------------------------------------------------------------- /lib/lvgl/scripts/cppcheck_run.sh: -------------------------------------------------------------------------------- 1 | cppcheck -j8 --template="{severity}\t{file}:{line}\t{id}: {message}" --enable=all ../src/ --output-file=cppcheck_res.txt --suppress=unusedFunction --suppress=preprocessorErrorDirective --force 2 | -------------------------------------------------------------------------------- /lib/lvgl/scripts/filetohex.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | import sys 3 | 4 | with open(sys.argv[1], 'r') as file: 5 | s = file.read() 6 | 7 | b = bytearray() 8 | b.extend(map(ord, s)) 9 | 10 | for a in b: print(hex(a), end =", ") 11 | 12 | -------------------------------------------------------------------------------- /lib/lvgl/scripts/find_version.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Credit: https://stackoverflow.com/a/4774063 3 | SCRIPTPATH="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" 4 | TMPENVFILE=$(mktemp /tmp/lvgl.script.XXXXXX) 5 | cat $SCRIPTPATH/../lvgl.h | grep "#define LVGL_VERSION_" | sed 's/#define //g' | sed -r 's/\s+/=/' > $TMPENVFILE 6 | . $TMPENVFILE 7 | rm $TMPENVFILE 8 | echo $LVGL_VERSION_MAJOR.$LVGL_VERSION_MINOR 9 | -------------------------------------------------------------------------------- /lib/lvgl/scripts/genexamplelist.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo "/* Autogenerated */" 3 | echo '#include ' 4 | echo '#include "examplelist.h"' 5 | TMPFILE=$(mktemp) 6 | find examples -name \*.h | xargs grep -h "^void lv_example" | sed 's/(/ /g' | awk '{print $2}' > $TMPFILE 7 | cat $TMPFILE | while read -r line; do 8 | echo "extern void ${line}(void);" 9 | done 10 | echo "const struct lv_ci_example lv_ci_example_list[] = {" 11 | cat $TMPFILE | while read -r line; do 12 | echo " { \"$line\", $line },"; 13 | done 14 | echo " { NULL, NULL }" 15 | echo "};" 16 | -------------------------------------------------------------------------------- /lib/lvgl/scripts/infer_run.sh: -------------------------------------------------------------------------------- 1 | # https://github.com/facebook/infer 2 | # 3 | # Install: 4 | # VERSION=0.17.0; \ 5 | # curl -sSL "https://github.com/facebook/infer/releases/download/v$VERSION/infer-linux64-v$VERSION.tar.xz" \ 6 | # | sudo tar -C /opt -xJ && \ 7 | # sudoln -s "/opt/infer-linux64-v$VERSION/bin/infer" /usr/local/bin/infer 8 | 9 | infer run -- make -j8 10 | -------------------------------------------------------------------------------- /lib/lvgl/scripts/install-prerequisites.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/sh 2 | 3 | # Install Linux package prerequisites needed for LVGL development 4 | # and testing. Some less-common development packages are not included 5 | # here, such as MicroPython and PC simulator packages. 6 | # 7 | # Note: This script is run by the CI workflows. 8 | sudo apt install gcc python3 libpng-dev ruby-full gcovr cmake 9 | -------------------------------------------------------------------------------- /lib/lvgl/scripts/release/commits.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmallPond/D-BOT/98ec7958c368b6205f710f60df76f6b4479b677d/lib/lvgl/scripts/release/commits.txt -------------------------------------------------------------------------------- /lib/lvgl/scripts/release/release.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # Create a new release from master. Execute the followings: 4 | # - On lvgl, lv_demos, and lv_drivers: 5 | # - Detect the current version of master. E.g. 8.1-dev 6 | # - Create a new branch from the master for the release. E.g. release/v8.1 7 | # - Remove the "-dev" postfix from the version numbers 8 | # - Create a tag for the new version. E.g. v8.1 9 | # - Push the new branch and tag 10 | # - Get the relevant changes from docs/CHANGELOG.md and create a blog post from it 11 | # - Increment the version number in master. E.g.g 8.1-dev to 8.2-dev 12 | # - Add a new section to the CHANGELOG with the new version 13 | # - Update the simulator and lv_port projects 14 | # 15 | # USAGE: 16 | # release.py 17 | # - : -minor or -major 18 | -------------------------------------------------------------------------------- /lib/lvgl/src/core/lv_core.mk: -------------------------------------------------------------------------------- 1 | CSRCS += lv_disp.c 2 | CSRCS += lv_group.c 3 | CSRCS += lv_indev.c 4 | CSRCS += lv_indev_scroll.c 5 | CSRCS += lv_obj.c 6 | CSRCS += lv_obj_class.c 7 | CSRCS += lv_obj_draw.c 8 | CSRCS += lv_obj_pos.c 9 | CSRCS += lv_obj_scroll.c 10 | CSRCS += lv_obj_style.c 11 | CSRCS += lv_obj_style_gen.c 12 | CSRCS += lv_obj_tree.c 13 | CSRCS += lv_event.c 14 | CSRCS += lv_refr.c 15 | CSRCS += lv_theme.c 16 | 17 | DEPPATH += --dep-path $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/core 18 | VPATH += :$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/core 19 | 20 | CFLAGS += "-I$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/core" 21 | -------------------------------------------------------------------------------- /lib/lvgl/src/draw/lv_draw.mk: -------------------------------------------------------------------------------- 1 | CSRCS += lv_draw_arc.c 2 | CSRCS += lv_draw_blend.c 3 | CSRCS += lv_draw_img.c 4 | CSRCS += lv_draw_label.c 5 | CSRCS += lv_draw_line.c 6 | CSRCS += lv_draw_mask.c 7 | CSRCS += lv_draw_rect.c 8 | CSRCS += lv_draw_triangle.c 9 | CSRCS += lv_img_buf.c 10 | CSRCS += lv_img_cache.c 11 | CSRCS += lv_img_decoder.c 12 | 13 | DEPPATH += --dep-path $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/draw 14 | VPATH += :$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/draw 15 | 16 | CFLAGS += "-I$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/draw" 17 | -------------------------------------------------------------------------------- /lib/lvgl/src/extra/extra.mk: -------------------------------------------------------------------------------- 1 | CSRCS += $(shell find -L $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/extra -name \*.c) 2 | -------------------------------------------------------------------------------- /lib/lvgl/src/extra/layouts/lv_layouts.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_layouts.h 3 | * 4 | */ 5 | 6 | #ifndef LV_LAYOUTS_H 7 | #define LV_LAYOUTS_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "flex/lv_flex.h" 17 | #include "grid/lv_grid.h" 18 | 19 | /********************* 20 | * DEFINES 21 | *********************/ 22 | 23 | /********************** 24 | * TYPEDEFS 25 | **********************/ 26 | 27 | /********************** 28 | * GLOBAL PROTOTYPES 29 | **********************/ 30 | 31 | /********************** 32 | * MACROS 33 | **********************/ 34 | #if LV_USE_LOG && LV_LOG_TRACE_LAYOUT 35 | # define LV_TRACE_LAYOUT(...) LV_LOG_TRACE(__VA_ARGS__) 36 | #else 37 | # define LV_TRACE_LAYOUT(...) 38 | #endif 39 | 40 | #ifdef __cplusplus 41 | } /*extern "C"*/ 42 | #endif 43 | 44 | #endif /*LV_LAYOUTS_H*/ 45 | -------------------------------------------------------------------------------- /lib/lvgl/src/extra/libs/bmp/lv_bmp.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_templ.h 3 | * 4 | */ 5 | 6 | #ifndef LV_BMP_H 7 | #define LV_BMP_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "../../../lv_conf_internal.h" 17 | #if LV_USE_BMP 18 | 19 | /********************* 20 | * DEFINES 21 | *********************/ 22 | 23 | /********************** 24 | * TYPEDEFS 25 | **********************/ 26 | 27 | /********************** 28 | * GLOBAL PROTOTYPES 29 | **********************/ 30 | void lv_bmp_init(void); 31 | 32 | /********************** 33 | * MACROS 34 | **********************/ 35 | 36 | #endif /*LV_USE_BMP*/ 37 | 38 | #ifdef __cplusplus 39 | } /* extern "C" */ 40 | #endif 41 | 42 | #endif /*LV_BMP_H*/ 43 | -------------------------------------------------------------------------------- /lib/lvgl/src/extra/libs/freetype/arial.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmallPond/D-BOT/98ec7958c368b6205f710f60df76f6b4479b677d/lib/lvgl/src/extra/libs/freetype/arial.ttf -------------------------------------------------------------------------------- /lib/lvgl/src/extra/libs/fsdrv/lv_fsdrv.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_fsdrv.h 3 | * 4 | */ 5 | 6 | #ifndef LV_FSDRV_H 7 | #define LV_FSDRV_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "../../../lv_conf_internal.h" 17 | 18 | /********************* 19 | * DEFINES 20 | *********************/ 21 | 22 | /********************** 23 | * TYPEDEFS 24 | **********************/ 25 | 26 | /********************** 27 | * GLOBAL PROTOTYPES 28 | **********************/ 29 | 30 | #if LV_USE_FS_FATFS != '\0' 31 | void lv_fs_fatfs_init(void); 32 | #endif 33 | 34 | #if LV_USE_FS_STDIO != '\0' 35 | void lv_fs_stdio_init(void); 36 | #endif 37 | 38 | #if LV_USE_FS_POSIX != '\0' 39 | void lv_fs_posix_init(void); 40 | #endif 41 | 42 | #if LV_USE_FS_WIN32 != '\0' 43 | void lv_fs_win32_init(void); 44 | #endif 45 | 46 | /********************** 47 | * MACROS 48 | **********************/ 49 | 50 | #ifdef __cplusplus 51 | } /* extern "C" */ 52 | #endif 53 | 54 | #endif /*LV_FSDRV_H*/ 55 | 56 | -------------------------------------------------------------------------------- /lib/lvgl/src/extra/libs/lv_libs.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_libs.h 3 | * 4 | */ 5 | 6 | #ifndef LV_LIBS_H 7 | #define LV_LIBS_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "bmp/lv_bmp.h" 17 | #include "fsdrv/lv_fsdrv.h" 18 | #include "png/lv_png.h" 19 | #include "gif/lv_gif.h" 20 | #include "qrcode/lv_qrcode.h" 21 | #include "sjpg/lv_sjpg.h" 22 | #include "freetype/lv_freetype.h" 23 | #include "rlottie/lv_rlottie.h" 24 | 25 | /********************* 26 | * DEFINES 27 | *********************/ 28 | 29 | /********************** 30 | * TYPEDEFS 31 | **********************/ 32 | 33 | /********************** 34 | * GLOBAL PROTOTYPES 35 | **********************/ 36 | 37 | /********************** 38 | * MACROS 39 | **********************/ 40 | 41 | #ifdef __cplusplus 42 | } /*extern "C"*/ 43 | #endif 44 | 45 | #endif /*LV_LAYOUTS_H*/ 46 | -------------------------------------------------------------------------------- /lib/lvgl/src/extra/libs/png/lv_png.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_png.h 3 | * 4 | */ 5 | 6 | #ifndef LV_PNG_H 7 | #define LV_PNG_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "../../../lv_conf_internal.h" 17 | #if LV_USE_PNG 18 | 19 | /********************* 20 | * DEFINES 21 | *********************/ 22 | 23 | /********************** 24 | * TYPEDEFS 25 | **********************/ 26 | 27 | /********************** 28 | * GLOBAL PROTOTYPES 29 | **********************/ 30 | 31 | /** 32 | * Register the PNG decoder functions in LittlevGL 33 | */ 34 | void lv_png_init(void); 35 | 36 | /********************** 37 | * MACROS 38 | **********************/ 39 | 40 | #endif /*LV_USE_PNG*/ 41 | 42 | #ifdef __cplusplus 43 | } /* extern "C" */ 44 | #endif 45 | 46 | #endif /*LV_PNG_H*/ 47 | -------------------------------------------------------------------------------- /lib/lvgl/src/extra/libs/sjpg/lv_sjpg.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_sjpg.h 3 | * 4 | */ 5 | 6 | #ifndef LV_SJPEG_H 7 | #define LV_SJPEG_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | 17 | #if LV_USE_SJPG 18 | 19 | /********************* 20 | * DEFINES 21 | *********************/ 22 | 23 | /********************** 24 | * TYPEDEFS 25 | **********************/ 26 | 27 | /********************** 28 | * GLOBAL PROTOTYPES 29 | **********************/ 30 | 31 | void lv_split_jpeg_init(void); 32 | 33 | /********************** 34 | * MACROS 35 | **********************/ 36 | 37 | #endif /*LV_USE_SJPG*/ 38 | 39 | #ifdef __cplusplus 40 | } 41 | #endif 42 | 43 | #endif /* LV_SJPEG_H */ 44 | -------------------------------------------------------------------------------- /lib/lvgl/src/extra/libs/sjpg/tjpgdcnf.h: -------------------------------------------------------------------------------- 1 | /*----------------------------------------------*/ 2 | /* TJpgDec System Configurations R0.03 */ 3 | /*----------------------------------------------*/ 4 | 5 | #define JD_SZBUF 512 6 | /* Specifies size of stream input buffer */ 7 | 8 | #define JD_FORMAT 0 9 | /* Specifies output pixel format. 10 | / 0: RGB888 (24-bit/pix) 11 | / 1: RGB565 (16-bit/pix) 12 | / 2: Grayscale (8-bit/pix) 13 | */ 14 | 15 | #define JD_USE_SCALE 1 16 | /* Switches output descaling feature. 17 | / 0: Disable 18 | / 1: Enable 19 | */ 20 | 21 | #define JD_TBLCLIP 1 22 | /* Use table conversion for saturation arithmetic. A bit faster, but increases 1 KB of code size. 23 | / 0: Disable 24 | / 1: Enable 25 | */ 26 | 27 | #define JD_FASTDECODE 0 28 | /* Optimization level 29 | / 0: Basic optimization. Suitable for 8/16-bit MCUs. 30 | / 1: + 32-bit barrel shifter. Suitable for 32-bit MCUs. 31 | / 2: + Table conversion for huffman decoding (wants 6 << HUFF_BIT bytes of RAM) 32 | */ 33 | 34 | -------------------------------------------------------------------------------- /lib/lvgl/src/extra/lv_extra.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_extra.h 3 | * 4 | */ 5 | 6 | #ifndef LV_EXTRA_H 7 | #define LV_EXTRA_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | 17 | /********************* 18 | * DEFINES 19 | *********************/ 20 | 21 | /********************** 22 | * TYPEDEFS 23 | **********************/ 24 | 25 | /********************** 26 | * GLOBAL PROTOTYPES 27 | **********************/ 28 | 29 | /** 30 | * Initialize the extra components 31 | */ 32 | void lv_extra_init(void); 33 | 34 | /********************** 35 | * MACROS 36 | **********************/ 37 | 38 | #ifdef __cplusplus 39 | } /*extern "C"*/ 40 | #endif 41 | 42 | #endif /*LV_EXTRA_H*/ 43 | -------------------------------------------------------------------------------- /lib/lvgl/src/extra/others/lv_others.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_others.h 3 | * 4 | */ 5 | 6 | #ifndef LV_OTHERS_H 7 | #define LV_OTHERS_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "snapshot/lv_snapshot.h" 17 | 18 | /********************* 19 | * DEFINES 20 | *********************/ 21 | 22 | /********************** 23 | * TYPEDEFS 24 | **********************/ 25 | 26 | /********************** 27 | * GLOBAL PROTOTYPES 28 | **********************/ 29 | 30 | /********************** 31 | * MACROS 32 | **********************/ 33 | 34 | #ifdef __cplusplus 35 | } /*extern "C"*/ 36 | #endif 37 | 38 | #endif /*LV_OTHERS_H*/ 39 | -------------------------------------------------------------------------------- /lib/lvgl/src/extra/themes/basic/lv_theme_basic.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_theme_basic.h 3 | * 4 | */ 5 | 6 | #ifndef LV_THEME_BASIC_H 7 | #define LV_THEME_BASIC_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "../../../core/lv_obj.h" 17 | 18 | #if LV_USE_THEME_BASIC 19 | 20 | /********************* 21 | * DEFINES 22 | *********************/ 23 | 24 | /********************** 25 | * TYPEDEFS 26 | **********************/ 27 | 28 | /********************** 29 | * GLOBAL PROTOTYPES 30 | **********************/ 31 | 32 | /** 33 | * Initialize the theme 34 | * @param disp pointer to display to attach the theme 35 | * @return a pointer to reference this theme later 36 | */ 37 | lv_theme_t * lv_theme_basic_init(lv_disp_t * disp); 38 | 39 | /********************** 40 | * MACROS 41 | **********************/ 42 | 43 | #endif 44 | 45 | #ifdef __cplusplus 46 | } /*extern "C"*/ 47 | #endif 48 | 49 | #endif /*LV_THEME_BASIC_H*/ 50 | -------------------------------------------------------------------------------- /lib/lvgl/src/extra/themes/lv_themes.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_themes.h 3 | * 4 | */ 5 | 6 | #ifndef LV_THEMES_H 7 | #define LV_THEMES_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "default/lv_theme_default.h" 17 | #include "mono/lv_theme_mono.h" 18 | #include "basic/lv_theme_basic.h" 19 | 20 | /********************* 21 | * DEFINES 22 | *********************/ 23 | 24 | /********************** 25 | * TYPEDEFS 26 | **********************/ 27 | 28 | /********************** 29 | * GLOBAL PROTOTYPES 30 | **********************/ 31 | 32 | /********************** 33 | * MACROS 34 | **********************/ 35 | 36 | #ifdef __cplusplus 37 | } /*extern "C"*/ 38 | #endif 39 | 40 | #endif /*LV_THEMES_H*/ 41 | -------------------------------------------------------------------------------- /lib/lvgl/src/extra/widgets/spinner/lv_spinner.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_spinner.h 3 | * 4 | */ 5 | 6 | #ifndef LV_SPINNER_H 7 | #define LV_SPINNER_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "../../../lvgl.h" 17 | 18 | #if LV_USE_SPINNER 19 | 20 | /*Testing of dependencies*/ 21 | #if LV_USE_ARC == 0 22 | #error "lv_spinner: lv_arc is required. Enable it in lv_conf.h (LV_USE_ARC 1) " 23 | #endif 24 | 25 | /********************* 26 | * DEFINES 27 | *********************/ 28 | 29 | /********************** 30 | * TYPEDEFS 31 | **********************/ 32 | extern const lv_obj_class_t lv_spinner_class; 33 | 34 | /********************** 35 | * GLOBAL PROTOTYPES 36 | **********************/ 37 | 38 | lv_obj_t * lv_spinner_create(lv_obj_t * parent, uint32_t time, uint32_t arc_length); 39 | 40 | /********************** 41 | * MACROS 42 | **********************/ 43 | 44 | #endif /*LV_USE_SPINNER*/ 45 | 46 | #ifdef __cplusplus 47 | } /*extern "C"*/ 48 | #endif 49 | 50 | #endif /*LV_SPINNER_H*/ 51 | -------------------------------------------------------------------------------- /lib/lvgl/src/font/lv_font_loader.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_font_loader.h 3 | * 4 | */ 5 | 6 | #ifndef LV_FONT_LOADER_H 7 | #define LV_FONT_LOADER_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | 17 | /********************* 18 | * DEFINES 19 | *********************/ 20 | 21 | /********************** 22 | * TYPEDEFS 23 | **********************/ 24 | 25 | /********************** 26 | * GLOBAL PROTOTYPES 27 | **********************/ 28 | 29 | lv_font_t * lv_font_load(const char * fontName); 30 | void lv_font_free(lv_font_t * font); 31 | 32 | /********************** 33 | * MACROS 34 | **********************/ 35 | 36 | #ifdef __cplusplus 37 | } /*extern "C"*/ 38 | #endif 39 | 40 | #endif /*LV_FONT_LOADER_H*/ 41 | -------------------------------------------------------------------------------- /lib/lvgl/src/gpu/lv_gpu.mk: -------------------------------------------------------------------------------- 1 | CSRCS += lv_gpu_nxp_pxp.c 2 | CSRCS += lv_gpu_nxp_pxp_osa.c 3 | CSRCS += lv_gpu_nxp_vglite.c 4 | CSRCS += lv_gpu_stm32_dma2d.c 5 | CSRCS += lv_gpu_sdl.c 6 | 7 | DEPPATH += --dep-path $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/gpu 8 | VPATH += :$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/gpu 9 | 10 | CFLAGS += "-I$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/gpu" 11 | 12 | include $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/gpu/sdl/lv_gpu_sdl.mk -------------------------------------------------------------------------------- /lib/lvgl/src/gpu/sdl/lv_gpu_sdl.mk: -------------------------------------------------------------------------------- 1 | CSRCS += lv_gpu_sdl_draw_arc.c 2 | CSRCS += lv_gpu_sdl_draw_blend.c 3 | CSRCS += lv_gpu_sdl_draw_img.c 4 | CSRCS += lv_gpu_sdl_draw_label.c 5 | CSRCS += lv_gpu_sdl_draw_line.c 6 | CSRCS += lv_gpu_sdl_draw_rect.c 7 | CSRCS += lv_gpu_sdl_lru.c 8 | CSRCS += lv_gpu_sdl_mask.c 9 | CSRCS += lv_gpu_sdl_stack_blur.c 10 | CSRCS += lv_gpu_sdl_texture_cache.c 11 | CSRCS += lv_gpu_sdl_utils.c 12 | 13 | DEPPATH += --dep-path $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/gpu/sdl 14 | VPATH += :$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/gpu/sdl 15 | 16 | CFLAGS += "-I$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/gpu/sdl" 17 | -------------------------------------------------------------------------------- /lib/lvgl/src/gpu/sdl/lv_gpu_sdl_stack_blur.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_gpu_sdl_stack_blur.h 3 | * 4 | */ 5 | #ifndef LV_GPU_SDL_STACK_BLUR_H 6 | #define LV_GPU_SDL_STACK_BLUR_H 7 | 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | /********************* 13 | * INCLUDES 14 | *********************/ 15 | 16 | #include "../../lv_conf_internal.h" 17 | 18 | #include "../../misc/lv_color.h" 19 | 20 | /********************* 21 | * DEFINES 22 | *********************/ 23 | 24 | /********************** 25 | * TYPEDEFS 26 | **********************/ 27 | 28 | /********************** 29 | * GLOBAL PROTOTYPES 30 | **********************/ 31 | 32 | void lv_stack_blur_grayscale(lv_opa_t * buf, uint16_t w, uint16_t h, uint16_t r); 33 | 34 | /********************** 35 | * MACROS 36 | **********************/ 37 | 38 | #ifdef __cplusplus 39 | } /*extern "C"*/ 40 | #endif 41 | 42 | #endif /*LV_GPU_SDL_STACK_BLUR_H*/ 43 | -------------------------------------------------------------------------------- /lib/lvgl/src/hal/lv_hal.mk: -------------------------------------------------------------------------------- 1 | CSRCS += lv_hal_disp.c 2 | CSRCS += lv_hal_indev.c 3 | CSRCS += lv_hal_tick.c 4 | 5 | DEPPATH += --dep-path $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/hal 6 | VPATH += :$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/hal 7 | 8 | CFLAGS += "-I$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/hal" 9 | -------------------------------------------------------------------------------- /lib/lvgl/src/lvgl.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lvgl.h 3 | * This file exists only to be compatible with Arduino's library structure 4 | */ 5 | 6 | #ifndef LVGL_SRC_H 7 | #define LVGL_SRC_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | 17 | #include "../lvgl.h" 18 | 19 | /********************* 20 | * DEFINES 21 | *********************/ 22 | 23 | /********************** 24 | * TYPEDEFS 25 | **********************/ 26 | 27 | /********************** 28 | * GLOBAL PROTOTYPES 29 | **********************/ 30 | 31 | /********************** 32 | * MACROS 33 | **********************/ 34 | 35 | #ifdef __cplusplus 36 | } /*extern "C"*/ 37 | #endif 38 | 39 | #endif /*LVGL_SRC_H*/ 40 | -------------------------------------------------------------------------------- /lib/lvgl/src/misc/lv_gc.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_gc.c 3 | * 4 | */ 5 | 6 | /********************* 7 | * INCLUDES 8 | *********************/ 9 | #include "lv_gc.h" 10 | 11 | /********************* 12 | * DEFINES 13 | *********************/ 14 | 15 | /********************** 16 | * TYPEDEFS 17 | **********************/ 18 | 19 | /********************** 20 | * STATIC PROTOTYPES 21 | **********************/ 22 | 23 | /********************** 24 | * STATIC VARIABLES 25 | **********************/ 26 | 27 | #if(!defined(LV_ENABLE_GC)) || LV_ENABLE_GC == 0 28 | LV_ROOTS 29 | #endif /*LV_ENABLE_GC*/ 30 | 31 | /********************** 32 | * MACROS 33 | **********************/ 34 | 35 | /********************** 36 | * GLOBAL FUNCTIONS 37 | **********************/ 38 | 39 | void _lv_gc_clear_roots(void) 40 | { 41 | #define LV_CLEAR_ROOT(root_type, root_name) lv_memset_00(&LV_GC_ROOT(root_name), sizeof(LV_GC_ROOT(root_name))); 42 | LV_ITERATE_ROOTS(LV_CLEAR_ROOT) 43 | } 44 | 45 | /********************** 46 | * STATIC FUNCTIONS 47 | **********************/ 48 | -------------------------------------------------------------------------------- /lib/lvgl/src/misc/lv_misc.mk: -------------------------------------------------------------------------------- 1 | CSRCS += lv_anim.c 2 | CSRCS += lv_anim_timeline.c 3 | CSRCS += lv_area.c 4 | CSRCS += lv_async.c 5 | CSRCS += lv_bidi.c 6 | CSRCS += lv_color.c 7 | CSRCS += lv_fs.c 8 | CSRCS += lv_gc.c 9 | CSRCS += lv_ll.c 10 | CSRCS += lv_log.c 11 | CSRCS += lv_math.c 12 | CSRCS += lv_mem.c 13 | CSRCS += lv_printf.c 14 | CSRCS += lv_style.c 15 | CSRCS += lv_style_gen.c 16 | CSRCS += lv_timer.c 17 | CSRCS += lv_tlsf.c 18 | CSRCS += lv_txt.c 19 | CSRCS += lv_txt_ap.c 20 | CSRCS += lv_utils.c 21 | 22 | DEPPATH += --dep-path $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/misc 23 | VPATH += :$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/misc 24 | 25 | CFLAGS += "-I$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/misc" 26 | -------------------------------------------------------------------------------- /lib/lvgl/src/misc/lv_templ.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_templ.c 3 | * 4 | */ 5 | 6 | /********************* 7 | * INCLUDES 8 | *********************/ 9 | 10 | /********************* 11 | * DEFINES 12 | *********************/ 13 | 14 | /********************** 15 | * TYPEDEFS 16 | **********************/ 17 | 18 | /*This typedef exists purely to keep -Wpedantic happy when the file is empty.*/ 19 | /*It can be removed.*/ 20 | typedef int _keep_pedantic_happy; 21 | 22 | /********************** 23 | * STATIC PROTOTYPES 24 | **********************/ 25 | 26 | /********************** 27 | * STATIC VARIABLES 28 | **********************/ 29 | 30 | /********************** 31 | * MACROS 32 | **********************/ 33 | 34 | /********************** 35 | * GLOBAL FUNCTIONS 36 | **********************/ 37 | 38 | /********************** 39 | * STATIC FUNCTIONS 40 | **********************/ 41 | -------------------------------------------------------------------------------- /lib/lvgl/src/misc/lv_templ.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_templ.h 3 | * 4 | */ 5 | 6 | #ifndef LV_TEMPL_H 7 | #define LV_TEMPL_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | 17 | /********************* 18 | * DEFINES 19 | *********************/ 20 | 21 | /********************** 22 | * TYPEDEFS 23 | **********************/ 24 | 25 | /********************** 26 | * GLOBAL PROTOTYPES 27 | **********************/ 28 | 29 | /********************** 30 | * MACROS 31 | **********************/ 32 | 33 | #ifdef __cplusplus 34 | } /*extern "C"*/ 35 | #endif 36 | 37 | #endif /*LV_TEMPL_H*/ 38 | -------------------------------------------------------------------------------- /lib/lvgl/src/misc/lv_txt_ap.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_txt_ap.h 3 | * 4 | */ 5 | 6 | #ifndef LV_TXT_AP_H 7 | #define LV_TXT_AP_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include 17 | #include "lv_txt.h" 18 | #include "../draw/lv_draw.h" 19 | 20 | #if LV_USE_ARABIC_PERSIAN_CHARS == 1 21 | 22 | /********************* 23 | * DEFINES 24 | *********************/ 25 | 26 | #define LV_UNDEF_ARABIC_PERSIAN_CHARS (UINT32_MAX) 27 | #define LV_AP_ALPHABET_BASE_CODE 0x0622 28 | #define LV_AP_END_CHARS_LIST {0,0,0,0,0,{0,0}} 29 | /********************** 30 | * TYPEDEFS 31 | **********************/ 32 | 33 | /********************** 34 | * GLOBAL PROTOTYPES 35 | **********************/ 36 | uint32_t _lv_txt_ap_calc_bytes_cnt(const char * txt); 37 | void _lv_txt_ap_proc(const char * txt, char * txt_out); 38 | 39 | /********************** 40 | * MACROS 41 | **********************/ 42 | 43 | #endif // LV_USE_ARABIC_PERSIAN_CHARS 44 | 45 | #ifdef __cplusplus 46 | } /*extern "C"*/ 47 | #endif 48 | 49 | #endif /*LV_TXT_AP_H*/ 50 | -------------------------------------------------------------------------------- /lib/lvgl/src/widgets/lv_widgets.mk: -------------------------------------------------------------------------------- 1 | CSRCS += lv_arc.c 2 | CSRCS += lv_bar.c 3 | CSRCS += lv_btn.c 4 | CSRCS += lv_btnmatrix.c 5 | CSRCS += lv_canvas.c 6 | CSRCS += lv_checkbox.c 7 | CSRCS += lv_dropdown.c 8 | CSRCS += lv_img.c 9 | CSRCS += lv_label.c 10 | CSRCS += lv_line.c 11 | CSRCS += lv_roller.c 12 | CSRCS += lv_slider.c 13 | CSRCS += lv_switch.c 14 | CSRCS += lv_table.c 15 | CSRCS += lv_textarea.c 16 | 17 | DEPPATH += --dep-path $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/widgets 18 | VPATH += :$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/widgets 19 | 20 | CFLAGS += "-I$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/widgets" 21 | -------------------------------------------------------------------------------- /lib/lvgl/tests/.gitignore: -------------------------------------------------------------------------------- 1 | *.out 2 | *_Runner.c 3 | -------------------------------------------------------------------------------- /lib/lvgl/tests/config.yml: -------------------------------------------------------------------------------- 1 | :unity: 2 | :includes: 3 | - lv_test_init.h 4 | :suite_setup: "lv_test_init();" 5 | :suite_teardown: "lv_test_deinit();return num_failures;" 6 | -------------------------------------------------------------------------------- /lib/lvgl/tests/src/lv_test_conf.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_test_conf.h 3 | * 4 | */ 5 | 6 | #ifndef LV_TEST_CONF_H 7 | #define LV_TEST_CONF_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | 17 | /********************* 18 | * DEFINES 19 | *********************/ 20 | 21 | /********************** 22 | * TYPEDEFS 23 | **********************/ 24 | 25 | uint32_t custom_tick_get(void); 26 | #define LV_TICK_CUSTOM_SYS_TIME_EXPR custom_tick_get() 27 | 28 | typedef void * lv_user_data_t; 29 | 30 | /********************** 31 | * GLOBAL PROTOTYPES 32 | **********************/ 33 | 34 | /********************** 35 | * MACROS 36 | **********************/ 37 | 38 | #ifdef __cplusplus 39 | } /*extern "C"*/ 40 | #endif 41 | 42 | #endif /*LV_TEST_CONF_H*/ 43 | -------------------------------------------------------------------------------- /lib/lvgl/tests/src/lv_test_init.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef LV_TEST_INIT_H 3 | #define LV_TEST_INIT_H 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | #include 10 | #include <../lvgl.h> 11 | 12 | void lv_test_init(void); 13 | void lv_test_deinit(void); 14 | 15 | #ifdef __cplusplus 16 | } /*extern "C"*/ 17 | #endif 18 | 19 | #endif /*LV_TEST_INIT_H*/ 20 | 21 | -------------------------------------------------------------------------------- /lib/lvgl/tests/src/test_cases/_test_template.c: -------------------------------------------------------------------------------- 1 | #if LV_BUILD_TEST 2 | #include "../lvgl.h" 3 | 4 | #include "unity/unity.h" 5 | 6 | void setUp(void); 7 | void tearDown(void); 8 | 9 | void test_func_1(void); 10 | 11 | void setUp(void) 12 | { 13 | /* Function run before every test */ 14 | } 15 | 16 | void tearDown(void) 17 | { 18 | /* Function run after every test */ 19 | } 20 | 21 | void test_func_1(void) 22 | { 23 | TEST_ASSERT_EQUAL(actual, expected); 24 | } 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /lib/lvgl/tests/src/test_cases/test_config.c: -------------------------------------------------------------------------------- 1 | #if LV_BUILD_TEST 2 | #include "../lvgl.h" 3 | 4 | #include "unity/unity.h" 5 | 6 | void test_config(void); 7 | 8 | void test_config(void) 9 | { 10 | TEST_ASSERT_EQUAL(130, LV_DPI_DEF); 11 | TEST_ASSERT_EQUAL(130, lv_disp_get_dpi(NULL)); 12 | TEST_ASSERT_EQUAL(800, LV_HOR_RES); 13 | TEST_ASSERT_EQUAL(800, lv_disp_get_hor_res(NULL)); 14 | TEST_ASSERT_EQUAL(480, LV_VER_RES); 15 | TEST_ASSERT_EQUAL(480, lv_disp_get_ver_res(NULL)); 16 | TEST_ASSERT_EQUAL(32, LV_COLOR_DEPTH); 17 | } 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /lib/lvgl/tests/src/test_cases/test_obj_tree.c: -------------------------------------------------------------------------------- 1 | #if LV_BUILD_TEST 2 | #include "../lvgl.h" 3 | 4 | #include "unity/unity.h" 5 | 6 | void test_obj_tree_1(void); 7 | void test_obj_tree_2(void); 8 | 9 | void test_obj_tree_1(void) 10 | { 11 | TEST_ASSERT_EQUAL(lv_obj_get_child_cnt(lv_scr_act()), 0); 12 | } 13 | 14 | void test_obj_tree_2(void) 15 | { 16 | 17 | lv_obj_create(lv_scr_act()); 18 | lv_obj_t * o2 = lv_obj_create(lv_scr_act()); 19 | lv_obj_create(lv_scr_act()); 20 | TEST_ASSERT_EQUAL(lv_obj_get_child_cnt(lv_scr_act()), 3); 21 | 22 | lv_obj_del(o2); 23 | TEST_ASSERT_EQUAL(lv_obj_get_child_cnt(lv_scr_act()), 2); 24 | 25 | lv_obj_clean(lv_scr_act()); 26 | TEST_ASSERT_EQUAL(lv_obj_get_child_cnt(lv_scr_act()), 0); 27 | 28 | lv_color_t c1 = lv_color_hex(0x444444); 29 | lv_color_t c2 = lv_color_hex3(0x444); 30 | TEST_ASSERT_EQUAL_COLOR(c1, c2); 31 | 32 | lv_obj_remove_style_all(lv_scr_act()); 33 | lv_obj_set_style_bg_color(lv_scr_act(), lv_color_hex(0x112233), 0); 34 | lv_obj_set_style_bg_opa(lv_scr_act(), LV_OPA_COVER, 0); 35 | 36 | //TEST_ASSERT_EQUAL_SCREENSHOT("scr1.png") 37 | } 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /lib/lvgl/tests/src/test_cases/test_style.c: -------------------------------------------------------------------------------- 1 | #if LV_BUILD_TEST 2 | #include "../lvgl.h" 3 | 4 | #include "unity/unity.h" 5 | 6 | //void test_func_1(void); 7 | 8 | //void test_func_1(void) 9 | //{ 10 | // TEST_ASSERT_EQUAL(actual, expected); 11 | //} 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /lib/lvgl/tests/src/test_fonts/font_1.fnt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmallPond/D-BOT/98ec7958c368b6205f710f60df76f6b4479b677d/lib/lvgl/tests/src/test_fonts/font_1.fnt -------------------------------------------------------------------------------- /lib/lvgl/tests/src/test_fonts/font_2.fnt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmallPond/D-BOT/98ec7958c368b6205f710f60df76f6b4479b677d/lib/lvgl/tests/src/test_fonts/font_2.fnt -------------------------------------------------------------------------------- /lib/lvgl/tests/src/test_fonts/font_3.fnt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmallPond/D-BOT/98ec7958c368b6205f710f60df76f6b4479b677d/lib/lvgl/tests/src/test_fonts/font_3.fnt -------------------------------------------------------------------------------- /lib/lvgl/tests/unity/run_test.erb: -------------------------------------------------------------------------------- 1 | /*=======Test Runner Used To Run Each Test=====*/ 2 | static void run_test(UnityTestFunction func, const char* name, UNITY_LINE_TYPE line_num) 3 | { 4 | Unity.CurrentTestName = name; 5 | Unity.CurrentTestLineNumber = line_num; 6 | #ifdef UNITY_USE_COMMAND_LINE_ARGS 7 | if (!UnityTestMatches()) 8 | return; 9 | #endif 10 | Unity.NumberOfTests++; 11 | UNITY_CLR_DETAILS(); 12 | UNITY_EXEC_TIME_START(); 13 | CMock_Init(); 14 | if (TEST_PROTECT()) 15 | { 16 | <% if @options[:plugins].include?(:cexception) %> 17 | CEXCEPTION_T e; 18 | Try { 19 | <%= @options[:setup_name] %>(); 20 | func(); 21 | } Catch(e) { 22 | TEST_ASSERT_EQUAL_HEX32_MESSAGE(CEXCEPTION_NONE, e, "Unhandled Exception!"); 23 | } 24 | <% else %> 25 | <%= @options[:setup_name] %>(); 26 | func(); 27 | <% end %> 28 | } 29 | if (TEST_PROTECT()) 30 | { 31 | <%= @options[:teardown_name] %>(); 32 | CMock_Verify(); 33 | } 34 | CMock_Destroy(); 35 | UNITY_EXEC_TIME_STOP(); 36 | UnityConcludeTest(); 37 | } 38 | -------------------------------------------------------------------------------- /lib/lvgl/tests/unity/type_sanitizer.rb: -------------------------------------------------------------------------------- 1 | module TypeSanitizer 2 | def self.sanitize_c_identifier(unsanitized) 3 | # convert filename to valid C identifier by replacing invalid chars with '_' 4 | unsanitized.gsub(/[-\/\\\.\,\s]/, '_') 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /lib/lvgl/zephyr/module.yml: -------------------------------------------------------------------------------- 1 | build: 2 | cmake: . 3 | -------------------------------------------------------------------------------- /platformio.ini: -------------------------------------------------------------------------------- 1 | ; PlatformIO Project Configuration File 2 | ; 3 | ; Build options: build flags, source filter 4 | ; Upload options: custom upload port, speed and extra flags 5 | ; Library options: dependencies, extra library storages 6 | ; Advanced options: extra scripting 7 | ; 8 | ; Please visit documentation for the other options and examples 9 | ; https://docs.platformio.org/page/projectconf.html 10 | 11 | [env:esp32-s3-devkitc-1] 12 | platform = espressif32 13 | board = esp32-s3-devkitc-1 14 | framework = arduino 15 | build_flags = -DXK_INVERT_ROTATION=1 -DXK_MQTT=1 16 | -DCORE_DEBUG_LEVEL=3 17 | -DXK_WIRELESS_PARAMETER 18 | upload_speed = 4608000 19 | lib_deps = 20 | adafruit/Adafruit NeoPixel@^1.10.7 21 | moononournation/GFX Library for Arduino@1.2.1 22 | askuric/Simple FOC@2.3.0 23 | knolleary/PubSubClient@^2.8 24 | https://github.com/bblanchon/ArduinoJson 25 | https://github.com/me-no-dev/AsyncTCP 26 | https://github.com/me-no-dev/ESPAsyncWebServer 27 | tockn/MPU6050_tockn@^1.5.2 28 | https://github.com/SmallPond/WirelessTuning 29 | https://github.com/SmallPond/ble_ctrl 30 | tzapu/WiFiManager@^2.0.17 31 | -------------------------------------------------------------------------------- /src/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmallPond/D-BOT/98ec7958c368b6205f710f60df76f6b4479b677d/src/README.md -------------------------------------------------------------------------------- /src/app/Accounts/ACT_IMU.cpp: -------------------------------------------------------------------------------- 1 | #include "Account_Master.h" 2 | #include "hal/hal.h" 3 | 4 | static Account* actIMU; 5 | 6 | void AccountSystem::imu_commit(HAL::imu_info_t* info) 7 | { 8 | actIMU->Commit(info, sizeof(HAL::imu_info_t)); 9 | } 10 | 11 | ACCOUNT_INIT_DEF(IMU) 12 | { 13 | actIMU = account; 14 | } 15 | -------------------------------------------------------------------------------- /src/app/Accounts/ACT_Music.cpp: -------------------------------------------------------------------------------- 1 | #include "Account_Master.h" 2 | #include "hal/hal.h" 3 | 4 | static int onEvent(Account* account, Account::EventParam_t* param) 5 | { 6 | if (param->event != Account::EVENT_NOTIFY) 7 | { 8 | return Account::ERROR_UNSUPPORTED_REQUEST; 9 | } 10 | 11 | if (param->size != sizeof(AccountSystem::MusicPlayer_Info_t)) 12 | { 13 | return Account::ERROR_SIZE_MISMATCH; 14 | } 15 | 16 | AccountSystem::MusicPlayer_Info_t* info = (AccountSystem::MusicPlayer_Info_t*)param->data_p; 17 | 18 | HAL::audio_play_music(info->music); 19 | 20 | return 0; 21 | } 22 | 23 | ACCOUNT_INIT_DEF(MusicPlayer) 24 | { 25 | account->SetEventCallback(onEvent); 26 | } -------------------------------------------------------------------------------- /src/app/Accounts/Account_Master.cpp: -------------------------------------------------------------------------------- 1 | #include "Account_Master.h" 2 | #include "hal/hal.h" 3 | 4 | static AccountBroker dataCenter("MASTER"); 5 | 6 | AccountBroker* AccountSystem::Broker() 7 | { 8 | return &dataCenter; 9 | } 10 | 11 | void Accounts_Init() 12 | { 13 | #define ACT_DEF(NodeName, bufferSize)\ 14 | Account* act##NodeName = new Account(#NodeName, &dataCenter, bufferSize); 15 | 16 | #include "_ACT_LIST.inc" 17 | 18 | #undef ACT_DEF 19 | 20 | #define ACT_DEF(NodeName, bufferSize)\ 21 | do{\ 22 | extern void _ACT_##NodeName##_Init(Account* account);\ 23 | _ACT_##NodeName##_Init(act##NodeName);\ 24 | }while(0) 25 | 26 | #include "_ACT_LIST.inc" 27 | 28 | #undef ACT_DEF 29 | } 30 | -------------------------------------------------------------------------------- /src/app/Accounts/Account_Master.h: -------------------------------------------------------------------------------- 1 | #ifndef __DATA_PROC_H 2 | #define __DATA_PROC_H 3 | 4 | #include "app/Utils/AccountSystem/AccountBroker.h" 5 | #include "hal/HAL_Def.h" 6 | #include "ACT_Def.h" 7 | 8 | #define ACCOUNT_INIT_DEF(name) void _ACT_##name##_Init(Account* account) 9 | 10 | void Accounts_Init(); 11 | 12 | namespace AccountSystem 13 | { 14 | 15 | AccountBroker* Broker(); 16 | 17 | void imu_commit(HAL::imu_info_t* info); 18 | } 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /src/app/Accounts/_ACT_LIST.inc: -------------------------------------------------------------------------------- 1 | /* Data processing node list */ 2 | 3 | // ACT_DEF(Storage, 0); 4 | // ACT_DEF(Power, 0); 5 | // ACT_DEF(IMU, sizeof(HAL::IMU_Info_t)); 6 | ACT_DEF(StatusBar, 0); 7 | // ACT_DEF(MusicPlayer, 0); 8 | // ACT_DEF(SysConfig, 0); 9 | ACT_DEF(Motor, 0); 10 | ACT_DEF(IMU, sizeof(HAL::imu_info_t)); 11 | ACT_DEF(MusicPlayer, 0); 12 | -------------------------------------------------------------------------------- /src/app/Pages/HASS/Hass.h: -------------------------------------------------------------------------------- 1 | #ifndef __HASS_H__ 2 | #define __HASS_H__ 3 | 4 | #include "HassModel.h" 5 | #include "HassView.h" 6 | 7 | void hass_hal_init(void); 8 | int hass_hal_send(const char *device_name, int knob_value); 9 | 10 | namespace Page 11 | { 12 | class Hass : public PageBase 13 | { 14 | public: 15 | Hass(); 16 | virtual ~Hass(); 17 | 18 | virtual void onCustomAttrConfig(); 19 | virtual void onViewLoad(); 20 | virtual void onViewDidLoad(); 21 | virtual void onViewWillAppear(); 22 | virtual void onViewDidAppear(); 23 | virtual void onViewWillDisappear(); 24 | virtual void onViewDidDisappear(); 25 | virtual void onViewDidUnload(); 26 | 27 | void HassEventHandler(lv_event_t* event, lv_event_code_t code); 28 | 29 | private: 30 | void Update(); 31 | void AttachEvent(lv_obj_t* obj); 32 | static void onTimerUpdate(lv_timer_t* timer); 33 | static void onEvent(lv_event_t* event); 34 | 35 | private: 36 | HassView* View; 37 | HassModel* Model; 38 | lv_timer_t* timer; 39 | Account* account; 40 | }; 41 | } 42 | 43 | 44 | #endif /* __HASS_H__ */ -------------------------------------------------------------------------------- /src/app/Pages/HASS/HassModel.cpp: -------------------------------------------------------------------------------- 1 | #include "HassModel.h" 2 | #include "app/Accounts/Account_Master.h" 3 | 4 | using namespace Page; 5 | 6 | HassModel::HassModel() 7 | { 8 | app = APP_MODE_HOME_ASSISTANT; 9 | } 10 | 11 | void HassModel::GetKnobStatus(HassInfo* info) 12 | { 13 | PlaygroundModel::GetKnobStatus(info); 14 | } 15 | 16 | void HassModel::Init() 17 | { 18 | PlaygroundModel::Init(); 19 | } 20 | 21 | void HassModel::Deinit() 22 | { 23 | PlaygroundModel::Deinit(); 24 | } 25 | 26 | void HassModel::ChangeMotorMode(int mode) 27 | { 28 | PlaygroundModel::ChangeMotorMode(mode); 29 | } 30 | 31 | void HassModel::SetPlaygroundMode(int16_t mode) 32 | { 33 | PlaygroundModel::SetPlaygroundMode(mode); 34 | } -------------------------------------------------------------------------------- /src/app/Pages/HASS/HassModel.h: -------------------------------------------------------------------------------- 1 | #ifndef __HOME_ASSISTANT_MODEL_H 2 | #define __HOME_ASSISTANT_MODEL_H 3 | #include "app/Utils/AccountSystem/Account.h" 4 | #include "lvgl.h" 5 | #include "../Playground/PlaygroundView.h" 6 | #include "../Playground/PlaygroundModel.h" 7 | #include 8 | 9 | typedef struct HassInfo : PlaygroundInfo 10 | { 11 | /** 12 | * 正在被操作的设备 13 | */ 14 | const char* busy_device_entity_id; 15 | } HassInfo; 16 | 17 | namespace Page 18 | { 19 | 20 | class HassModel: public PlaygroundModel 21 | { 22 | public: 23 | HassModel(); 24 | ~HassModel(){}; 25 | void Init(); 26 | void Deinit(); 27 | void Update(void* pg_ui); 28 | void GetKnobStatus(HassInfo* info); 29 | static std::map getStateMap(); 30 | static void setStateMap(const char* entity_id, const char* state); 31 | void setBusyDeviceEntityId(const char* entity_id); 32 | const char* getBusyDeviceEntityId(); 33 | void ChangeMotorMode(int mode); 34 | void SetPlaygroundMode(int16_t mode); 35 | 36 | }; 37 | 38 | } 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /src/app/Pages/Menu/MenuModel.h: -------------------------------------------------------------------------------- 1 | #ifndef __MENU_MODEL_H 2 | #define __MENU_MODEL_H 3 | 4 | #include "app/Accounts/Account_Master.h" 5 | 6 | namespace Page 7 | { 8 | 9 | class MenuModel 10 | { 11 | public: 12 | void Init(); 13 | void Deinit(); 14 | 15 | void GetIMUInfo( 16 | char* info, uint32_t len 17 | ); 18 | 19 | void GetBatteryInfo( 20 | int* usage, 21 | float* voltage, 22 | char* state, uint32_t len 23 | ); 24 | 25 | void ChangeMotorMode(int mode); 26 | 27 | private: 28 | Account* account; 29 | 30 | private: 31 | 32 | }; 33 | 34 | } 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /src/app/Pages/Playground/PlaygroundModel.h: -------------------------------------------------------------------------------- 1 | #ifndef __PLAGROUND_MODEL_H 2 | #define __PLAGROUND_MODEL_H 3 | #include "app/Utils/AccountSystem/Account.h" 4 | #include "lvgl.h" 5 | #include "hal/hal.h" 6 | 7 | typedef struct 8 | { 9 | int32_t xkonb_value; 10 | int32_t motor_pos; 11 | int32_t angle_offset; 12 | SuperDialMotion konb_direction; 13 | } PlaygroundInfo; 14 | namespace Page 15 | { 16 | 17 | class PlaygroundModel 18 | { 19 | public: 20 | virtual ~PlaygroundModel() {}; 21 | int16_t app; 22 | void Init(); 23 | void Deinit(); 24 | virtual void GetKnobStatus(PlaygroundInfo *info); 25 | void ChangeMotorMode(int mode); 26 | void ChangeMotorModeWithInitPosition(int mode, int init_position); 27 | void SetPlaygroundMode(int16_t mode); 28 | void SetLcdBkBrightness(int value); 29 | static int32_t MAX_VALUE; 30 | static int32_t MIN_VALUE; 31 | static int32_t knob_value; 32 | private: 33 | Account* account; 34 | }; 35 | 36 | } 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /src/app/Pages/Setting/SettingModel.h: -------------------------------------------------------------------------------- 1 | #ifndef __SETTING_MODEL_H 2 | #define __SETTING_MODEL_H 3 | #include "app/Utils/AccountSystem/Account.h" 4 | #include "lvgl.h" 5 | #include "hal/nvs.h" 6 | #include "../Playground/PlaygroundView.h" 7 | #include "../Playground/PlaygroundModel.h" 8 | #include 9 | 10 | typedef struct SettingInfo : PlaygroundInfo 11 | { 12 | } SettingInfo; 13 | 14 | namespace Page 15 | { 16 | 17 | class SettingModel: public PlaygroundModel 18 | { 19 | public: 20 | SettingModel(); 21 | ~SettingModel(){}; 22 | void Init(); 23 | void Deinit(); 24 | void Update(void* pg_ui); 25 | void GetKnobStatus(SettingInfo* info); 26 | static std::map getStateMap(); 27 | static void setStateMap(const char* entity_id, const char* state); 28 | void ChangeMotorMode(int mode); 29 | void SetPlaygroundMode(int16_t mode); 30 | void SaveLcdBkTimeout(int value); 31 | void SaveLcdBkBrightness(int value); 32 | }; 33 | 34 | } 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /src/app/Pages/StartUp/StartUp.h: -------------------------------------------------------------------------------- 1 | #ifndef __STARTUP_PRESENTER_H 2 | #define __STARTUP_PRESENTER_H 3 | 4 | #include "StartUpView.h" 5 | #include "StartUpModel.h" 6 | 7 | namespace Page 8 | { 9 | 10 | class Startup : public PageBase 11 | { 12 | public: 13 | 14 | public: 15 | Startup(); 16 | virtual ~Startup(); 17 | 18 | virtual void onCustomAttrConfig(); 19 | virtual void onViewLoad(); 20 | virtual void onViewDidLoad(); 21 | virtual void onViewWillAppear(); 22 | virtual void onViewDidAppear(); 23 | virtual void onViewWillDisappear(); 24 | virtual void onViewDidDisappear(); 25 | virtual void onViewDidUnload(); 26 | 27 | private: 28 | static void onTimer(lv_timer_t* timer); 29 | 30 | StartupView View; 31 | StartupModel Model; 32 | }; 33 | 34 | } 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /src/app/Pages/StartUp/StartUpModel.cpp: -------------------------------------------------------------------------------- 1 | #include "StartUpModel.h" 2 | 3 | using namespace Page; 4 | 5 | void StartupModel::Init() 6 | { 7 | account = new Account("StartupModel", AccountSystem::Broker(), 0, this); 8 | } 9 | 10 | void StartupModel::DeInit() 11 | { 12 | if (account) 13 | { 14 | delete account; 15 | account = nullptr; 16 | } 17 | } 18 | 19 | void StartupModel::PlayMusic(const char* music) 20 | { 21 | // AccountSystem::MusicPlayer_Info_t info; 22 | // info.music = music; 23 | // account->Notify("MusicPlayer", &info, sizeof(info)); 24 | } 25 | -------------------------------------------------------------------------------- /src/app/Pages/StartUp/StartUpModel.h: -------------------------------------------------------------------------------- 1 | #ifndef __STARTUP_MODEL_H 2 | #define __STARTUP_MODEL_H 3 | 4 | #include "app/Accounts/Account_Master.h" 5 | #include "hal/hal.h" 6 | 7 | namespace Page 8 | { 9 | 10 | class StartupModel 11 | { 12 | public: 13 | void Init(); 14 | void DeInit(); 15 | void PlayMusic(const char* music); 16 | void SetEncoderEnable(bool en) 17 | { 18 | // HAL::Encoder_SetEnable(en); 19 | } 20 | 21 | private: 22 | Account* account; 23 | }; 24 | 25 | } 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /src/app/Pages/StartUp/StartUpView.h: -------------------------------------------------------------------------------- 1 | #ifndef __STARTUP_VIEW_H 2 | #define __STARTUP_VIEW_H 3 | 4 | #include "../Page.h" 5 | 6 | namespace Page 7 | { 8 | 9 | class StartupView 10 | { 11 | public: 12 | void Create(lv_obj_t* root); 13 | void Delete(); 14 | 15 | public: 16 | struct 17 | { 18 | lv_obj_t* cont; 19 | lv_obj_t* labelLogo; 20 | 21 | lv_anim_timeline_t* anim_timeline; 22 | } ui; 23 | 24 | private: 25 | }; 26 | 27 | } 28 | 29 | #endif // !__VIEW_H 30 | -------------------------------------------------------------------------------- /src/app/Pages/SurfaceDial/SurfaceDial.h: -------------------------------------------------------------------------------- 1 | #ifndef SURFACEDIAL_H_ 2 | #define SURFACEDIAL_H_ 3 | #include "SurfaceDialView.h" 4 | #include "SurfaceDialModel.h" 5 | namespace Page 6 | { 7 | class SurfaceDial : public PageBase 8 | { 9 | public: 10 | SurfaceDial(); 11 | virtual ~SurfaceDial(); 12 | 13 | virtual void onCustomAttrConfig(); 14 | virtual void onViewLoad(); 15 | virtual void onViewDidLoad(); 16 | virtual void onViewWillAppear(); 17 | virtual void onViewDidAppear(); 18 | virtual void onViewWillDisappear(); 19 | virtual void onViewDidDisappear(); 20 | virtual void onViewDidUnload(); 21 | void SurfaceDialEventHandler(lv_event_t* event, lv_event_code_t code); 22 | 23 | private: 24 | void AttachEvent(lv_obj_t* obj); 25 | static void onEvent(lv_event_t* event); 26 | static void onTimerUpdate(lv_timer_t* timer); 27 | void Update(); 28 | 29 | private: 30 | SurfaceDialView* View; 31 | SurfaceDialModel* Model; 32 | lv_timer_t* timer; 33 | }; 34 | } 35 | #endif //SURFACEDIAL_H_ 36 | -------------------------------------------------------------------------------- /src/app/Pages/SurfaceDial/SurfaceDialModel.cpp: -------------------------------------------------------------------------------- 1 | #include "SurfaceDialModel.h" 2 | #include "app/Accounts/Account_Master.h" 3 | #include 4 | #include "hal/motor.h" 5 | #include "hal/hal.h" 6 | 7 | using namespace Page; 8 | 9 | SurfaceDialModel::SurfaceDialModel() 10 | { 11 | app = APP_MODE_SUPER_DIAL; 12 | } 13 | 14 | void SurfaceDialModel::GetKnobStatus(SurfaceDialInfo *info) 15 | { 16 | PlaygroundModel::GetKnobStatus(info); 17 | info->is_ble_connected = HAL::surface_dial_is_connected(); 18 | } 19 | 20 | void SurfaceDialModel::SetPlaygroundMode(int16_t mode) 21 | { 22 | PlaygroundModel::SetPlaygroundMode(mode); 23 | } 24 | 25 | 26 | void SurfaceDialModel::Init() 27 | { 28 | PlaygroundModel::Init(); 29 | } 30 | 31 | void SurfaceDialModel::Deinit() 32 | { 33 | PlaygroundModel::Deinit(); 34 | } 35 | void SurfaceDialModel::ChangeMotorMode(int mode) 36 | { 37 | PlaygroundModel::ChangeMotorMode(mode); 38 | } 39 | -------------------------------------------------------------------------------- /src/app/Pages/SurfaceDial/SurfaceDialModel.h: -------------------------------------------------------------------------------- 1 | #ifndef __SURFACE_DIAL_MODEL_H 2 | #define __SURFACE_DIAL_MODEL_H 3 | #include "app/Utils/AccountSystem/Account.h" 4 | #include "lvgl.h" 5 | #include "../Playground/PlaygroundView.h" 6 | #include "../Playground/PlaygroundModel.h" 7 | 8 | typedef struct SurfaceDialInfo : PlaygroundInfo 9 | { 10 | bool is_ble_connected; 11 | } SurfaceDialInfo; 12 | 13 | namespace Page 14 | { 15 | 16 | class SurfaceDialModel : public PlaygroundModel 17 | { 18 | public: 19 | SurfaceDialModel(); 20 | void Init(); 21 | void Deinit(); 22 | void Update(void* pg_ui); 23 | void GetKnobStatus(SurfaceDialInfo* info); 24 | void ChangeMotorMode(int mode); 25 | void SetPlaygroundMode(int16_t mode); 26 | 27 | void onEvent(Account* account, Account::EventParam_t* param); 28 | private: 29 | 30 | }; 31 | 32 | } 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /src/app/Pages/SurfaceDial/SurfaceDialView.h: -------------------------------------------------------------------------------- 1 | #ifndef __SUPER_DIAL_VIEW_H 2 | #define __SUPER_DIAL_VIEW_H 3 | #include 4 | #include "app/app.h" 5 | #include "app/Pages/Page.h" 6 | #include "../Playground/PlaygroundView.h" 7 | #include "SurfaceDialModel.h" 8 | 9 | namespace Page 10 | { 11 | 12 | class SurfaceDialView: public PlaygroundView 13 | { 14 | public: 15 | SurfaceDialView(){} 16 | void Create(lv_obj_t* root); 17 | void Delete(); 18 | void UpdateView(SurfaceDialInfo *info); 19 | void SetPlaygroundMode(int16_t mode); 20 | 21 | 22 | public: 23 | struct { 24 | lv_obj_t* img_super_dial; 25 | }m_ui; 26 | 27 | private: 28 | }; 29 | 30 | } 31 | 32 | #endif // !__VIEW_H 33 | -------------------------------------------------------------------------------- /src/app/Pages/SystemInfos/SystemInfos.h: -------------------------------------------------------------------------------- 1 | #ifndef __SYSTEM_INFOS_PRESENTER_H 2 | #define __SYSTEM_INFOS_PRESENTER_H 3 | 4 | #include "SystemInfosView.h" 5 | #include "SystemInfosModel.h" 6 | 7 | namespace Page 8 | { 9 | 10 | class SystemInfos : public PageBase 11 | { 12 | public: 13 | 14 | public: 15 | SystemInfos(); 16 | virtual ~SystemInfos(); 17 | 18 | virtual void onCustomAttrConfig(); 19 | virtual void onViewLoad(); 20 | virtual void onViewDidLoad(); 21 | virtual void onViewWillAppear(); 22 | virtual void onViewDidAppear(); 23 | virtual void onViewWillDisappear(); 24 | virtual void onViewDidDisappear(); 25 | virtual void onViewDidUnload(); 26 | 27 | private: 28 | void Update(); 29 | void AttachEvent(lv_obj_t* obj); 30 | static void onTimerUpdate(lv_timer_t* timer); 31 | static void onEvent(lv_event_t* event); 32 | 33 | private: 34 | SystemInfosView View; 35 | SystemInfosModel Model; 36 | lv_timer_t* timer; 37 | }; 38 | 39 | } 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /src/app/Pages/SystemInfos/SystemInfosModel.h: -------------------------------------------------------------------------------- 1 | #ifndef __SYSTEM_INFOS_MODEL_H 2 | #define __SYSTEM_INFOS_MODEL_H 3 | 4 | #include "app/Accounts/Account_Master.h" 5 | 6 | namespace Page 7 | { 8 | 9 | class SystemInfosModel 10 | { 11 | public: 12 | void Init(); 13 | void Deinit(); 14 | 15 | void GetIMUInfo( 16 | char* info, uint32_t len 17 | ); 18 | 19 | void GetBatteryInfo( 20 | int* usage, 21 | float* voltage, 22 | char* state, uint32_t len 23 | ); 24 | 25 | void GetStorageInfo( 26 | bool* detect, 27 | char* size, uint32_t len 28 | ); 29 | 30 | void GetJointsInfo( 31 | char* data, uint32_t len 32 | ); 33 | 34 | void GetPose6DInfo( 35 | char* data, uint32_t len 36 | ); 37 | 38 | private: 39 | Account* account; 40 | 41 | private: 42 | 43 | }; 44 | 45 | } 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /src/app/Pages/_Template/Template.h: -------------------------------------------------------------------------------- 1 | #ifndef __TEMPLATE_PRESENTER_H 2 | #define __TEMPLATE_PRESENTER_H 3 | 4 | #include "TemplateView.h" 5 | #include "TemplateModel.h" 6 | 7 | namespace Page 8 | { 9 | 10 | class Template : public PageBase 11 | { 12 | public: 13 | typedef struct 14 | { 15 | uint16_t time; 16 | lv_color_t color; 17 | } Param_t; 18 | 19 | public: 20 | Template(); 21 | virtual ~Template(); 22 | 23 | virtual void onCustomAttrConfig(); 24 | virtual void onViewLoad(); 25 | virtual void onViewDidLoad(); 26 | virtual void onViewWillAppear(); 27 | virtual void onViewDidAppear(); 28 | virtual void onViewWillDisappear(); 29 | virtual void onViewDidDisappear(); 30 | virtual void onViewDidUnload(); 31 | 32 | private: 33 | void Update(); 34 | void AttachEvent(lv_obj_t* obj); 35 | static void onTimerUpdate(lv_timer_t* timer); 36 | static void onEvent(lv_event_t* event); 37 | 38 | private: 39 | TemplateView View; 40 | TemplateModel Model; 41 | lv_timer_t* timer; 42 | }; 43 | 44 | } 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /src/app/Pages/_Template/TemplateModel.cpp: -------------------------------------------------------------------------------- 1 | #include "TemplateModel.h" 2 | 3 | using namespace Page; 4 | 5 | uint32_t TemplateModel::GetData() 6 | { 7 | return lv_tick_get(); 8 | } 9 | -------------------------------------------------------------------------------- /src/app/Pages/_Template/TemplateModel.h: -------------------------------------------------------------------------------- 1 | #ifndef __TEMPLATE_MODEL_H 2 | #define __TEMPLATE_MODEL_H 3 | 4 | #include "lvgl.h" 5 | 6 | namespace Page 7 | { 8 | 9 | class TemplateModel 10 | { 11 | public: 12 | uint32_t TickSave; 13 | uint32_t GetData(); 14 | private: 15 | 16 | }; 17 | 18 | } 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /src/app/Pages/_Template/TemplateView.h: -------------------------------------------------------------------------------- 1 | #ifndef __TEMPLATE_VIEW_H 2 | #define __TEMPLATE_VIEW_H 3 | 4 | #include "../Page.h" 5 | #define EMOJI_WIDTH (240) 6 | #define EMOJI_HEIGHT (110) 7 | #define EMOJI_SIZE (EMOJI_WIDTH*EMOJI_HEIGHT*3) 8 | #define BIN_HEAD_LENGH (4) // bin file has 4 byte head 9 | #define EMOJI_IMG_OFFSET (240 * 60 * 3) // row * line 10 | 11 | namespace Page 12 | { 13 | 14 | class TemplateView 15 | { 16 | public: 17 | void Create(lv_obj_t* root); 18 | void update_emoji(unsigned char *buf); 19 | void Delete(); 20 | public: 21 | struct 22 | { 23 | // lv_obj_t* labelTitle; 24 | // lv_obj_t* labelTick; 25 | lv_obj_t* canvas; 26 | lv_group_t* group; 27 | } ui; 28 | 29 | private: 30 | 31 | }; 32 | 33 | } 34 | 35 | #endif // !__VIEW_H 36 | -------------------------------------------------------------------------------- /src/app/Resources/ResourcePool.h: -------------------------------------------------------------------------------- 1 | #ifndef __RESOURCE_POOL 2 | #define __RESOURCE_POOL 3 | 4 | #include "app/Utils/PageManager/ResourceManager.h" 5 | #include "lvgl.h" 6 | 7 | class ResourcePool 8 | { 9 | 10 | public: 11 | ResourceManager Font_; 12 | ResourceManager Image_; 13 | 14 | public: 15 | void Init(); 16 | lv_font_t* GetFont(const char* name) 17 | { 18 | return (lv_font_t*)Font_.GetResource(name); 19 | } 20 | const void* GetImage(const char* name) 21 | { 22 | return Image_.GetResource(name); 23 | } 24 | }; 25 | 26 | extern ResourcePool Resource; 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /src/app/Utils/TonePlayer/ToneMap.h: -------------------------------------------------------------------------------- 1 | #ifndef __TONE_MAP_H 2 | #define __TONE_MAP_H 3 | 4 | /*音符频率对应表*/ 5 | enum ToneMap 6 | { 7 | L1 = 262, 8 | L1h = 277, 9 | L2 = 294, 10 | L2h = 311, 11 | L3 = 330, 12 | L4 = 349, 13 | L4h = 370, 14 | L5 = 392, 15 | L5h = 415, 16 | L6 = 440, 17 | L6h = 466, 18 | L7 = 494, 19 | M1 = 523, 20 | M1h = 554, 21 | M2 = 587, 22 | M2h = 622, 23 | M3 = 659, 24 | M4 = 698, 25 | M4h = 740, 26 | M5 = 784, 27 | M5h = 831, 28 | M6 = 880, 29 | M6h = 932, 30 | M7 = 988, 31 | H1 = 1046, 32 | H1h = 1109, 33 | H2 = 1175, 34 | H2h = 1245, 35 | H3 = 1318, 36 | H4 = 1397, 37 | H4h = 1480, 38 | H5 = 1568, 39 | H5h = 1661, 40 | H6 = 1760, 41 | H6h = 1865, 42 | H7 = 1976, 43 | }; 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /src/app/Utils/lv_ext/lv_anim_timeline_wrapper.c: -------------------------------------------------------------------------------- 1 | #include "lv_anim_timeline_wrapper.h" 2 | 3 | void lv_anim_timeline_add_wrapper(lv_anim_timeline_t* at, const lv_anim_timeline_wrapper_t* wrapper) 4 | { 5 | for(uint32_t i = 0; wrapper[i].obj != NULL; i++) 6 | { 7 | const lv_anim_timeline_wrapper_t* atw = &wrapper[i]; 8 | 9 | lv_anim_t a; 10 | lv_anim_init(&a); 11 | lv_anim_set_var(&a, atw->obj); 12 | lv_anim_set_values(&a, atw->start, atw->end); 13 | lv_anim_set_exec_cb(&a, atw->exec_cb); 14 | lv_anim_set_time(&a, atw->duration); 15 | lv_anim_set_path_cb(&a, atw->path_cb); 16 | lv_anim_set_early_apply(&a, atw->early_apply); 17 | 18 | lv_anim_timeline_add(at, atw->start_time, &a); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/app/bot/comm/espnow_comm.h: -------------------------------------------------------------------------------- 1 | #ifndef __ESPNOW_COMM_H__ 2 | #define __ESPNOW_COMM_H__ 3 | 4 | #include "simple_comm.h" 5 | #include 6 | #include 7 | 8 | namespace iot { 9 | 10 | class ESPNOWComm : public SimpleComm { 11 | public: 12 | ESPNOWComm(); 13 | int Init() override; 14 | int Send(const JsonDocument& json) override; 15 | void SetRecvCallback(RecvCallback callback) override; 16 | void SetPeerAddress(const uint8_t* macAddress); 17 | void Loop() override; 18 | 19 | private: 20 | static ESPNOWComm* activeInstance; 21 | 22 | static void OnDataReceived(const uint8_t* mac, const uint8_t* data, int len){ 23 | 24 | log_i("receved msg from %s\n", mac); 25 | if (activeInstance->recv_cb_) { 26 | JsonDocument doc; 27 | DeserializationError error = deserializeJson(doc, data, len); 28 | if (!error) { 29 | activeInstance->recv_cb_(doc); 30 | } 31 | } 32 | } 33 | 34 | uint8_t _peerAddress[6]; 35 | RecvCallback recv_cb_; 36 | }; 37 | 38 | } // namespace iot 39 | 40 | #endif -------------------------------------------------------------------------------- /src/app/bot/comm/serial_comm.cpp: -------------------------------------------------------------------------------- 1 | #include "serial_comm.h" 2 | 3 | namespace iot { 4 | 5 | SerialComm::SerialComm(HardwareSerial& serial, unsigned long baudRate) 6 | : _serial(serial), _baudRate(baudRate) {} 7 | 8 | int SerialComm::Init() { 9 | _serial.begin(_baudRate); 10 | return 0; 11 | } 12 | 13 | int SerialComm::Send(const JsonDocument& json) { 14 | String output; 15 | serializeJson(json, output); 16 | _serial.println(output); 17 | return 0; 18 | } 19 | 20 | void SerialComm::SetRecvCallback(RecvCallback callback) { 21 | _recvCallback = callback; 22 | } 23 | 24 | void SerialComm::Loop() { 25 | if (_recvCallback && _serial.available()) { 26 | String input = _serial.readStringUntil('\n'); 27 | JsonDocument doc; 28 | DeserializationError error = deserializeJson(doc, input); 29 | if (!error) { 30 | _recvCallback(doc); 31 | } 32 | } 33 | } 34 | 35 | } // namespace iot -------------------------------------------------------------------------------- /src/app/bot/comm/serial_comm.h: -------------------------------------------------------------------------------- 1 | #ifndef __SERIAL_COMM_H__ 2 | #define __SERIAL_COMM_H__ 3 | 4 | #include "simple_comm.h" 5 | #include 6 | 7 | namespace iot { 8 | 9 | class SerialComm : public SimpleComm { 10 | public: 11 | explicit SerialComm(HardwareSerial& serial, unsigned long baudRate = 9600); 12 | int Init() override; 13 | int Send(const JsonDocument& json) override; 14 | void SetRecvCallback(RecvCallback callback) override; 15 | void Loop() override; 16 | 17 | private: 18 | HardwareSerial& _serial; 19 | unsigned long _baudRate; 20 | RecvCallback _recvCallback; 21 | }; 22 | 23 | } // namespace iot 24 | 25 | #endif -------------------------------------------------------------------------------- /src/app/bot/comm/simple_comm.h: -------------------------------------------------------------------------------- 1 | #ifndef __SIMPLE_COMM_H__ 2 | #define __SIMPLE_COMM_H__ 3 | 4 | #include 5 | #include 6 | 7 | namespace iot { 8 | 9 | class SimpleComm { 10 | public: 11 | 12 | using RecvCallback = std::function; 13 | 14 | virtual ~SimpleComm() = default; 15 | virtual int Init() = 0; 16 | virtual int Send(const JsonDocument& json) = 0; 17 | virtual void SetRecvCallback(RecvCallback callback) = 0; 18 | virtual void Loop() = 0; 19 | }; 20 | 21 | 22 | } // namespace iot 23 | 24 | #endif -------------------------------------------------------------------------------- /src/app/bot/comm/udp_comm.h: -------------------------------------------------------------------------------- 1 | #ifndef __UDP_COMM_H__ 2 | #define __UDP_COMM_H__ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include "simple_comm.h" 12 | 13 | namespace iot { 14 | 15 | class UDPComm : public SimpleComm{ 16 | public: 17 | using RecvCallback = std::function; 18 | 19 | UDPComm(const std::string& ssid, const std::string& password, uint16_t localPort); 20 | ~UDPComm(); 21 | 22 | int Init() override; 23 | int Send(const JsonDocument& json) override; 24 | void SetRecvCallback(RecvCallback callback) override; 25 | void Loop(); 26 | 27 | private: 28 | std::string ssid_; 29 | std::string password_; 30 | uint16_t local_port_; 31 | WiFiUDP udp_; 32 | RecvCallback recvCallback_; 33 | }; 34 | 35 | } // namespace iot 36 | 37 | #endif // __UDP_COMM_H__ -------------------------------------------------------------------------------- /src/app/bot/controller.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file controller.h 3 | * @author dingmos 4 | * @version V0.0.1 5 | * @date 2025-02-16 6 | * @brief 结合 button 库解析遥控器状态。 7 | */ 8 | 9 | #ifndef __CONTROLLER_H__ 10 | #define __CONTROLLER_H__ 11 | #define DEFAULTU_BLE_ADDR "04:0A:11:11:90:10" 12 | void controller_init(const char *ble_addr); 13 | 14 | #endif -------------------------------------------------------------------------------- /src/hal/HAL_Def.h: -------------------------------------------------------------------------------- 1 | #ifndef __HAL_DEF_H 2 | #define __HAL_DEF_H 3 | 4 | #include 5 | 6 | namespace HAL 7 | { 8 | 9 | /* Clock */ 10 | typedef struct 11 | { 12 | uint16_t year; 13 | uint8_t month; 14 | uint8_t day; 15 | uint8_t week; 16 | uint8_t hour; 17 | uint8_t minute; 18 | uint8_t second; 19 | uint16_t millisecond; 20 | } Clock_Info_t; 21 | 22 | /* IMU */ 23 | typedef struct 24 | { 25 | float ax; 26 | float ay; 27 | float az; 28 | float gx; 29 | float gy; 30 | float gz; 31 | float mx; 32 | float my; 33 | float mz; 34 | float roll; 35 | float yaw; 36 | float pitch; 37 | } imu_info_t; 38 | 39 | /* Power */ 40 | typedef struct 41 | { 42 | uint16_t voltage; 43 | uint8_t usage; 44 | bool isCharging; 45 | } Power_Info_t; 46 | 47 | } 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /src/hal/audio.cpp: -------------------------------------------------------------------------------- 1 | #include "hal.h" 2 | #include "app/Utils/TonePlayer/TonePlayer.h" 3 | #include "lvgl.h" 4 | #include "app/Utils/TonePlayer/MusicCode.h" 5 | 6 | static TonePlayer player; 7 | 8 | static void tone_callback(uint32_t freq, uint16_t volume) 9 | { 10 | HAL::buzz_tone(freq); 11 | } 12 | 13 | void HAL::audio_init(void) 14 | { 15 | player.SetCallback(tone_callback); 16 | } 17 | 18 | void HAL::audio_update(void) 19 | { 20 | player.Update(lv_tick_get()); 21 | } 22 | 23 | bool HAL::audio_play_music(const char* name) 24 | { 25 | bool retval = false; 26 | for (int i = 0; i < sizeof(MusicList) / sizeof(MusicList[0]); i++) 27 | { 28 | if (strcmp(name, MusicList[i].name) == 0) 29 | { 30 | player.Play(MusicList[i].mc, MusicList[i].length); 31 | retval = true; 32 | break; 33 | } 34 | } 35 | return retval; 36 | } 37 | -------------------------------------------------------------------------------- /src/hal/encoder.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "hal.h" 3 | #include 4 | 5 | static bool encoder_stat = true; 6 | 7 | bool HAL::is_encoder_enabled(void) 8 | { 9 | return encoder_stat; 10 | } 11 | 12 | void HAL::encoder_disable(void) 13 | { 14 | encoder_stat = false; 15 | } 16 | 17 | void HAL::encoder_enable(void) 18 | { 19 | encoder_stat = true; 20 | } -------------------------------------------------------------------------------- /src/hal/led.cpp: -------------------------------------------------------------------------------- 1 | #include "hal.h" 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/hal/motor.h: -------------------------------------------------------------------------------- 1 | #ifndef __MOTOR_H__ 2 | #define __MOTOR_H__ 3 | #include "hal.h" 4 | 5 | #define pi 3.1415926 6 | #define init_smooth 1000 // 该值越大,初始化越慢。以防受到干扰。 7 | #define volt_limit 5.0000 8 | 9 | typedef struct { 10 | bool is_outbound; 11 | int32_t position; 12 | double angle_offset; 13 | }MotorStatusInfo; 14 | 15 | struct XKnobConfig { 16 | // 可以运动的个数 17 | int32_t num_positions; 18 | // 位置 19 | int32_t position; 20 | // 位置宽度弧度 或者是每一步的度数 21 | float position_width_radians; 22 | // 正常旋转时的制动强度 23 | float detent_strength_unit; 24 | // 超出界限后的制动强度 25 | float endstop_strength_unit; 26 | // 每一步弧度的放大值 27 | float snap_point; 28 | // 描述符 29 | char descriptor[50]; 30 | }; 31 | 32 | 33 | #endif // -------------------------------------------------------------------------------- /src/hal/power.cpp: -------------------------------------------------------------------------------- 1 | #include "hal.h" 2 | #include 3 | #include "config.h" 4 | #include 5 | 6 | void HAL::power_init(void) 7 | { 8 | pinMode(BATTERY_OFF_PIN, OUTPUT); 9 | digitalWrite(BATTERY_OFF_PIN, LOW); // 10 | 11 | pinMode(ON_OFF_PIN, OUTPUT); 12 | digitalWrite(ON_OFF_PIN, HIGH); 13 | } 14 | 15 | void HAL::power_off(void) 16 | { 17 | /* 18 | * ___-__----.. 19 | * MT3608: a high input at EN turns on the conveter 20 | * low input turns it off 21 | */ 22 | digitalWrite(BATTERY_OFF_PIN, HIGH); 23 | delay(100); 24 | digitalWrite(BATTERY_OFF_PIN, LOW); 25 | delay(200); 26 | digitalWrite(BATTERY_OFF_PIN, HIGH); 27 | 28 | // keep PUSH_PIN HIGH level in deep sleep mode 29 | rtc_gpio_init((gpio_num_t)PUSH_BUTTON_PIN); 30 | rtc_gpio_pullup_en((gpio_num_t)PUSH_BUTTON_PIN); 31 | rtc_gpio_pulldown_dis((gpio_num_t)PUSH_BUTTON_PIN); 32 | gpio_deep_sleep_hold_en(); 33 | // low level will trigger wakeup 34 | esp_sleep_enable_ext0_wakeup((gpio_num_t)PUSH_BUTTON_PIN, 0); 35 | esp_deep_sleep_start(); 36 | } -------------------------------------------------------------------------------- /src/hal/sd_card.h: -------------------------------------------------------------------------------- 1 | #ifndef __SD_CARD_H__ 2 | #define __SD_CARD_H__ 3 | 4 | #include "FS.h" 5 | #include "SD.h" 6 | #include "SPI.h" 7 | 8 | class SdCard 9 | { 10 | private: 11 | char buf[128]; 12 | 13 | public: 14 | void init(); 15 | 16 | void listDir(const char* dirname, uint8_t levels); 17 | 18 | void createDir(const char* path); 19 | 20 | void removeDir(const char* path); 21 | 22 | void readFile(const char* path); 23 | 24 | String readFileLine(const char* path, int num); 25 | 26 | void writeFile(const char* path, const char* message); 27 | 28 | void appendFile(const char* path, const char* message); 29 | 30 | void renameFile(const char* path1, const char* path2); 31 | 32 | void deleteFile(const char* path); 33 | 34 | void readBinFromSd(const char* path, uint8_t* buf); 35 | 36 | void writeBinToSd(const char* path, uint8_t* buf); 37 | 38 | void fileIO(const char* path); 39 | }; 40 | 41 | extern SdCard tf; 42 | 43 | #endif -------------------------------------------------------------------------------- /src/hal/surface_dial.cpp: -------------------------------------------------------------------------------- 1 | #include "hal/hal.h" 2 | #include "BleKeyboard.h" 3 | 4 | BleKeyboard bleKeyboard("Surface Dial(X)"); 5 | 6 | 7 | 8 | void HAL::surface_dial_init(void) 9 | { 10 | if(!bleKeyboard.isConnected()) { 11 | bleKeyboard.begin(); 12 | } 13 | } 14 | 15 | bool HAL::surface_dial_is_connected(void) 16 | { 17 | return bleKeyboard.isConnected(); 18 | } 19 | 20 | void HAL::surface_dial_press(void) 21 | { 22 | bleKeyboard.sendDialReport(DIAL_PRESS); 23 | } 24 | 25 | void HAL::surface_dial_release(void) 26 | { 27 | bleKeyboard.sendDialReport(DIAL_RELEASE); 28 | } 29 | 30 | 31 | void HAL::surface_dial_update(SuperDialMotion direction) 32 | { 33 | if (bleKeyboard.isConnected()) { 34 | 35 | switch (direction) 36 | { 37 | case SUPER_DIAL_LEFT: 38 | bleKeyboard.sendDialReport(DIAL_L); 39 | break; 40 | case SUPER_DIAL_RIGHT: 41 | bleKeyboard.sendDialReport(DIAL_R); 42 | break; 43 | default: 44 | Serial.println("SuperDial: Error direction parameter"); 45 | break; 46 | } 47 | } 48 | } -------------------------------------------------------------------------------- /src/hal/tuning.h: -------------------------------------------------------------------------------- 1 | #ifndef __TUNING_H__ 2 | #define __TUNING_H__ 3 | 4 | #include 5 | 6 | /** motor.cpp */ 7 | extern PIDController pid_vel; 8 | extern PIDController pid_stb; 9 | extern PIDController pid_vel_tmp; 10 | extern PIDController pid_steering; 11 | extern float g_mid_value; 12 | extern BLDCMotor motor_0; 13 | extern BLDCMotor motor_1; 14 | 15 | /** bot.cpp */ 16 | extern PIDController pid_bot_s; 17 | extern PIDController pid_bot_m; 18 | #endif -------------------------------------------------------------------------------- /src/port/display.h: -------------------------------------------------------------------------------- 1 | #ifndef __DISPLAY_H__ 2 | #define __DISPLAY_H__ 3 | 4 | #include "lvgl.h" 5 | #include 6 | 7 | typedef Arduino_GC9A01 SCREEN_CLASS; 8 | 9 | void Port_Init(); 10 | void DisplayFault_Init(SCREEN_CLASS* scr); 11 | void lv_port_disp_init(SCREEN_CLASS* scr); 12 | void lv_fs_fatfs_init(void); 13 | void lv_port_indev_init(void); 14 | 15 | extern TaskHandle_t handleTaskLvgl; 16 | #endif /* __DISPLAY_H__ */ -------------------------------------------------------------------------------- /test/README: -------------------------------------------------------------------------------- 1 | 2 | This directory is intended for PlatformIO Test Runner and project tests. 3 | 4 | Unit Testing is a software testing method by which individual units of 5 | source code, sets of one or more MCU program modules together with associated 6 | control data, usage procedures, and operating procedures, are tested to 7 | determine whether they are fit for use. Unit testing finds problems early 8 | in the development cycle. 9 | 10 | More information about PlatformIO Unit Testing: 11 | - https://docs.platformio.org/en/latest/advanced/unit-testing/index.html 12 | --------------------------------------------------------------------------------