Added backlight callback.

This commit is contained in:
imi415 2021-06-26 11:07:01 +08:00
parent 93c56ceaa0
commit e4ea2560c1
Signed by: imi415
GPG Key ID: 17F01E106F9F5E0A
2 changed files with 7 additions and 0 deletions

View File

@ -192,6 +192,12 @@ st7789_ret_t st7789_lcd_display(st7789_lcd_t *lcd, uint8_t display_on) {
if(lcd->cb.write_cmd_cb(lcd->user_data, &command, 0x01) != ST7789_OK) {
return ST7789_ERROR;
}
if(lcd->cb.backlight_cb(lcd->user_data, display_on) != ST7789_OK) {
return ST7789_ERROR;
}
return ST7789_OK;
}
st7789_ret_t st7789_lcd_config(st7789_lcd_t *lcd, st7789_config_t *config) {

View File

@ -24,6 +24,7 @@ typedef enum {
typedef struct {
st7789_ret_t (*reset_cb)(void *handle);
st7789_ret_t (*backlight_cb)(void *handle, uint8_t on);
st7789_ret_t (*write_cmd_cb)(void *handle, uint8_t *cmd, uint8_t len);
st7789_ret_t (*write_data_cb)(void *handle, uint8_t *data, uint32_t len);
} st7789_cb_t;