Struct nrf52832_hal::i2s::I2S
source · [−]pub struct I2S { /* private fields */ }
Implementations
sourceimpl I2S
impl I2S
sourcepub fn new(i2s: I2S, pins: Pins) -> I2S
pub fn new(i2s: I2S, pins: Pins) -> I2S
Takes ownership of the raw I2S peripheral, returning a safe wrapper in controller mode.
sourcepub fn set_tx_enabled(&self, enabled: bool) -> &I2S
pub fn set_tx_enabled(&self, enabled: bool) -> &I2S
Enables/disables I2S transmission (TX).
sourcepub fn set_rx_enabled(&self, enabled: bool) -> &I2S
pub fn set_rx_enabled(&self, enabled: bool) -> &I2S
Enables/disables I2S reception (RX).
sourcepub fn set_mck_frequency(&self, freq: MckFreq) -> &I2S
pub fn set_mck_frequency(&self, freq: MckFreq) -> &I2S
Sets MCK generator frequency.
sourcepub fn set_sample_width(&self, width: SampleWidth) -> &I2S
pub fn set_sample_width(&self, width: SampleWidth) -> &I2S
Sets sample width.
sourcepub fn set_format(&self, format: Format) -> &I2S
pub fn set_format(&self, format: Format) -> &I2S
Sets the frame format.
sourcepub fn set_channels(&self, channels: Channels) -> &I2S
pub fn set_channels(&self, channels: Channels) -> &I2S
Sets the I2S channel configuration.
sourcepub fn rx<W, B>(self, buffer: B) -> Result<Transfer<B>, Error> where
W: SupportedWordSize,
B: 'static + WriteBuffer<Word = W>,
pub fn rx<W, B>(self, buffer: B) -> Result<Transfer<B>, Error> where
W: SupportedWordSize,
B: 'static + WriteBuffer<Word = W>,
Receives data into the given buffer
until it’s filled.
Buffer address must be 4 byte aligned and located in RAM.
Returns a value that represents the in-progress DMA transfer.
sourcepub fn transfer<W, TxB, RxB>(
self,
tx_buffer: TxB,
rx_buffer: RxB
) -> Result<TransferFullDuplex<TxB, RxB>, Error> where
W: SupportedWordSize,
TxB: 'static + ReadBuffer<Word = W>,
RxB: 'static + WriteBuffer<Word = W>,
pub fn transfer<W, TxB, RxB>(
self,
tx_buffer: TxB,
rx_buffer: RxB
) -> Result<TransferFullDuplex<TxB, RxB>, Error> where
W: SupportedWordSize,
TxB: 'static + ReadBuffer<Word = W>,
RxB: 'static + WriteBuffer<Word = W>,
Full duplex DMA transfer.
Transmits the given tx_buffer
while simultaneously receiving data
into the given rx_buffer
until it is filled.
The buffers must be of equal size and their addresses must be 4 byte aligned and located in RAM.
Returns a value that represents the in-progress DMA transfer.
sourcepub fn tx<W, B>(self, buffer: B) -> Result<Transfer<B>, Error> where
W: SupportedWordSize,
B: 'static + ReadBuffer<Word = W>,
pub fn tx<W, B>(self, buffer: B) -> Result<Transfer<B>, Error> where
W: SupportedWordSize,
B: 'static + ReadBuffer<Word = W>,
Transmits the given tx_buffer
.
Buffer address must be 4 byte aligned and located in RAM.
Returns a value that represents the in-progress DMA transfer.
sourcepub fn set_tx_ptr(&self, addr: u32) -> Result<(), Error>
pub fn set_tx_ptr(&self, addr: u32) -> Result<(), Error>
Sets the transmit buffer RAM start address.
sourcepub unsafe fn set_rx_ptr(&self, addr: u32) -> Result<(), Error>
pub unsafe fn set_rx_ptr(&self, addr: u32) -> Result<(), Error>
Sets the receive buffer RAM start address.
sourcepub unsafe fn set_buffersize(&self, n_32bit: u32) -> Result<(), Error>
pub unsafe fn set_buffersize(&self, n_32bit: u32) -> Result<(), Error>
Sets the size (in 32bit words) of the receive and transmit buffers.
sourcepub fn is_event_triggered(&self, event: I2SEvent) -> bool
pub fn is_event_triggered(&self, event: I2SEvent) -> bool
Checks if an event has been triggered.
sourcepub fn reset_event(&self, event: I2SEvent)
pub fn reset_event(&self, event: I2SEvent)
Marks event as handled.
sourcepub fn enable_interrupt(&self, event: I2SEvent) -> &I2S
pub fn enable_interrupt(&self, event: I2SEvent) -> &I2S
Enables interrupt triggering on the specified event.
sourcepub fn disable_interrupt(&self, event: I2SEvent) -> &I2S
pub fn disable_interrupt(&self, event: I2SEvent) -> &I2S
Disables interrupt triggering on the specified event.
sourcepub fn event_stopped(&self) -> &Reg<EVENTS_STOPPED_SPEC>
pub fn event_stopped(&self) -> &Reg<EVENTS_STOPPED_SPEC>
Returns reference to Stopped
event endpoint for PPI.
sourcepub fn event_rx_ptr_updated(&self) -> &Reg<EVENTS_RXPTRUPD_SPEC>
pub fn event_rx_ptr_updated(&self) -> &Reg<EVENTS_RXPTRUPD_SPEC>
Returns reference to RxPtrUpdated
event endpoint for PPI.
sourcepub fn event_tx_ptr_updated(&self) -> &Reg<EVENTS_TXPTRUPD_SPEC>
pub fn event_tx_ptr_updated(&self) -> &Reg<EVENTS_TXPTRUPD_SPEC>
Returns reference to TxPtrUpdated
event endpoint for PPI.
sourcepub fn task_start(&self) -> &Reg<TASKS_START_SPEC>
pub fn task_start(&self) -> &Reg<TASKS_START_SPEC>
Returns reference to Start
task endpoint for PPI.
sourcepub fn task_stop(&self) -> &Reg<TASKS_STOP_SPEC>
pub fn task_stop(&self) -> &Reg<TASKS_STOP_SPEC>
Returns reference to Stop
task endpoint for PPI.
Auto Trait Implementations
impl RefUnwindSafe for I2S
impl Send for I2S
impl !Sync for I2S
impl Unpin for I2S
impl UnwindSafe for I2S
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> CheckedAs for T
impl<T> CheckedAs for T
sourcepub fn checked_as<Dst>(self) -> Option<Dst> where
T: CheckedCast<Dst>,
pub fn checked_as<Dst>(self) -> Option<Dst> where
T: CheckedCast<Dst>,
Casts the value.
sourceimpl<Src, Dst> CheckedCastFrom<Src> for Dst where
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dst where
Src: CheckedCast<Dst>,
sourcepub fn checked_cast_from(src: Src) -> Option<Dst>
pub fn checked_cast_from(src: Src) -> Option<Dst>
Casts the value.
sourceimpl<Src, Dst> LosslessTryInto<Dst> for Src where
Dst: LosslessTryFrom<Src>,
impl<Src, Dst> LosslessTryInto<Dst> for Src where
Dst: LosslessTryFrom<Src>,
sourcepub fn lossless_try_into(self) -> Option<Dst>
pub fn lossless_try_into(self) -> Option<Dst>
Performs the conversion.
sourceimpl<Src, Dst> LossyInto<Dst> for Src where
Dst: LossyFrom<Src>,
impl<Src, Dst> LossyInto<Dst> for Src where
Dst: LossyFrom<Src>,
sourcepub fn lossy_into(self) -> Dst
pub fn lossy_into(self) -> Dst
Performs the conversion.
sourceimpl<T> OverflowingAs for T
impl<T> OverflowingAs for T
sourcepub fn overflowing_as<Dst>(self) -> (Dst, bool) where
T: OverflowingCast<Dst>,
pub fn overflowing_as<Dst>(self) -> (Dst, bool) where
T: OverflowingCast<Dst>,
Casts the value.
sourceimpl<Src, Dst> OverflowingCastFrom<Src> for Dst where
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dst where
Src: OverflowingCast<Dst>,
sourcepub fn overflowing_cast_from(src: Src) -> (Dst, bool)
pub fn overflowing_cast_from(src: Src) -> (Dst, bool)
OverflowingCasts the value.
sourceimpl<T> SaturatingAs for T
impl<T> SaturatingAs for T
sourcepub fn saturating_as<Dst>(self) -> Dst where
T: SaturatingCast<Dst>,
pub fn saturating_as<Dst>(self) -> Dst where
T: SaturatingCast<Dst>,
Casts the value.
sourceimpl<Src, Dst> SaturatingCastFrom<Src> for Dst where
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dst where
Src: SaturatingCast<Dst>,
sourcepub fn saturating_cast_from(src: Src) -> Dst
pub fn saturating_cast_from(src: Src) -> Dst
Casts the value.
sourceimpl<T> UnwrappedAs for T
impl<T> UnwrappedAs for T
sourcepub fn unwrapped_as<Dst>(self) -> Dst where
T: UnwrappedCast<Dst>,
pub fn unwrapped_as<Dst>(self) -> Dst where
T: UnwrappedCast<Dst>,
Casts the value.
sourceimpl<Src, Dst> UnwrappedCastFrom<Src> for Dst where
Src: UnwrappedCast<Dst>,
impl<Src, Dst> UnwrappedCastFrom<Src> for Dst where
Src: UnwrappedCast<Dst>,
sourcepub fn unwrapped_cast_from(src: Src) -> Dst
pub fn unwrapped_cast_from(src: Src) -> Dst
UnwrappedCasts the value.
sourceimpl<T> WrappingAs for T
impl<T> WrappingAs for T
sourcepub fn wrapping_as<Dst>(self) -> Dst where
T: WrappingCast<Dst>,
pub fn wrapping_as<Dst>(self) -> Dst where
T: WrappingCast<Dst>,
Casts the value.
sourceimpl<Src, Dst> WrappingCastFrom<Src> for Dst where
Src: WrappingCast<Dst>,
impl<Src, Dst> WrappingCastFrom<Src> for Dst where
Src: WrappingCast<Dst>,
sourcepub fn wrapping_cast_from(src: Src) -> Dst
pub fn wrapping_cast_from(src: Src) -> Dst
WrappingCasts the value.