SdMmcSpi

Struct SdMmcSpi 

Source
pub struct SdMmcSpi<Spi: Transfer<u8>, Cs: OutputSwitch, Config: SdMmcSpiConfig> { /* private fields */ }
Expand description

SD Card SPI driver.

Spi - SPI. Cs - Chip select output switch. Config - Config implementation of driver config trait.

Implementations§

Source§

impl<Spi: Transfer<u8>, Cs: OutputSwitch, Config: SdMmcSpiConfig> SdMmcSpi<Spi, Cs, Config>
where Spi::Error: Debug, Cs::Error: Debug,

Source

pub fn new(spi: Spi, cs: Cs) -> Self

Creates a new SdMmcSpi<Spi, Cs, Config>.

spi - SPI instance. cs - chip select output switch.

Trait Implementations§

Source§

impl<Spi: Transfer<u8>, Cs: OutputSwitch, Config: SdMmcSpiConfig> DiskioDevice for SdMmcSpi<Spi, Cs, Config>
where Spi::Error: Debug, Cs::Error: Debug,

Source§

type HardwareError = Error<<Spi as Transfer<u8>>::Error, <Cs as OutputSwitch>::Error>

Device error type.
Source§

fn status(&self) -> Status

Get status of device.
Source§

fn reset(&mut self)

Reset device (optional).
Source§

fn initialize(&mut self) -> Result<(), DiskioError<Self::HardwareError>>

Initialize device.
Source§

fn read( &self, buf: &mut [u8], lba: Lba, ) -> Result<(), DiskioError<Self::HardwareError>>

Read data blocks from device by address.
Source§

fn write( &self, buf: &[u8], lba: Lba, ) -> Result<(), DiskioError<Self::HardwareError>>

Write data blocks to device by address.
Source§

fn ioctl( &self, cmd: IoctlCmd<'_>, ) -> Result<(), DiskioError<Self::HardwareError>>

Make ioctl query to device.

Auto Trait Implementations§

§

impl<Spi, Cs, Config> !Freeze for SdMmcSpi<Spi, Cs, Config>

§

impl<Spi, Cs, Config> !RefUnwindSafe for SdMmcSpi<Spi, Cs, Config>

§

impl<Spi, Cs, Config> Send for SdMmcSpi<Spi, Cs, Config>
where Spi: Send, Cs: Send, Config: Send,

§

impl<Spi, Cs, Config> !Sync for SdMmcSpi<Spi, Cs, Config>

§

impl<Spi, Cs, Config> Unpin for SdMmcSpi<Spi, Cs, Config>
where Config: Unpin, Spi: Unpin, Cs: Unpin,

§

impl<Spi, Cs, Config> UnwindSafe for SdMmcSpi<Spi, Cs, Config>
where Config: UnwindSafe, Spi: UnwindSafe, Cs: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoSwitch for T

Source§

fn into_switch<ActiveLevel>(self) -> Switch<T, ActiveLevel>

Consumes the IoPin returning a Switch of the appropriate ActiveLevel. Read more
Source§

fn into_active_low_switch(self) -> Switch<Self, ActiveLow>
where Self: Sized,

Consumes the IoPin returning a Switch<IoPin, ActiveLow>. Read more
Source§

fn into_active_high_switch(self) -> Switch<Self, ActiveHigh>
where Self: Sized,

Consumes the IoPin returning a Switch<IoPin, ActiveHigh>. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.