|
|
@@ -8,7 +8,7 @@
|
|
|
#define LUAT_LOG_TAG "lcd"
|
|
|
#include "luat_log.h"
|
|
|
|
|
|
-luat_color_t BACK_COLOR = WHITE, FORE_COLOR = BLACK;
|
|
|
+luat_color_t BACK_COLOR = LCD_WHITE, FORE_COLOR = LCD_BLACK;
|
|
|
|
|
|
#define LUAT_LCD_CONF_COUNT (1)
|
|
|
static luat_lcd_conf_t* confs[LUAT_LCD_CONF_COUNT] = {0};
|
|
|
@@ -44,6 +44,9 @@ void luat_lcd_execute_cmds(luat_lcd_conf_t* conf, uint32_t* cmds, uint32_t count
|
|
|
|
|
|
|
|
|
int lcd_write_cmd(luat_lcd_conf_t* conf, const uint8_t cmd){
|
|
|
+ if (conf->opts->write_cmd){
|
|
|
+ return conf->opts->write_cmd(conf,cmd);
|
|
|
+ }
|
|
|
size_t len;
|
|
|
luat_gpio_set(conf->pin_dc, Luat_GPIO_LOW);
|
|
|
#ifdef LUAT_LCD_CMD_DELAY_US
|
|
|
@@ -71,6 +74,9 @@ int lcd_write_cmd(luat_lcd_conf_t* conf, const uint8_t cmd){
|
|
|
}
|
|
|
|
|
|
int lcd_write_data(luat_lcd_conf_t* conf, const uint8_t data){
|
|
|
+ if (conf->opts->write_cmd){
|
|
|
+ return conf->opts->write_data(conf,data);
|
|
|
+ }
|
|
|
size_t len;
|
|
|
if (conf->port == LUAT_LCD_SPI_DEVICE){
|
|
|
len = luat_spi_device_send((luat_spi_device_t*)(conf->lcd_spi_device), (const char*)&data, 1);
|