#[non_exhaustive]pub struct Board {Show 17 fields
pub display: DisplayResources<'static>,
pub backlight: BacklightResources<'static>,
pub sys_i2c: SysI2cResources<'static>,
pub keyboard: KeyboardResources<'static>,
pub audio: AudioResources<'static>,
pub spi_bus: SpiBusResources<'static>,
pub ext: ExtResources<'static>,
pub rmt: RmtResources<'static>,
pub battery: BatteryResources<'static>,
pub imu: ImuResources,
pub button: GPIO0<'static>,
pub grove: GroveResources<'static>,
pub fpc_io1: GPIO7<'static>,
pub radio: RadioResources<'static>,
pub system: SystemResources<'static>,
pub spare: SpareResources<'static>,
pub raw: RawResources<'static>,
}Expand description
Every peripheral of the chip, grouped by what the Cardputer ADV wires it
to. Create it with crate::init or Board::new.
Each group’s init borrows the group, so take the board as mut and
keep it for the life of the program; drivers are created from it and
dropped as apps come and go.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.display: DisplayResources<'static>ST7789V2 LCD (SPI3 + DMA channel 0).
backlight: BacklightResources<'static>LCD backlight, which also powers the RGB LED.
sys_i2c: SysI2cResources<'static>Internal I²C bus (keyboard, codec, IMU).
keyboard: KeyboardResources<'static>Keyboard scanner interrupt line (the scanner itself is on sys_i2c).
audio: AudioResources<'static>ES8311 codec I²S link.
spi_bus: SpiBusResources<'static>SPI bus shared by microSD and the EXT header.
ext: ExtResources<'static>EXT header control and UART lines.
rmt: RmtResources<'static>RMT pulse generator with the RGB LED and IR LED it drives.
battery: BatteryResources<'static>Battery voltage sense.
imu: ImuResourcesBMI270 IMU (on sys_i2c).
G0 button (active low). Read it with
Input::new(board.button.reborrow(), InputConfig::default().with_pull(Pull::Up)).
grove: GroveResources<'static>Grove port.
fpc_io1: GPIO7<'static>Spare line on the internal FPC connector.
radio: RadioResources<'static>Wi-Fi and Bluetooth radio.
system: SystemResources<'static>Peripherals not tied to a board function.
spare: SpareResources<'static>GPIOs and UART0 that the board leaves unrouted.
raw: RawResources<'static>Register-block peripherals for low-level or unsafe work.
Implementations§
Source§impl Board
impl Board
Sourcepub fn new(p: Peripherals) -> (Self, RtosResources)
pub fn new(p: Peripherals) -> (Self, RtosResources)
Splits esp_hal::init’s peripherals into board resource groups.
Peripherals tokens can’t be recovered once dropped (short of
unsafe stealing), so every peripheral is forwarded except exactly
three: SPI0/SPI1, which serve the flash cache (using them would
crash execution), and PSRAM, which the ESP32-S3FN8 does not have.