![]() |
LPCOpen Platform for LPC112X microcontrollers
112X
LPCOpen Platform for the NXP LPC112X family of Microcontrollers
|
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.
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... | |
#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_U8 | ( | val | ) | (((val) >> 8) & 0xFF), ((val) & 0xFF) |
int WM8904_Init | ( | int | input | ) |
uint16_t WM8904_REG_Read | ( | uint8_t | reg | ) |
int WM8904_REG_VerifyMult | ( | uint8_t | reg, |
const uint8_t * | value, | ||
uint8_t * | buff, | ||
int | len | ||
) |
Verify values in multiple WM8904 registers.
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 |
void WM8904_REG_Write | ( | uint8_t | reg, |
uint16_t | val | ||
) |
int WM8904_REG_WriteMult | ( | const uint8_t * | buff, |
int | len | ||
) |
Write multiple value to WM8904 registers.
buff | : Pointer to buffer (See note section) |
len | : Number of bytes in buff |