Arduino WM8060 Audio Codec
|
Transmit Audio. More...
Functions | |
void | mtb_wm8960_set_write_retry_count (uint32_t count) |
Defines the number of times we retry to update a register value via I2C. This might help if you have an instable I2C connection. By default we set it to 1 which will cause the initialization to fail when the register update fails. More... | |
bool | mtb_wm8960_init (uint8_t features) |
Initialize the I2C communication with the audio codec, reset the codec and apply default configuration based on the feature(s) requested. More... | |
void | mtb_wm8960_free () |
Frees up any resources allocated by the driver as part of mtb_wm8960_init(). | |
bool | mtb_wm8960_adjust_input_volume (uint8_t volume) |
This function updates the volume of both the left and right channels of the microphone input. More... | |
bool | mtb_wm8960_adjust_heaphone_output_volume (uint8_t volume) |
This function updates the volume of both the left and right channels of the headphone output. More... | |
bool | mtb_wm8960_adjust_speaker_output_volume (uint8_t volume) |
This function updates the volume of both the left and right channels of the speaker output. More... | |
bool | mtb_wm8960_set_output_volume (uint8_t volume) |
This function updates the volume of both the left and right channels of the speaker and headphones. More... | |
bool | mtb_wm8960_activate (void) |
This function powers up the modules the required for the features enabled using mtb_wm8960_init. This function is called in conjunction with mtb_wm8960_deactivate. More... | |
bool | mtb_wm8960_deactivate (void) |
This function powers down the modules the required for the features enabled using mtb_wm8960_init. More... | |
bool | mtb_wm8960_configure_clocking (uint32_t mclk_hz, bool enable_pll, mtb_wm8960_adc_dac_sample_rate_t sample_rate, mtb_wm8960_word_length_t word_length, mtb_wm8960_mode_t mode) |
This function configures the master clock and the digital interface for the audio codec. More... | |
bool | mtb_wm8960_dump () |
This function dumps the actual register values. More... | |
Transmit Audio.
bool mtb_wm8960_activate | ( | void | ) |
This function powers up the modules the required for the features enabled using mtb_wm8960_init. This function is called in conjunction with mtb_wm8960_deactivate.
bool mtb_wm8960_adjust_heaphone_output_volume | ( | uint8_t | volume | ) |
This function updates the volume of both the left and right channels of the headphone output.
[in] | volume | - Steps of 1dB, where: Minimum volume: -73dB (0x30) Maximum volume: +6dB (0x7F) Mute: (0x00~0x2F) |
bool mtb_wm8960_adjust_input_volume | ( | uint8_t | volume | ) |
This function updates the volume of both the left and right channels of the microphone input.
[in] | volume | - Steps of 0.75dB, where: Minimum volume: -17.25dB (0x00) Maximum volume: +30dB (0x3F) |
bool mtb_wm8960_adjust_speaker_output_volume | ( | uint8_t | volume | ) |
This function updates the volume of both the left and right channels of the speaker output.
[in] | volume | - Steps of 1dB, where: Minimum volume: -73dB (0x30) Maximum volume: +6dB (0x7F) Mute: (0x00~0x2F) |
bool mtb_wm8960_configure_clocking | ( | uint32_t | mclk_hz, |
bool | enable_pll, | ||
mtb_wm8960_adc_dac_sample_rate_t | sample_rate, | ||
mtb_wm8960_word_length_t | word_length, | ||
mtb_wm8960_mode_t | mode | ||
) |
This function configures the master clock and the digital interface for the audio codec.
[in] | mclk_hz | The master clock (MCLK) frequency |
[in] | enable_pll | Set true to enable PLL and false to disable PLL |
[in] | sample_rate | Sample rate for the ADC and DAC |
[in] | word_length | Word length |
[in] | mode | Mode the audio codec to operate as. |
bool mtb_wm8960_deactivate | ( | void | ) |
This function powers down the modules the required for the features enabled using mtb_wm8960_init.
bool mtb_wm8960_dump | ( | ) |
This function dumps the actual register values.
[in] | reg | The audio codec register to update |
[in] | mask | The mask used to clear bits in the register |
bool mtb_wm8960_init | ( | uint8_t | features | ) |
Initialize the I2C communication with the audio codec, reset the codec and apply default configuration based on the feature(s) requested.
If either WM8960_FEATURE_MICROPHONE or WM8960_FEATURE_HEADPHONE is requested, the following operations will be performed, For either feature features,
For WM8960_FEATURE_MICROPHONE,
For WM8960_FEATURE_HEADPHONE,
[in] | features | Features to enabled during initialization. See mtb_wm8960_features_t |
bool mtb_wm8960_set_output_volume | ( | uint8_t | volume | ) |
This function updates the volume of both the left and right channels of the speaker and headphones.
[in] | volume | - Steps of 1dB, where: Minimum volume: -73dB (0x30) Maximum volume: +6dB (0x7F) Mute: (0x00~0x2F) |
void mtb_wm8960_set_write_retry_count | ( | uint32_t | count | ) |
Defines the number of times we retry to update a register value via I2C. This might help if you have an instable I2C connection. By default we set it to 1 which will cause the initialization to fail when the register update fails.
count; | 0: retry endlessly until success; any number > 0 = number of retries |