I2s

Struct I2s 

Source
#[non_exhaustive]
pub struct I2s<'d, Dm>
where Dm: DriverMode,
{ pub i2s_rx: RxCreator<'d, Dm>, pub i2s_tx: TxCreator<'d, Dm>, }
Expand description

Instance of the I2S peripheral driver

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§i2s_rx: RxCreator<'d, Dm>

Handles the reception (RX) side of the I2S peripheral.

§i2s_tx: TxCreator<'d, Dm>

Handles the transmission (TX) side of the I2S peripheral.

Implementations§

Source§

impl<Dm> I2s<'_, Dm>
where Dm: DriverMode,

Source

pub fn set_interrupt_handler(&mut self, handler: InterruptHandler)

Available on crate feature unstable only.

Registers an interrupt handler for the peripheral.

Note that this will replace any previously registered interrupt handlers.

You can restore the default/unhandled interrupt handler by using crate::interrupt::DEFAULT_INTERRUPT_HANDLER

§Stability

This API is marked as unstable and is only available when the unstable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Source

pub fn listen(&mut self, interrupts: impl Into<EnumSet<I2sInterrupt>>)

Available on crate feature unstable only.

Listen for the given interrupts

§Stability

This API is marked as unstable and is only available when the unstable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Source

pub fn unlisten(&mut self, interrupts: impl Into<EnumSet<I2sInterrupt>>)

Available on crate feature unstable only.

Unlisten the given interrupts

§Stability

This API is marked as unstable and is only available when the unstable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Source

pub fn interrupts(&mut self) -> EnumSet<I2sInterrupt>

Available on crate feature unstable only.

Gets asserted interrupts

§Stability

This API is marked as unstable and is only available when the unstable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Source

pub fn clear_interrupts(&mut self, interrupts: impl Into<EnumSet<I2sInterrupt>>)

Available on crate feature unstable only.

Resets asserted interrupts

§Stability

This API is marked as unstable and is only available when the unstable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Source§

impl<'d> I2s<'d, Blocking>

Source

pub fn new( i2s: impl Instance + 'd, channel: impl DmaChannelFor<AnyI2s<'d>>, config: Config, ) -> Result<Self, ConfigError>

Construct a new I2s instance.

Source

pub fn into_async(self) -> I2s<'d, Async>

Converts the I2S instance into async mode.

Source§

impl<'d, Dm> I2s<'d, Dm>
where Dm: DriverMode,

Source

pub fn with_mclk(self, mclk: impl PeripheralOutput<'d>) -> Self

Configures the I2S peripheral to use a master clock (MCLK) output pin.

Trait Implementations§

Source§

impl<Dm> InterruptConfigurable for I2s<'_, Dm>
where Dm: DriverMode,

Available on crate feature unstable only.
Source§

fn set_interrupt_handler(&mut self, handler: InterruptHandler)

Registers an interrupt handler for the peripheral. Read more

Auto Trait Implementations§

§

impl<'d, Dm> Freeze for I2s<'d, Dm>

§

impl<'d, Dm> RefUnwindSafe for I2s<'d, Dm>
where Dm: RefUnwindSafe,

§

impl<'d, Dm> Send for I2s<'d, Dm>
where Dm: Send,

§

impl<'d, Dm> Sync for I2s<'d, Dm>
where Dm: Sync,

§

impl<'d, Dm> Unpin for I2s<'d, Dm>
where Dm: Unpin,

§

impl<'d, Dm> !UnwindSafe for I2s<'d, Dm>

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

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> Same for T

Source§

type Output = T

Should always be Self
§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

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.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.