[][src]Struct stm32h7_sdmmc::Sdmmc

pub struct Sdmmc<SDMMC> { /* fields omitted */ }

Sdmmc device

Implementations

impl Sdmmc<SDMMC1>[src]

pub fn sdmmc1(
    sdmmc: SDMMC1,
    bus_width: BusWidth,
    prec: Sdmmc1,
    clocks: &CoreClocks
) -> Self
[src]

Initialise SDMMC peripheral

pub fn init_card(&mut self, freq: impl Into<Hertz>) -> Result<(), Error>[src]

Initializes card (if present) and sets the bus at the specified frequency.

pub fn card(&self) -> Result<&Card, Error>[src]

Get a reference to the initialized card

Errors

Returns Error::NoCard if init_card has not previously succeeded

pub fn clock(&self) -> Hertz[src]

Get the current SDMMC bus clock

pub fn read_block(
    &mut self,
    address: u32,
    buffer: &mut [u8; 512]
) -> Result<(), Error>
[src]

Read block from card.

address is the block address.

pub fn read_blocks(
    &mut self,
    address: u32,
    buffer: &mut [u8]
) -> Result<(), Error>
[src]

Read mutliple blocks from card. The length of the buffer must be multiple of 512.

address is the block address.

pub fn write_block(
    &mut self,
    address: u32,
    buffer: &[u8; 512]
) -> Result<(), Error>
[src]

Write block to card. Buffer must be 512 bytes

impl Sdmmc<SDMMC2>[src]

pub fn sdmmc2(
    sdmmc: SDMMC2,
    bus_width: BusWidth,
    prec: Sdmmc2,
    clocks: &CoreClocks
) -> Self
[src]

Initialise SDMMC peripheral

pub fn init_card(&mut self, freq: impl Into<Hertz>) -> Result<(), Error>[src]

Initializes card (if present) and sets the bus at the specified frequency.

pub fn card(&self) -> Result<&Card, Error>[src]

Get a reference to the initialized card

Errors

Returns Error::NoCard if init_card has not previously succeeded

pub fn clock(&self) -> Hertz[src]

Get the current SDMMC bus clock

pub fn read_block(
    &mut self,
    address: u32,
    buffer: &mut [u8; 512]
) -> Result<(), Error>
[src]

Read block from card.

address is the block address.

pub fn read_blocks(
    &mut self,
    address: u32,
    buffer: &mut [u8]
) -> Result<(), Error>
[src]

Read mutliple blocks from card. The length of the buffer must be multiple of 512.

address is the block address.

pub fn write_block(
    &mut self,
    address: u32,
    buffer: &[u8; 512]
) -> Result<(), Error>
[src]

Write block to card. Buffer must be 512 bytes

Trait Implementations

impl<SDMMC> Debug for Sdmmc<SDMMC>[src]

Auto Trait Implementations

impl<SDMMC> Send for Sdmmc<SDMMC> where
    SDMMC: Send

impl<SDMMC> Sync for Sdmmc<SDMMC> where
    SDMMC: Sync

impl<SDMMC> Unpin for Sdmmc<SDMMC> where
    SDMMC: Unpin

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.