Skip to content
This repository was archived by the owner on Dec 4, 2020. It is now read-only.

Commit 177d586

Browse files
authored
Merge pull request #3 from Pablo2048/feature/lvgl6.1
Feature/lvgl6.1
2 parents ee758d0 + 3ae9a78 commit 177d586

File tree

130 files changed

+23241
-11131
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+23241
-11131
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This library allows to use LittlevGL (v6.x) as an Arduino library. Library can b
66

77
There is simple example which uses https://github.com/Bodmer/TFT_eSPI library as an TFT driver to simplify testing. To get all this to work you have to setup TFT_eSPI to work with your TFT display type via editing the `User_Setup.h` file in TFT_eSPI library folder, or by selecting your own configurtion in the `User_Setup_Select.h` file in TFT_eSPI library folder.
88

9-
LittlevGL library has its own configuration file in `lv_conf.h` file, which is locatd in LittlevGL library folder. Please get in mind to check that corresponding resolutions in LVGL configuration match the ones in TFT_eSPI and with physical resolution of your display.
9+
LittlevGL library has its own configuration file in `lv_conf.h` file, which is locatd in LittlevGL library folder. Please get in mind to check that the corresponding resolutions in LVGL configuration match the ones in TFT_eSPI and with the physical resolution of your display.
1010

1111
Example result should look like this:
1212

@@ -21,7 +21,7 @@ Tested with:
2121

2222
## Debugging
2323

24-
In case of trouble there are debug information inside LVGL. In the `ESP32_TFT_eSPI` example there is `my_print` method, which allow to send this debug information to the serial interface. To enable this feature you have to edit `lv_conf.h` file and enable logging in section `log settings`:
24+
In case of trouble there are debug informations inside LVGL. In the `ESP32_TFT_eSPI` example there is `my_print` method, which allow to send this debug informations to the serial interface. To enable this feature you have to edit `lv_conf.h` file and enable logging in section `log settings`:
2525

