DiskioDevice

Trait DiskioDevice 

Source
pub trait DiskioDevice {
    type HardwareError;

    // Required methods
    fn status(&self) -> FlagSet<StatusFlag>;
    fn initialize(&mut self) -> Result<(), Error<Self::HardwareError>>;
    fn read(
        &self,
        buf: &mut [u8],
        lba: u64,
    ) -> Result<(), Error<Self::HardwareError>>;
    fn write(
        &self,
        buf: &[u8],
        lba: u64,
    ) -> Result<(), Error<Self::HardwareError>>;
    fn ioctl(&self, cmd: IoctlCmd<'_>) -> Result<(), Error<Self::HardwareError>>;

    // Provided method
    fn reset(&mut self) { ... }
}
Expand description

Represents disk IO device.

Required Associated Types§

Source

type HardwareError

Device error type.

Required Methods§

Source

fn status(&self) -> FlagSet<StatusFlag>

Get status of device.

Source

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

Initialize device.

Source

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

Read data blocks from device by address.

Source

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

Write data blocks to device by address.

Source

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

Make ioctl query to device.

Provided Methods§

Source

fn reset(&mut self)

Reset device (optional).

Implementors§

Source§

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