[−][src]Struct nrf52832_hal::i2s::I2S
Implementations
impl I2S
[src]
pub fn new_controller(
i2s: I2S,
mck_pin: Option<&Pin<Output<PushPull>>>,
sck_pin: &Pin<Output<PushPull>>,
lrck_pin: &Pin<Output<PushPull>>,
sdin_pin: Option<&Pin<Input<Floating>>>,
sdout_pin: Option<&Pin<Output<PushPull>>>
) -> I2S
[src]
i2s: I2S,
mck_pin: Option<&Pin<Output<PushPull>>>,
sck_pin: &Pin<Output<PushPull>>,
lrck_pin: &Pin<Output<PushPull>>,
sdin_pin: Option<&Pin<Input<Floating>>>,
sdout_pin: Option<&Pin<Output<PushPull>>>
) -> I2S
Takes ownership of the raw I2S peripheral, returning a safe wrapper in controller mode.
pub fn new_peripheral(
i2s: I2S,
mck_pin: Option<&Pin<Input<Floating>>>,
sck_pin: &Pin<Input<Floating>>,
lrck_pin: &Pin<Input<Floating>>,
sdin_pin: Option<&Pin<Input<Floating>>>,
sdout_pin: Option<&Pin<Output<PushPull>>>
) -> I2S
[src]
i2s: I2S,
mck_pin: Option<&Pin<Input<Floating>>>,
sck_pin: &Pin<Input<Floating>>,
lrck_pin: &Pin<Input<Floating>>,
sdin_pin: Option<&Pin<Input<Floating>>>,
sdout_pin: Option<&Pin<Output<PushPull>>>
) -> I2S
Takes ownership of the raw I2S peripheral, returning a safe wrapper in peripheral mode.
pub fn enable(&self) -> &I2S
[src]
Enables the I2S module.
pub fn disable(&self) -> &I2S
[src]
Disables the I2S module.
pub fn start(&self) -> &I2S
[src]
Starts I2S transfer.
pub fn stop(&self) -> &I2S
[src]
Stops the I2S transfer and waits until it has stopped.
pub fn set_tx_enabled(&self, enabled: bool) -> &I2S
[src]
Enables/disables I2S transmission (TX).
pub fn set_rx_enabled(&self, enabled: bool) -> &I2S
[src]
Enables/disables I2S reception (RX).
pub fn set_mck_frequency(&self, freq: MckFreq) -> &I2S
[src]
Sets MCK generator frequency.
pub fn set_ratio(&self, ratio: Ratio) -> &I2S
[src]
Sets MCK / LRCK ratio.
pub fn set_sample_width(&self, width: SampleWidth) -> &I2S
[src]
Sets sample width.
pub fn set_align(&self, align: Align) -> &I2S
[src]
Sets the sample alignment within a frame.
pub fn set_format(&self, format: Format) -> &I2S
[src]
Sets the frame format.
pub fn set_channels(&self, channels: Channels) -> &I2S
[src]
Sets the I2S channel configuation.
pub fn channels(&self) -> Channels
[src]
Returns the I2S channel configuation.
pub fn rx<W, B>(self, buffer: B) -> Result<Transfer<B>, Error> where
B: WriteBuffer<Word = W> + 'static,
W: SupportedWordSize,
[src]
B: WriteBuffer<Word = W> + 'static,
W: SupportedWordSize,
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.
pub fn transfer<W, TxB, RxB>(
self,
tx_buffer: TxB,
rx_buffer: RxB
) -> Result<TransferFullDuplex<TxB, RxB>, Error> where
RxB: WriteBuffer<Word = W> + 'static,
TxB: ReadBuffer<Word = W> + 'static,
W: SupportedWordSize,
[src]
self,
tx_buffer: TxB,
rx_buffer: RxB
) -> Result<TransferFullDuplex<TxB, RxB>, Error> where
RxB: WriteBuffer<Word = W> + 'static,
TxB: ReadBuffer<Word = W> + 'static,
W: SupportedWordSize,
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.
pub fn tx<W, B>(self, buffer: B) -> Result<Transfer<B>, Error> where
B: ReadBuffer<Word = W> + 'static,
W: SupportedWordSize,
[src]
B: ReadBuffer<Word = W> + 'static,
W: SupportedWordSize,
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.
pub fn set_tx_ptr(&self, addr: u32) -> Result<(), Error>
[src]
Sets the transmit buffer RAM start address.
pub unsafe fn set_rx_ptr(&self, addr: u32) -> Result<(), Error>
[src]
Sets the receive buffer RAM start address.
pub unsafe fn set_buffersize(&self, n_32bit: u32) -> Result<(), Error>
[src]
Sets the size (in 32bit words) of the receive and transmit buffers.
pub fn is_event_triggered(&self, event: I2SEvent) -> bool
[src]
Checks if an event has been triggered.
pub fn reset_event(&self, event: I2SEvent)
[src]
Marks event as handled.
pub fn enable_interrupt(&self, event: I2SEvent) -> &I2S
[src]
Enables interrupt triggering on the specified event.
pub fn disable_interrupt(&self, event: I2SEvent) -> &I2S
[src]
Disables interrupt triggering on the specified event.
pub fn event_stopped(&self) -> &Reg<u32, _EVENTS_STOPPED>
[src]
Returns reference to Stopped
event endpoint for PPI.
pub fn event_rx_ptr_updated(&self) -> &Reg<u32, _EVENTS_RXPTRUPD>
[src]
Returns reference to RxPtrUpdated
event endpoint for PPI.
pub fn event_tx_ptr_updated(&self) -> &Reg<u32, _EVENTS_TXPTRUPD>
[src]
Returns reference to TxPtrUpdated
event endpoint for PPI.
pub fn task_start(&self) -> &Reg<u32, _TASKS_START>
[src]
Returns reference to Start
task endpoint for PPI.
pub fn task_stop(&self) -> &Reg<u32, _TASKS_STOP>
[src]
Returns reference to Stop
task endpoint for PPI.
pub fn free(self) -> I2S
[src]
Consumes self
and returns back the raw peripheral.
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<Src, Dst> LosslessTryInto<Dst> for Src where
Dst: LosslessTryFrom<Src>,
[src]
Dst: LosslessTryFrom<Src>,
pub fn lossless_try_into(self) -> Option<Dst>
[src]
impl<Src, Dst> LossyInto<Dst> for Src where
Dst: LossyFrom<Src>,
[src]
Dst: LossyFrom<Src>,
pub fn lossy_into(self) -> Dst
[src]
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,