16#include "wm8904_reg.h"
46 DAC_DGTL_VOL_L = 0x1E,
47 DAC_DGTL_VOL_R = 0x1F,
50 ADC_DGTL_VOL_L = 0x24,
51 ADC_DGTL_VOL_R = 0x25,
76 DC_SERVO_RDBK0 = 0x4D,
125 FLL_NCO_TEST0 = 0xF7,
133 cmd_t &operator=(
const cmd_t rhs)
141 static cmd_t init_cmds_0[];
142 static cmd_t init_cmds_1[];
143 static cmd_t init_cmds_2[];
144 static cmd_t init_cmds_3[];
145 static cmd_t init_cmds_4[];
146 static cmd_t init_cmds_5[];
147 static cmd_t init_cmds_6[];
159 DATA_FMT_16_L_JUSTIFIED,
161 DATA_FMT_32_L_JUSTIFIED,
172 enum AudioOutSelect_t
192 DataFmt_t dataFormat;
193 AudioChSelect_t inCh;
194 AudioChSelect_t outCh;
195 AudioInSelect_t inSrc;
196 AudioOutSelect_t outSrc;
205 void InitInput(
const cfg_t &cfg);
206 void ConfigFLL(
const cfg_t &cfg);
230 void WriteReg(Reg::RegAddr_t reg, uint16_t dat);
236 uint16_t
ReadReg(Reg::RegAddr_t reg);
260 void UpdateCmd(Reg::cmd_t cmd, uint16_t updateMask);
268 void SetVolume(AudioOutSelect_t out, AudioChSelect_t channel, uint8_t volume);
275 uint8_t
GetVolume(AudioOutSelect_t out, AudioChSelect_t channel);
282 void Mute(AudioOutSelect_t out, AudioChSelect_t channel,
bool mute);
289 void SetMicGain(AudioChSelect_t channel, uint8_t gain);
301 void MuteMic(AudioChSelect_t channel,
bool mute);
314 int TransmitBuffer(
void *buffer, uint32_t bufferLen,
bool waitIfNeeded);
I2C Peripheral Class.
Definition i2c.h:213
void SendCmdList(Reg::cmd_t *cmds, uint32_t len)
Execute an array of codec Commands. A command is: a register to write, a value to write,...
Definition wm8904.cpp:145
void SendCmd(Reg::cmd_t cmd)
Execute codec Command. A command is: a register to write, a value to write, and a delay of time requi...
Definition wm8904.cpp:139
void MuteMic(AudioChSelect_t channel, bool mute)
Mute or unmute the selected input channel.
Definition wm8904.cpp:464
uint16_t ReadReg(Reg::RegAddr_t reg)
Read a register on the WM8904.
Definition wm8904.cpp:30
void SetMicGain(AudioChSelect_t channel, uint8_t gain)
Set the microphone gain of the selected input channel.
Definition wm8904.cpp:440
void WriteReg(Reg::RegAddr_t reg, uint16_t dat)
Write a register on the WM8904.
Definition wm8904.cpp:17
void Init(const cfg_t &cfg, const SSC_cfg_t &ssc_cfg)
Configures and initializes both the driver and the codec.
Definition wm8904.cpp:245
void Mute(AudioOutSelect_t out, AudioChSelect_t channel, bool mute)
Mute or unmute the selected audio output and channel.
Definition wm8904.cpp:389
void RegisterTxBufferDoneCB(SSC_BufferDoneFn_t cb)
Registers a callback for when a transmit buffer is finished.
Definition wm8904.cpp:510
WM8904(I2C &module)
The constructor for the WM8904 context.
Definition wm8904.cpp:15
uint8_t GetVolume(AudioOutSelect_t out, AudioChSelect_t channel)
Get the volume of the selected audio output and channel.
Definition wm8904.cpp:369
void Shutdown()
Shuts down the WM8904 codec driver.
int ReadyReceiveBuffer(void *buffer, uint32_t bufferLen, bool waitIfNeeded)
Hands off a buffer to be written to by the codec.
Definition wm8904.cpp:505
void RegisterRxBufferDoneCB(SSC_BufferDoneFn_t cb)
Registers a callback for when a receive buffer is finished.
Definition wm8904.cpp:515
void UpdateCmd(Reg::cmd_t cmd, uint16_t updateMask)
Execute a codec Command to update a register. A command is: a register to write, a value to write,...
Definition wm8904.cpp:153
int TransmitBuffer(void *buffer, uint32_t bufferLen, bool waitIfNeeded)
Hands off a buffer to be transmitted to the codec.
Definition wm8904.cpp:500
uint8_t GetMicGain(AudioChSelect_t channel)
Get the microphone gain of the selected input channel.
Definition wm8904.cpp:459
void SetVolume(AudioOutSelect_t out, AudioChSelect_t channel, uint8_t volume)
Set the volume of the selected audio output and channel.
Definition wm8904.cpp:329
NetBurner I2C API for ARM SAME70.
NetBurner System Initialization Header File.
NetBurner Real-Time Operating System (NBRTOS) API.
Configuration structure for the SSC driver. Passed to the initialize function to configure the hardwa...
Definition ssc_i2s.h:249