mirror of
https://gitee.com/dlmu-cone/tronone-h7-scaffold
synced 2026-07-24 03:27:45 +08:00
ioc changed hard spi tft
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user