#ifndef BOARD_FEATHER_TFT_H
#define BOARD_FEATHER_TFT_H

#include "pico/stdlib.h"

// ============================================================================
// Adafruit Feather RP2350 with 4.0" TFT ST7796
// ============================================================================

#define BOARD_NAME "Adafruit Feather RP2350 + 4.0\" TFT ST7796"

// Display Configuration
#define DISPLAY_WIDTH 480
#define DISPLAY_HEIGHT 320
#define DISPLAY_TYPE_SELECTED 0  // DISPLAY_TYPE_ST7796_VAL

// Touch Configuration
#define TOUCH_TYPE_SELECTED 0  // TOUCH_TYPE_FT6336U_VAL
#define TOUCH_SWAP_XY true
#define TOUCH_INVERT_X true
#define TOUCH_INVERT_Y false

// Invert display color (black <-> white)
#define DISPLAY_INVERT_COLOR true

// SPI pins for display - Feather RP2350 with 4.0" TFT
#define DISPLAY_SPI_PORT spi1
#define DISPLAY_SCK_PIN  10   // D10 (SCK)
#define DISPLAY_MOSI_PIN 11   // D11 (MOSI)
#define DISPLAY_MISO_PIN 20   // Not used for display
#define DISPLAY_CS_PIN   7    // D13 (CS)
#define DISPLAY_DC_PIN   4    // D4 (DC)
#define DISPLAY_RST_PIN  9    // D9 (RST)
#define DISPLAY_BL_PIN   6    // D6 (Backlight)
#define DISPLAY_BUSY_PIN -1   // Not used for TFT

// I2C pins for touch - Feather I2C default
#define TOUCH_I2C_PORT i2c1
#define TOUCH_SDA_PIN  2
#define TOUCH_SCL_PIN  3
#define TOUCH_INT_PIN  25
#define TOUCH_RST_PIN  28

// SD card pins (shared SPI with display)
#define SD_SPI_PORT    spi1
#define SD_CS_PIN      5
#define SD_MISO_PIN    24
#define SD_MOSI_PIN    11
#define SD_SCK_PIN     10

// Common configuration
#define SPI_BAUDRATE (32 * 1000 * 1000)  // 32 MHz for display
#define I2C_BAUDRATE (400 * 1000)        // 400 kHz for touch

#endif // BOARD_FEATHER_TFT_H
