9494#define PIN_BCKL_OFF 1 // GPIO value for backlight OFF
9595// ---------------------------------------------------------
9696
97+ #elif CONFIG_EXAMPLE_DISPLAY_TYPE == 3
98+
99+ // ** Set the correct configuration for M5Stack TFT
100+ // ---------------------------------------------------------
101+ #define DEFAULT_DISP_TYPE DISP_TYPE_ILI9341
102+ #define DEFAULT_TFT_DISPLAY_WIDTH 320
103+ #define DEFAULT_TFT_DISPLAY_HEIGHT 240
104+ #define DISP_COLOR_BITS_24 0x66
105+ #define DEFAULT_GAMMA_CURVE 0
106+ #define DEFAULT_SPI_CLOCK 26000000
107+ #define TFT_INVERT_ROTATION 0
108+ #define TFT_INVERT_ROTATION1 0
109+ #define TFT_INVERT_ROTATION2 1 // Adapte M5Stack TFT
110+ #define TFT_RGB_BGR 0x08
111+
112+ #define USE_TOUCH TOUCH_TYPE_NONE
113+
114+ #define PIN_NUM_MISO 19 // SPI MISO
115+ #define PIN_NUM_MOSI 23 // SPI MOSI
116+ #define PIN_NUM_CLK 18 // SPI CLOCK pin
117+ #define PIN_NUM_CS 14 // Display CS pin
118+ #define PIN_NUM_DC 27 // Display command/data pin
119+ #define PIN_NUM_TCS 0 // Touch screen CS pin (NOT used if USE_TOUCH=0)
120+
121+ #define PIN_NUM_RST 33 // GPIO used for RESET control (#16)
122+ #define PIN_NUM_BCKL 32 // GPIO used for backlight control
123+ #define PIN_BCKL_ON 1 // GPIO value for backlight ON
124+ #define PIN_BCKL_OFF 0 // GPIO value for backlight OFF
125+ // ---------------------------------------------------------
126+
97127#else
98128
99129// Configuration for other boards, set the correct values for the display used
@@ -644,4 +674,4 @@ uint32_t stmpe610_getID();
644674
645675// ===============================================================================
646676
647- #endif
677+ #endif
0 commit comments