Struct ectool::SpiRom[][src]

pub struct SpiRom<'a, S: Spi, T: Timeout> { /* fields omitted */ }

SPI ROM transactions

Implementations

impl<'a, S: Spi, T: Timeout> SpiRom<'a, S, T>[src]

pub fn new(spi: &'a mut S, timeout: T) -> Self[src]

Create a SPI ROM using the specified SPI bus and timeout

pub fn sector_size(&self) -> usize[src]

Get sector size in bytes

pub unsafe fn status(&mut self) -> Result<u8, Error>[src]

Read the status register

pub unsafe fn status_wait(&mut self, mask: u8, value: u8) -> Result<(), Error>[src]

Wait for the status register to have mask bits set to value

pub unsafe fn write_disable(&mut self) -> Result<(), Error>[src]

Disable writes

pub unsafe fn write_enable(&mut self) -> Result<(), Error>[src]

Enable writes

pub unsafe fn erase_sector(&mut self, address: u32) -> Result<(), Error>[src]

Erase a sector with the specified address

pub unsafe fn read_at(
    &mut self,
    address: u32,
    data: &mut [u8]
) -> Result<usize, Error>
[src]

Read at a specific address

pub unsafe fn write_at(
    &mut self,
    address: u32,
    data: &[u8]
) -> Result<usize, Error>
[src]

Write at a specific address

Trait Implementations

impl<'a, S: Spi, T: Timeout> Drop for SpiRom<'a, S, T>[src]

Auto Trait Implementations

impl<'a, S, T> RefUnwindSafe for SpiRom<'a, S, T> where
    S: RefUnwindSafe,
    T: RefUnwindSafe

impl<'a, S, T> Send for SpiRom<'a, S, T> where
    S: Send,
    T: Send

impl<'a, S, T> Sync for SpiRom<'a, S, T> where
    S: Sync,
    T: Sync

impl<'a, S, T> Unpin for SpiRom<'a, S, T> where
    T: Unpin

impl<'a, S, T> !UnwindSafe for SpiRom<'a, S, T>

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> Downcast for T where
    T: Any
[src]

impl<T> DowncastSync for T where
    T: Send + Sync + Any
[src]

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

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

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.