ST7789: Add template for update_cb

We might use this callback to be able to rotate the display at runtime using the displa controller configuration bytes
This commit is contained in:
C47D 2021-09-08 22:59:52 -05:00
parent 83c08f6a2a
commit dfe54e8573
2 changed files with 32 additions and 0 deletions

View file

@ -232,3 +232,8 @@ static void st7789_set_orientation(lv_disp_drv_t *drv, uint8_t orientation)
st7789_send_data(drv, (void *) &data[orientation], 1);
}
/* Display update callback, we could update the orientation in here */
void st7789_update_cb(lv_disp_drv_t *drv)
{
(void) drv;
}

View file

@ -107,10 +107,37 @@ extern "C"
#define ST7789_NVMSET 0xFC // NVM setting
#define ST7789_PROMACT 0xFE // Program action
/**
* Initialize the ST7789 display controller with default configuration
*
* @param drv Pointer to lv_disp_drv_t being used
*/
void st7789_init(lv_disp_drv_t *drv);
/**
* Send buffer content to display
*
* @param drv Pointer to lv_disp_drv_t being used
* @param area Pointer to area to be sent
* @param color_map Pointer to color map
*/
void st7789_flush(lv_disp_drv_t *drv, const lv_area_t *area, lv_color_t *color_map);
/**
* Control display backlight
*
* @param drv Pointer to lv_disp_drv_t being used
* @param backlight Backlight control
*/
void st7789_enable_backlight(lv_disp_drv_t *drv, bool backlight);
/**
* Display updated callback
*
* @param drv Pointer to lv_disp_drv_t being used
*/
void st7789_update_cb(lv_disp_drv_t *drv)
#ifdef __cplusplus
} /* extern "C" */
#endif