Module imxrt_iomuxc::sai

source ·
Expand description

SAI / I2S pad configurations

§Examples

Accept a transfer pin in a SAI driver. Change TxDataSignal to RxDataSignal for the inverse operation.

use imxrt_iomuxc::sai::{Pin, TxDataSignal};
use imxrt_iomuxc::consts::{U1, Unsigned};

struct SAI<U> {
    /* Driver details... */
}

type SAI1 = SAI<U1>;

impl<U: Unsigned> SAI<U> {
    fn add_tx_pin<P>(&mut self, pin: P)
    where
        P: Pin<U>,
        <P as Pin<U>>::Signal: TxDataSignal,
    {
        let tx_offset: usize = <P::Signal as TxDataSignal>::Index::to_usize();
        assert_eq!(tx_offset, 1);
        // ...
    }
}

let mut sai1: SAI1 = // Create SAI1 driver...
let gpio_sd_b1_02 = // 1060 SAI1 TX_DATA01 pin...


sai1.add_tx_pin(gpio_sd_b1_02);

Enums§

  • A tag that indicates a SAI MCLK pad
  • A tag that indicates a SAI RX bit clock pad
  • A SAI RX data pin
  • A tag that indicates a SAI RX frame sync pad
  • A tag that indicates a SAI TX bit clock pad
  • A SAI TX data pin
  • A tag that indicates a SAI TX frame sync pad

Traits§

Functions§

  • Prepare a pad to be used as a SAI pin