cleanup code

Signed-off-by: imliubo <imliubo@makingfun.xyz>
This commit is contained in:
imliubo
2024-12-26 13:35:31 +08:00
parent 9626b0b71b
commit 76990c8c0e
4 changed files with 17 additions and 18 deletions

View File

@@ -28,7 +28,7 @@ CoreS3AudioCodec::CoreS3AudioCodec(void* i2c_master_handle, int input_sample_rat
data_if_ = audio_codec_new_i2s_data(&i2s_cfg);
assert(data_if_ != NULL);
// Output
// Audio Output(Speaker)
audio_codec_i2c_cfg_t i2c_cfg = {
.port = (i2c_port_t)1,
.addr = aw88298_addr,
@@ -58,7 +58,7 @@ CoreS3AudioCodec::CoreS3AudioCodec(void* i2c_master_handle, int input_sample_rat
output_dev_ = esp_codec_dev_new(&dev_cfg);
assert(output_dev_ != NULL);
// Input
// Audio Input(Microphone)
i2c_cfg.addr = es7210_addr;
in_ctrl_if_ = audio_codec_new_i2c_ctrl(&i2c_cfg);
assert(in_ctrl_if_ != NULL);

View File

@@ -1,6 +1,8 @@
#ifndef _BOARD_CONFIG_H_
#define _BOARD_CONFIG_H_
// M5Stack CoreS3 Board configuration
#include <driver/gpio.h>
#define AUDIO_INPUT_REFERENCE true

View File

@@ -18,6 +18,7 @@
class Axp2101 : public I2cDevice {
public:
// Power Init
Axp2101(i2c_master_bus_handle_t i2c_bus, uint8_t addr) : I2cDevice(i2c_bus, addr) {
uint8_t data = ReadReg(0x90);
data |= 0b10110100;
@@ -26,7 +27,6 @@ public:
WriteReg(0x97, (0b11110 - 2));
WriteReg(0x69, 0b00110101);
WriteReg(0x30, 0b111111);
WriteReg(0x90, 0xBF);
WriteReg(0x94, 33 - 5);
WriteReg(0x95, 33 - 5);
@@ -35,11 +35,9 @@ public:
class Aw9523 : public I2cDevice {
public:
// Exanpd IO Init
Aw9523(i2c_master_bus_handle_t i2c_bus, uint8_t addr) : I2cDevice(i2c_bus, addr) {
// WriteReg(0x02, 0b00000101); // P0
// WriteReg(0x03, 0b00000011); // P1
WriteReg(0x02, 0b00000111); // P0
// WriteReg(0x03, 0b10000011); // P1
WriteReg(0x03, 0b10001111); // P1
WriteReg(0x04, 0b00011000); // CONFIG_P0
WriteReg(0x05, 0b00001100); // CONFIG_P1
@@ -247,7 +245,6 @@ private:
public:
M5StackCoreS3Board() : boot_button_(GPIO_NUM_1) {
// M5StackCoreS3Board() {
InitializeI2c();
InitializeAxp2101();
InitializeAw9523();

View File

@@ -1,16 +1,16 @@
## IDF Component Manager Manifest File
dependencies:
78/esp-wifi-connect: ~1.4.1
78/esp-opus-encoder: ~2.0.0
78/esp-ml307: ~1.7.0
espressif/led_strip: ^2.4.1
espressif/esp_codec_dev: ~1.3.2
espressif/esp-sr: ^1.9.0
espressif/button: ^3.3.1
lvgl/lvgl: ~8.4.0
esp_lvgl_port: ~2.4.1
espressif/esp_lcd_ili9341: "==1.0.0"
78/esp-wifi-connect: "~1.4.1"
78/esp-opus-encoder: "~2.0.0"
78/esp-ml307: "~1.7.0"
espressif/led_strip: "^2.4.1"
espressif/esp_codec_dev: "~1.3.2"
espressif/esp-sr: "^1.9.0"
espressif/button: "^3.3.1"
lvgl/lvgl: "~8.4.0"
esp_lvgl_port: "~2.4.1"
## Required IDF version
idf:
version: '>=5.3'
version: ">=5.3"
espressif/esp_lcd_ili9341: ==1.0.0