Tx

Struct Tx 

Source
pub struct Tx<const N: u8, const WORD_SIZE: u8, const FRAME_SIZE: usize, PACKING: Packing<WORD_SIZE>> { /* private fields */ }
Expand description

A SAI transmit half

Implementations§

Source§

impl<const N: u8, const WORD_SIZE: u8, const FRAME_SIZE: usize, PACKING: Packing<WORD_SIZE>> Tx<N, WORD_SIZE, FRAME_SIZE, PACKING>

Source

pub fn set_enable(&mut self, en: bool)

Enable/Disable transmission

Source

pub fn interrupts(&self) -> Interrupts

Return the interrupt flags.

The interrupt flags indicate the reasons that this peripheral may generate an interrupt.

Source

pub fn set_interrupts(&mut self, interrutps: Interrupts)

Set the interrupt flags for this SAI transmitter.

Source

pub fn status(&mut self) -> Status

Get the status register of the transmitter, this can be used in conjunction with status field masks to determine the state of the SAI peripheral.

Source

pub fn clear_status(&mut self, flags: Status)

Clear status error flags

Source

pub fn reg_dump(&mut self) -> [u32; 6]

Get a dump of the Tx configuration registers

Source

pub fn fifo_position(&mut self, chan: usize) -> (u32, u32)

Get the FIFO write and read position

use imxrt_ral::sai::{SAI1, TCSR};
use imxrt_hal::sai::{Tx, PackingNone, Sai, SaiConfig};
let sai = Sai::without_pins(unsafe { SAI1::instance() }, 0, 0);
let (Some(mut sai_tx), None) = sai.split::<16, 2, PackingNone>(&SaiConfig::i2s(8)) else { panic!() };

let (write_pos, read_pos) = sai_tx.fifo_position(0);
Source§

impl<const N: u8, const FRAME_SIZE: usize> Tx<N, 32, FRAME_SIZE, PackingNone>

Source

pub fn write_frame(&mut self, chan: usize, frame: [u32; FRAME_SIZE])

Write without checks or blocking a single audio frame to channels FIFO

Source§

impl<const N: u8, const FRAME_SIZE: usize> Tx<N, 16, FRAME_SIZE, PackingNone>

Source

pub fn write_frame(&mut self, chan: usize, frame: [u16; FRAME_SIZE])

Write without checks or blocking a single audio frame to channels FIFO

Source§

impl<const N: u8, const FRAME_SIZE: usize> Tx<N, 8, FRAME_SIZE, PackingNone>

Source

pub fn write_frame(&mut self, chan: usize, frame: [u8; FRAME_SIZE])

Write without checks or blocking a single audio frame to channels FIFO

Auto Trait Implementations§

§

impl<const N: u8, const WORD_SIZE: u8, const FRAME_SIZE: usize, PACKING> Freeze for Tx<N, WORD_SIZE, FRAME_SIZE, PACKING>

§

impl<const N: u8, const WORD_SIZE: u8, const FRAME_SIZE: usize, PACKING> !RefUnwindSafe for Tx<N, WORD_SIZE, FRAME_SIZE, PACKING>

§

impl<const N: u8, const WORD_SIZE: u8, const FRAME_SIZE: usize, PACKING> Send for Tx<N, WORD_SIZE, FRAME_SIZE, PACKING>
where PACKING: Send,

§

impl<const N: u8, const WORD_SIZE: u8, const FRAME_SIZE: usize, PACKING> !Sync for Tx<N, WORD_SIZE, FRAME_SIZE, PACKING>

§

impl<const N: u8, const WORD_SIZE: u8, const FRAME_SIZE: usize, PACKING> Unpin for Tx<N, WORD_SIZE, FRAME_SIZE, PACKING>
where PACKING: Unpin,

§

impl<const N: u8, const WORD_SIZE: u8, const FRAME_SIZE: usize, PACKING> !UnwindSafe for Tx<N, WORD_SIZE, FRAME_SIZE, PACKING>

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.