SAMV71 Xplained Ultra Software Package 1.5

wm8904.h File Reference

#include "board.h"

Go to the source code of this file.

Defines

#define WM8904_CSB_STATE   (0x0 << 0)
#define WM8904_SLAVE_ADDRESS   0x1a | WM8904_CSB_STATE
#define CS2100_SLAVE_ADDRESS   0x4E
#define WM8904_REG_RESET   0x00
#define WM8904_REG_BIAS_CTRL0   0x04
#define WM8904_REG_VMID_CTRL0   0x05
#define WM8904_REG_MICBIAS_CTRL0   0x06
#define WM8904_REG_BIAS_CTRL1   0x07
#define WM8904_REG_POWER_MANG0   0x0C
#define WM8904_REG_POWER_MANG2   0x0E
#define WM8904_REG_POWER_MANG3   0x0F
#define WM8904_REG_POWER_MANG6   0x12
#define WM8904_REG_CLOCK_RATE0   0x14
#define WM8904_REG_CLOCK_RATE1   0x15
#define WM8904_REG_CLOCK_RATE2   0x16
#define WM8904_REG_AUD_INF0   0x18
#define WM8904_REG_AUD_INF1   0x19
#define WM8904_REG_AUD_INF2   0x1A
#define WM8904_REG_AUD_INF3   0x1B
#define WM8904_REG_ADC_DIG0   0x20
#define WM8904_REG_ADC_DIG1   0x21
#define WM8904_REG_ANALOGUE_LIN0   0x2C
#define WM8904_REG_ANALOGUE_RIN0   0x2D
#define WM8904_REG_ANALOGUE_LIN1   0x2E
#define WM8904_REG_ANALOGUE_RIN1   0x2F
#define WM8904_REG_ANALOGUE_LOUT1   0x39
#define WM8904_REG_ANALOGUE_ROUT1   0x3A
#define WM8904_REG_ANALOGUE_LOUT2   0x3B
#define WM8904_REG_ANALOGUE_ROUT2   0x3C
#define WM8904_REG_ANALOGUE_OUT12ZC   0x3D
#define WM8904_REG_DC_SERVO0   0x43
#define WM8904_REG_ANALOGUE_HP0   0x5A
#define WM8904_REG_CHARGE_PUMP0   0x62
#define WM8904_REG_CLASS0   0x68
#define WM8904_REG_FLL_CRTL1   0x74
#define WM8904_REG_FLL_CRTL2   0x75
#define WM8904_REG_FLL_CRTL3   0x76
#define WM8904_REG_FLL_CRTL4   0x77
#define WM8904_REG_FLL_CRTL5   0x78
#define WM8904_REG_END   0xFF

Functions

uint16_t WM8904_Read (Twid *pTwid, uint32_t device, uint32_t regAddr)
 Read data from WM8904 Register.
void WM8904_Write (Twid *pTwid, uint32_t device, uint32_t regAddr, uint16_t data)
 Write data to WM8904 Register.
uint8_t WM8904_Init (Twid *pTwid, uint32_t device, uint32_t PCK)
uint8_t WM8904_VolumeSet (Twid *pTwid, uint32_t device, uint16_t value)
void WM8904_IN2R_IN1L (Twid *pTwid, uint32_t device)

Detailed Description

Implementation WM8904 driver.

Definition in file wm8904.h.


Define Documentation

#define WM8904_REG_ADC_DIG0   0x20

ADC digital 0 register

Definition at line 95 of file wm8904.h.

#define WM8904_REG_ADC_DIG1   0x21

ADC digital 1 register

Definition at line 97 of file wm8904.h.

#define WM8904_REG_ANALOGUE_HP0   0x5A

Analogue HP 0 register

Definition at line 126 of file wm8904.h.

#define WM8904_REG_ANALOGUE_LIN0   0x2C

Analogue left input 0 register

Definition at line 100 of file wm8904.h.

#define WM8904_REG_ANALOGUE_LIN1   0x2E

Analogue left input 1 register

Definition at line 105 of file wm8904.h.

#define WM8904_REG_ANALOGUE_LOUT1   0x39

Analogue left output 1 register

Definition at line 110 of file wm8904.h.

#define WM8904_REG_ANALOGUE_LOUT2   0x3B

Analogue left output 2 register

Definition at line 115 of file wm8904.h.

#define WM8904_REG_ANALOGUE_OUT12ZC   0x3D

Analogue output 12 ZC register

Definition at line 120 of file wm8904.h.

#define WM8904_REG_ANALOGUE_RIN0   0x2D

