LPCOpen Platform for LPC112X microcontrollers  112X
LPCOpen Platform for the NXP LPC112X family of Microcontrollers
Macros | Functions
BOARD: WM8904 Audio codec interface module

Detailed Description

WM8904 Audio codec interface module, the module registers are accessed using I2C. The board which uses this module must define WM8904_I2C_BUS to I2C0, I2C1, etc, based on which I2C bus is connected to WM8904. All the functions in this modules assumes that the I2C interrupt for WM8904_I2C_BUS is enabled and Chip_I2C_MasterStateHandler(WM8904_I2C_BUS) is called from the ISR. If the functions are to be used in polling mode the caller must replace the event handler to Chip_I2C_EventHandlerPolling(), by using API Chip_I2C_SetMasterEventHandler(). A macro I2CDEV_WM8904_ADDR must be defined to the appropriate slave address of WM8904 audio codec.

Macros

#define WM8904_CLK_MCLK   1
 
#define WM8904_CLK_FLL   2
 
#define WM8904_FLL_MCLK   1
 
#define WM8904_FLL_BCLK   2
 
#define WM8904_FLL_LRCLK   3
 
#define WM8904_FLL_FREE_RUNNING   4
 
#define WM8904_SW_RESET_AND_ID   0x00
 
#define WM8904_REVISION   0x01
 
#define WM8904_BIAS_CONTROL_0   0x04
 
#define WM8904_VMID_CONTROL_0   0x05
 
#define WM8904_MIC_BIAS_CONTROL_0   0x06
 
#define WM8904_MIC_BIAS_CONTROL_1   0x07
 
#define WM8904_ANALOGUE_DAC_0   0x08
 
#define WM8904_MIC_FILTER_CONTROL   0x09
 
#define WM8904_ANALOGUE_ADC_0   0x0A
 
#define WM8904_POWER_MANAGEMENT_0   0x0C
 
#define WM8904_POWER_MANAGEMENT_2   0x0E
 
#define WM8904_POWER_MANAGEMENT_3   0x0F
 
#define WM8904_POWER_MANAGEMENT_6   0x12
 
#define WM8904_CLOCK_RATES_0   0x14
 
#define WM8904_CLOCK_RATES_1   0x15
 
#define WM8904_CLOCK_RATES_2   0x16
 
#define WM8904_AUDIO_INTERFACE_0   0x18
 
#define WM8904_AUDIO_INTERFACE_1   0x19
 
#define WM8904_AUDIO_INTERFACE_2   0x1A
 
#define WM8904_AUDIO_INTERFACE_3   0x1B
 
#define WM8904_DAC_DIGITAL_VOLUME_LEFT   0x1E
 
#define WM8904_DAC_DIGITAL_VOLUME_RIGHT   0x1F
 
#define WM8904_DAC_DIGITAL_0   0x20
 
#define WM8904_DAC_DIGITAL_1   0x21
 
#define WM8904_ADC_DIGITAL_VOLUME_LEFT   0x24
 
#define WM8904_ADC_DIGITAL_VOLUME_RIGHT   0x25
 
#define WM8904_ADC_DIGITAL_0   0x26
 
#define WM8904_DIGITAL_MICROPHONE_0   0x27
 
#define WM8904_DRC_0   0x28
 
#define WM8904_DRC_1   0x29
 
#define WM8904_DRC_2   0x2A
 
#define WM8904_DRC_3   0x2B
 
#define WM8904_ANALOGUE_LEFT_INPUT_0   0x2C
 
#define WM8904_ANALOGUE_RIGHT_INPUT_0   0x2D
 
#define WM8904_ANALOGUE_LEFT_INPUT_1   0x2E
 
#define WM8904_ANALOGUE_RIGHT_INPUT_1   0x2F
 
#define WM8904_ANALOGUE_OUT1_LEFT   0x39
 
#define WM8904_ANALOGUE_OUT1_RIGHT   0x3A
 
#define WM8904_ANALOGUE_OUT2_LEFT   0x3B
 
#define WM8904_ANALOGUE_OUT2_RIGHT   0x3C
 
#define WM8904_ANALOGUE_OUT12_ZC   0x3D
 
#define WM8904_DC_SERVO_0   0x43
 
#define WM8904_DC_SERVO_1   0x44
 
#define WM8904_DC_SERVO_2   0x45
 
#define WM8904_DC_SERVO_4   0x47
 
