arduino-audio-driver
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | Protected Attributes | List of all members
ES7243 Class Reference

Header-only driver class for the ES7243 ADC chip. More...

#include <ES7243.h>

Public Member Functions

 ES7243 ()=default
 
error_t configI2S (codec_mode_t mode, I2SDefinition *iface)
 Configure ES7243 adc mode and I2S interface.
 
error_t ctrlStateActive (codec_mode_t mode, bool ctrl_state_active)
 Control ES7243 adc chip.
 
error_t deinit (void)
 Deinitialize ES7243 adc chip.
 
error_t getVoiceVolume (int *volume)
 Get adc gain (value of gain 0~100)
 
error_t init (codec_config_t *codec_cfg)
 Initialize ES7243 adc chip.
 
error_t mclkActive (GpioPin mclk_gpio)
 
void setAddress (int addr)
 Defines the I2C device address.
 
void setMclkGpio (GpioPin gpio)
 Defines the GPIO pin used to provide the MCLK signal.
 
error_t setVoiceMute (bool mute)
 Set mute.
 
error_t setVoiceVolume (int volume)
 Set adc gain (value of gain 0~100)
 
void setWire (i2c_bus_handle_t handle)
 Defines the I2C bus instance to be used.
 
error_t writeReg (uint8_t reg_add, uint8_t data)
 

Static Public Attributes

static constexpr int MCLK_PULSES_NUMBER = 20
 

Protected Attributes

int actual_volume = 0
 
uint8_t audio_format = 0x0C
 
int i2c_addr = 0x13
 
i2c_bus_handle_t i2c_handle = nullptr
 
GpioPin mclk_gpio = GPIO_UNDEFINED
 

Detailed Description

Header-only driver class for the ES7243 ADC chip.

Author
Phil Schatzmann

Constructor & Destructor Documentation

◆ ES7243()

ES7243 ( )
default

Member Function Documentation

◆ configI2S()

error_t configI2S ( codec_mode_t  mode,
I2SDefinition *  iface 
)
inline

Configure ES7243 adc mode and I2S interface.

◆ ctrlStateActive()

error_t ctrlStateActive ( codec_mode_t  mode,
bool  ctrl_state_active 
)
inline

Control ES7243 adc chip.

◆ deinit()

error_t deinit ( void  )
inline

Deinitialize ES7243 adc chip.

◆ getVoiceVolume()

error_t getVoiceVolume ( int *  volume)
inline

Get adc gain (value of gain 0~100)

◆ init()

error_t init ( codec_config_t *  codec_cfg)
inline

Initialize ES7243 adc chip.

◆ mclkActive()

error_t mclkActive ( GpioPin  mclk_gpio)
inline

◆ setAddress()

void setAddress ( int  addr)
inline

Defines the I2C device address.

◆ setMclkGpio()

void setMclkGpio ( GpioPin  gpio)
inline

Defines the GPIO pin used to provide the MCLK signal.

◆ setVoiceMute()

error_t setVoiceMute ( bool  mute)
inline

Set mute.

◆ setVoiceVolume()

error_t setVoiceVolume ( int  volume)
inline

Set adc gain (value of gain 0~100)

◆ setWire()

void setWire ( i2c_bus_handle_t  handle)
inline

Defines the I2C bus instance to be used.

◆ writeReg()

error_t writeReg ( uint8_t  reg_add,
uint8_t  data 
)
inline

Member Data Documentation

◆ actual_volume

int actual_volume = 0
protected

◆ audio_format

uint8_t audio_format = 0x0C
protected

◆ i2c_addr

int i2c_addr = 0x13
protected

◆ i2c_handle

i2c_bus_handle_t i2c_handle = nullptr
protected

◆ mclk_gpio

GpioPin mclk_gpio = GPIO_UNDEFINED
protected

◆ MCLK_PULSES_NUMBER

constexpr int MCLK_PULSES_NUMBER = 20
staticconstexpr

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