pub struct Sdmmc<'d, T: Instance, Dma: SdioDma<T> = NoDma> { /* private fields */ }Expand description
Sdmmc device
Implementations§
Source§impl<'d, T: Instance, Dma: SdioDma<T>> Sdmmc<'d, T, Dma>
impl<'d, T: Instance, Dma: SdioDma<T>> Sdmmc<'d, T, Dma>
Sourcepub fn new_1bit(
sdmmc: Peri<'d, T>,
_irq: impl Binding<T::Interrupt, InterruptHandler<T>> + 'd,
dma: Peri<'d, Dma>,
clk: Peri<'d, impl CkPin<T, 0>>,
cmd: Peri<'d, impl CmdPin<T, 0>>,
d0: Peri<'d, impl D0Pin<T, 0>>,
config: Config,
) -> Self
pub fn new_1bit( sdmmc: Peri<'d, T>, _irq: impl Binding<T::Interrupt, InterruptHandler<T>> + 'd, dma: Peri<'d, Dma>, clk: Peri<'d, impl CkPin<T, 0>>, cmd: Peri<'d, impl CmdPin<T, 0>>, d0: Peri<'d, impl D0Pin<T, 0>>, config: Config, ) -> Self
Create a new SDMMC driver, with 1 data lane.
Sourcepub fn new_4bit(
sdmmc: Peri<'d, T>,
_irq: impl Binding<T::Interrupt, InterruptHandler<T>> + 'd,
dma: Peri<'d, Dma>,
clk: Peri<'d, impl CkPin<T, 0>>,
cmd: Peri<'d, impl CmdPin<T, 0>>,
d0: Peri<'d, impl D0Pin<T, 0>>,
d1: Peri<'d, impl D1Pin<T, 0>>,
d2: Peri<'d, impl D2Pin<T, 0>>,
d3: Peri<'d, impl D3Pin<T, 0>>,
config: Config,
) -> Self
pub fn new_4bit( sdmmc: Peri<'d, T>, _irq: impl Binding<T::Interrupt, InterruptHandler<T>> + 'd, dma: Peri<'d, Dma>, clk: Peri<'d, impl CkPin<T, 0>>, cmd: Peri<'d, impl CmdPin<T, 0>>, d0: Peri<'d, impl D0Pin<T, 0>>, d1: Peri<'d, impl D1Pin<T, 0>>, d2: Peri<'d, impl D2Pin<T, 0>>, d3: Peri<'d, impl D3Pin<T, 0>>, config: Config, ) -> Self
Create a new SDMMC driver, with 4 data lanes.
Source§impl<'d, T: Instance, Dma: SdioDma<T> + 'd> Sdmmc<'d, T, Dma>
impl<'d, T: Instance, Dma: SdioDma<T> + 'd> Sdmmc<'d, T, Dma>
Sourcepub async fn init_card(&mut self, freq: Hertz) -> Result<(), Error>
pub async fn init_card(&mut self, freq: Hertz) -> Result<(), Error>
Initializes card (if present) and sets the bus at the specified frequency.
Sourcepub async fn read_block(
&mut self,
block_idx: u32,
buffer: &mut DataBlock,
) -> Result<(), Error>
pub async fn read_block( &mut self, block_idx: u32, buffer: &mut DataBlock, ) -> Result<(), Error>
Read a data block.
Sourcepub async fn write_block(
&mut self,
block_idx: u32,
buffer: &DataBlock,
) -> Result<(), Error>
pub async fn write_block( &mut self, block_idx: u32, buffer: &DataBlock, ) -> Result<(), Error>
Write a data block.