|
arduino-audio-driver
|
Header-only driver class for the ES8388 codec chip. More...
#include <ES8388.h>
Public Member Functions | |
| ES8388 ()=default | |
| error_t | configFmt (codec_mode_t mod, i2s_format_t cfg) |
| Configure ES8388 I2S format. | |
| error_t | configI2S (codec_mode_t mode, I2SDefinition *iface) |
| Configure ES8388 codec mode and I2S interface. | |
| error_t | configInputDevice (es8388_input_device_t input) |
| Set ES8388 adc input mode. | |
| error_t | configOutputDevice (output_device_t output_device) |
| Set ES8388 dac output mode. | |
| error_t | ctrlStateActive (codec_mode_t mode, bool ctrl_state_active) |
| Control ES8388 codec chip. | |
| error_t | deinit (void) |
| Deinitialize ES8388 codec chip. | |
| error_t | getVoiceMute (void) |
| Get ES8388 DAC mute status. | |
| error_t | getVoiceVolume (int *volume) |
| Get voice volume (0~100) | |
| int | getVolumeHack () |
| Provides the volume hack in use. | |
| error_t | i2sConfigClock (es_i2s_clock_t cfg) |
| Configure I2S clock in MASTER mode. | |
| error_t | init (codec_config_t *cfg, int volumeHack) |
| Initialize ES8388 codec chip. | |
| void | readAll () |
| Print all ES8388 registers. | |
| error_t | readReg (uint8_t reg_add, uint8_t *p_data) |
| error_t | route (input_device_t in, output_device_t out) |
| Routes an analog input directly to an analog output, bypassing the ADC/DAC (e.g. for an analog monitoring/passthrough path). Only ADC_INPUT_LINE1 and ADC_INPUT_LINE2 are supported as input. | |
| error_t | routeIn2toOut1 () |
| Routes LIN2/RIN2 directly to LOUT1/ROUT1 (analog passthrough) | |
| error_t | setAdcDacVolume (int mode, int volume, int dot) |
| void | setAddress (int addr) |
| Defines the I2C device address. | |
| error_t | setBitsPerSample (codec_mode_t mode, sample_bits_t bit_per_sample) |
| Configure ES8388 data sample bits. | |
| error_t | setMicGain (es_mic_gain_t gain) |
| Set ES8388 mic gain. | |
| error_t | setVoiceMute (bool enable) |
| Configure ES8388 DAC mute or not. | |
| error_t | setVoiceVolume (int volume) |
| Set voice volume. | |
| error_t | setVoiceVolume0 (int volume) |
| error_t | setVoiceVolume1 (int volume) |
| error_t | setVoiceVolume2 (int volume) |
| void | setVolumeHack (int volumeHack) |
| Defines the volume hack to use (see AI_THINKER_ES8388_VOLUME_HACK) | |
| void | setWire (i2c_bus_handle_t handle) |
| Defines the I2C bus instance to be used. | |
| error_t | start (codec_mode_t mode) |
| Start ES8388 codec chip. | |
| error_t | stop (codec_mode_t mode) |
| Stop ES8388 codec chip. | |
| error_t | writeReg (uint8_t reg_add, uint8_t data) |
Static Public Attributes | |
| static constexpr uint8_t | ES8388_ADCCONTROL1 = 0x09 |
| static constexpr uint8_t | ES8388_ADCCONTROL10 = 0x12 |
| static constexpr uint8_t | ES8388_ADCCONTROL11 = 0x13 |
| static constexpr uint8_t | ES8388_ADCCONTROL12 = 0x14 |
| static constexpr uint8_t | ES8388_ADCCONTROL13 = 0x15 |
| static constexpr uint8_t | ES8388_ADCCONTROL14 = 0x16 |
| static constexpr uint8_t | ES8388_ADCCONTROL2 = 0x0a |
| static constexpr uint8_t | ES8388_ADCCONTROL3 = 0x0b |
| static constexpr uint8_t | ES8388_ADCCONTROL4 = 0x0c |
| static constexpr uint8_t | ES8388_ADCCONTROL5 = 0x0d |
| static constexpr uint8_t | ES8388_ADCCONTROL6 = 0x0e |
| static constexpr uint8_t | ES8388_ADCCONTROL7 = 0x0f |
| static constexpr uint8_t | ES8388_ADCCONTROL8 = 0x10 |
| static constexpr uint8_t | ES8388_ADCCONTROL9 = 0x11 |
| static constexpr uint8_t | ES8388_ADCPOWER = 0x03 |
| static constexpr int | ES8388_ADDR = 0x10 |
| static constexpr uint8_t | ES8388_ANAVOLMANAG = 0x07 |
| static constexpr uint8_t | ES8388_CHIPLOPOW1 = 0x05 |
| static constexpr uint8_t | ES8388_CHIPLOPOW2 = 0x06 |
| static constexpr uint8_t | ES8388_CHIPPOWER = 0x02 |
| static constexpr uint8_t | ES8388_CONTROL1 = 0x00 |
| static constexpr uint8_t | ES8388_CONTROL2 = 0x01 |
| static constexpr uint8_t | ES8388_DACCONTROL1 = 0x17 |
| static constexpr uint8_t | ES8388_DACCONTROL10 = 0x20 |
| static constexpr uint8_t | ES8388_DACCONTROL11 = 0x21 |
| static constexpr uint8_t | ES8388_DACCONTROL12 = 0x22 |
| static constexpr uint8_t | ES8388_DACCONTROL13 = 0x23 |
| static constexpr uint8_t | ES8388_DACCONTROL14 = 0x24 |
| static constexpr uint8_t | ES8388_DACCONTROL15 = 0x25 |
| static constexpr uint8_t | ES8388_DACCONTROL16 = 0x26 |
| static constexpr uint8_t | ES8388_DACCONTROL17 = 0x27 |
| static constexpr uint8_t | ES8388_DACCONTROL18 = 0x28 |
| static constexpr uint8_t | ES8388_DACCONTROL19 = 0x29 |
| static constexpr uint8_t | ES8388_DACCONTROL2 = 0x18 |
| static constexpr uint8_t | ES8388_DACCONTROL20 = 0x2a |
| static constexpr uint8_t | ES8388_DACCONTROL21 = 0x2b |
| static constexpr uint8_t | ES8388_DACCONTROL22 = 0x2c |
| static constexpr uint8_t | ES8388_DACCONTROL23 = 0x2d |
| static constexpr uint8_t | ES8388_DACCONTROL24 = 0x2e |
| static constexpr uint8_t | ES8388_DACCONTROL25 = 0x2f |
| static constexpr uint8_t | ES8388_DACCONTROL26 = 0x30 |
| static constexpr uint8_t | ES8388_DACCONTROL27 = 0x31 |
| static constexpr uint8_t | ES8388_DACCONTROL28 = 0x32 |
| static constexpr uint8_t | ES8388_DACCONTROL29 = 0x33 |
| static constexpr uint8_t | ES8388_DACCONTROL3 = 0x19 |
| static constexpr uint8_t | ES8388_DACCONTROL30 = 0x34 |
| static constexpr uint8_t | ES8388_DACCONTROL4 = 0x1a |
| static constexpr uint8_t | ES8388_DACCONTROL5 = 0x1b |
| static constexpr uint8_t | ES8388_DACCONTROL6 = 0x1c |
| static constexpr uint8_t | ES8388_DACCONTROL7 = 0x1d |
| static constexpr uint8_t | ES8388_DACCONTROL8 = 0x1e |
| static constexpr uint8_t | ES8388_DACCONTROL9 = 0x1f |
| static constexpr uint8_t | ES8388_DACPOWER = 0x04 |
| static constexpr uint8_t | ES8388_MASTERMODE = 0x08 |
Protected Attributes | |
| int | dac_power = 0x3c |
| int | i2c_addr = ES8388_ADDR |
| i2c_bus_handle_t | i2c_handle = nullptr |
| int | volume_hack = AI_THINKER_ES8388_VOLUME_HACK |
Header-only driver class for the ES8388 codec chip.
|
default |
|
inline |
Configure ES8388 I2S format.
|
inline |
Configure ES8388 codec mode and I2S interface.
|
inline |
Set ES8388 adc input mode.
|
inline |
Set ES8388 dac output mode.
|
inline |
Control ES8388 codec chip.
|
inline |
Get voice volume (0~100)
|
inline |
Provides the volume hack in use.
|
inline |
Configure I2S clock in MASTER mode.
|
inline |
Initialize ES8388 codec chip.
|
inline |
Print all ES8388 registers.
|
inline |
|
inline |
Routes an analog input directly to an analog output, bypassing the ADC/DAC (e.g. for an analog monitoring/passthrough path). Only ADC_INPUT_LINE1 and ADC_INPUT_LINE2 are supported as input.
| in | ADC_INPUT_LINE1 or ADC_INPUT_LINE2 |
| out | DAC_OUTPUT_NONE, DAC_OUTPUT_LINE1, DAC_OUTPUT_LINE2 or DAC_OUTPUT_ALL see https://m5stack-doc.oss-cn-shenzhen.aliyuncs.com/1141/ES8388.pdf |
|
inline |
Routes LIN2/RIN2 directly to LOUT1/ROUT1 (analog passthrough)
|
inline |
|
inline |
Defines the I2C device address.
|
inline |
Configure ES8388 data sample bits.
|
inline |
Set ES8388 mic gain.
|
inline |
Set voice volume.
| volume | voice volume (0~100) |
|
inline |
|
inline |
|
inline |
|
inline |
Defines the volume hack to use (see AI_THINKER_ES8388_VOLUME_HACK)
|
inline |
Defines the I2C bus instance to be used.
|
inline |
Start ES8388 codec chip.
|
inline |
Stop ES8388 codec chip.
|
inline |
|
protected |
|
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 |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
protected |
|
protected |
|
protected |