├── .gitignore ├── Makefile ├── README.md ├── lv_conf.h ├── lv_drivers ├── .github │ ├── auto-comment.yml │ └── stale.yml ├── .gitignore ├── CMakeLists.txt ├── LICENSE ├── README.md ├── display │ ├── GC9A01.c │ ├── GC9A01.h │ ├── ILI9341.c │ ├── ILI9341.h │ ├── R61581.c │ ├── R61581.h │ ├── SHARP_MIP.c │ ├── SHARP_MIP.h │ ├── SSD1963.c │ ├── SSD1963.h │ ├── ST7565.c │ ├── ST7565.h │ ├── UC1610.c │ ├── UC1610.h │ ├── drm.c │ ├── drm.h │ ├── fbdev.c │ ├── fbdev.h │ └── monitor.h ├── docs │ ├── astyle_c │ └── astyle_h ├── gtkdrv │ ├── README.md │ ├── broadway.png │ ├── gtkdrv.c │ └── gtkdrv.h ├── indev │ ├── AD_touch.c │ ├── AD_touch.h │ ├── FT5406EE8.c │ ├── FT5406EE8.h │ ├── XPT2046.c │ ├── XPT2046.h │ ├── evdev.c │ ├── evdev.h │ ├── keyboard.h │ ├── libinput.c │ ├── libinput_drv.h │ ├── mouse.h │ ├── mousewheel.h │ ├── xkb.c │ └── xkb.h ├── library.json ├── lv_drivers.mk ├── lv_drv_conf_template.h ├── sdl │ ├── sdl.c │ ├── sdl.h │ ├── sdl_gpu.c │ └── sdl_gpu.h ├── wayland │ ├── .gitignore │ ├── CMakeLists.txt │ ├── README.md │ ├── wayland.c │ └── wayland.h ├── win32drv │ ├── win32drv.c │ └── win32drv.h ├── win_drv.c └── win_drv.h ├── lv_drv_conf.h ├── lv_porting_sstar ├── blitutil.c ├── blitutil.h ├── convert_from_argb.h ├── lv_porting_sstar.mk ├── panel │ └── SAT070CP50_TTL_1024x600.h ├── sstar_disp.c ├── sstar_disp.h ├── sstar_fbdev.c ├── sstar_fbdev.h ├── sstar_gfx.c ├── sstar_gfx.h ├── sstar_memory.c ├── sstar_memory.h ├── sstar_port.c ├── sstar_port.h ├── sstar_sys.c ├── sstar_sys.h ├── tc_rotate.c ├── tc_rotate.h ├── verify_gfx.c ├── verify_gfx.h └── verify_gfx_type.h ├── lvgl ├── .codecov.yml ├── .editorconfig ├── .github │ ├── FUNDING.yml │ ├── ISSUE_TEMPLATE │ │ ├── bug-report.md │ │ ├── config.yml │ │ └── dev-discussion.md │ ├── auto-comment.yml │ ├── pull_request_template.md │ └── workflows │ │ ├── arduino.yml │ │ ├── build_micropython.yml │ │ ├── ccpp.yml │ │ ├── check_conf.yml │ │ ├── check_style.yml │ │ ├── close_old_issues.yml │ │ ├── compile_docs.yml │ │ ├── esp_upload_component.yml │ │ ├── main.yml │ │ └── release.yml ├── .gitignore ├── CMakeLists.txt ├── Kconfig ├── LICENCE.txt ├── README.md ├── README_zh.md ├── SConscript ├── component.mk ├── demos │ ├── README.md │ ├── 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_bechmark_montserrat_12_compr_az.c.c │ │ │ ├── lv_font_bechmark_montserrat_16_compr_az.c.c │ │ │ └── lv_font_bechmark_montserrat_28_compr_az.c.c │ │ ├── lv_demo_benchmark.c │ │ ├── lv_demo_benchmark.h │ │ ├── screenshot1.png │ │ └── screenshot2.png │ ├── keypad_encoder │ │ ├── README.md │ │ ├── lv_demo_keypad_encoder.c │ │ ├── lv_demo_keypad_encoder.h │ │ ├── screenshot1.gif │ │ └── screenshot1.png │ ├── lv_demos.h │ ├── lv_demos.mk │ ├── music │ │ ├── README.md │ │ ├── assets │ │ │ ├── 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 │ ├── 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 │ └── 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 ├── 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 │ │ ├── cmake.md │ │ ├── espressif.md │ │ ├── index.md │ │ ├── micropython.md │ │ ├── nuttx.md │ │ ├── nxp.md │ │ ├── pc-simulator.md │ │ ├── quick-overview.md │ │ ├── rt-thread.md │ │ ├── stm32.md │ │ └── tasmota-berry.md │ ├── header.rst │ ├── index.md │ ├── intro │ │ └── index.md │ ├── layouts │ │ ├── flex.md │ │ ├── grid.md │ │ └── index.md │ ├── libs │ │ ├── bmp.md │ │ ├── ffmpeg.md │ │ ├── freetype.md │ │ ├── fsdrv.md │ │ ├── gif.md │ │ ├── index.md │ │ ├── png.md │ │ ├── qrcode.md │ │ ├── rlottie.md │ │ └── sjpg.md │ ├── logo_lvgl.png │ ├── misc │ │ ├── align.png │ │ ├── anim-timeline.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 │ ├── others │ │ ├── gridnav.md │ │ ├── index.md │ │ ├── monkey.md │ │ └── snapshot.md │ ├── 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 │ │ ├── gpu.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 │ │ ├── animimg.md │ │ ├── calendar.md │ │ ├── chart.md │ │ ├── colorwheel.md │ │ ├── imgbtn.md │ │ ├── index.md │ │ ├── keyboard.md │ │ ├── led.md │ │ ├── list.md │ │ ├── menu.md │ │ ├── meter.md │ │ ├── msgbox.md │ │ ├── span.md │ │ ├── spinbox.md │ │ ├── spinner.md │ │ ├── tabview.md │ │ ├── tileview.md │ │ └── win.md │ │ ├── index.md │ │ └── obj.md ├── env_support │ ├── cmake │ │ ├── custom.cmake │ │ ├── esp.cmake │ │ ├── micropython.cmake │ │ └── zephyr.cmake │ ├── cmsis-pack │ │ ├── LVGL.lvgl.1.0.0.pack │ │ ├── LVGL.lvgl.pdsc │ │ ├── README.md │ │ ├── gen_pack.sh │ │ ├── lv_cmsis_pack.txt │ │ └── lv_conf_cmsis.h │ ├── rt-thread │ │ ├── SConscript │ │ ├── lv_rt_thread_conf.h │ │ └── lv_rt_thread_port.c │ └── zephyr │ │ └── module.yml ├── examples │ ├── anim │ │ ├── index.rst │ │ ├── lv_example_anim.h │ │ ├── lv_example_anim_1.c │ │ ├── lv_example_anim_1.py │ │ ├── lv_example_anim_2.c │ │ ├── lv_example_anim_2.py │ │ ├── lv_example_anim_3.c │ │ ├── lv_example_anim_3.py │ │ ├── lv_example_anim_timeline_1.c │ │ └── lv_example_anim_timeline_1.py │ ├── arduino │ │ └── LVGL_Arduino │ │ │ └── LVGL_Arduino.ino │ ├── assets │ │ ├── animimg001.c │ │ ├── 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 │ ├── 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 │ │ └── lv_example_event_4.c │ ├── examples.mk │ ├── get_started │ │ ├── index.rst │ │ ├── lv_example_get_started.h │ │ ├── lv_example_get_started_1.c │ │ ├── lv_example_get_started_1.py │ │ ├── lv_example_get_started_2.c │ │ ├── lv_example_get_started_2.py │ │ ├── lv_example_get_started_3.c │ │ └── lv_example_get_started_3.py │ ├── header.py │ ├── layouts │ │ ├── flex │ │ │ ├── index.rst │ │ │ ├── lv_example_flex.h │ │ │ ├── lv_example_flex_1.c │ │ │ ├── lv_example_flex_1.py │ │ │ ├── lv_example_flex_2.c │ │ │ ├── lv_example_flex_2.py │ │ │ ├── lv_example_flex_3.c │ │ │ ├── lv_example_flex_3.py │ │ │ ├── lv_example_flex_4.c │ │ │ ├── lv_example_flex_4.py │ │ │ ├── lv_example_flex_5.c │ │ │ ├── lv_example_flex_5.py │ │ │ ├── lv_example_flex_6.c │ │ │ └── lv_example_flex_6.py │ │ ├── grid │ │ │ ├── index.rst │ │ │ ├── lv_example_grid.h │ │ │ ├── lv_example_grid_1.c │ │ │ ├── lv_example_grid_1.py │ │ │ ├── lv_example_grid_2.c │ │ │ ├── lv_example_grid_2.py │ │ │ ├── lv_example_grid_3.c │ │ │ ├── lv_example_grid_3.py │ │ │ ├── lv_example_grid_4.c │ │ │ ├── lv_example_grid_4.py │ │ │ ├── lv_example_grid_5.c │ │ │ ├── lv_example_grid_5.py │ │ │ ├── lv_example_grid_6.c │ │ │ └── lv_example_grid_6.py │ │ └── lv_example_layout.h │ ├── libs │ │ ├── bmp │ │ │ ├── example_16bit.bmp │ │ │ ├── example_24bit.bmp │ │ │ ├── example_32bit.bmp │ │ │ ├── index.rst │ │ │ ├── lv_example_bmp.h │ │ │ ├── lv_example_bmp_1.c │ │ │ └── lv_example_bmp_1.py │ │ ├── ffmpeg │ │ │ ├── birds.mp4 │ │ │ ├── ffmpeg.png │ │ │ ├── index.rst │ │ │ ├── lv_example_ffmpeg.h │ │ │ ├── lv_example_ffmpeg_1.c │ │ │ └── lv_example_ffmpeg_2.c │ │ ├── freetype │ │ │ ├── arial.ttf │ │ │ ├── index.rst │ │ │ ├── lv_example_freetype.h │ │ │ ├── lv_example_freetype_1.c │ │ │ └── lv_example_freetype_1.py │ │ ├── gif │ │ │ ├── bulb.gif │ │ │ ├── img_bulb_gif.c │ │ │ ├── img_bulb_gif.py │ │ │ ├── index.rst │ │ │ ├── lv_example_gif.h │ │ │ ├── lv_example_gif_1.c │ │ │ └── lv_example_gif_1.py │ │ ├── lv_example_libs.h │ │ ├── png │ │ │ ├── img_wink_png.c │ │ │ ├── img_wink_png.py │ │ │ ├── index.rst │ │ │ ├── lv_example_png.h │ │ │ ├── lv_example_png_1.c │ │ │ ├── lv_example_png_1.py │ │ │ └── wink.png │ │ ├── qrcode │ │ │ ├── index.rst │ │ │ ├── lv_example_qrcode.h │ │ │ ├── lv_example_qrcode_1.c │ │ │ └── lv_example_qrcode_1.py │ │ ├── rlottie │ │ │ ├── index.rst │ │ │ ├── lv_example_rlottie.h │ │ │ ├── lv_example_rlottie_1.c │ │ │ ├── lv_example_rlottie_1.py │ │ │ ├── lv_example_rlottie_2.c │ │ │ ├── lv_example_rlottie_2.py │ │ │ ├── lv_example_rlottie_approve.c │ │ │ ├── lv_example_rlottie_approve.json │ │ │ └── lv_example_rlottie_approve.py │ │ └── sjpg │ │ │ ├── index.rst │ │ │ ├── lv_example_sjpg.h │ │ │ ├── lv_example_sjpg_1.c │ │ │ ├── lv_example_sjpg_1.py │ │ │ └── small_image.sjpg │ ├── lv_examples.h │ ├── others │ │ ├── gridnav │ │ │ ├── index.rst │ │ │ ├── lv_example_gridnav.h │ │ │ ├── lv_example_gridnav_1.c │ │ │ ├── lv_example_gridnav_2.c │ │ │ ├── lv_example_gridnav_3.c │ │ │ └── lv_example_gridnav_4.c │ │ ├── lv_example_others.h │ │ ├── monkey │ │ │ ├── index.rst │ │ │ ├── lv_example_monkey.h │ │ │ ├── lv_example_monkey_1.c │ │ │ ├── lv_example_monkey_2.c │ │ │ └── lv_example_monkey_3.c │ │ └── snapshot │ │ │ ├── index.rst │ │ │ ├── lv_example_snapshot.h │ │ │ ├── lv_example_snapshot_1.c │ │ │ └── lv_example_snapshot_1.py │ ├── porting │ │ ├── lv_port_disp_template.c │ │ ├── lv_port_disp_template.h │ │ ├── lv_port_fs_template.c │ │ ├── lv_port_fs_template.h │ │ ├── lv_port_indev_template.c │ │ └── lv_port_indev_template.h │ ├── scroll │ │ ├── index.rst │ │ ├── lv_example_scroll.h │ │ ├── lv_example_scroll_1.c │ │ ├── lv_example_scroll_1.py │ │ ├── lv_example_scroll_2.c │ │ ├── lv_example_scroll_2.py │ │ ├── lv_example_scroll_3.c │ │ ├── lv_example_scroll_3.py │ │ ├── lv_example_scroll_4.c │ │ ├── lv_example_scroll_4.py │ │ ├── lv_example_scroll_5.c │ │ ├── lv_example_scroll_5.py │ │ ├── lv_example_scroll_6.c │ │ └── lv_example_scroll_6.py │ ├── styles │ │ ├── index.rst │ │ ├── lv_example_style.h │ │ ├── lv_example_style_1.c │ │ ├── lv_example_style_1.py │ │ ├── lv_example_style_10.c │ │ ├── lv_example_style_10.py │ │ ├── lv_example_style_11.c │ │ ├── lv_example_style_11.py │ │ ├── lv_example_style_12.c │ │ ├── lv_example_style_12.py │ │ ├── lv_example_style_13.c │ │ ├── lv_example_style_13.py │ │ ├── lv_example_style_14.c │ │ ├── lv_example_style_14.py │ │ ├── lv_example_style_2.c │ │ ├── lv_example_style_2.py │ │ ├── lv_example_style_3.c │ │ ├── lv_example_style_3.py │ │ ├── lv_example_style_4.c │ │ ├── lv_example_style_4.py │ │ ├── lv_example_style_5.c │ │ ├── lv_example_style_5.py │ │ ├── lv_example_style_6.c │ │ ├── lv_example_style_6.py │ │ ├── lv_example_style_7.c │ │ ├── lv_example_style_7.py │ │ ├── lv_example_style_8.c │ │ ├── lv_example_style_8.py │ │ ├── lv_example_style_9.c │ │ └── lv_example_style_9.py │ ├── test_ex.sh │ └── widgets │ │ ├── animimg │ │ ├── index.rst │ │ ├── lv_example_animimg_1.c │ │ └── lv_example_animimg_1.py │ │ ├── arc │ │ ├── index.rst │ │ ├── lv_example_arc_1.c │ │ ├── lv_example_arc_1.py │ │ ├── lv_example_arc_2.c │ │ └── lv_example_arc_2.py │ │ ├── bar │ │ ├── index.rst │ │ ├── lv_example_bar_1.c │ │ ├── lv_example_bar_1.py │ │ ├── lv_example_bar_2.c │ │ ├── lv_example_bar_2.py │ │ ├── lv_example_bar_3.c │ │ ├── lv_example_bar_3.py │ │ ├── lv_example_bar_4.c │ │ ├── lv_example_bar_4.py │ │ ├── lv_example_bar_5.c │ │ ├── lv_example_bar_5.py │ │ ├── lv_example_bar_6.c │ │ ├── lv_example_bar_6.py │ │ └── test.py │ │ ├── btn │ │ ├── index.rst │ │ ├── lv_example_btn_1.c │ │ ├── lv_example_btn_1.py │ │ ├── lv_example_btn_2.c │ │ ├── lv_example_btn_2.py │ │ ├── lv_example_btn_3.c │ │ └── lv_example_btn_3.py │ │ ├── btnmatrix │ │ ├── index.rst │ │ ├── lv_example_btnmatrix_1.c │ │ ├── lv_example_btnmatrix_1.py │ │ ├── lv_example_btnmatrix_2.c │ │ ├── lv_example_btnmatrix_2.py │ │ ├── lv_example_btnmatrix_3.c │ │ └── lv_example_btnmatrix_3.py │ │ ├── calendar │ │ ├── index.rst │ │ ├── lv_example_calendar_1.c │ │ └── lv_example_calendar_1.py │ │ ├── canvas │ │ ├── index.rst │ │ ├── lv_example_canvas_1.c │ │ ├── lv_example_canvas_1.py │ │ ├── lv_example_canvas_2.c │ │ └── lv_example_canvas_2.py │ │ ├── chart │ │ ├── index.rst │ │ ├── lv_example_chart_1.c │ │ ├── lv_example_chart_1.py │ │ ├── lv_example_chart_2.c │ │ ├── lv_example_chart_2.py │ │ ├── lv_example_chart_3.c │ │ ├── lv_example_chart_3.py │ │ ├── lv_example_chart_4.c │ │ ├── lv_example_chart_4.py │ │ ├── lv_example_chart_5.c │ │ ├── lv_example_chart_5.py │ │ ├── lv_example_chart_6.c │ │ ├── lv_example_chart_6.py │ │ ├── lv_example_chart_7.c │ │ ├── lv_example_chart_7.py │ │ ├── lv_example_chart_8.c │ │ ├── lv_example_chart_8.py │ │ ├── lv_example_chart_9.c │ │ └── lv_example_chart_9.py │ │ ├── checkbox │ │ ├── index.rst │ │ ├── lv_example_checkbox_1.c │ │ ├── lv_example_checkbox_1.py │ │ └── lv_example_checkbox_2.c │ │ ├── colorwheel │ │ ├── index.rst │ │ ├── lv_example_colorwheel_1.c │ │ └── lv_example_colorwheel_1.py │ │ ├── dropdown │ │ ├── index.rst │ │ ├── lv_example_dropdown_1.c │ │ ├── lv_example_dropdown_1.py │ │ ├── lv_example_dropdown_2.c │ │ ├── lv_example_dropdown_2.py │ │ ├── lv_example_dropdown_3.c │ │ └── lv_example_dropdown_3.py │ │ ├── img │ │ ├── index.rst │ │ ├── lv_example_img_1.c │ │ ├── lv_example_img_1.py │ │ ├── lv_example_img_2.c │ │ ├── lv_example_img_2.py │ │ ├── lv_example_img_3.c │ │ ├── lv_example_img_3.py │ │ ├── lv_example_img_4.c │ │ └── lv_example_img_4.py │ │ ├── imgbtn │ │ ├── index.rst │ │ ├── lv_example_imgbtn_1.c │ │ └── lv_example_imgbtn_1.py │ │ ├── keyboard │ │ ├── index.rst │ │ ├── lv_example_keyboard_1.c │ │ └── lv_example_keyboard_1.py │ │ ├── label │ │ ├── index.rst │ │ ├── lv_example_label_1.c │ │ ├── lv_example_label_1.py │ │ ├── lv_example_label_2.c │ │ ├── lv_example_label_2.py │ │ ├── lv_example_label_3.c │ │ ├── lv_example_label_3.py │ │ └── lv_example_label_4.c │ │ ├── led │ │ ├── index.rst │ │ ├── lv_example_led_1.c │ │ └── lv_example_led_1.py │ │ ├── line │ │ ├── index.rst │ │ ├── lv_example_line_1.c │ │ └── lv_example_line_1.py │ │ ├── list │ │ ├── index.rst │ │ ├── lv_example_list_1.c │ │ ├── lv_example_list_1.py │ │ ├── lv_example_list_2.c │ │ ├── lv_example_list_2.py │ │ └── test.py │ │ ├── lv_example_widgets.h │ │ ├── menu │ │ ├── index.rst │ │ ├── lv_example_menu_1.c │ │ ├── lv_example_menu_1.py │ │ ├── lv_example_menu_2.c │ │ ├── lv_example_menu_2.py │ │ ├── lv_example_menu_3.c │ │ ├── lv_example_menu_3.py │ │ ├── lv_example_menu_4.c │ │ ├── lv_example_menu_4.py │ │ └── lv_example_menu_5.c │ │ ├── meter │ │ ├── index.rst │ │ ├── lv_example_meter_1.c │ │ ├── lv_example_meter_1.py │ │ ├── lv_example_meter_2.c │ │ ├── lv_example_meter_2.py │ │ ├── lv_example_meter_3.c │ │ ├── lv_example_meter_3.py │ │ ├── lv_example_meter_4.c │ │ └── lv_example_meter_4.py │ │ ├── msgbox │ │ ├── index.rst │ │ ├── lv_example_msgbox_1.c │ │ └── lv_example_msgbox_1.py │ │ ├── obj │ │ ├── index.rst │ │ ├── lv_example_obj_1.c │ │ ├── lv_example_obj_1.py │ │ ├── lv_example_obj_2.c │ │ └── lv_example_obj_2.py │ │ ├── roller │ │ ├── index.rst │ │ ├── lv_example_roller_1.c │ │ ├── lv_example_roller_1.py │ │ ├── lv_example_roller_2.c │ │ ├── lv_example_roller_2.py │ │ ├── lv_example_roller_3.c │ │ └── lv_example_roller_3.py │ │ ├── slider │ │ ├── index.rst │ │ ├── lv_example_slider_1.c │ │ ├── lv_example_slider_1.py │ │ ├── lv_example_slider_2.c │ │ ├── lv_example_slider_2.py │ │ ├── lv_example_slider_3.c │ │ └── lv_example_slider_3.py │ │ ├── span │ │ ├── index.rst │ │ ├── lv_example_span_1.c │ │ └── lv_example_span_1.py │ │ ├── spinbox │ │ ├── index.rst │ │ ├── lv_example_spinbox_1.c │ │ └── lv_example_spinbox_1.py │ │ ├── spinner │ │ ├── index.rst │ │ ├── lv_example_spinner_1.c │ │ └── lv_example_spinner_1.py │ │ ├── switch │ │ ├── index.rst │ │ ├── lv_example_switch_1.c │ │ └── lv_example_switch_1.py │ │ ├── table │ │ ├── index.rst │ │ ├── lv_example_table_1.c │ │ ├── lv_example_table_1.py │ │ ├── lv_example_table_2.c │ │ └── lv_example_table_2.py │ │ ├── tabview │ │ ├── index.rst │ │ ├── lv_example_tabview_1.c │ │ ├── lv_example_tabview_1.py │ │ ├── lv_example_tabview_2.c │ │ └── lv_example_tabview_2.py │ │ ├── textarea │ │ ├── index.rst │ │ ├── lv_example_textarea_1.c │ │ ├── lv_example_textarea_1.py │ │ ├── lv_example_textarea_2.c │ │ ├── lv_example_textarea_2.py │ │ ├── lv_example_textarea_3.c │ │ └── lv_example_textarea_3.py │ │ ├── tileview │ │ ├── index.rst │ │ ├── lv_example_tileview_1.c │ │ └── lv_example_tileview_1.py │ │ └── win │ │ ├── index.rst │ │ ├── lv_example_win_1.c │ │ └── lv_example_win_1.py ├── idf_component.yml ├── library.json ├── library.properties ├── lv_conf_template.h ├── lvgl.h ├── lvgl.mk ├── scripts │ ├── .gitignore │ ├── Doxyfile │ ├── build_html_examples.sh │ ├── built_in_font │ │ ├── DejaVuSans.ttf │ │ ├── FontAwesome5-Solid+Brands+Regular.woff │ │ ├── Montserrat-Medium.ttf │ │ ├── SimSun.woff │ │ ├── built_in_font_gen.py │ │ ├── generate_all.py │ │ └── unscii-8.ttf │ ├── changelog-template.hbs │ ├── changelog_gen.sh │ ├── code-format.cfg │ ├── code-format.py │ ├── cppcheck_run.sh │ ├── filetohex.py │ ├── find_version.sh │ ├── genexamplelist.sh │ ├── infer_run.sh │ ├── install-prerequisites.sh │ ├── jpg_to_sjpg.py │ ├── lv_conf_internal_gen.py │ ├── release │ │ ├── com.py │ │ ├── commits.txt │ │ ├── patch.py │ │ └── release.py │ └── style_api_gen.py ├── src │ ├── core │ │ ├── lv_core.mk │ │ ├── lv_disp.c │ │ ├── lv_disp.h │ │ ├── lv_event.c │ │ ├── lv_event.h │ │ ├── lv_group.c │ │ ├── lv_group.h │ │ ├── lv_indev.c │ │ ├── lv_indev.h │ │ ├── lv_indev_scroll.c │ │ ├── lv_indev_scroll.h │ │ ├── lv_obj.c │ │ ├── lv_obj.h │ │ ├── lv_obj_class.c │ │ ├── lv_obj_class.h │ │ ├── lv_obj_draw.c │ │ ├── lv_obj_draw.h │ │ ├── lv_obj_pos.c │ │ ├── lv_obj_pos.h │ │ ├── lv_obj_scroll.c │ │ ├── lv_obj_scroll.h │ │ ├── lv_obj_style.c │ │ ├── lv_obj_style.h │ │ ├── lv_obj_style_gen.c │ │ ├── lv_obj_style_gen.h │ │ ├── lv_obj_tree.c │ │ ├── lv_obj_tree.h │ │ ├── lv_refr.c │ │ ├── lv_refr.h │ │ ├── lv_theme.c │ │ └── lv_theme.h │ ├── draw │ │ ├── lv_draw.c │ │ ├── lv_draw.h │ │ ├── lv_draw.mk │ │ ├── lv_draw_arc.c │ │ ├── lv_draw_arc.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 │ │ ├── nxp_pxp │ │ │ ├── lv_gpu_nxp_pxp.c │ │ │ ├── lv_gpu_nxp_pxp.h │ │ │ ├── lv_gpu_nxp_pxp_osa.c │ │ │ └── lv_gpu_nxp_pxp_osa.h │ │ ├── nxp_vglite │ │ │ ├── lv_gpu_nxp_vglite.c │ │ │ └── lv_gpu_nxp_vglite.h │ │ ├── sdl │ │ │ ├── README.md │ │ │ ├── lv_draw_sdl.c │ │ │ ├── lv_draw_sdl.h │ │ │ ├── lv_draw_sdl.mk │ │ │ ├── lv_draw_sdl_arc.c │ │ │ ├── lv_draw_sdl_bg.c │ │ │ ├── lv_draw_sdl_composite.c │ │ │ ├── lv_draw_sdl_composite.h │ │ │ ├── lv_draw_sdl_img.c │ │ │ ├── lv_draw_sdl_img.h │ │ │ ├── lv_draw_sdl_label.c │ │ │ ├── lv_draw_sdl_line.c │ │ │ ├── lv_draw_sdl_mask.c │ │ │ ├── lv_draw_sdl_mask.h │ │ │ ├── lv_draw_sdl_polygon.c │ │ │ ├── lv_draw_sdl_priv.h │ │ │ ├── lv_draw_sdl_rect.c │ │ │ ├── lv_draw_sdl_rect.h │ │ │ ├── lv_draw_sdl_stack_blur.c │ │ │ ├── lv_draw_sdl_stack_blur.h │ │ │ ├── lv_draw_sdl_texture_cache.c │ │ │ ├── lv_draw_sdl_texture_cache.h │ │ │ ├── lv_draw_sdl_utils.c │ │ │ └── lv_draw_sdl_utils.h │ │ ├── stm32_dma2d │ │ │ ├── lv_gpu_stm32_dma2d.c │ │ │ └── lv_gpu_stm32_dma2d.h │ │ └── sw │ │ │ ├── lv_draw_sw.c │ │ │ ├── lv_draw_sw.h │ │ │ ├── lv_draw_sw.mk │ │ │ ├── lv_draw_sw_arc.c │ │ │ ├── lv_draw_sw_blend.c │ │ │ ├── lv_draw_sw_blend.h │ │ │ ├── lv_draw_sw_dither.c │ │ │ ├── lv_draw_sw_dither.h │ │ │ ├── lv_draw_sw_gradient.c │ │ │ ├── lv_draw_sw_gradient.h │ │ │ ├── lv_draw_sw_img.c │ │ │ ├── lv_draw_sw_letter.c │ │ │ ├── lv_draw_sw_line.c │ │ │ ├── lv_draw_sw_polygon.c │ │ │ └── lv_draw_sw_rect.c │ ├── extra │ │ ├── README.md │ │ ├── extra.mk │ │ ├── layouts │ │ │ ├── flex │ │ │ │ ├── lv_flex.c │ │ │ │ └── lv_flex.h │ │ │ ├── grid │ │ │ │ ├── lv_grid.c │ │ │ │ └── lv_grid.h │ │ │ └── lv_layouts.h │ │ ├── libs │ │ │ ├── bmp │ │ │ │ ├── lv_bmp.c │ │ │ │ └── lv_bmp.h │ │ │ ├── ffmpeg │ │ │ │ ├── lv_ffmpeg.c │ │ │ │ └── lv_ffmpeg.h │ │ │ ├── freetype │ │ │ │ ├── arial.ttf │ │ │ │ ├── lv_freetype.c │ │ │ │ └── lv_freetype.h │ │ │ ├── fsdrv │ │ │ │ ├── lv_fs_fatfs.c │ │ │ │ ├── lv_fs_posix.c │ │ │ │ ├── lv_fs_stdio.c │ │ │ │ ├── lv_fs_win32.c │ │ │ │ └── lv_fsdrv.h │ │ │ ├── gif │ │ │ │ ├── gifdec.c │ │ │ │ ├── gifdec.h │ │ │ │ ├── lv_gif.c │ │ │ │ └── lv_gif.h │ │ │ ├── lv_libs.h │ │ │ ├── png │ │ │ │ ├── lodepng.c │ │ │ │ ├── lodepng.h │ │ │ │ ├── lv_png.c │ │ │ │ └── lv_png.h │ │ │ ├── qrcode │ │ │ │ ├── lv_qrcode.c │ │ │ │ ├── lv_qrcode.h │ │ │ │ ├── qrcodegen.c │ │ │ │ └── qrcodegen.h │ │ │ ├── rlottie │ │ │ │ ├── lv_rlottie.c │ │ │ │ └── lv_rlottie.h │ │ │ └── sjpg │ │ │ │ ├── lv_sjpg.c │ │ │ │ ├── lv_sjpg.h │ │ │ │ ├── tjpgd.c │ │ │ │ ├── tjpgd.h │ │ │ │ └── tjpgdcnf.h │ │ ├── lv_extra.c │ │ ├── lv_extra.h │ │ ├── others │ │ │ ├── gridnav │ │ │ │ ├── lv_gridnav.c │ │ │ │ └── lv_gridnav.h │ │ │ ├── lv_others.h │ │ │ ├── monkey │ │ │ │ ├── lv_monkey.c │ │ │ │ └── lv_monkey.h │ │ │ └── snapshot │ │ │ │ ├── lv_snapshot.c │ │ │ │ └── lv_snapshot.h │ │ ├── themes │ │ │ ├── basic │ │ │ │ ├── lv_theme_basic.c │ │ │ │ └── lv_theme_basic.h │ │ │ ├── default │ │ │ │ ├── lv_theme_default.c │ │ │ │ └── lv_theme_default.h │ │ │ ├── lv_themes.h │ │ │ └── mono │ │ │ │ ├── lv_theme_mono.c │ │ │ │ └── lv_theme_mono.h │ │ └── widgets │ │ │ ├── animimg │ │ │ ├── lv_animimg.c │ │ │ └── lv_animimg.h │ │ │ ├── calendar │ │ │ ├── lv_calendar.c │ │ │ ├── lv_calendar.h │ │ │ ├── lv_calendar_header_arrow.c │ │ │ ├── lv_calendar_header_arrow.h │ │ │ ├── lv_calendar_header_dropdown.c │ │ │ └── lv_calendar_header_dropdown.h │ │ │ ├── chart │ │ │ ├── lv_chart.c │ │ │ └── lv_chart.h │ │ │ ├── colorwheel │ │ │ ├── lv_colorwheel.c │ │ │ └── lv_colorwheel.h │ │ │ ├── imgbtn │ │ │ ├── lv_imgbtn.c │ │ │ └── lv_imgbtn.h │ │ │ ├── keyboard │ │ │ ├── lv_keyboard.c │ │ │ └── lv_keyboard.h │ │ │ ├── led │ │ │ ├── lv_led.c │ │ │ └── lv_led.h │ │ │ ├── list │ │ │ ├── lv_list.c │ │ │ └── lv_list.h │ │ │ ├── lv_widgets.h │ │ │ ├── menu │ │ │ ├── lv_menu.c │ │ │ └── lv_menu.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 │ ├── hal │ │ ├── lv_hal.h │ │ ├── lv_hal.mk │ │ ├── lv_hal_disp.c │ │ ├── lv_hal_disp.h │ │ ├── lv_hal_indev.c │ │ ├── lv_hal_indev.h │ │ ├── lv_hal_tick.c │ │ └── lv_hal_tick.h │ ├── lv_api_map.h │ ├── lv_conf_internal.h │ ├── lv_conf_kconfig.h │ ├── lvgl.h │ ├── misc │ │ ├── lv_anim.c │ │ ├── lv_anim.h │ │ ├── lv_anim_timeline.c │ │ ├── lv_anim_timeline.h │ │ ├── lv_area.c │ │ ├── lv_area.h │ │ ├── lv_assert.h │ │ ├── lv_async.c │ │ ├── lv_async.h │ │ ├── lv_bidi.c │ │ ├── lv_bidi.h │ │ ├── lv_color.c │ │ ├── lv_color.h │ │ ├── lv_fs.c │ │ ├── lv_fs.h │ │ ├── lv_gc.c │ │ ├── lv_gc.h │ │ ├── lv_ll.c │ │ ├── lv_ll.h │ │ ├── lv_log.c │ │ ├── lv_log.h │ │ ├── lv_lru.c │ │ ├── lv_lru.h │ │ ├── lv_math.c │ │ ├── lv_math.h │ │ ├── lv_mem.c │ │ ├── lv_mem.h │ │ ├── lv_misc.mk │ │ ├── lv_printf.c │ │ ├── lv_printf.h │ │ ├── lv_style.c │ │ ├── lv_style.h │ │ ├── lv_style_gen.c │ │ ├── lv_style_gen.h │ │ ├── lv_templ.c │ │ ├── lv_templ.h │ │ ├── lv_timer.c │ │ ├── lv_timer.h │ │ ├── lv_tlsf.c │ │ ├── lv_tlsf.h │ │ ├── lv_txt.c │ │ ├── lv_txt.h │ │ ├── lv_txt_ap.c │ │ ├── lv_txt_ap.h │ │ ├── lv_types.h │ │ ├── lv_utils.c │ │ └── lv_utils.h │ └── widgets │ │ ├── lv_arc.c │ │ ├── lv_arc.h │ │ ├── lv_bar.c │ │ ├── lv_bar.h │ │ ├── lv_btn.c │ │ ├── lv_btn.h │ │ ├── lv_btnmatrix.c │ │ ├── lv_btnmatrix.h │ │ ├── lv_canvas.c │ │ ├── lv_canvas.h │ │ ├── lv_checkbox.c │ │ ├── lv_checkbox.h │ │ ├── lv_dropdown.c │ │ ├── lv_dropdown.h │ │ ├── lv_img.c │ │ ├── lv_img.h │ │ ├── lv_label.c │ │ ├── lv_label.h │ │ ├── lv_line.c │ │ ├── lv_line.h │ │ ├── lv_objx_templ.c │ │ ├── lv_objx_templ.h │ │ ├── lv_roller.c │ │ ├── lv_roller.h │ │ ├── lv_slider.c │ │ ├── lv_slider.h │ │ ├── lv_switch.c │ │ ├── lv_switch.h │ │ ├── lv_table.c │ │ ├── lv_table.h │ │ ├── lv_textarea.c │ │ ├── lv_textarea.h │ │ └── lv_widgets.mk └── tests │ ├── .gitignore │ ├── CMakeLists.txt │ ├── README.md │ ├── config.yml │ ├── main.py │ ├── ref_imgs │ ├── dropdown_1.png │ ├── dropdown_2.png │ └── scr1.png │ ├── src │ ├── lv_test_conf.h │ ├── lv_test_helpers.h │ ├── lv_test_indev.c │ ├── lv_test_indev.h │ ├── lv_test_init.c │ ├── lv_test_init.h │ ├── test_cases │ │ ├── _test_template.c │ │ ├── test_arc.c │ │ ├── test_bar.c │ │ ├── test_checkbox.c │ │ ├── test_config.c │ │ ├── test_demo_stress.c │ │ ├── test_demo_widgets.c │ │ ├── test_dropdown.c │ │ ├── test_event.c │ │ ├── test_font_loader.c │ │ ├── test_obj_tree.c │ │ ├── test_snapshot.c │ │ ├── test_style.c │ │ ├── test_switch.c │ │ └── test_txt.c │ └── test_fonts │ │ ├── font_1.c │ │ ├── font_1.fnt │ │ ├── font_2.c │ │ ├── font_2.fnt │ │ ├── font_3.c │ │ └── font_3.fnt │ └── unity │ ├── generate_test_runner.rb │ ├── run_test.erb │ ├── type_sanitizer.rb │ ├── unity.c │ ├── unity.h │ ├── unity_internals.h │ ├── unity_support.c │ └── unity_support.h ├── main.c ├── make.bak └── squareline_proj └── squareline_proj.mk /.gitignore: -------------------------------------------------------------------------------- 1 | build/ 2 | -------------------------------------------------------------------------------- /lv_drivers/.github/auto-comment.yml: -------------------------------------------------------------------------------- 1 | # Comment to a new issue. 2 | pullRequestOpened: | 3 | Thank you for raising your pull request. 4 | 5 | To ensure that all licensing criteria is met all repositories of the LVGL project apply a process called DCO (Developer's Certificate of Origin). 6 | 7 | The text of DCO can be read here: https://developercertificate.org/ 8 | For a more detailed description see the [Documentation](https://docs.lvgl.io/latest/en/html/contributing/index.html#developer-certification-of-origin-dco) site. 9 | 10 | By contributing to any repositories of the LVGL project you state that your contribution corresponds with the DCO. 11 | 12 | No further action is required if your contribution fulfills the DCO. If you are not sure about it feel free to ask us in a comment. 13 | -------------------------------------------------------------------------------- /lv_drivers/.github/stale.yml: -------------------------------------------------------------------------------- 1 | # Number of days of inactivity before an issue becomes stale 2 | daysUntilStale: 21 3 | # Number of days of inactivity before a stale issue is closed 4 | daysUntilClose: 7 5 | # Issues with these labels will never be considered stale 6 | exemptLabels: 7 | - architecture 8 | - pinned 9 | # Label to use when marking an issue as stale 10 | staleLabel: stale 11 | # Comment to post when marking an issue as stale. Set to `false` to disable 12 | markComment: > 13 | This issue or pull request has been automatically marked as stale because it has not had 14 | recent activity. It will be closed if no further activity occurs. Thank you 15 | for your contributions. 16 | # Comment to post when closing a stale issue. Set to `false` to disable 17 | closeComment: false 18 | -------------------------------------------------------------------------------- /lv_drivers/.gitignore: -------------------------------------------------------------------------------- 1 | **/*.o 2 | **/*.d -------------------------------------------------------------------------------- /lv_drivers/README.md: -------------------------------------------------------------------------------- 1 | # Display and Touch pad drivers 2 | 3 | Display controller and touchpad driver to can be directly used with [LittlevGL](https://littlevgl.com). 4 | 5 | To learn more about using drivers in LittlevGL visit the [Porting guide](https://docs.lvgl.io/latest/en/html/porting/index.html). 6 | 7 | If you used a new display or touchpad driver with LittlevGL please share it with other people! 8 | -------------------------------------------------------------------------------- /lv_drivers/docs/astyle_c: -------------------------------------------------------------------------------- 1 | --style=kr --convert-tabs --indent=spaces=4 --indent-switches --pad-oper --unpad-paren --align-pointer=middle --suffix=.bak --lineend=linux --min-conditional-indent= 2 | -------------------------------------------------------------------------------- /lv_drivers/docs/astyle_h: -------------------------------------------------------------------------------- 1 | --convert-tabs --indent=spaces=4 2 | -------------------------------------------------------------------------------- /lv_drivers/gtkdrv/broadway.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lv_drivers/gtkdrv/broadway.png -------------------------------------------------------------------------------- /lv_drivers/library.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "lv_drivers", 3 | "version": "8.2.0", 4 | "keywords": "littlevgl, lvgl, driver, display, touchpad", 5 | "description": "Drivers for LittlevGL graphics library.", 6 | "repository": { 7 | "type": "git", 8 | "url": "https://github.com/littlevgl/lv_drivers.git" 9 | }, 10 | "build": { 11 | "includeDir": "." 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /lv_drivers/lv_drivers.mk: -------------------------------------------------------------------------------- 1 | LV_DRIVERS_DIR_NAME ?= lv_drivers 2 | 3 | CSRCS += $(wildcard $(LVGL_DIR)/$(LV_DRIVERS_DIR_NAME)/*.c) 4 | CSRCS += $(wildcard $(LVGL_DIR)/$(LV_DRIVERS_DIR_NAME)/wayland/*.c) 5 | CSRCS += $(wildcard $(LVGL_DIR)/$(LV_DRIVERS_DIR_NAME)/indev/*.c) 6 | CSRCS += $(wildcard $(LVGL_DIR)/$(LV_DRIVERS_DIR_NAME)/gtkdrv/*.c) 7 | CSRCS += $(wildcard $(LVGL_DIR)/$(LV_DRIVERS_DIR_NAME)/display/*.c) 8 | 9 | -------------------------------------------------------------------------------- /lv_drivers/wayland/.gitignore: -------------------------------------------------------------------------------- 1 | CMakeCache.txt 2 | CMakeFiles/ 3 | Makefile 4 | cmake_install.cmake 5 | /protocols 6 | -------------------------------------------------------------------------------- /lv_porting_sstar/lv_porting_sstar.mk: -------------------------------------------------------------------------------- 1 | CSRCS += $(LVGL_DIR)/lv_porting_sstar/sstar_port.c 2 | CSRCS += $(LVGL_DIR)/lv_porting_sstar/sstar_sys.c 3 | CSRCS += $(LVGL_DIR)/lv_porting_sstar/sstar_fbdev.c 4 | CSRCS += $(LVGL_DIR)/lv_porting_sstar/sstar_disp.c 5 | CSRCS += $(LVGL_DIR)/lv_porting_sstar/sstar_gfx.c 6 | CSRCS += $(LVGL_DIR)/lv_porting_sstar/sstar_memory.c 7 | CSRCS += $(LVGL_DIR)/lv_porting_sstar/blitutil.c 8 | CSRCS += $(LVGL_DIR)/lv_porting_sstar/verify_gfx.c 9 | CSRCS += $(LVGL_DIR)/lv_porting_sstar/tc_rotate.c 10 | -------------------------------------------------------------------------------- /lv_porting_sstar/sstar_disp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sstar_disp.h 3 | */ 4 | 5 | #ifndef _SSTAR_DISP_H_ 6 | #define _SSTAR_DISP_H_ 7 | 8 | int sstar_disp_init(unsigned int dev, const char *interface, unsigned int width, unsigned int height); 9 | void sstar_disp_deinit(unsigned int dev, const char *interface); 10 | 11 | #endif /* _SSTAR_DISP_H_ */ 12 | -------------------------------------------------------------------------------- /lv_porting_sstar/sstar_fbdev.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sstar_fbdev.h 3 | */ 4 | 5 | #ifndef _SSTAR_FBDEV_H_ 6 | #define _SSTAR_FBDEV_H_ 7 | 8 | int sstar_fbdev_init(); 9 | void sstar_fbdev_deinit(); 10 | 11 | void *sstar_fbdev_get_buffer(int buf_i); 12 | unsigned int sstar_fbdev_get_xres(); 13 | unsigned int sstar_fbdev_get_yres(); 14 | unsigned int sstar_fbdev_get_bpp(); 15 | unsigned long sstar_fbdev_va2pa(void *ptr); 16 | 17 | void sstar_fbdev_flush(const lv_color_t *color_p); 18 | #endif /* _SSTAR_FBDEV_H_ */ 19 | -------------------------------------------------------------------------------- /lv_porting_sstar/sstar_gfx.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sstar_gfx.h 3 | */ 4 | 5 | #ifndef _SSTAR_GFX_H 6 | #define _SSTAR_GFX_H 7 | 8 | int sstar_gfx_init(); 9 | void sstar_gfx_deinit(); 10 | void sstar_gfx_blend_cb(lv_draw_ctx_t * draw_ctx, const lv_draw_sw_blend_dsc_t * dsc); 11 | void sstar_gfx_wait(); 12 | void sstar_gfx_copy(lv_color_t *dst, lv_color_t *src, lv_area_t *area); 13 | void sstar_bdma_copy(lv_color_t *dst, lv_color_t *src, lv_area_t *area); 14 | lv_res_t sstar_gfx_draw_img_cb(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_img_dsc_t * draw_dsc, 15 | const lv_area_t * coords, const void * src); 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /lv_porting_sstar/sstar_memory.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sstar_memory.h 3 | */ 4 | 5 | #ifndef _SSTAR_MEMORY_H 6 | #define _SSTAR_MEMORY_H 7 | 8 | #include "mi_common_datatype.h" 9 | 10 | MI_PHY sstar_pool_va2pa(const void *ptr); 11 | void sstar_flush_cache(); 12 | void *sstar_pool_malloc(size_t size); 13 | void sstar_pool_free(); 14 | int sstar_pool_check(const void *ptr); 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /lv_porting_sstar/sstar_port.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sstar_port.h 3 | */ 4 | 5 | #ifndef _SSTAR_PORT_H 6 | #define _SSTAR_PORT_H 7 | 8 | #include "mi_common_datatype.h" 9 | 10 | int sstar_lv_init(void); 11 | void sstar_lv_deinit(void); 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /lv_porting_sstar/sstar_sys.c: -------------------------------------------------------------------------------- 1 | /* 2 | * sstar_sys.c 3 | */ 4 | 5 | #include 6 | #include "sstar_sys.h" 7 | 8 | #include "mi_common_datatype.h" 9 | #include "mi_sys.h" 10 | 11 | int sstar_sys_init() 12 | { 13 | #ifdef CHIP_i2m 14 | if (MI_SUCCESS != MI_SYS_Init()) { 15 | printf("ERR %s -> [%d]", __FILE__, __LINE__); 16 | return -1; 17 | } 18 | #else 19 | if (MI_SUCCESS != MI_SYS_Init(0)) { 20 | printf("ERR %s -> [%d]", __FILE__, __LINE__); 21 | return -1; 22 | } 23 | #endif 24 | 25 | return 0; 26 | } 27 | 28 | void sstar_sys_deinit() 29 | { 30 | #ifdef CHIP_i2m 31 | MI_SYS_Exit(); 32 | #else 33 | MI_SYS_Exit(0); 34 | #endif 35 | } 36 | -------------------------------------------------------------------------------- /lv_porting_sstar/sstar_sys.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sstar_sys.h 3 | */ 4 | 5 | #ifndef _SSTAR_SYS_H_ 6 | #define _SSTAR_SYS_H_ 7 | 8 | int sstar_sys_init(); 9 | void sstar_sys_deinit(); 10 | 11 | #endif /* _SSTAR_SYS_H_ */ 12 | -------------------------------------------------------------------------------- /lv_porting_sstar/verify_gfx.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | 6 | // get bytesPerPixel each format 7 | unsigned int getBpp(MI_GFX_ColorFmt_e eFmt); 8 | int _gfx_alloc_surface(MI_GFX_Surface_t *pSurf, char **data,char *surfName); 9 | void _gfx_free_surface(MI_GFX_Surface_t *pSurf, char *data); 10 | void _gfx_sink_surface(MI_GFX_Surface_t *pSurf, const char *data,const char *name); 11 | -------------------------------------------------------------------------------- /lvgl/.codecov.yml: -------------------------------------------------------------------------------- 1 | codecov: 2 | notify: 3 | require_ci_to_pass: true 4 | comment: off 5 | coverage: 6 | status: 7 | patch: off 8 | project: off 9 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /lvgl/.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | open_collective: lvgl 2 | -------------------------------------------------------------------------------- /lvgl/.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: Documentation 4 | url: https://docs.lvgl.io 5 | about: Be sure to read to documentation first 6 | - name: Forum 7 | url: https://forum.lvgl.io 8 | about: For topics like How-to, Getting started, Feature request 9 | - name: CONTIBUTING.md 10 | url: https://github.com/lvgl/lvgl/blob/master/docs/CONTRIBUTING.md#faq-about-contributing 11 | about: The basic rules of contributing 12 | - name: CODING_STYLE.md 13 | url: https://github.com/lvgl/lvgl/blob/master/docs/CODING_STYLE.md 14 | about: Quick summary of LVGL's code style 15 | -------------------------------------------------------------------------------- /lvgl/.github/ISSUE_TEMPLATE/dev-discussion.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Development discussion 3 | about: Discussion strictly related to the development of the LVGL. 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 15 | 16 | ### Introduce the problem 17 | 20 | 21 | ### Examples and cases 22 | 25 | 26 | ### Suggested solution 27 | 30 | -------------------------------------------------------------------------------- /lvgl/.github/auto-comment.yml: -------------------------------------------------------------------------------- 1 | # Comment to a new issue. 2 | pullRequestOpened: | 3 | Thank you for raising your pull request. 4 | 5 | To ensure that all licensing criteria is met all repositories of the LVGL project apply a process called DCO (Developer's Certificate of Origin). 6 | 7 | The text of DCO can be read here: https://developercertificate.org/ 8 | For a more detailed description see the [Documentation](https://docs.lvgl.io/latest/en/html/contributing/index.html#developer-certification-of-origin-dco) site. 9 | 10 | By contributing to any repositories of the LVGL project you state that your contribution corresponds with the DCO. 11 | 12 | No further action is required if your contribution fulfills the DCO. If you are not sure about it feel free to ask us in a comment. 13 | -------------------------------------------------------------------------------- /lvgl/.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | ### Description of the feature or fix 2 | 3 | A clear and concise description of what the bug or new feature is. 4 | 5 | ### Checkpoints 6 | - [ ] Follow the [styling guide](https://github.com/lvgl/lvgl/blob/master/docs/CODING_STYLE.md) 7 | - [ ] Run `code-format.py` from the `scripts` folder. [astyle](http://astyle.sourceforge.net/install.html) needs to be installed. 8 | - [ ] Update the documentation 9 | -------------------------------------------------------------------------------- /lvgl/.github/workflows/arduino.yml: -------------------------------------------------------------------------------- 1 | name: Arduino Lint 2 | on: 3 | push: 4 | branches: [ master, release/v8.* ] 5 | pull_request: 6 | branches: [ master, release/v8.* ] 7 | jobs: 8 | lint: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: actions/checkout@v2 12 | - uses: arduino/arduino-lint-action@v1 13 | with: 14 | library-manager: update 15 | -------------------------------------------------------------------------------- /lvgl/.github/workflows/check_conf.yml: -------------------------------------------------------------------------------- 1 | name: Verify that lv_conf_internal.h matches repository state 2 | on: 3 | push: 4 | pull_request: 5 | 6 | jobs: 7 | verify-conf-internal: 8 | runs-on: ubuntu-latest 9 | steps: 10 | - name: Checkout 11 | uses: actions/checkout@v2 12 | with: 13 | persist-credentials: false 14 | fetch-depth: 0 15 | - name: Setup Python 16 | uses: actions/setup-python@v1 17 | with: 18 | python-version: 3.7 19 | - name: Generate lv_conf_internal.h 20 | run: python lv_conf_internal_gen.py 21 | working-directory: scripts 22 | - name: Check that repository is clean 23 | run: git diff --exit-code >/dev/null 2>&1 || (echo "Please regenerate lv_conf_internal.h using scripts/lv_conf_internal_gen.py"; false) 24 | -------------------------------------------------------------------------------- /lvgl/.github/workflows/close_old_issues.yml: -------------------------------------------------------------------------------- 1 | name: 'Close stale issues and PRs' 2 | on: 3 | schedule: 4 | - cron: '30 1 * * *' 5 | workflow_dispatch: 6 | 7 | jobs: 8 | stale: 9 | if: github.repository == 'lvgl/lvgl' 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: actions/stale@v3 13 | with: 14 | repo-token: ${{ secrets.LVGL_BOT_TOKEN }} 15 | stale-issue-message: 'This issue is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 7 days.' 16 | stale-pr-message: 'This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 7 days.' 17 | close-issue-message: 'This issue was closed because it has been stalled for 7 days with no activity.' 18 | days-before-stale: 14 19 | days-before-close: 7 20 | exempt-issue-labels: 'pinned' 21 | exempt-pr-labels: 'pinned' 22 | -------------------------------------------------------------------------------- /lvgl/.github/workflows/esp_upload_component.yml: -------------------------------------------------------------------------------- 1 | name: Push LVGL release to Espressif Component Service 2 | 3 | # If the commit is tagged, it will be uploaded. Other scenario silently fail. 4 | on: 5 | push: 6 | branches: 7 | - master 8 | 9 | jobs: 10 | upload_components: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - uses: actions/checkout@master 14 | with: 15 | submodules: "recursive" 16 | 17 | - name: Upload component to component registry 18 | uses: espressif/github-actions/upload_components@master 19 | with: 20 | name: "lvgl" 21 | version: "git" 22 | namespace: "lvgl" 23 | api_token: ${{ secrets.ESP_IDF_COMPONENT_API_TOKEN }} 24 | -------------------------------------------------------------------------------- /lvgl/.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | on: 2 | issues: 3 | types: [opened, edited] 4 | 5 | jobs: 6 | auto_close_issues: 7 | runs-on: ubuntu-latest 8 | steps: 9 | - name: Checkout 10 | uses: actions/checkout@v1 11 | - name: Automatically close issues that don't follow the issue template 12 | uses: lucasbento/auto-close-issues@v1.0.2 13 | with: 14 | github-token: ${{ secrets.GITHUB_TOKEN }} 15 | issue-close-message: "@${issue.user.login}: hello! :wave:\n\nThis issue is being automatically closed because it does not follow the issue template." # optional property 16 | closed-issues-label: "not-template" 17 | -------------------------------------------------------------------------------- /lvgl/.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | on: 2 | push: 3 | # Sequence of patterns matched against refs/tags 4 | tags: 5 | - "v[0-9]+.[0-9]+.[0-9]+" # Push events to matching v*, i.e. v1.0, v20.15.10 6 | 7 | name: Create Release 8 | 9 | jobs: 10 | build: 11 | name: Create Release 12 | runs-on: ubuntu-latest 13 | steps: 14 | - name: Checkout code 15 | uses: actions/checkout@v2 16 | - name: Create Release 17 | id: create_release 18 | uses: actions/create-release@v1 19 | env: 20 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token 21 | with: 22 | tag_name: ${{ github.ref }} 23 | release_name: Release ${{ github.ref }} 24 | body: | 25 | See the [CHANGELOG](https://github.com/lvgl/lvgl/blob/master/docs/CHANGELOG.md) 26 | draft: false 27 | prerelease: false 28 | -------------------------------------------------------------------------------- /lvgl/.gitignore: -------------------------------------------------------------------------------- 1 | **/*.o 2 | **/*bin 3 | **/*.swp 4 | **/*.swo 5 | **/*.gcda 6 | **/*.gcno 7 | tags 8 | docs/api_doc 9 | scripts/cppcheck_res.txt 10 | scripts/built_in_font/lv_font_* 11 | docs/doxygen_html 12 | docs/xml 13 | docs/examples.md 14 | docs/out_latex 15 | docs/_static/built_lv_examples 16 | docs/LVGL.pdf 17 | docs/env 18 | out_html 19 | __pycache__ 20 | /emscripten_builder 21 | test_screenshot_error.h 22 | build/ 23 | tests/build_*/ 24 | tests/report/ 25 | -------------------------------------------------------------------------------- /lvgl/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12.4) 2 | 3 | if(NOT ESP_PLATFORM) 4 | project(lvgl HOMEPAGE_URL https://github.com/lvgl/lvgl) 5 | endif() 6 | 7 | set(LVGL_ROOT_DIR ${CMAKE_CURRENT_LIST_DIR}) 8 | 9 | if(ESP_PLATFORM) 10 | include(${CMAKE_CURRENT_LIST_DIR}/env_support/cmake/esp.cmake) 11 | elseif(ZEPHYR_BASE) 12 | include(${CMAKE_CURRENT_LIST_DIR}/env_support/cmake/zephyr.cmake) 13 | elseif(MICROPY_DIR) 14 | include(${CMAKE_CURRENT_LIST_DIR}/env_support/cmake/micropython.cmake) 15 | else() 16 | include(${CMAKE_CURRENT_LIST_DIR}/env_support/cmake/custom.cmake) 17 | endif() 18 | -------------------------------------------------------------------------------- /lvgl/SConscript: -------------------------------------------------------------------------------- 1 | # RT-Thread building script for bridge 2 | 3 | import os 4 | from building import * 5 | 6 | objs = [] 7 | cwd = GetCurrentDir() 8 | 9 | objs = objs + SConscript(cwd + '/env_support/rt-thread/SConscript') 10 | 11 | Return('objs') 12 | -------------------------------------------------------------------------------- /lvgl/demos/benchmark/assets/img_cogwheel_argb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/demos/benchmark/assets/img_cogwheel_argb.png -------------------------------------------------------------------------------- /lvgl/demos/benchmark/assets/img_cogwheel_chroma_keyed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/demos/benchmark/assets/img_cogwheel_chroma_keyed.png -------------------------------------------------------------------------------- /lvgl/demos/benchmark/assets/img_cogwheel_indexed16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/demos/benchmark/assets/img_cogwheel_indexed16.png -------------------------------------------------------------------------------- /lvgl/demos/benchmark/assets/img_cogwheel_rgb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/demos/benchmark/assets/img_cogwheel_rgb.png -------------------------------------------------------------------------------- /lvgl/demos/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 | #include "../lv_demos.h" 17 | 18 | /********************* 19 | * DEFINES 20 | *********************/ 21 | 22 | /********************** 23 | * TYPEDEFS 24 | **********************/ 25 | 26 | /********************** 27 | * GLOBAL PROTOTYPES 28 | **********************/ 29 | void lv_demo_benchmark(void); 30 | 31 | /********************** 32 | * MACROS 33 | **********************/ 34 | 35 | #ifdef __cplusplus 36 | } /* extern "C" */ 37 | #endif 38 | 39 | #endif /*LV_DEMO_BENCHMARK_H*/ 40 | -------------------------------------------------------------------------------- /lvgl/demos/benchmark/screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/demos/benchmark/screenshot1.png -------------------------------------------------------------------------------- /lvgl/demos/benchmark/screenshot2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/demos/benchmark/screenshot2.png -------------------------------------------------------------------------------- /lvgl/demos/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/master/porting/indev.html#keypad-or-keyboard). 8 | 9 | ![Keypad and encoder navigation in LVGL embedded GUI library](screenshot1.gif) 10 | 11 | ## Run the demo 12 | - In `lv_conf.h` or equivalent places set `LV_USE_DEMO_KEYPAD_AND_ENCODER 1` 13 | - After `lv_init()` and initializing the drivers call `lv_demo_keypad_encoder()` 14 | -------------------------------------------------------------------------------- /lvgl/demos/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 | #include "../lv_demos.h" 17 | 18 | /********************* 19 | * DEFINES 20 | *********************/ 21 | 22 | /********************** 23 | * TYPEDEFS 24 | **********************/ 25 | 26 | /********************** 27 | * GLOBAL PROTOTYPES 28 | **********************/ 29 | void lv_demo_keypad_encoder(void); 30 | 31 | /********************** 32 | * MACROS 33 | **********************/ 34 | 35 | #ifdef __cplusplus 36 | } /* extern "C" */ 37 | #endif 38 | 39 | #endif /*LV_DEMO_KEYPAD_ENCODER_H*/ 40 | -------------------------------------------------------------------------------- /lvgl/demos/keypad_encoder/screenshot1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/demos/keypad_encoder/screenshot1.gif -------------------------------------------------------------------------------- /lvgl/demos/keypad_encoder/screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/demos/keypad_encoder/screenshot1.png -------------------------------------------------------------------------------- /lvgl/demos/lv_demos.mk: -------------------------------------------------------------------------------- 1 | CSRCS += $(shell find -L $(LVGL_DIR)/$(LVGL_DIR_NAME)/demos -name "*.c") 2 | -------------------------------------------------------------------------------- /lvgl/demos/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") -------------------------------------------------------------------------------- /lvgl/demos/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 | -------------------------------------------------------------------------------- /lvgl/demos/music/screenshot1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/demos/music/screenshot1.gif -------------------------------------------------------------------------------- /lvgl/demos/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_conf.h` or equivalent places 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 | -------------------------------------------------------------------------------- /lvgl/demos/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 | #include "../lv_demos.h" 17 | 18 | /********************* 19 | * DEFINES 20 | *********************/ 21 | 22 | #define LV_DEMO_STRESS_TIME_STEP 50 23 | 24 | /********************** 25 | * TYPEDEFS 26 | **********************/ 27 | 28 | /********************** 29 | * GLOBAL PROTOTYPES 30 | **********************/ 31 | void lv_demo_stress(void); 32 | 33 | /********************** 34 | * MACROS 35 | **********************/ 36 | 37 | #ifdef __cplusplus 38 | } /* extern "C" */ 39 | #endif 40 | 41 | #endif /*LV_DEMO_STRESS_H*/ 42 | -------------------------------------------------------------------------------- /lvgl/demos/stress/screenshot1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/demos/stress/screenshot1.gif -------------------------------------------------------------------------------- /lvgl/demos/stress/screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/demos/stress/screenshot1.png -------------------------------------------------------------------------------- /lvgl/demos/widgets/assets/avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/demos/widgets/assets/avatar.png -------------------------------------------------------------------------------- /lvgl/demos/widgets/assets/clothes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/demos/widgets/assets/clothes.png -------------------------------------------------------------------------------- /lvgl/demos/widgets/assets/lvgl_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/demos/widgets/assets/lvgl_logo.png -------------------------------------------------------------------------------- /lvgl/demos/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 | #include "../lv_demos.h" 17 | 18 | /********************* 19 | * DEFINES 20 | *********************/ 21 | 22 | /********************** 23 | * TYPEDEFS 24 | **********************/ 25 | 26 | /********************** 27 | * GLOBAL PROTOTYPES 28 | **********************/ 29 | void lv_demo_widgets(void); 30 | 31 | /********************** 32 | * MACROS 33 | **********************/ 34 | 35 | #ifdef __cplusplus 36 | } /* extern "C" */ 37 | #endif 38 | 39 | #endif /*LV_DEMO_WIDGETS_H*/ 40 | -------------------------------------------------------------------------------- /lvgl/demos/widgets/screenshot1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/demos/widgets/screenshot1.gif -------------------------------------------------------------------------------- /lvgl/demos/widgets/screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/demos/widgets/screenshot1.png -------------------------------------------------------------------------------- /lvgl/docs/_static/img/home_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/docs/_static/img/home_1.png -------------------------------------------------------------------------------- /lvgl/docs/_static/img/home_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/docs/_static/img/home_2.png -------------------------------------------------------------------------------- /lvgl/docs/_static/img/home_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/docs/_static/img/home_3.png -------------------------------------------------------------------------------- /lvgl/docs/_static/img/home_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/docs/_static/img/home_4.png -------------------------------------------------------------------------------- /lvgl/docs/_static/img/home_5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/docs/_static/img/home_5.png -------------------------------------------------------------------------------- /lvgl/docs/_static/img/home_6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/docs/_static/img/home_6.png -------------------------------------------------------------------------------- /lvgl/docs/_static/img/home_banner.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/docs/_static/img/home_banner.jpg -------------------------------------------------------------------------------- /lvgl/docs/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/docs/favicon.png -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /lvgl/docs/header.rst: -------------------------------------------------------------------------------- 1 | .. |github_link_base| replace:: https://github.com/lvgl/lvgl/blob/c6f99ad200c7862c2f3cca3811bc2bdc2c95e971/docs -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /lvgl/docs/libs/index.md: -------------------------------------------------------------------------------- 1 | ```eval_rst 2 | .. include:: /header.rst 3 | :github_url: |github_link_base|/libs/index.md 4 | ``` 5 | # 3rd party libraries 6 | 7 | 8 | ```eval_rst 9 | 10 | .. toctree:: 11 | :maxdepth: 1 12 | 13 | fsdrv 14 | bmp 15 | sjpg 16 | png 17 | gif 18 | freetype 19 | qrcode 20 | rlottie 21 | ffmpeg 22 | ``` 23 | 24 | -------------------------------------------------------------------------------- /lvgl/docs/logo_lvgl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/docs/logo_lvgl.png -------------------------------------------------------------------------------- /lvgl/docs/misc/align.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/docs/misc/align.png -------------------------------------------------------------------------------- /lvgl/docs/misc/anim-timeline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/docs/misc/anim-timeline.png -------------------------------------------------------------------------------- /lvgl/docs/misc/bidi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/docs/misc/bidi.png -------------------------------------------------------------------------------- /lvgl/docs/misc/boxmodel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/docs/misc/boxmodel.png -------------------------------------------------------------------------------- /lvgl/docs/misc/btn_example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/docs/misc/btn_example.png -------------------------------------------------------------------------------- /lvgl/docs/misc/button_style_example.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/docs/misc/button_style_example.gif -------------------------------------------------------------------------------- /lvgl/docs/misc/button_style_example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/docs/misc/button_style_example.png -------------------------------------------------------------------------------- /lvgl/docs/misc/codeblocks.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/docs/misc/codeblocks.jpg -------------------------------------------------------------------------------- /lvgl/docs/misc/eclipse.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/docs/misc/eclipse.jpg -------------------------------------------------------------------------------- /lvgl/docs/misc/layers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/docs/misc/layers.png -------------------------------------------------------------------------------- /lvgl/docs/misc/par_child1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/docs/misc/par_child1.png -------------------------------------------------------------------------------- /lvgl/docs/misc/par_child2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/docs/misc/par_child2.png -------------------------------------------------------------------------------- /lvgl/docs/misc/par_child3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/docs/misc/par_child3.png -------------------------------------------------------------------------------- /lvgl/docs/misc/platformio.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/docs/misc/platformio.jpg -------------------------------------------------------------------------------- /lvgl/docs/misc/qtcreator.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/docs/misc/qtcreator.jpg -------------------------------------------------------------------------------- /lvgl/docs/misc/simple_button_example.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/docs/misc/simple_button_example.gif -------------------------------------------------------------------------------- /lvgl/docs/misc/simple_button_example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/docs/misc/simple_button_example.png -------------------------------------------------------------------------------- /lvgl/docs/misc/symbols.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/docs/misc/symbols.png -------------------------------------------------------------------------------- /lvgl/docs/misc/sys.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/docs/misc/sys.png -------------------------------------------------------------------------------- /lvgl/docs/misc/visualstudio.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/docs/misc/visualstudio.jpg -------------------------------------------------------------------------------- /lvgl/docs/others/index.md: -------------------------------------------------------------------------------- 1 | ```eval_rst 2 | .. include:: /header.rst 3 | :github_url: |github_link_base|/others/index.md 4 | ``` 5 | # Others 6 | 7 | 8 | ```eval_rst 9 | 10 | .. toctree:: 11 | :maxdepth: 1 12 | 13 | snapshot 14 | monkey 15 | gridnav 16 | ``` 17 | 18 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | gpu 22 | 23 | ``` 24 | 25 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | animimg 13 | calendar 14 | chart 15 | colorwheel 16 | imgbtn 17 | keyboard 18 | led 19 | list 20 | menu 21 | meter 22 | msgbox 23 | span 24 | spinbox 25 | spinner 26 | tabview 27 | tileview 28 | win 29 | ``` 30 | 31 | 32 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /lvgl/env_support/cmake/micropython.cmake: -------------------------------------------------------------------------------- 1 | file(GLOB_RECURSE SOURCES ${LVGL_ROOT_DIR}/src/*.c) 2 | file(GLOB_RECURSE EXAMPLE_SOURCES ${LVGL_ROOT_DIR}/examples/*.c) 3 | 4 | # With micropython, build lvgl as interface library, link chain is: 5 | # lvgl_interface [lvgl] → usermod_lvgl_bindings [lv_bindings] → usermod 6 | # [micropython] → firmware [micropython] 7 | add_library(lvgl_interface INTERFACE) 8 | # ${SOURCES} must NOT be given to add_library directly for some reason (won't be 9 | # built) 10 | target_sources(lvgl_interface INTERFACE ${SOURCES}) 11 | # Micropython builds with -Werror; we need to suppress some warnings, such as: 12 | # 13 | # /home/test/build/lv_micropython/ports/rp2/build-PICO/lv_mp.c:29316:16: error: 14 | # 'lv_style_transition_dsc_t_path_xcb_callback' defined but not used 15 | # [-Werror=unused-function] 29316 | STATIC int32_t 16 | # lv_style_transition_dsc_t_path_xcb_callback(const struct _lv_anim_t * arg0) | 17 | # ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 18 | target_compile_options(lvgl_interface INTERFACE -Wno-unused-function) 19 | -------------------------------------------------------------------------------- /lvgl/env_support/cmake/zephyr.cmake: -------------------------------------------------------------------------------- 1 | if(CONFIG_LVGL) 2 | 3 | zephyr_include_directories(${ZEPHYR_BASE}/lib/gui/lvgl) 4 | 5 | target_include_directories(lvgl INTERFACE ${LVGL_ROOT_DIR}) 6 | 7 | zephyr_compile_definitions(LV_CONF_KCONFIG_EXTERNAL_INCLUDE=) 8 | 9 | zephyr_library() 10 | 11 | file(GLOB_RECURSE SOURCES ${LVGL_ROOT_DIR}/src/*.c) 12 | zephyr_library_sources(${SOURCES}) 13 | 14 | endif(CONFIG_LVGL) 15 | -------------------------------------------------------------------------------- /lvgl/env_support/cmsis-pack/LVGL.lvgl.1.0.0.pack: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/env_support/cmsis-pack/LVGL.lvgl.1.0.0.pack -------------------------------------------------------------------------------- /lvgl/env_support/rt-thread/lv_rt_thread_port.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006-2021, RT-Thread Development Team 3 | * 4 | * SPDX-License-Identifier: MIT 5 | * 6 | * Change Logs: 7 | * Date Author Notes 8 | * 2021-10-18 Meco Man The first version 9 | */ 10 | 11 | #ifdef __RTTHREAD__ 12 | 13 | #include 14 | #define DBG_TAG "LVGL" 15 | #define DBG_LVL DBG_INFO 16 | #include 17 | 18 | #include 19 | #include 20 | #include 21 | 22 | #if LV_USE_LOG 23 | static void lv_rt_log(const char *buf) 24 | { 25 | LOG_I(buf); 26 | } 27 | #endif 28 | 29 | static int lv_port_init(void) 30 | { 31 | #if LV_USE_LOG 32 | lv_log_register_print_cb(lv_rt_log); 33 | #endif 34 | 35 | lv_init(); 36 | 37 | lv_port_disp_init(); 38 | lv_port_indev_init(); 39 | 40 | return 0; 41 | } 42 | INIT_COMPONENT_EXPORT(lv_port_init); 43 | 44 | #endif /*__RTTHREAD__*/ 45 | -------------------------------------------------------------------------------- /lvgl/env_support/zephyr/module.yml: -------------------------------------------------------------------------------- 1 | build: 2 | cmake: . 3 | -------------------------------------------------------------------------------- /lvgl/examples/anim/index.rst: -------------------------------------------------------------------------------- 1 | 2 | Start animation on an event 3 | """""""""""""""""""""""""""" 4 | 5 | .. lv_example:: anim/lv_example_anim_1 6 | :language: c 7 | 8 | Playback animation 9 | """"""""""""""""""" 10 | .. lv_example:: anim/lv_example_anim_2 11 | :language: c 12 | 13 | Animation timeline 14 | """"""""""""""""""" 15 | .. lv_example:: anim/lv_example_anim_timeline_1 16 | :language: c 17 | 18 | -------------------------------------------------------------------------------- /lvgl/examples/anim/lv_example_anim.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_example_anim.h 3 | * 4 | */ 5 | 6 | #ifndef LV_EXAMPLE_ANIM_H 7 | #define LV_EXAMPLE_ANIM_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | 17 | /********************* 18 | * DEFINES 19 | *********************/ 20 | 21 | /********************** 22 | * TYPEDEFS 23 | **********************/ 24 | 25 | /********************** 26 | * GLOBAL PROTOTYPES 27 | **********************/ 28 | void lv_example_anim_1(void); 29 | void lv_example_anim_2(void); 30 | void lv_example_anim_3(void); 31 | void lv_example_anim_timeline_1(void); 32 | 33 | /********************** 34 | * MACROS 35 | **********************/ 36 | 37 | #ifdef __cplusplus 38 | } /*extern "C"*/ 39 | #endif 40 | 41 | #endif /*LV_EXAMPLE_ANIM_H*/ 42 | -------------------------------------------------------------------------------- /lvgl/examples/assets/animimg001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/examples/assets/animimg001.png -------------------------------------------------------------------------------- /lvgl/examples/assets/animimg002.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/examples/assets/animimg002.png -------------------------------------------------------------------------------- /lvgl/examples/assets/animimg003.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/examples/assets/animimg003.png -------------------------------------------------------------------------------- /lvgl/examples/assets/caret_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/examples/assets/caret_down.png -------------------------------------------------------------------------------- /lvgl/examples/assets/font/lv_font_simsun_16_cjk.fnt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/examples/assets/font/lv_font_simsun_16_cjk.fnt -------------------------------------------------------------------------------- /lvgl/examples/assets/font/montserrat-16.fnt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/examples/assets/font/montserrat-16.fnt -------------------------------------------------------------------------------- /lvgl/examples/assets/font/montserrat-22.fnt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/examples/assets/font/montserrat-22.fnt -------------------------------------------------------------------------------- /lvgl/examples/assets/img_caret_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/examples/assets/img_caret_down.png -------------------------------------------------------------------------------- /lvgl/examples/assets/img_cogwheel_argb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/examples/assets/img_cogwheel_argb.png -------------------------------------------------------------------------------- /lvgl/examples/assets/img_cogwheel_chroma_keyed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/examples/assets/img_cogwheel_chroma_keyed.png -------------------------------------------------------------------------------- /lvgl/examples/assets/img_cogwheel_indexed16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/examples/assets/img_cogwheel_indexed16.png -------------------------------------------------------------------------------- /lvgl/examples/assets/img_cogwheel_rgb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/examples/assets/img_cogwheel_rgb.png -------------------------------------------------------------------------------- /lvgl/examples/assets/img_hand_hour.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/examples/assets/img_hand_hour.png -------------------------------------------------------------------------------- /lvgl/examples/assets/img_hand_min.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/examples/assets/img_hand_min.png -------------------------------------------------------------------------------- /lvgl/examples/assets/img_skew_strip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/examples/assets/img_skew_strip.png -------------------------------------------------------------------------------- /lvgl/examples/assets/img_skew_strip_80x20_argb8888.fnt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/examples/assets/img_skew_strip_80x20_argb8888.fnt -------------------------------------------------------------------------------- /lvgl/examples/assets/img_star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/examples/assets/img_star.png -------------------------------------------------------------------------------- /lvgl/examples/assets/img_strip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/examples/assets/img_strip.png -------------------------------------------------------------------------------- /lvgl/examples/assets/imgbtn_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/examples/assets/imgbtn_left.png -------------------------------------------------------------------------------- /lvgl/examples/assets/imgbtn_mid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/examples/assets/imgbtn_mid.png -------------------------------------------------------------------------------- /lvgl/examples/assets/imgbtn_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/examples/assets/imgbtn_right.png -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | void lv_example_event_4(void); 32 | 33 | /********************** 34 | * MACROS 35 | **********************/ 36 | 37 | #ifdef __cplusplus 38 | } /*extern "C"*/ 39 | #endif 40 | 41 | #endif /*LV_EXAMPLE_EVENT_H*/ 42 | -------------------------------------------------------------------------------- /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, "%"LV_PRIu32, 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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | 32 | cont.add_event_cb(event_cb, lv.EVENT.CLICKED, None) 33 | -------------------------------------------------------------------------------- /lvgl/examples/examples.mk: -------------------------------------------------------------------------------- 1 | CSRCS += $(shell find -L $(LVGL_DIR)/$(LVGL_DIR_NAME)/examples -name \*.c) 2 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /lvgl/examples/header.py: -------------------------------------------------------------------------------- 1 | #!/opt/bin/lv_micropython -i 2 | 3 | import lvgl as lv 4 | 5 | import display_driver 6 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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: %"LV_PRIu32, i); 22 | lv_obj_center(label); 23 | } 24 | } 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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, "%"LV_PRIu32, i); 23 | lv_obj_center(label); 24 | } 25 | } 26 | #endif 27 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /lvgl/examples/layouts/grid/lv_example_grid_1.py: -------------------------------------------------------------------------------- 1 | # 2 | # A simple grid 3 | # 4 | 5 | col_dsc = [70, 70, 70, lv.GRID_TEMPLATE.LAST] 6 | row_dsc = [50, 50, 50, lv.GRID_TEMPLATE.LAST] 7 | 8 | # Create a container with grid 9 | cont = lv.obj(lv.scr_act()) 10 | cont.set_style_grid_column_dsc_array(col_dsc, 0) 11 | cont.set_style_grid_row_dsc_array(row_dsc, 0) 12 | cont.set_size(300, 220) 13 | cont.center() 14 | cont.set_layout(lv.LAYOUT_GRID.value) 15 | 16 | for i in range(9): 17 | col = i % 3 18 | row = i // 3 19 | 20 | obj = lv.btn(cont) 21 | # Stretch the cell horizontally and vertically too 22 | # Set span to 1 to make the cell 1 column/row sized 23 | obj.set_grid_cell(lv.GRID_ALIGN.STRETCH, col, 1, 24 | lv.GRID_ALIGN.STRETCH, row, 1) 25 | 26 | label = lv.label(obj) 27 | label.set_text("c" +str(col) + "r" +str(row)) 28 | label.center() 29 | 30 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /lvgl/examples/libs/bmp/example_16bit.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/examples/libs/bmp/example_16bit.bmp -------------------------------------------------------------------------------- /lvgl/examples/libs/bmp/example_24bit.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/examples/libs/bmp/example_24bit.bmp -------------------------------------------------------------------------------- /lvgl/examples/libs/bmp/example_32bit.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/examples/libs/bmp/example_32bit.bmp -------------------------------------------------------------------------------- /lvgl/examples/libs/bmp/index.rst: -------------------------------------------------------------------------------- 1 | Open a BMP image from file 2 | """"""""""""""""""""""""""""""""""""""""""""""" 3 | 4 | .. lv_example:: libs/bmp/lv_example_bmp_1 5 | :language: c 6 | 7 | -------------------------------------------------------------------------------- /lvgl/examples/libs/bmp/lv_example_bmp.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_example_bmp.h 3 | * 4 | */ 5 | 6 | #ifndef LV_EXAMPLE_BMP_H 7 | #define LV_EXAMPLE_BMP_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | 17 | /********************* 18 | * DEFINES 19 | *********************/ 20 | 21 | /********************** 22 | * TYPEDEFS 23 | **********************/ 24 | 25 | /********************** 26 | * GLOBAL PROTOTYPES 27 | **********************/ 28 | void lv_example_bmp_1(void); 29 | 30 | /********************** 31 | * MACROS 32 | **********************/ 33 | 34 | #ifdef __cplusplus 35 | } /*extern "C"*/ 36 | #endif 37 | 38 | #endif /*LV_EXAMPLE_BMP_H*/ 39 | -------------------------------------------------------------------------------- /lvgl/examples/libs/bmp/lv_example_bmp_1.c: -------------------------------------------------------------------------------- 1 | #include "../../lv_examples.h" 2 | #if LV_USE_BMP && LV_BUILD_EXAMPLES 3 | 4 | /** 5 | * Open a BMP file from a file 6 | */ 7 | void lv_example_bmp_1(void) 8 | { 9 | lv_obj_t * img = lv_img_create(lv_scr_act()); 10 | /* Assuming a File system is attached to letter 'A' 11 | * E.g. set LV_USE_FS_STDIO 'A' in lv_conf.h */ 12 | #if LV_COLOR_DEPTH == 32 13 | lv_img_set_src(img, "A:lvgl/examples/libs/bmp/example_32bit.bmp"); 14 | #elif LV_COLOR_DEPTH == 16 15 | lv_img_set_src(img, "A:lvgl/examples/libs/bmp/example_16bit.bmp"); 16 | #endif 17 | lv_obj_center(img); 18 | 19 | } 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /lvgl/examples/libs/bmp/lv_example_bmp_1.py: -------------------------------------------------------------------------------- 1 | #!/opt/bin/lv_micropython -i 2 | import lvgl as lv 3 | import display_driver 4 | import fs_driver 5 | 6 | fs_drv = lv.fs_drv_t() 7 | fs_driver.fs_register(fs_drv, 'S') 8 | 9 | img = lv.img(lv.scr_act()) 10 | # The File system is attached to letter 'S' 11 | 12 | img.set_src("S:example_32bit.bmp") 13 | img.center() 14 | -------------------------------------------------------------------------------- /lvgl/examples/libs/ffmpeg/birds.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/examples/libs/ffmpeg/birds.mp4 -------------------------------------------------------------------------------- /lvgl/examples/libs/ffmpeg/ffmpeg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/examples/libs/ffmpeg/ffmpeg.png -------------------------------------------------------------------------------- /lvgl/examples/libs/ffmpeg/index.rst: -------------------------------------------------------------------------------- 1 | Decode image 2 | """"""""""""""""""""""""""""""""""""" 3 | 4 | .. lv_example:: libs/ffmpeg/lv_example_ffmpeg_1 5 | :language: c 6 | 7 | Decode video 8 | """"""""""""""""""""""""""""""""""" 9 | 10 | .. lv_example:: libs/ffmpeg/lv_example_ffmpeg_2 11 | :language: c 12 | 13 | -------------------------------------------------------------------------------- /lvgl/examples/libs/ffmpeg/lv_example_ffmpeg.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_example_ffmpeg.h 3 | * 4 | */ 5 | 6 | #ifndef LV_EXAMPLE_FFMPEG_H 7 | #define LV_EXAMPLE_FFMPEG_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_ffmpeg_1(void); 29 | void lv_example_ffmpeg_2(void); 30 | 31 | /********************** 32 | * MACROS 33 | **********************/ 34 | 35 | #ifdef __cplusplus 36 | } /*extern "C"*/ 37 | #endif 38 | 39 | #endif /*LV_EXAMPLE_FFMPEG_H*/ 40 | -------------------------------------------------------------------------------- /lvgl/examples/libs/ffmpeg/lv_example_ffmpeg_1.c: -------------------------------------------------------------------------------- 1 | #include "../../lv_examples.h" 2 | #if LV_BUILD_EXAMPLES 3 | #if LV_USE_FFMPEG 4 | 5 | 6 | /** 7 | * Open an image from a file 8 | */ 9 | void lv_example_ffmpeg_1(void) 10 | { 11 | lv_obj_t * img = lv_img_create(lv_scr_act()); 12 | lv_img_set_src(img, "./lvgl/examples/libs/ffmpeg/ffmpeg.png"); 13 | lv_obj_center(img); 14 | } 15 | 16 | #else 17 | 18 | void lv_example_ffmpeg_1(void) 19 | { 20 | /*TODO 21 | *fallback for online examples*/ 22 | 23 | lv_obj_t * label = lv_label_create(lv_scr_act()); 24 | lv_label_set_text(label, "FFmpeg is not installed"); 25 | lv_obj_center(label); 26 | } 27 | 28 | #endif 29 | #endif 30 | -------------------------------------------------------------------------------- /lvgl/examples/libs/ffmpeg/lv_example_ffmpeg_2.c: -------------------------------------------------------------------------------- 1 | #include "../../lv_examples.h" 2 | #if LV_BUILD_EXAMPLES 3 | #if LV_USE_FFMPEG 4 | 5 | /** 6 | * Open a video from a file 7 | */ 8 | void lv_example_ffmpeg_2(void) 9 | { 10 | /*birds.mp4 is downloaded from http://www.videezy.com (Free Stock Footage by Videezy!) 11 | *https://www.videezy.com/abstract/44864-silhouettes-of-birds-over-the-sunset*/ 12 | lv_obj_t * player = lv_ffmpeg_player_create(lv_scr_act()); 13 | lv_ffmpeg_player_set_src(player, "./lvgl/examples/libs/ffmpeg/birds.mp4"); 14 | lv_ffmpeg_player_set_auto_restart(player, true); 15 | lv_ffmpeg_player_set_cmd(player, LV_FFMPEG_PLAYER_CMD_START); 16 | lv_obj_center(player); 17 | } 18 | 19 | #else 20 | 21 | void lv_example_ffmpeg_2(void) 22 | { 23 | /*TODO 24 | *fallback for online examples*/ 25 | 26 | lv_obj_t * label = lv_label_create(lv_scr_act()); 27 | lv_label_set_text(label, "FFmpeg is not installed"); 28 | lv_obj_center(label); 29 | } 30 | 31 | #endif 32 | #endif 33 | -------------------------------------------------------------------------------- /lvgl/examples/libs/freetype/arial.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/examples/libs/freetype/arial.ttf -------------------------------------------------------------------------------- /lvgl/examples/libs/freetype/index.rst: -------------------------------------------------------------------------------- 1 | Open a front with FreeType 2 | """"""""""""""""""""""""""""""""""""""""""""""" 3 | 4 | .. lv_example:: libs/freetype/lv_example_freetype_1 5 | :language: c 6 | 7 | -------------------------------------------------------------------------------- /lvgl/examples/libs/freetype/lv_example_freetype.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_example_freetype.h 3 | * 4 | */ 5 | 6 | #ifndef LV_EXAMPLE_FREETYPE_H 7 | #define LV_EXAMPLE_FREETYPE_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | 17 | /********************* 18 | * DEFINES 19 | *********************/ 20 | 21 | /********************** 22 | * TYPEDEFS 23 | **********************/ 24 | 25 | /********************** 26 | * GLOBAL PROTOTYPES 27 | **********************/ 28 | void lv_example_freetype_1(void); 29 | 30 | /********************** 31 | * MACROS 32 | **********************/ 33 | 34 | #ifdef __cplusplus 35 | } /*extern "C"*/ 36 | #endif 37 | 38 | #endif /*LV_EXAMPLE_FREETYPE_H*/ 39 | -------------------------------------------------------------------------------- /lvgl/examples/libs/freetype/lv_example_freetype_1.py: -------------------------------------------------------------------------------- 1 | #!/opt/bin/lv_micropython -i 2 | import lvgl as lv 3 | import display_driver 4 | import fs_driver 5 | 6 | info = lv.ft_info_t() 7 | info.name ="./arial.ttf" 8 | info.weight = 24 9 | info.style = lv.FT_FONT_STYLE.NORMAL 10 | info.font_init() 11 | 12 | # Create style with the new font 13 | style = lv.style_t() 14 | style.init() 15 | style.set_text_font(info.font) 16 | style.set_text_align(lv.TEXT_ALIGN.CENTER) 17 | 18 | # Create a label with the new style 19 | label = lv.label(lv.scr_act()) 20 | label.add_style(style, 0) 21 | label.set_text("Hello world\nI'm a font created with FreeType") 22 | label.center() 23 | -------------------------------------------------------------------------------- /lvgl/examples/libs/gif/bulb.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/examples/libs/gif/bulb.gif -------------------------------------------------------------------------------- /lvgl/examples/libs/gif/index.rst: -------------------------------------------------------------------------------- 1 | Open a GIF image from file and variable 2 | """"""""""""""""""""""""""""""""""""""""""""""" 3 | 4 | .. lv_example:: libs/gif/lv_example_gif_1 5 | :language: c 6 | 7 | -------------------------------------------------------------------------------- /lvgl/examples/libs/gif/lv_example_gif.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_example_gif.h 3 | * 4 | */ 5 | 6 | #ifndef LV_EXAMPLE_GIF_H 7 | #define LV_EXAMPLE_GIF_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | 17 | /********************* 18 | * DEFINES 19 | *********************/ 20 | 21 | /********************** 22 | * TYPEDEFS 23 | **********************/ 24 | 25 | /********************** 26 | * GLOBAL PROTOTYPES 27 | **********************/ 28 | void lv_example_gif_1(void); 29 | 30 | /********************** 31 | * MACROS 32 | **********************/ 33 | 34 | #ifdef __cplusplus 35 | } /*extern "C"*/ 36 | #endif 37 | 38 | #endif /*LV_EXAMPLE_GIF_H*/ 39 | -------------------------------------------------------------------------------- /lvgl/examples/libs/gif/lv_example_gif_1.c: -------------------------------------------------------------------------------- 1 | #include "../../lv_examples.h" 2 | #if LV_USE_GIF && LV_BUILD_EXAMPLES 3 | 4 | /** 5 | * Open a GIF image from a file and a variable 6 | */ 7 | void lv_example_gif_1(void) 8 | { 9 | LV_IMG_DECLARE(img_bulb_gif); 10 | lv_obj_t * img; 11 | 12 | img = lv_gif_create(lv_scr_act()); 13 | lv_gif_set_src(img, &img_bulb_gif); 14 | lv_obj_align(img, LV_ALIGN_BOTTOM_MID, 20, 0); 15 | 16 | img = lv_gif_create(lv_scr_act()); 17 | /* Assuming a File system is attached to letter 'A' 18 | * E.g. set LV_USE_FS_STDIO 'A' in lv_conf.h */ 19 | lv_gif_set_src(img, "A:/customer/bulb.gif"); 20 | lv_obj_align(img, LV_ALIGN_BOTTOM_MID, -20, 0); 21 | } 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /lvgl/examples/libs/gif/lv_example_gif_1.py: -------------------------------------------------------------------------------- 1 | #!/opt/bin/lv_micropython -i 2 | import lvgl as lv 3 | import display_driver 4 | import fs_driver 5 | from img_bulb_gif import img_bulb_gif_map 6 | 7 | fs_drv = lv.fs_drv_t() 8 | fs_driver.fs_register(fs_drv, 'S') 9 | # 10 | # Open a GIF image from a file and a variable 11 | # 12 | img_bulb_gif = lv.img_dsc_t( 13 | { 14 | "header": {"always_zero": 0, "w": 0, "h": 0, "cf": lv.img.CF.RAW}, 15 | "data_size": 0, 16 | "data": img_bulb_gif_map, 17 | } 18 | ) 19 | img1 = lv.gif(lv.scr_act()) 20 | img1.set_src(img_bulb_gif) 21 | img1.align(lv.ALIGN.RIGHT_MID, -150, 0) 22 | 23 | img2 = lv.gif(lv.scr_act()) 24 | # The File system is attached to letter 'S' 25 | 26 | img2.set_src("S:bulb.gif") 27 | img2.align(lv.ALIGN.RIGHT_MID, -250, 0) 28 | -------------------------------------------------------------------------------- /lvgl/examples/libs/lv_example_libs.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_example_libs.h 3 | * 4 | */ 5 | 6 | #ifndef LV_EXAMPLE_LIBS_H 7 | #define LV_EXAMPLE_LIBS_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "bmp/lv_example_bmp.h" 17 | #include "gif/lv_example_gif.h" 18 | #include "png/lv_example_png.h" 19 | #include "sjpg/lv_example_sjpg.h" 20 | #include "qrcode/lv_example_qrcode.h" 21 | #include "freetype/lv_example_freetype.h" 22 | #include "rlottie/lv_example_rlottie.h" 23 | #include "ffmpeg/lv_example_ffmpeg.h" 24 | 25 | /********************* 26 | * DEFINES 27 | *********************/ 28 | 29 | /********************** 30 | * TYPEDEFS 31 | **********************/ 32 | 33 | /********************** 34 | * GLOBAL PROTOTYPES 35 | **********************/ 36 | 37 | /********************** 38 | * MACROS 39 | **********************/ 40 | 41 | #ifdef __cplusplus 42 | } /*extern "C"*/ 43 | #endif 44 | 45 | #endif /*LV_EXAMPLE_LIBS_H*/ 46 | -------------------------------------------------------------------------------- /lvgl/examples/libs/png/index.rst: -------------------------------------------------------------------------------- 1 | Open a PNG image from file and variable 2 | """"""""""""""""""""""""""""""""""""""""""""""" 3 | 4 | .. lv_example:: libs/png/lv_example_png_1 5 | :language: c 6 | 7 | -------------------------------------------------------------------------------- /lvgl/examples/libs/png/lv_example_png.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_example_png.h 3 | * 4 | */ 5 | 6 | #ifndef LV_EXAMPLE_PNG_H 7 | #define LV_EXAMPLE_PNG_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | 17 | /********************* 18 | * DEFINES 19 | *********************/ 20 | 21 | /********************** 22 | * TYPEDEFS 23 | **********************/ 24 | 25 | /********************** 26 | * GLOBAL PROTOTYPES 27 | **********************/ 28 | void lv_example_png_1(void); 29 | 30 | /********************** 31 | * MACROS 32 | **********************/ 33 | 34 | #ifdef __cplusplus 35 | } /*extern "C"*/ 36 | #endif 37 | 38 | #endif /*LV_EXAMPLE_PNG_H*/ 39 | -------------------------------------------------------------------------------- /lvgl/examples/libs/png/lv_example_png_1.c: -------------------------------------------------------------------------------- 1 | #include "../../lv_examples.h" 2 | #if LV_USE_PNG && LV_USE_IMG && LV_BUILD_EXAMPLES 3 | 4 | /** 5 | * Open a PNG image from a file and a variable 6 | */ 7 | void lv_example_png_1(void) 8 | { 9 | LV_IMG_DECLARE(img_wink_png); 10 | lv_obj_t * img; 11 | 12 | img = lv_img_create(lv_scr_act()); 13 | lv_img_set_src(img, &img_wink_png); 14 | lv_obj_align(img, LV_ALIGN_LEFT_MID, 20, 0); 15 | 16 | img = lv_img_create(lv_scr_act()); 17 | /* Assuming a File system is attached to letter 'A' 18 | * E.g. set LV_USE_FS_STDIO 'A' in lv_conf.h */ 19 | lv_img_set_src(img, "A:lvgl/examples/libs/png/wink.png"); 20 | lv_obj_align(img, LV_ALIGN_RIGHT_MID, -20, 0); 21 | } 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /lvgl/examples/libs/png/wink.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/examples/libs/png/wink.png -------------------------------------------------------------------------------- /lvgl/examples/libs/qrcode/index.rst: -------------------------------------------------------------------------------- 1 | Create a QR Code 2 | """"""""""""""""""""""""""""""""""""""""""""""" 3 | 4 | .. lv_example:: libs/qrcode/lv_example_qrcode_1 5 | :language: c 6 | 7 | -------------------------------------------------------------------------------- /lvgl/examples/libs/qrcode/lv_example_qrcode.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_example_qrcode.h 3 | * 4 | */ 5 | 6 | #ifndef LV_EXAMPLE_QRCODE_H 7 | #define LV_EXAMPLE_QRCODE_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | 17 | /********************* 18 | * DEFINES 19 | *********************/ 20 | 21 | /********************** 22 | * TYPEDEFS 23 | **********************/ 24 | 25 | /********************** 26 | * GLOBAL PROTOTYPES 27 | **********************/ 28 | void lv_example_qrcode_1(void); 29 | 30 | /********************** 31 | * MACROS 32 | **********************/ 33 | 34 | #ifdef __cplusplus 35 | } /*extern "C"*/ 36 | #endif 37 | 38 | #endif /*LV_EXAMPLE_QRCODE_H*/ 39 | -------------------------------------------------------------------------------- /lvgl/examples/libs/qrcode/lv_example_qrcode_1.c: -------------------------------------------------------------------------------- 1 | #include "../../lv_examples.h" 2 | #if LV_USE_QRCODE && LV_BUILD_EXAMPLES 3 | 4 | /** 5 | * Create a QR Code 6 | */ 7 | void lv_example_qrcode_1(void) 8 | { 9 | lv_color_t bg_color = lv_palette_lighten(LV_PALETTE_LIGHT_BLUE, 5); 10 | lv_color_t fg_color = lv_palette_darken(LV_PALETTE_BLUE, 4); 11 | 12 | lv_obj_t * qr = lv_qrcode_create(lv_scr_act(), 150, fg_color, bg_color); 13 | 14 | /*Set data*/ 15 | const char * data = "https://lvgl.io"; 16 | lv_qrcode_update(qr, data, strlen(data)); 17 | lv_obj_center(qr); 18 | 19 | /*Add a border with bg_color*/ 20 | lv_obj_set_style_border_color(qr, bg_color, 0); 21 | lv_obj_set_style_border_width(qr, 5, 0); 22 | } 23 | 24 | #endif 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /lvgl/examples/libs/qrcode/lv_example_qrcode_1.py: -------------------------------------------------------------------------------- 1 | #!/opt/bin/lv_micropython -i 2 | import lvgl as lv 3 | import display_driver 4 | 5 | bg_color = lv.palette_lighten(lv.PALETTE.LIGHT_BLUE, 5) 6 | fg_color = lv.palette_darken(lv.PALETTE.BLUE, 4) 7 | 8 | qr = lv.qrcode(lv.scr_act(), 150, fg_color, bg_color) 9 | # Set data 10 | data = "https://lvgl.io" 11 | qr.update(data,len(data)) 12 | qr.center() 13 | # Add a border with bg_color 14 | qr.set_style_border_color(bg_color, 0) 15 | qr.set_style_border_width(5, 0) 16 | -------------------------------------------------------------------------------- /lvgl/examples/libs/rlottie/index.rst: -------------------------------------------------------------------------------- 1 | Load a Lottie animation from raw data 2 | """"""""""""""""""""""""""""""""""""" 3 | 4 | .. lv_example:: libs/rlottie/lv_example_rlottie_1 5 | :language: c 6 | 7 | Load a Lottie animation from a file 8 | """"""""""""""""""""""""""""""""""" 9 | 10 | .. lv_example:: libs/rlottie/lv_example_rlottie_2 11 | :language: c 12 | 13 | -------------------------------------------------------------------------------- /lvgl/examples/libs/rlottie/lv_example_rlottie.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_example_rlottie.h 3 | * 4 | */ 5 | 6 | #ifndef LV_EXAMPLE_RLOTTIE_H 7 | #define LV_EXAMPLE_RLOTTIE_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | 17 | /********************* 18 | * DEFINES 19 | *********************/ 20 | 21 | /********************** 22 | * TYPEDEFS 23 | **********************/ 24 | 25 | /********************** 26 | * GLOBAL PROTOTYPES 27 | **********************/ 28 | void lv_example_rlottie_1(void); 29 | void lv_example_rlottie_2(void); 30 | 31 | /********************** 32 | * MACROS 33 | **********************/ 34 | 35 | #ifdef __cplusplus 36 | } /*extern "C"*/ 37 | #endif 38 | 39 | #endif /*LV_EXAMPLE_SJPG_H*/ 40 | -------------------------------------------------------------------------------- /lvgl/examples/libs/rlottie/lv_example_rlottie_1.c: -------------------------------------------------------------------------------- 1 | #include "../../lv_examples.h" 2 | #if LV_BUILD_EXAMPLES 3 | #if LV_USE_RLOTTIE 4 | 5 | /** 6 | * Load an lottie animation from flash 7 | */ 8 | void lv_example_rlottie_1(void) 9 | { 10 | extern const uint8_t lv_example_rlottie_approve[]; 11 | lv_obj_t * lottie = lv_rlottie_create_from_raw(lv_scr_act(), 100, 100, (const void *)lv_example_rlottie_approve); 12 | lv_obj_center(lottie); 13 | } 14 | 15 | #else 16 | void lv_example_rlottie_1(void) 17 | { 18 | /*TODO 19 | *fallback for online examples*/ 20 | 21 | lv_obj_t * label = lv_label_create(lv_scr_act()); 22 | lv_label_set_text(label, "Rlottie is not installed"); 23 | lv_obj_center(label); 24 | } 25 | 26 | #endif 27 | #endif 28 | -------------------------------------------------------------------------------- /lvgl/examples/libs/rlottie/lv_example_rlottie_1.py: -------------------------------------------------------------------------------- 1 | #!/opt/bin/lv_micropython -i 2 | import lvgl as lv 3 | import display_driver 4 | # 5 | # Load a lottie animation from flash 6 | # 7 | from lv_example_rlottie_approve import lv_example_rlottie_approve 8 | 9 | lottie = lv.rlottie_create_from_raw(lv.scr_act(), 100, 100, lv_example_rlottie_approve) 10 | lottie.center() 11 | 12 | -------------------------------------------------------------------------------- /lvgl/examples/libs/rlottie/lv_example_rlottie_2.c: -------------------------------------------------------------------------------- 1 | #include "../../lv_examples.h" 2 | #if LV_BUILD_EXAMPLES 3 | #if LV_USE_RLOTTIE 4 | 5 | /** 6 | * Load an lottie animation from file 7 | */ 8 | void lv_example_rlottie_2(void) 9 | { 10 | /*The rlottie library uses STDIO file API, so there is no driver letter for LVGL*/ 11 | lv_obj_t * lottie = lv_rlottie_create_from_file(lv_scr_act(), 100, 100, 12 | "lvgl/examples/libs/rlottie/lv_example_rlottie_approve.json"); 13 | lv_obj_center(lottie); 14 | } 15 | 16 | #else 17 | void lv_example_rlottie_2(void) 18 | { 19 | /*TODO 20 | *fallback for online examples*/ 21 | 22 | lv_obj_t * label = lv_label_create(lv_scr_act()); 23 | lv_label_set_text(label, "Rlottie is not installed"); 24 | lv_obj_center(label); 25 | } 26 | 27 | #endif 28 | #endif 29 | -------------------------------------------------------------------------------- /lvgl/examples/libs/rlottie/lv_example_rlottie_2.py: -------------------------------------------------------------------------------- 1 | #!/opt/bin/lv_micropython -i 2 | import lvgl as lv 3 | import display_driver 4 | 5 | lottie = lv.rlottie_create_from_file(lv.scr_act(), 100, 100,"lv_example_rlottie_approve.json") 6 | lottie.center() 7 | -------------------------------------------------------------------------------- /lvgl/examples/libs/sjpg/index.rst: -------------------------------------------------------------------------------- 1 | Load an SJPG image 2 | """"""""""""""""""""""""""""""""""""""""""""""" 3 | 4 | .. lv_example:: libs/sjpg/lv_example_sjpg_1 5 | :language: c 6 | 7 | -------------------------------------------------------------------------------- /lvgl/examples/libs/sjpg/lv_example_sjpg.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_example_sjpg.h 3 | * 4 | */ 5 | 6 | #ifndef LV_EXAMPLE_SJPG_H 7 | #define LV_EXAMPLE_SJPG_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | 17 | /********************* 18 | * DEFINES 19 | *********************/ 20 | 21 | /********************** 22 | * TYPEDEFS 23 | **********************/ 24 | 25 | /********************** 26 | * GLOBAL PROTOTYPES 27 | **********************/ 28 | void lv_example_sjpg_1(void); 29 | 30 | /********************** 31 | * MACROS 32 | **********************/ 33 | 34 | #ifdef __cplusplus 35 | } /*extern "C"*/ 36 | #endif 37 | 38 | #endif /*LV_EXAMPLE_SJPG_H*/ 39 | -------------------------------------------------------------------------------- /lvgl/examples/libs/sjpg/lv_example_sjpg_1.c: -------------------------------------------------------------------------------- 1 | #include "../../lv_examples.h" 2 | #if LV_USE_SJPG && LV_BUILD_EXAMPLES 3 | 4 | /** 5 | * Load an SJPG image 6 | */ 7 | void lv_example_sjpg_1(void) 8 | { 9 | lv_obj_t * wp; 10 | 11 | wp = lv_img_create(lv_scr_act()); 12 | /* Assuming a File system is attached to letter 'A' 13 | * E.g. set LV_USE_FS_STDIO 'A' in lv_conf.h */ 14 | lv_img_set_src(wp, "A:lvgl/examples/libs/sjpg/small_image.sjpg"); 15 | } 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /lvgl/examples/libs/sjpg/lv_example_sjpg_1.py: -------------------------------------------------------------------------------- 1 | #!/opt/bin/lv_micropython -i 2 | import lvgl as lv 3 | import display_driver 4 | import fs_driver 5 | 6 | fs_drv = lv.fs_drv_t() 7 | fs_driver.fs_register(fs_drv, 'S') 8 | 9 | wp = lv.img(lv.scr_act()) 10 | # The File system is attached to letter 'S' 11 | 12 | wp.set_src("S:small_image.sjpg") 13 | wp.center() 14 | -------------------------------------------------------------------------------- /lvgl/examples/libs/sjpg/small_image.sjpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/examples/libs/sjpg/small_image.sjpg -------------------------------------------------------------------------------- /lvgl/examples/others/gridnav/index.rst: -------------------------------------------------------------------------------- 1 | 2 | Basic grid navigation 3 | """"""""""""""""""""" 4 | 5 | .. lv_example:: others/monkey/lv_example_gridnav_1 6 | :language: c 7 | 8 | Grid navigation on a list 9 | """""""""""""""""""""""" 10 | 11 | .. lv_example:: others/monkey/lv_example_gridnav_2 12 | :language: c 13 | 14 | Nested grid navigations 15 | """"""""""""""""""""""" 16 | 17 | .. lv_example:: others/monkey/lv_example_gridanav_3 18 | :language: c 19 | -------------------------------------------------------------------------------- /lvgl/examples/others/gridnav/lv_example_gridnav.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_example_gridnav.h 3 | * 4 | */ 5 | 6 | #ifndef LV_EXAMPLE_GRIDNAV_H 7 | #define LV_EXAMPLE_GRIDNAV_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_gridnav_1(void); 29 | void lv_example_gridnav_2(void); 30 | void lv_example_gridnav_3(void); 31 | 32 | /********************** 33 | * MACROS 34 | **********************/ 35 | 36 | #ifdef __cplusplus 37 | } /*extern "C"*/ 38 | #endif 39 | 40 | #endif /*LV_EXAMPLE_GRIDNAV_H*/ 41 | -------------------------------------------------------------------------------- /lvgl/examples/others/lv_example_others.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_example_others.h 3 | * 4 | */ 5 | 6 | #ifndef LV_EXAMPLE_OTHERS_H 7 | #define LV_EXAMPLE_OTHERS_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "snapshot/lv_example_snapshot.h" 17 | #include "monkey/lv_example_monkey.h" 18 | #include "gridnav/lv_example_gridnav.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_EX_OTHERS_H*/ 41 | -------------------------------------------------------------------------------- /lvgl/examples/others/monkey/index.rst: -------------------------------------------------------------------------------- 1 | 2 | Touchpad monkey example 3 | """"""""""""""""""" 4 | 5 | .. lv_example:: others/monkey/lv_example_monkey_1 6 | :language: c 7 | 8 | Encoder monkey example 9 | """"""""""""""""""" 10 | 11 | .. lv_example:: others/monkey/lv_example_monkey_2 12 | :language: c 13 | 14 | Button monkey example 15 | """"""""""""""""""" 16 | 17 | .. lv_example:: others/monkey/lv_example_monkey_3 18 | :language: c 19 | -------------------------------------------------------------------------------- /lvgl/examples/others/monkey/lv_example_monkey.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_example_monkey.h 3 | * 4 | */ 5 | 6 | #ifndef LV_EXAMPLE_MONKEY_H 7 | #define LV_EXAMPLE_MONKEY_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_monkey_1(void); 29 | void lv_example_monkey_2(void); 30 | void lv_example_monkey_3(void); 31 | 32 | /********************** 33 | * MACROS 34 | **********************/ 35 | 36 | #ifdef __cplusplus 37 | } /*extern "C"*/ 38 | #endif 39 | 40 | #endif /*LV_EXAMPLE_MONKEY_H*/ 41 | -------------------------------------------------------------------------------- /lvgl/examples/others/monkey/lv_example_monkey_1.c: -------------------------------------------------------------------------------- 1 | #include "../../lv_examples.h" 2 | #if LV_USE_MONKEY && LV_BUILD_EXAMPLES 3 | 4 | void lv_example_monkey_1(void) 5 | { 6 | /*Create pointer monkey test*/ 7 | lv_monkey_config_t config; 8 | lv_monkey_config_init(&config); 9 | config.type = LV_INDEV_TYPE_POINTER; 10 | config.period_range.min = 10; 11 | config.period_range.max = 100; 12 | lv_monkey_t * monkey = lv_monkey_create(&config); 13 | 14 | /*Start monkey test*/ 15 | lv_monkey_set_enable(monkey, true); 16 | } 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /lvgl/examples/others/monkey/lv_example_monkey_2.c: -------------------------------------------------------------------------------- 1 | #include "../../lv_examples.h" 2 | #if LV_USE_MONKEY && LV_BUILD_EXAMPLES 3 | 4 | void lv_example_monkey_2(void) 5 | { 6 | /*Create encoder monkey test*/ 7 | lv_monkey_config_t config; 8 | lv_monkey_config_init(&config); 9 | config.type = LV_INDEV_TYPE_ENCODER; 10 | config.period_range.min = 50; 11 | config.period_range.max = 500; 12 | config.input_range.min = -5; 13 | config.input_range.max = 5; 14 | lv_monkey_t * monkey = lv_monkey_create(&config); 15 | 16 | /*Set the default group*/ 17 | lv_group_t * group = lv_group_create(); 18 | lv_indev_set_group(lv_monkey_get_indev(monkey), group); 19 | lv_group_set_default(group); 20 | 21 | /*Start monkey test*/ 22 | lv_monkey_set_enable(monkey, true); 23 | } 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /lvgl/examples/others/snapshot/index.rst: -------------------------------------------------------------------------------- 1 | 2 | Simple snapshot example 3 | """"""""""""""""""" 4 | 5 | .. lv_example:: others/snapshot/lv_example_snapshot_1 6 | :language: c 7 | 8 | 9 | -------------------------------------------------------------------------------- /lvgl/examples/others/snapshot/lv_example_snapshot.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_example_snapshot.h 3 | * 4 | */ 5 | 6 | #ifndef LV_EX_SNAPSHOT_H 7 | #define LV_EX_SNAPSHOT_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | 17 | /********************* 18 | * DEFINES 19 | *********************/ 20 | 21 | /********************** 22 | * TYPEDEFS 23 | **********************/ 24 | 25 | /********************** 26 | * GLOBAL PROTOTYPES 27 | **********************/ 28 | void lv_example_snapshot_1(void); 29 | 30 | /********************** 31 | * MACROS 32 | **********************/ 33 | 34 | #ifdef __cplusplus 35 | } /*extern "C"*/ 36 | #endif 37 | 38 | #endif /*LV_EX_GET_STARTED_H*/ 39 | -------------------------------------------------------------------------------- /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 | void lv_port_disp_init(void); 33 | 34 | /********************** 35 | * MACROS 36 | **********************/ 37 | 38 | #ifdef __cplusplus 39 | } /*extern "C"*/ 40 | #endif 41 | 42 | #endif /*LV_PORT_DISP_TEMPL_H*/ 43 | 44 | #endif /*Disable/Enable content*/ 45 | -------------------------------------------------------------------------------- /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 | void lv_port_fs_init(void); 33 | 34 | /********************** 35 | * MACROS 36 | **********************/ 37 | 38 | #ifdef __cplusplus 39 | } /*extern "C"*/ 40 | #endif 41 | 42 | #endif /*LV_PORT_FS_TEMPL_H*/ 43 | 44 | #endif /*Disable/Enable content*/ 45 | -------------------------------------------------------------------------------- /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 | void lv_port_indev_init(void); 34 | 35 | /********************** 36 | * MACROS 37 | **********************/ 38 | 39 | #ifdef __cplusplus 40 | } /*extern "C"*/ 41 | #endif 42 | 43 | #endif /*LV_PORT_INDEV_TEMPL_H*/ 44 | 45 | #endif /*Disable/Enable content*/ 46 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | static lv_grad_dsc_t grad; 16 | grad.dir = LV_GRAD_DIR_VER; 17 | grad.stops_count = 2; 18 | grad.stops[0].color = lv_palette_lighten(LV_PALETTE_GREY, 1); 19 | grad.stops[1].color = lv_palette_main(LV_PALETTE_BLUE); 20 | 21 | /*Shift the gradient to the bottom*/ 22 | grad.stops[0].frac = 128; 23 | grad.stops[1].frac = 192; 24 | 25 | lv_style_set_bg_grad(&style, &grad); 26 | 27 | /*Create an object with the new style*/ 28 | lv_obj_t * obj = lv_obj_create(lv_scr_act()); 29 | lv_obj_add_style(obj, &style, 0); 30 | lv_obj_center(obj); 31 | } 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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, 55); 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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /lvgl/examples/test_ex.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cat ../../header.py $1 > test.py 3 | chmod +x test.py 4 | ./test.py 5 | -------------------------------------------------------------------------------- /lvgl/examples/widgets/animimg/index.rst: -------------------------------------------------------------------------------- 1 | 2 | Simple Animation Image 3 | """""""""""""""" 4 | 5 | .. lv_example:: widgets/animimg/lv_example_animimg_1 6 | :language: c 7 | :description: A simple example to demonstrate the use of an animation image. 8 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /lvgl/examples/widgets/bar/index.rst: -------------------------------------------------------------------------------- 1 | Simple Bar 2 | """""""""""""""" 3 | 4 | .. lv_example:: widgets/bar/lv_example_bar_1 5 | :language: c 6 | 7 | Styling a bar 8 | """""""""""""""" 9 | 10 | .. lv_example:: widgets/bar/lv_example_bar_2 11 | :language: c 12 | 13 | Temperature meter 14 | """""""""""""""""" 15 | 16 | .. lv_example:: widgets/bar/lv_example_bar_3 17 | :language: c 18 | 19 | Stripe pattern and range value 20 | """""""""""""""""""""""""""""""" 21 | 22 | .. lv_example:: widgets/bar/lv_example_bar_4 23 | :language: c 24 | 25 | Bar with LTR and RTL base direction 26 | """""""""""""""""""""""""""""""""""" 27 | 28 | .. lv_example:: widgets/bar/lv_example_bar_5 29 | :language: c 30 | 31 | Custom drawer to show the current value 32 | """"""""""""""""""""""""""""""""""""""" 33 | 34 | .. lv_example:: widgets/bar/lv_example_bar_6 35 | :language: c 36 | 37 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /lvgl/examples/widgets/chart/lv_example_chart_9.py: -------------------------------------------------------------------------------- 1 | import display_driver 2 | import lvgl as lv 3 | 4 | def add_data(t): 5 | chart.set_next_value(ser, lv.rand(10, 90)) 6 | 7 | p = chart.get_point_count() 8 | s = chart.get_x_start_point(ser) 9 | a = chart.get_y_array(ser) 10 | 11 | a[(s + 1) % p] = lv.CHART_POINT.NONE 12 | a[(s + 2) % p] = lv.CHART_POINT.NONE 13 | a[(s + 3) % p] = lv.CHART_POINT.NONE 14 | chart.refresh() 15 | 16 | # 17 | # Circular line chart with gap 18 | # 19 | chart = lv.chart(lv.scr_act()) 20 | 21 | chart.set_update_mode(lv.chart.UPDATE_MODE.CIRCULAR) 22 | chart.set_size(200, 150) 23 | chart.center() 24 | 25 | chart.set_point_count(30) 26 | ser = chart.add_series(lv.palette_main(lv.PALETTE.RED), lv.chart.AXIS.PRIMARY_Y) 27 | #Prefill with data 28 | for i in range(0, 30): 29 | chart.set_next_value(ser, lv.rand(10, 90)) 30 | 31 | lv.timer_create(add_data, 200, None) 32 | -------------------------------------------------------------------------------- /lvgl/examples/widgets/checkbox/index.rst: -------------------------------------------------------------------------------- 1 | 2 | Simple Checkboxes 3 | """"""""""""""""" 4 | 5 | .. lv_example:: widgets/checkbox/lv_example_checkbox_1 6 | :language: c 7 | 8 | Checkboxes as radio buttons 9 | """"""""""""""""""""""""""" 10 | .. lv_example:: widgets/checkbox/lv_example_checkbox_2 11 | :language: c 12 | 13 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /lvgl/examples/widgets/dropdown/lv_example_dropdown_1.py: -------------------------------------------------------------------------------- 1 | def event_handler(e): 2 | code = e.get_code() 3 | obj = e.get_target() 4 | if code == lv.EVENT.VALUE_CHANGED: 5 | option = " "*10 # should be large enough to store the option 6 | obj.get_selected_str(option, len(option)) 7 | # .strip() removes trailing spaces 8 | print("Option: \"%s\"" % option.strip()) 9 | 10 | # Create a normal drop down list 11 | dd = lv.dropdown(lv.scr_act()) 12 | dd.set_options("\n".join([ 13 | "Apple", 14 | "Banana", 15 | "Orange", 16 | "Cherry", 17 | "Grape", 18 | "Raspberry", 19 | "Melon", 20 | "Orange", 21 | "Lemon", 22 | "Nuts"])) 23 | 24 | dd.align(lv.ALIGN.TOP_MID, 0, 20) 25 | dd.add_event_cb(event_handler, lv.EVENT.ALL, None) 26 | 27 | -------------------------------------------------------------------------------- /lvgl/examples/widgets/dropdown/lv_example_dropdown_2.py: -------------------------------------------------------------------------------- 1 | # 2 | # Create a drop down, up, left and right menus 3 | # 4 | 5 | opts = "\n".join([ 6 | "Apple", 7 | "Banana", 8 | "Orange", 9 | "Melon", 10 | "Grape", 11 | "Raspberry"]) 12 | 13 | dd = lv.dropdown(lv.scr_act()) 14 | dd.set_options_static(opts) 15 | dd.align(lv.ALIGN.TOP_MID, 0, 10) 16 | dd = lv.dropdown(lv.scr_act()) 17 | dd.set_options_static(opts) 18 | dd.set_dir(lv.DIR.BOTTOM) 19 | dd.set_symbol(lv.SYMBOL.UP) 20 | dd.align(lv.ALIGN.BOTTOM_MID, 0, -10) 21 | 22 | dd = lv.dropdown(lv.scr_act()) 23 | dd.set_options_static(opts) 24 | dd.set_dir(lv.DIR.RIGHT) 25 | dd.set_symbol(lv.SYMBOL.RIGHT) 26 | dd.align(lv.ALIGN.LEFT_MID, 10, 0) 27 | 28 | dd = lv.dropdown(lv.scr_act()) 29 | dd.set_options_static(opts) 30 | dd.set_dir(lv.DIR.LEFT) 31 | dd.set_symbol(lv.SYMBOL.LEFT) 32 | dd.align(lv.ALIGN.RIGHT_MID, -10, 0) 33 | 34 | 35 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 one 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 | -------------------------------------------------------------------------------- /lvgl/examples/widgets/label/index.rst: -------------------------------------------------------------------------------- 1 | 2 | Line wrap, recoloring and scrolling 3 | """"""""""""""""""""""""""""""""""" 4 | 5 | .. lv_example:: widgets/label/lv_example_label_1 6 | :language: c 7 | 8 | Text shadow 9 | """""""""""" 10 | 11 | .. lv_example:: widgets/label/lv_example_label_2 12 | :language: c 13 | 14 | Show LTR, RTL and Chinese texts 15 | """""""""""""""""""""""""""""""""""" 16 | 17 | .. lv_example:: widgets/label/lv_example_label_3 18 | :language: c 19 | 20 | Draw label with gradient color 21 | """""""""""""""""""""""""""""""""""" 22 | 23 | .. lv_example:: widgets/label/lv_example_label_4 24 | :language: c 25 | 26 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /lvgl/examples/widgets/list/index.rst: -------------------------------------------------------------------------------- 1 | 2 | Simple List 3 | """""""""""""""" 4 | 5 | .. lv_example:: widgets/list/lv_example_list_1 6 | :language: c 7 | 8 | 9 | Sorting a List using up and down buttons 10 | """""""""""""""" 11 | 12 | .. lv_example:: widgets/list/lv_example_list_2 13 | :language: c 14 | -------------------------------------------------------------------------------- /lvgl/examples/widgets/menu/index.rst: -------------------------------------------------------------------------------- 1 | 2 | Simple Menu 3 | """""""""""""""" 4 | 5 | .. lv_example:: widgets/menu/lv_example_menu_1 6 | :language: c 7 | 8 | Simple Menu with root btn 9 | """""""""""""""""""""""""""" 10 | 11 | .. lv_example:: widgets/menu/lv_example_menu_2 12 | :language: c 13 | 14 | Simple Menu with custom header 15 | """""""""""""""""""""""""""" 16 | 17 | .. lv_example:: widgets/menu/lv_example_menu_3 18 | :language: c 19 | 20 | Simple Menu with floating btn to add new menu page 21 | """""""""""""""""""""""""""" 22 | 23 | .. lv_example:: widgets/menu/lv_example_menu_4 24 | :language: c 25 | 26 | Complex Menu 27 | """""""""""""""""""""""""""" 28 | 29 | .. lv_example:: widgets/menu/lv_example_menu_5 30 | :language: c 31 | 32 | -------------------------------------------------------------------------------- /lvgl/examples/widgets/menu/lv_example_menu_1.py: -------------------------------------------------------------------------------- 1 | # Create a menu object 2 | menu = lv.menu(lv.scr_act()) 3 | menu.set_size(320, 240) 4 | menu.center() 5 | 6 | # Create a sub page 7 | sub_page = lv.menu_page(menu, None) 8 | cont = lv.menu_cont(sub_page) 9 | label = lv.label(cont) 10 | label.set_text("Hello, I am hiding here") 11 | 12 | # Create a main page 13 | main_page = lv.menu_page(menu, None) 14 | 15 | cont = lv.menu_cont(main_page) 16 | label = lv.label(cont) 17 | label.set_text("Item 1") 18 | 19 | cont = lv.menu_cont(main_page) 20 | label = lv.label(cont) 21 | label.set_text("Item 2") 22 | 23 | cont = lv.menu_cont(main_page) 24 | label = lv.label(cont) 25 | label.set_text("Item 3 (Click me!)") 26 | menu.set_load_page_event(cont, sub_page) 27 | 28 | menu.set_page(main_page) -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | if(indev == NULL) return; 10 | 11 | lv_point_t vect; 12 | lv_indev_get_vect(indev, &vect); 13 | 14 | lv_coord_t x = lv_obj_get_x(obj) + vect.x; 15 | lv_coord_t y = lv_obj_get_y(obj) + vect.y; 16 | lv_obj_set_pos(obj, x, y); 17 | } 18 | 19 | 20 | /** 21 | * Make an object dragable. 22 | */ 23 | void lv_example_obj_2(void) 24 | { 25 | lv_obj_t * obj; 26 | obj = lv_obj_create(lv_scr_act()); 27 | lv_obj_set_size(obj, 150, 100); 28 | lv_obj_add_event_cb(obj, drag_event_handler, LV_EVENT_PRESSING, NULL); 29 | 30 | lv_obj_t * label = lv_label_create(obj); 31 | lv_label_set_text(label, "Drag me"); 32 | lv_obj_center(label); 33 | 34 | } 35 | #endif 36 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | 8 | win = lv.win(lv.scr_act(), 60) 9 | btn1 = win.add_btn(lv.SYMBOL.LEFT, 40) 10 | btn1.add_event_cb(event_handler, lv.EVENT.ALL, None) 11 | win.add_title("A title") 12 | btn2=win.add_btn(lv.SYMBOL.RIGHT, 40) 13 | btn2.add_event_cb(event_handler, lv.EVENT.ALL, None) 14 | btn3 = win.add_btn(lv.SYMBOL.CLOSE, 60) 15 | btn3.add_event_cb(event_handler, lv.EVENT.ALL, None) 16 | 17 | cont = win.get_content() # Content can be added here 18 | label = lv.label(cont) 19 | label.set_text("""This is 20 | a pretty 21 | long text 22 | to see how 23 | the window 24 | becomes 25 | scrollable. 26 | 27 | 28 | We need 29 | quite some text 30 | and we will 31 | even put 32 | some more 33 | text to be 34 | sure it 35 | overflows. 36 | """) 37 | -------------------------------------------------------------------------------- /lvgl/idf_component.yml: -------------------------------------------------------------------------------- 1 | description: LVGL - Light and Versatile Graphics Library 2 | url: https://github.com/lvgl/lvgl -------------------------------------------------------------------------------- /lvgl/library.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "lvgl", 3 | "version": "8.2.0", 4 | "keywords": "graphics, gui, embedded, tft, lvgl", 5 | "description": "Graphics library to create embedded GUI with easy-to-use graphical elements, beautiful visual effects and low memory footprint. It offers anti-aliasing, opacity, and animations using only one frame buffer.", 6 | "repository": { 7 | "type": "git", 8 | "url": "https://github.com/lvgl/lvgl.git" 9 | }, 10 | "build": { 11 | "includeDir": "." 12 | }, 13 | "license": "MIT", 14 | "homepage": "https://lvgl.io", 15 | "frameworks": "*", 16 | "platforms": "*" 17 | } 18 | -------------------------------------------------------------------------------- /lvgl/library.properties: -------------------------------------------------------------------------------- 1 | name=lvgl 2 | version=8.2.0 3 | author=kisvegabor 4 | maintainer=kisvegabor,embeddedt,pete-pjb 5 | sentence=Full-featured Graphics Library for Embedded Systems 6 | paragraph=Powerful and easy-to-use embedded GUI with many widgets, advanced visual effects (opacity, antialiasing, animations) and low memory requirements (16K RAM, 64K Flash). 7 | category=Display 8 | url=https://lvgl.io 9 | architectures=* 10 | includes=lvgl.h 11 | -------------------------------------------------------------------------------- /lvgl/lvgl.mk: -------------------------------------------------------------------------------- 1 | include $(LVGL_DIR)/$(LVGL_DIR_NAME)/demos/lv_demos.mk 2 | include $(LVGL_DIR)/$(LVGL_DIR_NAME)/examples/examples.mk 3 | include $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/extra/extra.mk 4 | include $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/core/lv_core.mk 5 | include $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/draw/lv_draw.mk 6 | include $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/draw/sw/lv_draw_sw.mk 7 | include $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/font/lv_font.mk 8 | include $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/hal/lv_hal.mk 9 | include $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/misc/lv_misc.mk 10 | include $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/widgets/lv_widgets.mk 11 | -------------------------------------------------------------------------------- /lvgl/scripts/.gitignore: -------------------------------------------------------------------------------- 1 | CHANGELOG_LAST.md 2 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /lvgl/scripts/built_in_font/DejaVuSans.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/scripts/built_in_font/DejaVuSans.ttf -------------------------------------------------------------------------------- /lvgl/scripts/built_in_font/FontAwesome5-Solid+Brands+Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/scripts/built_in_font/FontAwesome5-Solid+Brands+Regular.woff -------------------------------------------------------------------------------- /lvgl/scripts/built_in_font/Montserrat-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/scripts/built_in_font/Montserrat-Medium.ttf -------------------------------------------------------------------------------- /lvgl/scripts/built_in_font/SimSun.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/scripts/built_in_font/SimSun.woff -------------------------------------------------------------------------------- /lvgl/scripts/built_in_font/unscii-8.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/scripts/built_in_font/unscii-8.ttf -------------------------------------------------------------------------------- /lvgl/scripts/changelog_gen.sh: -------------------------------------------------------------------------------- 1 | # Generate CHANGELOG_LAST.md from changes since the last version tag. (vx.y.z-dev tags are ignored) 2 | # CHANGELOG_LAST.md can be edited manually if required and manually added to docs/CHANGELOG.md 3 | # 4 | # Requirements: 5 | # npm install -g auto-changelog 6 | # 7 | # Usage: 8 | # changelog-gen 9 | # 10 | # Example: if the latest verision is v5.6.7 the followings can be used for bugfix, minor or major versions: 11 | # changelog-gen v5.6.8 12 | # changelog-gen v5.7.0 13 | # changelog-gen v6.0.0 14 | 15 | auto-changelog -t changelog-template.hbs -l false --latest-version $1 --unreleased-only --tag-pattern ^v[0-9]+.[0-9]+.[0-9]+$ -o CHANGELOG_LAST.md 16 | -------------------------------------------------------------------------------- /lvgl/scripts/code-format.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import os 4 | 5 | os.system('astyle --options=code-format.cfg "../src/*.c,*.h"') 6 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /lvgl/scripts/filetohex.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | import sys 3 | 4 | with open(sys.argv[1], 'r') as file: 5 | s = file.read() 6 | 7 | b = bytearray() 8 | b.extend(map(ord, s)) 9 | 10 | for a in b: print(hex(a), end =", ") 11 | 12 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /lvgl/scripts/genexamplelist.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo "/* Autogenerated */" 3 | echo '#include ' 4 | echo '#include "examplelist.h"' 5 | TMPFILE=$(mktemp) 6 | find examples demos -name \*.h | xargs grep -hE "^void lv_(example|demo)" | 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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /lvgl/scripts/install-prerequisites.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/sh 2 | 3 | # Install Linux package prerequisites needed for LVGL development 4 | # and testing. Some less-common development packages are not included 5 | # here, such as MicroPython and PC simulator packages. 6 | # 7 | # Note: This script is run by the CI workflows. 8 | sudo apt update 9 | sudo apt install gcc python3 libpng-dev ruby-full gcovr cmake 10 | -------------------------------------------------------------------------------- /lvgl/scripts/release/commits.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/scripts/release/commits.txt -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /lvgl/src/draw/lv_draw.mk: -------------------------------------------------------------------------------- 1 | CSRCS += lv_draw_arc.c 2 | CSRCS += lv_draw.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 | 18 | include $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/draw/sdl/lv_draw_sdl.mk 19 | -------------------------------------------------------------------------------- /lvgl/src/draw/sdl/lv_draw_sdl.mk: -------------------------------------------------------------------------------- 1 | CSRCS += lv_draw_sdl.c 2 | CSRCS += lv_draw_sdl_arc.c 3 | CSRCS += lv_draw_sdl_bg.c 4 | CSRCS += lv_draw_sdl_composite.c 5 | CSRCS += lv_draw_sdl_img.c 6 | CSRCS += lv_draw_sdl_label.c 7 | CSRCS += lv_draw_sdl_line.c 8 | CSRCS += lv_draw_sdl_mask.c 9 | CSRCS += lv_draw_sdl_polygon.c 10 | CSRCS += lv_draw_sdl_rect.c 11 | CSRCS += lv_draw_sdl_stack_blur.c 12 | CSRCS += lv_draw_sdl_texture_cache.c 13 | CSRCS += lv_draw_sdl_utils.c 14 | 15 | DEPPATH += --dep-path $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/draw/sdl 16 | VPATH += :$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/draw/sdl 17 | 18 | CFLAGS += "-I$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/draw/sdl" 19 | -------------------------------------------------------------------------------- /lvgl/src/draw/sdl/lv_draw_sdl_stack_blur.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_draw_sdl_stack_blur.h 3 | * 4 | */ 5 | #ifndef LV_DRAW_SDL_STACK_BLUR_H 6 | #define LV_DRAW_SDL_STACK_BLUR_H 7 | 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | /********************* 13 | * INCLUDES 14 | *********************/ 15 | 16 | #include "../../lv_conf_internal.h" 17 | 18 | #if LV_USE_GPU_SDL 19 | 20 | #include "../../misc/lv_color.h" 21 | 22 | /********************* 23 | * DEFINES 24 | *********************/ 25 | 26 | /********************** 27 | * TYPEDEFS 28 | **********************/ 29 | 30 | /********************** 31 | * GLOBAL PROTOTYPES 32 | **********************/ 33 | 34 | void lv_stack_blur_grayscale(lv_opa_t * buf, uint16_t w, uint16_t h, uint16_t r); 35 | 36 | /********************** 37 | * MACROS 38 | **********************/ 39 | 40 | #endif /*LV_USE_GPU_SDL*/ 41 | 42 | #ifdef __cplusplus 43 | } /*extern "C"*/ 44 | #endif 45 | 46 | #endif /*LV_DRAW_SDL_STACK_BLUR_H*/ 47 | -------------------------------------------------------------------------------- /lvgl/src/draw/sw/lv_draw_sw.mk: -------------------------------------------------------------------------------- 1 | CSRCS += lv_draw_sw.c 2 | CSRCS += lv_draw_sw_arc.c 3 | CSRCS += lv_draw_sw_blend.c 4 | CSRCS += lv_draw_sw_img.c 5 | CSRCS += lv_draw_sw_letter.c 6 | CSRCS += lv_draw_sw_line.c 7 | CSRCS += lv_draw_sw_rect.c 8 | CSRCS += lv_draw_sw_polygon.c 9 | CSRCS += lv_draw_sw_gradient.c 10 | CSRCS += lv_draw_sw_dither.c 11 | 12 | DEPPATH += --dep-path $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/draw/sw 13 | VPATH += :$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/draw/sw 14 | 15 | CFLAGS += "-I$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/draw/sw" 16 | -------------------------------------------------------------------------------- /lvgl/src/extra/extra.mk: -------------------------------------------------------------------------------- 1 | CSRCS += $(shell find -L $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/extra -name \*.c) 2 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /lvgl/src/extra/libs/bmp/lv_bmp.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_bmp.h 3 | * 4 | */ 5 | 6 | #ifndef LV_BMP_H 7 | #define LV_BMP_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "../../../lv_conf_internal.h" 17 | #if LV_USE_BMP 18 | 19 | /********************* 20 | * DEFINES 21 | *********************/ 22 | 23 | /********************** 24 | * TYPEDEFS 25 | **********************/ 26 | 27 | /********************** 28 | * GLOBAL PROTOTYPES 29 | **********************/ 30 | void lv_bmp_init(void); 31 | 32 | /********************** 33 | * MACROS 34 | **********************/ 35 | 36 | #endif /*LV_USE_BMP*/ 37 | 38 | #ifdef __cplusplus 39 | } /* extern "C" */ 40 | #endif 41 | 42 | #endif /*LV_BMP_H*/ 43 | -------------------------------------------------------------------------------- /lvgl/src/extra/libs/freetype/arial.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/src/extra/libs/freetype/arial.ttf -------------------------------------------------------------------------------- /lvgl/src/extra/libs/lv_libs.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_libs.h 3 | * 4 | */ 5 | 6 | #ifndef LV_LIBS_H 7 | #define LV_LIBS_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "bmp/lv_bmp.h" 17 | #include "fsdrv/lv_fsdrv.h" 18 | #include "png/lv_png.h" 19 | #include "gif/lv_gif.h" 20 | #include "qrcode/lv_qrcode.h" 21 | #include "sjpg/lv_sjpg.h" 22 | #include "freetype/lv_freetype.h" 23 | #include "rlottie/lv_rlottie.h" 24 | #include "ffmpeg/lv_ffmpeg.h" 25 | 26 | /********************* 27 | * DEFINES 28 | *********************/ 29 | 30 | /********************** 31 | * TYPEDEFS 32 | **********************/ 33 | 34 | /********************** 35 | * GLOBAL PROTOTYPES 36 | **********************/ 37 | 38 | /********************** 39 | * MACROS 40 | **********************/ 41 | 42 | #ifdef __cplusplus 43 | } /*extern "C"*/ 44 | #endif 45 | 46 | #endif /*LV_LIBS_H*/ 47 | -------------------------------------------------------------------------------- /lvgl/src/extra/libs/png/lv_png.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_png.h 3 | * 4 | */ 5 | 6 | #ifndef LV_PNG_H 7 | #define LV_PNG_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "../../../lv_conf_internal.h" 17 | #if LV_USE_PNG 18 | 19 | /********************* 20 | * DEFINES 21 | *********************/ 22 | 23 | /********************** 24 | * TYPEDEFS 25 | **********************/ 26 | 27 | /********************** 28 | * GLOBAL PROTOTYPES 29 | **********************/ 30 | 31 | /** 32 | * Register the PNG decoder functions in LVGL 33 | */ 34 | void lv_png_init(void); 35 | 36 | /********************** 37 | * MACROS 38 | **********************/ 39 | 40 | #endif /*LV_USE_PNG*/ 41 | 42 | #ifdef __cplusplus 43 | } /* extern "C" */ 44 | #endif 45 | 46 | #endif /*LV_PNG_H*/ 47 | -------------------------------------------------------------------------------- /lvgl/src/extra/libs/sjpg/lv_sjpg.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_sjpg.h 3 | * 4 | */ 5 | 6 | #ifndef LV_SJPEG_H 7 | #define LV_SJPEG_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | 17 | #if LV_USE_SJPG 18 | 19 | /********************* 20 | * DEFINES 21 | *********************/ 22 | 23 | /********************** 24 | * TYPEDEFS 25 | **********************/ 26 | 27 | /********************** 28 | * GLOBAL PROTOTYPES 29 | **********************/ 30 | 31 | void lv_split_jpeg_init(void); 32 | 33 | /********************** 34 | * MACROS 35 | **********************/ 36 | 37 | #endif /*LV_USE_SJPG*/ 38 | 39 | #ifdef __cplusplus 40 | } 41 | #endif 42 | 43 | #endif /* LV_SJPEG_H */ 44 | -------------------------------------------------------------------------------- /lvgl/src/extra/libs/sjpg/tjpgdcnf.h: -------------------------------------------------------------------------------- 1 | /*----------------------------------------------*/ 2 | /* TJpgDec System Configurations R0.03 */ 3 | /*----------------------------------------------*/ 4 | 5 | #define JD_SZBUF 512 6 | /* Specifies size of stream input buffer */ 7 | 8 | #define JD_FORMAT 0 9 | /* Specifies output pixel format. 10 | / 0: RGB888 (24-bit/pix) 11 | / 1: RGB565 (16-bit/pix) 12 | / 2: Grayscale (8-bit/pix) 13 | */ 14 | 15 | #define JD_USE_SCALE 1 16 | /* Switches output descaling feature. 17 | / 0: Disable 18 | / 1: Enable 19 | */ 20 | 21 | #define JD_TBLCLIP 1 22 | /* Use table conversion for saturation arithmetic. A bit faster, but increases 1 KB of code size. 23 | / 0: Disable 24 | / 1: Enable 25 | */ 26 | 27 | #define JD_FASTDECODE 0 28 | /* Optimization level 29 | / 0: Basic optimization. Suitable for 8/16-bit MCUs. 30 | / 1: + 32-bit barrel shifter. Suitable for 32-bit MCUs. 31 | / 2: + Table conversion for huffman decoding (wants 6 << HUFF_BIT bytes of RAM) 32 | */ 33 | 34 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /lvgl/src/extra/others/lv_others.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_others.h 3 | * 4 | */ 5 | 6 | #ifndef LV_OTHERS_H 7 | #define LV_OTHERS_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "snapshot/lv_snapshot.h" 17 | #include "monkey/lv_monkey.h" 18 | #include "gridnav/lv_gridnav.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_OTHERS_H*/ 41 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /lvgl/src/font/korean.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/src/font/korean.ttf -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | 11 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /lvgl/src/misc/lv_misc.mk: -------------------------------------------------------------------------------- 1 | CSRCS += lv_anim.c 2 | CSRCS += lv_anim_timeline.c 3 | CSRCS += lv_area.c 4 | CSRCS += lv_async.c 5 | CSRCS += lv_bidi.c 6 | CSRCS += lv_color.c 7 | CSRCS += lv_fs.c 8 | CSRCS += lv_gc.c 9 | CSRCS += lv_ll.c 10 | CSRCS += lv_log.c 11 | CSRCS += lv_lru.c 12 | CSRCS += lv_math.c 13 | CSRCS += lv_mem.c 14 | CSRCS += lv_printf.c 15 | CSRCS += lv_style.c 16 | CSRCS += lv_style_gen.c 17 | CSRCS += lv_timer.c 18 | CSRCS += lv_tlsf.c 19 | CSRCS += lv_txt.c 20 | CSRCS += lv_txt_ap.c 21 | CSRCS += lv_utils.c 22 | 23 | DEPPATH += --dep-path $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/misc 24 | VPATH += :$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/misc 25 | 26 | CFLAGS += "-I$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/misc" 27 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /lvgl/tests/.gitignore: -------------------------------------------------------------------------------- 1 | *.out 2 | *_Runner.c 3 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /lvgl/tests/ref_imgs/dropdown_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/tests/ref_imgs/dropdown_1.png -------------------------------------------------------------------------------- /lvgl/tests/ref_imgs/dropdown_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/tests/ref_imgs/dropdown_2.png -------------------------------------------------------------------------------- /lvgl/tests/ref_imgs/scr1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/tests/ref_imgs/scr1.png -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /lvgl/tests/src/lv_test_helpers.h: -------------------------------------------------------------------------------- 1 | #ifndef LV_TEST_HELPERS_H 2 | #define LV_TEST_HELPERS_H 3 | 4 | #ifdef LVGL_CI_USING_SYS_HEAP 5 | /* Skip checking heap as we don't have the info available */ 6 | #define LV_HEAP_CHECK(x) do {} while(0) 7 | /* Pick a non-zero value */ 8 | #define lv_test_get_free_mem() (65536) 9 | #else 10 | #define LV_HEAP_CHECK(x) x 11 | 12 | static inline uint32_t lv_test_get_free_mem(void) 13 | { 14 | lv_mem_monitor_t m1; 15 | lv_mem_monitor(&m1); 16 | return m1.free_size; 17 | } 18 | #endif /* LVGL_CI_USING_SYS_HEAP */ 19 | 20 | 21 | #endif /*LV_TEST_HELPERS_H*/ 22 | 23 | 24 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /lvgl/tests/src/test_cases/_test_template.c: -------------------------------------------------------------------------------- 1 | #if LV_BUILD_TEST 2 | #include "../lvgl.h" 3 | 4 | #include "unity/unity.h" 5 | 6 | void setUp(void) 7 | { 8 | /* Function run before every test */ 9 | } 10 | 11 | void tearDown(void) 12 | { 13 | /* Function run after every test */ 14 | } 15 | 16 | void test_func_1(void) 17 | { 18 | TEST_FAIL(); 19 | } 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /lvgl/tests/src/test_cases/test_demo_stress.c: -------------------------------------------------------------------------------- 1 | #if LV_BUILD_TEST 2 | #include "../lvgl.h" 3 | #include "../demos/lv_demos.h" 4 | 5 | #include "unity/unity.h" 6 | 7 | #include "lv_test_helpers.h" 8 | #include "lv_test_indev.h" 9 | 10 | static void loop_through_stress_test(void) 11 | { 12 | #if LV_USE_DEMO_STRESS 13 | lv_test_indev_wait(LV_DEMO_STRESS_TIME_STEP*33); /* FIXME: remove magic number of states */ 14 | #endif 15 | } 16 | void test_demo_stress(void) 17 | { 18 | #if LV_USE_DEMO_STRESS 19 | lv_demo_stress(); 20 | #endif 21 | /* loop once to allow objects to be created */ 22 | loop_through_stress_test(); 23 | uint32_t mem_before = lv_test_get_free_mem(); 24 | /* loop 10 more times */ 25 | for(uint32_t i = 0; i < 10; i++) { 26 | loop_through_stress_test(); 27 | } 28 | TEST_ASSERT_EQUAL(mem_before, lv_test_get_free_mem()); 29 | } 30 | 31 | #endif 32 | 33 | -------------------------------------------------------------------------------- /lvgl/tests/src/test_cases/test_demo_widgets.c: -------------------------------------------------------------------------------- 1 | #if LV_BUILD_TEST 2 | #include "../lvgl.h" 3 | #include "../demos/lv_demos.h" 4 | 5 | #include "unity/unity.h" 6 | 7 | #include "lv_test_helpers.h" 8 | #include "lv_test_indev.h" 9 | 10 | void test_demo_widgets(void) 11 | { 12 | #if LV_USE_DEMO_WIDGETS 13 | lv_demo_widgets(); 14 | #endif 15 | } 16 | 17 | #endif 18 | 19 | -------------------------------------------------------------------------------- /lvgl/tests/src/test_cases/test_event.c: -------------------------------------------------------------------------------- 1 | #if LV_BUILD_TEST 2 | #include "../lvgl.h" 3 | 4 | #include "unity/unity.h" 5 | 6 | static void event_object_deletion_cb(const lv_obj_class_t *cls, lv_event_t *e) 7 | { 8 | LV_UNUSED(cls); 9 | if(lv_event_get_code(e) == LV_EVENT_VALUE_CHANGED) { 10 | lv_obj_del(lv_event_get_current_target(e)); 11 | } 12 | } 13 | 14 | static const lv_obj_class_t event_object_deletion_class = { 15 | .event_cb = event_object_deletion_cb, 16 | .base_class = &lv_obj_class 17 | }; 18 | 19 | 20 | /* Checks for memory leaks/invalid memory accesses on deleted objects */ 21 | void test_event_object_deletion(void) 22 | { 23 | lv_obj_t * obj = lv_obj_class_create_obj(&event_object_deletion_class, lv_scr_act()); 24 | lv_event_send(obj, LV_EVENT_VALUE_CHANGED, NULL); 25 | } 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /lvgl/tests/src/test_fonts/font_1.fnt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/tests/src/test_fonts/font_1.fnt -------------------------------------------------------------------------------- /lvgl/tests/src/test_fonts/font_2.fnt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/tests/src/test_fonts/font_2.fnt -------------------------------------------------------------------------------- /lvgl/tests/src/test_fonts/font_3.fnt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaron201912/lvgl_gfx/4e19febde40bce0748b65ad116bcbee36f9086d2/lvgl/tests/src/test_fonts/font_3.fnt -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /squareline_proj/squareline_proj.mk: -------------------------------------------------------------------------------- 1 | CSRCS += $(shell find -L $(LVGL_DIR)/squareline_proj -name "*.c") 2 | --------------------------------------------------------------------------------