Trait stm32_i2s_v12x::I2sPeripheral
source · pub unsafe trait I2sPeripheral {
type WsPin: WsPin;
const 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 composed of a SPI device that can be used for I2S communication.
This trait is meant to be implemented on a type that represent a full SPI device. That means an object composed of a SPI peripheral, pins that it uses, and eventually a clock object (which can be a reference).
§Safety
It is only safe to implement this trait when:
- The implementing type has ownership of the peripheral, preventing any other accesses to the register block.
REGISTERS
is a pointer to that peripheral’s register block and can be safely accessed as long as ownership or a borrow of the implementing type is present.
Required Associated Types§
Required Associated Constants§
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.