Skip to content

Commit

Permalink
Merge branch 'feature/support_aw88298_for_codec_dev' into 'master'
Browse files Browse the repository at this point in the history
esp_codec_dev: Support aw88298 audio amplifier

See merge request adf/esp-adf-internal!1277
  • Loading branch information
jason-mao committed Feb 23, 2024
2 parents 1b9d7ef + 96c1a72 commit 33ba0c5
Show file tree
Hide file tree
Showing 13 changed files with 523 additions and 15 deletions.
7 changes: 1 addition & 6 deletions components/audio_hal/driver/es8311/es8311.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,13 +262,9 @@ static void es8311_mute(int mute)
ESP_LOGI(TAG, "Enter into es8311_mute(), mute = %d\n", mute);
regv = es8311_read_reg(ES8311_DAC_REG31) & 0x9f;
if (mute) {
es8311_write_reg(ES8311_SYSTEM_REG12, 0x02);
es8311_write_reg(ES8311_DAC_REG31, regv | 0x60);
es8311_write_reg(ES8311_DAC_REG32, 0x00);
es8311_write_reg(ES8311_DAC_REG37, 0x08);
} else {
es8311_write_reg(ES8311_DAC_REG31, regv);
es8311_write_reg(ES8311_SYSTEM_REG12, 0x00);
}
}

Expand All @@ -285,7 +281,6 @@ static void es8311_suspend(void)
es8311_write_reg(ES8311_SYSTEM_REG14, 0x00);
es8311_write_reg(ES8311_SYSTEM_REG0D, 0xFA);
es8311_write_reg(ES8311_ADC_REG15, 0x00);
es8311_write_reg(ES8311_DAC_REG37, 0x08);
es8311_write_reg(ES8311_GP_REG45, 0x01);
}

Expand Down Expand Up @@ -668,7 +663,7 @@ esp_err_t es8311_start(es_module_t mode)

ret |= es8311_write_reg(ES8311_SYSTEM_REG0D, 0x01);
ret |= es8311_write_reg(ES8311_ADC_REG15, 0x40);
ret |= es8311_write_reg(ES8311_DAC_REG37, 0x48);
ret |= es8311_write_reg(ES8311_DAC_REG37, 0x08);
ret |= es8311_write_reg(ES8311_GP_REG45, 0x00);

/* set internal reference signal (ADCL + DACR) */
Expand Down
4 changes: 4 additions & 0 deletions components/esp_codec_dev/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ if (CONFIG_CODEC_ES8374_SUPPORT)
list(APPEND COMPONENT_SRCS device/es8374/es8374.c)
endif()

if (CONFIG_CODEC_AW88298_SUPPORT)
list(APPEND COMPONENT_SRCS device/aw88298/aw88298.c)
endif()

if (CONFIG_CODEC_ZL38063_SUPPORT)
list(APPEND COMPONENT_SRCS device/zl38063/zl38063.c
device/zl38063/api_lib/vprocTwolf_access.c
Expand Down
6 changes: 6 additions & 0 deletions components/esp_codec_dev/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ menu "Audio Codec Device Configuration"
help
Enable this option to support codec ES8156.

config CODEC_AW88298_SUPPORT
bool "Support AW88298 Codec Chip"
default y
help
Enable this option to support codec AW88298.

config CODEC_ES8374_SUPPORT
bool "Support ES8374 Codec Chip"
default y
Expand Down
1 change: 1 addition & 0 deletions components/esp_codec_dev/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ The currently supported codec devices are listed as below:
|ES8374 |Y|Y|
|ZL38063 |Y|Y|
|TAS6805M |Y|N|
|AW88298 |Y|N|
|ES7210 |N|Y|
|ES7243 |N|Y|
|ES7243E |N|Y|
Expand Down
1 change: 1 addition & 0 deletions components/esp_codec_dev/README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
|ES8374 |Y|Y|
|ZL38063 |Y|Y|
|TAS6805M |Y|N|
|AW88298 |Y|N|
|ES7210 |N|Y|
|ES7243 |N|Y|
|ES7243E |N|Y|
Expand Down
Loading

0 comments on commit 33ba0c5

Please sign in to comment.