#define WM8904_DC_SERVO_5   0x48
 
#define WM8904_DC_SERVO_6   0x49
 
#define WM8904_DC_SERVO_7   0x4A
 
#define WM8904_DC_SERVO_8   0x4B
 
#define WM8904_DC_SERVO_9   0x4C
 
#define WM8904_DC_SERVO_READBACK_0   0x4D
 
#define WM8904_ANALOGUE_HP_0   0x5A
 
#define WM8904_ANALOGUE_LINEOUT_0   0x5E
 
#define WM8904_CHARGE_PUMP_0   0x62
 
#define WM8904_CLASS_W_0   0x68
 
#define WM8904_WRITE_SEQUENCER_0   0x6C
 
#define WM8904_WRITE_SEQUENCER_1   0x6D
 
#define WM8904_WRITE_SEQUENCER_2   0x6E
 
#define WM8904_WRITE_SEQUENCER_3   0x6F
 
#define WM8904_WRITE_SEQUENCER_4   0x70
 
#define WM8904_FLL_CONTROL_1   0x74
 
#define WM8904_FLL_CONTROL_2   0x75
 
#define WM8904_FLL_CONTROL_3   0x76
 
#define WM8904_FLL_CONTROL_4   0x77
 
#define WM8904_FLL_CONTROL_5   0x78
 
#define WM8904_GPIO_CONTROL_1   0x79
 
#define WM8904_GPIO_CONTROL_2   0x7A
 
#define WM8904_GPIO_CONTROL_3   0x7B
 
#define WM8904_GPIO_CONTROL_4   0x7C
 
#define WM8904_DIGITAL_PULLS   0x7E
 
#define WM8904_INTERRUPT_STATUS   0x7F
 
#define WM8904_INTERRUPT_STATUS_MASK   0x80
 
#define WM8904_INTERRUPT_POLARITY   0x81
 
#define WM8904_INTERRUPT_DEBOUNCE   0x82
 
#define WM8904_EQ1   0x86
 
#define WM8904_EQ2   0x87
 
#define WM8904_EQ3   0x88
 
#define WM8904_EQ4   0x89
 
#define WM8904_EQ5   0x8A
 
#define WM8904_EQ6   0x8B
 
#define WM8904_EQ7   0x8C
 
#define WM8904_EQ8   0x8D
 
#define WM8904_EQ9   0x8E
 
#define WM8904_EQ10   0x8F
 
#define WM8904_EQ11   0x90
 
#define WM8904_EQ12   0x91
 
#define WM8904_EQ13   0x92
 
#define WM8904_EQ14   0x93
 
#define WM8904_EQ15   0x94
 
#define WM8904_EQ16   0x95
 
#define WM8904_EQ17   0x96
 
#define WM8904_EQ18   0x97
 
#define WM8904_EQ19   0x98
 
#define WM8904_EQ20   0x99
 
#define WM8904_EQ21   0x9A
 
#define WM8904_EQ22   0x9B
 
#define WM8904_EQ23   0x9C
 
#define WM8904_EQ24   0x9D
 
#define WM8904_CONTROL_INTERFACE_TEST_1   0xA1
 
#define WM8904_ADC_TEST_0   0xC6
 
#define WM8904_ANALOGUE_OUTPUT_BIAS_0   0xCC
 
#define WM8904_FLL_NCO_TEST_0   0xF7
 
#define WM8904_FLL_NCO_TEST_1   0xF8
 
#define WM8904_REGISTER_COUNT   101
 
#define WM8904_MAX_REGISTER   0xF8
 
#define WM8904_FLL_1288MHZ_K   (0x3127)
 
#define WM8904_FLL_1288MHZ_N   (0x8 << 5)
 
#define WM8904_FLL_1128MHZ_K   (0x86C2)
 
#define WM8904_FLL_1128MHZ_N   (0x7 << 5)
 
#define WM8904_BDIV_256FS_2_64FS   (0x0004)
 
#define WM8904_BDIV_256FS_2_32FS   (0x0008)
 
#define WM8904_BDIV_384FS_2_64FS   (0x0007)
 
#define WM8904_BDIV_384FS_2_32FS   (0x000B)
 
#define WM8904_LRDIV_64FS   (0x0840)
 
#define WM8904_LRDIV_32FS   (0x0820)
 
