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 async fn command(
&mut self,
command: &TransferConfig,
) -> Result<(), OspiError>
pub async fn 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(
peri: impl Peripheral<P = T> + 'd,
sck: impl Peripheral<P = impl SckPin<T>> + 'd,
d0: impl Peripheral<P = impl D0Pin<T>> + 'd,
d1: impl Peripheral<P = impl D1Pin<T>> + 'd,
nss: impl Peripheral<P = impl NSSPin<T>> + 'd,
config: Config,
) -> Self
pub fn new_blocking_singlespi( peri: impl Peripheral<P = T> + 'd, sck: impl Peripheral<P = impl SckPin<T>> + 'd, d0: impl Peripheral<P = impl D0Pin<T>> + 'd, d1: impl Peripheral<P = impl D1Pin<T>> + 'd, nss: impl Peripheral<P = impl NSSPin<T>> + 'd, config: Config, ) -> Self
Create new blocking OSPI driver for a single spi external chip
sourcepub fn new_blocking_dualspi(
peri: impl Peripheral<P = T> + 'd,
sck: impl Peripheral<P = impl SckPin<T>> + 'd,
d0: impl Peripheral<P = impl D0Pin<T>> + 'd,
d1: impl Peripheral<P = impl D1Pin<T>> + 'd,
nss: impl Peripheral<P = impl NSSPin<T>> + 'd,
config: Config,
) -> Self
pub fn new_blocking_dualspi( peri: impl Peripheral<P = T> + 'd, sck: impl Peripheral<P = impl SckPin<T>> + 'd, d0: impl Peripheral<P = impl D0Pin<T>> + 'd, d1: impl Peripheral<P = impl D1Pin<T>> + 'd, nss: impl Peripheral<P = impl NSSPin<T>> + 'd, config: Config, ) -> Self
Create new blocking OSPI driver for a dualspi external chip
sourcepub fn new_blocking_quadspi(
peri: impl Peripheral<P = T> + 'd,
sck: impl Peripheral<P = impl SckPin<T>> + 'd,
d0: impl Peripheral<P = impl D0Pin<T>> + 'd,
d1: impl Peripheral<P = impl D1Pin<T>> + 'd,
d2: impl Peripheral<P = impl D2Pin<T>> + 'd,
d3: impl Peripheral<P = impl D3Pin<T>> + 'd,
nss: impl Peripheral<P = impl NSSPin<T>> + 'd,
config: Config,
) -> Self
pub fn new_blocking_quadspi( peri: impl Peripheral<P = T> + 'd, sck: impl Peripheral<P = impl SckPin<T>> + 'd, d0: impl Peripheral<P = impl D0Pin<T>> + 'd, d1: impl Peripheral<P = impl D1Pin<T>> + 'd, d2: impl Peripheral<P = impl D2Pin<T>> + 'd, d3: impl Peripheral<P = impl D3Pin<T>> + 'd, nss: impl Peripheral<P = impl NSSPin<T>> + 'd, config: Config, ) -> Self
Create new blocking OSPI driver for a quadspi external chip
sourcepub fn new_blocking_dualquadspi(
peri: impl Peripheral<P = T> + 'd,
sck: impl Peripheral<P = impl SckPin<T>> + 'd,
d0: impl Peripheral<P = impl D0Pin<T>> + 'd,
d1: impl Peripheral<P = impl D1Pin<T>> + 'd,
d2: impl Peripheral<P = impl D2Pin<T>> + 'd,
d3: impl Peripheral<P = impl D3Pin<T>> + 'd,
d4: impl Peripheral<P = impl D4Pin<T>> + 'd,
d5: impl Peripheral<P = impl D5Pin<T>> + 'd,
d6: impl Peripheral<P = impl D6Pin<T>> + 'd,
d7: impl Peripheral<P = impl D7Pin<T>> + 'd,
nss: impl Peripheral<P = impl NSSPin<T>> + 'd,
config: Config,
) -> Self
pub fn new_blocking_dualquadspi( peri: impl Peripheral<P = T> + 'd, sck: impl Peripheral<P = impl SckPin<T>> + 'd, d0: impl Peripheral<P = impl D0Pin<T>> + 'd, d1: impl Peripheral<P = impl D1Pin<T>> + 'd, d2: impl Peripheral<P = impl D2Pin<T>> + 'd, d3: impl Peripheral<P = impl D3Pin<T>> + 'd, d4: impl Peripheral<P = impl D4Pin<T>> + 'd, d5: impl Peripheral<P = impl D5Pin<T>> + 'd, d6: impl Peripheral<P = impl D6Pin<T>> + 'd, d7: impl Peripheral<P = impl D7Pin<T>> + 'd, nss: impl Peripheral<P = impl NSSPin<T>> + 'd, config: Config, ) -> Self
Create new blocking OSPI driver for two quadspi external chips
sourcepub fn new_blocking_octospi(
peri: impl Peripheral<P = T> + 'd,
sck: impl Peripheral<P = impl SckPin<T>> + 'd,
d0: impl Peripheral<P = impl D0Pin<T>> + 'd,
d1: impl Peripheral<P = impl D1Pin<T>> + 'd,
d2: impl Peripheral<P = impl D2Pin<T>> + 'd,
d3: impl Peripheral<P = impl D3Pin<T>> + 'd,
d4: impl Peripheral<P = impl D4Pin<T>> + 'd,
d5: impl Peripheral<P = impl D5Pin<T>> + 'd,
d6: impl Peripheral<P = impl D6Pin<T>> + 'd,
d7: impl Peripheral<P = impl D7Pin<T>> + 'd,
nss: impl Peripheral<P = impl NSSPin<T>> + 'd,
config: Config,
) -> Self
pub fn new_blocking_octospi( peri: impl Peripheral<P = T> + 'd, sck: impl Peripheral<P = impl SckPin<T>> + 'd, d0: impl Peripheral<P = impl D0Pin<T>> + 'd, d1: impl Peripheral<P = impl D1Pin<T>> + 'd, d2: impl Peripheral<P = impl D2Pin<T>> + 'd, d3: impl Peripheral<P = impl D3Pin<T>> + 'd, d4: impl Peripheral<P = impl D4Pin<T>> + 'd, d5: impl Peripheral<P = impl D5Pin<T>> + 'd, d6: impl Peripheral<P = impl D6Pin<T>> + 'd, d7: impl Peripheral<P = impl D7Pin<T>> + 'd, nss: impl Peripheral<P = impl NSSPin<T>> + 'd, config: Config, ) -> Self
Create new blocking OSPI driver for octospi external chips
source§impl<'d, T: Instance> Ospi<'d, T, Async>
impl<'d, T: Instance> Ospi<'d, T, Async>
sourcepub fn new_singlespi(
peri: impl Peripheral<P = T> + 'd,
sck: impl Peripheral<P = impl SckPin<T>> + 'd,
d0: impl Peripheral<P = impl D0Pin<T>> + 'd,
d1: impl Peripheral<P = impl D1Pin<T>> + 'd,
nss: impl Peripheral<P = impl NSSPin<T>> + 'd,
dma: impl Peripheral<P = impl OctoDma<T>> + 'd,
config: Config,
) -> Self
pub fn new_singlespi( peri: impl Peripheral<P = T> + 'd, sck: impl Peripheral<P = impl SckPin<T>> + 'd, d0: impl Peripheral<P = impl D0Pin<T>> + 'd, d1: impl Peripheral<P = impl D1Pin<T>> + 'd, nss: impl Peripheral<P = impl NSSPin<T>> + 'd, dma: impl Peripheral<P = impl OctoDma<T>> + 'd, config: Config, ) -> Self
Create new blocking OSPI driver for a single spi external chip
sourcepub fn new_dualspi(
peri: impl Peripheral<P = T> + 'd,
sck: impl Peripheral<P = impl SckPin<T>> + 'd,
d0: impl Peripheral<P = impl D0Pin<T>> + 'd,
d1: impl Peripheral<P = impl D1Pin<T>> + 'd,
nss: impl Peripheral<P = impl NSSPin<T>> + 'd,
dma: impl Peripheral<P = impl OctoDma<T>> + 'd,
config: Config,
) -> Self
pub fn new_dualspi( peri: impl Peripheral<P = T> + 'd, sck: impl Peripheral<P = impl SckPin<T>> + 'd, d0: impl Peripheral<P = impl D0Pin<T>> + 'd, d1: impl Peripheral<P = impl D1Pin<T>> + 'd, nss: impl Peripheral<P = impl NSSPin<T>> + 'd, dma: impl Peripheral<P = impl OctoDma<T>> + 'd, config: Config, ) -> Self
Create new blocking OSPI driver for a dualspi external chip
sourcepub fn new_quadspi(
peri: impl Peripheral<P = T> + 'd,
sck: impl Peripheral<P = impl SckPin<T>> + 'd,
d0: impl Peripheral<P = impl D0Pin<T>> + 'd,
d1: impl Peripheral<P = impl D1Pin<T>> + 'd,
d2: impl Peripheral<P = impl D2Pin<T>> + 'd,
d3: impl Peripheral<P = impl D3Pin<T>> + 'd,
nss: impl Peripheral<P = impl NSSPin<T>> + 'd,
dma: impl Peripheral<P = impl OctoDma<T>> + 'd,
config: Config,
) -> Self
pub fn new_quadspi( peri: impl Peripheral<P = T> + 'd, sck: impl Peripheral<P = impl SckPin<T>> + 'd, d0: impl Peripheral<P = impl D0Pin<T>> + 'd, d1: impl Peripheral<P = impl D1Pin<T>> + 'd, d2: impl Peripheral<P = impl D2Pin<T>> + 'd, d3: impl Peripheral<P = impl D3Pin<T>> + 'd, nss: impl Peripheral<P = impl NSSPin<T>> + 'd, dma: impl Peripheral<P = impl OctoDma<T>> + 'd, config: Config, ) -> Self
Create new blocking OSPI driver for a quadspi external chip
sourcepub fn new_dualquadspi(
peri: impl Peripheral<P = T> + 'd,
sck: impl Peripheral<P = impl SckPin<T>> + 'd,
d0: impl Peripheral<P = impl D0Pin<T>> + 'd,
d1: impl Peripheral<P = impl D1Pin<T>> + 'd,
d2: impl Peripheral<P = impl D2Pin<T>> + 'd,
d3: impl Peripheral<P = impl D3Pin<T>> + 'd,
d4: impl Peripheral<P = impl D4Pin<T>> + 'd,
d5: impl Peripheral<P = impl D5Pin<T>> + 'd,
d6: impl Peripheral<P = impl D6Pin<T>> + 'd,
d7: impl Peripheral<P = impl D7Pin<T>> + 'd,
nss: impl Peripheral<P = impl NSSPin<T>> + 'd,
dma: impl Peripheral<P = impl OctoDma<T>> + 'd,
config: Config,
) -> Self
pub fn new_dualquadspi( peri: impl Peripheral<P = T> + 'd, sck: impl Peripheral<P = impl SckPin<T>> + 'd, d0: impl Peripheral<P = impl D0Pin<T>> + 'd, d1: impl Peripheral<P = impl D1Pin<T>> + 'd, d2: impl Peripheral<P = impl D2Pin<T>> + 'd, d3: impl Peripheral<P = impl D3Pin<T>> + 'd, d4: impl Peripheral<P = impl D4Pin<T>> + 'd, d5: impl Peripheral<P = impl D5Pin<T>> + 'd, d6: impl Peripheral<P = impl D6Pin<T>> + 'd, d7: impl Peripheral<P = impl D7Pin<T>> + 'd, nss: impl Peripheral<P = impl NSSPin<T>> + 'd, dma: impl Peripheral<P = impl OctoDma<T>> + 'd, config: Config, ) -> Self
Create new blocking OSPI driver for two quadspi external chips
sourcepub fn new_octospi(
peri: impl Peripheral<P = T> + 'd,
sck: impl Peripheral<P = impl SckPin<T>> + 'd,
d0: impl Peripheral<P = impl D0Pin<T>> + 'd,
d1: impl Peripheral<P = impl D1Pin<T>> + 'd,
d2: impl Peripheral<P = impl D2Pin<T>> + 'd,
d3: impl Peripheral<P = impl D3Pin<T>> + 'd,
d4: impl Peripheral<P = impl D4Pin<T>> + 'd,
d5: impl Peripheral<P = impl D5Pin<T>> + 'd,
d6: impl Peripheral<P = impl D6Pin<T>> + 'd,
d7: impl Peripheral<P = impl D7Pin<T>> + 'd,
nss: impl Peripheral<P = impl NSSPin<T>> + 'd,
dma: impl Peripheral<P = impl OctoDma<T>> + 'd,
config: Config,
) -> Self
pub fn new_octospi( peri: impl Peripheral<P = T> + 'd, sck: impl Peripheral<P = impl SckPin<T>> + 'd, d0: impl Peripheral<P = impl D0Pin<T>> + 'd, d1: impl Peripheral<P = impl D1Pin<T>> + 'd, d2: impl Peripheral<P = impl D2Pin<T>> + 'd, d3: impl Peripheral<P = impl D3Pin<T>> + 'd, d4: impl Peripheral<P = impl D4Pin<T>> + 'd, d5: impl Peripheral<P = impl D5Pin<T>> + 'd, d6: impl Peripheral<P = impl D6Pin<T>> + 'd, d7: impl Peripheral<P = impl D7Pin<T>> + 'd, nss: impl Peripheral<P = impl NSSPin<T>> + 'd, dma: impl Peripheral<P = impl OctoDma<T>> + 'd, config: Config, ) -> Self
Create new blocking OSPI driver for octospi external chips
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