#[non_exhaustive]pub struct I2s<'d, Dm>where
Dm: DriverMode,{
pub i2s_rx: RxCreator<'d, Dm>,
pub i2s_tx: TxCreator<'d, Dm>,
}
unstable
only.Expand description
Instance of the I2S peripheral driver
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
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)
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.
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
§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.
Sourcepub fn unlisten(&mut self, interrupts: impl Into<EnumSet<I2sInterrupt>>)
pub fn unlisten(&mut self, interrupts: impl Into<EnumSet<I2sInterrupt>>)
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.
Sourcepub fn interrupts(&mut self) -> EnumSet<I2sInterrupt>
pub fn interrupts(&mut self) -> EnumSet<I2sInterrupt>
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.
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
§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>
impl<'d> I2s<'d, Blocking>
Sourcepub fn new<CH>(
i2s: impl Peripheral<P = impl RegisterAccess> + 'd,
standard: Standard,
data_format: DataFormat,
sample_rate: Rate,
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: Rate,
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.