arduino-audio-driver
Loading...
Searching...
No Matches
AudioDriverTLV320AIC3104Class Class Reference

Driver for the TI TLV320AIC3104. It might also work on other AIC310x chips. More...

#include <AudioDriver.h>

Inheritance diagram for AudioDriverTLV320AIC3104Class:
AudioDriverZephyrT< TLV320AIC3104, 0x18 > AudioDriver

Public Member Functions

virtual bool begin (CodecConfig codecCfg, DriverDeviceInfo &pins)
 Starts the processing.
TLV320AIC3104 & driver ()
 Provides access to the wrapped Zephyr driver instance.
virtual bool end (void)
 Ends the processing: shut down dac and adc.
API_GPIO & getGPIO ()
virtual int getI2CAddress ()
 Provides the i2c address.
int getInputVolume ()
int getVolume () override
 Determines the actual volume (range: 0-100).
bool isInputVolumeSupported () override
 Determines if setInputVolume() is supported.
virtual bool isVolumeSupported ()
 Determines if setVolume() is suppored.
 operator bool ()
virtual DriverDeviceInfo & pins ()
 Provides the pin information.
virtual bool setConfig (CodecConfig codecCfg)
 changes the configuration
virtual bool setI2CAddress (uint16_t adr)
 Defines the i2c address.
bool setInputVolume (int volume) override
 Defines the input volume (range: 0-100) if supported.
bool setMclk (uint32_t _mclk)
virtual bool setMute (bool mute, int line)
 Mute individual lines: only supported for some rare DACs.
bool setMute (bool enable) override
 Mutes all output lines.
bool setPAPower (bool enable)
 Sets the PA Power pin to active or inactive.
void setPins (DriverDeviceInfo &pins)
void setupI2CAddress ()
 If no address is defined in the pins we provide it here.
bool setVolume (int volume) override
 Defines the Volume (in %) if volume is 0, mute is enabled,range is 0-100.

Protected Member Functions

bool configInterface (codec_mode_t mode, I2SDefinition iface) override
bool controlState (codec_mode_t mode) override
bool deinit () override
 Stops the input and output and (if supported) shuts down the codec.
virtual i2c_bus_handle_t getI2C ()
 Determine the TwoWire object from the I2C config or use Wire.
bool init (codec_config_t codecCfg) override
int limitValue (int volume, int min=0, int max=100)
int mapVolume (int x, int in_min, int in_max, int out_min, int out_max)

Protected Attributes

CodecConfig codec_cfg
int i2c_default_address = -1
uint32_t mclk = 0
DriverDeviceInfo * p_pins = nullptr
int volume_value
TLV320AIC3104 zephyr_driver

Detailed Description

Driver for the TI TLV320AIC3104. It might also work on other AIC310x chips.

Author
Mark Smith, @smittyhalibut

Member Function Documentation

◆ begin()

◆ configInterface()

bool configInterface ( codec_mode_t mode,
I2SDefinition iface )
inlineoverrideprotectedvirtual

Reimplemented from AudioDriver.

◆ controlState()

bool controlState ( codec_mode_t mode)
inlineoverrideprotectedvirtualinherited

Reimplemented from AudioDriver.

◆ deinit()

bool deinit ( )
inlineoverrideprotectedvirtualinherited

Stops the input and output and (if supported) shuts down the codec.

Reimplemented from AudioDriver.

◆ driver()

TLV320AIC3104 & driver ( )
inlineinherited

Provides access to the wrapped Zephyr driver instance.

◆ end()

virtual bool end ( void )
inlinevirtualinherited

◆ getGPIO()

API_GPIO & getGPIO ( )
inlineinherited

◆ getI2C()

virtual i2c_bus_handle_t getI2C ( )
inlineprotectedvirtualinherited

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

◆ getI2CAddress()

virtual int getI2CAddress ( )
inlinevirtualinherited

Provides the i2c address.

◆ getInputVolume()

int getInputVolume ( )
inlineinherited

◆ getVolume()

int getVolume ( )
inlineoverridevirtualinherited

Determines the actual volume (range: 0-100).

Implements AudioDriver.

◆ init()

bool init ( codec_config_t codecCfg)
inlineoverrideprotectedvirtualinherited

Reimplemented from AudioDriver.

◆ isInputVolumeSupported()

bool isInputVolumeSupported ( )
inlineoverridevirtualinherited

Determines if setInputVolume() is supported.

Reimplemented from AudioDriver.

◆ 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

◆ mapVolume()

int mapVolume ( int x,
int in_min,
int in_max,
int out_min,
int out_max )
inlineprotectedinherited

◆ operator bool()

operator bool ( )
inlineinherited

◆ pins()

virtual DriverDeviceInfo & pins ( )
inlinevirtualinherited

Provides the pin information.

Reimplemented in AudioDriverCS42448Class.

◆ setConfig()

virtual bool setConfig ( CodecConfig codecCfg)
inlinevirtualinherited

◆ setI2CAddress()

virtual bool setI2CAddress ( uint16_t adr)
inlinevirtualinherited

Defines the i2c address.

◆ setInputVolume()

bool setInputVolume ( int volume)
inlineoverridevirtualinherited

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

Reimplemented from AudioDriver.

◆ setMclk()

bool setMclk ( uint32_t _mclk)
inline

◆ setMute() [1/2]

virtual bool setMute ( bool mute,
int line )
inlinevirtualinherited

Mute individual lines: only supported for some rare DACs.

Reimplemented in AudioDriverCS42448Class, AudioDriverES8388Class, AudioDriverPCM3168Class, and AudioDriverWM8978Class.

◆ setMute() [2/2]

bool setMute ( bool enable)
inlineoverridevirtualinherited

Mutes all output lines.

Implements AudioDriver.

◆ setPAPower()

bool setPAPower ( bool enable)
inlineinherited

Sets the PA Power pin to active or inactive.

◆ setPins()

void setPins ( DriverDeviceInfo & pins)
inlineinherited

◆ setupI2CAddress()

void setupI2CAddress ( )
inlineinherited

If no address is defined in the pins we provide it here.

◆ setVolume()

bool setVolume ( int volume)
inlineoverridevirtualinherited

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

◆ i2c_default_address

int i2c_default_address = -1
protectedinherited

◆ mclk

uint32_t mclk = 0
protected

◆ p_pins

DriverDeviceInfo* p_pins = nullptr
protectedinherited

◆ volume_value

int volume_value
protectedinherited

◆ zephyr_driver

TLV320AIC3104 zephyr_driver
protectedinherited

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