2626
```c
2727
/*Log settings*/
@@ -36,4 +36,4 @@ In case of trouble there are debug information inside LVGL. In the `ESP32_TFT_eS
3636
# define LV_LOG_LEVEL LV_LOG_LEVEL_TRACE
3737
```
3838
39-
After enabling log module and setting LV_LOG_LEVEL accordingly the output log is sent to he `Serial` port @ 115200 Bd. After each line sent there is 100ms delay to allow the serial transfer to finish. This delay can be commented out in `my_print` method.
39+
After enabling log module and setting LV_LOG_LEVEL accordingly the output log is sent to the `Serial` port @ 115200 Bd. After each line sent there is 100ms delay to allow the serial transfer to finish. This delay can be commented out in `my_print` method.

examples/ESP32_TFT_eSPI/ESP32_TFT_eSPI.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ void setup() {
9696

9797
/* Create simple label */
9898
lv_obj_t *label = lv_label_create(lv_scr_act(), NULL);
99-
lv_label_set_text(label, "Hello Arduino! (V6.0)");
99+
lv_label_set_text(label, "Hello Arduino! (V6.1)");
100100
lv_obj_align(label, NULL, LV_ALIGN_CENTER, 0, 0);
101101
}
102102

examples/ESP32_TFT_eSPI_Slider/Setup.ino

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ void setup() {
5959

6060
/* Create simple label */
6161
lv_obj_t *label = lv_label_create(lv_scr_act(), NULL);
62-
lv_label_set_text(label, "Hello Arduino! (V6.0)");
62+
lv_label_set_text(label, "Hello Arduino! (V6.1)");
6363
lv_obj_align(label, NULL, LV_ALIGN_CENTER, 0, -50);
6464

6565
/* Create a slider in the center of the display */
@@ -68,12 +68,12 @@ void setup() {
6868
lv_obj_set_height(slider, 50);
6969
lv_obj_align(slider, NULL, LV_ALIGN_CENTER, 0, 0); /*Align to the center of the parent (screen)*/
7070
lv_obj_set_event_cb(slider, slider_event_cb); /*Assign an event function*/
71-
71+
7272
/* Create a label below the slider */
7373
slider_label = lv_label_create(lv_scr_act(), NULL);
7474
lv_label_set_text(slider_label, "0");
7575
lv_obj_set_auto_realign(slider, true);
7676
lv_obj_align(slider_label, slider, LV_ALIGN_OUT_BOTTOM_MID, 0, 10);
7777

7878
}
79-
79+

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"type": "git",
1313
"url": "https://github.com/littlevgl/arduino"
1414
},
15-
"version": "2.0.3",
15+
"version": "2.1.4",
1616
"license": "MIT",
1717
"frameworks": "arduino",
1818
"build": {

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=lv_arduino
2-
version=2.0.3
2+
version=2.1.4
33
author=Gabor Kiss-Vamosi
44
maintainer=Pavel Brychta <[email protected]>
55
sentence=Full-featured Graphics Library for embedded systems

src/README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
<p align="center">
33
<a href="https://github.com/littlevgl/lvgl/blob/master/LICENCE.txt"><img src="https://img.shields.io/badge/licence-MIT-blue.svg"></a>
44
<a href="https://github.com/littlevgl/lvgl/releases/tag/v6.0"><img src="https://img.shields.io/badge/version-6.0-blue.svg"></a>
5-
<br>
5+
</p>
6+
7+
<p align="center">
68
<img src="https://littlevgl.com/github/cover_ori_reduced_2.gif">
79
</p>
810

@@ -81,7 +83,7 @@ Choose a project with your favourite IDE:
8183
| Eclipse | CodeBlocks | Visual Studio | PlatformIO | Qt Creator |
8284
|-------------|-------------|---------------|-----------|------------|
8385
| [![Eclipse](https://littlevgl.com/logo/ide/eclipse.jpg)](https://github.com/littlevgl/pc_simulator_sdl_eclipse) | [![CodeBlocks](https://littlevgl.com/logo/ide/codeblocks.jpg)](https://github.com/littlevgl/pc_simulator_win_codeblocks) | [![VisualStudio](https://littlevgl.com/logo/ide/visualstudio.jpg)](https://github.com/littlevgl/visual_studio_2017_sdl_x64) | [![PlatformIO](https://littlevgl.com/logo/ide/platformio.jpg)](https://github.com/littlevgl/pc_simulator_sdl_platformio) | [![QtCreator](https://littlevgl.com/logo/ide/qtcreator.jpg)](https://blog.littlevgl.com/2019-01-03/qt-creator) |
84-
| Cross-platform<br>with SDL | Native Windows | Cross-platform<br>with SDL | Cross-platform<br>with SDL | Cross-platform<br>with SDL |
86+
| Cross-platform<br>with SDL<br>(Recommended on<br>Linux and Mac) | Native Windows | Windows<br>with SDL | Cross-platform<br>with SDL | Cross-platform<br>with SDL |
8587

8688

8789
## Add LittlevGL to your project
@@ -91,7 +93,7 @@ You can use the [Simulators](https://docs.littlevgl.com/en/html/get-started/pc-s
9193

9294
1. [Download](https://littlevgl.com/download) or [Clone](https://github.com/littlevgl/lvgl) the library
9395
2. Copy the `lvgl` folder into your project
94-
3. Copy `lvgl/lv_conf_templ.h` as `lv_conf.h` next to the `lvgl` folder and set at least `LV_HOR_RES_MAX`, `LV_VER_RES_MAX` and `LV_COLOR_DEPTH`.
96+
3. Copy `lvgl/lv_conf_template.h` as `lv_conf.h` next to the `lvgl` folder and set at least `LV_HOR_RES_MAX`, `LV_VER_RES_MAX` and `LV_COLOR_DEPTH`.
9597
4. Include `lvgl/lvgl.h` where you need to use LittlevGL related functions.
9698
5. Call `lv_tick_inc(x)` every `x` milliseconds **in a Timer or Task** (`x` should be between 1 and 10). It is required for the internal timing of LittlevGL.
9799
6. Call `lv_init()`
@@ -130,7 +132,7 @@ indev_drv.type = LV_INDEV_TYPE_POINTER; /*Touch pad is a pointer-like device*
130132
indev_drv.read_cb = my_touchpad_read; /*Set your driver function*/
131133
lv_indev_drv_register(&indev_drv); /*Finally register the driver*/
132134

133-
bool my_touchpad_read(lv_indev_t * indev, lv_indev_data_t * data)
135+
bool my_touchpad_read(lv_indev_drv_t * indev_driver, lv_indev_data_t * data)
134136
{
135137
static lv_coord_t last_x = 0;
136138
static lv_coord_t last_y = 0;
@@ -186,8 +188,8 @@ Styles can be assigned to the objects to changed their appearance. A style descr
186188

187189
You can create a new style like this:
188190
```c
189-
static lv_style_t style1; /*Declare a new style. Should be `static`*/
190-
lv_style_copy(&style1, &lv_style_plain); /*Copy a buil-in style*/
191+
static lv_style_t style1; /*Declare a new style. Should be `static`*/
192+
lv_style_copy(&style1, &lv_style_plain); /*Copy a built-in style*/
191193
style1.body.main_color = LV_COLOR_RED; /*Main color*/
192194
style1.body.grad_color = lv_color_hex(0xffd83c) /*Gradient color (orange)*/
193195
style1.body.radius = 3;

