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

Driver API for AD1938 TDS DAC/ADC. More...

#include <Driver.h>

Inheritance diagram for AudioDriverAD1938Class:
AudioDriver

Public Member Functions

bool begin (CodecConfig codecCfg, DriverPins &pins) override
 
AD1938 & driver ()
 
bool end (void) override
 
int getVolume () override
 
bool isInputVolumeSupported () override
 
bool isVolumeSupported () override
 
DriverPinspins ()
 
virtual bool setConfig (CodecConfig codecCfg)
 
bool setInputVolume (int volume) override
 
bool setMute (bool mute) override
 
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) override
 Defines the Volume (in %) if volume is 0, mute is enabled,range is 0-100. More...
 
bool setVolume (int volume, int line)
 

Protected Member Functions

virtual bool configInterface (codec_mode_t mode, I2SDefinition iface)
 
virtual bool controlState (codec_mode_t mode)
 
virtual bool deinit ()
 
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)
 

Protected Attributes

AD1938 ad1938
 
CodecConfig codec_cfg
 
DriverPinsp_pins = nullptr
 
int volume = 100
 
int volumes [8] = {100}
 

Detailed Description

Driver API for AD1938 TDS DAC/ADC.

Author
Phil Schatzmann

Member Function Documentation

◆ begin()

bool begin ( CodecConfig  codecCfg,
DriverPins pins 
)
inlineoverridevirtual

Reimplemented from AudioDriver.

◆ configInterface()

virtual bool configInterface ( codec_mode_t  mode,
I2SDefinition  iface 
)
inlineprotectedvirtualinherited

◆ controlState()

virtual bool controlState ( codec_mode_t  mode)
inlineprotectedvirtualinherited

◆ deinit()

virtual bool deinit ( )
inlineprotectedvirtualinherited

◆ driver()

AD1938& driver ( )
inline

◆ end()

bool end ( void  )
inlineoverridevirtual

Reimplemented from AudioDriver.

◆ getI2C()

TwoWire* getI2C ( )
inlineprotectedinherited

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

◆ getI2CAddress()

int getI2CAddress ( )
inlineprotectedinherited

◆ getVolume()

int getVolume ( )
inlineoverridevirtual

Implements AudioDriver.

◆ init()

virtual bool init ( codec_config_t  codec_cfg)
inlineprotectedvirtualinherited

◆ isInputVolumeSupported()

bool isInputVolumeSupported ( )
inlineoverridevirtual

Reimplemented from AudioDriver.

◆ isVolumeSupported()

bool isVolumeSupported ( )
inlineoverridevirtual

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

◆ pins()

DriverPins& pins ( )
inline

◆ setConfig()

virtual bool setConfig ( CodecConfig  codecCfg)
inlinevirtual

Reimplemented from AudioDriver.

◆ setInputVolume()

bool setInputVolume ( int  volume)
inlineoverridevirtual

Reimplemented from AudioDriver.

◆ setMute() [1/2]

bool setMute ( bool  mute)
inlineoverridevirtual

Implements AudioDriver.

◆ setMute() [2/2]

bool setMute ( bool  mute,
int  line 
)
inlinevirtual

Mute individual lines: only supported for some rare DACs.

Reimplemented from AudioDriver.

◆ setPAPower()

bool setPAPower ( bool  enable)
inlineinherited

Sets the PA Power pin to active or inactive.

◆ setVolume() [1/2]

bool setVolume ( int  volume)
inlineoverridevirtual

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

Implements AudioDriver.

◆ setVolume() [2/2]

bool setVolume ( int  volume,
int  line 
)
inline

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

Member Data Documentation

◆ ad1938

AD1938 ad1938
protected

◆ codec_cfg

CodecConfig codec_cfg
protectedinherited

◆ p_pins

DriverPins* p_pins = nullptr
protected

◆ volume

int volume = 100
protected

◆ volumes

int volumes[8] = {100}
protected

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