lv_hal: add init funtion to call prior driver registration
This commit is contained in:
@@ -40,13 +40,26 @@ static lv_disp_t *active;
|
|||||||
* GLOBAL FUNCTIONS
|
* GLOBAL FUNCTIONS
|
||||||
**********************/
|
**********************/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialize a display driver with default values.
|
||||||
|
* It is used to surly have known values in the fields ant not memory junk.
|
||||||
|
* After it you can set the fields.
|
||||||
|
* @param driver pointer to driver variable to initialize
|
||||||
|
*/
|
||||||
|
void lv_disp_drv_init(lv_disp_drv_t *driver)
|
||||||
|
{
|
||||||
|
driver->fill_fp = NULL;
|
||||||
|
driver->map_fp = NULL;
|
||||||
|
driver->blend_fp = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Register an initialized display driver.
|
* Register an initialized display driver.
|
||||||
* Automatically set the first display as active.
|
* Automatically set the first display as active.
|
||||||
* @param driver pointer to an initialized 'lv_disp_drv_t' variable (can be local variable)
|
* @param driver pointer to an initialized 'lv_disp_drv_t' variable (can be local variable)
|
||||||
* @return pointer to the new display or NULL on error
|
* @return pointer to the new display or NULL on error
|
||||||
*/
|
*/
|
||||||
lv_disp_t * lv_disp_register(lv_disp_drv_t *driver)
|
lv_disp_t * lv_disp_drv_register(lv_disp_drv_t *driver)
|
||||||
{
|
{
|
||||||
lv_disp_t *node;
|
lv_disp_t *node;
|
||||||
|
|
||||||
|
|||||||
@@ -46,6 +46,13 @@ typedef struct _disp_t {
|
|||||||
* GLOBAL PROTOTYPES
|
* GLOBAL PROTOTYPES
|
||||||
**********************/
|
**********************/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialize a display driver with default values.
|
||||||
|
* It is used to surly have known values in the fields ant not memory junk.
|
||||||
|
* After it you can set the fields.
|
||||||
|
* @param driver pointer to driver variable to initialize
|
||||||
|
*/
|
||||||
|
void lv_disp_drv_init(lv_disp_drv_t *driver);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Register an initialized display driver.
|
* Register an initialized display driver.
|
||||||
@@ -53,7 +60,7 @@ typedef struct _disp_t {
|
|||||||
* @param driver pointer to an initialized 'lv_disp_drv_t' variable (can be local variable)
|
* @param driver pointer to an initialized 'lv_disp_drv_t' variable (can be local variable)
|
||||||
* @return pointer to the new display or NULL on error
|
* @return pointer to the new display or NULL on error
|
||||||
*/
|
*/
|
||||||
lv_disp_t * lv_disp_register(lv_disp_drv_t *driver);
|
lv_disp_t * lv_disp_drv_register(lv_disp_drv_t *driver);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the active display
|
* Set the active display
|
||||||
|
|||||||
@@ -36,6 +36,18 @@ static lv_indev_t *indev_list = NULL;
|
|||||||
* GLOBAL FUNCTIONS
|
* GLOBAL FUNCTIONS
|
||||||
**********************/
|
**********************/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialize an input device driver with default values.
|
||||||
|
* It is used to surly have known values in the fields ant not memory junk.
|
||||||
|
* After it you can set the fields.
|
||||||
|
* @param driver pointer to driver variable to initialize
|
||||||
|
*/
|
||||||
|
void lv_indev_drv_init(lv_indev_drv_t *driver)
|
||||||
|
{
|
||||||
|
driver->read_fp = NULL;
|
||||||
|
driver->type = LV_INDEV_TYPE_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Register an initialized input device driver.
|
* Register an initialized input device driver.
|
||||||
* @param driver pointer to an initialized 'lv_indev_drv_t' variable (can be local variable)
|
* @param driver pointer to an initialized 'lv_indev_drv_t' variable (can be local variable)
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ extern "C" {
|
|||||||
|
|
||||||
/*Possible input device types*/
|
/*Possible input device types*/
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
LV_INDEV_TYPE_NONE, /*Show uninitialized state*/
|
||||||
LV_INDEV_TYPE_TOUCHPAD, /*Touch pad*/
|
LV_INDEV_TYPE_TOUCHPAD, /*Touch pad*/
|
||||||
LV_INDEV_TYPE_MOUSE, /*Mouse or similar pointer device*/
|
LV_INDEV_TYPE_MOUSE, /*Mouse or similar pointer device*/
|
||||||
LV_INDEV_TYPE_KEYPAD, /*Keypad or keyboard*/
|
LV_INDEV_TYPE_KEYPAD, /*Keypad or keyboard*/
|
||||||
@@ -105,6 +106,14 @@ typedef struct _lv_indev_t {
|
|||||||
* GLOBAL PROTOTYPES
|
* GLOBAL PROTOTYPES
|
||||||
**********************/
|
**********************/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialize an input device driver with default values.
|
||||||
|
* It is used to surly have known values in the fields ant not memory junk.
|
||||||
|
* After it you can set the fields.
|
||||||
|
* @param driver pointer to driver variable to initialize
|
||||||
|
*/
|
||||||
|
void lv_indev_drv_init(lv_indev_drv_t *driver);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Register an initialized input device driver.
|
* Register an initialized input device driver.
|
||||||
* @param driver pointer to an initialized 'lv_indev_drv_t' variable (can be local variable)
|
* @param driver pointer to an initialized 'lv_indev_drv_t' variable (can be local variable)
|
||||||
|
|||||||
Reference in New Issue
Block a user