42#define CHIP_NAME "Cirrus Logic WM8978"
43#define MANUFACTURER_NAME "Cirrus Logic"
44#define SUPPLY_VOLTAGE_MIN 2.5f
45#define SUPPLY_VOLTAGE_MAX 5.5f
46#define MAX_CURRENT 18.0f
47#define TEMPERATURE_MIN -40.0f
48#define TEMPERATURE_MAX 100.0f
49#define DRIVER_VERSION 1000
54#define WM8978_ADDRESS (0x1A << 1)
59#define WM8978_REG_SOFTWARE_RESET 0x00
60#define WM8978_REG_POWER_MANAGE_1 0x01
61#define WM8978_REG_POWER_MANAGE_2 0x02
62#define WM8978_REG_POWER_MANAGE_3 0x03
63#define WM8978_REG_AUDIO_INTERFACE 0x04
64#define WM8978_REG_COMPANDING_CTRL 0x05
65#define WM8978_REG_CLOCK_GEN_CTRL 0x06
66#define WM8978_REG_ADDITIONAL_CTRL 0x07
67#define WM8978_REG_GPIO 0x08
68#define WM8978_REG_JACK_DETECT_CONTROL 0x09
69#define WM8978_REG_DAC_CONTROL 0x0A
70#define WM8978_REG_LEFT_DAC_DIGITAL_VOL 0x0B
71#define WM8978_REG_RIGHT_DAC_DIGITAL_VOL 0x0C
72#define WM8978_REG_JACK_DETECT_CONTROL2 0x0D
73#define WM8978_REG_ADC_CONTROL 0x0E
74#define WM8978_REG_LEFT_ADC_DIGITAL_VOL 0x0F
75#define WM8978_REG_RIGHT_ADC_DIGITAL_VOL 0x10
76#define WM8978_REG_EQ1 0x12
77#define WM8978_REG_EQ2 0x13
78#define WM8978_REG_EQ3 0x14
79#define WM8978_REG_EQ4 0x15
80#define WM8978_REG_EQ5 0x16
81#define WM8978_REG_DAC_LIMITER_1 0x18
82#define WM8978_REG_DAC_LIMITER_2 0x19
83#define WM8978_REG_NOTCH_FILTER_1 0x1B
84#define WM8978_REG_NOTCH_FILTER_2 0x1C
85#define WM8978_REG_NOTCH_FILTER_3 0x1D
86#define WM8978_REG_NOTCH_FILTER_4 0x1E
87#define WM8978_REG_ALC_CONTROL_1 0x20
88#define WM8978_REG_ALC_CONTROL_2 0x21
89#define WM8978_REG_ALC_CONTROL_3 0x22
90#define WM8978_REG_NOISE_GATE 0x23
91#define WM8978_REG_PLL_N 0x24
92#define WM8978_REG_PLL_K1 0x25
93#define WM8978_REG_PLL_K2 0x26
94#define WM8978_REG_PLL_K3 0x27
95#define WM8978_REG_3D_CONTROL 0x29
96#define WM8978_REG_BEEP_CONTROL 0x2B
97#define WM8978_REG_INPUT_CTRL 0x2C
98#define WM8978_REG_LEFT_INP_PGA_CTRL 0x2D
99#define WM8978_REG_RIGHT_INP_PGA_CTRL 0x2E
100#define WM8978_REG_LEFT_ADC_BOOST_CTRL 0x2F
101#define WM8978_REG_RIGHT_ADC_BOOST_CTRL 0x30
102#define WM8978_REG_OUTPUT_CTRL 0x31
103#define WM8978_REG_LEFT_MIXER_CTRL 0x32
104#define WM8978_REG_RIGHT_MIXER_CTRL 0x33
105#define WM8978_REG_LOUT1_CTRL 0x34
106#define WM8978_REG_ROUT1_CTRL 0x35
107#define WM8978_REG_LOUT2_CTRL 0x36
108#define WM8978_REG_ROUT2_CTRL 0x37
109#define WM8978_REG_OUT3_MIXER_CTRL 0x38
110#define WM8978_REG_OUT4_MIXER_CTRL 0x39
115static const uint16_t gsc_wm8978_init_reg[58] =
117 0X0000, 0X0000, 0X0000, 0X0000, 0X0050, 0X0000, 0X0140, 0X0000,
118 0X0000, 0X0000, 0X0000, 0X00FF, 0X00FF, 0X0000, 0X0100, 0X00FF,
119 0X00FF, 0X0000, 0X012C, 0X002C, 0X002C, 0X002C, 0X002C, 0X0000,
120 0X0032, 0X0000, 0X0000, 0X0000, 0X0000, 0X0000, 0X0000, 0X0000,
121 0X0038, 0X000B, 0X0032, 0X0000, 0X0008, 0X000C, 0X0093, 0X00E9,
122 0X0000, 0X0000, 0X0000, 0X0000, 0X0003, 0X0010, 0X0010, 0X0100,
123 0X0100, 0X0002, 0X0001, 0X0001, 0X0039, 0X0039, 0X0039, 0X0039,
137static uint8_t a_wm8978_iic_read(
wm8978_handle_t *handle, uint8_t reg, uint16_t *config)
147 *config = handle->
reg[reg];
163static uint8_t a_wm8978_iic_write(
wm8978_handle_t *handle, uint8_t reg, uint16_t config)
167 buf[0] = config & 0xFF;
169 (reg << 1) | ((config >> 8) & 0x01), (uint8_t *)buf, 1) != 0)
173 handle->
reg[reg] = config;
206 handle->
debug_print(
"wm8978: write config failed.\n");
243 handle->
debug_print(
"wm8978: read config failed.\n");
252 handle->
debug_print(
"wm8978: write config failed.\n");
288 handle->
debug_print(
"wm8978: read config failed.\n");
297 handle->
debug_print(
"wm8978: write config failed.\n");
333 handle->
debug_print(
"wm8978: read config failed.\n");
342 handle->
debug_print(
"wm8978: write config failed.\n");
378 handle->
debug_print(
"wm8978: read config failed.\n");
387 handle->
debug_print(
"wm8978: write config failed.\n");
423 handle->
debug_print(
"wm8978: read config failed.\n");
432 handle->
debug_print(
"wm8978: write config failed.\n");
468 handle->
debug_print(
"wm8978: read config failed.\n");
477 handle->
debug_print(
"wm8978: write config failed.\n");
513 handle->
debug_print(
"wm8978: read config failed.\n");
522 handle->
debug_print(
"wm8978: write config failed.\n");
558 handle->
debug_print(
"wm8978: read config failed.\n");
563 conf |= impedance << 0;
567 handle->
debug_print(
"wm8978: write config failed.\n");
603 handle->
debug_print(
"wm8978: read config failed.\n");
612 handle->
debug_print(
"wm8978: write config failed.\n");
648 handle->
debug_print(
"wm8978: read config failed.\n");
657 handle->
debug_print(
"wm8978: write config failed.\n");
693 handle->
debug_print(
"wm8978: read config failed.\n");
702 handle->
debug_print(
"wm8978: write config failed.\n");
738 handle->
debug_print(
"wm8978: read config failed.\n");
747 handle->
debug_print(
"wm8978: write config failed.\n");
783 handle->
debug_print(
"wm8978: read config failed.\n");
792 handle->
debug_print(
"wm8978: write config failed.\n");
828 handle->
debug_print(
"wm8978: read config failed.\n");
837 handle->
debug_print(
"wm8978: write config failed.\n");
873 handle->
debug_print(
"wm8978: read config failed.\n");
882 handle->
debug_print(
"wm8978: write config failed.\n");
918 handle->
debug_print(
"wm8978: read config failed.\n");
927 handle->
debug_print(
"wm8978: write config failed.\n");
963 handle->
debug_print(
"wm8978: read config failed.\n");
972 handle->
debug_print(
"wm8978: write config failed.\n");
1008 handle->
debug_print(
"wm8978: read config failed.\n");
1013 conf |= enable << 8;
1017 handle->
debug_print(
"wm8978: write config failed.\n");
1053 handle->
debug_print(
"wm8978: read config failed.\n");
1058 conf |= enable << 7;
1062 handle->
debug_print(
"wm8978: write config failed.\n");
1098 handle->
debug_print(
"wm8978: read config failed.\n");
1103 conf |= enable << 6;
1107 handle->
debug_print(
"wm8978: write config failed.\n");
1143 handle->
debug_print(
"wm8978: read config failed.\n");
1148 conf |= enable << 5;
1152 handle->
debug_print(
"wm8978: write config failed.\n");
1188 handle->
debug_print(
"wm8978: read config failed.\n");
1193 conf |= enable << 3;
1197 handle->
debug_print(
"wm8978: write config failed.\n");
1233 handle->
debug_print(
"wm8978: read config failed.\n");
1238 conf |= enable << 2;
1242 handle->
debug_print(
"wm8978: write config failed.\n");
1278 handle->
debug_print(
"wm8978: read config failed.\n");
1283 conf |= enable << 1;
1287 handle->
debug_print(
"wm8978: write config failed.\n");
1323 handle->
debug_print(
"wm8978: read config failed.\n");
1328 conf |= enable << 0;
1332 handle->
debug_print(
"wm8978: write config failed.\n");
1368 handle->
debug_print(
"wm8978: read config failed.\n");
1373 conf |= polarity << 8;
1377 handle->
debug_print(
"wm8978: write config failed.\n");
1413 handle->
debug_print(
"wm8978: read config failed.\n");
1418 conf |= polarity << 7;
1422 handle->
debug_print(
"wm8978: write config failed.\n");
1458 handle->
debug_print(
"wm8978: read config failed.\n");
1463 conf |= word_length << 5;
1467 handle->
debug_print(
"wm8978: write config failed.\n");
1503 handle->
debug_print(
"wm8978: read config failed.\n");
1508 conf |= format << 3;
1512 handle->
debug_print(
"wm8978: write config failed.\n");
1548 handle->
debug_print(
"wm8978: read config failed.\n");
1553 conf |= appear << 2;
1557 handle->
debug_print(
"wm8978: write config failed.\n");
1593 handle->
debug_print(
"wm8978: read config failed.\n");
1598 conf |= appear << 1;
1602 handle->
debug_print(
"wm8978: write config failed.\n");
1638 handle->
debug_print(
"wm8978: read config failed.\n");
1643 conf |= channel << 0;
1647 handle->
debug_print(
"wm8978: write config failed.\n");
1683 handle->
debug_print(
"wm8978: read config failed.\n");
1688 conf |= enable << 5;
1692 handle->
debug_print(
"wm8978: write config failed.\n");
1728 handle->
debug_print(
"wm8978: read config failed.\n");
1733 conf |= companding << 3;
1737 handle->
debug_print(
"wm8978: write config failed.\n");
1773 handle->
debug_print(
"wm8978: read config failed.\n");
1778 conf |= companding << 1;
1782 handle->
debug_print(
"wm8978: write config failed.\n");
1818 handle->
debug_print(
"wm8978: read config failed.\n");
1823 conf |= enable << 0;
1827 handle->
debug_print(
"wm8978: write config failed.\n");
1863 handle->
debug_print(
"wm8978: read config failed.\n");
1868 conf |= clksel << 8;
1872 handle->
debug_print(
"wm8978: write config failed.\n");
1908 handle->
debug_print(
"wm8978: read config failed.\n");
1917 handle->
debug_print(
"wm8978: write config failed.\n");
1953 handle->
debug_print(
"wm8978: read config failed.\n");
1962 handle->
debug_print(
"wm8978: write config failed.\n");
1998 handle->
debug_print(
"wm8978: read config failed.\n");
2007 handle->
debug_print(
"wm8978: write config failed.\n");
2043 handle->
debug_print(
"wm8978: read config failed.\n");
2048 conf |= sample << 1;
2052 handle->
debug_print(
"wm8978: write config failed.\n");
2088 handle->
debug_print(
"wm8978: read config failed.\n");
2093 conf |= enable << 0;
2097 handle->
debug_print(
"wm8978: write config failed.\n");
2133 handle->
debug_print(
"wm8978: read config failed.\n");
2142 handle->
debug_print(
"wm8978: write config failed.\n");
2178 handle->
debug_print(
"wm8978: read config failed.\n");
2183 conf |= polarity << 3;
2187 handle->
debug_print(
"wm8978: write config failed.\n");
2223 handle->
debug_print(
"wm8978: read config failed.\n");
2232 handle->
debug_print(
"wm8978: write config failed.\n");
2268 handle->
debug_print(
"wm8978: read config failed.\n");
2273 conf |= enable << 8;
2277 handle->
debug_print(
"wm8978: write config failed.\n");
2313 handle->
debug_print(
"wm8978: read config failed.\n");
2318 conf |= enable << 7;
2322 handle->
debug_print(
"wm8978: write config failed.\n");
2358 handle->
debug_print(
"wm8978: read config failed.\n");
2363 conf |= enable << 6;
2367 handle->
debug_print(
"wm8978: write config failed.\n");
2403 handle->
debug_print(
"wm8978: read config failed.\n");
2412 handle->
debug_print(
"wm8978: write config failed.\n");
2448 handle->
debug_print(
"wm8978: read config failed.\n");
2453 conf |= enable << 6;
2457 handle->
debug_print(
"wm8978: write config failed.\n");
2493 handle->
debug_print(
"wm8978: read config failed.\n");
2502 handle->
debug_print(
"wm8978: write config failed.\n");
2538 handle->
debug_print(
"wm8978: read config failed.\n");
2543 conf |= enable << 2;
2547 handle->
debug_print(
"wm8978: write config failed.\n");
2583 handle->
debug_print(
"wm8978: read config failed.\n");
2588 conf |= polarity << 1;
2592 handle->
debug_print(
"wm8978: write config failed.\n");
2628 handle->
debug_print(
"wm8978: read config failed.\n");
2633 conf |= polarity << 0;
2637 handle->
debug_print(
"wm8978: write config failed.\n");
2671 conf = (enable << 8) | volume;
2675 handle->
debug_print(
"wm8978: write config failed.\n");
2709 conf = (enable << 8) | volume;
2713 handle->
debug_print(
"wm8978: write config failed.\n");
2750 handle->
debug_print(
"wm8978: read config failed.\n");
2760 conf &= ~(jack << 4);
2765 handle->
debug_print(
"wm8978: write config failed.\n");
2802 handle->
debug_print(
"wm8978: read config failed.\n");
2812 conf &= ~(jack << 0);
2817 handle->
debug_print(
"wm8978: write config failed.\n");
2853 handle->
debug_print(
"wm8978: read config failed.\n");
2858 conf |= enable << 8;
2862 handle->
debug_print(
"wm8978: write config failed.\n");
2898 handle->
debug_print(
"wm8978: read config failed.\n");
2907 handle->
debug_print(
"wm8978: write config failed.\n");
2943 handle->
debug_print(
"wm8978: read config failed.\n");
2952 handle->
debug_print(
"wm8978: write config failed.\n");
2988 handle->
debug_print(
"wm8978: read config failed.\n");
2997 handle->
debug_print(
"wm8978: write config failed.\n");
3033 handle->
debug_print(
"wm8978: read config failed.\n");
3038 conf |= polarity << 1;
3042 handle->
debug_print(
"wm8978: write config failed.\n");
3078 handle->
debug_print(
"wm8978: read config failed.\n");
3083 conf |= polarity << 0;
3087 handle->
debug_print(
"wm8978: write config failed.\n");
3121 conf = (enable << 8) | volume;
3125 handle->
debug_print(
"wm8978: write config failed.\n");
3159 conf = (enable << 8) | volume;
3163 handle->
debug_print(
"wm8978: write config failed.\n");
3193 *reg = (uint8_t)((uint8_t)(db + 127.0f) * 2 + 1);
3220 *db = -127.0f + (float)(reg - 1) * 0.5f;
3253 handle->
debug_print(
"wm8978: read config failed.\n");
3258 conf |= equaliser << 8;
3262 handle->
debug_print(
"wm8978: write config failed.\n");
3298 handle->
debug_print(
"wm8978: read config failed.\n");
3303 conf |= cut_off << 5;
3307 handle->
debug_print(
"wm8978: write config failed.\n");
3350 handle->
debug_print(
"wm8978: read config failed.\n");
3354 conf &= ~(0x1F << 0);
3359 handle->
debug_print(
"wm8978: write config failed.\n");
3395 handle->
debug_print(
"wm8978: read config failed.\n");
3404 handle->
debug_print(
"wm8978: write config failed.\n");
3440 handle->
debug_print(
"wm8978: read config failed.\n");
3449 handle->
debug_print(
"wm8978: write config failed.\n");
3492 handle->
debug_print(
"wm8978: read config failed.\n");
3496 conf &= ~(0x1F << 0);
3501 handle->
debug_print(
"wm8978: write config failed.\n");
3537 handle->
debug_print(
"wm8978: read config failed.\n");
3546 handle->
debug_print(
"wm8978: write config failed.\n");
3582 handle->
debug_print(
"wm8978: read config failed.\n");
3591 handle->
debug_print(
"wm8978: write config failed.\n");
3634 handle->
debug_print(
"wm8978: read config failed.\n");
3638 conf &= ~(0x1F << 0);
3643 handle->
debug_print(
"wm8978: write config failed.\n");
3679 handle->
debug_print(
"wm8978: read config failed.\n");
3688 handle->
debug_print(
"wm8978: write config failed.\n");
3724 handle->
debug_print(
"wm8978: read config failed.\n");
3733 handle->
debug_print(
"wm8978: write config failed.\n");
3776 handle->
debug_print(
"wm8978: read config failed.\n");
3780 conf &= ~(0x1F << 0);
3785 handle->
debug_print(
"wm8978: write config failed.\n");
3821 handle->
debug_print(
"wm8978: read config failed.\n");
3826 conf |= cut_off << 5;
3830 handle->
debug_print(
"wm8978: write config failed.\n");
3873 handle->
debug_print(
"wm8978: read config failed.\n");
3877 conf &= ~(0x1F << 0);
3882 handle->
debug_print(
"wm8978: write config failed.\n");
3912 *reg = (uint8_t)(-db + 12);
3939 *db = (int8_t)(12 - reg);
3972 handle->
debug_print(
"wm8978: read config failed.\n");
3977 conf |= enable << 8;
3981 handle->
debug_print(
"wm8978: write config failed.\n");
4017 handle->
debug_print(
"wm8978: read config failed.\n");
4021 conf &= ~(0xF << 4);
4026 handle->
debug_print(
"wm8978: write config failed.\n");
4062 handle->
debug_print(
"wm8978: read config failed.\n");
4066 conf &= ~(0xF << 0);
4067 conf |= attack << 0;
4071 handle->
debug_print(
"wm8978: write config failed.\n");
4107 handle->
debug_print(
"wm8978: read config failed.\n");
4116 handle->
debug_print(
"wm8978: write config failed.\n");
4159 handle->
debug_print(
"wm8978: read config failed.\n");
4163 conf &= ~(0xF << 0);
4168 handle->
debug_print(
"wm8978: write config failed.\n");
4204 handle->
debug_print(
"wm8978: read config failed.\n");
4209 conf |= enable << 7;
4213 handle->
debug_print(
"wm8978: write config failed.\n");
4247 if (coefficient > 0x7F)
4249 handle->
debug_print(
"wm8978: coefficient > 0x7F.\n");
4257 handle->
debug_print(
"wm8978: read config failed.\n");
4262 conf |= update_once << 8;
4263 conf &= ~(0x7F << 0);
4264 conf |= coefficient << 0;
4268 handle->
debug_print(
"wm8978: write config failed.\n");
4302 if (coefficient > 0x7F)
4304 handle->
debug_print(
"wm8978: coefficient > 0x7F.\n");
4312 handle->
debug_print(
"wm8978: read config failed.\n");
4317 conf |= update_once << 8;
4318 conf &= ~(0x7F << 0);
4319 conf |= coefficient << 0;
4323 handle->
debug_print(
"wm8978: write config failed.\n");
4357 if (coefficient > 0x7F)
4359 handle->
debug_print(
"wm8978: coefficient > 0x7F.\n");
4367 handle->
debug_print(
"wm8978: read config failed.\n");
4372 conf |= update_once << 8;
4373 conf &= ~(0x7F << 0);
4374 conf |= coefficient << 0;
4378 handle->
debug_print(
"wm8978: write config failed.\n");
4412 if (coefficient > 0x7F)
4414 handle->
debug_print(
"wm8978: coefficient > 0x7F.\n");
4422 handle->
debug_print(
"wm8978: read config failed.\n");
4427 conf |= update_once << 8;
4428 conf &= ~(0x7F << 0);
4429 conf |= coefficient << 0;
4433 handle->
debug_print(
"wm8978: write config failed.\n");
4469 handle->
debug_print(
"wm8978: read config failed.\n");
4478 handle->
debug_print(
"wm8978: write config failed.\n");
4514 handle->
debug_print(
"wm8978: read config failed.\n");
4523 handle->
debug_print(
"wm8978: write config failed.\n");
4559 handle->
debug_print(
"wm8978: read config failed.\n");
4568 handle->
debug_print(
"wm8978: write config failed.\n");
4611 handle->
debug_print(
"wm8978: read config failed.\n");
4615 conf &= ~(0xF << 4);
4620 handle->
debug_print(
"wm8978: write config failed.\n");
4650 *reg = (uint8_t)(ms / 2.67f);
4677 *ms = (float)(reg * 2.67f);
4710 handle->
debug_print(
"wm8978: read config failed.\n");
4714 conf &= ~(0xF << 0);
4719 handle->
debug_print(
"wm8978: write config failed.\n");
4755 handle->
debug_print(
"wm8978: read config failed.\n");
4764 handle->
debug_print(
"wm8978: write config failed.\n");
4807 handle->
debug_print(
"wm8978: read config failed.\n");
4811 conf &= ~(0xF << 4);
4816 handle->
debug_print(
"wm8978: write config failed.\n");
4859 handle->
debug_print(
"wm8978: read config failed.\n");
4863 conf &= ~(0xF << 0);
4864 conf |= attack << 0;
4868 handle->
debug_print(
"wm8978: write config failed.\n");
4904 handle->
debug_print(
"wm8978: read config failed.\n");
4909 conf |= enable << 3;
4913 handle->
debug_print(
"wm8978: write config failed.\n");
4946 if (threshold > 0x7)
4948 handle->
debug_print(
"wm8978: threshold > 0x7.\n");
4956 handle->
debug_print(
"wm8978: read config failed.\n");
4961 conf |= threshold << 0;
4965 handle->
debug_print(
"wm8978: write config failed.\n");
4995 *reg = (uint8_t)((db + 39) / (-6));
5022 *db = (int8_t)(reg * (-6) - 39);
5055 handle->
debug_print(
"wm8978: read config failed.\n");
5060 conf |= enable << 4;
5064 handle->
debug_print(
"wm8978: write config failed.\n");
5107 handle->
debug_print(
"wm8978: read config failed.\n");
5111 conf &= ~(0xF << 0);
5116 handle->
debug_print(
"wm8978: write config failed.\n");
5149 conf = (freq >> 0) & 0x1FF;
5153 handle->
debug_print(
"wm8978: write config failed.\n");
5157 conf = (freq >> 9) & 0x1FF;
5161 handle->
debug_print(
"wm8978: write config failed.\n");
5165 conf = (freq >> 18) & 0x3F;
5169 handle->
debug_print(
"wm8978: write config failed.\n");
5212 handle->
debug_print(
"wm8978: read config failed.\n");
5216 conf &= ~(0xF << 0);
5221 handle->
debug_print(
"wm8978: write config failed.\n");
5251 *reg = (uint8_t)(percent / 6.67f);
5278 *percent = (float)(reg) * 6.67f;
5311 handle->
debug_print(
"wm8978: read config failed.\n");
5316 conf |= enable << 5;
5320 handle->
debug_print(
"wm8978: write config failed.\n");
5356 handle->
debug_print(
"wm8978: read config failed.\n");
5361 conf |= enable << 4;
5365 handle->
debug_print(
"wm8978: write config failed.\n");
5408 handle->
debug_print(
"wm8978: read config failed.\n");
5417 handle->
debug_print(
"wm8978: write config failed.\n");
5447 *reg = (uint8_t)(db + 15) / 3;
5474 *db = (int8_t)(reg * 3 - 15);
5507 handle->
debug_print(
"wm8978: read config failed.\n");
5512 conf |= enable << 0;
5516 handle->
debug_print(
"wm8978: write config failed.\n");
5552 handle->
debug_print(
"wm8978: read config failed.\n");
5561 handle->
debug_print(
"wm8978: write config failed.\n");
5597 handle->
debug_print(
"wm8978: read config failed.\n");
5602 conf |= enable << 6;
5606 handle->
debug_print(
"wm8978: write config failed.\n");
5642 handle->
debug_print(
"wm8978: read config failed.\n");
5647 conf |= enable << 5;
5651 handle->
debug_print(
"wm8978: write config failed.\n");
5687 handle->
debug_print(
"wm8978: read config failed.\n");
5692 conf |= enable << 4;
5696 handle->
debug_print(
"wm8978: write config failed.\n");
5732 handle->
debug_print(
"wm8978: read config failed.\n");
5737 conf |= enable << 2;
5741 handle->
debug_print(
"wm8978: write config failed.\n");
5777 handle->
debug_print(
"wm8978: read config failed.\n");
5782 conf |= enable << 1;
5786 handle->
debug_print(
"wm8978: write config failed.\n");
5822 handle->
debug_print(
"wm8978: read config failed.\n");
5827 conf |= enable << 0;
5831 handle->
debug_print(
"wm8978: write config failed.\n");
5867 handle->
debug_print(
"wm8978: read config failed.\n");
5872 conf |= enable << 8;
5876 handle->
debug_print(
"wm8978: write config failed.\n");
5912 handle->
debug_print(
"wm8978: read config failed.\n");
5917 conf |= enable << 7;
5921 handle->
debug_print(
"wm8978: write config failed.\n");
5957 handle->
debug_print(
"wm8978: read config failed.\n");
5962 conf |= enable << 6;
5966 handle->
debug_print(
"wm8978: write config failed.\n");
6009 handle->
debug_print(
"wm8978: read config failed.\n");
6013 conf &= ~(0x3F << 0);
6014 conf |= volume << 0;
6018 handle->
debug_print(
"wm8978: write config failed.\n");
6048 *reg = (uint8_t)((db + 12.0f) / 0.75f);
6075 *db = (float)(reg) * 0.75f - 12.0f;
6108 handle->
debug_print(
"wm8978: read config failed.\n");
6113 conf |= enable << 8;
6117 handle->
debug_print(
"wm8978: write config failed.\n");
6153 handle->
debug_print(
"wm8978: read config failed.\n");
6158 conf |= enable << 7;
6162 handle->
debug_print(
"wm8978: write config failed.\n");
6198 handle->
debug_print(
"wm8978: read config failed.\n");
6203 conf |= enable << 6;
6207 handle->
debug_print(
"wm8978: write config failed.\n");
6250 handle->
debug_print(
"wm8978: read config failed.\n");
6254 conf &= ~(0x3F << 0);
6255 conf |= volume << 0;
6259 handle->
debug_print(
"wm8978: write config failed.\n");
6289 *reg = (uint8_t)((db + 12.0f) / 0.75f);
6316 *db = (float)(reg) * 0.75f - 12.0f;
6349 handle->
debug_print(
"wm8978: read config failed.\n");
6354 conf |= enable << 8;
6358 handle->
debug_print(
"wm8978: write config failed.\n");
6401 handle->
debug_print(
"wm8978: read config failed.\n");
6405 conf &= ~(0x7 << 4);
6410 handle->
debug_print(
"wm8978: write config failed.\n");
6440 *reg = (uint8_t)(db + 15) / 3;
6467 *db = (int8_t)(reg * 3 - 15);
6507 handle->
debug_print(
"wm8978: read config failed.\n");
6511 conf &= ~(0x7 << 0);
6516 handle->
debug_print(
"wm8978: write config failed.\n");
6546 *reg = (uint8_t)(db + 15) / 3;
6573 *db = (int8_t)(reg * 3 - 15);
6606 handle->
debug_print(
"wm8978: read config failed.\n");
6611 conf |= enable << 8;
6615 handle->
debug_print(
"wm8978: write config failed.\n");
6658 handle->
debug_print(
"wm8978: read config failed.\n");
6662 conf &= ~(0x7 << 4);
6667 handle->
debug_print(
"wm8978: write config failed.\n");
6697 *reg = (uint8_t)(db + 15) / 3;
6724 *db = (int8_t)(reg * 3 - 15);
6764 handle->
debug_print(
"wm8978: read config failed.\n");
6768 conf &= ~(0x7 << 0);
6773 handle->
debug_print(
"wm8978: write config failed.\n");
6803 *reg = (uint8_t)(db + 15) / 3;
6830 *db = (int8_t)(reg * 3 - 15);
6863 handle->
debug_print(
"wm8978: read config failed.\n");
6868 conf |= enable << 6;
6872 handle->
debug_print(
"wm8978: write config failed.\n");
6908 handle->
debug_print(
"wm8978: read config failed.\n");
6913 conf |= enable << 5;
6917 handle->
debug_print(
"wm8978: write config failed.\n");
6953 handle->
debug_print(
"wm8978: read config failed.\n");
6958 conf |= enable << 4;
6962 handle->
debug_print(
"wm8978: write config failed.\n");
6998 handle->
debug_print(
"wm8978: read config failed.\n");
7003 conf |= enable << 3;
7007 handle->
debug_print(
"wm8978: write config failed.\n");
7043 handle->
debug_print(
"wm8978: read config failed.\n");
7048 conf |= enable << 2;
7052 handle->
debug_print(
"wm8978: write config failed.\n");
7088 handle->
debug_print(
"wm8978: read config failed.\n");
7093 conf |= enable << 1;
7097 handle->
debug_print(
"wm8978: write config failed.\n");
7133 handle->
debug_print(
"wm8978: read config failed.\n");
7142 handle->
debug_print(
"wm8978: write config failed.\n");
7185 handle->
debug_print(
"wm8978: read config failed.\n");
7194 handle->
debug_print(
"wm8978: write config failed.\n");
7224 *reg = (uint8_t)(db + 15) / 3;
7251 *db = (int8_t)(reg * 3 - 15);
7284 handle->
debug_print(
"wm8978: read config failed.\n");
7289 conf |= enable << 5;
7293 handle->
debug_print(
"wm8978: write config failed.\n");
7336 handle->
debug_print(
"wm8978: read config failed.\n");
7345 handle->
debug_print(
"wm8978: write config failed.\n");
7375 *reg = (uint8_t)(db + 15) / 3;
7402 *db = (int8_t)(reg * 3 - 15);
7435 handle->
debug_print(
"wm8978: read config failed.\n");
7440 conf |= enable << 1;
7444 handle->
debug_print(
"wm8978: write config failed.\n");
7480 handle->
debug_print(
"wm8978: read config failed.\n");
7485 conf |= enable << 0;
7489 handle->
debug_print(
"wm8978: write config failed.\n");
7532 handle->
debug_print(
"wm8978: read config failed.\n");
7541 handle->
debug_print(
"wm8978: write config failed.\n");
7571 *reg = (uint8_t)(db + 15) / 3;
7598 *db = (int8_t)(reg * 3 - 15);
7631 handle->
debug_print(
"wm8978: read config failed.\n");
7636 conf |= enable << 5;
7640 handle->
debug_print(
"wm8978: write config failed.\n");
7683 handle->
debug_print(
"wm8978: read config failed.\n");
7692 handle->
debug_print(
"wm8978: write config failed.\n");
7722 *reg = (uint8_t)(db + 15) / 3;
7749 *db = (int8_t)(reg * 3 - 15);
7782 handle->
debug_print(
"wm8978: read config failed.\n");
7787 conf |= enable << 1;
7791 handle->
debug_print(
"wm8978: write config failed.\n");
7827 handle->
debug_print(
"wm8978: read config failed.\n");
7832 conf |= enable << 0;
7836 handle->
debug_print(
"wm8978: write config failed.\n");
7872 handle->
debug_print(
"wm8978: read config failed.\n");
7877 conf |= enable << 8;
7881 handle->
debug_print(
"wm8978: write config failed.\n");
7917 handle->
debug_print(
"wm8978: read config failed.\n");
7922 conf |= enable << 7;
7926 handle->
debug_print(
"wm8978: write config failed.\n");
7962 handle->
debug_print(
"wm8978: read config failed.\n");
7967 conf |= enable << 6;
7971 handle->
debug_print(
"wm8978: write config failed.\n");
8014 handle->
debug_print(
"wm8978: read config failed.\n");
8018 conf &= ~(0x3F << 0);
8023 handle->
debug_print(
"wm8978: write config failed.\n");
8053 *reg = (uint8_t)(db + 57);
8080 *db = (int8_t)(reg - 57);
8113 handle->
debug_print(
"wm8978: read config failed.\n");
8118 conf |= enable << 8;
8122 handle->
debug_print(
"wm8978: write config failed.\n");
8158 handle->
debug_print(
"wm8978: read config failed.\n");
8163 conf |= enable << 7;
8167 handle->
debug_print(
"wm8978: write config failed.\n");
8203 handle->
debug_print(
"wm8978: read config failed.\n");
8208 conf |= enable << 6;
8212 handle->
debug_print(
"wm8978: write config failed.\n");
8255 handle->
debug_print(
"wm8978: read config failed.\n");
8259 conf &= ~(0x3F << 0);
8264 handle->
debug_print(
"wm8978: write config failed.\n");
8294 *reg = (uint8_t)(db + 57);
8321 *db = (int8_t)(reg - 57);
8354 handle->
debug_print(
"wm8978: read config failed.\n");
8359 conf |= enable << 8;
8363 handle->
debug_print(
"wm8978: write config failed.\n");
8399 handle->
debug_print(
"wm8978: read config failed.\n");
8404 conf |= enable << 7;
8408 handle->
debug_print(
"wm8978: write config failed.\n");
8444 handle->
debug_print(
"wm8978: read config failed.\n");
8449 conf |= enable << 6;
8453 handle->
debug_print(
"wm8978: write config failed.\n");
8496 handle->
debug_print(
"wm8978: read config failed.\n");
8500 conf &= ~(0x3F << 0);
8505 handle->
debug_print(
"wm8978: write config failed.\n");
8535 *reg = (uint8_t)(db + 57);
8562 *db = (int8_t)(reg - 57);
8595 handle->
debug_print(
"wm8978: read config failed.\n");
8600 conf |= enable << 8;
8604 handle->
debug_print(
"wm8978: write config failed.\n");
8640 handle->
debug_print(
"wm8978: read config failed.\n");
8645 conf |= enable << 7;
8649 handle->
debug_print(
"wm8978: write config failed.\n");
8685 handle->
debug_print(
"wm8978: read config failed.\n");
8690 conf |= enable << 6;
8694 handle->
debug_print(
"wm8978: write config failed.\n");
8737 handle->
debug_print(
"wm8978: read config failed.\n");
8741 conf &= ~(0x3F << 0);
8746 handle->
debug_print(
"wm8978: write config failed.\n");
8776 *reg = (uint8_t)(db + 57);
8803 *db = (int8_t)(reg - 57);
8836 handle->
debug_print(
"wm8978: read config failed.\n");
8841 conf |= enable << 6;
8845 handle->
debug_print(
"wm8978: write config failed.\n");
8881 handle->
debug_print(
"wm8978: read config failed.\n");
8886 conf |= enable << 3;
8890 handle->
debug_print(
"wm8978: write config failed.\n");
8926 handle->
debug_print(
"wm8978: read config failed.\n");
8931 conf |= enable << 2;
8935 handle->
debug_print(
"wm8978: write config failed.\n");
8971 handle->
debug_print(
"wm8978: read config failed.\n");
8976 conf |= enable << 1;
8980 handle->
debug_print(
"wm8978: write config failed.\n");
9016 handle->
debug_print(
"wm8978: read config failed.\n");
9021 conf |= enable << 0;
9025 handle->
debug_print(
"wm8978: write config failed.\n");
9061 handle->
debug_print(
"wm8978: read config failed.\n");
9066 conf |= enable << 6;
9070 handle->
debug_print(
"wm8978: write config failed.\n");
9106 handle->
debug_print(
"wm8978: read config failed.\n");
9111 conf |= enable << 5;
9115 handle->
debug_print(
"wm8978: write config failed.\n");
9151 handle->
debug_print(
"wm8978: read config failed.\n");
9156 conf |= enable << 4;
9160 handle->
debug_print(
"wm8978: write config failed.\n");
9196 handle->
debug_print(
"wm8978: read config failed.\n");
9201 conf |= enable << 3;
9205 handle->
debug_print(
"wm8978: write config failed.\n");
9241 handle->
debug_print(
"wm8978: read config failed.\n");
9246 conf |= enable << 2;
9250 handle->
debug_print(
"wm8978: write config failed.\n");
9286 handle->
debug_print(
"wm8978: read config failed.\n");
9291 conf |= enable << 1;
9295 handle->
debug_print(
"wm8978: write config failed.\n");
9331 handle->
debug_print(
"wm8978: read config failed.\n");
9336 conf |= enable << 0;
9340 handle->
debug_print(
"wm8978: write config failed.\n");
9375 handle->
debug_print(
"wm8978: iic_init is null.\n");
9381 handle->
debug_print(
"wm8978: iic_deinit is null.\n");
9387 handle->
debug_print(
"wm8978: iic_write is null.\n");
9393 handle->
debug_print(
"wm8978: delay_ms is null.\n");
9400 handle->
debug_print(
"wm8978: iic init failed.\n");
9408 handle->
debug_print(
"wm8978: write config failed.\n");
9414 for (i = 0; i < 58; i++)
9416 handle->
reg[i] = gsc_wm8978_init_reg[i];
9451 handle->
debug_print(
"wm8978: read config failed.\n");
9460 handle->
debug_print(
"wm8978: write config failed.\n");
9467 handle->
debug_print(
"wm8978: iic deinit failed.\n");
9499 return a_wm8978_iic_write(handle, reg, value);
#define WM8978_REG_POWER_MANAGE_1
#define WM8978_REG_OUT3_MIXER_CTRL
#define WM8978_REG_RIGHT_MIXER_CTRL
#define WM8978_REG_PLL_K2
#define WM8978_REG_AUDIO_INTERFACE
#define WM8978_REG_LEFT_DAC_DIGITAL_VOL
#define WM8978_REG_LOUT2_CTRL
#define WM8978_REG_LEFT_INP_PGA_CTRL
#define WM8978_REG_3D_CONTROL
#define WM8978_REG_LEFT_ADC_BOOST_CTRL
#define WM8978_REG_POWER_MANAGE_3
#define WM8978_REG_RIGHT_ADC_DIGITAL_VOL
#define WM8978_REG_PLL_K3
#define WM8978_REG_NOTCH_FILTER_2
#define WM8978_REG_DAC_CONTROL
#define WM8978_REG_LEFT_ADC_DIGITAL_VOL
#define WM8978_REG_DAC_LIMITER_2
#define WM8978_REG_ALC_CONTROL_3
#define WM8978_REG_POWER_MANAGE_2
#define SUPPLY_VOLTAGE_MAX
#define WM8978_REG_BEEP_CONTROL
#define WM8978_REG_NOISE_GATE
#define WM8978_REG_JACK_DETECT_CONTROL2
#define WM8978_REG_DAC_LIMITER_1
#define WM8978_REG_NOTCH_FILTER_3
#define WM8978_REG_ALC_CONTROL_2
#define WM8978_REG_COMPANDING_CTRL
#define WM8978_REG_ADDITIONAL_CTRL
#define WM8978_ADDRESS
chip address definition
#define WM8978_REG_ROUT2_CTRL
#define WM8978_REG_RIGHT_INP_PGA_CTRL
#define WM8978_REG_NOTCH_FILTER_4
#define WM8978_REG_ADC_CONTROL
#define WM8978_REG_RIGHT_ADC_BOOST_CTRL
#define WM8978_REG_OUT4_MIXER_CTRL
#define MANUFACTURER_NAME
#define SUPPLY_VOLTAGE_MIN
#define WM8978_REG_CLOCK_GEN_CTRL
#define WM8978_REG_JACK_DETECT_CONTROL
#define WM8978_REG_SOFTWARE_RESET
chip register definition
#define WM8978_REG_ROUT1_CTRL
#define WM8978_REG_NOTCH_FILTER_1
#define WM8978_REG_LOUT1_CTRL
#define CHIP_NAME
chip information definition
#define WM8978_REG_ALC_CONTROL_1
#define WM8978_REG_OUTPUT_CTRL
#define WM8978_REG_INPUT_CTRL
#define WM8978_REG_LEFT_MIXER_CTRL
#define WM8978_REG_RIGHT_DAC_DIGITAL_VOL
#define WM8978_REG_PLL_K1
driver wm8978 header file
uint8_t wm8978_set_lout2_left_speaker_output_volume(wm8978_handle_t *handle, uint8_t vol)
set lout2 left speaker output volume
uint8_t wm8978_set_right_out2(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable right out2
uint8_t wm8978_soft_reset(wm8978_handle_t *handle)
soft reset
uint8_t wm8978_set_microphone_bias(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable microphone bias
uint8_t wm8978_set_right_channel_adc(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable right channel adc
wm8978_eq3_band_centre_freq_t
wm8978 eq3 band centre freq enumeration definition
uint8_t wm8978_left_bypass_volume_control_to_output_channel_mixer_convert_to_register(wm8978_handle_t *handle, int8_t db, uint8_t *reg)
convert the left bypass volume control to output channel mixer to the register raw data
uint8_t wm8978_auxiliary_amplifier_right_channel_input_boost_stage_convert_to_data(wm8978_handle_t *handle, uint8_t reg, int8_t *db)
convert the auxiliary amplifier right channel input boost stage register raw data to the real data
uint8_t wm8978_set_right_channel_input_pga_negative(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable right channel input pga negative
uint8_t wm8978_set_auxiliary_amplifier_left_channel_input_boost_stage(wm8978_handle_t *handle, uint8_t stage)
set auxiliary amplifier left channel input boost stage
uint8_t wm8978_set_microphone_bias_voltage(wm8978_handle_t *handle, wm8978_avdd_t avdd)
set microphone bias voltage
uint8_t wm8978_set_eq1_gain(wm8978_handle_t *handle, uint8_t gain)
set eq1 gain
uint8_t wm8978_lout1_left_headphone_output_volume_convert_to_register(wm8978_handle_t *handle, int8_t db, uint8_t *reg)
convert the lout1 left headphone output volume to the register raw data
uint8_t wm8978_rout1_right_headphone_output_volume_convert_to_data(wm8978_handle_t *handle, uint8_t reg, int8_t *db)
convert the rout1 right headphone output volume raw data to the real data
uint8_t wm8978_set_equaliser_apply(wm8978_handle_t *handle, wm8978_equaliser_t equaliser)
set equaliser apply
uint8_t wm8978_set_notch_filter_a0_coefficient_bit_6_0(wm8978_handle_t *handle, wm8978_bool_t update_once, uint8_t coefficient)
set notch filter a0 coefficient bit6 - bit0
uint8_t wm8978_set_mute_input_to_inv_rout2_mixer(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable mute input to inv rout2 mixer
uint8_t wm8978_set_eq4_gain(wm8978_handle_t *handle, uint8_t gain)
set eq4 gain
wm8978_mode_t
wm8978 mode enumeration definition
uint8_t wm8978_alc_noise_gate_threshold_convert_to_data(wm8978_handle_t *handle, uint8_t reg, int8_t *db)
convert the alc noise gate threshold register raw data to the real data
uint8_t wm8978_rout2_right_speaker_output_volume_convert_to_data(wm8978_handle_t *handle, uint8_t reg, int8_t *db)
convert the rout2 right speaker output volume raw data to the real data
wm8978_high_pass_filter_cut_off_t
wm8978 high pass filter cut off enumeration definition
uint8_t wm8978_set_channel(wm8978_handle_t *handle, wm8978_channel_t channel)
set channel
uint8_t wm8978_right_channel_input_boost_stage_convert_to_data(wm8978_handle_t *handle, uint8_t reg, int8_t *db)
convert the right channel input boost stage register raw data to the real data
uint8_t wm8978_set_lout1_headphone_volume_zero_cross(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable lout1 headphone volume zero cross
uint8_t wm8978_set_adc_right_channel_polarity(wm8978_handle_t *handle, wm8978_polarity_t polarity)
set adc right channel polarity
uint8_t wm8978_set_plln(wm8978_handle_t *handle, uint8_t n)
set plln
uint8_t wm8978_set_rout1_update(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable rout1 update
uint8_t wm8978_auxiliary_amplifier_left_channel_input_boost_stage_convert_to_data(wm8978_handle_t *handle, uint8_t reg, int8_t *db)
convert the auxiliary amplifier left channel input boost stage register raw data to the real data
uint8_t wm8978_set_left_channel_input_pga_volume(wm8978_handle_t *handle, uint8_t volume)
set left channel input pga volume
uint8_t wm8978_set_word_length(wm8978_handle_t *handle, wm8978_word_length_t word_length)
set word length
uint8_t wm8978_set_right_dac_output_polarity(wm8978_handle_t *handle, wm8978_polarity_t polarity)
set right dac output polarity
uint8_t wm8978_set_pll(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable pll
uint8_t wm8978_set_left_dac_output_to_right_output_mixer(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable left dac output to right output mixer
wm8978_eq4_band_centre_freq_t
wm8978 eq4 band centre freq enumeration definition
wm8978_data_format_t
wm8978 data format enumeration definition
uint8_t wm8978_set_vmid_0(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable vmid 0
uint8_t wm8978_set_alc(wm8978_handle_t *handle, wm8978_alc_t alc)
set alc
uint8_t wm8978_set_rout2_speaker_volume_zero_cross(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable rout2 speaker volume zero cross
uint8_t wm8978_aux_right_channel_input_to_right_mixer_volume_convert_to_register(wm8978_handle_t *handle, int8_t db, uint8_t *reg)
convert the aux right channel input to right mixer volume to the register raw data
uint8_t wm8978_set_adc_appear(wm8978_handle_t *handle, wm8978_appear_t appear)
set adc appear
uint8_t wm8978_set_rout1_right_headphone_output_volume(wm8978_handle_t *handle, uint8_t vol)
set rout1 right headphone output volume
uint8_t wm8978_init(wm8978_handle_t *handle)
initialize the chip
uint8_t wm8978_set_right_channel_input_pga_volume(wm8978_handle_t *handle, uint8_t volume)
set right channel input pga volume
uint8_t wm8978_volume_convert_to_register(wm8978_handle_t *handle, float db, uint8_t *reg)
convert the volume data to the register raw data
uint8_t wm8978_set_gpio1_select(wm8978_handle_t *handle, wm8978_gpio1_sel_t sel)
set gpio1 select
uint8_t wm8978_set_right_dac_output_to_out4(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable right dac output to out4
uint8_t wm8978_set_left_channel_input_pga_boost(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable left channel input pga boost
uint8_t wm8978_set_right_auxiliary_input_to_right_channel_output_mixer(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable right auxiliary input to right channel output mixer
wm8978_impedance_t
wm8978 impedance enumeration definition
uint8_t wm8978_info(wm8978_info_t *info)
get chip's information
uint8_t wm8978_set_left_input_pga_update(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable left input pga update
uint8_t wm8978_set_left_dac_mixer_to_out3(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable left dac mixer to out3
uint8_t wm8978_set_dac_left_volume(wm8978_handle_t *handle, wm8978_bool_t enable, uint8_t volume)
set dac left volume
wm8978_dac_limiter_attack_t
wm8978 dac limiter attack enumeration definition
uint8_t wm8978_set_eq4_bandwidth(wm8978_handle_t *handle, wm8978_eq_bandwidth_t width)
set eq4 bandwidth
uint8_t wm8978_set_adc_companding(wm8978_handle_t *handle, wm8978_companding_t companding)
set adc companding
uint8_t wm8978_auxiliary_amplifier_left_channel_input_boost_stage_convert_to_register(wm8978_handle_t *handle, int8_t db, uint8_t *reg)
convert the auxiliary amplifier left channel input boost stage to the register raw data
uint8_t wm8978_set_alc_level(wm8978_handle_t *handle, wm8978_alc_level_t level)
set alc level
wm8978_vref_t
wm8978 vref enumeration definition
uint8_t wm8978_set_right_bypass_path_to_right_output_mixer(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable right bypass path to right output mixer
uint8_t wm8978_set_left_dac_output_polarity(wm8978_handle_t *handle, wm8978_polarity_t polarity)
set left dac output polarity
uint8_t wm8978_set_right_channel_input_boost(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable right channel input boost
uint8_t wm8978_set_right_output_channel_mixer(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable right output channel mixer
uint8_t wm8978_auxiliary_amplifier_right_channel_input_boost_stage_convert_to_register(wm8978_handle_t *handle, int8_t db, uint8_t *reg)
convert the auxiliary amplifier right channel input boost stage to the register raw data
uint8_t wm8978_set_pll_div(wm8978_handle_t *handle, wm8978_pll_div_t d)
set pll div
uint8_t wm8978_aux_right_channel_input_to_right_mixer_volume_convert_to_data(wm8978_handle_t *handle, uint8_t reg, int8_t *db)
convert the aux right channel input to right mixer volume raw data to the real data
wm8978_clock_mode_t
wm8978 clock mode enumeration definition
uint8_t wm8978_eq_gain_convert_to_register(wm8978_handle_t *handle, int8_t db, uint8_t *reg)
convert the eq gain to the register raw data
uint8_t wm8978_right_channel_input_pga_volume_convert_to_data(wm8978_handle_t *handle, uint8_t reg, float *db)
convert the right channel input pga volume register raw data to the real data
uint8_t wm8978_set_left_channel_input_pga_zero_cross(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable left channel input pga zero cross
uint8_t wm8978_set_eq5_gain(wm8978_handle_t *handle, uint8_t gain)
set eq5 gain
uint8_t wm8978_set_loopback(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable loopback
uint8_t wm8978_set_pll_freq(wm8978_handle_t *handle, uint32_t freq)
set pll freq
uint8_t wm8978_set_left_dac_mixer_to_out4(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable left dac mixer to out4
uint8_t wm8978_set_lrclk_polarity(wm8978_handle_t *handle, wm8978_polarity_t polarity)
set lrclk polarity
uint8_t wm8978_set_dac_limiter_level(wm8978_handle_t *handle, wm8978_dac_limiter_level_t level)
set dac limiter level
wm8978_adc_oversample_rate_t
wm8978 adc oversample rate enumeration definition
uint8_t wm8978_alc_hold_time_convert_to_register(wm8978_handle_t *handle, float ms, uint8_t *reg)
convert the alc hold time to the register raw data
uint8_t wm8978_set_slow_clock(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable slow clock
uint8_t wm8978_set_approximate_sample_rate(wm8978_handle_t *handle, wm8978_approximate_sample_t sample)
set approximate sample rate
uint8_t wm8978_set_left_dac_output_to_left_output_mixer(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable left dac output to left output mixer
uint8_t wm8978_set_eq5_cut_off(wm8978_handle_t *handle, wm8978_eq5_band_cut_off_t cut_off)
set eq5 cut off
uint8_t wm8978_set_lout2_speaker_volume_zero_cross(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable lout2 speaker volume zero cross
uint8_t wm8978_set_eq2_gain(wm8978_handle_t *handle, uint8_t gain)
set eq2 gain
uint8_t wm8978_alc_noise_gate_threshold_convert_to_register(wm8978_handle_t *handle, int8_t db, uint8_t *reg)
convert the alc noise gate threshold to the register raw data
uint8_t wm8978_set_amute(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable amute
uint8_t wm8978_set_unused_input_output_tie_off_buffer(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable unused input output tie off buffer
uint8_t wm8978_left_channel_input_pga_volume_convert_to_data(wm8978_handle_t *handle, uint8_t reg, float *db)
convert the left channel input pga volume register raw data to the real data
uint8_t wm8978_left_channel_input_pga_volume_convert_to_register(wm8978_handle_t *handle, float db, uint8_t *reg)
convert the left channel input pga volume to the register raw data
wm8978_companding_t
wm8978 companding enumeration definition
uint8_t wm8978_aux_left_channel_input_to_left_mixer_volume_convert_to_data(wm8978_handle_t *handle, uint8_t reg, int8_t *db)
convert the aux left channel input to left mixer volume register raw data to the real data
uint8_t wm8978_set_out3_boost(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable out3 boost
uint8_t wm8978_set_rout2_right_speaker_output_mute(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable rout2 right speaker output mute
uint8_t wm8978_set_left_channel_input_pga_mute(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable left channel input pga mute
uint8_t wm8978_set_left_out1(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable left out1
uint8_t wm8978_left_channel_input_boost_stage_convert_to_register(wm8978_handle_t *handle, int8_t db, uint8_t *reg)
convert the left channel input boost stage to the register raw data
uint8_t wm8978_set_alc_noise_gate(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable alc noise gate
uint8_t wm8978_lout2_left_speaker_output_volume_convert_to_data(wm8978_handle_t *handle, uint8_t reg, int8_t *db)
convert the lout2 left speaker output volume raw data to the real data
wm8978_word_length_t
wm8978 word length enumeration definition
uint8_t wm8978_set_out4_mixer(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable out4 mixer
wm8978_channel_t
wm8978 channel enumeration definition
wm8978_dac_limiter_level_t
wm8978 dac limiter level enumeration definition
uint8_t wm8978_left_channel_input_boost_stage_convert_to_data(wm8978_handle_t *handle, uint8_t reg, int8_t *db)
convert the left channel input boost stage register raw data to the real data
uint8_t wm8978_set_lout2_update(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable lout2 update
uint8_t wm8978_set_right_bypass_volume_control_to_output_channel_mixer(wm8978_handle_t *handle, uint8_t vol)
set right bypass volume control to output channel mixer
wm8978_approximate_sample_t
wm8978 approximate sample enumeration definition
wm8978_pll_div_t
wm8978 pll div enumeration definition
uint8_t wm8978_depth_3d_convert_to_register(wm8978_handle_t *handle, float percent, uint8_t *reg)
convert the depth 3d to the register raw data
uint8_t wm8978_set_left_channel_input_pga_negative(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable left channel input pga negative
uint8_t wm8978_set_clock_mode(wm8978_handle_t *handle, wm8978_clock_mode_t mode)
set clock mode
uint8_t wm8978_alc_hold_time_convert_to_data(wm8978_handle_t *handle, uint8_t reg, float *ms)
convert the alc hold time register raw data to the real data
uint8_t wm8978_set_vref_to_analogue_output_resistance(wm8978_handle_t *handle, wm8978_vref_t vref)
set vref to analogue output resistance
wm8978_avdd_t
wm8978 avdd enumeration definition
uint8_t wm8978_set_bclk_div(wm8978_handle_t *handle, wm8978_bclk_div_t d)
set bclk div
uint8_t wm8978_set_gpio1_polarity(wm8978_handle_t *handle, wm8978_polarity_t polarity)
set gpio1 polarity
uint8_t wm8978_set_right_dac_output_to_left_output_mixer(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable right dac output to left output mixer
uint8_t wm8978_set_right_dac_mixer_to_out4(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable right dac mixer to out4
uint8_t wm8978_set_adc_left_volume(wm8978_handle_t *handle, wm8978_bool_t enable, uint8_t volume)
set adc left volume
uint8_t wm8978_aux_left_channel_input_to_left_mixer_volume_convert_to_register(wm8978_handle_t *handle, int8_t db, uint8_t *reg)
convert the aux left channel input to left mixer volume to the register raw data
wm8978_jack_t
wm8978 jack enumeration definition
wm8978_polarity_t
wm8978 polarity enumeration definition
uint8_t wm8978_set_left_bypass_volume_control_to_output_channel_mixer(wm8978_handle_t *handle, uint8_t vol)
set left bypass volume control to output channel mixer
uint8_t wm8978_set_left_channel_input_pga_positive(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable left channel input pga positive
uint8_t wm8978_set_adc_left_channel_polarity(wm8978_handle_t *handle, wm8978_polarity_t polarity)
set adc left channel polarity
wm8978_eq5_band_cut_off_t
wm8978 eq5 band cut off enumeration definition
uint8_t wm8978_set_speaker_boost(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable speaker boost
uint8_t wm8978_set_eq3_bandwidth(wm8978_handle_t *handle, wm8978_eq_bandwidth_t width)
set eq3 bandwidth
uint8_t wm8978_rout1_right_headphone_output_volume_convert_to_register(wm8978_handle_t *handle, int8_t db, uint8_t *reg)
convert the rout1 right headphone output volume to the register raw data
uint8_t wm8978_set_out4(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable out4
uint8_t wm8978_set_adc_oversample_rate(wm8978_handle_t *handle, wm8978_adc_oversample_rate_t rate)
set adc oversample rate
uint8_t wm8978_set_depth_3d(wm8978_handle_t *handle, uint8_t depth)
set depth 3d
uint8_t wm8978_set_clksel(wm8978_handle_t *handle, wm8978_clksel_t clksel)
set clksel
uint8_t wm8978_set_dac_oversample_rate(wm8978_handle_t *handle, wm8978_dac_oversample_rate_t rate)
set dac oversample rate
uint8_t wm8978_set_out4_mute(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable out4 mute
uint8_t wm8978_set_left_out2(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable left out2
uint8_t wm8978_set_adc_right_volume(wm8978_handle_t *handle, wm8978_bool_t enable, uint8_t volume)
set adc right volume
uint8_t wm8978_lout1_left_headphone_output_volume_convert_to_data(wm8978_handle_t *handle, uint8_t reg, int8_t *db)
convert the lout1 left headphone output volume raw data to the real data
uint8_t wm8978_set_thermal_shutdown(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable thermal shutdown
uint8_t wm8978_set_reference_impedance(wm8978_handle_t *handle, wm8978_impedance_t impedance)
set reference impedance
uint8_t wm8978_right_channel_input_boost_stage_convert_to_register(wm8978_handle_t *handle, int8_t db, uint8_t *reg)
convert the right channel input boost stage to the register raw data
uint8_t wm8978_set_eq2_centre_freq(wm8978_handle_t *handle, wm8978_eq2_band_centre_freq_t freq)
set eq2 centre freq
uint8_t wm8978_set_left_channel_dac(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable left channel dac
uint8_t wm8978_set_rout2_update(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable rout2 update
struct wm8978_handle_s wm8978_handle_t
wm8978 handle structure definition
wm8978_gpio1_sel_t
wm8978 gpio1 sel enumeration definition
uint8_t wm8978_set_dac_limiter_decay(wm8978_handle_t *handle, wm8978_dac_limiter_decay_t decay)
set dac limiter decay
uint8_t wm8978_lout2_left_speaker_output_volume_convert_to_register(wm8978_handle_t *handle, int8_t db, uint8_t *reg)
convert the lout2 left speaker output volume to the register raw data
uint8_t wm8978_set_right_channel_input_pga_amplifier_positive(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable right channel input pga amplifier positive
uint8_t wm8978_set_alc_noise_gate_threshold(wm8978_handle_t *handle, uint8_t threshold)
set alc noise gate threshold
uint8_t wm8978_set_dac_companding(wm8978_handle_t *handle, wm8978_companding_t companding)
set dac companding
uint8_t wm8978_set_inv_rout2_mixer(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable inv rout2 mixer
uint8_t wm8978_set_out4_boost(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable out4 boost
uint8_t wm8978_set_right_input_pga_update(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable right input pga update
uint8_t wm8978_set_out3_mixer(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable out3 mixer
uint8_t wm8978_set_rout2_right_speaker_output_volume(wm8978_handle_t *handle, uint8_t vol)
set rout2 right speaker output volume
uint8_t wm8978_set_left_channel_input_boost_stage(wm8978_handle_t *handle, uint8_t stage)
set left channel input boost stage
uint8_t wm8978_set_right_adc_input_to_out4(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable right adc input to out4
uint8_t wm8978_set_left_auxiliary_input_to_left_channel_output_mixer(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable left auxiliary input to left channel output mixer
uint8_t wm8978_volume_convert_to_data(wm8978_handle_t *handle, uint8_t reg, float *db)
convert the volume register raw data to the real data
uint8_t wm8978_set_left_dac_to_out4(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable left dac to out4
uint8_t wm8978_set_left_output_channel_mixer(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable left output channel mixer
uint8_t wm8978_set_alc_hold_time(wm8978_handle_t *handle, uint8_t t)
set alc hold time
uint8_t wm8978_set_eq1_cut_off(wm8978_handle_t *handle, wm8978_eq1_band_cut_off_t cut_off)
set eq1 cut off
uint8_t wm8978_set_left_bypass_path_to_left_output_mixer(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable left bypass path to left output mixer
uint8_t wm8978_set_eq4_centre_freq(wm8978_handle_t *handle, wm8978_eq4_band_centre_freq_t freq)
set eq4 centre freq
uint8_t wm8978_rout2_right_speaker_output_volume_convert_to_register(wm8978_handle_t *handle, int8_t db, uint8_t *reg)
convert the rout2 right speaker output volume to the register raw data
uint8_t wm8978_set_alc_max_gain(wm8978_handle_t *handle, wm8978_max_gain_t gain)
set alc max gain
uint8_t wm8978_set_mclk_div(wm8978_handle_t *handle, wm8978_mclk_div_t d)
set mclk div
uint8_t wm8978_eq_gain_convert_to_data(wm8978_handle_t *handle, uint8_t reg, int8_t *db)
convert the eq gain register raw data to the real data
uint8_t wm8978_set_lout2_left_speaker_output_mute(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable lout2 left speaker output mute
uint8_t wm8978_set_lout1_left_headphone_output_volume(wm8978_handle_t *handle, uint8_t vol)
set lout1 left headphone output volume
uint8_t wm8978_set_sleep(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable sleep
wm8978_clksel_t
wm8978 clksel enumeration definition
uint8_t wm8978_set_notch_filter_a1_coefficient_bit_13_7(wm8978_handle_t *handle, wm8978_bool_t update_once, uint8_t coefficient)
set notch filter a1 coefficient bit13 - bit7
uint8_t wm8978_set_alc_attack(wm8978_handle_t *handle, uint8_t attack)
set alc attack
wm8978_equaliser_t
wm8978 equaliser enumeration definition
uint8_t wm8978_set_out4_attenuated_by_6db(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable out4 attenuated by 6db
uint8_t wm8978_set_aux_right_channel_input_to_right_mixer_volume(wm8978_handle_t *handle, uint8_t vol)
set aux right channel input to right mixer volume
uint8_t wm8978_set_notch_filter_a0_coefficient_bit_13_7(wm8978_handle_t *handle, wm8978_bool_t update_once, uint8_t coefficient)
set notch filter a0 coefficient bit13 - bit7
uint8_t wm8978_beep_volume_convert_to_data(wm8978_handle_t *handle, uint8_t reg, int8_t *db)
convert the beep volume register raw data to the real data
uint8_t wm8978_right_channel_input_pga_volume_convert_to_register(wm8978_handle_t *handle, float db, uint8_t *reg)
convert the right channel input pga volume to the register raw data
wm8978_bclk_div_t
wm8978 bclk div enumeration definition
uint8_t wm8978_set_out3_mute(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable out3 mute
wm8978_dac_oversample_rate_t
wm8978 dac oversample rate enumeration definition
uint8_t wm8978_set_eq2_bandwidth(wm8978_handle_t *handle, wm8978_eq_bandwidth_t width)
set eq2 bandwidth
uint8_t wm8978_set_right_channel_input_boost_stage(wm8978_handle_t *handle, uint8_t stage)
set right channel input boost stage
uint8_t wm8978_set_dac_appear(wm8978_handle_t *handle, wm8978_appear_t appear)
set dac appear
uint8_t wm8978_set_right_channel_input_pga_boost(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable right channel input pga boost
uint8_t wm8978_set_companding_8bit_mode(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable companding 8bit mode
wm8978_min_gain_t
wm8978 min gain enumeration definition
uint8_t wm8978_set_left_adc_input_to_out3(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable left adc input to out3
uint8_t wm8978_set_beep_volume(wm8978_handle_t *handle, uint8_t vol)
set beep volume
uint8_t wm8978_set_dac_digital_limiter(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable dac digital limiter
uint8_t wm8978_set_right_channel_input_pga_zero_cross(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable right channel input pga zero cross
wm8978_max_gain_t
wm8978 max gain enumeration definition
uint8_t wm8978_set_beep(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable beep
uint8_t wm8978_set_eq3_gain(wm8978_handle_t *handle, uint8_t gain)
set eq3 gain
uint8_t wm8978_set_dc_buffer(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable dc buffer
uint8_t wm8978_deinit(wm8978_handle_t *handle)
close the chip
uint8_t wm8978_set_rout1_right_headphone_output_mute(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable rout1 right headphone output mute
wm8978_bool_t
wm8978 bool enumeration definition
uint8_t wm8978_set_vmid_1(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable vmid 1
uint8_t wm8978_set_right_out1(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable right out1
uint8_t wm8978_right_bypass_volume_control_to_output_channel_mixer_convert_to_data(wm8978_handle_t *handle, uint8_t reg, int8_t *db)
convert the right bypass volume control to output channel mixer raw data to the real data
uint8_t wm8978_set_dac_limiter_volume_boost(wm8978_handle_t *handle, uint8_t db)
set dac limiter volume boost
uint8_t wm8978_set_out4_mixer_output_to_out3(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable out4 mixer output to out3
uint8_t wm8978_set_bclk_polarity(wm8978_handle_t *handle, wm8978_polarity_t polarity)
set bclk polarity
uint8_t wm8978_set_alc_min_gain(wm8978_handle_t *handle, wm8978_min_gain_t gain)
set alc min gain
uint8_t wm8978_set_jack_logic_1(wm8978_handle_t *handle, wm8978_jack_t jack, wm8978_bool_t enable)
set jack logic 1
uint8_t wm8978_set_analogue_amplifier_bias(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable analogue amplifier bias
uint8_t wm8978_set_rout1_headphone_volume_zero_cross(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable rout1 headphone volume zero cross
uint8_t wm8978_set_left_channel_input_pga_amplifier_positive(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable left channel input pga amplifier positive
uint8_t wm8978_set_mode(wm8978_handle_t *handle, wm8978_mode_t mode)
set chip mode
uint8_t wm8978_set_high_pass_filter_cut_off(wm8978_handle_t *handle, wm8978_high_pass_filter_cut_off_t cut)
set high pass filter cut off
uint8_t wm8978_set_left_channel_input_boost(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable left channel input boost
uint8_t wm8978_set_jack_detection(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable jack detection
wm8978_alc_t
wm8978 alc enumeration definition
uint8_t wm8978_set_left_channel_input_pga(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable left channel input pga
wm8978_jack_sel_t
wm8978 jack sel enumeration definition
uint8_t wm8978_set_alc_mode(wm8978_handle_t *handle, wm8978_alc_mode_t mode)
set alc mode
uint8_t wm8978_set_right_channel_input_pga(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable right channel input pga
uint8_t wm8978_set_auxiliary_amplifier_right_channel_input_boost_stage(wm8978_handle_t *handle, uint8_t stage)
set auxiliary amplifier right channel input boost stage
uint8_t wm8978_set_lout1_update(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable lout1 update
wm8978_alc_level_t
wm8978 alc level enumeration definition
uint8_t wm8978_set_high_pass_filter(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable high pass filter
uint8_t wm8978_left_bypass_volume_control_to_output_channel_mixer_convert_to_data(wm8978_handle_t *handle, uint8_t reg, int8_t *db)
convert the left bypass volume control to output channel mixer register raw data to the real data
uint8_t wm8978_set_right_channel_input_pga_mute(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable right channel input pga mute
wm8978_eq1_band_cut_off_t
wm8978 eq1 band cut off enumeration definition
uint8_t wm8978_set_dac_limiter_attack(wm8978_handle_t *handle, wm8978_dac_limiter_attack_t attack)
set dac limiter attack
uint8_t wm8978_set_data_format(wm8978_handle_t *handle, wm8978_data_format_t format)
set data format
uint8_t wm8978_beep_volume_convert_to_register(wm8978_handle_t *handle, int8_t db, uint8_t *reg)
convert the beep volume to the register raw data
uint8_t wm8978_set_soft_mute(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable soft mute
uint8_t wm8978_set_right_channel_input_pga_positive(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable right channel input pga positive
uint8_t wm8978_set_mclk_divide_by_2(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable mclk divide by 2
uint8_t wm8978_set_left_channel_adc(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable left channel adc
uint8_t wm8978_set_aux_left_channel_input_to_left_mixer_volume(wm8978_handle_t *handle, uint8_t vol)
set aux left channel input to left mixer volume
uint8_t wm8978_set_left_dac_output_to_out3(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable left dac output to out3
uint8_t wm8978_set_dac_right_volume(wm8978_handle_t *handle, wm8978_bool_t enable, uint8_t volume)
set dac right volume
wm8978_alc_mode_t
wm8978 alc mode enumeration definition
uint8_t wm8978_set_notch_filter(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable notch filter
uint8_t wm8978_set_jack_logic_0(wm8978_handle_t *handle, wm8978_jack_t jack, wm8978_bool_t enable)
set jack logic 0
wm8978_dac_limiter_decay_t
wm8978 dac limiter decay enumeration definition
uint8_t wm8978_depth_3d_convert_to_data(wm8978_handle_t *handle, uint8_t reg, float *percent)
convert the depth 3d register raw data to the real data
uint8_t wm8978_right_bypass_volume_control_to_output_channel_mixer_convert_to_register(wm8978_handle_t *handle, int8_t db, uint8_t *reg)
convert the right bypass volume control to output channel mixer to the register raw data
wm8978_appear_t
wm8978 appear enumeration definition
uint8_t wm8978_set_eq3_centre_freq(wm8978_handle_t *handle, wm8978_eq3_band_centre_freq_t freq)
set eq3 centre freq
uint8_t wm8978_set_lout1_left_headphone_output_mute(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable lout1 left headphone output mute
uint8_t wm8978_set_jack_gpio(wm8978_handle_t *handle, wm8978_jack_sel_t sel)
set jack gpio
uint8_t wm8978_set_right_dac_output_to_right_output_mixer(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable right dac output to right output mixer
wm8978_eq_bandwidth_t
wm8978 eq bandwidth enumeration definition
wm8978_mclk_div_t
wm8978 mclk div enumeration definition
uint8_t wm8978_set_right_channel_dac(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable right channel dac
wm8978_eq2_band_centre_freq_t
wm8978 eq2 band centre freq enumeration definition
uint8_t wm8978_set_alc_decay(wm8978_handle_t *handle, uint8_t decay)
set alc decay
uint8_t wm8978_set_notch_filter_a1_coefficient_bit_6_0(wm8978_handle_t *handle, wm8978_bool_t update_once, uint8_t coefficient)
set notch filter a1 coefficient bit6 - bit0
struct wm8978_info_s wm8978_info_t
wm8978 information structure definition
uint8_t wm8978_set_out3(wm8978_handle_t *handle, wm8978_bool_t enable)
enable or disable out3
uint8_t wm8978_set_reg(wm8978_handle_t *handle, uint8_t reg, uint16_t value)
set the chip register
void(* delay_ms)(uint32_t ms)
void(* debug_print)(const char *const fmt,...)
uint8_t(* iic_init)(void)
uint8_t(* iic_write)(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len)
uint8_t(* iic_deinit)(void)
float supply_voltage_max_v
char manufacturer_name[32]
float supply_voltage_min_v