pub struct Qspi<'d> { /* private fields */ }Expand description
QSPI flash driver.
Implementations§
Source§impl<'d> Qspi<'d>
 
impl<'d> Qspi<'d>
Sourcepub fn new<T: Instance>(
    _qspi: Peri<'d, T>,
    _irq: impl Binding<T::Interrupt, InterruptHandler<T>> + 'd,
    sck: Peri<'d, impl GpioPin>,
    csn: Peri<'d, impl GpioPin>,
    io0: Peri<'d, impl GpioPin>,
    io1: Peri<'d, impl GpioPin>,
    io2: Peri<'d, impl GpioPin>,
    io3: Peri<'d, impl GpioPin>,
    config: Config,
) -> Self
 
pub fn new<T: Instance>( _qspi: Peri<'d, T>, _irq: impl Binding<T::Interrupt, InterruptHandler<T>> + 'd, sck: Peri<'d, impl GpioPin>, csn: Peri<'d, impl GpioPin>, io0: Peri<'d, impl GpioPin>, io1: Peri<'d, impl GpioPin>, io2: Peri<'d, impl GpioPin>, io3: Peri<'d, impl GpioPin>, config: Config, ) -> Self
Create a new QSPI driver.
Sourcepub async fn custom_instruction(
    &mut self,
    opcode: u8,
    req: &[u8],
    resp: &mut [u8],
) -> Result<(), Error>
 
pub async fn custom_instruction( &mut self, opcode: u8, req: &[u8], resp: &mut [u8], ) -> Result<(), Error>
Do a custom QSPI instruction.
Sourcepub fn blocking_custom_instruction(
    &mut self,
    opcode: u8,
    req: &[u8],
    resp: &mut [u8],
) -> Result<(), Error>
 
pub fn blocking_custom_instruction( &mut self, opcode: u8, req: &[u8], resp: &mut [u8], ) -> Result<(), Error>
Do a custom QSPI instruction, blocking version.
Sourcepub async fn read_raw(
    &mut self,
    address: u32,
    data: &mut [u8],
) -> Result<(), Error>
 
pub async fn read_raw( &mut self, address: u32, data: &mut [u8], ) -> Result<(), Error>
Raw QSPI read.
The difference with read is that this does not do bounds checks
against the flash capacity. It is intended for use when QSPI is used as
a raw bus, not with flash memory.
Sourcepub async fn write_raw(
    &mut self,
    address: u32,
    data: &[u8],
) -> Result<(), Error>
 
pub async fn write_raw( &mut self, address: u32, data: &[u8], ) -> Result<(), Error>
Raw QSPI write.
The difference with write is that this does not do bounds checks
against the flash capacity. It is intended for use when QSPI is used as
a raw bus, not with flash memory.
Sourcepub fn blocking_read_raw(
    &mut self,
    address: u32,
    data: &mut [u8],
) -> Result<(), Error>
 
pub fn blocking_read_raw( &mut self, address: u32, data: &mut [u8], ) -> Result<(), Error>
Raw QSPI read, blocking version.
The difference with blocking_read is that this does not do bounds checks
against the flash capacity. It is intended for use when QSPI is used as
a raw bus, not with flash memory.
Sourcepub fn blocking_write_raw(
    &mut self,
    address: u32,
    data: &[u8],
) -> Result<(), Error>
 
pub fn blocking_write_raw( &mut self, address: u32, data: &[u8], ) -> Result<(), Error>
Raw QSPI write, blocking version.
The difference with blocking_write is that this does not do bounds checks
against the flash capacity. It is intended for use when QSPI is used as
a raw bus, not with flash memory.
Sourcepub async fn read(&mut self, address: u32, data: &mut [u8]) -> Result<(), Error>
 
pub async fn read(&mut self, address: u32, data: &mut [u8]) -> Result<(), Error>
Read data from the flash memory.
Sourcepub async fn write(&mut self, address: u32, data: &[u8]) -> Result<(), Error>
 
pub async fn write(&mut self, address: u32, data: &[u8]) -> Result<(), Error>
Write data to the flash memory.
Sourcepub async fn erase(&mut self, address: u32) -> Result<(), Error>
 
pub async fn erase(&mut self, address: u32) -> Result<(), Error>
Erase a sector on the flash memory.
Sourcepub fn blocking_read(
    &mut self,
    address: u32,
    data: &mut [u8],
) -> Result<(), Error>
 
pub fn blocking_read( &mut self, address: u32, data: &mut [u8], ) -> Result<(), Error>
Read data from the flash memory, blocking version.