66 #if !defined (VERIFY_WRITTENDATA)
116 static uint8_t
CODEC_IO_Write(uint8_t Addr, uint16_t Reg, uint16_t Value);
137 uint32_t
wm8994_Init(uint16_t DeviceAddr, uint16_t OutputInputDevice, uint8_t Volume, uint32_t AudioFreq)
139 uint32_t counter = 0;
140 uint16_t output_device = OutputInputDevice & 0xFF;
141 uint16_t input_device = OutputInputDevice & 0xFF00;
142 uint16_t power_mgnt_reg_1 = 0;
155 if (input_device > 0)
168 if (output_device > 0)
172 switch (output_device)
279 if (input_device > 0)
282 switch (input_device)
468 if (output_device > 0)
530 power_mgnt_reg_1 |= 0x0303 | 0x3003;
585 if (input_device > 0)
590 power_mgnt_reg_1 |= 0x0013;
602 power_mgnt_reg_1 |= 0x0013;
663 uint32_t
wm8994_Play(uint16_t DeviceAddr, uint16_t* pBuffer, uint16_t Size)
665 uint32_t counter = 0;
681 uint32_t counter = 0;
700 uint32_t counter = 0;
724 uint32_t counter = 0;
770 uint32_t counter = 0;
776 if(convertedvol > 0x3E)
793 else if (Volume == 0)
804 counter +=
CODEC_IO_Write(DeviceAddr, 0x1C, convertedvol | 0x140);
807 counter +=
CODEC_IO_Write(DeviceAddr, 0x1D, convertedvol | 0x140);
810 counter +=
CODEC_IO_Write(DeviceAddr, 0x26, convertedvol | 0x140);
813 counter +=
CODEC_IO_Write(DeviceAddr, 0x27, convertedvol | 0x140);
823 counter +=
CODEC_IO_Write(DeviceAddr, 0x400, convertedvol | 0x100);
826 counter +=
CODEC_IO_Write(DeviceAddr, 0x401, convertedvol | 0x100);
829 counter +=
CODEC_IO_Write(DeviceAddr, 0x404, convertedvol | 0x100);
832 counter +=
CODEC_IO_Write(DeviceAddr, 0x405, convertedvol | 0x100);
846 uint32_t counter = 0;
881 uint32_t counter = 0;
968 uint32_t counter = 0;
1028 uint32_t counter = 0;
1047 uint32_t result = 0;
1051 #ifdef VERIFY_WRITTENDATA