libDaisy
Hardware Library for Daisy
Loading...
Searching...
No Matches
daisy::Wm8731 Class Reference

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

#include <codec_wm8731.h>

Classes

struct  Config
 

Public Types

enum class  Result { OK , ERR }
 

Public Member Functions

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

Member Enumeration Documentation

◆ Result

Return values for WM8731 Functions

Enumerator
OK 
ERR 

Constructor & Destructor Documentation

◆ Wm8731()

daisy::Wm8731::Wm8731 ( )
inline

◆ ~Wm8731()

daisy::Wm8731::~Wm8731 ( )
inline

Member Function Documentation

◆ Init()

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

Initializes the WM8731 device


The documentation for this class was generated from the following file: