/*
 * TFT_eSPI User_Setup.h ILI9341 Configuration for ESP32 ATLAS AI
 *
 * INSTRUCTIONS:
 * 1. Install TFT_eSPI via Arduino Library Manager (search: TFT_eSPI by Bodmer)
 * 2. Locate the library folder:
 *      Windows: %USERPROFILE%\Documents\Arduino\libraries\TFT_eSPI\
 *      macOS:   ~/Documents/Arduino/libraries/TFT_eSPI/
 *      Linux:   ~/Arduino/libraries/TFT_eSPI/
 * 3. REPLACE the entire contents of User_Setup.h with the lines below
 *    (or copy the "BEGIN PASTE" block into the existing file, clearing
 *     all other driver/pin #defines first).
 * 4. Save, then compile & upload.
 *
 * BEGIN PASTE
 */

// Driver selection
#define ILI9341_DRIVER          // 2.8" ILI9341 TFT

// Display size
#define TFT_WIDTH   240
#define TFT_HEIGHT  320
// NOTE: We call tft.setRotation(1) in code → renders as 320×240 landscape

// Pin definitions (match your wiring)
#define TFT_CS   17     // Chip Select
#define TFT_DC   16     // Data/Command (RS)
#define TFT_RST  5     // Reset (or connect to EN/3.3V with 10k pull-up)
#define TFT_MOSI 23     // SPI MOSI
#define TFT_SCLK 18     // SPI Clock
#define TFT_MISO 19     // SPI MISO (optional for display, needed for touch)
#define TFT_BL   32  // LED back-light (only for ST7789 with backlight control pin)
// SPI bus speed
// 40 MHz is reliable for most ILI9341 modules on short wires.
// If you see display glitches, reduce to 27000000 or 20000000.
#define SPI_FREQUENCY       40000000
#define SPI_READ_FREQUENCY  20000000

// Colour order
// Most ILI9341 breakouts use BGR, but some use RGB.
// If colours look wrong (red/blue swapped), toggle this.
#define TFT_BGR_ORDER

// Font: built-in glyphs 1–4
#define LOAD_GLCD 
#define LOAD_FONT2    
#define LOAD_FONT4    
#define LOAD_FONT6   
#define LOAD_FONT7
#define LOAD_FONT8

// Smooth fonts (needed for drawString)
#define SMOOTH_FONT

// END PASTE

/*
 * IMPORTANT: Do NOT define any other driver (#define ILI9488_DRIVER etc.)
 * Only ONE driver must be active at a time.
 *
 * ALSO: Make sure User_Setup_Select.h still includes the default path:
 *   #include <User_Setup.h>
 * and that no alternative setup file is uncommented there.
 */

