From dd27c3530432ea0b09f01e604bf577f31d8ef841 Mon Sep 17 00:00:00 2001 From: jacqueline Date: Thu, 1 Jun 2023 15:41:47 +1000 Subject: convert lvgl from submodule to a plain old directory --- lib/lvgl | 1 - lib/lvgl/examples/libs/bmp/example_16bit.bmp | Bin 0 -> 20138 bytes lib/lvgl/examples/libs/bmp/example_24bit.bmp | Bin 0 -> 30122 bytes lib/lvgl/examples/libs/bmp/example_32bit.bmp | Bin 0 -> 40138 bytes lib/lvgl/examples/libs/bmp/index.rst | 6 ++++ lib/lvgl/examples/libs/bmp/lv_example_bmp.h | 38 +++++++++++++++++++++++++ lib/lvgl/examples/libs/bmp/lv_example_bmp_1.c | 21 ++++++++++++++ lib/lvgl/examples/libs/bmp/lv_example_bmp_1.py | 13 +++++++++ 8 files changed, 78 insertions(+), 1 deletion(-) delete mode 160000 lib/lvgl create mode 100644 lib/lvgl/examples/libs/bmp/example_16bit.bmp create mode 100644 lib/lvgl/examples/libs/bmp/example_24bit.bmp create mode 100644 lib/lvgl/examples/libs/bmp/example_32bit.bmp create mode 100644 lib/lvgl/examples/libs/bmp/index.rst create mode 100644 lib/lvgl/examples/libs/bmp/lv_example_bmp.h create mode 100644 lib/lvgl/examples/libs/bmp/lv_example_bmp_1.c create mode 100755 lib/lvgl/examples/libs/bmp/lv_example_bmp_1.py (limited to 'lib/lvgl/examples/libs/bmp') diff --git a/lib/lvgl b/lib/lvgl deleted file mode 160000 index 0732400e..00000000 --- a/lib/lvgl +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 0732400e7b564dd0e7dc4a924619d8e19c5b23a0 diff --git a/lib/lvgl/examples/libs/bmp/example_16bit.bmp b/lib/lvgl/examples/libs/bmp/example_16bit.bmp new file mode 100644 index 00000000..21ee5ca9 Binary files /dev/null and b/lib/lvgl/examples/libs/bmp/example_16bit.bmp differ diff --git a/lib/lvgl/examples/libs/bmp/example_24bit.bmp b/lib/lvgl/examples/libs/bmp/example_24bit.bmp new file mode 100644 index 00000000..8f6f4fd6 Binary files /dev/null and b/lib/lvgl/examples/libs/bmp/example_24bit.bmp differ diff --git a/lib/lvgl/examples/libs/bmp/example_32bit.bmp b/lib/lvgl/examples/libs/bmp/example_32bit.bmp new file mode 100644 index 00000000..2c9435ec Binary files /dev/null and b/lib/lvgl/examples/libs/bmp/example_32bit.bmp differ diff --git a/lib/lvgl/examples/libs/bmp/index.rst b/lib/lvgl/examples/libs/bmp/index.rst new file mode 100644 index 00000000..d8f2a81d --- /dev/null +++ b/lib/lvgl/examples/libs/bmp/index.rst @@ -0,0 +1,6 @@ +Open a BMP image from file +""""""""""""""""""""""""""""""""""""""""""""""" + +.. lv_example:: libs/bmp/lv_example_bmp_1 + :language: c + diff --git a/lib/lvgl/examples/libs/bmp/lv_example_bmp.h b/lib/lvgl/examples/libs/bmp/lv_example_bmp.h new file mode 100644 index 00000000..6a4bf4ba --- /dev/null +++ b/lib/lvgl/examples/libs/bmp/lv_example_bmp.h @@ -0,0 +1,38 @@ +/** + * @file lv_example_bmp.h + * + */ + +#ifndef LV_EXAMPLE_BMP_H +#define LV_EXAMPLE_BMP_H + +#ifdef __cplusplus +extern "C" { +#endif + +/********************* + * INCLUDES + *********************/ + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * GLOBAL PROTOTYPES + **********************/ +void lv_example_bmp_1(void); + +/********************** + * MACROS + **********************/ + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif /*LV_EXAMPLE_BMP_H*/ diff --git a/lib/lvgl/examples/libs/bmp/lv_example_bmp_1.c b/lib/lvgl/examples/libs/bmp/lv_example_bmp_1.c new file mode 100644 index 00000000..233c5e0e --- /dev/null +++ b/lib/lvgl/examples/libs/bmp/lv_example_bmp_1.c @@ -0,0 +1,21 @@ +#include "../../lv_examples.h" +#if LV_USE_BMP && LV_BUILD_EXAMPLES + +/** + * Open a BMP file from a file + */ +void lv_example_bmp_1(void) +{ + lv_obj_t * img = lv_img_create(lv_scr_act()); + /* Assuming a File system is attached to letter 'A' + * E.g. set LV_USE_FS_STDIO 'A' in lv_conf.h */ +#if LV_COLOR_DEPTH == 32 + lv_img_set_src(img, "A:lvgl/examples/libs/bmp/example_32bit.bmp"); +#elif LV_COLOR_DEPTH == 16 + lv_img_set_src(img, "A:lvgl/examples/libs/bmp/example_16bit.bmp"); +#endif + lv_obj_center(img); + +} + +#endif diff --git a/lib/lvgl/examples/libs/bmp/lv_example_bmp_1.py b/lib/lvgl/examples/libs/bmp/lv_example_bmp_1.py new file mode 100755 index 00000000..a7e741df --- /dev/null +++ b/lib/lvgl/examples/libs/bmp/lv_example_bmp_1.py @@ -0,0 +1,13 @@ +#!/opt/bin/lv_micropython -i +import lvgl as lv +import display_driver +import fs_driver + +fs_drv = lv.fs_drv_t() +fs_driver.fs_register(fs_drv, 'S') + +img = lv.img(lv.scr_act()) +# The File system is attached to letter 'S' + +img.set_src("S:example_32bit.bmp") +img.center() -- cgit v1.2.3