Struct esp_idf_hal::i2s::config::Config
source · pub struct Config { /* private fields */ }
Expand description
I2S common channel configuration.
To create a custom configuration, use the builder pattern built-in to this struct. For example:
use esp_idf_hal::i2s::config::{ChannelOpen, Config, Role};
let config = Config::default().role(Role::Target).channels(ChannelOpen::Rx);
The default configuration is:
role
:Role::Controller
(master)dma_buffer_count
: 6 (DEFAULT_DMA_BUFFER_COUNT
)frames_per_buffer
: 240 (DEFAULT_FRAMES_PER_DMA_BUFFER
)auto_clear
:false
Implementations§
source§impl Config
impl Config
sourcepub fn role(self, role: Role) -> Self
pub fn role(self, role: Role) -> Self
Set the role of this channel: controller (master) or target (slave).
sourcepub fn dma_buffer_count(self, dma_buffer_count: u32) -> Self
pub fn dma_buffer_count(self, dma_buffer_count: u32) -> Self
Set the number of DMA buffers to use.
sourcepub fn frames_per_buffer(self, frames: u32) -> Self
pub fn frames_per_buffer(self, frames: u32) -> Self
Set the number of I2S frames in one DMA buffer.
sourcepub fn auto_clear(self, auto_clear: bool) -> Self
pub fn auto_clear(self, auto_clear: bool) -> Self
Set if the transmit buffer will be automatically cleared upon sending.
Trait Implementations§
impl Copy for Config
impl Eq for Config
impl StructuralPartialEq for Config
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
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,
§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)