├── .gitattributes ├── .gitignore ├── CMakeLists.txt ├── Makefile ├── README.md ├── components ├── lv_examples │ ├── CMakeLists.txt │ ├── Kconfig │ ├── component.mk │ ├── lv_demo_conf.h │ └── lv_examples │ │ ├── .gitignore │ │ ├── README.md │ │ ├── docs │ │ └── LICENSE.md │ │ ├── library.properties │ │ ├── lv_demo.h │ │ ├── lv_demo.mk │ │ ├── lv_demo_conf_template.h │ │ ├── scripts │ │ ├── build_all_examples.sh │ │ ├── examples.txt │ │ └── genexamplestxt.sh │ │ └── src │ │ ├── header.py │ │ ├── lv_demo.h │ │ ├── lv_demo_benchmark │ │ ├── README.md │ │ ├── assets │ │ │ ├── img_benchmark_cogwheel_alpha16.c │ │ │ ├── img_benchmark_cogwheel_argb.c │ │ │ ├── img_benchmark_cogwheel_chroma_keyed.c │ │ │ ├── img_benchmark_cogwheel_indexed16.c │ │ │ ├── img_benchmark_cogwheel_rgb.c │ │ │ ├── img_cogwheel_argb.png │ │ │ ├── img_cogwheel_chroma_keyed.png │ │ │ ├── img_cogwheel_indexed16.png │ │ │ ├── img_cogwheel_rgb.png │ │ │ ├── lv_font_montserrat_12_compr_az.c │ │ │ ├── lv_font_montserrat_16_compr_az.c │ │ │ └── lv_font_montserrat_28_compr_az.c │ │ ├── lv_demo_benchmark.c │ │ ├── lv_demo_benchmark.h │ │ ├── screenshot1.png │ │ └── screenshot2.png │ │ ├── lv_demo_keypad_encoder │ │ ├── README.md │ │ ├── lv_demo_keypad_encoder.c │ │ ├── lv_demo_keypad_encoder.h │ │ ├── screenshot1.gif │ │ └── screenshot1.png │ │ ├── lv_demo_music │ │ ├── README.md │ │ ├── assets │ │ │ ├── __pycache__ │ │ │ │ └── spectrum.cpython-36.pyc │ │ │ ├── img_lv_demo_music_btn_corner_large.c │ │ │ ├── img_lv_demo_music_btn_list_pause.c │ │ │ ├── img_lv_demo_music_btn_list_pause_large.c │ │ │ ├── img_lv_demo_music_btn_list_play.c │ │ │ ├── img_lv_demo_music_btn_list_play_large.c │ │ │ ├── img_lv_demo_music_btn_loop.c │ │ │ ├── img_lv_demo_music_btn_loop_large.c │ │ │ ├── img_lv_demo_music_btn_next.c │ │ │ ├── img_lv_demo_music_btn_next_large.c │ │ │ ├── img_lv_demo_music_btn_pause.c │ │ │ ├── img_lv_demo_music_btn_pause_large.c │ │ │ ├── img_lv_demo_music_btn_play.c │ │ │ ├── img_lv_demo_music_btn_play_large.c │ │ │ ├── img_lv_demo_music_btn_prev.c │ │ │ ├── img_lv_demo_music_btn_prev_large.c │ │ │ ├── img_lv_demo_music_btn_rnd.c │ │ │ ├── img_lv_demo_music_btn_rnd_large.c │ │ │ ├── img_lv_demo_music_corner_left.c │ │ │ ├── img_lv_demo_music_corner_left_large.c │ │ │ ├── img_lv_demo_music_corner_right.c │ │ │ ├── img_lv_demo_music_corner_right_large.c │ │ │ ├── img_lv_demo_music_cover_1.c │ │ │ ├── img_lv_demo_music_cover_1_large.c │ │ │ ├── img_lv_demo_music_cover_2.c │ │ │ ├── img_lv_demo_music_cover_2_large.c │ │ │ ├── img_lv_demo_music_cover_3.c │ │ │ ├── img_lv_demo_music_cover_3_large.c │ │ │ ├── img_lv_demo_music_icon_1.c │ │ │ ├── img_lv_demo_music_icon_1_large.c │ │ │ ├── img_lv_demo_music_icon_2.c │ │ │ ├── img_lv_demo_music_icon_2_large.c │ │ │ ├── img_lv_demo_music_icon_3.c │ │ │ ├── img_lv_demo_music_icon_3_large.c │ │ │ ├── img_lv_demo_music_icon_4.c │ │ │ ├── img_lv_demo_music_icon_4_large.c │ │ │ ├── img_lv_demo_music_list_border.c │ │ │ ├── img_lv_demo_music_list_border_large.c │ │ │ ├── img_lv_demo_music_logo.c │ │ │ ├── img_lv_demo_music_slider_knob.c │ │ │ ├── img_lv_demo_music_slider_knob_large.c │ │ │ ├── img_lv_demo_music_wave_bottom.c │ │ │ ├── img_lv_demo_music_wave_bottom_large.c │ │ │ ├── img_lv_demo_music_wave_top.c │ │ │ ├── img_lv_demo_music_wave_top_large.c │ │ │ ├── spectrum.py │ │ │ ├── spectrum_1.h │ │ │ ├── spectrum_2.h │ │ │ └── spectrum_3.h │ │ ├── lv_demo_music.c │ │ ├── lv_demo_music.h │ │ ├── lv_demo_music_list.c │ │ ├── lv_demo_music_list.h │ │ ├── lv_demo_music_main.c │ │ ├── lv_demo_music_main.h │ │ └── screenshot1.gif │ │ ├── lv_demo_stress │ │ ├── README.md │ │ ├── assets │ │ │ ├── lv_font_montserrat_12_compr_az.c │ │ │ ├── lv_font_montserrat_16_compr_az.c │ │ │ └── lv_font_montserrat_28_compr_az.c │ │ ├── lv_demo_stress.c │ │ ├── lv_demo_stress.h │ │ ├── screenshot1.gif │ │ └── screenshot1.png │ │ └── lv_demo_widgets │ │ ├── assets │ │ ├── avatar.png │ │ ├── clothes.png │ │ ├── img_clothes.c │ │ ├── img_demo_widgets_avatar.c │ │ ├── img_lvgl_logo.c │ │ └── lvgl_logo.png │ │ ├── lv_demo_widgets.c │ │ ├── lv_demo_widgets.h │ │ ├── lv_demo_widgets.py │ │ ├── screenshot1.gif │ │ └── screenshot1.png ├── lvgl │ ├── .codecov.yml │ ├── .editorconfig │ ├── .gitignore │ ├── .gitmodules │ ├── CMakeLists.txt │ ├── Kconfig │ ├── LICENCE.txt │ ├── README.md │ ├── component.mk │ ├── docs │ │ ├── CHANGELOG.md │ │ ├── CODE_OF_CONDUCT.md │ │ ├── CODING_STYLE.md │ │ ├── CONTRIBUTING.md │ │ ├── ROADMAP.md │ │ ├── _ext │ │ │ └── lv_example.py │ │ ├── _static │ │ │ ├── css │ │ │ │ ├── custom.css │ │ │ │ └── fontawesome.min.css │ │ │ └── img │ │ │ │ ├── home_1.png │ │ │ │ ├── home_2.png │ │ │ │ ├── home_3.png │ │ │ │ ├── home_4.png │ │ │ │ ├── home_5.png │ │ │ │ ├── home_6.png │ │ │ │ └── home_banner.jpg │ │ ├── _templates │ │ │ ├── layout.html │ │ │ └── page.html │ │ ├── build.py │ │ ├── conf.py │ │ ├── example_list.py │ │ ├── favicon.png │ │ ├── get-started │ │ │ ├── arduino.md │ │ │ ├── espressif.md │ │ │ ├── index.md │ │ │ ├── micropython.md │ │ │ ├── nuttx.md │ │ │ ├── nxp.md │ │ │ ├── pc-simulator.md │ │ │ ├── quick-overview.md │ │ │ └── stm32.md │ │ ├── header.rst │ │ ├── index.md │ │ ├── intro │ │ │ └── index.md │ │ ├── layouts │ │ │ ├── flex.md │ │ │ ├── grid.md │ │ │ └── index.md │ │ ├── logo_lvgl.png │ │ ├── misc │ │ │ ├── align.png │ │ │ ├── bidi.png │ │ │ ├── boxmodel.png │ │ │ ├── btn_example.png │ │ │ ├── button_style_example.gif │ │ │ ├── button_style_example.png │ │ │ ├── codeblocks.jpg │ │ │ ├── eclipse.jpg │ │ │ ├── layers.png │ │ │ ├── par_child1.png │ │ │ ├── par_child2.png │ │ │ ├── par_child3.png │ │ │ ├── platformio.jpg │ │ │ ├── qtcreator.jpg │ │ │ ├── simple_button_example.gif │ │ │ ├── simple_button_example.png │ │ │ ├── symbols.png │ │ │ ├── sys.png │ │ │ └── visualstudio.jpg │ │ ├── overview │ │ │ ├── animation.md │ │ │ ├── color.md │ │ │ ├── coords.md │ │ │ ├── display.md │ │ │ ├── drawing.md │ │ │ ├── event.md │ │ │ ├── file-system.md │ │ │ ├── font.md │ │ │ ├── image.md │ │ │ ├── indev.md │ │ │ ├── index.md │ │ │ ├── layer.md │ │ │ ├── new_widget.md │ │ │ ├── object.md │ │ │ ├── scroll.md │ │ │ ├── style-props.md │ │ │ ├── style.md │ │ │ └── timer.md │ │ ├── porting │ │ │ ├── display.md │ │ │ ├── indev.md │ │ │ ├── index.md │ │ │ ├── log.md │ │ │ ├── os.md │ │ │ ├── project.md │ │ │ ├── sleep.md │ │ │ ├── task-handler.md │ │ │ └── tick.md │ │ ├── requirements.txt │ │ └── widgets │ │ │ ├── core │ │ │ ├── arc.md │ │ │ ├── bar.md │ │ │ ├── btn.md │ │ │ ├── btnmatrix.md │ │ │ ├── canvas.md │ │ │ ├── checkbox.md │ │ │ ├── dropdown.md │ │ │ ├── img.md │ │ │ ├── index.md │ │ │ ├── label.md │ │ │ ├── line.md │ │ │ ├── roller.md │ │ │ ├── slider.md │ │ │ ├── switch.md │ │ │ ├── table.md │ │ │ └── textarea.md │ │ │ ├── extra │ │ │ ├── calendar.md │ │ │ ├── chart.md │ │ │ ├── colorwheel.md │ │ │ ├── imgbtn.md │ │ │ ├── index.md │ │ │ ├── keyboard.md │ │ │ ├── led.md │ │ │ ├── list.md │ │ │ ├── meter.md │ │ │ ├── msgbox.md │ │ │ ├── span.md │ │ │ ├── spinbox.md │ │ │ ├── spinner.md │ │ │ ├── tabview.md │ │ │ ├── tileview.md │ │ │ └── win.md │ │ │ ├── index.md │ │ │ └── obj.md │ ├── 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 │ │ ├── arduino │ │ │ └── LVGL_Arduino │ │ │ │ └── LVGL_Arduino.ino │ │ ├── assets │ │ │ ├── animimg001.c │ │ │ ├── animimg001.png │ │ │ ├── animimg002.c │ │ │ ├── animimg002.png │ │ │ ├── animimg003.c │ │ │ ├── animimg003.png │ │ │ ├── caret_down.png │ │ │ ├── font │ │ │ │ ├── lv_font_simsun_16_cjk.fnt │ │ │ │ ├── montserrat-16.fnt │ │ │ │ └── montserrat-22.fnt │ │ │ ├── img_caret_down.c │ │ │ ├── img_caret_down.png │ │ │ ├── img_cogwheel_alpha16.c │ │ │ ├── img_cogwheel_argb.c │ │ │ ├── img_cogwheel_argb.png │ │ │ ├── img_cogwheel_chroma_keyed.c │ │ │ ├── img_cogwheel_chroma_keyed.png │ │ │ ├── img_cogwheel_indexed16.c │ │ │ ├── img_cogwheel_indexed16.png │ │ │ ├── img_cogwheel_rgb.c │ │ │ ├── img_cogwheel_rgb.png │ │ │ ├── img_hand.c │ │ │ ├── img_hand_hour.png │ │ │ ├── img_hand_min.png │ │ │ ├── img_skew_strip.c │ │ │ ├── img_skew_strip.png │ │ │ ├── img_skew_strip_80x20_argb8888.fnt │ │ │ ├── img_star.c │ │ │ ├── img_star.png │ │ │ ├── img_strip.png │ │ │ ├── imgbtn_left.c │ │ │ ├── imgbtn_left.png │ │ │ ├── imgbtn_mid.c │ │ │ ├── imgbtn_mid.png │ │ │ ├── imgbtn_right.c │ │ │ ├── imgbtn_right.png │ │ │ ├── skew_strip.png │ │ │ └── star.png │ │ ├── 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 │ │ ├── lv_examples.h │ │ ├── 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 │ │ │ ├── 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 │ │ │ ├── checkbox │ │ │ ├── index.rst │ │ │ ├── lv_example_checkbox_1.c │ │ │ └── lv_example_checkbox_1.py │ │ │ ├── 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 │ │ │ ├── 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 │ │ │ └── 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 │ ├── library.json │ ├── library.properties │ ├── lv_conf_template.h │ ├── lvgl.h │ ├── lvgl.mk │ ├── scripts │ │ ├── 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 │ │ ├── code-format.cfg │ │ ├── code-format.sh │ │ ├── cppcheck_run.sh │ │ ├── find_version.sh │ │ ├── genexamplelist.sh │ │ ├── infer_run.sh │ │ ├── lv_conf_internal_gen.py │ │ ├── release │ │ │ ├── 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 │ │ │ ├── lv_extra.c │ │ │ ├── lv_extra.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 │ │ │ ├── korean.ttf │ │ │ ├── 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_stm32_dma2d.c │ │ │ └── lv_gpu_stm32_dma2d.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_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 │ │ ├── Makefile │ │ ├── README.md │ │ ├── build.py │ │ ├── config.yml │ │ ├── defines.py │ │ ├── main.py │ │ ├── ref_imgs │ │ │ ├── dropdown_1.png │ │ │ ├── dropdown_2.png │ │ │ └── scr1.png │ │ ├── src │ │ │ ├── lv_test_conf.h │ │ │ ├── lv_test_indev.c │ │ │ ├── lv_test_indev.h │ │ │ ├── lv_test_init.c │ │ │ ├── lv_test_init.h │ │ │ ├── lv_test_main.c │ │ │ ├── test_cases │ │ │ │ ├── _test_template.c │ │ │ │ ├── test_config.c │ │ │ │ ├── test_dropdown.c │ │ │ │ ├── test_font_loader.c │ │ │ │ ├── test_obj_tree.c │ │ │ │ └── test_style.c │ │ │ └── test_fonts │ │ │ │ ├── font_1.c │ │ │ │ ├── font_1.fnt │ │ │ │ ├── font_2.c │ │ │ │ ├── font_2.fnt │ │ │ │ ├── font_3.c │ │ │ │ └── font_3.fnt │ │ ├── test.py │ │ └── 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 └── lvgl_esp32_drivers │ ├── .editorconfig │ ├── .gitignore │ ├── CMakeLists.txt │ ├── CONTRIBUTE_CONTROLLER_SUPPORT.md │ ├── Kconfig │ ├── LICENSE │ ├── README.md │ ├── component.mk │ ├── lvgl_helpers.c │ ├── lvgl_helpers.h │ ├── lvgl_i2c │ ├── Kconfig │ ├── README.md │ ├── i2c_manager.c │ └── i2c_manager.h │ ├── lvgl_spi_conf.h │ ├── lvgl_tft │ ├── EVE.h │ ├── EVE_commands.c │ ├── EVE_commands.h │ ├── EVE_config.h │ ├── FT81x.c │ ├── FT81x.h │ ├── GC9A01.c │ ├── GC9A01.h │ ├── Kconfig │ ├── disp_driver.c │ ├── disp_driver.h │ ├── disp_spi.c │ ├── disp_spi.h │ ├── hx8357.c │ ├── hx8357.h │ ├── il3820.c │ ├── il3820.h │ ├── ili9163c.c │ ├── ili9163c.h │ ├── ili9341.c │ ├── ili9341.h │ ├── ili9481.c │ ├── ili9481.h │ ├── ili9486.c │ ├── ili9486.h │ ├── ili9488.c │ ├── ili9488.h │ ├── jd79653a.c │ ├── jd79653a.h │ ├── ra8875.c │ ├── ra8875.h │ ├── sh1107.c │ ├── sh1107.h │ ├── ssd1306.c │ ├── ssd1306.h │ ├── st7735s.c │ ├── st7735s.h │ ├── st7789.c │ ├── st7789.h │ ├── st7796s.c │ ├── st7796s.h │ ├── uc8151d.c │ └── uc8151d.h │ └── lvgl_touch │ ├── FT81x.c │ ├── FT81x.h │ ├── Kconfig │ ├── adcraw.c │ ├── adcraw.h │ ├── ft6x36.c │ ├── ft6x36.h │ ├── gt911.c │ ├── gt911.h │ ├── ra8875_touch.c │ ├── ra8875_touch.h │ ├── stmpe610.c │ ├── stmpe610.h │ ├── touch_driver.c │ ├── touch_driver.h │ ├── tp_spi.c │ ├── tp_spi.h │ ├── xpt2046.c │ └── xpt2046.h ├── main ├── CMakeLists.txt ├── component.mk └── main.c ├── sdkconfig ├── sdkconfig.defaults └── sdkconfig.old /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | *.d 3 | 4 | # Object files 5 | *.o 6 | *.ko 7 | *.obj 8 | *.elf 9 | 10 | # Linker output 11 | *.ilk 12 | *.map 13 | *.exp 14 | 15 | # Precompiled Headers 16 | *.gch 17 | *.pch 18 | 19 | # Libraries 20 | *.lib 21 | *.a 22 | *.la 23 | *.lo 24 | 25 | # Shared objects (inc. Windows DLLs) 26 | *.dll 27 | *.so 28 | *.so.* 29 | *.dylib 30 | 31 | # Executables 32 | *.exe 33 | *.out 34 | *.app 35 | *.i*86 36 | *.x86_64 37 | *.hex 38 | 39 | # Debug files 40 | *.dSYM/ 41 | *.su 42 | *.idb 43 | *.pdb 44 | 45 | # Kernel Module Compile Results 46 | *.mod* 47 | *.cmd 48 | .tmp_versions/ 49 | modules.order 50 | Module.symvers 51 | Mkfile.old 52 | dkms.conf 53 | 54 | # MacOS 55 | .DS_Store 56 | 57 | # ESP-IDF build dir 58 | build 59 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The following lines of boilerplate have to be in your project's 2 | # CMakeLists in this exact order for cmake to work correctly 3 | cmake_minimum_required(VERSION 3.5) 4 | 5 | include($ENV{IDF_PATH}/tools/cmake/project.cmake) 6 | project(hello-world) -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # This is a project Makefile. It is assumed the directory this Makefile resides in is a 3 | # project subdirectory. 4 | # 5 | 6 | PROJECT_NAME := hello-world 7 | 8 | include $(IDF_PATH)/make/project.mk 9 | 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # LVGL TEMPLATE 3 | Basic template for ST7789 driver and esp32. 4 | 5 | ## About ESP32 6 | 7 | * board: ESP32-WROVER 8 | * flash size: 16MB 9 | * esp-idf: v4.4 10 | 11 | ## About LCD TFT 12 | 13 | * LCD driver: ST7789 14 | * LCD module: 1.54 TFT SPI 240x240 15 | 16 | 17 | ## About LVGL 18 | 19 | * LVGL : v8.0.0-194-gd79ca388 20 | * LVGL commit : d79ca38 21 | * LVGL esp32 drivers commit: a68ce89 22 | -------------------------------------------------------------------------------- /components/lv_examples/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if(ESP_PLATFORM) 2 | 3 | file(GLOB_RECURSE SOURCES lv_examples/*.c) 4 | 5 | idf_component_register(SRCS ${SOURCES} 6 | INCLUDE_DIRS . 7 | REQUIRES lvgl) 8 | 9 | endif() 10 | -------------------------------------------------------------------------------- /components/lv_examples/Kconfig: -------------------------------------------------------------------------------- 1 | # Kconfig for lv_examples v7.4.0 2 | 3 | menu "lv_examples configuration" 4 | 5 | config LV_EX_PRINTF 6 | bool "Enable printf-ing data in demos and examples." 7 | 8 | choice LV_EX_CHOICE 9 | prompt "Select the demo you want to run." 10 | default LV_USE_DEMO_WIDGETS 11 | 12 | config LV_USE_DEMO_WIDGETS 13 | bool "Show demo widgets." 14 | 15 | config LV_DEMO_WIDGETS_SLIDESHOW 16 | bool "Slide demo widgets automatically." 17 | depends on LV_USE_DEMO_WIDGETS 18 | default y 19 | 20 | config LV_USE_DEMO_KEYPAD_AND_ENCODER 21 | bool "Demonstrate the usage of encoder and keyboard." 22 | 23 | config LV_USE_DEMO_BENCHMARK 24 | bool "Benchmark your system." 25 | 26 | config LV_USE_DEMO_STRESS 27 | bool "Stress test for LVGL." 28 | 29 | config LV_USE_DEMO_MUSIC 30 | bool "Music test for LVGL." 31 | endchoice 32 | endmenu 33 | -------------------------------------------------------------------------------- /components/lv_examples/component.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Component Makefile 3 | # 4 | 5 | CFLAGS += -DLV_CONF_INCLUDE_SIMPLE 6 | 7 | COMPONENT_SRCDIRS := lv_examples \ 8 | lv_examples/src/lv_demo_benchmark \ 9 | lv_examples/src/lv_demo_keypad_encoder \ 10 | lv_examples/src/demo_stress \ 11 | lv_examples/src/lv_demo_widgets \ 12 | lv_examples/src/lv_ex_style \ 13 | lv_examples/src/lv_ex_widgets \ 14 | lv_examples/src/lv_ex_music \ 15 | lv_examples/assets 16 | 17 | COMPONENT_ADD_INCLUDEDIRS := $(COMPONENT_SRCDIRS) . 18 | -------------------------------------------------------------------------------- /components/lv_examples/lv_examples/.gitignore: -------------------------------------------------------------------------------- 1 | **/*.o 2 | objs 3 | -------------------------------------------------------------------------------- /components/lv_examples/lv_examples/library.properties: -------------------------------------------------------------------------------- 1 | name=lv_examples 2 | version=8.1.0-dev 3 | author=kisvegabor 4 | maintainer=kisvegabor,embeddedt 5 | sentence=Examples for LVGL grapics library 6 | paragraph=Demos and examples to see and try the features of LVGL embedded GUI library. 7 | category=Display 8 | url=https://lvgl.io 9 | architectures=* 10 | includes=lv_demo.h 11 | depends=lvgl 12 | -------------------------------------------------------------------------------- /components/lv_examples/lv_examples/lv_demo.mk: -------------------------------------------------------------------------------- 1 | CSRCS += $(shell find -L $(LVGL_DIR)/lv_demos -name "*.c") 2 | -------------------------------------------------------------------------------- /components/lv_examples/lv_examples/scripts/examples.txt: -------------------------------------------------------------------------------- 1 | lv_demo_music 2 | lv_demo_stress 3 | lv_demo_benchmark 4 | lv_demo_printer 5 | lv_demo_keypad_encoder 6 | lv_demo_widgets 7 | -------------------------------------------------------------------------------- /components/lv_examples/lv_examples/scripts/genexamplestxt.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | find src -name \*.h | xargs grep -h "void lv" | sed 's/(/ /g' | awk '{print $2}' 3 | -------------------------------------------------------------------------------- /components/lv_examples/lv_examples/src/header.py: -------------------------------------------------------------------------------- 1 | #!/opt/bin/lv_micropython -i 2 | try: 3 | import sys 4 | except ImportError: 5 | import usys as sys 6 | # JS requires a special import 7 | if sys.platform == 'javascript': 8 | import utime as time 9 | import imp 10 | sys.path.append('https://raw.githubusercontent.com/littlevgl/lv_binding_micropython/master/lib') 11 | import display_driver 12 | else: 13 | import display_driver 14 | import time 15 | 16 | import lvgl as lv 17 | -------------------------------------------------------------------------------- /components/lv_examples/lv_examples/src/lv_demo.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_examples.h 3 | * This file exists only to be compatible with Arduino's library structure 4 | */ 5 | 6 | #ifndef LV_DEMO_SRC_H 7 | #define LV_DEMO_SRC_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | 17 | #include "../lv_demo.h" 18 | 19 | /********************* 20 | * DEFINES 21 | *********************/ 22 | 23 | /********************** 24 | * TYPEDEFS 25 | **********************/ 26 | 27 | /********************** 28 | * GLOBAL PROTOTYPES 29 | **********************/ 30 | 31 | /********************** 32 | * MACROS 33 | **********************/ 34 | 35 | 36 | #ifdef __cplusplus 37 | } /* extern "C" */ 38 | #endif 39 | 40 | #endif /*LV_DEMO_SRC_H*/ 41 | -------------------------------------------------------------------------------- /components/lv_examples/lv_examples/src/lv_demo_benchmark/assets/img_cogwheel_argb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lv_examples/lv_examples/src/lv_demo_benchmark/assets/img_cogwheel_argb.png -------------------------------------------------------------------------------- /components/lv_examples/lv_examples/src/lv_demo_benchmark/assets/img_cogwheel_chroma_keyed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lv_examples/lv_examples/src/lv_demo_benchmark/assets/img_cogwheel_chroma_keyed.png -------------------------------------------------------------------------------- /components/lv_examples/lv_examples/src/lv_demo_benchmark/assets/img_cogwheel_indexed16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lv_examples/lv_examples/src/lv_demo_benchmark/assets/img_cogwheel_indexed16.png -------------------------------------------------------------------------------- /components/lv_examples/lv_examples/src/lv_demo_benchmark/assets/img_cogwheel_rgb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lv_examples/lv_examples/src/lv_demo_benchmark/assets/img_cogwheel_rgb.png -------------------------------------------------------------------------------- /components/lv_examples/lv_examples/src/lv_demo_benchmark/lv_demo_benchmark.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_demo_benchmark.h 3 | * 4 | */ 5 | 6 | #ifndef LV_DEMO_BENCHMARK_H 7 | #define LV_DEMO_BENCHMARK_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_demo_benchmark(void); 29 | 30 | /********************** 31 | * MACROS 32 | **********************/ 33 | 34 | #ifdef __cplusplus 35 | } /* extern "C" */ 36 | #endif 37 | 38 | #endif /*LV_DEMO_BENCHMARK_H*/ 39 | -------------------------------------------------------------------------------- /components/lv_examples/lv_examples/src/lv_demo_benchmark/screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lv_examples/lv_examples/src/lv_demo_benchmark/screenshot1.png -------------------------------------------------------------------------------- /components/lv_examples/lv_examples/src/lv_demo_benchmark/screenshot2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lv_examples/lv_examples/src/lv_demo_benchmark/screenshot2.png -------------------------------------------------------------------------------- /components/lv_examples/lv_examples/src/lv_demo_keypad_encoder/README.md: -------------------------------------------------------------------------------- 1 | # Keypad and Encoder demo 2 | 3 | ## Overview 4 | 5 | LVGL allows you to control the widgets with keypad and/or encoder without touchpad. 6 | This demo shows how to handle buttons, drop-down lists, rollers, sliders, switches and text inputs without touchpad. 7 | Learn more about the touchpad-less usage of LVGL [here](https://docs.lvgl.io/v7/en/html/overview/indev.html#keypad-and-encoder). 8 | 9 | ![Keypad and encoder navigation in LVGL embedded GUI library](https://github.com/lvgl/lv_examples/blob/master/src/lv_demo_keypad_encoder/screenshot1.gif?raw=true) 10 | 11 | ## Run the demo 12 | - In `lv_ex_conf.h` set `LV_USE_DEMO_KEYPAD_AND_ENCODER 1` 13 | - After `lv_init()` and initializing the drivers call `lv_demo_keypad_encoder()` 14 | -------------------------------------------------------------------------------- /components/lv_examples/lv_examples/src/lv_demo_keypad_encoder/lv_demo_keypad_encoder.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_demo_keypad_encoder.h 3 | * 4 | */ 5 | 6 | #ifndef LV_DEMO_KEYPAD_ENCODER_H 7 | #define LV_DEMO_KEYPAD_ENCODER_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_demo_keypad_encoder(void); 29 | 30 | /********************** 31 | * MACROS 32 | **********************/ 33 | 34 | #ifdef __cplusplus 35 | } /* extern "C" */ 36 | #endif 37 | 38 | #endif /*LV_DEMO_KEYPAD_ENCODER_H*/ 39 | -------------------------------------------------------------------------------- /components/lv_examples/lv_examples/src/lv_demo_keypad_encoder/screenshot1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lv_examples/lv_examples/src/lv_demo_keypad_encoder/screenshot1.gif -------------------------------------------------------------------------------- /components/lv_examples/lv_examples/src/lv_demo_keypad_encoder/screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lv_examples/lv_examples/src/lv_demo_keypad_encoder/screenshot1.png -------------------------------------------------------------------------------- /components/lv_examples/lv_examples/src/lv_demo_music/assets/__pycache__/spectrum.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lv_examples/lv_examples/src/lv_demo_music/assets/__pycache__/spectrum.cpython-36.pyc -------------------------------------------------------------------------------- /components/lv_examples/lv_examples/src/lv_demo_music/assets/spectrum.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import librosa 3 | import math 4 | import sys 5 | 6 | print("Loading file") 7 | audio, sample_rate = librosa.load(sys.argv[1], duration=60, offset=0, sr=15360) 8 | 9 | print("Getting spectrum") 10 | spectrum = librosa.stft(audio) 11 | S = np.abs(spectrum) 12 | 13 | fout = open("spectrum.h", "w") 14 | 15 | print("Writing file") 16 | fn = 36 17 | fs = int(len(S) / fn) 18 | fout.write("const uint16_t spectrum[][4] = {\n") 19 | for t in range(0,len(S[0]-1)): 20 | fout.write("{ ") 21 | f_prev = 0 22 | for f in [8, 45, 300, 600]: 23 | v = 0 24 | for i in range(f_prev, f): v += S[i][t] 25 | if v != 0: v = int(v/30) 26 | if v < 0: v = 0 27 | f_prev = f 28 | fout.write(str(int(v)) + ", ") 29 | fout.write("},\n") 30 | fout.write("};\n") 31 | fout.close() 32 | 33 | print("Finished") -------------------------------------------------------------------------------- /components/lv_examples/lv_examples/src/lv_demo_music/lv_demo_music_list.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_demo_music_list.h 3 | * 4 | */ 5 | 6 | #ifndef LV_DEMO_MUSIC_LIST_H 7 | #define LV_DEMO_MUSIC_LIST_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "lv_demo_music.h" 17 | #if LV_USE_DEMO_MUSIC 18 | 19 | /********************* 20 | * DEFINES 21 | *********************/ 22 | 23 | /********************** 24 | * TYPEDEFS 25 | **********************/ 26 | 27 | /********************** 28 | * GLOBAL PROTOTYPES 29 | **********************/ 30 | lv_obj_t * _lv_demo_music_list_create(lv_obj_t * parent); 31 | void _lv_demo_music_list_btn_check(uint32_t track_id, bool state); 32 | 33 | /********************** 34 | * MACROS 35 | **********************/ 36 | 37 | #endif /*LV_USE_DEMO_MUSIC*/ 38 | 39 | #ifdef __cplusplus 40 | } /* extern "C" */ 41 | #endif 42 | 43 | #endif /*LV_DEMO_MUSIC_LIST_H*/ 44 | -------------------------------------------------------------------------------- /components/lv_examples/lv_examples/src/lv_demo_music/lv_demo_music_main.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_demo_music_main.h 3 | * 4 | */ 5 | 6 | #ifndef LV_DEMO_MUSIC_MAIN_H 7 | #define LV_DEMO_MUSIC_MAIN_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "lv_demo_music.h" 17 | #if LV_USE_DEMO_MUSIC 18 | 19 | /********************* 20 | * DEFINES 21 | *********************/ 22 | 23 | /********************** 24 | * TYPEDEFS 25 | **********************/ 26 | 27 | /********************** 28 | * GLOBAL PROTOTYPES 29 | **********************/ 30 | lv_obj_t * _lv_demo_music_main_create(lv_obj_t * parent); 31 | void _lv_demo_music_play(uint32_t id); 32 | void _lv_demo_music_resume(void); 33 | void _lv_demo_music_pause(void); 34 | void _lv_demo_music_album_next(bool next); 35 | 36 | /********************** 37 | * MACROS 38 | **********************/ 39 | #endif /*LV_USE_DEMO_MUSIC*/ 40 | 41 | 42 | #ifdef __cplusplus 43 | } /* extern "C" */ 44 | #endif 45 | 46 | #endif /*LV_DEMO_MUSIC_MAIN_H*/ 47 | -------------------------------------------------------------------------------- /components/lv_examples/lv_examples/src/lv_demo_music/screenshot1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lv_examples/lv_examples/src/lv_demo_music/screenshot1.gif -------------------------------------------------------------------------------- /components/lv_examples/lv_examples/src/lv_demo_stress/README.md: -------------------------------------------------------------------------------- 1 | # Stress demo 2 | 3 | ## Overview 4 | 5 | A stress test for LVGL. 6 | It contains a lot of object creation, deletion, animations, styles usage, and so on. It can be used if there is any memory corruption during heavy usage or any memory leaks. 7 | 8 | ![Printer demo with LVGL embedded GUI library](https://github.com/lvgl/lv_examples/blob/master/src/lv_demo_stress/screenshot1.gif?raw=true) 9 | 10 | ## Run the demo 11 | - In `lv_ex_conf.h` set `LV_USE_DEMO_STRESS 1` 12 | - In `lv_conf.h` enable all the widgets (`LV_USE_BTN 1`) and the animations (`LV_USE_ANIMATION 1`) 13 | - After `lv_init()` and initializing the drivers call `lv_demo_stress()` 14 | -------------------------------------------------------------------------------- /components/lv_examples/lv_examples/src/lv_demo_stress/lv_demo_stress.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_demo_stress.h 3 | * 4 | */ 5 | 6 | #ifndef LV_DEMO_STRESS_H 7 | #define LV_DEMO_STRESS_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_demo_stress(void); 29 | 30 | /********************** 31 | * MACROS 32 | **********************/ 33 | 34 | #ifdef __cplusplus 35 | } /* extern "C" */ 36 | #endif 37 | 38 | #endif /*LV_DEMO_STRESS_H*/ 39 | -------------------------------------------------------------------------------- /components/lv_examples/lv_examples/src/lv_demo_stress/screenshot1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lv_examples/lv_examples/src/lv_demo_stress/screenshot1.gif -------------------------------------------------------------------------------- /components/lv_examples/lv_examples/src/lv_demo_stress/screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lv_examples/lv_examples/src/lv_demo_stress/screenshot1.png -------------------------------------------------------------------------------- /components/lv_examples/lv_examples/src/lv_demo_widgets/assets/avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lv_examples/lv_examples/src/lv_demo_widgets/assets/avatar.png -------------------------------------------------------------------------------- /components/lv_examples/lv_examples/src/lv_demo_widgets/assets/clothes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lv_examples/lv_examples/src/lv_demo_widgets/assets/clothes.png -------------------------------------------------------------------------------- /components/lv_examples/lv_examples/src/lv_demo_widgets/assets/lvgl_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lv_examples/lv_examples/src/lv_demo_widgets/assets/lvgl_logo.png -------------------------------------------------------------------------------- /components/lv_examples/lv_examples/src/lv_demo_widgets/lv_demo_widgets.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_demo_widgets.h 3 | * 4 | */ 5 | 6 | #ifndef LV_DEMO_WIDGETS_H 7 | #define LV_DEMO_WIDGETS_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_demo_widgets(void); 29 | 30 | /********************** 31 | * MACROS 32 | **********************/ 33 | 34 | #ifdef __cplusplus 35 | } /* extern "C" */ 36 | #endif 37 | 38 | #endif /*LV_DEMO_WIDGETS_H*/ 39 | -------------------------------------------------------------------------------- /components/lv_examples/lv_examples/src/lv_demo_widgets/screenshot1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lv_examples/lv_examples/src/lv_demo_widgets/screenshot1.gif -------------------------------------------------------------------------------- /components/lv_examples/lv_examples/src/lv_demo_widgets/screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lv_examples/lv_examples/src/lv_demo_widgets/screenshot1.png -------------------------------------------------------------------------------- /components/lvgl/.codecov.yml: -------------------------------------------------------------------------------- 1 | codecov: 2 | notify: 3 | require_ci_to_pass: true 4 | comment: off 5 | coverage: 6 | status: 7 | project: 8 | default: 9 | target: 0% 10 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | image_err.h 22 | -------------------------------------------------------------------------------- /components/lvgl/.gitmodules: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lvgl/.gitmodules -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/lvgl/docs/_static/img/home_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lvgl/docs/_static/img/home_1.png -------------------------------------------------------------------------------- /components/lvgl/docs/_static/img/home_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lvgl/docs/_static/img/home_2.png -------------------------------------------------------------------------------- /components/lvgl/docs/_static/img/home_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lvgl/docs/_static/img/home_3.png -------------------------------------------------------------------------------- /components/lvgl/docs/_static/img/home_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lvgl/docs/_static/img/home_4.png -------------------------------------------------------------------------------- /components/lvgl/docs/_static/img/home_5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lvgl/docs/_static/img/home_5.png -------------------------------------------------------------------------------- /components/lvgl/docs/_static/img/home_6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lvgl/docs/_static/img/home_6.png -------------------------------------------------------------------------------- /components/lvgl/docs/_static/img/home_banner.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lvgl/docs/_static/img/home_banner.jpg -------------------------------------------------------------------------------- /components/lvgl/docs/_templates/layout.html: -------------------------------------------------------------------------------- 1 | {% extends "!layout.html" %} 2 | 3 | {%- block extrahead %} 4 | {{ super() }} 5 | 6 | 7 | 14 | {% endblock %} 15 | 16 | {% block footer %} 17 | {{ super() }} 18 | 31 | {% endblock %} 32 | -------------------------------------------------------------------------------- /components/lvgl/docs/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lvgl/docs/favicon.png -------------------------------------------------------------------------------- /components/lvgl/docs/get-started/stm32.md: -------------------------------------------------------------------------------- 1 | ```eval_rst 2 | .. include:: /header.rst 3 | :github_url: |github_link_base|/get-started/stm32.md 4 | ``` 5 | 6 | # STM32 7 | 8 | TODO 9 | -------------------------------------------------------------------------------- /components/lvgl/docs/header.rst: -------------------------------------------------------------------------------- 1 | .. |github_link_base| replace:: https://github.com/lvgl/lvgl/blob/c6f99ad200c7862c2f3cca3811bc2bdc2c95e971/docs -------------------------------------------------------------------------------- /components/lvgl/docs/layouts/index.md: -------------------------------------------------------------------------------- 1 | ```eval_rst 2 | .. include:: /header.rst 3 | :github_url: |github_link_base|/layouts/index.md 4 | ``` 5 | 6 | # Layouts 7 | 8 | 9 | ```eval_rst 10 | .. toctree:: 11 | :maxdepth: 2 12 | 13 | flex 14 | grid 15 | ``` 16 | -------------------------------------------------------------------------------- /components/lvgl/docs/logo_lvgl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lvgl/docs/logo_lvgl.png -------------------------------------------------------------------------------- /components/lvgl/docs/misc/align.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lvgl/docs/misc/align.png -------------------------------------------------------------------------------- /components/lvgl/docs/misc/bidi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lvgl/docs/misc/bidi.png -------------------------------------------------------------------------------- /components/lvgl/docs/misc/boxmodel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lvgl/docs/misc/boxmodel.png -------------------------------------------------------------------------------- /components/lvgl/docs/misc/btn_example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lvgl/docs/misc/btn_example.png -------------------------------------------------------------------------------- /components/lvgl/docs/misc/button_style_example.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lvgl/docs/misc/button_style_example.gif -------------------------------------------------------------------------------- /components/lvgl/docs/misc/button_style_example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lvgl/docs/misc/button_style_example.png -------------------------------------------------------------------------------- /components/lvgl/docs/misc/codeblocks.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lvgl/docs/misc/codeblocks.jpg -------------------------------------------------------------------------------- /components/lvgl/docs/misc/eclipse.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lvgl/docs/misc/eclipse.jpg -------------------------------------------------------------------------------- /components/lvgl/docs/misc/layers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lvgl/docs/misc/layers.png -------------------------------------------------------------------------------- /components/lvgl/docs/misc/par_child1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lvgl/docs/misc/par_child1.png -------------------------------------------------------------------------------- /components/lvgl/docs/misc/par_child2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lvgl/docs/misc/par_child2.png -------------------------------------------------------------------------------- /components/lvgl/docs/misc/par_child3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lvgl/docs/misc/par_child3.png -------------------------------------------------------------------------------- /components/lvgl/docs/misc/platformio.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lvgl/docs/misc/platformio.jpg -------------------------------------------------------------------------------- /components/lvgl/docs/misc/qtcreator.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lvgl/docs/misc/qtcreator.jpg -------------------------------------------------------------------------------- /components/lvgl/docs/misc/simple_button_example.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lvgl/docs/misc/simple_button_example.gif -------------------------------------------------------------------------------- /components/lvgl/docs/misc/simple_button_example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lvgl/docs/misc/simple_button_example.png -------------------------------------------------------------------------------- /components/lvgl/docs/misc/symbols.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lvgl/docs/misc/symbols.png -------------------------------------------------------------------------------- /components/lvgl/docs/misc/sys.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lvgl/docs/misc/sys.png -------------------------------------------------------------------------------- /components/lvgl/docs/misc/visualstudio.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lvgl/docs/misc/visualstudio.jpg -------------------------------------------------------------------------------- /components/lvgl/docs/overview/index.md: -------------------------------------------------------------------------------- 1 | ```eval_rst 2 | .. include:: /header.rst 3 | :github_url: |github_link_base|/overview/index.md 4 | ``` 5 | 6 | # Overview 7 | 8 | 9 | ```eval_rst 10 | 11 | .. toctree:: 12 | :maxdepth: 2 13 | 14 | object 15 | coords 16 | style 17 | style-props 18 | scroll 19 | layer 20 | event 21 | indev 22 | display 23 | color 24 | font 25 | image 26 | file-system 27 | animation 28 | timer 29 | drawing 30 | new_widget 31 | ``` 32 | 33 | -------------------------------------------------------------------------------- /components/lvgl/docs/overview/new_widget.md: -------------------------------------------------------------------------------- 1 | ```eval_rst 2 | .. include:: /header.rst 3 | :github_url: |github_link_base|/overview/new_widget.md 4 | ``` 5 | 6 | # New widget 7 | 8 | -------------------------------------------------------------------------------- /components/lvgl/docs/porting/index.md: -------------------------------------------------------------------------------- 1 | ```eval_rst 2 | .. include:: /header.rst 3 | :github_url: |github_link_base|/porting/index.md 4 | ``` 5 | 6 | # Porting 7 | 8 | ```eval_rst 9 | 10 | .. toctree:: 11 | :maxdepth: 2 12 | 13 | project 14 | display 15 | indev 16 | tick 17 | task-handler 18 | sleep 19 | os 20 | log 21 | 22 | ``` 23 | 24 | -------------------------------------------------------------------------------- /components/lvgl/docs/porting/os.md: -------------------------------------------------------------------------------- 1 | ```eval_rst 2 | .. include:: /header.rst 3 | :github_url: |github_link_base|/porting/os.md 4 | ``` 5 | # Operating system and interrupts 6 | 7 | LVGL is **not thread-safe** by default. 8 | 9 | However, in the following conditions it's valid to call LVGL related functions: 10 | - In *events*. Learn more in [Events](/overview/event). 11 | - In *lv_timer*. Learn more in [Timers](/overview/timer). 12 | 13 | 14 | ## Tasks and threads 15 | If you need to use real tasks or threads, you need a mutex which should be invoked before the call of `lv_timer_handler` and released after it. 16 | Also, you have to use the same mutex in other tasks and threads around every LVGL (`lv_...`) related function call and code. 17 | This way you can use LVGL in a real multitasking environment. Just make use of a mutex to avoid the concurrent calling of LVGL functions. 18 | 19 | ## Interrupts 20 | Try to avoid calling LVGL functions from interrupt handlers (except `lv_tick_inc()` and `lv_disp_flush_ready()`). But if you need to do this you have to disable the interrupt which uses LVGL functions while `lv_timer_handler` is running. 21 | It's a better approach to set a flag or some value and periodically check it in an `lv_timer`. 22 | -------------------------------------------------------------------------------- /components/lvgl/docs/porting/sleep.md: -------------------------------------------------------------------------------- 1 | ```eval_rst 2 | .. include:: /header.rst 3 | :github_url: |github_link_base|/porting/sleep.md 4 | ``` 5 | # Sleep management 6 | 7 | The MCU can go to sleep when no user input happens. In this case, the main `while(1)` should look like this: 8 | 9 | ```c 10 | while(1) { 11 | /*Normal operation (no sleep) in < 1 sec inactivity*/ 12 | if(lv_disp_get_inactive_time(NULL) < 1000) { 13 | lv_task_handler(); 14 | } 15 | /*Sleep after 1 sec inactivity*/ 16 | else { 17 | timer_stop(); /*Stop the timer where lv_tick_inc() is called*/ 18 | sleep(); /*Sleep the MCU*/ 19 | } 20 | my_delay_ms(5); 21 | } 22 | ``` 23 | 24 | You should also add the below lines to your input device read function to signal a wake-up (press, touch or click etc.) happened: 25 | ```c 26 | lv_tick_inc(LV_DISP_DEF_REFR_PERIOD); /*Force task execution on wake-up*/ 27 | timer_start(); /*Restart the timer where lv_tick_inc() is called*/ 28 | lv_task_handler(); /*Call `lv_task_handler()` manually to process the wake-up event*/ 29 | ``` 30 | 31 | In addition to `lv_disp_get_inactive_time()` you can check `lv_anim_count_running()` to see if all animations have finished. 32 | -------------------------------------------------------------------------------- /components/lvgl/docs/porting/task-handler.md: -------------------------------------------------------------------------------- 1 | ```eval_rst 2 | .. include:: /header.rst 3 | :github_url: |github_link_base|/porting/task-handler.md 4 | ``` 5 | # Task Handler 6 | 7 | To handle the tasks of LVGL you need to call `lv_timer_handler()` periodically in one of the following: 8 | - *while(1)* of *main()* function 9 | - timer interrupt periodically (lower priority than `lv_tick_inc()`) 10 | - an OS task periodically 11 | 12 | The timing is not critical but it should be about 5 milliseconds to keep the system responsive. 13 | 14 | Example: 15 | ```c 16 | while(1) { 17 | lv_timer_handler(); 18 | my_delay_ms(5); 19 | } 20 | ``` 21 | 22 | To learn more about timers visit the [Timer](/overview/timer) section. 23 | 24 | -------------------------------------------------------------------------------- /components/lvgl/docs/porting/tick.md: -------------------------------------------------------------------------------- 1 | ```eval_rst 2 | .. include:: /header.rst 3 | :github_url: |github_link_base|/porting/tick.md 4 | ``` 5 | # Tick interface 6 | 7 | LVGL needs a system tick to know elapsed time for animations and other tasks. 8 | 9 | You need to call the `lv_tick_inc(tick_period)` function periodically and provide the call period in milliseconds. For example, `lv_tick_inc(1)` when calling every millisecond. 10 | 11 | `lv_tick_inc` should be called in a higher priority routine than `lv_task_handler()` (e.g. in an interrupt) to precisely know the elapsed milliseconds even if the execution of `lv_task_handler` takes more time. 12 | 13 | With FreeRTOS `lv_tick_inc` can be called in `vApplicationTickHook`. 14 | 15 | On Linux based operating system (e.g. on Raspberry Pi) `lv_tick_inc` can be called in a thread like below: 16 | ```c 17 | void * tick_thread (void *args) 18 | { 19 | while(1) { 20 | usleep(5*1000); /*Sleep for 5 millisecond*/ 21 | lv_tick_inc(5); /*Tell LVGL that 5 milliseconds were elapsed*/ 22 | } 23 | } 24 | ``` 25 | 26 | 27 | 28 | ## API 29 | 30 | ```eval_rst 31 | 32 | .. doxygenfile:: lv_hal_tick.h 33 | :project: lvgl 34 | 35 | ``` 36 | -------------------------------------------------------------------------------- /components/lvgl/docs/requirements.txt: -------------------------------------------------------------------------------- 1 | alabaster==0.7.12 2 | Babel==2.9.1 3 | breathe==4.30.0 4 | certifi==2020.12.5 5 | chardet==4.0.0 6 | commonmark==0.9.1 7 | docutils==0.16 8 | idna==2.10 9 | imagesize==1.2.0 10 | importlib-metadata==4.0.1 11 | Jinja2==2.11.3 12 | Markdown==3.3.4 13 | MarkupSafe==1.1.1 14 | packaging==20.9 15 | Pygments==2.9.0 16 | pyparsing==2.4.7 17 | pytz==2021.1 18 | recommonmark==0.6.0 19 | requests==2.25.1 20 | six==1.16.0 21 | snowballstemmer==2.1.0 22 | Sphinx==4.0.1 23 | sphinx-markdown-tables==0.0.15 24 | sphinx-rtd-theme==0.5.2 25 | sphinx-sitemap==2.2.0 26 | sphinxcontrib-applehelp==1.0.2 27 | sphinxcontrib-devhelp==1.0.2 28 | sphinxcontrib-htmlhelp==1.0.3 29 | sphinxcontrib-jsmath==1.0.1 30 | sphinxcontrib-qthelp==1.0.3 31 | sphinxcontrib-serializinghtml==1.1.4 32 | typing-extensions==3.10.0.0 33 | urllib3==1.26.5 34 | zipp==3.4.1 35 | -------------------------------------------------------------------------------- /components/lvgl/docs/widgets/core/index.md: -------------------------------------------------------------------------------- 1 | ```eval_rst 2 | .. include:: /header.rst 3 | :github_url: |github_link_base|/object-types/index.md 4 | ``` 5 | # Core widgets 6 | 7 | ```eval_rst 8 | 9 | .. toctree:: 10 | :maxdepth: 1 11 | 12 | arc 13 | bar 14 | btn 15 | btnmatrix 16 | canvas 17 | checkbox 18 | dropdown 19 | img 20 | label 21 | line 22 | roller 23 | slider 24 | switch 25 | table 26 | textarea 27 | 28 | ``` 29 | 30 | 31 | -------------------------------------------------------------------------------- /components/lvgl/docs/widgets/extra/index.md: -------------------------------------------------------------------------------- 1 | ```eval_rst 2 | .. include:: /header.rst 3 | :github_url: |github_link_base|/object-types/index.md 4 | ``` 5 | # Extra widgets 6 | 7 | ```eval_rst 8 | 9 | .. toctree:: 10 | :maxdepth: 1 11 | 12 | calendar 13 | chart 14 | colorwheel 15 | imgbtn 16 | keyboard 17 | led 18 | list 19 | meter 20 | msgbox 21 | span 22 | spinbox 23 | spinner 24 | tabview 25 | tileview 26 | win 27 | ``` 28 | 29 | 30 | -------------------------------------------------------------------------------- /components/lvgl/docs/widgets/extra/spinner.md: -------------------------------------------------------------------------------- 1 | ```eval_rst 2 | .. include:: /header.rst 3 | :github_url: |github_link_base|/widgets/extra/spinner.md 4 | ``` 5 | # Spinner (lv_spinner) 6 | 7 | ## Overview 8 | The Spinner object is a spinning arc over a ring. 9 | 10 | ## Parts and Styles 11 | The parts are identical to the parts of [lv_arc](/widgets/core/arc). 12 | 13 | ## Usage 14 | 15 | ### Create a spinner 16 | 17 | To create a spinner use `lv_spinner_create(parent, spin_time, arc_length)`. `spin time` sets the spin time in milliseconds, `arc_length` sets the length of the spinning arc in degrees. 18 | 19 | ## Events 20 | No special events are sent the the Spinner. 21 | 22 | See the events of the [Arc](/widgets/core/arc) too. 23 | 24 | Learn more about [Events](/overview/event). 25 | 26 | ## Keys 27 | No *Keys* are processed by the object type. 28 | 29 | Learn more about [Keys](/overview/indev). 30 | 31 | 32 | 33 | ## Example 34 | 35 | ```eval_rst 36 | 37 | .. include:: ../../../examples/widgets/spinner/index.rst 38 | 39 | ``` 40 | 41 | ## API 42 | 43 | ```eval_rst 44 | 45 | .. doxygenfile:: lv_spinner.h 46 | :project: lvgl 47 | 48 | ``` 49 | -------------------------------------------------------------------------------- /components/lvgl/docs/widgets/index.md: -------------------------------------------------------------------------------- 1 | ```eval_rst 2 | .. include:: /header.rst 3 | :github_url: |github_link_base|/object-types/index.md 4 | ``` 5 | # Widgets 6 | 7 | ```eval_rst 8 | 9 | .. toctree:: 10 | :maxdepth: 1 11 | 12 | obj 13 | core/index 14 | extra/index 15 | ``` 16 | 17 | 18 | -------------------------------------------------------------------------------- /components/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 | 14 | -------------------------------------------------------------------------------- /components/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 | 31 | /********************** 32 | * MACROS 33 | **********************/ 34 | 35 | #ifdef __cplusplus 36 | } /*extern "C"*/ 37 | #endif 38 | 39 | #endif /*LV_EXAMPLE_ANIM_H*/ 40 | -------------------------------------------------------------------------------- /components/lvgl/examples/anim/lv_example_anim_1.py: -------------------------------------------------------------------------------- 1 | def anim_x_cb(label, v): 2 | label.set_x(v) 3 | 4 | def sw_event_cb(e,label): 5 | sw = e.get_target() 6 | 7 | if sw.has_state(lv.STATE.CHECKED): 8 | a = lv.anim_t() 9 | a.init() 10 | a.set_var(label) 11 | a.set_values(label.get_x(), 100) 12 | a.set_time(500) 13 | a.set_path_cb(lv.anim_t.path_overshoot) 14 | a.set_custom_exec_cb(lambda a,val: anim_x_cb(label,val)) 15 | lv.anim_t.start(a) 16 | else: 17 | a = lv.anim_t() 18 | a.init() 19 | a.set_var(label) 20 | a.set_values(label.get_x(), -label.get_width()) 21 | a.set_time(500) 22 | a.set_path_cb(lv.anim_t.path_ease_in) 23 | a.set_custom_exec_cb(lambda a,val: anim_x_cb(label,val)) 24 | lv.anim_t.start(a) 25 | 26 | # 27 | # Start animation on an event 28 | # 29 | 30 | label = lv.label(lv.scr_act()) 31 | label.set_text("Hello animations!") 32 | label.set_pos(100, 10) 33 | 34 | 35 | sw = lv.switch(lv.scr_act()) 36 | sw.center() 37 | sw.add_state(lv.STATE.CHECKED) 38 | sw.add_event_cb(lambda e: sw_event_cb(e,label), lv.EVENT.VALUE_CHANGED, None) 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/lvgl/examples/assets/animimg001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lvgl/examples/assets/animimg001.png -------------------------------------------------------------------------------- /components/lvgl/examples/assets/animimg002.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lvgl/examples/assets/animimg002.png -------------------------------------------------------------------------------- /components/lvgl/examples/assets/animimg003.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lvgl/examples/assets/animimg003.png -------------------------------------------------------------------------------- /components/lvgl/examples/assets/caret_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lvgl/examples/assets/caret_down.png -------------------------------------------------------------------------------- /components/lvgl/examples/assets/font/lv_font_simsun_16_cjk.fnt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lvgl/examples/assets/font/lv_font_simsun_16_cjk.fnt -------------------------------------------------------------------------------- /components/lvgl/examples/assets/font/montserrat-16.fnt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lvgl/examples/assets/font/montserrat-16.fnt -------------------------------------------------------------------------------- /components/lvgl/examples/assets/font/montserrat-22.fnt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lvgl/examples/assets/font/montserrat-22.fnt -------------------------------------------------------------------------------- /components/lvgl/examples/assets/img_caret_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lvgl/examples/assets/img_caret_down.png -------------------------------------------------------------------------------- /components/lvgl/examples/assets/img_cogwheel_argb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lvgl/examples/assets/img_cogwheel_argb.png -------------------------------------------------------------------------------- /components/lvgl/examples/assets/img_cogwheel_chroma_keyed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lvgl/examples/assets/img_cogwheel_chroma_keyed.png -------------------------------------------------------------------------------- /components/lvgl/examples/assets/img_cogwheel_indexed16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lvgl/examples/assets/img_cogwheel_indexed16.png -------------------------------------------------------------------------------- /components/lvgl/examples/assets/img_cogwheel_rgb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lvgl/examples/assets/img_cogwheel_rgb.png -------------------------------------------------------------------------------- /components/lvgl/examples/assets/img_hand_hour.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lvgl/examples/assets/img_hand_hour.png -------------------------------------------------------------------------------- /components/lvgl/examples/assets/img_hand_min.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lvgl/examples/assets/img_hand_min.png -------------------------------------------------------------------------------- /components/lvgl/examples/assets/img_skew_strip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lvgl/examples/assets/img_skew_strip.png -------------------------------------------------------------------------------- /components/lvgl/examples/assets/img_skew_strip_80x20_argb8888.fnt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lvgl/examples/assets/img_skew_strip_80x20_argb8888.fnt -------------------------------------------------------------------------------- /components/lvgl/examples/assets/img_star.png: -------------------------------------------------------------------------------- 1 | star.png -------------------------------------------------------------------------------- /components/lvgl/examples/assets/img_strip.png: -------------------------------------------------------------------------------- 1 | skew_strip.png -------------------------------------------------------------------------------- /components/lvgl/examples/assets/imgbtn_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lvgl/examples/assets/imgbtn_left.png -------------------------------------------------------------------------------- /components/lvgl/examples/assets/imgbtn_mid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lvgl/examples/assets/imgbtn_mid.png -------------------------------------------------------------------------------- /components/lvgl/examples/assets/imgbtn_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lvgl/examples/assets/imgbtn_right.png -------------------------------------------------------------------------------- /components/lvgl/examples/assets/skew_strip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lvgl/examples/assets/skew_strip.png -------------------------------------------------------------------------------- /components/lvgl/examples/assets/star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lvgl/examples/assets/star.png -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 uint32_t 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, "%d", 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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/lvgl/examples/examples.mk: -------------------------------------------------------------------------------- 1 | CSRCS += $(shell find -L $(LVGL_DIR)/$(LVGL_DIR_NAME)/examples -name \*.c) 2 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/lvgl/examples/header.py: -------------------------------------------------------------------------------- 1 | #!/opt/bin/lv_micropython -i 2 | 3 | import lvgl as lv 4 | 5 | import display_driver 6 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | uint32_t 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, "%d", i); 27 | lv_obj_center(label); 28 | } 29 | } 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | uint32_t 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: %d", i); 22 | lv_obj_center(label); 23 | } 24 | } 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/lvgl/examples/layouts/flex/lv_example_flex_5.py: -------------------------------------------------------------------------------- 1 | def row_gap_anim(obj, v): 2 | obj.set_style_pad_row(v, 0) 3 | 4 | 5 | def column_gap_anim(obj, v): 6 | obj.set_style_pad_column(v, 0) 7 | 8 | # 9 | # Demonstrate the effect of column and row gap style properties 10 | # 11 | 12 | cont = lv.obj(lv.scr_act()) 13 | cont.set_size(300, 220) 14 | cont.center() 15 | cont.set_flex_flow(lv.FLEX_FLOW.ROW_WRAP) 16 | 17 | for i in range(9): 18 | obj = lv.obj(cont) 19 | obj.set_size(70, lv.SIZE.CONTENT) 20 | 21 | label = lv.label(obj) 22 | label.set_text(str(i)) 23 | label.center() 24 | 25 | a_row = lv.anim_t() 26 | a_row.init() 27 | a_row.set_var(cont) 28 | a_row.set_values(0, 10) 29 | a_row.set_repeat_count(lv.ANIM_REPEAT.INFINITE) 30 | 31 | a_row.set_time(500) 32 | a_row.set_playback_time(500) 33 | a_row.set_custom_exec_cb(lambda a,val: row_gap_anim(cont,val)) 34 | lv.anim_t.start(a_row) 35 | 36 | a_col = lv.anim_t() 37 | a_col.init() 38 | a_col.set_var(cont) 39 | a_col.set_values(0, 10) 40 | a_col.set_repeat_count(lv.ANIM_REPEAT.INFINITE) 41 | 42 | a_col.set_time(3000) 43 | a_col.set_playback_time(3000) 44 | a_col.set_custom_exec_cb(lambda a,val: column_gap_anim(cont,val)) 45 | 46 | lv.anim_t.start(a_col) 47 | 48 | -------------------------------------------------------------------------------- /components/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 | uint32_t 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, "%d", i); 23 | lv_obj_center(label); 24 | } 25 | } 26 | #endif 27 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/lvgl/examples/layouts/grid/lv_example_grid_1.py: -------------------------------------------------------------------------------- 1 | # 2 | # A simple grid 3 | # 4 | 5 | col_dsc = [70, 70, 70, lv.COORD.MAX] 6 | row_dsc = [50, 50, 50, lv.COORD.MAX] 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 | -------------------------------------------------------------------------------- /components/lvgl/examples/layouts/grid/lv_example_grid_3.py: -------------------------------------------------------------------------------- 1 | def LV_GRID_FR(x): 2 | return lv.COORD.MAX - 100 + x 3 | # 4 | # Demonstrate grid's "free unit" 5 | # 6 | 7 | # Column 1: fix width 60 px 8 | # Column 2: 1 unit from the remaining free space 9 | # Column 3: 2 unit from the remaining free space 10 | 11 | col_dsc = [60, LV_GRID_FR(1), LV_GRID_FR(2), lv.COORD.MAX] 12 | 13 | # Row 1: fix width 60 px 14 | # Row 2: 1 unit from the remaining free space 15 | # Row 3: fix width 60 px 16 | 17 | row_dsc = [40, LV_GRID_FR(1), 40, lv.COORD.MAX] 18 | 19 | # Create a container with grid 20 | cont = lv.obj(lv.scr_act()) 21 | cont.set_size(300, 220) 22 | cont.center() 23 | cont.set_grid_dsc_array(col_dsc, row_dsc) 24 | 25 | for i in range(9): 26 | col = i % 3 27 | row = i // 3 28 | 29 | obj = lv.obj(cont) 30 | # Stretch the cell horizontally and vertically too 31 | # Set span to 1 to make the cell 1 column/row sized 32 | obj.set_grid_cell(lv.GRID_ALIGN.STRETCH, col, 1, 33 | lv.GRID_ALIGN.STRETCH, row, 1) 34 | 35 | label = lv.label(obj) 36 | label.set_text("%d,%d"%(col, row)) 37 | label.center() 38 | 39 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | 27 | /********************* 28 | * DEFINES 29 | *********************/ 30 | 31 | /********************** 32 | * TYPEDEFS 33 | **********************/ 34 | 35 | /********************** 36 | * GLOBAL PROTOTYPES 37 | **********************/ 38 | 39 | /********************** 40 | * MACROS 41 | **********************/ 42 | 43 | #ifdef __cplusplus 44 | } /*extern "C"*/ 45 | #endif 46 | 47 | #endif /*LV_EXAMPLES_H*/ 48 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/lvgl/examples/styles/lv_example_style.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_example_style.h 3 | * 4 | */ 5 | 6 | #ifndef LV_EXAMPLE_STYLE_H 7 | #define LV_EXAMPLE_STYLE_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_style_1(void); 29 | void lv_example_style_2(void); 30 | void lv_example_style_3(void); 31 | void lv_example_style_4(void); 32 | void lv_example_style_5(void); 33 | void lv_example_style_6(void); 34 | void lv_example_style_7(void); 35 | void lv_example_style_8(void); 36 | void lv_example_style_9(void); 37 | void lv_example_style_10(void); 38 | void lv_example_style_11(void); 39 | void lv_example_style_12(void); 40 | void lv_example_style_13(void); 41 | void lv_example_style_14(void); 42 | 43 | /********************** 44 | * MACROS 45 | **********************/ 46 | 47 | #ifdef __cplusplus 48 | } /*extern "C"*/ 49 | #endif 50 | 51 | #endif /*LV_EXAMPLE_STYLE_H*/ 52 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/lvgl/examples/test_ex.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cat ../../header.py $1 > test.py 3 | chmod +x test.py 4 | ./test.py 5 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 RTL and RTL base direction 26 | """""""""""""""""""""""""""""""""""" 27 | 28 | .. lv_example:: widgets/bar/lv_example_bar_5 29 | :language: c 30 | 31 | Custom drawr to show the current value 32 | """"""""""""""""""""""""""""""""""""""" 33 | 34 | .. lv_example:: widgets/bar/lv_example_bar_6 35 | :language: c 36 | 37 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/lvgl/examples/widgets/bar/lv_example_bar_2.c: -------------------------------------------------------------------------------- 1 | #include "../../lv_examples.h" 2 | #if LV_USE_BAR && LV_BUILD_EXAMPLES 3 | 4 | /** 5 | * Example of styling the bar 6 | */ 7 | void lv_example_bar_2(void) 8 | { 9 | static lv_style_t style_bg; 10 | static lv_style_t style_indic; 11 | 12 | lv_style_init(&style_bg); 13 | lv_style_set_border_color(&style_bg, lv_palette_main(LV_PALETTE_BLUE)); 14 | lv_style_set_border_width(&style_bg, 2); 15 | lv_style_set_pad_all(&style_bg, 6); /*To make the indicator smaller*/ 16 | lv_style_set_radius(&style_bg, 6); 17 | lv_style_set_anim_time(&style_bg, 1000); 18 | 19 | lv_style_init(&style_indic); 20 | lv_style_set_bg_opa(&style_indic, LV_OPA_COVER); 21 | lv_style_set_bg_color(&style_indic, lv_palette_main(LV_PALETTE_BLUE)); 22 | lv_style_set_radius(&style_indic, 3); 23 | 24 | lv_obj_t * bar = lv_bar_create(lv_scr_act()); 25 | lv_obj_remove_style_all(bar); /*To have a clean start*/ 26 | lv_obj_add_style(bar, &style_bg, 0); 27 | lv_obj_add_style(bar, &style_indic, LV_PART_INDICATOR); 28 | 29 | lv_obj_set_size(bar, 200, 20); 30 | lv_obj_center(bar); 31 | lv_bar_set_value(bar, 100, LV_ANIM_ON); 32 | } 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/lvgl/examples/widgets/btn/lv_example_btn_1.c: -------------------------------------------------------------------------------- 1 | #include "../../lv_examples.h" 2 | #if LV_USE_BTN && LV_BUILD_EXAMPLES 3 | 4 | static void event_handler(lv_event_t * e) 5 | { 6 | lv_event_code_t code = lv_event_get_code(e); 7 | 8 | if(code == LV_EVENT_CLICKED) { 9 | LV_LOG_USER("Clicked"); 10 | } 11 | else if(code == LV_EVENT_VALUE_CHANGED) { 12 | LV_LOG_USER("Toggled"); 13 | } 14 | } 15 | 16 | void lv_example_btn_1(void) 17 | { 18 | lv_obj_t * label; 19 | 20 | lv_obj_t * btn1 = lv_btn_create(lv_scr_act()); 21 | lv_obj_add_event_cb(btn1, event_handler, LV_EVENT_ALL, NULL); 22 | lv_obj_align(btn1, LV_ALIGN_CENTER, 0, -40); 23 | 24 | label = lv_label_create(btn1); 25 | lv_label_set_text(label, "Button"); 26 | lv_obj_center(label); 27 | 28 | lv_obj_t * btn2 = lv_btn_create(lv_scr_act()); 29 | lv_obj_add_event_cb(btn2, event_handler, LV_EVENT_ALL, NULL); 30 | lv_obj_align(btn2, LV_ALIGN_CENTER, 0, 40); 31 | lv_obj_add_flag(btn2, LV_OBJ_FLAG_CHECKABLE); 32 | lv_obj_set_height(btn2, LV_SIZE_CONTENT); 33 | 34 | label = lv_label_create(btn2); 35 | lv_label_set_text(label, "Toggle"); 36 | lv_obj_center(label); 37 | } 38 | #endif 39 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/lvgl/examples/widgets/chart/index.rst: -------------------------------------------------------------------------------- 1 | 2 | Line Chart 3 | """""""""" 4 | 5 | .. lv_example:: widgets/chart/lv_example_chart_1 6 | :language: c 7 | 8 | 9 | Faded area line chart with custom division lines 10 | """"""""""""""""""""""""""""""""""""""""""""""""""" 11 | 12 | .. lv_example:: widgets/chart/lv_example_chart_2 13 | :language: c 14 | 15 | Axis ticks and labels with scrolling 16 | """""""""""""""""""""""""""""""""""" 17 | 18 | .. lv_example:: widgets/chart/lv_example_chart_3 19 | :language: c 20 | 21 | Show the value of the pressed points 22 | """""""""""""""""""""""""""""""""""""" 23 | 24 | .. lv_example:: widgets/chart/lv_example_chart_4 25 | :language: c 26 | 27 | Display 1000 data points with zooming and scrolling 28 | """""""""""""""""""""""""""""""""""""""""""""""""""" 29 | 30 | .. lv_example:: widgets/chart/lv_example_chart_5 31 | :language: c 32 | 33 | Show cursor on the clicked point 34 | """"""""""""""""""""""""""""""""""" 35 | 36 | .. lv_example:: widgets/chart/lv_example_chart_6 37 | :language: c 38 | 39 | Scatter chart 40 | """"""""""""""""""""""""""""""""""" 41 | 42 | .. lv_example:: widgets/chart/lv_example_chart_7 43 | :language: c 44 | 45 | 46 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/lvgl/examples/widgets/checkbox/lv_example_checkbox_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 | txt = obj.get_text() 6 | if obj.get_state() & lv.STATE.CHECKED: 7 | state = "Checked" 8 | else: 9 | state = "Unchecked"; 10 | print(txt + ":" + state) 11 | 12 | 13 | lv.scr_act().set_flex_flow(lv.FLEX_FLOW.COLUMN) 14 | lv.scr_act().set_flex_align(lv.FLEX_ALIGN.CENTER, lv.FLEX_ALIGN.START, lv.FLEX_ALIGN.CENTER) 15 | 16 | cb = lv.checkbox(lv.scr_act()) 17 | cb.set_text("Apple") 18 | cb.add_event_cb(event_handler, lv.EVENT.ALL, None) 19 | 20 | cb = lv.checkbox(lv.scr_act()) 21 | cb.set_text("Banana") 22 | cb.add_state(lv.STATE.CHECKED) 23 | cb.add_event_cb(event_handler, lv.EVENT.ALL, None) 24 | 25 | cb = lv.checkbox(lv.scr_act()) 26 | cb.set_text("Lemon") 27 | cb.add_state(lv.STATE.DISABLED) 28 | cb.add_event_cb(event_handler, lv.EVENT.ALL, None) 29 | 30 | cb = lv.checkbox(lv.scr_act()) 31 | cb.add_state(lv.STATE.CHECKED | lv.STATE.DISABLED) 32 | cb.set_text("Melon") 33 | cb.add_event_cb(event_handler, lv.EVENT.ALL, None) 34 | 35 | cb.update_layout() 36 | 37 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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\n" 14 | "Banana\n" 15 | "Orange\n" 16 | "Cherry\n" 17 | "Grape\n" 18 | "Raspberry\n" 19 | "Melon\n" 20 | "Orange\n" 21 | "Lemon\n" 22 | "Nuts\n"])) 23 | 24 | dd.align(lv.ALIGN.TOP_MID, 0, 20) 25 | dd.add_event_cb(event_handler, lv.EVENT.ALL, None) 26 | 27 | -------------------------------------------------------------------------------- /components/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\n" 7 | "Banana\n" 8 | "Orange\n" 9 | "Melon\n" 10 | "Grape\n" 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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/lvgl/examples/widgets/meter/lv_example_meter_4.py: -------------------------------------------------------------------------------- 1 | # 2 | # Create a pie chart 3 | # 4 | 5 | meter = lv.meter(lv.scr_act()) 6 | 7 | # Remove the background and the circle from the middle 8 | meter.remove_style(None, lv.PART.MAIN) 9 | meter.remove_style(None, lv.PART.INDICATOR) 10 | 11 | meter.set_size(200, 200) 12 | meter.center() 13 | 14 | # Add a scale first with no ticks. 15 | scale = meter.add_scale() 16 | meter.set_scale_ticks(scale, 0, 0, 0, lv.color_black()) 17 | meter.set_scale_range(scale, 0, 100, 360, 0) 18 | 19 | # Add a three arc indicator* 20 | indic_w = 100 21 | indic1 = meter.add_arc(scale, indic_w,lv.palette_main(lv.PALETTE.ORANGE), 0) 22 | meter.set_indicator_start_value(indic1, 0) 23 | meter.set_indicator_end_value(indic1, 40) 24 | 25 | indic2 = meter.add_arc(scale, indic_w, lv.palette_main(lv.PALETTE.YELLOW), 0) 26 | meter.set_indicator_start_value(indic2, 40) # Start from the previous 27 | meter.set_indicator_end_value(indic2, 80) 28 | 29 | indic3 = meter.add_arc(scale, indic_w, lv.palette_main(lv.PALETTE.DEEP_ORANGE), 0) 30 | meter.set_indicator_start_value(indic3, 80) # Start from the previous 31 | meter.set_indicator_end_value(indic3, 100) 32 | 33 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/lvgl/examples/widgets/slider/lv_example_slider_1.c: -------------------------------------------------------------------------------- 1 | #include "../../lv_examples.h" 2 | #if LV_USE_SLIDER && LV_BUILD_EXAMPLES 3 | 4 | static void slider_event_cb(lv_event_t * e); 5 | static lv_obj_t * slider_label; 6 | 7 | /** 8 | * A default slider with a label displaying the current value 9 | */ 10 | void lv_example_slider_1(void) 11 | { 12 | /*Create a slider in the center of the display*/ 13 | lv_obj_t * slider = lv_slider_create(lv_scr_act()); 14 | lv_obj_center(slider); 15 | lv_obj_add_event_cb(slider, slider_event_cb, LV_EVENT_VALUE_CHANGED, NULL); 16 | 17 | /*Create a label below the slider*/ 18 | slider_label = lv_label_create(lv_scr_act()); 19 | lv_label_set_text(slider_label, "0%"); 20 | 21 | lv_obj_align_to(slider_label, slider, LV_ALIGN_OUT_BOTTOM_MID, 0, 10); 22 | } 23 | 24 | static void slider_event_cb(lv_event_t * e) 25 | { 26 | lv_obj_t * slider = lv_event_get_target(e); 27 | char buf[8]; 28 | lv_snprintf(buf, sizeof(buf), "%d%%", lv_slider_get_value(slider)); 29 | lv_label_set_text(slider_label, buf); 30 | lv_obj_align_to(slider_label, slider, LV_ALIGN_OUT_BOTTOM_MID, 0, 10); 31 | } 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/lvgl/examples/widgets/tileview/lv_example_tileview_1.py: -------------------------------------------------------------------------------- 1 | # 2 | # Create a 2x2 tile view and allow scrolling only in an "L" shape. 3 | # Demonstrate scroll chaining with a long list that 4 | # scrolls the tile view when it cant't be scrolled further. 5 | # 6 | tv = lv.tileview(lv.scr_act()) 7 | 8 | # Tile1: just a label 9 | tile1 = tv.add_tile(0, 0, lv.DIR.BOTTOM) 10 | label = lv.label(tile1) 11 | label.set_text("Scroll down") 12 | label.center() 13 | 14 | # Tile2: a button 15 | tile2 = tv.add_tile(0, 1, lv.DIR.TOP | lv.DIR.RIGHT) 16 | 17 | btn = lv.btn(tile2) 18 | 19 | label = lv.label(btn) 20 | label.set_text("Scroll up or right") 21 | 22 | btn.set_size(lv.SIZE.CONTENT, lv.SIZE.CONTENT) 23 | btn.center() 24 | 25 | # Tile3: a list 26 | tile3 = tv.add_tile(1, 1, lv.DIR.LEFT) 27 | list = lv.list(tile3) 28 | list.set_size(lv.pct(100), lv.pct(100)) 29 | 30 | list.add_btn(None, "One") 31 | list.add_btn(None, "Two") 32 | list.add_btn(None, "Three") 33 | list.add_btn(None, "Four") 34 | list.add_btn(None, "Five") 35 | list.add_btn(None, "Six") 36 | list.add_btn(None, "Seven") 37 | list.add_btn(None, "Eight") 38 | list.add_btn(None, "Nine") 39 | list.add_btn(None, "Ten") 40 | 41 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/lvgl/library.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "lvgl", 3 | "version": "8.1.0-dev", 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 | -------------------------------------------------------------------------------- /components/lvgl/library.properties: -------------------------------------------------------------------------------- 1 | name=lvgl 2 | version=8.1.0-dev 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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/lvgl/scripts/built_in_font/DejaVuSans.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lvgl/scripts/built_in_font/DejaVuSans.ttf -------------------------------------------------------------------------------- /components/lvgl/scripts/built_in_font/FontAwesome5-Solid+Brands+Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lvgl/scripts/built_in_font/FontAwesome5-Solid+Brands+Regular.woff -------------------------------------------------------------------------------- /components/lvgl/scripts/built_in_font/Montserrat-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lvgl/scripts/built_in_font/Montserrat-Medium.ttf -------------------------------------------------------------------------------- /components/lvgl/scripts/built_in_font/SimSun.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lvgl/scripts/built_in_font/SimSun.woff -------------------------------------------------------------------------------- /components/lvgl/scripts/built_in_font/unscii-8.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lvgl/scripts/built_in_font/unscii-8.ttf -------------------------------------------------------------------------------- /components/lvgl/scripts/code-format.sh: -------------------------------------------------------------------------------- 1 | astyle --options=code-format.cfg "../src/*.c,*.h" 2 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/lvgl/scripts/release/patch.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # Applies a commit or commits on baranch or branches 4 | # USAGE: 5 | # patch.py -c -b [-p] [-t] 6 | # - : list of commit SHAs to apply. 7 | # - : branches where the commit should be applied. * can be used as wildchar 8 | # - p: push the changes to 9 | # - t: increment version number and create a tag 10 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/lvgl/src/extra/extra.mk: -------------------------------------------------------------------------------- 1 | CSRCS += $(shell find -L $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/extra -name \*.c) 2 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/lvgl/src/extra/lv_extra.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_extra.c 3 | * 4 | */ 5 | 6 | /********************* 7 | * INCLUDES 8 | *********************/ 9 | #include "../lvgl.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 | /********************** 28 | * MACROS 29 | **********************/ 30 | 31 | /********************** 32 | * GLOBAL FUNCTIONS 33 | **********************/ 34 | 35 | void lv_extra_init(void) 36 | { 37 | #if LV_USE_FLEX 38 | lv_flex_init(); 39 | #endif 40 | 41 | #if LV_USE_GRID 42 | lv_grid_init(); 43 | #endif 44 | } 45 | 46 | /********************** 47 | * STATIC FUNCTIONS 48 | **********************/ 49 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/lvgl/src/extra/themes/mono/lv_theme_mono.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_theme_mono.h 3 | * 4 | */ 5 | 6 | #ifndef LV_USE_THEME_MONO_H 7 | #define LV_USE_THEME_MONO_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_MONO 19 | 20 | /********************* 21 | * DEFINES 22 | *********************/ 23 | 24 | /********************** 25 | * TYPEDEFS 26 | **********************/ 27 | 28 | /********************** 29 | * GLOBAL PROTOTYPES 30 | **********************/ 31 | 32 | /** 33 | * Initialize the theme 34 | * @param color_primary the primary color of the theme 35 | * @param color_secondary the secondary color for the theme 36 | * @param font pointer to a font to use. 37 | * @return a pointer to reference this theme later 38 | */ 39 | lv_theme_t * lv_theme_mono_init(lv_disp_t * disp, bool dark_bg, const lv_font_t * font); 40 | 41 | /********************** 42 | * MACROS 43 | **********************/ 44 | 45 | #endif 46 | 47 | #ifdef __cplusplus 48 | } /*extern "C"*/ 49 | #endif 50 | 51 | #endif /*LV_THEME_DEFAULT_H*/ 52 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/lvgl/src/extra/widgets/win/lv_win.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_win.h 3 | * 4 | */ 5 | 6 | #ifndef LV_WIN_H 7 | #define LV_WIN_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "../../../lvgl.h" 17 | 18 | /********************* 19 | * DEFINES 20 | *********************/ 21 | 22 | /********************** 23 | * TYPEDEFS 24 | **********************/ 25 | typedef struct { 26 | lv_obj_t obj; 27 | }lv_win_t; 28 | 29 | extern const lv_obj_class_t lv_win_class; 30 | 31 | /********************** 32 | * GLOBAL PROTOTYPES 33 | **********************/ 34 | 35 | lv_obj_t * lv_win_create(lv_obj_t * parent, lv_coord_t header_height); 36 | 37 | 38 | lv_obj_t * lv_win_add_title(lv_obj_t * win, const char * txt); 39 | lv_obj_t * lv_win_add_btn(lv_obj_t * win, const void * icon, lv_coord_t btn_w); 40 | 41 | lv_obj_t * lv_win_get_header(lv_obj_t * win); 42 | lv_obj_t * lv_win_get_content(lv_obj_t * win); 43 | /********************** 44 | * MACROS 45 | **********************/ 46 | 47 | #ifdef __cplusplus 48 | } /*extern "C"*/ 49 | #endif 50 | 51 | #endif /*LV_WIN_H*/ 52 | -------------------------------------------------------------------------------- /components/lvgl/src/font/korean.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lvgl/src/font/korean.ttf -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | 6 | DEPPATH += --dep-path $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/gpu 7 | VPATH += :$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/gpu 8 | 9 | CFLAGS += "-I$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/gpu" 10 | -------------------------------------------------------------------------------- /components/lvgl/src/hal/lv_hal.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_hal.h 3 | * 4 | */ 5 | 6 | #ifndef LV_HAL_H 7 | #define LV_HAL_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "lv_hal_disp.h" 17 | #include "lv_hal_indev.h" 18 | #include "lv_hal_tick.h" 19 | 20 | /********************* 21 | * DEFINES 22 | *********************/ 23 | /** 24 | * Same as Android's DIP. (Different name is chosen to avoid mistype between LV_DPI and LV_DIP) 25 | * 1 dip is 1 px on a 160 DPI screen 26 | * 1 dip is 2 px on a 320 DPI screen 27 | * https://stackoverflow.com/questions/2025282/what-is-the-difference-between-px-dip-dp-and-sp 28 | */ 29 | #define _LV_DPX_CALC(dpi, n) ((n) == 0 ? 0 :LV_MAX((( (dpi) * (n) + 80) / 160), 1)) /*+80 for rounding*/ 30 | #define LV_DPX(n) _LV_DPX_CALC(lv_disp_get_dpi(NULL), n) 31 | 32 | /********************** 33 | * TYPEDEFS 34 | **********************/ 35 | 36 | /********************** 37 | * GLOBAL PROTOTYPES 38 | **********************/ 39 | 40 | /********************** 41 | * MACROS 42 | **********************/ 43 | 44 | #ifdef __cplusplus 45 | } /*extern "C"*/ 46 | #endif 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/lvgl/src/lv_api_map.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_api_map.h 3 | * 4 | */ 5 | 6 | #ifndef LV_API_MAP_H 7 | #define LV_API_MAP_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "../lvgl.h" 17 | 18 | /********************* 19 | * DEFINES 20 | *********************/ 21 | 22 | #define LV_NO_TASK_READY LV_NO_TIMER_READY 23 | #define LV_INDEV_STATE_REL LV_INDEV_STATE_RELEASED 24 | #define LV_INDEV_STATE_PR LV_INDEV_STATE_PRESSED 25 | #define LV_OBJ_FLAG_SNAPABLE LV_OBJ_FLAG_SNAPPABLE /*Fixed typo*/ 26 | 27 | /********************** 28 | * TYPEDEFS 29 | **********************/ 30 | 31 | /********************** 32 | * GLOBAL PROTOTYPES 33 | **********************/ 34 | 35 | static inline LV_ATTRIBUTE_TIMER_HANDLER uint32_t lv_task_handler(void) 36 | { 37 | return lv_timer_handler(); 38 | } 39 | 40 | /********************** 41 | * MACROS 42 | **********************/ 43 | 44 | #ifdef __cplusplus 45 | } /*extern "C"*/ 46 | #endif 47 | 48 | #endif /*LV_API_MAP_H*/ 49 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/lvgl/src/misc/lv_gc.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_gc.c 3 | * 4 | */ 5 | 6 | /********************* 7 | * INCLUDES 8 | *********************/ 9 | 10 | #include "lv_gc.h" 11 | #include "string.h" 12 | 13 | /********************* 14 | * DEFINES 15 | *********************/ 16 | 17 | /********************** 18 | * TYPEDEFS 19 | **********************/ 20 | 21 | /********************** 22 | * STATIC PROTOTYPES 23 | **********************/ 24 | 25 | /********************** 26 | * STATIC VARIABLES 27 | **********************/ 28 | 29 | #if(!defined(LV_ENABLE_GC)) || LV_ENABLE_GC == 0 30 | LV_ROOTS 31 | #endif /*LV_ENABLE_GC*/ 32 | 33 | /********************** 34 | * MACROS 35 | **********************/ 36 | 37 | /********************** 38 | * GLOBAL FUNCTIONS 39 | **********************/ 40 | 41 | void _lv_gc_clear_roots(void) 42 | { 43 | #define LV_CLEAR_ROOT(root_type, root_name) lv_memset_00(&LV_GC_ROOT(root_name), sizeof(LV_GC_ROOT(root_name))); 44 | LV_ITERATE_ROOTS(LV_CLEAR_ROOT) 45 | } 46 | 47 | /********************** 48 | * STATIC FUNCTIONS 49 | **********************/ 50 | -------------------------------------------------------------------------------- /components/lvgl/src/misc/lv_misc.mk: -------------------------------------------------------------------------------- 1 | CSRCS += lv_anim.c 2 | CSRCS += lv_area.c 3 | CSRCS += lv_async.c 4 | CSRCS += lv_bidi.c 5 | CSRCS += lv_color.c 6 | CSRCS += lv_fs.c 7 | CSRCS += lv_gc.c 8 | CSRCS += lv_ll.c 9 | CSRCS += lv_log.c 10 | CSRCS += lv_math.c 11 | CSRCS += lv_mem.c 12 | CSRCS += lv_printf.c 13 | CSRCS += lv_style.c 14 | CSRCS += lv_style_gen.c 15 | CSRCS += lv_timer.c 16 | CSRCS += lv_tlsf.c 17 | CSRCS += lv_txt.c 18 | CSRCS += lv_txt_ap.c 19 | CSRCS += lv_utils.c 20 | 21 | DEPPATH += --dep-path $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/misc 22 | VPATH += :$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/misc 23 | 24 | CFLAGS += "-I$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/misc" 25 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/lvgl/src/widgets/lv_btn.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_btn.h 3 | * 4 | */ 5 | 6 | #ifndef LV_BTN_H 7 | #define LV_BTN_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "../lv_conf_internal.h" 17 | 18 | #if LV_USE_BTN != 0 19 | #include "../core/lv_obj.h" 20 | 21 | /********************* 22 | * DEFINES 23 | *********************/ 24 | 25 | /********************** 26 | * TYPEDEFS 27 | **********************/ 28 | 29 | typedef struct { 30 | lv_obj_t obj; 31 | }lv_btn_t; 32 | 33 | extern const lv_obj_class_t lv_btn_class; 34 | 35 | /********************** 36 | * GLOBAL PROTOTYPES 37 | **********************/ 38 | 39 | /** 40 | * Create a button object 41 | * @param parent pointer to an object, it will be the parent of the new button 42 | * @return pointer to the created button 43 | */ 44 | lv_obj_t * lv_btn_create(lv_obj_t * parent); 45 | 46 | /********************** 47 | * MACROS 48 | **********************/ 49 | 50 | #endif /*LV_USE_BTN*/ 51 | 52 | #ifdef __cplusplus 53 | } /*extern "C"*/ 54 | #endif 55 | 56 | #endif /*LV_BTN_H*/ 57 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/lvgl/tests/.gitignore: -------------------------------------------------------------------------------- 1 | *.out 2 | *_Runner.c 3 | /report -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/lvgl/tests/ref_imgs/dropdown_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lvgl/tests/ref_imgs/dropdown_1.png -------------------------------------------------------------------------------- /components/lvgl/tests/ref_imgs/dropdown_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lvgl/tests/ref_imgs/dropdown_2.png -------------------------------------------------------------------------------- /components/lvgl/tests/ref_imgs/scr1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lvgl/tests/ref_imgs/scr1.png -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/lvgl/tests/src/lv_test_main.c: -------------------------------------------------------------------------------- 1 | #if LV_BUILD_TEST && !defined(LV_BUILD_TEST_NO_MAIN) 2 | #include "../lvgl.h" 3 | #include 4 | #include 5 | 6 | #include 7 | #include "lv_test_init.h" 8 | 9 | int main(void) 10 | { 11 | lv_test_init(); 12 | 13 | printf("Exit with success!\n"); 14 | return 0; 15 | } 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /components/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 test_func_1(void); 7 | 8 | void test_func_1(void) 9 | { 10 | TEST_ASSERT_EQUAL(actual, expected); 11 | } 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/lvgl/tests/src/test_fonts/font_1.fnt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lvgl/tests/src/test_fonts/font_1.fnt -------------------------------------------------------------------------------- /components/lvgl/tests/src/test_fonts/font_2.fnt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lvgl/tests/src/test_fonts/font_2.fnt -------------------------------------------------------------------------------- /components/lvgl/tests/src/test_fonts/font_3.fnt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kevincoooool/lvgl_v8_esp32/786ec96d1ef0e884e184be23f141e89e7a375563/components/lvgl/tests/src/test_fonts/font_3.fnt -------------------------------------------------------------------------------- /components/lvgl/tests/test.py: -------------------------------------------------------------------------------- 1 | import os 2 | import glob 3 | 4 | def prepare(): 5 | os.system("rm src/*.o") 6 | os.system("rm -rdf src/test_runners") 7 | os.system("mkdir src/test_runners") 8 | files = glob.glob("./src/test_cases/test_*.c") 9 | 10 | for index, item in enumerate(files): 11 | if item == "./src/test_cases/test_config.c": 12 | files.pop(index) 13 | break 14 | 15 | files.insert(0, "./src/test_cases/test_config.c") 16 | 17 | for f in files: 18 | r = f[:-2] + "_Runner.c" 19 | r = r.replace("/test_cases/", "/test_runners/") 20 | cmd = "ruby unity/generate_test_runner.rb " + f + " " + r + " config.yml" 21 | os.system(cmd) 22 | return files 23 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/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 | -------------------------------------------------------------------------------- /components/lvgl/zephyr/module.yml: -------------------------------------------------------------------------------- 1 | build: 2 | cmake: . 3 | -------------------------------------------------------------------------------- /components/lvgl_esp32_drivers/.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig helps developers define and maintain consistent 2 | # coding styles between different editors and IDEs 3 | # http://editorconfig.org 4 | 5 | root = true 6 | 7 | [*] 8 | indent_style = space 9 | indent_size = 4 10 | end_of_line = lf 11 | charset = utf-8 12 | trim_trailing_whitespace = true 13 | insert_final_newline = true 14 | 15 | [{*.md,*.rst}] 16 | trim_trailing_whitespace = false 17 | 18 | [{Makefile,*.mk,*.bat}] 19 | indent_style = tab 20 | indent_size = 2 21 | 22 | [{*.cmake,CMakeLists.txt}] 23 | indent_style = space 24 | indent_size = 4 25 | max_line_length = 120 26 | 27 | [{*.sh,*.yml}] 28 | indent_style = space 29 | indent_size = 2 30 | -------------------------------------------------------------------------------- /components/lvgl_esp32_drivers/.gitignore: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | *.d 3 | 4 | # Object files 5 | *.o 6 | *.ko 7 | *.obj 8 | *.elf 9 | 10 | # Linker output 11 | *.ilk 12 | *.map 13 | *.exp 14 | 15 | # Precompiled Headers 16 | *.gch 17 | *.pch 18 | 19 | # Libraries 20 | *.lib 21 | *.a 22 | *.la 23 | *.lo 24 | 25 | # Shared objects (inc. Windows DLLs) 26 | *.dll 27 | *.so 28 | *.so.* 29 | *.dylib 30 | 31 | # Executables 32 | *.exe 33 | *.out 34 | *.app 35 | *.i*86 36 | *.x86_64 37 | *.hex 38 | 39 | # Debug files 40 | *.dSYM/ 41 | *.su 42 | *.idb 43 | *.pdb 44 | 45 | # Kernel Module Compile Results 46 | *.mod* 47 | *.cmd 48 | .tmp_versions/ 49 | modules.order 50 | Module.symvers 51 | Mkfile.old 52 | dkms.conf 53 | 54 | # MacOS 55 | .DS_Store 56 | 57 | # ESP-IDF build dir 58 | build 59 | -------------------------------------------------------------------------------- /components/lvgl_esp32_drivers/Kconfig: -------------------------------------------------------------------------------- 1 | menu "LVGL ESP Drivers" 2 | 3 | rsource "lvgl_tft/Kconfig" 4 | 5 | rsource "lvgl_touch/Kconfig" 6 | 7 | endmenu 8 | 9 | menu "I2C Port Settings" 10 | depends on LV_I2C && !HAVE_I2C_MANAGER 11 | 12 | rsource "lvgl_i2c/Kconfig" 13 | 14 | endmenu 15 | -------------------------------------------------------------------------------- /components/lvgl_esp32_drivers/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 LVGL 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /components/lvgl_esp32_drivers/lvgl_tft/FT81x.h: -------------------------------------------------------------------------------- 1 | #ifndef FT81X_H_ 2 | #define FT81X_H_ 3 | 4 | #include 5 | 6 | #ifdef LV_LVGL_H_INCLUDE_SIMPLE 7 | #include "lvgl.h" 8 | #else 9 | #include "lvgl/lvgl.h" 10 | #endif 11 | #include "../lvgl_helpers.h" 12 | 13 | void FT81x_init(void); 14 | 15 | void FT81x_flush(lv_disp_drv_t * drv, const lv_area_t * area, lv_color_t * color_map); 16 | 17 | #endif /* FT81X_H_ */ 18 | -------------------------------------------------------------------------------- /components/lvgl_esp32_drivers/lvgl_tft/jd79653a.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file il3820.h 3 | * 4 | */ 5 | 6 | #ifndef JD79653A_H 7 | #define JD79653A_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" 11 | { 12 | #endif 13 | 14 | #ifdef LV_LVGL_H_INCLUDE_SIMPLE 15 | #include "lvgl.h" 16 | #else 17 | #include "lvgl/lvgl.h" 18 | #endif 19 | 20 | void jd79653a_init(); 21 | void jd79653a_deep_sleep(); 22 | 23 | void jd79653a_lv_set_fb_cb(struct _disp_drv_t * disp_drv, uint8_t* buf, lv_coord_t buf_w, lv_coord_t x, lv_coord_t y, 24 | lv_color_t color, lv_opa_t opa); 25 | void jd79653a_lv_rounder_cb(struct _disp_drv_t * disp_drv, lv_area_t *area); 26 | void jd79653a_lv_fb_flush(lv_disp_drv_t *drv, const lv_area_t *area, lv_color_t *color_map); 27 | 28 | void jd79653a_fb_set_full_color(uint8_t color); 29 | void jd79653a_fb_full_update(uint8_t *data, size_t len); 30 | 31 | 32 | #ifdef __cplusplus 33 | } /* extern "C" */ 34 | #endif 35 | 36 | #endif // JD79653A_H 37 | -------------------------------------------------------------------------------- /components/lvgl_esp32_drivers/lvgl_touch/FT81x.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file STMPE610.h 3 | */ 4 | 5 | #ifndef FT81X_TOUCH__H 6 | #define FT81X_TOUCH__H 7 | 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | /********************* 13 | * INCLUDES 14 | *********************/ 15 | 16 | #include 17 | #include 18 | #ifdef LV_LVGL_H_INCLUDE_SIMPLE 19 | #include "lvgl.h" 20 | #else 21 | #include "lvgl/lvgl.h" 22 | #endif 23 | 24 | /********************* 25 | * DEFINES 26 | *********************/ 27 | 28 | /********************** 29 | * TYPEDEFS 30 | **********************/ 31 | 32 | /********************** 33 | * GLOBAL PROTOTYPES 34 | **********************/ 35 | ; 36 | bool FT81x_read(lv_indev_drv_t * drv, lv_indev_data_t * data); 37 | 38 | /********************** 39 | * MACROS 40 | **********************/ 41 | 42 | #ifdef __cplusplus 43 | } /* extern "C" */ 44 | #endif 45 | 46 | #endif /* FT81X_TOUCH__H */ 47 | -------------------------------------------------------------------------------- /components/lvgl_esp32_drivers/lvgl_touch/tp_spi.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file tp_spi.h 3 | * 4 | */ 5 | 6 | #ifndef TP_SPI_H 7 | #define TP_SPI_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include 17 | #include 18 | 19 | /********************* 20 | * DEFINES 21 | *********************/ 22 | 23 | /********************** 24 | * TYPEDEFS 25 | **********************/ 26 | 27 | /********************** 28 | * GLOBAL PROTOTYPES 29 | **********************/ 30 | void tp_spi_add_device(spi_host_device_t host); 31 | void tp_spi_add_device_config(spi_host_device_t host, spi_device_interface_config_t *config); 32 | void tp_spi_xchg(uint8_t* data_send, uint8_t* data_recv, uint8_t byte_count); 33 | void tp_spi_write_reg(uint8_t* data, uint8_t byte_count); 34 | void tp_spi_read_reg(uint8_t reg, uint8_t* data, uint8_t byte_count); 35 | 36 | /********************** 37 | * MACROS 38 | **********************/ 39 | 40 | 41 | #ifdef __cplusplus 42 | } /* extern "C" */ 43 | #endif 44 | 45 | #endif /*TP_SPI_H*/ 46 | -------------------------------------------------------------------------------- /main/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB_RECURSE SOURCES_C *.c) 2 | file(GLOB_RECURSE SOURCES_CPP *.cpp) 3 | 4 | idf_component_register( 5 | SRCS ${SOURCES_C} ${SOURCES_CPP} 6 | INCLUDE_DIRS "." ) 7 | 8 | target_compile_definitions(${COMPONENT_LIB} PUBLIC "-DLV_HOR_RES_MAX=240") 9 | target_compile_definitions(${COMPONENT_LIB} PUBLIC "-DLV_VER_RES_MAX=240") -------------------------------------------------------------------------------- /main/component.mk: -------------------------------------------------------------------------------- 1 | # 2 | # "main" pseudo-component makefile. 3 | # 4 | # (Uses default behaviour of compiling all source files in directory, adding 'include' to include path.) 5 | 6 | --------------------------------------------------------------------------------