pub struct Qspi<'d, T: Instance, M: PeriMode> { /* private fields */ }Expand description
QSPI driver.
Implementations§
Source§impl<'d, T: Instance, M: PeriMode> Qspi<'d, T, M>
impl<'d, T: Instance, M: PeriMode> Qspi<'d, T, M>
Sourcepub fn blocking_command(&mut self, transaction: TransferConfig)
pub fn blocking_command(&mut self, transaction: TransferConfig)
Do a QSPI command.
Sourcepub fn blocking_read(&mut self, buf: &mut [u8], transaction: TransferConfig)
pub fn blocking_read(&mut self, buf: &mut [u8], transaction: TransferConfig)
Blocking read data.
Sourcepub fn blocking_write(&mut self, buf: &[u8], transaction: TransferConfig)
pub fn blocking_write(&mut self, buf: &[u8], transaction: TransferConfig)
Blocking write data.
Sourcepub fn enable_memory_map(&mut self, transaction: &TransferConfig)
pub fn enable_memory_map(&mut self, transaction: &TransferConfig)
Enable memory map mode
Source§impl<'d, T: Instance> Qspi<'d, T, Blocking>
impl<'d, T: Instance> Qspi<'d, T, Blocking>
Sourcepub fn new_blocking_bank1(
peri: Peri<'d, T>,
d0: Peri<'d, impl BK1D0Pin<T>>,
d1: Peri<'d, impl BK1D1Pin<T>>,
d2: Peri<'d, impl BK1D2Pin<T>>,
d3: Peri<'d, impl BK1D3Pin<T>>,
sck: Peri<'d, impl SckPin<T>>,
nss: Peri<'d, impl BK1NSSPin<T>>,
config: Config,
) -> Self
pub fn new_blocking_bank1( peri: Peri<'d, T>, d0: Peri<'d, impl BK1D0Pin<T>>, d1: Peri<'d, impl BK1D1Pin<T>>, d2: Peri<'d, impl BK1D2Pin<T>>, d3: Peri<'d, impl BK1D3Pin<T>>, sck: Peri<'d, impl SckPin<T>>, nss: Peri<'d, impl BK1NSSPin<T>>, config: Config, ) -> Self
Create a new QSPI driver for bank 1, in blocking mode.
Sourcepub fn new_blocking_bank2(
peri: Peri<'d, T>,
d0: Peri<'d, impl BK2D0Pin<T>>,
d1: Peri<'d, impl BK2D1Pin<T>>,
d2: Peri<'d, impl BK2D2Pin<T>>,
d3: Peri<'d, impl BK2D3Pin<T>>,
sck: Peri<'d, impl SckPin<T>>,
nss: Peri<'d, impl BK2NSSPin<T>>,
config: Config,
) -> Self
pub fn new_blocking_bank2( peri: Peri<'d, T>, d0: Peri<'d, impl BK2D0Pin<T>>, d1: Peri<'d, impl BK2D1Pin<T>>, d2: Peri<'d, impl BK2D2Pin<T>>, d3: Peri<'d, impl BK2D3Pin<T>>, sck: Peri<'d, impl SckPin<T>>, nss: Peri<'d, impl BK2NSSPin<T>>, config: Config, ) -> Self
Create a new QSPI driver for bank 2, in blocking mode.
Sourcepub fn new_blocking_dual_bank(
peri: Peri<'d, T>,
bk1d0: Peri<'d, impl BK1D0Pin<T>>,
bk1d1: Peri<'d, impl BK1D1Pin<T>>,
bk1d2: Peri<'d, impl BK1D2Pin<T>>,
bk1d3: Peri<'d, impl BK1D3Pin<T>>,
bk2d0: Peri<'d, impl BK2D0Pin<T>>,
bk2d1: Peri<'d, impl BK2D1Pin<T>>,
bk2d2: Peri<'d, impl BK2D2Pin<T>>,
bk2d3: Peri<'d, impl BK2D3Pin<T>>,
sck: Peri<'d, impl SckPin<T>>,
bk1nss: Peri<'d, impl BK1NSSPin<T>>,
bk2nss: Peri<'d, impl BK2NSSPin<T>>,
config: Config,
) -> Self
pub fn new_blocking_dual_bank( peri: Peri<'d, T>, bk1d0: Peri<'d, impl BK1D0Pin<T>>, bk1d1: Peri<'d, impl BK1D1Pin<T>>, bk1d2: Peri<'d, impl BK1D2Pin<T>>, bk1d3: Peri<'d, impl BK1D3Pin<T>>, bk2d0: Peri<'d, impl BK2D0Pin<T>>, bk2d1: Peri<'d, impl BK2D1Pin<T>>, bk2d2: Peri<'d, impl BK2D2Pin<T>>, bk2d3: Peri<'d, impl BK2D3Pin<T>>, sck: Peri<'d, impl SckPin<T>>, bk1nss: Peri<'d, impl BK1NSSPin<T>>, bk2nss: Peri<'d, impl BK2NSSPin<T>>, config: Config, ) -> Self
Create a new QSPI driver for a dual bank, in blocking mode. NOTE: Both nss pins are optional, there are 3 mods of operation: (1)boths flashes share nss 1, (2)boths flashes share nss 2,(3)each flash have its own nss pin.
Source§impl<'d, T: Instance> Qspi<'d, T, Async>
impl<'d, T: Instance> Qspi<'d, T, Async>
Sourcepub fn new_bank1<D, I>(
peri: Peri<'d, T>,
d0: Peri<'d, impl BK1D0Pin<T>>,
d1: Peri<'d, impl BK1D1Pin<T>>,
d2: Peri<'d, impl BK1D2Pin<T>>,
d3: Peri<'d, impl BK1D3Pin<T>>,
sck: Peri<'d, impl SckPin<T>>,
nss: Peri<'d, impl BK1NSSPin<T>>,
dma: Peri<'d, D>,
_irq: I,
config: Config,
) -> Selfwhere
D: QuadDma<T>,
I: Binding<D::Interrupt, InterruptHandler<D>> + Binding<T::Interrupt, InterruptHandler<T>> + 'd,
pub fn new_bank1<D, I>(
peri: Peri<'d, T>,
d0: Peri<'d, impl BK1D0Pin<T>>,
d1: Peri<'d, impl BK1D1Pin<T>>,
d2: Peri<'d, impl BK1D2Pin<T>>,
d3: Peri<'d, impl BK1D3Pin<T>>,
sck: Peri<'d, impl SckPin<T>>,
nss: Peri<'d, impl BK1NSSPin<T>>,
dma: Peri<'d, D>,
_irq: I,
config: Config,
) -> Selfwhere
D: QuadDma<T>,
I: Binding<D::Interrupt, InterruptHandler<D>> + Binding<T::Interrupt, InterruptHandler<T>> + 'd,
Create a new QSPI driver for bank 1.
Sourcepub fn new_bank2<D, I>(
peri: Peri<'d, T>,
d0: Peri<'d, impl BK2D0Pin<T>>,
d1: Peri<'d, impl BK2D1Pin<T>>,
d2: Peri<'d, impl BK2D2Pin<T>>,
d3: Peri<'d, impl BK2D3Pin<T>>,
sck: Peri<'d, impl SckPin<T>>,
nss: Peri<'d, impl BK2NSSPin<T>>,
dma: Peri<'d, D>,
_irq: I,
config: Config,
) -> Selfwhere
D: QuadDma<T>,
I: Binding<D::Interrupt, InterruptHandler<D>> + Binding<T::Interrupt, InterruptHandler<T>> + 'd,
pub fn new_bank2<D, I>(
peri: Peri<'d, T>,
d0: Peri<'d, impl BK2D0Pin<T>>,
d1: Peri<'d, impl BK2D1Pin<T>>,
d2: Peri<'d, impl BK2D2Pin<T>>,
d3: Peri<'d, impl BK2D3Pin<T>>,
sck: Peri<'d, impl SckPin<T>>,
nss: Peri<'d, impl BK2NSSPin<T>>,
dma: Peri<'d, D>,
_irq: I,
config: Config,
) -> Selfwhere
D: QuadDma<T>,
I: Binding<D::Interrupt, InterruptHandler<D>> + Binding<T::Interrupt, InterruptHandler<T>> + 'd,
Create a new QSPI driver for bank 2.
Sourcepub fn blocking_read_dma(&mut self, buf: &mut [u8], transaction: TransferConfig)
pub fn blocking_read_dma(&mut self, buf: &mut [u8], transaction: TransferConfig)
Blocking read data, using DMA.
Sourcepub async fn read_dma(&mut self, buf: &mut [u8], transaction: TransferConfig)
pub async fn read_dma(&mut self, buf: &mut [u8], transaction: TransferConfig)
Async read data, using DMA.
Sourcepub fn blocking_write_dma(&mut self, buf: &[u8], transaction: TransferConfig)
pub fn blocking_write_dma(&mut self, buf: &[u8], transaction: TransferConfig)
Blocking write data, using DMA.
Sourcepub async fn write_dma(&mut self, buf: &[u8], transaction: TransferConfig)
pub async fn write_dma(&mut self, buf: &[u8], transaction: TransferConfig)
Async write data, using DMA.
Sourcepub async fn auto_poll(
&mut self,
transaction: TransferConfig,
interval: u16,
mask: u32,
match_value: u32,
data_len: usize,
match_mode: MatchMode,
)
pub async fn auto_poll( &mut self, transaction: TransferConfig, interval: u16, mask: u32, match_value: u32, data_len: usize, match_mode: MatchMode, )
Automaticly poll until a desired status is received.
In case the desired status is never received, it is advised to always use WithTimeout::with_timeout().