hardware button support

This commit is contained in:
Adolfo Reyna
2026-01-29 15:23:03 -05:00
parent 1684eb0198
commit 8d0bca691a
7 changed files with 204 additions and 40 deletions

View File

@@ -20,33 +20,38 @@
#define TOUCH_INVERT_X false
#define TOUCH_INVERT_Y false
// SPI pins for E-Ink display (using SPI0)
#define DISPLAY_SPI_PORT spi0
#define DISPLAY_SCK_PIN 2 // GP2
#define DISPLAY_MOSI_PIN 3 // GP3
#define DISPLAY_MISO_PIN 4 // GP4 (often not used by e-paper)
#define DISPLAY_CS_PIN 5 // GP5
#define DISPLAY_DC_PIN 6 // GP6 (Data/Command)
#define DISPLAY_RST_PIN 7 // GP7 (Reset)
// SPI pins for E-Ink display (using SPI1)
#define DISPLAY_SPI_PORT spi1
#define DISPLAY_SCK_PIN 10 // GP10
#define DISPLAY_MOSI_PIN 11 // GP11
#define DISPLAY_MISO_PIN 12 // GP12 (often not used by e-paper)
#define DISPLAY_CS_PIN 9 // GP9
#define DISPLAY_DC_PIN 8 // GP8 (Data/Command)
#define DISPLAY_RST_PIN 12 // GP12 (Reset)
#define DISPLAY_BL_PIN 8 // GP8 - Not used for e-ink, but needs valid pin number
#define DISPLAY_BUSY_PIN 9 // GP9 - E-paper BUSY pin (critical!)
#define DISPLAY_BUSY_PIN 13 // GP13 - E-paper BUSY pin (critical!)
// I2C pins for touch (if using touch-enabled e-ink)
// I2C pins for touch (not used - this board has no touch)
// Dummy values to satisfy compilation, but TOUCH_TYPE_NONE means they won't be used
#define TOUCH_I2C_PORT i2c0
#define TOUCH_SDA_PIN 12 // GP12
#define TOUCH_SCL_PIN 13 // GP13
#define TOUCH_INT_PIN 14 // GP14
#define TOUCH_RST_PIN 15 // GP15
// SD card pins (separate SPI1) - optional
// SD card pins (not used - this board has no SD card slot)
// Dummy values to satisfy compilation, but won't be initialized
#define SD_SPI_PORT spi1
#define SD_CS_PIN 17 // GP17
#define SD_CS_PIN 22 // GP22 - dummy value
#define SD_MISO_PIN 16 // GP16
#define SD_MOSI_PIN 19 // GP19
#define SD_SCK_PIN 18 // GP18
// Button pins (Waveshare e-Paper has 2 user buttons)
#define BUTTON_KEY0_PIN 15 // GP15 - User key 0
#define BUTTON_KEY1_PIN 17 // GP17 - User key 1
// Common configuration
#define SPI_BAUDRATE (4 * 1000 * 1000) // 4 MHz for e-paper (slower than TFT)
#define I2C_BAUDRATE (400 * 1000) // 400 kHz for touch
#endif // BOARD_PICO2_EINK_H