1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-14 06:42:58 +08:00

docs(quick-overview): update indev create to v9 (#6282)

This commit is contained in:
Gabor Kiss-Vamosi 2024-06-01 04:18:55 +02:00 committed by GitHub
parent 4ca147ef32
commit 607ac06044
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -44,9 +44,10 @@ If you would rather try LVGL on your own project follow these steps:
lv_display_t *display = lv_display_create(MY_DISP_HOR_RES, MY_DISP_VER_RES); lv_display_t *display = lv_display_create(MY_DISP_HOR_RES, MY_DISP_VER_RES);
- Create a draw buffer: LVGL will render the graphics here first, and - Create a draw buffer: LVGL supports multiple buffering methods. Here you
send the rendered image to the display. The buffer size can be set can see how to set up partial buffering
freely but 1/10 screen size is a good starting point. (that is render the screen and the changed areas in a smaller buffer).
The buffer size can be set freely but 1/10 screen size is a good starting point.
.. code:: c .. code:: c
@ -80,11 +81,9 @@ If you would rather try LVGL on your own project follow these steps:
.. code:: c .. code:: c
static lv_indev_t indev_drv; /*Descriptor of a input device driver*/ lv_indev_t * indev = lv_indev_create(); /*Create an input device*/
lv_indev_drv_init(&indev_drv); /*Basic initialization*/ lv_indev_set_type(indev, LV_INDEV_TYPE_POINTER); /*Touch pad is a pointer-like device*/
indev_drv.type = LV_INDEV_TYPE_POINTER; /*Touch pad is a pointer-like device*/ lv_ondev_set_read_cb(indev, my_touchpad_read); /*Set your driver function*/
indev_drv.read_cb = my_touchpad_read; /*Set your driver function*/
lv_indev_drv_register(&indev_drv); /*Finally register the driver*/
void my_touchpad_read(lv_indev_drv_t * indev_drv, lv_indev_data_t * data) void my_touchpad_read(lv_indev_drv_t * indev_drv, lv_indev_data_t * data)
{ {