Sai

Struct Sai 

Source
pub struct Sai<const N: u8, MclkPin, TxPins, RxPins> { /* private fields */ }
Expand description

A SAI peripheral instance

Implementations§

Source§

impl<const N: u8, Chan, Mclk, TxSync, TxBclk, TxData, RxSync, RxBclk, RxData> Sai<N, Mclk, Pins<TxSync, TxBclk, TxData>, Pins<RxSync, RxBclk, RxData>>
where Mclk: Pin<Const<N>, Signal = Mclk>, TxSync: Pin<Const<N>, Signal = TxSync>, TxBclk: Pin<Const<N>, Signal = TxBclk>, TxData: Pin<Const<N>>, RxSync: Pin<Const<N>, Signal = RxSync>, RxBclk: Pin<Const<N>, Signal = RxBclk>, RxData: Pin<Const<N>>, Chan: Unsigned, <TxData as Pin<Const<N>>>::Signal: TxDataSignal<Index = Chan>, <RxData as Pin<Const<N>>>::Signal: RxDataSignal<Index = Chan>,

Source

pub fn new( sai: Instance<N>, mclk_pin: Mclk, tx_pins: Pins<TxSync, TxBclk, TxData>, rx_pins: Pins<RxSync, RxBclk, RxData>, ) -> Self

Creates SAI instance with single channel RX and TX.

Source§

impl<const N: u8, Chan, Mclk, TxSync, TxBclk, TxData> Sai<N, Mclk, Pins<TxSync, TxBclk, TxData>, ()>
where Mclk: Pin<Const<N>, Signal = Mclk>, TxSync: Pin<Const<N>, Signal = TxSync>, TxBclk: Pin<Const<N>, Signal = TxBclk>, TxData: Pin<Const<N>>, Chan: Unsigned, <TxData as Pin<Const<N>>>::Signal: TxDataSignal<Index = Chan>,

Source

pub const N: u8 = N

The peripheral instance.

Source

pub fn from_tx( sai: Instance<N>, mclk_pin: Mclk, tx_pins: Pins<TxSync, TxBclk, TxData>, ) -> Self

Create a Sai instance given a set of transmit pins

Source§

impl<const N: u8, Chan, Mclk, RxSync, RxBclk, RxData> Sai<N, Mclk, (), Pins<RxSync, RxBclk, RxData>>
where Mclk: Pin<Const<N>, Signal = Mclk>, RxSync: Pin<Const<N>, Signal = RxSync>, RxBclk: Pin<Const<N>, Signal = RxBclk>, RxData: Pin<Const<N>>, Chan: Unsigned, <RxData as Pin<Const<N>>>::Signal: RxDataSignal<Index = Chan>,

Source

pub fn from_rx( sai: Instance<N>, mclk_pin: Mclk, rx_pins: Pins<RxSync, RxBclk, RxData>, ) -> Self

Create a Sai instance given a set of receive pins

Source§

impl<const N: u8> Sai<N, (), (), ()>

Source

pub fn without_pins( sai: Instance<N>, tx_chan_mask: u32, rx_chan_mask: u32, ) -> Self

Create a new SAI driver from the RAL SAI instance.

You’re responsible for configuring pins, and for making sure the pin configuration doesn’t change while this driver is in use. Setting the channel mask is also your responsibility

Source§

impl<const N: u8, Mclk, TxPins, RxPins> Sai<N, Mclk, TxPins, RxPins>

Source

pub fn split<const WORD_SIZE: u8, const FRAME_SIZE: usize, PACKING: Packing<WORD_SIZE>>( self, cfg: &SaiConfig, ) -> (Option<Tx<N, WORD_SIZE, FRAME_SIZE, PACKING>>, Option<Rx<N, WORD_SIZE, FRAME_SIZE, PACKING>>)

Split the Tx/Rx pair from a SAI, with word, frame, and packing options as type parameters

Auto Trait Implementations§

§

impl<const N: u8, MclkPin, TxPins, RxPins> Freeze for Sai<N, MclkPin, TxPins, RxPins>
where MclkPin: Freeze, TxPins: Freeze, RxPins: Freeze,

§

impl<const N: u8, MclkPin, TxPins, RxPins> !RefUnwindSafe for Sai<N, MclkPin, TxPins, RxPins>

§

impl<const N: u8, MclkPin, TxPins, RxPins> Send for Sai<N, MclkPin, TxPins, RxPins>
where MclkPin: Send, TxPins: Send, RxPins: Send,

§

impl<const N: u8, MclkPin, TxPins, RxPins> !Sync for Sai<N, MclkPin, TxPins, RxPins>

§

impl<const N: u8, MclkPin, TxPins, RxPins> Unpin for Sai<N, MclkPin, TxPins, RxPins>
where MclkPin: Unpin, TxPins: Unpin, RxPins: Unpin,

§

impl<const N: u8, MclkPin, TxPins, RxPins> !UnwindSafe for Sai<N, MclkPin, TxPins, RxPins>

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.