LittlevGL  3.20.00.19
Data Structures | Typedefs | Functions
lv_hal_disp.h File Reference

Detailed Description

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"
Include dependency graph for lv_hal_disp.h:
This graph shows which files directly or indirectly include this file:

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_tlv_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_tlv_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_tlv_disp_get_next (lv_disp_t *disp)
 
lv_disp_buf_tlv_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 Documentation

§ lv_disp_drv_t

typedef struct _disp_drv_t lv_disp_drv_t

Display Driver structure to be registered by HAL

§ lv_disp_t

typedef struct _disp_t lv_disp_t

Display structure. lv_disp_drv_t is the first member of the structure.

Function Documentation

§ lv_disp_drv_init()

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.

Parameters
driverpointer to driver variable to initialize

§ lv_disp_buf_init()

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

Parameters
disp_bufpointer lv_disp_buf_t variable to initialize
buf1A 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
buf2Optionally 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_cntsize of the buf1 and buf2 in pixel count.

§ lv_disp_drv_register()

lv_disp_t* lv_disp_drv_register ( lv_disp_drv_t driver)

Register an initialized display driver. Automatically set the first display as active.

Parameters
driverpointer to an initialized 'lv_disp_drv_t' variable (can be local variable)
Returns
pointer to the new display or NULL on error

§ lv_disp_drv_update()

void lv_disp_drv_update ( lv_disp_t disp,
lv_disp_drv_t new_drv 
)

Update the driver in run time.

Parameters
disppointer to a display. (return value of lv_disp_drv_register)
new_drvpointer to the new driver

§ lv_disp_remove()

void lv_disp_remove ( lv_disp_t disp)

Remove a display

Parameters
disppointer to display

§ lv_disp_set_default()

void lv_disp_set_default ( lv_disp_t disp)

Set a default screen. The new screens will be created on it by default.

Parameters
disppointer to a display

§ lv_disp_get_default()

lv_disp_t* lv_disp_get_default ( void  )

Get the default display

Returns
pointer to the default display

§ lv_disp_get_hor_res()

lv_coord_t lv_disp_get_hor_res ( lv_disp_t disp)

Get the horizontal resolution of a display

Parameters
disppointer to a display (NULL to use the default display)
Returns
the horizontal resolution of the display

§ lv_disp_get_ver_res()

lv_coord_t lv_disp_get_ver_res ( lv_disp_t disp)

Get the vertical resolution of a display

Parameters
disppointer to a display (NULL to use the default display)
Returns
the vertical resolution of the display

§ lv_disp_get_antialiasing()

bool lv_disp_get_antialiasing ( lv_disp_t disp)

Get if anti-aliasing is enabled for a display or not

Parameters
disppointer to a display (NULL to use the default display)
Returns
true: anti-aliasing is enabled; false: disabled

§ lv_disp_get_next()

lv_disp_t* lv_disp_get_next ( lv_disp_t disp)

Get the next display.

Parameters
disppointer to the current display. NULL to initialize.
Returns
the next display or NULL if no more. Give the first display when the parameter is NULL

§ lv_disp_get_buf()

lv_disp_buf_t* lv_disp_get_buf ( lv_disp_t disp)

Get the internal buffer of a display

Parameters
disppointer to a display
Returns
pointer to the internal buffers

§ lv_disp_get_inv_buf_size()

uint16_t lv_disp_get_inv_buf_size ( lv_disp_t disp)

Get the number of areas in the buffer

Returns
number of invalid areas

§ lv_disp_pop_from_inv_buf()

void lv_disp_pop_from_inv_buf ( lv_disp_t disp,
uint16_t  num 
)

Pop (delete) the last 'num' invalidated areas from the buffer

Parameters
numnumber of areas to delete

§ lv_disp_is_double_buf()

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)

Parameters
disppointer to to display to check
Returns
true: double buffered; false: not double buffered

§ lv_disp_is_true_double_buf()

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)

Parameters
disppointer to to display to check
Returns
true: double buffered; false: not double buffered
© Copyright 1995-2019, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale