![]() |
![]() |
|
LittlevGL
3.20.00.19
|
Display Driver HAL interface header file
#include <stdint.h>#include <stdbool.h>#include "lv_hal.h"#include "../lv_misc/lv_color.h"#include "../lv_misc/lv_area.h"#include "../lv_misc/lv_ll.h"#include "../lv_misc/lv_task.h"

Go to the source code of this file.
Data Structures | |
| struct | lv_disp_buf_t |
| struct | _disp_drv_t |
| struct | _disp_t |
Typedefs | |
| typedef struct _disp_drv_t | lv_disp_drv_t |
| typedef struct _disp_t | lv_disp_t |
Functions | |
| void | lv_disp_drv_init (lv_disp_drv_t *driver) |
| void | lv_disp_buf_init (lv_disp_buf_t *disp_buf, void *buf1, void *buf2, uint32_t size_in_px_cnt) |
| lv_disp_t * | lv_disp_drv_register (lv_disp_drv_t *driver) |
| void | lv_disp_drv_update (lv_disp_t *disp, lv_disp_drv_t *new_drv) |
| void | lv_disp_remove (lv_disp_t *disp) |
| void | lv_disp_set_default (lv_disp_t *disp) |
| lv_disp_t * | lv_disp_get_default (void) |
| lv_coord_t | lv_disp_get_hor_res (lv_disp_t *disp) |
| lv_coord_t | lv_disp_get_ver_res (lv_disp_t *disp) |
| bool | lv_disp_get_antialiasing (lv_disp_t *disp) |
| lv_disp_t * | lv_disp_get_next (lv_disp_t *disp) |
| lv_disp_buf_t * | lv_disp_get_buf (lv_disp_t *disp) |
| uint16_t | lv_disp_get_inv_buf_size (lv_disp_t *disp) |
| void | lv_disp_pop_from_inv_buf (lv_disp_t *disp, uint16_t num) |
| bool | lv_disp_is_double_buf (lv_disp_t *disp) |
| bool | lv_disp_is_true_double_buf (lv_disp_t *disp) |
| typedef struct _disp_drv_t lv_disp_drv_t |
Display Driver structure to be registered by HAL
Display structure. lv_disp_drv_t is the first member of the structure.
| void lv_disp_drv_init | ( | lv_disp_drv_t * | driver | ) |
Initialize a display driver with default values. It is used to have known values in the fields and not junk in memory. After it you can safely set only the fields you need.
| driver | pointer to driver variable to initialize |
| void lv_disp_buf_init | ( | lv_disp_buf_t * | disp_buf, |
| void * | buf1, | ||
| void * | buf2, | ||
| uint32_t | size_in_px_cnt | ||
| ) |
Initialize a display buffer
| disp_buf | pointer lv_disp_buf_t variable to initialize |
| buf1 | A buffer to be used by LittlevGL to draw the image. Always has to specified and can't be NULL. Can be an array allocated by the user. E.g. static lv_color_t disp_buf1[1024 * 10] Or a memory address e.g. in external SRAM |
| buf2 | Optionally specify a second buffer to make image rendering and image flushing (sending to the display) parallel. In the disp_drv->flush you should use DMA or similar hardware to send the image to the display in the background. It lets LittlevGL to render next frame into the other buffer while previous is being sent. Set to NULL if unused. |
| size_in_px_cnt | size of the buf1 and buf2 in pixel count. |
| lv_disp_t* lv_disp_drv_register | ( | lv_disp_drv_t * | driver | ) |
Register an initialized display driver. Automatically set the first display as active.
| driver | pointer to an initialized 'lv_disp_drv_t' variable (can be local variable) |
| void lv_disp_drv_update | ( | lv_disp_t * | disp, |
| lv_disp_drv_t * | new_drv | ||
| ) |
Update the driver in run time.
| disp | pointer to a display. (return value of lv_disp_drv_register) |
| new_drv | pointer to the new driver |
| void lv_disp_remove | ( | lv_disp_t * | disp | ) |
Remove a display
| disp | pointer to display |
| void lv_disp_set_default | ( | lv_disp_t * | disp | ) |
Set a default screen. The new screens will be created on it by default.
| disp | pointer to a display |
| lv_disp_t* lv_disp_get_default | ( | void | ) |
Get the default display
| lv_coord_t lv_disp_get_hor_res | ( | lv_disp_t * | disp | ) |
Get the horizontal resolution of a display
| disp | pointer to a display (NULL to use the default display) |
| lv_coord_t lv_disp_get_ver_res | ( | lv_disp_t * | disp | ) |
Get the vertical resolution of a display
| disp | pointer to a display (NULL to use the default display) |
| bool lv_disp_get_antialiasing | ( | lv_disp_t * | disp | ) |
Get if anti-aliasing is enabled for a display or not
| disp | pointer to a display (NULL to use the default display) |
Get the next display.
| disp | pointer to the current display. NULL to initialize. |
| lv_disp_buf_t* lv_disp_get_buf | ( | lv_disp_t * | disp | ) |
Get the internal buffer of a display
| disp | pointer to a display |
| uint16_t lv_disp_get_inv_buf_size | ( | lv_disp_t * | disp | ) |
Get the number of areas in the buffer
| void lv_disp_pop_from_inv_buf | ( | lv_disp_t * | disp, |
| uint16_t | num | ||
| ) |
Pop (delete) the last 'num' invalidated areas from the buffer
| num | number of areas to delete |
| bool lv_disp_is_double_buf | ( | lv_disp_t * | disp | ) |
Check the driver configuration if it's double buffered (both buf1 and buf2 are set)
| disp | pointer to to display to check |
| bool lv_disp_is_true_double_buf | ( | lv_disp_t * | disp | ) |
Check the driver configuration if it's TRUE double buffered (both buf1 and buf2 are set and size is screen sized)
| disp | pointer to to display to check |