#define WM8904_AIF123_256FS_2_32FS   { 0x4042, WM8904_BDIV_256FS_2_32FS, WM8904_LRDIV_32FS}
 
#define WM8904_AIF123_256FS_2_64FS   { 0x404A, WM8904_BDIV_256FS_2_64FS, WM8904_LRDIV_64FS}
 
#define WM8904_AIF123_384FS_2_32FS   { 0x4042, WM8904_BDIV_384FS_2_32FS, WM8904_LRDIV_32FS}
 
#define WM8904_AIF123_384FS_2_64FS   { 0x404A, WM8904_BDIV_384FS_2_64FS, WM8904_LRDIV_64FS}
 
#define WM8904_DAC_DIGITAL_1_VALUE   0x0240
 
#define WM8904_U8(val)   (((val) >> 8) & 0xFF), ((val) & 0xFF)
 

Functions

void WM8904_REG_Write (uint8_t reg, uint16_t val)
 Write a 16-bit value to Codec Register. More...
 
uint16_t WM8904_REG_Read (uint8_t reg)
 Read a 16-bit value from WM8904 codec register. More...
 
int WM8904_REG_WriteVerify (uint8_t reg, uint16_t val)
 Writes a value to a UDA register, read back and verify the value. More...
 
int WM8904_REG_WriteMult (const uint8_t *buff, int len)
 Write multiple value to WM8904 registers. More...
 
int WM8904_REG_VerifyMult (uint8_t reg, const uint8_t *value, uint8_t *buff, int len)
 Verify values in multiple WM8904 registers. More...
 
int WM8904_Init (int input)
 Initialize WM8904 to its default state. More...
 

Macro Definition Documentation

#define WM8904_ADC_DIGITAL_0   0x26

Definition at line 86 of file wm8904.h.

#define WM8904_ADC_DIGITAL_VOLUME_LEFT   0x24

Definition at line 84 of file wm8904.h.

#define WM8904_ADC_DIGITAL_VOLUME_RIGHT   0x25

Definition at line 85 of file wm8904.h.

#define WM8904_ADC_TEST_0   0xC6

Definition at line 159 of file wm8904.h.

#define WM8904_AIF123_256FS_2_32FS   { 0x4042, WM8904_BDIV_256FS_2_32FS, WM8904_LRDIV_32FS}

Definition at line 181 of file wm8904.h.

#define WM8904_AIF123_256FS_2_64FS   { 0x404A, WM8904_BDIV_256FS_2_64FS, WM8904_LRDIV_64FS}

Definition at line 182 of file wm8904.h.

#define WM8904_AIF123_384FS_2_32FS   { 0x4042, WM8904_BDIV_384FS_2_32FS, WM8904_LRDIV_32FS}

Definition at line 183 of file wm8904.h.

#define WM8904_AIF123_384FS_2_64FS   { 0x404A, WM8904_BDIV_384FS_2_64FS, WM8904_LRDIV_64FS}

Definition at line 184 of file wm8904.h.

#define WM8904_ANALOGUE_ADC_0   0x0A

Definition at line 68 of file wm8904.h.

#define WM8904_ANALOGUE_DAC_0   0x08

Definition at line 66 of file wm8904.h.

#define WM8904_ANALOGUE_HP_0   0x5A

Definition at line 111 of file wm8904.h.

#define WM8904_ANALOGUE_LEFT_INPUT_0   0x2C

Definition at line 92 of file wm8904.h.

#define WM8904_ANALOGUE_LEFT_INPUT_1   0x2E

Definition at line 94 of file wm8904.h.

#define WM8904_ANALOGUE_LINEOUT_0   0x5E

Definition at line 112 of file wm8904.h.

#define WM8904_ANALOGUE_OUT12_ZC   0x3D

Definition at line 100 of file wm8904.h.

#define WM8904_ANALOGUE_OUT1_LEFT   0x39

Definition at line 96 of file wm8904.h.

#define WM8904_ANALOGUE_OUT1_RIGHT   0x3A

Definition at line 97 of file wm8904.h.

#define WM8904_ANALOGUE_OUT2_LEFT   0x3B

Definition at line 98 of file wm8904.h.

#define WM8904_ANALOGUE_OUT2_RIGHT   0x3C

Definition at line 99 of file wm8904.h.

#define WM8904_ANALOGUE_OUTPUT_BIAS_0   0xCC

Definition at line 160 of file wm8904.h.

