Skip to main content

Config

Struct Config 

Source
pub struct Config { /* private fields */ }
Expand description

CS43L22 configuration This struct is used to configure the CS43L22 driver It contains the output device, interface format, word length and volume

Implementations§

Source§

impl Config

Source

pub fn new() -> Self

Create a new CS43L22 configuration

Source

pub fn output_device(self, output_device: OutputDevice) -> Self

Set the output device

Source

pub fn interface_format(self, interface_format: InterfaceFormat) -> Self

Set the interface format

Source

pub fn word_length(self, word_length: WordLength) -> Self

Set the word length

Source

pub fn volume_a(self, volume: u16) -> Self

Set the volume

Source

pub fn volume_b(self, volume: u16) -> Self

Set the volume

Source

pub fn treble_cutoff(self, treble_cutoff: TrebleCutoff) -> Self

Set the treble cutoff frequency

Source

pub fn treble_gain(self, treble_gain: ToneGain) -> Self

Set the treble gain

Source

pub fn bass_cutoff(self, bass_cutoff: BassCutoff) -> Self

Set the bass cutoff frequency

Source

pub fn bass_gain(self, bass_gain: ToneGain) -> Self

Set the bass gain

Source

pub fn with_tone_control(self, tone_control: bool) -> Self

Set the tone control

Trait Implementations§

Source§

impl Debug for Config

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Config

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.