Embassy
embassy-stm32

Crates

git

Versions

stm32l562re

Flavors

Struct embassy_stm32::ospi::Ospi

source ·
pub struct Ospi<'d, T: Instance, Dma> { /* private fields */ }
Expand description

OSPI driver.

Implementations§

source§

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

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 = Dma> + 'd, config: Config ) -> Self

Create new 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 = Dma> + 'd, config: Config ) -> Self

Create new 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 = Dma> + 'd, config: Config ) -> Self

Create new 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 = Dma> + 'd, config: Config ) -> Self

Create new 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 = Dma> + 'd, config: Config ) -> Self

Create new OSPI driver for octospi external chips

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 blocking_read_dma<W: Word>( &mut self, buf: &mut [W], transaction: TransferConfig ) -> Result<(), OspiError>
where Dma: OctoDma<T>,

Blocking read with DMA transfer

source

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

Blocking write with DMA transfer

source

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

Asynchronous read from external device

source

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

Asynchronous write to external device

source

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

Set new bus configuration

source

pub fn get_config(&self) -> Config

Get current configuration

Trait Implementations§

source§

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

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

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

§

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, Dma> SetConfig for Ospi<'d, T, Dma>

§

type Config = Config

The configuration type used by this driver.
§

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, Dma> Freeze for Ospi<'d, T, Dma>
where T: Freeze, Dma: Freeze,

§

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

§

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

§

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

§

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

§

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

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

§

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

§

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.