[][src]Trait spi_flash::FlashAccess

pub trait FlashAccess {
    pub fn exchange(&mut self, data: &[u8]) -> Result<Vec<u8>>;

    pub fn write(&mut self, data: &[u8]) -> Result<()> { ... }
}

Trait for objects which provide access to SPI flash.

Providers only need to implement exchange(), which asserts CS, writes all the bytes in data, then returns all the received bytes. If it provides a performance optimisation, providers may also implement write(), which does not require the received data.

Required methods

pub fn exchange(&mut self, data: &[u8]) -> Result<Vec<u8>>[src]

Assert CS, write all bytes in data while capturing received data, then de-assert CS.

Returns the received data.

Loading content...

Provided methods

pub fn write(&mut self, data: &[u8]) -> Result<()>[src]

Assert CS, write all bytes in data to the SPI bus, then de-assert CS.

Loading content...

Implementors

Loading content...