Skip to main content

CodecChip

Trait CodecChip 

Source
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§

Source

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).

Source

fn set_format(&mut self, fmt: I2sFormat, bits: Bits) -> Result<()>

Serial port framing and slot width.

Source

fn start(&mut self, module: Module) -> Result<()>

Power the converters up and unmute the port.

Source

fn stop(&mut self) -> Result<()>

Power down.

Source

fn set_mute(&mut self, mute: bool) -> Result<()>

Mute without changing gain.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<I: I2c> CodecChip for Es7210<I>

Source§

impl<I: I2c> CodecChip for Es7243e<I>

Source§

impl<I: I2c> CodecChip for Es8156<I>

Source§

impl<I: I2c> CodecChip for Es8311<I>

Source§

impl<I: I2c> CodecChip for Es8388<I>