init_bus

Function init_bus 

Source
pub fn init_bus(spi: SpiBusInner) -> &'static SpiBusWrapper
Expand description

Places the raw SPI bus into a 'static shared wrapper and returns a 'static reference to it.

This is called once by crate::Lilka::init after init_spi_master. The specific wrapper type depends on the active bus-sharing feature (see SpiBusWrapper).

§Panics

Panics if called more than once (the internal StaticCell can only be initialised once).

§Example

use lilkaoxide::{init_bus, init_spi_master};

// spi comes from init_spi_master(...)
let bus: &'static _ = init_bus(spi);