#define WM8904_ANALOGUE_RIGHT_INPUT_0   0x2D

Definition at line 93 of file wm8904.h.

#define WM8904_ANALOGUE_RIGHT_INPUT_1   0x2F

Definition at line 95 of file wm8904.h.

#define WM8904_AUDIO_INTERFACE_0   0x18

Definition at line 76 of file wm8904.h.

#define WM8904_AUDIO_INTERFACE_1   0x19

Definition at line 77 of file wm8904.h.

#define WM8904_AUDIO_INTERFACE_2   0x1A

Definition at line 78 of file wm8904.h.

#define WM8904_AUDIO_INTERFACE_3   0x1B

Definition at line 79 of file wm8904.h.

#define WM8904_BDIV_256FS_2_32FS   (0x0008)

Definition at line 175 of file wm8904.h.

#define WM8904_BDIV_256FS_2_64FS   (0x0004)

Definition at line 174 of file wm8904.h.

#define WM8904_BDIV_384FS_2_32FS   (0x000B)

Definition at line 177 of file wm8904.h.

#define WM8904_BDIV_384FS_2_64FS   (0x0007)

Definition at line 176 of file wm8904.h.

#define WM8904_BIAS_CONTROL_0   0x04

Definition at line 62 of file wm8904.h.

#define WM8904_CHARGE_PUMP_0   0x62

Definition at line 113 of file wm8904.h.

#define WM8904_CLASS_W_0   0x68

Definition at line 114 of file wm8904.h.

#define WM8904_CLK_FLL   2

Definition at line 50 of file wm8904.h.

#define WM8904_CLK_MCLK   1

Definition at line 49 of file wm8904.h.

#define WM8904_CLOCK_RATES_0   0x14

Definition at line 73 of file wm8904.h.

#define WM8904_CLOCK_RATES_1   0x15

Definition at line 74 of file wm8904.h.

#define WM8904_CLOCK_RATES_2   0x16

Definition at line 75 of file wm8904.h.

#define WM8904_CONTROL_INTERFACE_TEST_1   0xA1

Definition at line 158 of file wm8904.h.

#define WM8904_DAC_DIGITAL_0   0x20

Definition at line 82 of file wm8904.h.

#define WM8904_DAC_DIGITAL_1   0x21

Definition at line 83 of file wm8904.h.

#define WM8904_DAC_DIGITAL_1_VALUE   0x0240

Definition at line 186 of file wm8904.h.

#define WM8904_DAC_DIGITAL_VOLUME_LEFT   0x1E

Definition at line 80 of file wm8904.h.

#define WM8904_DAC_DIGITAL_VOLUME_RIGHT   0x1F

Definition at line 81 of file wm8904.h.

#define WM8904_DC_SERVO_0   0x43

Definition at line 101 of file wm8904.h.

#define WM8904_DC_SERVO_1   0x44

Definition at line 102 of file wm8904.h.

#define WM8904_DC_SERVO_2   0x45

Definition at line 103 of file wm8904.h.

#define WM8904_DC_SERVO_4   0x47

Definition at line 104 of file wm8904.h.

#define WM8904_DC_SERVO_5   0x48

Definition at line 105 of file wm8904.h.

#define WM8904_DC_SERVO_6   0x49

Definition at line 106 of file wm8904.h.

#define WM8904_DC_SERVO_7   0x4A

Definition at line 107 of file wm8904.h.

#define WM8904_DC_SERVO_8   0x4B

Definition at line 108 of file wm8904.h.

#define WM8904_DC_SERVO_9   0x4C

Definition at line 109 of file wm8904.h.

#define WM8904_DC_SERVO_READBACK_0   0x4D

Definition at line 110 of file wm8904.h.

#define WM8904_DIGITAL_MICROPHONE_0   0x27

Definition at line 87 of file wm8904.h.

#define WM8904_DIGITAL_PULLS   0x7E

Definition at line 129 of file wm8904.h.

#define WM8904_DRC_0   0x28

Definition at line 88 of file wm8904.h.

#define WM8904_DRC_1   0x29

Definition at line 89 of file wm8904.h.

#define WM8904_DRC_2   0x2A

Definition at line 90 of file wm8904.h.

#define WM8904_DRC_3   0x2B

Definition at line 91 of file wm8904.h.

#define WM8904_EQ1   0x86

Definition at line 134 of file wm8904.h.

#define WM8904_EQ10   0x8F

