16 #include "wm8904_reg.h" 43 DAC_DGTL_VOL_L = 0x1E,
44 DAC_DGTL_VOL_R = 0x1F,
47 ADC_DGTL_VOL_L = 0x24,
48 ADC_DGTL_VOL_R = 0x25,
73 DC_SERVO_RDBK0 = 0x4D,
122 FLL_NCO_TEST0 = 0xF7,
129 cmd_t & operator=(
const cmd_t rhs)
137 static cmd_t init_cmds_0[];
138 static cmd_t init_cmds_1[];
139 static cmd_t init_cmds_2[];
140 static cmd_t init_cmds_3[];
141 static cmd_t init_cmds_4[];
142 static cmd_t init_cmds_5[];
143 static cmd_t init_cmds_6[];
153 DATA_FMT_16_L_JUSTIFIED,
155 DATA_FMT_32_L_JUSTIFIED,
159 enum AudioChSelect_t {
165 enum AudioOutSelect_t {
172 enum AudioInSelect_t {
182 DataFmt_t dataFormat;
183 AudioChSelect_t inCh;
184 AudioChSelect_t outCh;
185 AudioInSelect_t inSrc;
186 AudioOutSelect_t outSrc;
195 void InitInput(
const cfg_t &cfg);
196 void ConfigFLL(
const cfg_t &cfg);
219 void WriteReg(Reg::RegAddr_t reg, uint16_t dat);
225 uint16_t
ReadReg(Reg::RegAddr_t reg);
249 void UpdateCmd(Reg::cmd_t cmd, uint16_t updateMask);
257 void SetVolume(AudioOutSelect_t out, AudioChSelect_t channel, uint8_t volume);
264 uint8_t
GetVolume(AudioOutSelect_t out, AudioChSelect_t channel);
271 void Mute(AudioOutSelect_t out, AudioChSelect_t channel,
bool mute);
278 void SetMicGain(AudioChSelect_t channel, uint8_t gain);
290 void MuteMic(AudioChSelect_t channel,
bool mute);
303 int TransmitBuffer(
void *buffer, uint32_t bufferLen,
bool waitIfNeeded);
NetBurner Real-Time Operating System API.
NetBurner System Initialization Header File.
int TransmitBuffer(void *buffer, uint32_t bufferLen, bool waitIfNeeded)
Hands off a buffer to be transmitted to the codec.
Definition: wm8904.cpp:565
Configuration structure for the SSC driver. Passed to the initialize function to configure the hardwa...
Definition: ssc_i2s.h:238
int ReadyReceiveBuffer(void *buffer, uint32_t bufferLen, bool waitIfNeeded)
Hands off a buffer to be written to by the codec.
Definition: wm8904.cpp:570
void RegisterTxBufferDoneCB(SSC_BufferDoneFn_t cb)
Registers a callback for when a transmit buffer is finished.
Definition: wm8904.cpp:575
I2C Peripheral Class.
Definition: i2c.h:203
uint8_t GetMicGain(AudioChSelect_t channel)
Get the microphone gain of the selected input channel.
Definition: wm8904.cpp:527
void SetMicGain(AudioChSelect_t channel, uint8_t gain)
Set the microphone gain of the selected input channel.
Definition: wm8904.cpp:503
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:190
void Mute(AudioOutSelect_t out, AudioChSelect_t channel, bool mute)
Mute or unmute the selected audio output and channel.
Definition: wm8904.cpp:458
uint8_t GetVolume(AudioOutSelect_t out, AudioChSelect_t channel)
Get the volume of the selected audio output and channel.
Definition: wm8904.cpp:441
void SetVolume(AudioOutSelect_t out, AudioChSelect_t channel, uint8_t volume)
Set the volume of the selected audio output and channel.
Definition: wm8904.cpp:393
void Shutdown()
Shuts down the WM8904 codec driver.
void RegisterRxBufferDoneCB(SSC_BufferDoneFn_t cb)
Registers a callback for when a receive buffer is finished.
Definition: wm8904.cpp:580
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:204
WM8904(I2C &module)
The constructor for the WM8904 context.
Definition: wm8904.cpp:17
void WriteReg(Reg::RegAddr_t reg, uint16_t dat)
Write a register on the WM8904.
Definition: wm8904.cpp:22
void Init(const cfg_t &cfg, const SSC_cfg_t &ssc_cfg)
Configures and initializes both the driver and the codec.
Definition: wm8904.cpp:297
void MuteMic(AudioChSelect_t channel, bool mute)
Mute or unmute the selected input channel.
Definition: wm8904.cpp:532
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:196
NetBurner I2C API for ARM SAME70.
uint16_t ReadReg(Reg::RegAddr_t reg)
Read a register on the WM8904.
Definition: wm8904.cpp:38