|
185 | 185 |
|
186 | 186 | // The pins configured here are the native spi pins for HSPI interface |
187 | 187 | // Any other valid pin combination can be used |
188 | | -#define PIN_NUM_MISO 19 // SPI MISO |
189 | | -#define PIN_NUM_MOSI 23 // SPI MOSI |
190 | | -#define PIN_NUM_CLK 18 // SPI CLOCK pin |
191 | | -#define PIN_NUM_CS 5 // Display CS pin |
192 | | -#define PIN_NUM_DC 26 // Display command/data pin |
193 | | -#define PIN_NUM_TCS 25 // Touch screen CS pin (NOT used if USE_TOUCH=0) |
194 | 188 |
|
195 | | -// -------------------------------------------------------------- |
196 | | -// ** Set Reset and Backlight pins to 0 if not used ! |
197 | | -// ** If you want to use them, set them to some valid GPIO number |
| 189 | +#if defined(CONFIG_TFT_PIN_NUM_MISO) |
| 190 | +#define PIN_NUM_MISO CONFIG_TFT_PIN_NUM_MISO |
| 191 | +#else |
| 192 | +#define PIN_NUM_MISO 19 |
| 193 | +#endif |
| 194 | + |
| 195 | +#if defined(CONFIG_TFT_PIN_NUM_MOSI) |
| 196 | +#define PIN_NUM_MOSI CONFIG_TFT_PIN_NUM_MOSI |
| 197 | +#else |
| 198 | +#define PIN_NUM_MOSI 23 |
| 199 | +#endif |
| 200 | + |
| 201 | +#if defined(CONFIG_TFT_PIN_NUM_CLK) |
| 202 | +#define PIN_NUM_CLK CONFIG_TFT_PIN_NUM_CLK |
| 203 | +#else |
| 204 | +#define PIN_NUM_CLK 18 |
| 205 | +#endif |
| 206 | + |
| 207 | +#if defined(CONFIG_TFT_PIN_NUM_CS) |
| 208 | +#define PIN_NUM_CS CONFIG_TFT_PIN_NUM_CS |
| 209 | +#else |
| 210 | +#define PIN_NUM_CS 5 |
| 211 | +#endif |
| 212 | + |
| 213 | +#if defined(CONFIG_TFT_PIN_NUM_DC) |
| 214 | +#define PIN_NUM_DC CONFIG_TFT_PIN_NUM_DC |
| 215 | +#else |
| 216 | +#define PIN_NUM_DC 26 |
| 217 | +#endif |
| 218 | + |
| 219 | +#if defined(CONFIG_TFT_PIN_NUM_TCS) |
| 220 | +#define PIN_NUM_TCS CONFIG_TFT_PIN_NUM_TCS |
| 221 | +#else |
| 222 | +#define PIN_NUM_TCS 25 |
| 223 | +#endif |
198 | 224 |
|
199 | | -// GPIO used for RESET control |
200 | 225 | #if defined(CONFIG_TFT_PIN_NUM_RST) |
201 | 226 | #define PIN_NUM_RST CONFIG_TFT_PIN_NUM_RST |
202 | 227 | #else |
203 | 228 | #define PIN_NUM_RST 0 |
204 | 229 | #endif |
205 | 230 |
|
206 | | -#define PIN_NUM_BCKL 0 // GPIO used for backlight control |
| 231 | +#if defined(CONFIG_TFT_PIN_NUM_BCKL) |
| 232 | +#define PIN_NUM_BCKL CONFIG_TFT_PIN_NUM_BCKL |
| 233 | +#else |
| 234 | +#define PIN_NUM_BCKL 0 |
| 235 | +#endif |
| 236 | + |
207 | 237 | #define PIN_BCKL_ON 0 // GPIO value for backlight ON |
208 | 238 | #define PIN_BCKL_OFF 1 // GPIO value for backlight OFF |
209 | 239 | // -------------------------------------------------------------- |
210 | 240 |
|
211 | | -// ####################################################### |
212 | | -// Set this to 1 if you want to use touch screen functions |
213 | | -// ####################################################### |
214 | | -#define USE_TOUCH TOUCH_TYPE_NONE |
215 | | -// ####################################################### |
| 241 | +#if defined(CONFIG_TFT_ENABLE_TOUCH_SCREEN) |
| 242 | +#define USE_TOUCH CONFIG_TFT_ENABLE_TOUCH_SCREEN |
| 243 | +#else |
| 244 | +#define USE_TOUCH TOUCH_TYPE_NONE |
| 245 | +#endif |
216 | 246 |
|
217 | 247 | // ####################################################################### |
218 | 248 | // Default display width (smaller dimension) and height (larger dimension) |
|
0 commit comments