src/docs/CODING_STYLE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
## File format
3-
Use [lv_misc/lv_templ.c](https://github.com/littlevgl/lvgl/blob/master/lv_misc/lv_templ.c) and [lv_misc/lv_templ.h](https://github.com/littlevgl/lvgl/blob/master/lv_misc/lv_templ.h)
3+
Use [lv_misc/lv_templ.c](https://github.com/littlevgl/lvgl/blob/master/src/lv_misc/lv_templ.c) and [lv_misc/lv_templ.h](https://github.com/littlevgl/lvgl/blob/master/src/lv_misc/lv_templ.h)
44

55
## Naming conventions
66
* Words are separated by '_'

src/library.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "lvgl",
3+
"version": "6.1.1",
4+
"keywords": "graphics, gui, embedded, littlevgl",
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+
{
8+
"type": "git",
9+
"url": "https://github.com/littlevgl/lvgl.git"
10+
},
11+
"build": {
12+
"includeDir": "."
13+
}
14+
}

src/lv_conf_template.h

Lines changed: 97 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@
4343
/*Images pixels with this color will not be drawn (with chroma keying)*/
4444
#define LV_COLOR_TRANSP LV_COLOR_LIME /*LV_COLOR_LIME: pure green*/
4545

46+
/* Enable chroma keying for indexed images. */
47+
#define LV_INDEXED_CHROMA 1
48+
4649
/* Enable anti-aliasing (lines, and radiuses will be smoothed) */
4750
#define LV_ANTIALIAS 1
4851

@@ -193,6 +196,14 @@ typedef void * lv_img_decoder_user_data_t;
193196
* font's bitmaps */
194197
#define LV_ATTRIBUTE_LARGE_CONST
195198

199+
/* Export integer constant to binding.
200+
* This macro is used with constants in the form of LV_<CONST> that
201+
* should also appear on lvgl binding API such as Micropython
202+
*
203+
* The default value just prevents a GCC warning.
204+
*/
205+
#define LV_EXPORT_CONST_INT(int_value) struct _silence_gcc_warning
206+
196207
/*===================
197208
* HAL settings
198209
*==================*/
@@ -225,10 +236,46 @@ typedef void * lv_indev_drv_user_data_t; /*Type of user data in the i
225236
# define LV_LOG_LEVEL LV_LOG_LEVEL_WARN
226237

227238
/* 1: Print the log with 'printf';
228-
* 0: user need to register a callback with `lv_log_register_print`*/
239+
* 0: user need to register a callback with `lv_log_register_print_cb`*/
229240
# define LV_LOG_PRINTF 0
230241
#endif /*LV_USE_LOG*/
231242

243+
/*=================
244+
* Debug settings
245+
*================*/
246+
247+
/* If Debug is enabled LittelvGL validates the parameters of the functions.
248+
* If an invalid parameter is found an error log message is printed and
249+
* the MCU halts at the error. (`LV_USE_LOG` should be enabled)
250+
* If you are debugging the MCU you can pause
251+
* the debugger to see exactly where the issue is.
252+
*
253+
* The behavior of asserts can be overwritten by redefining them here.
254+
* E.g. #define LV_ASSERT_MEM(p) <my_assert_code>
255+
*/
256+
#define LV_USE_DEBUG 1
257+
#if LV_USE_DEBUG
258+
259+
/*Check if the parameter is NULL. (Quite fast) */
260+
#define LV_USE_ASSERT_NULL 1
261+
262+
/*Checks is the memory is successfully allocated or no. (Quite fast)*/
263+
#define LV_USE_ASSERT_MEM 1
264+
265+
/* Check the strings.
266+
* Search for NULL, very long strings, invalid characters, and unnatural repetitions. (Slow)
267+
* If disabled `LV_USE_ASSERT_NULL` will be performed instead (if it's enabled) */
268+
#define LV_USE_ASSERT_STR 0
269+
270+
/* Check NULL, the object's type and existence (e.g. not deleted). (Quite slow)
271+
* If disabled `LV_USE_ASSERT_NULL` will be performed instead (if it's enabled) */
272+
#define LV_USE_ASSERT_OBJ 0
273+
274+
/*Check if the styles are properly initialized. (Fast)*/
275+
#define LV_USE_ASSERT_STYLE 1
276+
277+
#endif /*LV_USE_DEBUG*/
278+
232279
/*================
233280
* THEME USAGE
234281
*================*/
@@ -260,6 +307,10 @@ typedef void * lv_indev_drv_user_data_t; /*Type of user data in the i
260307
#define LV_FONT_ROBOTO_22 0
261308
#define LV_FONT_ROBOTO_28 0
262309

310+
/* Demonstrate special features */
311+
#define LV_FONT_ROBOTO_12_SUBPX 1
312+
#define LV_FONT_ROBOTO_28_COMPRESSED 1 /*bpp = 3*/
313+
263314
/*Pixel perfect monospace font
264315
* http://pelulamu.net/unscii/ */
265316
#define LV_FONT_UNSCII_8 0
@@ -280,6 +331,12 @@ typedef void * lv_indev_drv_user_data_t; /*Type of user data in the i
280331
* but with > 10,000 characters if you see issues probably you need to enable it.*/
281332
#define LV_FONT_FMT_TXT_LARGE 0
282333

334+
/* Set the pixel order of the display.
335+
* Important only if "subpx fonts" are used.
336+
* With "normal" font it doesn't matter.
337+
*/
338+
#define LV_FONT_SUBPX_BGR 0
339+
283340
/*Declare the type of the user data of fonts (can be e.g. `void *`, `int`, `struct`)*/
284341
typedef void * lv_font_user_data_t;
285342

@@ -297,6 +354,42 @@ typedef void * lv_font_user_data_t;
297354
/*Can break (wrap) texts on these chars*/
298355
#define LV_TXT_BREAK_CHARS " ,.;:-_"
299356

357+
/* If a word is at least this long, will break wherever "prettiest"
358+
* To disable, set to a value <= 0 */
359+
#define LV_TXT_LINE_BREAK_LONG_LEN 12
360+
361+
/* Minimum number of characters in a long word to put on a line before a break.
362+
* Depends on LV_TXT_LINE_BREAK_LONG_LEN. */
363+
#define LV_TXT_LINE_BREAK_LONG_PRE_MIN_LEN 3
364+
365+
/* Minimum number of characters in a long word to put on a line after a break.
366+
* Depends on LV_TXT_LINE_BREAK_LONG_LEN. */
367+
#define LV_TXT_LINE_BREAK_LONG_POST_MIN_LEN 3
368+
369+
/* The control character to use for signalling text recoloring. */
370+
#define LV_TXT_COLOR_CMD "#"
371+
372+
/* Support bidirectional texts.
373+
* Allows mixing Left-to-Right and Right-to-Left texts.
374+
* The direction will be processed according to the Unicode Bidirectioanl Algorithm:
375+
* https://www.w3.org/International/articles/inline-bidi-markup/uba-basics*/
376+
#define LV_USE_BIDI 0
377+
#if LV_USE_BIDI
378+
/* Set the default direction. Supported values:
379+
* `LV_BIDI_DIR_LTR` Left-to-Right
380+
* `LV_BIDI_DIR_RTL` Right-to-Left
381+
* `LV_BIDI_DIR_AUTO` detect texts base direction */
382+
#define LV_BIDI_BASE_DIR_DEF LV_BIDI_DIR_AUTO
383+
#endif
384+
385+
/*Change the built in (v)snprintf functions*/
386+
#define LV_SPRINTF_CUSTOM 0
387+
#if LV_SPRINTF_CUSTOM
388+
# define LV_SPRINTF_INCLUDE <stdio.h>
389+
# define lv_snprintf snprintf
390+
# define lv_vsnprintf vsnprintf
391+
#endif /*LV_SPRINTF_CUSTOM*/
392+
300393
/*===================
301394
* LV_OBJ SETTINGS
302395
*==================*/
@@ -355,6 +448,9 @@ typedef void * lv_obj_user_data_t;
355448
/*Container (dependencies: -*/
356449
#define LV_USE_CONT 1
357450

451+
/*Color picker (dependencies: -*/
452+
#define LV_USE_CPICKER 1
453+
358454
/*Drop down list (dependencies: lv_page, lv_label, lv_symbol_def.h)*/
359455
#define LV_USE_DDLIST 1
360456
#if LV_USE_DDLIST != 0

src/lvgl.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,18 @@ extern "C" {
2525

2626
#include "src/lv_core/lv_obj.h"
2727
#include "src/lv_core/lv_group.h"
28+
#include "src/lv_core/lv_indev.h"
2829

2930
#include "src/lv_core/lv_refr.h"
3031
#include "src/lv_core/lv_disp.h"
32+
#include "src/lv_core/lv_debug.h"
3133

3234
#include "src/lv_themes/lv_theme.h"
3335

3436
#include "src/lv_font/lv_font.h"
3537
#include "src/lv_font/lv_font_fmt_txt.h"
38+
#include "src/lv_misc/lv_bidi.h"
39+
#include "src/lv_misc/lv_printf.h"
3640

3741
#include "src/lv_objx/lv_btn.h"
3842
#include "src/lv_objx/lv_imgbtn.h"
@@ -45,6 +49,7 @@ extern "C" {
4549
#include "src/lv_objx/lv_chart.h"
4650
#include "src/lv_objx/lv_table.h"
4751
#include "src/lv_objx/lv_cb.h"
52+
#include "src/lv_objx/lv_cpicker.h"
4853
#include "src/lv_objx/lv_bar.h"
4954
#include "src/lv_objx/lv_slider.h"
5055
#include "src/lv_objx/lv_led.h"

0 commit comments

Comments
 (0)