diff --git a/examples/lvgl/button_lvgl_example/button_lvgl.ino b/examples/lvgl/button_lvgl/button_lvgl.ino similarity index 89% rename from examples/lvgl/button_lvgl_example/button_lvgl.ino rename to examples/lvgl/button_lvgl/button_lvgl.ino index dc0313b..dfb24de 100644 --- a/examples/lvgl/button_lvgl_example/button_lvgl.ino +++ b/examples/lvgl/button_lvgl/button_lvgl.ino @@ -6,7 +6,11 @@ Arduino_H7_Video Display(800, 480, GigaDisplayShield); Arduino_GigaDisplayTouch TouchDetector; static void btn_event_cb(lv_event_t * e) { - lv_obj_t * btn = lv_event_get_target(e); + #if (LVGL_VERSION_MAJOR == 9) + lv_obj_t * btn = (lv_obj_t *) lv_event_get_target(e); + #else + lv_obj_t * btn = lv_event_get_target(e); + #endif lv_obj_t * label = lv_obj_get_child(btn, 0); lv_label_set_text_fmt(label, "Clicked!"); } diff --git a/examples/lvgl/image_lvgl/image_lvgl.ino b/examples/lvgl/image_lvgl/image_lvgl.ino index d42ec21..eeb104f 100644 --- a/examples/lvgl/image_lvgl/image_lvgl.ino +++ b/examples/lvgl/image_lvgl/image_lvgl.ino @@ -1,3 +1,8 @@ +/* +* Online image converter for LVGL v9: https://lvgl.io/tools/imageconverter_v9 +* Online image converter for LVGL v8 or earlier: https://lvgl.io/tools/imageconverter +*/ + #include "Arduino_H7_Video.h" #include "lvgl.h" diff --git a/examples/lvgl/image_lvgl/img_arduinologo.c b/examples/lvgl/image_lvgl/img_arduinologo.c index 244e455..e938d79 100644 --- a/examples/lvgl/image_lvgl/img_arduinologo.c +++ b/examples/lvgl/image_lvgl/img_arduinologo.c @@ -636,6 +636,15 @@ const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_IMG_ARDUI #endif }; +#if (LVGL_VERSION_MAJOR == 9) +const lv_img_dsc_t img_arduinologo = { + .header.cf = LV_COLOR_FORMAT_RGB565, + .header.w = 200, + .header.h = 150, + .data_size = 30000 * LV_COLOR_DEPTH / 8, + .data = img_arduinologo_map, +}; +#else const lv_img_dsc_t img_arduinologo = { .header.cf = LV_IMG_CF_TRUE_COLOR, .header.always_zero = 0, @@ -645,3 +654,4 @@ const lv_img_dsc_t img_arduinologo = { .data_size = 30000 * LV_COLOR_SIZE / 8, .data = img_arduinologo_map, }; +#endif \ No newline at end of file diff --git a/examples/lvgl/imu_orientation/img_arduinologo.c b/examples/lvgl/imu_orientation/img_arduinologo.c index 244e455..aaaf009 100644 --- a/examples/lvgl/imu_orientation/img_arduinologo.c +++ b/examples/lvgl/imu_orientation/img_arduinologo.c @@ -636,6 +636,15 @@ const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_IMG_ARDUI #endif }; +#if (LVGL_VERSION_MAJOR == 9) +const lv_img_dsc_t img_arduinologo = { + .header.cf = LV_COLOR_FORMAT_RGB565, + .header.w = 200, + .header.h = 150, + .data_size = 30000 * LV_COLOR_DEPTH / 8, + .data = img_arduinologo_map, +}; +#else const lv_img_dsc_t img_arduinologo = { .header.cf = LV_IMG_CF_TRUE_COLOR, .header.always_zero = 0, @@ -645,3 +654,4 @@ const lv_img_dsc_t img_arduinologo = { .data_size = 30000 * LV_COLOR_SIZE / 8, .data = img_arduinologo_map, }; +#endif diff --git a/examples/lvgl/imu_orientation/imu_orientation.ino b/examples/lvgl/imu_orientation/imu_orientation.ino index 556540a..134df8e 100644 --- a/examples/lvgl/imu_orientation/imu_orientation.ino +++ b/examples/lvgl/imu_orientation/imu_orientation.ino @@ -1,3 +1,8 @@ +/* +* Online image converter for LVGL v9: https://lvgl.io/tools/imageconverter_v9 +* Online image converter for LVGL v8 or earlier: https://lvgl.io/tools/imageconverter +*/ + #include "Arduino_BMI270_BMM150.h" #include "Arduino_H7_Video.h" #include "lvgl.h" diff --git a/examples/lvgl/squarelinestudio_lvgl/README.md b/examples/lvgl/squarelinestudio_lvgl/README.md deleted file mode 100644 index 1871654..0000000 --- a/examples/lvgl/squarelinestudio_lvgl/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# How to run the sketch: -- copy the `ui` folder into your `Arduino/libraries` directory -- upload the sketch and see the magic! \ No newline at end of file diff --git a/examples/lvgl/squarelinestudio_lvgl_v8/README.md b/examples/lvgl/squarelinestudio_lvgl_v8/README.md new file mode 100644 index 0000000..276b899 --- /dev/null +++ b/examples/lvgl/squarelinestudio_lvgl_v8/README.md @@ -0,0 +1,6 @@ +> [!NOTE] +> SquareLine Studio has ended its collaboration with LVGL. It only supports LVGL version 8 and earlier. + +# How to run the sketch: +- move the `ui` folder into your `Arduino/libraries` directory +- upload the sketch and see the magic! \ No newline at end of file diff --git a/examples/lvgl/squarelinestudio_lvgl/squarelinestudio_lvgl.ino b/examples/lvgl/squarelinestudio_lvgl_v8/squarelinestudio_lvgl_v8.ino similarity index 84% rename from examples/lvgl/squarelinestudio_lvgl/squarelinestudio_lvgl.ino rename to examples/lvgl/squarelinestudio_lvgl_v8/squarelinestudio_lvgl_v8.ino index c90a704..2684ce9 100644 --- a/examples/lvgl/squarelinestudio_lvgl/squarelinestudio_lvgl.ino +++ b/examples/lvgl/squarelinestudio_lvgl_v8/squarelinestudio_lvgl_v8.ino @@ -8,7 +8,7 @@ * 1. Create a SquareLine Studio project with the following settings: * - Resolution: 800x480 * - Color depth: 16-bit - * - LVGL version: 8.3.x + * - LVGL version: 8.3.x (NOTE: It only supports LVGL version 8 and earlier.) * 2. Design your GUI using the drag-and-drop tool. * 3. Export the LVGL UI files. * 4. Open the exported file and copy the 'libraries/ui' folder into your 'Arduino/libraries' directory. @@ -29,6 +29,10 @@ Arduino_H7_Video Display(800, 480, GigaDisplayShield); Arduino_GigaDisplayTouch Touch; +#if (LVGL_VERSION_MAJOR >= 9) + #error "SquareLine Studio has ended its collaboration with LVGL. It only supports LVGL version 8 and earlier." +#endif + void setup() { Display.begin(); Touch.begin(); diff --git a/examples/lvgl/squarelinestudio_lvgl/ui/library.properties b/examples/lvgl/squarelinestudio_lvgl_v8/ui/library.properties similarity index 100% rename from examples/lvgl/squarelinestudio_lvgl/ui/library.properties rename to examples/lvgl/squarelinestudio_lvgl_v8/ui/library.properties diff --git a/examples/lvgl/squarelinestudio_lvgl/ui/src/CMakeLists.txt b/examples/lvgl/squarelinestudio_lvgl_v8/ui/src/CMakeLists.txt similarity index 100% rename from examples/lvgl/squarelinestudio_lvgl/ui/src/CMakeLists.txt rename to examples/lvgl/squarelinestudio_lvgl_v8/ui/src/CMakeLists.txt diff --git a/examples/lvgl/squarelinestudio_lvgl/ui/src/components/ui_comp_hook.c b/examples/lvgl/squarelinestudio_lvgl_v8/ui/src/components/ui_comp_hook.c similarity index 100% rename from examples/lvgl/squarelinestudio_lvgl/ui/src/components/ui_comp_hook.c rename to examples/lvgl/squarelinestudio_lvgl_v8/ui/src/components/ui_comp_hook.c diff --git a/examples/lvgl/squarelinestudio_lvgl/ui/src/filelist.txt b/examples/lvgl/squarelinestudio_lvgl_v8/ui/src/filelist.txt similarity index 100% rename from examples/lvgl/squarelinestudio_lvgl/ui/src/filelist.txt rename to examples/lvgl/squarelinestudio_lvgl_v8/ui/src/filelist.txt diff --git a/examples/lvgl/squarelinestudio_lvgl/ui/src/readme.txt b/examples/lvgl/squarelinestudio_lvgl_v8/ui/src/readme.txt similarity index 100% rename from examples/lvgl/squarelinestudio_lvgl/ui/src/readme.txt rename to examples/lvgl/squarelinestudio_lvgl_v8/ui/src/readme.txt diff --git a/examples/lvgl/squarelinestudio_lvgl/ui/src/screens/ui_Screen1.c b/examples/lvgl/squarelinestudio_lvgl_v8/ui/src/screens/ui_Screen1.c similarity index 100% rename from examples/lvgl/squarelinestudio_lvgl/ui/src/screens/ui_Screen1.c rename to examples/lvgl/squarelinestudio_lvgl_v8/ui/src/screens/ui_Screen1.c diff --git a/examples/lvgl/squarelinestudio_lvgl/ui/src/ui.c b/examples/lvgl/squarelinestudio_lvgl_v8/ui/src/ui.c similarity index 100% rename from examples/lvgl/squarelinestudio_lvgl/ui/src/ui.c rename to examples/lvgl/squarelinestudio_lvgl_v8/ui/src/ui.c diff --git a/examples/lvgl/squarelinestudio_lvgl/ui/src/ui.h b/examples/lvgl/squarelinestudio_lvgl_v8/ui/src/ui.h similarity index 100% rename from examples/lvgl/squarelinestudio_lvgl/ui/src/ui.h rename to examples/lvgl/squarelinestudio_lvgl_v8/ui/src/ui.h diff --git a/examples/lvgl/squarelinestudio_lvgl/ui/src/ui_events.h b/examples/lvgl/squarelinestudio_lvgl_v8/ui/src/ui_events.h similarity index 100% rename from examples/lvgl/squarelinestudio_lvgl/ui/src/ui_events.h rename to examples/lvgl/squarelinestudio_lvgl_v8/ui/src/ui_events.h diff --git a/examples/lvgl/squarelinestudio_lvgl/ui/src/ui_helpers.c b/examples/lvgl/squarelinestudio_lvgl_v8/ui/src/ui_helpers.c similarity index 100% rename from examples/lvgl/squarelinestudio_lvgl/ui/src/ui_helpers.c rename to examples/lvgl/squarelinestudio_lvgl_v8/ui/src/ui_helpers.c diff --git a/examples/lvgl/squarelinestudio_lvgl/ui/src/ui_helpers.h b/examples/lvgl/squarelinestudio_lvgl_v8/ui/src/ui_helpers.h similarity index 100% rename from examples/lvgl/squarelinestudio_lvgl/ui/src/ui_helpers.h rename to examples/lvgl/squarelinestudio_lvgl_v8/ui/src/ui_helpers.h diff --git a/examples/lvgl/squarelinestudio_lvgl/ui/ui.h b/examples/lvgl/squarelinestudio_lvgl_v8/ui/ui.h similarity index 100% rename from examples/lvgl/squarelinestudio_lvgl/ui/ui.h rename to examples/lvgl/squarelinestudio_lvgl_v8/ui/ui.h