daisy::Wm8731¶
#include <codec_wm8731.h>
Public Classes¶
Name | |
---|---|
struct | Config |
Public Types¶
Name | |
---|---|
enum class | Result |
Public Functions¶
Name | |
---|---|
Wm8731() | |
~Wm8731() | |
Result | Init(const Config & config, I2CHandle i2c) |
Detailed Description¶
Device driver for Cirrus (Wolfsen) WM8731 Audio Codec
Currently only two-wire (I2C) interface format is supported, and only a limited set of features are configurable:
- Line inputs/outputs
- audio format/word length
- 48kHZ
Support for headphones, microphone, and full functionality still needs to be added.
Use the Driver like this (this will be compatible with the Daisy Seed audio/sai config): I2CHandle::Config i2c_config; I2CHandle i2c1_handle; Wm8731::Config codec_cfg; Wm8731 codec; i2c_config.periph = I2CHandle::Config::Peripheral::I2C_1; i2c_config.speed = I2CHandle::Config::Speed::I2C_400KHZ; i2c_config.pin_config.scl = {DSY_GPIOB, 6}; i2c_config.pin_config.sda = {DSY_GPIOB, 9}; i2c1_handle.Init(i2c_config); codec_cfg.Defaults(); // MCU is master, 24-bit, MSB LJ codec.Init(codec_cfg, i2c1_handle);
Public Types Documentation¶
enum Result¶
Enumerator | Value | Description |
---|---|---|
OK | ||
ERR |
Return values for WM8731 Functions
Public Functions Documentation¶
function Wm8731¶
function ~Wm8731¶
function Init¶
Initializes the WM8731 device
---¶
Updated on 2024-01-03 at 19:41:00 +0000