feat(platform): adapt GPIO configuration to new board
This commit is contained in:
+27
-26
@@ -1,40 +1,41 @@
|
||||
# ESP32-S3 GPIO Map
|
||||
|
||||
This document defines the active firmware GPIO assignments for the current
|
||||
battery-sensing ESP32-S3 board revision. Signal direction is described from the
|
||||
MCU's perspective. Older 2026-07-24 drawings assigned GPIO9 to a legacy power
|
||||
hold net; that assignment is not valid for the current board.
|
||||
This document describes the new upper/lower board in
|
||||
`schematic/电机-马达方案.pdf` (upper board updated 2026-10-19; lower board
|
||||
updated 2026-10-12). Directions are from the MCU's perspective. Firmware GPIO
|
||||
settings are collected under `TQ Cat Configuration -> Board Hardware
|
||||
Configuration (GPIO)`; see [firmware usage](firmware-pin-usage.md).
|
||||
|
||||
## GPIO Table
|
||||
|
||||
| U5 Pin | GPIO | Net | Direction | Connection / Function | Notes |
|
||||
| U11 Module Pin | GPIO | Net | Direction | Connection / Function | Notes |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| 1 | GND | GND | N/A | Ground reference | Ground reference |
|
||||
| 2 | 3V3 | 3V3 | Power | 3.3 V supply rail | Power rail |
|
||||
| 3 | EN/RST | EN | Input | Chip enable and reset input | Reset and enable |
|
||||
| 4 | GPIO4 | TP_INT | Bidirectional | Optional touch interrupt / reusable IO | Not connected by the 8-wire LCD adapter |
|
||||
| 5 | GPIO5 | TP_SDA | Bidirectional | Optional touch I2C SDA / reusable IO | Not connected by the 8-wire LCD adapter |
|
||||
| 6 | GPIO6 | TP_SCL | Input | Rocker microswitch / original SW2 function | Reuses the touch-clock contact left open by the 8-wire LCD adapter; active-low with internal pull-up |
|
||||
| 7 | GPIO7 | BLK | Output | LCD adapter backlight control | Active-high firmware default |
|
||||
| 8 | GPIO15 | CS | Output | ST7789P3 SPI chip select | Active low |
|
||||
| 9 | GPIO16 | DC | Output | ST7789P3 data/command select | Also named A0 by the panel specification |
|
||||
| 10 | GPIO17 | RES | Output | ST7789P3 hardware reset | Active low |
|
||||
| 11 | GPIO18 | MOSI | Output | ST7789P3 SPI data / SDA | 4-line SPI write data |
|
||||
| 12 | GPIO8 | CLK / Swing | Output | ST7789P3 SPI clock | Do not drive the Swing function while the LCD is connected |
|
||||
| 4 | GPIO4 | BLK | Output | LCD backlight enable | Active high; old RMT output is not started |
|
||||
| 5 | GPIO5 | CS | Output | ST7789P3 SPI chip select | Old pulse output is not started |
|
||||
| 6 | GPIO6 | DC | Output | ST7789P3 data/command | Do not use old microswitch wiring |
|
||||
| 7 | GPIO7 | RES | Output | ST7789P3 reset | Active low |
|
||||
| 8 | GPIO15 | SDA | Output | ST7789P3 SPI MOSI | SPI data, not I2C SDA |
|
||||
| 9 | GPIO16 | SCL | Output | ST7789P3 SPI clock | SPI clock, not I2C SCL |
|
||||
| 10 | GPIO17 | 电量检测 | Analog input | Battery voltage sense | Lower-board R6/R11=100 kOhm each, Q5/Q6 switching; upper-board C31 filter |
|
||||
| 11 | GPIO18 | 充电检测 | Input | TP4056 CHRG# via Q7 | Low-active assumption requires hardware verification |
|
||||
| 12 | GPIO8 | 充满检测 | Input | TP4056 STDBY# via Q8 | Not consumed by current firmware; no new option added |
|
||||
| 13 | GPIO19 | ESP_D_N | Bidirectional | USB D- | Type-C |
|
||||
| 14 | GPIO20 | ESP_D_P | Bidirectional | USB D+ | Type-C |
|
||||
| 15 | GPIO3 | touch | Input | TTP223 touch-button output | Present on the board but not consumed by the current input policy |
|
||||
| 15 | GPIO3 | NC | N/A | No assigned net | Old touch input moved to GPIO13 |
|
||||
| 16 | GPIO46 | UNASSIGNED | N/A | No connection assigned | Reserved; no signal assigned |
|
||||
| 17 | GPIO9 | Power_t | Analog input | Battery voltage sense | R17=100 kOhm from VBAT and R18=100 kOhm to GND; ADC voltage is one half of VBAT |
|
||||
| 18 | GPIO10 | Charge | Input | TP4057 charger status | Active-low while charging; high means full or external power absent |
|
||||
| 19 | GPIO11 | PA_CTRL | Output | Audio power-amplifier enable | Amplifier control |
|
||||
| 20 | GPIO12 | SW1 | Input | Button 1 / turntable calibration switch | External 10 kOhm pull-up; active low |
|
||||
| 21 | GPIO13 | SW2 | Input | Button 2 / K2 push-to-talk input | External 10 kOhm pull-up; active low |
|
||||
| 22 | GPIO14 | UNASSIGNED / RESET_KEY | Optional input | Configurable Wi-Fi reset button | Unassigned and disabled by default; active-low with internal pull-up when enabled |
|
||||
| 23 | GPIO21 | IN4 | Output | ULN2003 IN4 | Stepper motor phase control |
|
||||
| 17 | GPIO9 | PA_CTRL | Output | Audio amplifier enable | Not a battery ADC input on this board |
|
||||
| 18 | GPIO10 | 马达控制 | Output | Q3 low-side DC rocker-motor control | Not consumed by current firmware; external R30 pull-down |
|
||||
| 19 | GPIO11 | 开关1 | Input | Turntable calibration switch | External 10 kOhm pull-up; active low |
|
||||
| 20 | GPIO12 | 开关2 | Input | Slot/fortune input | External 10 kOhm pull-up; active low |
|
||||
| 21 | GPIO13 | 触摸铜箔 | Input | TTP223 output / PTT | Verify actual touch polarity; firmware retains previous active-level setting |
|
||||
| 22 | GPIO14 | IN1 | Output | ULN2003 IN1 | Optional Wi-Fi reset must remain disabled on this pin |
|
||||
| 23 | GPIO21 | IN2 | Output | ULN2003 IN2 | Stepper phase control |
|
||||
| 24 | GPIO47 | IN3 | Output | ULN2003 IN3 | Stepper motor phase control |
|
||||
| 25 | GPIO48 | IN2 | Output | ULN2003 IN2 | Stepper motor phase control |
|
||||
| 26 | GPIO45 | IN1 | Output | ULN2003 IN1 | Stepper motor phase control |
|
||||
| 25 | GPIO48 | IN4 | Output | ULN2003 IN4 | Stepper phase control |
|
||||
| 26 | GPIO45 | NC | N/A | No assigned net | No longer stepper IN1 |
|
||||
| 27 | GPIO0 | BOOT | Input | Boot/download switch | 10 kOhm pull-up to 3V3 |
|
||||
| 28 | GPIO35 | UNASSIGNED | N/A | No connection assigned | Reserved; no signal assigned |
|
||||
| 29 | GPIO36 | UNASSIGNED | N/A | No connection assigned | Reserved; no signal assigned |
|
||||
@@ -44,8 +45,8 @@ hold net; that assignment is not valid for the current board.
|
||||
| 33 | GPIO40 | I2S_DSDIN | Output | ES8311 DSDIN | Audio interface |
|
||||
| 34 | GPIO41 | I2S_LRCK | Output | ES8311 LRCK | Audio interface |
|
||||
| 35 | GPIO42 | I2S_ASDOUT | Input | ES8311 ASDOUT | Audio interface |
|
||||
| 36 | RXD0 | esp_tx | Input | Debug UART | Routed to J2 |
|
||||
| 37 | TXD0 | esp_rx | Output | Debug UART | Routed to J2 |
|
||||
| 36 | RXD0 | TX | Input | UART0 RX | Routed to CN5; connector net names reflect the opposite endpoint |
|
||||
| 37 | TXD0 | RX | Output | UART0 TX | Routed to CN5; connector net names reflect the opposite endpoint |
|
||||
| 38 | GPIO2 | IO2_I2C_SCL | Bidirectional | ES8311 control interface SCL | Audio codec |
|
||||
| 39 | GPIO1 | IO1_I2C_SDA | Bidirectional | ES8311 control interface SDA | Audio codec |
|
||||
| 40 | GND | GND | N/A | Ground reference | Ground reference |
|
||||
|
||||
Reference in New Issue
Block a user