arduino-audio-driver
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
AudioDriverLyratMiniClass Class Reference

Driver API for Lyrat Mini with a ES8311 and a ES7243 codec chip. More...

#include <Driver.h>

Inheritance diagram for AudioDriverLyratMiniClass:
AudioDriver

Public Member Functions

bool begin (CodecConfig codecCfg, DriverPins &pins)
 Starts the processing. More...
 
bool end (void)
 Ends the processing: shut down dac and adc. More...
 
virtual int getI2CAddress ()
 Provides the i2c address. More...
 
int getInputVolume ()
 
int getVolume () override
 Determines the actual volume (range: 0-100) More...
 
bool isInputVolumeSupported () override
 Determines if setInputVolume() is supported. More...
 
virtual bool isVolumeSupported ()
 Determines if setVolume() is suppored. More...
 
 operator bool ()
 
virtual DriverPinspins ()
 Provides the pin information. More...
 
virtual bool setConfig (CodecConfig codecCfg)
 changes the configuration More...
 
virtual bool setI2CAddress (uint16_t adr)
 Defines the i2c address. 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...
 
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...
 
void setPins (DriverPins &pins)
 
void setupI2CAddress ()
 If no address is defined in the pins we provide it here. More...
 
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 i2c_bus_handle_t getI2C ()
 Determine the TwoWire object from the I2C config or use Wire. More...
 
virtual bool init (codec_config_t codec_cfg)
 
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

AudioDriverES7243Class adc
 
CodecConfig codec_cfg
 
AudioDriverES8311Class dac
 
int i2c_default_address = -1
 
DriverPinsp_pins = nullptr
 

Detailed Description

Driver API for Lyrat Mini with a ES8311 and a ES7243 codec chip.

Author
Phil Schatzmann

Member Function Documentation

◆ begin()

bool begin ( CodecConfig  codecCfg,
DriverPins pins 
)
inlinevirtual

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

◆ end()

bool end ( void  )
inlinevirtual

Ends the processing: shut down dac and adc.

Reimplemented from AudioDriver.

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

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

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 DriverPins& 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)
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]

virtual bool setMute ( bool  mute,
int  line 
)
inlinevirtualinherited

Mute individual lines: only supported for some rare DACs.

Reimplemented in AudioDriverWM8978Class, AudioDriverPCM3168Class, AudioDriverES8388Class, and AudioDriverCS42448Class.

◆ setPAPower()

bool setPAPower ( bool  enable)
inlineinherited

Sets the PA Power pin to active or inactive.

◆ setPins()

void setPins ( DriverPins pins)
inlineinherited

◆ setupI2CAddress()

void setupI2CAddress ( )
inlineinherited

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

◆ setVolume()

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

◆ adc

AudioDriverES7243Class adc
protected

◆ codec_cfg

CodecConfig codec_cfg
protectedinherited

◆ dac

AudioDriverES8311Class dac
protected

◆ i2c_default_address

int i2c_default_address = -1
protectedinherited

◆ p_pins

DriverPins* p_pins = nullptr
protectedinherited

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