This is an old revision of the document!
LVGL (Light and Versatile Embedded Graphics Library) este biblioteca grafica cel mai des folosita in sistemele embedded.
1. Porning de la config-ul hacktorwatch:iot
. In acest config aplicatia HacktorWatch (CONFIG_HACKTORWATCH_REV2
) este activata in mod implicit.
2. Apelati functia “lv_example_checkbox_1()” din setul de functii oferite ca exemplu de biblioteca LVGL. Stergeti partea de cod care face label-ul “Hello!” folosita la ex. 1.
3. Activati driver-ul de touchscreen CST816S si suportul de touchscreen din LVGL
CONFIG_INPUT_CST816S
pentru a activa driver-ul de touchscreen. Ceasul HacktorWatch foloseste chip-ul Hynitron CST816S pentru touchscreen.LV_USE_NUTTX_TOUCHSCREEN
pentru ca LVGL sa fie compilat cu suport de touchscreen#ifdef CONFIG_INPUT_TOUCHSCREEN info.input_path = "/dev/input0"; #endif
--- ./graphics/lvgl/lvgl/src/drivers/nuttx/lv_nuttx_touchscreen.c 2024-10-24 21:45:11.000000000 +0300 +++ ./graphics/lvgl/lvgl/src/drivers/nuttx/lv_nuttx_touchscreen.c 2025-08-10 20:04:58.486933763 +0300 @@ -146,7 +146,11 @@ /* Save last sample and let lvgl continue reading */ touchscreen->last_sample = sample; touchscreen->has_last_sample = true; - data->continue_reading = true; + + if (sample.point[0].flags & TOUCH_DOWN) + data->continue_reading = true; + else + data->continue_reading = false; } else { /* No more sample available, clear last sample flag */
4. Rulati urmatorul cod care va crea un obiect “circle” folosit ca parinte pentru mai multe elemente - o coloana cu un label si un checkbox - aflate in interiorul cercului. Mai jos este o diagrama cu relatia dintre ele.