Expand description
Board Support Package for ssh-stamp-esp32.
Board definitions live in boards/*.toml (one file per board, containing
pin mappings and an optional documentation URL). The build.rs reads
those TOML files and generates all Rust code — board structs, the
take_uart_pins! macro, and the select_board! macro — into
OUT_DIR/boards_gen.rs, which is included here.
The TOML files are the single source of truth for pin numbers. No human writes or edits the generated Rust code.
§Board catalog
Pin allocation for every board of this platform, generated from its
boards/*.toml files on each cargo doc (cargo xtask <board> doc) run. The TOML
files are the single source of truth: this table is the only place the
allocation is written down, and no README, guide or hand-written doc page
repeats it.
| Board | Chip | UART RX | UART TX | CAN TX | CAN RX | I2C SDA | I2C SCL |
|---|---|---|---|---|---|---|---|
esp32-s2-saola | esp32s2 | 10 | 11 | x | x | x | x |
esp32c5-devkitc | esp32c5 | 8 | 9 | x | x | x | x |
esp32c6-devkitc | esp32c6 | 10 | 11 | x | x | x | x |
esp32c61-devkitc | esp32c61 | 2 | 3 | x | x | x | x |
waveshare-esp32-s3-touch-lcd-43 | esp32s3 | 44 | 43 | 20 | 19 | 8 (mux) | 9 (mux) |
Cells are GPIO numbers. x marks a bus that is neither supported nor tested
on that board yet — either the hardware does not break it out, or nothing has
driven it there so far. Adding the pins to the board’s TOML is what fills the
cell in, here and in the firmware.
Pins marked (mux) are not a bus of their own: the firmware drives them to
steer an on-board switch or IO expander (the [can_mux] section of the
board’s TOML) before it can use the bus they route.
Select a board with cargo xtask <board> build, or with
--features board-<board> when driving cargo directly.
§Adding a board
- Create
boards/{board-name}.tomlwith a[pins]section (uart_rxanduart_tx, pluscan_tx/can_rxandi2c_sda/i2c_sclfor the buses the board breaks out), a[build]section naming its chip, and an optionalurl. - Add
board-{name} = []to[features]inCargo.toml.
No .rs file, no macro editing, no binary changes. The build.rs
validates that selected features have matching TOML files, and the board
shows up in the catalog above on the next cargo xtask <board> doc.
Macros§
- select_
board - Select the active board type
Bat compile time. - setup_
can_ transceiver - Prepare the board’s CAN transceiver routing, if it needs any.
- take_
can_ pins - Extract CAN GPIO pins from
peripherals. - take_
uart_ pins - Extract UART GPIO pins and logical pin numbers from
peripherals.
Structs§
- Esp32
S2Saola - Board: esp32-s2-saola.
- Esp32c5
Devkitc - Board: esp32c5-devkitc.
- Esp32c6
Devkitc - Board: esp32c6-devkitc.
- Esp32c61
Devkitc - Board: esp32c61-devkitc.
- Waveshare
Esp32 S3Touch Lcd43 - Board: waveshare-esp32-s3-touch-lcd-43.
Traits§
- Board
- Board identification trait.