4b7f82c38f
- Re-apply input-gain-percent (100 = no digital boost) + 42dB HW max mapping lost in the upstream merge (was 340953b1/7788415e) - es3c35p: lvgl.fontSize=16 (text 12/16/22, launcher icons 42) - Add flash-es3c.sh build+flash helper for 28p/35p
41 lines
1.2 KiB
C
41 lines
1.2 KiB
C
// SPDX-License-Identifier: Apache-2.0
|
|
#pragma once
|
|
|
|
#include <stdint.h>
|
|
#include <stdbool.h>
|
|
#include <tactility/error.h>
|
|
#include <tactility/drivers/audio_codec.h>
|
|
|
|
struct Device;
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/**
|
|
* @brief ES8311 codec device configuration.
|
|
*
|
|
* The ES8311 is wired as both control (I2C) and audio (I2S) device: the I2C
|
|
* bus is the device's parent (per i2c-device.yaml), while the I2S controller
|
|
* is referenced via a devicetree phandle. It operates in dual mode
|
|
* (speaker output + mic input) on boards such as M5Stack StickS3.
|
|
*/
|
|
struct Es8311Config {
|
|
/** I2C address on the bus (typically 0x18) */
|
|
uint8_t address;
|
|
/** I2S controller device that carries audio data */
|
|
struct Device* i2s_device;
|
|
/**
|
|
* Extra fixed digital gain multiplier applied by audio_stream on top of the ES8311's
|
|
* own hardware ADC gain (0..42dB), as an integer percentage (100 = 1.0x / no extra boost).
|
|
* Small MEMS mic capsules can still sound quiet even near max hardware gain; this is for
|
|
* boards where 42dB hardware gain alone isn't enough. devicetree has no float property type,
|
|
* hence the x100 integer encoding.
|
|
*/
|
|
uint16_t input_gain_percent;
|
|
};
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|