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

Go to the source code of this file.

Data Structures

struct  WM8903_Init_Seq_t
 
struct  wm8903_register_lookup_table
 

Macros

#define I2S_MCK_PORT   1
 
#define I2S_MCK_PIN   17
 
#define I2S_MCK_MUX   2
 
#define I2S_SCK_PORT   0
 
#define I2S_SCK_PIN   4
 
#define I2S_SCK_MUX   1
 
#define I2S_WS_PORT   0
 
#define I2S_WS_PIN   5
 
#define I2S_WS_MUX   1
 
#define I2CDEV_CODEC_ADDR   0x1A
 
#define CODEC_I2C_BUS   LPC_I2C0
 
#define CODEC_I2C_BUS_ID   I2C0
 
#define MULTI_REGISTER_DELAY_COMMAND   0xFFFF
 
#define MULTI_REGISTER_WAIT_FOR_SEQUENCER_NOT_BUSY   0xFFFE
 

Functions

static int WM8903_MultiRegWrite (const WM8903_Init_Seq_t *seq, uint32_t cnt)
 
static void SetupXferRecAndExecute (uint8_t devAddr, uint8_t *txBuffPtr, uint16_t txSize, uint8_t *rxBuffPtr, uint16_t rxSize)
 
uint16_t WM8903_REG_Read (uint8_t reg)
 Read a 16-bit value from WM8903 codec register. More...
 
uint32_t WM8903_REG_Write (uint8_t reg, uint16_t val)
 Write a 16-bit value to Codec Register. More...
 
int WM8903_Init (int input)
 Initialize WM8903 to its default state. More...
 
void WM8903_DeInit (void)
 Disable the WM8903. More...
 
void WM8903_DumpAllRegisters (void)
 Debug function to print contents of all WM8903 registers to debug console. More...
 

Variables

const WM8903_Init_Seq_t g_wm8903 []
 
static I2CM_XFER_T i2cmXferRec
 
wm8903_register_lookup_table registerLookupTable []
 

Macro Definition Documentation

#define CODEC_I2C_BUS   LPC_I2C0

Definition at line 52 of file wm8903.c.

#define CODEC_I2C_BUS_ID   I2C0

Definition at line 53 of file wm8903.c.

#define I2CDEV_CODEC_ADDR   0x1A

Definition at line 51 of file wm8903.c.

#define I2S_MCK_MUX   2

Definition at line 40 of file wm8903.c.

#define I2S_MCK_PIN   17

Definition at line 39 of file wm8903.c.

#define I2S_MCK_PORT   1

Definition at line 38 of file wm8903.c.

#define I2S_SCK_MUX   1

Definition at line 44 of file wm8903.c.

#define I2S_SCK_PIN   4

Definition at line 43 of file wm8903.c.

#define I2S_SCK_PORT   0

Definition at line 42 of file wm8903.c.

#define I2S_WS_MUX   1

Definition at line 48 of file wm8903.c.

#define I2S_WS_PIN   5

Definition at line 47 of file wm8903.c.

#define I2S_WS_PORT   0

Definition at line 46 of file wm8903.c.

#define MULTI_REGISTER_DELAY_COMMAND   0xFFFF

Definition at line 55 of file wm8903.c.

#define MULTI_REGISTER_WAIT_FOR_SEQUENCER_NOT_BUSY   0xFFFE

Definition at line 56 of file wm8903.c.

Function Documentation

static void SetupXferRecAndExecute ( uint8_t  devAddr,
uint8_t *  txBuffPtr,
uint16_t  txSize,
uint8_t *  rxBuffPtr,
uint16_t  rxSize 
)
static

Definition at line 158 of file wm8903.c.

static int WM8903_MultiRegWrite ( const WM8903_Init_Seq_t seq,
uint32_t  cnt 
)
static

Definition at line 115 of file wm8903.c.

Variable Documentation

const WM8903_Init_Seq_t g_wm8903[]

Definition at line 63 of file wm8903.c.

I2CM_XFER_T i2cmXferRec
static

Definition at line 103 of file wm8903.c.

wm8903_register_lookup_table registerLookupTable[]

Definition at line 252 of file wm8903.c.