pub struct Qspi<'d, T: Instance> { /* private fields */ }
Expand description
QSPI flash driver.
Implementations§
Source§impl<'d, T: Instance> Qspi<'d, T>
impl<'d, T: Instance> Qspi<'d, T>
Sourcepub fn new(
qspi: impl Peripheral<P = T> + 'd,
_irq: impl Binding<T::Interrupt, InterruptHandler<T>> + 'd,
sck: impl Peripheral<P = impl GpioPin> + 'd,
csn: impl Peripheral<P = impl GpioPin> + 'd,
io0: impl Peripheral<P = impl GpioPin> + 'd,
io1: impl Peripheral<P = impl GpioPin> + 'd,
io2: impl Peripheral<P = impl GpioPin> + 'd,
io3: impl Peripheral<P = impl GpioPin> + 'd,
config: Config,
) -> Self
pub fn new( qspi: impl Peripheral<P = T> + 'd, _irq: impl Binding<T::Interrupt, InterruptHandler<T>> + 'd, sck: impl Peripheral<P = impl GpioPin> + 'd, csn: impl Peripheral<P = impl GpioPin> + 'd, io0: impl Peripheral<P = impl GpioPin> + 'd, io1: impl Peripheral<P = impl GpioPin> + 'd, io2: impl Peripheral<P = impl GpioPin> + 'd, io3: impl Peripheral<P = impl GpioPin> + 'd, 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.