pub struct I2s<I: Instance> { /* private fields */ }
Expand description
An I2s wrapper around an SPI object and pins
Implementations§
Source§impl<SPI: Instance> I2s<SPI>
impl<SPI: Instance> I2s<SPI>
Sourcepub fn new(
spi: SPI,
pins: (impl Into<SPI::Ws>, impl Into<SPI::Ck>, impl Into<SPI::Mck>, impl Into<SPI::Sd>),
clocks: &Clocks,
) -> Self
pub fn new( spi: SPI, pins: (impl Into<SPI::Ws>, impl Into<SPI::Ck>, impl Into<SPI::Mck>, impl Into<SPI::Sd>), clocks: &Clocks, ) -> Self
Creates an I2s object around an SPI peripheral and pins
This function enables and resets the SPI peripheral, but does not configure it.
The returned I2s object implements stm32_i2s_v12x::I2sPeripheral
, so it can be used to
configure the peripheral and communicate.
§Panics
This function panics if the I2S clock input (from the I2S PLL or similar) is not configured.
pub fn release(self) -> (SPI, (SPI::Ws, SPI::Ck, SPI::Mck, SPI::Sd))
Trait Implementations§
Source§impl I2sPeripheral for I2s<SPI2>
impl I2sPeripheral for I2s<SPI2>
Source§impl I2sPeripheral for I2s<SPI3>
impl I2sPeripheral for I2s<SPI3>
Source§impl I2sPeripheral for I2s<SPI4>
impl I2sPeripheral for I2s<SPI4>
Auto Trait Implementations§
impl<I> Freeze for I2s<I>
impl<I> RefUnwindSafe for I2s<I>where
I: RefUnwindSafe,
<I as I2sCommon>::Ws: RefUnwindSafe,
<I as I2sCommon>::Ck: RefUnwindSafe,
<I as I2sMaster>::Mck: RefUnwindSafe,
<I as I2sCommon>::Sd: RefUnwindSafe,
impl<I> Send for I2s<I>
impl<I> Sync for I2s<I>
impl<I> Unpin for I2s<I>
impl<I> UnwindSafe for I2s<I>where
I: UnwindSafe,
<I as I2sCommon>::Ws: UnwindSafe,
<I as I2sCommon>::Ck: UnwindSafe,
<I as I2sMaster>::Mck: UnwindSafe,
<I as I2sCommon>::Sd: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more