pub trait CodecChip {
// Required methods
fn set_sample_rate(
&mut self,
sample_rate_hz: u32,
mclk_hz: u32,
) -> Result<()>;
fn set_format(&mut self, fmt: I2sFormat, bits: Bits) -> Result<()>;
fn start(&mut self, module: Module) -> Result<()>;
fn stop(&mut self) -> Result<()>;
fn set_mute(&mut self, mute: bool) -> Result<()>;
}Expand description
What a firmware asks of any codec chip, whichever one the board carries.
Required Methods§
Sourcefn set_sample_rate(&mut self, sample_rate_hz: u32, mclk_hz: u32) -> Result<()>
fn set_sample_rate(&mut self, sample_rate_hz: u32, mclk_hz: u32) -> Result<()>
Clock the converters for sample_rate_hz from a master clock of
mclk_hz (a chip supports only the pairs in its coefficient table).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".