|
arduino-audio-driver
|
Header-only driver class for the ES8311 codec chip. More...
#include <ES8311.h>
Public Member Functions | |
| ES8311 ()=default | |
| error_t | configFmt (I2SDefinition fmt) |
| Configure ES8311 I2S format. | |
| error_t | configI2S (codec_mode_t mode, I2SDefinition *iface) |
| Configure ES8311 codec mode and I2S interface. | |
| error_t | ctrlStateActive (codec_mode_t mode, bool ctrl_state_active) |
| Control ES8311 codec chip. | |
| error_t | deinit () |
| Deinitialize ES8311 codec chip. | |
| int | getCoeff (uint32_t mclk, uint32_t rate) |
| look for the coefficient in es8311_coeff_div[] table | |
| int8_t | getMclkSrc (void) |
| error_t | getVoiceMute (int *mute) |
| Get ES8311 DAC mute status. | |
| error_t | getVoiceVolume (int *volume) |
| Get voice volume (0~100) | |
| error_t | init (codec_config_t *codec_cfg) |
| Initialize ES8311 codec chip. | |
| void | mute (int do_mute) |
| set es8311 dac mute (1) or unmute (0) | |
| void | readAll () |
| Print all ES8311 registers. | |
| int | readReg (uint8_t reg_addr) |
| void | setAddress (int addr) |
| Defines the I2C device address. | |
| error_t | setBitsPerSample (sample_bits_t bits) |
| Configure ES8311 data sample bits. | |
| void | setMclkSrc (int8_t src) |
| Defines the source of the master clock (FROM_MCLK_PIN or FROM_SCLK_PIN) | |
| error_t | setMicGain (es8311_mic_gain_t gain_db) |
| Set ES8311 mic gain. | |
| error_t | setVoiceMute (bool enable) |
| Configure ES8311 DAC mute or not. | |
| error_t | setVoiceVolume (int volume) |
| Set voice volume (0~100) | |
| void | setWire (i2c_bus_handle_t handle) |
| Defines the I2C bus instance to be used. | |
| error_t | start (codec_mode_t mode) |
| Start ES8311 codec chip. | |
| error_t | stop (codec_mode_t mode) |
| Stop ES8311 codec chip. | |
| void | suspend (void) |
| set es8311 into suspend mode | |
| error_t | writeReg (uint8_t reg_addr, uint8_t data) |
Static Public Member Functions | |
| static constexpr int | bitVal (int nr) |
Static Public Attributes | |
| static constexpr uint8_t | ES8311_ADC_REG15 = 0x15 |
| static constexpr uint8_t | ES8311_ADC_REG16 = 0x16 |
| static constexpr uint8_t | ES8311_ADC_REG17 = 0x17 |
| static constexpr uint8_t | ES8311_ADC_REG18 = 0x18 |
| static constexpr uint8_t | ES8311_ADC_REG19 = 0x19 |
| static constexpr uint8_t | ES8311_ADC_REG1A = 0x1A |
| static constexpr uint8_t | ES8311_ADC_REG1B = 0x1B |
| static constexpr uint8_t | ES8311_ADC_REG1C = 0x1C |
| static constexpr int | ES8311_ADDR = 0x18 |
| static constexpr uint8_t | ES8311_CHD1_REGFD = 0xFD |
| static constexpr uint8_t | ES8311_CHD2_REGFE = 0xFE |
| static constexpr uint8_t | ES8311_CHVER_REGFF = 0xFF |
| static constexpr uint8_t | ES8311_CLK_MANAGER_REG01 = 0x01 |
| static constexpr uint8_t | ES8311_CLK_MANAGER_REG02 = 0x02 |
| static constexpr uint8_t | ES8311_CLK_MANAGER_REG03 = 0x03 |
| static constexpr uint8_t | ES8311_CLK_MANAGER_REG04 = 0x04 |
| static constexpr uint8_t | ES8311_CLK_MANAGER_REG05 = 0x05 |
| static constexpr uint8_t | ES8311_CLK_MANAGER_REG06 = 0x06 |
| static constexpr uint8_t | ES8311_CLK_MANAGER_REG07 = 0x07 |
| static constexpr uint8_t | ES8311_CLK_MANAGER_REG08 = 0x08 |
| static constexpr uint8_t | ES8311_DAC_REG31 = 0x31 |
| static constexpr uint8_t | ES8311_DAC_REG32 = 0x32 |
| static constexpr uint8_t | ES8311_DAC_REG33 = 0x33 |
| static constexpr uint8_t | ES8311_DAC_REG34 = 0x34 |
| static constexpr uint8_t | ES8311_DAC_REG35 = 0x35 |
| static constexpr uint8_t | ES8311_DAC_REG37 = 0x37 |
| static constexpr uint8_t | ES8311_GP_REG45 = 0x45 |
| static constexpr uint8_t | ES8311_GPIO_REG44 = 0x44 |
| static constexpr uint8_t | ES8311_MAX_REGISTER = 0xFF |
| static constexpr uint8_t | ES8311_RESET_REG00 = 0x00 |
| static constexpr uint8_t | ES8311_SDPIN_REG09 = 0x09 |
| static constexpr uint8_t | ES8311_SDPOUT_REG0A = 0x0A |
| static constexpr uint8_t | ES8311_SYSTEM_REG0B = 0x0B |
| static constexpr uint8_t | ES8311_SYSTEM_REG0C = 0x0C |
| static constexpr uint8_t | ES8311_SYSTEM_REG0D = 0x0D |
| static constexpr uint8_t | ES8311_SYSTEM_REG0E = 0x0E |
| static constexpr uint8_t | ES8311_SYSTEM_REG0F = 0x0F |
| static constexpr uint8_t | ES8311_SYSTEM_REG10 = 0x10 |
| static constexpr uint8_t | ES8311_SYSTEM_REG11 = 0x11 |
| static constexpr uint8_t | ES8311_SYSTEM_REG12 = 0x12 |
| static constexpr uint8_t | ES8311_SYSTEM_REG13 = 0x13 |
| static constexpr uint8_t | ES8311_SYSTEM_REG14 = 0x14 |
| static constexpr int | FROM_MCLK_PIN = 0 |
| static constexpr int | FROM_SCLK_PIN = 1 |
| static constexpr int | INVERT_MCLK = 0 |
| static constexpr int | INVERT_SCLK = 0 |
| static constexpr int | IS_DMIC = 0 |
| static constexpr int | MCLK_DIV_FRE = 256 |
Protected Attributes | |
| int | i2c_addr = ES8311_ADDR |
| i2c_bus_handle_t | i2c_handle = nullptr |
| int8_t | mclk_src = 0 |
Header-only driver class for the ES8311 codec chip.
|
default |
|
inlinestaticconstexpr |
|
inline |
Configure ES8311 I2S format.
|
inline |
Configure ES8311 codec mode and I2S interface.
|
inline |
Control ES8311 codec chip.
|
inline |
look for the coefficient in es8311_coeff_div[] table
|
inline |
|
inline |
Get voice volume (0~100)
|
inline |
Initialize ES8311 codec chip.
|
inline |
set es8311 dac mute (1) or unmute (0)
|
inline |
Print all ES8311 registers.
|
inline |
|
inline |
Defines the I2C device address.
|
inline |
Configure ES8311 data sample bits.
|
inline |
Defines the source of the master clock (FROM_MCLK_PIN or FROM_SCLK_PIN)
|
inline |
Set ES8311 mic gain.
|
inline |
Set voice volume (0~100)
|
inline |
Defines the I2C bus instance to be used.
|
inline |
Start ES8311 codec chip.
|
inline |
Stop ES8311 codec chip.
|
inline |
set es8311 into suspend mode
|
inline |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
protected |
|
protected |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
protected |