LPCOpen Platform for LPC112X microcontrollers  112X
LPCOpen Platform for the NXP LPC112X family of Microcontrollers
Data Structures | Macros | Functions | Variables
wm8904.c File Reference
#include "board.h"
#include "wm8904.h"

Go to the source code of this file.

Data Structures

struct  WM8904_Init_Seq_t
 
struct  Codec_Cfg_t
 

Macros

#define WM8904_STATE_OFF   0
 
#define WM8904_STATE_ON   1
 
#define WM8904_LOCK_TIMEOUT   10
 
#define WM8904_INIT_STEPS   31
 
#define WM8904_INPUT_INIT_STEPS   4
 

Functions

int WM8904_MultiRegWrite (const WM8904_Init_Seq_t *seq, uint32_t cnt)
 
static int Audio_Codec_SetDefaultValues (const uint8_t *values, int sz)
 
uint16_t WM8904_REG_Read (uint8_t reg)
 Read a 16-bit value from WM8904 codec register. More...
 
void WM8904_REG_Write (uint8_t reg, uint16_t val)
 Write a 16-bit value to 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_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...
 
static void delay (uint32_t i)
 

Variables

const Codec_Cfg_t g_CodecCfgs [2]
 
const WM8904_Init_Seq_t g_wm8904 []
 
const WM8904_Init_Seq_t g_wm8904_input_init []
 

Macro Definition Documentation

#define WM8904_INIT_STEPS   31

Definition at line 61 of file wm8904.c.

#define WM8904_INPUT_INIT_STEPS   4

Definition at line 126 of file wm8904.c.

#define WM8904_LOCK_TIMEOUT   10

Definition at line 42 of file wm8904.c.

#define WM8904_STATE_OFF   0

Definition at line 39 of file wm8904.c.

#define WM8904_STATE_ON   1

Definition at line 40 of file wm8904.c.

Function Documentation

static int Audio_Codec_SetDefaultValues ( const uint8_t *  values,
int  sz 
)
static

Definition at line 147 of file wm8904.c.

static void delay ( uint32_t  i)
static

Definition at line 253 of file wm8904.c.

int WM8904_MultiRegWrite ( const WM8904_Init_Seq_t seq,
uint32_t  cnt 
)

Definition at line 258 of file wm8904.c.

Variable Documentation

const Codec_Cfg_t g_CodecCfgs[2]
Initial value:

Definition at line 56 of file wm8904.c.

const WM8904_Init_Seq_t g_wm8904[]

Definition at line 62 of file wm8904.c.

const WM8904_Init_Seq_t g_wm8904_input_init[]
Initial value:
= {
{ 0x0C, 0x0003},
{ 0x12, 0x000F},
{ 0x2C, 0x0005},
{ 0x2D, 0x0005},
}

Definition at line 127 of file wm8904.c.