pub struct Spi2Parts {
pub bus: SpiBusType,
/* private fields */
}Expand description
The constructed bus + display pins, between Spi2Resources::into_parts
and Spi2Parts::finish. bus is still exclusive here — the window for
the app’s SD pre-init (see the module docs).
Fields§
§bus: SpiBusTypeExclusive DMA bus (not yet shared) for sdspi::sd_init.
Implementations§
Source§impl Spi2Parts
impl Spi2Parts
Sourcepub async fn finish<CS>(
self,
card_cs: CS,
) -> Result<(DisplayDriver, CardSpiDevice<CS>), DisplayInitError>
pub async fn finish<CS>( self, card_cs: CS, ) -> Result<(DisplayDriver, CardSpiDevice<CS>), DisplayInitError>
Share the bus, initialise the display, and build the SD-card device.
The display comes up first and unconditionally — it must work even when the SD card is dead or absent, so the system keeps a UI. On CoreS3 this also restores GPIO35 to high-impedance MISO input afterwards (see the module docs); on Fire27 it turns the backlight on after a successful init.
On CoreS3 the panel must be out of reset before this is called:
wait for power_display_reset
(AW9523B LCD_RST pulse) — bounded, so a wedged I2C init can’t
freeze the display task forever.
Sourcepub async fn finish_sd<CS>(
self,
card_cs: CS,
presence: CardPresence,
) -> Result<(DisplayDriver, PreparedCard<CS>), DisplayInitError>where
CS: OutputPin,
pub async fn finish_sd<CS>(
self,
card_cs: CS,
presence: CardPresence,
) -> Result<(DisplayDriver, PreparedCard<CS>), DisplayInitError>where
CS: OutputPin,
Publish-safe full SD bring-up, layered on [finish].
Runs the mandatory ≥74-clock power-up idle on the still-exclusive
bus (chip-select deasserted), brings the display up unconditionally
(see [finish]), and hands back a presence-resolved
PreparedCard. The app owns only the final
SdSpi::new(prepared.into_inner()).init() plus its retry/degrade
policy — no SD-driver type enters the BSP graph.
CardPresence::ForceAbsent reaches the app’s normal SD-absent
degrade path with a card inserted: the freeze takes effect at the
first CS assert inside SdSpi::init(), so real-absent and
forced-absent share one degrade path.