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);