3.0 KiB
Board Configuration System
This directory contains board-specific configuration files for different hardware setups.
How to Switch Boards
Edit board_config.h and uncomment the board you want to use:
// ---- SELECT YOUR BOARD HERE ----
#define BOARD_FEATHER_TFT // Feather RP2350 + 4.0" TFT ST7796
// #define BOARD_PICO2_TFT // Pico 2 + 4.0" TFT ST7796
// #define BOARD_PICO2_EINK // Pico 2 + E-Ink Display
// --------------------------------
Important: Only one board should be uncommented at a time!
Available Boards
1. BOARD_FEATHER_TFT
File: board_feather_tft.h
Hardware: Adafruit Feather RP2350 with 4.0" TFT ST7796
Display: ST7796 (480x320 RGB TFT)
Touch: FT6336U capacitive touch
Features: High-speed refresh, backlight control, SD card
2. BOARD_PICO2_TFT
File: board_pico2_tft.h
Hardware: Raspberry Pi Pico 2 with 4.0" TFT ST7796
Display: ST7796 (480x320 RGB TFT)
Touch: FT6336U capacitive touch
Features: High-speed refresh, backlight control, SD card
3. BOARD_PICO2_EINK
File: board_pico2_eink.h
Hardware: Raspberry Pi Pico 2 with E-Ink Display
Display: E-Paper (400x300 monochrome)
Touch: None (configurable)
Features: Ultra low power, BUSY pin for refresh status
Adding a New Board
- Create a new header file:
board_configs/board_your_name.h - Copy the structure from an existing board file
- Update all pin definitions for your hardware
- Add a
#define BOARD_YOUR_NAMEoption inboard_config.h - Add an
#elif defined(BOARD_YOUR_NAME)section
Configuration Structure
Each board config file must define:
Display Settings
BOARD_NAME- Human-readable board nameDISPLAY_WIDTH,DISPLAY_HEIGHT- Screen dimensionsDISPLAY_TYPE_SELECTED- Display driver type (0=ST7796, 2=EPAPER)
Display Pins
DISPLAY_SPI_PORT- SPI instance (spi0 or spi1)DISPLAY_SCK_PIN,DISPLAY_MOSI_PIN,DISPLAY_MISO_PINDISPLAY_CS_PIN- Chip selectDISPLAY_DC_PIN- Data/CommandDISPLAY_RST_PIN- ResetDISPLAY_BL_PIN- Backlight (-1 for e-ink)DISPLAY_BUSY_PIN- E-paper busy signal (-1 for TFT)
Touch Settings
TOUCH_TYPE_SELECTED- Touch driver type (0=FT6336U, 1=NONE)TOUCH_SWAP_XY,TOUCH_INVERT_X,TOUCH_INVERT_Y- Orientation
Touch Pins
TOUCH_I2C_PORT- I2C instance (i2c0 or i2c1)TOUCH_SDA_PIN,TOUCH_SCL_PINTOUCH_INT_PIN- InterruptTOUCH_RST_PIN- Reset
SD Card Pins (Optional)
SD_SPI_PORT,SD_CS_PIN,SD_MISO_PIN,SD_MOSI_PIN,SD_SCK_PIN
Timing
SPI_BAUDRATE- SPI clock speed (32MHz for TFT, 4MHz for e-ink)I2C_BAUDRATE- I2C clock speed (typically 400kHz)
Build Process
The build system automatically uses the selected board configuration:
# Build for currently selected board
mkdir -p build
cd build
cmake ..
make -j4
No need to specify board-specific CMake flags - just edit board_config.h to switch!