TFT (plus Hardware SPI) for LPC (#19139)
This commit is contained in:
@ -82,11 +82,6 @@
|
||||
|
||||
#define U8G_COM_SSD_I2C_HAL u8g_com_arduino_ssd_i2c_fn
|
||||
|
||||
#if EITHER(FSMC_GRAPHICAL_TFT, SPI_GRAPHICAL_TFT)
|
||||
uint8_t u8g_com_stm32duino_tft_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
|
||||
#define U8G_COM_HAL_TFT_FN u8g_com_stm32duino_tft_fn
|
||||
#endif
|
||||
|
||||
#elif defined(TARGET_LPC1768)
|
||||
|
||||
uint8_t u8g_com_HAL_LPC1768_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
|
||||
@ -117,6 +112,9 @@
|
||||
#ifndef U8G_COM_SSD_I2C_HAL
|
||||
#define U8G_COM_SSD_I2C_HAL u8g_com_null_fn
|
||||
#endif
|
||||
#ifndef U8G_COM_HAL_TFT_FN
|
||||
#if EITHER(FSMC_GRAPHICAL_TFT, SPI_GRAPHICAL_TFT)
|
||||
uint8_t u8g_com_hal_tft_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
|
||||
#define U8G_COM_HAL_TFT_FN u8g_com_hal_tft_fn
|
||||
#else
|
||||
#define U8G_COM_HAL_TFT_FN u8g_com_null_fn
|
||||
#endif
|
||||
|
@ -760,7 +760,7 @@ uint8_t u8g_dev_tft_320x240_upscale_from_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, u
|
||||
|
||||
static uint8_t msgInitCount = 2; // Ignore all messages until 2nd U8G_COM_MSG_INIT
|
||||
|
||||
uint8_t u8g_com_stm32duino_tft_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr) {
|
||||
uint8_t u8g_com_hal_tft_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr) {
|
||||
if (msgInitCount) {
|
||||
if (msg == U8G_COM_MSG_INIT) msgInitCount--;
|
||||
if (msgInitCount) return -1;
|
||||
@ -801,7 +801,7 @@ uint8_t u8g_com_stm32duino_tft_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void
|
||||
break;
|
||||
|
||||
case U8G_COM_MSG_WRITE_SEQ:
|
||||
tftio.DataTransferBegin(DATASIZE_8BIT);
|
||||
tftio.DataTransferBegin(DATASIZE_16BIT);
|
||||
for (uint8_t i = 0; i < arg_val; i += 2)
|
||||
tftio.WriteData(*(uint16_t *)(((uint32_t)arg_ptr) + i));
|
||||
tftio.DataTransferEnd();
|
||||
|
Reference in New Issue
Block a user