embassy-stm32

Crates

git

Versions

stm32u575oi

Flavors

embassy_stm32::ospi

Struct Ospi

Source
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>

Source

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

Source

pub fn disable_memory_mapped_mode(&mut self)

Quit from memory mapped mode

Source

pub async fn command( &mut self, command: &TransferConfig, ) -> Result<(), OspiError>

Function used to control or configure the target device without data transfer

Source

pub fn blocking_read<W: Word>( &mut self, buf: &mut [W], transaction: TransferConfig, ) -> Result<(), OspiError>

Blocking read with byte by byte data transfer

Source

pub fn blocking_write<W: Word>( &mut self, buf: &[W], transaction: TransferConfig, ) -> Result<(), OspiError>

Blocking write with byte by byte data transfer

Source

pub fn set_config(&mut self, config: &Config)

Set new bus configuration

Source

pub fn get_config(&self) -> Config

Get current configuration

Source§

impl<'d, T: Instance> Ospi<'d, T, Blocking>

Source

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

Source

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

Source

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

Source

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

Source

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>

Source

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

Source

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

Source

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

Source

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

Source

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

Source

pub fn blocking_read_dma<W: Word>( &mut self, buf: &mut [W], transaction: TransferConfig, ) -> Result<(), OspiError>

Blocking read with DMA transfer

Source

pub fn blocking_write_dma<W: Word>( &mut self, buf: &[W], transaction: TransferConfig, ) -> Result<(), OspiError>

Blocking write with DMA transfer

Source

pub async fn read<W: Word>( &mut self, buf: &mut [W], transaction: TransferConfig, ) -> Result<(), OspiError>

Asynchronous read from external device

Source

pub async fn write<W: Word>( &mut self, buf: &[W], transaction: TransferConfig, ) -> Result<(), OspiError>

Asynchronous write to external device

Trait Implementations§

Source§

impl<'d, T: Instance, M: PeriMode> Drop for Ospi<'d, T, M>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl<'d, T: Instance, M: PeriMode> GetConfig for Ospi<'d, T, M>

Source§

type Config = Config

The configuration type used by this driver.
Source§

fn get_config(&self) -> Self::Config

Get the configuration of the driver.
Source§

impl<'d, T: Instance, M: PeriMode> SetConfig for Ospi<'d, T, M>

Source§

type Config = Config

The configuration type used by this driver.
Source§

type ConfigError = ()

The error type that can occur if set_config fails.
Source§

fn set_config(&mut self, config: &Self::Config) -> Result<(), ()>

Set the configuration of the driver.

Auto Trait Implementations§

§

impl<'d, T, M> Freeze for Ospi<'d, T, M>
where T: Freeze,

§

impl<'d, T, M> RefUnwindSafe for Ospi<'d, T, M>

§

impl<'d, T, M> Send for Ospi<'d, T, M>
where T: Send, M: Send,

§

impl<'d, T, M> Sync for Ospi<'d, T, M>
where T: Sync, M: Sync,

§

impl<'d, T, M> Unpin for Ospi<'d, T, M>
where T: Unpin, M: Unpin,

§

impl<'d, T, M> !UnwindSafe for Ospi<'d, T, M>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.