#include "hpm_wm8978.h"Macros | |
| #define | WM8978_I2C_SLAVE_ADDRESS1 (0x1A) |
| #define | WM8978_I2C_SLAVE_ADDRESS2 (0x1A) |
Functions | |
| hpm_stat_t | wm8979_init (wm8978_context_t *control) |
| WM8979 initialize function. More... | |
| hpm_stat_t | wm8978_reset (wm8978_context_t *control) |
| Write register to WM8978 using I2C. More... | |
| hpm_stat_t | wm8978_set_out_volume (wm8978_context_t *control, wm8978_out_channel_t channel, uint8_t volume) |
| WM8979 set out volume function. More... | |
| hpm_stat_t | wm8978_get_out_volume (wm8978_context_t *control, wm8978_out_channel_t channel, uint8_t *volume) |
| WM8979 read out volume function. More... | |
| hpm_stat_t | wm8978_set_out_mute (wm8978_context_t *control, wm8978_out_channel_t channel, bool mute) |
| WM8979 set out mute. More... | |
| hpm_stat_t | wm8978_set_mic_gain (wm8978_context_t *control, uint8_t gain) |
| WM8979 set gain of mic. More... | |
| hpm_stat_t | wm8978_set_line_gain (wm8978_context_t *control, uint8_t gain) |
| WM8979 set the gain of the Line input channel. More... | |
| hpm_stat_t | wm8978_power_down (wm8978_context_t *control) |
| WM8979 enter power down mode. More... | |
| hpm_stat_t | wm8978_cfg_audio_interface (wm8978_context_t *control, wm8978_audio_interface_t standard, wm8978_word_length_t word_len) |
| Configuring the audio interface of WM8978. More... | |
| hpm_stat_t | wm8978_cfg_audio_channel (wm8978_context_t *control, uint8_t in_flags, uint8_t out_flags) |
| Configure wm8978 audio channel. More... | |
| hpm_stat_t | wm8978_notch_filter (wm8978_context_t *control, uint16_t nfa0, uint16_t nfa1) |
| setting the Notch Filter for WM8978 More... | |
| hpm_stat_t | wm8978_ctrl_gpio1 (wm8978_context_t *control, bool value) |
| Control the GPIO1 pin of WM8978 to output high or low. More... | |
| hpm_stat_t | wm8978_write_reg (wm8978_context_t *control, uint8_t reg, uint16_t val) |
| Write register to WM8978 using I2C. More... | |
| hpm_stat_t | wm8978_read_reg (wm8978_context_t *control, uint8_t reg, uint16_t *val) |
| Read register from WM8978 using I2C. More... | |
| hpm_stat_t | wm8978_modify_reg (wm8978_context_t *control, uint8_t reg, uint16_t mask, uint16_t val) |
| Modify some bits in the register using I2C. More... | |
Variables | |
| static volatile uint16_t | wm8978_reg_val [] |
| #define WM8978_I2C_SLAVE_ADDRESS1 (0x1A) |
| #define WM8978_I2C_SLAVE_ADDRESS2 (0x1A) |
| hpm_stat_t wm8978_cfg_audio_channel | ( | wm8978_context_t * | control, |
| uint8_t | in_flags, | ||
| uint8_t | out_flags | ||
| ) |
Configure wm8978 audio channel.
| [in] | control | WM8979 control structure. |
| [in] | in_flags | Flags for the input channel |
| [in] | out_flags | Flags for the output channel |
| hpm_stat_t | status_success if set without any error |
| hpm_stat_t wm8978_cfg_audio_interface | ( | wm8978_context_t * | control, |
| wm8978_audio_interface_t | standard, | ||
| wm8978_word_length_t | word_len | ||
| ) |
Configuring the audio interface of WM8978.
| [in] | control | WM8979 control structure. |
| [in] | standard | wm8978_audio_interface_t structure |
| [in] | word_len | wm8978_word_length_t structure |
| hpm_stat_t | status_success if set without any error |
| hpm_stat_t wm8978_ctrl_gpio1 | ( | wm8978_context_t * | control, |
| bool | value | ||
| ) |
Control the GPIO1 pin of WM8978 to output high or low.
| [in] | control | WM8979 control structure. |
| [in] | value | output high or low. if true, it's high |
| hpm_stat_t | status_success if set without any error |
| hpm_stat_t wm8978_get_out_volume | ( | wm8978_context_t * | control, |
| wm8978_out_channel_t | channel, | ||
| uint8_t * | volume | ||
| ) |
WM8979 read out volume function.
| [in] | control | WM8979 control structure. |
| [in] | channel | out channel |
| [out] | volume | volume points value |
| hpm_stat_t | status_success if set without any error |
| hpm_stat_t wm8978_modify_reg | ( | wm8978_context_t * | control, |
| uint8_t | reg, | ||
| uint16_t | mask, | ||
| uint16_t | val | ||
| ) |
Modify some bits in the register using I2C.
| [in] | control | WM8978 control structure. |
| [in] | reg | The register address in WM8978. |
| [in] | mask | The mask code for the bits want to write. The bit you want to write should be 0. |
| [in] | val | Value needs to write into the register. |
| hpm_stat_t | status_success if modify reg without any error |
| hpm_stat_t wm8978_notch_filter | ( | wm8978_context_t * | control, |
| uint16_t | nfa0, | ||
| uint16_t | nfa1 | ||
| ) |
setting the Notch Filter for WM8978
| [in] | control | WM8979 control structure. |
| [in] | nfa0 | Notch Filter0 value |
| [in] | nfa1 | Notch Filter1 value |
| hpm_stat_t | status_success if set without any error |
| hpm_stat_t wm8978_power_down | ( | wm8978_context_t * | control | ) |
WM8979 enter power down mode.
| [in] | control | WM8979 control structure. |
| hpm_stat_t | status_success if set without any error |
| hpm_stat_t wm8978_read_reg | ( | wm8978_context_t * | control, |
| uint8_t | reg, | ||
| uint16_t * | val | ||
| ) |
Read register from WM8978 using I2C.
| [in] | reg | The register address in WM8978. |
| [in] | reg | The register address in WM8978. |
| [out] | val | Value point read to. |
| hpm_stat_t | status_success if read reg without any error |
| hpm_stat_t wm8978_reset | ( | wm8978_context_t * | control | ) |
Write register to WM8978 using I2C.
| [in] | control | WM8978 control structure. |
| hpm_stat_t | status_success if reset without any error |
| hpm_stat_t wm8978_set_line_gain | ( | wm8978_context_t * | control, |
| uint8_t | gain | ||
| ) |
WM8979 set the gain of the Line input channel.
| [in] | control | WM8979 control structure. |
| [in] | gain | volume value, range: 0 ~ 7 |
| hpm_stat_t | status_success if set without any error |
| hpm_stat_t wm8978_set_mic_gain | ( | wm8978_context_t * | control, |
| uint8_t | gain | ||
| ) |
WM8979 set gain of mic.
| [in] | control | WM8979 control structure. |
| [in] | gain | gain value, range: 0 ~ 63 |
| hpm_stat_t | status_success if set without any error |
| hpm_stat_t wm8978_set_out_mute | ( | wm8978_context_t * | control, |
| wm8978_out_channel_t | channel, | ||
| bool | mute | ||
| ) |
WM8979 set out mute.
| [in] | control | WM8979 control structure. |
| [in] | channel | out channel |
| [in] | mute | if mute is set to true |
| hpm_stat_t | status_success if set without any error |
| hpm_stat_t wm8978_set_out_volume | ( | wm8978_context_t * | control, |
| wm8978_out_channel_t | channel, | ||
| uint8_t | volume | ||
| ) |
WM8979 set out volume function.
| [in] | control | WM8979 control structure. |
| [in] | channel | out channel |
| [in] | volume | volume value |
| hpm_stat_t | status_success if set without any error |
| hpm_stat_t wm8978_write_reg | ( | wm8978_context_t * | control, |
| uint8_t | reg, | ||
| uint16_t | val | ||
| ) |
Write register to WM8978 using I2C.
| [in] | control | WM8978 control structure. |
| [in] | reg | The register address in WM8978. |
| [in] | val | Value needs to write into the register. |
| hpm_stat_t | status_success if write reg without any error |
| hpm_stat_t wm8979_init | ( | wm8978_context_t * | control | ) |
WM8979 initialize function.
| [in] | control | WM8979 control structure. |
| hpm_stat_t | status_success if init without any error |
|
static |