Board constants
hub.board (hub._board_module) exposes board-
specific pin numbers and configuration. Values are set by the C
firmware from Board.h at compile time.
SD card
Attribute |
Meaning |
|---|---|
|
|
|
SDMMC slot number |
|
Chip-select (SPI mode) |
|
Clock (SPI mode) |
|
MOSI (SPI mode) |
|
MISO (SPI mode) |
|
SDMMC bus width, 1 or 4 |
|
SDMMC clock pin |
|
SDMMC command pin |
|
SDMMC data lines |
Mounting an SD card (SPI):
import machine, os, hub
b = hub.board
sd = machine.SDCard(slot=b.SD_SLOT, cs=machine.Pin(b.SD_CS),
sck=machine.Pin(b.SD_SCK),
mosi=machine.Pin(b.SD_MOSI),
miso=machine.Pin(b.SD_MISO))
os.mount(sd, "/sd")
Port pins
Each external port has two ID pins (analog-ID / LPF2 identification) and two H-bridge PWM channels:
Attribute |
Meaning |
|---|---|
|
Port |
|
Port |
Where x is A, B, C, D. These are exposed for
low-level board bring-up — for normal use, drive motors via the
port’s LPF2 API (Motors).