Analogue right input 0 register

Definition at line 102 of file wm8904.h.

#define WM8904_REG_ANALOGUE_RIN1   0x2F

Analogue right input 1 register

Definition at line 107 of file wm8904.h.

#define WM8904_REG_ANALOGUE_ROUT1   0x3A

Analogue right output 1 register

Definition at line 112 of file wm8904.h.

#define WM8904_REG_ANALOGUE_ROUT2   0x3C

Analogue right output 2 register

Definition at line 117 of file wm8904.h.

#define WM8904_REG_AUD_INF0   0x18

Audio interface0 register

Definition at line 85 of file wm8904.h.

#define WM8904_REG_AUD_INF1   0x19

Audio interface1 register

Definition at line 88 of file wm8904.h.

#define WM8904_REG_AUD_INF2   0x1A

Audio interface2 register

Definition at line 90 of file wm8904.h.

#define WM8904_REG_AUD_INF3   0x1B

Audio interface3 register

Definition at line 92 of file wm8904.h.

#define WM8904_REG_BIAS_CTRL0   0x04

Bias control 0 register

Definition at line 56 of file wm8904.h.

#define WM8904_REG_BIAS_CTRL1   0x07

Bias control 1 register

Definition at line 65 of file wm8904.h.

#define WM8904_REG_CHARGE_PUMP0   0x62

Charge pump 0 register

Definition at line 129 of file wm8904.h.

#define WM8904_REG_CLASS0   0x68

Class W 0 register

Definition at line 132 of file wm8904.h.

#define WM8904_REG_CLOCK_RATE0   0x14

Clock rate0 register

Definition at line 77 of file wm8904.h.

#define WM8904_REG_CLOCK_RATE1   0x15

Clock rate1 register

Definition at line 79 of file wm8904.h.

#define WM8904_REG_CLOCK_RATE2   0x16

Clock rate2 register

Definition at line 82 of file wm8904.h.

#define WM8904_REG_DC_SERVO0   0x43

DC servo 0 register

Definition at line 123 of file wm8904.h.

#define WM8904_REG_END   0xFF

DUMMY register

Definition at line 146 of file wm8904.h.

#define WM8904_REG_FLL_CRTL1   0x74

FLL control 1 register

Definition at line 135 of file wm8904.h.

#define WM8904_REG_FLL_CRTL2   0x75

FLL control 2 register

Definition at line 137 of file wm8904.h.

#define WM8904_REG_FLL_CRTL3   0x76

FLL control 3 register

Definition at line 139 of file wm8904.h.

#define WM8904_REG_FLL_CRTL4   0x77

FLL control 4 register

Definition at line 141 of file wm8904.h.

#define WM8904_REG_FLL_CRTL5   0x78

FLL control 5 register

Definition at line 143 of file wm8904.h.

#define WM8904_REG_MICBIAS_CTRL0   0x06

MIC Bias control 0 register

Definition at line 62 of file wm8904.h.

#define WM8904_REG_POWER_MANG0   0x0C

Power management control 0 register

Definition at line 68 of file wm8904.h.

#define WM8904_REG_POWER_MANG2   0x0E

Power management control 2 register

Definition at line 70 of file wm8904.h.

#define WM8904_REG_POWER_MANG3   0x0F

Power management control 3 register

Definition at line 72 of file wm8904.h.

#define WM8904_REG_POWER_MANG6   0x12

Power management control 6 register

Definition at line 74 of file wm8904.h.

#define WM8904_REG_RESET   0x00

Reset register

Definition at line 53 of file wm8904.h.

#define WM8904_REG_VMID_CTRL0   0x05

VMID control 0 register

Definition at line 59 of file wm8904.h.

#define WM8904_SLAVE_ADDRESS   0x1a | WM8904_CSB_STATE

Slave address

Definition at line 48 of file wm8904.h.


Function Documentation

uint16_t WM8904_Read ( Twid pTwid,
uint32_t  device,
uint32_t  regAddr 
)

Read data from WM8904 Register.

Parameters:
pTwid Pointer to twi driver structure
device Twi slave address.
regAddr Register address to read.
Returns:
value in the given register.

Definition at line 62 of file wm8904.c.

void WM8904_Write ( Twid pTwid,
uint32_t  device,
uint32_t  regAddr,
uint16_t  data 
)

Write data to WM8904 Register.

Parameters:
pTwid Pointer to twi driver structure
device Twi slave address.
regAddr Register address to read.
data Data to write

Definition at line 82 of file wm8904.c.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines