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

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

#include <Driver.h>

Inheritance diagram for AudioDriverCS42448Class:
AudioDriver

Public Member Functions

bool begin (CodecConfig codecCfg, DriverPins &pins) override
 Starts the processing. More...
 
CS42448 & driver ()
 
bool end (void) override
 Ends the processing: shut down dac and adc. More...
 
int getVolume () override
 Determines the actual volume (range: 0-100) More...
 
bool isInputVolumeSupported () override
 Determines if setInputVolume() is supported. More...
 
bool isVolumeSupported () override
 Determines if setVolume() is suppored. More...
 
 operator bool ()
 
DriverPinspins ()
 Provides the pin information. More...
 
virtual bool setConfig (CodecConfig codecCfg)
 changes the configuration More...
 
bool setInputVolume (int volume) override
 Defines the input volume (range: 0-100) if supported. More...
 
bool setMute (bool enable) override
 Mutes all output lines. More...
 
bool setMute (bool enable, 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...
 
void setPins (DriverPins &pins)
 
bool setVolume (int dac, int volume)
 
bool setVolume (int volume) override
 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)
 
virtual bool deinit ()
 
virtual TwoWire * getI2C ()
 Determine the TwoWire object from the I2C config or use Wire. More...
 
virtual int getI2CAddress ()
 
virtual bool init (codec_config_t codec_cfg)
 
int limitValue (int volume, int min=0, int max=100)
 

Protected Attributes

CodecConfig cfg
 
CodecConfig codec_cfg
 
CS42448 cs42448
 
DriverPinsp_pins = nullptr
 
int volume = 100
 

Detailed Description

Driver API for CS42448 TDS DAC/ADC.

Author
Phil Schatzmann

Member Function Documentation

◆ begin()

bool begin ( CodecConfig  codecCfg,
DriverPins pins 
)
inlineoverridevirtual

Starts the processing.

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

CS42448& driver ( )
inline

◆ end()

bool end ( void  )
inlineoverridevirtual

Ends the processing: shut down dac and adc.

Reimplemented from AudioDriver.

◆ getI2C()

virtual TwoWire* getI2C ( )
inlineprotectedvirtualinherited

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

◆ getI2CAddress()

virtual int getI2CAddress ( )
inlineprotectedvirtualinherited

◆ getVolume()

int getVolume ( )
inlineoverridevirtual

Determines the actual volume (range: 0-100)

Implements AudioDriver.

◆ init()

virtual bool init ( codec_config_t  codec_cfg)
inlineprotectedvirtualinherited

◆ isInputVolumeSupported()

bool isInputVolumeSupported ( )
inlineoverridevirtual

Determines if setInputVolume() is supported.

Reimplemented from AudioDriver.

◆ isVolumeSupported()

bool isVolumeSupported ( )
inlineoverridevirtual

Determines if setVolume() is suppored.

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

◆ operator bool()

operator bool ( )
inlineinherited

◆ pins()

DriverPins& pins ( )
inlinevirtual

Provides the pin information.

Reimplemented from AudioDriver.

◆ setConfig()

virtual bool setConfig ( CodecConfig  codecCfg)
inlinevirtual

changes the configuration

Reimplemented from AudioDriver.

◆ setInputVolume()

bool setInputVolume ( int  volume)
inlineoverridevirtual

Defines the input volume (range: 0-100) if supported.

Reimplemented from AudioDriver.

◆ setMute() [1/2]

bool setMute ( bool  enable)
inlineoverridevirtual

Mutes all output lines.

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.

◆ setPins()

void setPins ( DriverPins pins)
inlineinherited

◆ setVolume() [1/2]

bool setVolume ( int  dac,
int  volume 
)
inline

◆ setVolume() [2/2]

bool setVolume ( int  volume)
inlineoverridevirtual

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

Implements AudioDriver.

Member Data Documentation

◆ cfg

CodecConfig cfg
protected

◆ codec_cfg

CodecConfig codec_cfg
protectedinherited

◆ cs42448

CS42448 cs42448
protected

◆ p_pins

DriverPins* p_pins = nullptr
protectedinherited

◆ volume

int volume = 100
protected

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