ioc changed hard spi tft

This commit is contained in:
TuxMonkey
2026-07-20 16:41:16 +08:00
parent f92585831a
commit 9ea9ddf310
4 changed files with 28 additions and 8 deletions

View File

@@ -158,6 +158,18 @@ static void tft_write_bytes(const uint8_t *data, uint32_t len)
#else
while (len > 0U)
{
#if TFT_HW_SPI_BYTE_MODE && TFT_HW_SPI_PULSE_CS
tft_cs_low();
if (HAL_SPI_Transmit(&TFT_SPI_UNIT, (uint8_t *) data, 1U, TFT_SPI_TIMEOUT_MS) != HAL_OK)
{
tft_transfer_ok = false;
tft_cs_high();
return;
}
tft_cs_high();
data++;
len--;
#else
#if TFT_HW_SPI_BYTE_MODE
uint16_t chunk = 1U;
#else
@@ -171,6 +183,7 @@ static void tft_write_bytes(const uint8_t *data, uint32_t len)
}
data += chunk;
len -= chunk;
#endif
}
#endif
}

View File

@@ -11,8 +11,9 @@ extern "C" {
#endif
#define TFT_USE_HORIZONTAL 2U
#define TFT_USE_SOFT_SPI 1U
#define TFT_USE_SOFT_SPI 0U
#define TFT_HW_SPI_BYTE_MODE 1U
#define TFT_HW_SPI_PULSE_CS 1U
#if (TFT_USE_HORIZONTAL == 0U) || (TFT_USE_HORIZONTAL == 1U)
#define TFT_LCD_W 240U