[][src]Struct wio_terminal::SDCardController

pub struct SDCardController<TS: TimeSource> {
    pub cont: Controller<SdMmcSpi<SPIMaster6<Sercom6Pad2<Pc18<PfC>>, Sercom6Pad0<Pc16<PfC>>, Sercom6Pad1<Pc17<PfC>>>, Pc19<Output<PushPull>>>, TS>,
    // some fields omitted
}

An initialized SPI SDMMC controller.

Fields

cont: Controller<SdMmcSpi<SPIMaster6<Sercom6Pad2<Pc18<PfC>>, Sercom6Pad0<Pc16<PfC>>, Sercom6Pad1<Pc17<PfC>>>, Pc19<Output<PushPull>>>, TS>

Implementations

impl<TS: TimeSource> SDCardController<TS>[src]

pub fn set_baud<B: Into<Hertz>>(&mut self, baud: B)[src]

Initializes the MMC card. An error is returned if there is no card or a communications error occurs.

Methods from Deref<Target = Controller<SdMmcSpi<SPIMaster6<Sercom6Pad2<Pc18<PfC>>, Sercom6Pad0<Pc16<PfC>>, Sercom6Pad1<Pc17<PfC>>>, Pc19<Output<PushPull>>>, TS>>

pub fn device(&mut self) -> &mut D[src]

Temporarily get access to the underlying block device.

pub fn get_volume(
    &mut self,
    volume_idx: VolumeIdx
) -> Result<Volume, Error<<D as BlockDevice>::Error>>
[src]

Get a volume (or partition) based on entries in the Master Boot Record. We do not support GUID Partition Table disks. Nor do we support any concept of drive letters - that is for a higher layer to handle.

pub fn open_root_dir(
    &mut self,
    volume: &Volume
) -> Result<Directory, Error<<D as BlockDevice>::Error>>
[src]

Open a directory. You can then read the directory entries in a random order using get_directory_entry.

TODO: Work out how to prevent damage occuring to the file system while this directory handle is open. In particular, stop this directory being unlinked.

pub fn open_dir(
    &mut self,
    volume: &Volume,
    parent_dir: &Directory,
    name: &str
) -> Result<Directory, Error<<D as BlockDevice>::Error>>
[src]

Open a directory. You can then read the directory entries in a random order using get_directory_entry.

TODO: Work out how to prevent damage occuring to the file system while this directory handle is open. In particular, stop this directory being unlinked.

pub fn close_dir(&mut self, volume: &Volume, dir: Directory)[src]

Close a directory. You cannot perform operations on an open directory and so must close it if you want to do something with it.

pub fn find_directory_entry(
    &mut self,
    volume: &Volume,
    dir: &Directory,
    name: &str
) -> Result<DirEntry, Error<<D as BlockDevice>::Error>>
[src]

Look in a directory for a named file.

pub fn iterate_dir<F>(
    &mut self,
    volume: &Volume,
    dir: &Directory,
    func: F
) -> Result<(), Error<<D as BlockDevice>::Error>> where
    F: FnMut(&DirEntry), 
[src]

Call a callback function for each directory entry in a directory.

pub fn open_file_in_dir(
    &mut self,
    volume: &mut Volume,
    dir: &Directory,
    name: &str,
    mode: Mode
) -> Result<File, Error<<D as BlockDevice>::Error>>
[src]

Open a file with the given full path. A file can only be opened once.

pub fn read(
    &mut self,
    volume: &Volume,
    file: &mut File,
    buffer: &mut [u8]
) -> Result<usize, Error<<D as BlockDevice>::Error>>
[src]

Read from an open file.

pub fn write(
    &mut self,
    volume: &mut Volume,
    file: &mut File,
    buffer: &[u8]
) -> Result<usize, Error<<D as BlockDevice>::Error>>
[src]

Write to a open file.

pub fn close_file(
    &mut self,
    volume: &Volume,
    file: File
) -> Result<(), Error<<D as BlockDevice>::Error>>
[src]

Close a file with the given full path.

Trait Implementations

impl<TS: TimeSource> Deref for SDCardController<TS>[src]

type Target = Controller<SdMmcSpi<SPIMaster6<Sercom6Pad2<Pc18<PfC>>, Sercom6Pad0<Pc16<PfC>>, Sercom6Pad1<Pc17<PfC>>>, Pc19<Output<PushPull>>>, TS>

The resulting type after dereferencing.

impl<TS: TimeSource> DerefMut for SDCardController<TS>[src]

Auto Trait Implementations

impl<TS> Send for SDCardController<TS> where
    TS: Send
[src]

impl<TS> !Sync for SDCardController<TS>[src]

impl<TS> Unpin for SDCardController<TS> where
    TS: Unpin
[src]

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.