diff options
| author | jacqueline <me@jacqueline.id.au> | 2023-06-01 15:41:47 +1000 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2023-06-01 15:41:47 +1000 |
| commit | dd27c3530432ea0b09f01e604bf577f31d8ef841 (patch) | |
| tree | bbf86cf81a78f0ff0b07f31f1c390db473f26fd3 /lib/lvgl/examples/libs/bmp | |
| parent | 6fd588e970470b15936187980829916d0dbe77bb (diff) | |
| download | tangara-fw-dd27c3530432ea0b09f01e604bf577f31d8ef841.tar.gz | |
convert lvgl from submodule to a plain old directory
Diffstat (limited to 'lib/lvgl/examples/libs/bmp')
| m--------- | lib/lvgl | 0 | ||||
| -rw-r--r-- | lib/lvgl/examples/libs/bmp/example_16bit.bmp | bin | 0 -> 20138 bytes | |||
| -rw-r--r-- | lib/lvgl/examples/libs/bmp/example_24bit.bmp | bin | 0 -> 30122 bytes | |||
| -rw-r--r-- | lib/lvgl/examples/libs/bmp/example_32bit.bmp | bin | 0 -> 40138 bytes | |||
| -rw-r--r-- | lib/lvgl/examples/libs/bmp/index.rst | 6 | ||||
| -rw-r--r-- | lib/lvgl/examples/libs/bmp/lv_example_bmp.h | 38 | ||||
| -rw-r--r-- | lib/lvgl/examples/libs/bmp/lv_example_bmp_1.c | 21 | ||||
| -rwxr-xr-x | lib/lvgl/examples/libs/bmp/lv_example_bmp_1.py | 13 |
8 files changed, 78 insertions, 0 deletions
diff --git a/lib/lvgl b/lib/lvgl deleted file mode 160000 -Subproject 0732400e7b564dd0e7dc4a924619d8e19c5b23a diff --git a/lib/lvgl/examples/libs/bmp/example_16bit.bmp b/lib/lvgl/examples/libs/bmp/example_16bit.bmp Binary files differnew file mode 100644 index 00000000..21ee5ca9 --- /dev/null +++ b/lib/lvgl/examples/libs/bmp/example_16bit.bmp diff --git a/lib/lvgl/examples/libs/bmp/example_24bit.bmp b/lib/lvgl/examples/libs/bmp/example_24bit.bmp Binary files differnew file mode 100644 index 00000000..8f6f4fd6 --- /dev/null +++ b/lib/lvgl/examples/libs/bmp/example_24bit.bmp diff --git a/lib/lvgl/examples/libs/bmp/example_32bit.bmp b/lib/lvgl/examples/libs/bmp/example_32bit.bmp Binary files differnew file mode 100644 index 00000000..2c9435ec --- /dev/null +++ b/lib/lvgl/examples/libs/bmp/example_32bit.bmp 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() |
