refactor(doorbell): migrate ESP32-S3 to ESP_IOExpander library

This commit is contained in:
2026-02-16 20:51:56 -08:00
parent c7ea8d5817
commit 89f3248747
6 changed files with 225 additions and 2126 deletions

View File

@@ -1,52 +1,41 @@
#pragma once
#define BOARD_NAME "WS_S3_43"
#define DISPLAY_WIDTH 800
#define DISPLAY_HEIGHT 480
#define DISPLAY_ROTATION 0 // landscape, USB-C on left
#define BOARD_NAME "WS_S3_43"
#define DISPLAY_WIDTH 800
#define DISPLAY_HEIGHT 480
#define DISPLAY_ROTATION 0
// ── RGB parallel bus pins (directly to ST7262 panel) ──
#define LCD_DE 40
#define LCD_VSYNC 41
#define LCD_HSYNC 39
#define LCD_PCLK 42
// ── RGB parallel bus (from Westcott1 reference) ──
#define LCD_DE 5
#define LCD_VSYNC 3
#define LCD_HSYNC 46
#define LCD_PCLK 7
#define LCD_R0 45
#define LCD_R1 48
#define LCD_R2 47
#define LCD_R3 21
#define LCD_R4 14
#define LCD_R0 1
#define LCD_R1 2
#define LCD_R2 42
#define LCD_R3 41
#define LCD_R4 40
#define LCD_G0 5
#define LCD_G1 6
#define LCD_G2 7
#define LCD_G3 15
#define LCD_G4 16
#define LCD_G5 4
#define LCD_G0 39
#define LCD_G1 0
#define LCD_G2 45
#define LCD_G3 48
#define LCD_G4 47
#define LCD_G5 21
#define LCD_B0 8
#define LCD_B1 3
#define LCD_B2 46
#define LCD_B3 9
#define LCD_B4 1
#define LCD_B0 14
#define LCD_B1 38
#define LCD_B2 18
#define LCD_B3 17
#define LCD_B4 10
// ── CH422G I2C IO expander ──
// Controls LCD_RST, TP_RST, LCD_BL, SD_CS via I2C
#define I2C_SDA 17
#define I2C_SCL 18
#define I2C_FREQ 100000
// CH422G I2C command addresses
#define CH422G_WRITE_OC 0x46
#define CH422G_SET_MODE 0x48
#define CH422G_READ_IN 0x4C
// EXIO bit positions
#define EXIO_TP_RST (1 << 0) // EXIO1
#define EXIO_LCD_BL (1 << 1) // EXIO2 — also drives DISP signal!
#define EXIO_LCD_RST (1 << 2) // EXIO3
#define EXIO_SD_CS (1 << 3) // EXIO4
// ── I2C bus (shared: CH422G + GT911) ──
#define I2C_MASTER_NUM 0
#define I2C_MASTER_SDA 8
#define I2C_MASTER_SCL 9
// ── GT911 Touch ──
#define GT911_ADDR 0x5D
#define TOUCH_INT -1 // not wired to a readable GPIO on this board
#define GT911_ADDR 0x5D
#define TOUCH_INT -1