Skip to content

Class daisy::Wm8731

ClassList > daisy > Wm8731

More...

  • #include <codec_wm8731.h>

Classes

Type Name
struct Config

Public Types

Type Name
enum Result

Public Functions

Type Name
Result Init (const Config & config, I2CHandle i2c)
Wm8731 ()
~Wm8731 ()

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

enum daisy::Wm8731::Result {
    OK,
    ERR
};

Return values for WM8731 Functions


Public Functions Documentation

function Init

Result daisy::Wm8731::Init (
    const  Config & config,
    I2CHandle i2c
) 

Initializes the WM8731 device


function Wm8731

inline daisy::Wm8731::Wm8731 () 

function ~Wm8731

inline daisy::Wm8731::~Wm8731 () 


The documentation for this class was generated from the following file external-docs/libDaisy/src/dev/codec_wm8731.h