ioc changed soft spi tft

This commit is contained in:
TuxMonkey
2026-07-20 16:29:06 +08:00
parent cda936d7e0
commit f92585831a
11 changed files with 271 additions and 152 deletions

View File

@@ -10,7 +10,9 @@
extern "C" {
#endif
#define TFT_USE_HORIZONTAL 2U
#define TFT_USE_HORIZONTAL 2U
#define TFT_USE_SOFT_SPI 1U
#define TFT_HW_SPI_BYTE_MODE 1U
#if (TFT_USE_HORIZONTAL == 0U) || (TFT_USE_HORIZONTAL == 1U)
#define TFT_LCD_W 240U
@@ -24,6 +26,16 @@ extern "C" {
#define TFT_SPI_UNIT hspi1
#endif
#ifndef TFT_SCK_GPIO_Port
#define TFT_SCK_GPIO_Port GPIOB
#define TFT_SCK_Pin GPIO_PIN_3
#endif
#ifndef TFT_MOSI_GPIO_Port
#define TFT_MOSI_GPIO_Port GPIOD
#define TFT_MOSI_Pin GPIO_PIN_7
#endif
#if defined(LCD_CS_GPIO_Port) && defined(LCD_CS_Pin)
#define TFT_CS_GPIO_Port LCD_CS_GPIO_Port
#define TFT_CS_Pin LCD_CS_Pin
@@ -68,6 +80,7 @@ extern "C" {
#define TFT_COLOR_LIGHT_GRAY 0xC618U
void TFT_Init(void);
void TFT_ShowBootScreen(void);
void TFT_Clear(uint16_t color);
void TFT_FillRect(uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint16_t color);
void TFT_DrawPoint(uint16_t x, uint16_t y, uint16_t color);