#[non_exhaustive]pub struct I2s<'d, Dm>where
Dm: DriverMode,{
pub i2s_rx: RxCreator<'d, Dm>,
pub i2s_tx: TxCreator<'d, Dm>,
}
Available on crate feature
unstable
only.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,
impl<Dm> I2s<'_, Dm>where
Dm: DriverMode,
Sourcepub fn set_interrupt_handler(&mut self, handler: InterruptHandler)
pub fn set_interrupt_handler(&mut self, handler: InterruptHandler)
Sets the interrupt handler
Interrupts are not enabled at the peripheral level here.
Sourcepub fn listen(&mut self, interrupts: impl Into<EnumSet<I2sInterrupt>>)
pub fn listen(&mut self, interrupts: impl Into<EnumSet<I2sInterrupt>>)
Listen for the given interrupts
Sourcepub fn unlisten(&mut self, interrupts: impl Into<EnumSet<I2sInterrupt>>)
pub fn unlisten(&mut self, interrupts: impl Into<EnumSet<I2sInterrupt>>)
Unlisten the given interrupts
Sourcepub fn interrupts(&mut self) -> EnumSet<I2sInterrupt>
pub fn interrupts(&mut self) -> EnumSet<I2sInterrupt>
Gets asserted interrupts
Sourcepub fn clear_interrupts(&mut self, interrupts: impl Into<EnumSet<I2sInterrupt>>)
pub fn clear_interrupts(&mut self, interrupts: impl Into<EnumSet<I2sInterrupt>>)
Resets asserted interrupts
Source§impl<'d> I2s<'d, Blocking>
impl<'d> I2s<'d, Blocking>
Sourcepub fn new<CH>(
i2s: impl Peripheral<P = impl RegisterAccess> + 'd,
standard: Standard,
data_format: DataFormat,
sample_rate: impl Into<HertzU32>,
channel: impl Peripheral<P = CH> + 'd,
rx_descriptors: &'static mut [DmaDescriptor],
tx_descriptors: &'static mut [DmaDescriptor],
) -> Selfwhere
CH: DmaChannelFor<AnyI2s>,
pub fn new<CH>(
i2s: impl Peripheral<P = impl RegisterAccess> + 'd,
standard: Standard,
data_format: DataFormat,
sample_rate: impl Into<HertzU32>,
channel: impl Peripheral<P = CH> + 'd,
rx_descriptors: &'static mut [DmaDescriptor],
tx_descriptors: &'static mut [DmaDescriptor],
) -> Selfwhere
CH: DmaChannelFor<AnyI2s>,
Construct a new I2S peripheral driver instance for the first I2S peripheral
Sourcepub fn into_async(self) -> I2s<'d, Async>
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,
impl<'d, Dm> I2s<'d, Dm>where
Dm: DriverMode,
Sourcepub fn with_mclk<P: PeripheralOutput>(
self,
pin: impl Peripheral<P = P> + 'd,
) -> Self
pub fn with_mclk<P: PeripheralOutput>( self, pin: impl Peripheral<P = P> + '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,
impl<Dm> InterruptConfigurable for I2s<'_, Dm>where
Dm: DriverMode,
Source§fn set_interrupt_handler(&mut self, handler: InterruptHandler)
fn set_interrupt_handler(&mut self, handler: InterruptHandler)
Set the interrupt handler Read more