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

Driver API for the wm8994 codec chip. More...

#include <Driver.h>

Inheritance diagram for AudioDriverWM8994Class:
AudioDriver

Public Member Functions

 AudioDriverWM8994Class (uint16_t deviceAddr=0x1A)
 
virtual bool begin (CodecConfig codecCfg, DriverPins &pins)
 
virtual bool end (void)
 
int getVolume ()
 
virtual bool isInputVolumeSupported ()
 
virtual bool isVolumeSupported ()
 
DriverPinspins ()
 
virtual bool setConfig (CodecConfig codecCfg)
 
void setI2CAddress (uint16_t adr)
 
virtual bool setInputVolume (int volume)
 
bool setMute (bool mute)
 
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)
 
virtual bool controlState (codec_mode_t mode)
 
bool deinit ()
 
TwoWire * getI2C ()
 Determine the TwoWire object from the I2C config or use Wire. More...
 
int getI2CAddress ()
 
uint16_t getOutput (output_device_t output_device)
 
virtual bool init (codec_config_t codec_cfg)
 
int limitValue (int volume, int min=0, int max=100)
 

Protected Attributes

CodecConfig codec_cfg
 
uint16_t deviceAddr
 
DriverPinsp_pins = nullptr
 
int volume = 100
 

Detailed Description

Driver API for the wm8994 codec chip.

Author
Phil Schatzmann

Constructor & Destructor Documentation

◆ AudioDriverWM8994Class()

AudioDriverWM8994Class ( uint16_t  deviceAddr = 0x1A)
inline

Member Function Documentation

◆ begin()

virtual bool begin ( CodecConfig  codecCfg,
DriverPins pins 
)
inlinevirtual

Reimplemented from AudioDriver.

◆ configInterface()

virtual bool configInterface ( codec_mode_t  mode,
I2SDefinition  iface 
)
inlineprotectedvirtualinherited

◆ controlState()

virtual bool controlState ( codec_mode_t  mode)
inlineprotectedvirtualinherited

◆ deinit()

bool deinit ( )
inlineprotectedvirtual

Reimplemented from AudioDriver.

◆ end()

virtual bool end ( void  )
inlinevirtualinherited

◆ getI2C()

TwoWire* getI2C ( )
inlineprotectedinherited

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

◆ getI2CAddress()

int getI2CAddress ( )
inlineprotectedinherited

◆ getOutput()

uint16_t getOutput ( output_device_t  output_device)
inlineprotected

◆ getVolume()

int getVolume ( )
inlinevirtual

Implements AudioDriver.

◆ init()

virtual bool init ( codec_config_t  codec_cfg)
inlineprotectedvirtualinherited

◆ isInputVolumeSupported()

virtual bool isInputVolumeSupported ( )
inlinevirtualinherited

◆ isVolumeSupported()

virtual bool isVolumeSupported ( )
inlinevirtualinherited

◆ limitValue()

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

make sure that value is in range

Parameters
volume
Returns

◆ pins()

DriverPins& pins ( )
inlineinherited

◆ setConfig()

virtual bool setConfig ( CodecConfig  codecCfg)
inlinevirtualinherited

◆ setI2CAddress()

void setI2CAddress ( uint16_t  adr)
inline

◆ setInputVolume()

virtual bool setInputVolume ( int  volume)
inlinevirtualinherited

◆ setMute() [1/2]

bool setMute ( bool  mute)
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.

Member Data Documentation

◆ codec_cfg

CodecConfig codec_cfg
protectedinherited

◆ deviceAddr

uint16_t deviceAddr
protected

◆ p_pins

DriverPins* p_pins = nullptr
protectedinherited

◆ volume

int volume = 100
protected

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