Definition at line 143 of file wm8904.h.

#define WM8904_EQ11   0x90

Definition at line 144 of file wm8904.h.

#define WM8904_EQ12   0x91

Definition at line 145 of file wm8904.h.

#define WM8904_EQ13   0x92

Definition at line 146 of file wm8904.h.

#define WM8904_EQ14   0x93

Definition at line 147 of file wm8904.h.

#define WM8904_EQ15   0x94

Definition at line 148 of file wm8904.h.

#define WM8904_EQ16   0x95

Definition at line 149 of file wm8904.h.

#define WM8904_EQ17   0x96

Definition at line 150 of file wm8904.h.

#define WM8904_EQ18   0x97

Definition at line 151 of file wm8904.h.

#define WM8904_EQ19   0x98

Definition at line 152 of file wm8904.h.

#define WM8904_EQ2   0x87

Definition at line 135 of file wm8904.h.

#define WM8904_EQ20   0x99

Definition at line 153 of file wm8904.h.

#define WM8904_EQ21   0x9A

Definition at line 154 of file wm8904.h.

#define WM8904_EQ22   0x9B

Definition at line 155 of file wm8904.h.

#define WM8904_EQ23   0x9C

Definition at line 156 of file wm8904.h.

#define WM8904_EQ24   0x9D

Definition at line 157 of file wm8904.h.

#define WM8904_EQ3   0x88

Definition at line 136 of file wm8904.h.

#define WM8904_EQ4   0x89

Definition at line 137 of file wm8904.h.

#define WM8904_EQ5   0x8A

Definition at line 138 of file wm8904.h.

#define WM8904_EQ6   0x8B

Definition at line 139 of file wm8904.h.

#define WM8904_EQ7   0x8C

Definition at line 140 of file wm8904.h.

#define WM8904_EQ8   0x8D

Definition at line 141 of file wm8904.h.

#define WM8904_EQ9   0x8E

Definition at line 142 of file wm8904.h.

#define WM8904_FLL_1128MHZ_K   (0x86C2)

Definition at line 171 of file wm8904.h.

#define WM8904_FLL_1128MHZ_N   (0x7 << 5)

Definition at line 172 of file wm8904.h.

#define WM8904_FLL_1288MHZ_K   (0x3127)

Definition at line 169 of file wm8904.h.

#define WM8904_FLL_1288MHZ_N   (0x8 << 5)

Definition at line 170 of file wm8904.h.

#define WM8904_FLL_BCLK   2

Definition at line 53 of file wm8904.h.

#define WM8904_FLL_CONTROL_1   0x74

Definition at line 120 of file wm8904.h.

#define WM8904_FLL_CONTROL_2   0x75

Definition at line 121 of file wm8904.h.

#define WM8904_FLL_CONTROL_3   0x76

Definition at line 122 of file wm8904.h.

#define WM8904_FLL_CONTROL_4   0x77

Definition at line 123 of file wm8904.h.

#define WM8904_FLL_CONTROL_5   0x78

Definition at line 124 of file wm8904.h.

#define WM8904_FLL_FREE_RUNNING   4

Definition at line 55 of file wm8904.h.

#define WM8904_FLL_LRCLK   3

Definition at line 54 of file wm8904.h.

#define WM8904_FLL_MCLK   1

Definition at line 52 of file wm8904.h.

#define WM8904_FLL_NCO_TEST_0   0xF7

Definition at line 161 of file wm8904.h.

#define WM8904_FLL_NCO_TEST_1   0xF8

Definition at line 162 of file wm8904.h.

#define WM8904_GPIO_CONTROL_1   0x79

Definition at line 125 of file wm8904.h.

#define WM8904_GPIO_CONTROL_2   0x7A

Definition at line 126 of file wm8904.h.

#define WM8904_GPIO_CONTROL_3   0x7B

Definition at line 127 of file wm8904.h.

#define WM8904_GPIO_CONTROL_4   0x7C

Definition at line 128 of file wm8904.h.

#define WM8904_INTERRUPT_DEBOUNCE   0x82

Definition at line 133 of file wm8904.h.

#define WM8904_INTERRUPT_POLARITY   0x81

Definition at line 132 of file wm8904.h.

#define WM8904_INTERRUPT_STATUS   0x7F

Definition at line 130 of file wm8904.h.

#define WM8904_INTERRUPT_STATUS_MASK   0x80

