arduino-audio-driver
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
AudioDriverWM8960Class Class Reference

Driver API for WM8990 codec chip. More...

#include <Driver.h>

Inheritance diagram for AudioDriverWM8960Class:
AudioDriver

Public Member Functions

bool begin (CodecConfig codecCfg, DriverPins &pins)
 
void dumpRegisters ()
 
bool end (void)
 
int getVolume ()
 
bool isInputVolumeSupported ()
 
bool isVolumeSupported ()
 
DriverPinspins ()
 
virtual bool setConfig (CodecConfig codecCfg)
 
void setEnablePLL (bool active)
 Configuration: enable/disable PLL (active by default) More...
 
void setI2CRetryCount (int cnt)
 Configuration: define retry count (default : 0) More...
 
bool setInputVolume (int volume)
 
void setMclkHz (uint32_t hz)
 Configuration: define master clock frequency (default: 0) More...
 
bool setMute (bool enable)
 
virtual bool setMute (bool mute, int line)
 Mute individual lines: only supported for some rare DACs. More...
 
bool setPAPower (bool enable)
 Sets the PA Power pin to active or inactive. More...
 
bool setVolume (int volume)
 Defines the Volume (in %) if volume is 0, mute is enabled,range is 0-100. More...
 

Protected Member Functions

virtual bool configInterface (codec_mode_t mode, I2SDefinition iface)
 
bool configure_clocking ()
 
virtual bool controlState (codec_mode_t mode)
 
virtual bool deinit ()
 
int getFeatures (CodecConfig cfg)
 
TwoWire * getI2C ()
 Determine the TwoWire object from the I2C config or use Wire. More...
 
int getI2CAddress ()
 
virtual bool init (codec_config_t codec_cfg)
 
int limitValue (int volume, int min=0, int max=100)
 
mtb_wm8960_mode_t modeMasterSlave (bool is_master)
 if microcontroller is master then module is slave More...
 
mtb_wm8960_adc_dac_sample_rate_t sampleRate (int rate)
 
mtb_wm8960_word_length_t wordLength (int bits)
 

Protected Attributes

CodecConfig codec_cfg
 
int i2c_retry_count = 0
 
DriverPinsp_pins = nullptr
 
int volume_in = 100
 
int volume_out = 100
 
bool vs1053_enable_pll = true
 
uint32_t vs1053_mclk_hz = 0
 

Detailed Description

Driver API for WM8990 codec chip.

Author
Phil Schatzmann

Member Function Documentation

◆ begin()

bool begin ( CodecConfig  codecCfg,
DriverPins pins 
)
inlinevirtual

Reimplemented from AudioDriver.

◆ configInterface()

virtual bool configInterface ( codec_mode_t  mode,
I2SDefinition  iface 
)
inlineprotectedvirtualinherited

◆ configure_clocking()

bool configure_clocking ( )
inlineprotected

◆ controlState()

virtual bool controlState ( codec_mode_t  mode)
inlineprotectedvirtualinherited

◆ deinit()

virtual bool deinit ( )
inlineprotectedvirtualinherited

◆ dumpRegisters()

void dumpRegisters ( )
inline

◆ end()

bool end ( void  )
inlinevirtual

Reimplemented from AudioDriver.

◆ getFeatures()

int getFeatures ( CodecConfig  cfg)
inlineprotected

◆ getI2C()

TwoWire* getI2C ( )
inlineprotectedinherited

Determine the TwoWire object from the I2C config or use Wire.

◆ getI2CAddress()

int getI2CAddress ( )
inlineprotectedinherited

◆ getVolume()

int getVolume ( )
inlinevirtual

Implements AudioDriver.

◆ init()

virtual bool init ( codec_config_t  codec_cfg)
inlineprotectedvirtualinherited

◆ isInputVolumeSupported()

bool isInputVolumeSupported ( )
inlinevirtual

Reimplemented from AudioDriver.

◆ isVolumeSupported()

bool isVolumeSupported ( )
inlinevirtual

Reimplemented from AudioDriver.

◆ limitValue()

int limitValue ( int  volume,
int  min = 0,
int  max = 100 
)
inlineprotectedinherited

make sure that value is in range

Parameters
volume
Returns

◆ modeMasterSlave()

mtb_wm8960_mode_t modeMasterSlave ( bool  is_master)
inlineprotected

if microcontroller is master then module is slave

◆ pins()

DriverPins& pins ( )
inlineinherited

◆ sampleRate()

mtb_wm8960_adc_dac_sample_rate_t sampleRate ( int  rate)
inlineprotected

◆ setConfig()

virtual bool setConfig ( CodecConfig  codecCfg)
inlinevirtual

Reimplemented from AudioDriver.

◆ setEnablePLL()

void setEnablePLL ( bool  active)
inline

Configuration: enable/disable PLL (active by default)

◆ setI2CRetryCount()

void setI2CRetryCount ( int  cnt)
inline

Configuration: define retry count (default : 0)

◆ setInputVolume()

bool setInputVolume ( int  volume)
inlinevirtual

Reimplemented from AudioDriver.

◆ setMclkHz()

void setMclkHz ( uint32_t  hz)
inline

Configuration: define master clock frequency (default: 0)

◆ setMute() [1/2]

bool setMute ( bool  enable)
inlinevirtual

Implements AudioDriver.

◆ setMute() [2/2]

virtual bool setMute ( bool  mute,
int  line 
)
inlinevirtualinherited

Mute individual lines: only supported for some rare DACs.

Reimplemented in AudioDriverES8388Class, AudioDriverAD1938Class, and AudioDriverCS42448Class.

◆ setPAPower()

bool setPAPower ( bool  enable)
inlineinherited

Sets the PA Power pin to active or inactive.

◆ setVolume()

bool setVolume ( int  volume)
inlinevirtual

Defines the Volume (in %) if volume is 0, mute is enabled,range is 0-100.

Implements AudioDriver.

◆ wordLength()

mtb_wm8960_word_length_t wordLength ( int  bits)
inlineprotected

Member Data Documentation

◆ codec_cfg

CodecConfig codec_cfg
protectedinherited

◆ i2c_retry_count

int i2c_retry_count = 0
protected

◆ p_pins

DriverPins* p_pins = nullptr
protectedinherited

◆ volume_in

int volume_in = 100
protected

◆ volume_out

int volume_out = 100
protected

◆ vs1053_enable_pll

bool vs1053_enable_pll = true
protected

◆ vs1053_mclk_hz

uint32_t vs1053_mclk_hz = 0
protected

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