pub struct Spdifrx<'d, T: Instance> { /* private fields */ }Expand description
Ring-buffered SPDIFRX driver.
Data is read by DMAs and stored in a ring buffer.
Implementations§
Source§impl<'d, T: Instance> Spdifrx<'d, T>
 
impl<'d, T: Instance> Spdifrx<'d, T>
Sourcepub fn new(
    peri: Peri<'d, T>,
    _irq: impl Binding<T::GlobalInterrupt, GlobalInterruptHandler<T>> + 'd,
    config: Config,
    spdifrx_in: Peri<'d, impl InPin<T>>,
    data_dma: Peri<'d, impl Channel + Dma<T>>,
    data_dma_buf: &'d mut [u32],
) -> Self
 
pub fn new( peri: Peri<'d, T>, _irq: impl Binding<T::GlobalInterrupt, GlobalInterruptHandler<T>> + 'd, config: Config, spdifrx_in: Peri<'d, impl InPin<T>>, data_dma: Peri<'d, impl Channel + Dma<T>>, data_dma_buf: &'d mut [u32], ) -> Self
Create a new Spdifrx instance.
Sourcepub async fn read(&mut self, data: &mut [u32]) -> Result<(), Error>
 
pub async fn read(&mut self, data: &mut [u32]) -> Result<(), Error>
Read from the SPDIFRX data ring buffer.
SPDIFRX is always receiving data in the background. This function pops already-received data from the buffer.
If there’s less than data.len() data in the buffer, this waits until there is.
Trait Implementations§
Auto Trait Implementations§
impl<'d, T> Freeze for Spdifrx<'d, T>where
    T: Freeze,
impl<'d, T> RefUnwindSafe for Spdifrx<'d, T>where
    T: RefUnwindSafe,
impl<'d, T> Send for Spdifrx<'d, T>where
    T: Send,
impl<'d, T> Sync for Spdifrx<'d, T>where
    T: Sync,
impl<'d, T> Unpin for Spdifrx<'d, T>where
    T: Unpin,
impl<'d, T> !UnwindSafe for Spdifrx<'d, T>
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