Add pointer to lv_disp_drv_t as first parameter to HAL functions

This commit is contained in:
C47D 2021-08-26 10:42:26 -05:00
parent 413721182c
commit 0f1a6d490e
4 changed files with 78 additions and 51 deletions

View file

@ -1,10 +1,30 @@
#ifndef DISPLAY_HAL_H_
#define DISPLAY_HAL_H_
#ifdef __cplusplus
extern "C"
{
#endif
#ifdef LV_LVGL_H_INCLUDE_SIMPLE
#include "lvgl.h"
#else
#include "lvgl/lvgl.h"
#endif
/* NOTE We could remove this function from here, because it's used to
* initialize the GPIOS on the MCU */
void display_hal_init_io(void);
void display_hal_delay(uint32_t delay_ms);
void display_hal_backlight(uint8_t state);
void display_hal_gpio_dc(uint8_t state);
void display_hal_gpio_rst(uint8_t state);
/* NOTE drv parameter is meant to be used in multi display projects, so the
* user could distinguish multiple displays on their hal implementation */
void display_hal_delay(lv_disp_drv_t *drv, uint32_t delay_ms);
void display_hal_backlight(lv_disp_drv_t *drv, uint8_t state);
void display_hal_gpio_dc(lv_disp_drv_t *drv, uint8_t state);
void display_hal_gpio_rst(lv_disp_drv_t *drv, uint8_t state);
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif