Struct SubBlock

Source
pub struct SubBlock<Channel, Config, Direction = NoDir> { /* private fields */ }
Expand description

Wrapper for a single channel of the SAI and its configuration.

Implementations§

Source§

impl<Ch> SubBlock<Ch, Asynchronous>
where Ch: Channel + SaiChannel,

Source

pub fn master_rx( self, pins: (impl Into<Ch::Mclk>, impl Into<Ch::Fs>, impl Into<Ch::Sck>, impl Into<Ch::Sd>), protocol: Protocol, sample_freq: impl Into<Hertz>, clocks: &Clocks, ) -> SubBlock<Ch, AsyncMaster<Ch>, Receive>

Configures the channel as a master and a receiver.

Source

pub fn master_tx( self, pins: (impl Into<Ch::Mclk>, impl Into<Ch::Fs>, impl Into<Ch::Sck>, impl Into<Ch::Sd>), protocol: Protocol, sample_freq: impl Into<Hertz>, clocks: &Clocks, ) -> SubBlock<Ch, AsyncMaster<Ch>, Transmit>

Configures the channel as a master and a transmitter.

Source

pub fn slave_rx( self, pins: (impl Into<Ch::Mclk>, impl Into<Ch::Fs>, impl Into<Ch::Sck>, impl Into<Ch::Sd>), protocol: Protocol, ) -> SubBlock<Ch, AsyncSlave<Ch>, Receive>

Configures the channel as a slave and a receiver.

Source

pub fn slave_tx( self, pins: (impl Into<Ch::Mclk>, impl Into<Ch::Fs>, impl Into<Ch::Sck>, impl Into<Ch::Sd>), protocol: Protocol, ) -> SubBlock<Ch, AsyncSlave<Ch>, Transmit>

Configures the channel as a master and a transmitter.

Source§

impl<Ch> SubBlock<Ch, Synchronous>
where Ch: Channel + SaiChannel,

Source

pub fn slave_rx( self, sd: impl Into<Ch::Sd>, protocol: Protocol, ) -> SubBlock<Ch, SyncSlave<Ch>, Receive>

Configures the channel as a slave and a receiver.

Source

pub fn slave_tx( self, sd: impl Into<Ch::Sd>, protocol: Protocol, ) -> SubBlock<Ch, SyncSlave<Ch>, Transmit>

Configures the channel as a slave and a transmitter.

Source§

impl<Ch, Config> SubBlock<Ch, Config, Receive>
where Ch: Channel,

Source

pub fn start(&mut self)

Source

pub fn stop(&mut self)

Source

pub fn try_read(&mut self) -> Result<(u32, u32), ()>

Source§

impl<Ch, Config> SubBlock<Ch, Config, Transmit>
where Ch: Channel,

Source

pub fn start(&mut self)

Source

pub fn stop(&mut self)

Source

pub fn try_send(&mut self, left: u32, right: u32) -> Result<(), ()>

Auto Trait Implementations§

§

impl<Channel, Config, Direction> Freeze for SubBlock<Channel, Config, Direction>
where Channel: Freeze, Config: Freeze, Direction: Freeze,

§

impl<Channel, Config, Direction> RefUnwindSafe for SubBlock<Channel, Config, Direction>
where Channel: RefUnwindSafe, Config: RefUnwindSafe, Direction: RefUnwindSafe,

§

impl<Channel, Config, Direction> Send for SubBlock<Channel, Config, Direction>
where Channel: Send, Config: Send, Direction: Send,

§

impl<Channel, Config, Direction> Sync for SubBlock<Channel, Config, Direction>
where Channel: Sync, Config: Sync, Direction: Sync,

§

impl<Channel, Config, Direction> Unpin for SubBlock<Channel, Config, Direction>
where Channel: Unpin, Config: Unpin, Direction: Unpin,

§

impl<Channel, Config, Direction> UnwindSafe for SubBlock<Channel, Config, Direction>
where Channel: UnwindSafe, Config: UnwindSafe, Direction: UnwindSafe,

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.