Definition at line 131 of file wm8904.h.

#define WM8904_LRDIV_32FS   (0x0820)

Definition at line 179 of file wm8904.h.

#define WM8904_LRDIV_64FS   (0x0840)

Definition at line 178 of file wm8904.h.

#define WM8904_MAX_REGISTER   0xF8

Definition at line 165 of file wm8904.h.

#define WM8904_MIC_BIAS_CONTROL_0   0x06

Definition at line 64 of file wm8904.h.

#define WM8904_MIC_BIAS_CONTROL_1   0x07

Definition at line 65 of file wm8904.h.

#define WM8904_MIC_FILTER_CONTROL   0x09

Definition at line 67 of file wm8904.h.

#define WM8904_POWER_MANAGEMENT_0   0x0C

Definition at line 69 of file wm8904.h.

#define WM8904_POWER_MANAGEMENT_2   0x0E

Definition at line 70 of file wm8904.h.

#define WM8904_POWER_MANAGEMENT_3   0x0F

Definition at line 71 of file wm8904.h.

#define WM8904_POWER_MANAGEMENT_6   0x12

Definition at line 72 of file wm8904.h.

#define WM8904_REGISTER_COUNT   101

Definition at line 164 of file wm8904.h.

#define WM8904_REVISION   0x01

Definition at line 61 of file wm8904.h.

#define WM8904_SW_RESET_AND_ID   0x00

Definition at line 60 of file wm8904.h.

#define WM8904_U8 (   val)    (((val) >> 8) & 0xFF), ((val) & 0xFF)

Convert a 16 bit register value to 2 x 8 bit values that could be written to the I2C bus in an efficient way.

Definition at line 197 of file wm8904.h.

#define WM8904_VMID_CONTROL_0   0x05

Definition at line 63 of file wm8904.h.

#define WM8904_WRITE_SEQUENCER_0   0x6C

Definition at line 115 of file wm8904.h.

#define WM8904_WRITE_SEQUENCER_1   0x6D

Definition at line 116 of file wm8904.h.

#define WM8904_WRITE_SEQUENCER_2   0x6E

Definition at line 117 of file wm8904.h.

#define WM8904_WRITE_SEQUENCER_3   0x6F

Definition at line 118 of file wm8904.h.

#define WM8904_WRITE_SEQUENCER_4   0x70

Definition at line 119 of file wm8904.h.

Function Documentation

int WM8904_Init ( int  input)

Initialize WM8904 to its default state.

Parameters
input: Audio input source (Must be one of WM8904_LINE_IN or WM8904_MIC_IN_L or WM8904_MIC_IN_LR)
Returns
1 on Success and 0 on failure

Definition at line 213 of file wm8904.c.

uint16_t WM8904_REG_Read ( uint8_t  reg)

Read a 16-bit value from WM8904 codec register.

Parameters
reg: Register from which the value to be read
Returns
Returns the value read from the register

Definition at line 169 of file wm8904.c.

int WM8904_REG_VerifyMult ( uint8_t  reg,
const uint8_t *  value,
uint8_t *  buff,
int  len 
)

Verify values in multiple WM8904 registers.

Parameters
reg: Starting register from which data be read
value: Pointer to memory which contains values to be compared
buff: Pointer to memory to which data be read
len: Length of bytes in value buff
Returns
1 on Success & Data is valid, 0 on Failure

Definition at line 195 of file wm8904.c.

void WM8904_REG_Write ( uint8_t  reg,
uint16_t  val 
)

Write a 16-bit value to Codec Register.

Parameters
reg: Register to which val be written
val: 16-Bit value to be written
Returns
Nothing

Definition at line 178 of file wm8904.c.

int WM8904_REG_WriteMult ( const uint8_t *  buff,
int  len 
)

Write multiple value to WM8904 registers.

Parameters
buff: Pointer to buffer (See note section)
len: Number of bytes in buff
Returns
1 on Success, 0 on failure
Note
buff[0] must be the address of the register to which the first data i.e, buff[1], buff[2] be written, the next bytes buff[3], buff[4] be written to register buff[0]+1 and so on.
int WM8904_REG_WriteVerify ( uint8_t  reg,
uint16_t  val 
)

Writes a value to a UDA register, read back and verify the value.

Parameters
reg: Register to which the value be written
val: Value to be written
Returns
1 On success, 0 on failure

Definition at line 186 of file wm8904.c.