Struct microbit::hal::i2s::I2S [−][src]
pub struct I2S { /* fields omitted */ }
Implementations
impl I2S
[src]
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]
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]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]
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]Takes ownership of the raw I2S peripheral, returning a safe wrapper in peripheral mode.
pub fn set_tx_enabled(&self, enabled: bool) -> &I2S
[src]
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]
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]
pub fn set_mck_frequency(&self, freq: MckFreq) -> &I2S
[src]Sets MCK generator frequency.
pub fn set_sample_width(&self, width: SampleWidth) -> &I2S
[src]
pub fn set_sample_width(&self, width: SampleWidth) -> &I2S
[src]Sets sample width.
pub fn set_format(&self, format: Format) -> &I2S
[src]
pub fn set_format(&self, format: Format) -> &I2S
[src]Sets the frame format.
pub fn set_channels(&self, channels: Channels) -> &I2S
[src]
pub fn set_channels(&self, channels: Channels) -> &I2S
[src]Sets the I2S channel configuation.
pub fn rx<W, B>(self, buffer: B) -> Result<Transfer<B>, Error> where
W: SupportedWordSize,
B: WriteBuffer<Word = W> + 'static,
[src]
pub fn rx<W, B>(self, buffer: B) -> Result<Transfer<B>, Error> where
W: SupportedWordSize,
B: WriteBuffer<Word = W> + 'static,
[src]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
W: SupportedWordSize,
TxB: ReadBuffer<Word = W> + 'static,
RxB: WriteBuffer<Word = W> + 'static,
[src]
pub fn transfer<W, TxB, RxB>(
self,
tx_buffer: TxB,
rx_buffer: RxB
) -> Result<TransferFullDuplex<TxB, RxB>, Error> where
W: SupportedWordSize,
TxB: ReadBuffer<Word = W> + 'static,
RxB: WriteBuffer<Word = W> + 'static,
[src]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
W: SupportedWordSize,
B: ReadBuffer<Word = W> + 'static,
[src]
pub fn tx<W, B>(self, buffer: B) -> Result<Transfer<B>, Error> where
W: SupportedWordSize,
B: ReadBuffer<Word = W> + 'static,
[src]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]
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]
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]
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]
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]
pub fn reset_event(&self, event: I2SEvent)
[src]Marks event as handled.
pub fn enable_interrupt(&self, event: I2SEvent) -> &I2S
[src]
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]
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]
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]
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]
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]
pub fn task_start(&self) -> &Reg<u32, _TASKS_START>
[src]Returns reference to Start
task endpoint for PPI.
Auto Trait Implementations
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> CheckedAs for T
[src]
impl<T> CheckedAs for T
[src]pub fn checked_as<Dst>(self) -> Option<Dst> where
T: CheckedCast<Dst>,
[src]
pub fn checked_as<Dst>(self) -> Option<Dst> where
T: CheckedCast<Dst>,
[src]Casts the value.
impl<Src, Dst> LosslessTryInto<Dst> for Src where
Dst: LosslessTryFrom<Src>,
[src]
impl<Src, Dst> LosslessTryInto<Dst> for Src where
Dst: LosslessTryFrom<Src>,
[src]pub fn lossless_try_into(self) -> Option<Dst>
[src]
pub fn lossless_try_into(self) -> Option<Dst>
[src]Performs the conversion.
impl<Src, Dst> LossyInto<Dst> for Src where
Dst: LossyFrom<Src>,
[src]
impl<Src, Dst> LossyInto<Dst> for Src where
Dst: LossyFrom<Src>,
[src]pub fn lossy_into(self) -> Dst
[src]
pub fn lossy_into(self) -> Dst
[src]Performs the conversion.
impl<T> OverflowingAs for T
[src]
impl<T> OverflowingAs for T
[src]pub fn overflowing_as<Dst>(self) -> (Dst, bool) where
T: OverflowingCast<Dst>,
[src]
pub fn overflowing_as<Dst>(self) -> (Dst, bool) where
T: OverflowingCast<Dst>,
[src]Casts the value.
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self
impl<T> SaturatingAs for T
[src]
impl<T> SaturatingAs for T
[src]pub fn saturating_as<Dst>(self) -> Dst where
T: SaturatingCast<Dst>,
[src]
pub fn saturating_as<Dst>(self) -> Dst where
T: SaturatingCast<Dst>,
[src]Casts the value.
impl<T> UnwrappedAs for T
[src]
impl<T> UnwrappedAs for T
[src]pub fn unwrapped_as<Dst>(self) -> Dst where
T: UnwrappedCast<Dst>,
[src]
pub fn unwrapped_as<Dst>(self) -> Dst where
T: UnwrappedCast<Dst>,
[src]Casts the value.
impl<T> WrappingAs for T
[src]
impl<T> WrappingAs for T
[src]pub fn wrapping_as<Dst>(self) -> Dst where
T: WrappingCast<Dst>,
[src]
pub fn wrapping_as<Dst>(self) -> Dst where
T: WrappingCast<Dst>,
[src]Casts the value.