pub struct Channels { /* private fields */ }Expand description
I2S channels configuration
Implementations§
Source§impl Channels
 
impl Channels
Sourcepub const LEFT: Channels
 
pub const LEFT: Channels
Two channels. Left(first) channel will contain data. Right(second) channel will contain zeros.
Sourcepub const RIGHT: Channels
 
pub const RIGHT: Channels
Two channels. Right(second) channel will contain data. Left(first) channel will contain zeros.
Sourcepub const fn new(count: u8, mask: u16, fill: Option<u32>) -> Self
 
pub const fn new(count: u8, mask: u16, fill: Option<u32>) -> Self
Creates arbitrary configuration for I2S channels.
- countthe total number of channels. Must be at least 1 and no more than 16.
- maskdetermines which channels will be active, with the least significant bit representing first channel. Setting the bit at the nth position means nth channel is active. Inactive channels do not consume or write data in the DMA buffer.
- filldetermines the behavior of inactive channels.- Some(n)will make all inactive channel send out specified value, truncated to the channel width.- Nonewill make disabled channels repeat the data from the last active channel. This field is ignored in the receiver unit.
§Example
The following example prepares configuration for 6 channels. Only 1st and 4th channels are active. Channels 2-3 will use the same data as the 1st, and channels 5-6 will use the data from the 4th.
use esp_hal::i2s::master::Channels;
let channels = Channels::new(6, 0b_001_001, None);Trait Implementations§
impl Copy for Channels
Available on crate feature 
unstable only.impl Eq for Channels
Available on crate feature 
unstable only.impl StructuralPartialEq for Channels
Available on crate feature 
unstable only.Auto Trait Implementations§
impl Freeze for Channels
impl RefUnwindSafe for Channels
impl Send for Channels
impl Sync for Channels
impl Unpin for Channels
impl UnwindSafe for Channels
Blanket Implementations§
§impl<T> Any for Twhere
    T: 'static + ?Sized,
 
impl<T> Any for Twhere
    T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
    T: ?Sized,
 
impl<T> Borrow<T> for Twhere
    T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
 
impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
 
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
    T: Clone,
 
impl<T> CloneToUninit for Twhere
    T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
 
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)