Trait stm32_i2s_v12x::DualI2sPeripheral
source · pub unsafe trait DualI2sPeripheral {
type WsPin: WsPin;
const MAIN_REGISTERS: *const ();
const EXT_REGISTERS: *const ();
// Required methods
fn i2s_freq(&self) -> u32;
fn ws_pin(&self) -> &Self::WsPin;
fn ws_pin_mut(&mut self) -> &mut Self::WsPin;
fn rcc_reset(&mut self);
}
Expand description
An object that can be used for full duplex I2S communication.
This trait is meant to be implemented on a type that represent a device supporting full duplex I2S operation. This object should be composed of
- A SPI peripheral with I2S support
- The corresponding I2SEXT peripheral
- Pins that the peripherals use
- Eventually a clock object (or reference)
§Safety
It is only safe to implement this trait when:
- The implementing type has ownership of the peripherals, preventing any other accesses to the register blocks.
MAIN_REGISTERS
andEXT_REGISTERS
are pointers to that peripheral’s register blocks and can be safely accessed as long as ownership or a borrow of the implementing type is present.
Required Associated Types§
Required Associated Constants§
sourceconst MAIN_REGISTERS: *const ()
const MAIN_REGISTERS: *const ()
Pointer to the SPI register block
sourceconst EXT_REGISTERS: *const ()
const EXT_REGISTERS: *const ()
Pointer to the I2SEXT register block
Required Methods§
sourcefn i2s_freq(&self) -> u32
fn i2s_freq(&self) -> u32
Get I2s clock source frequency from the I2s device.
Implementers are allowed to panic in case i2s source frequency is unavailable.
sourcefn ws_pin_mut(&mut self) -> &mut Self::WsPin
fn ws_pin_mut(&mut self) -> &mut Self::WsPin
Get mutable reference to WS pin;
Object Safety§
This trait is not object safe.