Added backlight callback.
This commit is contained in:
parent
93c56ceaa0
commit
e4ea2560c1
|
@ -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) {
|
if(lcd->cb.write_cmd_cb(lcd->user_data, &command, 0x01) != ST7789_OK) {
|
||||||
return ST7789_ERROR;
|
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) {
|
st7789_ret_t st7789_lcd_config(st7789_lcd_t *lcd, st7789_config_t *config) {
|
||||||
|
|
|
@ -24,6 +24,7 @@ typedef enum {
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
st7789_ret_t (*reset_cb)(void *handle);
|
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_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_ret_t (*write_data_cb)(void *handle, uint8_t *data, uint32_t len);
|
||||||
} st7789_cb_t;
|
} st7789_cb_t;
|
||||||
|
|
Loading…
Reference in New Issue