pub struct Ospi<'d, T: Instance, M: PeriMode> { /* private fields */ }Expand description
OSPI driver.
Implementations§
Source§impl<'d, T: Instance, M: PeriMode> Ospi<'d, T, M>
impl<'d, T: Instance, M: PeriMode> Ospi<'d, T, M>
Sourcepub fn enable_memory_mapped_mode(
&mut self,
read_config: TransferConfig,
write_config: TransferConfig,
) -> Result<(), OspiError>
pub fn enable_memory_mapped_mode( &mut self, read_config: TransferConfig, write_config: TransferConfig, ) -> Result<(), OspiError>
Enter memory mode.
The Input read_config is used to configure the read operation in memory mode
Sourcepub fn disable_memory_mapped_mode(&mut self)
pub fn disable_memory_mapped_mode(&mut self)
Quit from memory mapped mode
Sourcepub fn blocking_command(
&mut self,
command: &TransferConfig,
) -> Result<(), OspiError>
pub fn blocking_command( &mut self, command: &TransferConfig, ) -> Result<(), OspiError>
Function used to control or configure the target device without data transfer
Sourcepub fn blocking_read<W: Word>(
&mut self,
buf: &mut [W],
transaction: TransferConfig,
) -> Result<(), OspiError>
pub fn blocking_read<W: Word>( &mut self, buf: &mut [W], transaction: TransferConfig, ) -> Result<(), OspiError>
Blocking read with byte by byte data transfer
Sourcepub fn blocking_write<W: Word>(
&mut self,
buf: &[W],
transaction: TransferConfig,
) -> Result<(), OspiError>
pub fn blocking_write<W: Word>( &mut self, buf: &[W], transaction: TransferConfig, ) -> Result<(), OspiError>
Blocking write with byte by byte data transfer
Sourcepub fn set_config(&mut self, config: &Config)
pub fn set_config(&mut self, config: &Config)
Set new bus configuration
Sourcepub fn get_config(&self) -> Config
pub fn get_config(&self) -> Config
Get current configuration
Source§impl<'d, T: Instance> Ospi<'d, T, Blocking>
impl<'d, T: Instance> Ospi<'d, T, Blocking>
Sourcepub fn new_blocking_singlespi<const IOL_PGROUP: u8, const CTRL_PGROUP: u8>(
peri: Peri<'d, T>,
sck: Peri<'d, impl SckSrc<T, CTRL_PGROUP>>,
d0: Peri<'d, impl D0Src<T, IOL_PGROUP>>,
d1: Peri<'d, impl D1Src<T, IOL_PGROUP>>,
nss: Peri<'d, impl NSSSrc<T, CTRL_PGROUP>>,
config: Config,
) -> Self
pub fn new_blocking_singlespi<const IOL_PGROUP: u8, const CTRL_PGROUP: u8>( peri: Peri<'d, T>, sck: Peri<'d, impl SckSrc<T, CTRL_PGROUP>>, d0: Peri<'d, impl D0Src<T, IOL_PGROUP>>, d1: Peri<'d, impl D1Src<T, IOL_PGROUP>>, nss: Peri<'d, impl NSSSrc<T, CTRL_PGROUP>>, config: Config, ) -> Self
Create new blocking OSPI driver for a single spi external chip
Sourcepub fn new_blocking_dualspi<const IOL_PGROUP: u8, const CTRL_PGROUP: u8>(
peri: Peri<'d, T>,
sck: Peri<'d, impl SckSrc<T, CTRL_PGROUP>>,
d0: Peri<'d, impl D0Src<T, IOL_PGROUP>>,
d1: Peri<'d, impl D1Src<T, IOL_PGROUP>>,
nss: Peri<'d, impl NSSSrc<T, CTRL_PGROUP>>,
config: Config,
) -> Self
pub fn new_blocking_dualspi<const IOL_PGROUP: u8, const CTRL_PGROUP: u8>( peri: Peri<'d, T>, sck: Peri<'d, impl SckSrc<T, CTRL_PGROUP>>, d0: Peri<'d, impl D0Src<T, IOL_PGROUP>>, d1: Peri<'d, impl D1Src<T, IOL_PGROUP>>, nss: Peri<'d, impl NSSSrc<T, CTRL_PGROUP>>, config: Config, ) -> Self
Create new blocking OSPI driver for a dualspi external chip
Sourcepub fn new_blocking_quadspi<const IOL_PGROUP: u8, const CTRL_PGROUP: u8>(
peri: Peri<'d, T>,
sck: Peri<'d, impl SckSrc<T, CTRL_PGROUP>>,
d0: Peri<'d, impl D0Src<T, IOL_PGROUP>>,
d1: Peri<'d, impl D1Src<T, IOL_PGROUP>>,
d2: Peri<'d, impl D2Src<T, IOL_PGROUP>>,
d3: Peri<'d, impl D3Src<T, IOL_PGROUP>>,
nss: Peri<'d, impl NSSSrc<T, CTRL_PGROUP>>,
config: Config,
) -> Self
pub fn new_blocking_quadspi<const IOL_PGROUP: u8, const CTRL_PGROUP: u8>( peri: Peri<'d, T>, sck: Peri<'d, impl SckSrc<T, CTRL_PGROUP>>, d0: Peri<'d, impl D0Src<T, IOL_PGROUP>>, d1: Peri<'d, impl D1Src<T, IOL_PGROUP>>, d2: Peri<'d, impl D2Src<T, IOL_PGROUP>>, d3: Peri<'d, impl D3Src<T, IOL_PGROUP>>, nss: Peri<'d, impl NSSSrc<T, CTRL_PGROUP>>, config: Config, ) -> Self
Create new blocking OSPI driver for a quadspi external chip
Sourcepub fn new_blocking_dualquadspi<const IOLSRC1: u8, const IOLSRC2: u8, const CTRL_PGROUP: u8>(
peri: Peri<'d, T>,
sck: Peri<'d, impl SckSrc<T, CTRL_PGROUP>>,
d0_1: Peri<'d, impl D0Src<T, IOLSRC1>>,
d1_1: Peri<'d, impl D1Src<T, IOLSRC1>>,
d2_1: Peri<'d, impl D2Src<T, IOLSRC1>>,
d3_1: Peri<'d, impl D3Src<T, IOLSRC1>>,
d0_2: Peri<'d, impl D4Src<T, IOLSRC2>>,
d1_2: Peri<'d, impl D5Src<T, IOLSRC2>>,
d2_2: Peri<'d, impl D6Src<T, IOLSRC2>>,
d3_2: Peri<'d, impl D7Src<T, IOLSRC2>>,
nss: Peri<'d, impl NSSSrc<T, CTRL_PGROUP>>,
config: Config,
) -> Self
pub fn new_blocking_dualquadspi<const IOLSRC1: u8, const IOLSRC2: u8, const CTRL_PGROUP: u8>( peri: Peri<'d, T>, sck: Peri<'d, impl SckSrc<T, CTRL_PGROUP>>, d0_1: Peri<'d, impl D0Src<T, IOLSRC1>>, d1_1: Peri<'d, impl D1Src<T, IOLSRC1>>, d2_1: Peri<'d, impl D2Src<T, IOLSRC1>>, d3_1: Peri<'d, impl D3Src<T, IOLSRC1>>, d0_2: Peri<'d, impl D4Src<T, IOLSRC2>>, d1_2: Peri<'d, impl D5Src<T, IOLSRC2>>, d2_2: Peri<'d, impl D6Src<T, IOLSRC2>>, d3_2: Peri<'d, impl D7Src<T, IOLSRC2>>, nss: Peri<'d, impl NSSSrc<T, CTRL_PGROUP>>, config: Config, ) -> Self
Create new blocking OSPI driver for two quadspi external chips
Sourcepub fn new_blocking_octospi<const IOL_PGROUP: u8, const IOH_PGROUP: u8, const CTRL_PGROUP: u8>(
peri: Peri<'d, T>,
sck: Peri<'d, impl SckSrc<T, CTRL_PGROUP>>,
d0: Peri<'d, impl D0Src<T, IOL_PGROUP>>,
d1: Peri<'d, impl D1Src<T, IOL_PGROUP>>,
d2: Peri<'d, impl D2Src<T, IOL_PGROUP>>,
d3: Peri<'d, impl D3Src<T, IOL_PGROUP>>,
d4: Peri<'d, impl D4Src<T, IOH_PGROUP>>,
d5: Peri<'d, impl D5Src<T, IOH_PGROUP>>,
d6: Peri<'d, impl D6Src<T, IOH_PGROUP>>,
d7: Peri<'d, impl D7Src<T, IOH_PGROUP>>,
nss: Peri<'d, impl NSSSrc<T, CTRL_PGROUP>>,
config: Config,
) -> Self
pub fn new_blocking_octospi<const IOL_PGROUP: u8, const IOH_PGROUP: u8, const CTRL_PGROUP: u8>( peri: Peri<'d, T>, sck: Peri<'d, impl SckSrc<T, CTRL_PGROUP>>, d0: Peri<'d, impl D0Src<T, IOL_PGROUP>>, d1: Peri<'d, impl D1Src<T, IOL_PGROUP>>, d2: Peri<'d, impl D2Src<T, IOL_PGROUP>>, d3: Peri<'d, impl D3Src<T, IOL_PGROUP>>, d4: Peri<'d, impl D4Src<T, IOH_PGROUP>>, d5: Peri<'d, impl D5Src<T, IOH_PGROUP>>, d6: Peri<'d, impl D6Src<T, IOH_PGROUP>>, d7: Peri<'d, impl D7Src<T, IOH_PGROUP>>, nss: Peri<'d, impl NSSSrc<T, CTRL_PGROUP>>, config: Config, ) -> Self
Create new blocking OSPI driver for octospi external chips
Sourcepub fn new_blocking_octospi_with_dqs<const IOL_PGROUP: u8, const IOH_PGROUP: u8, const CTRL_PGROUP: u8>(
peri: Peri<'d, T>,
sck: Peri<'d, impl SckSrc<T, CTRL_PGROUP>>,
d0: Peri<'d, impl D0Src<T, IOL_PGROUP>>,
d1: Peri<'d, impl D1Src<T, IOL_PGROUP>>,
d2: Peri<'d, impl D2Src<T, IOL_PGROUP>>,
d3: Peri<'d, impl D3Src<T, IOL_PGROUP>>,
d4: Peri<'d, impl D4Src<T, IOH_PGROUP>>,
d5: Peri<'d, impl D5Src<T, IOH_PGROUP>>,
d6: Peri<'d, impl D6Src<T, IOH_PGROUP>>,
d7: Peri<'d, impl D7Src<T, IOH_PGROUP>>,
nss: Peri<'d, impl NSSSrc<T, CTRL_PGROUP>>,
dqs: Peri<'d, impl DQSSrc<T, CTRL_PGROUP>>,
config: Config,
) -> Self
pub fn new_blocking_octospi_with_dqs<const IOL_PGROUP: u8, const IOH_PGROUP: u8, const CTRL_PGROUP: u8>( peri: Peri<'d, T>, sck: Peri<'d, impl SckSrc<T, CTRL_PGROUP>>, d0: Peri<'d, impl D0Src<T, IOL_PGROUP>>, d1: Peri<'d, impl D1Src<T, IOL_PGROUP>>, d2: Peri<'d, impl D2Src<T, IOL_PGROUP>>, d3: Peri<'d, impl D3Src<T, IOL_PGROUP>>, d4: Peri<'d, impl D4Src<T, IOH_PGROUP>>, d5: Peri<'d, impl D5Src<T, IOH_PGROUP>>, d6: Peri<'d, impl D6Src<T, IOH_PGROUP>>, d7: Peri<'d, impl D7Src<T, IOH_PGROUP>>, nss: Peri<'d, impl NSSSrc<T, CTRL_PGROUP>>, dqs: Peri<'d, impl DQSSrc<T, CTRL_PGROUP>>, config: Config, ) -> Self
Create new blocking OSPI driver for octospi external chips with DQS support
Source§impl<'d, T: Instance> Ospi<'d, T, Async>
impl<'d, T: Instance> Ospi<'d, T, Async>
Sourcepub fn new_singlespi<const IOL_PGROUP: u8, const CTRL_PGROUP: u8, D: OctoDma<T>>(
peri: Peri<'d, T>,
sck: Peri<'d, impl SckSrc<T, CTRL_PGROUP>>,
d0: Peri<'d, impl D0Src<T, IOL_PGROUP>>,
d1: Peri<'d, impl D1Src<T, IOL_PGROUP>>,
nss: Peri<'d, impl NSSSrc<T, CTRL_PGROUP>>,
dma: Peri<'d, D>,
_irq: impl Binding<D::Interrupt, InterruptHandler<D>> + 'd,
config: Config,
) -> Self
pub fn new_singlespi<const IOL_PGROUP: u8, const CTRL_PGROUP: u8, D: OctoDma<T>>( peri: Peri<'d, T>, sck: Peri<'d, impl SckSrc<T, CTRL_PGROUP>>, d0: Peri<'d, impl D0Src<T, IOL_PGROUP>>, d1: Peri<'d, impl D1Src<T, IOL_PGROUP>>, nss: Peri<'d, impl NSSSrc<T, CTRL_PGROUP>>, dma: Peri<'d, D>, _irq: impl Binding<D::Interrupt, InterruptHandler<D>> + 'd, config: Config, ) -> Self
Create new blocking OSPI driver for a single spi external chip
Sourcepub fn new_dualspi<const IOL_PGROUP: u8, const CTRL_PGROUP: u8, D: OctoDma<T>>(
peri: Peri<'d, T>,
sck: Peri<'d, impl SckSrc<T, CTRL_PGROUP>>,
d0: Peri<'d, impl D0Src<T, IOL_PGROUP>>,
d1: Peri<'d, impl D1Src<T, IOL_PGROUP>>,
nss: Peri<'d, impl NSSSrc<T, CTRL_PGROUP>>,
dma: Peri<'d, D>,
_irq: impl Binding<D::Interrupt, InterruptHandler<D>> + 'd,
config: Config,
) -> Self
pub fn new_dualspi<const IOL_PGROUP: u8, const CTRL_PGROUP: u8, D: OctoDma<T>>( peri: Peri<'d, T>, sck: Peri<'d, impl SckSrc<T, CTRL_PGROUP>>, d0: Peri<'d, impl D0Src<T, IOL_PGROUP>>, d1: Peri<'d, impl D1Src<T, IOL_PGROUP>>, nss: Peri<'d, impl NSSSrc<T, CTRL_PGROUP>>, dma: Peri<'d, D>, _irq: impl Binding<D::Interrupt, InterruptHandler<D>> + 'd, config: Config, ) -> Self
Create new blocking OSPI driver for a dualspi external chip
Sourcepub fn new_quadspi<const IOL_PGROUP: u8, const CTRL_PGROUP: u8, D: OctoDma<T>>(
peri: Peri<'d, T>,
sck: Peri<'d, impl SckSrc<T, CTRL_PGROUP>>,
d0: Peri<'d, impl D0Src<T, IOL_PGROUP>>,
d1: Peri<'d, impl D1Src<T, IOL_PGROUP>>,
d2: Peri<'d, impl D2Src<T, IOL_PGROUP>>,
d3: Peri<'d, impl D3Src<T, IOL_PGROUP>>,
nss: Peri<'d, impl NSSSrc<T, CTRL_PGROUP>>,
dma: Peri<'d, D>,
_irq: impl Binding<D::Interrupt, InterruptHandler<D>> + 'd,
config: Config,
) -> Self
pub fn new_quadspi<const IOL_PGROUP: u8, const CTRL_PGROUP: u8, D: OctoDma<T>>( peri: Peri<'d, T>, sck: Peri<'d, impl SckSrc<T, CTRL_PGROUP>>, d0: Peri<'d, impl D0Src<T, IOL_PGROUP>>, d1: Peri<'d, impl D1Src<T, IOL_PGROUP>>, d2: Peri<'d, impl D2Src<T, IOL_PGROUP>>, d3: Peri<'d, impl D3Src<T, IOL_PGROUP>>, nss: Peri<'d, impl NSSSrc<T, CTRL_PGROUP>>, dma: Peri<'d, D>, _irq: impl Binding<D::Interrupt, InterruptHandler<D>> + 'd, config: Config, ) -> Self
Create new blocking OSPI driver for a quadspi external chip
Sourcepub fn new_dualquadspi<const IOLSRC1: u8, const CTRL_PGROUP: u8, const IOLSRC2: u8, D: OctoDma<T>>(
peri: Peri<'d, T>,
sck: Peri<'d, impl SckSrc<T, CTRL_PGROUP>>,
d0_1: Peri<'d, impl D0Src<T, IOLSRC1>>,
d1_1: Peri<'d, impl D1Src<T, IOLSRC1>>,
d2_1: Peri<'d, impl D2Src<T, IOLSRC1>>,
d3_1: Peri<'d, impl D3Src<T, IOLSRC1>>,
d0_2: Peri<'d, impl D0Src<T, IOLSRC2>>,
d1_2: Peri<'d, impl D1Src<T, IOLSRC2>>,
d2_2: Peri<'d, impl D2Src<T, IOLSRC2>>,
d3_2: Peri<'d, impl D3Src<T, IOLSRC2>>,
nss: Peri<'d, impl NSSSrc<T, CTRL_PGROUP>>,
dma: Peri<'d, D>,
_irq: impl Binding<D::Interrupt, InterruptHandler<D>> + 'd,
config: Config,
) -> Self
pub fn new_dualquadspi<const IOLSRC1: u8, const CTRL_PGROUP: u8, const IOLSRC2: u8, D: OctoDma<T>>( peri: Peri<'d, T>, sck: Peri<'d, impl SckSrc<T, CTRL_PGROUP>>, d0_1: Peri<'d, impl D0Src<T, IOLSRC1>>, d1_1: Peri<'d, impl D1Src<T, IOLSRC1>>, d2_1: Peri<'d, impl D2Src<T, IOLSRC1>>, d3_1: Peri<'d, impl D3Src<T, IOLSRC1>>, d0_2: Peri<'d, impl D0Src<T, IOLSRC2>>, d1_2: Peri<'d, impl D1Src<T, IOLSRC2>>, d2_2: Peri<'d, impl D2Src<T, IOLSRC2>>, d3_2: Peri<'d, impl D3Src<T, IOLSRC2>>, nss: Peri<'d, impl NSSSrc<T, CTRL_PGROUP>>, dma: Peri<'d, D>, _irq: impl Binding<D::Interrupt, InterruptHandler<D>> + 'd, config: Config, ) -> Self
Create new blocking OSPI driver for two quadspi external chips
Sourcepub fn new_octospi<const IOL_PGROUP: u8, const IOH_PGROUP: u8, const CTRL_PGROUP: u8, D: OctoDma<T>>(
peri: Peri<'d, T>,
sck: Peri<'d, impl SckSrc<T, CTRL_PGROUP>>,
d0: Peri<'d, impl D0Src<T, IOL_PGROUP>>,
d1: Peri<'d, impl D1Src<T, IOL_PGROUP>>,
d2: Peri<'d, impl D2Src<T, IOL_PGROUP>>,
d3: Peri<'d, impl D3Src<T, IOL_PGROUP>>,
d4: Peri<'d, impl D4Src<T, IOH_PGROUP>>,
d5: Peri<'d, impl D5Src<T, IOH_PGROUP>>,
d6: Peri<'d, impl D6Src<T, IOH_PGROUP>>,
d7: Peri<'d, impl D7Src<T, IOH_PGROUP>>,
nss: Peri<'d, impl NSSSrc<T, CTRL_PGROUP>>,
dma: Peri<'d, D>,
_irq: impl Binding<D::Interrupt, InterruptHandler<D>> + 'd,
config: Config,
) -> Self
pub fn new_octospi<const IOL_PGROUP: u8, const IOH_PGROUP: u8, const CTRL_PGROUP: u8, D: OctoDma<T>>( peri: Peri<'d, T>, sck: Peri<'d, impl SckSrc<T, CTRL_PGROUP>>, d0: Peri<'d, impl D0Src<T, IOL_PGROUP>>, d1: Peri<'d, impl D1Src<T, IOL_PGROUP>>, d2: Peri<'d, impl D2Src<T, IOL_PGROUP>>, d3: Peri<'d, impl D3Src<T, IOL_PGROUP>>, d4: Peri<'d, impl D4Src<T, IOH_PGROUP>>, d5: Peri<'d, impl D5Src<T, IOH_PGROUP>>, d6: Peri<'d, impl D6Src<T, IOH_PGROUP>>, d7: Peri<'d, impl D7Src<T, IOH_PGROUP>>, nss: Peri<'d, impl NSSSrc<T, CTRL_PGROUP>>, dma: Peri<'d, D>, _irq: impl Binding<D::Interrupt, InterruptHandler<D>> + 'd, config: Config, ) -> Self
Create new blocking OSPI driver for octospi external chips
Sourcepub fn new_octospi_with_dqs<const IOL_PGROUP: u8, const IOH_PGROUP: u8, const CTRL_PGROUP: u8, D: OctoDma<T>>(
peri: Peri<'d, T>,
sck: Peri<'d, impl SckSrc<T, CTRL_PGROUP>>,
d0: Peri<'d, impl D0Src<T, IOL_PGROUP>>,
d1: Peri<'d, impl D1Src<T, IOL_PGROUP>>,
d2: Peri<'d, impl D2Src<T, IOL_PGROUP>>,
d3: Peri<'d, impl D3Src<T, IOL_PGROUP>>,
d4: Peri<'d, impl D4Src<T, IOH_PGROUP>>,
d5: Peri<'d, impl D5Src<T, IOH_PGROUP>>,
d6: Peri<'d, impl D6Src<T, IOH_PGROUP>>,
d7: Peri<'d, impl D7Src<T, IOH_PGROUP>>,
nss: Peri<'d, impl NSSSrc<T, CTRL_PGROUP>>,
dqs: Peri<'d, impl DQSSrc<T, CTRL_PGROUP>>,
dma: Peri<'d, D>,
_irq: impl Binding<D::Interrupt, InterruptHandler<D>> + 'd,
config: Config,
) -> Self
pub fn new_octospi_with_dqs<const IOL_PGROUP: u8, const IOH_PGROUP: u8, const CTRL_PGROUP: u8, D: OctoDma<T>>( peri: Peri<'d, T>, sck: Peri<'d, impl SckSrc<T, CTRL_PGROUP>>, d0: Peri<'d, impl D0Src<T, IOL_PGROUP>>, d1: Peri<'d, impl D1Src<T, IOL_PGROUP>>, d2: Peri<'d, impl D2Src<T, IOL_PGROUP>>, d3: Peri<'d, impl D3Src<T, IOL_PGROUP>>, d4: Peri<'d, impl D4Src<T, IOH_PGROUP>>, d5: Peri<'d, impl D5Src<T, IOH_PGROUP>>, d6: Peri<'d, impl D6Src<T, IOH_PGROUP>>, d7: Peri<'d, impl D7Src<T, IOH_PGROUP>>, nss: Peri<'d, impl NSSSrc<T, CTRL_PGROUP>>, dqs: Peri<'d, impl DQSSrc<T, CTRL_PGROUP>>, dma: Peri<'d, D>, _irq: impl Binding<D::Interrupt, InterruptHandler<D>> + 'd, config: Config, ) -> Self
Create new blocking OSPI driver for octospi external chips with DQS support
Sourcepub fn blocking_read_dma<W: Word>(
&mut self,
buf: &mut [W],
transaction: TransferConfig,
) -> Result<(), OspiError>
pub fn blocking_read_dma<W: Word>( &mut self, buf: &mut [W], transaction: TransferConfig, ) -> Result<(), OspiError>
Blocking read with DMA transfer
Sourcepub fn blocking_write_dma<W: Word>(
&mut self,
buf: &[W],
transaction: TransferConfig,
) -> Result<(), OspiError>
pub fn blocking_write_dma<W: Word>( &mut self, buf: &[W], transaction: TransferConfig, ) -> Result<(), OspiError>
Blocking write with DMA transfer