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:
parent
4ca147ef32
commit
607ac06044
@ -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);
|
||||
|
||||
- Create a draw buffer: LVGL will render the graphics here first, and
|
||||
send the rendered image to the display. The buffer size can be set
|
||||
freely but 1/10 screen size is a good starting point.
|
||||
- Create a draw buffer: LVGL supports multiple buffering methods. Here you
|
||||
can see how to set up partial buffering
|
||||
(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
|
||||
|
||||
@ -80,11 +81,9 @@ If you would rather try LVGL on your own project follow these steps:
|
||||
|
||||
.. code:: c
|
||||
|
||||
static lv_indev_t indev_drv; /*Descriptor of a input device driver*/
|
||||
lv_indev_drv_init(&indev_drv); /*Basic initialization*/
|
||||
indev_drv.type = LV_INDEV_TYPE_POINTER; /*Touch pad is a pointer-like device*/
|
||||
indev_drv.read_cb = my_touchpad_read; /*Set your driver function*/
|
||||
lv_indev_drv_register(&indev_drv); /*Finally register the driver*/
|
||||
lv_indev_t * indev = lv_indev_create(); /*Create an input device*/
|
||||
lv_indev_set_type(indev, LV_INDEV_TYPE_POINTER); /*Touch pad is a pointer-like device*/
|
||||
lv_ondev_set_read_cb(indev, my_touchpad_read); /*Set your driver function*/
|
||||
|
||||
void my_touchpad_read(lv_indev_drv_t * indev_drv, lv_indev_data_t * data)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user