From 28e24d5bde8855fa330119cb3bf896a72514617e Mon Sep 17 00:00:00 2001 From: Andriy Malyshenko Date: Wed, 19 Nov 2025 11:26:49 +0100 Subject: [PATCH 01/58] TAS5805M driver improvements. Sleep mode when mute. State object for DAC state tracking. Added debug logging. --- .../custom_board/tas5805m/include/tas5805m.h | 59 ++----- components/custom_board/tas5805m/tas5805m.c | 149 +++++++----------- 2 files changed, 73 insertions(+), 135 deletions(-) diff --git a/components/custom_board/tas5805m/include/tas5805m.h b/components/custom_board/tas5805m/include/tas5805m.h index e9d718c5..e7f1f9bd 100644 --- a/components/custom_board/tas5805m/include/tas5805m.h +++ b/components/custom_board/tas5805m/include/tas5805m.h @@ -42,14 +42,11 @@ extern "C" { #define I2C_MASTER_RX_BUF_DISABLE 0 /*!< I2C master doesn't need buffer */ #define I2C_MASTER_TIMEOUT_MS 1000 -#define TAS5805M_VOLUME_MUTE 0xff // (-103.5 dB - actual mute) -#define TAS5805M_VOLUME_MIN 0xa8 // ( -60 dB - save value representing barely hearable volume) -#define TAS5805M_VOLUME_MAX 0x30 // ( 0 dB - maximum volume that guarantees no distortion ) -/* -// TODO: make it available for user configuration -#define TAS5805M_REG_VOLUME_MAX 0x00 // (+24 dB - maximum volume that DAC can do) -*/ +/* Represented in % */ +#define TAS5805M_VOLUME_MIN 0 +#define TAS5805M_VOLUME_MAX 100 +#define TAS5805M_VOLUME_MUTE 255 /* See here for the original Implementation : audio_hal/driver/tas5805m */ /* Its not from me it was developed by Espressif */ /* Volume steps tas5805m_volume[0] => 255 which means mute */ @@ -57,19 +54,17 @@ static const uint8_t tas5805m_volume[] = { 0xff, 0x9f, 0x8f, 0x7f, 0x6f, 0x5f, 0x5c, 0x5a, 0x58, 0x54, 0x50, 0x4c, 0x4a, 0x48, 0x44, 0x40, 0x3d, 0x3b, 0x39, 0x37, 0x35}; - typedef enum { TAS5805M_CTRL_DEEP_SLEEP = 0x00, // Deep Sleep TAS5805M_CTRL_SLEEP = 0x01, // Sleep TAS5805M_CTRL_HI_Z = 0x02, // Hi-Z TAS5805M_CTRL_PLAY = 0x03, // Play - TAS5805M_CTRL_MUTE = 0x08, // Mute Flag - // Mute, but driver in PLAY state - TAS5805M_CTRL_PLAY_MUTE = TAS5805M_CTRL_MUTE | TAS5805M_CTRL_PLAY + TAS5805M_CTRL_MUTE = 0x08 | TAS5805M_CTRL_PLAY // Mute + Play } TAS5805M_CTRL_STATE; typedef struct { - int8_t volume; + bool mute; + int8_t volume; TAS5805M_CTRL_STATE state; } TAS5805_STATE; @@ -128,23 +123,6 @@ esp_err_t tas5805m_get_volume(int *vol); */ esp_err_t tas5805m_set_mute(bool enable); -/** - * @brief Get TAS5805 mute status - * - * @return - * - ESP_FAIL Parameter error - * - ESP_OK Success - */ -esp_err_t tas5805m_get_mute(bool *enabled); - -/** - * @brief Get cached TAS5805 state - * - * @param[out] out_state pointer to TAS5805_STATE to receive cached values - * @return ESP_OK or error - */ -esp_err_t tas5805m_get_state(TAS5805_STATE *out_state); - /** * @brief Set the state of the TAS5805M * @@ -154,26 +132,17 @@ esp_err_t tas5805m_get_state(TAS5805_STATE *out_state); esp_err_t tas5805m_set_state(TAS5805M_CTRL_STATE state); /** - * @brief Control the TAS5805 codec chip - * - * @param mode: codec mode - * @param ctrl_state: control state + * @brief Get TAS5805 mute status * - * @return - * - ESP_OK - * - ESP_FAIL - */ + * @return + * - ESP_FAIL Parameter error + * - ESP_OK Success + */ +esp_err_t tas5805m_get_mute(bool *enabled); + esp_err_t tas5805m_ctrl(audio_hal_codec_mode_t mode, audio_hal_ctrl_t ctrl_state); -/** - * @brief Configure the I2S interface of TAS5805 codec chip - * @param mode: codec mode - * @param iface: I2S interface configuration - * @return - * - ESP_OK - * - ESP_FAIL - */ esp_err_t tas5805m_config_iface(audio_hal_codec_mode_t mode, audio_hal_codec_i2s_iface_t *iface); diff --git a/components/custom_board/tas5805m/tas5805m.c b/components/custom_board/tas5805m/tas5805m.c index 4c77e28b..cd0a35df 100644 --- a/components/custom_board/tas5805m/tas5805m.c +++ b/components/custom_board/tas5805m/tas5805m.c @@ -32,10 +32,11 @@ static const char *TAG = "TAS5805M"; -// State of TAS5805M (internal to this module) -static TAS5805_STATE tas5805m_state = { - .volume = 0, - .state = TAS5805M_CTRL_PLAY, +// State of TAS5805M +TAS5805_STATE tas5805m_state = { + .mute = false, + .volume = 0, + .state = TAS5805M_CTRL_PLAY, }; /* Default I2C config */ @@ -108,7 +109,7 @@ esp_err_t tas5805m_read_byte(uint8_t register_name, uint8_t *data) { // Writing of TAS5805M-Register esp_err_t tas5805m_write_byte(uint8_t register_name, uint8_t value) { int ret = 0; - ESP_LOGV(TAG, "%s: Writing 0x%02x to register 0x%02x", __func__, value, register_name); + ESP_LOGD(TAG, "%s: Writing 0x%02x to register 0x%02x", __func__, value, register_name); i2c_cmd_handle_t cmd = i2c_cmd_link_create(); i2c_master_start(cmd); @@ -160,14 +161,16 @@ esp_err_t tas5805m_init() { return ret; } - ESP_LOGW(TAG, "%s: Setting to PLAY (muted)", __func__); + ESP_LOGW(TAG, "%s: Setting to PLAY", __func__); - ESP_ERROR_CHECK(tas5805m_set_state(TAS5805M_CTRL_MUTE | TAS5805M_CTRL_PLAY)); + ESP_ERROR_CHECK(tas5805m_set_state(TAS5805M_CTRL_PLAY)); if (ret != ESP_OK) { ESP_LOGW(TAG, "%s: Set DAC state failed", __func__); return ret; } + tas5805m_state.mute = false; + // Check if Bridge-Mode is enabled #if defined(CONFIG_DAC_BRIDGE_MODE_MONO) || defined(CONFIG_DAC_BRIDGE_MODE_LEFT) || defined(CONFIG_DAC_BRIDGE_MODE_RIGHT) ESP_LOGD(TAG, "%s: Setting Bridge-Mode", __func__); @@ -250,76 +253,51 @@ esp_err_t tas5805m_init() { return ret; } -// Getting cached TAS5805 state -esp_err_t tas5805m_get_state(TAS5805_STATE *out_state) -{ - *out_state = tas5805m_state; - return ESP_OK; -} - // Setting the DAC State of TAS5805M esp_err_t tas5805m_set_state(TAS5805M_CTRL_STATE state) { - ESP_LOGD(TAG, "%s: Setting state to 0x%x", __func__, state); - esp_err_t ret = tas5805m_write_byte(TAS5805M_DEVICE_CTRL_2_REGISTER, state); - if (ret == ESP_OK) { - /* Update in-memory state only after successful device write */ - tas5805m_state.state = state; - } else { - ESP_LOGW(TAG, "%s: Failed to set device state (0x%x): %s", __func__, state, esp_err_to_name(ret)); - } - return ret; + ESP_LOGD(TAG, "%s: Setting state to %d", __func__, state); + tas5805m_state.state = state; + return tas5805m_write_byte(TAS5805M_DEVICE_CTRL_2_REGISTER, state); } // Setting the Volume esp_err_t tas5805m_set_volume(int vol) { ESP_LOGD(TAG, "%s: Setting volume to %d", __func__, vol); - /* Clamp input percent to [0..100] */ - if (vol < 0) vol = 0; - if (vol > 100) vol = 100; - - /* If percent is zero, map to the explicit MUTE register value regardless of reg_min - * Otherwise map linearly between register min and max. This preserves behaviour when - * TAS5805M_VOLUME_MIN isn't 0xff while ensuring vol==0 always mutes. - */ - uint8_t reg_val = 0; - if (vol == 0) { - reg_val = (uint8_t)TAS5805M_VOLUME_MUTE; - } else { - /* Map linear percent (1..100) to register range (TAS5805M_VOLUME_MIN..TAS5805M_VOLUME_MAX) - * Note: register ordering may be descending (higher register = quieter). Formula handles that. - */ - int32_t reg_min = (int32_t)TAS5805M_VOLUME_MIN; - int32_t reg_max = (int32_t)TAS5805M_VOLUME_MAX; - int32_t diff = reg_max - reg_min; /* may be negative */ - int32_t numer = diff * vol; - /* integer rounding toward nearest */ - int32_t adj = (numer >= 0) ? (numer + 50) / 100 : (numer - 50) / 100; - reg_val = (uint8_t)(reg_min + adj); - } + int vol_idx = 0; // Temp-Variable - /* Writing the Volume to the Register*/ - esp_err_t ret = tas5805m_write_byte(TAS5805M_DIG_VOL_CTRL_REGISTER, reg_val); - if (ret == ESP_OK) { - tas5805m_state.volume = vol; - } else { - ESP_LOGW(TAG, "%s: Failed to write volume (reg 0x%02x): %s", __func__, reg_val, esp_err_to_name(ret)); + /* Checking if Volume is bigger or smaller than the max values */ + if (vol < TAS5805M_VOLUME_MIN) { + vol = TAS5805M_VOLUME_MIN; } - return ret; + if (vol > TAS5805M_VOLUME_MAX) { + vol = TAS5805M_VOLUME_MAX; + } + /* Mapping the Values from 0-100 to 254-0 */ + vol_idx = vol / 5; + /* Updating the global volume Variable */ + tas5805m_state.volume = vol_idx; + /* Writing the Volume to the Register*/ + return tas5805m_write_byte(TAS5805M_DIG_VOL_CTRL_REGISTER, + tas5805m_volume[vol_idx]); } -// Getting the Volume esp_err_t tas5805m_get_volume(int *vol) { - if (vol == NULL) { - return ESP_ERR_INVALID_ARG; + esp_err_t ret = ESP_OK; + uint8_t rxbuf = 0; + ret = tas5805m_read_byte(TAS5805M_DIG_VOL_CTRL_REGISTER, &rxbuf); + int i; + for (i = 0; i < sizeof(tas5805m_volume); i++) { + if (rxbuf >= tas5805m_volume[i]) break; } - - *vol = tas5805m_state.volume; - ESP_LOGD(TAG, "%s: Getting volume (cached): %d", __func__, *vol); - return ESP_OK; + + /* Updating the global volume Variable */ + tas5805m_state.volume = i; + ESP_LOGD(TAG, "%s: Getting volume: %d", __func__, i * 5); + *vol = 5 * i; // Converting it to percent + return ret; } -// Deinit the TAS5805M esp_err_t tas5805m_deinit(void) { ESP_ERROR_CHECK(tas5805m_set_state(TAS5805M_CTRL_HI_Z)); gpio_set_level(TAS5805M_GPIO_PDN, 0); @@ -327,49 +305,40 @@ esp_err_t tas5805m_deinit(void) { return ESP_OK; } -// Setting mute state esp_err_t tas5805m_set_mute(bool enable) { ESP_LOGD(TAG, "%s: Setting mute to %d", __func__, enable); - TAS5805M_CTRL_STATE new_state; - if (enable) { - new_state = (TAS5805M_CTRL_STATE)(tas5805m_state.state | TAS5805M_CTRL_MUTE); - } else { - new_state = (TAS5805M_CTRL_STATE)(tas5805m_state.state & ~TAS5805M_CTRL_MUTE); + if (tas5805m_state.mute != enable) { + tas5805m_state.mute = enable; + return tas5805m_set_state(enable ? TAS5805M_CTRL_MUTE : TAS5805M_CTRL_PLAY); } - /* Use existing set_state helper which writes-first and updates cache on success */ - return tas5805m_set_state(new_state); + return ESP_OK; } -// Getting mute state esp_err_t tas5805m_get_mute(bool *enabled) { - bool mute = tas5805m_state.state & TAS5805M_CTRL_MUTE; - ESP_LOGD(TAG, "%s: Getting mute: %d", __func__, mute); - *enabled = mute; + ESP_LOGD(TAG, "%s: Getting mute: %d", __func__, tas5805m_state.mute); + *enabled = tas5805m_state.mute; return ESP_OK; } -// Control function of TAS5805M esp_err_t tas5805m_ctrl(audio_hal_codec_mode_t mode, audio_hal_ctrl_t ctrl_state) { - ESP_LOGI(TAG, "%s: Control state: %d", __func__, ctrl_state); - TAS5805M_CTRL_STATE new_state; - + esp_err_t ret; if (ctrl_state == AUDIO_HAL_CTRL_STOP) { - ESP_LOGD(TAG, "%s: Setting to DEEP_SLEEP", __func__); - /* Clear lower 3 bits (state field) then set to DEEP_SLEEP (0x0) - * This ensures lower bits are reset to 0 as required by the device. - */ - new_state = (TAS5805M_CTRL_STATE)((tas5805m_state.state & ~0x07) | TAS5805M_CTRL_DEEP_SLEEP); - } else if (ctrl_state == AUDIO_HAL_CTRL_START ) { - ESP_LOGD(TAG, "%s: Setting to PLAY", __func__); - /* Clear lower 3 bits (state field) and set to PLAY (0x3), preserve other flags */ - new_state = (TAS5805M_CTRL_STATE)((tas5805m_state.state & ~0x07) | TAS5805M_CTRL_PLAY); + // set deepsleep + ESP_LOGI(TAG, "%s: Setting to DEEP_SLEEP", __func__); + ret = tas5805m_set_state(TAS5805M_CTRL_DEEP_SLEEP); + //ret = tas5805m_write_byte(TAS5805M_DEVICE_CTRL_2_REGISTER, + // TAS5805M_CTRL_DEEP_SLEEP + 0x08*mute); + } else { - ESP_LOGW(TAG, "%s: Unknown control state: %d", __func__, ctrl_state); - return ESP_FAIL; + ESP_LOGI(TAG, "%s: Setting to HI_Z", __func__); + ret = tas5805m_set_state(TAS5805M_CTRL_HI_Z); + vTaskDelay(1 / portTICK_PERIOD_MS); + ESP_LOGI(TAG, "%s: Setting to PLAY", __func__); + ret |= tas5805m_set_state(TAS5805M_CTRL_PLAY); } - - return tas5805m_set_state(new_state); + + return ret; } esp_err_t tas5805m_config_iface(audio_hal_codec_mode_t mode, From 048fdc3bb615ccd7428eba397fd2150307ceea47 Mon Sep 17 00:00:00 2001 From: Andriy Malyshenko Date: Wed, 19 Nov 2025 11:33:21 +0100 Subject: [PATCH 02/58] Set correct mute flag on DAC restore --- components/custom_board/tas5805m/tas5805m.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/components/custom_board/tas5805m/tas5805m.c b/components/custom_board/tas5805m/tas5805m.c index cd0a35df..283f1db8 100644 --- a/components/custom_board/tas5805m/tas5805m.c +++ b/components/custom_board/tas5805m/tas5805m.c @@ -324,18 +324,15 @@ esp_err_t tas5805m_ctrl(audio_hal_codec_mode_t mode, audio_hal_ctrl_t ctrl_state) { esp_err_t ret; if (ctrl_state == AUDIO_HAL_CTRL_STOP) { - // set deepsleep ESP_LOGI(TAG, "%s: Setting to DEEP_SLEEP", __func__); ret = tas5805m_set_state(TAS5805M_CTRL_DEEP_SLEEP); - //ret = tas5805m_write_byte(TAS5805M_DEVICE_CTRL_2_REGISTER, - // TAS5805M_CTRL_DEEP_SLEEP + 0x08*mute); } else { ESP_LOGI(TAG, "%s: Setting to HI_Z", __func__); ret = tas5805m_set_state(TAS5805M_CTRL_HI_Z); vTaskDelay(1 / portTICK_PERIOD_MS); ESP_LOGI(TAG, "%s: Setting to PLAY", __func__); - ret |= tas5805m_set_state(TAS5805M_CTRL_PLAY); + ret |= tas5805m_set_state(tas5805m_state.mute ? TAS5805M_CTRL_MUTE : TAS5805M_CTRL_PLAY); } return ret; From 515dacafdfd2ebfb2911b3c932d5dd70640418bc Mon Sep 17 00:00:00 2001 From: Andriy Malyshenko Date: Thu, 20 Nov 2025 15:29:51 +0100 Subject: [PATCH 03/58] Added revised state changes: independent MUTE flasg and DAC power mode --- .../custom_board/tas5805m/include/tas5805m.h | 45 +++++++-- components/custom_board/tas5805m/tas5805m.c | 97 ++++++++++++------- 2 files changed, 98 insertions(+), 44 deletions(-) diff --git a/components/custom_board/tas5805m/include/tas5805m.h b/components/custom_board/tas5805m/include/tas5805m.h index e7f1f9bd..41c252b3 100644 --- a/components/custom_board/tas5805m/include/tas5805m.h +++ b/components/custom_board/tas5805m/include/tas5805m.h @@ -59,12 +59,11 @@ typedef enum { TAS5805M_CTRL_SLEEP = 0x01, // Sleep TAS5805M_CTRL_HI_Z = 0x02, // Hi-Z TAS5805M_CTRL_PLAY = 0x03, // Play - TAS5805M_CTRL_MUTE = 0x08 | TAS5805M_CTRL_PLAY // Mute + Play + TAS5805M_CTRL_MUTE = 0x08 // Mute Flag } TAS5805M_CTRL_STATE; typedef struct { - bool mute; - int8_t volume; + int8_t volume; TAS5805M_CTRL_STATE state; } TAS5805_STATE; @@ -123,6 +122,23 @@ esp_err_t tas5805m_get_volume(int *vol); */ esp_err_t tas5805m_set_mute(bool enable); +/** + * @brief Get TAS5805 mute status + * + * @return + * - ESP_FAIL Parameter error + * - ESP_OK Success + */ +esp_err_t tas5805m_get_mute(bool *enabled); + +/** + * @brief Get cached TAS5805 state + * + * @param[out] out_state pointer to TAS5805_STATE to receive cached values + * @return ESP_OK or error + */ +esp_err_t tas5805m_get_state(TAS5805_STATE *out_state); + /** * @brief Set the state of the TAS5805M * @@ -132,17 +148,26 @@ esp_err_t tas5805m_set_mute(bool enable); esp_err_t tas5805m_set_state(TAS5805M_CTRL_STATE state); /** - * @brief Get TAS5805 mute status + * @brief Control the TAS5805 codec chip * - * @return - * - ESP_FAIL Parameter error - * - ESP_OK Success - */ -esp_err_t tas5805m_get_mute(bool *enabled); - + * @param mode: codec mode + * @param ctrl_state: control state + * + * @return + * - ESP_OK + * - ESP_FAIL + */ esp_err_t tas5805m_ctrl(audio_hal_codec_mode_t mode, audio_hal_ctrl_t ctrl_state); +/** + * @brief Configure the I2S interface of TAS5805 codec chip + * @param mode: codec mode + * @param iface: I2S interface configuration + * @return + * - ESP_OK + * - ESP_FAIL + */ esp_err_t tas5805m_config_iface(audio_hal_codec_mode_t mode, audio_hal_codec_i2s_iface_t *iface); diff --git a/components/custom_board/tas5805m/tas5805m.c b/components/custom_board/tas5805m/tas5805m.c index 283f1db8..bc8bc93d 100644 --- a/components/custom_board/tas5805m/tas5805m.c +++ b/components/custom_board/tas5805m/tas5805m.c @@ -32,11 +32,10 @@ static const char *TAG = "TAS5805M"; -// State of TAS5805M -TAS5805_STATE tas5805m_state = { - .mute = false, - .volume = 0, - .state = TAS5805M_CTRL_PLAY, +// State of TAS5805M (internal to this module) +static TAS5805_STATE tas5805m_state = { + .volume = 0, + .state = TAS5805M_CTRL_PLAY, }; /* Default I2C config */ @@ -109,7 +108,7 @@ esp_err_t tas5805m_read_byte(uint8_t register_name, uint8_t *data) { // Writing of TAS5805M-Register esp_err_t tas5805m_write_byte(uint8_t register_name, uint8_t value) { int ret = 0; - ESP_LOGD(TAG, "%s: Writing 0x%02x to register 0x%02x", __func__, value, register_name); + ESP_LOGV(TAG, "%s: Writing 0x%02x to register 0x%02x", __func__, value, register_name); i2c_cmd_handle_t cmd = i2c_cmd_link_create(); i2c_master_start(cmd); @@ -161,16 +160,14 @@ esp_err_t tas5805m_init() { return ret; } - ESP_LOGW(TAG, "%s: Setting to PLAY", __func__); + ESP_LOGW(TAG, "%s: Setting to PLAY (muted)", __func__); - ESP_ERROR_CHECK(tas5805m_set_state(TAS5805M_CTRL_PLAY)); + ESP_ERROR_CHECK(tas5805m_set_state(TAS5805M_CTRL_MUTE | TAS5805M_CTRL_PLAY)); if (ret != ESP_OK) { ESP_LOGW(TAG, "%s: Set DAC state failed", __func__); return ret; } - tas5805m_state.mute = false; - // Check if Bridge-Mode is enabled #if defined(CONFIG_DAC_BRIDGE_MODE_MONO) || defined(CONFIG_DAC_BRIDGE_MODE_LEFT) || defined(CONFIG_DAC_BRIDGE_MODE_RIGHT) ESP_LOGD(TAG, "%s: Setting Bridge-Mode", __func__); @@ -253,19 +250,32 @@ esp_err_t tas5805m_init() { return ret; } +// Getting cached TAS5805 state +esp_err_t tas5805m_get_state(TAS5805_STATE *out_state) +{ + *out_state = tas5805m_state; + return ESP_OK; +} + // Setting the DAC State of TAS5805M esp_err_t tas5805m_set_state(TAS5805M_CTRL_STATE state) { - ESP_LOGD(TAG, "%s: Setting state to %d", __func__, state); - tas5805m_state.state = state; - return tas5805m_write_byte(TAS5805M_DEVICE_CTRL_2_REGISTER, state); + ESP_LOGD(TAG, "%s: Setting state to 0x%x", __func__, state); + esp_err_t ret = tas5805m_write_byte(TAS5805M_DEVICE_CTRL_2_REGISTER, state); + if (ret == ESP_OK) { + /* Update in-memory state only after successful device write */ + tas5805m_state.state = state; + } else { + ESP_LOGW(TAG, "%s: Failed to set device state (0x%x): %s", __func__, state, esp_err_to_name(ret)); + } + return ret; } // Setting the Volume esp_err_t tas5805m_set_volume(int vol) { ESP_LOGD(TAG, "%s: Setting volume to %d", __func__, vol); int vol_idx = 0; // Temp-Variable - + /* Checking if Volume is bigger or smaller than the max values */ if (vol < TAS5805M_VOLUME_MIN) { vol = TAS5805M_VOLUME_MIN; @@ -275,13 +285,19 @@ esp_err_t tas5805m_set_volume(int vol) { } /* Mapping the Values from 0-100 to 254-0 */ vol_idx = vol / 5; - /* Updating the global volume Variable */ - tas5805m_state.volume = vol_idx; /* Writing the Volume to the Register*/ - return tas5805m_write_byte(TAS5805M_DIG_VOL_CTRL_REGISTER, + esp_err_t ret = tas5805m_write_byte(TAS5805M_DIG_VOL_CTRL_REGISTER, tas5805m_volume[vol_idx]); + if (ret == ESP_OK) { + /* Update cached volume only if write succeeded */ + tas5805m_state.volume = vol_idx; + } else { + ESP_LOGW(TAG, "%s: Failed to write volume (idx %d): %s", __func__, vol_idx, esp_err_to_name(ret)); + } + return ret; } +// Getting the Volume esp_err_t tas5805m_get_volume(int *vol) { esp_err_t ret = ESP_OK; uint8_t rxbuf = 0; @@ -298,6 +314,7 @@ esp_err_t tas5805m_get_volume(int *vol) { return ret; } +// Deinit the TAS5805M esp_err_t tas5805m_deinit(void) { ESP_ERROR_CHECK(tas5805m_set_state(TAS5805M_CTRL_HI_Z)); gpio_set_level(TAS5805M_GPIO_PDN, 0); @@ -305,37 +322,49 @@ esp_err_t tas5805m_deinit(void) { return ESP_OK; } +// Setting mute state esp_err_t tas5805m_set_mute(bool enable) { ESP_LOGD(TAG, "%s: Setting mute to %d", __func__, enable); - if (tas5805m_state.mute != enable) { - tas5805m_state.mute = enable; - return tas5805m_set_state(enable ? TAS5805M_CTRL_MUTE : TAS5805M_CTRL_PLAY); + TAS5805M_CTRL_STATE new_state; + if (enable) { + new_state = (TAS5805M_CTRL_STATE)(tas5805m_state.state | TAS5805M_CTRL_MUTE); + } else { + new_state = (TAS5805M_CTRL_STATE)(tas5805m_state.state & ~TAS5805M_CTRL_MUTE); } - return ESP_OK; + /* Use existing set_state helper which writes-first and updates cache on success */ + return tas5805m_set_state(new_state); } +// Getting mute state esp_err_t tas5805m_get_mute(bool *enabled) { - ESP_LOGD(TAG, "%s: Getting mute: %d", __func__, tas5805m_state.mute); - *enabled = tas5805m_state.mute; + bool mute = tas5805m_state.state & TAS5805M_CTRL_MUTE; + ESP_LOGD(TAG, "%s: Getting mute: %d", __func__, mute); + *enabled = mute; return ESP_OK; } +// Control function of TAS5805M esp_err_t tas5805m_ctrl(audio_hal_codec_mode_t mode, audio_hal_ctrl_t ctrl_state) { - esp_err_t ret; + ESP_LOGI(TAG, "%s: Control state: %d", __func__, ctrl_state); + TAS5805M_CTRL_STATE new_state; + if (ctrl_state == AUDIO_HAL_CTRL_STOP) { - ESP_LOGI(TAG, "%s: Setting to DEEP_SLEEP", __func__); - ret = tas5805m_set_state(TAS5805M_CTRL_DEEP_SLEEP); - + ESP_LOGD(TAG, "%s: Setting to DEEP_SLEEP", __func__); + /* Clear lower 3 bits (state field) then set to DEEP_SLEEP (0x0) + * This ensures lower bits are reset to 0 as required by the device. + */ + new_state = (TAS5805M_CTRL_STATE)((tas5805m_state.state & ~0x07) | TAS5805M_CTRL_DEEP_SLEEP); + } else if (ctrl_state == AUDIO_HAL_CTRL_START ) { + ESP_LOGD(TAG, "%s: Setting to PLAY", __func__); + /* Clear lower 3 bits (state field) and set to PLAY (0x3), preserve other flags */ + new_state = (TAS5805M_CTRL_STATE)((tas5805m_state.state & ~0x07) | TAS5805M_CTRL_PLAY); } else { - ESP_LOGI(TAG, "%s: Setting to HI_Z", __func__); - ret = tas5805m_set_state(TAS5805M_CTRL_HI_Z); - vTaskDelay(1 / portTICK_PERIOD_MS); - ESP_LOGI(TAG, "%s: Setting to PLAY", __func__); - ret |= tas5805m_set_state(tas5805m_state.mute ? TAS5805M_CTRL_MUTE : TAS5805M_CTRL_PLAY); + ESP_LOGW(TAG, "%s: Unknown control state: %d", __func__, ctrl_state); + return ESP_FAIL; } - - return ret; + + return tas5805m_set_state(new_state); } esp_err_t tas5805m_config_iface(audio_hal_codec_mode_t mode, From 79e9950c18dcbf3129f670f2cd9ed28dd672619b Mon Sep 17 00:00:00 2001 From: Andriy Malyshenko Date: Thu, 20 Nov 2025 15:54:11 +0100 Subject: [PATCH 04/58] Volume implementation without a lookup tables --- .../custom_board/tas5805m/include/tas5805m.h | 9 +++- components/custom_board/tas5805m/tas5805m.c | 53 +++++++++---------- 2 files changed, 32 insertions(+), 30 deletions(-) diff --git a/components/custom_board/tas5805m/include/tas5805m.h b/components/custom_board/tas5805m/include/tas5805m.h index 41c252b3..c010642e 100644 --- a/components/custom_board/tas5805m/include/tas5805m.h +++ b/components/custom_board/tas5805m/include/tas5805m.h @@ -43,8 +43,12 @@ extern "C" { #define I2C_MASTER_TIMEOUT_MS 1000 /* Represented in % */ -#define TAS5805M_VOLUME_MIN 0 -#define TAS5805M_VOLUME_MAX 100 +#define TAS5805M_REG_VOLUME_MIN 0xff +#define TAS5805M_REG_VOLUME_MAX 0x30 // ( 0 dB - maximum volume that guarantees no distortion ) +/* +// TODO: make it available for user configuration +#define TAS5805M_REG_VOLUME_MAX 0x00 // (+24 dB - maximum volume that DAC can do) +*/ #define TAS5805M_VOLUME_MUTE 255 /* See here for the original Implementation : audio_hal/driver/tas5805m */ @@ -54,6 +58,7 @@ static const uint8_t tas5805m_volume[] = { 0xff, 0x9f, 0x8f, 0x7f, 0x6f, 0x5f, 0x5c, 0x5a, 0x58, 0x54, 0x50, 0x4c, 0x4a, 0x48, 0x44, 0x40, 0x3d, 0x3b, 0x39, 0x37, 0x35}; + typedef enum { TAS5805M_CTRL_DEEP_SLEEP = 0x00, // Deep Sleep TAS5805M_CTRL_SLEEP = 0x01, // Sleep diff --git a/components/custom_board/tas5805m/tas5805m.c b/components/custom_board/tas5805m/tas5805m.c index bc8bc93d..d45836e2 100644 --- a/components/custom_board/tas5805m/tas5805m.c +++ b/components/custom_board/tas5805m/tas5805m.c @@ -274,44 +274,41 @@ esp_err_t tas5805m_set_state(TAS5805M_CTRL_STATE state) // Setting the Volume esp_err_t tas5805m_set_volume(int vol) { ESP_LOGD(TAG, "%s: Setting volume to %d", __func__, vol); - int vol_idx = 0; // Temp-Variable - - /* Checking if Volume is bigger or smaller than the max values */ - if (vol < TAS5805M_VOLUME_MIN) { - vol = TAS5805M_VOLUME_MIN; - } - if (vol > TAS5805M_VOLUME_MAX) { - vol = TAS5805M_VOLUME_MAX; - } - /* Mapping the Values from 0-100 to 254-0 */ - vol_idx = vol / 5; + /* Clamp input percent to [0..100] */ + if (vol < 0) vol = 0; + if (vol > 100) vol = 100; + + /* Map linear percent (0..100) to register range (TAS5805M_REG_VOLUME_MIN..TAS5805M_REG_VOLUME_MAX) + * Note: on this device register values decrease with increasing volume (e.g. 0xff = mute, 0x30 = max) + * We'll compute: reg = reg_min + round((reg_max - reg_min) * vol / 100) + */ + int32_t reg_min = (int32_t)TAS5805M_REG_VOLUME_MIN; + int32_t reg_max = (int32_t)TAS5805M_REG_VOLUME_MAX; + int32_t diff = reg_max - reg_min; /* may be negative */ + int32_t numer = diff * vol; + /* integer rounding toward nearest */ + int32_t adj = (numer >= 0) ? (numer + 50) / 100 : (numer - 50) / 100; + uint8_t reg_val = (uint8_t)(reg_min + adj); + /* Writing the Volume to the Register*/ - esp_err_t ret = tas5805m_write_byte(TAS5805M_DIG_VOL_CTRL_REGISTER, - tas5805m_volume[vol_idx]); + esp_err_t ret = tas5805m_write_byte(TAS5805M_DIG_VOL_CTRL_REGISTER, reg_val); if (ret == ESP_OK) { - /* Update cached volume only if write succeeded */ - tas5805m_state.volume = vol_idx; + tas5805m_state.volume = vol; } else { - ESP_LOGW(TAG, "%s: Failed to write volume (idx %d): %s", __func__, vol_idx, esp_err_to_name(ret)); + ESP_LOGW(TAG, "%s: Failed to write volume (reg 0x%02x): %s", __func__, reg_val, esp_err_to_name(ret)); } return ret; } // Getting the Volume esp_err_t tas5805m_get_volume(int *vol) { - esp_err_t ret = ESP_OK; - uint8_t rxbuf = 0; - ret = tas5805m_read_byte(TAS5805M_DIG_VOL_CTRL_REGISTER, &rxbuf); - int i; - for (i = 0; i < sizeof(tas5805m_volume); i++) { - if (rxbuf >= tas5805m_volume[i]) break; + if (vol == NULL) { + return ESP_ERR_INVALID_ARG; } - - /* Updating the global volume Variable */ - tas5805m_state.volume = i; - ESP_LOGD(TAG, "%s: Getting volume: %d", __func__, i * 5); - *vol = 5 * i; // Converting it to percent - return ret; + + *vol = tas5805m_state.volume; + ESP_LOGD(TAG, "%s: Getting volume (cached): %d", __func__, *vol); + return ESP_OK; } // Deinit the TAS5805M From 52b4f1e5af918f58a872da75f7c429eb58ffe067 Mon Sep 17 00:00:00 2001 From: Andriy Malyshenko Date: Thu, 20 Nov 2025 16:08:29 +0100 Subject: [PATCH 05/58] Changed lower border of volume slider to -60dB to provide better dynamic range --- .../custom_board/tas5805m/include/tas5805m.h | 7 ++--- components/custom_board/tas5805m/tas5805m.c | 30 ++++++++++++------- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/components/custom_board/tas5805m/include/tas5805m.h b/components/custom_board/tas5805m/include/tas5805m.h index c010642e..48337f77 100644 --- a/components/custom_board/tas5805m/include/tas5805m.h +++ b/components/custom_board/tas5805m/include/tas5805m.h @@ -42,15 +42,14 @@ extern "C" { #define I2C_MASTER_RX_BUF_DISABLE 0 /*!< I2C master doesn't need buffer */ #define I2C_MASTER_TIMEOUT_MS 1000 -/* Represented in % */ -#define TAS5805M_REG_VOLUME_MIN 0xff -#define TAS5805M_REG_VOLUME_MAX 0x30 // ( 0 dB - maximum volume that guarantees no distortion ) +#define TAS5805M_VOLUME_MUTE 0xff // (-103.5 dB - actual mute) +#define TAS5805M_VOLUME_MIN 0xa8 // ( -60 dB - save value representing barely hearable volume) +#define TAS5805M_VOLUME_MAX 0x30 // ( 0 dB - maximum volume that guarantees no distortion ) /* // TODO: make it available for user configuration #define TAS5805M_REG_VOLUME_MAX 0x00 // (+24 dB - maximum volume that DAC can do) */ -#define TAS5805M_VOLUME_MUTE 255 /* See here for the original Implementation : audio_hal/driver/tas5805m */ /* Its not from me it was developed by Espressif */ /* Volume steps tas5805m_volume[0] => 255 which means mute */ diff --git a/components/custom_board/tas5805m/tas5805m.c b/components/custom_board/tas5805m/tas5805m.c index d45836e2..4c77e28b 100644 --- a/components/custom_board/tas5805m/tas5805m.c +++ b/components/custom_board/tas5805m/tas5805m.c @@ -278,17 +278,25 @@ esp_err_t tas5805m_set_volume(int vol) { if (vol < 0) vol = 0; if (vol > 100) vol = 100; - /* Map linear percent (0..100) to register range (TAS5805M_REG_VOLUME_MIN..TAS5805M_REG_VOLUME_MAX) - * Note: on this device register values decrease with increasing volume (e.g. 0xff = mute, 0x30 = max) - * We'll compute: reg = reg_min + round((reg_max - reg_min) * vol / 100) - */ - int32_t reg_min = (int32_t)TAS5805M_REG_VOLUME_MIN; - int32_t reg_max = (int32_t)TAS5805M_REG_VOLUME_MAX; - int32_t diff = reg_max - reg_min; /* may be negative */ - int32_t numer = diff * vol; - /* integer rounding toward nearest */ - int32_t adj = (numer >= 0) ? (numer + 50) / 100 : (numer - 50) / 100; - uint8_t reg_val = (uint8_t)(reg_min + adj); + /* If percent is zero, map to the explicit MUTE register value regardless of reg_min + * Otherwise map linearly between register min and max. This preserves behaviour when + * TAS5805M_VOLUME_MIN isn't 0xff while ensuring vol==0 always mutes. + */ + uint8_t reg_val = 0; + if (vol == 0) { + reg_val = (uint8_t)TAS5805M_VOLUME_MUTE; + } else { + /* Map linear percent (1..100) to register range (TAS5805M_VOLUME_MIN..TAS5805M_VOLUME_MAX) + * Note: register ordering may be descending (higher register = quieter). Formula handles that. + */ + int32_t reg_min = (int32_t)TAS5805M_VOLUME_MIN; + int32_t reg_max = (int32_t)TAS5805M_VOLUME_MAX; + int32_t diff = reg_max - reg_min; /* may be negative */ + int32_t numer = diff * vol; + /* integer rounding toward nearest */ + int32_t adj = (numer >= 0) ? (numer + 50) / 100 : (numer - 50) / 100; + reg_val = (uint8_t)(reg_min + adj); + } /* Writing the Volume to the Register*/ esp_err_t ret = tas5805m_write_byte(TAS5805M_DIG_VOL_CTRL_REGISTER, reg_val); From 1ae205ed9c6a2fd68fe8c20d4a0f1529af100b73 Mon Sep 17 00:00:00 2001 From: Andriy Malyshenko Date: Fri, 21 Nov 2025 15:15:10 +0100 Subject: [PATCH 06/58] Updated Ui to manage DSP settings and change DSP flow. Updated DSP component to apply stored settings at startup and expose settings structure to http component, Updated html for the UI --- components/dsp_processor/dsp_capabilities.md | 152 +++++++ components/dsp_processor/dsp_processor.c | 397 ++++++++++-------- .../dsp_processor/include/dsp_processor.h | 126 +++++- 3 files changed, 506 insertions(+), 169 deletions(-) create mode 100644 components/dsp_processor/dsp_capabilities.md diff --git a/components/dsp_processor/dsp_capabilities.md b/components/dsp_processor/dsp_capabilities.md new file mode 100644 index 00000000..1267ef25 --- /dev/null +++ b/components/dsp_processor/dsp_capabilities.md @@ -0,0 +1,152 @@ +# DSP Processor Dynamic Configuration Schema + +## Overview +This document defines the JSON structure for DSP processor capabilities that enables dynamic UI generation. + +## JSON Schema Example + +```json +{ + "version": "1.0", + "flows": [ + { + "id": "dspfEQBassTreble", + "name": "Bass & Treble EQ", + "description": "Simple 2-band equalizer with bass and treble controls", + "parameters": [ + { + "key": "fc_1", + "name": "Bass Frequency", + "type": "float", + "unit": "Hz", + "min": 50.0, + "max": 500.0, + "default": 300.0, + "step": 10.0, + "ui_control": "slider" + }, + { + "key": "gain_1", + "name": "Bass Gain", + "type": "float", + "unit": "dB", + "min": -12.0, + "max": 12.0, + "default": 0.0, + "step": 1.0, + "ui_control": "slider" + }, + { + "key": "fc_3", + "name": "Treble Frequency", + "type": "float", + "unit": "Hz", + "min": 2000.0, + "max": 12000.0, + "default": 4000.0, + "step": 100.0, + "ui_control": "slider" + }, + { + "key": "gain_3", + "name": "Treble Gain", + "type": "float", + "unit": "dB", + "min": -12.0, + "max": 12.0, + "default": 0.0, + "step": 1.0, + "ui_control": "slider" + } + ] + }, + { + "id": "dspfBassBoost", + "name": "Bass Boost", + "description": "Fixed +6dB bass enhancement", + "parameters": [ + { + "key": "fc_1", + "name": "Bass Frequency", + "type": "float", + "unit": "Hz", + "min": 50.0, + "max": 500.0, + "default": 300.0, + "step": 10.0, + "ui_control": "slider" + } + ] + }, + { + "id": "dspfBiamp", + "name": "Bi-Amp Crossover", + "description": "Channel 0: Low-pass, Channel 1: High-pass", + "parameters": [ + { + "key": "fc_1", + "name": "Crossover Frequency", + "type": "float", + "unit": "Hz", + "min": 80.0, + "max": 500.0, + "default": 300.0, + "step": 10.0, + "ui_control": "slider" + }, + { + "key": "gain_1", + "name": "Low-Pass Gain", + "type": "float", + "unit": "dB", + "min": -12.0, + "max": 12.0, + "default": 0.0, + "step": 1.0, + "ui_control": "slider" + }, + { + "key": "fc_3", + "name": "High-Pass Frequency", + "type": "float", + "unit": "Hz", + "min": 80.0, + "max": 500.0, + "default": 100.0, + "step": 10.0, + "ui_control": "slider" + }, + { + "key": "gain_3", + "name": "High-Pass Gain", + "type": "float", + "unit": "dB", + "min": -12.0, + "max": 12.0, + "default": 0.0, + "step": 1.0, + "ui_control": "slider" + } + ] + }, + { + "id": "dspfStereo", + "name": "Stereo Pass-Through", + "description": "No DSP processing, optional soft volume", + "parameters": [] + } + ], + "current_flow": "dspfEQBassTreble" +} +``` + +## Parameter Types +- `float`: Floating-point value +- `int`: Integer value +- `enum`: Enumerated value (requires `options` array) + +## UI Control Types +- `slider`: Continuous range slider +- `number`: Numeric input box +- `select`: Dropdown menu (for enums) +- `toggle`: On/off switch diff --git a/components/dsp_processor/dsp_processor.c b/components/dsp_processor/dsp_processor.c index 96490c80..e3230363 100644 --- a/components/dsp_processor/dsp_processor.c +++ b/components/dsp_processor/dsp_processor.c @@ -5,52 +5,33 @@ #include #include "freertos/FreeRTOS.h" -#include "freertos/semphr.h" #if CONFIG_USE_DSP_PROCESSOR #include "dsp_processor.h" #include "dsps_biquad.h" #include "dsps_biquad_gen.h" #include "esp_log.h" +#include "freertos/queue.h" #include "player.h" -typedef struct ptype { - int filtertype; - float freq; - float gain; - float q; - float *in, *out; - float coeffs[5]; - float w[2]; -} ptype_t; - -typedef struct dsp_all_params_s { - dspFlows_t active_flow; - struct { - float fc_1; - float gain_1; - float fc_3; - float gain_3; - } flow_params[DSP_FLOW_COUNT]; -} dsp_all_params_t; - #ifdef CONFIG_USE_BIQUAD_ASM #define BIQUAD dsps_biquad_f32_ae32 #else #define BIQUAD dsps_biquad_f32 #endif -static const char *TAG = "dsp_proc"; +static const char *TAG = "dspProc"; #define DSP_PROCESSOR_LEN 16 -// Legacy queue removed. Use paramsChangedSemaphoreHandle to notify worker of updates. -static SemaphoreHandle_t paramsChangedSemaphoreHandle = NULL; -static SemaphoreHandle_t params_mutex = NULL; +static QueueHandle_t filterUpdateQHdl = NULL; // Centralized parameter storage - one set of parameters per DSP flow static dsp_all_params_t all_params; +// Legacy single filterParams for backward compatibility with worker thread +static filterParams_t filterParams; + static ptype_t *filter = NULL; static double dynamic_vol = 1.0; @@ -62,9 +43,19 @@ static float *sbufout0 = NULL; #if CONFIG_USE_DSP_PROCESSOR #define SNAPCAST_USE_SOFT_VOL CONFIG_SNAPCLIENT_USE_SOFT_VOL -// Default DSP flow is Stereo, but will be updated from NVS at runtime +#if CONFIG_SNAPCLIENT_DSP_FLOW_STEREO dspFlows_t dspFlowInit = dspfStereo; #endif +#if CONFIG_SNAPCLIENT_DSP_FLOW_BASSBOOST +dspFlows_t dspFlowInit = dspfBassBoost; +#endif +#if CONFIG_SNAPCLIENT_DSP_FLOW_BIAMP +dspFlows_t dspFlowInit = dspfBiamp; +#endif +#if CONFIG_SNAPCLIENT_DSP_FLOW_BASS_TREBLE_EQ +dspFlows_t dspFlowInit = dspfEQBassTreble; +#endif +#endif /** * @@ -72,6 +63,20 @@ dspFlows_t dspFlowInit = dspfStereo; void dsp_processor_init(void) { ESP_LOGD(TAG, "%s: initializing", __func__); init = false; + + if (filterUpdateQHdl) { + vQueueDelete(filterUpdateQHdl); + filterUpdateQHdl = NULL; + } + + // have a max queue length of 1 here because we use xQueueOverwrite + // to write to the queue + filterUpdateQHdl = xQueueCreate(1, sizeof(filterParams_t)); + if (filterUpdateQHdl == NULL) { + ESP_LOGE(TAG, "%s: Failed to create filter update queue", __func__); + return; + } + // Initialize all_params with defaults for each flow memset(&all_params, 0, sizeof(dsp_all_params_t)); all_params.active_flow = dspFlowInit; @@ -95,24 +100,15 @@ void dsp_processor_init(void) { // dspfStereo has no parameters (pass-through with volume only) // dspf2DOT1 and dspfFunkyHonda not yet implemented - // Note: Do not read settings here to avoid circular dependency. The - // dsp_processor_settings component will call dsp_processor_set_params_for_flow() - // and dsp_processor_switch_flow() during its init to apply saved settings. + // Initialize legacy filterParams from active flow + filterParams.dspFlow = all_params.active_flow; + filterParams.fc_1 = all_params.flow_params[all_params.active_flow].fc_1; + filterParams.gain_1 = all_params.flow_params[all_params.active_flow].gain_1; + filterParams.fc_2 = all_params.flow_params[all_params.active_flow].fc_2; + filterParams.gain_2 = all_params.flow_params[all_params.active_flow].gain_2; + filterParams.fc_3 = all_params.flow_params[all_params.active_flow].fc_3; + filterParams.gain_3 = all_params.flow_params[all_params.active_flow].gain_3; - if (params_mutex == NULL) { - params_mutex = xSemaphoreCreateMutex(); - if (params_mutex == NULL) { - ESP_LOGW(TAG, "%s: failed to create params mutex", __func__); - } - } - if (paramsChangedSemaphoreHandle == NULL) { - paramsChangedSemaphoreHandle = xSemaphoreCreateBinary(); - if (paramsChangedSemaphoreHandle == NULL) { - ESP_LOGW(TAG, "%s: failed to create params changed semaphore", __func__); - } else { - xSemaphoreTake(paramsChangedSemaphoreHandle, 10); - } - } ESP_LOGI(TAG, "%s: Initialized with flow=%d, fc_1=%.1f, gain_1=%.1f", __func__, all_params.active_flow, all_params.flow_params[all_params.active_flow].fc_1, @@ -141,15 +137,11 @@ void dsp_processor_uninit(void) { filter = NULL; } - if (params_mutex) { - vSemaphoreDelete(params_mutex); - params_mutex = NULL; + if (filterUpdateQHdl) { + vQueueDelete(filterUpdateQHdl); + filterUpdateQHdl = NULL; } - if (paramsChangedSemaphoreHandle) { - vSemaphoreDelete(paramsChangedSemaphoreHandle); - paramsChangedSemaphoreHandle = NULL; - } init = false; ESP_LOGI(TAG, "%s: uninit done", __func__); @@ -157,45 +149,40 @@ void dsp_processor_uninit(void) { /** * Update filter parameters - * Updates centralized storage and queues for worker thread + * Updates both the static filterParams immediately and queues for worker thread */ esp_err_t dsp_processor_update_filter_params(filterParams_t *params) { ESP_LOGD(TAG, "%s: updating filter params", __func__); - // Update centralized storage for the current flow + // Update static filterParams immediately so get_capabilities returns current value + memcpy(&filterParams, params, sizeof(filterParams_t)); + + // Also update centralized storage for the current flow dspFlows_t flow = params->dspFlow; - if (flow >= 0 && flow < DSP_FLOW_COUNT) { // Validate flow index - // Acquire mutex once, update parameters and set the notification flag - if (params_mutex && (xSemaphoreTake(params_mutex, portMAX_DELAY) == pdTRUE)) { - all_params.active_flow = flow; - all_params.flow_params[flow].fc_1 = params->fc_1; - all_params.flow_params[flow].gain_1 = params->gain_1; - all_params.flow_params[flow].fc_3 = params->fc_3; - all_params.flow_params[flow].gain_3 = params->gain_3; - xSemaphoreGive(paramsChangedSemaphoreHandle); - xSemaphoreGive(params_mutex); - } else { - // No mutex available: best-effort update - all_params.active_flow = flow; - all_params.flow_params[flow].fc_1 = params->fc_1; - all_params.flow_params[flow].gain_1 = params->gain_1; - all_params.flow_params[flow].fc_3 = params->fc_3; - all_params.flow_params[flow].gain_3 = params->gain_3; - xSemaphoreGive(paramsChangedSemaphoreHandle); - } + if (flow >= 0 && flow < 6) { // Validate flow index + all_params.active_flow = flow; + all_params.flow_params[flow].fc_1 = params->fc_1; + all_params.flow_params[flow].gain_1 = params->gain_1; + all_params.flow_params[flow].fc_2 = params->fc_2; + all_params.flow_params[flow].gain_2 = params->gain_2; + all_params.flow_params[flow].fc_3 = params->fc_3; + all_params.flow_params[flow].gain_3 = params->gain_3; } - // Worker polls params_changed; we set it while holding the mutex above - // to ensure atomic visibility. Nothing more to do here. + if (filterUpdateQHdl) { + if (xQueueOverwrite(filterUpdateQHdl, params) == pdTRUE) { + return ESP_OK; + } + } - return ESP_OK; + return ESP_FAIL; } /** * */ static int32_t dsp_processor_gen_filter(ptype_t *filter, uint32_t cnt) { - ESP_LOGD(TAG, "%s: generating %lu filters", __func__, (unsigned long)cnt); + ESP_LOGD(TAG, "%s: generating %d filters", __func__, cnt); if ((filter == NULL) && (cnt > 0)) { return ESP_FAIL; } @@ -254,7 +241,6 @@ int dsp_processor_worker(void *p_pcmChnk, const void *p_scSet) { if (samplerate == 0) { samplerate = 44100; - ESP_LOGW(TAG, "%s: Sample rate is not set, using default: %lu", __func__, (unsigned long)samplerate); } int16_t len = pcmChnk->fragment->size / ((bits / 8) * ch); @@ -263,47 +249,17 @@ int dsp_processor_worker(void *p_pcmChnk, const void *p_scSet) { // volatile needed to ensure 32 bit access volatile uint32_t *audio_tmp = (volatile uint32_t *)(pcmChnk->fragment->payload); - - // Local working copy of filter parameters - static filterParams_t currentFilterParams = {0}; - static bool paramsInitialized = false; - - // Initialize on first run - if (!paramsInitialized) { - currentFilterParams.dspFlow = all_params.active_flow; - currentFilterParams.fc_1 = all_params.flow_params[all_params.active_flow].fc_1; - currentFilterParams.gain_1 = all_params.flow_params[all_params.active_flow].gain_1; - currentFilterParams.fc_3 = all_params.flow_params[all_params.active_flow].fc_3; - currentFilterParams.gain_3 = all_params.flow_params[all_params.active_flow].gain_3; - paramsInitialized = true; - } - - // If parameters were changed by API, copy them from centralized storage - if (xSemaphoreTake(paramsChangedSemaphoreHandle, 0) == pdTRUE) { - // Copy under mutex to avoid torn reads - if (params_mutex) { - xSemaphoreTake(params_mutex, portMAX_DELAY); - } else { - ESP_LOGW(TAG, "%s: params mutex not available, proceeding without mutex", __func__); - } - - dspFlows_t aflow = all_params.active_flow; - currentFilterParams.dspFlow = aflow; - currentFilterParams.fc_1 = all_params.flow_params[aflow].fc_1; - currentFilterParams.gain_1 = all_params.flow_params[aflow].gain_1; - currentFilterParams.fc_3 = all_params.flow_params[aflow].fc_3; - currentFilterParams.gain_3 = all_params.flow_params[aflow].gain_3; - if (params_mutex) { - xSemaphoreGive(params_mutex); - } else { - ESP_LOGW(TAG, "%s: params mutex not available, proceeding without mutex", __func__); - } + dspFlows_t dspFlow; - ESP_LOGI(TAG, "Applying filter update: flow=%d", currentFilterParams.dspFlow); + // check if we need to update filters + if (xQueueReceive(filterUpdateQHdl, &filterParams, pdMS_TO_TICKS(0)) == + pdTRUE) { init = false; + + // TODO: store filterParams in NVM } - dspFlows_t dspFlow = currentFilterParams.dspFlow; + dspFlow = filterParams.dspFlow; if (init == false) { uint32_t cnt = 0; @@ -321,10 +277,10 @@ int dsp_processor_worker(void *p_pcmChnk, const void *p_scSet) { (ptype_t *)heap_caps_malloc(sizeof(ptype_t) * cnt, MALLOC_CAP_8BIT); if (filter) { // simple EQ control of low and high frequencies (bass, treble) - float bass_fc = currentFilterParams.fc_1 / samplerate; - float bass_gain = currentFilterParams.gain_1; - float treble_fc = currentFilterParams.fc_3 / samplerate; - float treble_gain = currentFilterParams.gain_3; + float bass_fc = filterParams.fc_1 / samplerate; + float bass_gain = filterParams.gain_1; + float treble_fc = filterParams.fc_3 / samplerate; + float treble_gain = filterParams.gain_3; // filters for CH 0 filter[0] = (ptype_t){LOWSHELF, bass_fc, bass_gain, 0.707, @@ -356,8 +312,8 @@ int dsp_processor_worker(void *p_pcmChnk, const void *p_scSet) { filter = (ptype_t *)heap_caps_malloc(sizeof(ptype_t) * cnt, MALLOC_CAP_8BIT); if (filter) { - float bass_fc = currentFilterParams.fc_1 / samplerate; - float bass_gain = currentFilterParams.gain_1; + float bass_fc = filterParams.fc_1 / samplerate; + float bass_gain = filterParams.gain_1; filter[0] = (ptype_t){LOWSHELF, bass_fc, bass_gain, 0.707, NULL, NULL, {0, 0, 0, 0, 0}, {0, 0}}; @@ -365,7 +321,7 @@ int dsp_processor_worker(void *p_pcmChnk, const void *p_scSet) { NULL, NULL, {0, 0, 0, 0, 0}, {0, 0}}; ESP_LOGI(TAG, "got new setting for dspfBassBoost: fc=%.1f gain=%.1f", - currentFilterParams.fc_1, currentFilterParams.gain_1); + filterParams.fc_1, filterParams.gain_1); } else { ESP_LOGE(TAG, "failed to get memory for filter"); } @@ -379,10 +335,10 @@ int dsp_processor_worker(void *p_pcmChnk, const void *p_scSet) { filter = (ptype_t *)heap_caps_malloc(sizeof(ptype_t) * cnt, MALLOC_CAP_8BIT); if (filter) { - float lp_fc = currentFilterParams.fc_1 / samplerate; - float lp_gain = currentFilterParams.gain_1; - float hp_fc = currentFilterParams.fc_3 / samplerate; - float hp_gain = currentFilterParams.gain_3; + float lp_fc = filterParams.fc_1 / samplerate; + float lp_gain = filterParams.gain_1; + float hp_fc = filterParams.fc_3 / samplerate; + float hp_gain = filterParams.gain_3; filter[0] = (ptype_t){LPF, lp_fc, lp_gain, 0.707, NULL, NULL, {0, 0, 0, 0, 0}, {0, 0}}; @@ -776,52 +732,169 @@ void dsp_processor_set_volome(double volume) { dynamic_vol = volume; } } + +/** + * Get current DSP flow + */ +dspFlows_t dsp_processor_get_current_flow(void) { + ESP_LOGD(TAG, "%s: returning flow=%d", __func__, filterParams.dspFlow); + return filterParams.dspFlow; +} + +/** + * Get DSP capabilities as JSON string + * Caller must free the returned string + */ +char* dsp_processor_get_capabilities_json(void) { + ESP_LOGD(TAG, "%s: generating capabilities JSON", __func__); + // Pre-calculate required buffer size (approximate) + size_t buffer_size = 4096; + char* json = (char*)malloc(buffer_size); + if (!json) { + ESP_LOGE(TAG, "Failed to allocate memory for capabilities JSON"); + return NULL; + } + + int offset = 0; + + // Start JSON + offset += snprintf(json + offset, buffer_size - offset, + "{\n" + " \"version\": \"1.0\",\n" + " \"flows\": [\n"); + + // dspfStereo + offset += snprintf(json + offset, buffer_size - offset, + " {\n" + " \"id\": \"dspfStereo\",\n" + " \"name\": \"Stereo Pass-Through\",\n" + " \"description\": \"No DSP processing, optional soft volume\",\n" + " \"parameters\": []\n" + " },\n"); + + // dspfEQBassTreble + offset += snprintf(json + offset, buffer_size - offset, + " {\n" + " \"id\": \"dspfEQBassTreble\",\n" + " \"name\": \"Bass & Treble EQ\",\n" + " \"description\": \"Simple 2-band equalizer with bass and treble controls\",\n" + " \"parameters\": [\n" + " {\"key\": \"fc_1\", \"name\": \"Bass Frequency\", \"type\": \"float\", \"unit\": \"Hz\", \"min\": %.1f, \"max\": %.1f, \"default\": %.1f, \"step\": %.1f, \"ui_control\": \"slider\"},\n" + " {\"key\": \"gain_1\", \"name\": \"Bass Gain\", \"type\": \"float\", \"unit\": \"dB\", \"min\": %.1f, \"max\": %.1f, \"default\": %.1f, \"step\": %.1f, \"ui_control\": \"slider\"},\n" + " {\"key\": \"fc_3\", \"name\": \"Treble Frequency\", \"type\": \"float\", \"unit\": \"Hz\", \"min\": %.1f, \"max\": %.1f, \"default\": %.1f, \"step\": %.1f, \"ui_control\": \"slider\"},\n" + " {\"key\": \"gain_3\", \"name\": \"Treble Gain\", \"type\": \"float\", \"unit\": \"dB\", \"min\": %.1f, \"max\": %.1f, \"default\": %.1f, \"step\": %.1f, \"ui_control\": \"slider\"}\n" + " ]\n" + " },\n", + DSP_BASS_FREQ_MIN, DSP_BASS_FREQ_MAX, DSP_BASS_FREQ_DEFAULT, DSP_BASS_FREQ_STEP, + DSP_GAIN_MIN, DSP_GAIN_MAX, DSP_GAIN_DEFAULT, DSP_GAIN_STEP, + DSP_TREBLE_FREQ_MIN, DSP_TREBLE_FREQ_MAX, DSP_TREBLE_FREQ_DEFAULT, DSP_TREBLE_FREQ_STEP, + DSP_GAIN_MIN, DSP_GAIN_MAX, DSP_GAIN_DEFAULT, DSP_GAIN_STEP); + + // dspfBassBoost + offset += snprintf(json + offset, buffer_size - offset, + " {\n" + " \"id\": \"dspfBassBoost\",\n" + " \"name\": \"Bass Boost\",\n" + " \"description\": \"Adjustable bass enhancement\",\n" + " \"parameters\": [\n" + " {\"key\": \"fc_1\", \"name\": \"Bass Frequency\", \"type\": \"float\", \"unit\": \"Hz\", \"min\": %.1f, \"max\": %.1f, \"default\": %.1f, \"step\": %.1f, \"ui_control\": \"slider\"},\n" + " {\"key\": \"gain_1\", \"name\": \"Bass Gain\", \"type\": \"float\", \"unit\": \"dB\", \"min\": %.1f, \"max\": %.1f, \"default\": %.1f, \"step\": %.1f, \"ui_control\": \"slider\"}\n" + " ]\n" + " },\n", + DSP_BASS_FREQ_MIN, DSP_BASS_FREQ_MAX, DSP_BASS_FREQ_DEFAULT, DSP_BASS_FREQ_STEP, + DSP_BASSBOOST_GAIN_MIN, DSP_BASSBOOST_GAIN_MAX, DSP_BASSBOOST_GAIN_DEFAULT, DSP_BASSBOOST_GAIN_STEP); + + // dspfBiamp + offset += snprintf(json + offset, buffer_size - offset, + " {\n" + " \"id\": \"dspfBiamp\",\n" + " \"name\": \"Bi-Amp Crossover\",\n" + " \"description\": \"Channel 0: Low-pass, Channel 1: High-pass\",\n" + " \"parameters\": [\n" + " {\"key\": \"fc_1\", \"name\": \"Low-Pass Frequency\", \"type\": \"float\", \"unit\": \"Hz\", \"min\": %.1f, \"max\": %.1f, \"default\": %.1f, \"step\": %.1f, \"ui_control\": \"slider\"},\n" + " {\"key\": \"gain_1\", \"name\": \"Low-Pass Gain\", \"type\": \"float\", \"unit\": \"dB\", \"min\": %.1f, \"max\": %.1f, \"default\": %.1f, \"step\": %.1f, \"ui_control\": \"slider\"},\n" + " {\"key\": \"fc_3\", \"name\": \"High-Pass Frequency\", \"type\": \"float\", \"unit\": \"Hz\", \"min\": %.1f, \"max\": %.1f, \"default\": %.1f, \"step\": %.1f, \"ui_control\": \"slider\"},\n" + " {\"key\": \"gain_3\", \"name\": \"High-Pass Gain\", \"type\": \"float\", \"unit\": \"dB\", \"min\": %.1f, \"max\": %.1f, \"default\": %.1f, \"step\": %.1f, \"ui_control\": \"slider\"}\n" + " ]\n" + " }\n", + DSP_CROSSOVER_FREQ_MIN, DSP_CROSSOVER_FREQ_MAX, DSP_CROSSOVER_FREQ_DEFAULT, DSP_CROSSOVER_FREQ_STEP, + DSP_GAIN_MIN, DSP_GAIN_MAX, DSP_GAIN_DEFAULT, DSP_GAIN_STEP, + DSP_CROSSOVER_FREQ_MIN, DSP_CROSSOVER_FREQ_MAX, DSP_CROSSOVER_FREQ_DEFAULT, DSP_CROSSOVER_FREQ_STEP, + DSP_GAIN_MIN, DSP_GAIN_MAX, DSP_GAIN_DEFAULT, DSP_GAIN_STEP); + + // Close JSON + offset += snprintf(json + offset, buffer_size - offset, + " ],\n" + " \"current_flow\": \"%s\"\n" + "}\n", + filterParams.dspFlow == dspfEQBassTreble ? "dspfEQBassTreble" : + filterParams.dspFlow == dspfBassBoost ? "dspfBassBoost" : + filterParams.dspFlow == dspfBiamp ? "dspfBiamp" : + filterParams.dspFlow == dspfStereo ? "dspfStereo" : + filterParams.dspFlow == dspf2DOT1 ? "dspf2DOT1" : + filterParams.dspFlow == dspfFunkyHonda ? "dspfFunkyHonda" : "unknown"); + + if (offset >= buffer_size - 1) { + ESP_LOGW(TAG, "JSON buffer may have been truncated"); + } + + return json; +} + +/** + * Get all parameters (centralized storage) + */ +const dsp_all_params_t* dsp_processor_get_all_params(void) { + return &all_params; +} + +/** + * Get parameters for a specific flow + */ +esp_err_t dsp_processor_get_params_for_flow(dspFlows_t flow, filterParams_t *params) { + ESP_LOGD(TAG, "%s: getting params for flow %d", __func__, flow); + + if (params == NULL || flow < 0 || flow >= 6) { + return ESP_ERR_INVALID_ARG; + } + + params->dspFlow = flow; + params->fc_1 = all_params.flow_params[flow].fc_1; + params->gain_1 = all_params.flow_params[flow].gain_1; + params->fc_2 = all_params.flow_params[flow].fc_2; + params->gain_2 = all_params.flow_params[flow].gain_2; + params->fc_3 = all_params.flow_params[flow].fc_3; + params->gain_3 = all_params.flow_params[flow].gain_3; + + return ESP_OK; +} + /** * Set parameters for a specific flow (without switching to it) */ esp_err_t dsp_processor_set_params_for_flow(dspFlows_t flow, const filterParams_t *params) { ESP_LOGD(TAG, "%s: setting params for flow %d", __func__, flow); - if (params == NULL || flow < 0 || flow >= DSP_FLOW_COUNT) { + if (params == NULL || flow < 0 || flow >= 6) { return ESP_ERR_INVALID_ARG; } // Update centralized storage for this specific flow - if (params_mutex) { - xSemaphoreTake(params_mutex, portMAX_DELAY); - } else { - ESP_LOGW(TAG, "%s: params mutex not available, proceeding without mutex", __func__); - } - all_params.flow_params[flow].fc_1 = params->fc_1; all_params.flow_params[flow].gain_1 = params->gain_1; + all_params.flow_params[flow].fc_2 = params->fc_2; + all_params.flow_params[flow].gain_2 = params->gain_2; all_params.flow_params[flow].fc_3 = params->fc_3; all_params.flow_params[flow].gain_3 = params->gain_3; - if (params_mutex) { - xSemaphoreGive(params_mutex); - } else { - ESP_LOGW(TAG, "%s: params mutex not available, proceeding without mutex", __func__); - } // If this is the active flow, also update the legacy filterParams and notify worker - if (params_mutex) { - xSemaphoreTake(params_mutex, portMAX_DELAY); - } else { - ESP_LOGW(TAG, "%s: params mutex not available, proceeding without mutex", __func__); - } - - bool is_active = (flow == all_params.active_flow); - if (params_mutex) { - xSemaphoreGive(params_mutex); - } else { - ESP_LOGW(TAG, "%s: params mutex not available, proceeding without mutex", __func__); - } - - if (is_active) { + if (flow == all_params.active_flow) { filterParams_t temp_params; temp_params.dspFlow = flow; temp_params.fc_1 = params->fc_1; temp_params.gain_1 = params->gain_1; + temp_params.fc_2 = params->fc_2; + temp_params.gain_2 = params->gain_2; temp_params.fc_3 = params->fc_3; temp_params.gain_3 = params->gain_3; @@ -835,32 +908,24 @@ esp_err_t dsp_processor_set_params_for_flow(dspFlows_t flow, const filterParams_ * Switch to a different DSP flow */ esp_err_t dsp_processor_switch_flow(dspFlows_t flow) { - if (flow < 0 || flow >= DSP_FLOW_COUNT) { - ESP_LOGE(TAG, "%s: invalid flow %d", __func__, flow); + ESP_LOGI(TAG, "%s: switching from flow %d to %d", __func__, all_params.active_flow, flow); + + if (flow < 0 || flow >= 6) { return ESP_ERR_INVALID_ARG; } - ESP_LOGI(TAG, "%s: switching from flow %d to %d", __func__, all_params.active_flow, flow); - // Set active flow under mutex and capture params to apply - if (params_mutex) { - xSemaphoreTake(params_mutex, portMAX_DELAY); - } else { - ESP_LOGW(TAG, "%s: params mutex not available, proceeding without mutex", __func__); - } - all_params.active_flow = flow; + + // Load parameters for the new flow and apply them filterParams_t params; params.dspFlow = flow; params.fc_1 = all_params.flow_params[flow].fc_1; params.gain_1 = all_params.flow_params[flow].gain_1; + params.fc_2 = all_params.flow_params[flow].fc_2; + params.gain_2 = all_params.flow_params[flow].gain_2; params.fc_3 = all_params.flow_params[flow].fc_3; params.gain_3 = all_params.flow_params[flow].gain_3; - if (params_mutex) { - xSemaphoreGive(params_mutex); - } else { - ESP_LOGW(TAG, "%s: params mutex not available, proceeding without mutex", __func__); - } - + return dsp_processor_update_filter_params(¶ms); } diff --git a/components/dsp_processor/include/dsp_processor.h b/components/dsp_processor/include/dsp_processor.h index 5099dcf4..891d59b0 100644 --- a/components/dsp_processor/include/dsp_processor.h +++ b/components/dsp_processor/include/dsp_processor.h @@ -6,8 +6,51 @@ extern "C" { #endif #include "esp_err.h" -#include "dsp_types.h" -#include "freertos/FreeRTOS.h" + +/** + * DSP Parameter Limits - Configurable at compile time + * + * These defines control the min/max/default values for all DSP parameters + * exposed in the UI. Modify these values before compilation to set appropriate + * limits for your audio system. + * + * All frequency values are in Hz + * All gain values are in dB + */ + +#define DSP_BASS_FREQ_MIN 30.0f +#define DSP_BASS_FREQ_MAX 500.0f +#define DSP_BASS_FREQ_DEFAULT 150.0f +#define DSP_BASS_FREQ_STEP 5.0f + +#define DSP_TREBLE_FREQ_MIN 2000.0f +#define DSP_TREBLE_FREQ_MAX 16000.0f +#define DSP_TREBLE_FREQ_DEFAULT 8000.0f +#define DSP_TREBLE_FREQ_STEP 100.0f + +#define DSP_GAIN_MIN -15.0f +#define DSP_GAIN_MAX 15.0f +#define DSP_GAIN_DEFAULT 0.0f +#define DSP_GAIN_STEP 1.0f + +#define DSP_BASSBOOST_GAIN_MIN -18.0f +#define DSP_BASSBOOST_GAIN_MAX 18.0f +#define DSP_BASSBOOST_GAIN_DEFAULT 9.0f +#define DSP_BASSBOOST_GAIN_STEP 1.0f + +#define DSP_CROSSOVER_FREQ_MIN 80.0f +#define DSP_CROSSOVER_FREQ_MAX 3000.0f +#define DSP_CROSSOVER_FREQ_DEFAULT 500.0f +#define DSP_CROSSOVER_FREQ_STEP 10.0f + +typedef enum dspFlows { + dspfStereo, + dspfBiamp, + dspf2DOT1, + dspfFunkyHonda, + dspfBassBoost, + dspfEQBassTreble, +} dspFlows_t; enum filtertypes { LPF, @@ -22,14 +65,84 @@ enum filtertypes { HIGHSHELF }; +// Each audio processor node consist of a data struct holding the +// required weights and states for processing an automomous processing +// function. The high level parameters is maintained in the structure +// as well +// Process node +typedef struct ptype { + int filtertype; + float freq; + float gain; + float q; + float *in, *out; + float coeffs[5]; + float w[2]; +} ptype_t; + +// used to dynamically change used filters and their parameters +typedef struct filterParams_s { + dspFlows_t dspFlow; + float fc_1; + float gain_1; + float fc_2; + float gain_2; + float fc_3; + float gain_3; +} filterParams_t; + +/** + * Centralized parameter storage for all DSP flows + * Each DSP flow has its own isolated parameter set to prevent collisions + * when switching between flows. This ensures that changing "gain" in one + * flow doesn't affect "gain" in another flow. + */ +typedef struct dsp_all_params_s { + dspFlows_t active_flow; // Currently active DSP flow + + // Parameters for each DSP flow (indexed by dspFlows_t enum) + struct { + float fc_1; // Primary frequency (bass/crossover) + float gain_1; // Primary gain (bass/boost) + float fc_2; // Secondary frequency + float gain_2; // Secondary gain + float fc_3; // Tertiary frequency (treble/high crossover) + float gain_3; // Tertiary gain (treble) + } flow_params[6]; // One entry per dspFlows_t enum value +} dsp_all_params_t; + +// TODO: this is unused, remove??? +// Process flow +typedef struct pnode { + ptype_t process; + struct pnode *next; +} pnode_t; void dsp_processor_init(void); void dsp_processor_uninit(void); int dsp_processor_worker(void *pcmChnk, const void *scSet); esp_err_t dsp_processor_update_filter_params(filterParams_t *params); - void dsp_processor_set_volome(double volume); +/** + * Get current DSP flow + */ +dspFlows_t dsp_processor_get_current_flow(void); + +/** + * Get all parameters (centralized storage for all flows) + * Returns pointer to internal storage - do not modify directly + */ +const dsp_all_params_t* dsp_processor_get_all_params(void); + +/** + * Get parameters for a specific flow + * @param flow The DSP flow to get parameters for + * @param params Output parameter structure + * @return ESP_OK on success + */ +esp_err_t dsp_processor_get_params_for_flow(dspFlows_t flow, filterParams_t *params); + /** * Set parameters for a specific flow (without switching to it) * This allows updating parameters for a flow that's not currently active @@ -47,6 +160,13 @@ esp_err_t dsp_processor_set_params_for_flow(dspFlows_t flow, const filterParams_ */ esp_err_t dsp_processor_switch_flow(dspFlows_t flow); +/** + * Get DSP capabilities as JSON string. + * Returns a dynamically allocated string that must be freed by caller. + * Returns NULL on error. + */ +char* dsp_processor_get_capabilities_json(void); + #ifdef __cplusplus } #endif From c33637ee13f9af285cecffeb076b59ea836542a2 Mon Sep 17 00:00:00 2001 From: Andriy Malyshenko Date: Sat, 22 Nov 2025 01:02:21 +0100 Subject: [PATCH 07/58] post rebase cleanup --- components/custom_board/tas5805m/include/tas5805m.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/custom_board/tas5805m/include/tas5805m.h b/components/custom_board/tas5805m/include/tas5805m.h index 48337f77..e9d718c5 100644 --- a/components/custom_board/tas5805m/include/tas5805m.h +++ b/components/custom_board/tas5805m/include/tas5805m.h @@ -63,7 +63,9 @@ typedef enum { TAS5805M_CTRL_SLEEP = 0x01, // Sleep TAS5805M_CTRL_HI_Z = 0x02, // Hi-Z TAS5805M_CTRL_PLAY = 0x03, // Play - TAS5805M_CTRL_MUTE = 0x08 // Mute Flag + TAS5805M_CTRL_MUTE = 0x08, // Mute Flag + // Mute, but driver in PLAY state + TAS5805M_CTRL_PLAY_MUTE = TAS5805M_CTRL_MUTE | TAS5805M_CTRL_PLAY } TAS5805M_CTRL_STATE; typedef struct { From 1505272b0c5a887d6ad919997427654257a915ac Mon Sep 17 00:00:00 2001 From: Andriy Malyshenko Date: Sat, 22 Nov 2025 18:37:14 +0100 Subject: [PATCH 08/58] fix build errors --- components/ui_http_server/ui_http_server.c | 1565 ++++++++++---------- 1 file changed, 755 insertions(+), 810 deletions(-) diff --git a/components/ui_http_server/ui_http_server.c b/components/ui_http_server/ui_http_server.c index 06f02efa..59b3f35d 100644 --- a/components/ui_http_server/ui_http_server.c +++ b/components/ui_http_server/ui_http_server.c @@ -1,120 +1,201 @@ /* HTTP Server Example - This example code is in the Public Domain (or CC0 licensed, at your + This example code is in the Public Domain (or CC0 licensed, at your option.) - Unless required by applicable law or agreed to in writing, this - software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR - CONDITIONS OF ANY KIND, either express or implied. + Unless required by applicable law or agreed to in writing, this + software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + CONDITIONS OF ANY KIND, either express or implied. */ #include "ui_http_server.h" #include -#include -#include "dsp_processor_settings.h" +#include "dsp_processor.h" #include "esp_err.h" #include "esp_http_server.h" #include "esp_log.h" -#include "esp_system.h" +#include "esp_spiffs.h" +#include "esp_vfs.h" +#include "nvs_flash.h" #include "freertos/FreeRTOS.h" #include "freertos/queue.h" -#include "freertos/semphr.h" #include "freertos/task.h" -#include "settings_manager.h" +#include "freertos/semphr.h" +#include "hostname_manager.h" static const char *TAG = "UI_HTTP"; static QueueHandle_t xQueueHttp = NULL; static TaskHandle_t taskHandle = NULL; static httpd_handle_t server = NULL; +static SemaphoreHandle_t nvs_mutex = NULL; + +/** + * List files in SPIFFS directory + */ +static void SPIFFS_Directory(char *path) { + ESP_LOGD(TAG, "%s: path=%s", __func__, path); + DIR *dir = opendir(path); + assert(dir != NULL); + while (true) { + struct dirent *pe = readdir(dir); + if (!pe) break; + ESP_LOGI(TAG, "%s: d_name=%s/%s d_ino=%d d_type=%x", __func__, path, pe->d_name, + pe->d_ino, pe->d_type); + } + closedir(dir); +} -// External references to embedded files -extern const uint8_t index_html_start[] asm("_binary_index_html_start"); -extern const uint8_t index_html_end[] asm("_binary_index_html_end"); -extern const uint8_t index_js_start[] asm("_binary_index_js_start"); -extern const uint8_t index_js_end[] asm("_binary_index_js_end"); -extern const uint8_t styles_css_start[] asm("_binary_styles_css_start"); -extern const uint8_t styles_css_end[] asm("_binary_styles_css_end"); -extern const uint8_t general_settings_html_start[] asm("_binary_general_settings_html_start"); -extern const uint8_t general_settings_html_end[] asm("_binary_general_settings_html_end"); -extern const uint8_t dsp_settings_html_start[] asm("_binary_dsp_settings_html_start"); -extern const uint8_t dsp_settings_html_end[] asm("_binary_dsp_settings_html_end"); -extern const uint8_t favicon_ico_start[] asm("_binary_favicon_ico_start"); -extern const uint8_t favicon_ico_end[] asm("_binary_favicon_ico_end"); - -// Structure to map URI paths to embedded files -typedef struct { - const char *uri; - const uint8_t *data_start; - const uint8_t *data_end; - const char *content_type; -} embedded_file_t; - -static const embedded_file_t embedded_files[] = { - {"/", index_html_start, index_html_end, "text/html; charset=utf-8"}, - {"/index.html", index_html_start, index_html_end, "text/html; charset=utf-8"}, - {"/index.js", index_js_start, index_js_end, "application/javascript; charset=utf-8"}, - {"/styles.css", styles_css_start, styles_css_end, "text/css; charset=utf-8"}, - {"/general-settings.html", general_settings_html_start, general_settings_html_end, "text/html; charset=utf-8"}, - {"/dsp-settings.html", dsp_settings_html_start, dsp_settings_html_end, "text/html; charset=utf-8"}, - {"/favicon.ico", favicon_ico_start, favicon_ico_end, "image/x-icon"}, -}; +/** + * Helper: Generate flow-specific NVS key + * Format: "flow__" (e.g., "flow_5_fc_1" for dspfEQBassTreble bass freq) + * This prevents parameter collisions between different DSP flows + */ +static void make_flow_key(char *out_key, size_t out_size, dspFlows_t flow, const char *param) { + snprintf(out_key, out_size, "flow_%d_%s", (int)flow, param); +} + +/** + * Mount SPIFFS filesystem + */ +static esp_err_t SPIFFS_Mount(char *path, char *label, int max_files) { + ESP_LOGD(TAG, "%s: path=%s label=%s max_files=%d", __func__, path, label, max_files); + esp_err_t ret; + + if (!esp_spiffs_mounted(label)) { + esp_vfs_spiffs_conf_t conf = {.base_path = path, + .partition_label = label, + .max_files = max_files, + .format_if_mount_failed = true}; + + // Use settings defined above to initialize and mount SPIFFS file system. + // Note: esp_vfs_spiffs_register is an all-in-one convenience function. + ret = esp_vfs_spiffs_register(&conf); + + if (ret != ESP_OK) { + if (ret == ESP_FAIL) { + ESP_LOGE(TAG, "%s: Failed to mount or format filesystem", __func__); + } else if (ret == ESP_ERR_NOT_FOUND) { + ESP_LOGE(TAG, "%s: Failed to find SPIFFS partition", __func__); + } else { + ESP_LOGE(TAG, "%s: Failed to initialize SPIFFS (%s)", __func__, esp_err_to_name(ret)); + } + return ret; + } + } + + size_t total = 0, used = 0; + ret = esp_spiffs_info(label, &total, &used); + if (ret != ESP_OK) { + ESP_LOGE(TAG, "%s: Failed to get SPIFFS partition information (%s)", __func__, + esp_err_to_name(ret)); + } else { + ESP_LOGI(TAG, "%s: Partition size: total: %d, used: %d", __func__, total, used); + } + + if (ret == ESP_OK) { + ESP_LOGI(TAG, "%s: Mount %s to %s success", __func__, path, label); + SPIFFS_Directory(path); + } + + return ret; +} + +/** + * Convert text file to HTML response + */ +static esp_err_t Text2Html(httpd_req_t *req, char *filename) { + ESP_LOGD(TAG, "%s: filename=%s", __func__, filename); + // ESP_LOGI(TAG, "Reading %s", filename); + FILE *fhtml = fopen(filename, "r"); + if (fhtml == NULL) { + ESP_LOGE(TAG, "%s: fopen fail. [%s]", __func__, filename); + return ESP_FAIL; + } else { + char line[128]; + while (fgets(line, sizeof(line), fhtml) != NULL) { + size_t linelen = strlen(line); + // Remove EOL (CR or LF) but add back \n for proper line breaks + for (int i = linelen; i > 0; i--) { + if (line[i - 1] == 0x0a) { + line[i - 1] = 0; + } else if (line[i - 1] == 0x0d) { + line[i - 1] = 0; + } else { + break; + } + } + ESP_LOGV(TAG, "line=[%s]", line); + if (strlen(line) == 0) { + // Send empty line as newline to preserve structure + httpd_resp_sendstr_chunk(req, "\n"); + continue; + } + // Send line content + esp_err_t ret = httpd_resp_sendstr_chunk(req, line); + if (ret != ESP_OK) { + ESP_LOGE(TAG, "%s: httpd_resp_sendstr_chunk fail %d", __func__, ret); + } + // Add newline after each line to preserve line breaks + httpd_resp_sendstr_chunk(req, "\n"); + } + fclose(fhtml); + } + return ESP_OK; +} /** * Simple URL decode function * Decodes %XX hex sequences and + as space */ static void url_decode(char *dst, const char *src, size_t dst_size) { - size_t dst_idx = 0; - size_t src_idx = 0; - - while (src[src_idx] != '\0' && dst_idx < dst_size - 1) { - if (src[src_idx] == '%' && src[src_idx + 1] != '\0' && - src[src_idx + 2] != '\0') { - // Decode %XX - char hex[3] = {src[src_idx + 1], src[src_idx + 2], '\0'}; - dst[dst_idx++] = (char)strtol(hex, NULL, 16); - src_idx += 3; - } else if (src[src_idx] == '+') { - // Convert + to space - dst[dst_idx++] = ' '; - src_idx++; - } else { - dst[dst_idx++] = src[src_idx++]; - } - } - dst[dst_idx] = '\0'; + size_t dst_idx = 0; + size_t src_idx = 0; + + while (src[src_idx] != '\0' && dst_idx < dst_size - 1) { + if (src[src_idx] == '%' && src[src_idx + 1] != '\0' && src[src_idx + 2] != '\0') { + // Decode %XX + char hex[3] = {src[src_idx + 1], src[src_idx + 2], '\0'}; + dst[dst_idx++] = (char)strtol(hex, NULL, 16); + src_idx += 3; + } else if (src[src_idx] == '+') { + // Convert + to space + dst[dst_idx++] = ' '; + src_idx++; + } else { + dst[dst_idx++] = src[src_idx++]; + } + } + dst[dst_idx] = '\0'; } /** * Find key value in parameter string */ static int find_key_value(char *key, char *parameter, char *value) { - ESP_LOGD(TAG, "%s: key=%s", __func__, key); - // char * addr1; - char *addr1 = strstr(parameter, key); - if (addr1 == NULL) - return 0; - ESP_LOGD(TAG, "%s: addr1=%s", __func__, addr1); - - char *addr2 = addr1 + strlen(key); - ESP_LOGD(TAG, "%s: addr2=[%s]", __func__, addr2); - - char *addr3 = strstr(addr2, "&"); - ESP_LOGD(TAG, "%s: addr3=%p", __func__, addr3); - if (addr3 == NULL) { - strcpy(value, addr2); - } else { - int length = addr3 - addr2; - ESP_LOGD(TAG, "%s: addr2=%p addr3=%p length=%d", __func__, addr2, addr3, - length); - strncpy(value, addr2, length); - value[length] = 0; - } - ESP_LOGD(TAG, "%s: key=[%s] value=[%s]", __func__, key, value); - return strlen(value); + ESP_LOGD(TAG, "%s: key=%s", __func__, key); + // char * addr1; + char *addr1 = strstr(parameter, key); + if (addr1 == NULL) return 0; + ESP_LOGD(TAG, "%s: addr1=%s", __func__, addr1); + + char *addr2 = addr1 + strlen(key); + ESP_LOGD(TAG, "%s: addr2=[%s]", __func__, addr2); + + char *addr3 = strstr(addr2, "&"); + ESP_LOGD(TAG, "%s: addr3=%p", __func__, addr3); + if (addr3 == NULL) { + strcpy(value, addr2); + } else { + int length = addr3 - addr2; + ESP_LOGD(TAG, "%s: addr2=%p addr3=%p length=%d", __func__, addr2, addr3, length); + strncpy(value, addr2, length); + value[length] = 0; + } + ESP_LOGD(TAG, "%s: key=[%s] value=[%s]", __func__, key, value); + return strlen(value); } /** @@ -122,461 +203,216 @@ static int find_key_value(char *key, char *parameter, char *value) { * This enables local development with ?backend parameter */ static void set_cors_headers(httpd_req_t *req) { - httpd_resp_set_hdr(req, "Access-Control-Allow-Origin", "*"); - httpd_resp_set_hdr(req, "Access-Control-Allow-Methods", - "GET, POST, DELETE, OPTIONS"); - httpd_resp_set_hdr(req, "Access-Control-Allow-Headers", "Content-Type"); - httpd_resp_set_hdr(req, "Access-Control-Max-Age", "86400"); + httpd_resp_set_hdr(req, "Access-Control-Allow-Origin", "*"); + httpd_resp_set_hdr(req, "Access-Control-Allow-Methods", "GET, POST, OPTIONS"); + httpd_resp_set_hdr(req, "Access-Control-Allow-Headers", "Content-Type"); + httpd_resp_set_hdr(req, "Access-Control-Max-Age", "86400"); } /** - * HTTP get handler - serves index.html from embedded files + * HTTP get handler */ static esp_err_t root_get_handler(httpd_req_t *req) { - ESP_LOGD(TAG, "%s: uri=%s", __func__, req->uri); + ESP_LOGD(TAG, "%s: uri=%s", __func__, req->uri); - set_cors_headers(req); - httpd_resp_set_type(req, "text/html; charset=utf-8"); + set_cors_headers(req); - /* Send index.html from embedded data (subtract 1 for null terminator) */ - size_t index_size = index_html_end - index_html_start - 1; - httpd_resp_send(req, (const char *)index_html_start, index_size); + /* Send index.html */ + Text2Html(req, "/html/index.html"); - return ESP_OK; + /* Send empty chunk to signal HTTP response completion */ + httpd_resp_sendstr_chunk(req, NULL); + + return ESP_OK; } /* * HTTP post handler - * Expects a single parameter change in the query string: - * /post?param=NAME&value=INT + * Expects a single parameter change in the query string: /post?param=NAME&value=INT */ static esp_err_t root_post_handler(httpd_req_t *req) { - ESP_LOGD(TAG, "%s: uri=%s", __func__, req->uri); - URL_t urlBuf; - int ret = -1; - char param[16] = {0}; - char valstr[64] = {0}; // Increased size for hostname - - set_cors_headers(req); - - memset(&urlBuf, 0, sizeof(URL_t)); - - if (find_key_value("param=", (char *)req->uri, param) && - find_key_value("value=", (char *)req->uri, valstr)) { - - // Special handling for hostname (string parameter) - if (strcmp(param, "hostname") == 0) { - // URL decode the hostname value - char decoded_hostname[64] = {0}; - url_decode(decoded_hostname, valstr, sizeof(decoded_hostname)); - - ESP_LOGI(TAG, "%s: Setting hostname to: %s", __func__, - decoded_hostname); - - if (settings_set_hostname(decoded_hostname) == ESP_OK) { - httpd_resp_set_status(req, "200 OK"); - httpd_resp_sendstr(req, "ok"); - } else { - httpd_resp_set_status(req, "400 Bad Request"); - httpd_resp_sendstr(req, "Invalid hostname"); - } - return ESP_OK; - } - - // Special handling for snapserver host (string parameter) - if (strcmp(param, "snapserver_host") == 0) { - char decoded_host[128] = {0}; - url_decode(decoded_host, valstr, sizeof(decoded_host)); - ESP_LOGI(TAG, "%s: Setting snapserver_host to: %s", __func__, - decoded_host); - if (settings_set_server_host(decoded_host) == ESP_OK) { - httpd_resp_set_status(req, "200 OK"); - httpd_resp_sendstr(req, "ok"); - } else { - httpd_resp_set_status(req, "500 Internal Server Error"); - httpd_resp_sendstr(req, "error"); - } - return ESP_OK; - } - - // Special handling for snapserver_use_mdns (boolean/integer) - if (strcmp(param, "snapserver_use_mdns") == 0) { - long v = strtol(valstr, NULL, 10); - ESP_LOGI(TAG, "%s: Setting snapserver_use_mdns to: %ld", __func__, - v); - - if (settings_set_mdns_enabled(v != 0) == ESP_OK) { - httpd_resp_set_status(req, "200 OK"); - httpd_resp_sendstr(req, "ok"); - } else { - httpd_resp_set_status(req, "500 Internal Server Error"); - httpd_resp_sendstr(req, "error"); - } - return ESP_OK; - } - - // Special handling for snapserver_port (integer) - if (strcmp(param, "snapserver_port") == 0) { - long v = strtol(valstr, NULL, 10); - ESP_LOGI(TAG, "%s: Setting snapserver_port to: %ld", __func__, v); - if (settings_set_server_port((int32_t)v) == ESP_OK) { - httpd_resp_set_status(req, "200 OK"); - httpd_resp_sendstr(req, "ok"); - } else { - httpd_resp_set_status(req, "500 Internal Server Error"); - httpd_resp_sendstr(req, "error"); - } - return ESP_OK; - } - - // Parse integer value; strtol skips leading whitespace - long v = strtol(valstr, NULL, 10); - urlBuf.int_value = (int32_t)v; - snprintf(urlBuf.key, sizeof(urlBuf.key), "%s", param); - ret = 0; - ESP_LOGD(TAG, "%s: Received param=%s value=%ld", __func__, urlBuf.key, - (long)urlBuf.int_value); - } else { - ESP_LOGD(TAG, "%s: Invalid post: expected param=NAME&value=INT in URI", - __func__); - } - - if (ret >= 0) { - // Send to http_server_task with timeout to prevent handler from - // blocking indefinitely - if (xQueueSend(xQueueHttp, &urlBuf, pdMS_TO_TICKS(1000)) != pdPASS) { - ESP_LOGE(TAG, "%s: xQueueSend Fail (queue full or timeout)", - __func__); - httpd_resp_set_status(req, "503 Service Unavailable"); - httpd_resp_sendstr(req, "Queue full, try again"); - return ESP_OK; - } - } - - httpd_resp_set_status(req, "200 OK"); - httpd_resp_sendstr(req, "ok"); - return ESP_OK; -} - -/* - * HTTP DELETE handler - * Clears a parameter from NVS: /delete?param=NAME - */ -static esp_err_t root_delete_handler(httpd_req_t *req) { - ESP_LOGD(TAG, "%s: uri=%s", __func__, req->uri); - char param[32] = {0}; - - set_cors_headers(req); - - if (!find_key_value("param=", (char *)req->uri, param)) { - ESP_LOGD(TAG, "%s: Invalid delete: expected param=NAME in URI", - __func__); - httpd_resp_set_status(req, "400 Bad Request"); - httpd_resp_sendstr(req, "Missing param"); - return ESP_OK; - } - - // Handle hostname clear - if (strcmp(param, "hostname") == 0) { - ESP_LOGI(TAG, "%s: Clearing hostname from NVS", __func__); - if (settings_clear_hostname() == ESP_OK) { - httpd_resp_set_status(req, "200 OK"); - httpd_resp_sendstr(req, "ok"); - } else { - httpd_resp_set_status(req, "500 Internal Server Error"); - httpd_resp_sendstr(req, "error"); - } - return ESP_OK; - } - - // Handle snapserver_use_mdns clear - if (strcmp(param, "snapserver_use_mdns") == 0) { - ESP_LOGI(TAG, "%s: Clearing snapserver_use_mdns from NVS", __func__); - if (settings_clear_mdns_enabled() == ESP_OK) { - httpd_resp_set_status(req, "200 OK"); - httpd_resp_sendstr(req, "ok"); - } else { - httpd_resp_set_status(req, "500 Internal Server Error"); - httpd_resp_sendstr(req, "error"); - } - return ESP_OK; - } - - // Handle snapserver_host clear - if (strcmp(param, "snapserver_host") == 0) { - ESP_LOGI(TAG, "%s: Clearing snapserver_host from NVS", __func__); - if (settings_clear_server_host() == ESP_OK) { - httpd_resp_set_status(req, "200 OK"); - httpd_resp_sendstr(req, "ok"); - } else { - httpd_resp_set_status(req, "500 Internal Server Error"); - httpd_resp_sendstr(req, "error"); - } - return ESP_OK; - } - - // Handle snapserver_port clear - if (strcmp(param, "snapserver_port") == 0) { - ESP_LOGI(TAG, "%s: Clearing snapserver_port from NVS", __func__); - if (settings_clear_server_port() == ESP_OK) { - httpd_resp_set_status(req, "200 OK"); - httpd_resp_sendstr(req, "ok"); - } else { - httpd_resp_set_status(req, "500 Internal Server Error"); - httpd_resp_sendstr(req, "error"); - } - return ESP_OK; - } - - // Unknown parameter - httpd_resp_set_status(req, "400 Bad Request"); - httpd_resp_sendstr(req, "Unknown parameter"); - return ESP_OK; + ESP_LOGD(TAG, "%s: uri=%s", __func__, req->uri); + URL_t urlBuf; + int ret = -1; + char param[16] = {0}; + char valstr[64] = {0}; // Increased size for hostname + + set_cors_headers(req); + + memset(&urlBuf, 0, sizeof(URL_t)); + + if (find_key_value("param=", (char *)req->uri, param) && + find_key_value("value=", (char *)req->uri, valstr)) { + + // Special handling for hostname (string parameter) + if (strcmp(param, "hostname") == 0) { + // URL decode the hostname value + char decoded_hostname[64] = {0}; + url_decode(decoded_hostname, valstr, sizeof(decoded_hostname)); + + ESP_LOGI(TAG, "%s: Setting hostname to: %s", __func__, decoded_hostname); + + if (hostname_set(decoded_hostname) == ESP_OK) { + httpd_resp_set_status(req, "200 OK"); + httpd_resp_sendstr(req, "ok"); + } else { + httpd_resp_set_status(req, "400 Bad Request"); + httpd_resp_sendstr(req, "Invalid hostname"); + } + return ESP_OK; + } + + // Parse integer value; strtol skips leading whitespace + long v = strtol(valstr, NULL, 10); + urlBuf.int_value = (int32_t)v; + strncpy(urlBuf.key, param, sizeof(urlBuf.key) - 1); + ret = 0; + ESP_LOGD(TAG, "%s: Received param=%s value=%d", __func__, urlBuf.key, urlBuf.int_value); + } else { + ESP_LOGD(TAG, "%s: Invalid post: expected param=NAME&value=INT in URI", __func__); + } + + if (ret >= 0) { + // Send to http_server_task with timeout to prevent handler from blocking indefinitely + if (xQueueSend(xQueueHttp, &urlBuf, pdMS_TO_TICKS(1000)) != pdPASS) { + ESP_LOGE(TAG, "%s: xQueueSend Fail (queue full or timeout)", __func__); + httpd_resp_set_status(req, "503 Service Unavailable"); + httpd_resp_sendstr(req, "Queue full, try again"); + return ESP_OK; + } + } + + httpd_resp_set_status(req, "200 OK"); + httpd_resp_sendstr(req, "ok"); + return ESP_OK; } /* * GET parameter handler * Returns current parameter value: /get?param=NAME * Response format: plain text integer value - * + * * This reads from the DSP processor's centralized storage for the active flow */ static esp_err_t get_param_handler(httpd_req_t *req) { - ESP_LOGD(TAG, "%s: uri=%s", __func__, req->uri); - char param[16] = {0}; - - set_cors_headers(req); - - if (find_key_value("param=", (char *)req->uri, param)) { - // Special handling for hostname (string parameter) - if (strcmp(param, "hostname") == 0) { - char hostname[64] = {0}; - if (settings_get_hostname(hostname, sizeof(hostname)) == ESP_OK) { - httpd_resp_set_status(req, "200 OK"); - httpd_resp_set_type(req, "text/plain"); - httpd_resp_sendstr(req, hostname); - ESP_LOGD(TAG, "%s: hostname=%s", __func__, hostname); - } else { - httpd_resp_set_status(req, "500 Internal Server Error"); - httpd_resp_sendstr(req, "error"); - } - return ESP_OK; - } - - if (strcmp(param, "snapserver_use_mdns") == 0) { - bool enabled = true; - if (settings_get_mdns_enabled(&enabled) == ESP_OK) { - char resp[8]; - snprintf(resp, sizeof(resp), "%d", enabled ? 1 : 0); - httpd_resp_set_status(req, "200 OK"); - httpd_resp_set_type(req, "text/plain"); - httpd_resp_sendstr(req, resp); - ESP_LOGD(TAG, "%s: snapserver_use_mdns=%d", __func__, - enabled ? 1 : 0); - } else { - httpd_resp_set_status(req, "200 OK"); - httpd_resp_set_type(req, "text/plain"); - httpd_resp_sendstr(req, "1"); - ESP_LOGD( - TAG, - "%s: snapserver_use_mdns not found, returning default 1", - __func__); - } - return ESP_OK; - } - - if (strcmp(param, "snapserver_host") == 0) { - char host[128] = {0}; - if (settings_get_server_host(host, sizeof(host)) == ESP_OK) { - httpd_resp_set_status(req, "200 OK"); - httpd_resp_set_type(req, "text/plain"); - httpd_resp_sendstr(req, host); - ESP_LOGD(TAG, "%s: snapserver_host=%s", __func__, host); - } else { - httpd_resp_set_status(req, "200 OK"); - httpd_resp_set_type(req, "text/plain"); - httpd_resp_sendstr(req, ""); - ESP_LOGD(TAG, "%s: snapserver_host not found, returning empty", - __func__); - } - return ESP_OK; - } - - if (strcmp(param, "snapserver_port") == 0) { - int32_t port = 0; - if (settings_get_server_port(&port) == ESP_OK && port != 0) { - char resp[16]; - snprintf(resp, sizeof(resp), "%d", (int)port); - httpd_resp_set_status(req, "200 OK"); - httpd_resp_set_type(req, "text/plain"); - httpd_resp_sendstr(req, resp); - ESP_LOGD(TAG, "%s: snapserver_port=%d", __func__, (int)port); - } else { - httpd_resp_set_status(req, "200 OK"); - httpd_resp_set_type(req, "text/plain"); - httpd_resp_sendstr(req, ""); - ESP_LOGD(TAG, "%s: snapserver_port not found, returning empty", - __func__); - } - return ESP_OK; - } - + ESP_LOGD(TAG, "%s: uri=%s", __func__, req->uri); + char param[16] = {0}; + + set_cors_headers(req); + + if (find_key_value("param=", (char *)req->uri, param)) { + // Special handling for hostname (string parameter) + if (strcmp(param, "hostname") == 0) { + char hostname[64] = {0}; + if (hostname_get(hostname, sizeof(hostname)) == ESP_OK) { + httpd_resp_set_status(req, "200 OK"); + httpd_resp_set_type(req, "text/plain"); + httpd_resp_sendstr(req, hostname); + ESP_LOGD(TAG, "%s: hostname=%s", __func__, hostname); + } else { + httpd_resp_set_status(req, "500 Internal Server Error"); + httpd_resp_sendstr(req, "error"); + } + return ESP_OK; + } + #if CONFIG_USE_DSP_PROCESSOR - // Get current flow from settings - dspFlows_t current_flow = dsp_settings_get_active_flow(); - - // Get parameters for current flow - filterParams_t params; - if (dsp_settings_get_flow_params(current_flow, ¶ms) == ESP_OK) { - int32_t value = 0; // Map parameter name to value - if (strcmp(param, "fc_1") == 0) { - value = (int32_t)params.fc_1; - } else if (strcmp(param, "gain_1") == 0) { - value = (int32_t)params.gain_1; - } else if (strcmp(param, "fc_3") == 0) { - value = (int32_t)params.fc_3; - } else if (strcmp(param, "gain_3") == 0) { - value = (int32_t)params.gain_3; - } else { - httpd_resp_set_status(req, "400 Bad Request"); - httpd_resp_sendstr(req, "Unknown parameter"); - return ESP_OK; - } - - char response[32]; - snprintf(response, sizeof(response), "%d", (int)value); - httpd_resp_set_status(req, "200 OK"); - httpd_resp_set_type(req, "text/plain"); - httpd_resp_sendstr(req, response); - ESP_LOGD(TAG, "%s: flow=%d %s=%d", __func__, current_flow, param, - (int)value); - } else { - httpd_resp_set_status(req, "500 Internal Server Error"); - httpd_resp_sendstr(req, "0"); - } + // Get current flow from DSP processor + dspFlows_t current_flow = dsp_processor_get_current_flow(); + + // Get parameters for current flow + filterParams_t params; + if (dsp_processor_get_params_for_flow(current_flow, ¶ms) == ESP_OK) { + int32_t value = 0; + + // Map parameter name to value + if (strcmp(param, "fc_1") == 0) { + value = (int32_t)params.fc_1; + } else if (strcmp(param, "gain_1") == 0) { + value = (int32_t)params.gain_1; + } else if (strcmp(param, "fc_2") == 0) { + value = (int32_t)params.fc_2; + } else if (strcmp(param, "gain_2") == 0) { + value = (int32_t)params.gain_2; + } else if (strcmp(param, "fc_3") == 0) { + value = (int32_t)params.fc_3; + } else if (strcmp(param, "gain_3") == 0) { + value = (int32_t)params.gain_3; + } else { + httpd_resp_set_status(req, "400 Bad Request"); + httpd_resp_sendstr(req, "Unknown parameter"); + return ESP_OK; + } + + char response[32]; + snprintf(response, sizeof(response), "%d", (int)value); + httpd_resp_set_status(req, "200 OK"); + httpd_resp_set_type(req, "text/plain"); + httpd_resp_sendstr(req, response); + ESP_LOGD(TAG, "%s: flow=%d %s=%d", __func__, current_flow, param, (int)value); + } else { + httpd_resp_set_status(req, "500 Internal Server Error"); + httpd_resp_sendstr(req, "0"); + } #else - // Fallback: load from NVS using dsp_settings - dspFlows_t current_flow = dspfStereo; - if (dsp_settings_load_active_flow(¤t_flow) != ESP_OK) { - current_flow = dspfStereo; // default - } - - int32_t value = 0; - if (dsp_settings_load_flow_param(current_flow, param, &value) == - ESP_OK) { - char response[32]; - snprintf(response, sizeof(response), "%d", (int)value); - httpd_resp_set_status(req, "200 OK"); - httpd_resp_set_type(req, "text/plain"); - httpd_resp_sendstr(req, response); - ESP_LOGD(TAG, "%s: flow=%d %s=%d", __func__, current_flow, param, - (int)value); - } else { - httpd_resp_set_status(req, "404 Not Found"); - httpd_resp_sendstr(req, "0"); - ESP_LOGD(TAG, "%s: flow=%d %s not found, returning 0", __func__, - current_flow, param); - } + // Fallback: load from NVS with flow-specific key + int32_t active_flow_val = 0; + dspFlows_t current_flow = dspfEQBassTreble; + if (ui_http_load_param("active_flow", &active_flow_val) == ESP_OK) { + current_flow = (dspFlows_t)active_flow_val; + } + + char flow_key[32]; + make_flow_key(flow_key, sizeof(flow_key), current_flow, param); + + int32_t value = 0; + if (ui_http_load_param(flow_key, &value) == ESP_OK) { + char response[32]; + snprintf(response, sizeof(response), "%d", (int)value); + httpd_resp_set_status(req, "200 OK"); + httpd_resp_set_type(req, "text/plain"); + httpd_resp_sendstr(req, response); + ESP_LOGD(TAG, "%s: %s=%d", __func__, flow_key, (int)value); + } else { + httpd_resp_set_status(req, "404 Not Found"); + httpd_resp_sendstr(req, "0"); + ESP_LOGD(TAG, "%s: %s not found, returning 0", __func__, flow_key); + } #endif - } else { - httpd_resp_set_status(req, "400 Bad Request"); - httpd_resp_sendstr(req, "error"); - } - return ESP_OK; + } else { + httpd_resp_set_status(req, "400 Bad Request"); + httpd_resp_sendstr(req, "error"); + } + return ESP_OK; } /* * GET capabilities handler - * Returns settings based on the 'tab' parameter: /capabilities?tab=general or - * /capabilities?tab=dsp - * - * Response for tab=general: - * - hostname, mdns_enabled, server_host, server_port - * - * Response for tab=dsp (if DSP enabled): - * - active_flow and all flow parameters + * Returns DSP capabilities as JSON: /capabilities */ static esp_err_t get_capabilities_handler(httpd_req_t *req) { - ESP_LOGD(TAG, "%s: uri=%s", __func__, req->uri); - - set_cors_headers(req); - - // Parse tab parameter - char tab[16] = {0}; - if (!find_key_value("tab=", (char *)req->uri, tab)) { - // No tab specified, return error - ESP_LOGW(TAG, "%s: Missing 'tab' parameter", __func__); - httpd_resp_set_status(req, "400 Bad Request"); - httpd_resp_sendstr(req, "{\"error\": \"Missing 'tab' parameter. Use " - "?tab=general or ?tab=dsp\"}"); - return ESP_OK; - } - - ESP_LOGI(TAG, "%s: Requested tab: %s", __func__, tab); - - if (strcmp(tab, "general") == 0) { - // Return general settings - char general_json[512] = {0}; - esp_err_t ret = settings_get_json(general_json, sizeof(general_json)); - - if (ret != ESP_OK) { - ESP_LOGE(TAG, "%s: Failed to get general settings JSON: %s", - __func__, esp_err_to_name(ret)); - httpd_resp_set_status(req, "500 Internal Server Error"); - httpd_resp_sendstr( - req, "{\"error\": \"Failed to retrieve general settings\"}"); - return ESP_OK; - } - - httpd_resp_set_status(req, "200 OK"); - httpd_resp_set_type(req, "application/json"); - httpd_resp_sendstr(req, general_json); - - } else if (strcmp(tab, "dsp") == 0) { + ESP_LOGD(TAG, "%s: uri=%s", __func__, req->uri); + + set_cors_headers(req); + #if CONFIG_USE_DSP_PROCESSOR - // Return DSP settings - allocate larger buffer for schema + values - char *dsp_json = (char *)malloc(4096); - if (!dsp_json) { - ESP_LOGE(TAG, "%s: Failed to allocate memory for DSP JSON", - __func__); - httpd_resp_set_status(req, "500 Internal Server Error"); - httpd_resp_sendstr(req, - "{\"error\": \"Memory allocation failed\"}"); - return ESP_OK; - } - - esp_err_t ret = dsp_settings_get_json(dsp_json, 4096); - - if (ret != ESP_OK) { - ESP_LOGE(TAG, "%s: Failed to get DSP settings JSON: %s", __func__, - esp_err_to_name(ret)); - free(dsp_json); - httpd_resp_set_status(req, "500 Internal Server Error"); - httpd_resp_sendstr( - req, "{\"error\": \"Failed to retrieve DSP settings\"}"); - return ESP_OK; - } - - httpd_resp_set_status(req, "200 OK"); - httpd_resp_set_type(req, "application/json"); - httpd_resp_sendstr(req, dsp_json); - free(dsp_json); + char* capabilities_json = dsp_processor_get_capabilities_json(); + if (capabilities_json) { + httpd_resp_set_status(req, "200 OK"); + httpd_resp_set_type(req, "application/json"); + httpd_resp_sendstr(req, capabilities_json); + free(capabilities_json); + } else { + httpd_resp_set_status(req, "500 Internal Server Error"); + httpd_resp_sendstr(req, "{\"error\": \"Failed to generate capabilities\"}"); + } #else - // DSP not enabled - httpd_resp_set_status(req, "200 OK"); - httpd_resp_set_type(req, "application/json"); - httpd_resp_sendstr(req, "{\"dsp_enabled\": false}"); + httpd_resp_set_status(req, "200 OK"); + httpd_resp_set_type(req, "application/json"); + httpd_resp_sendstr(req, "{\"version\": \"1.0\", \"flows\": [], \"current_flow\": \"none\"}"); #endif - - } else { - // Unknown tab - ESP_LOGW(TAG, "%s: Unknown tab: %s", __func__, tab); - httpd_resp_set_status(req, "400 Bad Request"); - httpd_resp_sendstr( - req, "{\"error\": \"Unknown tab. Use ?tab=general or ?tab=dsp\"}"); - } - - return ESP_OK; + + return ESP_OK; } /* @@ -584,358 +420,467 @@ static esp_err_t get_capabilities_handler(httpd_req_t *req) { * Returns 404 since we don't have a favicon */ static esp_err_t favicon_get_handler(httpd_req_t *req) { - ESP_LOGD(TAG, "%s: uri=%s", __func__, req->uri); - set_cors_headers(req); - httpd_resp_set_status(req, "404 Not Found"); - httpd_resp_set_type(req, "text/plain"); - httpd_resp_sendstr(req, "No favicon available"); - return ESP_OK; -} - -/* Restart handler: responds OK and schedules a restart shortly after */ -static void restart_task(void *pv) { - // give HTTP stack time to finish sending response - vTaskDelay(pdMS_TO_TICKS(200)); - ESP_LOGI(TAG, "restart_task: calling esp_restart()"); - esp_restart(); - vTaskDelete(NULL); -} - -static esp_err_t restart_post_handler(httpd_req_t *req) { - ESP_LOGD(TAG, "%s: uri=%s", __func__, req->uri); - set_cors_headers(req); - - // Send immediate response before restarting - httpd_resp_set_status(req, "200 OK"); - httpd_resp_sendstr(req, "restarting"); - - // Spawn a task that will restart the chip after a short delay - BaseType_t ok = xTaskCreate(restart_task, "restart_task", 2048, NULL, 5, NULL); - if (ok != pdPASS) { - ESP_LOGW(TAG, "%s: Failed to create restart task", __func__); - } - - return ESP_OK; + ESP_LOGD(TAG, "%s: uri=%s", __func__, req->uri); + set_cors_headers(req); + httpd_resp_set_status(req, "404 Not Found"); + httpd_resp_set_type(req, "text/plain"); + httpd_resp_sendstr(req, "No favicon available"); + return ESP_OK; } /* * Static file handler - * Serves files from embedded flash memory + * Serves files from SPIFFS /html directory */ static esp_err_t static_file_handler(httpd_req_t *req) { - ESP_LOGD(TAG, "%s: uri=%s", __func__, req->uri); - - set_cors_headers(req); - - // Search for the requested file in embedded files - for (size_t i = 0; i < sizeof(embedded_files) / sizeof(embedded_file_t); i++) { - if (strcmp(req->uri, embedded_files[i].uri) == 0) { - // Found the file - size_t file_size = embedded_files[i].data_end - embedded_files[i].data_start; - - // EMBED_TXTFILES adds a null terminator, but we shouldn't send it - // Only subtract for text files (not binary like favicon) - if (strstr(embedded_files[i].content_type, "text/") != NULL || - strstr(embedded_files[i].content_type, "application/javascript") != NULL) { - file_size--; - } - - ESP_LOGD(TAG, "%s: Serving %s (%d bytes)", __func__, req->uri, file_size); - - httpd_resp_set_type(req, embedded_files[i].content_type); - httpd_resp_send(req, (const char *)embedded_files[i].data_start, file_size); - - return ESP_OK; - } - } - - // File not found - ESP_LOGW(TAG, "%s: File not found: %s", __func__, req->uri); - httpd_resp_set_status(req, "404 Not Found"); - httpd_resp_sendstr(req, "File not found"); - return ESP_OK; + ESP_LOGD(TAG, "%s: uri=%s", __func__, req->uri); + + set_cors_headers(req); + + // Build file path - use smaller buffer to save stack space + char filepath[128]; + // Check URI length to prevent truncation + if (strlen(req->uri) > sizeof(filepath) - 6) { // 6 = strlen("/html") + 1 + ESP_LOGW(TAG, "%s: URI too long: %s", __func__, req->uri); + httpd_resp_set_status(req, "414 URI Too Long"); + httpd_resp_sendstr(req, "URI too long"); + return ESP_OK; + } + snprintf(filepath, sizeof(filepath), "/html%s", req->uri); + + // Determine content type based on file extension + const char *content_type = "text/plain"; + if (strstr(req->uri, ".html")) { + content_type = "text/html"; + } else if (strstr(req->uri, ".css")) { + content_type = "text/css"; + } else if (strstr(req->uri, ".js")) { + content_type = "application/javascript"; + } else if (strstr(req->uri, ".json")) { + content_type = "application/json"; + } else if (strstr(req->uri, ".png")) { + content_type = "image/png"; + } else if (strstr(req->uri, ".jpg") || strstr(req->uri, ".jpeg")) { + content_type = "image/jpeg"; + } else if (strstr(req->uri, ".ico")) { + content_type = "image/x-icon"; + } + + // Try to open the file + FILE *file = fopen(filepath, "r"); + if (!file) { + ESP_LOGW(TAG, "%s: Failed to open file: %s", __func__, filepath); + httpd_resp_set_status(req, "404 Not Found"); + httpd_resp_sendstr(req, "File not found"); + return ESP_OK; + } + + // Set content type + httpd_resp_set_type(req, content_type); + + // Send file contents in chunks - use smaller buffer to save stack space + char buffer[256]; + size_t read_bytes; + while ((read_bytes = fread(buffer, 1, sizeof(buffer), file)) > 0) { + if (httpd_resp_send_chunk(req, buffer, read_bytes) != ESP_OK) { + fclose(file); + ESP_LOGE(TAG, "%s: Failed to send file chunk", __func__); + return ESP_FAIL; + } + } + + fclose(file); + + // Send empty chunk to signal completion + httpd_resp_send_chunk(req, NULL, 0); + + ESP_LOGD(TAG, "%s: Successfully sent file: %s", __func__, filepath); + return ESP_OK; } /* * OPTIONS handler for CORS preflight requests */ static esp_err_t options_handler(httpd_req_t *req) { - ESP_LOGD(TAG, "%s: uri=%s", __func__, req->uri); - set_cors_headers(req); - httpd_resp_set_status(req, "204 No Content"); - httpd_resp_send(req, NULL, 0); - return ESP_OK; + ESP_LOGD(TAG, "%s: uri=%s", __func__, req->uri); + set_cors_headers(req); + httpd_resp_set_status(req, "204 No Content"); + httpd_resp_send(req, NULL, 0); + return ESP_OK; } /** */ esp_err_t stop_server(void) { - ESP_LOGD(TAG, "%s", __func__); - if (server) { - httpd_stop(server); - server = NULL; - } + ESP_LOGD(TAG, "%s", __func__); + if (server) { + httpd_stop(server); + server = NULL; + } - return ESP_OK; + return ESP_OK; +} + +/** + * Save a single integer parameter to NVS under namespace "ui_http". + * Thread-safe with mutex protection. + */ +esp_err_t ui_http_save_param(const char *name, int32_t value) { + ESP_LOGD(TAG, "%s: name=%s value=%d", __func__, name, (int)value); + + if (!nvs_mutex) { + ESP_LOGE(TAG, "%s: NVS mutex not initialized", __func__); + return ESP_ERR_INVALID_STATE; + } + + // Acquire mutex with timeout to prevent deadlock + if (xSemaphoreTake(nvs_mutex, pdMS_TO_TICKS(5000)) != pdTRUE) { + ESP_LOGE(TAG, "%s: Failed to acquire NVS mutex (timeout)", __func__); + return ESP_ERR_TIMEOUT; + } + + nvs_handle_t h; + esp_err_t err = nvs_open("ui_http", NVS_READWRITE, &h); + if (err != ESP_OK) { + ESP_LOGE(TAG, "%s: nvs_open failed: %s", __func__, esp_err_to_name(err)); + xSemaphoreGive(nvs_mutex); + return err; + } + + err = nvs_set_i32(h, name, value); + if (err == ESP_OK) { + err = nvs_commit(h); + } + nvs_close(h); + + xSemaphoreGive(nvs_mutex); + + if (err != ESP_OK) { + ESP_LOGE(TAG, "%s: Failed to save param '%s': %s", __func__, name, esp_err_to_name(err)); + } + return err; +} + +/** + * Load a single integer parameter from NVS. Returns ESP_OK on success or + * ESP_ERR_NVS_NOT_FOUND if not present. + * Thread-safe with mutex protection. + */ +esp_err_t ui_http_load_param(const char *name, int32_t *value) { + ESP_LOGD(TAG, "%s: name=%s", __func__, name); + + if (!nvs_mutex) { + ESP_LOGE(TAG, "%s: NVS mutex not initialized", __func__); + return ESP_ERR_INVALID_STATE; + } + + // Acquire mutex with timeout to prevent deadlock + if (xSemaphoreTake(nvs_mutex, pdMS_TO_TICKS(5000)) != pdTRUE) { + ESP_LOGE(TAG, "%s: Failed to acquire NVS mutex (timeout)", __func__); + return ESP_ERR_TIMEOUT; + } + + nvs_handle_t h; + esp_err_t err = nvs_open("ui_http", NVS_READWRITE, &h); + if (err != ESP_OK) { + ESP_LOGW(TAG, "%s: nvs_open failed: %s", __func__, esp_err_to_name(err)); + xSemaphoreGive(nvs_mutex); + return err; + } + + int32_t tmp = 0; + err = nvs_get_i32(h, name, &tmp); + nvs_close(h); + + xSemaphoreGive(nvs_mutex); + + if (err == ESP_OK) { + *value = tmp; + } else { + ESP_LOGD(TAG, "%s: nvs_get_i32('%s') -> %s", __func__, name, esp_err_to_name(err)); + } + return err; } /* * Function to start the web server */ esp_err_t start_server(const char *base_path, int port) { - ESP_LOGD(TAG, "%s: base_path=%s port=%d", __func__, base_path, port); - httpd_config_t config = HTTPD_DEFAULT_CONFIG(); - config.server_port = port; - config.max_open_sockets = - 7; // Increased from 2 to handle concurrent requests better - config.max_uri_handlers = - 16; // Increased from default (8) to accommodate all handlers - config.lru_purge_enable = true; // Enable LRU socket purging - - /* Enable wildcard URI matching for static file handler */ - config.uri_match_fn = httpd_uri_match_wildcard; - - ESP_LOGI(TAG, "%s: Starting HTTP Server on port: '%d'", __func__, - config.server_port); - if (httpd_start(&server, &config) != ESP_OK) { - ESP_LOGE(TAG, "%s: Failed to start file server!", __func__); - return ESP_FAIL; - } - - /* URI handler for get */ - httpd_uri_t _root_get_handler = { - .uri = "/", - .method = HTTP_GET, - .handler = root_get_handler, - //.user_ctx = server_data // Pass server data as context - }; - httpd_register_uri_handler(server, &_root_get_handler); - - /* URI handler for post */ - httpd_uri_t _root_post_handler = { - .uri = "/post", - .method = HTTP_POST, - .handler = root_post_handler, - //.user_ctx = server_data // Pass server data as context - }; - httpd_register_uri_handler(server, &_root_post_handler); - - /* URI handler for delete */ - httpd_uri_t _root_delete_handler = { - .uri = "/delete", - .method = HTTP_DELETE, - .handler = root_delete_handler, - }; - httpd_register_uri_handler(server, &_root_delete_handler); - - /* URI handler for get parameter */ - httpd_uri_t _get_param_handler = { - .uri = "/get", - .method = HTTP_GET, - .handler = get_param_handler, - }; - httpd_register_uri_handler(server, &_get_param_handler); - - /* URI handler for capabilities */ - httpd_uri_t _get_capabilities_handler = { - .uri = "/capabilities", - .method = HTTP_GET, - .handler = get_capabilities_handler, - }; - httpd_register_uri_handler(server, &_get_capabilities_handler); - - /* URI handler for favicon.ico */ - httpd_uri_t _favicon_get_handler = { - .uri = "/favicon.ico", - .method = HTTP_GET, - .handler = favicon_get_handler, - //.user_ctx = server_data // Pass server data as context - }; - httpd_register_uri_handler(server, &_favicon_get_handler); - - /* URI handler for restart (POST) */ - httpd_uri_t _restart_post_handler = { - .uri = "/restart", - .method = HTTP_POST, - .handler = restart_post_handler, - }; - httpd_register_uri_handler(server, &_restart_post_handler); - - /* URI handler for OPTIONS (CORS preflight) - specific endpoints */ - httpd_uri_t _options_post_handler = { - .uri = "/post", - .method = HTTP_OPTIONS, - .handler = options_handler, - }; - httpd_register_uri_handler(server, &_options_post_handler); - - httpd_uri_t _options_get_handler = { - .uri = "/get", - .method = HTTP_OPTIONS, - .handler = options_handler, - }; - httpd_register_uri_handler(server, &_options_get_handler); - - httpd_uri_t _options_delete_handler = { - .uri = "/delete", - .method = HTTP_OPTIONS, - .handler = options_handler, - }; - httpd_register_uri_handler(server, &_options_delete_handler); - - httpd_uri_t _options_capabilities_handler = { - .uri = "/capabilities", - .method = HTTP_OPTIONS, - .handler = options_handler, - }; - httpd_register_uri_handler(server, &_options_capabilities_handler); - - httpd_uri_t _options_restart_handler = { - .uri = "/restart", - .method = HTTP_OPTIONS, - .handler = options_handler, - }; - httpd_register_uri_handler(server, &_options_restart_handler); - - /* URI handler for static files (catch-all, must be last) */ - httpd_uri_t _static_file_handler = { - .uri = "/*", - .method = HTTP_GET, - .handler = static_file_handler, - }; - esp_err_t ret = httpd_register_uri_handler(server, &_static_file_handler); - if (ret != ESP_OK) { - ESP_LOGE(TAG, "%s: Failed to register static file handler: %s", - __func__, esp_err_to_name(ret)); - } else { - ESP_LOGI(TAG, "%s: Static file handler registered for /*", __func__); - } - - return ESP_OK; + ESP_LOGD(TAG, "%s: base_path=%s port=%d", __func__, base_path, port); + httpd_config_t config = HTTPD_DEFAULT_CONFIG(); + config.server_port = port; + config.max_open_sockets = 7; // Increased from 2 to handle concurrent requests better + config.max_uri_handlers = 16; // Increased from default (8) to accommodate all handlers + config.lru_purge_enable = true; // Enable LRU socket purging + + /* Enable wildcard URI matching for static file handler */ + config.uri_match_fn = httpd_uri_match_wildcard; + + ESP_LOGI(TAG, "%s: Starting HTTP Server on port: '%d'", __func__, config.server_port); + if (httpd_start(&server, &config) != ESP_OK) { + ESP_LOGE(TAG, "%s: Failed to start file server!", __func__); + return ESP_FAIL; + } + + /* URI handler for get */ + httpd_uri_t _root_get_handler = { + .uri = "/", .method = HTTP_GET, .handler = root_get_handler, + //.user_ctx = server_data // Pass server data as context + }; + httpd_register_uri_handler(server, &_root_get_handler); + + /* URI handler for post */ + httpd_uri_t _root_post_handler = { + .uri = "/post", .method = HTTP_POST, .handler = root_post_handler, + //.user_ctx = server_data // Pass server data as context + }; + httpd_register_uri_handler(server, &_root_post_handler); + + /* URI handler for get parameter */ + httpd_uri_t _get_param_handler = { + .uri = "/get", .method = HTTP_GET, .handler = get_param_handler, + }; + httpd_register_uri_handler(server, &_get_param_handler); + + /* URI handler for capabilities */ + httpd_uri_t _get_capabilities_handler = { + .uri = "/capabilities", .method = HTTP_GET, .handler = get_capabilities_handler, + }; + httpd_register_uri_handler(server, &_get_capabilities_handler); + + /* URI handler for favicon.ico */ + httpd_uri_t _favicon_get_handler = { + .uri = "/favicon.ico", .method = HTTP_GET, .handler = favicon_get_handler, + //.user_ctx = server_data // Pass server data as context + }; + httpd_register_uri_handler(server, &_favicon_get_handler); + + /* URI handler for OPTIONS (CORS preflight) - specific endpoints */ + httpd_uri_t _options_post_handler = { + .uri = "/post", .method = HTTP_OPTIONS, .handler = options_handler, + }; + httpd_register_uri_handler(server, &_options_post_handler); + + httpd_uri_t _options_get_handler = { + .uri = "/get", .method = HTTP_OPTIONS, .handler = options_handler, + }; + httpd_register_uri_handler(server, &_options_get_handler); + + httpd_uri_t _options_capabilities_handler = { + .uri = "/capabilities", .method = HTTP_OPTIONS, .handler = options_handler, + }; + httpd_register_uri_handler(server, &_options_capabilities_handler); + + /* URI handler for static files (catch-all, must be last) */ + httpd_uri_t _static_file_handler = { + .uri = "/*", .method = HTTP_GET, .handler = static_file_handler, + }; + esp_err_t ret = httpd_register_uri_handler(server, &_static_file_handler); + if (ret != ESP_OK) { + ESP_LOGE(TAG, "%s: Failed to register static file handler: %s", __func__, esp_err_to_name(ret)); + } else { + ESP_LOGI(TAG, "%s: Static file handler registered for /*", __func__); + } + + return ESP_OK; } /** * HTTP Server task - manages DSP parameters with flow-specific storage */ static void http_server_task(void *pvParameters) { - ESP_LOGD(TAG, "%s: started", __func__); - // Start Server - ESP_ERROR_CHECK(start_server("/html", CONFIG_WEB_PORT)); - - // Ensure mdns setting has a default (true) on first boot - handled by - // settings_manager - bool tmp_mdns = true; - if (settings_get_mdns_enabled(&tmp_mdns) == ESP_OK) { - ESP_LOGD(TAG, "%s: mdns setting loaded: %d", __func__, - tmp_mdns ? 1 : 0); - } - - // DSP processor already loads parameters from NVS in dsp_processor_init() - // Just get the current active flow and parameters from DSP processor - dspFlows_t active_flow = dspfStereo; // default - filterParams_t current_params; - memset(¤t_params, 0, sizeof(filterParams_t)); - + ESP_LOGD(TAG, "%s: started", __func__); + // Start Server + ESP_ERROR_CHECK(start_server("/html", CONFIG_WEB_PORT)); + + // Load last active flow from NVS + int32_t tmpv = 0; + dspFlows_t active_flow = dspfEQBassTreble; // default + if (ui_http_load_param("active_flow", &tmpv) == ESP_OK) { + active_flow = (dspFlows_t)tmpv; + ESP_LOGI(TAG, "%s: Loaded active flow: %d", __func__, active_flow); + } + + // Load persisted parameters for all flows from NVS + char key[32]; + for (int flow = 0; flow < 6; flow++) { + filterParams_t params; + // Initialize all fields to zero + memset(¶ms, 0, sizeof(filterParams_t)); + params.dspFlow = (dspFlows_t)flow; + + // Initialize with defaults from DSP processor #if CONFIG_USE_DSP_PROCESSOR - active_flow = dsp_settings_get_active_flow(); - dsp_settings_get_flow_params(active_flow, ¤t_params); - ESP_LOGI(TAG, "%s: Current flow %d with fc_1=%.1f gain_1=%.1f", __func__, - active_flow, current_params.fc_1, current_params.gain_1); -#else - current_params.dspFlow = active_flow; + dsp_processor_get_params_for_flow((dspFlows_t)flow, ¶ms); #endif + + // Try to load persisted values (flow-specific keys) + make_flow_key(key, sizeof(key), (dspFlows_t)flow, "fc_1"); + if (ui_http_load_param(key, &tmpv) == ESP_OK) { + params.fc_1 = (float)tmpv; + } + + make_flow_key(key, sizeof(key), (dspFlows_t)flow, "gain_1"); + if (ui_http_load_param(key, &tmpv) == ESP_OK) { + params.gain_1 = (float)tmpv; + } + + make_flow_key(key, sizeof(key), (dspFlows_t)flow, "fc_2"); + if (ui_http_load_param(key, &tmpv) == ESP_OK) { + params.fc_2 = (float)tmpv; + } + + make_flow_key(key, sizeof(key), (dspFlows_t)flow, "gain_2"); + if (ui_http_load_param(key, &tmpv) == ESP_OK) { + params.gain_2 = (float)tmpv; + } + + make_flow_key(key, sizeof(key), (dspFlows_t)flow, "fc_3"); + if (ui_http_load_param(key, &tmpv) == ESP_OK) { + params.fc_3 = (float)tmpv; + } + + make_flow_key(key, sizeof(key), (dspFlows_t)flow, "gain_3"); + if (ui_http_load_param(key, &tmpv) == ESP_OK) { + params.gain_3 = (float)tmpv; + } + + // Store in DSP processor's centralized storage +#if CONFIG_USE_DSP_PROCESSOR + dsp_processor_set_params_for_flow((dspFlows_t)flow, ¶ms); +#endif + + ESP_LOGI(TAG, "%s: Loaded flow %d: fc_1=%.1f gain_1=%.1f fc_3=%.1f gain_3=%.1f", + __func__, flow, params.fc_1, params.gain_1, params.fc_3, params.gain_3); + } - URL_t urlBuf; - while (1) { - // Waiting for post - if (xQueueReceive(xQueueHttp, &urlBuf, portMAX_DELAY) == pdTRUE) { - ESP_LOGI(TAG, "%s: received update: %s = %ld", __func__, urlBuf.key, - (long)urlBuf.int_value); - - // Handle flow change specially - if (strcmp(urlBuf.key, "dspFlow") == 0) { - dspFlows_t new_flow = (dspFlows_t)urlBuf.int_value; +#if CONFIG_USE_DSP_PROCESSOR + // Switch to the active flow (this applies its parameters) + dsp_processor_switch_flow(active_flow); + ESP_LOGI(TAG, "%s: Switched to flow %d", __func__, active_flow); +#endif + // Get current active parameters + filterParams_t current_params; #if CONFIG_USE_DSP_PROCESSOR - // Switch to new flow (loads its stored parameters and notifies subscribers) - dsp_settings_switch_active_flow(new_flow); - // Get the parameters for the new flow - dsp_settings_get_flow_params(new_flow, ¤t_params); - ESP_LOGI(TAG, "%s: Switched to flow %d", __func__, new_flow); + dsp_processor_get_params_for_flow(active_flow, ¤t_params); #else - current_params.dspFlow = new_flow; + memset(¤t_params, 0, sizeof(filterParams_t)); + current_params.dspFlow = active_flow; #endif - continue; - } // Handle parameter updates for current flow - bool param_recognized = false; - dspFlows_t current_flow = current_params.dspFlow; - - if (strcmp(urlBuf.key, "fc_1") == 0) { - current_params.fc_1 = (float)urlBuf.int_value; - param_recognized = true; - } else if (strcmp(urlBuf.key, "gain_1") == 0) { - current_params.gain_1 = (float)urlBuf.int_value; - param_recognized = true; - } else if (strcmp(urlBuf.key, "fc_3") == 0) { - current_params.fc_3 = (float)urlBuf.int_value; - param_recognized = true; - } else if (strcmp(urlBuf.key, "gain_3") == 0) { - current_params.gain_3 = (float)urlBuf.int_value; - param_recognized = true; - } - - - if (!param_recognized) { - ESP_LOGW(TAG, "%s: Unknown param '%s' received, ignoring", - __func__, urlBuf.key); - continue; - } - - #if CONFIG_USE_DSP_PROCESSOR - // Update settings and notify subscribers (includes NVS persistence) - dsp_settings_set_flow_params(current_flow, ¤t_params); - ESP_LOGD(TAG, "%s: Updated %s = %ld", __func__, urlBuf.key, - (long)urlBuf.int_value); + URL_t urlBuf; + while (1) { + // Waiting for post + if (xQueueReceive(xQueueHttp, &urlBuf, portMAX_DELAY) == pdTRUE) { + ESP_LOGI(TAG, "%s: received update: %s = %d", __func__, urlBuf.key, urlBuf.int_value); + + // Handle flow change specially + if (strcmp(urlBuf.key, "dspFlow") == 0) { + dspFlows_t new_flow = (dspFlows_t)urlBuf.int_value; + + // Save current flow ID to NVS + if (ui_http_save_param("active_flow", (int32_t)new_flow) != ESP_OK) { + ESP_LOGW(TAG, "%s: Failed to persist active_flow to NVS", __func__); + } + +#if CONFIG_USE_DSP_PROCESSOR + // Switch to new flow (loads its stored parameters) + dsp_processor_switch_flow(new_flow); + // Get the parameters for the new flow + dsp_processor_get_params_for_flow(new_flow, ¤t_params); #else - // Persist parameter using dsp_settings (values are stored as - // int32_t) - if (dsp_settings_save_flow_param(current_flow, urlBuf.key, - urlBuf.int_value) != ESP_OK) { - ESP_LOGW(TAG, "%s: Failed to persist param '%s' to NVS", - __func__, urlBuf.key); - } else { - ESP_LOGD(TAG, "%s: Saved %s = %ld to NVS", __func__, urlBuf.key, - (long)urlBuf.int_value); - } + current_params.dspFlow = new_flow; +#endif + + ESP_LOGI(TAG, "%s: Switched to flow %d", __func__, new_flow); + continue; + } + + // Handle parameter updates for current flow + bool param_recognized = false; + dspFlows_t current_flow = current_params.dspFlow; + + if (strcmp(urlBuf.key, "fc_1") == 0) { + current_params.fc_1 = (float)urlBuf.int_value; + param_recognized = true; + } else if (strcmp(urlBuf.key, "gain_1") == 0) { + current_params.gain_1 = (float)urlBuf.int_value; + param_recognized = true; + } else if (strcmp(urlBuf.key, "fc_2") == 0) { + current_params.fc_2 = (float)urlBuf.int_value; + param_recognized = true; + } else if (strcmp(urlBuf.key, "gain_2") == 0) { + current_params.gain_2 = (float)urlBuf.int_value; + param_recognized = true; + } else if (strcmp(urlBuf.key, "fc_3") == 0) { + current_params.fc_3 = (float)urlBuf.int_value; + param_recognized = true; + } else if (strcmp(urlBuf.key, "gain_3") == 0) { + current_params.gain_3 = (float)urlBuf.int_value; + param_recognized = true; + } + + if (!param_recognized) { + ESP_LOGW(TAG, "%s: Unknown param '%s' received, ignoring", __func__, urlBuf.key); + continue; + } + +#if CONFIG_USE_DSP_PROCESSOR + // Apply updated params to DSP + dsp_processor_set_params_for_flow(current_flow, ¤t_params); #endif - } -} // Never reach here - ESP_LOGI(TAG, "%s: finish", __func__); - vTaskDelete(NULL); + + // Persist with flow-specific key + make_flow_key(key, sizeof(key), current_flow, urlBuf.key); + if (ui_http_save_param(key, urlBuf.int_value) != ESP_OK) { + ESP_LOGW(TAG, "%s: Failed to persist param '%s' to NVS", __func__, key); + } else { + ESP_LOGD(TAG, "%s: Saved %s = %d to NVS", __func__, key, urlBuf.int_value); + } + } + } + + // Never reach here + ESP_LOGI(TAG, "%s: finish", __func__); + vTaskDelete(NULL); } /** * */ void init_http_server_task(void) { - ESP_LOGD(TAG, "%s: initializing", __func__); - - // No SPIFFS mounting needed - files are embedded in flash - - // Create Queue - if (!xQueueHttp) { - xQueueHttp = xQueueCreate(10, sizeof(URL_t)); - configASSERT(xQueueHttp); - } - - if (taskHandle) { - stop_server(); - vTaskDelete(taskHandle); - taskHandle = NULL; - } - - // Stack size can be reduced from 512*8 since we're not using file I/O - xTaskCreatePinnedToCore(http_server_task, "HTTP", 512 * 6, NULL, 2, - &taskHandle, tskNO_AFFINITY); + ESP_LOGD(TAG, "%s: initializing", __func__); + + // Create NVS mutex if not already created + if (!nvs_mutex) { + nvs_mutex = xSemaphoreCreateMutex(); + if (!nvs_mutex) { + ESP_LOGE(TAG, "%s: Failed to create NVS mutex", __func__); + return; + } + } + + // Initialize SPIFFS + ESP_LOGI(TAG, "%s: Initializing SPIFFS", __func__); + if (SPIFFS_Mount("/html", "storage", 6) != ESP_OK) { + ESP_LOGE(TAG, "%s: SPIFFS mount failed", __func__); + return; + } + + // Create Queue + if (!xQueueHttp) { + xQueueHttp = xQueueCreate(10, sizeof(URL_t)); + configASSERT(xQueueHttp); + } + + if (taskHandle) { + stop_server(); + vTaskDelete(taskHandle); + taskHandle = NULL; + } + + // Increased stack size from 512*5 to 512*8 (4KB) to accommodate static file handler + xTaskCreatePinnedToCore(http_server_task, "HTTP", 512 * 8, NULL, 2, + &taskHandle, tskNO_AFFINITY); } From b908e45a6f029066bce6fc0190d55eb84a02cde3 Mon Sep 17 00:00:00 2001 From: Andriy Malyshenko Date: Mon, 24 Nov 2025 15:21:13 +0100 Subject: [PATCH 09/58] refactored away DSP settings into dedicated component. aligned general_settings component architecture. Fully data-driven front-end --- components/dsp_processor/CMakeLists.txt | 2 +- components/dsp_processor/dsp_capabilities.md | 152 --- components/dsp_processor/dsp_processor.c | 146 +-- .../dsp_processor/include/dsp_processor.h | 7 - .../dsp_processor_settings/CMakeLists.txt | 2 +- .../dsp_processor_settings.c | 1023 +++++++---------- .../include/dsp_processor_settings.h | 58 +- .../settings_manager/settings_manager.c | 15 +- main/main.c | 1 + 9 files changed, 469 insertions(+), 937 deletions(-) delete mode 100644 components/dsp_processor/dsp_capabilities.md diff --git a/components/dsp_processor/CMakeLists.txt b/components/dsp_processor/CMakeLists.txt index d8353364..87fd6744 100644 --- a/components/dsp_processor/CMakeLists.txt +++ b/components/dsp_processor/CMakeLists.txt @@ -1,5 +1,5 @@ set(COMPONENT_REQUIRES) -set(COMPONENT_PRIV_REQUIRES esp-dsp lightsnapcast) +set(COMPONENT_PRIV_REQUIRES esp-dsp lightsnapcast dsp_processor_settings) list(APPEND COMPONENT_ADD_INCLUDEDIRS ./include) set(COMPONENT_SRCS ./dsp_processor.c) diff --git a/components/dsp_processor/dsp_capabilities.md b/components/dsp_processor/dsp_capabilities.md deleted file mode 100644 index 1267ef25..00000000 --- a/components/dsp_processor/dsp_capabilities.md +++ /dev/null @@ -1,152 +0,0 @@ -# DSP Processor Dynamic Configuration Schema - -## Overview -This document defines the JSON structure for DSP processor capabilities that enables dynamic UI generation. - -## JSON Schema Example - -```json -{ - "version": "1.0", - "flows": [ - { - "id": "dspfEQBassTreble", - "name": "Bass & Treble EQ", - "description": "Simple 2-band equalizer with bass and treble controls", - "parameters": [ - { - "key": "fc_1", - "name": "Bass Frequency", - "type": "float", - "unit": "Hz", - "min": 50.0, - "max": 500.0, - "default": 300.0, - "step": 10.0, - "ui_control": "slider" - }, - { - "key": "gain_1", - "name": "Bass Gain", - "type": "float", - "unit": "dB", - "min": -12.0, - "max": 12.0, - "default": 0.0, - "step": 1.0, - "ui_control": "slider" - }, - { - "key": "fc_3", - "name": "Treble Frequency", - "type": "float", - "unit": "Hz", - "min": 2000.0, - "max": 12000.0, - "default": 4000.0, - "step": 100.0, - "ui_control": "slider" - }, - { - "key": "gain_3", - "name": "Treble Gain", - "type": "float", - "unit": "dB", - "min": -12.0, - "max": 12.0, - "default": 0.0, - "step": 1.0, - "ui_control": "slider" - } - ] - }, - { - "id": "dspfBassBoost", - "name": "Bass Boost", - "description": "Fixed +6dB bass enhancement", - "parameters": [ - { - "key": "fc_1", - "name": "Bass Frequency", - "type": "float", - "unit": "Hz", - "min": 50.0, - "max": 500.0, - "default": 300.0, - "step": 10.0, - "ui_control": "slider" - } - ] - }, - { - "id": "dspfBiamp", - "name": "Bi-Amp Crossover", - "description": "Channel 0: Low-pass, Channel 1: High-pass", - "parameters": [ - { - "key": "fc_1", - "name": "Crossover Frequency", - "type": "float", - "unit": "Hz", - "min": 80.0, - "max": 500.0, - "default": 300.0, - "step": 10.0, - "ui_control": "slider" - }, - { - "key": "gain_1", - "name": "Low-Pass Gain", - "type": "float", - "unit": "dB", - "min": -12.0, - "max": 12.0, - "default": 0.0, - "step": 1.0, - "ui_control": "slider" - }, - { - "key": "fc_3", - "name": "High-Pass Frequency", - "type": "float", - "unit": "Hz", - "min": 80.0, - "max": 500.0, - "default": 100.0, - "step": 10.0, - "ui_control": "slider" - }, - { - "key": "gain_3", - "name": "High-Pass Gain", - "type": "float", - "unit": "dB", - "min": -12.0, - "max": 12.0, - "default": 0.0, - "step": 1.0, - "ui_control": "slider" - } - ] - }, - { - "id": "dspfStereo", - "name": "Stereo Pass-Through", - "description": "No DSP processing, optional soft volume", - "parameters": [] - } - ], - "current_flow": "dspfEQBassTreble" -} -``` - -## Parameter Types -- `float`: Floating-point value -- `int`: Integer value -- `enum`: Enumerated value (requires `options` array) - -## UI Control Types -- `slider`: Continuous range slider -- `number`: Numeric input box -- `select`: Dropdown menu (for enums) -- `toggle`: On/off switch diff --git a/components/dsp_processor/dsp_processor.c b/components/dsp_processor/dsp_processor.c index e3230363..647f49df 100644 --- a/components/dsp_processor/dsp_processor.c +++ b/components/dsp_processor/dsp_processor.c @@ -8,6 +8,7 @@ #if CONFIG_USE_DSP_PROCESSOR #include "dsp_processor.h" +#include "dsp_processor_settings.h" #include "dsps_biquad.h" #include "dsps_biquad_gen.h" #include "esp_log.h" @@ -43,19 +44,9 @@ static float *sbufout0 = NULL; #if CONFIG_USE_DSP_PROCESSOR #define SNAPCAST_USE_SOFT_VOL CONFIG_SNAPCLIENT_USE_SOFT_VOL -#if CONFIG_SNAPCLIENT_DSP_FLOW_STEREO +// Default DSP flow is Stereo, but will be updated from NVS at runtime dspFlows_t dspFlowInit = dspfStereo; #endif -#if CONFIG_SNAPCLIENT_DSP_FLOW_BASSBOOST -dspFlows_t dspFlowInit = dspfBassBoost; -#endif -#if CONFIG_SNAPCLIENT_DSP_FLOW_BIAMP -dspFlows_t dspFlowInit = dspfBiamp; -#endif -#if CONFIG_SNAPCLIENT_DSP_FLOW_BASS_TREBLE_EQ -dspFlows_t dspFlowInit = dspfEQBassTreble; -#endif -#endif /** * @@ -100,6 +91,39 @@ void dsp_processor_init(void) { // dspfStereo has no parameters (pass-through with volume only) // dspf2DOT1 and dspfFunkyHonda not yet implemented + // Load saved parameters from NVS for all flows + ESP_LOGI(TAG, "%s: Loading saved parameters from NVS", __func__); + for (int flow = 0; flow < 6; flow++) { + int32_t fc_1, gain_1, fc_2, gain_2, fc_3, gain_3; + + // Load each parameter, keeping defaults if not found in NVS + if (dsp_settings_load_flow_param((dspFlows_t)flow, "fc_1", &fc_1) == ESP_OK) { + all_params.flow_params[flow].fc_1 = (float)fc_1; + } + if (dsp_settings_load_flow_param((dspFlows_t)flow, "gain_1", &gain_1) == ESP_OK) { + all_params.flow_params[flow].gain_1 = (float)gain_1; + } + if (dsp_settings_load_flow_param((dspFlows_t)flow, "fc_2", &fc_2) == ESP_OK) { + all_params.flow_params[flow].fc_2 = (float)fc_2; + } + if (dsp_settings_load_flow_param((dspFlows_t)flow, "gain_2", &gain_2) == ESP_OK) { + all_params.flow_params[flow].gain_2 = (float)gain_2; + } + if (dsp_settings_load_flow_param((dspFlows_t)flow, "fc_3", &fc_3) == ESP_OK) { + all_params.flow_params[flow].fc_3 = (float)fc_3; + } + if (dsp_settings_load_flow_param((dspFlows_t)flow, "gain_3", &gain_3) == ESP_OK) { + all_params.flow_params[flow].gain_3 = (float)gain_3; + } + } + + // Load saved active flow + dspFlows_t saved_flow; + if (dsp_settings_load_active_flow(&saved_flow) == ESP_OK) { + all_params.active_flow = saved_flow; + ESP_LOGI(TAG, "%s: Restored active flow: %d", __func__, saved_flow); + } + // Initialize legacy filterParams from active flow filterParams.dspFlow = all_params.active_flow; filterParams.fc_1 = all_params.flow_params[all_params.active_flow].fc_1; @@ -741,106 +765,6 @@ dspFlows_t dsp_processor_get_current_flow(void) { return filterParams.dspFlow; } -/** - * Get DSP capabilities as JSON string - * Caller must free the returned string - */ -char* dsp_processor_get_capabilities_json(void) { - ESP_LOGD(TAG, "%s: generating capabilities JSON", __func__); - // Pre-calculate required buffer size (approximate) - size_t buffer_size = 4096; - char* json = (char*)malloc(buffer_size); - if (!json) { - ESP_LOGE(TAG, "Failed to allocate memory for capabilities JSON"); - return NULL; - } - - int offset = 0; - - // Start JSON - offset += snprintf(json + offset, buffer_size - offset, - "{\n" - " \"version\": \"1.0\",\n" - " \"flows\": [\n"); - - // dspfStereo - offset += snprintf(json + offset, buffer_size - offset, - " {\n" - " \"id\": \"dspfStereo\",\n" - " \"name\": \"Stereo Pass-Through\",\n" - " \"description\": \"No DSP processing, optional soft volume\",\n" - " \"parameters\": []\n" - " },\n"); - - // dspfEQBassTreble - offset += snprintf(json + offset, buffer_size - offset, - " {\n" - " \"id\": \"dspfEQBassTreble\",\n" - " \"name\": \"Bass & Treble EQ\",\n" - " \"description\": \"Simple 2-band equalizer with bass and treble controls\",\n" - " \"parameters\": [\n" - " {\"key\": \"fc_1\", \"name\": \"Bass Frequency\", \"type\": \"float\", \"unit\": \"Hz\", \"min\": %.1f, \"max\": %.1f, \"default\": %.1f, \"step\": %.1f, \"ui_control\": \"slider\"},\n" - " {\"key\": \"gain_1\", \"name\": \"Bass Gain\", \"type\": \"float\", \"unit\": \"dB\", \"min\": %.1f, \"max\": %.1f, \"default\": %.1f, \"step\": %.1f, \"ui_control\": \"slider\"},\n" - " {\"key\": \"fc_3\", \"name\": \"Treble Frequency\", \"type\": \"float\", \"unit\": \"Hz\", \"min\": %.1f, \"max\": %.1f, \"default\": %.1f, \"step\": %.1f, \"ui_control\": \"slider\"},\n" - " {\"key\": \"gain_3\", \"name\": \"Treble Gain\", \"type\": \"float\", \"unit\": \"dB\", \"min\": %.1f, \"max\": %.1f, \"default\": %.1f, \"step\": %.1f, \"ui_control\": \"slider\"}\n" - " ]\n" - " },\n", - DSP_BASS_FREQ_MIN, DSP_BASS_FREQ_MAX, DSP_BASS_FREQ_DEFAULT, DSP_BASS_FREQ_STEP, - DSP_GAIN_MIN, DSP_GAIN_MAX, DSP_GAIN_DEFAULT, DSP_GAIN_STEP, - DSP_TREBLE_FREQ_MIN, DSP_TREBLE_FREQ_MAX, DSP_TREBLE_FREQ_DEFAULT, DSP_TREBLE_FREQ_STEP, - DSP_GAIN_MIN, DSP_GAIN_MAX, DSP_GAIN_DEFAULT, DSP_GAIN_STEP); - - // dspfBassBoost - offset += snprintf(json + offset, buffer_size - offset, - " {\n" - " \"id\": \"dspfBassBoost\",\n" - " \"name\": \"Bass Boost\",\n" - " \"description\": \"Adjustable bass enhancement\",\n" - " \"parameters\": [\n" - " {\"key\": \"fc_1\", \"name\": \"Bass Frequency\", \"type\": \"float\", \"unit\": \"Hz\", \"min\": %.1f, \"max\": %.1f, \"default\": %.1f, \"step\": %.1f, \"ui_control\": \"slider\"},\n" - " {\"key\": \"gain_1\", \"name\": \"Bass Gain\", \"type\": \"float\", \"unit\": \"dB\", \"min\": %.1f, \"max\": %.1f, \"default\": %.1f, \"step\": %.1f, \"ui_control\": \"slider\"}\n" - " ]\n" - " },\n", - DSP_BASS_FREQ_MIN, DSP_BASS_FREQ_MAX, DSP_BASS_FREQ_DEFAULT, DSP_BASS_FREQ_STEP, - DSP_BASSBOOST_GAIN_MIN, DSP_BASSBOOST_GAIN_MAX, DSP_BASSBOOST_GAIN_DEFAULT, DSP_BASSBOOST_GAIN_STEP); - - // dspfBiamp - offset += snprintf(json + offset, buffer_size - offset, - " {\n" - " \"id\": \"dspfBiamp\",\n" - " \"name\": \"Bi-Amp Crossover\",\n" - " \"description\": \"Channel 0: Low-pass, Channel 1: High-pass\",\n" - " \"parameters\": [\n" - " {\"key\": \"fc_1\", \"name\": \"Low-Pass Frequency\", \"type\": \"float\", \"unit\": \"Hz\", \"min\": %.1f, \"max\": %.1f, \"default\": %.1f, \"step\": %.1f, \"ui_control\": \"slider\"},\n" - " {\"key\": \"gain_1\", \"name\": \"Low-Pass Gain\", \"type\": \"float\", \"unit\": \"dB\", \"min\": %.1f, \"max\": %.1f, \"default\": %.1f, \"step\": %.1f, \"ui_control\": \"slider\"},\n" - " {\"key\": \"fc_3\", \"name\": \"High-Pass Frequency\", \"type\": \"float\", \"unit\": \"Hz\", \"min\": %.1f, \"max\": %.1f, \"default\": %.1f, \"step\": %.1f, \"ui_control\": \"slider\"},\n" - " {\"key\": \"gain_3\", \"name\": \"High-Pass Gain\", \"type\": \"float\", \"unit\": \"dB\", \"min\": %.1f, \"max\": %.1f, \"default\": %.1f, \"step\": %.1f, \"ui_control\": \"slider\"}\n" - " ]\n" - " }\n", - DSP_CROSSOVER_FREQ_MIN, DSP_CROSSOVER_FREQ_MAX, DSP_CROSSOVER_FREQ_DEFAULT, DSP_CROSSOVER_FREQ_STEP, - DSP_GAIN_MIN, DSP_GAIN_MAX, DSP_GAIN_DEFAULT, DSP_GAIN_STEP, - DSP_CROSSOVER_FREQ_MIN, DSP_CROSSOVER_FREQ_MAX, DSP_CROSSOVER_FREQ_DEFAULT, DSP_CROSSOVER_FREQ_STEP, - DSP_GAIN_MIN, DSP_GAIN_MAX, DSP_GAIN_DEFAULT, DSP_GAIN_STEP); - - // Close JSON - offset += snprintf(json + offset, buffer_size - offset, - " ],\n" - " \"current_flow\": \"%s\"\n" - "}\n", - filterParams.dspFlow == dspfEQBassTreble ? "dspfEQBassTreble" : - filterParams.dspFlow == dspfBassBoost ? "dspfBassBoost" : - filterParams.dspFlow == dspfBiamp ? "dspfBiamp" : - filterParams.dspFlow == dspfStereo ? "dspfStereo" : - filterParams.dspFlow == dspf2DOT1 ? "dspf2DOT1" : - filterParams.dspFlow == dspfFunkyHonda ? "dspfFunkyHonda" : "unknown"); - - if (offset >= buffer_size - 1) { - ESP_LOGW(TAG, "JSON buffer may have been truncated"); - } - - return json; -} - /** * Get all parameters (centralized storage) */ diff --git a/components/dsp_processor/include/dsp_processor.h b/components/dsp_processor/include/dsp_processor.h index 891d59b0..409def52 100644 --- a/components/dsp_processor/include/dsp_processor.h +++ b/components/dsp_processor/include/dsp_processor.h @@ -160,13 +160,6 @@ esp_err_t dsp_processor_set_params_for_flow(dspFlows_t flow, const filterParams_ */ esp_err_t dsp_processor_switch_flow(dspFlows_t flow); -/** - * Get DSP capabilities as JSON string. - * Returns a dynamically allocated string that must be freed by caller. - * Returns NULL on error. - */ -char* dsp_processor_get_capabilities_json(void); - #ifdef __cplusplus } #endif diff --git a/components/dsp_processor_settings/CMakeLists.txt b/components/dsp_processor_settings/CMakeLists.txt index 31cabb38..7e158df3 100644 --- a/components/dsp_processor_settings/CMakeLists.txt +++ b/components/dsp_processor_settings/CMakeLists.txt @@ -1,5 +1,5 @@ idf_component_register( SRCS "dsp_processor_settings.c" INCLUDE_DIRS "include" - REQUIRES nvs_flash json dsp_processor + REQUIRES nvs_flash dsp_processor json ) diff --git a/components/dsp_processor_settings/dsp_processor_settings.c b/components/dsp_processor_settings/dsp_processor_settings.c index 6685aae6..f1f48668 100644 --- a/components/dsp_processor_settings/dsp_processor_settings.c +++ b/components/dsp_processor_settings/dsp_processor_settings.c @@ -5,14 +5,13 @@ #include "dsp_processor_settings.h" -#include "cJSON.h" -#include "dsp_processor.h" +#include #include "esp_log.h" +#include "nvs_flash.h" +#include "nvs.h" #include "freertos/FreeRTOS.h" #include "freertos/semphr.h" -#include "nvs.h" -#include "nvs_flash.h" -#include +#include "cJSON.h" static const char *TAG = "dsp_settings"; static const char *NVS_NAMESPACE = "dsp_settings"; @@ -21,633 +20,435 @@ static const char *NVS_KEY_ACTIVE_FLOW = "active_flow"; // Mutex for thread-safe NVS access static SemaphoreHandle_t dsp_settings_mutex = NULL; - /** * Generate flow-specific NVS key * Format: "flow__" (e.g., "flow_5_fc_1") */ -static void make_flow_key(char *out_key, size_t out_size, dspFlows_t flow, - const char *param) { - if (!out_key || out_size == 0 || !param) { - return; - } - - snprintf(out_key, out_size, "flow_%d_%s", (int)flow, param); +static void make_flow_key(char *out_key, size_t out_size, dspFlows_t flow, const char *param) { + snprintf(out_key, out_size, "flow_%d_%s", (int)flow, param); } esp_err_t dsp_settings_init(void) { - if (dsp_settings_mutex == NULL) { - dsp_settings_mutex = xSemaphoreCreateMutex(); - if (dsp_settings_mutex == NULL) { - ESP_LOGE(TAG, "%s: Failed to create mutex", __func__); - return ESP_ERR_NO_MEM; - } - } - - ESP_LOGI(TAG, "%s: DSP settings manager initialized", __func__); - // Restore DSP parameters into dsp_processor so the processor has the - // persisted configuration after both modules are initialized. - // Note: caller (main) must initialize dsp_processor before calling - // dsp_settings_init() so these calls succeed. - dspFlows_t active = dspfStereo; - if (dsp_settings_load_active_flow(&active) == ESP_OK) { - ESP_LOGI(TAG, "%s: Restoring DSP active flow %d", __func__, active); - - // For each flow, load stored params and apply to dsp_processor - for (int f = 0; f < DSP_FLOW_COUNT; f++) { - filterParams_t params; - memset(¶ms, 0, sizeof(params)); - if (dsp_settings_get_flow_params((dspFlows_t)f, ¶ms) == ESP_OK) { - esp_err_t e = dsp_processor_set_params_for_flow((dspFlows_t)f, ¶ms); - if (e != ESP_OK) { - ESP_LOGW(TAG, "%s: Failed to apply params for flow %d: %s", __func__, f, esp_err_to_name(e)); - } else { - ESP_LOGD(TAG, "%s: Restored params for flow %d: fc_1=%.2f gain_1=%.2f fc_3=%.2f gain_3=%.2f", - __func__, f, params.fc_1, params.gain_1, params.fc_3, params.gain_3); - } - } else { - ESP_LOGD(TAG, "%s: No stored params for flow %d", __func__, f); - } - } - } - - // Finally, instruct dsp_processor to switch to the active flow - esp_err_t se = dsp_processor_switch_flow(active); - if (se != ESP_OK) { - ESP_LOGW(TAG, "%s: dsp_processor_switch_flow failed: %s", __func__, esp_err_to_name(se)); - } - return ESP_OK; + if (dsp_settings_mutex == NULL) { + dsp_settings_mutex = xSemaphoreCreateMutex(); + if (dsp_settings_mutex == NULL) { + ESP_LOGE(TAG, "%s: Failed to create mutex", __func__); + return ESP_ERR_NO_MEM; + } + } + + ESP_LOGI(TAG, "%s: DSP settings manager initialized", __func__); + return ESP_OK; } esp_err_t dsp_settings_save_active_flow(dspFlows_t flow) { - if (flow < 0 || flow >= DSP_FLOW_COUNT) { - ESP_LOGE(TAG, "%s: invalid flow %d", __func__, flow); - return ESP_ERR_INVALID_ARG; - } - - ESP_LOGD(TAG, "%s: flow=%d", __func__, (int)flow); - - if (!dsp_settings_mutex) { - ESP_LOGE(TAG, "%s: Not initialized", __func__); - return ESP_ERR_INVALID_STATE; - } - - if (xSemaphoreTake(dsp_settings_mutex, pdMS_TO_TICKS(5000)) != pdTRUE) { - ESP_LOGE(TAG, "%s: Failed to acquire mutex (timeout)", __func__); - return ESP_ERR_TIMEOUT; - } - - nvs_handle_t h; - esp_err_t err = nvs_open(NVS_NAMESPACE, NVS_READWRITE, &h); - if (err != ESP_OK) { - ESP_LOGE(TAG, "%s: Failed to open NVS: %s", __func__, - esp_err_to_name(err)); - xSemaphoreGive(dsp_settings_mutex); - return err; - } - - err = nvs_set_i32(h, NVS_KEY_ACTIVE_FLOW, (int32_t)flow); - if (err == ESP_OK) { - err = nvs_commit(h); - } - - nvs_close(h); - xSemaphoreGive(dsp_settings_mutex); - - if (err == ESP_OK) { - ESP_LOGI(TAG, "%s: Active flow saved: %d", __func__, (int)flow); - } else { - ESP_LOGE(TAG, "%s: Failed to save active flow: %s", __func__, - esp_err_to_name(err)); - } - - return err; + ESP_LOGD(TAG, "%s: flow=%d", __func__, (int)flow); + + if (!dsp_settings_mutex) { + ESP_LOGE(TAG, "%s: Not initialized", __func__); + return ESP_ERR_INVALID_STATE; + } + + if (xSemaphoreTake(dsp_settings_mutex, pdMS_TO_TICKS(5000)) != pdTRUE) { + ESP_LOGE(TAG, "%s: Failed to acquire mutex (timeout)", __func__); + return ESP_ERR_TIMEOUT; + } + + nvs_handle_t h; + esp_err_t err = nvs_open(NVS_NAMESPACE, NVS_READWRITE, &h); + if (err != ESP_OK) { + ESP_LOGE(TAG, "%s: Failed to open NVS: %s", __func__, esp_err_to_name(err)); + xSemaphoreGive(dsp_settings_mutex); + return err; + } + + err = nvs_set_i32(h, NVS_KEY_ACTIVE_FLOW, (int32_t)flow); + if (err == ESP_OK) { + err = nvs_commit(h); + } + + nvs_close(h); + xSemaphoreGive(dsp_settings_mutex); + + if (err == ESP_OK) { + ESP_LOGI(TAG, "%s: Active flow saved: %d", __func__, (int)flow); + } else { + ESP_LOGE(TAG, "%s: Failed to save active flow: %s", __func__, esp_err_to_name(err)); + } + + return err; } esp_err_t dsp_settings_load_active_flow(dspFlows_t *flow) { - ESP_LOGD(TAG, "%s: entered", __func__); - - if (!flow) - return ESP_ERR_INVALID_ARG; - if (!dsp_settings_mutex) - return ESP_ERR_INVALID_STATE; - - if (xSemaphoreTake(dsp_settings_mutex, pdMS_TO_TICKS(5000)) != pdTRUE) { - return ESP_ERR_TIMEOUT; - } - - nvs_handle_t h; - esp_err_t err = nvs_open(NVS_NAMESPACE, NVS_READONLY, &h); - if (err == ESP_OK) { - int32_t v = 0; - err = nvs_get_i32(h, NVS_KEY_ACTIVE_FLOW, &v); - nvs_close(h); - if (err == ESP_OK) { - *flow = (dspFlows_t)v; - ESP_LOGD(TAG, "%s: Active flow from NVS: %d", __func__, (int)*flow); - } else if (err != ESP_ERR_NVS_NOT_FOUND) { - ESP_LOGW(TAG, "%s: NVS read error: %s", __func__, - esp_err_to_name(err)); - } - } - - xSemaphoreGive(dsp_settings_mutex); - return err; + ESP_LOGD(TAG, "%s: entered", __func__); + + if (!flow) return ESP_ERR_INVALID_ARG; + if (!dsp_settings_mutex) return ESP_ERR_INVALID_STATE; + + if (xSemaphoreTake(dsp_settings_mutex, pdMS_TO_TICKS(5000)) != pdTRUE) { + return ESP_ERR_TIMEOUT; + } + + nvs_handle_t h; + esp_err_t err = nvs_open(NVS_NAMESPACE, NVS_READONLY, &h); + if (err == ESP_OK) { + int32_t v = 0; + err = nvs_get_i32(h, NVS_KEY_ACTIVE_FLOW, &v); + nvs_close(h); + if (err == ESP_OK) { + *flow = (dspFlows_t)v; + ESP_LOGD(TAG, "%s: Active flow from NVS: %d", __func__, (int)*flow); + } else if (err != ESP_ERR_NVS_NOT_FOUND) { + ESP_LOGW(TAG, "%s: NVS read error: %s", __func__, esp_err_to_name(err)); + } + } + + xSemaphoreGive(dsp_settings_mutex); + return err; } -esp_err_t dsp_settings_save_flow_param(dspFlows_t flow, const char *param_name, - int32_t value) { - ESP_LOGD(TAG, "%s: flow=%d param=%s value=%d", __func__, (int)flow, - param_name, (int)value); - - if (!param_name) - return ESP_ERR_INVALID_ARG; - if (!dsp_settings_mutex) - return ESP_ERR_INVALID_STATE; - - char key[32]; - make_flow_key(key, sizeof(key), flow, param_name); - - if (xSemaphoreTake(dsp_settings_mutex, pdMS_TO_TICKS(5000)) != pdTRUE) { - return ESP_ERR_TIMEOUT; - } - - nvs_handle_t h; - esp_err_t err = nvs_open(NVS_NAMESPACE, NVS_READWRITE, &h); - if (err != ESP_OK) { - xSemaphoreGive(dsp_settings_mutex); - return err; - } - - err = nvs_set_i32(h, key, value); - if (err == ESP_OK) { - err = nvs_commit(h); - } - - nvs_close(h); - xSemaphoreGive(dsp_settings_mutex); - - if (err == ESP_OK) { - ESP_LOGD(TAG, "%s: Saved %s=%d", __func__, key, (int)value); - } else { - ESP_LOGE(TAG, "%s: Failed to save %s: %s", __func__, key, - esp_err_to_name(err)); - } - - return err; +esp_err_t dsp_settings_save_flow_param(dspFlows_t flow, const char *param_name, int32_t value) { + ESP_LOGD(TAG, "%s: flow=%d param=%s value=%d", __func__, (int)flow, param_name, (int)value); + + if (!param_name) return ESP_ERR_INVALID_ARG; + if (!dsp_settings_mutex) return ESP_ERR_INVALID_STATE; + + char key[32]; + make_flow_key(key, sizeof(key), flow, param_name); + + if (xSemaphoreTake(dsp_settings_mutex, pdMS_TO_TICKS(5000)) != pdTRUE) { + return ESP_ERR_TIMEOUT; + } + + nvs_handle_t h; + esp_err_t err = nvs_open(NVS_NAMESPACE, NVS_READWRITE, &h); + if (err != ESP_OK) { + xSemaphoreGive(dsp_settings_mutex); + return err; + } + + err = nvs_set_i32(h, key, value); + if (err == ESP_OK) { + err = nvs_commit(h); + } + + nvs_close(h); + xSemaphoreGive(dsp_settings_mutex); + + if (err == ESP_OK) { + ESP_LOGD(TAG, "%s: Saved %s=%d", __func__, key, (int)value); + } else { + ESP_LOGE(TAG, "%s: Failed to save %s: %s", __func__, key, esp_err_to_name(err)); + } + + return err; } -esp_err_t dsp_settings_load_flow_param(dspFlows_t flow, const char *param_name, - int32_t *value) { - ESP_LOGV(TAG, "%s: flow=%d param=%s", __func__, (int)flow, param_name); - - if (!param_name || !value) - return ESP_ERR_INVALID_ARG; - if (!dsp_settings_mutex) - return ESP_ERR_INVALID_STATE; - - if (flow < 0 || flow >= DSP_FLOW_COUNT) { - ESP_LOGE(TAG, "%s: invalid flow %d", __func__, flow); - return ESP_ERR_INVALID_ARG; - } - - char key[32]; - make_flow_key(key, sizeof(key), flow, param_name); - - if (xSemaphoreTake(dsp_settings_mutex, pdMS_TO_TICKS(5000)) != pdTRUE) { - return ESP_ERR_TIMEOUT; - } - - nvs_handle_t h; - esp_err_t err = nvs_open(NVS_NAMESPACE, NVS_READONLY, &h); - if (err == ESP_OK) { - int32_t v = 0; - err = nvs_get_i32(h, key, &v); - nvs_close(h); - if (err == ESP_OK) { - *value = v; - ESP_LOGD(TAG, "%s: Loaded %s=%d", __func__, key, (int)*value); - } else if (err != ESP_ERR_NVS_NOT_FOUND) { - ESP_LOGW(TAG, "%s: NVS read error for %s: %s", __func__, key, - esp_err_to_name(err)); - } - } - - xSemaphoreGive(dsp_settings_mutex); - return err; +esp_err_t dsp_settings_load_flow_param(dspFlows_t flow, const char *param_name, int32_t *value) { + ESP_LOGD(TAG, "%s: flow=%d param=%s", __func__, (int)flow, param_name); + + if (!param_name || !value) return ESP_ERR_INVALID_ARG; + if (!dsp_settings_mutex) return ESP_ERR_INVALID_STATE; + + char key[32]; + make_flow_key(key, sizeof(key), flow, param_name); + + if (xSemaphoreTake(dsp_settings_mutex, pdMS_TO_TICKS(5000)) != pdTRUE) { + return ESP_ERR_TIMEOUT; + } + + nvs_handle_t h; + esp_err_t err = nvs_open(NVS_NAMESPACE, NVS_READONLY, &h); + if (err == ESP_OK) { + int32_t v = 0; + err = nvs_get_i32(h, key, &v); + nvs_close(h); + if (err == ESP_OK) { + *value = v; + ESP_LOGD(TAG, "%s: Loaded %s=%d", __func__, key, (int)*value); + } else if (err != ESP_ERR_NVS_NOT_FOUND) { + ESP_LOGW(TAG, "%s: NVS read error for %s: %s", __func__, key, esp_err_to_name(err)); + } + } + + xSemaphoreGive(dsp_settings_mutex); + return err; } esp_err_t dsp_settings_get_json(char *json_out, size_t max_len) { - ESP_LOGI(TAG, "%s: Start - buffer=%p size=%zu", __func__, json_out, - max_len); - - if (!json_out || max_len == 0) { - ESP_LOGE(TAG, "%s: Invalid arguments", __func__); - return ESP_ERR_INVALID_ARG; - } - - cJSON *root = cJSON_CreateObject(); - if (!root) { - ESP_LOGE(TAG, "%s: Failed to create JSON object", __func__); - return ESP_ERR_NO_MEM; - } - - // Add active flow. Default to Stereo pass-through if nothing is stored - // Attempt to load stored value; if not present, keep the default. - dspFlows_t active_flow = dspfStereo; // default - (void)dsp_settings_load_active_flow(&active_flow); - cJSON_AddNumberToObject(root, "active_flow", (int)active_flow); - - // Add flow schema with current values - cJSON *schema = cJSON_CreateArray(); - if (!schema) { - cJSON_Delete(root); - return ESP_ERR_NO_MEM; - } - - // Flow: dspfStereo (0) - cJSON *stereo = cJSON_CreateObject(); - cJSON_AddStringToObject(stereo, "id", "dspfStereo"); - cJSON_AddStringToObject(stereo, "name", "Stereo Pass-Through"); - cJSON_AddStringToObject(stereo, "description", - "No DSP processing, optional soft volume"); - cJSON_AddNumberToObject(stereo, "enum_value", 0); - cJSON_AddItemToObject(stereo, "parameters", cJSON_CreateArray()); - cJSON_AddItemToArray(schema, stereo); - - // Flow: dspfEQBassTreble (5) - cJSON *eq = cJSON_CreateObject(); - cJSON_AddStringToObject(eq, "id", "dspfEQBassTreble"); - cJSON_AddStringToObject(eq, "name", "Bass & Treble EQ"); - cJSON_AddStringToObject( - eq, "description", - "Simple 2-band equalizer with bass and treble controls"); - cJSON_AddNumberToObject(eq, "enum_value", 5); - cJSON *eq_params = cJSON_CreateArray(); - - // Bass frequency - cJSON *p1 = cJSON_CreateObject(); - cJSON_AddStringToObject(p1, "key", "fc_1"); - cJSON_AddStringToObject(p1, "name", "Bass Frequency"); - cJSON_AddStringToObject(p1, "unit", "Hz"); - cJSON_AddNumberToObject(p1, "min", (int)DSP_BASS_FREQ_MIN); - cJSON_AddNumberToObject(p1, "max", (int)DSP_BASS_FREQ_MAX); - cJSON_AddNumberToObject(p1, "default", (int)DSP_BASS_FREQ_DEFAULT); - cJSON_AddNumberToObject(p1, "step", (int)DSP_BASS_FREQ_STEP); - int32_t val_fc1 = 100; - dsp_settings_load_flow_param(dspfEQBassTreble, "fc_1", &val_fc1); - cJSON_AddNumberToObject(p1, "current", val_fc1); - cJSON_AddItemToArray(eq_params, p1); - - // Bass gain - cJSON *p2 = cJSON_CreateObject(); - cJSON_AddStringToObject(p2, "key", "gain_1"); - cJSON_AddStringToObject(p2, "name", "Bass Gain"); - cJSON_AddStringToObject(p2, "unit", "dB"); - cJSON_AddNumberToObject(p2, "min", (int)DSP_GAIN_MIN); - cJSON_AddNumberToObject(p2, "max", (int)DSP_GAIN_MAX); - cJSON_AddNumberToObject(p2, "default", (int)DSP_GAIN_DEFAULT); - cJSON_AddNumberToObject(p2, "step", (int)DSP_GAIN_STEP); - int32_t val_g1 = 0; - dsp_settings_load_flow_param(dspfEQBassTreble, "gain_1", &val_g1); - cJSON_AddNumberToObject(p2, "current", val_g1); - cJSON_AddItemToArray(eq_params, p2); - - // Treble frequency - cJSON *p3 = cJSON_CreateObject(); - cJSON_AddStringToObject(p3, "key", "fc_3"); - cJSON_AddStringToObject(p3, "name", "Treble Frequency"); - cJSON_AddStringToObject(p3, "unit", "Hz"); - cJSON_AddNumberToObject(p3, "min", (int)DSP_TREBLE_FREQ_MIN); - cJSON_AddNumberToObject(p3, "max", (int)DSP_TREBLE_FREQ_MAX); - cJSON_AddNumberToObject(p3, "default", (int)DSP_TREBLE_FREQ_DEFAULT); - cJSON_AddNumberToObject(p3, "step", (int)DSP_TREBLE_FREQ_STEP); - int32_t val_fc3 = 8000; - dsp_settings_load_flow_param(dspfEQBassTreble, "fc_3", &val_fc3); - cJSON_AddNumberToObject(p3, "current", val_fc3); - cJSON_AddItemToArray(eq_params, p3); - - // Treble gain - cJSON *p4 = cJSON_CreateObject(); - cJSON_AddStringToObject(p4, "key", "gain_3"); - cJSON_AddStringToObject(p4, "name", "Treble Gain"); - cJSON_AddStringToObject(p4, "unit", "dB"); - cJSON_AddNumberToObject(p4, "min", (int)DSP_GAIN_MIN); - cJSON_AddNumberToObject(p4, "max", (int)DSP_GAIN_MAX); - cJSON_AddNumberToObject(p4, "default", (int)DSP_GAIN_DEFAULT); - cJSON_AddNumberToObject(p4, "step", (int)DSP_GAIN_STEP); - int32_t val_g3 = 0; - dsp_settings_load_flow_param(dspfEQBassTreble, "gain_3", &val_g3); - cJSON_AddNumberToObject(p4, "current", val_g3); - cJSON_AddItemToArray(eq_params, p4); - - cJSON_AddItemToObject(eq, "parameters", eq_params); - cJSON_AddItemToArray(schema, eq); - - // Flow: dspfBassBoost (4) - cJSON *boost = cJSON_CreateObject(); - cJSON_AddStringToObject(boost, "id", "dspfBassBoost"); - cJSON_AddStringToObject(boost, "name", "Bass Boost"); - cJSON_AddStringToObject(boost, "description", - "Adjustable bass enhancement"); - cJSON_AddNumberToObject(boost, "enum_value", 4); - cJSON *boost_params = cJSON_CreateArray(); - - cJSON *bp1 = cJSON_CreateObject(); - cJSON_AddStringToObject(bp1, "key", "fc_1"); - cJSON_AddStringToObject(bp1, "name", "Bass Frequency"); - cJSON_AddStringToObject(bp1, "unit", "Hz"); - cJSON_AddNumberToObject(bp1, "min", (int)DSP_BASS_FREQ_MIN); - cJSON_AddNumberToObject(bp1, "max", (int)DSP_BASS_FREQ_MAX); - cJSON_AddNumberToObject(bp1, "default", (int)DSP_BASS_FREQ_DEFAULT); - cJSON_AddNumberToObject(bp1, "step", (int)DSP_BASS_FREQ_STEP); - int32_t val_b_fc1 = 100; - dsp_settings_load_flow_param(dspfBassBoost, "fc_1", &val_b_fc1); - cJSON_AddNumberToObject(bp1, "current", val_b_fc1); - cJSON_AddItemToArray(boost_params, bp1); - - cJSON *bp2 = cJSON_CreateObject(); - cJSON_AddStringToObject(bp2, "key", "gain_1"); - cJSON_AddStringToObject(bp2, "name", "Bass Gain"); - cJSON_AddStringToObject(bp2, "unit", "dB"); - cJSON_AddNumberToObject(bp2, "min", (int)DSP_BASSBOOST_GAIN_MIN); - cJSON_AddNumberToObject(bp2, "max", (int)DSP_BASSBOOST_GAIN_MAX); - cJSON_AddNumberToObject(bp2, "default", (int)DSP_BASSBOOST_GAIN_DEFAULT); - cJSON_AddNumberToObject(bp2, "step", (int)DSP_BASSBOOST_GAIN_STEP); - int32_t val_b_g1 = 12; - dsp_settings_load_flow_param(dspfBassBoost, "gain_1", &val_b_g1); - cJSON_AddNumberToObject(bp2, "current", val_b_g1); - cJSON_AddItemToArray(boost_params, bp2); - - cJSON_AddItemToObject(boost, "parameters", boost_params); - cJSON_AddItemToArray(schema, boost); - - // Flow: dspfBiamp (1) - cJSON *biamp = cJSON_CreateObject(); - cJSON_AddStringToObject(biamp, "id", "dspfBiamp"); - cJSON_AddStringToObject(biamp, "name", "Bi-Amp Crossover"); - cJSON_AddStringToObject(biamp, "description", - "Channel 0: Low-pass, Channel 1: High-pass"); - cJSON_AddNumberToObject(biamp, "enum_value", 1); - cJSON *biamp_params = cJSON_CreateArray(); - - cJSON *bip1 = cJSON_CreateObject(); - cJSON_AddStringToObject(bip1, "key", "fc_1"); - cJSON_AddStringToObject(bip1, "name", "Low-Pass Frequency"); - cJSON_AddStringToObject(bip1, "unit", "Hz"); - cJSON_AddNumberToObject(bip1, "min", (int)DSP_CROSSOVER_FREQ_MIN); - cJSON_AddNumberToObject(bip1, "max", (int)DSP_CROSSOVER_FREQ_MAX); - cJSON_AddNumberToObject(bip1, "default", (int)DSP_CROSSOVER_FREQ_DEFAULT); - cJSON_AddNumberToObject(bip1, "step", (int)DSP_CROSSOVER_FREQ_STEP); - int32_t val_bi_fc1 = 200; - dsp_settings_load_flow_param(dspfBiamp, "fc_1", &val_bi_fc1); - cJSON_AddNumberToObject(bip1, "current", val_bi_fc1); - cJSON_AddItemToArray(biamp_params, bip1); - - cJSON *bip2 = cJSON_CreateObject(); - cJSON_AddStringToObject(bip2, "key", "gain_1"); - cJSON_AddStringToObject(bip2, "name", "Low-Pass Gain"); - cJSON_AddStringToObject(bip2, "unit", "dB"); - cJSON_AddNumberToObject(bip2, "min", (int)DSP_GAIN_MIN); - cJSON_AddNumberToObject(bip2, "max", (int)DSP_GAIN_MAX); - cJSON_AddNumberToObject(bip2, "default", (int)DSP_GAIN_DEFAULT); - cJSON_AddNumberToObject(bip2, "step", (int)DSP_GAIN_STEP); - int32_t val_bi_g1 = 0; - dsp_settings_load_flow_param(dspfBiamp, "gain_1", &val_bi_g1); - cJSON_AddNumberToObject(bip2, "current", val_bi_g1); - cJSON_AddItemToArray(biamp_params, bip2); - - cJSON *bip3 = cJSON_CreateObject(); - cJSON_AddStringToObject(bip3, "key", "fc_3"); - cJSON_AddStringToObject(bip3, "name", "High-Pass Frequency"); - cJSON_AddStringToObject(bip3, "unit", "Hz"); - cJSON_AddNumberToObject(bip3, "min", (int)DSP_CROSSOVER_FREQ_MIN); - cJSON_AddNumberToObject(bip3, "max", (int)DSP_CROSSOVER_FREQ_MAX); - cJSON_AddNumberToObject(bip3, "default", (int)DSP_CROSSOVER_FREQ_DEFAULT); - cJSON_AddNumberToObject(bip3, "step", (int)DSP_CROSSOVER_FREQ_STEP); - int32_t val_bi_fc3 = 200; - dsp_settings_load_flow_param(dspfBiamp, "fc_3", &val_bi_fc3); - cJSON_AddNumberToObject(bip3, "current", val_bi_fc3); - cJSON_AddItemToArray(biamp_params, bip3); - - cJSON *bip4 = cJSON_CreateObject(); - cJSON_AddStringToObject(bip4, "key", "gain_3"); - cJSON_AddStringToObject(bip4, "name", "High-Pass Gain"); - cJSON_AddStringToObject(bip4, "unit", "dB"); - cJSON_AddNumberToObject(bip4, "min", (int)DSP_GAIN_MIN); - cJSON_AddNumberToObject(bip4, "max", (int)DSP_GAIN_MAX); - cJSON_AddNumberToObject(bip4, "default", (int)DSP_GAIN_DEFAULT); - cJSON_AddNumberToObject(bip4, "step", (int)DSP_GAIN_STEP); - int32_t val_bi_g3 = 0; - dsp_settings_load_flow_param(dspfBiamp, "gain_3", &val_bi_g3); - cJSON_AddNumberToObject(bip4, "current", val_bi_g3); - cJSON_AddItemToArray(biamp_params, bip4); - - cJSON_AddItemToObject(biamp, "parameters", biamp_params); - cJSON_AddItemToArray(schema, biamp); - - cJSON_AddItemToObject(root, "flows", schema); - - // Render to string - char *json_str = cJSON_PrintUnformatted(root); - cJSON_Delete(root); - - if (!json_str) { - ESP_LOGE(TAG, "%s: Failed to render JSON", __func__); - return ESP_ERR_NO_MEM; - } - - size_t json_len = strlen(json_str); - ESP_LOGI(TAG, "%s: Generated JSON size: %zu bytes (buffer size: %zu)", - __func__, json_len, max_len); - - if (json_len >= max_len) { - ESP_LOGE(TAG, "%s: JSON too large for buffer (%zu >= %zu)", __func__, - json_len, max_len); - cJSON_free(json_str); - return ESP_ERR_INVALID_SIZE; - } - - strncpy(json_out, json_str, max_len - 1); - json_out[max_len - 1] = '\0'; - cJSON_free(json_str); - - ESP_LOGV(TAG, "%s: JSON generated: %s", __func__, json_out); - return ESP_OK; + ESP_LOGI(TAG, "%s: Start - buffer=%p size=%zu", __func__, json_out, max_len); + + if (!json_out || max_len == 0) { + ESP_LOGE(TAG, "%s: Invalid arguments", __func__); + return ESP_ERR_INVALID_ARG; + } + + cJSON *root = cJSON_CreateObject(); + if (!root) { + ESP_LOGE(TAG, "%s: Failed to create JSON object", __func__); + return ESP_ERR_NO_MEM; + } + + // Add active flow + dspFlows_t active_flow = dspfEQBassTreble; // default + if (dsp_settings_load_active_flow(&active_flow) == ESP_OK) { + cJSON_AddNumberToObject(root, "active_flow", (int)active_flow); + } + + // Add flow schema with current values + cJSON *schema = cJSON_CreateArray(); + if (!schema) { + cJSON_Delete(root); + return ESP_ERR_NO_MEM; + } + + // Flow: dspfStereo (0) + cJSON *stereo = cJSON_CreateObject(); + cJSON_AddStringToObject(stereo, "id", "dspfStereo"); + cJSON_AddStringToObject(stereo, "name", "Stereo Pass-Through"); + cJSON_AddStringToObject(stereo, "description", "No DSP processing, optional soft volume"); + cJSON_AddNumberToObject(stereo, "enum_value", 0); + cJSON_AddItemToObject(stereo, "parameters", cJSON_CreateArray()); + cJSON_AddItemToArray(schema, stereo); + + // Flow: dspfEQBassTreble (5) + cJSON *eq = cJSON_CreateObject(); + cJSON_AddStringToObject(eq, "id", "dspfEQBassTreble"); + cJSON_AddStringToObject(eq, "name", "Bass & Treble EQ"); + cJSON_AddStringToObject(eq, "description", "Simple 2-band equalizer with bass and treble controls"); + cJSON_AddNumberToObject(eq, "enum_value", 5); + cJSON *eq_params = cJSON_CreateArray(); + + // Bass frequency + cJSON *p1 = cJSON_CreateObject(); + cJSON_AddStringToObject(p1, "key", "fc_1"); + cJSON_AddStringToObject(p1, "name", "Bass Frequency"); + cJSON_AddStringToObject(p1, "unit", "Hz"); + cJSON_AddNumberToObject(p1, "min", 20); + cJSON_AddNumberToObject(p1, "max", 300); + cJSON_AddNumberToObject(p1, "default", 100); + cJSON_AddNumberToObject(p1, "step", 10); + int32_t val_fc1 = 100; + dsp_settings_load_flow_param(dspfEQBassTreble, "fc_1", &val_fc1); + cJSON_AddNumberToObject(p1, "current", val_fc1); + cJSON_AddItemToArray(eq_params, p1); + + // Bass gain + cJSON *p2 = cJSON_CreateObject(); + cJSON_AddStringToObject(p2, "key", "gain_1"); + cJSON_AddStringToObject(p2, "name", "Bass Gain"); + cJSON_AddStringToObject(p2, "unit", "dB"); + cJSON_AddNumberToObject(p2, "min", -15); + cJSON_AddNumberToObject(p2, "max", 15); + cJSON_AddNumberToObject(p2, "default", 0); + cJSON_AddNumberToObject(p2, "step", 1); + int32_t val_g1 = 0; + dsp_settings_load_flow_param(dspfEQBassTreble, "gain_1", &val_g1); + cJSON_AddNumberToObject(p2, "current", val_g1); + cJSON_AddItemToArray(eq_params, p2); + + // Treble frequency + cJSON *p3 = cJSON_CreateObject(); + cJSON_AddStringToObject(p3, "key", "fc_3"); + cJSON_AddStringToObject(p3, "name", "Treble Frequency"); + cJSON_AddStringToObject(p3, "unit", "Hz"); + cJSON_AddNumberToObject(p3, "min", 2000); + cJSON_AddNumberToObject(p3, "max", 16000); + cJSON_AddNumberToObject(p3, "default", 8000); + cJSON_AddNumberToObject(p3, "step", 500); + int32_t val_fc3 = 8000; + dsp_settings_load_flow_param(dspfEQBassTreble, "fc_3", &val_fc3); + cJSON_AddNumberToObject(p3, "current", val_fc3); + cJSON_AddItemToArray(eq_params, p3); + + // Treble gain + cJSON *p4 = cJSON_CreateObject(); + cJSON_AddStringToObject(p4, "key", "gain_3"); + cJSON_AddStringToObject(p4, "name", "Treble Gain"); + cJSON_AddStringToObject(p4, "unit", "dB"); + cJSON_AddNumberToObject(p4, "min", -15); + cJSON_AddNumberToObject(p4, "max", 15); + cJSON_AddNumberToObject(p4, "default", 0); + cJSON_AddNumberToObject(p4, "step", 1); + int32_t val_g3 = 0; + dsp_settings_load_flow_param(dspfEQBassTreble, "gain_3", &val_g3); + cJSON_AddNumberToObject(p4, "current", val_g3); + cJSON_AddItemToArray(eq_params, p4); + + cJSON_AddItemToObject(eq, "parameters", eq_params); + cJSON_AddItemToArray(schema, eq); + + // Flow: dspfBassBoost (4) + cJSON *boost = cJSON_CreateObject(); + cJSON_AddStringToObject(boost, "id", "dspfBassBoost"); + cJSON_AddStringToObject(boost, "name", "Bass Boost"); + cJSON_AddStringToObject(boost, "description", "Adjustable bass enhancement"); + cJSON_AddNumberToObject(boost, "enum_value", 4); + cJSON *boost_params = cJSON_CreateArray(); + + cJSON *bp1 = cJSON_CreateObject(); + cJSON_AddStringToObject(bp1, "key", "fc_1"); + cJSON_AddStringToObject(bp1, "name", "Bass Frequency"); + cJSON_AddStringToObject(bp1, "unit", "Hz"); + cJSON_AddNumberToObject(bp1, "min", 20); + cJSON_AddNumberToObject(bp1, "max", 300); + cJSON_AddNumberToObject(bp1, "default", 100); + cJSON_AddNumberToObject(bp1, "step", 10); + int32_t val_b_fc1 = 100; + dsp_settings_load_flow_param(dspfBassBoost, "fc_1", &val_b_fc1); + cJSON_AddNumberToObject(bp1, "current", val_b_fc1); + cJSON_AddItemToArray(boost_params, bp1); + + cJSON *bp2 = cJSON_CreateObject(); + cJSON_AddStringToObject(bp2, "key", "gain_1"); + cJSON_AddStringToObject(bp2, "name", "Bass Gain"); + cJSON_AddStringToObject(bp2, "unit", "dB"); + cJSON_AddNumberToObject(bp2, "min", 0); + cJSON_AddNumberToObject(bp2, "max", 24); + cJSON_AddNumberToObject(bp2, "default", 12); + cJSON_AddNumberToObject(bp2, "step", 1); + int32_t val_b_g1 = 12; + dsp_settings_load_flow_param(dspfBassBoost, "gain_1", &val_b_g1); + cJSON_AddNumberToObject(bp2, "current", val_b_g1); + cJSON_AddItemToArray(boost_params, bp2); + + cJSON_AddItemToObject(boost, "parameters", boost_params); + cJSON_AddItemToArray(schema, boost); + + // Flow: dspfBiamp (1) + cJSON *biamp = cJSON_CreateObject(); + cJSON_AddStringToObject(biamp, "id", "dspfBiamp"); + cJSON_AddStringToObject(biamp, "name", "Bi-Amp Crossover"); + cJSON_AddStringToObject(biamp, "description", "Channel 0: Low-pass, Channel 1: High-pass"); + cJSON_AddNumberToObject(biamp, "enum_value", 1); + cJSON *biamp_params = cJSON_CreateArray(); + + cJSON *bip1 = cJSON_CreateObject(); + cJSON_AddStringToObject(bip1, "key", "fc_1"); + cJSON_AddStringToObject(bip1, "name", "Low-Pass Frequency"); + cJSON_AddStringToObject(bip1, "unit", "Hz"); + cJSON_AddNumberToObject(bip1, "min", 20); + cJSON_AddNumberToObject(bip1, "max", 20000); + cJSON_AddNumberToObject(bip1, "default", 200); + cJSON_AddNumberToObject(bip1, "step", 10); + int32_t val_bi_fc1 = 200; + dsp_settings_load_flow_param(dspfBiamp, "fc_1", &val_bi_fc1); + cJSON_AddNumberToObject(bip1, "current", val_bi_fc1); + cJSON_AddItemToArray(biamp_params, bip1); + + cJSON *bip2 = cJSON_CreateObject(); + cJSON_AddStringToObject(bip2, "key", "gain_1"); + cJSON_AddStringToObject(bip2, "name", "Low-Pass Gain"); + cJSON_AddStringToObject(bip2, "unit", "dB"); + cJSON_AddNumberToObject(bip2, "min", -15); + cJSON_AddNumberToObject(bip2, "max", 15); + cJSON_AddNumberToObject(bip2, "default", 0); + cJSON_AddNumberToObject(bip2, "step", 1); + int32_t val_bi_g1 = 0; + dsp_settings_load_flow_param(dspfBiamp, "gain_1", &val_bi_g1); + cJSON_AddNumberToObject(bip2, "current", val_bi_g1); + cJSON_AddItemToArray(biamp_params, bip2); + + cJSON *bip3 = cJSON_CreateObject(); + cJSON_AddStringToObject(bip3, "key", "fc_3"); + cJSON_AddStringToObject(bip3, "name", "High-Pass Frequency"); + cJSON_AddStringToObject(bip3, "unit", "Hz"); + cJSON_AddNumberToObject(bip3, "min", 20); + cJSON_AddNumberToObject(bip3, "max", 20000); + cJSON_AddNumberToObject(bip3, "default", 200); + cJSON_AddNumberToObject(bip3, "step", 10); + int32_t val_bi_fc3 = 200; + dsp_settings_load_flow_param(dspfBiamp, "fc_3", &val_bi_fc3); + cJSON_AddNumberToObject(bip3, "current", val_bi_fc3); + cJSON_AddItemToArray(biamp_params, bip3); + + cJSON *bip4 = cJSON_CreateObject(); + cJSON_AddStringToObject(bip4, "key", "gain_3"); + cJSON_AddStringToObject(bip4, "name", "High-Pass Gain"); + cJSON_AddStringToObject(bip4, "unit", "dB"); + cJSON_AddNumberToObject(bip4, "min", -15); + cJSON_AddNumberToObject(bip4, "max", 15); + cJSON_AddNumberToObject(bip4, "default", 0); + cJSON_AddNumberToObject(bip4, "step", 1); + int32_t val_bi_g3 = 0; + dsp_settings_load_flow_param(dspfBiamp, "gain_3", &val_bi_g3); + cJSON_AddNumberToObject(bip4, "current", val_bi_g3); + cJSON_AddItemToArray(biamp_params, bip4); + + cJSON_AddItemToObject(biamp, "parameters", biamp_params); + cJSON_AddItemToArray(schema, biamp); + + cJSON_AddItemToObject(root, "flows", schema); + + // Render to string + char *json_str = cJSON_PrintUnformatted(root); + cJSON_Delete(root); + + if (!json_str) { + ESP_LOGE(TAG, "%s: Failed to render JSON", __func__); + return ESP_ERR_NO_MEM; + } + + size_t json_len = strlen(json_str); + ESP_LOGI(TAG, "%s: Generated JSON size: %zu bytes (buffer size: %zu)", __func__, json_len, max_len); + + if (json_len >= max_len) { + ESP_LOGE(TAG, "%s: JSON too large for buffer (%zu >= %zu)", __func__, json_len, max_len); + cJSON_free(json_str); + return ESP_ERR_INVALID_SIZE; + } + + strncpy(json_out, json_str, max_len - 1); + json_out[max_len - 1] = '\0'; + cJSON_free(json_str); + + ESP_LOGD(TAG, "%s: JSON generated: %s", __func__, json_out); + return ESP_OK; } esp_err_t dsp_settings_set_from_json(const char *json_in) { - ESP_LOGD(TAG, "%s: json=%s", __func__, json_in); - - if (!json_in) - return ESP_ERR_INVALID_ARG; - - cJSON *root = cJSON_Parse(json_in); - if (!root) { - ESP_LOGE(TAG, "%s: Failed to parse JSON", __func__); - return ESP_ERR_INVALID_ARG; - } - - esp_err_t err = ESP_OK; - - // Update active flow if present - cJSON *active_flow = cJSON_GetObjectItem(root, "active_flow"); - if (cJSON_IsNumber(active_flow)) { - err = dsp_settings_save_active_flow((dspFlows_t)active_flow->valueint); - if (err != ESP_OK) { - ESP_LOGW(TAG, "%s: Failed to save active_flow", __func__); - } - } - - // Iterate through all items and save flow parameters - // Expecting keys like "flow_5_fc_1", "flow_5_gain_1", etc. - cJSON *item = NULL; - cJSON_ArrayForEach(item, root) { - if (cJSON_IsNumber(item) && item->string) { - // Parse key format: "flow_X_param" - if (strncmp(item->string, "flow_", 5) == 0) { - int flow_id; - char param_name[16]; - if (sscanf(item->string, "flow_%d_%15s", &flow_id, - param_name) == 2) { - esp_err_t save_err = dsp_settings_save_flow_param( - (dspFlows_t)flow_id, param_name, item->valueint); - if (save_err != ESP_OK) { - ESP_LOGW(TAG, "%s: Failed to save %s", __func__, - item->string); - err = save_err; - } - } - } - } - } - - cJSON_Delete(root); - return err; -} - -/** - * Get current active flow - */ -dspFlows_t dsp_settings_get_active_flow(void) { - dspFlows_t flow = dspfStereo; - if (dsp_settings_load_active_flow(&flow) == ESP_OK) { - return flow; - } - return flow; -} - -/** - * Get parameters for a specific flow - */ -esp_err_t dsp_settings_get_flow_params(dspFlows_t flow, - filterParams_t *params) { - if (!params || flow < 0 || flow >= DSP_FLOW_COUNT) { - return ESP_ERR_INVALID_ARG; - } - - params->dspFlow = flow; - - int32_t v = 0; - if (dsp_settings_load_flow_param(flow, "fc_1", &v) == ESP_OK) { - params->fc_1 = (float)v; - } else { - params->fc_1 = DSP_BASS_FREQ_DEFAULT; - } - - if (dsp_settings_load_flow_param(flow, "gain_1", &v) == ESP_OK) { - params->gain_1 = (float)v; - } else { - params->gain_1 = DSP_GAIN_DEFAULT; - } - - if (dsp_settings_load_flow_param(flow, "fc_3", &v) == ESP_OK) { - params->fc_3 = (float)v; - } else { - params->fc_3 = DSP_TREBLE_FREQ_DEFAULT; - } - - if (dsp_settings_load_flow_param(flow, "gain_3", &v) == ESP_OK) { - params->gain_3 = (float)v; - } else { - params->gain_3 = DSP_GAIN_DEFAULT; - } - - return ESP_OK; -} - -/** - * Set parameters for a specific flow and notify subscribers - */ -esp_err_t dsp_settings_set_flow_params(dspFlows_t flow, - const filterParams_t *params) { - if (!params || flow < 0 || flow >= DSP_FLOW_COUNT) { - return ESP_ERR_INVALID_ARG; - } - - ESP_LOGI(TAG, "Setting params for flow %d: fc_1=%.1f gain_1=%.1f", flow, - params->fc_1, params->gain_1); - - // Save to NVS - esp_err_t err = ESP_OK; - err |= dsp_settings_save_flow_param(flow, "fc_1", (int32_t)params->fc_1); - err |= - dsp_settings_save_flow_param(flow, "gain_1", (int32_t)params->gain_1); - err |= dsp_settings_save_flow_param(flow, "fc_3", (int32_t)params->fc_3); - err |= - dsp_settings_save_flow_param(flow, "gain_3", (int32_t)params->gain_3); - if (err == ESP_OK) { - // If the flow we just saved is currently active, apply it to the - // DSP processor. Read active flow from NVS on demand. - dspFlows_t active = dspfStereo; - if (dsp_settings_load_active_flow(&active) == ESP_OK && active == flow) { - esp_err_t e = dsp_processor_set_params_for_flow(flow, params); - if (e == ESP_OK) { - ESP_LOGD(TAG, "Applied params to DSP processor for active flow"); - } else { - ESP_LOGW(TAG, "Failed to apply params to DSP processor: %s", - esp_err_to_name(e)); - } - } - } - - return err; -} - -/** - * Switch active flow and notify subscribers - */ -esp_err_t dsp_settings_switch_active_flow(dspFlows_t flow) { - if (flow < 0 || flow >= DSP_FLOW_COUNT) { - return ESP_ERR_INVALID_ARG; - } - - ESP_LOGI(TAG, "Switching active flow to %d", flow); - - // Save to NVS - esp_err_t err = dsp_settings_save_active_flow(flow); - if (err == ESP_OK) { - // Get parameters for the new flow and apply to DSP processor - filterParams_t params; - if (dsp_settings_get_flow_params(flow, ¶ms) == ESP_OK) { - esp_err_t e = dsp_processor_set_params_for_flow(flow, ¶ms); - if (e != ESP_OK) { - ESP_LOGW(TAG, "Failed to set params for flow on DSP processor: %s", - esp_err_to_name(e)); - } - } else { - ESP_LOGW(TAG, "Failed to load params for flow %d", flow); - } - - // Now instruct processor to switch to the new flow - esp_err_t e = dsp_processor_switch_flow(flow); - if (e == ESP_OK) { - ESP_LOGD(TAG, "DSP processor switched to flow %d", flow); - } else { - ESP_LOGW(TAG, "DSP processor failed to switch flow: %s", - esp_err_to_name(e)); - } - } - - return err; + ESP_LOGD(TAG, "%s: json=%s", __func__, json_in); + + if (!json_in) return ESP_ERR_INVALID_ARG; + + cJSON *root = cJSON_Parse(json_in); + if (!root) { + ESP_LOGE(TAG, "%s: Failed to parse JSON", __func__); + return ESP_ERR_INVALID_ARG; + } + + esp_err_t err = ESP_OK; + + // Update active flow if present + cJSON *active_flow = cJSON_GetObjectItem(root, "active_flow"); + if (cJSON_IsNumber(active_flow)) { + err = dsp_settings_save_active_flow((dspFlows_t)active_flow->valueint); + if (err != ESP_OK) { + ESP_LOGW(TAG, "%s: Failed to save active_flow", __func__); + } + } + + // Iterate through all items and save flow parameters + // Expecting keys like "flow_5_fc_1", "flow_5_gain_1", etc. + cJSON *item = NULL; + cJSON_ArrayForEach(item, root) { + if (cJSON_IsNumber(item) && item->string) { + // Parse key format: "flow_X_param" + if (strncmp(item->string, "flow_", 5) == 0) { + int flow_id; + char param_name[16]; + if (sscanf(item->string, "flow_%d_%15s", &flow_id, param_name) == 2) { + esp_err_t save_err = dsp_settings_save_flow_param( + (dspFlows_t)flow_id, param_name, item->valueint); + if (save_err != ESP_OK) { + ESP_LOGW(TAG, "%s: Failed to save %s", __func__, item->string); + err = save_err; + } + } + } + } + } + + cJSON_Delete(root); + return err; } diff --git a/components/dsp_processor_settings/include/dsp_processor_settings.h b/components/dsp_processor_settings/include/dsp_processor_settings.h index b25c56c9..e1436934 100644 --- a/components/dsp_processor_settings/include/dsp_processor_settings.h +++ b/components/dsp_processor_settings/include/dsp_processor_settings.h @@ -15,10 +15,10 @@ extern "C" { #endif -#include "dsp_types.h" #include #include #include +#include "dsp_processor.h" /** * Initialize DSP settings manager @@ -42,38 +42,36 @@ esp_err_t dsp_settings_load_active_flow(dspFlows_t *flow); /** * Save a flow-specific integer parameter to NVS * Format: "flow__" (e.g., "flow_5_fc_1") - * + * * @param flow The DSP flow this parameter belongs to - * @param param_name Parameter name (e.g., "fc_1", "gain_1") + * @param param_name Parameter name (e.g., "fc_1", "gain_2") * @param value Parameter value */ -esp_err_t dsp_settings_save_flow_param(dspFlows_t flow, const char *param_name, - int32_t value); +esp_err_t dsp_settings_save_flow_param(dspFlows_t flow, const char *param_name, int32_t value); /** * Load a flow-specific integer parameter from NVS - * + * * @param flow The DSP flow this parameter belongs to * @param param_name Parameter name * @param value Pointer to store the loaded value * @return ESP_OK on success, ESP_ERR_NVS_NOT_FOUND if not set */ -esp_err_t dsp_settings_load_flow_param(dspFlows_t flow, const char *param_name, - int32_t *value); +esp_err_t dsp_settings_load_flow_param(dspFlows_t flow, const char *param_name, int32_t *value); /** * Get all DSP settings as a JSON string * Includes active flow and all flow-specific parameters - * + * * @param json_out Buffer to store JSON string (caller must allocate) * @param max_len Maximum size of output buffer * @return ESP_OK on success - * + * * Example output: * { * "active_flow": 5, * "flows": { - * "5": {"fc_1": 150, "gain_1": 0, "fc_3": 8000, "gain_3": 0} + * "5": {"fc_1": 150, "gain_1": 0, "fc_2": 8000, "gain_2": 0} * } * } */ @@ -82,10 +80,10 @@ esp_err_t dsp_settings_get_json(char *json_out, size_t max_len); /** * Update DSP settings from a JSON string * Parses JSON and saves values to NVS - * + * * @param json_in JSON string containing settings to update * @return ESP_OK on success - * + * * Expected format: * { * "active_flow": 5, @@ -95,40 +93,6 @@ esp_err_t dsp_settings_get_json(char *json_out, size_t max_len); */ esp_err_t dsp_settings_set_from_json(const char *json_in); -/** - * Get current active flow - * @return Current active DSP flow - */ -dspFlows_t dsp_settings_get_active_flow(void); - -/** - * Get parameters for a specific flow - * @param flow DSP flow to query - * @param params Output structure for parameters - * @return ESP_OK on success - */ -esp_err_t dsp_settings_get_flow_params(dspFlows_t flow, filterParams_t *params); - -/** - * Set parameters for a specific flow - * Persists to NVS and updates cache - * - * @param flow DSP flow to update - * @param params New parameters - * @return ESP_OK on success - */ -esp_err_t dsp_settings_set_flow_params(dspFlows_t flow, - const filterParams_t *params); - -/** - * Switch active flow - * Persists to NVS and updates cache - * - * @param flow New active flow - * @return ESP_OK on success - */ -esp_err_t dsp_settings_switch_active_flow(dspFlows_t flow); - #ifdef __cplusplus } #endif diff --git a/components/settings_manager/settings_manager.c b/components/settings_manager/settings_manager.c index 31e97137..f8fcfb9a 100644 --- a/components/settings_manager/settings_manager.c +++ b/components/settings_manager/settings_manager.c @@ -235,12 +235,13 @@ esp_err_t settings_get_mdns_enabled(bool *enabled) { } } // Not present in NVS. Check sdkconfig if available, otherwise default true -#ifndef CONFIG_SNAPSERVER_USE_MDNS - *enabled = false; +#ifdef CONFIG_SNAPSERVER_USE_MDNS + *enabled = (CONFIG_SNAPSERVER_USE_MDNS != 0); + ESP_LOGD(TAG, "%s: mdns from CONFIG_SNAPSERVER_USE_MDNS: %d", __func__, *enabled ? 1 : 0); #else *enabled = true; + ESP_LOGD(TAG, "%s: mdns default: true", __func__); #endif - ESP_LOGD(TAG, "%s: mdns from CONFIG_SNAPSERVER_USE_MDNS: %d", __func__, *enabled ? 1 : 0); xSemaphoreGive(hostname_mutex); return ESP_OK; } @@ -402,7 +403,7 @@ esp_err_t settings_get_server_port(int32_t *port) { // not present in NVS -> check sdkconfig fallbacks or default 0 #ifdef CONFIG_SNAPSERVER_PORT *port = CONFIG_SNAPSERVER_PORT; - ESP_LOGD(TAG, "%s: server_port from CONFIG_SNAPSERVER_PORT: %ld", __func__, (long)*port); + ESP_LOGD(TAG, "%s: server_port from CONFIG_SNAPSERVER_PORT: %d", __func__, *port); #else *port = 0; ESP_LOGD(TAG, "%s: server_port not set (default 0)", __func__); @@ -412,7 +413,7 @@ esp_err_t settings_get_server_port(int32_t *port) { } esp_err_t settings_set_server_port(int32_t port) { - ESP_LOGD(TAG, "%s: port=%ld", __func__, (long)port); + ESP_LOGD(TAG, "%s: port=%d", __func__, port); if (!hostname_mutex) return ESP_ERR_INVALID_STATE; if (xSemaphoreTake(hostname_mutex, pdMS_TO_TICKS(5000)) != pdTRUE) return ESP_ERR_TIMEOUT; @@ -429,7 +430,7 @@ esp_err_t settings_set_server_port(int32_t port) { nvs_close(h); xSemaphoreGive(hostname_mutex); if (err == ESP_OK) { - ESP_LOGI(TAG, "%s: server_port saved: %ld", __func__, (long)port); + ESP_LOGI(TAG, "%s: server_port saved: %d", __func__, port); } else { ESP_LOGE(TAG, "%s: Failed to save server_port: %s", __func__, esp_err_to_name(err)); } @@ -530,7 +531,7 @@ esp_err_t settings_get_json(char *json_out, size_t max_len) { json_out[max_len - 1] = '\0'; cJSON_free(json_str); - ESP_LOGV(TAG, "%s: JSON generated: %s", __func__, json_out); + ESP_LOGD(TAG, "%s: JSON generated: %s", __func__, json_out); return ESP_OK; } diff --git a/main/main.c b/main/main.c index 1801630b..f77f9fc1 100644 --- a/main/main.c +++ b/main/main.c @@ -2821,6 +2821,7 @@ void app_main(void) { #endif #if CONFIG_USE_DSP_PROCESSOR + dsp_settings_init(); dsp_processor_init(); dsp_settings_init(); #endif From a2f126dae146cb782bfde4c20339311d9733594a Mon Sep 17 00:00:00 2001 From: Andriy Malyshenko Date: Mon, 24 Nov 2025 22:04:54 +0100 Subject: [PATCH 10/58] replaced hard coded flow count with DSP_FLOW_COUNT --- components/dsp_processor/dsp_processor.c | 10 +++++----- components/dsp_processor/include/dsp_processor.h | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/components/dsp_processor/dsp_processor.c b/components/dsp_processor/dsp_processor.c index 647f49df..559b6bb9 100644 --- a/components/dsp_processor/dsp_processor.c +++ b/components/dsp_processor/dsp_processor.c @@ -93,7 +93,7 @@ void dsp_processor_init(void) { // Load saved parameters from NVS for all flows ESP_LOGI(TAG, "%s: Loading saved parameters from NVS", __func__); - for (int flow = 0; flow < 6; flow++) { + for (int flow = 0; flow < DSP_FLOW_COUNT; flow++) { int32_t fc_1, gain_1, fc_2, gain_2, fc_3, gain_3; // Load each parameter, keeping defaults if not found in NVS @@ -183,7 +183,7 @@ esp_err_t dsp_processor_update_filter_params(filterParams_t *params) { // Also update centralized storage for the current flow dspFlows_t flow = params->dspFlow; - if (flow >= 0 && flow < 6) { // Validate flow index + if (flow >= 0 && flow < DSP_FLOW_COUNT) { // Validate flow index all_params.active_flow = flow; all_params.flow_params[flow].fc_1 = params->fc_1; all_params.flow_params[flow].gain_1 = params->gain_1; @@ -778,7 +778,7 @@ const dsp_all_params_t* dsp_processor_get_all_params(void) { esp_err_t dsp_processor_get_params_for_flow(dspFlows_t flow, filterParams_t *params) { ESP_LOGD(TAG, "%s: getting params for flow %d", __func__, flow); - if (params == NULL || flow < 0 || flow >= 6) { + if (params == NULL || flow < 0 || flow >= DSP_FLOW_COUNT) { return ESP_ERR_INVALID_ARG; } @@ -799,7 +799,7 @@ esp_err_t dsp_processor_get_params_for_flow(dspFlows_t flow, filterParams_t *par esp_err_t dsp_processor_set_params_for_flow(dspFlows_t flow, const filterParams_t *params) { ESP_LOGD(TAG, "%s: setting params for flow %d", __func__, flow); - if (params == NULL || flow < 0 || flow >= 6) { + if (params == NULL || flow < 0 || flow >= DSP_FLOW_COUNT) { return ESP_ERR_INVALID_ARG; } @@ -834,7 +834,7 @@ esp_err_t dsp_processor_set_params_for_flow(dspFlows_t flow, const filterParams_ esp_err_t dsp_processor_switch_flow(dspFlows_t flow) { ESP_LOGI(TAG, "%s: switching from flow %d to %d", __func__, all_params.active_flow, flow); - if (flow < 0 || flow >= 6) { + if (flow < 0 || flow >= DSP_FLOW_COUNT) { return ESP_ERR_INVALID_ARG; } diff --git a/components/dsp_processor/include/dsp_processor.h b/components/dsp_processor/include/dsp_processor.h index 409def52..de0780c1 100644 --- a/components/dsp_processor/include/dsp_processor.h +++ b/components/dsp_processor/include/dsp_processor.h @@ -50,6 +50,7 @@ typedef enum dspFlows { dspfFunkyHonda, dspfBassBoost, dspfEQBassTreble, + DSP_FLOW_COUNT // Total number of DSP flows } dspFlows_t; enum filtertypes { @@ -108,7 +109,7 @@ typedef struct dsp_all_params_s { float gain_2; // Secondary gain float fc_3; // Tertiary frequency (treble/high crossover) float gain_3; // Tertiary gain (treble) - } flow_params[6]; // One entry per dspFlows_t enum value + } flow_params[DSP_FLOW_COUNT]; // One entry per dspFlows_t enum value } dsp_all_params_t; // TODO: this is unused, remove??? From 30e3f641d12058423c874f9d3e6274df50109d7d Mon Sep 17 00:00:00 2001 From: Andriy Malyshenko Date: Wed, 26 Nov 2025 14:32:15 +0100 Subject: [PATCH 11/58] Removed dsp_processor_switch_flow function --- components/dsp_processor/dsp_processor.c | 25 ------------------- .../dsp_processor/include/dsp_processor.h | 8 ------ 2 files changed, 33 deletions(-) diff --git a/components/dsp_processor/dsp_processor.c b/components/dsp_processor/dsp_processor.c index 559b6bb9..77a57f00 100644 --- a/components/dsp_processor/dsp_processor.c +++ b/components/dsp_processor/dsp_processor.c @@ -828,29 +828,4 @@ esp_err_t dsp_processor_set_params_for_flow(dspFlows_t flow, const filterParams_ return ESP_OK; } -/** - * Switch to a different DSP flow - */ -esp_err_t dsp_processor_switch_flow(dspFlows_t flow) { - ESP_LOGI(TAG, "%s: switching from flow %d to %d", __func__, all_params.active_flow, flow); - - if (flow < 0 || flow >= DSP_FLOW_COUNT) { - return ESP_ERR_INVALID_ARG; - } - - all_params.active_flow = flow; - - // Load parameters for the new flow and apply them - filterParams_t params; - params.dspFlow = flow; - params.fc_1 = all_params.flow_params[flow].fc_1; - params.gain_1 = all_params.flow_params[flow].gain_1; - params.fc_2 = all_params.flow_params[flow].fc_2; - params.gain_2 = all_params.flow_params[flow].gain_2; - params.fc_3 = all_params.flow_params[flow].fc_3; - params.gain_3 = all_params.flow_params[flow].gain_3; - - return dsp_processor_update_filter_params(¶ms); -} - #endif diff --git a/components/dsp_processor/include/dsp_processor.h b/components/dsp_processor/include/dsp_processor.h index de0780c1..16c3c1d1 100644 --- a/components/dsp_processor/include/dsp_processor.h +++ b/components/dsp_processor/include/dsp_processor.h @@ -153,14 +153,6 @@ esp_err_t dsp_processor_get_params_for_flow(dspFlows_t flow, filterParams_t *par */ esp_err_t dsp_processor_set_params_for_flow(dspFlows_t flow, const filterParams_t *params); -/** - * Switch to a different DSP flow - * This activates the flow and applies its stored parameters - * @param flow The DSP flow to switch to - * @return ESP_OK on success - */ -esp_err_t dsp_processor_switch_flow(dspFlows_t flow); - #ifdef __cplusplus } #endif From 7da1391fcd2e576025f20a9f882d1e5b4873a444 Mon Sep 17 00:00:00 2001 From: Andriy Malyshenko Date: Tue, 25 Nov 2025 11:17:01 +0100 Subject: [PATCH 12/58] First steps in tas5805m settings page (wip) --- components/audio_hal/CMakeLists.txt | 4 +- components/custom_board/CMakeLists.txt | 4 +- .../custom_board/tas5805m/include/tas5805m.h | 45 ++ components/custom_board/tas5805m/tas5805m.c | 85 +++ .../settings_manager/settings_manager.c | 7 + components/tas5805m_settings/CMakeLists.txt | 5 + .../include/tas5805m_settings.h | 158 ++++++ .../tas5805m_settings/tas5805m_settings.c | 483 ++++++++++++++++++ components/ui_http_server/CMakeLists.txt | 4 +- .../ui_http_server/html/dac-settings.html | 394 ++++++++++++++ components/ui_http_server/html/index.html | 11 +- 11 files changed, 1194 insertions(+), 6 deletions(-) create mode 100644 components/tas5805m_settings/CMakeLists.txt create mode 100644 components/tas5805m_settings/include/tas5805m_settings.h create mode 100644 components/tas5805m_settings/tas5805m_settings.c create mode 100644 components/ui_http_server/html/dac-settings.html diff --git a/components/audio_hal/CMakeLists.txt b/components/audio_hal/CMakeLists.txt index 17c26127..b55162b2 100644 --- a/components/audio_hal/CMakeLists.txt +++ b/components/audio_hal/CMakeLists.txt @@ -18,8 +18,8 @@ IF (NOT ((CONFIG_IDF_TARGET STREQUAL "esp32c3") OR (CONFIG_IDF_TARGET STREQUAL " endif() # Edit following two lines to set component requirements (see docs) -set(COMPONENT_REQUIRES ) -set(COMPONENT_PRIV_REQUIRES audio_sal audio_board mbedtls esp_peripherals custom_board) +set(COMPONENT_REQUIRES audio_sal) +set(COMPONENT_PRIV_REQUIRES audio_board mbedtls esp_peripherals custom_board) set(COMPONENT_SRCS ./audio_hal.c ./audio_volume.c diff --git a/components/custom_board/CMakeLists.txt b/components/custom_board/CMakeLists.txt index 82e0c3db..2139c097 100644 --- a/components/custom_board/CMakeLists.txt +++ b/components/custom_board/CMakeLists.txt @@ -1,6 +1,6 @@ # Edit following two lines to set component requirements (see docs) -set(COMPONENT_REQUIRES) -set(COMPONENT_PRIV_REQUIRES audio_hal esp_peripherals) +set(COMPONENT_REQUIRES audio_hal audio_board) +set(COMPONENT_PRIV_REQUIRES esp_peripherals) if(CONFIG_AUDIO_BOARD_CUSTOM) message(STATUS "Current board name is " CONFIG_AUDIO_BOARD_CUSTOM) diff --git a/components/custom_board/tas5805m/include/tas5805m.h b/components/custom_board/tas5805m/include/tas5805m.h index e9d718c5..fe0d636f 100644 --- a/components/custom_board/tas5805m/include/tas5805m.h +++ b/components/custom_board/tas5805m/include/tas5805m.h @@ -115,6 +115,51 @@ esp_err_t tas5805m_set_volume(int vol); */ esp_err_t tas5805m_get_volume(int *vol); +/** + * @brief Set analog gain (register 0x54) + * + * @param gain_db: gain in 0.5dB steps, range -15.5 to 0 dB + * Stored as int representing 0.5dB steps (e.g., -31 = -15.5dB, 0 = 0dB) + * + * @return + * - ESP_OK + * - ESP_FAIL + */ +esp_err_t tas5805m_set_analog_gain(int gain_half_db); + +/** + * @brief Get analog gain (register 0x54) + * + * @param[out] gain_half_db: gain in 0.5dB steps + * + * @return + * - ESP_OK + * - ESP_FAIL + */ +esp_err_t tas5805m_get_analog_gain(int *gain_half_db); + +/** + * @brief Set digital volume in dB (register 0x4c) + * + * @param vol_half_db: volume in 0.5dB steps, range -207 to 48 (-103.5dB to 24dB) + * + * @return + * - ESP_OK + * - ESP_FAIL + */ +esp_err_t tas5805m_set_digital_volume_db(int vol_half_db); + +/** + * @brief Get digital volume in dB (register 0x4c) + * + * @param[out] vol_half_db: volume in 0.5dB steps + * + * @return + * - ESP_OK + * - ESP_FAIL + */ +esp_err_t tas5805m_get_digital_volume_db(int *vol_half_db); + /** * @brief Set TAS5805 mute or not * Continuously call should have an interval time determined by diff --git a/components/custom_board/tas5805m/tas5805m.c b/components/custom_board/tas5805m/tas5805m.c index 4c77e28b..ef94fd60 100644 --- a/components/custom_board/tas5805m/tas5805m.c +++ b/components/custom_board/tas5805m/tas5805m.c @@ -319,6 +319,91 @@ esp_err_t tas5805m_get_volume(int *vol) { return ESP_OK; } +// Set digital volume in dB (0.5dB steps) +esp_err_t tas5805m_set_digital_volume_db(int vol_half_db) { + ESP_LOGD(TAG, "%s: Setting digital volume to %d half-dB (%.1f dB)", __func__, vol_half_db, vol_half_db / 2.0); + + // Clamp to valid range: -207 to +48 (-103.5dB to +24dB) + if (vol_half_db < -207) vol_half_db = -207; + if (vol_half_db > 48) vol_half_db = 48; + + // Convert half-dB to register value + // Register: 0x00 = +24dB, 0x30 = 0dB, 0xff = -103.5dB (mute) + // Formula: reg = 48 - vol_half_db + uint8_t reg_val = (uint8_t)(48 - vol_half_db); + + esp_err_t ret = tas5805m_write_byte(TAS5805M_DIG_VOL_CTRL_REGISTER, reg_val); + if (ret != ESP_OK) { + ESP_LOGW(TAG, "%s: Failed to write digital volume (reg 0x%02x): %s", __func__, reg_val, esp_err_to_name(ret)); + } + return ret; +} + +// Get digital volume in dB (0.5dB steps) +esp_err_t tas5805m_get_digital_volume_db(int *vol_half_db) { + if (vol_half_db == NULL) { + return ESP_ERR_INVALID_ARG; + } + + uint8_t reg_val = 0; + esp_err_t ret = tas5805m_read_byte(TAS5805M_DIG_VOL_CTRL_REGISTER, ®_val); + if (ret != ESP_OK) { + ESP_LOGW(TAG, "%s: Failed to read digital volume register: %s", __func__, esp_err_to_name(ret)); + return ret; + } + + // Convert register value to half-dB + // Formula: vol_half_db = 48 - reg + *vol_half_db = 48 - (int)reg_val; + + ESP_LOGD(TAG, "%s: Digital volume: reg=0x%02x, value=%d half-dB (%.1f dB)", + __func__, reg_val, *vol_half_db, *vol_half_db / 2.0); + return ESP_OK; +} + +// Set analog gain in dB (0.5dB steps) +esp_err_t tas5805m_set_analog_gain(int gain_half_db) { + ESP_LOGD(TAG, "%s: Setting analog gain to %d half-dB (%.1f dB)", __func__, gain_half_db, gain_half_db / 2.0); + + // Clamp to valid range: -31 to 0 (-15.5dB to 0dB) + if (gain_half_db < -31) gain_half_db = -31; + if (gain_half_db > 0) gain_half_db = 0; + + // Convert half-dB to register value + // Register: bits [4:0], 0x00 = 0dB, 0x1f = -15.5dB + // Formula: reg = -gain_half_db + uint8_t reg_val = (uint8_t)(-gain_half_db) & 0x1F; + + esp_err_t ret = tas5805m_write_byte(TAS5805M_AGAIN_REGISTER, reg_val); + if (ret != ESP_OK) { + ESP_LOGW(TAG, "%s: Failed to write analog gain (reg 0x%02x): %s", __func__, reg_val, esp_err_to_name(ret)); + } + return ret; +} + +// Get analog gain in dB (0.5dB steps) +esp_err_t tas5805m_get_analog_gain(int *gain_half_db) { + if (gain_half_db == NULL) { + return ESP_ERR_INVALID_ARG; + } + + uint8_t reg_val = 0; + esp_err_t ret = tas5805m_read_byte(TAS5805M_AGAIN_REGISTER, ®_val); + if (ret != ESP_OK) { + ESP_LOGW(TAG, "%s: Failed to read analog gain register: %s", __func__, esp_err_to_name(ret)); + return ret; + } + + // Convert register value to half-dB + // Formula: gain_half_db = -(reg & 0x1F) + *gain_half_db = -(int)(reg_val & 0x1F); + + ESP_LOGD(TAG, "%s: Analog gain: reg=0x%02x, value=%d half-dB (%.1f dB)", + __func__, reg_val, *gain_half_db, *gain_half_db / 2.0); + return ESP_OK; +} + + // Deinit the TAS5805M esp_err_t tas5805m_deinit(void) { ESP_ERROR_CHECK(tas5805m_set_state(TAS5805M_CTRL_HI_Z)); diff --git a/components/settings_manager/settings_manager.c b/components/settings_manager/settings_manager.c index f8fcfb9a..83143c72 100644 --- a/components/settings_manager/settings_manager.c +++ b/components/settings_manager/settings_manager.c @@ -512,6 +512,13 @@ esp_err_t settings_get_json(char *json_out, size_t max_len) { cJSON_AddBoolToObject(root, "dsp_available", false); #endif + // Add DAC availability flag +#if CONFIG_DAC_TAS5805M + cJSON_AddBoolToObject(root, "dac_available", true); +#else + cJSON_AddBoolToObject(root, "dac_available", false); +#endif + // Render to string char *json_str = cJSON_PrintUnformatted(root); cJSON_Delete(root); diff --git a/components/tas5805m_settings/CMakeLists.txt b/components/tas5805m_settings/CMakeLists.txt new file mode 100644 index 00000000..99c431bd --- /dev/null +++ b/components/tas5805m_settings/CMakeLists.txt @@ -0,0 +1,5 @@ +idf_component_register( + SRCS "tas5805m_settings.c" + INCLUDE_DIRS "include" + REQUIRES nvs_flash custom_board json +) diff --git a/components/tas5805m_settings/include/tas5805m_settings.h b/components/tas5805m_settings/include/tas5805m_settings.h new file mode 100644 index 00000000..f6035634 --- /dev/null +++ b/components/tas5805m_settings/include/tas5805m_settings.h @@ -0,0 +1,158 @@ +/** + * @file tas5805m_settings.h + * @brief TAS5805M DAC settings persistence and JSON serialization + * + * Manages NVS persistence for TAS5805M DAC settings including: + * - DAC state (Deep Sleep, Sleep, Hi-Z, Play, Mute) + * - Digital volume control + * - Analog gain control + * - JSON serialization for HTTP API consumption + * - Communication with tas5805m component + */ + +#ifndef __TAS5805M_SETTINGS_H__ +#define __TAS5805M_SETTINGS_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include +#include +#include "tas5805m.h" + +// NVS Configuration +#define TAS5805M_NVS_NAMESPACE "tas5805m_cfg" +#define TAS5805M_NVS_KEY_STATE "state" +#define TAS5805M_NVS_KEY_DIGITAL_VOL "dig_vol" +#define TAS5805M_NVS_KEY_ANALOG_GAIN "ana_gain" + +// Digital Volume Settings (in 0.5dB steps) +#define TAS5805M_DIGITAL_VOL_MIN -207 // -103.5 dB +#define TAS5805M_DIGITAL_VOL_MAX 48 // +24 dB +#define TAS5805M_DIGITAL_VOL_STEP 1 // 0.5 dB per step +#define TAS5805M_DIGITAL_VOL_DEFAULT 0 // 0 dB +#define TAS5805M_DIGITAL_VOL_SCALE 0.5 // Display scaling factor + +// Analog Gain Settings (in 0.5dB steps) +#define TAS5805M_ANALOG_GAIN_MIN -31 // -15.5 dB +#define TAS5805M_ANALOG_GAIN_MAX 0 // 0 dB +#define TAS5805M_ANALOG_GAIN_STEP 1 // 0.5 dB per step +#define TAS5805M_ANALOG_GAIN_DEFAULT 0 // 0 dB +#define TAS5805M_ANALOG_GAIN_SCALE 0.5 // Display scaling factor + +/** + * Initialize TAS5805M settings manager + * Must be called before any other functions + * @return ESP_OK on success + */ +esp_err_t tas5805m_settings_init(void); + +/** + * Save DAC state to NVS + * @param state The TAS5805M_CTRL_STATE to persist + * @return ESP_OK on success + */ +esp_err_t tas5805m_settings_save_state(TAS5805M_CTRL_STATE state); + +/** + * Load DAC state from NVS + * @param state Pointer to store the loaded state + * @return ESP_OK on success, ESP_ERR_NVS_NOT_FOUND if not set + */ +esp_err_t tas5805m_settings_load_state(TAS5805M_CTRL_STATE *state); + +/** + * Save digital volume setting to NVS + * @param vol_half_db Volume in 0.5dB steps (-207 to 48) + * @return ESP_OK on success + */ +esp_err_t tas5805m_settings_save_digital_volume(int vol_half_db); + +/** + * Load digital volume setting from NVS + * @param vol_half_db Pointer to store volume in 0.5dB steps + * @return ESP_OK on success, ESP_ERR_NVS_NOT_FOUND if not set + */ +esp_err_t tas5805m_settings_load_digital_volume(int *vol_half_db); + +/** + * Save analog gain setting to NVS + * @param gain_half_db Gain in 0.5dB steps (-31 to 0) + * @return ESP_OK on success + */ +esp_err_t tas5805m_settings_save_analog_gain(int gain_half_db); + +/** + * Load analog gain setting from NVS + * @param gain_half_db Pointer to store gain in 0.5dB steps + * @return ESP_OK on success, ESP_ERR_NVS_NOT_FOUND if not set + */ +esp_err_t tas5805m_settings_load_analog_gain(int *gain_half_db); + +/** + * Get current TAS5805M settings as a JSON string + * Queries the tas5805m component for current state and formats as JSON + * + * @param json_out Buffer to store JSON string (caller must allocate) + * @param max_len Maximum size of output buffer + * @return ESP_OK on success + * + * Example output: + * { + * "state": 3, + * "state_name": "Play", + * "volume": 50, + * "muted": false + * } + */ +esp_err_t tas5805m_settings_get_json(char *json_out, size_t max_len); + +/** + * Update TAS5805M settings from a JSON string + * Parses JSON and applies changes to the DAC via tas5805m component + * + * @param json_in JSON string containing settings to update + * @return ESP_OK on success + * + * Expected format: + * { + * "state": 3 + * } + */ +esp_err_t tas5805m_settings_set_from_json(const char *json_in); + +/** + * Get TAS5805M settings schema as JSON + * Provides UI metadata about available settings and their constraints + * + * @param json_out Buffer to store JSON string (caller must allocate) + * @param max_len Maximum size of output buffer + * @return ESP_OK on success + * + * Example output: + * { + * "parameters": [ + * { + * "key": "state", + * "name": "DAC State", + * "type": "enum", + * "values": [ + * {"value": 0, "name": "Deep Sleep"}, + * {"value": 1, "name": "Sleep"}, + * {"value": 2, "name": "Hi-Z"}, + * {"value": 3, "name": "Play"} + * ], + * "current": 3 + * } + * ] + * } + */ +esp_err_t tas5805m_settings_get_schema_json(char *json_out, size_t max_len); + +#ifdef __cplusplus +} +#endif + +#endif /* __TAS5805M_SETTINGS_H__ */ diff --git a/components/tas5805m_settings/tas5805m_settings.c b/components/tas5805m_settings/tas5805m_settings.c new file mode 100644 index 00000000..8c7e486a --- /dev/null +++ b/components/tas5805m_settings/tas5805m_settings.c @@ -0,0 +1,483 @@ +/** + * @file tas5805m_settings.c + * @brief TAS5805M DAC settings persistence and JSON serialization implementation + */ + +#include "tas5805m_settings.h" + +#include +#include "esp_log.h" +#include "nvs_flash.h" +#include "nvs.h" +#include "freertos/FreeRTOS.h" +#include "freertos/semphr.h" +#include "cJSON.h" + +static const char *TAG = "tas5805m_settings"; + +// Mutex for thread-safe NVS access +static SemaphoreHandle_t tas5805m_settings_mutex = NULL; + +/** + * Convert TAS5805M_CTRL_STATE enum to human-readable string + */ +static const char* tas5805m_state_to_string(TAS5805M_CTRL_STATE state) { + // Mask out the mute flag for string conversion + TAS5805M_CTRL_STATE base_state = state & ~TAS5805M_CTRL_MUTE; + + switch (base_state) { + case TAS5805M_CTRL_DEEP_SLEEP: return "Deep Sleep"; + case TAS5805M_CTRL_SLEEP: return "Sleep"; + case TAS5805M_CTRL_HI_Z: return "Hi-Z"; + case TAS5805M_CTRL_PLAY: + return (state & TAS5805M_CTRL_MUTE) ? "Play (Muted)" : "Play"; + default: return "Unknown"; + } +} + +esp_err_t tas5805m_settings_init(void) { + if (tas5805m_settings_mutex == NULL) { + tas5805m_settings_mutex = xSemaphoreCreateMutex(); + if (tas5805m_settings_mutex == NULL) { + ESP_LOGE(TAG, "%s: Failed to create mutex", __func__); + return ESP_ERR_NO_MEM; + } + } + + ESP_LOGI(TAG, "%s: TAS5805M settings manager initialized", __func__); + return ESP_OK; +} + +esp_err_t tas5805m_settings_save_state(TAS5805M_CTRL_STATE state) { + ESP_LOGD(TAG, "%s: state=%d", __func__, (int)state); + + if (!tas5805m_settings_mutex) { + ESP_LOGE(TAG, "%s: Not initialized", __func__); + return ESP_ERR_INVALID_STATE; + } + + if (xSemaphoreTake(tas5805m_settings_mutex, pdMS_TO_TICKS(5000)) != pdTRUE) { + ESP_LOGE(TAG, "%s: Failed to acquire mutex (timeout)", __func__); + return ESP_ERR_TIMEOUT; + } + + nvs_handle_t h; + esp_err_t err = nvs_open(TAS5805M_NVS_NAMESPACE, NVS_READWRITE, &h); + if (err != ESP_OK) { + ESP_LOGE(TAG, "%s: Failed to open NVS: %s", __func__, esp_err_to_name(err)); + xSemaphoreGive(tas5805m_settings_mutex); + return err; + } + + err = nvs_set_i32(h, TAS5805M_NVS_KEY_STATE, (int32_t)state); + if (err == ESP_OK) { + err = nvs_commit(h); + } + + nvs_close(h); + xSemaphoreGive(tas5805m_settings_mutex); + + if (err == ESP_OK) { + ESP_LOGI(TAG, "%s: State saved: %d (%s)", __func__, (int)state, tas5805m_state_to_string(state)); + } else { + ESP_LOGE(TAG, "%s: Failed to save state: %s", __func__, esp_err_to_name(err)); + } + + return err; +} + +esp_err_t tas5805m_settings_load_state(TAS5805M_CTRL_STATE *state) { + ESP_LOGD(TAG, "%s: entered", __func__); + + if (!state) return ESP_ERR_INVALID_ARG; + if (!tas5805m_settings_mutex) return ESP_ERR_INVALID_STATE; + + if (xSemaphoreTake(tas5805m_settings_mutex, pdMS_TO_TICKS(5000)) != pdTRUE) { + return ESP_ERR_TIMEOUT; + } + + nvs_handle_t h; + esp_err_t err = nvs_open(TAS5805M_NVS_NAMESPACE, NVS_READONLY, &h); + if (err == ESP_OK) { + int32_t v = 0; + err = nvs_get_i32(h, TAS5805M_NVS_KEY_STATE, &v); + nvs_close(h); + if (err == ESP_OK) { + *state = (TAS5805M_CTRL_STATE)v; + ESP_LOGD(TAG, "%s: State from NVS: %d (%s)", __func__, (int)*state, tas5805m_state_to_string(*state)); + } else if (err != ESP_ERR_NVS_NOT_FOUND) { + ESP_LOGW(TAG, "%s: NVS read error: %s", __func__, esp_err_to_name(err)); + } + } + + xSemaphoreGive(tas5805m_settings_mutex); + return err; +} + +esp_err_t tas5805m_settings_save_digital_volume(int vol_half_db) { + ESP_LOGD(TAG, "%s: vol_half_db=%d", __func__, vol_half_db); + + if (!tas5805m_settings_mutex) return ESP_ERR_INVALID_STATE; + + if (xSemaphoreTake(tas5805m_settings_mutex, pdMS_TO_TICKS(5000)) != pdTRUE) { + return ESP_ERR_TIMEOUT; + } + + nvs_handle_t h; + esp_err_t err = nvs_open(TAS5805M_NVS_NAMESPACE, NVS_READWRITE, &h); + if (err == ESP_OK) { + err = nvs_set_i32(h, TAS5805M_NVS_KEY_DIGITAL_VOL, (int32_t)vol_half_db); + if (err == ESP_OK) { + err = nvs_commit(h); + } + nvs_close(h); + } + + xSemaphoreGive(tas5805m_settings_mutex); + return err; +} + +esp_err_t tas5805m_settings_load_digital_volume(int *vol_half_db) { + if (!vol_half_db) return ESP_ERR_INVALID_ARG; + if (!tas5805m_settings_mutex) return ESP_ERR_INVALID_STATE; + + if (xSemaphoreTake(tas5805m_settings_mutex, pdMS_TO_TICKS(5000)) != pdTRUE) { + return ESP_ERR_TIMEOUT; + } + + nvs_handle_t h; + esp_err_t err = nvs_open(TAS5805M_NVS_NAMESPACE, NVS_READONLY, &h); + if (err == ESP_OK) { + int32_t v = 0; + err = nvs_get_i32(h, TAS5805M_NVS_KEY_DIGITAL_VOL, &v); + if (err == ESP_OK) { + *vol_half_db = (int)v; + } + nvs_close(h); + } + + xSemaphoreGive(tas5805m_settings_mutex); + return err; +} + +esp_err_t tas5805m_settings_save_analog_gain(int gain_half_db) { + ESP_LOGD(TAG, "%s: gain_half_db=%d", __func__, gain_half_db); + + if (!tas5805m_settings_mutex) return ESP_ERR_INVALID_STATE; + + if (xSemaphoreTake(tas5805m_settings_mutex, pdMS_TO_TICKS(5000)) != pdTRUE) { + return ESP_ERR_TIMEOUT; + } + + nvs_handle_t h; + esp_err_t err = nvs_open(TAS5805M_NVS_NAMESPACE, NVS_READWRITE, &h); + if (err == ESP_OK) { + err = nvs_set_i32(h, TAS5805M_NVS_KEY_ANALOG_GAIN, (int32_t)gain_half_db); + if (err == ESP_OK) { + err = nvs_commit(h); + } + nvs_close(h); + } + + xSemaphoreGive(tas5805m_settings_mutex); + return err; +} + +esp_err_t tas5805m_settings_load_analog_gain(int *gain_half_db) { + if (!gain_half_db) return ESP_ERR_INVALID_ARG; + if (!tas5805m_settings_mutex) return ESP_ERR_INVALID_STATE; + + if (xSemaphoreTake(tas5805m_settings_mutex, pdMS_TO_TICKS(5000)) != pdTRUE) { + return ESP_ERR_TIMEOUT; + } + + nvs_handle_t h; + esp_err_t err = nvs_open(TAS5805M_NVS_NAMESPACE, NVS_READONLY, &h); + if (err == ESP_OK) { + int32_t v = 0; + err = nvs_get_i32(h, TAS5805M_NVS_KEY_ANALOG_GAIN, &v); + if (err == ESP_OK) { + *gain_half_db = (int)v; + } + nvs_close(h); + } + + xSemaphoreGive(tas5805m_settings_mutex); + return err; +} + +esp_err_t tas5805m_settings_get_json(char *json_out, size_t max_len) { + ESP_LOGD(TAG, "%s: max_len=%zu", __func__, max_len); + + if (!json_out || max_len == 0) { + return ESP_ERR_INVALID_ARG; + } + + // Query current state from tas5805m component + TAS5805_STATE dac_state; + esp_err_t err = tas5805m_get_state(&dac_state); + if (err != ESP_OK) { + ESP_LOGE(TAG, "%s: Failed to get DAC state: %s", __func__, esp_err_to_name(err)); + return err; + } + + // Build JSON + cJSON *root = cJSON_CreateObject(); + if (!root) { + ESP_LOGE(TAG, "%s: Failed to create JSON root", __func__); + return ESP_ERR_NO_MEM; + } + + cJSON_AddNumberToObject(root, "state", (int)dac_state.state); + cJSON_AddStringToObject(root, "state_name", tas5805m_state_to_string(dac_state.state)); + cJSON_AddNumberToObject(root, "volume", dac_state.volume); + + bool muted = (dac_state.state & TAS5805M_CTRL_MUTE) != 0; + cJSON_AddBoolToObject(root, "muted", muted); + + // Render to string + char *json_str = cJSON_PrintUnformatted(root); + cJSON_Delete(root); + + if (!json_str) { + ESP_LOGE(TAG, "%s: Failed to render JSON", __func__); + return ESP_ERR_NO_MEM; + } + + size_t json_len = strlen(json_str); + ESP_LOGI(TAG, "%s: Generated JSON size: %zu bytes (buffer size: %zu)", __func__, json_len, max_len); + + if (json_len >= max_len) { + ESP_LOGE(TAG, "%s: JSON too large for buffer (%zu >= %zu)", __func__, json_len, max_len); + cJSON_free(json_str); + return ESP_ERR_INVALID_SIZE; + } + + strncpy(json_out, json_str, max_len - 1); + json_out[max_len - 1] = '\0'; + cJSON_free(json_str); + + ESP_LOGD(TAG, "%s: JSON generated: %s", __func__, json_out); + return ESP_OK; +} + +esp_err_t tas5805m_settings_set_from_json(const char *json_in) { + ESP_LOGD(TAG, "%s: json=%s", __func__, json_in); + + if (!json_in) return ESP_ERR_INVALID_ARG; + + cJSON *root = cJSON_Parse(json_in); + if (!root) { + ESP_LOGE(TAG, "%s: Failed to parse JSON", __func__); + return ESP_ERR_INVALID_ARG; + } + + esp_err_t err = ESP_OK; + + // Update state if present + cJSON *state_item = cJSON_GetObjectItem(root, "state"); + if (cJSON_IsNumber(state_item)) { + TAS5805M_CTRL_STATE new_state = (TAS5805M_CTRL_STATE)state_item->valueint; + + // Apply to DAC + err = tas5805m_set_state(new_state); + if (err == ESP_OK) { + ESP_LOGI(TAG, "%s: Applied state %d (%s) to DAC", __func__, + (int)new_state, tas5805m_state_to_string(new_state)); + + // Persist to NVS + esp_err_t save_err = tas5805m_settings_save_state(new_state); + if (save_err != ESP_OK) { + ESP_LOGW(TAG, "%s: Failed to save state to NVS: %s", + __func__, esp_err_to_name(save_err)); + } + } else { + ESP_LOGE(TAG, "%s: Failed to apply state to DAC: %s", + __func__, esp_err_to_name(err)); + } + } + + // Update digital volume if present + cJSON *dig_vol_item = cJSON_GetObjectItem(root, "digital_volume"); + if (cJSON_IsNumber(dig_vol_item)) { + int vol_half_db = dig_vol_item->valueint; + + err = tas5805m_set_digital_volume_db(vol_half_db); + if (err == ESP_OK) { + ESP_LOGI(TAG, "%s: Applied digital volume %.1f dB to DAC", __func__, vol_half_db / 2.0); + tas5805m_settings_save_digital_volume(vol_half_db); + } else { + ESP_LOGE(TAG, "%s: Failed to apply digital volume: %s", + __func__, esp_err_to_name(err)); + } + } + + // Update analog gain if present + cJSON *ana_gain_item = cJSON_GetObjectItem(root, "analog_gain"); + if (cJSON_IsNumber(ana_gain_item)) { + int gain_half_db = ana_gain_item->valueint; + + err = tas5805m_set_analog_gain(gain_half_db); + if (err == ESP_OK) { + ESP_LOGI(TAG, "%s: Applied analog gain %.1f dB to DAC", __func__, gain_half_db / 2.0); + tas5805m_settings_save_analog_gain(gain_half_db); + } else { + ESP_LOGE(TAG, "%s: Failed to apply analog gain: %s", + __func__, esp_err_to_name(err)); + } + } + + cJSON_Delete(root); + return err; +} + +esp_err_t tas5805m_settings_get_schema_json(char *json_out, size_t max_len) { + ESP_LOGD(TAG, "%s: max_len=%zu", __func__, max_len); + + if (!json_out || max_len == 0) { + return ESP_ERR_INVALID_ARG; + } + + // Get current state for schema + TAS5805_STATE dac_state; + esp_err_t err = tas5805m_get_state(&dac_state); + if (err != ESP_OK) { + ESP_LOGE(TAG, "%s: Failed to get DAC state: %s", __func__, esp_err_to_name(err)); + // Continue with default state + dac_state.state = TAS5805M_CTRL_PLAY; + } + + // Get current digital volume + int dig_vol_half_db = 0; + if (tas5805m_get_digital_volume_db(&dig_vol_half_db) != ESP_OK) { + dig_vol_half_db = TAS5805M_DIGITAL_VOL_DEFAULT; + } + + // Get current analog gain + int ana_gain_half_db = 0; + if (tas5805m_get_analog_gain(&ana_gain_half_db) != ESP_OK) { + ana_gain_half_db = TAS5805M_ANALOG_GAIN_DEFAULT; + } + + // Build schema JSON + cJSON *root = cJSON_CreateObject(); + if (!root) { + ESP_LOGE(TAG, "%s: Failed to create JSON root", __func__); + return ESP_ERR_NO_MEM; + } + + cJSON *groups = cJSON_CreateArray(); + + // ===== Volume Group ===== + cJSON *volume_group = cJSON_CreateObject(); + cJSON_AddStringToObject(volume_group, "name", "Volume"); + cJSON_AddStringToObject(volume_group, "description", "Digital and analog volume control"); + + cJSON *volume_params = cJSON_CreateArray(); + + // Digital Volume parameter + cJSON *dig_vol_param = cJSON_CreateObject(); + cJSON_AddStringToObject(dig_vol_param, "key", "digital_volume"); + cJSON_AddStringToObject(dig_vol_param, "name", "Digital Volume"); + cJSON_AddStringToObject(dig_vol_param, "type", "range"); + cJSON_AddStringToObject(dig_vol_param, "unit", "dB"); + cJSON_AddNumberToObject(dig_vol_param, "min", TAS5805M_DIGITAL_VOL_MIN); + cJSON_AddNumberToObject(dig_vol_param, "max", TAS5805M_DIGITAL_VOL_MAX); + cJSON_AddNumberToObject(dig_vol_param, "step", TAS5805M_DIGITAL_VOL_STEP); + cJSON_AddNumberToObject(dig_vol_param, "default", TAS5805M_DIGITAL_VOL_DEFAULT); + cJSON_AddNumberToObject(dig_vol_param, "current", dig_vol_half_db); + cJSON_AddNumberToObject(dig_vol_param, "scale", TAS5805M_DIGITAL_VOL_SCALE); + cJSON_AddItemToArray(volume_params, dig_vol_param); + + // Analog Gain parameter + cJSON *ana_gain_param = cJSON_CreateObject(); + cJSON_AddStringToObject(ana_gain_param, "key", "analog_gain"); + cJSON_AddStringToObject(ana_gain_param, "name", "Analog Gain"); + cJSON_AddStringToObject(ana_gain_param, "type", "range"); + cJSON_AddStringToObject(ana_gain_param, "unit", "dB"); + cJSON_AddNumberToObject(ana_gain_param, "min", TAS5805M_ANALOG_GAIN_MIN); + cJSON_AddNumberToObject(ana_gain_param, "max", TAS5805M_ANALOG_GAIN_MAX); + cJSON_AddNumberToObject(ana_gain_param, "step", TAS5805M_ANALOG_GAIN_STEP); + cJSON_AddNumberToObject(ana_gain_param, "default", TAS5805M_ANALOG_GAIN_DEFAULT); + cJSON_AddNumberToObject(ana_gain_param, "current", ana_gain_half_db); + cJSON_AddNumberToObject(ana_gain_param, "scale", TAS5805M_ANALOG_GAIN_SCALE); + cJSON_AddItemToArray(volume_params, ana_gain_param); + + cJSON_AddItemToObject(volume_group, "parameters", volume_params); + cJSON_AddItemToArray(groups, volume_group); + + // ===== State Group ===== + cJSON *state_group = cJSON_CreateObject(); + cJSON_AddStringToObject(state_group, "name", "State"); + cJSON_AddStringToObject(state_group, "description", "DAC power and operation state"); + + cJSON *state_params = cJSON_CreateArray(); + + // State parameter + cJSON *state_param = cJSON_CreateObject(); + cJSON_AddStringToObject(state_param, "key", "state"); + cJSON_AddStringToObject(state_param, "name", "DAC State"); + cJSON_AddStringToObject(state_param, "type", "enum"); + cJSON_AddNumberToObject(state_param, "current", (int)dac_state.state); + + // State enum values + cJSON *values = cJSON_CreateArray(); + + cJSON *val_deep_sleep = cJSON_CreateObject(); + cJSON_AddNumberToObject(val_deep_sleep, "value", TAS5805M_CTRL_DEEP_SLEEP); + cJSON_AddStringToObject(val_deep_sleep, "name", "Deep Sleep"); + cJSON_AddItemToArray(values, val_deep_sleep); + + cJSON *val_sleep = cJSON_CreateObject(); + cJSON_AddNumberToObject(val_sleep, "value", TAS5805M_CTRL_SLEEP); + cJSON_AddStringToObject(val_sleep, "name", "Sleep"); + cJSON_AddItemToArray(values, val_sleep); + + cJSON *val_hiz = cJSON_CreateObject(); + cJSON_AddNumberToObject(val_hiz, "value", TAS5805M_CTRL_HI_Z); + cJSON_AddStringToObject(val_hiz, "name", "Hi-Z"); + cJSON_AddItemToArray(values, val_hiz); + + cJSON *val_play = cJSON_CreateObject(); + cJSON_AddNumberToObject(val_play, "value", TAS5805M_CTRL_PLAY); + cJSON_AddStringToObject(val_play, "name", "Play"); + cJSON_AddItemToArray(values, val_play); + + cJSON *val_play_mute = cJSON_CreateObject(); + cJSON_AddNumberToObject(val_play_mute, "value", TAS5805M_CTRL_PLAY_MUTE); + cJSON_AddStringToObject(val_play_mute, "name", "Play (Muted)"); + cJSON_AddItemToArray(values, val_play_mute); + + cJSON_AddItemToObject(state_param, "values", values); + cJSON_AddItemToArray(state_params, state_param); + + cJSON_AddItemToObject(state_group, "parameters", state_params); + cJSON_AddItemToArray(groups, state_group); + + cJSON_AddItemToObject(root, "groups", groups); + + // Render to string + char *json_str = cJSON_PrintUnformatted(root); + cJSON_Delete(root); + + if (!json_str) { + ESP_LOGE(TAG, "%s: Failed to render JSON", __func__); + return ESP_ERR_NO_MEM; + } + + size_t json_len = strlen(json_str); + ESP_LOGI(TAG, "%s: Generated schema JSON size: %zu bytes (buffer size: %zu)", __func__, json_len, max_len); + + if (json_len >= max_len) { + ESP_LOGE(TAG, "%s: JSON too large for buffer (%zu >= %zu)", __func__, json_len, max_len); + cJSON_free(json_str); + return ESP_ERR_INVALID_SIZE; + } + + strncpy(json_out, json_str, max_len - 1); + json_out[max_len - 1] = '\0'; + cJSON_free(json_str); + + ESP_LOGD(TAG, "%s: Schema JSON generated: %s", __func__, json_out); + return ESP_OK; +} diff --git a/components/ui_http_server/CMakeLists.txt b/components/ui_http_server/CMakeLists.txt index d4d73092..8a41d1fc 100644 --- a/components/ui_http_server/CMakeLists.txt +++ b/components/ui_http_server/CMakeLists.txt @@ -1,9 +1,11 @@ idf_component_register(SRCS "ui_http_server.c" INCLUDE_DIRS "include" - REQUIRES esp_http_server settings_manager dsp_processor_settings + REQUIRES esp_http_server settings_manager dsp_processor_settings tas5805m_settings + PRIV_REQUIRES custom_board EMBED_TXTFILES html/index.html html/index.js html/styles.css html/general-settings.html html/dsp-settings.html + html/dac-settings.html EMBED_FILES html/favicon.ico) diff --git a/components/ui_http_server/html/dac-settings.html b/components/ui_http_server/html/dac-settings.html new file mode 100644 index 00000000..61907209 --- /dev/null +++ b/components/ui_http_server/html/dac-settings.html @@ -0,0 +1,394 @@ + + + + + + ESP32 Snapclient DAC Control + + + + + +

TAS5805M DAC Settings

+ +
+
Loading DAC settings...
+
+ + + + diff --git a/components/ui_http_server/html/index.html b/components/ui_http_server/html/index.html index af39ec99..6cba0e6f 100644 --- a/components/ui_http_server/html/index.html +++ b/components/ui_http_server/html/index.html @@ -90,6 +90,7 @@

ESP32 Snapclient

@@ -117,9 +118,17 @@

ESP32 Snapclient

dspTab.style.display = 'block'; } } + + // Show DAC tab if dac_available is true + if (capabilities.dac_available === true) { + const dacTab = document.getElementById('dac-tab'); + if (dacTab) { + dacTab.style.display = 'block'; + } + } } catch (error) { console.error('Error checking DSP availability:', error); - // DSP tab remains hidden on error + // DSP and DAC tabs remain hidden on error } } From 1a5397a834afb842c27163052aed2e84395a4727 Mon Sep 17 00:00:00 2001 From: Andriy Malyshenko Date: Wed, 26 Nov 2025 16:01:41 +0100 Subject: [PATCH 13/58] Add persistence for DAC mode, modulation mode, digital volume and analog gain to tas5805m_settings --- .../custom_board/tas5805m/include/tas5805m.h | 202 +++++++-- components/custom_board/tas5805m/tas5805m.c | 324 ++++++++++--- .../include/tas5805m_settings.h | 40 ++ .../tas5805m_settings/tas5805m_settings.c | 424 ++++++++++++++++-- 4 files changed, 826 insertions(+), 164 deletions(-) diff --git a/components/custom_board/tas5805m/include/tas5805m.h b/components/custom_board/tas5805m/include/tas5805m.h index fe0d636f..4ca74976 100644 --- a/components/custom_board/tas5805m/include/tas5805m.h +++ b/components/custom_board/tas5805m/include/tas5805m.h @@ -42,29 +42,28 @@ extern "C" { #define I2C_MASTER_RX_BUF_DISABLE 0 /*!< I2C master doesn't need buffer */ #define I2C_MASTER_TIMEOUT_MS 1000 -#define TAS5805M_VOLUME_MUTE 0xff // (-103.5 dB - actual mute) -#define TAS5805M_VOLUME_MIN 0xa8 // ( -60 dB - save value representing barely hearable volume) -#define TAS5805M_VOLUME_MAX 0x30 // ( 0 dB - maximum volume that guarantees no distortion ) +#define TAS5805M_VOLUME_MUTE 0xff // (-103.5 dB - actual mute) +#define TAS5805M_VOLUME_MIN \ + 0xa8 // ( -60 dB - save value representing barely hearable volume) +#define TAS5805M_VOLUME_MAX \ + 0x30 // ( 0 dB - maximum volume that guarantees no distortion ) /* // TODO: make it available for user configuration -#define TAS5805M_REG_VOLUME_MAX 0x00 // (+24 dB - maximum volume that DAC can do) +#define TAS5805M_REG_VOLUME_MAX 0x00 // (+24 dB - maximum volume that DAC +can do) */ -/* See here for the original Implementation : audio_hal/driver/tas5805m */ -/* Its not from me it was developed by Espressif */ -/* Volume steps tas5805m_volume[0] => 255 which means mute */ -static const uint8_t tas5805m_volume[] = { - 0xff, 0x9f, 0x8f, 0x7f, 0x6f, 0x5f, 0x5c, 0x5a, 0x58, 0x54, 0x50, - 0x4c, 0x4a, 0x48, 0x44, 0x40, 0x3d, 0x3b, 0x39, 0x37, 0x35}; - +#define TAS5805M_VOLUME_DIGITAL_MAX 255 // Mute +#define TAS5805M_VOLUME_DIGITAL_DEFAULT 48 // +0 Db +#define TAS5805M_VOLUME_DIGITAL_MIN 0 // +24 Db typedef enum { - TAS5805M_CTRL_DEEP_SLEEP = 0x00, // Deep Sleep - TAS5805M_CTRL_SLEEP = 0x01, // Sleep - TAS5805M_CTRL_HI_Z = 0x02, // Hi-Z - TAS5805M_CTRL_PLAY = 0x03, // Play - TAS5805M_CTRL_MUTE = 0x08, // Mute Flag - // Mute, but driver in PLAY state + TAS5805M_CTRL_DEEP_SLEEP = 0x00, // Deep Sleep + TAS5805M_CTRL_SLEEP = 0x01, // Sleep + TAS5805M_CTRL_HI_Z = 0x02, // Hi-Z + TAS5805M_CTRL_PLAY = 0x03, // Play + TAS5805M_CTRL_MUTE = 0x08, // Mute Flag + // Mute, but driver in PLAY state TAS5805M_CTRL_PLAY_MUTE = TAS5805M_CTRL_MUTE | TAS5805M_CTRL_PLAY } TAS5805M_CTRL_STATE; @@ -73,6 +72,38 @@ typedef struct { TAS5805M_CTRL_STATE state; } TAS5805_STATE; +typedef enum { + TAS5805M_DAC_MODE_BTL = 0x00, // Bridge tied load + TAS5805M_DAC_MODE_PBTL = 0x01 // Parallel load +} TAS5805M_DAC_MODE; + +typedef enum { + SW_FREQ_768K = (0x00 << 4), + SW_FREQ_384K = (0x01 << 4), + SW_FREQ_480K = (0x03 << 4), + SW_FREQ_576K = (0x04 << 4), +} TAS5805M_SW_FREQ; + +typedef enum { + SW_FREQ_80K = (0x00 << 5), + SW_FREQ_100K = (0x01 << 5), + SW_FREQ_120K = (0x02 << 5), + SW_FREQ_175K = (0x03 << 5), +} TAS5805M_BD_FREQ; + +typedef enum { + MOD_MODE_BD = 0x0, + MOD_MODE_1SPW = 0x1, + MOD_MODE_HYBRID = 0x2, +} TAS5805M_MOD_MODE; + +typedef struct { + uint8_t err0; + uint8_t err1; + uint8_t err2; + uint8_t ot_warn; +} TAS5805M_FAULT; + /** * @brief Initialize TAS5805 codec chip * @@ -116,49 +147,26 @@ esp_err_t tas5805m_set_volume(int vol); esp_err_t tas5805m_get_volume(int *vol); /** - * @brief Set analog gain (register 0x54) - * - * @param gain_db: gain in 0.5dB steps, range -15.5 to 0 dB - * Stored as int representing 0.5dB steps (e.g., -31 = -15.5dB, 0 = 0dB) - * - * @return - * - ESP_OK - * - ESP_FAIL - */ -esp_err_t tas5805m_set_analog_gain(int gain_half_db); - -/** - * @brief Get analog gain (register 0x54) - * - * @param[out] gain_half_db: gain in 0.5dB steps - * - * @return - * - ESP_OK - * - ESP_FAIL - */ -esp_err_t tas5805m_get_analog_gain(int *gain_half_db); - -/** - * @brief Set digital volume in dB (register 0x4c) + * @brief Set device volume) * - * @param vol_half_db: volume in 0.5dB steps, range -207 to 48 (-103.5dB to 24dB) + * @param volume: digital volume (inverted) (0~255) * * @return * - ESP_OK * - ESP_FAIL */ -esp_err_t tas5805m_set_digital_volume_db(int vol_half_db); +esp_err_t tas5805m_set_digital_volume(uint8_t vol); /** - * @brief Get digital volume in dB (register 0x4c) + * @brief Get device volume * - * @param[out] vol_half_db: volume in 0.5dB steps + * @param[out] *volume: digital volume (inverted) (0~255) * * @return * - ESP_OK * - ESP_FAIL */ -esp_err_t tas5805m_get_digital_volume_db(int *vol_half_db); +esp_err_t tas5805m_get_digital_volume(uint8_t *vol); /** * @brief Set TAS5805 mute or not @@ -207,21 +215,117 @@ esp_err_t tas5805m_set_state(TAS5805M_CTRL_STATE state); * @return * - ESP_OK * - ESP_FAIL - */ + */ esp_err_t tas5805m_ctrl(audio_hal_codec_mode_t mode, audio_hal_ctrl_t ctrl_state); /** * @brief Configure the I2S interface of TAS5805 codec chip * @param mode: codec mode - * @param iface: I2S interface configuration + * @param iface: I2S interface configuration * @return * - ESP_OK * - ESP_FAIL - */ + */ esp_err_t tas5805m_config_iface(audio_hal_codec_mode_t mode, audio_hal_codec_i2s_iface_t *iface); +/** + * @brief Get the current DAC mode of the TAS5805M + * + * @param mode: Pointer to the mode variable + * + */ +esp_err_t tas5805m_get_dac_mode(TAS5805M_DAC_MODE *mode); + +/** + * @brief Set the DAC mode of the TAS5805M + * + * @param mode: The mode to set + * + */ +esp_err_t tas5805m_set_dac_mode(TAS5805M_DAC_MODE mode); + +/** + * @brief Get the current modulation mode of the TAS5805M + * + * @param mode: Pointer to the mode variable + * @param freq: Pointer to the DSP frequency variable + * @param bd_freq: Pointer to the BD frequency variable + * + * @return + * - ESP_OK + * - ESP_FAIL + */ +esp_err_t tas5805m_get_modulation_mode(TAS5805M_MOD_MODE *mode, + TAS5805M_SW_FREQ *freq, + TAS5805M_BD_FREQ *bd_freq); + +/** + * @brief Set the modulation mode of the TAS5805M + * + * @param mode: The mode to set + * @param freq: The DSP frequency to set + * @param bd_freq: The BD frequency to set + * + * @return + * - ESP_OK + * - ESP_FAIL + */ +esp_err_t tas5805m_set_modulation_mode(TAS5805M_MOD_MODE mode, + TAS5805M_SW_FREQ freq, + TAS5805M_BD_FREQ bd_freq); + +/** + * @brief Get the analog gain of the TAS5805M + * + * @param gain: Pointer to the gain variable + * + * @return + * - ESP_OK + * - ESP_FAIL + */ +esp_err_t tas5805m_get_again(uint8_t *gain); + +/** + * @brief Set the analog gain of the TAS5805M + * + * @param gain: The gain to set + * + * @return + * - ESP_OK + * - ESP_FAIL + */ +esp_err_t tas5805m_set_again(uint8_t gain); + +/** + * @brief Get the faults of the TAS5805M + * + * @param fault: Pointer to the fault struct + * + * @return + * - ESP_OK + * - ESP_FAIL + */ +esp_err_t tas5805m_get_faults(TAS5805M_FAULT *fault); + +/** + * @brief Clear the faults of the TAS5805M + * + * @return + * - ESP_OK + * - ESP_FAIL + */ +esp_err_t tas5805m_clear_faults(); + +/** + * @brief Decode the errors from the TAS5805M + * + * @param fault: The fault struct to decode + * + */ +void tas5805m_decode_faults(TAS5805M_FAULT fault); + #ifdef __cplusplus } #endif diff --git a/components/custom_board/tas5805m/tas5805m.c b/components/custom_board/tas5805m/tas5805m.c index ef94fd60..bab9b736 100644 --- a/components/custom_board/tas5805m/tas5805m.c +++ b/components/custom_board/tas5805m/tas5805m.c @@ -319,91 +319,41 @@ esp_err_t tas5805m_get_volume(int *vol) { return ESP_OK; } -// Set digital volume in dB (0.5dB steps) -esp_err_t tas5805m_set_digital_volume_db(int vol_half_db) { - ESP_LOGD(TAG, "%s: Setting digital volume to %d half-dB (%.1f dB)", __func__, vol_half_db, vol_half_db / 2.0); - - // Clamp to valid range: -207 to +48 (-103.5dB to +24dB) - if (vol_half_db < -207) vol_half_db = -207; - if (vol_half_db > 48) vol_half_db = 48; - - // Convert half-dB to register value - // Register: 0x00 = +24dB, 0x30 = 0dB, 0xff = -103.5dB (mute) - // Formula: reg = 48 - vol_half_db - uint8_t reg_val = (uint8_t)(48 - vol_half_db); - - esp_err_t ret = tas5805m_write_byte(TAS5805M_DIG_VOL_CTRL_REGISTER, reg_val); - if (ret != ESP_OK) { - ESP_LOGW(TAG, "%s: Failed to write digital volume (reg 0x%02x): %s", __func__, reg_val, esp_err_to_name(ret)); - } - return ret; -} -// Get digital volume in dB (0.5dB steps) -esp_err_t tas5805m_get_digital_volume_db(int *vol_half_db) { - if (vol_half_db == NULL) { - return ESP_ERR_INVALID_ARG; +// Setting the Volume [0..255], 0 is mute, 255 is full blast +esp_err_t tas5805m_set_digital_volume(uint8_t vol) +{ + esp_err_t ret = ESP_OK; + if (vol < TAS5805M_VOLUME_DIGITAL_MIN) + { + vol = TAS5805M_VOLUME_DIGITAL_MIN; } - - uint8_t reg_val = 0; - esp_err_t ret = tas5805m_read_byte(TAS5805M_DIG_VOL_CTRL_REGISTER, ®_val); - if (ret != ESP_OK) { - ESP_LOGW(TAG, "%s: Failed to read digital volume register: %s", __func__, esp_err_to_name(ret)); - return ret; + if (vol > TAS5805M_VOLUME_DIGITAL_MAX) + { + vol = TAS5805M_VOLUME_DIGITAL_MAX; } - - // Convert register value to half-dB - // Formula: vol_half_db = 48 - reg - *vol_half_db = 48 - (int)reg_val; - - ESP_LOGD(TAG, "%s: Digital volume: reg=0x%02x, value=%d half-dB (%.1f dB)", - __func__, reg_val, *vol_half_db, *vol_half_db / 2.0); - return ESP_OK; -} -// Set analog gain in dB (0.5dB steps) -esp_err_t tas5805m_set_analog_gain(int gain_half_db) { - ESP_LOGD(TAG, "%s: Setting analog gain to %d half-dB (%.1f dB)", __func__, gain_half_db, gain_half_db / 2.0); - - // Clamp to valid range: -31 to 0 (-15.5dB to 0dB) - if (gain_half_db < -31) gain_half_db = -31; - if (gain_half_db > 0) gain_half_db = 0; - - // Convert half-dB to register value - // Register: bits [4:0], 0x00 = 0dB, 0x1f = -15.5dB - // Formula: reg = -gain_half_db - uint8_t reg_val = (uint8_t)(-gain_half_db) & 0x1F; - - esp_err_t ret = tas5805m_write_byte(TAS5805M_AGAIN_REGISTER, reg_val); - if (ret != ESP_OK) { - ESP_LOGW(TAG, "%s: Failed to write analog gain (reg 0x%02x): %s", __func__, reg_val, esp_err_to_name(ret)); + ret = tas5805m_write_byte(TAS5805M_DIG_VOL_CTRL, vol); + if (ret != ESP_OK) + { + ESP_LOGE(TAG, "%s: Error during I2C transmission: %s", __func__, esp_err_to_name(ret)); } + return ret; } -// Get analog gain in dB (0.5dB steps) -esp_err_t tas5805m_get_analog_gain(int *gain_half_db) { - if (gain_half_db == NULL) { - return ESP_ERR_INVALID_ARG; - } - - uint8_t reg_val = 0; - esp_err_t ret = tas5805m_read_byte(TAS5805M_AGAIN_REGISTER, ®_val); - if (ret != ESP_OK) { - ESP_LOGW(TAG, "%s: Failed to read analog gain register: %s", __func__, esp_err_to_name(ret)); - return ret; +// Getting the Volume [0..255], 0 is mute, 255 is full blast +esp_err_t tas5805m_get_digital_volume(uint8_t *vol) +{ + esp_err_t ret = ESP_OK; + ret = tas5805m_read_byte(TAS5805M_DIG_VOL_CTRL_REGISTER, vol); + if (ret != ESP_OK) + { + ESP_LOGE(TAG, "%s: Error during I2C transmission: %s", __func__, esp_err_to_name(ret)); } - - // Convert register value to half-dB - // Formula: gain_half_db = -(reg & 0x1F) - *gain_half_db = -(int)(reg_val & 0x1F); - - ESP_LOGD(TAG, "%s: Analog gain: reg=0x%02x, value=%d half-dB (%.1f dB)", - __func__, reg_val, *gain_half_db, *gain_half_db / 2.0); - return ESP_OK; + return ret; } - // Deinit the TAS5805M esp_err_t tas5805m_deinit(void) { ESP_ERROR_CHECK(tas5805m_set_state(TAS5805M_CTRL_HI_Z)); @@ -462,3 +412,229 @@ esp_err_t tas5805m_config_iface(audio_hal_codec_mode_t mode, // TODO return ESP_OK; } + +esp_err_t tas5805m_get_dac_mode(TAS5805M_DAC_MODE *mode) +{ + uint8_t current_value; + esp_err_t err = tas5805m_read_byte(TAS5805M_DEVICE_CTRL_1, ¤t_value); + if (err != ESP_OK) { + ESP_LOGE(TAG, "%s: Error during I2C transmission: %s", __func__, esp_err_to_name(err)); + return err; + } + + if (current_value & (1 << 2)) { + *mode = TAS5805M_DAC_MODE_PBTL; + } else { + *mode = TAS5805M_DAC_MODE_BTL; + } + + return ESP_OK; +} + +esp_err_t tas5805m_set_dac_mode(TAS5805M_DAC_MODE mode) +{ + ESP_LOGD(TAG, "%s: Setting DAC mode to %d", __func__, mode); + + // Read the current value of the register + uint8_t current_value; + esp_err_t err = tas5805m_read_byte(TAS5805M_DEVICE_CTRL_1, ¤t_value); + if (err != ESP_OK) { + ESP_LOGE(TAG, "%s: Error during I2C transmission: %s", __func__, esp_err_to_name(err)); + return err; + } + + // Update bit 2 based on the mode + if (mode == TAS5805M_DAC_MODE_PBTL) { + current_value |= (1 << 2); // Set bit 2 to 1 (PBTL mode) + } else { + current_value &= ~(1 << 2); // Clear bit 2 to 0 (BTL mode) + } + + // Write the updated value back to the register + int ret = tas5805m_write_byte(TAS5805M_DEVICE_CTRL_1, current_value); + if (ret != ESP_OK) { + ESP_LOGE(TAG, "%s: Error during I2C transmission: %s", __func__, esp_err_to_name(ret)); + } + + return ret; +} + +esp_err_t tas5805m_get_modulation_mode(TAS5805M_MOD_MODE *mode, TAS5805M_SW_FREQ *freq, TAS5805M_BD_FREQ *bd_freq) +{ + // Read the current value of the register + uint8_t current_value; + esp_err_t err = tas5805m_read_byte(TAS5805M_DEVICE_CTRL_1, ¤t_value); + if (err != ESP_OK) { + ESP_LOGE(TAG, "%s: Error during I2C transmission: %s", __func__, esp_err_to_name(err)); + return err; + } + + // Extract bits 0-1 + *mode = (current_value & 0b00000011); + // Extract bits 4-6 + *freq = (current_value & 0b01110000); + + // Read the BD frequency + err = tas5805m_read_byte(TAS5805M_ANA_CTRL, ¤t_value); + if (err != ESP_OK) { + ESP_LOGE(TAG, "%s: Error during I2C transmission: %s", __func__, esp_err_to_name(err)); + return err; + } + + *bd_freq = (current_value & 0b01100000); + return ESP_OK; +} + +esp_err_t tas5805m_set_modulation_mode(TAS5805M_MOD_MODE mode, TAS5805M_SW_FREQ freq, TAS5805M_BD_FREQ bd_freq) +{ + ESP_LOGD(TAG, "%s: Setting modulation to %d, FSW: %d, Class-D bandwidth control: %d", __func__, mode, freq, bd_freq); + + // Read the current value of the register + uint8_t current_value; + esp_err_t err = tas5805m_read_byte(TAS5805M_DEVICE_CTRL_1, ¤t_value); + if (err != ESP_OK) { + ESP_LOGE(TAG, "%s: Error during I2C transmission: %s", __func__, esp_err_to_name(err)); + return err; + } + + // Clear bits 0-1 and 4-6 + current_value &= ~((0x07 << 4) | (0x03 << 0)); + // Update bit 0-1 based on the mode + current_value |= mode & 0b00000011; // Set bits 0-1 + // Update bits 4-6 based on sw freq + current_value |= freq & 0b01110000; // Set bits 4-6 + + // Write the updated value back to the register + int ret = tas5805m_write_byte(TAS5805M_DEVICE_CTRL_1, current_value); + if (ret != ESP_OK) { + ESP_LOGE(TAG, "%s: Error during I2C transmission: %s", __func__, esp_err_to_name(ret)); + } + + // Set the BD frequency + ret = tas5805m_write_byte(TAS5805M_ANA_CTRL, bd_freq); + if (ret != ESP_OK) { + ESP_LOGE(TAG, "%s: Error during I2C transmission: %s", __func__, esp_err_to_name(ret)); + } + + return ret; +} + +esp_err_t tas5805m_get_again(uint8_t *gain) +{ + int ret = ESP_OK; + ret = tas5805m_read_byte(TAS5805M_AGAIN, gain); + if (ret != ESP_OK) + { + ESP_LOGE(TAG, "%s: Error during I2C transmission: %s", __func__, esp_err_to_name(ret)); + } + return ret; +} + +esp_err_t tas5805m_set_again(uint8_t gain) +{ + // Gain is inverted! + if (gain < TAS5805M_MAX_GAIN || gain > TAS5805M_MIN_GAIN) + { + ESP_LOGE(TAG, "%s: Invalid gain %d", __func__, gain); + return ESP_ERR_INVALID_ARG; + } + + uint8_t value = tas5805m_again[gain]; + int ret = tas5805m_write_byte(TAS5805M_AGAIN, value); + if (ret != ESP_OK) + { + ESP_LOGE(TAG, "%s: Error during I2C transmission: %s", __func__, esp_err_to_name(ret)); + } + + return ret; +} + +esp_err_t tas5805m_clear_faults() +{ + ESP_LOGD(TAG, "%s: Clearing faults", __func__); + int ret = tas5805m_write_byte(TAS5805M_FAULT_CLEAR, TAS5805M_ANALOG_FAULT_CLEAR); + if (ret != ESP_OK) + { + ESP_LOGE(TAG, "%s: Error during I2C transmission: %s", __func__, esp_err_to_name(ret)); + } + return ret; +} + +esp_err_t tas5805m_get_faults(TAS5805M_FAULT *fault) +{ + int ret = ESP_OK; + + ret = tas5805m_read_byte(TAS5805M_CHAN_FAULT, &(fault->err0)); + if (ret != ESP_OK) + { + ESP_LOGE(TAG, "%s: Error during I2C transmission: %s", __func__, esp_err_to_name(ret)); + return ret; + } + + ret = tas5805m_read_byte(TAS5805M_GLOBAL_FAULT1, &(fault->err1)); + if (ret != ESP_OK) + { + ESP_LOGE(TAG, "%s: Error during I2C transmission: %s", __func__, esp_err_to_name(ret)); + return ret; + } + + ret = tas5805m_read_byte(TAS5805M_GLOBAL_FAULT2, &(fault->err2)); + if (ret != ESP_OK) + { + ESP_LOGE(TAG, "%s: Error during I2C transmission: %s", __func__, esp_err_to_name(ret)); + return ret; + } + + ret= tas5805m_read_byte(TAS5805M_OT_WARNING, &(fault->ot_warn)); + if (ret != ESP_OK) + { + ESP_LOGE(TAG, "%s: Error during I2C transmission: %s", __func__, esp_err_to_name(ret)); + return ret; + } + + return ret; +} + +void tas5805m_decode_faults(TAS5805M_FAULT fault) +{ + if (fault.err0) { + if (fault.err0 & (1 << 0)) + ESP_LOGW(TAG, "%s: Right channel over current fault", __func__); + + if (fault.err0 & (1 << 1)) + ESP_LOGW(TAG, "%s: Left channel over current fault", __func__); + + if (fault.err0 & (1 << 2)) + ESP_LOGW(TAG, "%s: Right channel DC fault", __func__); + + if (fault.err0 & (1 << 3)) + ESP_LOGW(TAG, "%s: Left channel DC fault", __func__); + } + + if (fault.err1) { + if (fault.err1 & (1 << 0)) + ESP_LOGW(TAG, "%s: PVDD UV fault", __func__); + + if (fault.err1 & (1 << 1)) + ESP_LOGW(TAG, "%s: PVDD OV fault", __func__); + + if (fault.err1 & (1 << 2)) + ESP_LOGW(TAG, "%s: Clock fault", __func__); + + if (fault.err1 & (1 << 6)) + ESP_LOGW(TAG, "%s: The recent BQ is written failed", __func__); + + if (fault.err1 & (1 << 7)) + ESP_LOGW(TAG, "%s: Indicate OTP CRC check error", __func__); + } + + if (fault.err2) { + if (fault.err2 & (1 << 0)) + ESP_LOGW(TAG, "%s: Over temperature shut down fault", __func__); + } + + if (fault.ot_warn) { + if (fault.ot_warn & (1 << 2)) + ESP_LOGW(TAG, "%s: Over temperature warning", __func__); + } +} \ No newline at end of file diff --git a/components/tas5805m_settings/include/tas5805m_settings.h b/components/tas5805m_settings/include/tas5805m_settings.h index f6035634..dfae3a08 100644 --- a/components/tas5805m_settings/include/tas5805m_settings.h +++ b/components/tas5805m_settings/include/tas5805m_settings.h @@ -27,6 +27,10 @@ extern "C" { #define TAS5805M_NVS_KEY_STATE "state" #define TAS5805M_NVS_KEY_DIGITAL_VOL "dig_vol" #define TAS5805M_NVS_KEY_ANALOG_GAIN "ana_gain" +#define TAS5805M_NVS_KEY_DAC_MODE "dac_mode" +#define TAS5805M_NVS_KEY_MOD_MODE "mod_mode" +#define TAS5805M_NVS_KEY_SW_FREQ "sw_freq" +#define TAS5805M_NVS_KEY_BD_FREQ "bd_freq" // Digital Volume Settings (in 0.5dB steps) #define TAS5805M_DIGITAL_VOL_MIN -207 // -103.5 dB @@ -91,6 +95,42 @@ esp_err_t tas5805m_settings_save_analog_gain(int gain_half_db); */ esp_err_t tas5805m_settings_load_analog_gain(int *gain_half_db); +/** + * Save DAC mode setting to NVS + * @param mode The DAC mode (BTL or PBTL) + * @return ESP_OK on success + */ +esp_err_t tas5805m_settings_save_dac_mode(TAS5805M_DAC_MODE mode); + +/** + * Load DAC mode setting from NVS + * @param mode Pointer to store the DAC mode + * @return ESP_OK on success, ESP_ERR_NVS_NOT_FOUND if not set + */ +esp_err_t tas5805m_settings_load_dac_mode(TAS5805M_DAC_MODE *mode); + +/** + * Save modulation mode settings to NVS + * @param mode The modulation mode + * @param freq The switching frequency + * @param bd_freq The BD frequency + * @return ESP_OK on success + */ +esp_err_t tas5805m_settings_save_modulation_mode(TAS5805M_MOD_MODE mode, + TAS5805M_SW_FREQ freq, + TAS5805M_BD_FREQ bd_freq); + +/** + * Load modulation mode settings from NVS + * @param mode Pointer to store modulation mode + * @param freq Pointer to store switching frequency + * @param bd_freq Pointer to store BD frequency + * @return ESP_OK on success, ESP_ERR_NVS_NOT_FOUND if not set + */ +esp_err_t tas5805m_settings_load_modulation_mode(TAS5805M_MOD_MODE *mode, + TAS5805M_SW_FREQ *freq, + TAS5805M_BD_FREQ *bd_freq); + /** * Get current TAS5805M settings as a JSON string * Queries the tas5805m component for current state and formats as JSON diff --git a/components/tas5805m_settings/tas5805m_settings.c b/components/tas5805m_settings/tas5805m_settings.c index 8c7e486a..1dcd3479 100644 --- a/components/tas5805m_settings/tas5805m_settings.c +++ b/components/tas5805m_settings/tas5805m_settings.c @@ -206,6 +206,136 @@ esp_err_t tas5805m_settings_load_analog_gain(int *gain_half_db) { return err; } +esp_err_t tas5805m_settings_save_dac_mode(TAS5805M_DAC_MODE mode) { + ESP_LOGD(TAG, "%s: mode=%d", __func__, (int)mode); + + if (!tas5805m_settings_mutex) return ESP_ERR_INVALID_STATE; + + if (xSemaphoreTake(tas5805m_settings_mutex, pdMS_TO_TICKS(5000)) != pdTRUE) { + return ESP_ERR_TIMEOUT; + } + + nvs_handle_t h; + esp_err_t err = nvs_open(TAS5805M_NVS_NAMESPACE, NVS_READWRITE, &h); + if (err == ESP_OK) { + err = nvs_set_i32(h, TAS5805M_NVS_KEY_DAC_MODE, (int32_t)mode); + if (err == ESP_OK) { + err = nvs_commit(h); + } + nvs_close(h); + } + + xSemaphoreGive(tas5805m_settings_mutex); + + if (err == ESP_OK) { + ESP_LOGI(TAG, "%s: DAC mode saved: %d (%s)", __func__, (int)mode, + mode == TAS5805M_DAC_MODE_BTL ? "BTL" : "PBTL"); + } else { + ESP_LOGE(TAG, "%s: Failed to save DAC mode: %s", __func__, esp_err_to_name(err)); + } + + return err; +} + +esp_err_t tas5805m_settings_load_dac_mode(TAS5805M_DAC_MODE *mode) { + if (!mode) return ESP_ERR_INVALID_ARG; + if (!tas5805m_settings_mutex) return ESP_ERR_INVALID_STATE; + + if (xSemaphoreTake(tas5805m_settings_mutex, pdMS_TO_TICKS(5000)) != pdTRUE) { + return ESP_ERR_TIMEOUT; + } + + nvs_handle_t h; + esp_err_t err = nvs_open(TAS5805M_NVS_NAMESPACE, NVS_READONLY, &h); + if (err == ESP_OK) { + int32_t v = 0; + err = nvs_get_i32(h, TAS5805M_NVS_KEY_DAC_MODE, &v); + if (err == ESP_OK) { + *mode = (TAS5805M_DAC_MODE)v; + ESP_LOGD(TAG, "%s: DAC mode from NVS: %d (%s)", __func__, (int)*mode, + *mode == TAS5805M_DAC_MODE_BTL ? "BTL" : "PBTL"); + } + nvs_close(h); + } + + xSemaphoreGive(tas5805m_settings_mutex); + return err; +} + +esp_err_t tas5805m_settings_save_modulation_mode(TAS5805M_MOD_MODE mode, + TAS5805M_SW_FREQ freq, + TAS5805M_BD_FREQ bd_freq) { + ESP_LOGD(TAG, "%s: mode=%d, freq=%d, bd_freq=%d", __func__, (int)mode, (int)freq, (int)bd_freq); + + if (!tas5805m_settings_mutex) return ESP_ERR_INVALID_STATE; + + if (xSemaphoreTake(tas5805m_settings_mutex, pdMS_TO_TICKS(5000)) != pdTRUE) { + return ESP_ERR_TIMEOUT; + } + + nvs_handle_t h; + esp_err_t err = nvs_open(TAS5805M_NVS_NAMESPACE, NVS_READWRITE, &h); + if (err == ESP_OK) { + err = nvs_set_i32(h, TAS5805M_NVS_KEY_MOD_MODE, (int32_t)mode); + if (err == ESP_OK) { + err = nvs_set_i32(h, TAS5805M_NVS_KEY_SW_FREQ, (int32_t)freq); + } + if (err == ESP_OK) { + err = nvs_set_i32(h, TAS5805M_NVS_KEY_BD_FREQ, (int32_t)bd_freq); + } + if (err == ESP_OK) { + err = nvs_commit(h); + } + nvs_close(h); + } + + xSemaphoreGive(tas5805m_settings_mutex); + + if (err == ESP_OK) { + ESP_LOGI(TAG, "%s: Modulation mode saved: mode=%d, freq=%d, bd_freq=%d", + __func__, (int)mode, (int)freq, (int)bd_freq); + } else { + ESP_LOGE(TAG, "%s: Failed to save modulation mode: %s", __func__, esp_err_to_name(err)); + } + + return err; +} + +esp_err_t tas5805m_settings_load_modulation_mode(TAS5805M_MOD_MODE *mode, + TAS5805M_SW_FREQ *freq, + TAS5805M_BD_FREQ *bd_freq) { + if (!mode || !freq || !bd_freq) return ESP_ERR_INVALID_ARG; + if (!tas5805m_settings_mutex) return ESP_ERR_INVALID_STATE; + + if (xSemaphoreTake(tas5805m_settings_mutex, pdMS_TO_TICKS(5000)) != pdTRUE) { + return ESP_ERR_TIMEOUT; + } + + nvs_handle_t h; + esp_err_t err = nvs_open(TAS5805M_NVS_NAMESPACE, NVS_READONLY, &h); + if (err == ESP_OK) { + int32_t v_mode = 0, v_freq = 0, v_bd = 0; + err = nvs_get_i32(h, TAS5805M_NVS_KEY_MOD_MODE, &v_mode); + if (err == ESP_OK) { + err = nvs_get_i32(h, TAS5805M_NVS_KEY_SW_FREQ, &v_freq); + } + if (err == ESP_OK) { + err = nvs_get_i32(h, TAS5805M_NVS_KEY_BD_FREQ, &v_bd); + } + if (err == ESP_OK) { + *mode = (TAS5805M_MOD_MODE)v_mode; + *freq = (TAS5805M_SW_FREQ)v_freq; + *bd_freq = (TAS5805M_BD_FREQ)v_bd; + ESP_LOGD(TAG, "%s: Modulation mode from NVS: mode=%d, freq=%d, bd_freq=%d", + __func__, (int)*mode, (int)*freq, (int)*bd_freq); + } + nvs_close(h); + } + + xSemaphoreGive(tas5805m_settings_mutex); + return err; +} + esp_err_t tas5805m_settings_get_json(char *json_out, size_t max_len) { ESP_LOGD(TAG, "%s: max_len=%zu", __func__, max_len); @@ -221,6 +351,34 @@ esp_err_t tas5805m_settings_get_json(char *json_out, size_t max_len) { return err; } + // Get DAC mode + TAS5805M_DAC_MODE dac_mode; + if (tas5805m_get_dac_mode(&dac_mode) != ESP_OK) { + dac_mode = TAS5805M_DAC_MODE_BTL; + } + + // Get modulation mode + TAS5805M_MOD_MODE mod_mode; + TAS5805M_SW_FREQ sw_freq; + TAS5805M_BD_FREQ bd_freq; + if (tas5805m_get_modulation_mode(&mod_mode, &sw_freq, &bd_freq) != ESP_OK) { + mod_mode = MOD_MODE_BD; + sw_freq = SW_FREQ_768K; + bd_freq = SW_FREQ_80K; + } + + // Get analog gain + uint8_t analog_gain; + if (tas5805m_get_again(&analog_gain) != ESP_OK) { + analog_gain = 0; + } + + // Get digital volume (stored in TAS5805_STATE) + uint8_t digital_volume; + if (tas5805m_get_digital_volume(&digital_volume) != ESP_OK) { + digital_volume = TAS5805M_VOLUME_DIGITAL_DEFAULT; + } + // Build JSON cJSON *root = cJSON_CreateObject(); if (!root) { @@ -234,6 +392,14 @@ esp_err_t tas5805m_settings_get_json(char *json_out, size_t max_len) { bool muted = (dac_state.state & TAS5805M_CTRL_MUTE) != 0; cJSON_AddBoolToObject(root, "muted", muted); + + cJSON_AddNumberToObject(root, "digital_volume", digital_volume); + cJSON_AddNumberToObject(root, "analog_gain", analog_gain); + cJSON_AddNumberToObject(root, "dac_mode", (int)dac_mode); + cJSON_AddStringToObject(root, "dac_mode_name", dac_mode == TAS5805M_DAC_MODE_BTL ? "BTL" : "PBTL"); + cJSON_AddNumberToObject(root, "modulation_mode", (int)mod_mode); + cJSON_AddNumberToObject(root, "sw_freq", (int)sw_freq); + cJSON_AddNumberToObject(root, "bd_freq", (int)bd_freq); // Render to string char *json_str = cJSON_PrintUnformatted(root); @@ -297,36 +463,75 @@ esp_err_t tas5805m_settings_set_from_json(const char *json_in) { } } - // Update digital volume if present + // Update digital volume if present (expects raw uint8_t value) cJSON *dig_vol_item = cJSON_GetObjectItem(root, "digital_volume"); if (cJSON_IsNumber(dig_vol_item)) { - int vol_half_db = dig_vol_item->valueint; + uint8_t vol = (uint8_t)dig_vol_item->valueint; - err = tas5805m_set_digital_volume_db(vol_half_db); + err = tas5805m_set_digital_volume(vol); if (err == ESP_OK) { - ESP_LOGI(TAG, "%s: Applied digital volume %.1f dB to DAC", __func__, vol_half_db / 2.0); - tas5805m_settings_save_digital_volume(vol_half_db); + ESP_LOGI(TAG, "%s: Applied digital volume %d to DAC", __func__, vol); + // Note: We're saving the raw value, conversion to half_db would need lookup table + tas5805m_settings_save_digital_volume((int)vol); } else { ESP_LOGE(TAG, "%s: Failed to apply digital volume: %s", __func__, esp_err_to_name(err)); } } - // Update analog gain if present + // Update analog gain if present (expects uint8_t 0-31) cJSON *ana_gain_item = cJSON_GetObjectItem(root, "analog_gain"); if (cJSON_IsNumber(ana_gain_item)) { - int gain_half_db = ana_gain_item->valueint; + uint8_t gain = (uint8_t)ana_gain_item->valueint; - err = tas5805m_set_analog_gain(gain_half_db); + err = tas5805m_set_again(gain); if (err == ESP_OK) { - ESP_LOGI(TAG, "%s: Applied analog gain %.1f dB to DAC", __func__, gain_half_db / 2.0); - tas5805m_settings_save_analog_gain(gain_half_db); + ESP_LOGI(TAG, "%s: Applied analog gain %d to DAC", __func__, gain); + // Note: We're saving the raw value, conversion to half_db would need lookup table + tas5805m_settings_save_analog_gain((int)gain); } else { ESP_LOGE(TAG, "%s: Failed to apply analog gain: %s", __func__, esp_err_to_name(err)); } } + // Update DAC mode if present + cJSON *dac_mode_item = cJSON_GetObjectItem(root, "dac_mode"); + if (cJSON_IsNumber(dac_mode_item)) { + TAS5805M_DAC_MODE mode = (TAS5805M_DAC_MODE)dac_mode_item->valueint; + + err = tas5805m_set_dac_mode(mode); + if (err == ESP_OK) { + ESP_LOGI(TAG, "%s: Applied DAC mode %d (%s) to DAC", __func__, + (int)mode, mode == TAS5805M_DAC_MODE_BTL ? "BTL" : "PBTL"); + tas5805m_settings_save_dac_mode(mode); + } else { + ESP_LOGE(TAG, "%s: Failed to apply DAC mode: %s", + __func__, esp_err_to_name(err)); + } + } + + // Update modulation mode if present (requires all three parameters) + cJSON *mod_mode_item = cJSON_GetObjectItem(root, "modulation_mode"); + cJSON *sw_freq_item = cJSON_GetObjectItem(root, "sw_freq"); + cJSON *bd_freq_item = cJSON_GetObjectItem(root, "bd_freq"); + + if (cJSON_IsNumber(mod_mode_item) && cJSON_IsNumber(sw_freq_item) && cJSON_IsNumber(bd_freq_item)) { + TAS5805M_MOD_MODE mod_mode = (TAS5805M_MOD_MODE)mod_mode_item->valueint; + TAS5805M_SW_FREQ sw_freq = (TAS5805M_SW_FREQ)sw_freq_item->valueint; + TAS5805M_BD_FREQ bd_freq = (TAS5805M_BD_FREQ)bd_freq_item->valueint; + + err = tas5805m_set_modulation_mode(mod_mode, sw_freq, bd_freq); + if (err == ESP_OK) { + ESP_LOGI(TAG, "%s: Applied modulation mode: mode=%d, freq=%d, bd_freq=%d", + __func__, (int)mod_mode, (int)sw_freq, (int)bd_freq); + tas5805m_settings_save_modulation_mode(mod_mode, sw_freq, bd_freq); + } else { + ESP_LOGE(TAG, "%s: Failed to apply modulation mode: %s", + __func__, esp_err_to_name(err)); + } + } + cJSON_Delete(root); return err; } @@ -347,16 +552,32 @@ esp_err_t tas5805m_settings_get_schema_json(char *json_out, size_t max_len) { dac_state.state = TAS5805M_CTRL_PLAY; } - // Get current digital volume - int dig_vol_half_db = 0; - if (tas5805m_get_digital_volume_db(&dig_vol_half_db) != ESP_OK) { - dig_vol_half_db = TAS5805M_DIGITAL_VOL_DEFAULT; + // Get current digital volume (raw value) + uint8_t digital_volume; + if (tas5805m_get_digital_volume(&digital_volume) != ESP_OK) { + digital_volume = TAS5805M_VOLUME_DIGITAL_DEFAULT; + } + + // Get current analog gain (raw value) + uint8_t analog_gain; + if (tas5805m_get_again(&analog_gain) != ESP_OK) { + analog_gain = 0; } - // Get current analog gain - int ana_gain_half_db = 0; - if (tas5805m_get_analog_gain(&ana_gain_half_db) != ESP_OK) { - ana_gain_half_db = TAS5805M_ANALOG_GAIN_DEFAULT; + // Get current DAC mode + TAS5805M_DAC_MODE dac_mode; + if (tas5805m_get_dac_mode(&dac_mode) != ESP_OK) { + dac_mode = TAS5805M_DAC_MODE_BTL; + } + + // Get current modulation mode + TAS5805M_MOD_MODE mod_mode; + TAS5805M_SW_FREQ sw_freq; + TAS5805M_BD_FREQ bd_freq; + if (tas5805m_get_modulation_mode(&mod_mode, &sw_freq, &bd_freq) != ESP_OK) { + mod_mode = MOD_MODE_BD; + sw_freq = SW_FREQ_768K; + bd_freq = SW_FREQ_80K; } // Build schema JSON @@ -375,32 +596,30 @@ esp_err_t tas5805m_settings_get_schema_json(char *json_out, size_t max_len) { cJSON *volume_params = cJSON_CreateArray(); - // Digital Volume parameter + // Digital Volume parameter (raw register value 0-255) cJSON *dig_vol_param = cJSON_CreateObject(); cJSON_AddStringToObject(dig_vol_param, "key", "digital_volume"); cJSON_AddStringToObject(dig_vol_param, "name", "Digital Volume"); cJSON_AddStringToObject(dig_vol_param, "type", "range"); - cJSON_AddStringToObject(dig_vol_param, "unit", "dB"); - cJSON_AddNumberToObject(dig_vol_param, "min", TAS5805M_DIGITAL_VOL_MIN); - cJSON_AddNumberToObject(dig_vol_param, "max", TAS5805M_DIGITAL_VOL_MAX); - cJSON_AddNumberToObject(dig_vol_param, "step", TAS5805M_DIGITAL_VOL_STEP); - cJSON_AddNumberToObject(dig_vol_param, "default", TAS5805M_DIGITAL_VOL_DEFAULT); - cJSON_AddNumberToObject(dig_vol_param, "current", dig_vol_half_db); - cJSON_AddNumberToObject(dig_vol_param, "scale", TAS5805M_DIGITAL_VOL_SCALE); + cJSON_AddStringToObject(dig_vol_param, "unit", "register"); + cJSON_AddNumberToObject(dig_vol_param, "min", TAS5805M_VOLUME_DIGITAL_MIN); + cJSON_AddNumberToObject(dig_vol_param, "max", TAS5805M_VOLUME_DIGITAL_MAX); + cJSON_AddNumberToObject(dig_vol_param, "step", 1); + cJSON_AddNumberToObject(dig_vol_param, "default", TAS5805M_VOLUME_DIGITAL_DEFAULT); + cJSON_AddNumberToObject(dig_vol_param, "current", digital_volume); cJSON_AddItemToArray(volume_params, dig_vol_param); - // Analog Gain parameter + // Analog Gain parameter (raw register value 0-31) cJSON *ana_gain_param = cJSON_CreateObject(); cJSON_AddStringToObject(ana_gain_param, "key", "analog_gain"); cJSON_AddStringToObject(ana_gain_param, "name", "Analog Gain"); cJSON_AddStringToObject(ana_gain_param, "type", "range"); - cJSON_AddStringToObject(ana_gain_param, "unit", "dB"); - cJSON_AddNumberToObject(ana_gain_param, "min", TAS5805M_ANALOG_GAIN_MIN); - cJSON_AddNumberToObject(ana_gain_param, "max", TAS5805M_ANALOG_GAIN_MAX); - cJSON_AddNumberToObject(ana_gain_param, "step", TAS5805M_ANALOG_GAIN_STEP); - cJSON_AddNumberToObject(ana_gain_param, "default", TAS5805M_ANALOG_GAIN_DEFAULT); - cJSON_AddNumberToObject(ana_gain_param, "current", ana_gain_half_db); - cJSON_AddNumberToObject(ana_gain_param, "scale", TAS5805M_ANALOG_GAIN_SCALE); + cJSON_AddStringToObject(ana_gain_param, "unit", "register"); + cJSON_AddNumberToObject(ana_gain_param, "min", 0); + cJSON_AddNumberToObject(ana_gain_param, "max", 31); + cJSON_AddNumberToObject(ana_gain_param, "step", 1); + cJSON_AddNumberToObject(ana_gain_param, "default", 0); + cJSON_AddNumberToObject(ana_gain_param, "current", analog_gain); cJSON_AddItemToArray(volume_params, ana_gain_param); cJSON_AddItemToObject(volume_group, "parameters", volume_params); @@ -421,39 +640,162 @@ esp_err_t tas5805m_settings_get_schema_json(char *json_out, size_t max_len) { cJSON_AddNumberToObject(state_param, "current", (int)dac_state.state); // State enum values - cJSON *values = cJSON_CreateArray(); + cJSON *state_values = cJSON_CreateArray(); cJSON *val_deep_sleep = cJSON_CreateObject(); cJSON_AddNumberToObject(val_deep_sleep, "value", TAS5805M_CTRL_DEEP_SLEEP); cJSON_AddStringToObject(val_deep_sleep, "name", "Deep Sleep"); - cJSON_AddItemToArray(values, val_deep_sleep); + cJSON_AddItemToArray(state_values, val_deep_sleep); cJSON *val_sleep = cJSON_CreateObject(); cJSON_AddNumberToObject(val_sleep, "value", TAS5805M_CTRL_SLEEP); cJSON_AddStringToObject(val_sleep, "name", "Sleep"); - cJSON_AddItemToArray(values, val_sleep); + cJSON_AddItemToArray(state_values, val_sleep); cJSON *val_hiz = cJSON_CreateObject(); cJSON_AddNumberToObject(val_hiz, "value", TAS5805M_CTRL_HI_Z); cJSON_AddStringToObject(val_hiz, "name", "Hi-Z"); - cJSON_AddItemToArray(values, val_hiz); + cJSON_AddItemToArray(state_values, val_hiz); cJSON *val_play = cJSON_CreateObject(); cJSON_AddNumberToObject(val_play, "value", TAS5805M_CTRL_PLAY); cJSON_AddStringToObject(val_play, "name", "Play"); - cJSON_AddItemToArray(values, val_play); + cJSON_AddItemToArray(state_values, val_play); cJSON *val_play_mute = cJSON_CreateObject(); cJSON_AddNumberToObject(val_play_mute, "value", TAS5805M_CTRL_PLAY_MUTE); cJSON_AddStringToObject(val_play_mute, "name", "Play (Muted)"); - cJSON_AddItemToArray(values, val_play_mute); + cJSON_AddItemToArray(state_values, val_play_mute); - cJSON_AddItemToObject(state_param, "values", values); + cJSON_AddItemToObject(state_param, "values", state_values); cJSON_AddItemToArray(state_params, state_param); cJSON_AddItemToObject(state_group, "parameters", state_params); cJSON_AddItemToArray(groups, state_group); + // ===== DAC Configuration Group ===== + cJSON *dac_config_group = cJSON_CreateObject(); + cJSON_AddStringToObject(dac_config_group, "name", "DAC Configuration"); + cJSON_AddStringToObject(dac_config_group, "description", "DAC mode and modulation settings"); + + cJSON *dac_config_params = cJSON_CreateArray(); + + // DAC Mode parameter + cJSON *dac_mode_param = cJSON_CreateObject(); + cJSON_AddStringToObject(dac_mode_param, "key", "dac_mode"); + cJSON_AddStringToObject(dac_mode_param, "name", "DAC Mode"); + cJSON_AddStringToObject(dac_mode_param, "type", "enum"); + cJSON_AddNumberToObject(dac_mode_param, "current", (int)dac_mode); + + cJSON *dac_mode_values = cJSON_CreateArray(); + + cJSON *dac_mode_btl = cJSON_CreateObject(); + cJSON_AddNumberToObject(dac_mode_btl, "value", TAS5805M_DAC_MODE_BTL); + cJSON_AddStringToObject(dac_mode_btl, "name", "BTL (Bridge Tied Load)"); + cJSON_AddItemToArray(dac_mode_values, dac_mode_btl); + + cJSON *dac_mode_pbtl = cJSON_CreateObject(); + cJSON_AddNumberToObject(dac_mode_pbtl, "value", TAS5805M_DAC_MODE_PBTL); + cJSON_AddStringToObject(dac_mode_pbtl, "name", "PBTL (Parallel Load)"); + cJSON_AddItemToArray(dac_mode_values, dac_mode_pbtl); + + cJSON_AddItemToObject(dac_mode_param, "values", dac_mode_values); + cJSON_AddItemToArray(dac_config_params, dac_mode_param); + + // Modulation Mode parameter + cJSON *mod_mode_param = cJSON_CreateObject(); + cJSON_AddStringToObject(mod_mode_param, "key", "modulation_mode"); + cJSON_AddStringToObject(mod_mode_param, "name", "Modulation Mode"); + cJSON_AddStringToObject(mod_mode_param, "type", "enum"); + cJSON_AddNumberToObject(mod_mode_param, "current", (int)mod_mode); + + cJSON *mod_mode_values = cJSON_CreateArray(); + + cJSON *mod_bd = cJSON_CreateObject(); + cJSON_AddNumberToObject(mod_bd, "value", MOD_MODE_BD); + cJSON_AddStringToObject(mod_bd, "name", "BD Mode"); + cJSON_AddItemToArray(mod_mode_values, mod_bd); + + cJSON *mod_1spw = cJSON_CreateObject(); + cJSON_AddNumberToObject(mod_1spw, "value", MOD_MODE_1SPW); + cJSON_AddStringToObject(mod_1spw, "name", "1SPW Mode"); + cJSON_AddItemToArray(mod_mode_values, mod_1spw); + + cJSON *mod_hybrid = cJSON_CreateObject(); + cJSON_AddNumberToObject(mod_hybrid, "value", MOD_MODE_HYBRID); + cJSON_AddStringToObject(mod_hybrid, "name", "Hybrid Mode"); + cJSON_AddItemToArray(mod_mode_values, mod_hybrid); + + cJSON_AddItemToObject(mod_mode_param, "values", mod_mode_values); + cJSON_AddItemToArray(dac_config_params, mod_mode_param); + + // Switching Frequency parameter + cJSON *sw_freq_param = cJSON_CreateObject(); + cJSON_AddStringToObject(sw_freq_param, "key", "sw_freq"); + cJSON_AddStringToObject(sw_freq_param, "name", "Switching Frequency"); + cJSON_AddStringToObject(sw_freq_param, "type", "enum"); + cJSON_AddNumberToObject(sw_freq_param, "current", (int)sw_freq); + + cJSON *sw_freq_values = cJSON_CreateArray(); + + cJSON *freq_768k = cJSON_CreateObject(); + cJSON_AddNumberToObject(freq_768k, "value", SW_FREQ_768K); + cJSON_AddStringToObject(freq_768k, "name", "768 kHz"); + cJSON_AddItemToArray(sw_freq_values, freq_768k); + + cJSON *freq_384k = cJSON_CreateObject(); + cJSON_AddNumberToObject(freq_384k, "value", SW_FREQ_384K); + cJSON_AddStringToObject(freq_384k, "name", "384 kHz"); + cJSON_AddItemToArray(sw_freq_values, freq_384k); + + cJSON *freq_480k = cJSON_CreateObject(); + cJSON_AddNumberToObject(freq_480k, "value", SW_FREQ_480K); + cJSON_AddStringToObject(freq_480k, "name", "480 kHz"); + cJSON_AddItemToArray(sw_freq_values, freq_480k); + + cJSON *freq_576k = cJSON_CreateObject(); + cJSON_AddNumberToObject(freq_576k, "value", SW_FREQ_576K); + cJSON_AddStringToObject(freq_576k, "name", "576 kHz"); + cJSON_AddItemToArray(sw_freq_values, freq_576k); + + cJSON_AddItemToObject(sw_freq_param, "values", sw_freq_values); + cJSON_AddItemToArray(dac_config_params, sw_freq_param); + + // BD Frequency parameter + cJSON *bd_freq_param = cJSON_CreateObject(); + cJSON_AddStringToObject(bd_freq_param, "key", "bd_freq"); + cJSON_AddStringToObject(bd_freq_param, "name", "BD Frequency"); + cJSON_AddStringToObject(bd_freq_param, "type", "enum"); + cJSON_AddNumberToObject(bd_freq_param, "current", (int)bd_freq); + + cJSON *bd_freq_values = cJSON_CreateArray(); + + cJSON *bd_80k = cJSON_CreateObject(); + cJSON_AddNumberToObject(bd_80k, "value", SW_FREQ_80K); + cJSON_AddStringToObject(bd_80k, "name", "80 kHz"); + cJSON_AddItemToArray(bd_freq_values, bd_80k); + + cJSON *bd_100k = cJSON_CreateObject(); + cJSON_AddNumberToObject(bd_100k, "value", SW_FREQ_100K); + cJSON_AddStringToObject(bd_100k, "name", "100 kHz"); + cJSON_AddItemToArray(bd_freq_values, bd_100k); + + cJSON *bd_120k = cJSON_CreateObject(); + cJSON_AddNumberToObject(bd_120k, "value", SW_FREQ_120K); + cJSON_AddStringToObject(bd_120k, "name", "120 kHz"); + cJSON_AddItemToArray(bd_freq_values, bd_120k); + + cJSON *bd_175k = cJSON_CreateObject(); + cJSON_AddNumberToObject(bd_175k, "value", SW_FREQ_175K); + cJSON_AddStringToObject(bd_175k, "name", "175 kHz"); + cJSON_AddItemToArray(bd_freq_values, bd_175k); + + cJSON_AddItemToObject(bd_freq_param, "values", bd_freq_values); + cJSON_AddItemToArray(dac_config_params, bd_freq_param); + + cJSON_AddItemToObject(dac_config_group, "parameters", dac_config_params); + cJSON_AddItemToArray(groups, dac_config_group); + cJSON_AddItemToObject(root, "groups", groups); // Render to string From 1f6dc7e9c2294b6390fc3c39dcef632b64bbec54 Mon Sep 17 00:00:00 2001 From: Andriy Malyshenko Date: Wed, 26 Nov 2025 18:26:31 +0100 Subject: [PATCH 14/58] Added UI for DAC settings: bridge mode, modulation mode, switching frequency, analog gain. Added support for readonly parameters --- .../custom_board/tas5805m/include/tas5805m.h | 69 +----- .../tas5805m/include/tas5805m_reg_cfg.h | 3 + .../tas5805m/include/tas5805m_types.h | 116 +++++++++ components/custom_board/tas5805m/tas5805m.c | 34 +-- .../dsp_processor_settings.c | 2 +- .../include/tas5805m_settings.h | 157 ++---------- .../tas5805m_settings/tas5805m_settings.c | 231 +++++++----------- .../ui_http_server/html/dac-settings.html | 187 ++++++++++++-- main/main.c | 7 +- 9 files changed, 422 insertions(+), 384 deletions(-) create mode 100644 components/custom_board/tas5805m/include/tas5805m_types.h diff --git a/components/custom_board/tas5805m/include/tas5805m.h b/components/custom_board/tas5805m/include/tas5805m.h index 4ca74976..57feceff 100644 --- a/components/custom_board/tas5805m/include/tas5805m.h +++ b/components/custom_board/tas5805m/include/tas5805m.h @@ -33,6 +33,8 @@ #include "esp_err.h" #include "esp_log.h" +#include "tas5805m_types.h" + #ifdef __cplusplus extern "C" { #endif @@ -42,72 +44,7 @@ extern "C" { #define I2C_MASTER_RX_BUF_DISABLE 0 /*!< I2C master doesn't need buffer */ #define I2C_MASTER_TIMEOUT_MS 1000 -#define TAS5805M_VOLUME_MUTE 0xff // (-103.5 dB - actual mute) -#define TAS5805M_VOLUME_MIN \ - 0xa8 // ( -60 dB - save value representing barely hearable volume) -#define TAS5805M_VOLUME_MAX \ - 0x30 // ( 0 dB - maximum volume that guarantees no distortion ) -/* -// TODO: make it available for user configuration -#define TAS5805M_REG_VOLUME_MAX 0x00 // (+24 dB - maximum volume that DAC -can do) -*/ - -#define TAS5805M_VOLUME_DIGITAL_MAX 255 // Mute -#define TAS5805M_VOLUME_DIGITAL_DEFAULT 48 // +0 Db -#define TAS5805M_VOLUME_DIGITAL_MIN 0 // +24 Db - -typedef enum { - TAS5805M_CTRL_DEEP_SLEEP = 0x00, // Deep Sleep - TAS5805M_CTRL_SLEEP = 0x01, // Sleep - TAS5805M_CTRL_HI_Z = 0x02, // Hi-Z - TAS5805M_CTRL_PLAY = 0x03, // Play - TAS5805M_CTRL_MUTE = 0x08, // Mute Flag - // Mute, but driver in PLAY state - TAS5805M_CTRL_PLAY_MUTE = TAS5805M_CTRL_MUTE | TAS5805M_CTRL_PLAY -} TAS5805M_CTRL_STATE; - -typedef struct { - int8_t volume; - TAS5805M_CTRL_STATE state; -} TAS5805_STATE; - -typedef enum { - TAS5805M_DAC_MODE_BTL = 0x00, // Bridge tied load - TAS5805M_DAC_MODE_PBTL = 0x01 // Parallel load -} TAS5805M_DAC_MODE; - -typedef enum { - SW_FREQ_768K = (0x00 << 4), - SW_FREQ_384K = (0x01 << 4), - SW_FREQ_480K = (0x03 << 4), - SW_FREQ_576K = (0x04 << 4), -} TAS5805M_SW_FREQ; - -typedef enum { - SW_FREQ_80K = (0x00 << 5), - SW_FREQ_100K = (0x01 << 5), - SW_FREQ_120K = (0x02 << 5), - SW_FREQ_175K = (0x03 << 5), -} TAS5805M_BD_FREQ; - -typedef enum { - MOD_MODE_BD = 0x0, - MOD_MODE_1SPW = 0x1, - MOD_MODE_HYBRID = 0x2, -} TAS5805M_MOD_MODE; - -typedef struct { - uint8_t err0; - uint8_t err1; - uint8_t err2; - uint8_t ot_warn; -} TAS5805M_FAULT; - -/** - * @brief Initialize TAS5805 codec chip - * - * @param cfg configuration of TAS5805 +/* @brief Initialize TAS5805 codec chip * * @return * - ESP_OK diff --git a/components/custom_board/tas5805m/include/tas5805m_reg_cfg.h b/components/custom_board/tas5805m/include/tas5805m_reg_cfg.h index 072b2062..f29d9d74 100644 --- a/components/custom_board/tas5805m/include/tas5805m_reg_cfg.h +++ b/components/custom_board/tas5805m/include/tas5805m_reg_cfg.h @@ -91,4 +91,7 @@ extern "C" #define TAS5805M_PIN_CONTROL2_REGISTER 0x75 #define TAS5805M_MISC_CONTROL_REGISTER 0x76 #define TAS5805M_FAULT_CLEAR_REGISTER 0x78 +/* TAS5805M_REG_FAULT register values */ +#define TAS5805M_ANALOG_FAULT_CLEAR 0x80 + #endif diff --git a/components/custom_board/tas5805m/include/tas5805m_types.h b/components/custom_board/tas5805m/include/tas5805m_types.h new file mode 100644 index 00000000..fa053de7 --- /dev/null +++ b/components/custom_board/tas5805m/include/tas5805m_types.h @@ -0,0 +1,116 @@ +#ifndef _TAS5805M_TYPES_H_ +#define _TAS5805M_TYPES_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define TAS5805M_VOLUME_MUTE 0xff // (-103.5 dB - actual mute) +#define TAS5805M_VOLUME_MIN \ + 0xa8 // ( -60 dB - save value representing barely hearable volume) +#define TAS5805M_VOLUME_MAX \ + 0x30 // ( 0 dB - maximum volume that guarantees no distortion ) +// 0x00 // (+24 dB - maximum volume that DAC can do) + +#define TAS5805M_VOLUME_DIGITAL_MAX 255 // Mute +#define TAS5805M_VOLUME_DIGITAL_DEFAULT 48 // +0 Db +#define TAS5805M_VOLUME_DIGITAL_MIN 0 // +24 Db + +/* Control states */ +typedef enum { + TAS5805M_CTRL_DEEP_SLEEP = 0x00, + TAS5805M_CTRL_SLEEP = 0x01, + TAS5805M_CTRL_HI_Z = 0x02, + TAS5805M_CTRL_PLAY = 0x03, + TAS5805M_CTRL_MUTE = 0x08, + TAS5805M_CTRL_PLAY_MUTE = TAS5805M_CTRL_MUTE | TAS5805M_CTRL_PLAY +} TAS5805M_CTRL_STATE; + +/* Cached state structure */ +typedef struct { + int8_t volume; + TAS5805M_CTRL_STATE state; +} TAS5805_STATE; + +/* DAC mode */ +typedef enum { + TAS5805M_DAC_MODE_BTL = 0x00, + TAS5805M_DAC_MODE_PBTL = 0x01 +} TAS5805M_DAC_MODE; + +/* Switching frequency (SW) */ +typedef enum { + SW_FREQ_768K = (0x00 << 4), + SW_FREQ_384K = (0x01 << 4), + SW_FREQ_480K = (0x03 << 4), + SW_FREQ_576K = (0x04 << 4), +} TAS5805M_SW_FREQ; + +/* BD frequency */ +typedef enum { + SW_FREQ_80K = (0x00 << 5), + SW_FREQ_100K = (0x01 << 5), + SW_FREQ_120K = (0x02 << 5), + SW_FREQ_175K = (0x03 << 5), +} TAS5805M_BD_FREQ; + +/* Modulation mode */ +typedef enum { + MOD_MODE_BD = 0x0, + MOD_MODE_1SPW = 0x1, + MOD_MODE_HYBRID = 0x2, +} TAS5805M_MOD_MODE; + +/* Fault structure */ +typedef struct { + uint8_t err0; + uint8_t err1; + uint8_t err2; + uint8_t ot_warn; +} TAS5805M_FAULT; + +// Analog gain +#define TAS5805M_MAX_GAIN 0 +#define TAS5805M_MIN_GAIN 31 +static const uint8_t tas5805m_again[TAS5805M_MIN_GAIN + 1] = { + 0x00, /* 0dB */ + 0x01, /* -0.5Db */ + 0x02, /* -1.0dB */ + 0x03, /* -1.5dB */ + 0x04, /* -2.0dB */ + 0x05, /* -2.5dB */ + 0x06, /* -3.0dB */ + 0x07, /* -3.5dB */ + 0x08, /* -4.0dB */ + 0x09, /* -4.5dB */ + 0x0A, /* -5.0dB */ + 0x0B, /* -5.5dB */ + 0x0C, /* -6.0dB */ + 0x0D, /* -6.5dB */ + 0x0E, /* -7.0dB */ + 0x0F, /* -7.5dB */ + 0x10, /* -8.0dB */ + 0x11, /* -8.5dB */ + 0x12, /* -9.0dB */ + 0x13, /* -9.5dB */ + 0x14, /* -10.0dB */ + 0x15, /* -10.5dB */ + 0x16, /* -11.0dB */ + 0x17, /* -11.5dB */ + 0x18, /* -12.0dB */ + 0x19, /* -12.5dB */ + 0x1A, /* -13.0dB */ + 0x1B, /* -13.5dB */ + 0x1C, /* -14.0dB */ + 0x1D, /* -14.5dB */ + 0x1E, /* -15.0dB */ + 0x1F, /* -15.5dB */ +}; + +#ifdef __cplusplus +} +#endif + +#endif /* _TAS5805M_TYPES_H_ */ diff --git a/components/custom_board/tas5805m/tas5805m.c b/components/custom_board/tas5805m/tas5805m.c index bab9b736..6aa69fad 100644 --- a/components/custom_board/tas5805m/tas5805m.c +++ b/components/custom_board/tas5805m/tas5805m.c @@ -101,7 +101,7 @@ esp_err_t tas5805m_read_byte(uint8_t register_name, uint8_t *data) { ret = i2c_master_cmd_begin(I2C_TAS5805M_MASTER_NUM, cmd, 1000 / portTICK_PERIOD_MS); i2c_cmd_link_delete(cmd); - ESP_LOGD(TAG, "%s: Read 0x%02x from register 0x%02x", __func__, *data, register_name); + ESP_LOGV(TAG, "%s: Read 0x%02x from register 0x%02x", __func__, *data, register_name); return ret; } @@ -333,7 +333,7 @@ esp_err_t tas5805m_set_digital_volume(uint8_t vol) vol = TAS5805M_VOLUME_DIGITAL_MAX; } - ret = tas5805m_write_byte(TAS5805M_DIG_VOL_CTRL, vol); + ret = tas5805m_write_byte(TAS5805M_DIG_VOL_CTRL_REGISTER, vol); if (ret != ESP_OK) { ESP_LOGE(TAG, "%s: Error during I2C transmission: %s", __func__, esp_err_to_name(ret)); @@ -416,7 +416,7 @@ esp_err_t tas5805m_config_iface(audio_hal_codec_mode_t mode, esp_err_t tas5805m_get_dac_mode(TAS5805M_DAC_MODE *mode) { uint8_t current_value; - esp_err_t err = tas5805m_read_byte(TAS5805M_DEVICE_CTRL_1, ¤t_value); + esp_err_t err = tas5805m_read_byte(TAS5805M_DEVICE_CTRL_1_REGISTER, ¤t_value); if (err != ESP_OK) { ESP_LOGE(TAG, "%s: Error during I2C transmission: %s", __func__, esp_err_to_name(err)); return err; @@ -437,7 +437,7 @@ esp_err_t tas5805m_set_dac_mode(TAS5805M_DAC_MODE mode) // Read the current value of the register uint8_t current_value; - esp_err_t err = tas5805m_read_byte(TAS5805M_DEVICE_CTRL_1, ¤t_value); + esp_err_t err = tas5805m_read_byte(TAS5805M_DEVICE_CTRL_1_REGISTER, ¤t_value); if (err != ESP_OK) { ESP_LOGE(TAG, "%s: Error during I2C transmission: %s", __func__, esp_err_to_name(err)); return err; @@ -451,7 +451,7 @@ esp_err_t tas5805m_set_dac_mode(TAS5805M_DAC_MODE mode) } // Write the updated value back to the register - int ret = tas5805m_write_byte(TAS5805M_DEVICE_CTRL_1, current_value); + int ret = tas5805m_write_byte(TAS5805M_DEVICE_CTRL_1_REGISTER, current_value); if (ret != ESP_OK) { ESP_LOGE(TAG, "%s: Error during I2C transmission: %s", __func__, esp_err_to_name(ret)); } @@ -463,7 +463,7 @@ esp_err_t tas5805m_get_modulation_mode(TAS5805M_MOD_MODE *mode, TAS5805M_SW_FREQ { // Read the current value of the register uint8_t current_value; - esp_err_t err = tas5805m_read_byte(TAS5805M_DEVICE_CTRL_1, ¤t_value); + esp_err_t err = tas5805m_read_byte(TAS5805M_DEVICE_CTRL_1_REGISTER, ¤t_value); if (err != ESP_OK) { ESP_LOGE(TAG, "%s: Error during I2C transmission: %s", __func__, esp_err_to_name(err)); return err; @@ -475,7 +475,7 @@ esp_err_t tas5805m_get_modulation_mode(TAS5805M_MOD_MODE *mode, TAS5805M_SW_FREQ *freq = (current_value & 0b01110000); // Read the BD frequency - err = tas5805m_read_byte(TAS5805M_ANA_CTRL, ¤t_value); + err = tas5805m_read_byte(TAS5805M_ANA_CTRL_REGISTER, ¤t_value); if (err != ESP_OK) { ESP_LOGE(TAG, "%s: Error during I2C transmission: %s", __func__, esp_err_to_name(err)); return err; @@ -491,7 +491,7 @@ esp_err_t tas5805m_set_modulation_mode(TAS5805M_MOD_MODE mode, TAS5805M_SW_FREQ // Read the current value of the register uint8_t current_value; - esp_err_t err = tas5805m_read_byte(TAS5805M_DEVICE_CTRL_1, ¤t_value); + esp_err_t err = tas5805m_read_byte(TAS5805M_DEVICE_CTRL_1_REGISTER, ¤t_value); if (err != ESP_OK) { ESP_LOGE(TAG, "%s: Error during I2C transmission: %s", __func__, esp_err_to_name(err)); return err; @@ -505,13 +505,13 @@ esp_err_t tas5805m_set_modulation_mode(TAS5805M_MOD_MODE mode, TAS5805M_SW_FREQ current_value |= freq & 0b01110000; // Set bits 4-6 // Write the updated value back to the register - int ret = tas5805m_write_byte(TAS5805M_DEVICE_CTRL_1, current_value); + int ret = tas5805m_write_byte(TAS5805M_DEVICE_CTRL_1_REGISTER, current_value); if (ret != ESP_OK) { ESP_LOGE(TAG, "%s: Error during I2C transmission: %s", __func__, esp_err_to_name(ret)); } // Set the BD frequency - ret = tas5805m_write_byte(TAS5805M_ANA_CTRL, bd_freq); + ret = tas5805m_write_byte(TAS5805M_ANA_CTRL_REGISTER, bd_freq); if (ret != ESP_OK) { ESP_LOGE(TAG, "%s: Error during I2C transmission: %s", __func__, esp_err_to_name(ret)); } @@ -522,7 +522,7 @@ esp_err_t tas5805m_set_modulation_mode(TAS5805M_MOD_MODE mode, TAS5805M_SW_FREQ esp_err_t tas5805m_get_again(uint8_t *gain) { int ret = ESP_OK; - ret = tas5805m_read_byte(TAS5805M_AGAIN, gain); + ret = tas5805m_read_byte(TAS5805M_AGAIN_REGISTER, gain); if (ret != ESP_OK) { ESP_LOGE(TAG, "%s: Error during I2C transmission: %s", __func__, esp_err_to_name(ret)); @@ -540,7 +540,7 @@ esp_err_t tas5805m_set_again(uint8_t gain) } uint8_t value = tas5805m_again[gain]; - int ret = tas5805m_write_byte(TAS5805M_AGAIN, value); + int ret = tas5805m_write_byte(TAS5805M_AGAIN_REGISTER, value); if (ret != ESP_OK) { ESP_LOGE(TAG, "%s: Error during I2C transmission: %s", __func__, esp_err_to_name(ret)); @@ -552,7 +552,7 @@ esp_err_t tas5805m_set_again(uint8_t gain) esp_err_t tas5805m_clear_faults() { ESP_LOGD(TAG, "%s: Clearing faults", __func__); - int ret = tas5805m_write_byte(TAS5805M_FAULT_CLEAR, TAS5805M_ANALOG_FAULT_CLEAR); + int ret = tas5805m_write_byte(TAS5805M_FAULT_CLEAR_REGISTER, TAS5805M_ANALOG_FAULT_CLEAR); if (ret != ESP_OK) { ESP_LOGE(TAG, "%s: Error during I2C transmission: %s", __func__, esp_err_to_name(ret)); @@ -564,28 +564,28 @@ esp_err_t tas5805m_get_faults(TAS5805M_FAULT *fault) { int ret = ESP_OK; - ret = tas5805m_read_byte(TAS5805M_CHAN_FAULT, &(fault->err0)); + ret = tas5805m_read_byte(TAS5805M_CHAN_FAULT_REGISTER, &(fault->err0)); if (ret != ESP_OK) { ESP_LOGE(TAG, "%s: Error during I2C transmission: %s", __func__, esp_err_to_name(ret)); return ret; } - ret = tas5805m_read_byte(TAS5805M_GLOBAL_FAULT1, &(fault->err1)); + ret = tas5805m_read_byte(TAS5805M_GLOBAL_FAULT1_REGISTER, &(fault->err1)); if (ret != ESP_OK) { ESP_LOGE(TAG, "%s: Error during I2C transmission: %s", __func__, esp_err_to_name(ret)); return ret; } - ret = tas5805m_read_byte(TAS5805M_GLOBAL_FAULT2, &(fault->err2)); + ret = tas5805m_read_byte(TAS5805M_GLOBAL_FAULT2_REGISTER, &(fault->err2)); if (ret != ESP_OK) { ESP_LOGE(TAG, "%s: Error during I2C transmission: %s", __func__, esp_err_to_name(ret)); return ret; } - ret= tas5805m_read_byte(TAS5805M_OT_WARNING, &(fault->ot_warn)); + ret= tas5805m_read_byte(TAS5805M_OT_WARNING_REGISTER, &(fault->ot_warn)); if (ret != ESP_OK) { ESP_LOGE(TAG, "%s: Error during I2C transmission: %s", __func__, esp_err_to_name(ret)); diff --git a/components/dsp_processor_settings/dsp_processor_settings.c b/components/dsp_processor_settings/dsp_processor_settings.c index f1f48668..c019b09e 100644 --- a/components/dsp_processor_settings/dsp_processor_settings.c +++ b/components/dsp_processor_settings/dsp_processor_settings.c @@ -390,7 +390,7 @@ esp_err_t dsp_settings_get_json(char *json_out, size_t max_len) { } size_t json_len = strlen(json_str); - ESP_LOGI(TAG, "%s: Generated JSON size: %zu bytes (buffer size: %zu)", __func__, json_len, max_len); + ESP_LOGD(TAG, "%s: Generated JSON size: %zu bytes (buffer size: %zu)", __func__, json_len, max_len); if (json_len >= max_len) { ESP_LOGE(TAG, "%s: JSON too large for buffer (%zu >= %zu)", __func__, json_len, max_len); diff --git a/components/tas5805m_settings/include/tas5805m_settings.h b/components/tas5805m_settings/include/tas5805m_settings.h index dfae3a08..12bdc4d0 100644 --- a/components/tas5805m_settings/include/tas5805m_settings.h +++ b/components/tas5805m_settings/include/tas5805m_settings.h @@ -1,13 +1,10 @@ -/** - * @file tas5805m_settings.h - * @brief TAS5805M DAC settings persistence and JSON serialization +/* + * tas5805m_settings.h + * TAS5805M DAC settings persistence and JSON serialization * - * Manages NVS persistence for TAS5805M DAC settings including: - * - DAC state (Deep Sleep, Sleep, Hi-Z, Play, Mute) - * - Digital volume control - * - Analog gain control - * - JSON serialization for HTTP API consumption - * - Communication with tas5805m component + * Notes: + * - DAC state and digital volume are treated as read-only by the settings manager + * (managed by the TAS5805M driver / application) and are not persisted to NVS. */ #ifndef __TAS5805M_SETTINGS_H__ @@ -20,19 +17,18 @@ extern "C" { #include #include #include +#include "tas5805m_types.h" #include "tas5805m.h" // NVS Configuration #define TAS5805M_NVS_NAMESPACE "tas5805m_cfg" -#define TAS5805M_NVS_KEY_STATE "state" -#define TAS5805M_NVS_KEY_DIGITAL_VOL "dig_vol" #define TAS5805M_NVS_KEY_ANALOG_GAIN "ana_gain" #define TAS5805M_NVS_KEY_DAC_MODE "dac_mode" #define TAS5805M_NVS_KEY_MOD_MODE "mod_mode" #define TAS5805M_NVS_KEY_SW_FREQ "sw_freq" #define TAS5805M_NVS_KEY_BD_FREQ "bd_freq" -// Digital Volume Settings (in 0.5dB steps) +// Digital Volume Settings (in 0.5dB steps) - kept for UI scaling/display #define TAS5805M_DIGITAL_VOL_MIN -207 // -103.5 dB #define TAS5805M_DIGITAL_VOL_MAX 48 // +24 dB #define TAS5805M_DIGITAL_VOL_STEP 1 // 0.5 dB per step @@ -46,151 +42,40 @@ extern "C" { #define TAS5805M_ANALOG_GAIN_DEFAULT 0 // 0 dB #define TAS5805M_ANALOG_GAIN_SCALE 0.5 // Display scaling factor -/** - * Initialize TAS5805M settings manager - * Must be called before any other functions - * @return ESP_OK on success - */ +/** Initialize TAS5805M settings manager. Must be called before other functions. */ esp_err_t tas5805m_settings_init(void); -/** - * Save DAC state to NVS - * @param state The TAS5805M_CTRL_STATE to persist - * @return ESP_OK on success - */ -esp_err_t tas5805m_settings_save_state(TAS5805M_CTRL_STATE state); - -/** - * Load DAC state from NVS - * @param state Pointer to store the loaded state - * @return ESP_OK on success, ESP_ERR_NVS_NOT_FOUND if not set - */ -esp_err_t tas5805m_settings_load_state(TAS5805M_CTRL_STATE *state); - -/** - * Save digital volume setting to NVS - * @param vol_half_db Volume in 0.5dB steps (-207 to 48) - * @return ESP_OK on success - */ -esp_err_t tas5805m_settings_save_digital_volume(int vol_half_db); - -/** - * Load digital volume setting from NVS - * @param vol_half_db Pointer to store volume in 0.5dB steps - * @return ESP_OK on success, ESP_ERR_NVS_NOT_FOUND if not set - */ -esp_err_t tas5805m_settings_load_digital_volume(int *vol_half_db); - -/** - * Save analog gain setting to NVS - * @param gain_half_db Gain in 0.5dB steps (-31 to 0) - * @return ESP_OK on success - */ +/** Save analog gain setting to NVS */ esp_err_t tas5805m_settings_save_analog_gain(int gain_half_db); - -/** - * Load analog gain setting from NVS - * @param gain_half_db Pointer to store gain in 0.5dB steps - * @return ESP_OK on success, ESP_ERR_NVS_NOT_FOUND if not set - */ +/** Load analog gain setting from NVS */ esp_err_t tas5805m_settings_load_analog_gain(int *gain_half_db); -/** - * Save DAC mode setting to NVS - * @param mode The DAC mode (BTL or PBTL) - * @return ESP_OK on success - */ +/** Save DAC mode setting to NVS */ esp_err_t tas5805m_settings_save_dac_mode(TAS5805M_DAC_MODE mode); - -/** - * Load DAC mode setting from NVS - * @param mode Pointer to store the DAC mode - * @return ESP_OK on success, ESP_ERR_NVS_NOT_FOUND if not set - */ +/** Load DAC mode setting from NVS */ esp_err_t tas5805m_settings_load_dac_mode(TAS5805M_DAC_MODE *mode); -/** - * Save modulation mode settings to NVS - * @param mode The modulation mode - * @param freq The switching frequency - * @param bd_freq The BD frequency - * @return ESP_OK on success - */ +/** Save modulation mode settings to NVS */ esp_err_t tas5805m_settings_save_modulation_mode(TAS5805M_MOD_MODE mode, TAS5805M_SW_FREQ freq, TAS5805M_BD_FREQ bd_freq); - -/** - * Load modulation mode settings from NVS - * @param mode Pointer to store modulation mode - * @param freq Pointer to store switching frequency - * @param bd_freq Pointer to store BD frequency - * @return ESP_OK on success, ESP_ERR_NVS_NOT_FOUND if not set - */ +/** Load modulation mode settings from NVS */ esp_err_t tas5805m_settings_load_modulation_mode(TAS5805M_MOD_MODE *mode, TAS5805M_SW_FREQ *freq, TAS5805M_BD_FREQ *bd_freq); -/** - * Get current TAS5805M settings as a JSON string - * Queries the tas5805m component for current state and formats as JSON - * - * @param json_out Buffer to store JSON string (caller must allocate) - * @param max_len Maximum size of output buffer - * @return ESP_OK on success - * - * Example output: - * { - * "state": 3, - * "state_name": "Play", - * "volume": 50, - * "muted": false - * } - */ +/** Get current TAS5805M settings as a JSON string */ esp_err_t tas5805m_settings_get_json(char *json_out, size_t max_len); -/** - * Update TAS5805M settings from a JSON string - * Parses JSON and applies changes to the DAC via tas5805m component - * - * @param json_in JSON string containing settings to update - * @return ESP_OK on success - * - * Expected format: - * { - * "state": 3 - * } - */ +/** Update TAS5805M settings from a JSON string */ esp_err_t tas5805m_settings_set_from_json(const char *json_in); -/** - * Get TAS5805M settings schema as JSON - * Provides UI metadata about available settings and their constraints - * - * @param json_out Buffer to store JSON string (caller must allocate) - * @param max_len Maximum size of output buffer - * @return ESP_OK on success - * - * Example output: - * { - * "parameters": [ - * { - * "key": "state", - * "name": "DAC State", - * "type": "enum", - * "values": [ - * {"value": 0, "name": "Deep Sleep"}, - * {"value": 1, "name": "Sleep"}, - * {"value": 2, "name": "Hi-Z"}, - * {"value": 3, "name": "Play"} - * ], - * "current": 3 - * } - * ] - * } - */ +/** Get TAS5805M settings schema as JSON */ esp_err_t tas5805m_settings_get_schema_json(char *json_out, size_t max_len); +/** Apply all persisted TAS5805M settings from NVS to the hardware. */ +esp_err_t tas5805m_settings_apply_all(void); + #ifdef __cplusplus } #endif diff --git a/components/tas5805m_settings/tas5805m_settings.c b/components/tas5805m_settings/tas5805m_settings.c index 1dcd3479..d248f3d0 100644 --- a/components/tas5805m_settings/tas5805m_settings.c +++ b/components/tas5805m_settings/tas5805m_settings.c @@ -48,117 +48,11 @@ esp_err_t tas5805m_settings_init(void) { return ESP_OK; } -esp_err_t tas5805m_settings_save_state(TAS5805M_CTRL_STATE state) { - ESP_LOGD(TAG, "%s: state=%d", __func__, (int)state); - - if (!tas5805m_settings_mutex) { - ESP_LOGE(TAG, "%s: Not initialized", __func__); - return ESP_ERR_INVALID_STATE; - } - - if (xSemaphoreTake(tas5805m_settings_mutex, pdMS_TO_TICKS(5000)) != pdTRUE) { - ESP_LOGE(TAG, "%s: Failed to acquire mutex (timeout)", __func__); - return ESP_ERR_TIMEOUT; - } - - nvs_handle_t h; - esp_err_t err = nvs_open(TAS5805M_NVS_NAMESPACE, NVS_READWRITE, &h); - if (err != ESP_OK) { - ESP_LOGE(TAG, "%s: Failed to open NVS: %s", __func__, esp_err_to_name(err)); - xSemaphoreGive(tas5805m_settings_mutex); - return err; - } - - err = nvs_set_i32(h, TAS5805M_NVS_KEY_STATE, (int32_t)state); - if (err == ESP_OK) { - err = nvs_commit(h); - } - - nvs_close(h); - xSemaphoreGive(tas5805m_settings_mutex); - - if (err == ESP_OK) { - ESP_LOGI(TAG, "%s: State saved: %d (%s)", __func__, (int)state, tas5805m_state_to_string(state)); - } else { - ESP_LOGE(TAG, "%s: Failed to save state: %s", __func__, esp_err_to_name(err)); - } - - return err; -} - -esp_err_t tas5805m_settings_load_state(TAS5805M_CTRL_STATE *state) { - ESP_LOGD(TAG, "%s: entered", __func__); - - if (!state) return ESP_ERR_INVALID_ARG; - if (!tas5805m_settings_mutex) return ESP_ERR_INVALID_STATE; - - if (xSemaphoreTake(tas5805m_settings_mutex, pdMS_TO_TICKS(5000)) != pdTRUE) { - return ESP_ERR_TIMEOUT; - } - - nvs_handle_t h; - esp_err_t err = nvs_open(TAS5805M_NVS_NAMESPACE, NVS_READONLY, &h); - if (err == ESP_OK) { - int32_t v = 0; - err = nvs_get_i32(h, TAS5805M_NVS_KEY_STATE, &v); - nvs_close(h); - if (err == ESP_OK) { - *state = (TAS5805M_CTRL_STATE)v; - ESP_LOGD(TAG, "%s: State from NVS: %d (%s)", __func__, (int)*state, tas5805m_state_to_string(*state)); - } else if (err != ESP_ERR_NVS_NOT_FOUND) { - ESP_LOGW(TAG, "%s: NVS read error: %s", __func__, esp_err_to_name(err)); - } - } - - xSemaphoreGive(tas5805m_settings_mutex); - return err; -} - -esp_err_t tas5805m_settings_save_digital_volume(int vol_half_db) { - ESP_LOGD(TAG, "%s: vol_half_db=%d", __func__, vol_half_db); - - if (!tas5805m_settings_mutex) return ESP_ERR_INVALID_STATE; - - if (xSemaphoreTake(tas5805m_settings_mutex, pdMS_TO_TICKS(5000)) != pdTRUE) { - return ESP_ERR_TIMEOUT; - } - - nvs_handle_t h; - esp_err_t err = nvs_open(TAS5805M_NVS_NAMESPACE, NVS_READWRITE, &h); - if (err == ESP_OK) { - err = nvs_set_i32(h, TAS5805M_NVS_KEY_DIGITAL_VOL, (int32_t)vol_half_db); - if (err == ESP_OK) { - err = nvs_commit(h); - } - nvs_close(h); - } - - xSemaphoreGive(tas5805m_settings_mutex); - return err; -} - -esp_err_t tas5805m_settings_load_digital_volume(int *vol_half_db) { - if (!vol_half_db) return ESP_ERR_INVALID_ARG; - if (!tas5805m_settings_mutex) return ESP_ERR_INVALID_STATE; - - if (xSemaphoreTake(tas5805m_settings_mutex, pdMS_TO_TICKS(5000)) != pdTRUE) { - return ESP_ERR_TIMEOUT; - } - - nvs_handle_t h; - esp_err_t err = nvs_open(TAS5805M_NVS_NAMESPACE, NVS_READONLY, &h); - if (err == ESP_OK) { - int32_t v = 0; - err = nvs_get_i32(h, TAS5805M_NVS_KEY_DIGITAL_VOL, &v); - if (err == ESP_OK) { - *vol_half_db = (int)v; - } - nvs_close(h); - } - - xSemaphoreGive(tas5805m_settings_mutex); - return err; -} +/* Digital volume persistence removed. + * Digital volume is treated as read-only / managed by the TAS5805M driver + * and is not persisted to NVS. Previous save/load functions and the + * corresponding NVS key were intentionally removed. + */ esp_err_t tas5805m_settings_save_analog_gain(int gain_half_db) { ESP_LOGD(TAG, "%s: gain_half_db=%d", __func__, gain_half_db); @@ -411,7 +305,7 @@ esp_err_t tas5805m_settings_get_json(char *json_out, size_t max_len) { } size_t json_len = strlen(json_str); - ESP_LOGI(TAG, "%s: Generated JSON size: %zu bytes (buffer size: %zu)", __func__, json_len, max_len); + ESP_LOGD(TAG, "%s: Generated JSON size: %zu bytes (buffer size: %zu)", __func__, json_len, max_len); if (json_len >= max_len) { ESP_LOGE(TAG, "%s: JSON too large for buffer (%zu >= %zu)", __func__, json_len, max_len); @@ -445,18 +339,11 @@ esp_err_t tas5805m_settings_set_from_json(const char *json_in) { if (cJSON_IsNumber(state_item)) { TAS5805M_CTRL_STATE new_state = (TAS5805M_CTRL_STATE)state_item->valueint; - // Apply to DAC + // Apply to DAC (do NOT persist state - state is managed by application) err = tas5805m_set_state(new_state); if (err == ESP_OK) { - ESP_LOGI(TAG, "%s: Applied state %d (%s) to DAC", __func__, + ESP_LOGI(TAG, "%s: Applied state %d (%s) to DAC (not persisted)", __func__, (int)new_state, tas5805m_state_to_string(new_state)); - - // Persist to NVS - esp_err_t save_err = tas5805m_settings_save_state(new_state); - if (save_err != ESP_OK) { - ESP_LOGW(TAG, "%s: Failed to save state to NVS: %s", - __func__, esp_err_to_name(save_err)); - } } else { ESP_LOGE(TAG, "%s: Failed to apply state to DAC: %s", __func__, esp_err_to_name(err)); @@ -468,11 +355,10 @@ esp_err_t tas5805m_settings_set_from_json(const char *json_in) { if (cJSON_IsNumber(dig_vol_item)) { uint8_t vol = (uint8_t)dig_vol_item->valueint; + // Apply to DAC (do NOT persist digital volume - managed by application) err = tas5805m_set_digital_volume(vol); if (err == ESP_OK) { - ESP_LOGI(TAG, "%s: Applied digital volume %d to DAC", __func__, vol); - // Note: We're saving the raw value, conversion to half_db would need lookup table - tas5805m_settings_save_digital_volume((int)vol); + ESP_LOGI(TAG, "%s: Applied digital volume %d to DAC (not persisted)", __func__, vol); } else { ESP_LOGE(TAG, "%s: Failed to apply digital volume: %s", __func__, esp_err_to_name(err)); @@ -511,23 +397,42 @@ esp_err_t tas5805m_settings_set_from_json(const char *json_in) { } } - // Update modulation mode if present (requires all three parameters) + // Update modulation mode if any parameter provided. Support partial updates + // (UI typically sends only the changed parameter). We'll query current + // modulation settings from the driver and apply a merged update. cJSON *mod_mode_item = cJSON_GetObjectItem(root, "modulation_mode"); cJSON *sw_freq_item = cJSON_GetObjectItem(root, "sw_freq"); cJSON *bd_freq_item = cJSON_GetObjectItem(root, "bd_freq"); - - if (cJSON_IsNumber(mod_mode_item) && cJSON_IsNumber(sw_freq_item) && cJSON_IsNumber(bd_freq_item)) { - TAS5805M_MOD_MODE mod_mode = (TAS5805M_MOD_MODE)mod_mode_item->valueint; - TAS5805M_SW_FREQ sw_freq = (TAS5805M_SW_FREQ)sw_freq_item->valueint; - TAS5805M_BD_FREQ bd_freq = (TAS5805M_BD_FREQ)bd_freq_item->valueint; - - err = tas5805m_set_modulation_mode(mod_mode, sw_freq, bd_freq); + + if (cJSON_IsNumber(mod_mode_item) || cJSON_IsNumber(sw_freq_item) || cJSON_IsNumber(bd_freq_item)) { + TAS5805M_MOD_MODE cur_mod = MOD_MODE_BD; + TAS5805M_SW_FREQ cur_sw = SW_FREQ_768K; + TAS5805M_BD_FREQ cur_bd = SW_FREQ_80K; + + // Read current values where possible + if (tas5805m_get_modulation_mode(&cur_mod, &cur_sw, &cur_bd) != ESP_OK) { + ESP_LOGW(TAG, "%s: Failed to read current modulation mode, using defaults", __func__); + } + + // Override with provided values + if (cJSON_IsNumber(mod_mode_item)) { + cur_mod = (TAS5805M_MOD_MODE)mod_mode_item->valueint; + } + if (cJSON_IsNumber(sw_freq_item)) { + cur_sw = (TAS5805M_SW_FREQ)sw_freq_item->valueint; + } + if (cJSON_IsNumber(bd_freq_item)) { + cur_bd = (TAS5805M_BD_FREQ)bd_freq_item->valueint; + } + + // Apply merged settings + err = tas5805m_set_modulation_mode(cur_mod, cur_sw, cur_bd); if (err == ESP_OK) { - ESP_LOGI(TAG, "%s: Applied modulation mode: mode=%d, freq=%d, bd_freq=%d", - __func__, (int)mod_mode, (int)sw_freq, (int)bd_freq); - tas5805m_settings_save_modulation_mode(mod_mode, sw_freq, bd_freq); + ESP_LOGI(TAG, "%s: Applied modulation mode: mode=%d, freq=%d, bd_freq=%d", + __func__, (int)cur_mod, (int)cur_sw, (int)cur_bd); + tas5805m_settings_save_modulation_mode(cur_mod, cur_sw, cur_bd); } else { - ESP_LOGE(TAG, "%s: Failed to apply modulation mode: %s", + ESP_LOGE(TAG, "%s: Failed to apply modulation mode: %s", __func__, esp_err_to_name(err)); } } @@ -596,7 +501,7 @@ esp_err_t tas5805m_settings_get_schema_json(char *json_out, size_t max_len) { cJSON *volume_params = cJSON_CreateArray(); - // Digital Volume parameter (raw register value 0-255) + // Digital Volume parameter (raw register value 0-255) - READ-ONLY (managed by application) cJSON *dig_vol_param = cJSON_CreateObject(); cJSON_AddStringToObject(dig_vol_param, "key", "digital_volume"); cJSON_AddStringToObject(dig_vol_param, "name", "Digital Volume"); @@ -607,6 +512,7 @@ esp_err_t tas5805m_settings_get_schema_json(char *json_out, size_t max_len) { cJSON_AddNumberToObject(dig_vol_param, "step", 1); cJSON_AddNumberToObject(dig_vol_param, "default", TAS5805M_VOLUME_DIGITAL_DEFAULT); cJSON_AddNumberToObject(dig_vol_param, "current", digital_volume); + cJSON_AddBoolToObject(dig_vol_param, "readonly", true); cJSON_AddItemToArray(volume_params, dig_vol_param); // Analog Gain parameter (raw register value 0-31) @@ -632,12 +538,13 @@ esp_err_t tas5805m_settings_get_schema_json(char *json_out, size_t max_len) { cJSON *state_params = cJSON_CreateArray(); - // State parameter + // State parameter - READ-ONLY (managed by application) cJSON *state_param = cJSON_CreateObject(); cJSON_AddStringToObject(state_param, "key", "state"); cJSON_AddStringToObject(state_param, "name", "DAC State"); cJSON_AddStringToObject(state_param, "type", "enum"); cJSON_AddNumberToObject(state_param, "current", (int)dac_state.state); + cJSON_AddBoolToObject(state_param, "readonly", true); // State enum values cJSON *state_values = cJSON_CreateArray(); @@ -823,3 +730,51 @@ esp_err_t tas5805m_settings_get_schema_json(char *json_out, size_t max_len) { ESP_LOGD(TAG, "%s: Schema JSON generated: %s", __func__, json_out); return ESP_OK; } + +esp_err_t tas5805m_settings_apply_all(void) { + ESP_LOGI(TAG, "%s: Applying persisted TAS5805M settings from NVS", __func__); + + // Ensure settings manager is initialized + esp_err_t err = tas5805m_settings_init(); + if (err != ESP_OK) { + ESP_LOGW(TAG, "%s: settings init failed: %s", __func__, esp_err_to_name(err)); + // continue; we'll still try to load values + } + + // NOTE: DAC state and digital volume are intentionally NOT restored here + // because they are considered application-managed/read-only and should not + // be persisted/restored automatically at boot. + + // Apply analog gain (raw register index) + int ana_gain = 0; + if (tas5805m_settings_load_analog_gain(&ana_gain) == ESP_OK) { + uint8_t gain = (uint8_t)ana_gain; + ESP_LOGI(TAG, "%s: Restoring analog gain raw=%d", __func__, gain); + if (tas5805m_set_again(gain) != ESP_OK) { + ESP_LOGW(TAG, "%s: Failed to apply saved analog gain", __func__); + } + } + + // Apply DAC mode + TAS5805M_DAC_MODE dac_mode; + if (tas5805m_settings_load_dac_mode(&dac_mode) == ESP_OK) { + ESP_LOGI(TAG, "%s: Restoring DAC mode=%d", __func__, (int)dac_mode); + if (tas5805m_set_dac_mode(dac_mode) != ESP_OK) { + ESP_LOGW(TAG, "%s: Failed to apply saved DAC mode", __func__); + } + } + + // Apply modulation mode (mode, sw_freq, bd_freq) + TAS5805M_MOD_MODE mod_mode; + TAS5805M_SW_FREQ sw_freq; + TAS5805M_BD_FREQ bd_freq; + if (tas5805m_settings_load_modulation_mode(&mod_mode, &sw_freq, &bd_freq) == ESP_OK) { + ESP_LOGI(TAG, "%s: Restoring modulation mode=%d, sw=%d, bd=%d", __func__, (int)mod_mode, (int)sw_freq, (int)bd_freq); + if (tas5805m_set_modulation_mode(mod_mode, sw_freq, bd_freq) != ESP_OK) { + ESP_LOGW(TAG, "%s: Failed to apply saved modulation mode", __func__); + } + } + + ESP_LOGI(TAG, "%s: Persisted settings application complete", __func__); + return ESP_OK; +} diff --git a/components/ui_http_server/html/dac-settings.html b/components/ui_http_server/html/dac-settings.html index 61907209..cc2a4466 100644 --- a/components/ui_http_server/html/dac-settings.html +++ b/components/ui_http_server/html/dac-settings.html @@ -107,6 +107,51 @@ border: none; } + /* Read-only parameter styles */ + .parameter-control.readonly { + background-color: #f9f9f9; + border-left: 3px solid #999; + } + + .parameter-control.readonly label { + color: #666; + } + + .parameter-control.readonly select { + background-color: #f0f0f0; + color: #666; + cursor: not-allowed; + border-color: #ddd; + } + + .parameter-control.readonly input[type="range"] { + background: #e8e8e8; + cursor: not-allowed; + pointer-events: none; + } + + .parameter-control.readonly input[type="range"]::-webkit-slider-thumb { + background: #999; + cursor: not-allowed; + } + + .parameter-control.readonly input[type="range"]::-moz-range-thumb { + background: #999; + cursor: not-allowed; + } + + .readonly-indicator { + display: inline-block; + margin-left: 8px; + padding: 2px 8px; + background-color: #e0e0e0; + color: #666; + font-size: 11px; + font-weight: normal; + border-radius: 3px; + text-transform: uppercase; + } + .range-labels { display: flex; justify-content: space-between; @@ -179,11 +224,47 @@ color: #007bff; font-weight: bold; } + + .polling-indicator { + display: inline-flex; + align-items: center; + gap: 8px; + font-size: 12px; + color: #666; + padding: 8px 12px; + background-color: #f8f9fa; + border-radius: 4px; + margin-bottom: 10px; + } + + .polling-indicator .pulse { + width: 8px; + height: 8px; + background-color: #28a745; + border-radius: 50%; + animation: pulse 2s ease-in-out infinite; + } + + @keyframes pulse { + 0%, 100% { + opacity: 1; + transform: scale(1); + } + 50% { + opacity: 0.5; + transform: scale(0.8); + } + }

TAS5805M DAC Settings

+
+ + Auto-refreshing every 2 seconds +
+
Loading DAC settings...
@@ -193,6 +274,8 @@

TAS5805M DAC Settings

let schema = null; let currentSettings = null; + let pollingInterval = null; + const POLL_INTERVAL_MS = 2000; // Poll every 2 seconds // Fetch DAC schema from the device async function loadSchema() { @@ -207,6 +290,9 @@

TAS5805M DAC Settings

await loadCurrentSettings(); renderUI(); + + // Start periodic polling + startPolling(); } catch (error) { console.error('Error loading DAC schema:', error); document.getElementById('app').innerHTML = @@ -221,10 +307,46 @@

TAS5805M DAC Settings

if (!response.ok) { throw new Error('Failed to fetch DAC settings'); } - currentSettings = await response.json(); + const newSettings = await response.json(); + + // Check if settings actually changed before updating UI + if (JSON.stringify(newSettings) !== JSON.stringify(currentSettings)) { + currentSettings = newSettings; + return true; // Settings changed + } + return false; // No change } catch (error) { console.error('Error loading current DAC settings:', error); - currentSettings = null; + // Don't clear currentSettings on error, keep showing last known state + return false; + } + } + + // Start periodic polling of DAC settings + function startPolling() { + // Clear any existing interval + if (pollingInterval) { + clearInterval(pollingInterval); + } + + // Poll for changes every POLL_INTERVAL_MS + pollingInterval = setInterval(async () => { + const changed = await loadCurrentSettings(); + if (changed && schema) { + renderUI(); + console.log('DAC settings updated from polling'); + } + }, POLL_INTERVAL_MS); + + console.log(`Started polling DAC settings every ${POLL_INTERVAL_MS}ms`); + } + + // Stop polling (useful for cleanup) + function stopPolling() { + if (pollingInterval) { + clearInterval(pollingInterval); + pollingInterval = null; + console.log('Stopped polling DAC settings'); } } @@ -234,26 +356,6 @@

TAS5805M DAC Settings

let html = ''; - // Show current state info if available - if (currentSettings) { - html += '
'; - html += 'Current State:'; - html += `${currentSettings.state_name || 'Unknown'}`; - html += '
'; - - // Show additional info - if (currentSettings.volume !== undefined || currentSettings.muted !== undefined) { - html += '
'; - if (currentSettings.volume !== undefined) { - html += `Volume: ${currentSettings.volume}
`; - } - if (currentSettings.muted !== undefined) { - html += `Muted: ${currentSettings.muted ? 'Yes' : 'No'}`; - } - html += '
'; - } - } - // Create parameters container html += '
'; @@ -272,6 +374,20 @@

TAS5805M DAC Settings

return; } + // Update schema with current values from currentSettings before rendering + if (currentSettings && schema.groups) { + for (const group of schema.groups) { + if (group.parameters) { + for (const param of group.parameters) { + // Update param.current with the value from currentSettings if available + if (currentSettings.hasOwnProperty(param.key)) { + param.current = currentSettings[param.key]; + } + } + } + } + } + container.innerHTML = ''; // Render each group @@ -291,8 +407,20 @@

TAS5805M DAC Settings

const controlDiv = document.createElement('div'); controlDiv.className = 'parameter-control'; + // Add readonly class if parameter is readonly + if (param.readonly) { + controlDiv.className += ' readonly'; + } + let html = '
'; - html += ``; + html += `'; if (param.type === 'range') { // Display current value with scaling @@ -305,7 +433,9 @@

TAS5805M DAC Settings

if (param.type === 'enum') { // Create dropdown for enum types - html += ``; for (const enumValue of param.values) { const selected = (param.current === enumValue.value) ? 'selected' : ''; @@ -319,6 +449,9 @@

TAS5805M DAC Settings

const displayMin = (param.min * scale).toFixed(1); const displayMax = (param.max * scale).toFixed(1); + const disabledAttr = param.readonly ? 'disabled' : ''; + const oninputAttr = param.readonly ? '' : `oninput="handleRangeChange('${param.key}', this.value, ${scale}, '${param.unit}')"`; + html += `TAS5805M DAC Settings value="${param.current}" data-scale="${scale}" data-unit="${param.unit}" - oninput="handleRangeChange('${param.key}', this.value, ${scale}, '${param.unit}')" + ${disabledAttr} + ${oninputAttr} aria-label="${param.name}">`; html += '
'; html += `${displayMin} ${param.unit}`; @@ -389,6 +523,9 @@

TAS5805M DAC Settings

// Initialize on page load document.addEventListener('DOMContentLoaded', loadSchema); + + // Stop polling when page is unloaded + window.addEventListener('beforeunload', stopPolling); diff --git a/main/main.c b/main/main.c index f77f9fc1..4d44385a 100644 --- a/main/main.c +++ b/main/main.c @@ -58,6 +58,7 @@ #include "snapcast.h" #include "ui_http_server.h" #include "settings_manager.h" +#include "tas5805m_settings.h" static bool isCachedChunk = false; static uint32_t cachedBlocks = 0; @@ -2626,7 +2627,7 @@ void app_main(void) { esp_log_level_set("settings", ESP_LOG_DEBUG); esp_log_level_set("dsp_settings", ESP_LOG_DEBUG); esp_log_level_set("UI_HTTP", ESP_LOG_WARN); - esp_log_level_set("dspProc", ESP_LOG_DEBUG); + esp_log_level_set("TAS5805M", ESP_LOG_DEBUG); #if CONFIG_SNAPCLIENT_USE_INTERNAL_ETHERNET || \ CONFIG_SNAPCLIENT_USE_SPI_ETHERNET @@ -2713,6 +2714,10 @@ void app_main(void) { vTaskDelay(portMAX_DELAY); } + // Apply persisted TAS5805M settings now that the codec has been initialized + if (tas5805m_settings_apply_all() != ESP_OK) { + ESP_LOGW(TAG, "Failed to apply persisted TAS5805M settings at boot"); + } audio_hal_ctrl_codec(board_handle->audio_hal, AUDIO_HAL_CODEC_MODE_DECODE, AUDIO_HAL_CTRL_STOP); From dd91fbe7fa04325ce555594226f355b73e89cfa7 Mon Sep 17 00:00:00 2001 From: Andriy Malyshenko Date: Wed, 26 Nov 2025 22:29:35 +0100 Subject: [PATCH 15/58] Added mixer implementation --- .../custom_board/tas5805m/include/tas5805m.h | 36 +++++ .../tas5805m/include/tas5805m_reg_cfg.h | 22 +++ .../tas5805m/include/tas5805m_types.h | 36 +++-- components/custom_board/tas5805m/tas5805m.c | 135 +++++++++++++++++ .../include/tas5805m_settings.h | 8 + .../tas5805m_settings/tas5805m_settings.c | 142 +++++++++++++++++- .../ui_http_server/html/dac-settings.html | 119 +++++++++++++-- main/main.c | 3 +- 8 files changed, 473 insertions(+), 28 deletions(-) diff --git a/components/custom_board/tas5805m/include/tas5805m.h b/components/custom_board/tas5805m/include/tas5805m.h index 57feceff..d8061066 100644 --- a/components/custom_board/tas5805m/include/tas5805m.h +++ b/components/custom_board/tas5805m/include/tas5805m.h @@ -235,6 +235,42 @@ esp_err_t tas5805m_get_again(uint8_t *gain); */ esp_err_t tas5805m_set_again(uint8_t gain); +/** + * @brief Get the mixer mode of the TAS5805M + * + * @param mode: Pointer to the mode variable + * + * @return + * - ESP_OK + * - ESP_FAIL + */ +esp_err_t tas5805m_get_mixer_mode(TAS5805M_MIXER_MODE *mode); + +/** + * @brief Set the mixer mode of the TAS5805M + * + * @param mode: The mode to set + * + * @return + * - ESP_OK + * - ESP_FAIL + */ +esp_err_t tas5805m_set_mixer_mode(TAS5805M_MIXER_MODE mode); + +/** + * @brief Set the mixer gain of the TAS5805M + * (4-bytes value, representing decimal in 9.23 format) + * + * @param channel: The channel to set the gain for + * @param gain: The gain to set + * + * @return + * - ESP_OK + * - ESP_FAIL + */ +esp_err_t tas5805m_set_mixer_gain(TAS5805M_MIXER_CHANNELS channel, + uint32_t gain); + /** * @brief Get the faults of the TAS5805M * diff --git a/components/custom_board/tas5805m/include/tas5805m_reg_cfg.h b/components/custom_board/tas5805m/include/tas5805m_reg_cfg.h index f29d9d74..c68e5062 100644 --- a/components/custom_board/tas5805m/include/tas5805m_reg_cfg.h +++ b/components/custom_board/tas5805m/include/tas5805m_reg_cfg.h @@ -47,6 +47,12 @@ extern "C" #define TAS5805M_GPIO_PDN CONFIG_PIN_DAC_PWDN #define TAS5805M_GPIO_PDN_MASK ((1ULL << TAS5805M_GPIO_PDN)) +#define TAS5805M_REG_PAGE_SET 0x00 +#define TAS5805M_REG_BOOK_SET 0x7f + +#define TAS5805M_REG_BOOK_CONTROL_PORT 0x00 +#define TAS5805M_REG_PAGE_ZERO 0x00 + #define TAS5805M_RESET_CTRL_REGISTER 0x01 #define TAS5805M_DEVICE_CTRL_1_REGISTER 0x02 #define TAS5805M_DEVICE_CTRL_2_REGISTER 0x03 @@ -94,4 +100,20 @@ extern "C" /* TAS5805M_REG_FAULT register values */ #define TAS5805M_ANALOG_FAULT_CLEAR 0x80 +// Mixer registers +#define TAS5805M_REG_BOOK_5 0x8c +#define TAS5805M_REG_BOOK_5_MIXER_PAGE 0x29 +#define TAS5805M_REG_LEFT_TO_LEFT_GAIN 0x18 +#define TAS5805M_REG_RIGHT_TO_LEFT_GAIN 0x1c +#define TAS5805M_REG_LEFT_TO_RIGHT_GAIN 0x20 +#define TAS5805M_REG_RIGHT_TO_RIGHT_GAIN 0x24 +#define TAS5805M_REG_BOOK_5_VOLUME_PAGE 0x2a +#define TAS5805M_REG_LEFT_VOLUME 0x24 +#define TAS5805M_REG_RIGHT_VOLUME 0x28 + +#define TAS5805M_MIXER_VALUE_MUTE 0x00000000 +#define TAS5805M_MIXER_VALUE_0DB 0x00008000 +#define TAS5805M_MIXER_VALUE_MINUS6DB 0x00004000 +#define TAS5805M_MIXER_VALUE_PLUS6DB 0x00000000 + #endif diff --git a/components/custom_board/tas5805m/include/tas5805m_types.h b/components/custom_board/tas5805m/include/tas5805m_types.h index fa053de7..5059859c 100644 --- a/components/custom_board/tas5805m/include/tas5805m_types.h +++ b/components/custom_board/tas5805m/include/tas5805m_types.h @@ -8,10 +8,8 @@ extern "C" { #endif #define TAS5805M_VOLUME_MUTE 0xff // (-103.5 dB - actual mute) -#define TAS5805M_VOLUME_MIN \ - 0xa8 // ( -60 dB - save value representing barely hearable volume) -#define TAS5805M_VOLUME_MAX \ - 0x30 // ( 0 dB - maximum volume that guarantees no distortion ) +#define TAS5805M_VOLUME_MIN 0xa8 // ( -60 dB - save value representing barely hearable volume) +#define TAS5805M_VOLUME_MAX 0x30 // ( 0 dB - maximum volume that guarantees no distortion ) // 0x00 // (+24 dB - maximum volume that DAC can do) #define TAS5805M_VOLUME_DIGITAL_MAX 255 // Mute @@ -28,12 +26,6 @@ typedef enum { TAS5805M_CTRL_PLAY_MUTE = TAS5805M_CTRL_MUTE | TAS5805M_CTRL_PLAY } TAS5805M_CTRL_STATE; -/* Cached state structure */ -typedef struct { - int8_t volume; - TAS5805M_CTRL_STATE state; -} TAS5805_STATE; - /* DAC mode */ typedef enum { TAS5805M_DAC_MODE_BTL = 0x00, @@ -63,6 +55,23 @@ typedef enum { MOD_MODE_HYBRID = 0x2, } TAS5805M_MOD_MODE; +/* Fault structure */ +typedef enum { + MIXER_UNKNOWN, + MIXER_STEREO, + MIXER_STEREO_INVERSE, + MIXER_MONO, + MIXER_RIGHT, + MIXER_LEFT, +} TAS5805M_MIXER_MODE; + +typedef enum { + TAS5805M_MIXER_CHANNEL_LEFT_TO_LEFT = 0x00, + TAS5805M_MIXER_CHANNEL_RIGHT_TO_LEFT = 0x01, + TAS5805M_MIXER_CHANNEL_LEFT_TO_RIGHT = 0x02, + TAS5805M_MIXER_CHANNEL_RIGHT_TO_RIGHT = 0x03, +} TAS5805M_MIXER_CHANNELS; + /* Fault structure */ typedef struct { uint8_t err0; @@ -71,6 +80,13 @@ typedef struct { uint8_t ot_warn; } TAS5805M_FAULT; +/* Cached state structure */ +typedef struct { + int8_t volume; + TAS5805M_CTRL_STATE state; + TAS5805M_MIXER_MODE mixer_mode; +} TAS5805_STATE; + // Analog gain #define TAS5805M_MAX_GAIN 0 #define TAS5805M_MIN_GAIN 31 diff --git a/components/custom_board/tas5805m/tas5805m.c b/components/custom_board/tas5805m/tas5805m.c index 6aa69fad..e981d864 100644 --- a/components/custom_board/tas5805m/tas5805m.c +++ b/components/custom_board/tas5805m/tas5805m.c @@ -32,10 +32,18 @@ static const char *TAG = "TAS5805M"; +#define TAS5805M_SET_BOOK_AND_PAGE(BOOK, PAGE) \ + do { \ + tas5805m_write_byte(TAS5805M_REG_PAGE_SET, TAS5805M_REG_PAGE_ZERO); \ + tas5805m_write_byte(TAS5805M_REG_BOOK_SET, BOOK); \ + tas5805m_write_byte(TAS5805M_REG_PAGE_SET, PAGE); \ + } while (0) + // State of TAS5805M (internal to this module) static TAS5805_STATE tas5805m_state = { .volume = 0, .state = TAS5805M_CTRL_PLAY, + .mixer_mode = MIXER_STEREO, }; /* Default I2C config */ @@ -130,6 +138,35 @@ esp_err_t tas5805m_write_byte(uint8_t register_name, uint8_t value) { return ret; } +esp_err_t tas5805m_write_bytes(uint8_t *reg, + int regLen, uint8_t *data, int datalen) +{ + int ret = ESP_OK; + ESP_LOGV(TAG, "%s: 0x%02x <- [%d] bytes", __func__, *reg, datalen); + for (int i = 0; i < datalen; i++) + { + ESP_LOGV(TAG, "%s: 0x%02x", __func__, data[i]); + } + + i2c_cmd_handle_t cmd = i2c_cmd_link_create(); + ret |= i2c_master_start(cmd); + ret |= i2c_master_write_byte(cmd, TAS5805M_ADDRESS << 1 | WRITE_BIT, ACK_CHECK_EN); + ret |= i2c_master_write(cmd, reg, regLen, ACK_CHECK_EN); + ret |= i2c_master_write(cmd, data, datalen, ACK_CHECK_EN); + ret |= i2c_master_stop(cmd); + ret = i2c_master_cmd_begin(I2C_TAS5805M_MASTER_NUM, cmd, 1000 / portTICK_RATE_MS); + + // Check if ret is OK + if (ret != ESP_OK) + { + ESP_LOGE(TAG, "%s: Error during I2C transmission: %s", __func__, esp_err_to_name(ret)); + } + + i2c_cmd_link_delete(cmd); + + return ret; +} + // Inits the TAS5805M change Settings in Menuconfig to enable Bridge-Mode esp_err_t tas5805m_init() { ESP_LOGD(TAG, "%s: Initializing TAS5805M", __func__); @@ -549,6 +586,104 @@ esp_err_t tas5805m_set_again(uint8_t gain) return ret; } +esp_err_t tas5805m_get_mixer_mode(TAS5805M_MIXER_MODE *mode) +{ + *mode = tas5805m_state.mixer_mode; + return ESP_OK; +} + +esp_err_t tas5805m_set_mixer_mode(TAS5805M_MIXER_MODE mode) +{ + ESP_LOGD(TAG, "%s: Setting mixer mode to %d", __func__, mode); + + uint32_t mixer_l_to_l, mixer_r_to_r, mixer_l_to_r, mixer_r_to_l; + int ret = ESP_OK; + + switch (mode) + { + case MIXER_STEREO: + mixer_l_to_l = TAS5805M_MIXER_VALUE_0DB; + mixer_l_to_r = TAS5805M_MIXER_VALUE_MUTE; + mixer_r_to_l = TAS5805M_MIXER_VALUE_MUTE; + mixer_r_to_r = TAS5805M_MIXER_VALUE_0DB; + break; + + case MIXER_STEREO_INVERSE: + mixer_l_to_l = TAS5805M_MIXER_VALUE_MUTE; + mixer_l_to_r = TAS5805M_MIXER_VALUE_0DB; + mixer_r_to_l = TAS5805M_MIXER_VALUE_0DB; + mixer_r_to_r = TAS5805M_MIXER_VALUE_MUTE; + break; + + case MIXER_MONO: + mixer_l_to_l = TAS5805M_MIXER_VALUE_MINUS6DB; + mixer_r_to_r = TAS5805M_MIXER_VALUE_MINUS6DB; + mixer_l_to_r = TAS5805M_MIXER_VALUE_MINUS6DB; + mixer_r_to_l = TAS5805M_MIXER_VALUE_MINUS6DB; + break; + + case MIXER_LEFT: + mixer_l_to_l = TAS5805M_MIXER_VALUE_0DB; + mixer_r_to_r = TAS5805M_MIXER_VALUE_MUTE; + mixer_l_to_r = TAS5805M_MIXER_VALUE_0DB; + mixer_r_to_l = TAS5805M_MIXER_VALUE_MUTE; + break; + + case MIXER_RIGHT: + mixer_l_to_l = TAS5805M_MIXER_VALUE_MUTE; + mixer_r_to_r = TAS5805M_MIXER_VALUE_0DB; + mixer_l_to_r = TAS5805M_MIXER_VALUE_MUTE; + mixer_r_to_l = TAS5805M_MIXER_VALUE_0DB; + break; + + default: + ESP_LOGE(TAG, "%s: Invalid mixer mode %d", __func__, mode); + return ESP_ERR_INVALID_ARG; + } + + ret = ret | tas5805m_set_mixer_gain(TAS5805M_MIXER_CHANNEL_LEFT_TO_LEFT, mixer_l_to_l); + ret = ret | tas5805m_set_mixer_gain(TAS5805M_MIXER_CHANNEL_RIGHT_TO_RIGHT, mixer_r_to_r); + ret = ret | tas5805m_set_mixer_gain(TAS5805M_MIXER_CHANNEL_LEFT_TO_RIGHT, mixer_l_to_r); + ret = ret | tas5805m_set_mixer_gain(TAS5805M_MIXER_CHANNEL_RIGHT_TO_LEFT, mixer_r_to_l); + + tas5805m_state.mixer_mode = mode; + return ret; +} + +esp_err_t tas5805m_set_mixer_gain(TAS5805M_MIXER_CHANNELS channel, uint32_t gain) +{ + ESP_LOGD(TAG, "%s: Setting mixer gain for channel %d to 0x%08x", __func__, channel, gain); + uint8_t reg; + + switch (channel) + { + case TAS5805M_MIXER_CHANNEL_LEFT_TO_LEFT: + reg = TAS5805M_REG_LEFT_TO_LEFT_GAIN; + break; + case TAS5805M_MIXER_CHANNEL_RIGHT_TO_RIGHT: + reg = TAS5805M_REG_RIGHT_TO_RIGHT_GAIN; + break; + case TAS5805M_MIXER_CHANNEL_LEFT_TO_RIGHT: + reg = TAS5805M_REG_LEFT_TO_RIGHT_GAIN; + break; + case TAS5805M_MIXER_CHANNEL_RIGHT_TO_LEFT: + reg = TAS5805M_REG_RIGHT_TO_LEFT_GAIN; + break; + default: + ESP_LOGE(TAG, "%s: Invalid mixer channel %d", __func__, channel); + return ESP_ERR_INVALID_ARG; + } + + TAS5805M_SET_BOOK_AND_PAGE(TAS5805M_REG_BOOK_5, TAS5805M_REG_BOOK_5_MIXER_PAGE); + int ret = tas5805m_write_bytes(®, 1, (uint8_t *)&gain, sizeof(gain)); + if (ret != ESP_OK) { + ESP_LOGE(TAG, "Failed to write register %d: %d", TAS5805M_REG_LEFT_TO_LEFT_GAIN, ret); + } + + TAS5805M_SET_BOOK_AND_PAGE(TAS5805M_REG_BOOK_CONTROL_PORT, TAS5805M_REG_PAGE_ZERO); + return ret; +} + esp_err_t tas5805m_clear_faults() { ESP_LOGD(TAG, "%s: Clearing faults", __func__); diff --git a/components/tas5805m_settings/include/tas5805m_settings.h b/components/tas5805m_settings/include/tas5805m_settings.h index 12bdc4d0..e0b2e861 100644 --- a/components/tas5805m_settings/include/tas5805m_settings.h +++ b/components/tas5805m_settings/include/tas5805m_settings.h @@ -17,6 +17,7 @@ extern "C" { #include #include #include + #include "tas5805m_types.h" #include "tas5805m.h" @@ -27,6 +28,8 @@ extern "C" { #define TAS5805M_NVS_KEY_MOD_MODE "mod_mode" #define TAS5805M_NVS_KEY_SW_FREQ "sw_freq" #define TAS5805M_NVS_KEY_BD_FREQ "bd_freq" +// Mixer mode (persisted) +#define TAS5805M_NVS_KEY_MIXER_MODE "mixer_mode" // Digital Volume Settings (in 0.5dB steps) - kept for UI scaling/display #define TAS5805M_DIGITAL_VOL_MIN -207 // -103.5 dB @@ -64,6 +67,11 @@ esp_err_t tas5805m_settings_load_modulation_mode(TAS5805M_MOD_MODE *mode, TAS5805M_SW_FREQ *freq, TAS5805M_BD_FREQ *bd_freq); +/** Save mixer mode to NVS */ +esp_err_t tas5805m_settings_save_mixer_mode(TAS5805M_MIXER_MODE mode); +/** Load mixer mode from NVS */ +esp_err_t tas5805m_settings_load_mixer_mode(TAS5805M_MIXER_MODE *mode); + /** Get current TAS5805M settings as a JSON string */ esp_err_t tas5805m_settings_get_json(char *json_out, size_t max_len); diff --git a/components/tas5805m_settings/tas5805m_settings.c b/components/tas5805m_settings/tas5805m_settings.c index d248f3d0..20dba5fe 100644 --- a/components/tas5805m_settings/tas5805m_settings.c +++ b/components/tas5805m_settings/tas5805m_settings.c @@ -35,6 +35,18 @@ static const char* tas5805m_state_to_string(TAS5805M_CTRL_STATE state) { } } +static const char* tas5805m_mixer_mode_to_string(TAS5805M_MIXER_MODE mode) { + switch (mode) { + case MIXER_UNKNOWN: return "Unknown"; + case MIXER_STEREO: return "Stereo"; + case MIXER_STEREO_INVERSE: return "Stereo (Inverse)"; + case MIXER_MONO: return "Mono"; + case MIXER_RIGHT: return "Right"; + case MIXER_LEFT: return "Left"; + default: return "Unknown"; + } +} + esp_err_t tas5805m_settings_init(void) { if (tas5805m_settings_mutex == NULL) { tas5805m_settings_mutex = xSemaphoreCreateMutex(); @@ -230,6 +242,62 @@ esp_err_t tas5805m_settings_load_modulation_mode(TAS5805M_MOD_MODE *mode, return err; } +/** Save mixer mode to NVS */ +esp_err_t tas5805m_settings_save_mixer_mode(TAS5805M_MIXER_MODE mode) { + ESP_LOGD(TAG, "%s: mode=%d", __func__, (int)mode); + + if (!tas5805m_settings_mutex) return ESP_ERR_INVALID_STATE; + + if (xSemaphoreTake(tas5805m_settings_mutex, pdMS_TO_TICKS(5000)) != pdTRUE) { + return ESP_ERR_TIMEOUT; + } + + nvs_handle_t h; + esp_err_t err = nvs_open(TAS5805M_NVS_NAMESPACE, NVS_READWRITE, &h); + if (err == ESP_OK) { + err = nvs_set_i32(h, TAS5805M_NVS_KEY_MIXER_MODE, (int32_t)mode); + if (err == ESP_OK) { + err = nvs_commit(h); + } + nvs_close(h); + } + + xSemaphoreGive(tas5805m_settings_mutex); + + if (err == ESP_OK) { + ESP_LOGI(TAG, "%s: Mixer mode saved: %d", __func__, (int)mode); + } else { + ESP_LOGE(TAG, "%s: Failed to save mixer mode: %s", __func__, esp_err_to_name(err)); + } + + return err; +} + +/** Load mixer mode from NVS */ +esp_err_t tas5805m_settings_load_mixer_mode(TAS5805M_MIXER_MODE *mode) { + if (!mode) return ESP_ERR_INVALID_ARG; + if (!tas5805m_settings_mutex) return ESP_ERR_INVALID_STATE; + + if (xSemaphoreTake(tas5805m_settings_mutex, pdMS_TO_TICKS(5000)) != pdTRUE) { + return ESP_ERR_TIMEOUT; + } + + nvs_handle_t h; + esp_err_t err = nvs_open(TAS5805M_NVS_NAMESPACE, NVS_READONLY, &h); + if (err == ESP_OK) { + int32_t v = 0; + err = nvs_get_i32(h, TAS5805M_NVS_KEY_MIXER_MODE, &v); + if (err == ESP_OK) { + *mode = (TAS5805M_MIXER_MODE)v; + ESP_LOGD(TAG, "%s: Mixer mode from NVS: %d", __func__, (int)*mode); + } + nvs_close(h); + } + + xSemaphoreGive(tas5805m_settings_mutex); + return err; +} + esp_err_t tas5805m_settings_get_json(char *json_out, size_t max_len) { ESP_LOGD(TAG, "%s: max_len=%zu", __func__, max_len); @@ -294,6 +362,9 @@ esp_err_t tas5805m_settings_get_json(char *json_out, size_t max_len) { cJSON_AddNumberToObject(root, "modulation_mode", (int)mod_mode); cJSON_AddNumberToObject(root, "sw_freq", (int)sw_freq); cJSON_AddNumberToObject(root, "bd_freq", (int)bd_freq); + /* Mixer mode from cached state */ + cJSON_AddNumberToObject(root, "mixer_mode", (int)dac_state.mixer_mode); + cJSON_AddStringToObject(root, "mixer_mode_name", tas5805m_mixer_mode_to_string(dac_state.mixer_mode)); // Render to string char *json_str = cJSON_PrintUnformatted(root); @@ -437,6 +508,19 @@ esp_err_t tas5805m_settings_set_from_json(const char *json_in) { } } + // Update mixer mode if present + cJSON *mixer_mode_item = cJSON_GetObjectItem(root, "mixer_mode"); + if (cJSON_IsNumber(mixer_mode_item)) { + TAS5805M_MIXER_MODE mode = (TAS5805M_MIXER_MODE)mixer_mode_item->valueint; + err = tas5805m_set_mixer_mode(mode); + if (err == ESP_OK) { + ESP_LOGI(TAG, "%s: Applied mixer mode %d to DAC", __func__, (int)mode); + tas5805m_settings_save_mixer_mode(mode); + } else { + ESP_LOGE(TAG, "%s: Failed to apply mixer mode: %s", __func__, esp_err_to_name(err)); + } + } + cJSON_Delete(root); return err; } @@ -506,7 +590,7 @@ esp_err_t tas5805m_settings_get_schema_json(char *json_out, size_t max_len) { cJSON_AddStringToObject(dig_vol_param, "key", "digital_volume"); cJSON_AddStringToObject(dig_vol_param, "name", "Digital Volume"); cJSON_AddStringToObject(dig_vol_param, "type", "range"); - cJSON_AddStringToObject(dig_vol_param, "unit", "register"); + cJSON_AddStringToObject(dig_vol_param, "unit", ""); cJSON_AddNumberToObject(dig_vol_param, "min", TAS5805M_VOLUME_DIGITAL_MIN); cJSON_AddNumberToObject(dig_vol_param, "max", TAS5805M_VOLUME_DIGITAL_MAX); cJSON_AddNumberToObject(dig_vol_param, "step", 1); @@ -520,7 +604,7 @@ esp_err_t tas5805m_settings_get_schema_json(char *json_out, size_t max_len) { cJSON_AddStringToObject(ana_gain_param, "key", "analog_gain"); cJSON_AddStringToObject(ana_gain_param, "name", "Analog Gain"); cJSON_AddStringToObject(ana_gain_param, "type", "range"); - cJSON_AddStringToObject(ana_gain_param, "unit", "register"); + cJSON_AddStringToObject(ana_gain_param, "unit", ""); cJSON_AddNumberToObject(ana_gain_param, "min", 0); cJSON_AddNumberToObject(ana_gain_param, "max", 31); cJSON_AddNumberToObject(ana_gain_param, "step", 1); @@ -609,6 +693,48 @@ esp_err_t tas5805m_settings_get_schema_json(char *json_out, size_t max_len) { cJSON_AddItemToObject(dac_mode_param, "values", dac_mode_values); cJSON_AddItemToArray(dac_config_params, dac_mode_param); + // Mixer Mode parameter + cJSON *mixer_mode_param = cJSON_CreateObject(); + cJSON_AddStringToObject(mixer_mode_param, "key", "mixer_mode"); + cJSON_AddStringToObject(mixer_mode_param, "name", "Mixer Mode"); + cJSON_AddStringToObject(mixer_mode_param, "type", "enum"); + cJSON_AddNumberToObject(mixer_mode_param, "current", (int)dac_state.mixer_mode); + + cJSON *mixer_mode_values = cJSON_CreateArray(); + + cJSON *mm_unknown = cJSON_CreateObject(); + cJSON_AddNumberToObject(mm_unknown, "value", MIXER_UNKNOWN); + cJSON_AddStringToObject(mm_unknown, "name", "Unknown"); + cJSON_AddItemToArray(mixer_mode_values, mm_unknown); + + cJSON *mm_stereo = cJSON_CreateObject(); + cJSON_AddNumberToObject(mm_stereo, "value", MIXER_STEREO); + cJSON_AddStringToObject(mm_stereo, "name", "Stereo"); + cJSON_AddItemToArray(mixer_mode_values, mm_stereo); + + cJSON *mm_stereo_inv = cJSON_CreateObject(); + cJSON_AddNumberToObject(mm_stereo_inv, "value", MIXER_STEREO_INVERSE); + cJSON_AddStringToObject(mm_stereo_inv, "name", "Stereo (Inverse)"); + cJSON_AddItemToArray(mixer_mode_values, mm_stereo_inv); + + cJSON *mm_mono = cJSON_CreateObject(); + cJSON_AddNumberToObject(mm_mono, "value", MIXER_MONO); + cJSON_AddStringToObject(mm_mono, "name", "Mono"); + cJSON_AddItemToArray(mixer_mode_values, mm_mono); + + cJSON *mm_right = cJSON_CreateObject(); + cJSON_AddNumberToObject(mm_right, "value", MIXER_RIGHT); + cJSON_AddStringToObject(mm_right, "name", "Right"); + cJSON_AddItemToArray(mixer_mode_values, mm_right); + + cJSON *mm_left = cJSON_CreateObject(); + cJSON_AddNumberToObject(mm_left, "value", MIXER_LEFT); + cJSON_AddStringToObject(mm_left, "name", "Left"); + cJSON_AddItemToArray(mixer_mode_values, mm_left); + + cJSON_AddItemToObject(mixer_mode_param, "values", mixer_mode_values); + cJSON_AddItemToArray(dac_config_params, mixer_mode_param); + // Modulation Mode parameter cJSON *mod_mode_param = cJSON_CreateObject(); cJSON_AddStringToObject(mod_mode_param, "key", "modulation_mode"); @@ -699,10 +825,11 @@ esp_err_t tas5805m_settings_get_schema_json(char *json_out, size_t max_len) { cJSON_AddItemToObject(bd_freq_param, "values", bd_freq_values); cJSON_AddItemToArray(dac_config_params, bd_freq_param); - + cJSON_AddItemToObject(dac_config_group, "parameters", dac_config_params); cJSON_AddItemToArray(groups, dac_config_group); + // End groups cJSON_AddItemToObject(root, "groups", groups); // Render to string @@ -775,6 +902,15 @@ esp_err_t tas5805m_settings_apply_all(void) { } } + // Apply mixer mode + TAS5805M_MIXER_MODE mixer_mode; + if (tas5805m_settings_load_mixer_mode(&mixer_mode) == ESP_OK) { + ESP_LOGI(TAG, "%s: Restoring mixer mode=%d", __func__, (int)mixer_mode); + if (tas5805m_set_mixer_mode(mixer_mode) != ESP_OK) { + ESP_LOGW(TAG, "%s: Failed to apply saved mixer mode", __func__); + } + } + ESP_LOGI(TAG, "%s: Persisted settings application complete", __func__); return ESP_OK; } diff --git a/components/ui_http_server/html/dac-settings.html b/components/ui_http_server/html/dac-settings.html index cc2a4466..05b4b5fe 100644 --- a/components/ui_http_server/html/dac-settings.html +++ b/components/ui_http_server/html/dac-settings.html @@ -260,9 +260,14 @@

TAS5805M DAC Settings

-
+
- Auto-refreshing every 2 seconds + Auto-refreshing every 2 seconds +
+ + + 2s +
@@ -275,7 +280,11 @@

TAS5805M DAC Settings

let schema = null; let currentSettings = null; let pollingInterval = null; - const POLL_INTERVAL_MS = 2000; // Poll every 2 seconds + // Poll interval in seconds (0 = off). Persisted to localStorage. + let pollIntervalSec = (function(){ + const v = parseInt(localStorage.getItem('dac_poll_interval_sec')); + return Number.isInteger(v) ? v : 2; + })(); // Fetch DAC schema from the device async function loadSchema() { @@ -291,7 +300,8 @@

TAS5805M DAC Settings

renderUI(); - // Start periodic polling + // Initialize polling UI and start periodic polling if enabled + initPollingControls(); startPolling(); } catch (error) { console.error('Error loading DAC schema:', error); @@ -322,23 +332,32 @@

TAS5805M DAC Settings

} } - // Start periodic polling of DAC settings + // Start periodic polling of DAC settings using pollIntervalSec function startPolling() { // Clear any existing interval if (pollingInterval) { clearInterval(pollingInterval); + pollingInterval = null; } - - // Poll for changes every POLL_INTERVAL_MS + + if (!pollIntervalSec || pollIntervalSec <= 0) { + // Polling disabled + updatePollingIndicator(false); + console.log('Polling disabled (pollIntervalSec=0)'); + return; + } + + // Poll for changes every pollIntervalSec seconds pollingInterval = setInterval(async () => { const changed = await loadCurrentSettings(); if (changed && schema) { renderUI(); console.log('DAC settings updated from polling'); } - }, POLL_INTERVAL_MS); - - console.log(`Started polling DAC settings every ${POLL_INTERVAL_MS}ms`); + }, pollIntervalSec * 1000); + + updatePollingIndicator(true); + console.log(`Started polling DAC settings every ${pollIntervalSec}s`); } // Stop polling (useful for cleanup) @@ -350,6 +369,53 @@

TAS5805M DAC Settings

} } + // Initialize polling controls (slider and label) and wire events + function initPollingControls() { + const slider = document.getElementById('poll-interval'); + const valSpan = document.getElementById('poll-interval-value'); + const textSpan = document.getElementById('polling-text'); + + if (!slider || !valSpan || !textSpan) return; + + // Set slider initial value + slider.value = String(pollIntervalSec); + valSpan.textContent = pollIntervalSec === 0 ? 'Off' : (pollIntervalSec + 's'); + textSpan.textContent = pollIntervalSec === 0 ? 'Auto-refresh OFF' : `Auto-refreshing every ${pollIntervalSec} second${pollIntervalSec===1? '' : 's'}`; + + // Update function + const update = (sec) => { + pollIntervalSec = sec; + localStorage.setItem('dac_poll_interval_sec', String(pollIntervalSec)); + valSpan.textContent = pollIntervalSec === 0 ? 'Off' : (pollIntervalSec + 's'); + textSpan.textContent = pollIntervalSec === 0 ? 'Auto-refresh OFF' : `Auto-refreshing every ${pollIntervalSec} second${pollIntervalSec===1? '' : 's'}`; + // Restart polling with new interval + startPolling(); + }; + + slider.addEventListener('input', (e) => { + const v = parseInt(e.target.value, 10) || 0; + valSpan.textContent = v === 0 ? 'Off' : (v + 's'); + }); + + slider.addEventListener('change', (e) => { + const v = parseInt(e.target.value, 10) || 0; + update(v); + }); + } + + function updatePollingIndicator(active) { + const indicator = document.getElementById('polling-indicator'); + const pulse = indicator ? indicator.querySelector('.pulse') : null; + if (!indicator || !pulse) return; + if (active) { + pulse.style.backgroundColor = '#28a745'; + pulse.style.animationPlayState = 'running'; + } else { + pulse.style.backgroundColor = '#999'; + pulse.style.animationPlayState = 'paused'; + } + } + // Render the complete UI based on schema function renderUI() { const app = document.getElementById('app'); @@ -423,9 +489,19 @@

TAS5805M DAC Settings

html += ''; if (param.type === 'range') { - // Display current value with scaling + // Display current value with scaling. If the schema's step is an integer + // then show integer formatting; otherwise preserve fractional digits const scale = param.scale || 1; - const displayValue = (param.current * scale).toFixed(1); + const step = (param.step !== undefined) ? Number(param.step) : 1; + const getDecimals = (s) => { + if (s === undefined || s === null) return 1; + if (Number.isInteger(s)) return 0; + const ss = String(s); + if (ss.indexOf('.') === -1) return 0; + return ss.split('.')[1].length; + }; + const decimals = (param.decimals !== undefined) ? param.decimals : getDecimals(step); + const displayValue = (param.current * scale).toFixed(decimals); html += `${displayValue} ${param.unit}`; } @@ -482,8 +558,25 @@

TAS5805M DAC Settings

// Handle range slider changes function handleRangeChange(paramKey, value, scale, unit) { const valueSpan = document.getElementById(`${paramKey}-value`); + const slider = document.getElementById(paramKey); + // Determine decimals from the slider's step attribute (fallback to 1 decimal) + let decimals = 1; + if (slider) { + const stepAttr = slider.getAttribute('step'); + const step = stepAttr !== null ? Number(stepAttr) : 1; + if (!Number.isNaN(step)) { + if (Number.isInteger(step)) { + decimals = 0; + } else { + const s = String(step); + decimals = s.indexOf('.') === -1 ? 0 : s.split('.')[1].length; + } + } + } + if (valueSpan) { - const displayValue = (parseInt(value) * scale).toFixed(1); + const numeric = parseFloat(value); + const displayValue = (numeric * (scale || 1)).toFixed(decimals); valueSpan.textContent = `${displayValue} ${unit}`; } diff --git a/main/main.c b/main/main.c index 4d44385a..9ded8fdc 100644 --- a/main/main.c +++ b/main/main.c @@ -2624,10 +2624,9 @@ void app_main(void) { esp_log_level_set("wifi", ESP_LOG_WARN); esp_log_level_set("wifi_init", ESP_LOG_WARN); esp_log_level_set("httpd_uri", ESP_LOG_WARN); - esp_log_level_set("settings", ESP_LOG_DEBUG); - esp_log_level_set("dsp_settings", ESP_LOG_DEBUG); esp_log_level_set("UI_HTTP", ESP_LOG_WARN); esp_log_level_set("TAS5805M", ESP_LOG_DEBUG); + esp_log_level_set("tas5805m_settings", ESP_LOG_INFO); #if CONFIG_SNAPCLIENT_USE_INTERNAL_ETHERNET || \ CONFIG_SNAPCLIENT_USE_SPI_ETHERNET From d1f6f646404c0b32d48b48e41d2242494ecd46be Mon Sep 17 00:00:00 2001 From: Andriy Malyshenko Date: Wed, 26 Nov 2025 23:06:28 +0100 Subject: [PATCH 16/58] Added EQ related code to the tas5805m driver --- .../custom_board/tas5805m/include/tas5805m.h | 137 + .../tas5805m/include/tas5805m_eq.h | 18836 ++++++++++++++++ .../tas5805m/include/tas5805m_eq_profiles.h | 2718 +++ .../tas5805m/include/tas5805m_reg_cfg.h | 7 +- .../tas5805m/include/tas5805m_types.h | 46 +- components/custom_board/tas5805m/tas5805m.c | 271 +- 6 files changed, 21928 insertions(+), 87 deletions(-) create mode 100644 components/custom_board/tas5805m/include/tas5805m_eq.h create mode 100644 components/custom_board/tas5805m/include/tas5805m_eq_profiles.h diff --git a/components/custom_board/tas5805m/include/tas5805m.h b/components/custom_board/tas5805m/include/tas5805m.h index d8061066..c6fd4068 100644 --- a/components/custom_board/tas5805m/include/tas5805m.h +++ b/components/custom_board/tas5805m/include/tas5805m.h @@ -35,6 +35,11 @@ #include "tas5805m_types.h" +#if defined(CONFIG_DAC_TAS5805M_EQ_SUPPORT) +#include "tas5805m_eq.h" +#include "tas5805m_eq_profiles.h" +#endif + #ifdef __cplusplus extern "C" { #endif @@ -44,6 +49,19 @@ extern "C" { #define I2C_MASTER_RX_BUF_DISABLE 0 /*!< I2C master doesn't need buffer */ #define I2C_MASTER_TIMEOUT_MS 1000 +/* Cached state structure */ +typedef struct { + int8_t volume; + TAS5805M_CTRL_STATE state; + TAS5805M_MIXER_MODE mixer_mode; + +#if defined(CONFIG_DAC_TAS5805M_EQ_SUPPORT) + int8_t eq_gain_l[TAS5805M_EQ_BANDS]; + int8_t eq_gain_r[TAS5805M_EQ_BANDS]; + TAS5805M_EQ_PROFILE eq_profile[2]; +#endif +} TAS5805_STATE; + /* @brief Initialize TAS5805 codec chip * * @return @@ -299,6 +317,125 @@ esp_err_t tas5805m_clear_faults(); */ void tas5805m_decode_faults(TAS5805M_FAULT fault); +#if defined(CONFIG_DAC_TAS5805M_EQ_SUPPORT) + +/** + * @brief Get the current EQ mode of the TAS5805M + * + * @param mode: Pointer to the mode variable + * + */ +esp_err_t tas5805m_get_eq_mode(TAS5805M_EQ_MODE *mode); + +/** + * @brief Set the EQ mode of the TAS5805M + * + * @param mode: The mode to set + * + * @return + * - ESP_OK + * - ESP_FAIL + */ +esp_err_t tas5805m_set_eq_mode(TAS5805M_EQ_MODE mode); + +/** + * @brief Get the current EQ gain of the TAS5805M for LEFT channel (applies to + * both channels, when configures as mirror) + * + * @param band: The band to get the gain of + * @param gain: Pointer to the gain variable + * + */ +esp_err_t tas5805m_get_eq_gain(int band, int *gain); + +/** + * @brief Set the EQ gain of the TAS5805M for selected channel + * + * @param band: The band to set the gain of + * @param gain: The gain to set + * @param channel: The channel to set the gain for + * + * @return + * - ESP_OK + * - ESP_FAIL + */ +esp_err_t tas5805m_get_eq_gain_channel(TAS5805M_EQ_CHANNELS channel, int band, + int *gain); + +/** + * @brief Set the EQ gain of the TAS5805M for LEFT channel (applies to both + * channels, when configures as mirror) + * + * @param band: The band to set the gain of + * @param gain: The gain to set + * + */ +esp_err_t tas5805m_set_eq_gain(int band, int gain); + +/** + * @brief Set the EQ gain of the TAS5805M for selected channel + * + * @param band: The band to set the gain of + * @param gain: The gain to set + * @param channel: The channel to set the gain for + * + * @return + * - ESP_OK + * - ESP_FAIL + */ +esp_err_t tas5805m_set_eq_gain_channel(TAS5805M_EQ_CHANNELS channel, int band, + int gain); + +/** + * @brief Get the current EQ profile of the TAS5805M + * + * @param profile: Pointer to the profile variable + * + * @return + * - ESP_OK + * - ESP_FAIL + */ +esp_err_t tas5805m_get_eq_profile(TAS5805M_EQ_PROFILE *profile); + +/** + * @brief Get the EQ profile of the TAS5805M for a specific channel + * + * @param profile: Pointer to the profile variable + * @param channel: The channel to get the profile for + * + * @return + * - ESP_OK + * - ESP_FAIL + */ +esp_err_t tas5805m_get_eq_profile_channel(TAS5805M_EQ_CHANNELS channel, + TAS5805M_EQ_PROFILE *profile); + +/** + * @brief Set the EQ profile of the TAS5805M + * + * @param profile: The EQ profile to set + * + * @return + * - ESP_OK + * - ESP_FAIL + */ +esp_err_t tas5805m_set_eq_profile(TAS5805M_EQ_PROFILE profile); + +/** + * @brief Set the EQ profile of the TAS5805M for a specific channel + * + * @param profile: The EQ profile to set + * @param channel: The channel to set the profile for + * + * @return + * - ESP_OK + * - ESP_FAIL + */ +esp_err_t tas5805m_set_eq_profile_channel(TAS5805M_EQ_CHANNELS channel, + TAS5805M_EQ_PROFILE profile); + +#endif /* CONFIG_DAC_TAS5805M_EQ_SUPPORT */ + #ifdef __cplusplus } #endif diff --git a/components/custom_board/tas5805m/include/tas5805m_eq.h b/components/custom_board/tas5805m/include/tas5805m_eq.h new file mode 100644 index 00000000..3e5f868d --- /dev/null +++ b/components/custom_board/tas5805m/include/tas5805m_eq.h @@ -0,0 +1,18836 @@ +#pragma once + +#include "tas5805m_types.h" + +#if defined(CONFIG_DAC_TAS5805M_EQ_SUPPORT) + +#ifdef __cplusplus +extern "C" +{ +#endif + + typedef unsigned char cfg_u8; + + typedef struct + { + cfg_u8 page; + cfg_u8 offset; + cfg_u8 value; + } reg_sequence_eq; + +#define TAS5805M_EQ_MAX_DB 15 +#define TAS5805M_EQ_MIN_DB -TAS5805M_EQ_MAX_DB + +#define TAS5805M_EQ_STEPS (1 + TAS5805M_EQ_MAX_DB - TAS5805M_EQ_MIN_DB) +#define TAS5805M_EQ_BANDS 15 +#define TAS5805M_EQ_KOEF_PER_BAND 5 +#define TAS5805M_EQ_REG_PER_KOEF 4 +#define TAS5805M_EQ_REG_PER_STEP (TAS5805M_EQ_BANDS * TAS5805M_EQ_KOEF_PER_BAND * TAS5805M_EQ_REG_PER_KOEF) + +// Mixer registers +#define TAS5805M_REG_BOOK_EQ 0xaa + + // Frquency bands + static const int tas5805m_eq_bands[TAS5805M_EQ_BANDS] = { + 20, 32, 50, 80, 125, 200, 315, 500, 800, 1250, 2000, 3150, 5000, 8000, 16000}; + + static const reg_sequence_eq tas5805m_eq_registers_left_mf[TAS5805M_EQ_REG_PER_STEP] = { + {0x24, 0x18, 0x07}, // Biquad - BQ1 Left - Filter: Equalizer (Q Factor) Frequency: 20 Hz Gain: -15dB QVal: 2 Bandwidth: 1000 Hz + {0x24, 0x19, 0xfc}, + {0x24, 0x56, 0xa2}, + {0x24, 0x57, 0x71}, + {0x24, 0x58, 0xf0}, + {0x24, 0x59, 0x27}, + {0x24, 0x5a, 0xdd}, + {0x24, 0x5b, 0xad}, + {0x24, 0x5c, 0x07}, + {0x24, 0x5d, 0xe8}, + {0x24, 0x5e, 0x8e}, + {0x24, 0x5f, 0x1e}, + {0x24, 0x60, 0x0f}, + {0x24, 0x61, 0xd8}, + {0x24, 0x62, 0x22}, + {0x24, 0x63, 0x53}, + {0x24, 0x64, 0xf8}, + {0x24, 0x65, 0x27}, + {0x24, 0x66, 0xcf}, + {0x24, 0x67, 0x71}, + {0x24, 0x68, 0x07}, // Biquad - BQ5 Left - Filter: Equalizer (Q Factor) Frequency: 125 Hz Gain: -15dB QVal: 1 Bandwidth: 1000 Hz + {0x24, 0x69, 0xda}, + {0x24, 0x6a, 0x23}, + {0x24, 0x6b, 0x50}, + {0x24, 0x6c, 0xf0}, + {0x24, 0x6d, 0x5c}, + {0x24, 0x6e, 0x3c}, + {0x24, 0x6f, 0x8e}, + {0x24, 0x70, 0x07}, + {0x24, 0x71, 0xc9}, + {0x24, 0x72, 0xc2}, + {0x24, 0x73, 0x70}, + {0x24, 0x74, 0x0f}, + {0x24, 0x75, 0xa3}, + {0x24, 0x76, 0xc3}, + {0x24, 0x77, 0x72}, + {0x24, 0x78, 0xf8}, + {0x24, 0x79, 0x5c}, + {0x24, 0x7a, 0x1a}, + {0x24, 0x7b, 0x40}, + {0x24, 0x7c, 0x07}, // Biquad - BQ6 Left - Filter: Equalizer (Q Factor) Frequency: 200 Hz Gain: -15dB QVal: 1 Bandwidth: 1000 Hz + {0x24, 0x7d, 0xc4}, + {0x24, 0x7e, 0x3a}, + {0x24, 0x7f, 0x25}, + {0x25, 0x08, 0xf0}, + {0x25, 0x09, 0x91}, + {0x25, 0x0a, 0xbd}, + {0x25, 0x0b, 0xa6}, + {0x25, 0x0c, 0x07}, + {0x25, 0x0d, 0xaa}, + {0x25, 0x0e, 0x5e}, + {0x25, 0x0f, 0xdb}, + {0x25, 0x10, 0x0f}, + {0x25, 0x11, 0x6e}, + {0x25, 0x12, 0x42}, + {0x25, 0x13, 0x5a}, + {0x25, 0x14, 0xf8}, + {0x25, 0x15, 0x91}, + {0x25, 0x16, 0x67}, + {0x25, 0x17, 0x01}, + {0x25, 0x18, 0x07}, // Biquad - BQ7 Left - Filter: Equalizer (Q Factor) Frequency: 315 Hz Gain: -15dB QVal: 0.9 Bandwidth: 1000 Hz + {0x25, 0x19, 0x9a}, + {0x25, 0x1a, 0x1c}, + {0x25, 0x1b, 0x35}, + {0x25, 0x1c, 0xf0}, + {0x25, 0x1d, 0xf8}, + {0x25, 0x1e, 0xac}, + {0x25, 0x1f, 0x4b}, + {0x25, 0x20, 0x07}, + {0x25, 0x21, 0x6e}, + {0x25, 0x22, 0x08}, + {0x25, 0x23, 0xdb}, + {0x25, 0x24, 0x0f}, + {0x25, 0x25, 0x07}, + {0x25, 0x26, 0x53}, + {0x25, 0x27, 0xb5}, + {0x25, 0x28, 0xf8}, + {0x25, 0x29, 0xf7}, + {0x25, 0x2a, 0xda}, + {0x25, 0x2b, 0xf0}, + {0x25, 0x2c, 0x07}, // Biquad - BQ8 Left - Filter: Equalizer (Q Factor) Frequency: 500 Hz Gain: -15dB QVal: 0.9 Bandwidth: 1000 Hz + {0x25, 0x2d, 0x63}, + {0x25, 0x2e, 0xd2}, + {0x25, 0x2f, 0x0d}, + {0x25, 0x30, 0xf1}, + {0x25, 0x31, 0x7d}, + {0x25, 0x32, 0xe8}, + {0x25, 0x33, 0xac}, + {0x25, 0x34, 0x07}, + {0x25, 0x35, 0x20}, + {0x25, 0x36, 0x42}, + {0x25, 0x37, 0xa0}, + {0x25, 0x38, 0x0e}, + {0x25, 0x39, 0x82}, + {0x25, 0x3a, 0x17}, + {0x25, 0x3b, 0x54}, + {0x25, 0x3c, 0xf9}, + {0x25, 0x3d, 0x7b}, + {0x25, 0x3e, 0xeb}, + {0x25, 0x3f, 0x53}, + {0x25, 0x40, 0x06}, // Biquad - BQ9 Left - Filter: Equalizer (Q Factor) Frequency: 800 Hz Gain: -15dB QVal: 0.8 Bandwidth: 1000 Hz + {0x25, 0x41, 0xfa}, + {0x25, 0x42, 0x4b}, + {0x25, 0x43, 0xcf}, + {0x25, 0x44, 0xf2}, + {0x25, 0x45, 0x81}, + {0x25, 0x46, 0x5b}, + {0x25, 0x47, 0x57}, + {0x25, 0x48, 0x06}, + {0x25, 0x49, 0x89}, + {0x25, 0x4a, 0x16}, + {0x25, 0x4b, 0x8a}, + {0x25, 0x4c, 0x0d}, + {0x25, 0x4d, 0x7e}, + {0x25, 0x4e, 0xa4}, + {0x25, 0x4f, 0xa9}, + {0x25, 0x50, 0xfa}, + {0x25, 0x51, 0x7c}, + {0x25, 0x52, 0x9d}, + {0x25, 0x53, 0xa7}, + {0x25, 0x54, 0x06}, // Biquad - BQ10 Left - Filter: Equalizer (Q Factor) Frequency: 1250 Hz Gain: -15dB QVal: 0.8 Bandwidth: 1000 Hz + {0x25, 0x55, 0x87}, + {0x25, 0x56, 0xf6}, + {0x25, 0x57, 0x8b}, + {0x25, 0x58, 0xf3}, + {0x25, 0x59, 0x9d}, + {0x25, 0x5a, 0x61}, + {0x25, 0x5b, 0x7d}, + {0x25, 0x5c, 0x05}, + {0x25, 0x5d, 0xe5}, + {0x25, 0x5e, 0x4b}, + {0x25, 0x5f, 0xf3}, + {0x25, 0x60, 0x0c}, + {0x25, 0x61, 0x62}, + {0x25, 0x62, 0x9e}, + {0x25, 0x63, 0x83}, + {0x25, 0x64, 0xfb}, + {0x25, 0x65, 0x92}, + {0x25, 0x66, 0xbd}, + {0x25, 0x67, 0x82}, + {0x25, 0x68, 0x05}, // Biquad - BQ11 Left - Filter: Equalizer (Q Factor) Frequency: 2000 Hz Gain: -15dB QVal: 0.7 Bandwidth: 1000 Hz + {0x25, 0x69, 0xbb}, + {0x25, 0x6a, 0xc2}, + {0x25, 0x6b, 0x12}, + {0x25, 0x6c, 0xf5}, + {0x25, 0x6d, 0x9a}, + {0x25, 0x6e, 0x73}, + {0x25, 0x6f, 0xa5}, + {0x25, 0x70, 0x04}, + {0x25, 0x71, 0xc0}, + {0x25, 0x72, 0xc1}, + {0x25, 0x73, 0xae}, + {0x25, 0x74, 0x0a}, + {0x25, 0x75, 0x65}, + {0x25, 0x76, 0x8c}, + {0x25, 0x77, 0x5b}, + {0x25, 0x78, 0xfd}, + {0x25, 0x79, 0x83}, + {0x25, 0x7a, 0x7c}, + {0x25, 0x7b, 0x40}, + {0x25, 0x7c, 0x05}, // Biquad - BQ12 Left - Filter: Equalizer (Q Factor) Frequency: 3150 Hz Gain: -15dB QVal: 0.7 Bandwidth: 1000 Hz + {0x25, 0x7d, 0x05}, + {0x25, 0x7e, 0x40}, + {0x25, 0x7f, 0xf6}, + {0x26, 0x08, 0xf7}, + {0x26, 0x09, 0x6e}, + {0x26, 0x0a, 0xe4}, + {0x26, 0x0b, 0x09}, + {0x26, 0x0c, 0x03}, + {0x26, 0x0d, 0xbb}, + {0x26, 0x0e, 0x4d}, + {0x26, 0x0f, 0xe9}, + {0x26, 0x10, 0x08}, + {0x26, 0x11, 0x91}, + {0x26, 0x12, 0x1b}, + {0x26, 0x13, 0xf7}, + {0x26, 0x14, 0xff}, + {0x26, 0x15, 0x3f}, + {0x26, 0x16, 0x71}, + {0x26, 0x17, 0x21}, + {0x26, 0x18, 0x04}, // Biquad - BQ13 Left - Filter: Equalizer (Q Factor) Frequency: 5000 Hz Gain: -15dB QVal: 0.6 Bandwidth: 1000 Hz + {0x26, 0x19, 0x04}, + {0x26, 0x1a, 0xcb}, + {0x26, 0x1b, 0xe7}, + {0x26, 0x1c, 0xfa}, + {0x26, 0x1d, 0x05}, + {0x26, 0x1e, 0x17}, + {0x26, 0x1f, 0xe0}, + {0x26, 0x20, 0x02}, + {0x26, 0x21, 0x4b}, + {0x26, 0x22, 0xe8}, + {0x26, 0x23, 0x98}, + {0x26, 0x24, 0x05}, + {0x26, 0x25, 0xfa}, + {0x26, 0x26, 0xe8}, + {0x26, 0x27, 0x20}, + {0x26, 0x28, 0x01}, + {0x26, 0x29, 0xaf}, + {0x26, 0x2a, 0x4b}, + {0x26, 0x2b, 0x81}, + {0x26, 0x2c, 0x03}, // Biquad - BQ14 Left - Filter: Equalizer (Q Factor) Frequency: 8000 Hz Gain: -15dB QVal: 0.6 Bandwidth: 1000 Hz + {0x26, 0x2d, 0x53}, + {0x26, 0x2e, 0xbb}, + {0x26, 0x2f, 0x80}, + {0x26, 0x30, 0xfb}, + {0x26, 0x31, 0xfc}, + {0x26, 0x32, 0xe8}, + {0x26, 0x33, 0xbc}, + {0x26, 0x34, 0x01}, + {0x26, 0x35, 0x4e}, + {0x26, 0x36, 0x3f}, + {0x26, 0x37, 0xfe}, + {0x26, 0x38, 0x04}, + {0x26, 0x39, 0x03}, + {0x26, 0x3a, 0x17}, + {0x26, 0x3b, 0x44}, + {0x26, 0x3c, 0x03}, + {0x26, 0x3d, 0x5e}, + {0x26, 0x3e, 0x04}, + {0x26, 0x3f, 0x82}, + {0x26, 0x40, 0x02}, // Biquad - BQ15 Left - Filter: Equalizer (Q Factor) Frequency: 16000 Hz Gain: -15dB QVal: 0.5 Bandwidth: 1000 Hz + {0x26, 0x41, 0x60}, + {0x26, 0x42, 0x9e}, + {0x26, 0x43, 0x22}, + {0x26, 0x44, 0xfe}, + {0x26, 0x45, 0xd6}, + {0x26, 0x46, 0xb4}, + {0x26, 0x47, 0xf8}, + {0x26, 0x48, 0xff}, + {0x26, 0x49, 0xf1}, + {0x26, 0x4a, 0xf7}, + {0x26, 0x4b, 0xef}, + {0x26, 0x4c, 0x01}, + {0x26, 0x4d, 0x29}, + {0x26, 0x4e, 0x4b}, + {0x26, 0x4f, 0x08}, + {0x26, 0x50, 0x05}, + {0x26, 0x51, 0xad}, + {0x26, 0x52, 0x69}, + {0x26, 0x53, 0xef}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_left_me[TAS5805M_EQ_REG_PER_STEP] = { + {0x24, 0x18, 0x07}, // Biquad - BQ1 Left - Filter: Equalizer (Q Factor) Frequency: 20 Hz Gain: -14dB QVal: 2 Bandwidth: 1000 Hz + {0x24, 0x19, 0xfd}, + {0x24, 0x1a, 0x50}, + {0x24, 0x1b, 0xcc}, + {0x24, 0x1c, 0xf0}, + {0x24, 0x1d, 0x06}, + {0x24, 0x1e, 0xb5}, + {0x24, 0x1f, 0xe2}, + {0x24, 0x20, 0x07}, + {0x24, 0x21, 0xfb}, + {0x24, 0x22, 0xfa}, + {0x24, 0x23, 0x37}, + {0x24, 0x24, 0x0f}, + {0x24, 0x25, 0xf9}, + {0x24, 0x26, 0x4a}, + {0x24, 0x27, 0x1e}, + {0x24, 0x28, 0xf8}, + {0x24, 0x29, 0x06}, + {0x24, 0x2a, 0xb4}, + {0x24, 0x2b, 0xfd}, + {0x24, 0x2c, 0x07}, // Biquad - BQ2 Left - Filter: Equalizer (Q Factor) Frequency: 31.5 Hz Gain: -14dB QVal: 2 Bandwidth: 1000 Hz + {0x24, 0x2d, 0xfb}, + {0x24, 0x2e, 0xc6}, + {0x24, 0x2f, 0xad}, + {0x24, 0x30, 0xf0}, + {0x24, 0x31, 0x0a}, + {0x24, 0x32, 0x8f}, + {0x24, 0x33, 0xef}, + {0x24, 0x34, 0x07}, + {0x24, 0x35, 0xf9}, + {0x24, 0x36, 0xab}, + {0x24, 0x37, 0x9d}, + {0x24, 0x38, 0x0f}, + {0x24, 0x39, 0xf5}, + {0x24, 0x3a, 0x70}, + {0x24, 0x3b, 0x11}, + {0x24, 0x3c, 0xf8}, + {0x24, 0x3d, 0x0a}, + {0x24, 0x3e, 0x8d}, + {0x24, 0x3f, 0xb6}, + {0x24, 0x40, 0x07}, // Biquad - BQ3 Left - Filter: Equalizer (Q Factor) Frequency: 50 Hz Gain: -14dB QVal: 1.5 Bandwidth: 1000 Hz + {0x24, 0x41, 0xf7}, + {0x24, 0x42, 0x16}, + {0x24, 0x43, 0x0c}, + {0x24, 0x44, 0xf0}, + {0x24, 0x45, 0x16}, + {0x24, 0x46, 0x4b}, + {0x24, 0x47, 0x17}, + {0x24, 0x48, 0x07}, + {0x24, 0x49, 0xf2}, + {0x24, 0x4a, 0xa4}, + {0x24, 0x4b, 0x73}, + {0x24, 0x4c, 0x0f}, + {0x24, 0x4d, 0xe9}, + {0x24, 0x4e, 0xb4}, + {0x24, 0x4f, 0xe9}, + {0x24, 0x50, 0xf8}, + {0x24, 0x51, 0x16}, + {0x24, 0x52, 0x45}, + {0x24, 0x53, 0x81}, + {0x24, 0x54, 0x07}, // Biquad - BQ4 Left - Filter: Equalizer (Q Factor) Frequency: 80 Hz Gain: -14dB QVal: 1.5 Bandwidth: 1000 Hz + {0x24, 0x55, 0xf1}, + {0x24, 0x56, 0xc8}, + {0x24, 0x57, 0xc0}, + {0x24, 0x58, 0xf0}, + {0x24, 0x59, 0x23}, + {0x24, 0x5a, 0x92}, + {0x24, 0x5b, 0xfe}, + {0x24, 0x5c, 0x07}, + {0x24, 0x5d, 0xea}, + {0x24, 0x5e, 0xb2}, + {0x24, 0x5f, 0x82}, + {0x24, 0x60, 0x0f}, + {0x24, 0x61, 0xdc}, + {0x24, 0x62, 0x6d}, + {0x24, 0x63, 0x02}, + {0x24, 0x64, 0xf8}, + {0x24, 0x65, 0x23}, + {0x24, 0x66, 0x84}, + {0x24, 0x67, 0xbe}, + {0x24, 0x68, 0x07}, // Biquad - BQ5 Left - Filter: Equalizer (Q Factor) Frequency: 125 Hz Gain: -14dB QVal: 1 Bandwidth: 1000 Hz + {0x24, 0x69, 0xdf}, + {0x24, 0x6a, 0x10}, + {0x24, 0x6b, 0xc0}, + {0x24, 0x6c, 0xf0}, + {0x24, 0x6d, 0x52}, + {0x24, 0x6e, 0x6c}, + {0x24, 0x6f, 0x09}, + {0x24, 0x70, 0x07}, + {0x24, 0x71, 0xce}, + {0x24, 0x72, 0xa5}, + {0x24, 0x73, 0x9a}, + {0x24, 0x74, 0x0f}, + {0x24, 0x75, 0xad}, + {0x24, 0x76, 0x93}, + {0x24, 0x77, 0xf7}, + {0x24, 0x78, 0xf8}, + {0x24, 0x79, 0x52}, + {0x24, 0x7a, 0x49}, + {0x24, 0x7b, 0xa6}, + {0x24, 0x7c, 0x07}, // Biquad - BQ6 Left - Filter: Equalizer (Q Factor) Frequency: 200 Hz Gain: -14dB QVal: 1 Bandwidth: 1000 Hz + {0x24, 0x7d, 0xcb}, + {0x24, 0x7e, 0xee}, + {0x24, 0x7f, 0xab}, + {0x25, 0x08, 0xf0}, + {0x25, 0x09, 0x82}, + {0x25, 0x0a, 0x6e}, + {0x25, 0x0b, 0x95}, + {0x25, 0x0c, 0x07}, + {0x25, 0x0d, 0xb1}, + {0x25, 0x0e, 0xf9}, + {0x25, 0x0f, 0xba}, + {0x25, 0x10, 0x0f}, + {0x25, 0x11, 0x7d}, + {0x25, 0x12, 0x91}, + {0x25, 0x13, 0x6b}, + {0x25, 0x14, 0xf8}, + {0x25, 0x15, 0x82}, + {0x25, 0x16, 0x17}, + {0x25, 0x17, 0x9a}, + {0x25, 0x18, 0x07}, // Biquad - BQ7 Left - Filter: Equalizer (Q Factor) Frequency: 315 Hz Gain: -14dB QVal: 0.9 Bandwidth: 1000 Hz + {0x25, 0x19, 0xa7}, + {0x25, 0x1a, 0x00}, + {0x25, 0x1b, 0x64}, + {0x25, 0x1c, 0xf0}, + {0x25, 0x1d, 0xdf}, + {0x25, 0x1e, 0x30}, + {0x25, 0x1f, 0x0d}, + {0x25, 0x20, 0x07}, + {0x25, 0x21, 0x7a}, + {0x25, 0x22, 0xa2}, + {0x25, 0x23, 0x4c}, + {0x25, 0x24, 0x0f}, + {0x25, 0x25, 0x20}, + {0x25, 0x26, 0xcf}, + {0x25, 0x27, 0xf3}, + {0x25, 0x28, 0xf8}, + {0x25, 0x29, 0xde}, + {0x25, 0x2a, 0x5d}, + {0x25, 0x2b, 0x4f}, + {0x25, 0x2c, 0x07}, // Biquad - BQ8 Left - Filter: Equalizer (Q Factor) Frequency: 500 Hz Gain: -14dB QVal: 0.9 Bandwidth: 1000 Hz + {0x25, 0x2d, 0x77}, + {0x25, 0x2e, 0x18}, + {0x25, 0x2f, 0xf7}, + {0x25, 0x30, 0xf1}, + {0x25, 0x31, 0x58}, + {0x25, 0x32, 0x10}, + {0x25, 0x33, 0x44}, + {0x25, 0x34, 0x07}, + {0x25, 0x35, 0x32}, + {0x25, 0x36, 0xd9}, + {0x25, 0x37, 0x4e}, + {0x25, 0x38, 0x0e}, + {0x25, 0x39, 0xa7}, + {0x25, 0x3a, 0xef}, + {0x25, 0x3b, 0xbc}, + {0x25, 0x3c, 0xf9}, + {0x25, 0x3d, 0x56}, + {0x25, 0x3e, 0x0d}, + {0x25, 0x3f, 0xba}, + {0x25, 0x40, 0x07}, // Biquad - BQ9 Left - Filter: Equalizer (Q Factor) Frequency: 800 Hz Gain: -14dB QVal: 0.8 Bandwidth: 1000 Hz + {0x25, 0x41, 0x19}, + {0x25, 0x42, 0x01}, + {0x25, 0x43, 0xee}, + {0x25, 0x44, 0xf2}, + {0x25, 0x45, 0x45}, + {0x25, 0x46, 0xf6}, + {0x25, 0x47, 0x3c}, + {0x25, 0x48, 0x06}, + {0x25, 0x49, 0xa5}, + {0x25, 0x4a, 0xda}, + {0x25, 0x4b, 0x64}, + {0x25, 0x4c, 0x0d}, + {0x25, 0x4d, 0xba}, + {0x25, 0x4e, 0x09}, + {0x25, 0x4f, 0xc4}, + {0x25, 0x50, 0xfa}, + {0x25, 0x51, 0x41}, + {0x25, 0x52, 0x23}, + {0x25, 0x53, 0xae}, + {0x25, 0x54, 0x06}, // Biquad - BQ10 Left - Filter: Equalizer (Q Factor) Frequency: 1250 Hz Gain: -14dB QVal: 0.8 Bandwidth: 1000 Hz + {0x25, 0x55, 0xb1}, + {0x25, 0x56, 0x94}, + {0x25, 0x57, 0x6b}, + {0x25, 0x58, 0xf3}, + {0x25, 0x59, 0x4e}, + {0x25, 0x5a, 0x76}, + {0x25, 0x5b, 0x10}, + {0x25, 0x5c, 0x06}, + {0x25, 0x5d, 0x0a}, + {0x25, 0x5e, 0xdd}, + {0x25, 0x5f, 0x4e}, + {0x25, 0x60, 0x0c}, + {0x25, 0x61, 0xb1}, + {0x25, 0x62, 0x89}, + {0x25, 0x63, 0xf0}, + {0x25, 0x64, 0xfb}, + {0x25, 0x65, 0x43}, + {0x25, 0x66, 0x8e}, + {0x25, 0x67, 0x47}, + {0x25, 0x68, 0x05}, // Biquad - BQ11 Left - Filter: Equalizer (Q Factor) Frequency: 2000 Hz Gain: -14dB QVal: 0.7 Bandwidth: 1000 Hz + {0x25, 0x69, 0xf4}, + {0x25, 0x6a, 0xe7}, + {0x25, 0x6b, 0x66}, + {0x25, 0x6c, 0xf5}, + {0x25, 0x6d, 0x32}, + {0x25, 0x6e, 0xd3}, + {0x25, 0x6f, 0xaa}, + {0x25, 0x70, 0x04}, + {0x25, 0x71, 0xf0}, + {0x25, 0x72, 0x21}, + {0x25, 0x73, 0x3e}, + {0x25, 0x74, 0x0a}, + {0x25, 0x75, 0xcd}, + {0x25, 0x76, 0x2c}, + {0x25, 0x77, 0x56}, + {0x25, 0x78, 0xfd}, + {0x25, 0x79, 0x1a}, + {0x25, 0x7a, 0xf7}, + {0x25, 0x7b, 0x5b}, + {0x25, 0x7c, 0x05}, // Biquad - BQ12 Left - Filter: Equalizer (Q Factor) Frequency: 3150 Hz Gain: -14dB QVal: 0.7 Bandwidth: 1000 Hz + {0x25, 0x7d, 0x47}, + {0x25, 0x7e, 0xd9}, + {0x25, 0x7f, 0x42}, + {0x26, 0x08, 0xf6}, + {0x26, 0x09, 0xfd}, + {0x26, 0x0a, 0x41}, + {0x26, 0x0b, 0x75}, + {0x26, 0x0c, 0x03}, + {0x26, 0x0d, 0xec}, + {0x26, 0x0e, 0xcd}, + {0x26, 0x0f, 0x95}, + {0x26, 0x10, 0x09}, + {0x26, 0x11, 0x02}, + {0x26, 0x12, 0xbe}, + {0x26, 0x13, 0x8b}, + {0x26, 0x14, 0xfe}, + {0x26, 0x15, 0xcb}, + {0x26, 0x16, 0x59}, + {0x26, 0x17, 0x2a}, + {0x26, 0x18, 0x04}, // Biquad - BQ13 Left - Filter: Equalizer (Q Factor) Frequency: 5000 Hz Gain: -14dB QVal: 0.6 Bandwidth: 1000 Hz + {0x26, 0x19, 0x4d}, + {0x26, 0x1a, 0x4a}, + {0x26, 0x1b, 0x12}, + {0x26, 0x1c, 0xf9}, + {0x26, 0x1d, 0x99}, + {0x26, 0x1e, 0x38}, + {0x26, 0x1f, 0x47}, + {0x26, 0x20, 0x02}, + {0x26, 0x21, 0x75}, + {0x26, 0x22, 0x55}, + {0x26, 0x23, 0xb7}, + {0x26, 0x24, 0x06}, + {0x26, 0x25, 0x66}, + {0x26, 0x26, 0xc7}, + {0x26, 0x27, 0xb9}, + {0x26, 0x28, 0x01}, + {0x26, 0x29, 0x3d}, + {0x26, 0x2a, 0x60}, + {0x26, 0x2b, 0x37}, + {0x26, 0x2c, 0x03}, // Biquad - BQ14 Left - Filter: Equalizer (Q Factor) Frequency: 8000 Hz Gain: -14dB QVal: 0.6 Bandwidth: 1000 Hz + {0x26, 0x2d, 0x9b}, + {0x26, 0x2e, 0x0c}, + {0x26, 0x2f, 0x56}, + {0x26, 0x30, 0xfb}, + {0x26, 0x31, 0xa6}, + {0x26, 0x32, 0xe9}, + {0x26, 0x33, 0x1a}, + {0x26, 0x34, 0x01}, + {0x26, 0x35, 0x6a}, + {0x26, 0x36, 0x3c}, + {0x26, 0x37, 0xa0}, + {0x26, 0x38, 0x04}, + {0x26, 0x39, 0x59}, + {0x26, 0x3a, 0x16}, + {0x26, 0x3b, 0xe6}, + {0x26, 0x3c, 0x02}, + {0x26, 0x3d, 0xfa}, + {0x26, 0x3e, 0xb7}, + {0x26, 0x3f, 0x0b}, + {0x26, 0x40, 0x02}, // Biquad - BQ15 Left - Filter: Equalizer (Q Factor) Frequency: 16000 Hz Gain: -14dB QVal: 0.5 Bandwidth: 1000 Hz + {0x26, 0x41, 0x9e}, + {0x26, 0x42, 0xfe}, + {0x26, 0x43, 0xca}, + {0x26, 0x44, 0xfe}, + {0x26, 0x45, 0xb8}, + {0x26, 0x46, 0x3c}, + {0x26, 0x47, 0xb7}, + {0x26, 0x48, 0xff}, + {0x26, 0x49, 0xf0}, + {0x26, 0x4a, 0x87}, + {0x26, 0x4b, 0xc8}, + {0x26, 0x4c, 0x01}, + {0x26, 0x4d, 0x47}, + {0x26, 0x4e, 0xc3}, + {0x26, 0x4f, 0x49}, + {0x26, 0x50, 0x05}, + {0x26, 0x51, 0x70}, + {0x26, 0x52, 0x79}, + {0x26, 0x53, 0x6e}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_left_md[TAS5805M_EQ_REG_PER_STEP] = { + {0x24, 0x18, 0x07}, // Biquad - BQ1 Left - Filter: Equalizer (Q Factor) Frequency: 20 Hz Gain: -13dB QVal: 2 Bandwidth: 1000 Hz + {0x24, 0x19, 0xfd}, + {0x24, 0x1a, 0xae}, + {0x24, 0x1b, 0x0e}, + {0x24, 0x1c, 0xf0}, + {0x24, 0x1d, 0x05}, + {0x24, 0x1e, 0xfb}, + {0x24, 0x1f, 0x70}, + {0x24, 0x20, 0x07}, + {0x24, 0x21, 0xfc}, + {0x24, 0x22, 0x57}, + {0x24, 0x23, 0x69}, + {0x24, 0x24, 0x0f}, + {0x24, 0x25, 0xfa}, + {0x24, 0x26, 0x04}, + {0x24, 0x27, 0x90}, + {0x24, 0x28, 0xf8}, + {0x24, 0x29, 0x05}, + {0x24, 0x2a, 0xfa}, + {0x24, 0x2b, 0x8a}, + {0x24, 0x2c, 0x07}, // Biquad - BQ2 Left - Filter: Equalizer (Q Factor) Frequency: 31.5 Hz Gain: -13dB QVal: 2 Bandwidth: 1000 Hz + {0x24, 0x2d, 0xfc}, + {0x24, 0x2e, 0x59}, + {0x24, 0x2f, 0x51}, + {0x24, 0x30, 0xf0}, + {0x24, 0x31, 0x09}, + {0x24, 0x32, 0x6a}, + {0x24, 0x33, 0xcd}, + {0x24, 0x34, 0x07}, + {0x24, 0x35, 0xfa}, + {0x24, 0x36, 0x3e}, + {0x24, 0x37, 0x1b}, + {0x24, 0x38, 0x0f}, + {0x24, 0x39, 0xf6}, + {0x24, 0x3a, 0x95}, + {0x24, 0x3b, 0x33}, + {0x24, 0x3c, 0xf8}, + {0x24, 0x3d, 0x09}, + {0x24, 0x3e, 0x68}, + {0x24, 0x3f, 0x94}, + {0x24, 0x40, 0x07}, // Biquad - BQ3 Left - Filter: Equalizer (Q Factor) Frequency: 50 Hz Gain: -13dB QVal: 1.5 Bandwidth: 1000 Hz + {0x24, 0x41, 0xf8}, + {0x24, 0x42, 0x4a}, + {0x24, 0x43, 0xe6}, + {0x24, 0x44, 0xf0}, + {0x24, 0x45, 0x13}, + {0x24, 0x46, 0xe2}, + {0x24, 0x47, 0x11}, + {0x24, 0x48, 0x07}, + {0x24, 0x49, 0xf3}, + {0x24, 0x4a, 0xd8}, + {0x24, 0x4b, 0xa0}, + {0x24, 0x4c, 0x0f}, + {0x24, 0x4d, 0xec}, + {0x24, 0x4e, 0x1d}, + {0x24, 0x4f, 0xef}, + {0x24, 0x50, 0xf8}, + {0x24, 0x51, 0x13}, + {0x24, 0x52, 0xdc}, + {0x24, 0x53, 0x7a}, + {0x24, 0x54, 0x07}, // Biquad - BQ4 Left - Filter: Equalizer (Q Factor) Frequency: 80 Hz Gain: -13dB QVal: 1.5 Bandwidth: 1000 Hz + {0x24, 0x55, 0xf3}, + {0x24, 0x56, 0xb4}, + {0x24, 0x57, 0x32}, + {0x24, 0x58, 0xf0}, + {0x24, 0x59, 0x1f}, + {0x24, 0x5a, 0xbd}, + {0x24, 0x5b, 0xd4}, + {0x24, 0x5c, 0x07}, + {0x24, 0x5d, 0xec}, + {0x24, 0x5e, 0x9c}, + {0x24, 0x5f, 0x3e}, + {0x24, 0x60, 0x0f}, + {0x24, 0x61, 0xe0}, + {0x24, 0x62, 0x42}, + {0x24, 0x63, 0x2c}, + {0x24, 0x64, 0xf8}, + {0x24, 0x65, 0x1f}, + {0x24, 0x66, 0xaf}, + {0x24, 0x67, 0x90}, + {0x24, 0x68, 0x07}, // Biquad - BQ5 Left - Filter: Equalizer (Q Factor) Frequency: 125 Hz Gain: -13dB QVal: 1 Bandwidth: 1000 Hz + {0x24, 0x69, 0xe3}, + {0x24, 0x6a, 0x7a}, + {0x24, 0x6b, 0x3b}, + {0x24, 0x6c, 0xf0}, + {0x24, 0x6d, 0x49}, + {0x24, 0x6e, 0xa2}, + {0x24, 0x6f, 0x5a}, + {0x24, 0x70, 0x07}, + {0x24, 0x71, 0xd3}, + {0x24, 0x72, 0x05}, + {0x24, 0x73, 0xe1}, + {0x24, 0x74, 0x0f}, + {0x24, 0x75, 0xb6}, + {0x24, 0x76, 0x5d}, + {0x24, 0x77, 0xa6}, + {0x24, 0x78, 0xf8}, + {0x24, 0x79, 0x49}, + {0x24, 0x7a, 0x7f}, + {0x24, 0x7b, 0xe3}, + {0x24, 0x7c, 0x07}, // Biquad - BQ6 Left - Filter: Equalizer (Q Factor) Frequency: 200 Hz Gain: -13dB QVal: 1 Bandwidth: 1000 Hz + {0x24, 0x7d, 0xd2}, + {0x24, 0x7e, 0xd9}, + {0x24, 0x7f, 0x9e}, + {0x25, 0x08, 0xf0}, + {0x25, 0x09, 0x74}, + {0x25, 0x0a, 0xb0}, + {0x25, 0x0b, 0x06}, + {0x25, 0x0c, 0x07}, + {0x25, 0x0d, 0xb8}, + {0x25, 0x0e, 0xcd}, + {0x25, 0x0f, 0xa4}, + {0x25, 0x10, 0x0f}, + {0x25, 0x11, 0x8b}, + {0x25, 0x12, 0x4f}, + {0x25, 0x13, 0xfa}, + {0x25, 0x14, 0xf8}, + {0x25, 0x15, 0x74}, + {0x25, 0x16, 0x58}, + {0x25, 0x17, 0xbe}, + {0x25, 0x18, 0x07}, // Biquad - BQ7 Left - Filter: Equalizer (Q Factor) Frequency: 315 Hz Gain: -13dB QVal: 0.9 Bandwidth: 1000 Hz + {0x25, 0x19, 0xb2}, + {0x25, 0x1a, 0xa2}, + {0x25, 0x1b, 0xc1}, + {0x25, 0x1c, 0xf0}, + {0x25, 0x1d, 0xc8}, + {0x25, 0x1e, 0x30}, + {0x25, 0x1f, 0x09}, + {0x25, 0x20, 0x07}, + {0x25, 0x21, 0x86}, + {0x25, 0x22, 0x01}, + {0x25, 0x23, 0x35}, + {0x25, 0x24, 0x0f}, + {0x25, 0x25, 0x37}, + {0x25, 0x26, 0xcf}, + {0x25, 0x27, 0xf7}, + {0x25, 0x28, 0xf8}, + {0x25, 0x29, 0xc7}, + {0x25, 0x2a, 0x5c}, + {0x25, 0x2b, 0x0b}, + {0x25, 0x2c, 0x07}, // Biquad - BQ8 Left - Filter: Equalizer (Q Factor) Frequency: 500 Hz Gain: -13dB QVal: 0.9 Bandwidth: 1000 Hz + {0x25, 0x2d, 0x88}, + {0x25, 0x2e, 0x9c}, + {0x25, 0x2f, 0xc0}, + {0x25, 0x30, 0xf1}, + {0x25, 0x31, 0x35}, + {0x25, 0x32, 0xad}, + {0x25, 0x33, 0x8a}, + {0x25, 0x34, 0x07}, + {0x25, 0x35, 0x43}, + {0x25, 0x36, 0xbc}, + {0x25, 0x37, 0xf7}, + {0x25, 0x38, 0x0e}, + {0x25, 0x39, 0xca}, + {0x25, 0x3a, 0x52}, + {0x25, 0x3b, 0x76}, + {0x25, 0x3c, 0xf9}, + {0x25, 0x3d, 0x33}, + {0x25, 0x3e, 0xa6}, + {0x25, 0x3f, 0x49}, + {0x25, 0x40, 0x07}, // Biquad - BQ9 Left - Filter: Equalizer (Q Factor) Frequency: 800 Hz Gain: -13dB QVal: 0.8 Bandwidth: 1000 Hz + {0x25, 0x41, 0x35}, + {0x25, 0x42, 0x48}, + {0x25, 0x43, 0x70}, + {0x25, 0x44, 0xf2}, + {0x25, 0x45, 0x0f}, + {0x25, 0x46, 0x47}, + {0x25, 0x47, 0x2c}, + {0x25, 0x48, 0x06}, + {0x25, 0x49, 0xc0}, + {0x25, 0x4a, 0x56}, + {0x25, 0x4b, 0x28}, + {0x25, 0x4c, 0x0d}, + {0x25, 0x4d, 0xf0}, + {0x25, 0x4e, 0xb8}, + {0x25, 0x4f, 0xd4}, + {0x25, 0x50, 0xfa}, + {0x25, 0x51, 0x0a}, + {0x25, 0x52, 0x61}, + {0x25, 0x53, 0x68}, + {0x25, 0x54, 0x06}, // Biquad - BQ10 Left - Filter: Equalizer (Q Factor) Frequency: 1250 Hz Gain: -13dB QVal: 0.8 Bandwidth: 1000 Hz + {0x25, 0x55, 0xd8}, + {0x25, 0x56, 0x74}, + {0x25, 0x57, 0xd4}, + {0x25, 0x58, 0xf3}, + {0x25, 0x59, 0x04}, + {0x25, 0x5a, 0xbc}, + {0x25, 0x5b, 0xdc}, + {0x25, 0x5c, 0x06}, + {0x25, 0x5d, 0x2d}, + {0x25, 0x5e, 0xf5}, + {0x25, 0x5f, 0x70}, + {0x25, 0x60, 0x0c}, + {0x25, 0x61, 0xfb}, + {0x25, 0x62, 0x43}, + {0x25, 0x63, 0x24}, + {0x25, 0x64, 0xfa}, + {0x25, 0x65, 0xf9}, + {0x25, 0x66, 0x95}, + {0x25, 0x67, 0xbd}, + {0x25, 0x68, 0x06}, // Biquad - BQ11 Left - Filter: Equalizer (Q Factor) Frequency: 2000 Hz Gain: -13dB QVal: 0.7 Bandwidth: 1000 Hz + {0x25, 0x69, 0x2b}, + {0x25, 0x6a, 0xb8}, + {0x25, 0x6b, 0x63}, + {0x25, 0x6c, 0xf4}, + {0x25, 0x6d, 0xcf}, + {0x25, 0x6e, 0x6d}, + {0x25, 0x6f, 0x0d}, + {0x25, 0x70, 0x05}, + {0x25, 0x71, 0x1d}, + {0x25, 0x72, 0x92}, + {0x25, 0x73, 0x72}, + {0x25, 0x74, 0x0b}, + {0x25, 0x75, 0x30}, + {0x25, 0x76, 0x92}, + {0x25, 0x77, 0xf3}, + {0x25, 0x78, 0xfc}, + {0x25, 0x79, 0xb6}, + {0x25, 0x7a, 0xb5}, + {0x25, 0x7b, 0x2b}, + {0x25, 0x7c, 0x05}, // Biquad - BQ12 Left - Filter: Equalizer (Q Factor) Frequency: 3150 Hz Gain: -13dB QVal: 0.7 Bandwidth: 1000 Hz + {0x25, 0x7d, 0x89}, + {0x25, 0x7e, 0x4c}, + {0x25, 0x7f, 0x9d}, + {0x26, 0x08, 0xf6}, + {0x26, 0x09, 0x8d}, + {0x26, 0x0a, 0x92}, + {0x26, 0x0b, 0xbe}, + {0x26, 0x0c, 0x04}, + {0x26, 0x0d, 0x1d}, + {0x26, 0x0e, 0x73}, + {0x26, 0x0f, 0x83}, + {0x26, 0x10, 0x09}, + {0x26, 0x11, 0x72}, + {0x26, 0x12, 0x6d}, + {0x26, 0x13, 0x42}, + {0x26, 0x14, 0xfe}, + {0x26, 0x15, 0x59}, + {0x26, 0x16, 0x3f}, + {0x26, 0x17, 0xe0}, + {0x26, 0x18, 0x04}, // Biquad - BQ13 Left - Filter: Equalizer (Q Factor) Frequency: 5000 Hz Gain: -13dB QVal: 0.6 Bandwidth: 1000 Hz + {0x26, 0x19, 0x97}, + {0x26, 0x1a, 0x15}, + {0x26, 0x1b, 0xf5}, + {0x26, 0x1c, 0xf9}, + {0x26, 0x1d, 0x2b}, + {0x26, 0x1e, 0x68}, + {0x26, 0x1f, 0x19}, + {0x26, 0x20, 0x02}, + {0x26, 0x21, 0x9f}, + {0x26, 0x22, 0x81}, + {0x26, 0x23, 0x88}, + {0x26, 0x24, 0x06}, + {0x26, 0x25, 0xd4}, + {0x26, 0x26, 0x97}, + {0x26, 0x27, 0xe7}, + {0x26, 0x28, 0x00}, + {0x26, 0x29, 0xc9}, + {0x26, 0x2a, 0x68}, + {0x26, 0x2b, 0x83}, + {0x26, 0x2c, 0x03}, // Biquad - BQ14 Left - Filter: Equalizer (Q Factor) Frequency: 8000 Hz Gain: -13dB QVal: 0.6 Bandwidth: 1000 Hz + {0x26, 0x2d, 0xe5}, + {0x26, 0x2e, 0x7c}, + {0x26, 0x2f, 0x35}, + {0x26, 0x30, 0xfb}, + {0x26, 0x31, 0x4d}, + {0x26, 0x32, 0x25}, + {0x26, 0x33, 0xec}, + {0x26, 0x34, 0x01}, + {0x26, 0x35, 0x87}, + {0x26, 0x36, 0x72}, + {0x26, 0x37, 0xd2}, + {0x26, 0x38, 0x04}, + {0x26, 0x39, 0xb2}, + {0x26, 0x3a, 0xda}, + {0x26, 0x3b, 0x14}, + {0x26, 0x3c, 0x02}, + {0x26, 0x3d, 0x93}, + {0x26, 0x3e, 0x10}, + {0x26, 0x3f, 0xf9}, + {0x26, 0x40, 0x02}, // Biquad - BQ15 Left - Filter: Equalizer (Q Factor) Frequency: 16000 Hz Gain: -13dB QVal: 0.5 Bandwidth: 1000 Hz + {0x26, 0x41, 0xe2}, + {0x26, 0x42, 0x72}, + {0x26, 0x43, 0xe0}, + {0x26, 0x44, 0xfe}, + {0x26, 0x45, 0x97}, + {0x26, 0x46, 0x49}, + {0x26, 0x47, 0xba}, + {0x26, 0x48, 0xff}, + {0x26, 0x49, 0xee}, + {0x26, 0x4a, 0xf9}, + {0x26, 0x4b, 0xac}, + {0x26, 0x4c, 0x01}, + {0x26, 0x4d, 0x68}, + {0x26, 0x4e, 0xb6}, + {0x26, 0x4f, 0x46}, + {0x26, 0x50, 0x05}, + {0x26, 0x51, 0x2e}, + {0x26, 0x52, 0x93}, + {0x26, 0x53, 0x74}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_left_mc[TAS5805M_EQ_REG_PER_STEP] = { + {0x24, 0x18, 0x07}, // Biquad - BQ1 Left - Filter: Equalizer (Q Factor) Frequency: 20 Hz Gain: -12dB QVal: 2 Bandwidth: 1000 Hz + {0x24, 0x19, 0xfe}, + {0x24, 0x1a, 0x01}, + {0x24, 0x1b, 0x32}, + {0x24, 0x1c, 0xf0}, + {0x24, 0x1d, 0x05}, + {0x24, 0x1e, 0x55}, + {0x24, 0x1f, 0x35}, + {0x24, 0x20, 0x07}, + {0x24, 0x21, 0xfc}, + {0x24, 0x22, 0xaa}, + {0x24, 0x23, 0x7f}, + {0x24, 0x24, 0x0f}, + {0x24, 0x25, 0xfa}, + {0x24, 0x26, 0xaa}, + {0x24, 0x27, 0xcb}, + {0x24, 0x28, 0xf8}, + {0x24, 0x29, 0x05}, + {0x24, 0x2a, 0x54}, + {0x24, 0x2b, 0x4f}, + {0x24, 0x2c, 0x07}, // Biquad - BQ2 Left - Filter: Equalizer (Q Factor) Frequency: 31.5 Hz Gain: -12dB QVal: 2 Bandwidth: 1000 Hz + {0x24, 0x2d, 0xfc}, + {0x24, 0x2e, 0xdc}, + {0x24, 0x2f, 0x15}, + {0x24, 0x30, 0xf0}, + {0x24, 0x31, 0x08}, + {0x24, 0x32, 0x65}, + {0x24, 0x33, 0x68}, + {0x24, 0x34, 0x07}, + {0x24, 0x35, 0xfa}, + {0x24, 0x36, 0xc0}, + {0x24, 0x37, 0xbc}, + {0x24, 0x38, 0x0f}, + {0x24, 0x39, 0xf7}, + {0x24, 0x3a, 0x9a}, + {0x24, 0x3b, 0x98}, + {0x24, 0x3c, 0xf8}, + {0x24, 0x3d, 0x08}, + {0x24, 0x3e, 0x63}, + {0x24, 0x3f, 0x2f}, + {0x24, 0x40, 0x07}, // Biquad - BQ3 Left - Filter: Equalizer (Q Factor) Frequency: 50 Hz Gain: -12dB QVal: 1.5 Bandwidth: 1000 Hz + {0x24, 0x41, 0xf9}, + {0x24, 0x42, 0x5e}, + {0x24, 0x43, 0x78}, + {0x24, 0x44, 0xf0}, + {0x24, 0x45, 0x11}, + {0x24, 0x46, 0xbb}, + {0x24, 0x47, 0x87}, + {0x24, 0x48, 0x07}, + {0x24, 0x49, 0xf4}, + {0x24, 0x4a, 0xeb}, + {0x24, 0x4b, 0x98}, + {0x24, 0x4c, 0x0f}, + {0x24, 0x4d, 0xee}, + {0x24, 0x4e, 0x44}, + {0x24, 0x4f, 0x79}, + {0x24, 0x50, 0xf8}, + {0x24, 0x51, 0x11}, + {0x24, 0x52, 0xb5}, + {0x24, 0x53, 0xf0}, + {0x24, 0x54, 0x07}, // Biquad - BQ4 Left - Filter: Equalizer (Q Factor) Frequency: 80 Hz Gain: -12dB QVal: 1.5 Bandwidth: 1000 Hz + {0x24, 0x55, 0xf5}, + {0x24, 0x56, 0x6a}, + {0x24, 0x57, 0xfa}, + {0x24, 0x58, 0xf0}, + {0x24, 0x59, 0x1c}, + {0x24, 0x5a, 0x51}, + {0x24, 0x5b, 0xcd}, + {0x24, 0x5c, 0x07}, + {0x24, 0x5d, 0xee}, + {0x24, 0x5e, 0x51}, + {0x24, 0x5f, 0x7f}, + {0x24, 0x60, 0x0f}, + {0x24, 0x61, 0xe3}, + {0x24, 0x62, 0xae}, + {0x24, 0x63, 0x33}, + {0x24, 0x64, 0xf8}, + {0x24, 0x65, 0x1c}, + {0x24, 0x66, 0x43}, + {0x24, 0x67, 0x87}, + {0x24, 0x68, 0x07}, // Biquad - BQ5 Left - Filter: Equalizer (Q Factor) Frequency: 125 Hz Gain: -12dB QVal: 1 Bandwidth: 1000 Hz + {0x24, 0x69, 0xe7}, + {0x24, 0x6a, 0x6d}, + {0x24, 0x6b, 0x10}, + {0x24, 0x6c, 0xf0}, + {0x24, 0x6d, 0x41}, + {0x24, 0x6e, 0xc4}, + {0x24, 0x6f, 0xff}, + {0x24, 0x70, 0x07}, + {0x24, 0x71, 0xd6}, + {0x24, 0x72, 0xf0}, + {0x24, 0x73, 0x79}, + {0x24, 0x74, 0x0f}, + {0x24, 0x75, 0xbe}, + {0x24, 0x76, 0x3b}, + {0x24, 0x77, 0x01}, + {0x24, 0x78, 0xf8}, + {0x24, 0x79, 0x41}, + {0x24, 0x7a, 0xa2}, + {0x24, 0x7b, 0x77}, + {0x24, 0x7c, 0x07}, // Biquad - BQ6 Left - Filter: Equalizer (Q Factor) Frequency: 200 Hz Gain: -12dB QVal: 1 Bandwidth: 1000 Hz + {0x24, 0x7d, 0xd9}, + {0x24, 0x7e, 0x0e}, + {0x24, 0x7f, 0x5a}, + {0x25, 0x08, 0xf0}, + {0x25, 0x09, 0x68}, + {0x25, 0x0a, 0x5b}, + {0x25, 0x0b, 0x7d}, + {0x25, 0x0c, 0x07}, + {0x25, 0x0d, 0xbe}, + {0x25, 0x0e, 0xed}, + {0x25, 0x0f, 0xb7}, + {0x25, 0x10, 0x0f}, + {0x25, 0x11, 0x97}, + {0x25, 0x12, 0xa4}, + {0x25, 0x13, 0x83}, + {0x25, 0x14, 0xf8}, + {0x25, 0x15, 0x68}, + {0x25, 0x16, 0x03}, + {0x25, 0x17, 0xef}, + {0x25, 0x18, 0x07}, // Biquad - BQ7 Left - Filter: Equalizer (Q Factor) Frequency: 315 Hz Gain: -12dB QVal: 0.9 Bandwidth: 1000 Hz + {0x25, 0x19, 0xbd}, + {0x25, 0x1a, 0x1f}, + {0x25, 0x1b, 0x31}, + {0x25, 0x1c, 0xf0}, + {0x25, 0x1d, 0xb3}, + {0x25, 0x1e, 0x75}, + {0x25, 0x1f, 0x15}, + {0x25, 0x20, 0x07}, + {0x25, 0x21, 0x90}, + {0x25, 0x22, 0x40}, + {0x25, 0x23, 0xd9}, + {0x25, 0x24, 0x0f}, + {0x25, 0x25, 0x4c}, + {0x25, 0x26, 0x8a}, + {0x25, 0x27, 0xeb}, + {0x25, 0x28, 0xf8}, + {0x25, 0x29, 0xb2}, + {0x25, 0x2a, 0x9f}, + {0x25, 0x2b, 0xf5}, + {0x25, 0x2c, 0x07}, // Biquad - BQ8 Left - Filter: Equalizer (Q Factor) Frequency: 500 Hz Gain: -12dB QVal: 0.9 Bandwidth: 1000 Hz + {0x25, 0x2d, 0x98}, + {0x25, 0x2e, 0x7e}, + {0x25, 0x2f, 0xc3}, + {0x25, 0x30, 0xf1}, + {0x25, 0x31, 0x16}, + {0x25, 0x32, 0x7e}, + {0x25, 0x33, 0xfe}, + {0x25, 0x34, 0x07}, + {0x25, 0x35, 0x53}, + {0x25, 0x36, 0x0d}, + {0x25, 0x37, 0xc6}, + {0x25, 0x38, 0x0e}, + {0x25, 0x39, 0xe9}, + {0x25, 0x3a, 0x81}, + {0x25, 0x3b, 0x02}, + {0x25, 0x3c, 0xf9}, + {0x25, 0x3d, 0x14}, + {0x25, 0x3e, 0x73}, + {0x25, 0x3f, 0x77}, + {0x25, 0x40, 0x07}, // Biquad - BQ9 Left - Filter: Equalizer (Q Factor) Frequency: 800 Hz Gain: -12dB QVal: 0.8 Bandwidth: 1000 Hz + {0x25, 0x41, 0x4f}, + {0x25, 0x42, 0x3c}, + {0x25, 0x43, 0x4e}, + {0x25, 0x44, 0xf1}, + {0x25, 0x45, 0xdd}, + {0x25, 0x46, 0x16}, + {0x25, 0x47, 0x22}, + {0x25, 0x48, 0x06}, + {0x25, 0x49, 0xd8}, + {0x25, 0x4a, 0xa4}, + {0x25, 0x4b, 0xf6}, + {0x25, 0x4c, 0x0e}, + {0x25, 0x4d, 0x22}, + {0x25, 0x4e, 0xe9}, + {0x25, 0x4f, 0xde}, + {0x25, 0x50, 0xf9}, + {0x25, 0x51, 0xd8}, + {0x25, 0x52, 0x1e}, + {0x25, 0x53, 0xbb}, + {0x25, 0x54, 0x06}, // Biquad - BQ10 Left - Filter: Equalizer (Q Factor) Frequency: 1250 Hz Gain: -12dB QVal: 0.8 Bandwidth: 1000 Hz + {0x25, 0x55, 0xfc}, + {0x25, 0x56, 0x9f}, + {0x25, 0x57, 0x5e}, + {0x25, 0x58, 0xf2}, + {0x25, 0x59, 0xc0}, + {0x25, 0x5a, 0x27}, + {0x25, 0x5b, 0x78}, + {0x25, 0x5c, 0x06}, + {0x25, 0x5d, 0x4e}, + {0x25, 0x5e, 0x9b}, + {0x25, 0x5f, 0x35}, + {0x25, 0x60, 0x0d}, + {0x25, 0x61, 0x3f}, + {0x25, 0x62, 0xd8}, + {0x25, 0x63, 0x88}, + {0x25, 0x64, 0xfa}, + {0x25, 0x65, 0xb4}, + {0x25, 0x66, 0xc5}, + {0x25, 0x67, 0x6c}, + {0x25, 0x68, 0x06}, // Biquad - BQ11 Left - Filter: Equalizer (Q Factor) Frequency: 2000 Hz Gain: -12dB QVal: 0.7 Bandwidth: 1000 Hz + {0x25, 0x69, 0x60}, + {0x25, 0x6a, 0x01}, + {0x25, 0x6b, 0xbb}, + {0x25, 0x6c, 0xf4}, + {0x25, 0x6d, 0x70}, + {0x25, 0x6e, 0x9c}, + {0x25, 0x6f, 0xd6}, + {0x25, 0x70, 0x05}, + {0x25, 0x71, 0x48}, + {0x25, 0x72, 0xea}, + {0x25, 0x73, 0xc3}, + {0x25, 0x74, 0x0b}, + {0x25, 0x75, 0x8f}, + {0x25, 0x76, 0x63}, + {0x25, 0x77, 0x2a}, + {0x25, 0x78, 0xfc}, + {0x25, 0x79, 0x57}, + {0x25, 0x7a, 0x13}, + {0x25, 0x7b, 0x82}, + {0x25, 0x7c, 0x05}, // Biquad - BQ12 Left - Filter: Equalizer (Q Factor) Frequency: 3150 Hz Gain: -12dB QVal: 0.7 Bandwidth: 1000 Hz + {0x25, 0x7d, 0xc9}, + {0x25, 0x7e, 0x36}, + {0x25, 0x7f, 0xe1}, + {0x26, 0x08, 0xf6}, + {0x26, 0x09, 0x20}, + {0x26, 0x0a, 0x82}, + {0x26, 0x0b, 0xc7}, + {0x26, 0x0c, 0x04}, + {0x26, 0x0d, 0x4c}, + {0x26, 0x0e, 0xf5}, + {0x26, 0x0f, 0x45}, + {0x26, 0x10, 0x09}, + {0x26, 0x11, 0xdf}, + {0x26, 0x12, 0x7d}, + {0x26, 0x13, 0x39}, + {0x26, 0x14, 0xfd}, + {0x26, 0x15, 0xe9}, + {0x26, 0x16, 0xd3}, + {0x26, 0x17, 0xd9}, + {0x26, 0x18, 0x04}, // Biquad - BQ13 Left - Filter: Equalizer (Q Factor) Frequency: 5000 Hz Gain: -12dB QVal: 0.6 Bandwidth: 1000 Hz + {0x26, 0x19, 0xe1}, + {0x26, 0x1a, 0xb8}, + {0x26, 0x1b, 0xb8}, + {0x26, 0x1c, 0xf8}, + {0x26, 0x1d, 0xbc}, + {0x26, 0x1e, 0x58}, + {0x26, 0x1f, 0x2b}, + {0x26, 0x20, 0x02}, + {0x26, 0x21, 0xca}, + {0x26, 0x22, 0x28}, + {0x26, 0x23, 0x25}, + {0x26, 0x24, 0x07}, + {0x26, 0x25, 0x43}, + {0x26, 0x26, 0xa7}, + {0x26, 0x27, 0xd5}, + {0x26, 0x28, 0x00}, + {0x26, 0x29, 0x54}, + {0x26, 0x2a, 0x1f}, + {0x26, 0x2b, 0x24}, + {0x26, 0x2c, 0x04}, // Biquad - BQ14 Left - Filter: Equalizer (Q Factor) Frequency: 8000 Hz Gain: -12dB QVal: 0.6 Bandwidth: 1000 Hz + {0x26, 0x2d, 0x32}, + {0x26, 0x2e, 0xba}, + {0x26, 0x2f, 0x9c}, + {0x26, 0x30, 0xfa}, + {0x26, 0x31, 0xf0}, + {0x26, 0x32, 0x00}, + {0x26, 0x33, 0x47}, + {0x26, 0x34, 0x01}, + {0x26, 0x35, 0xa5}, + {0x26, 0x36, 0xc3}, + {0x26, 0x37, 0x00}, + {0x26, 0x38, 0x05}, + {0x26, 0x39, 0x0f}, + {0x26, 0x3a, 0xff}, + {0x26, 0x3b, 0xb9}, + {0x26, 0x3c, 0x02}, + {0x26, 0x3d, 0x27}, + {0x26, 0x3e, 0x82}, + {0x26, 0x3f, 0x65}, + {0x26, 0x40, 0x03}, // Biquad - BQ15 Left - Filter: Equalizer (Q Factor) Frequency: 16000 Hz Gain: -12dB QVal: 0.5 Bandwidth: 1000 Hz + {0x26, 0x41, 0x2b}, + {0x26, 0x42, 0x1f}, + {0x26, 0x43, 0x0f}, + {0x26, 0x44, 0xfe}, + {0x26, 0x45, 0x73}, + {0x26, 0x46, 0xca}, + {0x26, 0x47, 0x18}, + {0x26, 0x48, 0xff}, + {0x26, 0x49, 0xed}, + {0x26, 0x4a, 0x4c}, + {0x26, 0x4b, 0xc2}, + {0x26, 0x4c, 0x01}, + {0x26, 0x4d, 0x8c}, + {0x26, 0x4e, 0x35}, + {0x26, 0x4f, 0xe8}, + {0x26, 0x50, 0x04}, + {0x26, 0x51, 0xe7}, + {0x26, 0x52, 0x94}, + {0x26, 0x53, 0x2f}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_left_mb[TAS5805M_EQ_REG_PER_STEP] = { + + {0x24, 0x18, 0x07}, // Biquad - BQ1 Left - Filter: Equalizer (Q Factor) Frequency: 20 Hz Gain: -11dB QVal: 2 Bandwidth: 1000 Hz + {0x24, 0x19, 0xfe}, + {0x24, 0x1a, 0x4b}, + {0x24, 0x1b, 0x51}, + {0x24, 0x1c, 0xf0}, + {0x24, 0x1d, 0x04}, + {0x24, 0x1e, 0xc1}, + {0x24, 0x1f, 0x03}, + {0x24, 0x20, 0x07}, + {0x24, 0x21, 0xfc}, + {0x24, 0x22, 0xf4}, + {0x24, 0x23, 0x92}, + {0x24, 0x24, 0x0f}, + {0x24, 0x25, 0xfb}, + {0x24, 0x26, 0x3e}, + {0x24, 0x27, 0xfd}, + {0x24, 0x28, 0xf8}, + {0x24, 0x29, 0x04}, + {0x24, 0x2a, 0xc0}, + {0x24, 0x2b, 0x1d}, + {0x24, 0x2c, 0x07}, // Biquad - BQ2 Left - Filter: Equalizer (Q Factor) Frequency: 31.5 Hz Gain: -11dB QVal: 2 Bandwidth: 1000 Hz + {0x24, 0x2d, 0xfd}, + {0x24, 0x2e, 0x50}, + {0x24, 0x2f, 0xae}, + {0x24, 0x30, 0xf0}, + {0x24, 0x31, 0x07}, + {0x24, 0x32, 0x7c}, + {0x24, 0x33, 0x54}, + {0x24, 0x34, 0x07}, + {0x24, 0x35, 0xfb}, + {0x24, 0x36, 0x35}, + {0x24, 0x37, 0x37}, + {0x24, 0x38, 0x0f}, + {0x24, 0x39, 0xf8}, + {0x24, 0x3a, 0x83}, + {0x24, 0x3b, 0xac}, + {0x24, 0x3c, 0xf8}, + {0x24, 0x3d, 0x07}, + {0x24, 0x3e, 0x7a}, + {0x24, 0x3f, 0x1b}, + {0x24, 0x40, 0x07}, // Biquad - BQ3 Left - Filter: Equalizer (Q Factor) Frequency: 50 Hz Gain: -11dB QVal: 1.5 Bandwidth: 1000 Hz + {0x24, 0x41, 0xfa}, + {0x24, 0x42, 0x54}, + {0x24, 0x43, 0x51}, + {0x24, 0x44, 0xf0}, + {0x24, 0x45, 0x0f}, + {0x24, 0x46, 0xd0}, + {0x24, 0x47, 0x5f}, + {0x24, 0x48, 0x07}, + {0x24, 0x49, 0xf5}, + {0x24, 0x4a, 0xe0}, + {0x24, 0x4b, 0xe8}, + {0x24, 0x4c, 0x0f}, + {0x24, 0x4d, 0xf0}, + {0x24, 0x4e, 0x2f}, + {0x24, 0x4f, 0xa1}, + {0x24, 0x50, 0xf8}, + {0x24, 0x51, 0x0f}, + {0x24, 0x52, 0xca}, + {0x24, 0x53, 0xc7}, + {0x24, 0x54, 0x07}, // Biquad - BQ4 Left - Filter: Equalizer (Q Factor) Frequency: 80 Hz Gain: -11dB QVal: 1.5 Bandwidth: 1000 Hz + {0x24, 0x55, 0xf6}, + {0x24, 0x56, 0xf2}, + {0x24, 0x57, 0xab}, + {0x24, 0x58, 0xf0}, + {0x24, 0x59, 0x19}, + {0x24, 0x5a, 0x43}, + {0x24, 0x5b, 0xcc}, + {0x24, 0x5c, 0x07}, + {0x24, 0x5d, 0xef}, + {0x24, 0x5e, 0xd7}, + {0x24, 0x5f, 0xd2}, + {0x24, 0x60, 0x0f}, + {0x24, 0x61, 0xe6}, + {0x24, 0x62, 0xbc}, + {0x24, 0x63, 0x34}, + {0x24, 0x64, 0xf8}, + {0x24, 0x65, 0x19}, + {0x24, 0x66, 0x35}, + {0x24, 0x67, 0x83}, + {0x24, 0x68, 0x07}, // Biquad - BQ5 Left - Filter: Equalizer (Q Factor) Frequency: 125 Hz Gain: -11dB QVal: 1 Bandwidth: 1000 Hz + {0x24, 0x69, 0xea}, + {0x24, 0x6a, 0xf5}, + {0x24, 0x6b, 0x4d}, + {0x24, 0x6c, 0xf0}, + {0x24, 0x6d, 0x3a}, + {0x24, 0x6e, 0xbb}, + {0x24, 0x6f, 0xf2}, + {0x24, 0x70, 0x07}, + {0x24, 0x71, 0xda}, + {0x24, 0x72, 0x71}, + {0x24, 0x73, 0x58}, + {0x24, 0x74, 0x0f}, + {0x24, 0x75, 0xc5}, + {0x24, 0x76, 0x44}, + {0x24, 0x77, 0x0e}, + {0x24, 0x78, 0xf8}, + {0x24, 0x79, 0x3a}, + {0x24, 0x7a, 0x99}, + {0x24, 0x7b, 0x5b}, + {0x24, 0x7c, 0x07}, // Biquad - BQ6 Left - Filter: Equalizer (Q Factor) Frequency: 200 Hz Gain: -11dB QVal: 1 Bandwidth: 1000 Hz + {0x24, 0x7d, 0xde}, + {0x24, 0x7e, 0x9e}, + {0x24, 0x7f, 0xa2}, + {0x25, 0x08, 0xf0}, + {0x25, 0x09, 0x5d}, + {0x25, 0x0a, 0x4d}, + {0x25, 0x0b, 0xb0}, + {0x25, 0x0c, 0x07}, + {0x25, 0x0d, 0xc4}, + {0x25, 0x0e, 0x6b}, + {0x25, 0x0f, 0x7a}, + {0x25, 0x10, 0x0f}, + {0x25, 0x11, 0xa2}, + {0x25, 0x12, 0xb2}, + {0x25, 0x13, 0x50}, + {0x25, 0x14, 0xf8}, + {0x25, 0x15, 0x5c}, + {0x25, 0x16, 0xf5}, + {0x25, 0x17, 0xe4}, + {0x25, 0x18, 0x07}, // Biquad - BQ7 Left - Filter: Equalizer (Q Factor) Frequency: 315 Hz Gain: -11dB QVal: 0.9 Bandwidth: 1000 Hz + {0x25, 0x19, 0xc6}, + {0x25, 0x1a, 0x8f}, + {0x25, 0x1b, 0xe5}, + {0x25, 0x1c, 0xf0}, + {0x25, 0x1d, 0xa0}, + {0x25, 0x1e, 0xcb}, + {0x25, 0x1f, 0x6d}, + {0x25, 0x20, 0x07}, + {0x25, 0x21, 0x99}, + {0x25, 0x22, 0x7a}, + {0x25, 0x23, 0xd1}, + {0x25, 0x24, 0x0f}, + {0x25, 0x25, 0x5f}, + {0x25, 0x26, 0x34}, + {0x25, 0x27, 0x93}, + {0x25, 0x28, 0xf8}, + {0x25, 0x29, 0x9f}, + {0x25, 0x2a, 0xf5}, + {0x25, 0x2b, 0x4a}, + {0x25, 0x2c, 0x07}, // Biquad - BQ8 Left - Filter: Equalizer (Q Factor) Frequency: 500 Hz Gain: -11dB QVal: 0.9 Bandwidth: 1000 Hz + {0x25, 0x2d, 0xa6}, + {0x25, 0x2e, 0xdf}, + {0x25, 0x2f, 0x75}, + {0x25, 0x30, 0xf0}, + {0x25, 0x31, 0xfa}, + {0x25, 0x32, 0x44}, + {0x25, 0x33, 0xea}, + {0x25, 0x34, 0x07}, + {0x25, 0x35, 0x60}, + {0x25, 0x36, 0xeb}, + {0x25, 0x37, 0x07}, + {0x25, 0x38, 0x0f}, + {0x25, 0x39, 0x05}, + {0x25, 0x3a, 0xbb}, + {0x25, 0x3b, 0x16}, + {0x25, 0x3c, 0xf8}, + {0x25, 0x3d, 0xf8}, + {0x25, 0x3e, 0x35}, + {0x25, 0x3f, 0x84}, + {0x25, 0x40, 0x07}, // Biquad - BQ9 Left - Filter: Equalizer (Q Factor) Frequency: 800 Hz Gain: -11dB QVal: 0.8 Bandwidth: 1000 Hz + {0x25, 0x41, 0x66}, + {0x25, 0x42, 0xfd}, + {0x25, 0x43, 0x29}, + {0x25, 0x44, 0xf1}, + {0x25, 0x45, 0xaf}, + {0x25, 0x46, 0x25}, + {0x25, 0x47, 0xf1}, + {0x25, 0x48, 0x06}, + {0x25, 0x49, 0xee}, + {0x25, 0x4a, 0xe4}, + {0x25, 0x4b, 0x70}, + {0x25, 0x4c, 0x0e}, + {0x25, 0x4d, 0x50}, + {0x25, 0x4e, 0xda}, + {0x25, 0x4f, 0x0f}, + {0x25, 0x50, 0xf9}, + {0x25, 0x51, 0xaa}, + {0x25, 0x52, 0x1e}, + {0x25, 0x53, 0x67}, + {0x25, 0x54, 0x07}, // Biquad - BQ10 Left - Filter: Equalizer (Q Factor) Frequency: 1250 Hz Gain: -11dB QVal: 0.8 Bandwidth: 1000 Hz + {0x25, 0x55, 0x1e}, + {0x25, 0x56, 0x23}, + {0x25, 0x57, 0x28}, + {0x25, 0x58, 0xf2}, + {0x25, 0x59, 0x80}, + {0x25, 0x5a, 0x99}, + {0x25, 0x5b, 0x3b}, + {0x25, 0x5c, 0x06}, + {0x25, 0x5d, 0x6c}, + {0x25, 0x5e, 0xdc}, + {0x25, 0x5f, 0x43}, + {0x25, 0x60, 0x0d}, + {0x25, 0x61, 0x7f}, + {0x25, 0x62, 0x66}, + {0x25, 0x63, 0xc5}, + {0x25, 0x64, 0xfa}, + {0x25, 0x65, 0x75}, + {0x25, 0x66, 0x00}, + {0x25, 0x67, 0x96}, + {0x25, 0x68, 0x06}, // Biquad - BQ11 Left - Filter: Equalizer (Q Factor) Frequency: 2000 Hz Gain: -11dB QVal: 0.7 Bandwidth: 1000 Hz + {0x25, 0x69, 0x91}, + {0x25, 0x6a, 0x9c}, + {0x25, 0x6b, 0xe7}, + {0x25, 0x6c, 0xf4}, + {0x25, 0x6d, 0x16}, + {0x25, 0x6e, 0xa8}, + {0x25, 0x6f, 0xe3}, + {0x25, 0x70, 0x05}, + {0x25, 0x71, 0x72}, + {0x25, 0x72, 0x0a}, + {0x25, 0x73, 0x3f}, + {0x25, 0x74, 0x0b}, + {0x25, 0x75, 0xe9}, + {0x25, 0x76, 0x57}, + {0x25, 0x77, 0x1d}, + {0x25, 0x78, 0xfb}, + {0x25, 0x79, 0xfc}, + {0x25, 0x7a, 0x58}, + {0x25, 0x7b, 0xda}, + {0x25, 0x7c, 0x06}, // Biquad - BQ12 Left - Filter: Equalizer (Q Factor) Frequency: 3150 Hz Gain: -11dB QVal: 0.7 Bandwidth: 1000 Hz + {0x25, 0x7d, 0x07}, + {0x25, 0x7e, 0x3d}, + {0x25, 0x7f, 0x9b}, + {0x26, 0x08, 0xf5}, + {0x26, 0x09, 0xb6}, + {0x26, 0x0a, 0xab}, + {0x26, 0x0b, 0xe9}, + {0x26, 0x0c, 0x04}, + {0x26, 0x0d, 0x7b}, + {0x26, 0x0e, 0x0f}, + {0x26, 0x0f, 0x9f}, + {0x26, 0x10, 0x0a}, + {0x26, 0x11, 0x49}, + {0x26, 0x12, 0x54}, + {0x26, 0x13, 0x17}, + {0x26, 0x14, 0xfd}, + {0x26, 0x15, 0x7d}, + {0x26, 0x16, 0xb2}, + {0x26, 0x17, 0xc7}, + {0x26, 0x18, 0x05}, // Biquad - BQ13 Left - Filter: Equalizer (Q Factor) Frequency: 5000 Hz Gain: -11dB QVal: 0.6 Bandwidth: 1000 Hz + {0x26, 0x19, 0x2c}, + {0x26, 0x1a, 0xb5}, + {0x26, 0x1b, 0xf2}, + {0x26, 0x1c, 0xf8}, + {0x26, 0x1d, 0x4c}, + {0x26, 0x1e, 0xc1}, + {0x26, 0x1f, 0x9e}, + {0x26, 0x20, 0x02}, + {0x26, 0x21, 0xf5}, + {0x26, 0x22, 0x02}, + {0x26, 0x23, 0x74}, + {0x26, 0x24, 0x07}, + {0x26, 0x25, 0xb3}, + {0x26, 0x26, 0x3e}, + {0x26, 0x27, 0x62}, + {0x26, 0x28, 0xff}, + {0x26, 0x29, 0xde}, + {0x26, 0x2a, 0x47}, + {0x26, 0x2b, 0x9a}, + {0x26, 0x2c, 0x04}, // Biquad - BQ14 Left - Filter: Equalizer (Q Factor) Frequency: 8000 Hz Gain: -11dB QVal: 0.6 Bandwidth: 1000 Hz + {0x26, 0x2d, 0x82}, + {0x26, 0x2e, 0x67}, + {0x26, 0x2f, 0x0a}, + {0x26, 0x30, 0xfa}, + {0x26, 0x31, 0x8f}, + {0x26, 0x32, 0xec}, + {0x26, 0x33, 0x8a}, + {0x26, 0x34, 0x01}, + {0x26, 0x35, 0xc5}, + {0x26, 0x36, 0x07}, + {0x26, 0x37, 0x48}, + {0x26, 0x38, 0x05}, + {0x26, 0x39, 0x70}, + {0x26, 0x3a, 0x13}, + {0x26, 0x3b, 0x76}, + {0x26, 0x3c, 0x01}, + {0x26, 0x3d, 0xb8}, + {0x26, 0x3e, 0x91}, + {0x26, 0x3f, 0xae}, + {0x26, 0x40, 0x03}, // Biquad - BQ15 Left - Filter: Equalizer (Q Factor) Frequency: 16000 Hz Gain: -11dB QVal: 0.5 Bandwidth: 1000 Hz + {0x26, 0x41, 0x79}, + {0x26, 0x42, 0x1a}, + {0x26, 0x43, 0xdc}, + {0x26, 0x44, 0xfe}, + {0x26, 0x45, 0x4d}, + {0x26, 0x46, 0xb2}, + {0x26, 0x47, 0x52}, + {0x26, 0x48, 0xff}, + {0x26, 0x49, 0xeb}, + {0x26, 0x4a, 0x80}, + {0x26, 0x4b, 0x7f}, + {0x26, 0x4c, 0x01}, + {0x26, 0x4d, 0xb2}, + {0x26, 0x4e, 0x4d}, + {0x26, 0x4f, 0xae}, + {0x26, 0x50, 0x04}, + {0x26, 0x51, 0x9b}, + {0x26, 0x52, 0x64}, + {0x26, 0x53, 0xa5}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_left_ma[TAS5805M_EQ_REG_PER_STEP] = { + {0x24, 0x18, 0x07}, // Biquad - BQ1 Left - Filter: Equalizer (Q Factor) Frequency: 20 Hz Gain: -10dB QVal: 2 Bandwidth: 1000 Hz + {0x24, 0x19, 0xfe}, + {0x24, 0x1a, 0x8d}, + {0x24, 0x1b, 0x65}, + {0x24, 0x1c, 0xf0}, + {0x24, 0x1d, 0x04}, + {0x24, 0x1e, 0x3c}, + {0x24, 0x1f, 0xe6}, + {0x24, 0x20, 0x07}, + {0x24, 0x21, 0xfd}, + {0x24, 0x22, 0x36}, + {0x24, 0x23, 0x9b}, + {0x24, 0x24, 0x0f}, + {0x24, 0x25, 0xfb}, + {0x24, 0x26, 0xc3}, + {0x24, 0x27, 0x1a}, + {0x24, 0x28, 0xf8}, + {0x24, 0x29, 0x04}, + {0x24, 0x2a, 0x3c}, + {0x24, 0x2b, 0x00}, + {0x24, 0x2c, 0x07}, // Biquad - BQ2 Left - Filter: Equalizer (Q Factor) Frequency: 31.5 Hz Gain: -10dB QVal: 2 Bandwidth: 1000 Hz + {0x24, 0x2d, 0xfd}, + {0x24, 0x2e, 0xb8}, + {0x24, 0x2f, 0xa5}, + {0x24, 0x30, 0xf0}, + {0x24, 0x31, 0x06}, + {0x24, 0x32, 0xac}, + {0x24, 0x33, 0x83}, + {0x24, 0x34, 0x07}, + {0x24, 0x35, 0xfb}, + {0x24, 0x36, 0x9d}, + {0x24, 0x37, 0x12}, + {0x24, 0x38, 0x0f}, + {0x24, 0x39, 0xf9}, + {0x24, 0x3a, 0x53}, + {0x24, 0x3b, 0x7d}, + {0x24, 0x3c, 0xf8}, + {0x24, 0x3d, 0x06}, + {0x24, 0x3e, 0xaa}, + {0x24, 0x3f, 0x49}, + {0x24, 0x40, 0x07}, // Biquad - BQ3 Left - Filter: Equalizer (Q Factor) Frequency: 50 Hz Gain: -10dB QVal: 1.5 Bandwidth: 1000 Hz + {0x24, 0x41, 0xfb}, + {0x24, 0x42, 0x2f}, + {0x24, 0x43, 0xa0}, + {0x24, 0x44, 0xf0}, + {0x24, 0x45, 0x0e}, + {0x24, 0x46, 0x1a}, + {0x24, 0x47, 0x3c}, + {0x24, 0x48, 0x07}, + {0x24, 0x49, 0xf6}, + {0x24, 0x4a, 0xbb}, + {0x24, 0x4b, 0xbd}, + {0x24, 0x4c, 0x0f}, + {0x24, 0x4d, 0xf1}, + {0x24, 0x4e, 0xe5}, + {0x24, 0x4f, 0xc4}, + {0x24, 0x50, 0xf8}, + {0x24, 0x51, 0x0e}, + {0x24, 0x52, 0x14}, + {0x24, 0x53, 0xa4}, + {0x24, 0x54, 0x07}, // Biquad - BQ4 Left - Filter: Equalizer (Q Factor) Frequency: 80 Hz Gain: -10dB QVal: 1.5 Bandwidth: 1000 Hz + {0x24, 0x55, 0xf8}, + {0x24, 0x56, 0x50}, + {0x24, 0x57, 0x42}, + {0x24, 0x58, 0xf0}, + {0x24, 0x59, 0x16}, + {0x24, 0x5a, 0x89}, + {0x24, 0x5b, 0xd9}, + {0x24, 0x5c, 0x07}, + {0x24, 0x5d, 0xf1}, + {0x24, 0x5e, 0x34}, + {0x24, 0x5f, 0x31}, + {0x24, 0x60, 0x0f}, + {0x24, 0x61, 0xe9}, + {0x24, 0x62, 0x76}, + {0x24, 0x63, 0x27}, + {0x24, 0x64, 0xf8}, + {0x24, 0x65, 0x16}, + {0x24, 0x66, 0x7b}, + {0x24, 0x67, 0x8d}, + {0x24, 0x68, 0x07}, // Biquad - BQ5 Left - Filter: Equalizer (Q Factor) Frequency: 125 Hz Gain: -10dB QVal: 1 Bandwidth: 1000 Hz + {0x24, 0x69, 0xee}, + {0x24, 0x6a, 0x1d}, + {0x24, 0x6b, 0xdf}, + {0x24, 0x6c, 0xf0}, + {0x24, 0x6d, 0x34}, + {0x24, 0x6e, 0x71}, + {0x24, 0x6f, 0x73}, + {0x24, 0x70, 0x07}, + {0x24, 0x71, 0xdd}, + {0x24, 0x72, 0x93}, + {0x24, 0x73, 0x53}, + {0x24, 0x74, 0x0f}, + {0x24, 0x75, 0xcb}, + {0x24, 0x76, 0x8e}, + {0x24, 0x77, 0x8d}, + {0x24, 0x78, 0xf8}, + {0x24, 0x79, 0x34}, + {0x24, 0x7a, 0x4e}, + {0x24, 0x7b, 0xce}, + {0x24, 0x7c, 0x07}, // Biquad - BQ6 Left - Filter: Equalizer (Q Factor) Frequency: 200 Hz Gain: -10dB QVal: 1 Bandwidth: 1000 Hz + {0x24, 0x7d, 0xe3}, + {0x24, 0x7e, 0x9a}, + {0x24, 0x7f, 0xb1}, + {0x25, 0x08, 0xf0}, + {0x25, 0x09, 0x53}, + {0x25, 0x0a, 0x66}, + {0x25, 0x0b, 0x62}, + {0x25, 0x0c, 0x07}, + {0x25, 0x0d, 0xc9}, + {0x25, 0x0e, 0x56}, + {0x25, 0x0f, 0xf0}, + {0x25, 0x10, 0x0f}, + {0x25, 0x11, 0xac}, + {0x25, 0x12, 0x99}, + {0x25, 0x13, 0x9e}, + {0x25, 0x14, 0xf8}, + {0x25, 0x15, 0x53}, + {0x25, 0x16, 0x0e}, + {0x25, 0x17, 0x5f}, + {0x25, 0x18, 0x07}, // Biquad - BQ7 Left - Filter: Equalizer (Q Factor) Frequency: 315 Hz Gain: -10dB QVal: 0.9 Bandwidth: 1000 Hz + {0x25, 0x19, 0xcf}, + {0x25, 0x1a, 0x0d}, + {0x25, 0x1b, 0x47}, + {0x25, 0x1c, 0xf0}, + {0x25, 0x1d, 0x90}, + {0x25, 0x1e, 0x02}, + {0x25, 0x1f, 0xcd}, + {0x25, 0x20, 0x07}, + {0x25, 0x21, 0xa1}, + {0x25, 0x22, 0xc6}, + {0x25, 0x23, 0xfa}, + {0x25, 0x24, 0x0f}, + {0x25, 0x25, 0x6f}, + {0x25, 0x26, 0xfd}, + {0x25, 0x27, 0x33}, + {0x25, 0x28, 0xf8}, + {0x25, 0x29, 0x8f}, + {0x25, 0x2a, 0x2b}, + {0x25, 0x2b, 0xbf}, + {0x25, 0x2c, 0x07}, // Biquad - BQ8 Left - Filter: Equalizer (Q Factor) Frequency: 500 Hz Gain: -10dB QVal: 0.9 Bandwidth: 1000 Hz + {0x25, 0x2d, 0xb3}, + {0x25, 0x2e, 0xde}, + {0x25, 0x2f, 0x0f}, + {0x25, 0x30, 0xf0}, + {0x25, 0x31, 0xe0}, + {0x25, 0x32, 0xc2}, + {0x25, 0x33, 0x02}, + {0x25, 0x34, 0x07}, + {0x25, 0x35, 0x6d}, + {0x25, 0x36, 0x72}, + {0x25, 0x37, 0xd4}, + {0x25, 0x38, 0x0f}, + {0x25, 0x39, 0x1f}, + {0x25, 0x3a, 0x3d}, + {0x25, 0x3b, 0xfe}, + {0x25, 0x3c, 0xf8}, + {0x25, 0x3d, 0xde}, + {0x25, 0x3e, 0xaf}, + {0x25, 0x3f, 0x1c}, + {0x25, 0x40, 0x07}, // Biquad - BQ9 Left - Filter: Equalizer (Q Factor) Frequency: 800 Hz Gain: -10dB QVal: 0.8 Bandwidth: 1000 Hz + {0x25, 0x41, 0x7c}, + {0x25, 0x42, 0xac}, + {0x25, 0x43, 0x54}, + {0x25, 0x44, 0xf1}, + {0x25, 0x45, 0x85}, + {0x25, 0x46, 0x36}, + {0x25, 0x47, 0x26}, + {0x25, 0x48, 0x07}, + {0x25, 0x49, 0x03}, + {0x25, 0x4a, 0x33}, + {0x25, 0x4b, 0xcb}, + {0x25, 0x4c, 0x0e}, + {0x25, 0x4d, 0x7a}, + {0x25, 0x4e, 0xc9}, + {0x25, 0x4f, 0xda}, + {0x25, 0x50, 0xf9}, + {0x25, 0x51, 0x80}, + {0x25, 0x52, 0x1f}, + {0x25, 0x53, 0xe1}, + {0x25, 0x54, 0x07}, // Biquad - BQ10 Left - Filter: Equalizer (Q Factor) Frequency: 1250 Hz Gain: -10dB QVal: 0.8 Bandwidth: 1000 Hz + {0x25, 0x55, 0x3d}, + {0x25, 0x56, 0x15}, + {0x25, 0x57, 0x7c}, + {0x25, 0x58, 0xf2}, + {0x25, 0x59, 0x45}, + {0x25, 0x5a, 0xe9}, + {0x25, 0x5b, 0xc3}, + {0x25, 0x5c, 0x06}, + {0x25, 0x5d, 0x88}, + {0x25, 0x5e, 0xcb}, + {0x25, 0x5f, 0xd2}, + {0x25, 0x60, 0x0d}, + {0x25, 0x61, 0xba}, + {0x25, 0x62, 0x16}, + {0x25, 0x63, 0x3d}, + {0x25, 0x64, 0xfa}, + {0x25, 0x65, 0x3a}, + {0x25, 0x66, 0x1e}, + {0x25, 0x67, 0xb2}, + {0x25, 0x68, 0x06}, // Biquad - BQ11 Left - Filter: Equalizer (Q Factor) Frequency: 2000 Hz Gain: -10dB QVal: 0.7 Bandwidth: 1000 Hz + {0x25, 0x69, 0xc0}, + {0x25, 0x6a, 0x6f}, + {0x25, 0x6b, 0xce}, + {0x25, 0x6c, 0xf3}, + {0x25, 0x6d, 0xc1}, + {0x25, 0x6e, 0xc0}, + {0x25, 0x6f, 0x87}, + {0x25, 0x70, 0x05}, + {0x25, 0x71, 0x98}, + {0x25, 0x72, 0xdb}, + {0x25, 0x73, 0x44}, + {0x25, 0x74, 0x0c}, + {0x25, 0x75, 0x3e}, + {0x25, 0x76, 0x3f}, + {0x25, 0x77, 0x79}, + {0x25, 0x78, 0xfb}, + {0x25, 0x79, 0xa6}, + {0x25, 0x7a, 0xb4}, + {0x25, 0x7b, 0xee}, + {0x25, 0x7c, 0x06}, // Biquad - BQ12 Left - Filter: Equalizer (Q Factor) Frequency: 3150 Hz Gain: -10dB QVal: 0.7 Bandwidth: 1000 Hz + {0x25, 0x7d, 0x43}, + {0x25, 0x7e, 0x11}, + {0x25, 0x7f, 0xc4}, + {0x26, 0x08, 0xf5}, + {0x26, 0x09, 0x50}, + {0x26, 0x0a, 0x94}, + {0x26, 0x0b, 0xfb}, + {0x26, 0x0c, 0x04}, + {0x26, 0x0d, 0xa7}, + {0x26, 0x0e, 0x87}, + {0x26, 0x0f, 0xd4}, + {0x26, 0x10, 0x0a}, + {0x26, 0x11, 0xaf}, + {0x26, 0x12, 0x6b}, + {0x26, 0x13, 0x05}, + {0x26, 0x14, 0xfd}, + {0x26, 0x15, 0x15}, + {0x26, 0x16, 0x66}, + {0x26, 0x17, 0x67}, + {0x26, 0x18, 0x05}, // Biquad - BQ13 Left - Filter: Equalizer (Q Factor) Frequency: 5000 Hz Gain: -10dB QVal: 0.6 Bandwidth: 1000 Hz + {0x26, 0x19, 0x77}, + {0x26, 0x1a, 0x8e}, + {0x26, 0x1b, 0xdc}, + {0x26, 0x1c, 0xf7}, + {0x26, 0x1d, 0xdd}, + {0x26, 0x1e, 0x61}, + {0x26, 0x1f, 0x1b}, + {0x26, 0x20, 0x03}, + {0x26, 0x21, 0x1f}, + {0x26, 0x22, 0xc8}, + {0x26, 0x23, 0x02}, + {0x26, 0x24, 0x08}, + {0x26, 0x25, 0x22}, + {0x26, 0x26, 0x9e}, + {0x26, 0x27, 0xe5}, + {0x26, 0x28, 0xff}, + {0x26, 0x29, 0x68}, + {0x26, 0x2a, 0xa9}, + {0x26, 0x2b, 0x21}, + {0x26, 0x2c, 0x04}, // Biquad - BQ14 Left - Filter: Equalizer (Q Factor) Frequency: 8000 Hz Gain: -10dB QVal: 0.6 Bandwidth: 1000 Hz + {0x26, 0x2d, 0xd4}, + {0x26, 0x2e, 0x12}, + {0x26, 0x2f, 0x63}, + {0x26, 0x30, 0xfa}, + {0x26, 0x31, 0x2d}, + {0x26, 0x32, 0x70}, + {0x26, 0x33, 0xb1}, + {0x26, 0x34, 0x01}, + {0x26, 0x35, 0xe5}, + {0x26, 0x36, 0x14}, + {0x26, 0x37, 0x10}, + {0x26, 0x38, 0x05}, + {0x26, 0x39, 0xd2}, + {0x26, 0x3a, 0x8f}, + {0x26, 0x3b, 0x4f}, + {0x26, 0x3c, 0x01}, + {0x26, 0x3d, 0x46}, + {0x26, 0x3e, 0xd9}, + {0x26, 0x3f, 0x8d}, + {0x26, 0x40, 0x03}, // Biquad - BQ15 Left - Filter: Equalizer (Q Factor) Frequency: 16000 Hz Gain: -10dB QVal: 0.5 Bandwidth: 1000 Hz + {0x26, 0x41, 0xcc}, + {0x26, 0x42, 0x6e}, + {0x26, 0x43, 0x15}, + {0x26, 0x44, 0xfe}, + {0x26, 0x45, 0x24}, + {0x26, 0x46, 0xfe}, + {0x26, 0x47, 0x9a}, + {0x26, 0x48, 0xff}, + {0x26, 0x49, 0xe9}, + {0x26, 0x4a, 0x94}, + {0x26, 0x4b, 0xb6}, + {0x26, 0x4c, 0x01}, + {0x26, 0x4d, 0xdb}, + {0x26, 0x4e, 0x01}, + {0x26, 0x4f, 0x66}, + {0x26, 0x50, 0x04}, + {0x26, 0x51, 0x49}, + {0x26, 0x52, 0xfd}, + {0x26, 0x53, 0x35}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_left_m9[TAS5805M_EQ_REG_PER_STEP] = { + {0x24, 0x18, 0x07}, // Biquad - BQ1 Left - Filter: Equalizer (Q Factor) Frequency: 20 Hz Gain: -9dB QVal: 2 Bandwidth: 1000 Hz + {0x24, 0x19, 0xfe}, + {0x24, 0x1a, 0xc8}, + {0x24, 0x1b, 0x4d}, + {0x24, 0x1c, 0xf0}, + {0x24, 0x1d, 0x03}, + {0x24, 0x1e, 0xc7}, + {0x24, 0x1f, 0x1f}, + {0x24, 0x20, 0x07}, + {0x24, 0x21, 0xfd}, + {0x24, 0x22, 0x71}, + {0x24, 0x23, 0x79}, + {0x24, 0x24, 0x0f}, + {0x24, 0x25, 0xfc}, + {0x24, 0x26, 0x38}, + {0x24, 0x27, 0xe1}, + {0x24, 0x28, 0xf8}, + {0x24, 0x29, 0x03}, + {0x24, 0x2a, 0xc6}, + {0x24, 0x2b, 0x3a}, + {0x24, 0x2c, 0x07}, // Biquad - BQ2 Left - Filter: Equalizer (Q Factor) Frequency: 31.5 Hz Gain: -9dB QVal: 2 Bandwidth: 1000 Hz + {0x24, 0x2d, 0xfe}, + {0x24, 0x2e, 0x15}, + {0x24, 0x2f, 0x56}, + {0x24, 0x30, 0xf0}, + {0x24, 0x31, 0x05}, + {0x24, 0x32, 0xf3}, + {0x24, 0x33, 0x39}, + {0x24, 0x34, 0x07}, + {0x24, 0x35, 0xfb}, + {0x24, 0x36, 0xf9}, + {0x24, 0x37, 0xaa}, + {0x24, 0x38, 0x0f}, + {0x24, 0x39, 0xfa}, + {0x24, 0x3a, 0x0c}, + {0x24, 0x3b, 0xc7}, + {0x24, 0x3c, 0xf8}, + {0x24, 0x3d, 0x05}, + {0x24, 0x3e, 0xf1}, + {0x24, 0x3f, 0x00}, + {0x24, 0x40, 0x07}, // Biquad - BQ3 Left - Filter: Equalizer (Q Factor) Frequency: 50 Hz Gain: -9dB QVal: 1.5 Bandwidth: 1000 Hz + {0x24, 0x41, 0xfb}, + {0x24, 0x42, 0xf3}, + {0x24, 0x43, 0x3d}, + {0x24, 0x44, 0xf0}, + {0x24, 0x45, 0x0c}, + {0x24, 0x46, 0x93}, + {0x24, 0x47, 0x70}, + {0x24, 0x48, 0x07}, + {0x24, 0x49, 0xf7}, + {0x24, 0x4a, 0x7e}, + {0x24, 0x4b, 0xec}, + {0x24, 0x4c, 0x0f}, + {0x24, 0x4d, 0xf3}, + {0x24, 0x4e, 0x6c}, + {0x24, 0x4f, 0x90}, + {0x24, 0x50, 0xf8}, + {0x24, 0x51, 0x0c}, + {0x24, 0x52, 0x8d}, + {0x24, 0x53, 0xd7}, + {0x24, 0x54, 0x07}, // Biquad - BQ4 Left - Filter: Equalizer (Q Factor) Frequency: 80 Hz Gain: -9dB QVal: 1.5 Bandwidth: 1000 Hz + {0x24, 0x55, 0xf9}, + {0x24, 0x56, 0x88}, + {0x24, 0x57, 0x39}, + {0x24, 0x58, 0xf0}, + {0x24, 0x59, 0x14}, + {0x24, 0x5a, 0x1b}, + {0x24, 0x5b, 0x02}, + {0x24, 0x5c, 0x07}, + {0x24, 0x5d, 0xf2}, + {0x24, 0x5e, 0x6b}, + {0x24, 0x5f, 0x12}, + {0x24, 0x60, 0x0f}, + {0x24, 0x61, 0xeb}, + {0x24, 0x62, 0xe4}, + {0x24, 0x63, 0xfe}, + {0x24, 0x64, 0xf8}, + {0x24, 0x65, 0x14}, + {0x24, 0x66, 0x0c}, + {0x24, 0x67, 0xb4}, + {0x24, 0x68, 0x07}, // Biquad - BQ5 Left - Filter: Equalizer (Q Factor) Frequency: 125 Hz Gain: -9dB QVal: 1 Bandwidth: 1000 Hz + {0x24, 0x69, 0xf0}, + {0x24, 0x6a, 0xf0}, + {0x24, 0x6b, 0xa2}, + {0x24, 0x6c, 0xf0}, + {0x24, 0x6d, 0x2e}, + {0x24, 0x6e, 0xd1}, + {0x24, 0x6f, 0xdc}, + {0x24, 0x70, 0x07}, + {0x24, 0x71, 0xe0}, + {0x24, 0x72, 0x60}, + {0x24, 0x73, 0x33}, + {0x24, 0x74, 0x0f}, + {0x24, 0x75, 0xd1}, + {0x24, 0x76, 0x2e}, + {0x24, 0x77, 0x24}, + {0x24, 0x78, 0xf8}, + {0x24, 0x79, 0x2e}, + {0x24, 0x7a, 0xaf}, + {0x24, 0x7b, 0x2a}, + {0x24, 0x7c, 0x07}, // Biquad - BQ6 Left - Filter: Equalizer (Q Factor) Frequency: 200 Hz Gain: -9dB QVal: 1 Bandwidth: 1000 Hz + {0x24, 0x7d, 0xe8}, + {0x24, 0x7e, 0x11}, + {0x24, 0x7f, 0x50}, + {0x25, 0x08, 0xf0}, + {0x25, 0x09, 0x4a}, + {0x25, 0x0a, 0x88}, + {0x25, 0x0b, 0x32}, + {0x25, 0x0c, 0x07}, + {0x25, 0x0d, 0xcd}, + {0x25, 0x0e, 0xbe}, + {0x25, 0x0f, 0xb3}, + {0x25, 0x10, 0x0f}, + {0x25, 0x11, 0xb5}, + {0x25, 0x12, 0x77}, + {0x25, 0x13, 0xce}, + {0x25, 0x14, 0xf8}, + {0x25, 0x15, 0x4a}, + {0x25, 0x16, 0x2f}, + {0x25, 0x17, 0xfd}, + {0x25, 0x18, 0x07}, // Biquad - BQ7 Left - Filter: Equalizer (Q Factor) Frequency: 315 Hz Gain: -9dB QVal: 0.9 Bandwidth: 1000 Hz + {0x25, 0x19, 0xd6}, + {0x25, 0x1a, 0xad}, + {0x25, 0x1b, 0xfd}, + {0x25, 0x1c, 0xf0}, + {0x25, 0x1d, 0x80}, + {0x25, 0x1e, 0xee}, + {0x25, 0x1f, 0x6b}, + {0x25, 0x20, 0x07}, + {0x25, 0x21, 0xa9}, + {0x25, 0x22, 0x3b}, + {0x25, 0x23, 0x77}, + {0x25, 0x24, 0x0f}, + {0x25, 0x25, 0x7f}, + {0x25, 0x26, 0x11}, + {0x25, 0x27, 0x95}, + {0x25, 0x28, 0xf8}, + {0x25, 0x29, 0x80}, + {0x25, 0x2a, 0x16}, + {0x25, 0x2b, 0x8c}, + {0x25, 0x2c, 0x07}, // Biquad - BQ8 Left - Filter: Equalizer (Q Factor) Frequency: 500 Hz Gain: -9dB QVal: 0.9 Bandwidth: 1000 Hz + {0x25, 0x2d, 0xbf}, + {0x25, 0x2e, 0x98}, + {0x25, 0x2f, 0x51}, + {0x25, 0x30, 0xf0}, + {0x25, 0x31, 0xc9}, + {0x25, 0x32, 0xbb}, + {0x25, 0x33, 0xdf}, + {0x25, 0x34, 0x07}, + {0x25, 0x35, 0x78}, + {0x25, 0x36, 0xc1}, + {0x25, 0x37, 0xde}, + {0x25, 0x38, 0x0f}, + {0x25, 0x39, 0x36}, + {0x25, 0x3a, 0x44}, + {0x25, 0x3b, 0x21}, + {0x25, 0x3c, 0xf8}, + {0x25, 0x3d, 0xc7}, + {0x25, 0x3e, 0xa5}, + {0x25, 0x3f, 0xd1}, + {0x25, 0x40, 0x07}, // Biquad - BQ9 Left - Filter: Equalizer (Q Factor) Frequency: 800 Hz Gain: -9dB QVal: 0.8 Bandwidth: 1000 Hz + {0x25, 0x41, 0x90}, + {0x25, 0x42, 0x6b}, + {0x25, 0x43, 0xfc}, + {0x25, 0x44, 0xf1}, + {0x25, 0x45, 0x5f}, + {0x25, 0x46, 0x04}, + {0x25, 0x47, 0xaa}, + {0x25, 0x48, 0x07}, + {0x25, 0x49, 0x15}, + {0x25, 0x4a, 0xb3}, + {0x25, 0x4b, 0x0b}, + {0x25, 0x4c, 0x0e}, + {0x25, 0x4d, 0xa0}, + {0x25, 0x4e, 0xfb}, + {0x25, 0x4f, 0x56}, + {0x25, 0x50, 0xf9}, + {0x25, 0x51, 0x59}, + {0x25, 0x52, 0xe0}, + {0x25, 0x53, 0xf9}, + {0x25, 0x54, 0x07}, // Biquad - BQ10 Left - Filter: Equalizer (Q Factor) Frequency: 1250 Hz Gain: -9dB QVal: 0.8 Bandwidth: 1000 Hz + {0x25, 0x55, 0x59}, + {0x25, 0x56, 0x90}, + {0x25, 0x57, 0x8c}, + {0x25, 0x58, 0xf2}, + {0x25, 0x59, 0x0f}, + {0x25, 0x5a, 0xe7}, + {0x25, 0x5b, 0x63}, + {0x25, 0x5c, 0x06}, + {0x25, 0x5d, 0xa2}, + {0x25, 0x5e, 0x81}, + {0x25, 0x5f, 0x88}, + {0x25, 0x60, 0x0d}, + {0x25, 0x61, 0xf0}, + {0x25, 0x62, 0x18}, + {0x25, 0x63, 0x9d}, + {0x25, 0x64, 0xfa}, + {0x25, 0x65, 0x03}, + {0x25, 0x66, 0xed}, + {0x25, 0x67, 0xec}, + {0x25, 0x68, 0x06}, // Biquad - BQ11 Left - Filter: Equalizer (Q Factor) Frequency: 2000 Hz Gain: -9dB QVal: 0.7 Bandwidth: 1000 Hz + {0x25, 0x69, 0xec}, + {0x25, 0x6a, 0x6c}, + {0x25, 0x6b, 0x0e}, + {0x25, 0x6c, 0xf3}, + {0x25, 0x6d, 0x71}, + {0x25, 0x6e, 0xfd}, + {0x25, 0x6f, 0xd5}, + {0x25, 0x70, 0x05}, + {0x25, 0x71, 0xbd}, + {0x25, 0x72, 0x51}, + {0x25, 0x73, 0xe6}, + {0x25, 0x74, 0x0c}, + {0x25, 0x75, 0x8e}, + {0x25, 0x76, 0x02}, + {0x25, 0x77, 0x2b}, + {0x25, 0x78, 0xfb}, + {0x25, 0x79, 0x56}, + {0x25, 0x7a, 0x42}, + {0x25, 0x7b, 0x0b}, + {0x25, 0x7c, 0x06}, // Biquad - BQ12 Left - Filter: Equalizer (Q Factor) Frequency: 3150 Hz Gain: -9dB QVal: 0.7 Bandwidth: 1000 Hz + {0x25, 0x7d, 0x7c}, + {0x25, 0x7e, 0x70}, + {0x25, 0x7f, 0xff}, + {0x26, 0x08, 0xf4}, + {0x26, 0x09, 0xee}, + {0x26, 0x0a, 0xaf}, + {0x26, 0x0b, 0x3d}, + {0x26, 0x0c, 0x04}, + {0x26, 0x0d, 0xd2}, + {0x26, 0x0e, 0x2c}, + {0x26, 0x0f, 0x91}, + {0x26, 0x10, 0x0b}, + {0x26, 0x11, 0x11}, + {0x26, 0x12, 0x50}, + {0x26, 0x13, 0xc3}, + {0x26, 0x14, 0xfc}, + {0x26, 0x15, 0xb1}, + {0x26, 0x16, 0x62}, + {0x26, 0x17, 0x70}, + {0x26, 0x18, 0x05}, // Biquad - BQ13 Left - Filter: Equalizer (Q Factor) Frequency: 5000 Hz Gain: -9dB QVal: 0.6 Bandwidth: 1000 Hz + {0x26, 0x19, 0xc1}, + {0x26, 0x1a, 0xc5}, + {0x26, 0x1b, 0xa1}, + {0x26, 0x1c, 0xf7}, + {0x26, 0x1d, 0x6e}, + {0x26, 0x1e, 0xf1}, + {0x26, 0x1f, 0xdf}, + {0x26, 0x20, 0x03}, + {0x26, 0x21, 0x4a}, + {0x26, 0x22, 0x30}, + {0x26, 0x23, 0xe9}, + {0x26, 0x24, 0x08}, + {0x26, 0x25, 0x91}, + {0x26, 0x26, 0x0e}, + {0x26, 0x27, 0x21}, + {0x26, 0x28, 0xfe}, + {0x26, 0x29, 0xf4}, + {0x26, 0x2a, 0x09}, + {0x26, 0x2b, 0x76}, + {0x26, 0x2c, 0x05}, // Biquad - BQ14 Left - Filter: Equalizer (Q Factor) Frequency: 8000 Hz Gain: -9dB QVal: 0.6 Bandwidth: 1000 Hz + {0x26, 0x2d, 0x27}, + {0x26, 0x2e, 0x41}, + {0x26, 0x2f, 0x04}, + {0x26, 0x30, 0xf9}, + {0x26, 0x31, 0xc9}, + {0x26, 0x32, 0x21}, + {0x26, 0x33, 0xd4}, + {0x26, 0x34, 0x02}, + {0x26, 0x35, 0x05}, + {0x26, 0x36, 0xb8}, + {0x26, 0x37, 0xd5}, + {0x26, 0x38, 0x06}, + {0x26, 0x39, 0x36}, + {0x26, 0x3a, 0xde}, + {0x26, 0x3b, 0x2c}, + {0x26, 0x3c, 0x00}, + {0x26, 0x3d, 0xd3}, + {0x26, 0x3e, 0x06}, + {0x26, 0x3f, 0x27}, + {0x26, 0x40, 0x04}, // Biquad - BQ15 Left - Filter: Equalizer (Q Factor) Frequency: 16000 Hz Gain: -9dB QVal: 0.5 Bandwidth: 1000 Hz + {0x26, 0x41, 0x25}, + {0x26, 0x42, 0x0e}, + {0x26, 0x43, 0x56}, + {0x26, 0x44, 0xfd}, + {0x26, 0x45, 0xf9}, + {0x26, 0x46, 0xb4}, + {0x26, 0x47, 0x03}, + {0x26, 0x48, 0xff}, + {0x26, 0x49, 0xe7}, + {0x26, 0x4a, 0x89}, + {0x26, 0x4b, 0xa4}, + {0x26, 0x4c, 0x02}, + {0x26, 0x4d, 0x06}, + {0x26, 0x4e, 0x4b}, + {0x26, 0x4f, 0xfd}, + {0x26, 0x50, 0x03}, + {0x26, 0x51, 0xf3}, + {0x26, 0x52, 0x68}, + {0x26, 0x53, 0x06}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_left_m8[TAS5805M_EQ_REG_PER_STEP] = { + {0x24, 0x18, 0x07}, // Biquad - BQ1 Left - Filter: Equalizer (Q Factor) Frequency: 20 Hz Gain: -8dB QVal: 2 Bandwidth: 1000 Hz + {0x24, 0x19, 0xfe}, + {0x24, 0x1a, 0xfc}, + {0x24, 0x1b, 0xd0}, + {0x24, 0x1c, 0xf0}, + {0x24, 0x1d, 0x03}, + {0x24, 0x1e, 0x5e}, + {0x24, 0x1f, 0x22}, + {0x24, 0x20, 0x07}, + {0x24, 0x21, 0xfd}, + {0x24, 0x22, 0xa5}, + {0x24, 0x23, 0xf3}, + {0x24, 0x24, 0x0f}, + {0x24, 0x25, 0xfc}, + {0x24, 0x26, 0xa1}, + {0x24, 0x27, 0xde}, + {0x24, 0x28, 0xf8}, + {0x24, 0x29, 0x03}, + {0x24, 0x2a, 0x5d}, + {0x24, 0x2b, 0x3c}, + {0x24, 0x2c, 0x07}, // Biquad - BQ2 Left - Filter: Equalizer (Q Factor) Frequency: 31.5 Hz Gain: -8dB QVal: 2 Bandwidth: 1000 Hz + {0x24, 0x2d, 0xfe}, + {0x24, 0x2e, 0x67}, + {0x24, 0x2f, 0xfa}, + {0x24, 0x30, 0xf0}, + {0x24, 0x31, 0x05}, + {0x24, 0x32, 0x4e}, + {0x24, 0x33, 0x08}, + {0x24, 0x34, 0x07}, + {0x24, 0x35, 0xfc}, + {0x24, 0x36, 0x4c}, + {0x24, 0x37, 0x38}, + {0x24, 0x38, 0x0f}, + {0x24, 0x39, 0xfa}, + {0x24, 0x3a, 0xb1}, + {0x24, 0x3b, 0xf8}, + {0x24, 0x3c, 0xf8}, + {0x24, 0x3d, 0x05}, + {0x24, 0x3e, 0x4b}, + {0x24, 0x3f, 0xce}, + {0x24, 0x40, 0x07}, // Biquad - BQ3 Left - Filter: Equalizer (Q Factor) Frequency: 50 Hz Gain: -8dB QVal: 1.5 Bandwidth: 1000 Hz + {0x24, 0x41, 0xfc}, + {0x24, 0x42, 0xa1}, + {0x24, 0x43, 0xb3}, + {0x24, 0x44, 0xf0}, + {0x24, 0x45, 0x0b}, + {0x24, 0x46, 0x36}, + {0x24, 0x47, 0xe4}, + {0x24, 0x48, 0x07}, + {0x24, 0x49, 0xf8}, + {0x24, 0x4a, 0x2d}, + {0x24, 0x4b, 0x02}, + {0x24, 0x4c, 0x0f}, + {0x24, 0x4d, 0xf4}, + {0x24, 0x4e, 0xc9}, + {0x24, 0x4f, 0x1c}, + {0x24, 0x50, 0xf8}, + {0x24, 0x51, 0x0b}, + {0x24, 0x52, 0x31}, + {0x24, 0x53, 0x4b}, + {0x24, 0x54, 0x07}, // Biquad - BQ4 Left - Filter: Equalizer (Q Factor) Frequency: 80 Hz Gain: -8dB QVal: 1.5 Bandwidth: 1000 Hz + {0x24, 0x55, 0xfa}, + {0x24, 0x56, 0x9e}, + {0x24, 0x57, 0x94}, + {0x24, 0x58, 0xf0}, + {0x24, 0x59, 0x11}, + {0x24, 0x5a, 0xef}, + {0x24, 0x5b, 0x46}, + {0x24, 0x5c, 0x07}, + {0x24, 0x5d, 0xf3}, + {0x24, 0x5e, 0x80}, + {0x24, 0x5f, 0x75}, + {0x24, 0x60, 0x0f}, + {0x24, 0x61, 0xee}, + {0x24, 0x62, 0x10}, + {0x24, 0x63, 0xba}, + {0x24, 0x64, 0xf8}, + {0x24, 0x65, 0x11}, + {0x24, 0x66, 0xe0}, + {0x24, 0x67, 0xf7}, + {0x24, 0x68, 0x07}, // Biquad - BQ5 Left - Filter: Equalizer (Q Factor) Frequency: 125 Hz Gain: -8dB QVal: 1 Bandwidth: 1000 Hz + {0x24, 0x69, 0xf3}, + {0x24, 0x6a, 0x76}, + {0x24, 0x6b, 0x7f}, + {0x24, 0x6c, 0xf0}, + {0x24, 0x6d, 0x29}, + {0x24, 0x6e, 0xcb}, + {0x24, 0x6f, 0x71}, + {0x24, 0x70, 0x07}, + {0x24, 0x71, 0xe2}, + {0x24, 0x72, 0xe0}, + {0x24, 0x73, 0xcc}, + {0x24, 0x74, 0x0f}, + {0x24, 0x75, 0xd6}, + {0x24, 0x76, 0x34}, + {0x24, 0x77, 0x8f}, + {0x24, 0x78, 0xf8}, + {0x24, 0x79, 0x29}, + {0x24, 0x7a, 0xa8}, + {0x24, 0x7b, 0xb5}, + {0x24, 0x7c, 0x07}, // Biquad - BQ6 Left - Filter: Equalizer (Q Factor) Frequency: 200 Hz Gain: -8dB QVal: 1 Bandwidth: 1000 Hz + {0x24, 0x7d, 0xec}, + {0x24, 0x7e, 0x0f}, + {0x24, 0x7f, 0xf0}, + {0x25, 0x08, 0xf0}, + {0x25, 0x09, 0x42}, + {0x25, 0x0a, 0x98}, + {0x25, 0x0b, 0x6a}, + {0x25, 0x0c, 0x07}, + {0x25, 0x0d, 0xd1}, + {0x25, 0x0e, 0xb0}, + {0x25, 0x0f, 0x07}, + {0x25, 0x10, 0x0f}, + {0x25, 0x11, 0xbd}, + {0x25, 0x12, 0x67}, + {0x25, 0x13, 0x96}, + {0x25, 0x14, 0xf8}, + {0x25, 0x15, 0x42}, + {0x25, 0x16, 0x40}, + {0x25, 0x17, 0x08}, + {0x25, 0x18, 0x07}, // Biquad - BQ7 Left - Filter: Equalizer (Q Factor) Frequency: 315 Hz Gain: -8dB QVal: 0.9 Bandwidth: 1000 Hz + {0x25, 0x19, 0xdd}, + {0x25, 0x1a, 0x86}, + {0x25, 0x1b, 0xf3}, + {0x25, 0x1c, 0xf0}, + {0x25, 0x1d, 0x73}, + {0x25, 0x1e, 0x64}, + {0x25, 0x1f, 0xf1}, + {0x25, 0x20, 0x07}, + {0x25, 0x21, 0xaf}, + {0x25, 0x22, 0xec}, + {0x25, 0x23, 0xb9}, + {0x25, 0x24, 0x0f}, + {0x25, 0x25, 0x8c}, + {0x25, 0x26, 0x9b}, + {0x25, 0x27, 0x0f}, + {0x25, 0x28, 0xf8}, + {0x25, 0x29, 0x72}, + {0x25, 0x2a, 0x8c}, + {0x25, 0x2b, 0x55}, + {0x25, 0x2c, 0x07}, // Biquad - BQ8 Left - Filter: Equalizer (Q Factor) Frequency: 500 Hz Gain: -8dB QVal: 0.9 Bandwidth: 1000 Hz + {0x25, 0x2d, 0xca}, + {0x25, 0x2e, 0x2a}, + {0x25, 0x2f, 0x56}, + {0x25, 0x30, 0xf0}, + {0x25, 0x31, 0xb4}, + {0x25, 0x32, 0xfb}, + {0x25, 0x33, 0x50}, + {0x25, 0x34, 0x07}, + {0x25, 0x35, 0x82}, + {0x25, 0x36, 0xf3}, + {0x25, 0x37, 0x41}, + {0x25, 0x38, 0x0f}, + {0x25, 0x39, 0x4b}, + {0x25, 0x3a, 0x04}, + {0x25, 0x3b, 0xb0}, + {0x25, 0x3c, 0xf8}, + {0x25, 0x3d, 0xb2}, + {0x25, 0x3e, 0xe2}, + {0x25, 0x3f, 0x69}, + {0x25, 0x40, 0x07}, // Biquad - BQ9 Left - Filter: Equalizer (Q Factor) Frequency: 800 Hz Gain: -8dB QVal: 0.8 Bandwidth: 1000 Hz + {0x25, 0x41, 0xa2}, + {0x25, 0x42, 0x5e}, + {0x25, 0x43, 0x76}, + {0x25, 0x44, 0xf1}, + {0x25, 0x45, 0x3c}, + {0x25, 0x46, 0x4f}, + {0x25, 0x47, 0x15}, + {0x25, 0x48, 0x07}, + {0x25, 0x49, 0x26}, + {0x25, 0x4a, 0x82}, + {0x25, 0x4b, 0x57}, + {0x25, 0x4c, 0x0e}, + {0x25, 0x4d, 0xc3}, + {0x25, 0x4e, 0xb0}, + {0x25, 0x4f, 0xeb}, + {0x25, 0x50, 0xf9}, + {0x25, 0x51, 0x37}, + {0x25, 0x52, 0x1f}, + {0x25, 0x53, 0x33}, + {0x25, 0x54, 0x07}, // Biquad - BQ10 Left - Filter: Equalizer (Q Factor) Frequency: 1250 Hz Gain: -8dB QVal: 0.8 Bandwidth: 1000 Hz + {0x25, 0x55, 0x73}, + {0x25, 0x56, 0xb2}, + {0x25, 0x57, 0x39}, + {0x25, 0x58, 0xf1}, + {0x25, 0x59, 0xde}, + {0x25, 0x5a, 0x59}, + {0x25, 0x5b, 0x75}, + {0x25, 0x5c, 0x06}, + {0x25, 0x5d, 0xba}, + {0x25, 0x5e, 0x18}, + {0x25, 0x5f, 0x5d}, + {0x25, 0x60, 0x0e}, + {0x25, 0x61, 0x21}, + {0x25, 0x62, 0xa6}, + {0x25, 0x63, 0x8b}, + {0x25, 0x64, 0xf9}, + {0x25, 0x65, 0xd2}, + {0x25, 0x66, 0x35}, + {0x25, 0x67, 0x6a}, + {0x25, 0x68, 0x07}, // Biquad - BQ11 Left - Filter: Equalizer (Q Factor) Frequency: 2000 Hz Gain: -8dB QVal: 0.7 Bandwidth: 1000 Hz + {0x25, 0x69, 0x15}, + {0x25, 0x6a, 0x8d}, + {0x25, 0x6b, 0xfb}, + {0x25, 0x6c, 0xf3}, + {0x25, 0x6d, 0x27}, + {0x25, 0x6e, 0x67}, + {0x25, 0x6f, 0x79}, + {0x25, 0x70, 0x05}, + {0x25, 0x71, 0xdf}, + {0x25, 0x72, 0x6b}, + {0x25, 0x73, 0x1a}, + {0x25, 0x74, 0x0c}, + {0x25, 0x75, 0xd8}, + {0x25, 0x76, 0x98}, + {0x25, 0x77, 0x87}, + {0x25, 0x78, 0xfb}, + {0x25, 0x79, 0x0b}, + {0x25, 0x7a, 0x06}, + {0x25, 0x7b, 0xec}, + {0x25, 0x7c, 0x06}, // Biquad - BQ12 Left - Filter: Equalizer (Q Factor) Frequency: 3150 Hz Gain: -8dB QVal: 0.7 Bandwidth: 1000 Hz + {0x25, 0x7d, 0xb3}, + {0x25, 0x7e, 0x26}, + {0x25, 0x7f, 0x34}, + {0x26, 0x08, 0xf4}, + {0x26, 0x09, 0x91}, + {0x26, 0x0a, 0x55}, + {0x26, 0x0b, 0x46}, + {0x26, 0x0c, 0x04}, + {0x26, 0x0d, 0xfa}, + {0x26, 0x0e, 0xd6}, + {0x26, 0x0f, 0x5d}, + {0x26, 0x10, 0x0b}, + {0x26, 0x11, 0x6e}, + {0x26, 0x12, 0xaa}, + {0x26, 0x13, 0xba}, + {0x26, 0x14, 0xfc}, + {0x26, 0x15, 0x52}, + {0x26, 0x16, 0x03}, + {0x26, 0x17, 0x6f}, + {0x26, 0x18, 0x06}, // Biquad - BQ13 Left - Filter: Equalizer (Q Factor) Frequency: 5000 Hz Gain: -8dB QVal: 0.6 Bandwidth: 1000 Hz + {0x26, 0x19, 0x0a}, + {0x26, 0x1a, 0xe0}, + {0x26, 0x1b, 0xa9}, + {0x26, 0x1c, 0xf7}, + {0x26, 0x1d, 0x02}, + {0x26, 0x1e, 0x28}, + {0x26, 0x1f, 0xdd}, + {0x26, 0x20, 0x03}, + {0x26, 0x21, 0x73}, + {0x26, 0x22, 0xf7}, + {0x26, 0x23, 0xaa}, + {0x26, 0x24, 0x08}, + {0x26, 0x25, 0xfd}, + {0x26, 0x26, 0xd7}, + {0x26, 0x27, 0x23}, + {0x26, 0x28, 0xfe}, + {0x26, 0x29, 0x81}, + {0x26, 0x2a, 0x27}, + {0x26, 0x2b, 0xad}, + {0x26, 0x2c, 0x05}, // Biquad - BQ14 Left - Filter: Equalizer (Q Factor) Frequency: 8000 Hz Gain: -8dB QVal: 0.6 Bandwidth: 1000 Hz + {0x26, 0x2d, 0x7b}, + {0x26, 0x2e, 0x6d}, + {0x26, 0x2f, 0x7c}, + {0x26, 0x30, 0xf9}, + {0x26, 0x31, 0x63}, + {0x26, 0x32, 0xa0}, + {0x26, 0x33, 0xde}, + {0x26, 0x34, 0x02}, + {0x26, 0x35, 0x26}, + {0x26, 0x36, 0xc1}, + {0x26, 0x37, 0x37}, + {0x26, 0x38, 0x06}, + {0x26, 0x39, 0x9c}, + {0x26, 0x3a, 0x5f}, + {0x26, 0x3b, 0x22}, + {0x26, 0x3c, 0x00}, + {0x26, 0x3d, 0x5d}, + {0x26, 0x3e, 0xd1}, + {0x26, 0x3f, 0x4d}, + {0x26, 0x40, 0x04}, // Biquad - BQ15 Left - Filter: Equalizer (Q Factor) Frequency: 16000 Hz Gain: -8dB QVal: 0.5 Bandwidth: 1000 Hz + {0x26, 0x41, 0x82}, + {0x26, 0x42, 0xdc}, + {0x26, 0x43, 0xce}, + {0x26, 0x44, 0xfd}, + {0x26, 0x45, 0xcb}, + {0x26, 0x46, 0xe1}, + {0x26, 0x47, 0x9a}, + {0x26, 0x48, 0xff}, + {0x26, 0x49, 0xe5}, + {0x26, 0x4a, 0x5f}, + {0x26, 0x4b, 0xfe}, + {0x26, 0x4c, 0x02}, + {0x26, 0x4d, 0x34}, + {0x26, 0x4e, 0x1e}, + {0x26, 0x4f, 0x66}, + {0x26, 0x50, 0x03}, + {0x26, 0x51, 0x97}, + {0x26, 0x52, 0xc3}, + {0x26, 0x53, 0x34}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_left_m7[TAS5805M_EQ_REG_PER_STEP] = { + {0x24, 0x18, 0x07}, // Biquad - BQ1 Left - Filter: Equalizer (Q Factor) Frequency: 20 Hz Gain: -7dB QVal: 2 Bandwidth: 1000 Hz + {0x24, 0x19, 0xff}, + {0x24, 0x1a, 0x2b}, + {0x24, 0x1b, 0xa0}, + {0x24, 0x1c, 0xf0}, + {0x24, 0x1d, 0x03}, + {0x24, 0x1e, 0x00}, + {0x24, 0x1f, 0x8b}, + {0x24, 0x20, 0x07}, + {0x24, 0x21, 0xfd}, + {0x24, 0x22, 0xd4}, + {0x24, 0x23, 0xbb}, + {0x24, 0x24, 0x0f}, + {0x24, 0x25, 0xfc}, + {0x24, 0x26, 0xff}, + {0x24, 0x27, 0x75}, + {0x24, 0x28, 0xf8}, + {0x24, 0x29, 0x02}, + {0x24, 0x2a, 0xff}, + {0x24, 0x2b, 0xa5}, + {0x24, 0x2c, 0x07}, // Biquad - BQ2 Left - Filter: Equalizer (Q Factor) Frequency: 31.5 Hz Gain: -7dB QVal: 2 Bandwidth: 1000 Hz + {0x24, 0x2d, 0xfe}, + {0x24, 0x2e, 0xb1}, + {0x24, 0x2f, 0xa6}, + {0x24, 0x30, 0xf0}, + {0x24, 0x31, 0x04}, + {0x24, 0x32, 0xba}, + {0x24, 0x33, 0xc2}, + {0x24, 0x34, 0x07}, + {0x24, 0x35, 0xfc}, + {0x24, 0x36, 0x95}, + {0x24, 0x37, 0xd1}, + {0x24, 0x38, 0x0f}, + {0x24, 0x39, 0xfb}, + {0x24, 0x3a, 0x45}, + {0x24, 0x3b, 0x3e}, + {0x24, 0x3c, 0xf8}, + {0x24, 0x3d, 0x04}, + {0x24, 0x3e, 0xb8}, + {0x24, 0x3f, 0x88}, + {0x24, 0x40, 0x07}, // Biquad - BQ3 Left - Filter: Equalizer (Q Factor) Frequency: 50 Hz Gain: -7dB QVal: 1.5 Bandwidth: 1000 Hz + {0x24, 0x41, 0xfd}, + {0x24, 0x42, 0x3d}, + {0x24, 0x43, 0x4a}, + {0x24, 0x44, 0xf0}, + {0x24, 0x45, 0x0a}, + {0x24, 0x46, 0x00}, + {0x24, 0x47, 0x0e}, + {0x24, 0x48, 0x07}, + {0x24, 0x49, 0xf8}, + {0x24, 0x4a, 0xc8}, + {0x24, 0x4b, 0x42}, + {0x24, 0x4c, 0x0f}, + {0x24, 0x4d, 0xf5}, + {0x24, 0x4e, 0xff}, + {0x24, 0x4f, 0xf2}, + {0x24, 0x50, 0xf8}, + {0x24, 0x51, 0x09}, + {0x24, 0x52, 0xfa}, + {0x24, 0x53, 0x74}, + {0x24, 0x54, 0x07}, // Biquad - BQ4 Left - Filter: Equalizer (Q Factor) Frequency: 80 Hz Gain: -7dB QVal: 1.5 Bandwidth: 1000 Hz + {0x24, 0x55, 0xfb}, + {0x24, 0x56, 0x96}, + {0x24, 0x57, 0xea}, + {0x24, 0x58, 0xf0}, + {0x24, 0x59, 0x0f}, + {0x24, 0x5a, 0xff}, + {0x24, 0x5b, 0x7b}, + {0x24, 0x5c, 0x07}, + {0x24, 0x5d, 0xf4}, + {0x24, 0x5e, 0x77}, + {0x24, 0x5f, 0xed}, + {0x24, 0x60, 0x0f}, + {0x24, 0x61, 0xf0}, + {0x24, 0x62, 0x00}, + {0x24, 0x63, 0x85}, + {0x24, 0x64, 0xf8}, + {0x24, 0x65, 0x0f}, + {0x24, 0x66, 0xf1}, + {0x24, 0x67, 0x29}, + {0x24, 0x68, 0x07}, // Biquad - BQ5 Left - Filter: Equalizer (Q Factor) Frequency: 125 Hz Gain: -7dB QVal: 1 Bandwidth: 1000 Hz + {0x24, 0x69, 0xf5}, + {0x24, 0x6a, 0xb7}, + {0x24, 0x6b, 0x79}, + {0x24, 0x6c, 0xf0}, + {0x24, 0x6d, 0x25}, + {0x24, 0x6e, 0x4e}, + {0x24, 0x6f, 0x3a}, + {0x24, 0x70, 0x07}, + {0x24, 0x71, 0xe5}, + {0x24, 0x72, 0x1d}, + {0x24, 0x73, 0x13}, + {0x24, 0x74, 0x0f}, + {0x24, 0x75, 0xda}, + {0x24, 0x76, 0xb1}, + {0x24, 0x77, 0xc6}, + {0x24, 0x78, 0xf8}, + {0x24, 0x79, 0x25}, + {0x24, 0x7a, 0x2b}, + {0x24, 0x7b, 0x74}, + {0x24, 0x7c, 0x07}, // Biquad - BQ6 Left - Filter: Equalizer (Q Factor) Frequency: 200 Hz Gain: -7dB QVal: 1 Bandwidth: 1000 Hz + {0x24, 0x7d, 0xef}, + {0x24, 0x7e, 0xa2}, + {0x24, 0x7f, 0xc4}, + {0x25, 0x08, 0xf0}, + {0x25, 0x09, 0x3b}, + {0x25, 0x0a, 0x7e}, + {0x25, 0x0b, 0xd1}, + {0x25, 0x0c, 0x07}, + {0x25, 0x0d, 0xd5}, + {0x25, 0x0e, 0x36}, + {0x25, 0x0f, 0xf5}, + {0x25, 0x10, 0x0f}, + {0x25, 0x11, 0xc4}, + {0x25, 0x12, 0x81}, + {0x25, 0x13, 0x2f}, + {0x25, 0x14, 0xf8}, + {0x25, 0x15, 0x3b}, + {0x25, 0x16, 0x26}, + {0x25, 0x17, 0x48}, + {0x25, 0x18, 0x07}, // Biquad - BQ7 Left - Filter: Equalizer (Q Factor) Frequency: 315 Hz Gain: -7dB QVal: 0.9 Bandwidth: 1000 Hz + {0x25, 0x19, 0xe3}, + {0x25, 0x1a, 0xab}, + {0x25, 0x1b, 0x63}, + {0x25, 0x1c, 0xf0}, + {0x25, 0x1d, 0x67}, + {0x25, 0x1e, 0x40}, + {0x25, 0x1f, 0x55}, + {0x25, 0x20, 0x07}, + {0x25, 0x21, 0xb5}, + {0x25, 0x22, 0xed}, + {0x25, 0x23, 0x8c}, + {0x25, 0x24, 0x0f}, + {0x25, 0x25, 0x98}, + {0x25, 0x26, 0xbf}, + {0x25, 0x27, 0xab}, + {0x25, 0x28, 0xf8}, + {0x25, 0x29, 0x66}, + {0x25, 0x2a, 0x67}, + {0x25, 0x2b, 0x11}, + {0x25, 0x2c, 0x07}, // Biquad - BQ8 Left - Filter: Equalizer (Q Factor) Frequency: 500 Hz Gain: -7dB QVal: 0.9 Bandwidth: 1000 Hz + {0x25, 0x2d, 0xd3}, + {0x25, 0x2e, 0xae}, + {0x25, 0x2f, 0x80}, + {0x25, 0x30, 0xf0}, + {0x25, 0x31, 0xa2}, + {0x25, 0x32, 0x4c}, + {0x25, 0x33, 0x8c}, + {0x25, 0x34, 0x07}, + {0x25, 0x35, 0x8c}, + {0x25, 0x36, 0x20}, + {0x25, 0x37, 0x6b}, + {0x25, 0x38, 0x0f}, + {0x25, 0x39, 0x5d}, + {0x25, 0x3a, 0xb3}, + {0x25, 0x3b, 0x74}, + {0x25, 0x3c, 0xf8}, + {0x25, 0x3d, 0xa0}, + {0x25, 0x3e, 0x31}, + {0x25, 0x3f, 0x15}, + {0x25, 0x40, 0x07}, // Biquad - BQ9 Left - Filter: Equalizer (Q Factor) Frequency: 800 Hz Gain: -7dB QVal: 0.8 Bandwidth: 1000 Hz + {0x25, 0x41, 0xb2}, + {0x25, 0x42, 0xa5}, + {0x25, 0x43, 0xab}, + {0x25, 0x44, 0xf1}, + {0x25, 0x45, 0x1c}, + {0x25, 0x46, 0xd3}, + {0x25, 0x47, 0xd5}, + {0x25, 0x48, 0x07}, + {0x25, 0x49, 0x35}, + {0x25, 0x4a, 0xc1}, + {0x25, 0x4b, 0x72}, + {0x25, 0x4c, 0x0e}, + {0x25, 0x4d, 0xe3}, + {0x25, 0x4e, 0x2c}, + {0x25, 0x4f, 0x2b}, + {0x25, 0x50, 0xf9}, + {0x25, 0x51, 0x17}, + {0x25, 0x52, 0x98}, + {0x25, 0x53, 0xe3}, + {0x25, 0x54, 0x07}, // Biquad - BQ10 Left - Filter: Equalizer (Q Factor) Frequency: 1250 Hz Gain: -7dB QVal: 0.8 Bandwidth: 1000 Hz + {0x25, 0x55, 0x8b}, + {0x25, 0x56, 0x9a}, + {0x25, 0x57, 0xf7}, + {0x25, 0x58, 0xf1}, + {0x25, 0x59, 0xb1}, + {0x25, 0x5a, 0x02}, + {0x25, 0x5b, 0x69}, + {0x25, 0x5c, 0x06}, + {0x25, 0x5d, 0xcf}, + {0x25, 0x5e, 0xad}, + {0x25, 0x5f, 0x9e}, + {0x25, 0x60, 0x0e}, + {0x25, 0x61, 0x4e}, + {0x25, 0x62, 0xfd}, + {0x25, 0x63, 0x97}, + {0x25, 0x64, 0xf9}, + {0x25, 0x65, 0xa4}, + {0x25, 0x66, 0xb7}, + {0x25, 0x67, 0x6b}, + {0x25, 0x68, 0x07}, // Biquad - BQ11 Left - Filter: Equalizer (Q Factor) Frequency: 2000 Hz Gain: -7dB QVal: 0.7 Bandwidth: 1000 Hz + {0x25, 0x69, 0x3b}, + {0x25, 0x6a, 0xdb}, + {0x25, 0x6b, 0x62}, + {0x25, 0x6c, 0xf2}, + {0x25, 0x6d, 0xe1}, + {0x25, 0x6e, 0xf2}, + {0x25, 0x6f, 0xeb}, + {0x25, 0x70, 0x05}, + {0x25, 0x71, 0xff}, + {0x25, 0x72, 0x2b}, + {0x25, 0x73, 0xae}, + {0x25, 0x74, 0x0d}, + {0x25, 0x75, 0x1e}, + {0x25, 0x76, 0x0d}, + {0x25, 0x77, 0x15}, + {0x25, 0x78, 0xfa}, + {0x25, 0x79, 0xc4}, + {0x25, 0x7a, 0xf8}, + {0x25, 0x7b, 0xef}, + {0x25, 0x7c, 0x06}, // Biquad - BQ12 Left - Filter: Equalizer (Q Factor) Frequency: 3150 Hz Gain: -7dB QVal: 0.7 Bandwidth: 1000 Hz + {0x25, 0x7d, 0xe7}, + {0x25, 0x7e, 0x09}, + {0x25, 0x7f, 0xae}, + {0x26, 0x08, 0xf4}, + {0x26, 0x09, 0x38}, + {0x26, 0x0a, 0xca}, + {0x26, 0x0b, 0xd8}, + {0x26, 0x0c, 0x05}, + {0x26, 0x0d, 0x21}, + {0x26, 0x0e, 0x67}, + {0x26, 0x0f, 0xb7}, + {0x26, 0x10, 0x0b}, + {0x26, 0x11, 0xc7}, + {0x26, 0x12, 0x35}, + {0x26, 0x13, 0x28}, + {0x26, 0x14, 0xfb}, + {0x26, 0x15, 0xf7}, + {0x26, 0x16, 0x8e}, + {0x26, 0x17, 0x9b}, + {0x26, 0x18, 0x06}, // Biquad - BQ13 Left - Filter: Equalizer (Q Factor) Frequency: 5000 Hz Gain: -7dB QVal: 0.6 Bandwidth: 1000 Hz + {0x26, 0x19, 0x52}, + {0x26, 0x1a, 0x6d}, + {0x26, 0x1b, 0xa1}, + {0x26, 0x1c, 0xf6}, + {0x26, 0x1d, 0x97}, + {0x26, 0x1e, 0xb0}, + {0x26, 0x1f, 0x30}, + {0x26, 0x20, 0x03}, + {0x26, 0x21, 0x9c}, + {0x26, 0x22, 0xda}, + {0x26, 0x23, 0xf2}, + {0x26, 0x24, 0x09}, + {0x26, 0x25, 0x68}, + {0x26, 0x26, 0x4f}, + {0x26, 0x27, 0xd0}, + {0x26, 0x28, 0xfe}, + {0x26, 0x29, 0x10}, + {0x26, 0x2a, 0xb7}, + {0x26, 0x2b, 0x6c}, + {0x26, 0x2c, 0x05}, // Biquad - BQ14 Left - Filter: Equalizer (Q Factor) Frequency: 8000 Hz Gain: -7dB QVal: 0.6 Bandwidth: 1000 Hz + {0x26, 0x2d, 0xd0}, + {0x26, 0x2e, 0x0b}, + {0x26, 0x2f, 0xc7}, + {0x26, 0x30, 0xf8}, + {0x26, 0x31, 0xfd}, + {0x26, 0x32, 0x96}, + {0x26, 0x33, 0xa5}, + {0x26, 0x34, 0x02}, + {0x26, 0x35, 0x47}, + {0x26, 0x36, 0xf6}, + {0x26, 0x37, 0x44}, + {0x26, 0x38, 0x07}, + {0x26, 0x39, 0x02}, + {0x26, 0x3a, 0x69}, + {0x26, 0x3b, 0x5b}, + {0x26, 0x3c, 0xff}, + {0x26, 0x3d, 0xe7}, + {0x26, 0x3e, 0xfd}, + {0x26, 0x3f, 0xf6}, + {0x26, 0x40, 0x04}, // Biquad - BQ15 Left - Filter: Equalizer (Q Factor) Frequency: 16000 Hz Gain: -7dB QVal: 0.5 Bandwidth: 1000 Hz + {0x26, 0x41, 0xe5}, + {0x26, 0x42, 0xa4}, + {0x26, 0x43, 0x72}, + {0x26, 0x44, 0xfd}, + {0x26, 0x45, 0x9b}, + {0x26, 0x46, 0xa1}, + {0x26, 0x47, 0x48}, + {0x26, 0x48, 0xff}, + {0x26, 0x49, 0xe3}, + {0x26, 0x4a, 0x18}, + {0x26, 0x4b, 0xff}, + {0x26, 0x4c, 0x02}, + {0x26, 0x4d, 0x64}, + {0x26, 0x4e, 0x5e}, + {0x26, 0x4f, 0xb8}, + {0x26, 0x50, 0x03}, + {0x26, 0x51, 0x37}, + {0x26, 0x52, 0x42}, + {0x26, 0x53, 0x8f}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_left_m6[TAS5805M_EQ_REG_PER_STEP] = { + {0x24, 0x18, 0x07}, // Biquad - BQ1 Left - Filter: Equalizer (Q Factor) Frequency: 20 Hz Gain: -6dB QVal: 2 Bandwidth: 1000 Hz + {0x24, 0x19, 0xff}, + {0x24, 0x1a, 0x55}, + {0x24, 0x1b, 0x5a}, + {0x24, 0x1c, 0xf0}, + {0x24, 0x1d, 0x02}, + {0x24, 0x1e, 0xad}, + {0x24, 0x1f, 0x1e}, + {0x24, 0x20, 0x07}, + {0x24, 0x21, 0xfd}, + {0x24, 0x22, 0xfe}, + {0x24, 0x23, 0x6e}, + {0x24, 0x24, 0x0f}, + {0x24, 0x25, 0xfd}, + {0x24, 0x26, 0x52}, + {0x24, 0x27, 0xe2}, + {0x24, 0x28, 0xf8}, + {0x24, 0x29, 0x02}, + {0x24, 0x2a, 0xac}, + {0x24, 0x2b, 0x38}, + {0x24, 0x2c, 0x07}, // Biquad - BQ2 Left - Filter: Equalizer (Q Factor) Frequency: 31.5 Hz Gain: -6dB QVal: 2 Bandwidth: 1000 Hz + {0x24, 0x2d, 0xfe}, + {0x24, 0x2e, 0xf3}, + {0x24, 0x2f, 0x54}, + {0x24, 0x30, 0xf0}, + {0x24, 0x31, 0x04}, + {0x24, 0x32, 0x37}, + {0x24, 0x33, 0x78}, + {0x24, 0x34, 0x07}, + {0x24, 0x35, 0xfc}, + {0x24, 0x36, 0xd7}, + {0x24, 0x37, 0x6e}, + {0x24, 0x38, 0x0f}, + {0x24, 0x39, 0xfb}, + {0x24, 0x3a, 0xc8}, + {0x24, 0x3b, 0x88}, + {0x24, 0x3c, 0xf8}, + {0x24, 0x3d, 0x04}, + {0x24, 0x3e, 0x35}, + {0x24, 0x3f, 0x3e}, + {0x24, 0x40, 0x07}, // Biquad - BQ3 Left - Filter: Equalizer (Q Factor) Frequency: 50 Hz Gain: -6dB QVal: 1.5 Bandwidth: 1000 Hz + {0x24, 0x41, 0xfd}, + {0x24, 0x42, 0xc8}, + {0x24, 0x43, 0x09}, + {0x24, 0x44, 0xf0}, + {0x24, 0x45, 0x08}, + {0x24, 0x46, 0xea}, + {0x24, 0x47, 0xde}, + {0x24, 0x48, 0x07}, + {0x24, 0x49, 0xf9}, + {0x24, 0x4a, 0x52}, + {0x24, 0x4b, 0xb3}, + {0x24, 0x4c, 0x0f}, + {0x24, 0x4d, 0xf7}, + {0x24, 0x4e, 0x15}, + {0x24, 0x4f, 0x22}, + {0x24, 0x50, 0xf8}, + {0x24, 0x51, 0x08}, + {0x24, 0x52, 0xe5}, + {0x24, 0x53, 0x43}, + {0x24, 0x54, 0x07}, // Biquad - BQ4 Left - Filter: Equalizer (Q Factor) Frequency: 80 Hz Gain: -6dB QVal: 1.5 Bandwidth: 1000 Hz + {0x24, 0x55, 0xfc}, + {0x24, 0x56, 0x74}, + {0x24, 0x57, 0x71}, + {0x24, 0x58, 0xf0}, + {0x24, 0x59, 0x0e}, + {0x24, 0x5a, 0x45}, + {0x24, 0x5b, 0x34}, + {0x24, 0x5c, 0x07}, + {0x24, 0x5d, 0xf5}, + {0x24, 0x5e, 0x54}, + {0x24, 0x5f, 0xae}, + {0x24, 0x60, 0x0f}, + {0x24, 0x61, 0xf1}, + {0x24, 0x62, 0xba}, + {0x24, 0x63, 0xcc}, + {0x24, 0x64, 0xf8}, + {0x24, 0x65, 0x0e}, + {0x24, 0x66, 0x36}, + {0x24, 0x67, 0xe1}, + {0x24, 0x68, 0x07}, // Biquad - BQ5 Left - Filter: Equalizer (Q Factor) Frequency: 125 Hz Gain: -6dB QVal: 1 Bandwidth: 1000 Hz + {0x24, 0x69, 0xf7}, + {0x24, 0x6a, 0xba}, + {0x24, 0x6b, 0xc8}, + {0x24, 0x6c, 0xf0}, + {0x24, 0x6d, 0x21}, + {0x24, 0x6e, 0x4b}, + {0x24, 0x6f, 0xd8}, + {0x24, 0x70, 0x07}, + {0x24, 0x71, 0xe7}, + {0x24, 0x72, 0x1c}, + {0x24, 0x73, 0x2f}, + {0x24, 0x74, 0x0f}, + {0x24, 0x75, 0xde}, + {0x24, 0x76, 0xb4}, + {0x24, 0x77, 0x28}, + {0x24, 0x78, 0xf8}, + {0x24, 0x79, 0x21}, + {0x24, 0x7a, 0x29}, + {0x24, 0x7b, 0x09}, + {0x24, 0x7c, 0x07}, // Biquad - BQ6 Left - Filter: Equalizer (Q Factor) Frequency: 200 Hz Gain: -6dB QVal: 1 Bandwidth: 1000 Hz + {0x24, 0x7d, 0xf2}, + {0x24, 0x7e, 0xd4}, + {0x24, 0x7f, 0xd3}, + {0x25, 0x08, 0xf0}, + {0x25, 0x09, 0x35}, + {0x25, 0x0a, 0x25}, + {0x25, 0x0b, 0x79}, + {0x25, 0x0c, 0x07}, + {0x25, 0x0d, 0xd8}, + {0x25, 0x0e, 0x5e}, + {0x25, 0x0f, 0x61}, + {0x25, 0x10, 0x0f}, + {0x25, 0x11, 0xca}, + {0x25, 0x12, 0xda}, + {0x25, 0x13, 0x87}, + {0x25, 0x14, 0xf8}, + {0x25, 0x15, 0x34}, + {0x25, 0x16, 0xcc}, + {0x25, 0x17, 0xcc}, + {0x25, 0x18, 0x07}, // Biquad - BQ7 Left - Filter: Equalizer (Q Factor) Frequency: 315 Hz Gain: -6dB QVal: 0.9 Bandwidth: 1000 Hz + {0x25, 0x19, 0xe9}, + {0x25, 0x1a, 0x2c}, + {0x25, 0x1b, 0xef}, + {0x25, 0x1c, 0xf0}, + {0x25, 0x1d, 0x5c}, + {0x25, 0x1e, 0x5d}, + {0x25, 0x1f, 0xc2}, + {0x25, 0x20, 0x07}, + {0x25, 0x21, 0xbb}, + {0x25, 0x22, 0x4f}, + {0x25, 0x23, 0x2c}, + {0x25, 0x24, 0x0f}, + {0x25, 0x25, 0xa3}, + {0x25, 0x26, 0xa2}, + {0x25, 0x27, 0x3e}, + {0x25, 0x28, 0xf8}, + {0x25, 0x29, 0x5b}, + {0x25, 0x2a, 0x83}, + {0x25, 0x2b, 0xe6}, + {0x25, 0x2c, 0x07}, // Biquad - BQ8 Left - Filter: Equalizer (Q Factor) Frequency: 500 Hz Gain: -6dB QVal: 0.9 Bandwidth: 1000 Hz + {0x25, 0x2d, 0xdc}, + {0x25, 0x2e, 0x3d}, + {0x25, 0x2f, 0x6a}, + {0x25, 0x30, 0xf0}, + {0x25, 0x31, 0x91}, + {0x25, 0x32, 0x7f}, + {0x25, 0x33, 0x43}, + {0x25, 0x34, 0x07}, + {0x25, 0x35, 0x94}, + {0x25, 0x36, 0x61}, + {0x25, 0x37, 0x17}, + {0x25, 0x38, 0x0f}, + {0x25, 0x39, 0x6e}, + {0x25, 0x3a, 0x80}, + {0x25, 0x3b, 0xbd}, + {0x25, 0x3c, 0xf8}, + {0x25, 0x3d, 0x8f}, + {0x25, 0x3e, 0x61}, + {0x25, 0x3f, 0x7e}, + {0x25, 0x40, 0x07}, // Biquad - BQ9 Left - Filter: Equalizer (Q Factor) Frequency: 800 Hz Gain: -6dB QVal: 0.8 Bandwidth: 1000 Hz + {0x25, 0x41, 0xc1}, + {0x25, 0x42, 0x62}, + {0x25, 0x43, 0xa3}, + {0x25, 0x44, 0xf1}, + {0x25, 0x45, 0x00}, + {0x25, 0x46, 0x53}, + {0x25, 0x47, 0x06}, + {0x25, 0x48, 0x07}, + {0x25, 0x49, 0x43}, + {0x25, 0x4a, 0x8f}, + {0x25, 0x4b, 0x4c}, + {0x25, 0x4c, 0x0e}, + {0x25, 0x4d, 0xff}, + {0x25, 0x4e, 0xac}, + {0x25, 0x4f, 0xfa}, + {0x25, 0x50, 0xf8}, + {0x25, 0x51, 0xfb}, + {0x25, 0x52, 0x0e}, + {0x25, 0x53, 0x11}, + {0x25, 0x54, 0x07}, // Biquad - BQ10 Left - Filter: Equalizer (Q Factor) Frequency: 1250 Hz Gain: -6dB QVal: 0.8 Bandwidth: 1000 Hz + {0x25, 0x55, 0xa1}, + {0x25, 0x56, 0x6c}, + {0x25, 0x57, 0xd9}, + {0x25, 0x58, 0xf1}, + {0x25, 0x59, 0x87}, + {0x25, 0x5a, 0xa1}, + {0x25, 0x5b, 0xa6}, + {0x25, 0x5c, 0x06}, + {0x25, 0x5d, 0xe3}, + {0x25, 0x5e, 0x60}, + {0x25, 0x5f, 0x0c}, + {0x25, 0x60, 0x0e}, + {0x25, 0x61, 0x78}, + {0x25, 0x62, 0x5e}, + {0x25, 0x63, 0x5a}, + {0x25, 0x64, 0xf9}, + {0x25, 0x65, 0x7b}, + {0x25, 0x66, 0x33}, + {0x25, 0x67, 0x1b}, + {0x25, 0x68, 0x07}, // Biquad - BQ11 Left - Filter: Equalizer (Q Factor) Frequency: 2000 Hz Gain: -6dB QVal: 0.7 Bandwidth: 1000 Hz + {0x25, 0x69, 0x5f}, + {0x25, 0x6a, 0x62}, + {0x25, 0x6b, 0x39}, + {0x25, 0x6c, 0xf2}, + {0x25, 0x6d, 0xa1}, + {0x25, 0x6e, 0x86}, + {0x25, 0x6f, 0xdb}, + {0x25, 0x70, 0x06}, + {0x25, 0x71, 0x1c}, + {0x25, 0x72, 0x9f}, + {0x25, 0x73, 0x36}, + {0x25, 0x74, 0x0d}, + {0x25, 0x75, 0x5e}, + {0x25, 0x76, 0x79}, + {0x25, 0x77, 0x25}, + {0x25, 0x78, 0xfa}, + {0x25, 0x79, 0x83}, + {0x25, 0x7a, 0xfe}, + {0x25, 0x7b, 0x91}, + {0x25, 0x7c, 0x07}, // Biquad - BQ12 Left - Filter: Equalizer (Q Factor) Frequency: 3150 Hz Gain: -6dB QVal: 0.7 Bandwidth: 1000 Hz + {0x25, 0x7d, 0x18}, + {0x25, 0x7e, 0x00}, + {0x25, 0x7f, 0xbd}, + {0x26, 0x08, 0xf3}, + {0x26, 0x09, 0xe5}, + {0x26, 0x0a, 0x3d}, + {0x26, 0x0b, 0x7c}, + {0x26, 0x0c, 0x05}, + {0x26, 0x0d, 0x45}, + {0x26, 0x0e, 0xcc}, + {0x26, 0x0f, 0xc9}, + {0x26, 0x10, 0x0c}, + {0x26, 0x11, 0x1a}, + {0x26, 0x12, 0xc2}, + {0x26, 0x13, 0x84}, + {0x26, 0x14, 0xfb}, + {0x26, 0x15, 0xa2}, + {0x26, 0x16, 0x32}, + {0x26, 0x17, 0x7a}, + {0x26, 0x18, 0x06}, // Biquad - BQ13 Left - Filter: Equalizer (Q Factor) Frequency: 5000 Hz Gain: -6dB QVal: 0.6 Bandwidth: 1000 Hz + {0x26, 0x19, 0x98}, + {0x26, 0x1a, 0x04}, + {0x26, 0x1b, 0x28}, + {0x26, 0x1c, 0xf6}, + {0x26, 0x1d, 0x30}, + {0x26, 0x1e, 0x23}, + {0x26, 0x1f, 0x2c}, + {0x26, 0x20, 0x03}, + {0x26, 0x21, 0xc4}, + {0x26, 0x22, 0x9f}, + {0x26, 0x23, 0x1b}, + {0x26, 0x24, 0x09}, + {0x26, 0x25, 0xcf}, + {0x26, 0x26, 0xdc}, + {0x26, 0x27, 0xd4}, + {0x26, 0x28, 0xfd}, + {0x26, 0x29, 0xa3}, + {0x26, 0x2a, 0x5c}, + {0x26, 0x2b, 0xbc}, + {0x26, 0x2c, 0x06}, // Biquad - BQ14 Left - Filter: Equalizer (Q Factor) Frequency: 8000 Hz Gain: -6dB QVal: 0.6 Bandwidth: 1000 Hz + {0x26, 0x2d, 0x24}, + {0x26, 0x2e, 0x8c}, + {0x26, 0x2f, 0xe2}, + {0x26, 0x30, 0xf8}, + {0x26, 0x31, 0x97}, + {0x26, 0x32, 0xaf}, + {0x26, 0x33, 0x9f}, + {0x26, 0x34, 0x02}, + {0x26, 0x35, 0x69}, + {0x26, 0x36, 0x1f}, + {0x26, 0x37, 0xdd}, + {0x26, 0x38, 0x07}, + {0x26, 0x39, 0x68}, + {0x26, 0x3a, 0x50}, + {0x26, 0x3b, 0x61}, + {0x26, 0x3c, 0xff}, + {0x26, 0x3d, 0x72}, + {0x26, 0x3e, 0x53}, + {0x26, 0x3f, 0x41}, + {0x26, 0x40, 0x05}, // Biquad - BQ15 Left - Filter: Equalizer (Q Factor) Frequency: 16000 Hz Gain: -6dB QVal: 0.5 Bandwidth: 1000 Hz + {0x26, 0x41, 0x4d}, + {0x26, 0x42, 0x18}, + {0x26, 0x43, 0xc5}, + {0x26, 0x44, 0xfd}, + {0x26, 0x45, 0x69}, + {0x26, 0x46, 0x18}, + {0x26, 0x47, 0x6a}, + {0x26, 0x48, 0xff}, + {0x26, 0x49, 0xe0}, + {0x26, 0x4a, 0xb6}, + {0x26, 0x4b, 0x68}, + {0x26, 0x4c, 0x02}, + {0x26, 0x4d, 0x96}, + {0x26, 0x4e, 0xe7}, + {0x26, 0x4f, 0x96}, + {0x26, 0x50, 0x02}, + {0x26, 0x51, 0xd2}, + {0x26, 0x52, 0x30}, + {0x26, 0x53, 0xd3}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_left_m5[TAS5805M_EQ_REG_PER_STEP] = { + {0x24, 0x18, 0x07}, // Biquad - BQ1 Left - Filter: Equalizer (Q Factor) Frequency: 20 Hz Gain: -5dB QVal: 2 Bandwidth: 1000 Hz + {0x24, 0x19, 0xff}, + {0x24, 0x1a, 0x7a}, + {0x24, 0x1b, 0x8c}, + {0x24, 0x1c, 0xf0}, + {0x24, 0x1d, 0x02}, + {0x24, 0x1e, 0x62}, + {0x24, 0x1f, 0xc1}, + {0x24, 0x20, 0x07}, + {0x24, 0x21, 0xfe}, + {0x24, 0x22, 0x23}, + {0x24, 0x23, 0x9a}, + {0x24, 0x24, 0x0f}, + {0x24, 0x25, 0xfd}, + {0x24, 0x26, 0x9d}, + {0x24, 0x27, 0x3f}, + {0x24, 0x28, 0xf8}, + {0x24, 0x29, 0x02}, + {0x24, 0x2a, 0x61}, + {0x24, 0x2b, 0xdb}, + {0x24, 0x2c, 0x07}, // Biquad - BQ2 Left - Filter: Equalizer (Q Factor) Frequency: 31.5 Hz Gain: -5dB QVal: 2 Bandwidth: 1000 Hz + {0x24, 0x2d, 0xff}, + {0x24, 0x2e, 0x2d}, + {0x24, 0x2f, 0xe1}, + {0x24, 0x30, 0xf0}, + {0x24, 0x31, 0x03}, + {0x24, 0x32, 0xc2}, + {0x24, 0x33, 0x6d}, + {0x24, 0x34, 0x07}, + {0x24, 0x35, 0xfd}, + {0x24, 0x36, 0x11}, + {0x24, 0x37, 0xec}, + {0x24, 0x38, 0x0f}, + {0x24, 0x39, 0xfc}, + {0x24, 0x3a, 0x3d}, + {0x24, 0x3b, 0x93}, + {0x24, 0x3c, 0xf8}, + {0x24, 0x3d, 0x03}, + {0x24, 0x3e, 0xc0}, + {0x24, 0x3f, 0x33}, + {0x24, 0x40, 0x07}, // Biquad - BQ3 Left - Filter: Equalizer (Q Factor) Frequency: 50 Hz Gain: -5dB QVal: 1.5 Bandwidth: 1000 Hz + {0x24, 0x41, 0xfe}, + {0x24, 0x42, 0x43}, + {0x24, 0x43, 0xc2}, + {0x24, 0x44, 0xf0}, + {0x24, 0x45, 0x07}, + {0x24, 0x46, 0xf3}, + {0x24, 0x47, 0xb2}, + {0x24, 0x48, 0x07}, + {0x24, 0x49, 0xf9}, + {0x24, 0x4a, 0xce}, + {0x24, 0x4b, 0x27}, + {0x24, 0x4c, 0x0f}, + {0x24, 0x4d, 0xf8}, + {0x24, 0x4e, 0x0c}, + {0x24, 0x4f, 0x4e}, + {0x24, 0x50, 0xf8}, + {0x24, 0x51, 0x07}, + {0x24, 0x52, 0xee}, + {0x24, 0x53, 0x18}, + {0x24, 0x54, 0x07}, // Biquad - BQ4 Left - Filter: Equalizer (Q Factor) Frequency: 80 Hz Gain: -5dB QVal: 1.5 Bandwidth: 1000 Hz + {0x24, 0x55, 0xfd}, + {0x24, 0x56, 0x3a}, + {0x24, 0x57, 0x09}, + {0x24, 0x58, 0xf0}, + {0x24, 0x59, 0x0c}, + {0x24, 0x5a, 0xba}, + {0x24, 0x5b, 0xb5}, + {0x24, 0x5c, 0x07}, + {0x24, 0x5d, 0xf6}, + {0x24, 0x5e, 0x19}, + {0x24, 0x5f, 0x96}, + {0x24, 0x60, 0x0f}, + {0x24, 0x61, 0xf3}, + {0x24, 0x62, 0x45}, + {0x24, 0x63, 0x4b}, + {0x24, 0x64, 0xf8}, + {0x24, 0x65, 0x0c}, + {0x24, 0x66, 0xac}, + {0x24, 0x67, 0x61}, + {0x24, 0x68, 0x07}, // Biquad - BQ5 Left - Filter: Equalizer (Q Factor) Frequency: 125 Hz Gain: -5dB QVal: 1 Bandwidth: 1000 Hz + {0x24, 0x69, 0xf9}, + {0x24, 0x6a, 0x86}, + {0x24, 0x6b, 0xe9}, + {0x24, 0x6c, 0xf0}, + {0x24, 0x6d, 0x1d}, + {0x24, 0x6e, 0xb7}, + {0x24, 0x6f, 0x5e}, + {0x24, 0x70, 0x07}, + {0x24, 0x71, 0xe8}, + {0x24, 0x72, 0xe4}, + {0x24, 0x73, 0x90}, + {0x24, 0x74, 0x0f}, + {0x24, 0x75, 0xe2}, + {0x24, 0x76, 0x48}, + {0x24, 0x77, 0xa2}, + {0x24, 0x78, 0xf8}, + {0x24, 0x79, 0x1d}, + {0x24, 0x7a, 0x94}, + {0x24, 0x7b, 0x87}, + {0x24, 0x7c, 0x07}, // Biquad - BQ6 Left - Filter: Equalizer (Q Factor) Frequency: 200 Hz Gain: -5dB QVal: 1 Bandwidth: 1000 Hz + {0x24, 0x7d, 0xf5}, + {0x24, 0x7e, 0xb0}, + {0x24, 0x7f, 0x18}, + {0x25, 0x08, 0xf0}, + {0x25, 0x09, 0x2f}, + {0x25, 0x0a, 0x78}, + {0x25, 0x0b, 0x92}, + {0x25, 0x0c, 0x07}, + {0x25, 0x0d, 0xdb}, + {0x25, 0x0e, 0x30}, + {0x25, 0x0f, 0x23}, + {0x25, 0x10, 0x0f}, + {0x25, 0x11, 0xd0}, + {0x25, 0x12, 0x87}, + {0x25, 0x13, 0x6e}, + {0x25, 0x14, 0xf8}, + {0x25, 0x15, 0x2f}, + {0x25, 0x16, 0x1f}, + {0x25, 0x17, 0xc5}, + {0x25, 0x18, 0x07}, // Biquad - BQ7 Left - Filter: Equalizer (Q Factor) Frequency: 315 Hz Gain: -5dB QVal: 0.9 Bandwidth: 1000 Hz + {0x25, 0x19, 0xee}, + {0x25, 0x1a, 0x1b}, + {0x25, 0x1b, 0xaf}, + {0x25, 0x1c, 0xf0}, + {0x25, 0x1d, 0x52}, + {0x25, 0x1e, 0x9d}, + {0x25, 0x1f, 0x62}, + {0x25, 0x20, 0x07}, + {0x25, 0x21, 0xc0}, + {0x25, 0x22, 0x21}, + {0x25, 0x23, 0x53}, + {0x25, 0x24, 0x0f}, + {0x25, 0x25, 0xad}, + {0x25, 0x26, 0x62}, + {0x25, 0x27, 0x9e}, + {0x25, 0x28, 0xf8}, + {0x25, 0x29, 0x51}, + {0x25, 0x2a, 0xc2}, + {0x25, 0x2b, 0xfe}, + {0x25, 0x2c, 0x07}, // Biquad - BQ8 Left - Filter: Equalizer (Q Factor) Frequency: 500 Hz Gain: -5dB QVal: 0.9 Bandwidth: 1000 Hz + {0x25, 0x2d, 0xe3}, + {0x25, 0x2e, 0xed}, + {0x25, 0x2f, 0xe7}, + {0x25, 0x30, 0xf0}, + {0x25, 0x31, 0x82}, + {0x25, 0x32, 0x66}, + {0x25, 0x33, 0xa8}, + {0x25, 0x34, 0x07}, + {0x25, 0x35, 0x9b}, + {0x25, 0x36, 0xcb}, + {0x25, 0x37, 0x48}, + {0x25, 0x38, 0x0f}, + {0x25, 0x39, 0x7d}, + {0x25, 0x3a, 0x99}, + {0x25, 0x3b, 0x58}, + {0x25, 0x3c, 0xf8}, + {0x25, 0x3d, 0x80}, + {0x25, 0x3e, 0x46}, + {0x25, 0x3f, 0xd1}, + {0x25, 0x40, 0x07}, // Biquad - BQ9 Left - Filter: Equalizer (Q Factor) Frequency: 800 Hz Gain: -5dB QVal: 0.8 Bandwidth: 1000 Hz + {0x25, 0x41, 0xce}, + {0x25, 0x42, 0xb5}, + {0x25, 0x43, 0x2e}, + {0x25, 0x44, 0xf0}, + {0x25, 0x45, 0xe6}, + {0x25, 0x46, 0x8f}, + {0x25, 0x47, 0x22}, + {0x25, 0x48, 0x07}, + {0x25, 0x49, 0x50}, + {0x25, 0x4a, 0x09}, + {0x25, 0x4b, 0xb2}, + {0x25, 0x4c, 0x0f}, + {0x25, 0x4d, 0x19}, + {0x25, 0x4e, 0x70}, + {0x25, 0x4f, 0xde}, + {0x25, 0x50, 0xf8}, + {0x25, 0x51, 0xe1}, + {0x25, 0x52, 0x41}, + {0x25, 0x53, 0x20}, + {0x25, 0x54, 0x07}, // Biquad - BQ10 Left - Filter: Equalizer (Q Factor) Frequency: 1250 Hz Gain: -5dB QVal: 0.8 Bandwidth: 1000 Hz + {0x25, 0x55, 0xb5}, + {0x25, 0x56, 0x4a}, + {0x25, 0x57, 0xb7}, + {0x25, 0x58, 0xf1}, + {0x25, 0x59, 0x61}, + {0x25, 0x5a, 0xf5}, + {0x25, 0x5b, 0x18}, + {0x25, 0x5c, 0x06}, + {0x25, 0x5d, 0xf5}, + {0x25, 0x5e, 0x4f}, + {0x25, 0x5f, 0x1a}, + {0x25, 0x60, 0x0e}, + {0x25, 0x61, 0x9e}, + {0x25, 0x62, 0x0a}, + {0x25, 0x63, 0xe8}, + {0x25, 0x64, 0xf9}, + {0x25, 0x65, 0x55}, + {0x25, 0x66, 0x66}, + {0x25, 0x67, 0x2f}, + {0x25, 0x68, 0x07}, // Biquad - BQ11 Left - Filter: Equalizer (Q Factor) Frequency: 2000 Hz Gain: -5dB QVal: 0.7 Bandwidth: 1000 Hz + {0x25, 0x69, 0x80}, + {0x25, 0x6a, 0x37}, + {0x25, 0x6b, 0x39}, + {0x25, 0x6c, 0xf2}, + {0x25, 0x6d, 0x65}, + {0x25, 0x6e, 0xfd}, + {0x25, 0x6f, 0xb7}, + {0x25, 0x70, 0x06}, + {0x25, 0x71, 0x37}, + {0x25, 0x72, 0xd6}, + {0x25, 0x73, 0xdf}, + {0x25, 0x74, 0x0d}, + {0x25, 0x75, 0x9a}, + {0x25, 0x76, 0x02}, + {0x25, 0x77, 0x49}, + {0x25, 0x78, 0xfa}, + {0x25, 0x79, 0x47}, + {0x25, 0x7a, 0xf1}, + {0x25, 0x7b, 0xe9}, + {0x25, 0x7c, 0x07}, // Biquad - BQ12 Left - Filter: Equalizer (Q Factor) Frequency: 3150 Hz Gain: -5dB QVal: 0.7 Bandwidth: 1000 Hz + {0x25, 0x7d, 0x45}, + {0x25, 0x7e, 0xfc}, + {0x25, 0x7f, 0xef}, + {0x26, 0x08, 0xf3}, + {0x26, 0x09, 0x96}, + {0x26, 0x0a, 0xc5}, + {0x26, 0x0b, 0xd9}, + {0x26, 0x0c, 0x05}, + {0x26, 0x0d, 0x67}, + {0x26, 0x0e, 0xfa}, + {0x26, 0x0f, 0xd4}, + {0x26, 0x10, 0x0c}, + {0x26, 0x11, 0x69}, + {0x26, 0x12, 0x3a}, + {0x26, 0x13, 0x27}, + {0x26, 0x14, 0xfb}, + {0x26, 0x15, 0x52}, + {0x26, 0x16, 0x08}, + {0x26, 0x17, 0x3d}, + {0x26, 0x18, 0x06}, // Biquad - BQ13 Left - Filter: Equalizer (Q Factor) Frequency: 5000 Hz Gain: -5dB QVal: 0.6 Bandwidth: 1000 Hz + {0x26, 0x19, 0xdb}, + {0x26, 0x1a, 0x47}, + {0x26, 0x1b, 0xef}, + {0x26, 0x1c, 0xf5}, + {0x26, 0x1d, 0xcc}, + {0x26, 0x1e, 0x0b}, + {0x26, 0x1f, 0x2e}, + {0x26, 0x20, 0x03}, + {0x26, 0x21, 0xeb}, + {0x26, 0x22, 0x0f}, + {0x26, 0x23, 0x65}, + {0x26, 0x24, 0x0a}, + {0x26, 0x25, 0x33}, + {0x26, 0x26, 0xf4}, + {0x26, 0x27, 0xd2}, + {0x26, 0x28, 0xfd}, + {0x26, 0x29, 0x39}, + {0x26, 0x2a, 0xa8}, + {0x26, 0x2b, 0xab}, + {0x26, 0x2c, 0x06}, // Biquad - BQ14 Left - Filter: Equalizer (Q Factor) Frequency: 8000 Hz Gain: -5dB QVal: 0.6 Bandwidth: 1000 Hz + {0x26, 0x2d, 0x78}, + {0x26, 0x2e, 0x62}, + {0x26, 0x2f, 0x91}, + {0x26, 0x30, 0xf8}, + {0x26, 0x31, 0x32}, + {0x26, 0x32, 0x97}, + {0x26, 0x33, 0x4e}, + {0x26, 0x34, 0x02}, + {0x26, 0x35, 0x8a}, + {0x26, 0x36, 0x06}, + {0x26, 0x37, 0x30}, + {0x26, 0x38, 0x07}, + {0x26, 0x39, 0xcd}, + {0x26, 0x3a, 0x68}, + {0x26, 0x3b, 0xb2}, + {0x26, 0x3c, 0xfe}, + {0x26, 0x3d, 0xfd}, + {0x26, 0x3e, 0x97}, + {0x26, 0x3f, 0x3f}, + {0x26, 0x40, 0x05}, // Biquad - BQ15 Left - Filter: Equalizer (Q Factor) Frequency: 16000 Hz Gain: -5dB QVal: 0.5 Bandwidth: 1000 Hz + {0x26, 0x41, 0xb8}, + {0x26, 0x42, 0xd5}, + {0x26, 0x43, 0x5a}, + {0x26, 0x44, 0xfd}, + {0x26, 0x45, 0x34}, + {0x26, 0x46, 0x78}, + {0x26, 0x47, 0x0d}, + {0x26, 0x48, 0xff}, + {0x26, 0x49, 0xde}, + {0x26, 0x4a, 0x3a}, + {0x26, 0x4b, 0x8b}, + {0x26, 0x4c, 0x02}, + {0x26, 0x4d, 0xcb}, + {0x26, 0x4e, 0x87}, + {0x26, 0x4f, 0xf3}, + {0x26, 0x50, 0x02}, + {0x26, 0x51, 0x68}, + {0x26, 0x52, 0xf0}, + {0x26, 0x53, 0x1b}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_left_m4[TAS5805M_EQ_REG_PER_STEP] = { + {0x24, 0x18, 0x07}, // Biquad - BQ1 Left - Filter: Equalizer (Q Factor) Frequency: 20 Hz Gain: -4dB QVal: 2 Bandwidth: 1000 Hz + {0x24, 0x19, 0xff}, + {0x24, 0x1a, 0x9b}, + {0x24, 0x1b, 0xb3}, + {0x24, 0x1c, 0xf0}, + {0x24, 0x1d, 0x02}, + {0x24, 0x1e, 0x20}, + {0x24, 0x1f, 0x77}, + {0x24, 0x20, 0x07}, + {0x24, 0x21, 0xfe}, + {0x24, 0x22, 0x44}, + {0x24, 0x23, 0xbb}, + {0x24, 0x24, 0x0f}, + {0x24, 0x25, 0xfd}, + {0x24, 0x26, 0xdf}, + {0x24, 0x27, 0x89}, + {0x24, 0x28, 0xf8}, + {0x24, 0x29, 0x02}, + {0x24, 0x2a, 0x1f}, + {0x24, 0x2b, 0x91}, + {0x24, 0x2c, 0x07}, // Biquad - BQ2 Left - Filter: Equalizer (Q Factor) Frequency: 31.5 Hz Gain: -4dB QVal: 2 Bandwidth: 1000 Hz + {0x24, 0x2d, 0xff}, + {0x24, 0x2e, 0x62}, + {0x24, 0x2f, 0x13}, + {0x24, 0x30, 0xf0}, + {0x24, 0x31, 0x03}, + {0x24, 0x32, 0x5a}, + {0x24, 0x33, 0x17}, + {0x24, 0x34, 0x07}, + {0x24, 0x35, 0xfd}, + {0x24, 0x36, 0x46}, + {0x24, 0x37, 0x10}, + {0x24, 0x38, 0x0f}, + {0x24, 0x39, 0xfc}, + {0x24, 0x3a, 0xa5}, + {0x24, 0x3b, 0xe9}, + {0x24, 0x3c, 0xf8}, + {0x24, 0x3d, 0x03}, + {0x24, 0x3e, 0x57}, + {0x24, 0x3f, 0xdd}, + {0x24, 0x40, 0x07}, // Biquad - BQ3 Left - Filter: Equalizer (Q Factor) Frequency: 50 Hz Gain: -4dB QVal: 1.5 Bandwidth: 1000 Hz + {0x24, 0x41, 0xfe}, + {0x24, 0x42, 0xb2}, + {0x24, 0x43, 0x12}, + {0x24, 0x44, 0xf0}, + {0x24, 0x45, 0x07}, + {0x24, 0x46, 0x17}, + {0x24, 0x47, 0x4f}, + {0x24, 0x48, 0x07}, + {0x24, 0x49, 0xfa}, + {0x24, 0x4a, 0x3c}, + {0x24, 0x4b, 0x3a}, + {0x24, 0x4c, 0x0f}, + {0x24, 0x4d, 0xf8}, + {0x24, 0x4e, 0xe8}, + {0x24, 0x4f, 0xb1}, + {0x24, 0x50, 0xf8}, + {0x24, 0x51, 0x07}, + {0x24, 0x52, 0x11}, + {0x24, 0x53, 0xb4}, + {0x24, 0x54, 0x07}, // Biquad - BQ4 Left - Filter: Equalizer (Q Factor) Frequency: 80 Hz Gain: -4dB QVal: 1.5 Bandwidth: 1000 Hz + {0x24, 0x55, 0xfd}, + {0x24, 0x56, 0xea}, + {0x24, 0x57, 0x44}, + {0x24, 0x58, 0xf0}, + {0x24, 0x59, 0x0b}, + {0x24, 0x5a, 0x5a}, + {0x24, 0x5b, 0xdd}, + {0x24, 0x5c, 0x07}, + {0x24, 0x5d, 0xf6}, + {0x24, 0x5e, 0xc9}, + {0x24, 0x5f, 0x34}, + {0x24, 0x60, 0x0f}, + {0x24, 0x61, 0xf4}, + {0x24, 0x62, 0xa5}, + {0x24, 0x63, 0x23}, + {0x24, 0x64, 0xf8}, + {0x24, 0x65, 0x0b}, + {0x24, 0x66, 0x4c}, + {0x24, 0x67, 0x87}, + {0x24, 0x68, 0x07}, // Biquad - BQ5 Left - Filter: Equalizer (Q Factor) Frequency: 125 Hz Gain: -4dB QVal: 1 Bandwidth: 1000 Hz + {0x24, 0x69, 0xfb}, + {0x24, 0x6a, 0x21}, + {0x24, 0x6b, 0xaf}, + {0x24, 0x6c, 0xf0}, + {0x24, 0x6d, 0x1a}, + {0x24, 0x6e, 0x85}, + {0x24, 0x6f, 0x31}, + {0x24, 0x70, 0x07}, + {0x24, 0x71, 0xea}, + {0x24, 0x72, 0x7b}, + {0x24, 0x73, 0xfe}, + {0x24, 0x74, 0x0f}, + {0x24, 0x75, 0xe5}, + {0x24, 0x76, 0x7a}, + {0x24, 0x77, 0xcf}, + {0x24, 0x78, 0xf8}, + {0x24, 0x79, 0x1a}, + {0x24, 0x7a, 0x62}, + {0x24, 0x7b, 0x54}, + {0x24, 0x7c, 0x07}, // Biquad - BQ6 Left - Filter: Equalizer (Q Factor) Frequency: 200 Hz Gain: -4dB QVal: 1 Bandwidth: 1000 Hz + {0x24, 0x7d, 0xf8}, + {0x24, 0x7e, 0x3d}, + {0x24, 0x7f, 0x92}, + {0x25, 0x08, 0xf0}, + {0x25, 0x09, 0x2a}, + {0x25, 0x0a, 0x66}, + {0x25, 0x0b, 0x3a}, + {0x25, 0x0c, 0x07}, + {0x25, 0x0d, 0xdd}, + {0x25, 0x0e, 0xb5}, + {0x25, 0x0f, 0x1d}, + {0x25, 0x10, 0x0f}, + {0x25, 0x11, 0xd5}, + {0x25, 0x12, 0x99}, + {0x25, 0x13, 0xc6}, + {0x25, 0x14, 0xf8}, + {0x25, 0x15, 0x2a}, + {0x25, 0x16, 0x0d}, + {0x25, 0x17, 0x51}, + {0x25, 0x18, 0x07}, // Biquad - BQ7 Left - Filter: Equalizer (Q Factor) Frequency: 315 Hz Gain: -4dB QVal: 0.9 Bandwidth: 1000 Hz + {0x25, 0x19, 0xf2}, + {0x25, 0x1a, 0x86}, + {0x25, 0x1b, 0x4f}, + {0x25, 0x1c, 0xf0}, + {0x25, 0x1d, 0x49}, + {0x25, 0x1e, 0xe2}, + {0x25, 0x1f, 0x37}, + {0x25, 0x20, 0x07}, + {0x25, 0x21, 0xc4}, + {0x25, 0x22, 0x72}, + {0x25, 0x23, 0x57}, + {0x25, 0x24, 0x0f}, + {0x25, 0x25, 0xb6}, + {0x25, 0x26, 0x1d}, + {0x25, 0x27, 0xc9}, + {0x25, 0x28, 0xf8}, + {0x25, 0x29, 0x49}, + {0x25, 0x2a, 0x07}, + {0x25, 0x2b, 0x59}, + {0x25, 0x2c, 0x07}, // Biquad - BQ8 Left - Filter: Equalizer (Q Factor) Frequency: 500 Hz Gain: -4dB QVal: 0.9 Bandwidth: 1000 Hz + {0x25, 0x2d, 0xea}, + {0x25, 0x2e, 0xd5}, + {0x25, 0x2f, 0x0b}, + {0x25, 0x30, 0xf0}, + {0x25, 0x31, 0x74}, + {0x25, 0x32, 0xd9}, + {0x25, 0x33, 0x57}, + {0x25, 0x34, 0x07}, + {0x25, 0x35, 0xa2}, + {0x25, 0x36, 0x73}, + {0x25, 0x37, 0x50}, + {0x25, 0x38, 0x0f}, + {0x25, 0x39, 0x8b}, + {0x25, 0x3a, 0x26}, + {0x25, 0x3b, 0xa9}, + {0x25, 0x3c, 0xf8}, + {0x25, 0x3d, 0x72}, + {0x25, 0x3e, 0xb7}, + {0x25, 0x3f, 0xa5}, + {0x25, 0x40, 0x07}, // Biquad - BQ9 Left - Filter: Equalizer (Q Factor) Frequency: 800 Hz Gain: -4dB QVal: 0.8 Bandwidth: 1000 Hz + {0x25, 0x41, 0xda}, + {0x25, 0x42, 0xbb}, + {0x25, 0x43, 0xa3}, + {0x25, 0x44, 0xf0}, + {0x25, 0x45, 0xcf}, + {0x25, 0x46, 0x4d}, + {0x25, 0x47, 0x7d}, + {0x25, 0x48, 0x07}, + {0x25, 0x49, 0x5b}, + {0x25, 0x4a, 0x4d}, + {0x25, 0x4b, 0x0e}, + {0x25, 0x4c, 0x0f}, + {0x25, 0x4d, 0x30}, + {0x25, 0x4e, 0xb2}, + {0x25, 0x4f, 0x83}, + {0x25, 0x50, 0xf8}, + {0x25, 0x51, 0xc9}, + {0x25, 0x52, 0xf7}, + {0x25, 0x53, 0x4f}, + {0x25, 0x54, 0x07}, // Biquad - BQ10 Left - Filter: Equalizer (Q Factor) Frequency: 1250 Hz Gain: -4dB QVal: 0.8 Bandwidth: 1000 Hz + {0x25, 0x55, 0xc7}, + {0x25, 0x56, 0x57}, + {0x25, 0x57, 0x7a}, + {0x25, 0x58, 0xf1}, + {0x25, 0x59, 0x3f}, + {0x25, 0x5a, 0xba}, + {0x25, 0x5b, 0x88}, + {0x25, 0x5c, 0x07}, + {0x25, 0x5d, 0x05}, + {0x25, 0x5e, 0x9a}, + {0x25, 0x5f, 0x4f}, + {0x25, 0x60, 0x0e}, + {0x25, 0x61, 0xc0}, + {0x25, 0x62, 0x45}, + {0x25, 0x63, 0x78}, + {0x25, 0x64, 0xf9}, + {0x25, 0x65, 0x33}, + {0x25, 0x66, 0x0e}, + {0x25, 0x67, 0x37}, + {0x25, 0x68, 0x07}, // Biquad - BQ11 Left - Filter: Equalizer (Q Factor) Frequency: 2000 Hz Gain: -4dB QVal: 0.7 Bandwidth: 1000 Hz + {0x25, 0x69, 0x9e}, + {0x25, 0x6a, 0x74}, + {0x25, 0x6b, 0x83}, + {0x25, 0x6c, 0xf2}, + {0x25, 0x6d, 0x2f}, + {0x25, 0x6e, 0x28}, + {0x25, 0x6f, 0x1a}, + {0x25, 0x70, 0x06}, + {0x25, 0x71, 0x50}, + {0x25, 0x72, 0xe8}, + {0x25, 0x73, 0x52}, + {0x25, 0x74, 0x0d}, + {0x25, 0x75, 0xd0}, + {0x25, 0x76, 0xd7}, + {0x25, 0x77, 0xe6}, + {0x25, 0x78, 0xfa}, + {0x25, 0x79, 0x10}, + {0x25, 0x7a, 0xa3}, + {0x25, 0x7b, 0x2a}, + {0x25, 0x7c, 0x07}, // Biquad - BQ12 Left - Filter: Equalizer (Q Factor) Frequency: 3150 Hz Gain: -4dB QVal: 0.7 Bandwidth: 1000 Hz + {0x25, 0x7d, 0x70}, + {0x25, 0x7e, 0xfa}, + {0x25, 0x7f, 0xfb}, + {0x26, 0x08, 0xf3}, + {0x26, 0x09, 0x4d}, + {0x26, 0x0a, 0x69}, + {0x26, 0x0b, 0x89}, + {0x26, 0x0c, 0x05}, + {0x26, 0x0d, 0x87}, + {0x26, 0x0e, 0xef}, + {0x26, 0x0f, 0x6a}, + {0x26, 0x10, 0x0c}, + {0x26, 0x11, 0xb2}, + {0x26, 0x12, 0x96}, + {0x26, 0x13, 0x77}, + {0x26, 0x14, 0xfb}, + {0x26, 0x15, 0x07}, + {0x26, 0x16, 0x15}, + {0x26, 0x17, 0x9b}, + {0x26, 0x18, 0x07}, // Biquad - BQ13 Left - Filter: Equalizer (Q Factor) Frequency: 5000 Hz Gain: -4dB QVal: 0.6 Bandwidth: 1000 Hz + {0x26, 0x19, 0x1b}, + {0x26, 0x1a, 0xea}, + {0x26, 0x1b, 0x47}, + {0x26, 0x1c, 0xf5}, + {0x26, 0x1d, 0x6b}, + {0x26, 0x1e, 0xdd}, + {0x26, 0x1f, 0x4b}, + {0x26, 0x20, 0x04}, + {0x26, 0x21, 0x0f}, + {0x26, 0x22, 0xfe}, + {0x26, 0x23, 0xda}, + {0x26, 0x24, 0x0a}, + {0x26, 0x25, 0x94}, + {0x26, 0x26, 0x22}, + {0x26, 0x27, 0xb5}, + {0x26, 0x28, 0xfc}, + {0x26, 0x29, 0xd4}, + {0x26, 0x2a, 0x16}, + {0x26, 0x2b, 0xdf}, + {0x26, 0x2c, 0x06}, // Biquad - BQ14 Left - Filter: Equalizer (Q Factor) Frequency: 8000 Hz Gain: -4dB QVal: 0.6 Bandwidth: 1000 Hz + {0x26, 0x2d, 0xcb}, + {0x26, 0x2e, 0x03}, + {0x26, 0x2f, 0x13}, + {0x26, 0x30, 0xf7}, + {0x26, 0x31, 0xce}, + {0x26, 0x32, 0xf3}, + {0x26, 0x33, 0xd4}, + {0x26, 0x34, 0x02}, + {0x26, 0x35, 0xaa}, + {0x26, 0x36, 0x73}, + {0x26, 0x37, 0x2e}, + {0x26, 0x38, 0x08}, + {0x26, 0x39, 0x31}, + {0x26, 0x3a, 0x0c}, + {0x26, 0x3b, 0x2c}, + {0x26, 0x3c, 0xfe}, + {0x26, 0x3d, 0x8a}, + {0x26, 0x3e, 0x89}, + {0x26, 0x3f, 0xbe}, + {0x26, 0x40, 0x06}, // Biquad - BQ15 Left - Filter: Equalizer (Q Factor) Frequency: 16000 Hz Gain: -4dB QVal: 0.5 Bandwidth: 1000 Hz + {0x26, 0x41, 0x28}, + {0x26, 0x42, 0x5e}, + {0x26, 0x43, 0x41}, + {0x26, 0x44, 0xfc}, + {0x26, 0x45, 0xfd}, + {0x26, 0x46, 0xfc}, + {0x26, 0x47, 0xbd}, + {0x26, 0x48, 0xff}, + {0x26, 0x49, 0xdb}, + {0x26, 0x4a, 0xa8}, + {0x26, 0x4b, 0x44}, + {0x26, 0x4c, 0x03}, + {0x26, 0x4d, 0x02}, + {0x26, 0x4e, 0x03}, + {0x26, 0x4f, 0x43}, + {0x26, 0x50, 0x01}, + {0x26, 0x51, 0xfb}, + {0x26, 0x52, 0xf9}, + {0x26, 0x53, 0x7b}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_left_m3[TAS5805M_EQ_REG_PER_STEP] = { + {0x24, 0x18, 0x07}, // Biquad - BQ1 Left - Filter: Equalizer (Q Factor) Frequency: 20 Hz Gain: -3dB QVal: 2 Bandwidth: 1000 Hz + {0x24, 0x19, 0xff}, + {0x24, 0x1a, 0xb9}, + {0x24, 0x1b, 0x41}, + {0x24, 0x1c, 0xf0}, + {0x24, 0x1d, 0x01}, + {0x24, 0x1e, 0xe5}, + {0x24, 0x1f, 0x61}, + {0x24, 0x20, 0x07}, + {0x24, 0x21, 0xfe}, + {0x24, 0x22, 0x62}, + {0x24, 0x23, 0x44}, + {0x24, 0x24, 0x0f}, + {0x24, 0x25, 0xfe}, + {0x24, 0x26, 0x1a}, + {0x24, 0x27, 0x9f}, + {0x24, 0x28, 0xf8}, + {0x24, 0x29, 0x01}, + {0x24, 0x2a, 0xe4}, + {0x24, 0x2b, 0x7c}, + {0x24, 0x2c, 0x07}, // Biquad - BQ2 Left - Filter: Equalizer (Q Factor) Frequency: 31.5 Hz Gain: -3dB QVal: 2 Bandwidth: 1000 Hz + {0x24, 0x2d, 0xff}, + {0x24, 0x2e, 0x90}, + {0x24, 0x2f, 0x9a}, + {0x24, 0x30, 0xf0}, + {0x24, 0x31, 0x02}, + {0x24, 0x32, 0xfd}, + {0x24, 0x33, 0x16}, + {0x24, 0x34, 0x07}, + {0x24, 0x35, 0xfd}, + {0x24, 0x36, 0x74}, + {0x24, 0x37, 0x8a}, + {0x24, 0x38, 0x0f}, + {0x24, 0x39, 0xfd}, + {0x24, 0x3a, 0x02}, + {0x24, 0x3b, 0xea}, + {0x24, 0x3c, 0xf8}, + {0x24, 0x3d, 0x02}, + {0x24, 0x3e, 0xfa}, + {0x24, 0x3f, 0xdb}, + {0x24, 0x40, 0x07}, // Biquad - BQ3 Left - Filter: Equalizer (Q Factor) Frequency: 50 Hz Gain: -3dB QVal: 1.5 Bandwidth: 1000 Hz + {0x24, 0x41, 0xff}, + {0x24, 0x42, 0x14}, + {0x24, 0x43, 0x6e}, + {0x24, 0x44, 0xf0}, + {0x24, 0x45, 0x06}, + {0x24, 0x46, 0x52}, + {0x24, 0x47, 0xcf}, + {0x24, 0x48, 0x07}, + {0x24, 0x49, 0xfa}, + {0x24, 0x4a, 0x9e}, + {0x24, 0x4b, 0x5f}, + {0x24, 0x4c, 0x0f}, + {0x24, 0x4d, 0xf9}, + {0x24, 0x4e, 0xad}, + {0x24, 0x4f, 0x31}, + {0x24, 0x50, 0xf8}, + {0x24, 0x51, 0x06}, + {0x24, 0x52, 0x4d}, + {0x24, 0x53, 0x34}, + {0x24, 0x54, 0x07}, // Biquad - BQ4 Left - Filter: Equalizer (Q Factor) Frequency: 80 Hz Gain: -3dB QVal: 1.5 Bandwidth: 1000 Hz + {0x24, 0x55, 0xfe}, + {0x24, 0x56, 0x87}, + {0x24, 0x57, 0x6f}, + {0x24, 0x58, 0xf0}, + {0x24, 0x59, 0x0a}, + {0x24, 0x5a, 0x21}, + {0x24, 0x5b, 0x15}, + {0x24, 0x5c, 0x07}, + {0x24, 0x5d, 0xf7}, + {0x24, 0x5e, 0x65}, + {0x24, 0x5f, 0xd3}, + {0x24, 0x60, 0x0f}, + {0x24, 0x61, 0xf5}, + {0x24, 0x62, 0xde}, + {0x24, 0x63, 0xeb}, + {0x24, 0x64, 0xf8}, + {0x24, 0x65, 0x0a}, + {0x24, 0x66, 0x12}, + {0x24, 0x67, 0xbe}, + {0x24, 0x68, 0x07}, // Biquad - BQ5 Left - Filter: Equalizer (Q Factor) Frequency: 125 Hz Gain: -3dB QVal: 1 Bandwidth: 1000 Hz + {0x24, 0x69, 0xfc}, + {0x24, 0x6a, 0x90}, + {0x24, 0x6b, 0x54}, + {0x24, 0x6c, 0xf0}, + {0x24, 0x6d, 0x17}, + {0x24, 0x6e, 0xaa}, + {0x24, 0x6f, 0xe9}, + {0x24, 0x70, 0x07}, + {0x24, 0x71, 0xeb}, + {0x24, 0x72, 0xe7}, + {0x24, 0x73, 0xa6}, + {0x24, 0x74, 0x0f}, + {0x24, 0x75, 0xe8}, + {0x24, 0x76, 0x55}, + {0x24, 0x77, 0x17}, + {0x24, 0x78, 0xf8}, + {0x24, 0x79, 0x17}, + {0x24, 0x7a, 0x88}, + {0x24, 0x7b, 0x05}, + {0x24, 0x7c, 0x07}, // Biquad - BQ6 Left - Filter: Equalizer (Q Factor) Frequency: 200 Hz Gain: -3dB QVal: 1 Bandwidth: 1000 Hz + {0x24, 0x7d, 0xfa}, + {0x24, 0x7e, 0x85}, + {0x24, 0x7f, 0x5d}, + {0x25, 0x08, 0xf0}, + {0x25, 0x09, 0x25}, + {0x25, 0x0a, 0xde}, + {0x25, 0x0b, 0x55}, + {0x25, 0x0c, 0x07}, + {0x25, 0x0d, 0xdf}, + {0x25, 0x0e, 0xf5}, + {0x25, 0x0f, 0x51}, + {0x25, 0x10, 0x0f}, + {0x25, 0x11, 0xda}, + {0x25, 0x12, 0x21}, + {0x25, 0x13, 0xab}, + {0x25, 0x14, 0xf8}, + {0x25, 0x15, 0x25}, + {0x25, 0x16, 0x85}, + {0x25, 0x17, 0x52}, + {0x25, 0x18, 0x07}, // Biquad - BQ7 Left - Filter: Equalizer (Q Factor) Frequency: 315 Hz Gain: -3dB QVal: 0.9 Bandwidth: 1000 Hz + {0x25, 0x19, 0xf6}, + {0x25, 0x1a, 0x7a}, + {0x25, 0x1b, 0x22}, + {0x25, 0x1c, 0xf0}, + {0x25, 0x1d, 0x42}, + {0x25, 0x1e, 0x11}, + {0x25, 0x1f, 0xe9}, + {0x25, 0x20, 0x07}, + {0x25, 0x21, 0xc8}, + {0x25, 0x22, 0x4f}, + {0x25, 0x23, 0x40}, + {0x25, 0x24, 0x0f}, + {0x25, 0x25, 0xbd}, + {0x25, 0x26, 0xee}, + {0x25, 0x27, 0x17}, + {0x25, 0x28, 0xf8}, + {0x25, 0x29, 0x41}, + {0x25, 0x2a, 0x36}, + {0x25, 0x2b, 0x9e}, + {0x25, 0x2c, 0x07}, // Biquad - BQ8 Left - Filter: Equalizer (Q Factor) Frequency: 500 Hz Gain: -3dB QVal: 0.9 Bandwidth: 1000 Hz + {0x25, 0x2d, 0xf1}, + {0x25, 0x2e, 0x06}, + {0x25, 0x2f, 0x38}, + {0x25, 0x30, 0xf0}, + {0x25, 0x31, 0x68}, + {0x25, 0x32, 0xb1}, + {0x25, 0x33, 0x45}, + {0x25, 0x34, 0x07}, + {0x25, 0x35, 0xa8}, + {0x25, 0x36, 0x6b}, + {0x25, 0x37, 0xe1}, + {0x25, 0x38, 0x0f}, + {0x25, 0x39, 0x97}, + {0x25, 0x3a, 0x4e}, + {0x25, 0x3b, 0xbb}, + {0x25, 0x3c, 0xf8}, + {0x25, 0x3d, 0x66}, + {0x25, 0x3e, 0x8d}, + {0x25, 0x3f, 0xe7}, + {0x25, 0x40, 0x07}, // Biquad - BQ9 Left - Filter: Equalizer (Q Factor) Frequency: 800 Hz Gain: -3dB QVal: 0.8 Bandwidth: 1000 Hz + {0x25, 0x41, 0xe5}, + {0x25, 0x42, 0x92}, + {0x25, 0x43, 0xb4}, + {0x25, 0x44, 0xf0}, + {0x25, 0x45, 0xba}, + {0x25, 0x46, 0x56}, + {0x25, 0x47, 0x98}, + {0x25, 0x48, 0x07}, + {0x25, 0x49, 0x65}, + {0x25, 0x4a, 0x74}, + {0x25, 0x4b, 0x3f}, + {0x25, 0x4c, 0x0f}, + {0x25, 0x4d, 0x45}, + {0x25, 0x4e, 0xa9}, + {0x25, 0x4f, 0x68}, + {0x25, 0x50, 0xf8}, + {0x25, 0x51, 0xb4}, + {0x25, 0x52, 0xf9}, + {0x25, 0x53, 0x0d}, + {0x25, 0x54, 0x07}, // Biquad - BQ10 Left - Filter: Equalizer (Q Factor) Frequency: 1250 Hz Gain: -3dB QVal: 0.8 Bandwidth: 1000 Hz + {0x25, 0x55, 0xd7}, + {0x25, 0x56, 0xb5}, + {0x25, 0x57, 0x91}, + {0x25, 0x58, 0xf1}, + {0x25, 0x59, 0x20}, + {0x25, 0x5a, 0xb0}, + {0x25, 0x5b, 0xad}, + {0x25, 0x5c, 0x07}, + {0x25, 0x5d, 0x14}, + {0x25, 0x5e, 0x60}, + {0x25, 0x5f, 0xbe}, + {0x25, 0x60, 0x0e}, + {0x25, 0x61, 0xdf}, + {0x25, 0x62, 0x4f}, + {0x25, 0x63, 0x53}, + {0x25, 0x64, 0xf9}, + {0x25, 0x65, 0x13}, + {0x25, 0x66, 0xe9}, + {0x25, 0x67, 0xb1}, + {0x25, 0x68, 0x07}, // Biquad - BQ11 Left - Filter: Equalizer (Q Factor) Frequency: 2000 Hz Gain: -3dB QVal: 0.7 Bandwidth: 1000 Hz + {0x25, 0x69, 0xba}, + {0x25, 0x6a, 0x38}, + {0x25, 0x6b, 0x5c}, + {0x25, 0x6c, 0xf1}, + {0x25, 0x6d, 0xfc}, + {0x25, 0x6e, 0xcf}, + {0x25, 0x6f, 0x24}, + {0x25, 0x70, 0x06}, + {0x25, 0x71, 0x67}, + {0x25, 0x72, 0xec}, + {0x25, 0x73, 0xa7}, + {0x25, 0x74, 0x0e}, + {0x25, 0x75, 0x03}, + {0x25, 0x76, 0x30}, + {0x25, 0x77, 0xdc}, + {0x25, 0x78, 0xf9}, + {0x25, 0x79, 0xdd}, + {0x25, 0x7a, 0xda}, + {0x25, 0x7b, 0xfd}, + {0x25, 0x7c, 0x07}, // Biquad - BQ12 Left - Filter: Equalizer (Q Factor) Frequency: 3150 Hz Gain: -3dB QVal: 0.7 Bandwidth: 1000 Hz + {0x25, 0x7d, 0x99}, + {0x25, 0x7e, 0x01}, + {0x25, 0x7f, 0x7b}, + {0x26, 0x08, 0xf3}, + {0x26, 0x09, 0x09}, + {0x26, 0x0a, 0x1d}, + {0x26, 0x0b, 0x4b}, + {0x26, 0x0c, 0x05}, + {0x26, 0x0d, 0xa5}, + {0x26, 0x0e, 0xaf}, + {0x26, 0x0f, 0x70}, + {0x26, 0x10, 0x0c}, + {0x26, 0x11, 0xf6}, + {0x26, 0x12, 0xe2}, + {0x26, 0x13, 0xb5}, + {0x26, 0x14, 0xfa}, + {0x26, 0x15, 0xc1}, + {0x26, 0x16, 0x4f}, + {0x26, 0x17, 0x15}, + {0x26, 0x18, 0x07}, // Biquad - BQ13 Left - Filter: Equalizer (Q Factor) Frequency: 5000 Hz Gain: -3dB QVal: 0.6 Bandwidth: 1000 Hz + {0x26, 0x19, 0x59}, + {0x26, 0x1a, 0xab}, + {0x26, 0x1b, 0x10}, + {0x26, 0x1c, 0xf5}, + {0x26, 0x1d, 0x0f}, + {0x26, 0x1e, 0xf8}, + {0x26, 0x1f, 0xf1}, + {0x26, 0x20, 0x04}, + {0x26, 0x21, 0x33}, + {0x26, 0x22, 0x48}, + {0x26, 0x23, 0xd3}, + {0x26, 0x24, 0x0a}, + {0x26, 0x25, 0xf0}, + {0x26, 0x26, 0x07}, + {0x26, 0x27, 0x0f}, + {0x26, 0x28, 0xfc}, + {0x26, 0x29, 0x73}, + {0x26, 0x2a, 0x0c}, + {0x26, 0x2b, 0x1d}, + {0x26, 0x2c, 0x07}, // Biquad - BQ14 Left - Filter: Equalizer (Q Factor) Frequency: 8000 Hz Gain: -3dB QVal: 0.6 Bandwidth: 1000 Hz + {0x26, 0x2d, 0x1b}, + {0x26, 0x2e, 0xec}, + {0x26, 0x2f, 0x98}, + {0x26, 0x30, 0xf7}, + {0x26, 0x31, 0x6d}, + {0x26, 0x32, 0x61}, + {0x26, 0x33, 0xb8}, + {0x26, 0x34, 0x02}, + {0x26, 0x35, 0xca}, + {0x26, 0x36, 0x33}, + {0x26, 0x37, 0xe6}, + {0x26, 0x38, 0x08}, + {0x26, 0x39, 0x92}, + {0x26, 0x3a, 0x9e}, + {0x26, 0x3b, 0x48}, + {0x26, 0x3c, 0xfe}, + {0x26, 0x3d, 0x19}, + {0x26, 0x3e, 0xdf}, + {0x26, 0x3f, 0x82}, + {0x26, 0x40, 0x06}, // Biquad - BQ15 Left - Filter: Equalizer (Q Factor) Frequency: 16000 Hz Gain: -3dB QVal: 0.5 Bandwidth: 1000 Hz + {0x26, 0x41, 0x9b}, + {0x26, 0x42, 0x21}, + {0x26, 0x43, 0x67}, + {0x26, 0x44, 0xfc}, + {0x26, 0x45, 0xc5}, + {0x26, 0x46, 0xed}, + {0x26, 0x47, 0xd5}, + {0x26, 0x48, 0xff}, + {0x26, 0x49, 0xd9}, + {0x26, 0x4a, 0x02}, + {0x26, 0x4b, 0xf0}, + {0x26, 0x4c, 0x03}, + {0x26, 0x4d, 0x3a}, + {0x26, 0x4e, 0x12}, + {0x26, 0x4f, 0x2b}, + {0x26, 0x50, 0x01}, + {0x26, 0x51, 0x8b}, + {0x26, 0x52, 0xdb}, + {0x26, 0x53, 0xa9}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_left_m2[TAS5805M_EQ_REG_PER_STEP] = { + {0x24, 0x18, 0x07}, // Biquad - BQ1 Left - Filter: Equalizer (Q Factor) Frequency: 20 Hz Gain: -2dB QVal: 2 Bandwidth: 1000 Hz + {0x24, 0x19, 0xff}, + {0x24, 0x1a, 0xd3}, + {0x24, 0x1b, 0x98}, + {0x24, 0x1c, 0xf0}, + {0x24, 0x1d, 0x01}, + {0x24, 0x1e, 0xb0}, + {0x24, 0x1f, 0xb7}, + {0x24, 0x20, 0x07}, + {0x24, 0x21, 0xfe}, + {0x24, 0x22, 0x7c}, + {0x24, 0x23, 0x97}, + {0x24, 0x24, 0x0f}, + {0x24, 0x25, 0xfe}, + {0x24, 0x26, 0x4f}, + {0x24, 0x27, 0x49}, + {0x24, 0x28, 0xf8}, + {0x24, 0x29, 0x01}, + {0x24, 0x2a, 0xaf}, + {0x24, 0x2b, 0xd1}, + {0x24, 0x2c, 0x07}, // Biquad - BQ2 Left - Filter: Equalizer (Q Factor) Frequency: 31.5 Hz Gain: -2dB QVal: 2 Bandwidth: 1000 Hz + {0x24, 0x2d, 0xff}, + {0x24, 0x2e, 0xba}, + {0x24, 0x2f, 0x14}, + {0x24, 0x30, 0xf0}, + {0x24, 0x31, 0x02}, + {0x24, 0x32, 0xaa}, + {0x24, 0x33, 0x2e}, + {0x24, 0x34, 0x07}, + {0x24, 0x35, 0xfd}, + {0x24, 0x36, 0x9d}, + {0x24, 0x37, 0xf9}, + {0x24, 0x38, 0x0f}, + {0x24, 0x39, 0xfd}, + {0x24, 0x3a, 0x55}, + {0x24, 0x3b, 0xd2}, + {0x24, 0x3c, 0xf8}, + {0x24, 0x3d, 0x02}, + {0x24, 0x3e, 0xa7}, + {0x24, 0x3f, 0xf3}, + {0x24, 0x40, 0x07}, // Biquad - BQ3 Left - Filter: Equalizer (Q Factor) Frequency: 50 Hz Gain: -2dB QVal: 1.5 Bandwidth: 1000 Hz + {0x24, 0x41, 0xff}, + {0x24, 0x42, 0x6c}, + {0x24, 0x43, 0x1f}, + {0x24, 0x44, 0xf0}, + {0x24, 0x45, 0x05}, + {0x24, 0x46, 0xa3}, + {0x24, 0x47, 0x9e}, + {0x24, 0x48, 0x07}, + {0x24, 0x49, 0xfa}, + {0x24, 0x4a, 0xf5}, + {0x24, 0x4b, 0xdf}, + {0x24, 0x4c, 0x0f}, + {0x24, 0x4d, 0xfa}, + {0x24, 0x4e, 0x5c}, + {0x24, 0x4f, 0x62}, + {0x24, 0x50, 0xf8}, + {0x24, 0x51, 0x05}, + {0x24, 0x52, 0x9e}, + {0x24, 0x53, 0x02}, + {0x24, 0x54, 0x07}, // Biquad - BQ4 Left - Filter: Equalizer (Q Factor) Frequency: 80 Hz Gain: -2dB QVal: 1.5 Bandwidth: 1000 Hz + {0x24, 0x55, 0xff}, + {0x24, 0x56, 0x13}, + {0x24, 0x57, 0x97}, + {0x24, 0x58, 0xf0}, + {0x24, 0x59, 0x09}, + {0x24, 0x5a, 0x09}, + {0x24, 0x5b, 0x44}, + {0x24, 0x5c, 0x07}, + {0x24, 0x5d, 0xf7}, + {0x24, 0x5e, 0xf1}, + {0x24, 0x5f, 0x7d}, + {0x24, 0x60, 0x0f}, + {0x24, 0x61, 0xf6}, + {0x24, 0x62, 0xf6}, + {0x24, 0x63, 0xbc}, + {0x24, 0x64, 0xf8}, + {0x24, 0x65, 0x08}, + {0x24, 0x66, 0xfa}, + {0x24, 0x67, 0xec}, + {0x24, 0x68, 0x07}, // Biquad - BQ5 Left - Filter: Equalizer (Q Factor) Frequency: 125 Hz Gain: -2dB QVal: 1 Bandwidth: 1000 Hz + {0x24, 0x69, 0xfd}, + {0x24, 0x6a, 0xd7}, + {0x24, 0x6b, 0x8a}, + {0x24, 0x6c, 0xf0}, + {0x24, 0x6d, 0x15}, + {0x24, 0x6e, 0x1f}, + {0x24, 0x6f, 0x2f}, + {0x24, 0x70, 0x07}, + {0x24, 0x71, 0xed}, + {0x24, 0x72, 0x2c}, + {0x24, 0x73, 0x31}, + {0x24, 0x74, 0x0f}, + {0x24, 0x75, 0xea}, + {0x24, 0x76, 0xe0}, + {0x24, 0x77, 0xd1}, + {0x24, 0x78, 0xf8}, + {0x24, 0x79, 0x14}, + {0x24, 0x7a, 0xfc}, + {0x24, 0x7b, 0x45}, + {0x24, 0x7c, 0x07}, // Biquad - BQ6 Left - Filter: Equalizer (Q Factor) Frequency: 200 Hz Gain: -2dB QVal: 1 Bandwidth: 1000 Hz + {0x24, 0x7d, 0xfc}, + {0x24, 0x7e, 0x8e}, + {0x24, 0x7f, 0xc5}, + {0x25, 0x08, 0xf0}, + {0x25, 0x09, 0x21}, + {0x25, 0x0a, 0xd2}, + {0x25, 0x0b, 0x64}, + {0x25, 0x0c, 0x07}, + {0x25, 0x0d, 0xe1}, + {0x25, 0x0e, 0xf7}, + {0x25, 0x0f, 0xf1}, + {0x25, 0x10, 0x0f}, + {0x25, 0x11, 0xde}, + {0x25, 0x12, 0x2d}, + {0x25, 0x13, 0x9c}, + {0x25, 0x14, 0xf8}, + {0x25, 0x15, 0x21}, + {0x25, 0x16, 0x79}, + {0x25, 0x17, 0x4a}, + {0x25, 0x18, 0x07}, // Biquad - BQ7 Left - Filter: Equalizer (Q Factor) Frequency: 315 Hz Gain: -2dB QVal: 0.9 Bandwidth: 1000 Hz + {0x25, 0x19, 0xfa}, + {0x25, 0x1a, 0x03}, + {0x25, 0x1b, 0x3e}, + {0x25, 0x1c, 0xf0}, + {0x25, 0x1d, 0x3b}, + {0x25, 0x1e, 0x14}, + {0x25, 0x1f, 0x93}, + {0x25, 0x20, 0x07}, + {0x25, 0x21, 0xcb}, + {0x25, 0x22, 0xc3}, + {0x25, 0x23, 0xdc}, + {0x25, 0x24, 0x0f}, + {0x25, 0x25, 0xc4}, + {0x25, 0x26, 0xeb}, + {0x25, 0x27, 0x6d}, + {0x25, 0x28, 0xf8}, + {0x25, 0x29, 0x3a}, + {0x25, 0x2a, 0x38}, + {0x25, 0x2b, 0xe6}, + {0x25, 0x2c, 0x07}, // Biquad - BQ8 Left - Filter: Equalizer (Q Factor) Frequency: 500 Hz Gain: -2dB QVal: 0.9 Bandwidth: 1000 Hz + {0x25, 0x2d, 0xf6}, + {0x25, 0x2e, 0x93}, + {0x25, 0x2f, 0x31}, + {0x25, 0x30, 0xf0}, + {0x25, 0x31, 0x5d}, + {0x25, 0x32, 0xcb}, + {0x25, 0x33, 0x8f}, + {0x25, 0x34, 0x07}, + {0x25, 0x35, 0xad}, + {0x25, 0x36, 0xc6}, + {0x25, 0x37, 0x1b}, + {0x25, 0x38, 0x0f}, + {0x25, 0x39, 0xa2}, + {0x25, 0x3a, 0x34}, + {0x25, 0x3b, 0x71}, + {0x25, 0x3c, 0xf8}, + {0x25, 0x3d, 0x5b}, + {0x25, 0x3e, 0xa6}, + {0x25, 0x3f, 0xb3}, + {0x25, 0x40, 0x07}, // Biquad - BQ9 Left - Filter: Equalizer (Q Factor) Frequency: 800 Hz Gain: -2dB QVal: 0.8 Bandwidth: 1000 Hz + {0x25, 0x41, 0xef}, + {0x25, 0x42, 0x55}, + {0x25, 0x43, 0x53}, + {0x25, 0x44, 0xf0}, + {0x25, 0x45, 0xa7}, + {0x25, 0x46, 0x76}, + {0x25, 0x47, 0x57}, + {0x25, 0x48, 0x07}, + {0x25, 0x49, 0x6e}, + {0x25, 0x4a, 0x98}, + {0x25, 0x4b, 0x84}, + {0x25, 0x4c, 0x0f}, + {0x25, 0x4d, 0x58}, + {0x25, 0x4e, 0x89}, + {0x25, 0x4f, 0xa9}, + {0x25, 0x50, 0xf8}, + {0x25, 0x51, 0xa2}, + {0x25, 0x52, 0x12}, + {0x25, 0x53, 0x29}, + {0x25, 0x54, 0x07}, // Biquad - BQ10 Left - Filter: Equalizer (Q Factor) Frequency: 1250 Hz Gain: -2dB QVal: 0.8 Bandwidth: 1000 Hz + {0x25, 0x55, 0xe6}, + {0x25, 0x56, 0x86}, + {0x25, 0x57, 0x77}, + {0x25, 0x58, 0xf1}, + {0x25, 0x59, 0x04}, + {0x25, 0x5a, 0x98}, + {0x25, 0x5b, 0x07}, + {0x25, 0x5c, 0x07}, + {0x25, 0x5d, 0x21}, + {0x25, 0x5e, 0xc0}, + {0x25, 0x5f, 0xa1}, + {0x25, 0x60, 0x0e}, + {0x25, 0x61, 0xfb}, + {0x25, 0x62, 0x67}, + {0x25, 0x63, 0xf9}, + {0x25, 0x64, 0xf8}, + {0x25, 0x65, 0xf7}, + {0x25, 0x66, 0xb8}, + {0x25, 0x67, 0xe8}, + {0x25, 0x68, 0x07}, // Biquad - BQ11 Left - Filter: Equalizer (Q Factor) Frequency: 2000 Hz Gain: -2dB QVal: 0.7 Bandwidth: 1000 Hz + {0x25, 0x69, 0xd3}, + {0x25, 0x6a, 0xa3}, + {0x25, 0x6b, 0xfa}, + {0x25, 0x6c, 0xf1}, + {0x25, 0x6d, 0xce}, + {0x25, 0x6e, 0xb6}, + {0x25, 0x6f, 0x9b}, + {0x25, 0x70, 0x06}, + {0x25, 0x71, 0x7c}, + {0x25, 0x72, 0xff}, + {0x25, 0x73, 0x66}, + {0x25, 0x74, 0x0e}, + {0x25, 0x75, 0x31}, + {0x25, 0x76, 0x49}, + {0x25, 0x77, 0x65}, + {0x25, 0x78, 0xf9}, + {0x25, 0x79, 0xaf}, + {0x25, 0x7a, 0x5c}, + {0x25, 0x7b, 0xa0}, + {0x25, 0x7c, 0x07}, // Biquad - BQ12 Left - Filter: Equalizer (Q Factor) Frequency: 3150 Hz Gain: -2dB QVal: 0.7 Bandwidth: 1000 Hz + {0x25, 0x7d, 0xbe}, + {0x25, 0x7e, 0x1f}, + {0x25, 0x7f, 0x7d}, + {0x26, 0x08, 0xf2}, + {0x26, 0x09, 0xc9}, + {0x26, 0x0a, 0xc7}, + {0x26, 0x0b, 0x6b}, + {0x26, 0x0c, 0x05}, + {0x26, 0x0d, 0xc1}, + {0x26, 0x0e, 0x46}, + {0x26, 0x0f, 0x19}, + {0x26, 0x10, 0x0d}, + {0x26, 0x11, 0x36}, + {0x26, 0x12, 0x38}, + {0x26, 0x13, 0x95}, + {0x26, 0x14, 0xfa}, + {0x26, 0x15, 0x80}, + {0x26, 0x16, 0x9a}, + {0x26, 0x17, 0x69}, + {0x26, 0x18, 0x07}, // Biquad - BQ13 Left - Filter: Equalizer (Q Factor) Frequency: 5000 Hz Gain: -2dB QVal: 0.6 Bandwidth: 1000 Hz + {0x26, 0x19, 0x94}, + {0x26, 0x1a, 0x59}, + {0x26, 0x1b, 0x08}, + {0x26, 0x1c, 0xf4}, + {0x26, 0x1d, 0xb8}, + {0x26, 0x1e, 0xa7}, + {0x26, 0x1f, 0x68}, + {0x26, 0x20, 0x04}, + {0x26, 0x21, 0x54}, + {0x26, 0x22, 0xd1}, + {0x26, 0x23, 0x2b}, + {0x26, 0x24, 0x0b}, + {0x26, 0x25, 0x47}, + {0x26, 0x26, 0x58}, + {0x26, 0x27, 0x98}, + {0x26, 0x28, 0xfc}, + {0x26, 0x29, 0x16}, + {0x26, 0x2a, 0xd5}, + {0x26, 0x2b, 0xcd}, + {0x26, 0x2c, 0x07}, // Biquad - BQ14 Left - Filter: Equalizer (Q Factor) Frequency: 8000 Hz Gain: -2dB QVal: 0.6 Bandwidth: 1000 Hz + {0x26, 0x2d, 0x6a}, + {0x26, 0x2e, 0xa8}, + {0x26, 0x2f, 0x4b}, + {0x26, 0x30, 0xf7}, + {0x26, 0x31, 0x0e}, + {0x26, 0x32, 0x70}, + {0x26, 0x33, 0x46}, + {0x26, 0x34, 0x02}, + {0x26, 0x35, 0xe9}, + {0x26, 0x36, 0x19}, + {0x26, 0x37, 0xb6}, + {0x26, 0x38, 0x08}, + {0x26, 0x39, 0xf1}, + {0x26, 0x3a, 0x8f}, + {0x26, 0x3b, 0xba}, + {0x26, 0x3c, 0xfd}, + {0x26, 0x3d, 0xac}, + {0x26, 0x3e, 0x3d}, + {0x26, 0x3f, 0xff}, + {0x26, 0x40, 0x07}, // Biquad - BQ15 Left - Filter: Equalizer (Q Factor) Frequency: 16000 Hz Gain: -2dB QVal: 0.5 Bandwidth: 1000 Hz + {0x26, 0x41, 0x10}, + {0x26, 0x42, 0x78}, + {0x26, 0x43, 0xf4}, + {0x26, 0x44, 0xfc}, + {0x26, 0x45, 0x8c}, + {0x26, 0x46, 0x9c}, + {0x26, 0x47, 0x55}, + {0x26, 0x48, 0xff}, + {0x26, 0x49, 0xd6}, + {0x26, 0x4a, 0x4e}, + {0x26, 0x4b, 0x62}, + {0x26, 0x4c, 0x03}, + {0x26, 0x4d, 0x73}, + {0x26, 0x4e, 0x63}, + {0x26, 0x4f, 0xab}, + {0x26, 0x50, 0x01}, + {0x26, 0x51, 0x19}, + {0x26, 0x52, 0x38}, + {0x26, 0x53, 0xaa}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_left_m1[TAS5805M_EQ_REG_PER_STEP] = { + {0x24, 0x18, 0x07}, // Biquad - BQ1 Left - Filter: Equalizer (Q Factor) Frequency: 20 Hz Gain: -1dB QVal: 2 Bandwidth: 1000 Hz + {0x24, 0x19, 0xff}, + {0x24, 0x1a, 0xeb}, + {0x24, 0x1b, 0x13}, + {0x24, 0x1c, 0xf0}, + {0x24, 0x1d, 0x01}, + {0x24, 0x1e, 0x81}, + {0x24, 0x1f, 0xc6}, + {0x24, 0x20, 0x07}, + {0x24, 0x21, 0xfe}, + {0x24, 0x22, 0x94}, + {0x24, 0x23, 0x0d}, + {0x24, 0x24, 0x0f}, + {0x24, 0x25, 0xfe}, + {0x24, 0x26, 0x7e}, + {0x24, 0x27, 0x3a}, + {0x24, 0x28, 0xf8}, + {0x24, 0x29, 0x01}, + {0x24, 0x2a, 0x80}, + {0x24, 0x2b, 0xe0}, + {0x24, 0x2c, 0x07}, // Biquad - BQ2 Left - Filter: Equalizer (Q Factor) Frequency: 31.5 Hz Gain: -1dB QVal: 2 Bandwidth: 1000 Hz + {0x24, 0x2d, 0xff}, + {0x24, 0x2e, 0xdf}, + {0x24, 0x2f, 0x0c}, + {0x24, 0x30, 0xf0}, + {0x24, 0x31, 0x02}, + {0x24, 0x32, 0x60}, + {0x24, 0x33, 0x47}, + {0x24, 0x34, 0x07}, + {0x24, 0x35, 0xfd}, + {0x24, 0x36, 0xc2}, + {0x24, 0x37, 0xe7}, + {0x24, 0x38, 0x0f}, + {0x24, 0x39, 0xfd}, + {0x24, 0x3a, 0x9f}, + {0x24, 0x3b, 0xb9}, + {0x24, 0x3c, 0xf8}, + {0x24, 0x3d, 0x02}, + {0x24, 0x3e, 0x5e}, + {0x24, 0x3f, 0x0d}, + {0x24, 0x40, 0x07}, // Biquad - BQ3 Left - Filter: Equalizer (Q Factor) Frequency: 50 Hz Gain: -1dB QVal: 1.5 Bandwidth: 1000 Hz + {0x24, 0x41, 0xff}, + {0x24, 0x42, 0xba}, + {0x24, 0x43, 0x4d}, + {0x24, 0x44, 0xf0}, + {0x24, 0x45, 0x05}, + {0x24, 0x46, 0x07}, + {0x24, 0x47, 0x6d}, + {0x24, 0x48, 0x07}, + {0x24, 0x49, 0xfb}, + {0x24, 0x4a, 0x43}, + {0x24, 0x4b, 0xe1}, + {0x24, 0x4c, 0x0f}, + {0x24, 0x4d, 0xfa}, + {0x24, 0x4e, 0xf8}, + {0x24, 0x4f, 0x93}, + {0x24, 0x50, 0xf8}, + {0x24, 0x51, 0x05}, + {0x24, 0x52, 0x01}, + {0x24, 0x53, 0xd1}, + {0x24, 0x54, 0x07}, // Biquad - BQ4 Left - Filter: Equalizer (Q Factor) Frequency: 80 Hz Gain: -1dB QVal: 1.5 Bandwidth: 1000 Hz + {0x24, 0x55, 0xff}, + {0x24, 0x56, 0x90}, + {0x24, 0x57, 0x90}, + {0x24, 0x58, 0xf0}, + {0x24, 0x59, 0x08}, + {0x24, 0x5a, 0x0f}, + {0x24, 0x5b, 0xc0}, + {0x24, 0x5c, 0x07}, + {0x24, 0x5d, 0xf8}, + {0x24, 0x5e, 0x6e}, + {0x24, 0x5f, 0x08}, + {0x24, 0x60, 0x0f}, + {0x24, 0x61, 0xf7}, + {0x24, 0x62, 0xf0}, + {0x24, 0x63, 0x40}, + {0x24, 0x64, 0xf8}, + {0x24, 0x65, 0x08}, + {0x24, 0x66, 0x01}, + {0x24, 0x67, 0x68}, + {0x24, 0x68, 0x07}, // Biquad - BQ5 Left - Filter: Equalizer (Q Factor) Frequency: 125 Hz Gain: -1dB QVal: 1 Bandwidth: 1000 Hz + {0x24, 0x69, 0xfe}, + {0x24, 0x6a, 0xfb}, + {0x24, 0x6b, 0x82}, + {0x24, 0x6c, 0xf0}, + {0x24, 0x6d, 0x12}, + {0x24, 0x6e, 0xd9}, + {0x24, 0x6f, 0xa4}, + {0x24, 0x70, 0x07}, + {0x24, 0x71, 0xee}, + {0x24, 0x72, 0x4d}, + {0x24, 0x73, 0xc8}, + {0x24, 0x74, 0x0f}, + {0x24, 0x75, 0xed}, + {0x24, 0x76, 0x26}, + {0x24, 0x77, 0x5c}, + {0x24, 0x78, 0xf8}, + {0x24, 0x79, 0x12}, + {0x24, 0x7a, 0xb6}, + {0x24, 0x7b, 0xb6}, + {0x24, 0x7c, 0x07}, // Biquad - BQ6 Left - Filter: Equalizer (Q Factor) Frequency: 200 Hz Gain: -1dB QVal: 1 Bandwidth: 1000 Hz + {0x24, 0x7d, 0xfe}, + {0x24, 0x7e, 0x60}, + {0x24, 0x7f, 0x5a}, + {0x25, 0x08, 0xf0}, + {0x25, 0x09, 0x1e}, + {0x25, 0x0a, 0x35}, + {0x25, 0x0b, 0x5c}, + {0x25, 0x0c, 0x07}, + {0x25, 0x0d, 0xe3}, + {0x25, 0x0e, 0xc3}, + {0x25, 0x0f, 0x78}, + {0x25, 0x10, 0x0f}, + {0x25, 0x11, 0xe1}, + {0x25, 0x12, 0xca}, + {0x25, 0x13, 0xa4}, + {0x25, 0x14, 0xf8}, + {0x25, 0x15, 0x1d}, + {0x25, 0x16, 0xdc}, + {0x25, 0x17, 0x2e}, + {0x25, 0x18, 0x07}, // Biquad - BQ7 Left - Filter: Equalizer (Q Factor) Frequency: 315 Hz Gain: -1dB QVal: 0.9 Bandwidth: 1000 Hz + {0x25, 0x19, 0xfd}, + {0x25, 0x1a, 0x2c}, + {0x25, 0x1b, 0x92}, + {0x25, 0x1c, 0xf0}, + {0x25, 0x1d, 0x34}, + {0x25, 0x1e, 0xd4}, + {0x25, 0x1f, 0x96}, + {0x25, 0x20, 0x07}, + {0x25, 0x21, 0xce}, + {0x25, 0x22, 0xda}, + {0x25, 0x23, 0xdc}, + {0x25, 0x24, 0x0f}, + {0x25, 0x25, 0xcb}, + {0x25, 0x26, 0x2b}, + {0x25, 0x27, 0x6a}, + {0x25, 0x28, 0xf8}, + {0x25, 0x29, 0x33}, + {0x25, 0x2a, 0xf8}, + {0x25, 0x2b, 0x93}, + {0x25, 0x2c, 0x07}, // Biquad - BQ8 Left - Filter: Equalizer (Q Factor) Frequency: 500 Hz Gain: -1dB QVal: 0.9 Bandwidth: 1000 Hz + {0x25, 0x2d, 0xfb}, + {0x25, 0x2e, 0x8c}, + {0x25, 0x2f, 0x31}, + {0x25, 0x30, 0xf0}, + {0x25, 0x31, 0x54}, + {0x25, 0x32, 0x08}, + {0x25, 0x33, 0x5c}, + {0x25, 0x34, 0x07}, + {0x25, 0x35, 0xb2}, + {0x25, 0x36, 0x91}, + {0x25, 0x37, 0xa5}, + {0x25, 0x38, 0x0f}, + {0x25, 0x39, 0xab}, + {0x25, 0x3a, 0xf7}, + {0x25, 0x3b, 0xa4}, + {0x25, 0x3c, 0xf8}, + {0x25, 0x3d, 0x51}, + {0x25, 0x3e, 0xe2}, + {0x25, 0x3f, 0x2a}, + {0x25, 0x40, 0x07}, // Biquad - BQ9 Left - Filter: Equalizer (Q Factor) Frequency: 800 Hz Gain: -1dB QVal: 0.8 Bandwidth: 1000 Hz + {0x25, 0x41, 0xf8}, + {0x25, 0x42, 0x1c}, + {0x25, 0x43, 0xa4}, + {0x25, 0x44, 0xf0}, + {0x25, 0x45, 0x96}, + {0x25, 0x46, 0x7c}, + {0x25, 0x47, 0x17}, + {0x25, 0x48, 0x07}, + {0x25, 0x49, 0x76}, + {0x25, 0x4a, 0xd1}, + {0x25, 0x4b, 0x69}, + {0x25, 0x4c, 0x0f}, + {0x25, 0x4d, 0x69}, + {0x25, 0x4e, 0x83}, + {0x25, 0x4f, 0xe9}, + {0x25, 0x50, 0xf8}, + {0x25, 0x51, 0x91}, + {0x25, 0x52, 0x11}, + {0x25, 0x53, 0xf3}, + {0x25, 0x54, 0x07}, // Biquad - BQ10 Left - Filter: Equalizer (Q Factor) Frequency: 1250 Hz Gain: -1dB QVal: 0.8 Bandwidth: 1000 Hz + {0x25, 0x55, 0xf3}, + {0x25, 0x56, 0xea}, + {0x25, 0x57, 0x62}, + {0x25, 0x58, 0xf0}, + {0x25, 0x59, 0xeb}, + {0x25, 0x5a, 0x33}, + {0x25, 0x5b, 0x83}, + {0x25, 0x5c, 0x07}, + {0x25, 0x5d, 0x2d}, + {0x25, 0x5e, 0xd7}, + {0x25, 0x5f, 0x0b}, + {0x25, 0x60, 0x0f}, + {0x25, 0x61, 0x14}, + {0x25, 0x62, 0xcc}, + {0x25, 0x63, 0x7d}, + {0x25, 0x64, 0xf8}, + {0x25, 0x65, 0xde}, + {0x25, 0x66, 0x3e}, + {0x25, 0x67, 0x93}, + {0x25, 0x68, 0x07}, // Biquad - BQ11 Left - Filter: Equalizer (Q Factor) Frequency: 2000 Hz Gain: -1dB QVal: 0.7 Bandwidth: 1000 Hz + {0x25, 0x69, 0xea}, + {0x25, 0x6a, 0xda}, + {0x25, 0x6b, 0x7b}, + {0x25, 0x6c, 0xf1}, + {0x25, 0x6d, 0xa4}, + {0x25, 0x6e, 0x9e}, + {0x25, 0x6f, 0xcf}, + {0x25, 0x70, 0x06}, + {0x25, 0x71, 0x90}, + {0x25, 0x72, 0x3d}, + {0x25, 0x73, 0xad}, + {0x25, 0x74, 0x0e}, + {0x25, 0x75, 0x5b}, + {0x25, 0x76, 0x61}, + {0x25, 0x77, 0x31}, + {0x25, 0x78, 0xf9}, + {0x25, 0x79, 0x84}, + {0x25, 0x7a, 0xe7}, + {0x25, 0x7b, 0xd8}, + {0x25, 0x7c, 0x07}, // Biquad - BQ12 Left - Filter: Equalizer (Q Factor) Frequency: 3150 Hz Gain: -1dB QVal: 0.7 Bandwidth: 1000 Hz + {0x25, 0x7d, 0xe0}, + {0x25, 0x7e, 0x6b}, + {0x25, 0x7f, 0x1a}, + {0x26, 0x08, 0xf2}, + {0x26, 0x09, 0x8f}, + {0x26, 0x0a, 0x42}, + {0x26, 0x0b, 0x37}, + {0x26, 0x0c, 0x05}, + {0x26, 0x0d, 0xda}, + {0x26, 0x0e, 0xc3}, + {0x26, 0x0f, 0xd0}, + {0x26, 0x10, 0x0d}, + {0x26, 0x11, 0x70}, + {0x26, 0x12, 0xbd}, + {0x26, 0x13, 0xc9}, + {0x26, 0x14, 0xfa}, + {0x26, 0x15, 0x44}, + {0x26, 0x16, 0xd1}, + {0x26, 0x17, 0x16}, + {0x26, 0x18, 0x07}, // Biquad - BQ13 Left - Filter: Equalizer (Q Factor) Frequency: 5000 Hz Gain: -1dB QVal: 0.6 Bandwidth: 1000 Hz + {0x26, 0x19, 0xcb}, + {0x26, 0x1a, 0xd1}, + {0x26, 0x1b, 0x93}, + {0x26, 0x1c, 0xf4}, + {0x26, 0x1d, 0x66}, + {0x26, 0x1e, 0x1c}, + {0x26, 0x1f, 0x35}, + {0x26, 0x20, 0x04}, + {0x26, 0x21, 0x74}, + {0x26, 0x22, 0x84}, + {0x26, 0x23, 0x1b}, + {0x26, 0x24, 0x0b}, + {0x26, 0x25, 0x99}, + {0x26, 0x26, 0xe3}, + {0x26, 0x27, 0xcb}, + {0x26, 0x28, 0xfb}, + {0x26, 0x29, 0xbf}, + {0x26, 0x2a, 0xaa}, + {0x26, 0x2b, 0x52}, + {0x26, 0x2c, 0x07}, // Biquad - BQ14 Left - Filter: Equalizer (Q Factor) Frequency: 8000 Hz Gain: -1dB QVal: 0.6 Bandwidth: 1000 Hz + {0x26, 0x2d, 0xb6}, + {0x26, 0x2e, 0xcc}, + {0x26, 0x2f, 0xcd}, + {0x26, 0x30, 0xf6}, + {0x26, 0x31, 0xb2}, + {0x26, 0x32, 0x9e}, + {0x26, 0x33, 0x90}, + {0x26, 0x34, 0x03}, + {0x26, 0x35, 0x06}, + {0x26, 0x36, 0xfb}, + {0x26, 0x37, 0x43}, + {0x26, 0x38, 0x09}, + {0x26, 0x39, 0x4d}, + {0x26, 0x3a, 0x61}, + {0x26, 0x3b, 0x70}, + {0x26, 0x3c, 0xfd}, + {0x26, 0x3d, 0x42}, + {0x26, 0x3e, 0x37}, + {0x26, 0x3f, 0xf1}, + {0x26, 0x40, 0x07}, // Biquad - BQ15 Left - Filter: Equalizer (Q Factor) Frequency: 16000 Hz Gain: -1dB QVal: 0.5 Bandwidth: 1000 Hz + {0x26, 0x41, 0x87}, + {0x26, 0x42, 0xae}, + {0x26, 0x43, 0xa6}, + {0x26, 0x44, 0xfc}, + {0x26, 0x45, 0x52}, + {0x26, 0x46, 0x61}, + {0x26, 0x47, 0x46}, + {0x26, 0x48, 0xff}, + {0x26, 0x49, 0xd3}, + {0x26, 0x4a, 0x8e}, + {0x26, 0x4b, 0xcf}, + {0x26, 0x4c, 0x03}, + {0x26, 0x4d, 0xad}, + {0x26, 0x4e, 0x9e}, + {0x26, 0x4f, 0xba}, + {0x26, 0x50, 0x00}, + {0x26, 0x51, 0xa4}, + {0x26, 0x52, 0xc2}, + {0x26, 0x53, 0x8c}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_left_0[TAS5805M_EQ_REG_PER_STEP] = { + {0x24, 0x18, 0x08}, // Biquad - BQ1 Left - Filter: Equalizer (Q Factor) Frequency: 20 Hz QVal: 2 Bandwidth: 1000 Hz + {0x24, 0x19, 0x00}, + {0x24, 0x1a, 0x00}, + {0x24, 0x1b, 0x00}, + {0x24, 0x1c, 0xf0}, + {0x24, 0x1d, 0x01}, + {0x24, 0x1e, 0x57}, + {0x24, 0x1f, 0xef}, + {0x24, 0x20, 0x07}, + {0x24, 0x21, 0xfe}, + {0x24, 0x22, 0xa8}, + {0x24, 0x23, 0xf7}, + {0x24, 0x24, 0x0f}, + {0x24, 0x25, 0xfe}, + {0x24, 0x26, 0xa8}, + {0x24, 0x27, 0x11}, + {0x24, 0x28, 0xf8}, + {0x24, 0x29, 0x01}, + {0x24, 0x2a, 0x57}, + {0x24, 0x2b, 0x09}, + {0x24, 0x2c, 0x08}, // Biquad - BQ2 Left - Filter: Equalizer (Q Factor) Frequency: 31.5 Hz QVal: 2 Bandwidth: 1000 Hz + {0x24, 0x2d, 0x00}, + {0x24, 0x2e, 0x00}, + {0x24, 0x2f, 0x00}, + {0x24, 0x30, 0xf0}, + {0x24, 0x31, 0x02}, + {0x24, 0x32, 0x1e}, + {0x24, 0x33, 0x67}, + {0x24, 0x34, 0x07}, + {0x24, 0x35, 0xfd}, + {0x24, 0x36, 0xe3}, + {0x24, 0x37, 0xd3}, + {0x24, 0x38, 0x0f}, + {0x24, 0x39, 0xfd}, + {0x24, 0x3a, 0xe1}, + {0x24, 0x3b, 0x99}, + {0x24, 0x3c, 0xf8}, + {0x24, 0x3d, 0x02}, + {0x24, 0x3e, 0x1c}, + {0x24, 0x3f, 0x2d}, + {0x24, 0x40, 0x08}, // Biquad - BQ3 Left - Filter: Equalizer (Q Factor) Frequency: 50 Hz QVal: 1.5 Bandwidth: 1000 Hz + {0x24, 0x41, 0x00}, + {0x24, 0x42, 0x00}, + {0x24, 0x43, 0x00}, + {0x24, 0x44, 0xf0}, + {0x24, 0x45, 0x04}, + {0x24, 0x46, 0x7c}, + {0x24, 0x47, 0x2f}, + {0x24, 0x48, 0x07}, + {0x24, 0x49, 0xfb}, + {0x24, 0x4a, 0x89}, + {0x24, 0x4b, 0x6d}, + {0x24, 0x4c, 0x0f}, + {0x24, 0x4d, 0xfb}, + {0x24, 0x4e, 0x83}, + {0x24, 0x4f, 0xd1}, + {0x24, 0x50, 0xf8}, + {0x24, 0x51, 0x04}, + {0x24, 0x52, 0x76}, + {0x24, 0x53, 0x93}, + {0x24, 0x54, 0x08}, // Biquad - BQ4 Left - Filter: Equalizer (Q Factor) Frequency: 80 Hz QVal: 1.5 Bandwidth: 1000 Hz + {0x24, 0x55, 0x00}, + {0x24, 0x56, 0x00}, + {0x24, 0x57, 0x00}, + {0x24, 0x58, 0xf0}, + {0x24, 0x59, 0x07}, + {0x24, 0x5a, 0x31}, + {0x24, 0x5b, 0x45}, + {0x24, 0x5c, 0x07}, + {0x24, 0x5d, 0xf8}, + {0x24, 0x5e, 0xdd}, + {0x24, 0x5f, 0x14}, + {0x24, 0x60, 0x0f}, + {0x24, 0x61, 0xf8}, + {0x24, 0x62, 0xce}, + {0x24, 0x63, 0xbb}, + {0x24, 0x64, 0xf8}, + {0x24, 0x65, 0x07}, + {0x24, 0x66, 0x22}, + {0x24, 0x67, 0xec}, + {0x24, 0x68, 0x08}, // Biquad - BQ5 Left - Filter: Equalizer (Q Factor) Frequency: 125 Hz QVal: 1 Bandwidth: 1000 Hz + {0x24, 0x69, 0x00}, + {0x24, 0x6a, 0x00}, + {0x24, 0x6b, 0x00}, + {0x24, 0x6c, 0xf0}, + {0x24, 0x6d, 0x10}, + {0x24, 0x6e, 0xd2}, + {0x24, 0x6f, 0xcc}, + {0x24, 0x70, 0x07}, + {0x24, 0x71, 0xef}, + {0x24, 0x72, 0x50}, + {0x24, 0x73, 0x27}, + {0x24, 0x74, 0x0f}, + {0x24, 0x75, 0xef}, + {0x24, 0x76, 0x2d}, + {0x24, 0x77, 0x34}, + {0x24, 0x78, 0xf8}, + {0x24, 0x79, 0x10}, + {0x24, 0x7a, 0xaf}, + {0x24, 0x7b, 0xd9}, + {0x24, 0x7c, 0x08}, // Biquad - BQ6 Left - Filter: Equalizer (Q Factor) Frequency: 200 Hz QVal: 1 Bandwidth: 1000 Hz + {0x24, 0x7d, 0x00}, + {0x24, 0x7e, 0x00}, + {0x24, 0x7f, 0x00}, + {0x25, 0x08, 0xf0}, + {0x25, 0x09, 0x1a}, + {0x25, 0x0a, 0xfb}, + {0x25, 0x0b, 0x8a}, + {0x25, 0x0c, 0x07}, + {0x25, 0x0d, 0xe5}, + {0x25, 0x0e, 0x5d}, + {0x25, 0x0f, 0xb6}, + {0x25, 0x10, 0x0f}, + {0x25, 0x11, 0xe5}, + {0x25, 0x12, 0x04}, + {0x25, 0x13, 0x76}, + {0x25, 0x14, 0xf8}, + {0x25, 0x15, 0x1a}, + {0x25, 0x16, 0xa2}, + {0x25, 0x17, 0x4a}, + {0x25, 0x18, 0x08}, // Biquad - BQ7 Left - Filter: Equalizer (Q Factor) Frequency: 315 Hz QVal: 0.9 Bandwidth: 1000 Hz + {0x25, 0x19, 0x00}, + {0x25, 0x1a, 0x00}, + {0x25, 0x1b, 0x00}, + {0x25, 0x1c, 0xf0}, + {0x25, 0x1d, 0x2f}, + {0x25, 0x1e, 0x3e}, + {0x25, 0x1f, 0x6a}, + {0x25, 0x20, 0x07}, + {0x25, 0x21, 0xd1}, + {0x25, 0x22, 0x9d}, + {0x25, 0x23, 0xe7}, + {0x25, 0x24, 0x0f}, + {0x25, 0x25, 0xd0}, + {0x25, 0x26, 0xc1}, + {0x25, 0x27, 0x96}, + {0x25, 0x28, 0xf8}, + {0x25, 0x29, 0x2e}, + {0x25, 0x2a, 0x62}, + {0x25, 0x2b, 0x19}, + {0x25, 0x2c, 0x08}, // Biquad - BQ8 Left - Filter: Equalizer (Q Factor) Frequency: 500 Hz QVal: 0.9 Bandwidth: 1000 Hz + {0x25, 0x2d, 0x00}, + {0x25, 0x2e, 0x00}, + {0x25, 0x2f, 0x00}, + {0x25, 0x30, 0xf0}, + {0x25, 0x31, 0x4b}, + {0x25, 0x32, 0x4a}, + {0x25, 0x33, 0xa6}, + {0x25, 0x34, 0x07}, + {0x25, 0x35, 0xb6}, + {0x25, 0x36, 0xdc}, + {0x25, 0x37, 0xc0}, + {0x25, 0x38, 0x0f}, + {0x25, 0x39, 0xb4}, + {0x25, 0x3a, 0xb5}, + {0x25, 0x3b, 0x5a}, + {0x25, 0x3c, 0xf8}, + {0x25, 0x3d, 0x49}, + {0x25, 0x3e, 0x23}, + {0x25, 0x3f, 0x40}, + {0x25, 0x40, 0x08}, // Biquad - BQ9 Left - Filter: Equalizer (Q Factor) Frequency: 800 Hz QVal: 0.8 Bandwidth: 1000 Hz + {0x25, 0x41, 0x00}, + {0x25, 0x42, 0x00}, + {0x25, 0x43, 0x00}, + {0x25, 0x44, 0xf0}, + {0x25, 0x45, 0x87}, + {0x25, 0x46, 0x3a}, + {0x25, 0x47, 0xb6}, + {0x25, 0x48, 0x07}, + {0x25, 0x49, 0x7e}, + {0x25, 0x4a, 0x34}, + {0x25, 0x4b, 0xca}, + {0x25, 0x4c, 0x0f}, + {0x25, 0x4d, 0x78}, + {0x25, 0x4e, 0xc5}, + {0x25, 0x4f, 0x4a}, + {0x25, 0x50, 0xf8}, + {0x25, 0x51, 0x81}, + {0x25, 0x52, 0xcb}, + {0x25, 0x53, 0x36}, + {0x25, 0x54, 0x08}, // Biquad - BQ10 Left - Filter: Equalizer (Q Factor) Frequency: 1250 Hz QVal: 0.8 Bandwidth: 1000 Hz + {0x25, 0x55, 0x00}, + {0x25, 0x56, 0x00}, + {0x25, 0x57, 0x00}, + {0x25, 0x58, 0xf0}, + {0x25, 0x59, 0xd4}, + {0x25, 0x5a, 0x48}, + {0x25, 0x5b, 0xf3}, + {0x25, 0x5c, 0x07}, + {0x25, 0x5d, 0x38}, + {0x25, 0x5e, 0xbf}, + {0x25, 0x5f, 0xae}, + {0x25, 0x60, 0x0f}, + {0x25, 0x61, 0x2b}, + {0x25, 0x62, 0xb7}, + {0x25, 0x63, 0x0d}, + {0x25, 0x64, 0xf8}, + {0x25, 0x65, 0xc7}, + {0x25, 0x66, 0x40}, + {0x25, 0x67, 0x52}, + {0x25, 0x68, 0x08}, // Biquad - BQ11 Left - Filter: Equalizer (Q Factor) Frequency: 2000 Hz QVal: 0.7 Bandwidth: 1000 Hz + {0x25, 0x69, 0x00}, + {0x25, 0x6a, 0x00}, + {0x25, 0x6b, 0x00}, + {0x25, 0x6c, 0xf1}, + {0x25, 0x6d, 0x7e}, + {0x25, 0x6e, 0x46}, + {0x25, 0x6f, 0x3e}, + {0x25, 0x70, 0x06}, + {0x25, 0x71, 0xa1}, + {0x25, 0x72, 0xc5}, + {0x25, 0x73, 0x6e}, + {0x25, 0x74, 0x0e}, + {0x25, 0x75, 0x81}, + {0x25, 0x76, 0xb9}, + {0x25, 0x77, 0xc2}, + {0x25, 0x78, 0xf9}, + {0x25, 0x79, 0x5e}, + {0x25, 0x7a, 0x3a}, + {0x25, 0x7b, 0x92}, + {0x25, 0x7c, 0x08}, // Biquad - BQ12 Left - Filter: Equalizer (Q Factor) Frequency: 3150 Hz QVal: 0.7 Bandwidth: 1000 Hz + {0x25, 0x7d, 0x00}, + {0x25, 0x7e, 0x00}, + {0x25, 0x7f, 0x00}, + {0x26, 0x08, 0xf2}, + {0x26, 0x09, 0x59}, + {0x26, 0x0a, 0x5e}, + {0x26, 0x0b, 0x71}, + {0x26, 0x0c, 0x05}, + {0x26, 0x0d, 0xf2}, + {0x26, 0x0e, 0x3d}, + {0x26, 0x0f, 0x2a}, + {0x26, 0x10, 0x0d}, + {0x26, 0x11, 0xa6}, + {0x26, 0x12, 0xa1}, + {0x26, 0x13, 0x8f}, + {0x26, 0x14, 0xfa}, + {0x26, 0x15, 0x0d}, + {0x26, 0x16, 0xc2}, + {0x26, 0x17, 0xd6}, + {0x26, 0x18, 0x08}, // Biquad - BQ13 Left - Filter: Equalizer (Q Factor) Frequency: 5000 Hz QVal: 0.6 Bandwidth: 1000 Hz + {0x26, 0x19, 0x00}, + {0x26, 0x1a, 0x00}, + {0x26, 0x1b, 0x00}, + {0x26, 0x1c, 0xf4}, + {0x26, 0x1d, 0x18}, + {0x26, 0x1e, 0x76}, + {0x26, 0x1f, 0x1f}, + {0x26, 0x20, 0x04}, + {0x26, 0x21, 0x92}, + {0x26, 0x22, 0x55}, + {0x26, 0x23, 0xd1}, + {0x26, 0x24, 0x0b}, + {0x26, 0x25, 0xe7}, + {0x26, 0x26, 0x89}, + {0x26, 0x27, 0xe1}, + {0x26, 0x28, 0xfb}, + {0x26, 0x29, 0x6d}, + {0x26, 0x2a, 0xaa}, + {0x26, 0x2b, 0x2f}, + {0x26, 0x2c, 0x08}, // Biquad - BQ14 Left - Filter: Equalizer (Q Factor) Frequency: 8000 Hz QVal: 0.6 Bandwidth: 1000 Hz + {0x26, 0x2d, 0x00}, + {0x26, 0x2e, 0x00}, + {0x26, 0x2f, 0x00}, + {0x26, 0x30, 0xf6}, + {0x26, 0x31, 0x5a}, + {0x26, 0x32, 0x59}, + {0x26, 0x33, 0x40}, + {0x26, 0x34, 0x03}, + {0x26, 0x35, 0x23}, + {0x26, 0x36, 0xb5}, + {0x26, 0x37, 0x30}, + {0x26, 0x38, 0x09}, + {0x26, 0x39, 0xa5}, + {0x26, 0x3a, 0xa6}, + {0x26, 0x3b, 0xc0}, + {0x26, 0x3c, 0xfc}, + {0x26, 0x3d, 0xdc}, + {0x26, 0x3e, 0x4a}, + {0x26, 0x3f, 0xd0}, + {0x26, 0x40, 0x08}, // Biquad - BQ15 Left - Filter: Equalizer (Q Factor) Frequency: 16000 Hz QVal: 0.5 Bandwidth: 1000 Hz + {0x26, 0x41, 0x00}, + {0x26, 0x42, 0x00}, + {0x26, 0x43, 0x00}, + {0x26, 0x44, 0xfc}, + {0x26, 0x45, 0x17}, + {0x26, 0x46, 0x9b}, + {0x26, 0x47, 0xa8}, + {0x26, 0x48, 0xff}, + {0x26, 0x49, 0xd0}, + {0x26, 0x4a, 0xc8}, + {0x26, 0x4b, 0xb1}, + {0x26, 0x4c, 0x03}, + {0x26, 0x4d, 0xe8}, + {0x26, 0x4e, 0x64}, + {0x26, 0x4f, 0x58}, + {0x26, 0x50, 0x00}, + {0x26, 0x51, 0x2f}, + {0x26, 0x52, 0x37}, + {0x26, 0x53, 0x4f}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_left_p1[TAS5805M_EQ_REG_PER_STEP] = { + {0x24, 0x18, 0x08}, // Biquad - BQ1 Left - Filter: Equalizer (Q Factor) Frequency: 20 Hz Gain: 1dB QVal: 2 Bandwidth: 1000 Hz + {0x24, 0x19, 0x00}, + {0x24, 0x1a, 0x14}, + {0x24, 0x1b, 0xee}, + {0x24, 0x1c, 0xf0}, + {0x24, 0x1d, 0x01}, + {0x24, 0x1e, 0x57}, + {0x24, 0x1f, 0xef}, + {0x24, 0x20, 0x07}, + {0x24, 0x21, 0xfe}, + {0x24, 0x22, 0x94}, + {0x24, 0x23, 0x0a}, + {0x24, 0x24, 0x0f}, + {0x24, 0x25, 0xfe}, + {0x24, 0x26, 0xa8}, + {0x24, 0x27, 0x11}, + {0x24, 0x28, 0xf8}, + {0x24, 0x29, 0x01}, + {0x24, 0x2a, 0x57}, + {0x24, 0x2b, 0x09}, + {0x24, 0x2c, 0x08}, // Biquad - BQ2 Left - Filter: Equalizer (Q Factor) Frequency: 31.5 Hz Gain: 1dB QVal: 2 Bandwidth: 1000 Hz + {0x24, 0x2d, 0x00}, + {0x24, 0x2e, 0x20}, + {0x24, 0x2f, 0xf5}, + {0x24, 0x30, 0xf0}, + {0x24, 0x31, 0x02}, + {0x24, 0x32, 0x1e}, + {0x24, 0x33, 0x67}, + {0x24, 0x34, 0x07}, + {0x24, 0x35, 0xfd}, + {0x24, 0x36, 0xc2}, + {0x24, 0x37, 0xde}, + {0x24, 0x38, 0x0f}, + {0x24, 0x39, 0xfd}, + {0x24, 0x3a, 0xe1}, + {0x24, 0x3b, 0x99}, + {0x24, 0x3c, 0xf8}, + {0x24, 0x3d, 0x02}, + {0x24, 0x3e, 0x1c}, + {0x24, 0x3f, 0x2d}, + {0x24, 0x40, 0x08}, // Biquad - BQ3 Left - Filter: Equalizer (Q Factor) Frequency: 50 Hz Gain: 1dB QVal: 1.5 Bandwidth: 1000 Hz + {0x24, 0x41, 0x00}, + {0x24, 0x42, 0x45}, + {0x24, 0x43, 0xb5}, + {0x24, 0x44, 0xf0}, + {0x24, 0x45, 0x04}, + {0x24, 0x46, 0x7c}, + {0x24, 0x47, 0x2f}, + {0x24, 0x48, 0x07}, + {0x24, 0x49, 0xfb}, + {0x24, 0x4a, 0x43}, + {0x24, 0x4b, 0xb8}, + {0x24, 0x4c, 0x0f}, + {0x24, 0x4d, 0xfb}, + {0x24, 0x4e, 0x83}, + {0x24, 0x4f, 0xd1}, + {0x24, 0x50, 0xf8}, + {0x24, 0x51, 0x04}, + {0x24, 0x52, 0x76}, + {0x24, 0x53, 0x93}, + {0x24, 0x54, 0x08}, // Biquad - BQ4 Left - Filter: Equalizer (Q Factor) Frequency: 80 Hz Gain: 1dB QVal: 1.5 Bandwidth: 1000 Hz + {0x24, 0x55, 0x00}, + {0x24, 0x56, 0x6f}, + {0x24, 0x57, 0x75}, + {0x24, 0x58, 0xf0}, + {0x24, 0x59, 0x07}, + {0x24, 0x5a, 0x31}, + {0x24, 0x5b, 0x45}, + {0x24, 0x5c, 0x07}, + {0x24, 0x5d, 0xf8}, + {0x24, 0x5e, 0x6d}, + {0x24, 0x5f, 0x9e}, + {0x24, 0x60, 0x0f}, + {0x24, 0x61, 0xf8}, + {0x24, 0x62, 0xce}, + {0x24, 0x63, 0xbb}, + {0x24, 0x64, 0xf8}, + {0x24, 0x65, 0x07}, + {0x24, 0x66, 0x22}, + {0x24, 0x67, 0xec}, + {0x24, 0x68, 0x08}, // Biquad - BQ5 Left - Filter: Equalizer (Q Factor) Frequency: 125 Hz Gain: 1dB QVal: 1 Bandwidth: 1000 Hz + {0x24, 0x69, 0x01}, + {0x24, 0x6a, 0x04}, + {0x24, 0x6b, 0x9f}, + {0x24, 0x6c, 0xf0}, + {0x24, 0x6d, 0x10}, + {0x24, 0x6e, 0xd2}, + {0x24, 0x6f, 0xcc}, + {0x24, 0x70, 0x07}, + {0x24, 0x71, 0xee}, + {0x24, 0x72, 0x4b}, + {0x24, 0x73, 0x88}, + {0x24, 0x74, 0x0f}, + {0x24, 0x75, 0xef}, + {0x24, 0x76, 0x2d}, + {0x24, 0x77, 0x34}, + {0x24, 0x78, 0xf8}, + {0x24, 0x79, 0x10}, + {0x24, 0x7a, 0xaf}, + {0x24, 0x7b, 0xd9}, + {0x24, 0x7c, 0x08}, // Biquad - BQ6 Left - Filter: Equalizer (Q Factor) Frequency: 200 Hz Gain: 1dB QVal: 1 Bandwidth: 1000 Hz + {0x24, 0x7d, 0x01}, + {0x24, 0x7e, 0x9f}, + {0x24, 0x7f, 0xfa}, + {0x25, 0x08, 0xf0}, + {0x25, 0x09, 0x1a}, + {0x25, 0x0a, 0xfb}, + {0x25, 0x0b, 0x8a}, + {0x25, 0x0c, 0x07}, + {0x25, 0x0d, 0xe3}, + {0x25, 0x0e, 0xbd}, + {0x25, 0x0f, 0xbc}, + {0x25, 0x10, 0x0f}, + {0x25, 0x11, 0xe5}, + {0x25, 0x12, 0x04}, + {0x25, 0x13, 0x76}, + {0x25, 0x14, 0xf8}, + {0x25, 0x15, 0x1a}, + {0x25, 0x16, 0xa2}, + {0x25, 0x17, 0x4a}, + {0x25, 0x18, 0x08}, // Biquad - BQ7 Left - Filter: Equalizer (Q Factor) Frequency: 315 Hz Gain: 1dB QVal: 0.9 Bandwidth: 1000 Hz + {0x25, 0x19, 0x02}, + {0x25, 0x1a, 0xd4}, + {0x25, 0x1b, 0x6e}, + {0x25, 0x1c, 0xf0}, + {0x25, 0x1d, 0x2f}, + {0x25, 0x1e, 0x3e}, + {0x25, 0x1f, 0x6a}, + {0x25, 0x20, 0x07}, + {0x25, 0x21, 0xce}, + {0x25, 0x22, 0xc9}, + {0x25, 0x23, 0x79}, + {0x25, 0x24, 0x0f}, + {0x25, 0x25, 0xd0}, + {0x25, 0x26, 0xc1}, + {0x25, 0x27, 0x96}, + {0x25, 0x28, 0xf8}, + {0x25, 0x29, 0x2e}, + {0x25, 0x2a, 0x62}, + {0x25, 0x2b, 0x19}, + {0x25, 0x2c, 0x08}, // Biquad - BQ8 Left - Filter: Equalizer (Q Factor) Frequency: 500 Hz Gain: 1dB QVal: 0.9 Bandwidth: 1000 Hz + {0x25, 0x2d, 0x04}, + {0x25, 0x2e, 0x76}, + {0x25, 0x2f, 0x4a}, + {0x25, 0x30, 0xf0}, + {0x25, 0x31, 0x4b}, + {0x25, 0x32, 0x4a}, + {0x25, 0x33, 0xa6}, + {0x25, 0x34, 0x07}, + {0x25, 0x35, 0xb2}, + {0x25, 0x36, 0x66}, + {0x25, 0x37, 0x75}, + {0x25, 0x38, 0x0f}, + {0x25, 0x39, 0xb4}, + {0x25, 0x3a, 0xb5}, + {0x25, 0x3b, 0x5a}, + {0x25, 0x3c, 0xf8}, + {0x25, 0x3d, 0x49}, + {0x25, 0x3e, 0x23}, + {0x25, 0x3f, 0x40}, + {0x25, 0x40, 0x08}, // Biquad - BQ9 Left - Filter: Equalizer (Q Factor) Frequency: 800 Hz Gain: 1dB QVal: 0.8 Bandwidth: 1000 Hz + {0x25, 0x41, 0x07}, + {0x25, 0x42, 0xeb}, + {0x25, 0x43, 0x2b}, + {0x25, 0x44, 0xf0}, + {0x25, 0x45, 0x87}, + {0x25, 0x46, 0x3a}, + {0x25, 0x47, 0xb6}, + {0x25, 0x48, 0x07}, + {0x25, 0x49, 0x76}, + {0x25, 0x4a, 0x49}, + {0x25, 0x4b, 0x9f}, + {0x25, 0x4c, 0x0f}, + {0x25, 0x4d, 0x78}, + {0x25, 0x4e, 0xc5}, + {0x25, 0x4f, 0x4a}, + {0x25, 0x50, 0xf8}, + {0x25, 0x51, 0x81}, + {0x25, 0x52, 0xcb}, + {0x25, 0x53, 0x36}, + {0x25, 0x54, 0x08}, // Biquad - BQ10 Left - Filter: Equalizer (Q Factor) Frequency: 1250 Hz Gain: 1dB QVal: 0.8 Bandwidth: 1000 Hz + {0x25, 0x55, 0x0c}, + {0x25, 0x56, 0x27}, + {0x25, 0x57, 0xfa}, + {0x25, 0x58, 0xf0}, + {0x25, 0x59, 0xd4}, + {0x25, 0x5a, 0x48}, + {0x25, 0x5b, 0xf3}, + {0x25, 0x5c, 0x07}, + {0x25, 0x5d, 0x2c}, + {0x25, 0x5e, 0x97}, + {0x25, 0x5f, 0xb3}, + {0x25, 0x60, 0x0f}, + {0x25, 0x61, 0x2b}, + {0x25, 0x62, 0xb7}, + {0x25, 0x63, 0x0d}, + {0x25, 0x64, 0xf8}, + {0x25, 0x65, 0xc7}, + {0x25, 0x66, 0x40}, + {0x25, 0x67, 0x52}, + {0x25, 0x68, 0x08}, // Biquad - BQ11 Left - Filter: Equalizer (Q Factor) Frequency: 2000 Hz Gain: 1dB QVal: 0.7 Bandwidth: 1000 Hz + {0x25, 0x69, 0x15}, + {0x25, 0x6a, 0x5e}, + {0x25, 0x6b, 0x00}, + {0x25, 0x6c, 0xf1}, + {0x25, 0x6d, 0x7e}, + {0x25, 0x6e, 0x46}, + {0x25, 0x6f, 0x3e}, + {0x25, 0x70, 0x06}, + {0x25, 0x71, 0x8c}, + {0x25, 0x72, 0x67}, + {0x25, 0x73, 0x6e}, + {0x25, 0x74, 0x0e}, + {0x25, 0x75, 0x81}, + {0x25, 0x76, 0xb9}, + {0x25, 0x77, 0xc2}, + {0x25, 0x78, 0xf9}, + {0x25, 0x79, 0x5e}, + {0x25, 0x7a, 0x3a}, + {0x25, 0x7b, 0x92}, + {0x25, 0x7c, 0x08}, // Biquad - BQ12 Left - Filter: Equalizer (Q Factor) Frequency: 3150 Hz Gain: 1dB QVal: 0.7 Bandwidth: 1000 Hz + {0x25, 0x7d, 0x20}, + {0x25, 0x7e, 0x13}, + {0x25, 0x7f, 0x87}, + {0x26, 0x08, 0xf2}, + {0x26, 0x09, 0x59}, + {0x26, 0x0a, 0x5e}, + {0x26, 0x0b, 0x71}, + {0x26, 0x0c, 0x05}, + {0x26, 0x0d, 0xd2}, + {0x26, 0x0e, 0x29}, + {0x26, 0x0f, 0xa3}, + {0x26, 0x10, 0x0d}, + {0x26, 0x11, 0xa6}, + {0x26, 0x12, 0xa1}, + {0x26, 0x13, 0x8f}, + {0x26, 0x14, 0xfa}, + {0x26, 0x15, 0x0d}, + {0x26, 0x16, 0xc2}, + {0x26, 0x17, 0xd6}, + {0x26, 0x18, 0x08}, // Biquad - BQ13 Left - Filter: Equalizer (Q Factor) Frequency: 5000 Hz Gain: 1dB QVal: 0.6 Bandwidth: 1000 Hz + {0x26, 0x19, 0x35}, + {0x26, 0x1a, 0x8b}, + {0x26, 0x1b, 0xb0}, + {0x26, 0x1c, 0xf4}, + {0x26, 0x1d, 0x18}, + {0x26, 0x1e, 0x76}, + {0x26, 0x1f, 0x1f}, + {0x26, 0x20, 0x04}, + {0x26, 0x21, 0x5c}, + {0x26, 0x22, 0xca}, + {0x26, 0x23, 0x21}, + {0x26, 0x24, 0x0b}, + {0x26, 0x25, 0xe7}, + {0x26, 0x26, 0x89}, + {0x26, 0x27, 0xe1}, + {0x26, 0x28, 0xfb}, + {0x26, 0x29, 0x6d}, + {0x26, 0x2a, 0xaa}, + {0x26, 0x2b, 0x2f}, + {0x26, 0x2c, 0x08}, // Biquad - BQ14 Left - Filter: Equalizer (Q Factor) Frequency: 8000 Hz Gain: 1dB QVal: 0.6 Bandwidth: 1000 Hz + {0x26, 0x2d, 0x4b}, + {0x26, 0x2e, 0xe9}, + {0x26, 0x2f, 0xce}, + {0x26, 0x30, 0xf6}, + {0x26, 0x31, 0x5a}, + {0x26, 0x32, 0x59}, + {0x26, 0x33, 0x40}, + {0x26, 0x34, 0x02}, + {0x26, 0x35, 0xd7}, + {0x26, 0x36, 0xcb}, + {0x26, 0x37, 0x61}, + {0x26, 0x38, 0x09}, + {0x26, 0x39, 0xa5}, + {0x26, 0x3a, 0xa6}, + {0x26, 0x3b, 0xc0}, + {0x26, 0x3c, 0xfc}, + {0x26, 0x3d, 0xdc}, + {0x26, 0x3e, 0x4a}, + {0x26, 0x3f, 0xd0}, + {0x26, 0x40, 0x08}, // Biquad - BQ15 Left - Filter: Equalizer (Q Factor) Frequency: 16000 Hz Gain: 1dB QVal: 0.5 Bandwidth: 1000 Hz + {0x26, 0x41, 0x7f}, + {0x26, 0x42, 0xd3}, + {0x26, 0x43, 0xd8}, + {0x26, 0x44, 0xfc}, + {0x26, 0x45, 0x17}, + {0x26, 0x46, 0x9b}, + {0x26, 0x47, 0xa8}, + {0x26, 0x48, 0xff}, + {0x26, 0x49, 0x50}, + {0x26, 0x4a, 0xf4}, + {0x26, 0x4b, 0xd9}, + {0x26, 0x4c, 0x03}, + {0x26, 0x4d, 0xe8}, + {0x26, 0x4e, 0x64}, + {0x26, 0x4f, 0x58}, + {0x26, 0x50, 0x00}, + {0x26, 0x51, 0x2f}, + {0x26, 0x52, 0x37}, + {0x26, 0x53, 0x4f}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_left_p2[TAS5805M_EQ_REG_PER_STEP] = { + {0x24, 0x18, 0x08}, // Biquad - BQ1 Left - Filter: Equalizer (Q Factor) Frequency: 20 Hz Gain: 2dB QVal: 2 Bandwidth: 1000 Hz + {0x24, 0x19, 0x00}, + {0x24, 0x1a, 0x2c}, + {0x24, 0x1b, 0x69}, + {0x24, 0x1c, 0xf0}, + {0x24, 0x1d, 0x01}, + {0x24, 0x1e, 0x57}, + {0x24, 0x1f, 0xef}, + {0x24, 0x20, 0x07}, + {0x24, 0x21, 0xfe}, + {0x24, 0x22, 0x7c}, + {0x24, 0x23, 0x8e}, + {0x24, 0x24, 0x0f}, + {0x24, 0x25, 0xfe}, + {0x24, 0x26, 0xa8}, + {0x24, 0x27, 0x11}, + {0x24, 0x28, 0xf8}, + {0x24, 0x29, 0x01}, + {0x24, 0x2a, 0x57}, + {0x24, 0x2b, 0x09}, + {0x24, 0x2c, 0x08}, // Biquad - BQ2 Left - Filter: Equalizer (Q Factor) Frequency: 31.5 Hz Gain: 2dB QVal: 2 Bandwidth: 1000 Hz + {0x24, 0x2d, 0x00}, + {0x24, 0x2e, 0x45}, + {0x24, 0x2f, 0xef}, + {0x24, 0x30, 0xf0}, + {0x24, 0x31, 0x02}, + {0x24, 0x32, 0x1e}, + {0x24, 0x33, 0x67}, + {0x24, 0x34, 0x07}, + {0x24, 0x35, 0xfd}, + {0x24, 0x36, 0x9d}, + {0x24, 0x37, 0xe4}, + {0x24, 0x38, 0x0f}, + {0x24, 0x39, 0xfd}, + {0x24, 0x3a, 0xe1}, + {0x24, 0x3b, 0x99}, + {0x24, 0x3c, 0xf8}, + {0x24, 0x3d, 0x02}, + {0x24, 0x3e, 0x1c}, + {0x24, 0x3f, 0x2d}, + {0x24, 0x40, 0x08}, // Biquad - BQ3 Left - Filter: Equalizer (Q Factor) Frequency: 50 Hz Gain: 2dB QVal: 1.5 Bandwidth: 1000 Hz + {0x24, 0x41, 0x00}, + {0x24, 0x42, 0x93}, + {0x24, 0x43, 0xec}, + {0x24, 0x44, 0xf0}, + {0x24, 0x45, 0x04}, + {0x24, 0x46, 0x7c}, + {0x24, 0x47, 0x2f}, + {0x24, 0x48, 0x07}, + {0x24, 0x49, 0xfa}, + {0x24, 0x4a, 0xf5}, + {0x24, 0x4b, 0x82}, + {0x24, 0x4c, 0x0f}, + {0x24, 0x4d, 0xfb}, + {0x24, 0x4e, 0x83}, + {0x24, 0x4f, 0xd1}, + {0x24, 0x50, 0xf8}, + {0x24, 0x51, 0x04}, + {0x24, 0x52, 0x76}, + {0x24, 0x53, 0x93}, + {0x24, 0x54, 0x08}, // Biquad - BQ4 Left - Filter: Equalizer (Q Factor) Frequency: 80 Hz Gain: 2dB QVal: 1.5 Bandwidth: 1000 Hz + {0x24, 0x55, 0x00}, + {0x24, 0x56, 0xec}, + {0x24, 0x57, 0x85}, + {0x24, 0x58, 0xf0}, + {0x24, 0x59, 0x07}, + {0x24, 0x5a, 0x31}, + {0x24, 0x5b, 0x45}, + {0x24, 0x5c, 0x07}, + {0x24, 0x5d, 0xf7}, + {0x24, 0x5e, 0xf0}, + {0x24, 0x5f, 0x8f}, + {0x24, 0x60, 0x0f}, + {0x24, 0x61, 0xf8}, + {0x24, 0x62, 0xce}, + {0x24, 0x63, 0xbb}, + {0x24, 0x64, 0xf8}, + {0x24, 0x65, 0x07}, + {0x24, 0x66, 0x22}, + {0x24, 0x67, 0xec}, + {0x24, 0x68, 0x08}, // Biquad - BQ5 Left - Filter: Equalizer (Q Factor) Frequency: 125 Hz Gain: 2dB QVal: 1 Bandwidth: 1000 Hz + {0x24, 0x69, 0x02}, + {0x24, 0x6a, 0x29}, + {0x24, 0x6b, 0x0b}, + {0x24, 0x6c, 0xf0}, + {0x24, 0x6d, 0x10}, + {0x24, 0x6e, 0xd2}, + {0x24, 0x6f, 0xcc}, + {0x24, 0x70, 0x07}, + {0x24, 0x71, 0xed}, + {0x24, 0x72, 0x27}, + {0x24, 0x73, 0x1c}, + {0x24, 0x74, 0x0f}, + {0x24, 0x75, 0xef}, + {0x24, 0x76, 0x2d}, + {0x24, 0x77, 0x34}, + {0x24, 0x78, 0xf8}, + {0x24, 0x79, 0x10}, + {0x24, 0x7a, 0xaf}, + {0x24, 0x7b, 0xd9}, + {0x24, 0x7c, 0x08}, // Biquad - BQ6 Left - Filter: Equalizer (Q Factor) Frequency: 200 Hz Gain: 2dB QVal: 1 Bandwidth: 1000 Hz + {0x24, 0x7d, 0x03}, + {0x24, 0x7e, 0x72}, + {0x24, 0x7f, 0xb7}, + {0x25, 0x08, 0xf0}, + {0x25, 0x09, 0x1a}, + {0x25, 0x0a, 0xfb}, + {0x25, 0x0b, 0x8a}, + {0x25, 0x0c, 0x07}, + {0x25, 0x0d, 0xe1}, + {0x25, 0x0e, 0xea}, + {0x25, 0x0f, 0xff}, + {0x25, 0x10, 0x0f}, + {0x25, 0x11, 0xe5}, + {0x25, 0x12, 0x04}, + {0x25, 0x13, 0x76}, + {0x25, 0x14, 0xf8}, + {0x25, 0x15, 0x1a}, + {0x25, 0x16, 0xa2}, + {0x25, 0x17, 0x4a}, + {0x25, 0x18, 0x08}, // Biquad - BQ7 Left - Filter: Equalizer (Q Factor) Frequency: 315 Hz Gain: 2dB QVal: 0.9 Bandwidth: 1000 Hz + {0x25, 0x19, 0x06}, + {0x25, 0x1a, 0x01}, + {0x25, 0x1b, 0x41}, + {0x25, 0x1c, 0xf0}, + {0x25, 0x1d, 0x2f}, + {0x25, 0x1e, 0x3e}, + {0x25, 0x1f, 0x6a}, + {0x25, 0x20, 0x07}, + {0x25, 0x21, 0xcb}, + {0x25, 0x22, 0x9c}, + {0x25, 0x23, 0xa7}, + {0x25, 0x24, 0x0f}, + {0x25, 0x25, 0xd0}, + {0x25, 0x26, 0xc1}, + {0x25, 0x27, 0x96}, + {0x25, 0x28, 0xf8}, + {0x25, 0x29, 0x2e}, + {0x25, 0x2a, 0x62}, + {0x25, 0x2b, 0x19}, + {0x25, 0x2c, 0x08}, // Biquad - BQ8 Left - Filter: Equalizer (Q Factor) Frequency: 500 Hz Gain: 2dB QVal: 0.9 Bandwidth: 1000 Hz + {0x25, 0x2d, 0x09}, + {0x25, 0x2e, 0x77}, + {0x25, 0x2f, 0xf6}, + {0x25, 0x30, 0xf0}, + {0x25, 0x31, 0x4b}, + {0x25, 0x32, 0x4a}, + {0x25, 0x33, 0xa6}, + {0x25, 0x34, 0x07}, + {0x25, 0x35, 0xad}, + {0x25, 0x36, 0x64}, + {0x25, 0x37, 0xc9}, + {0x25, 0x38, 0x0f}, + {0x25, 0x39, 0xb4}, + {0x25, 0x3a, 0xb5}, + {0x25, 0x3b, 0x5a}, + {0x25, 0x3c, 0xf8}, + {0x25, 0x3d, 0x49}, + {0x25, 0x3e, 0x23}, + {0x25, 0x3f, 0x40}, + {0x25, 0x40, 0x08}, // Biquad - BQ9 Left - Filter: Equalizer (Q Factor) Frequency: 800 Hz Gain: 2dB QVal: 0.8 Bandwidth: 1000 Hz + {0x25, 0x41, 0x10}, + {0x25, 0x42, 0xcd}, + {0x25, 0x43, 0xaf}, + {0x25, 0x44, 0xf0}, + {0x25, 0x45, 0x87}, + {0x25, 0x46, 0x3a}, + {0x25, 0x47, 0xb6}, + {0x25, 0x48, 0x07}, + {0x25, 0x49, 0x6d}, + {0x25, 0x4a, 0x67}, + {0x25, 0x4b, 0x1b}, + {0x25, 0x4c, 0x0f}, + {0x25, 0x4d, 0x78}, + {0x25, 0x4e, 0xc5}, + {0x25, 0x4f, 0x4a}, + {0x25, 0x50, 0xf8}, + {0x25, 0x51, 0x81}, + {0x25, 0x52, 0xcb}, + {0x25, 0x53, 0x36}, + {0x25, 0x54, 0x08}, // Biquad - BQ10 Left - Filter: Equalizer (Q Factor) Frequency: 1250 Hz Gain: 2dB QVal: 0.8 Bandwidth: 1000 Hz + {0x25, 0x55, 0x19}, + {0x25, 0x56, 0xcb}, + {0x25, 0x57, 0xad}, + {0x25, 0x58, 0xf0}, + {0x25, 0x59, 0xd4}, + {0x25, 0x5a, 0x48}, + {0x25, 0x5b, 0xf3}, + {0x25, 0x5c, 0x07}, + {0x25, 0x5d, 0x1e}, + {0x25, 0x5e, 0xf4}, + {0x25, 0x5f, 0x01}, + {0x25, 0x60, 0x0f}, + {0x25, 0x61, 0x2b}, + {0x25, 0x62, 0xb7}, + {0x25, 0x63, 0x0d}, + {0x25, 0x64, 0xf8}, + {0x25, 0x65, 0xc7}, + {0x25, 0x66, 0x40}, + {0x25, 0x67, 0x52}, + {0x25, 0x68, 0x08}, // Biquad - BQ11 Left - Filter: Equalizer (Q Factor) Frequency: 2000 Hz Gain: 2dB QVal: 0.7 Bandwidth: 1000 Hz + {0x25, 0x69, 0x2d}, + {0x25, 0x6a, 0x57}, + {0x25, 0x6b, 0x71}, + {0x25, 0x6c, 0xf1}, + {0x25, 0x6d, 0x7e}, + {0x25, 0x6e, 0x46}, + {0x25, 0x6f, 0x3e}, + {0x25, 0x70, 0x06}, + {0x25, 0x71, 0x74}, + {0x25, 0x72, 0x6d}, + {0x25, 0x73, 0xfd}, + {0x25, 0x74, 0x0e}, + {0x25, 0x75, 0x81}, + {0x25, 0x76, 0xb9}, + {0x25, 0x77, 0xc2}, + {0x25, 0x78, 0xf9}, + {0x25, 0x79, 0x5e}, + {0x25, 0x7a, 0x3a}, + {0x25, 0x7b, 0x92}, + {0x25, 0x7c, 0x08}, // Biquad - BQ12 Left - Filter: Equalizer (Q Factor) Frequency: 3150 Hz Gain: 2dB QVal: 0.7 Bandwidth: 1000 Hz + {0x25, 0x7d, 0x44}, + {0x25, 0x7e, 0x11}, + {0x25, 0x7f, 0x03}, + {0x26, 0x08, 0xf2}, + {0x26, 0x09, 0x59}, + {0x26, 0x0a, 0x5e}, + {0x26, 0x0b, 0x71}, + {0x26, 0x0c, 0x05}, + {0x26, 0x0d, 0xae}, + {0x26, 0x0e, 0x2c}, + {0x26, 0x0f, 0x27}, + {0x26, 0x10, 0x0d}, + {0x26, 0x11, 0xa6}, + {0x26, 0x12, 0xa1}, + {0x26, 0x13, 0x8f}, + {0x26, 0x14, 0xfa}, + {0x26, 0x15, 0x0d}, + {0x26, 0x16, 0xc2}, + {0x26, 0x17, 0xd6}, + {0x26, 0x18, 0x08}, // Biquad - BQ13 Left - Filter: Equalizer (Q Factor) Frequency: 5000 Hz Gain: 2dB QVal: 0.6 Bandwidth: 1000 Hz + {0x26, 0x19, 0x71}, + {0x26, 0x1a, 0x9f}, + {0x26, 0x1b, 0xf7}, + {0x26, 0x1c, 0xf4}, + {0x26, 0x1d, 0x18}, + {0x26, 0x1e, 0x76}, + {0x26, 0x1f, 0x1f}, + {0x26, 0x20, 0x04}, + {0x26, 0x21, 0x20}, + {0x26, 0x22, 0xb5}, + {0x26, 0x23, 0xda}, + {0x26, 0x24, 0x0b}, + {0x26, 0x25, 0xe7}, + {0x26, 0x26, 0x89}, + {0x26, 0x27, 0xe1}, + {0x26, 0x28, 0xfb}, + {0x26, 0x29, 0x6d}, + {0x26, 0x2a, 0xaa}, + {0x26, 0x2b, 0x2f}, + {0x26, 0x2c, 0x08}, // Biquad - BQ14 Left - Filter: Equalizer (Q Factor) Frequency: 8000 Hz Gain: 2dB QVal: 0.6 Bandwidth: 1000 Hz + {0x26, 0x2d, 0xa1}, + {0x26, 0x2e, 0x16}, + {0x26, 0x2f, 0xe6}, + {0x26, 0x30, 0xf6}, + {0x26, 0x31, 0x5a}, + {0x26, 0x32, 0x59}, + {0x26, 0x33, 0x40}, + {0x26, 0x34, 0x02}, + {0x26, 0x35, 0x82}, + {0x26, 0x36, 0x9e}, + {0x26, 0x37, 0x4a}, + {0x26, 0x38, 0x09}, + {0x26, 0x39, 0xa5}, + {0x26, 0x3a, 0xa6}, + {0x26, 0x3b, 0xc0}, + {0x26, 0x3c, 0xfc}, + {0x26, 0x3d, 0xdc}, + {0x26, 0x3e, 0x4a}, + {0x26, 0x3f, 0xd0}, + {0x26, 0x40, 0x09}, // Biquad - BQ15 Left - Filter: Equalizer (Q Factor) Frequency: 16000 Hz Gain: 2dB QVal: 0.5 Bandwidth: 1000 Hz + {0x26, 0x41, 0x0f}, + {0x26, 0x42, 0x40}, + {0x26, 0x43, 0x99}, + {0x26, 0x44, 0xfc}, + {0x26, 0x45, 0x17}, + {0x26, 0x46, 0x9b}, + {0x26, 0x47, 0xa8}, + {0x26, 0x48, 0xfe}, + {0x26, 0x49, 0xc1}, + {0x26, 0x4a, 0x88}, + {0x26, 0x4b, 0x18}, + {0x26, 0x4c, 0x03}, + {0x26, 0x4d, 0xe8}, + {0x26, 0x4e, 0x64}, + {0x26, 0x4f, 0x58}, + {0x26, 0x50, 0x00}, + {0x26, 0x51, 0x2f}, + {0x26, 0x52, 0x37}, + {0x26, 0x53, 0x4f}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_left_p3[TAS5805M_EQ_REG_PER_STEP] = { + {0x24, 0x18, 0x08}, // Biquad - BQ1 Left - Filter: Equalizer (Q Factor) Frequency: 20 Hz Gain: 3dB QVal: 2 Bandwidth: 1000 Hz + {0x24, 0x19, 0x00}, + {0x24, 0x1a, 0x46}, + {0x24, 0x1b, 0xc2}, + {0x24, 0x1c, 0xf0}, + {0x24, 0x1d, 0x01}, + {0x24, 0x1e, 0x57}, + {0x24, 0x1f, 0xef}, + {0x24, 0x20, 0x07}, + {0x24, 0x21, 0xfe}, + {0x24, 0x22, 0x62}, + {0x24, 0x23, 0x36}, + {0x24, 0x24, 0x0f}, + {0x24, 0x25, 0xfe}, + {0x24, 0x26, 0xa8}, + {0x24, 0x27, 0x11}, + {0x24, 0x28, 0xf8}, + {0x24, 0x29, 0x01}, + {0x24, 0x2a, 0x57}, + {0x24, 0x2b, 0x09}, + {0x24, 0x2c, 0x08}, // Biquad - BQ2 Left - Filter: Equalizer (Q Factor) Frequency: 31.5 Hz Gain: 3dB QVal: 2 Bandwidth: 1000 Hz + {0x24, 0x2d, 0x00}, + {0x24, 0x2e, 0x6f}, + {0x24, 0x2f, 0x6c}, + {0x24, 0x30, 0xf0}, + {0x24, 0x31, 0x02}, + {0x24, 0x32, 0x1e}, + {0x24, 0x33, 0x67}, + {0x24, 0x34, 0x07}, + {0x24, 0x35, 0xfd}, + {0x24, 0x36, 0x74}, + {0x24, 0x37, 0x67}, + {0x24, 0x38, 0x0f}, + {0x24, 0x39, 0xfd}, + {0x24, 0x3a, 0xe1}, + {0x24, 0x3b, 0x99}, + {0x24, 0x3c, 0xf8}, + {0x24, 0x3d, 0x02}, + {0x24, 0x3e, 0x1c}, + {0x24, 0x3f, 0x2d}, + {0x24, 0x40, 0x08}, // Biquad - BQ3 Left - Filter: Equalizer (Q Factor) Frequency: 50 Hz Gain: 3dB QVal: 1.5 Bandwidth: 1000 Hz + {0x24, 0x41, 0x00}, + {0x24, 0x42, 0xeb}, + {0x24, 0x43, 0xad}, + {0x24, 0x44, 0xf0}, + {0x24, 0x45, 0x04}, + {0x24, 0x46, 0x7c}, + {0x24, 0x47, 0x2f}, + {0x24, 0x48, 0x07}, + {0x24, 0x49, 0xfa}, + {0x24, 0x4a, 0x9d}, + {0x24, 0x4b, 0xc0}, + {0x24, 0x4c, 0x0f}, + {0x24, 0x4d, 0xfb}, + {0x24, 0x4e, 0x83}, + {0x24, 0x4f, 0xd1}, + {0x24, 0x50, 0xf8}, + {0x24, 0x51, 0x04}, + {0x24, 0x52, 0x76}, + {0x24, 0x53, 0x93}, + {0x24, 0x54, 0x08}, // Biquad - BQ4 Left - Filter: Equalizer (Q Factor) Frequency: 80 Hz Gain: 3dB QVal: 1.5 Bandwidth: 1000 Hz + {0x24, 0x55, 0x01}, + {0x24, 0x56, 0x78}, + {0x24, 0x57, 0xd6}, + {0x24, 0x58, 0xf0}, + {0x24, 0x59, 0x07}, + {0x24, 0x5a, 0x31}, + {0x24, 0x5b, 0x45}, + {0x24, 0x5c, 0x07}, + {0x24, 0x5d, 0xf7}, + {0x24, 0x5e, 0x64}, + {0x24, 0x5f, 0x3e}, + {0x24, 0x60, 0x0f}, + {0x24, 0x61, 0xf8}, + {0x24, 0x62, 0xce}, + {0x24, 0x63, 0xbb}, + {0x24, 0x64, 0xf8}, + {0x24, 0x65, 0x07}, + {0x24, 0x66, 0x22}, + {0x24, 0x67, 0xec}, + {0x24, 0x68, 0x08}, // Biquad - BQ5 Left - Filter: Equalizer (Q Factor) Frequency: 125 Hz Gain: 3dB QVal: 1 Bandwidth: 1000 Hz + {0x24, 0x69, 0x03}, + {0x24, 0x6a, 0x71}, + {0x24, 0x6b, 0x26}, + {0x24, 0x6c, 0xf0}, + {0x24, 0x6d, 0x10}, + {0x24, 0x6e, 0xd2}, + {0x24, 0x6f, 0xcc}, + {0x24, 0x70, 0x07}, + {0x24, 0x71, 0xeb}, + {0x24, 0x72, 0xdf}, + {0x24, 0x73, 0x01}, + {0x24, 0x74, 0x0f}, + {0x24, 0x75, 0xef}, + {0x24, 0x76, 0x2d}, + {0x24, 0x77, 0x34}, + {0x24, 0x78, 0xf8}, + {0x24, 0x79, 0x10}, + {0x24, 0x7a, 0xaf}, + {0x24, 0x7b, 0xd9}, + {0x24, 0x7c, 0x08}, // Biquad - BQ6 Left - Filter: Equalizer (Q Factor) Frequency: 200 Hz Gain: 3dB QVal: 1 Bandwidth: 1000 Hz + {0x24, 0x7d, 0x05}, + {0x24, 0x7e, 0x7e}, + {0x24, 0x7f, 0x66}, + {0x25, 0x08, 0xf0}, + {0x25, 0x09, 0x1a}, + {0x25, 0x0a, 0xfb}, + {0x25, 0x0b, 0x8a}, + {0x25, 0x0c, 0x07}, + {0x25, 0x0d, 0xdf}, + {0x25, 0x0e, 0xdf}, + {0x25, 0x0f, 0x50}, + {0x25, 0x10, 0x0f}, + {0x25, 0x11, 0xe5}, + {0x25, 0x12, 0x04}, + {0x25, 0x13, 0x76}, + {0x25, 0x14, 0xf8}, + {0x25, 0x15, 0x1a}, + {0x25, 0x16, 0xa2}, + {0x25, 0x17, 0x4a}, + {0x25, 0x18, 0x08}, // Biquad - BQ7 Left - Filter: Equalizer (Q Factor) Frequency: 315 Hz Gain: 3dB QVal: 0.9 Bandwidth: 1000 Hz + {0x25, 0x19, 0x09}, + {0x25, 0x1a, 0x91}, + {0x25, 0x1b, 0x41}, + {0x25, 0x1c, 0xf0}, + {0x25, 0x1d, 0x2f}, + {0x25, 0x1e, 0x3e}, + {0x25, 0x1f, 0x6a}, + {0x25, 0x20, 0x07}, + {0x25, 0x21, 0xc8}, + {0x25, 0x22, 0x0c}, + {0x25, 0x23, 0xa6}, + {0x25, 0x24, 0x0f}, + {0x25, 0x25, 0xd0}, + {0x25, 0x26, 0xc1}, + {0x25, 0x27, 0x96}, + {0x25, 0x28, 0xf8}, + {0x25, 0x29, 0x2e}, + {0x25, 0x2a, 0x62}, + {0x25, 0x2b, 0x19}, + {0x25, 0x2c, 0x08}, // Biquad - BQ8 Left - Filter: Equalizer (Q Factor) Frequency: 500 Hz Gain: 3dB QVal: 0.9 Bandwidth: 1000 Hz + {0x25, 0x2d, 0x0f}, + {0x25, 0x2e, 0x16}, + {0x25, 0x2f, 0x06}, + {0x25, 0x30, 0xf0}, + {0x25, 0x31, 0x4b}, + {0x25, 0x32, 0x4a}, + {0x25, 0x33, 0xa6}, + {0x25, 0x34, 0x07}, + {0x25, 0x35, 0xa7}, + {0x25, 0x36, 0xc6}, + {0x25, 0x37, 0xba}, + {0x25, 0x38, 0x0f}, + {0x25, 0x39, 0xb4}, + {0x25, 0x3a, 0xb5}, + {0x25, 0x3b, 0x5a}, + {0x25, 0x3c, 0xf8}, + {0x25, 0x3d, 0x49}, + {0x25, 0x3e, 0x23}, + {0x25, 0x3f, 0x40}, + {0x25, 0x40, 0x08}, // Biquad - BQ9 Left - Filter: Equalizer (Q Factor) Frequency: 800 Hz Gain: 3dB QVal: 0.8 Bandwidth: 1000 Hz + {0x25, 0x41, 0x1a}, + {0x25, 0x42, 0xc5}, + {0x25, 0x43, 0xbc}, + {0x25, 0x44, 0xf0}, + {0x25, 0x45, 0x87}, + {0x25, 0x46, 0x3a}, + {0x25, 0x47, 0xb6}, + {0x25, 0x48, 0x07}, + {0x25, 0x49, 0x63}, + {0x25, 0x4a, 0x6f}, + {0x25, 0x4b, 0x0d}, + {0x25, 0x4c, 0x0f}, + {0x25, 0x4d, 0x78}, + {0x25, 0x4e, 0xc5}, + {0x25, 0x4f, 0x4a}, + {0x25, 0x50, 0xf8}, + {0x25, 0x51, 0x81}, + {0x25, 0x52, 0xcb}, + {0x25, 0x53, 0x36}, + {0x25, 0x54, 0x08}, // Biquad - BQ10 Left - Filter: Equalizer (Q Factor) Frequency: 1250 Hz Gain: 3dB QVal: 0.8 Bandwidth: 1000 Hz + {0x25, 0x55, 0x29}, + {0x25, 0x56, 0x19}, + {0x25, 0x57, 0x6c}, + {0x25, 0x58, 0xf0}, + {0x25, 0x59, 0xd4}, + {0x25, 0x5a, 0x48}, + {0x25, 0x5b, 0xf3}, + {0x25, 0x5c, 0x07}, + {0x25, 0x5d, 0x0f}, + {0x25, 0x5e, 0xa6}, + {0x25, 0x5f, 0x41}, + {0x25, 0x60, 0x0f}, + {0x25, 0x61, 0x2b}, + {0x25, 0x62, 0xb7}, + {0x25, 0x63, 0x0d}, + {0x25, 0x64, 0xf8}, + {0x25, 0x65, 0xc7}, + {0x25, 0x66, 0x40}, + {0x25, 0x67, 0x52}, + {0x25, 0x68, 0x08}, // Biquad - BQ11 Left - Filter: Equalizer (Q Factor) Frequency: 2000 Hz Gain: 3dB QVal: 0.7 Bandwidth: 1000 Hz + {0x25, 0x69, 0x48}, + {0x25, 0x6a, 0x3d}, + {0x25, 0x6b, 0xc3}, + {0x25, 0x6c, 0xf1}, + {0x25, 0x6d, 0x7e}, + {0x25, 0x6e, 0x46}, + {0x25, 0x6f, 0x3e}, + {0x25, 0x70, 0x06}, + {0x25, 0x71, 0x59}, + {0x25, 0x72, 0x87}, + {0x25, 0x73, 0xab}, + {0x25, 0x74, 0x0e}, + {0x25, 0x75, 0x81}, + {0x25, 0x76, 0xb9}, + {0x25, 0x77, 0xc2}, + {0x25, 0x78, 0xf9}, + {0x25, 0x79, 0x5e}, + {0x25, 0x7a, 0x3a}, + {0x25, 0x7b, 0x92}, + {0x25, 0x7c, 0x08}, // Biquad - BQ12 Left - Filter: Equalizer (Q Factor) Frequency: 3150 Hz Gain: 3dB QVal: 0.7 Bandwidth: 1000 Hz + {0x25, 0x7d, 0x6c}, + {0x25, 0x7e, 0x72}, + {0x25, 0x7f, 0xb6}, + {0x26, 0x08, 0xf2}, + {0x26, 0x09, 0x59}, + {0x26, 0x0a, 0x5e}, + {0x26, 0x0b, 0x71}, + {0x26, 0x0c, 0x05}, + {0x26, 0x0d, 0x85}, + {0x26, 0x0e, 0xca}, + {0x26, 0x0f, 0x74}, + {0x26, 0x10, 0x0d}, + {0x26, 0x11, 0xa6}, + {0x26, 0x12, 0xa1}, + {0x26, 0x13, 0x8f}, + {0x26, 0x14, 0xfa}, + {0x26, 0x15, 0x0d}, + {0x26, 0x16, 0xc2}, + {0x26, 0x17, 0xd6}, + {0x26, 0x18, 0x08}, // Biquad - BQ13 Left - Filter: Equalizer (Q Factor) Frequency: 5000 Hz Gain: 3dB QVal: 0.6 Bandwidth: 1000 Hz + {0x26, 0x19, 0xb5}, + {0x26, 0x1a, 0x08}, + {0x26, 0x1b, 0xeb}, + {0x26, 0x1c, 0xf4}, + {0x26, 0x1d, 0x18}, + {0x26, 0x1e, 0x76}, + {0x26, 0x1f, 0x1f}, + {0x26, 0x20, 0x03}, + {0x26, 0x21, 0xdd}, + {0x26, 0x22, 0x4c}, + {0x26, 0x23, 0xe6}, + {0x26, 0x24, 0x0b}, + {0x26, 0x25, 0xe7}, + {0x26, 0x26, 0x89}, + {0x26, 0x27, 0xe1}, + {0x26, 0x28, 0xfb}, + {0x26, 0x29, 0x6d}, + {0x26, 0x2a, 0xaa}, + {0x26, 0x2b, 0x2f}, + {0x26, 0x2c, 0x09}, // Biquad - BQ14 Left - Filter: Equalizer (Q Factor) Frequency: 8000 Hz Gain: 3dB QVal: 0.6 Bandwidth: 1000 Hz + {0x26, 0x2d, 0x00}, + {0x26, 0x2e, 0xa8}, + {0x26, 0x2f, 0x9c}, + {0x26, 0x30, 0xf6}, + {0x26, 0x31, 0x5a}, + {0x26, 0x32, 0x59}, + {0x26, 0x33, 0x40}, + {0x26, 0x34, 0x02}, + {0x26, 0x35, 0x23}, + {0x26, 0x36, 0x0c}, + {0x26, 0x37, 0x93}, + {0x26, 0x38, 0x09}, + {0x26, 0x39, 0xa5}, + {0x26, 0x3a, 0xa6}, + {0x26, 0x3b, 0xc0}, + {0x26, 0x3c, 0xfc}, + {0x26, 0x3d, 0xdc}, + {0x26, 0x3e, 0x4a}, + {0x26, 0x3f, 0xd0}, + {0x26, 0x40, 0x09}, // Biquad - BQ15 Left - Filter: Equalizer (Q Factor) Frequency: 16000 Hz Gain: 3dB QVal: 0.5 Bandwidth: 1000 Hz + {0x26, 0x41, 0xb0}, + {0x26, 0x42, 0x2d}, + {0x26, 0x43, 0x7a}, + {0x26, 0x44, 0xfc}, + {0x26, 0x45, 0x17}, + {0x26, 0x46, 0x9b}, + {0x26, 0x47, 0xa8}, + {0x26, 0x48, 0xfe}, + {0x26, 0x49, 0x20}, + {0x26, 0x4a, 0x9b}, + {0x26, 0x4b, 0x37}, + {0x26, 0x4c, 0x03}, + {0x26, 0x4d, 0xe8}, + {0x26, 0x4e, 0x64}, + {0x26, 0x4f, 0x58}, + {0x26, 0x50, 0x00}, + {0x26, 0x51, 0x2f}, + {0x26, 0x52, 0x37}, + {0x26, 0x53, 0x4f}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_left_p4[TAS5805M_EQ_REG_PER_STEP] = { + {0x24, 0x18, 0x08}, // Biquad - BQ1 Left - Filter: Equalizer (Q Factor) Frequency: 20 Hz Gain: 4dB QVal: 2 Bandwidth: 1000 Hz + {0x24, 0x19, 0x00}, + {0x24, 0x1a, 0x64}, + {0x24, 0x1b, 0x52}, + {0x24, 0x1c, 0xf0}, + {0x24, 0x1d, 0x01}, + {0x24, 0x1e, 0x57}, + {0x24, 0x1f, 0xef}, + {0x24, 0x20, 0x07}, + {0x24, 0x21, 0xfe}, + {0x24, 0x22, 0x44}, + {0x24, 0x23, 0xa6}, + {0x24, 0x24, 0x0f}, + {0x24, 0x25, 0xfe}, + {0x24, 0x26, 0xa8}, + {0x24, 0x27, 0x11}, + {0x24, 0x28, 0xf8}, + {0x24, 0x29, 0x01}, + {0x24, 0x2a, 0x57}, + {0x24, 0x2b, 0x09}, + {0x24, 0x2c, 0x08}, // Biquad - BQ2 Left - Filter: Equalizer (Q Factor) Frequency: 31.5 Hz Gain: 4dB QVal: 2 Bandwidth: 1000 Hz + {0x24, 0x2d, 0x00}, + {0x24, 0x2e, 0x9d}, + {0x24, 0x2f, 0xf9}, + {0x24, 0x30, 0xf0}, + {0x24, 0x31, 0x02}, + {0x24, 0x32, 0x1e}, + {0x24, 0x33, 0x67}, + {0x24, 0x34, 0x07}, + {0x24, 0x35, 0xfd}, + {0x24, 0x36, 0x45}, + {0x24, 0x37, 0xda}, + {0x24, 0x38, 0x0f}, + {0x24, 0x39, 0xfd}, + {0x24, 0x3a, 0xe1}, + {0x24, 0x3b, 0x99}, + {0x24, 0x3c, 0xf8}, + {0x24, 0x3d, 0x02}, + {0x24, 0x3e, 0x1c}, + {0x24, 0x3f, 0x2d}, + {0x24, 0x40, 0x08}, // Biquad - BQ3 Left - Filter: Equalizer (Q Factor) Frequency: 50 Hz Gain: 4dB QVal: 1.5 Bandwidth: 1000 Hz + {0x24, 0x41, 0x01}, + {0x24, 0x42, 0x4e}, + {0x24, 0x43, 0x24}, + {0x24, 0x44, 0xf0}, + {0x24, 0x45, 0x04}, + {0x24, 0x46, 0x7c}, + {0x24, 0x47, 0x2f}, + {0x24, 0x48, 0x07}, + {0x24, 0x49, 0xfa}, + {0x24, 0x4a, 0x3b}, + {0x24, 0x4b, 0x49}, + {0x24, 0x4c, 0x0f}, + {0x24, 0x4d, 0xfb}, + {0x24, 0x4e, 0x83}, + {0x24, 0x4f, 0xd1}, + {0x24, 0x50, 0xf8}, + {0x24, 0x51, 0x04}, + {0x24, 0x52, 0x76}, + {0x24, 0x53, 0x93}, + {0x24, 0x54, 0x08}, // Biquad - BQ4 Left - Filter: Equalizer (Q Factor) Frequency: 80 Hz Gain: 4dB QVal: 1.5 Bandwidth: 1000 Hz + {0x24, 0x55, 0x02}, + {0x24, 0x56, 0x16}, + {0x24, 0x57, 0x47}, + {0x24, 0x58, 0xf0}, + {0x24, 0x59, 0x07}, + {0x24, 0x5a, 0x31}, + {0x24, 0x5b, 0x45}, + {0x24, 0x5c, 0x07}, + {0x24, 0x5d, 0xf6}, + {0x24, 0x5e, 0xc6}, + {0x24, 0x5f, 0xcd}, + {0x24, 0x60, 0x0f}, + {0x24, 0x61, 0xf8}, + {0x24, 0x62, 0xce}, + {0x24, 0x63, 0xbb}, + {0x24, 0x64, 0xf8}, + {0x24, 0x65, 0x07}, + {0x24, 0x66, 0x22}, + {0x24, 0x67, 0xec}, + {0x24, 0x68, 0x08}, // Biquad - BQ5 Left - Filter: Equalizer (Q Factor) Frequency: 125 Hz Gain: 4dB QVal: 1 Bandwidth: 1000 Hz + {0x24, 0x69, 0x04}, + {0x24, 0x6a, 0xe1}, + {0x24, 0x6b, 0x49}, + {0x24, 0x6c, 0xf0}, + {0x24, 0x6d, 0x10}, + {0x24, 0x6e, 0xd2}, + {0x24, 0x6f, 0xcc}, + {0x24, 0x70, 0x07}, + {0x24, 0x71, 0xea}, + {0x24, 0x72, 0x6e}, + {0x24, 0x73, 0xde}, + {0x24, 0x74, 0x0f}, + {0x24, 0x75, 0xef}, + {0x24, 0x76, 0x2d}, + {0x24, 0x77, 0x34}, + {0x24, 0x78, 0xf8}, + {0x24, 0x79, 0x10}, + {0x24, 0x7a, 0xaf}, + {0x24, 0x7b, 0xd9}, + {0x24, 0x7c, 0x08}, // Biquad - BQ6 Left - Filter: Equalizer (Q Factor) Frequency: 200 Hz Gain: 4dB QVal: 1 Bandwidth: 1000 Hz + {0x24, 0x7d, 0x07}, + {0x24, 0x7e, 0xc9}, + {0x24, 0x7f, 0xfc}, + {0x25, 0x08, 0xf0}, + {0x25, 0x09, 0x1a}, + {0x25, 0x0a, 0xfb}, + {0x25, 0x0b, 0x8a}, + {0x25, 0x0c, 0x07}, + {0x25, 0x0d, 0xdd}, + {0x25, 0x0e, 0x93}, + {0x25, 0x0f, 0xba}, + {0x25, 0x10, 0x0f}, + {0x25, 0x11, 0xe5}, + {0x25, 0x12, 0x04}, + {0x25, 0x13, 0x76}, + {0x25, 0x14, 0xf8}, + {0x25, 0x15, 0x1a}, + {0x25, 0x16, 0xa2}, + {0x25, 0x17, 0x4a}, + {0x25, 0x18, 0x08}, // Biquad - BQ7 Left - Filter: Equalizer (Q Factor) Frequency: 315 Hz Gain: 4dB QVal: 0.9 Bandwidth: 1000 Hz + {0x25, 0x19, 0x0d}, + {0x25, 0x1a, 0x90}, + {0x25, 0x1b, 0x8a}, + {0x25, 0x1c, 0xf0}, + {0x25, 0x1d, 0x2f}, + {0x25, 0x1e, 0x3e}, + {0x25, 0x1f, 0x6a}, + {0x25, 0x20, 0x07}, + {0x25, 0x21, 0xc4}, + {0x25, 0x22, 0x0d}, + {0x25, 0x23, 0x5d}, + {0x25, 0x24, 0x0f}, + {0x25, 0x25, 0xd0}, + {0x25, 0x26, 0xc1}, + {0x25, 0x27, 0x96}, + {0x25, 0x28, 0xf8}, + {0x25, 0x29, 0x2e}, + {0x25, 0x2a, 0x62}, + {0x25, 0x2b, 0x19}, + {0x25, 0x2c, 0x08}, // Biquad - BQ8 Left - Filter: Equalizer (Q Factor) Frequency: 500 Hz Gain: 4dB QVal: 0.9 Bandwidth: 1000 Hz + {0x25, 0x2d, 0x15}, + {0x25, 0x2e, 0x63}, + {0x25, 0x2f, 0x8d}, + {0x25, 0x30, 0xf0}, + {0x25, 0x31, 0x4b}, + {0x25, 0x32, 0x4a}, + {0x25, 0x33, 0xa6}, + {0x25, 0x34, 0x07}, + {0x25, 0x35, 0xa1}, + {0x25, 0x36, 0x79}, + {0x25, 0x37, 0x33}, + {0x25, 0x38, 0x0f}, + {0x25, 0x39, 0xb4}, + {0x25, 0x3a, 0xb5}, + {0x25, 0x3b, 0x5a}, + {0x25, 0x3c, 0xf8}, + {0x25, 0x3d, 0x49}, + {0x25, 0x3e, 0x23}, + {0x25, 0x3f, 0x40}, + {0x25, 0x40, 0x08}, // Biquad - BQ9 Left - Filter: Equalizer (Q Factor) Frequency: 800 Hz Gain: 4dB QVal: 0.8 Bandwidth: 1000 Hz + {0x25, 0x41, 0x25}, + {0x25, 0x42, 0xf5}, + {0x25, 0x43, 0x2f}, + {0x25, 0x44, 0xf0}, + {0x25, 0x45, 0x87}, + {0x25, 0x46, 0x3a}, + {0x25, 0x47, 0xb6}, + {0x25, 0x48, 0x07}, + {0x25, 0x49, 0x58}, + {0x25, 0x4a, 0x3f}, + {0x25, 0x4b, 0x9a}, + {0x25, 0x4c, 0x0f}, + {0x25, 0x4d, 0x78}, + {0x25, 0x4e, 0xc5}, + {0x25, 0x4f, 0x4a}, + {0x25, 0x50, 0xf8}, + {0x25, 0x51, 0x81}, + {0x25, 0x52, 0xcb}, + {0x25, 0x53, 0x36}, + {0x25, 0x54, 0x08}, // Biquad - BQ10 Left - Filter: Equalizer (Q Factor) Frequency: 1250 Hz Gain: 4dB QVal: 0.8 Bandwidth: 1000 Hz + {0x25, 0x55, 0x3a}, + {0x25, 0x56, 0x45}, + {0x25, 0x57, 0x36}, + {0x25, 0x58, 0xf0}, + {0x25, 0x59, 0xd4}, + {0x25, 0x5a, 0x48}, + {0x25, 0x5b, 0xf3}, + {0x25, 0x5c, 0x06}, + {0x25, 0x5d, 0xfe}, + {0x25, 0x5e, 0x7a}, + {0x25, 0x5f, 0x78}, + {0x25, 0x60, 0x0f}, + {0x25, 0x61, 0x2b}, + {0x25, 0x62, 0xb7}, + {0x25, 0x63, 0x0d}, + {0x25, 0x64, 0xf8}, + {0x25, 0x65, 0xc7}, + {0x25, 0x66, 0x40}, + {0x25, 0x67, 0x52}, + {0x25, 0x68, 0x08}, // Biquad - BQ11 Left - Filter: Equalizer (Q Factor) Frequency: 2000 Hz Gain: 4dB QVal: 0.7 Bandwidth: 1000 Hz + {0x25, 0x69, 0x66}, + {0x25, 0x6a, 0x6c}, + {0x25, 0x6b, 0x58}, + {0x25, 0x6c, 0xf1}, + {0x25, 0x6d, 0x7e}, + {0x25, 0x6e, 0x46}, + {0x25, 0x6f, 0x3e}, + {0x25, 0x70, 0x06}, + {0x25, 0x71, 0x3b}, + {0x25, 0x72, 0x59}, + {0x25, 0x73, 0x16}, + {0x25, 0x74, 0x0e}, + {0x25, 0x75, 0x81}, + {0x25, 0x76, 0xb9}, + {0x25, 0x77, 0xc2}, + {0x25, 0x78, 0xf9}, + {0x25, 0x79, 0x5e}, + {0x25, 0x7a, 0x3a}, + {0x25, 0x7b, 0x92}, + {0x25, 0x7c, 0x08}, // Biquad - BQ12 Left - Filter: Equalizer (Q Factor) Frequency: 3150 Hz Gain: 4dB QVal: 0.7 Bandwidth: 1000 Hz + {0x25, 0x7d, 0x99}, + {0x25, 0x7e, 0xc1}, + {0x25, 0x7f, 0xcd}, + {0x26, 0x08, 0xf2}, + {0x26, 0x09, 0x59}, + {0x26, 0x0a, 0x5e}, + {0x26, 0x0b, 0x71}, + {0x26, 0x0c, 0x05}, + {0x26, 0x0d, 0x58}, + {0x26, 0x0e, 0x7b}, + {0x26, 0x0f, 0x5d}, + {0x26, 0x10, 0x0d}, + {0x26, 0x11, 0xa6}, + {0x26, 0x12, 0xa1}, + {0x26, 0x13, 0x8f}, + {0x26, 0x14, 0xfa}, + {0x26, 0x15, 0x0d}, + {0x26, 0x16, 0xc2}, + {0x26, 0x17, 0xd6}, + {0x26, 0x18, 0x09}, // Biquad - BQ13 Left - Filter: Equalizer (Q Factor) Frequency: 5000 Hz Gain: 4dB QVal: 0.6 Bandwidth: 1000 Hz + {0x26, 0x19, 0x00}, + {0x26, 0x1a, 0xab}, + {0x26, 0x1b, 0x8a}, + {0x26, 0x1c, 0xf4}, + {0x26, 0x1d, 0x18}, + {0x26, 0x1e, 0x76}, + {0x26, 0x1f, 0x1f}, + {0x26, 0x20, 0x03}, + {0x26, 0x21, 0x91}, + {0x26, 0x22, 0xaa}, + {0x26, 0x23, 0x47}, + {0x26, 0x24, 0x0b}, + {0x26, 0x25, 0xe7}, + {0x26, 0x26, 0x89}, + {0x26, 0x27, 0xe1}, + {0x26, 0x28, 0xfb}, + {0x26, 0x29, 0x6d}, + {0x26, 0x2a, 0xaa}, + {0x26, 0x2b, 0x2f}, + {0x26, 0x2c, 0x09}, // Biquad - BQ14 Left - Filter: Equalizer (Q Factor) Frequency: 8000 Hz Gain: 4dB QVal: 0.6 Bandwidth: 1000 Hz + {0x26, 0x2d, 0x6b}, + {0x26, 0x2e, 0xe3}, + {0x26, 0x2f, 0x97}, + {0x26, 0x30, 0xf6}, + {0x26, 0x31, 0x5a}, + {0x26, 0x32, 0x59}, + {0x26, 0x33, 0x40}, + {0x26, 0x34, 0x01}, + {0x26, 0x35, 0xb7}, + {0x26, 0x36, 0xd1}, + {0x26, 0x37, 0x98}, + {0x26, 0x38, 0x09}, + {0x26, 0x39, 0xa5}, + {0x26, 0x3a, 0xa6}, + {0x26, 0x3b, 0xc0}, + {0x26, 0x3c, 0xfc}, + {0x26, 0x3d, 0xdc}, + {0x26, 0x3e, 0x4a}, + {0x26, 0x3f, 0xd0}, + {0x26, 0x40, 0x0a}, // Biquad - BQ15 Left - Filter: Equalizer (Q Factor) Frequency: 16000 Hz Gain: 4dB QVal: 0.5 Bandwidth: 1000 Hz + {0x26, 0x41, 0x64}, + {0x26, 0x42, 0xbd}, + {0x26, 0x43, 0x22}, + {0x26, 0x44, 0xfc}, + {0x26, 0x45, 0x17}, + {0x26, 0x46, 0x9b}, + {0x26, 0x47, 0xa8}, + {0x26, 0x48, 0xfd}, + {0x26, 0x49, 0x6c}, + {0x26, 0x4a, 0x0b}, + {0x26, 0x4b, 0x8f}, + {0x26, 0x4c, 0x03}, + {0x26, 0x4d, 0xe8}, + {0x26, 0x4e, 0x64}, + {0x26, 0x4f, 0x58}, + {0x26, 0x50, 0x00}, + {0x26, 0x51, 0x2f}, + {0x26, 0x52, 0x37}, + {0x26, 0x53, 0x4f}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_left_p5[TAS5805M_EQ_REG_PER_STEP] = { + {0x24, 0x18, 0x08}, // Biquad - BQ1 Left - Filter: Equalizer (Q Factor) Frequency: 20 Hz Gain: 5dB QVal: 2 Bandwidth: 1000 Hz + {0x24, 0x19, 0x00}, + {0x24, 0x1a, 0x85}, + {0x24, 0x1b, 0x7d}, + {0x24, 0x1c, 0xf0}, + {0x24, 0x1d, 0x01}, + {0x24, 0x1e, 0x57}, + {0x24, 0x1f, 0xef}, + {0x24, 0x20, 0x07}, + {0x24, 0x21, 0xfe}, + {0x24, 0x22, 0x23}, + {0x24, 0x23, 0x7a}, + {0x24, 0x24, 0x0f}, + {0x24, 0x25, 0xfe}, + {0x24, 0x26, 0xa8}, + {0x24, 0x27, 0x11}, + {0x24, 0x28, 0xf8}, + {0x24, 0x29, 0x01}, + {0x24, 0x2a, 0x57}, + {0x24, 0x2b, 0x09}, + {0x24, 0x2c, 0x08}, // Biquad - BQ2 Left - Filter: Equalizer (Q Factor) Frequency: 31.5 Hz Gain: 5dB QVal: 2 Bandwidth: 1000 Hz + {0x24, 0x2d, 0x00}, + {0x24, 0x2e, 0xd2}, + {0x24, 0x2f, 0x34}, + {0x24, 0x30, 0xf0}, + {0x24, 0x31, 0x02}, + {0x24, 0x32, 0x1e}, + {0x24, 0x33, 0x67}, + {0x24, 0x34, 0x07}, + {0x24, 0x35, 0xfd}, + {0x24, 0x36, 0x11}, + {0x24, 0x37, 0x9f}, + {0x24, 0x38, 0x0f}, + {0x24, 0x39, 0xfd}, + {0x24, 0x3a, 0xe1}, + {0x24, 0x3b, 0x99}, + {0x24, 0x3c, 0xf8}, + {0x24, 0x3d, 0x02}, + {0x24, 0x3e, 0x1c}, + {0x24, 0x3f, 0x2d}, + {0x24, 0x40, 0x08}, // Biquad - BQ3 Left - Filter: Equalizer (Q Factor) Frequency: 50 Hz Gain: 5dB QVal: 1.5 Bandwidth: 1000 Hz + {0x24, 0x41, 0x01}, + {0x24, 0x42, 0xbc}, + {0x24, 0x43, 0x9f}, + {0x24, 0x44, 0xf0}, + {0x24, 0x45, 0x04}, + {0x24, 0x46, 0x7c}, + {0x24, 0x47, 0x2f}, + {0x24, 0x48, 0x07}, + {0x24, 0x49, 0xf9}, + {0x24, 0x4a, 0xcc}, + {0x24, 0x4b, 0xcf}, + {0x24, 0x4c, 0x0f}, + {0x24, 0x4d, 0xfb}, + {0x24, 0x4e, 0x83}, + {0x24, 0x4f, 0xd1}, + {0x24, 0x50, 0xf8}, + {0x24, 0x51, 0x04}, + {0x24, 0x52, 0x76}, + {0x24, 0x53, 0x93}, + {0x24, 0x54, 0x08}, // Biquad - BQ4 Left - Filter: Equalizer (Q Factor) Frequency: 80 Hz Gain: 5dB QVal: 1.5 Bandwidth: 1000 Hz + {0x24, 0x55, 0x02}, + {0x24, 0x56, 0xc6}, + {0x24, 0x57, 0xed}, + {0x24, 0x58, 0xf0}, + {0x24, 0x59, 0x07}, + {0x24, 0x5a, 0x31}, + {0x24, 0x5b, 0x45}, + {0x24, 0x5c, 0x07}, + {0x24, 0x5d, 0xf6}, + {0x24, 0x5e, 0x16}, + {0x24, 0x5f, 0x26}, + {0x24, 0x60, 0x0f}, + {0x24, 0x61, 0xf8}, + {0x24, 0x62, 0xce}, + {0x24, 0x63, 0xbb}, + {0x24, 0x64, 0xf8}, + {0x24, 0x65, 0x07}, + {0x24, 0x66, 0x22}, + {0x24, 0x67, 0xec}, + {0x24, 0x68, 0x08}, // Biquad - BQ5 Left - Filter: Equalizer (Q Factor) Frequency: 125 Hz Gain: 5dB QVal: 1 Bandwidth: 1000 Hz + {0x24, 0x69, 0x06}, + {0x24, 0x6a, 0x7e}, + {0x24, 0x6b, 0x58}, + {0x24, 0x6c, 0xf0}, + {0x24, 0x6d, 0x10}, + {0x24, 0x6e, 0xd2}, + {0x24, 0x6f, 0xcc}, + {0x24, 0x70, 0x07}, + {0x24, 0x71, 0xe8}, + {0x24, 0x72, 0xd1}, + {0x24, 0x73, 0xcf}, + {0x24, 0x74, 0x0f}, + {0x24, 0x75, 0xef}, + {0x24, 0x76, 0x2d}, + {0x24, 0x77, 0x34}, + {0x24, 0x78, 0xf8}, + {0x24, 0x79, 0x10}, + {0x24, 0x7a, 0xaf}, + {0x24, 0x7b, 0xd9}, + {0x24, 0x7c, 0x08}, // Biquad - BQ6 Left - Filter: Equalizer (Q Factor) Frequency: 200 Hz Gain: 5dB QVal: 1 Bandwidth: 1000 Hz + {0x24, 0x7d, 0x0a}, + {0x24, 0x7e, 0x5d}, + {0x24, 0x7f, 0x44}, + {0x25, 0x08, 0xf0}, + {0x25, 0x09, 0x1a}, + {0x25, 0x0a, 0xfb}, + {0x25, 0x0b, 0x8a}, + {0x25, 0x0c, 0x07}, + {0x25, 0x0d, 0xdb}, + {0x25, 0x0e, 0x00}, + {0x25, 0x0f, 0x72}, + {0x25, 0x10, 0x0f}, + {0x25, 0x11, 0xe5}, + {0x25, 0x12, 0x04}, + {0x25, 0x13, 0x76}, + {0x25, 0x14, 0xf8}, + {0x25, 0x15, 0x1a}, + {0x25, 0x16, 0xa2}, + {0x25, 0x17, 0x4a}, + {0x25, 0x18, 0x08}, // Biquad - BQ7 Left - Filter: Equalizer (Q Factor) Frequency: 315 Hz Gain: 5dB QVal: 0.9 Bandwidth: 1000 Hz + {0x25, 0x19, 0x12}, + {0x25, 0x1a, 0x0c}, + {0x25, 0x1b, 0xaf}, + {0x25, 0x1c, 0xf0}, + {0x25, 0x1d, 0x2f}, + {0x25, 0x1e, 0x3e}, + {0x25, 0x1f, 0x6a}, + {0x25, 0x20, 0x07}, + {0x25, 0x21, 0xbf}, + {0x25, 0x22, 0x91}, + {0x25, 0x23, 0x38}, + {0x25, 0x24, 0x0f}, + {0x25, 0x25, 0xd0}, + {0x25, 0x26, 0xc1}, + {0x25, 0x27, 0x96}, + {0x25, 0x28, 0xf8}, + {0x25, 0x29, 0x2e}, + {0x25, 0x2a, 0x62}, + {0x25, 0x2b, 0x19}, + {0x25, 0x2c, 0x08}, // Biquad - BQ8 Left - Filter: Equalizer (Q Factor) Frequency: 500 Hz Gain: 5dB QVal: 0.9 Bandwidth: 1000 Hz + {0x25, 0x2d, 0x1c}, + {0x25, 0x2e, 0x75}, + {0x25, 0x2f, 0xf6}, + {0x25, 0x30, 0xf0}, + {0x25, 0x31, 0x4b}, + {0x25, 0x32, 0x4a}, + {0x25, 0x33, 0xa6}, + {0x25, 0x34, 0x07}, + {0x25, 0x35, 0x9a}, + {0x25, 0x36, 0x66}, + {0x25, 0x37, 0xca}, + {0x25, 0x38, 0x0f}, + {0x25, 0x39, 0xb4}, + {0x25, 0x3a, 0xb5}, + {0x25, 0x3b, 0x5a}, + {0x25, 0x3c, 0xf8}, + {0x25, 0x3d, 0x49}, + {0x25, 0x3e, 0x23}, + {0x25, 0x3f, 0x40}, + {0x25, 0x40, 0x08}, // Biquad - BQ9 Left - Filter: Equalizer (Q Factor) Frequency: 800 Hz Gain: 5dB QVal: 0.8 Bandwidth: 1000 Hz + {0x25, 0x41, 0x32}, + {0x25, 0x42, 0x82}, + {0x25, 0x43, 0x07}, + {0x25, 0x44, 0xf0}, + {0x25, 0x45, 0x87}, + {0x25, 0x46, 0x3a}, + {0x25, 0x47, 0xb6}, + {0x25, 0x48, 0x07}, + {0x25, 0x49, 0x4b}, + {0x25, 0x4a, 0xb2}, + {0x25, 0x4b, 0xc3}, + {0x25, 0x4c, 0x0f}, + {0x25, 0x4d, 0x78}, + {0x25, 0x4e, 0xc5}, + {0x25, 0x4f, 0x4a}, + {0x25, 0x50, 0xf8}, + {0x25, 0x51, 0x81}, + {0x25, 0x52, 0xcb}, + {0x25, 0x53, 0x36}, + {0x25, 0x54, 0x08}, // Biquad - BQ10 Left - Filter: Equalizer (Q Factor) Frequency: 1250 Hz Gain: 5dB QVal: 0.8 Bandwidth: 1000 Hz + {0x25, 0x55, 0x4d}, + {0x25, 0x56, 0x89}, + {0x25, 0x57, 0x5d}, + {0x25, 0x58, 0xf0}, + {0x25, 0x59, 0xd4}, + {0x25, 0x5a, 0x48}, + {0x25, 0x5b, 0xf3}, + {0x25, 0x5c, 0x06}, + {0x25, 0x5d, 0xeb}, + {0x25, 0x5e, 0x36}, + {0x25, 0x5f, 0x51}, + {0x25, 0x60, 0x0f}, + {0x25, 0x61, 0x2b}, + {0x25, 0x62, 0xb7}, + {0x25, 0x63, 0x0d}, + {0x25, 0x64, 0xf8}, + {0x25, 0x65, 0xc7}, + {0x25, 0x66, 0x40}, + {0x25, 0x67, 0x52}, + {0x25, 0x68, 0x08}, // Biquad - BQ11 Left - Filter: Equalizer (Q Factor) Frequency: 2000 Hz Gain: 5dB QVal: 0.7 Bandwidth: 1000 Hz + {0x25, 0x69, 0x88}, + {0x25, 0x6a, 0x49}, + {0x25, 0x6b, 0xb6}, + {0x25, 0x6c, 0xf1}, + {0x25, 0x6d, 0x7e}, + {0x25, 0x6e, 0x46}, + {0x25, 0x6f, 0x3e}, + {0x25, 0x70, 0x06}, + {0x25, 0x71, 0x19}, + {0x25, 0x72, 0x7b}, + {0x25, 0x73, 0xb8}, + {0x25, 0x74, 0x0e}, + {0x25, 0x75, 0x81}, + {0x25, 0x76, 0xb9}, + {0x25, 0x77, 0xc2}, + {0x25, 0x78, 0xf9}, + {0x25, 0x79, 0x5e}, + {0x25, 0x7a, 0x3a}, + {0x25, 0x7b, 0x92}, + {0x25, 0x7c, 0x08}, // Biquad - BQ12 Left - Filter: Equalizer (Q Factor) Frequency: 3150 Hz Gain: 5dB QVal: 0.7 Bandwidth: 1000 Hz + {0x25, 0x7d, 0xcc}, + {0x25, 0x7e, 0x98}, + {0x25, 0x7f, 0x32}, + {0x26, 0x08, 0xf2}, + {0x26, 0x09, 0x59}, + {0x26, 0x0a, 0x5e}, + {0x26, 0x0b, 0x71}, + {0x26, 0x0c, 0x05}, + {0x26, 0x0d, 0x25}, + {0x26, 0x0e, 0xa4}, + {0x26, 0x0f, 0xf8}, + {0x26, 0x10, 0x0d}, + {0x26, 0x11, 0xa6}, + {0x26, 0x12, 0xa1}, + {0x26, 0x13, 0x8f}, + {0x26, 0x14, 0xfa}, + {0x26, 0x15, 0x0d}, + {0x26, 0x16, 0xc2}, + {0x26, 0x17, 0xd6}, + {0x26, 0x18, 0x09}, // Biquad - BQ13 Left - Filter: Equalizer (Q Factor) Frequency: 5000 Hz Gain: 5dB QVal: 0.6 Bandwidth: 1000 Hz + {0x26, 0x19, 0x55}, + {0x26, 0x1a, 0x88}, + {0x26, 0x1b, 0xc2}, + {0x26, 0x1c, 0xf4}, + {0x26, 0x1d, 0x18}, + {0x26, 0x1e, 0x76}, + {0x26, 0x1f, 0x1f}, + {0x26, 0x20, 0x03}, + {0x26, 0x21, 0x3c}, + {0x26, 0x22, 0xcd}, + {0x26, 0x23, 0x0f}, + {0x26, 0x24, 0x0b}, + {0x26, 0x25, 0xe7}, + {0x26, 0x26, 0x89}, + {0x26, 0x27, 0xe1}, + {0x26, 0x28, 0xfb}, + {0x26, 0x29, 0x6d}, + {0x26, 0x2a, 0xaa}, + {0x26, 0x2b, 0x2f}, + {0x26, 0x2c, 0x09}, // Biquad - BQ14 Left - Filter: Equalizer (Q Factor) Frequency: 8000 Hz Gain: 5dB QVal: 0.6 Bandwidth: 1000 Hz + {0x26, 0x2d, 0xe4}, + {0x26, 0x2e, 0x34}, + {0x26, 0x2f, 0x1a}, + {0x26, 0x30, 0xf6}, + {0x26, 0x31, 0x5a}, + {0x26, 0x32, 0x59}, + {0x26, 0x33, 0x40}, + {0x26, 0x34, 0x01}, + {0x26, 0x35, 0x3f}, + {0x26, 0x36, 0x81}, + {0x26, 0x37, 0x16}, + {0x26, 0x38, 0x09}, + {0x26, 0x39, 0xa5}, + {0x26, 0x3a, 0xa6}, + {0x26, 0x3b, 0xc0}, + {0x26, 0x3c, 0xfc}, + {0x26, 0x3d, 0xdc}, + {0x26, 0x3e, 0x4a}, + {0x26, 0x3f, 0xd0}, + {0x26, 0x40, 0x0b}, // Biquad - BQ15 Left - Filter: Equalizer (Q Factor) Frequency: 16000 Hz Gain: 5dB QVal: 0.5 Bandwidth: 1000 Hz + {0x26, 0x41, 0x2f}, + {0x26, 0x42, 0x54}, + {0x26, 0x43, 0xee}, + {0x26, 0x44, 0xfc}, + {0x26, 0x45, 0x17}, + {0x26, 0x46, 0x9b}, + {0x26, 0x47, 0xa8}, + {0x26, 0x48, 0xfc}, + {0x26, 0x49, 0xa1}, + {0x26, 0x4a, 0x73}, + {0x26, 0x4b, 0xc3}, + {0x26, 0x4c, 0x03}, + {0x26, 0x4d, 0xe8}, + {0x26, 0x4e, 0x64}, + {0x26, 0x4f, 0x58}, + {0x26, 0x50, 0x00}, + {0x26, 0x51, 0x2f}, + {0x26, 0x52, 0x37}, + {0x26, 0x53, 0x4f}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_left_p6[TAS5805M_EQ_REG_PER_STEP] = { + {0x24, 0x18, 0x08}, // Biquad - BQ1 Left - Filter: Equalizer (Q Factor) Frequency: 20 Hz Gain: 6dB QVal: 2 Bandwidth: 1000 Hz + {0x24, 0x19, 0x00}, + {0x24, 0x1a, 0xaa}, + {0x24, 0x1b, 0xb4}, + {0x24, 0x1c, 0xf0}, + {0x24, 0x1d, 0x01}, + {0x24, 0x1e, 0x57}, + {0x24, 0x1f, 0xef}, + {0x24, 0x20, 0x07}, + {0x24, 0x21, 0xfd}, + {0x24, 0x22, 0xfe}, + {0x24, 0x23, 0x43}, + {0x24, 0x24, 0x0f}, + {0x24, 0x25, 0xfe}, + {0x24, 0x26, 0xa8}, + {0x24, 0x27, 0x11}, + {0x24, 0x28, 0xf8}, + {0x24, 0x29, 0x01}, + {0x24, 0x2a, 0x57}, + {0x24, 0x2b, 0x09}, + {0x24, 0x2c, 0x08}, // Biquad - BQ2 Left - Filter: Equalizer (Q Factor) Frequency: 31.5 Hz Gain: 6dB QVal: 2 Bandwidth: 1000 Hz + {0x24, 0x2d, 0x01}, + {0x24, 0x2e, 0x0c}, + {0x24, 0x2f, 0xcf}, + {0x24, 0x30, 0xf0}, + {0x24, 0x31, 0x02}, + {0x24, 0x32, 0x1e}, + {0x24, 0x33, 0x67}, + {0x24, 0x34, 0x07}, + {0x24, 0x35, 0xfc}, + {0x24, 0x36, 0xd7}, + {0x24, 0x37, 0x04}, + {0x24, 0x38, 0x0f}, + {0x24, 0x39, 0xfd}, + {0x24, 0x3a, 0xe1}, + {0x24, 0x3b, 0x99}, + {0x24, 0x3c, 0xf8}, + {0x24, 0x3d, 0x02}, + {0x24, 0x3e, 0x1c}, + {0x24, 0x3f, 0x2d}, + {0x24, 0x40, 0x08}, // Biquad - BQ3 Left - Filter: Equalizer (Q Factor) Frequency: 50 Hz Gain: 6dB QVal: 1.5 Bandwidth: 1000 Hz + {0x24, 0x41, 0x02}, + {0x24, 0x42, 0x38}, + {0x24, 0x43, 0x94}, + {0x24, 0x44, 0xf0}, + {0x24, 0x45, 0x04}, + {0x24, 0x46, 0x7c}, + {0x24, 0x47, 0x2f}, + {0x24, 0x48, 0x07}, + {0x24, 0x49, 0xf9}, + {0x24, 0x4a, 0x50}, + {0x24, 0x4b, 0xd9}, + {0x24, 0x4c, 0x0f}, + {0x24, 0x4d, 0xfb}, + {0x24, 0x4e, 0x83}, + {0x24, 0x4f, 0xd1}, + {0x24, 0x50, 0xf8}, + {0x24, 0x51, 0x04}, + {0x24, 0x52, 0x76}, + {0x24, 0x53, 0x93}, + {0x24, 0x54, 0x08}, // Biquad - BQ4 Left - Filter: Equalizer (Q Factor) Frequency: 80 Hz Gain: 6dB QVal: 1.5 Bandwidth: 1000 Hz + {0x24, 0x55, 0x03}, + {0x24, 0x56, 0x8d}, + {0x24, 0x57, 0x22}, + {0x24, 0x58, 0xf0}, + {0x24, 0x59, 0x07}, + {0x24, 0x5a, 0x31}, + {0x24, 0x5b, 0x45}, + {0x24, 0x5c, 0x07}, + {0x24, 0x5d, 0xf5}, + {0x24, 0x5e, 0x4f}, + {0x24, 0x5f, 0xf2}, + {0x24, 0x60, 0x0f}, + {0x24, 0x61, 0xf8}, + {0x24, 0x62, 0xce}, + {0x24, 0x63, 0xbb}, + {0x24, 0x64, 0xf8}, + {0x24, 0x65, 0x07}, + {0x24, 0x66, 0x22}, + {0x24, 0x67, 0xec}, + {0x24, 0x68, 0x08}, // Biquad - BQ5 Left - Filter: Equalizer (Q Factor) Frequency: 125 Hz Gain: 6dB QVal: 1 Bandwidth: 1000 Hz + {0x24, 0x69, 0x08}, + {0x24, 0x6a, 0x4d}, + {0x24, 0x6b, 0xce}, + {0x24, 0x6c, 0xf0}, + {0x24, 0x6d, 0x10}, + {0x24, 0x6e, 0xd2}, + {0x24, 0x6f, 0xcc}, + {0x24, 0x70, 0x07}, + {0x24, 0x71, 0xe7}, + {0x24, 0x72, 0x02}, + {0x24, 0x73, 0x59}, + {0x24, 0x74, 0x0f}, + {0x24, 0x75, 0xef}, + {0x24, 0x76, 0x2d}, + {0x24, 0x77, 0x34}, + {0x24, 0x78, 0xf8}, + {0x24, 0x79, 0x10}, + {0x24, 0x7a, 0xaf}, + {0x24, 0x7b, 0xd9}, + {0x24, 0x7c, 0x08}, // Biquad - BQ6 Left - Filter: Equalizer (Q Factor) Frequency: 200 Hz Gain: 6dB QVal: 1 Bandwidth: 1000 Hz + {0x24, 0x7d, 0x0d}, + {0x24, 0x7e, 0x40}, + {0x24, 0x7f, 0xfe}, + {0x25, 0x08, 0xf0}, + {0x25, 0x09, 0x1a}, + {0x25, 0x0a, 0xfb}, + {0x25, 0x0b, 0x8a}, + {0x25, 0x0c, 0x07}, + {0x25, 0x0d, 0xd8}, + {0x25, 0x0e, 0x1c}, + {0x25, 0x0f, 0xb8}, + {0x25, 0x10, 0x0f}, + {0x25, 0x11, 0xe5}, + {0x25, 0x12, 0x04}, + {0x25, 0x13, 0x76}, + {0x25, 0x14, 0xf8}, + {0x25, 0x15, 0x1a}, + {0x25, 0x16, 0xa2}, + {0x25, 0x17, 0x4a}, + {0x25, 0x18, 0x08}, // Biquad - BQ7 Left - Filter: Equalizer (Q Factor) Frequency: 315 Hz Gain: 6dB QVal: 0.9 Bandwidth: 1000 Hz + {0x25, 0x19, 0x17}, + {0x25, 0x1a, 0x14}, + {0x25, 0x1b, 0xec}, + {0x25, 0x1c, 0xf0}, + {0x25, 0x1d, 0x2f}, + {0x25, 0x1e, 0x3e}, + {0x25, 0x1f, 0x6a}, + {0x25, 0x20, 0x07}, + {0x25, 0x21, 0xba}, + {0x25, 0x22, 0x88}, + {0x25, 0x23, 0xfc}, + {0x25, 0x24, 0x0f}, + {0x25, 0x25, 0xd0}, + {0x25, 0x26, 0xc1}, + {0x25, 0x27, 0x96}, + {0x25, 0x28, 0xf8}, + {0x25, 0x29, 0x2e}, + {0x25, 0x2a, 0x62}, + {0x25, 0x2b, 0x19}, + {0x25, 0x2c, 0x08}, // Biquad - BQ8 Left - Filter: Equalizer (Q Factor) Frequency: 500 Hz Gain: 6dB QVal: 0.9 Bandwidth: 1000 Hz + {0x25, 0x2d, 0x24}, + {0x25, 0x2e, 0x65}, + {0x25, 0x2f, 0x46}, + {0x25, 0x30, 0xf0}, + {0x25, 0x31, 0x4b}, + {0x25, 0x32, 0x4a}, + {0x25, 0x33, 0xa6}, + {0x25, 0x34, 0x07}, + {0x25, 0x35, 0x92}, + {0x25, 0x36, 0x77}, + {0x25, 0x37, 0x7a}, + {0x25, 0x38, 0x0f}, + {0x25, 0x39, 0xb4}, + {0x25, 0x3a, 0xb5}, + {0x25, 0x3b, 0x5a}, + {0x25, 0x3c, 0xf8}, + {0x25, 0x3d, 0x49}, + {0x25, 0x3e, 0x23}, + {0x25, 0x3f, 0x40}, + {0x25, 0x40, 0x08}, // Biquad - BQ9 Left - Filter: Equalizer (Q Factor) Frequency: 800 Hz Gain: 6dB QVal: 0.8 Bandwidth: 1000 Hz + {0x25, 0x41, 0x40}, + {0x25, 0x42, 0x96}, + {0x25, 0x43, 0xe5}, + {0x25, 0x44, 0xf0}, + {0x25, 0x45, 0x87}, + {0x25, 0x46, 0x3a}, + {0x25, 0x47, 0xb6}, + {0x25, 0x48, 0x07}, + {0x25, 0x49, 0x3d}, + {0x25, 0x4a, 0x9d}, + {0x25, 0x4b, 0xe5}, + {0x25, 0x4c, 0x0f}, + {0x25, 0x4d, 0x78}, + {0x25, 0x4e, 0xc5}, + {0x25, 0x4f, 0x4a}, + {0x25, 0x50, 0xf8}, + {0x25, 0x51, 0x81}, + {0x25, 0x52, 0xcb}, + {0x25, 0x53, 0x36}, + {0x25, 0x54, 0x08}, // Biquad - BQ10 Left - Filter: Equalizer (Q Factor) Frequency: 1250 Hz Gain: 6dB QVal: 0.8 Bandwidth: 1000 Hz + {0x25, 0x55, 0x63}, + {0x25, 0x56, 0x27}, + {0x25, 0x57, 0x54}, + {0x25, 0x58, 0xf0}, + {0x25, 0x59, 0xd4}, + {0x25, 0x5a, 0x48}, + {0x25, 0x5b, 0xf3}, + {0x25, 0x5c, 0x06}, + {0x25, 0x5d, 0xd5}, + {0x25, 0x5e, 0x98}, + {0x25, 0x5f, 0x59}, + {0x25, 0x60, 0x0f}, + {0x25, 0x61, 0x2b}, + {0x25, 0x62, 0xb7}, + {0x25, 0x63, 0x0d}, + {0x25, 0x64, 0xf8}, + {0x25, 0x65, 0xc7}, + {0x25, 0x66, 0x40}, + {0x25, 0x67, 0x52}, + {0x25, 0x68, 0x08}, // Biquad - BQ11 Left - Filter: Equalizer (Q Factor) Frequency: 2000 Hz Gain: 6dB QVal: 0.7 Bandwidth: 1000 Hz + {0x25, 0x69, 0xae}, + {0x25, 0x6a, 0x48}, + {0x25, 0x6b, 0xe6}, + {0x25, 0x6c, 0xf1}, + {0x25, 0x6d, 0x7e}, + {0x25, 0x6e, 0x46}, + {0x25, 0x6f, 0x3e}, + {0x25, 0x70, 0x05}, + {0x25, 0x71, 0xf3}, + {0x25, 0x72, 0x7c}, + {0x25, 0x73, 0x88}, + {0x25, 0x74, 0x0e}, + {0x25, 0x75, 0x81}, + {0x25, 0x76, 0xb9}, + {0x25, 0x77, 0xc2}, + {0x25, 0x78, 0xf9}, + {0x25, 0x79, 0x5e}, + {0x25, 0x7a, 0x3a}, + {0x25, 0x7b, 0x92}, + {0x25, 0x7c, 0x09}, // Biquad - BQ12 Left - Filter: Equalizer (Q Factor) Frequency: 3150 Hz Gain: 6dB QVal: 0.7 Bandwidth: 1000 Hz + {0x25, 0x7d, 0x05}, + {0x25, 0x7e, 0xa2}, + {0x25, 0x7f, 0x95}, + {0x26, 0x08, 0xf2}, + {0x26, 0x09, 0x59}, + {0x26, 0x0a, 0x5e}, + {0x26, 0x0b, 0x71}, + {0x26, 0x0c, 0x04}, + {0x26, 0x0d, 0xec}, + {0x26, 0x0e, 0x9a}, + {0x26, 0x0f, 0x94}, + {0x26, 0x10, 0x0d}, + {0x26, 0x11, 0xa6}, + {0x26, 0x12, 0xa1}, + {0x26, 0x13, 0x8f}, + {0x26, 0x14, 0xfa}, + {0x26, 0x15, 0x0d}, + {0x26, 0x16, 0xc2}, + {0x26, 0x17, 0xd6}, + {0x26, 0x18, 0x09}, // Biquad - BQ13 Left - Filter: Equalizer (Q Factor) Frequency: 5000 Hz Gain: 6dB QVal: 0.6 Bandwidth: 1000 Hz + {0x26, 0x19, 0xb4}, + {0x26, 0x1a, 0xc0}, + {0x26, 0x1b, 0xdb}, + {0x26, 0x1c, 0xf4}, + {0x26, 0x1d, 0x18}, + {0x26, 0x1e, 0x76}, + {0x26, 0x1f, 0x1f}, + {0x26, 0x20, 0x02}, + {0x26, 0x21, 0xdd}, + {0x26, 0x22, 0x94}, + {0x26, 0x23, 0xf6}, + {0x26, 0x24, 0x0b}, + {0x26, 0x25, 0xe7}, + {0x26, 0x26, 0x89}, + {0x26, 0x27, 0xe1}, + {0x26, 0x28, 0xfb}, + {0x26, 0x29, 0x6d}, + {0x26, 0x2a, 0xaa}, + {0x26, 0x2b, 0x2f}, + {0x26, 0x2c, 0x0a}, // Biquad - BQ14 Left - Filter: Equalizer (Q Factor) Frequency: 8000 Hz Gain: 6dB QVal: 0.6 Bandwidth: 1000 Hz + {0x26, 0x2d, 0x6b}, + {0x26, 0x2e, 0x32}, + {0x26, 0x2f, 0xd7}, + {0x26, 0x30, 0xf6}, + {0x26, 0x31, 0x5a}, + {0x26, 0x32, 0x59}, + {0x26, 0x33, 0x40}, + {0x26, 0x34, 0x00}, + {0x26, 0x35, 0xb8}, + {0x26, 0x36, 0x82}, + {0x26, 0x37, 0x59}, + {0x26, 0x38, 0x09}, + {0x26, 0x39, 0xa5}, + {0x26, 0x3a, 0xa6}, + {0x26, 0x3b, 0xc0}, + {0x26, 0x3c, 0xfc}, + {0x26, 0x3d, 0xdc}, + {0x26, 0x3e, 0x4a}, + {0x26, 0x3f, 0xd0}, + {0x26, 0x40, 0x0c}, // Biquad - BQ15 Left - Filter: Equalizer (Q Factor) Frequency: 16000 Hz Gain: 6dB QVal: 0.5 Bandwidth: 1000 Hz + {0x26, 0x41, 0x12}, + {0x26, 0x42, 0xa5}, + {0x26, 0x43, 0x11}, + {0x26, 0x44, 0xfc}, + {0x26, 0x45, 0x17}, + {0x26, 0x46, 0x9b}, + {0x26, 0x47, 0xa8}, + {0x26, 0x48, 0xfb}, + {0x26, 0x49, 0xbe}, + {0x26, 0x4a, 0x23}, + {0x26, 0x4b, 0xa0}, + {0x26, 0x4c, 0x03}, + {0x26, 0x4d, 0xe8}, + {0x26, 0x4e, 0x64}, + {0x26, 0x4f, 0x58}, + {0x26, 0x50, 0x00}, + {0x26, 0x51, 0x2f}, + {0x26, 0x52, 0x37}, + {0x26, 0x53, 0x4f}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_left_p7[TAS5805M_EQ_REG_PER_STEP] = { + {0x24, 0x18, 0x08}, // Biquad - BQ1 Left - Filter: Equalizer (Q Factor) Frequency: 20 Hz Gain: 7dB QVal: 2 Bandwidth: 1000 Hz + {0x24, 0x19, 0x00}, + {0x24, 0x1a, 0xd4}, + {0x24, 0x1b, 0x76}, + {0x24, 0x1c, 0xf0}, + {0x24, 0x1d, 0x01}, + {0x24, 0x1e, 0x57}, + {0x24, 0x1f, 0xef}, + {0x24, 0x20, 0x07}, + {0x24, 0x21, 0xfd}, + {0x24, 0x22, 0xd4}, + {0x24, 0x23, 0x81}, + {0x24, 0x24, 0x0f}, + {0x24, 0x25, 0xfe}, + {0x24, 0x26, 0xa8}, + {0x24, 0x27, 0x11}, + {0x24, 0x28, 0xf8}, + {0x24, 0x29, 0x01}, + {0x24, 0x2a, 0x57}, + {0x24, 0x2b, 0x09}, + {0x24, 0x2c, 0x08}, // Biquad - BQ2 Left - Filter: Equalizer (Q Factor) Frequency: 31.5 Hz Gain: 7dB QVal: 2 Bandwidth: 1000 Hz + {0x24, 0x2d, 0x01}, + {0x24, 0x2e, 0x4e}, + {0x24, 0x2f, 0x90}, + {0x24, 0x30, 0xf0}, + {0x24, 0x31, 0x02}, + {0x24, 0x32, 0x1e}, + {0x24, 0x33, 0x67}, + {0x24, 0x34, 0x07}, + {0x24, 0x35, 0xfc}, + {0x24, 0x36, 0x95}, + {0x24, 0x37, 0x43}, + {0x24, 0x38, 0x0f}, + {0x24, 0x39, 0xfd}, + {0x24, 0x3a, 0xe1}, + {0x24, 0x3b, 0x99}, + {0x24, 0x3c, 0xf8}, + {0x24, 0x3d, 0x02}, + {0x24, 0x3e, 0x1c}, + {0x24, 0x3f, 0x2d}, + {0x24, 0x40, 0x08}, // Biquad - BQ3 Left - Filter: Equalizer (Q Factor) Frequency: 50 Hz Gain: 7dB QVal: 1.5 Bandwidth: 1000 Hz + {0x24, 0x41, 0x02}, + {0x24, 0x42, 0xc3}, + {0x24, 0x43, 0xaa}, + {0x24, 0x44, 0xf0}, + {0x24, 0x45, 0x04}, + {0x24, 0x46, 0x7c}, + {0x24, 0x47, 0x2f}, + {0x24, 0x48, 0x07}, + {0x24, 0x49, 0xf8}, + {0x24, 0x4a, 0xc5}, + {0x24, 0x4b, 0xc3}, + {0x24, 0x4c, 0x0f}, + {0x24, 0x4d, 0xfb}, + {0x24, 0x4e, 0x83}, + {0x24, 0x4f, 0xd1}, + {0x24, 0x50, 0xf8}, + {0x24, 0x51, 0x04}, + {0x24, 0x52, 0x76}, + {0x24, 0x53, 0x93}, + {0x24, 0x54, 0x08}, // Biquad - BQ4 Left - Filter: Equalizer (Q Factor) Frequency: 80 Hz Gain: 7dB QVal: 1.5 Bandwidth: 1000 Hz + {0x24, 0x55, 0x04}, + {0x24, 0x56, 0x6b}, + {0x24, 0x57, 0x86}, + {0x24, 0x58, 0xf0}, + {0x24, 0x59, 0x07}, + {0x24, 0x5a, 0x31}, + {0x24, 0x5b, 0x45}, + {0x24, 0x5c, 0x07}, + {0x24, 0x5d, 0xf4}, + {0x24, 0x5e, 0x71}, + {0x24, 0x5f, 0x8e}, + {0x24, 0x60, 0x0f}, + {0x24, 0x61, 0xf8}, + {0x24, 0x62, 0xce}, + {0x24, 0x63, 0xbb}, + {0x24, 0x64, 0xf8}, + {0x24, 0x65, 0x07}, + {0x24, 0x66, 0x22}, + {0x24, 0x67, 0xec}, + {0x24, 0x68, 0x08}, // Biquad - BQ5 Left - Filter: Equalizer (Q Factor) Frequency: 125 Hz Gain: 7dB QVal: 1 Bandwidth: 1000 Hz + {0x24, 0x69, 0x0a}, + {0x24, 0x6a, 0x55}, + {0x24, 0x6b, 0xd0}, + {0x24, 0x6c, 0xf0}, + {0x24, 0x6d, 0x10}, + {0x24, 0x6e, 0xd2}, + {0x24, 0x6f, 0xcc}, + {0x24, 0x70, 0x07}, + {0x24, 0x71, 0xe4}, + {0x24, 0x72, 0xfa}, + {0x24, 0x73, 0x57}, + {0x24, 0x74, 0x0f}, + {0x24, 0x75, 0xef}, + {0x24, 0x76, 0x2d}, + {0x24, 0x77, 0x34}, + {0x24, 0x78, 0xf8}, + {0x24, 0x79, 0x10}, + {0x24, 0x7a, 0xaf}, + {0x24, 0x7b, 0xd9}, + {0x24, 0x7c, 0x08}, // Biquad - BQ6 Left - Filter: Equalizer (Q Factor) Frequency: 200 Hz Gain: 7dB QVal: 1 Bandwidth: 1000 Hz + {0x24, 0x7d, 0x10}, + {0x24, 0x7e, 0x7e}, + {0x24, 0x7f, 0xfb}, + {0x25, 0x08, 0xf0}, + {0x25, 0x09, 0x1a}, + {0x25, 0x0a, 0xfb}, + {0x25, 0x0b, 0x8a}, + {0x25, 0x0c, 0x07}, + {0x25, 0x0d, 0xd4}, + {0x25, 0x0e, 0xde}, + {0x25, 0x0f, 0xbc}, + {0x25, 0x10, 0x0f}, + {0x25, 0x11, 0xe5}, + {0x25, 0x12, 0x04}, + {0x25, 0x13, 0x76}, + {0x25, 0x14, 0xf8}, + {0x25, 0x15, 0x1a}, + {0x25, 0x16, 0xa2}, + {0x25, 0x17, 0x4a}, + {0x25, 0x18, 0x08}, // Biquad - BQ7 Left - Filter: Equalizer (Q Factor) Frequency: 315 Hz Gain: 7dB QVal: 0.9 Bandwidth: 1000 Hz + {0x25, 0x19, 0x1c}, + {0x25, 0x1a, 0xba}, + {0x25, 0x1b, 0x59}, + {0x25, 0x1c, 0xf0}, + {0x25, 0x1d, 0x2f}, + {0x25, 0x1e, 0x3e}, + {0x25, 0x1f, 0x6a}, + {0x25, 0x20, 0x07}, + {0x25, 0x21, 0xb4}, + {0x25, 0x22, 0xe3}, + {0x25, 0x23, 0x8e}, + {0x25, 0x24, 0x0f}, + {0x25, 0x25, 0xd0}, + {0x25, 0x26, 0xc1}, + {0x25, 0x27, 0x96}, + {0x25, 0x28, 0xf8}, + {0x25, 0x29, 0x2e}, + {0x25, 0x2a, 0x62}, + {0x25, 0x2b, 0x19}, + {0x25, 0x2c, 0x08}, // Biquad - BQ8 Left - Filter: Equalizer (Q Factor) Frequency: 500 Hz Gain: 7dB QVal: 0.9 Bandwidth: 1000 Hz + {0x25, 0x2d, 0x2d}, + {0x25, 0x2e, 0x4c}, + {0x25, 0x2f, 0x71}, + {0x25, 0x30, 0xf0}, + {0x25, 0x31, 0x4b}, + {0x25, 0x32, 0x4a}, + {0x25, 0x33, 0xa6}, + {0x25, 0x34, 0x07}, + {0x25, 0x35, 0x89}, + {0x25, 0x36, 0x90}, + {0x25, 0x37, 0x4e}, + {0x25, 0x38, 0x0f}, + {0x25, 0x39, 0xb4}, + {0x25, 0x3a, 0xb5}, + {0x25, 0x3b, 0x5a}, + {0x25, 0x3c, 0xf8}, + {0x25, 0x3d, 0x49}, + {0x25, 0x3e, 0x23}, + {0x25, 0x3f, 0x40}, + {0x25, 0x40, 0x08}, // Biquad - BQ9 Left - Filter: Equalizer (Q Factor) Frequency: 800 Hz Gain: 7dB QVal: 0.8 Bandwidth: 1000 Hz + {0x25, 0x41, 0x50}, + {0x25, 0x42, 0x63}, + {0x25, 0x43, 0xa0}, + {0x25, 0x44, 0xf0}, + {0x25, 0x45, 0x87}, + {0x25, 0x46, 0x3a}, + {0x25, 0x47, 0xb6}, + {0x25, 0x48, 0x07}, + {0x25, 0x49, 0x2d}, + {0x25, 0x4a, 0xd1}, + {0x25, 0x4b, 0x2a}, + {0x25, 0x4c, 0x0f}, + {0x25, 0x4d, 0x78}, + {0x25, 0x4e, 0xc5}, + {0x25, 0x4f, 0x4a}, + {0x25, 0x50, 0xf8}, + {0x25, 0x51, 0x81}, + {0x25, 0x52, 0xcb}, + {0x25, 0x53, 0x36}, + {0x25, 0x54, 0x08}, // Biquad - BQ10 Left - Filter: Equalizer (Q Factor) Frequency: 1250 Hz Gain: 7dB QVal: 0.8 Bandwidth: 1000 Hz + {0x25, 0x55, 0x7b}, + {0x25, 0x56, 0x68}, + {0x25, 0x57, 0x8b}, + {0x25, 0x58, 0xf0}, + {0x25, 0x59, 0xd4}, + {0x25, 0x5a, 0x48}, + {0x25, 0x5b, 0xf3}, + {0x25, 0x5c, 0x06}, + {0x25, 0x5d, 0xbd}, + {0x25, 0x5e, 0x57}, + {0x25, 0x5f, 0x23}, + {0x25, 0x60, 0x0f}, + {0x25, 0x61, 0x2b}, + {0x25, 0x62, 0xb7}, + {0x25, 0x63, 0x0d}, + {0x25, 0x64, 0xf8}, + {0x25, 0x65, 0xc7}, + {0x25, 0x66, 0x40}, + {0x25, 0x67, 0x52}, + {0x25, 0x68, 0x08}, // Biquad - BQ11 Left - Filter: Equalizer (Q Factor) Frequency: 2000 Hz Gain: 7dB QVal: 0.7 Bandwidth: 1000 Hz + {0x25, 0x69, 0xd8}, + {0x25, 0x6a, 0xea}, + {0x25, 0x6b, 0xfc}, + {0x25, 0x6c, 0xf1}, + {0x25, 0x6d, 0x7e}, + {0x25, 0x6e, 0x46}, + {0x25, 0x6f, 0x3e}, + {0x25, 0x70, 0x05}, + {0x25, 0x71, 0xc8}, + {0x25, 0x72, 0xda}, + {0x25, 0x73, 0x72}, + {0x25, 0x74, 0x0e}, + {0x25, 0x75, 0x81}, + {0x25, 0x76, 0xb9}, + {0x25, 0x77, 0xc2}, + {0x25, 0x78, 0xf9}, + {0x25, 0x79, 0x5e}, + {0x25, 0x7a, 0x3a}, + {0x25, 0x7b, 0x92}, + {0x25, 0x7c, 0x09}, // Biquad - BQ12 Left - Filter: Equalizer (Q Factor) Frequency: 3150 Hz Gain: 7dB QVal: 0.7 Bandwidth: 1000 Hz + {0x25, 0x7d, 0x45}, + {0x25, 0x7e, 0xa2}, + {0x25, 0x7f, 0xbc}, + {0x26, 0x08, 0xf2}, + {0x26, 0x09, 0x59}, + {0x26, 0x0a, 0x5e}, + {0x26, 0x0b, 0x71}, + {0x26, 0x0c, 0x04}, + {0x26, 0x0d, 0xac}, + {0x26, 0x0e, 0x9a}, + {0x26, 0x0f, 0x6e}, + {0x26, 0x10, 0x0d}, + {0x26, 0x11, 0xa6}, + {0x26, 0x12, 0xa1}, + {0x26, 0x13, 0x8f}, + {0x26, 0x14, 0xfa}, + {0x26, 0x15, 0x0d}, + {0x26, 0x16, 0xc2}, + {0x26, 0x17, 0xd6}, + {0x26, 0x18, 0x0a}, // Biquad - BQ13 Left - Filter: Equalizer (Q Factor) Frequency: 5000 Hz Gain: 7dB QVal: 0.6 Bandwidth: 1000 Hz + {0x26, 0x19, 0x1f}, + {0x26, 0x1a, 0x97}, + {0x26, 0x1b, 0x49}, + {0x26, 0x1c, 0xf4}, + {0x26, 0x1d, 0x18}, + {0x26, 0x1e, 0x76}, + {0x26, 0x1f, 0x1f}, + {0x26, 0x20, 0x02}, + {0x26, 0x21, 0x72}, + {0x26, 0x22, 0xbe}, + {0x26, 0x23, 0x88}, + {0x26, 0x24, 0x0b}, + {0x26, 0x25, 0xe7}, + {0x26, 0x26, 0x89}, + {0x26, 0x27, 0xe1}, + {0x26, 0x28, 0xfb}, + {0x26, 0x29, 0x6d}, + {0x26, 0x2a, 0xaa}, + {0x26, 0x2b, 0x2f}, + {0x26, 0x2c, 0x0b}, // Biquad - BQ14 Left - Filter: Equalizer (Q Factor) Frequency: 8000 Hz Gain: 7dB QVal: 0.6 Bandwidth: 1000 Hz + {0x26, 0x2d, 0x02}, + {0x26, 0x2e, 0xaa}, + {0x26, 0x2f, 0x61}, + {0x26, 0x30, 0xf6}, + {0x26, 0x31, 0x5a}, + {0x26, 0x32, 0x59}, + {0x26, 0x33, 0x40}, + {0x26, 0x34, 0x00}, + {0x26, 0x35, 0x21}, + {0x26, 0x36, 0x0a}, + {0x26, 0x37, 0xce}, + {0x26, 0x38, 0x09}, + {0x26, 0x39, 0xa5}, + {0x26, 0x3a, 0xa6}, + {0x26, 0x3b, 0xc0}, + {0x26, 0x3c, 0xfc}, + {0x26, 0x3d, 0xdc}, + {0x26, 0x3e, 0x4a}, + {0x26, 0x3f, 0xd0}, + {0x26, 0x40, 0x0d}, // Biquad - BQ15 Left - Filter: Equalizer (Q Factor) Frequency: 16000 Hz Gain: 7dB QVal: 0.5 Bandwidth: 1000 Hz + {0x26, 0x41, 0x11}, + {0x26, 0x42, 0xb1}, + {0x26, 0x43, 0xb7}, + {0x26, 0x44, 0xfc}, + {0x26, 0x45, 0x17}, + {0x26, 0x46, 0x9b}, + {0x26, 0x47, 0xa8}, + {0x26, 0x48, 0xfa}, + {0x26, 0x49, 0xbf}, + {0x26, 0x4a, 0x16}, + {0x26, 0x4b, 0xf9}, + {0x26, 0x4c, 0x03}, + {0x26, 0x4d, 0xe8}, + {0x26, 0x4e, 0x64}, + {0x26, 0x4f, 0x58}, + {0x26, 0x50, 0x00}, + {0x26, 0x51, 0x2f}, + {0x26, 0x52, 0x37}, + {0x26, 0x53, 0x4f}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_left_p8[TAS5805M_EQ_REG_PER_STEP] = { + {0x24, 0x18, 0x08}, // Biquad - BQ1 Left - Filter: Equalizer (Q Factor) Frequency: 20 Hz Gain: 8dB QVal: 2 Bandwidth: 1000 Hz + {0x24, 0x19, 0x01}, + {0x24, 0x1a, 0x03}, + {0x24, 0x1b, 0x50}, + {0x24, 0x1c, 0xf0}, + {0x24, 0x1d, 0x01}, + {0x24, 0x1e, 0x57}, + {0x24, 0x1f, 0xef}, + {0x24, 0x20, 0x07}, + {0x24, 0x21, 0xfd}, + {0x24, 0x22, 0xa5}, + {0x24, 0x23, 0xa7}, + {0x24, 0x24, 0x0f}, + {0x24, 0x25, 0xfe}, + {0x24, 0x26, 0xa8}, + {0x24, 0x27, 0x11}, + {0x24, 0x28, 0xf8}, + {0x24, 0x29, 0x01}, + {0x24, 0x2a, 0x57}, + {0x24, 0x2b, 0x09}, + {0x24, 0x2c, 0x08}, // Biquad - BQ2 Left - Filter: Equalizer (Q Factor) Frequency: 31.5 Hz Gain: 8dB QVal: 2 Bandwidth: 1000 Hz + {0x24, 0x2d, 0x01}, + {0x24, 0x2e, 0x98}, + {0x24, 0x2f, 0x58}, + {0x24, 0x30, 0xf0}, + {0x24, 0x31, 0x02}, + {0x24, 0x32, 0x1e}, + {0x24, 0x33, 0x67}, + {0x24, 0x34, 0x07}, + {0x24, 0x35, 0xfc}, + {0x24, 0x36, 0x4b}, + {0x24, 0x37, 0x7b}, + {0x24, 0x38, 0x0f}, + {0x24, 0x39, 0xfd}, + {0x24, 0x3a, 0xe1}, + {0x24, 0x3b, 0x99}, + {0x24, 0x3c, 0xf8}, + {0x24, 0x3d, 0x02}, + {0x24, 0x3e, 0x1c}, + {0x24, 0x3f, 0x2d}, + {0x24, 0x40, 0x08}, // Biquad - BQ3 Left - Filter: Equalizer (Q Factor) Frequency: 50 Hz Gain: 8dB QVal: 1.5 Bandwidth: 1000 Hz + {0x24, 0x41, 0x03}, + {0x24, 0x42, 0x5f}, + {0x24, 0x43, 0xb8}, + {0x24, 0x44, 0xf0}, + {0x24, 0x45, 0x04}, + {0x24, 0x46, 0x7c}, + {0x24, 0x47, 0x2f}, + {0x24, 0x48, 0x07}, + {0x24, 0x49, 0xf8}, + {0x24, 0x4a, 0x29}, + {0x24, 0x4b, 0xb5}, + {0x24, 0x4c, 0x0f}, + {0x24, 0x4d, 0xfb}, + {0x24, 0x4e, 0x83}, + {0x24, 0x4f, 0xd1}, + {0x24, 0x50, 0xf8}, + {0x24, 0x51, 0x04}, + {0x24, 0x52, 0x76}, + {0x24, 0x53, 0x93}, + {0x24, 0x54, 0x08}, // Biquad - BQ4 Left - Filter: Equalizer (Q Factor) Frequency: 80 Hz Gain: 8dB QVal: 1.5 Bandwidth: 1000 Hz + {0x24, 0x55, 0x05}, + {0x24, 0x56, 0x65}, + {0x24, 0x57, 0x0d}, + {0x24, 0x58, 0xf0}, + {0x24, 0x59, 0x07}, + {0x24, 0x5a, 0x31}, + {0x24, 0x5b, 0x45}, + {0x24, 0x5c, 0x07}, + {0x24, 0x5d, 0xf3}, + {0x24, 0x5e, 0x78}, + {0x24, 0x5f, 0x07}, + {0x24, 0x60, 0x0f}, + {0x24, 0x61, 0xf8}, + {0x24, 0x62, 0xce}, + {0x24, 0x63, 0xbb}, + {0x24, 0x64, 0xf8}, + {0x24, 0x65, 0x07}, + {0x24, 0x66, 0x22}, + {0x24, 0x67, 0xec}, + {0x24, 0x68, 0x08}, // Biquad - BQ5 Left - Filter: Equalizer (Q Factor) Frequency: 125 Hz Gain: 8dB QVal: 1 Bandwidth: 1000 Hz + {0x24, 0x69, 0x0c}, + {0x24, 0x6a, 0x9d}, + {0x24, 0x6b, 0x46}, + {0x24, 0x6c, 0xf0}, + {0x24, 0x6d, 0x10}, + {0x24, 0x6e, 0xd2}, + {0x24, 0x6f, 0xcc}, + {0x24, 0x70, 0x07}, + {0x24, 0x71, 0xe2}, + {0x24, 0x72, 0xb2}, + {0x24, 0x73, 0xe1}, + {0x24, 0x74, 0x0f}, + {0x24, 0x75, 0xef}, + {0x24, 0x76, 0x2d}, + {0x24, 0x77, 0x34}, + {0x24, 0x78, 0xf8}, + {0x24, 0x79, 0x10}, + {0x24, 0x7a, 0xaf}, + {0x24, 0x7b, 0xd9}, + {0x24, 0x7c, 0x08}, // Biquad - BQ6 Left - Filter: Equalizer (Q Factor) Frequency: 200 Hz Gain: 8dB QVal: 1 Bandwidth: 1000 Hz + {0x24, 0x7d, 0x14}, + {0x24, 0x7e, 0x22}, + {0x24, 0x7f, 0x3d}, + {0x25, 0x08, 0xf0}, + {0x25, 0x09, 0x1a}, + {0x25, 0x0a, 0xfb}, + {0x25, 0x0b, 0x8a}, + {0x25, 0x0c, 0x07}, + {0x25, 0x0d, 0xd1}, + {0x25, 0x0e, 0x3b}, + {0x25, 0x0f, 0x79}, + {0x25, 0x10, 0x0f}, + {0x25, 0x11, 0xe5}, + {0x25, 0x12, 0x04}, + {0x25, 0x13, 0x76}, + {0x25, 0x14, 0xf8}, + {0x25, 0x15, 0x1a}, + {0x25, 0x16, 0xa2}, + {0x25, 0x17, 0x4a}, + {0x25, 0x18, 0x08}, // Biquad - BQ7 Left - Filter: Equalizer (Q Factor) Frequency: 315 Hz Gain: 8dB QVal: 0.9 Bandwidth: 1000 Hz + {0x25, 0x19, 0x23}, + {0x25, 0x1a, 0x10}, + {0x25, 0x1b, 0x24}, + {0x25, 0x1c, 0xf0}, + {0x25, 0x1d, 0x2f}, + {0x25, 0x1e, 0x3e}, + {0x25, 0x1f, 0x6a}, + {0x25, 0x20, 0x07}, + {0x25, 0x21, 0xae}, + {0x25, 0x22, 0x8d}, + {0x25, 0x23, 0xc3}, + {0x25, 0x24, 0x0f}, + {0x25, 0x25, 0xd0}, + {0x25, 0x26, 0xc1}, + {0x25, 0x27, 0x96}, + {0x25, 0x28, 0xf8}, + {0x25, 0x29, 0x2e}, + {0x25, 0x2a, 0x62}, + {0x25, 0x2b, 0x19}, + {0x25, 0x2c, 0x08}, // Biquad - BQ8 Left - Filter: Equalizer (Q Factor) Frequency: 500 Hz Gain: 8dB QVal: 0.9 Bandwidth: 1000 Hz + {0x25, 0x2d, 0x37}, + {0x25, 0x2e, 0x49}, + {0x25, 0x2f, 0xb7}, + {0x25, 0x30, 0xf0}, + {0x25, 0x31, 0x4b}, + {0x25, 0x32, 0x4a}, + {0x25, 0x33, 0xa6}, + {0x25, 0x34, 0x07}, + {0x25, 0x35, 0x7f}, + {0x25, 0x36, 0x93}, + {0x25, 0x37, 0x09}, + {0x25, 0x38, 0x0f}, + {0x25, 0x39, 0xb4}, + {0x25, 0x3a, 0xb5}, + {0x25, 0x3b, 0x5a}, + {0x25, 0x3c, 0xf8}, + {0x25, 0x3d, 0x49}, + {0x25, 0x3e, 0x23}, + {0x25, 0x3f, 0x40}, + {0x25, 0x40, 0x08}, // Biquad - BQ9 Left - Filter: Equalizer (Q Factor) Frequency: 800 Hz Gain: 8dB QVal: 0.8 Bandwidth: 1000 Hz + {0x25, 0x41, 0x62}, + {0x25, 0x42, 0x1d}, + {0x25, 0x43, 0xe3}, + {0x25, 0x44, 0xf0}, + {0x25, 0x45, 0x87}, + {0x25, 0x46, 0x3a}, + {0x25, 0x47, 0xb6}, + {0x25, 0x48, 0x07}, + {0x25, 0x49, 0x1c}, + {0x25, 0x4a, 0x16}, + {0x25, 0x4b, 0xe7}, + {0x25, 0x4c, 0x0f}, + {0x25, 0x4d, 0x78}, + {0x25, 0x4e, 0xc5}, + {0x25, 0x4f, 0x4a}, + {0x25, 0x50, 0xf8}, + {0x25, 0x51, 0x81}, + {0x25, 0x52, 0xcb}, + {0x25, 0x53, 0x36}, + {0x25, 0x54, 0x08}, // Biquad - BQ10 Left - Filter: Equalizer (Q Factor) Frequency: 1250 Hz Gain: 8dB QVal: 0.8 Bandwidth: 1000 Hz + {0x25, 0x55, 0x96}, + {0x25, 0x56, 0x9f}, + {0x25, 0x57, 0x65}, + {0x25, 0x58, 0xf0}, + {0x25, 0x59, 0xd4}, + {0x25, 0x5a, 0x48}, + {0x25, 0x5b, 0xf3}, + {0x25, 0x5c, 0x06}, + {0x25, 0x5d, 0xa2}, + {0x25, 0x5e, 0x20}, + {0x25, 0x5f, 0x49}, + {0x25, 0x60, 0x0f}, + {0x25, 0x61, 0x2b}, + {0x25, 0x62, 0xb7}, + {0x25, 0x63, 0x0d}, + {0x25, 0x64, 0xf8}, + {0x25, 0x65, 0xc7}, + {0x25, 0x66, 0x40}, + {0x25, 0x67, 0x52}, + {0x25, 0x68, 0x09}, // Biquad - BQ11 Left - Filter: Equalizer (Q Factor) Frequency: 2000 Hz Gain: 8dB QVal: 0.7 Bandwidth: 1000 Hz + {0x25, 0x69, 0x08}, + {0x25, 0x6a, 0xc0}, + {0x25, 0x6b, 0xca}, + {0x25, 0x6c, 0xf1}, + {0x25, 0x6d, 0x7e}, + {0x25, 0x6e, 0x46}, + {0x25, 0x6f, 0x3e}, + {0x25, 0x70, 0x05}, + {0x25, 0x71, 0x99}, + {0x25, 0x72, 0x04}, + {0x25, 0x73, 0xa4}, + {0x25, 0x74, 0x0e}, + {0x25, 0x75, 0x81}, + {0x25, 0x76, 0xb9}, + {0x25, 0x77, 0xc2}, + {0x25, 0x78, 0xf9}, + {0x25, 0x79, 0x5e}, + {0x25, 0x7a, 0x3a}, + {0x25, 0x7b, 0x92}, + {0x25, 0x7c, 0x09}, // Biquad - BQ12 Left - Filter: Equalizer (Q Factor) Frequency: 3150 Hz Gain: 8dB QVal: 0.7 Bandwidth: 1000 Hz + {0x25, 0x7d, 0x8d}, + {0x25, 0x7e, 0x72}, + {0x25, 0x7f, 0x0e}, + {0x26, 0x08, 0xf2}, + {0x26, 0x09, 0x59}, + {0x26, 0x0a, 0x5e}, + {0x26, 0x0b, 0x71}, + {0x26, 0x0c, 0x04}, + {0x26, 0x0d, 0x64}, + {0x26, 0x0e, 0xcb}, + {0x26, 0x0f, 0x1c}, + {0x26, 0x10, 0x0d}, + {0x26, 0x11, 0xa6}, + {0x26, 0x12, 0xa1}, + {0x26, 0x13, 0x8f}, + {0x26, 0x14, 0xfa}, + {0x26, 0x15, 0x0d}, + {0x26, 0x16, 0xc2}, + {0x26, 0x17, 0xd6}, + {0x26, 0x18, 0x0a}, // Biquad - BQ13 Left - Filter: Equalizer (Q Factor) Frequency: 5000 Hz Gain: 8dB QVal: 0.6 Bandwidth: 1000 Hz + {0x26, 0x19, 0x97}, + {0x26, 0x1a, 0x76}, + {0x26, 0x1b, 0xf9}, + {0x26, 0x1c, 0xf4}, + {0x26, 0x1d, 0x18}, + {0x26, 0x1e, 0x76}, + {0x26, 0x1f, 0x1f}, + {0x26, 0x20, 0x01}, + {0x26, 0x21, 0xfa}, + {0x26, 0x22, 0xde}, + {0x26, 0x23, 0xd8}, + {0x26, 0x24, 0x0b}, + {0x26, 0x25, 0xe7}, + {0x26, 0x26, 0x89}, + {0x26, 0x27, 0xe1}, + {0x26, 0x28, 0xfb}, + {0x26, 0x29, 0x6d}, + {0x26, 0x2a, 0xaa}, + {0x26, 0x2b, 0x2f}, + {0x26, 0x2c, 0x0b}, // Biquad - BQ14 Left - Filter: Equalizer (Q Factor) Frequency: 8000 Hz Gain: 8dB QVal: 0.6 Bandwidth: 1000 Hz + {0x26, 0x2d, 0xac}, + {0x26, 0x2e, 0x9d}, + {0x26, 0x2f, 0x41}, + {0x26, 0x30, 0xf6}, + {0x26, 0x31, 0x5a}, + {0x26, 0x32, 0x59}, + {0x26, 0x33, 0x40}, + {0x26, 0x34, 0xff}, + {0x26, 0x35, 0x77}, + {0x26, 0x36, 0x17}, + {0x26, 0x37, 0xee}, + {0x26, 0x38, 0x09}, + {0x26, 0x39, 0xa5}, + {0x26, 0x3a, 0xa6}, + {0x26, 0x3b, 0xc0}, + {0x26, 0x3c, 0xfc}, + {0x26, 0x3d, 0xdc}, + {0x26, 0x3e, 0x4a}, + {0x26, 0x3f, 0xd0}, + {0x26, 0x40, 0x0e}, // Biquad - BQ15 Left - Filter: Equalizer (Q Factor) Frequency: 16000 Hz Gain: 8dB QVal: 0.5 Bandwidth: 1000 Hz + {0x26, 0x41, 0x2f}, + {0x26, 0x42, 0xdd}, + {0x26, 0x43, 0x47}, + {0x26, 0x44, 0xfc}, + {0x26, 0x45, 0x17}, + {0x26, 0x46, 0x9b}, + {0x26, 0x47, 0xa8}, + {0x26, 0x48, 0xf9}, + {0x26, 0x49, 0xa0}, + {0x26, 0x4a, 0xeb}, + {0x26, 0x4b, 0x6a}, + {0x26, 0x4c, 0x03}, + {0x26, 0x4d, 0xe8}, + {0x26, 0x4e, 0x64}, + {0x26, 0x4f, 0x58}, + {0x26, 0x50, 0x00}, + {0x26, 0x51, 0x2f}, + {0x26, 0x52, 0x37}, + {0x26, 0x53, 0x4f}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_left_p9[TAS5805M_EQ_REG_PER_STEP] = { + {0x24, 0x18, 0x08}, // Biquad - BQ1 Left - Filter: Equalizer (Q Factor) Frequency: 20 Hz Gain: 9dB QVal: 2 Bandwidth: 1000 Hz + {0x24, 0x19, 0x01}, + {0x24, 0x1a, 0x37}, + {0x24, 0x1b, 0xe2}, + {0x24, 0x1c, 0xf0}, + {0x24, 0x1d, 0x01}, + {0x24, 0x1e, 0x57}, + {0x24, 0x1f, 0xef}, + {0x24, 0x20, 0x07}, + {0x24, 0x21, 0xfd}, + {0x24, 0x22, 0x71}, + {0x24, 0x23, 0x15}, + {0x24, 0x24, 0x0f}, + {0x24, 0x25, 0xfe}, + {0x24, 0x26, 0xa8}, + {0x24, 0x27, 0x11}, + {0x24, 0x28, 0xf8}, + {0x24, 0x29, 0x01}, + {0x24, 0x2a, 0x57}, + {0x24, 0x2b, 0x09}, + {0x24, 0x2c, 0x08}, // Biquad - BQ2 Left - Filter: Equalizer (Q Factor) Frequency: 31.5 Hz Gain: 9dB QVal: 2 Bandwidth: 1000 Hz + {0x24, 0x2d, 0x01}, + {0x24, 0x2e, 0xeb}, + {0x24, 0x2f, 0x20}, + {0x24, 0x30, 0xf0}, + {0x24, 0x31, 0x02}, + {0x24, 0x32, 0x1e}, + {0x24, 0x33, 0x67}, + {0x24, 0x34, 0x07}, + {0x24, 0x35, 0xfb}, + {0x24, 0x36, 0xf8}, + {0x24, 0x37, 0xb3}, + {0x24, 0x38, 0x0f}, + {0x24, 0x39, 0xfd}, + {0x24, 0x3a, 0xe1}, + {0x24, 0x3b, 0x99}, + {0x24, 0x3c, 0xf8}, + {0x24, 0x3d, 0x02}, + {0x24, 0x3e, 0x1c}, + {0x24, 0x3f, 0x2d}, + {0x24, 0x40, 0x08}, // Biquad - BQ3 Left - Filter: Equalizer (Q Factor) Frequency: 50 Hz Gain: 9dB QVal: 1.5 Bandwidth: 1000 Hz + {0x24, 0x41, 0x04}, + {0x24, 0x42, 0x0e}, + {0x24, 0x43, 0xd1}, + {0x24, 0x44, 0xf0}, + {0x24, 0x45, 0x04}, + {0x24, 0x46, 0x7c}, + {0x24, 0x47, 0x2f}, + {0x24, 0x48, 0x07}, + {0x24, 0x49, 0xf7}, + {0x24, 0x4a, 0x7a}, + {0x24, 0x4b, 0x9c}, + {0x24, 0x4c, 0x0f}, + {0x24, 0x4d, 0xfb}, + {0x24, 0x4e, 0x83}, + {0x24, 0x4f, 0xd1}, + {0x24, 0x50, 0xf8}, + {0x24, 0x51, 0x04}, + {0x24, 0x52, 0x76}, + {0x24, 0x53, 0x93}, + {0x24, 0x54, 0x08}, // Biquad - BQ4 Left - Filter: Equalizer (Q Factor) Frequency: 80 Hz Gain: 9dB QVal: 1.5 Bandwidth: 1000 Hz + {0x24, 0x55, 0x06}, + {0x24, 0x56, 0x7d}, + {0x24, 0x57, 0x05}, + {0x24, 0x58, 0xf0}, + {0x24, 0x59, 0x07}, + {0x24, 0x5a, 0x31}, + {0x24, 0x5b, 0x45}, + {0x24, 0x5c, 0x07}, + {0x24, 0x5d, 0xf2}, + {0x24, 0x5e, 0x60}, + {0x24, 0x5f, 0x0e}, + {0x24, 0x60, 0x0f}, + {0x24, 0x61, 0xf8}, + {0x24, 0x62, 0xce}, + {0x24, 0x63, 0xbb}, + {0x24, 0x64, 0xf8}, + {0x24, 0x65, 0x07}, + {0x24, 0x66, 0x22}, + {0x24, 0x67, 0xec}, + {0x24, 0x68, 0x08}, // Biquad - BQ5 Left - Filter: Equalizer (Q Factor) Frequency: 125 Hz Gain: 9dB QVal: 1 Bandwidth: 1000 Hz + {0x24, 0x69, 0x0f}, + {0x24, 0x6a, 0x2b}, + {0x24, 0x6b, 0xed}, + {0x24, 0x6c, 0xf0}, + {0x24, 0x6d, 0x10}, + {0x24, 0x6e, 0xd2}, + {0x24, 0x6f, 0xcc}, + {0x24, 0x70, 0x07}, + {0x24, 0x71, 0xe0}, + {0x24, 0x72, 0x24}, + {0x24, 0x73, 0x3a}, + {0x24, 0x74, 0x0f}, + {0x24, 0x75, 0xef}, + {0x24, 0x76, 0x2d}, + {0x24, 0x77, 0x34}, + {0x24, 0x78, 0xf8}, + {0x24, 0x79, 0x10}, + {0x24, 0x7a, 0xaf}, + {0x24, 0x7b, 0xd9}, + {0x24, 0x7c, 0x08}, // Biquad - BQ6 Left - Filter: Equalizer (Q Factor) Frequency: 200 Hz Gain: 9dB QVal: 1 Bandwidth: 1000 Hz + {0x24, 0x7d, 0x18}, + {0x24, 0x7e, 0x37}, + {0x24, 0x7f, 0x21}, + {0x25, 0x08, 0xf0}, + {0x25, 0x09, 0x1a}, + {0x25, 0x0a, 0xfb}, + {0x25, 0x0b, 0x8a}, + {0x25, 0x0c, 0x07}, + {0x25, 0x0d, 0xcd}, + {0x25, 0x0e, 0x26}, + {0x25, 0x0f, 0x95}, + {0x25, 0x10, 0x0f}, + {0x25, 0x11, 0xe5}, + {0x25, 0x12, 0x04}, + {0x25, 0x13, 0x76}, + {0x25, 0x14, 0xf8}, + {0x25, 0x15, 0x1a}, + {0x25, 0x16, 0xa2}, + {0x25, 0x17, 0x4a}, + {0x25, 0x18, 0x08}, // Biquad - BQ7 Left - Filter: Equalizer (Q Factor) Frequency: 315 Hz Gain: 9dB QVal: 0.9 Bandwidth: 1000 Hz + {0x25, 0x19, 0x2a}, + {0x25, 0x1a, 0x2b}, + {0x25, 0x1b, 0xd4}, + {0x25, 0x1c, 0xf0}, + {0x25, 0x1d, 0x2f}, + {0x25, 0x1e, 0x3e}, + {0x25, 0x1f, 0x6a}, + {0x25, 0x20, 0x07}, + {0x25, 0x21, 0xa7}, + {0x25, 0x22, 0x72}, + {0x25, 0x23, 0x13}, + {0x25, 0x24, 0x0f}, + {0x25, 0x25, 0xd0}, + {0x25, 0x26, 0xc1}, + {0x25, 0x27, 0x96}, + {0x25, 0x28, 0xf8}, + {0x25, 0x29, 0x2e}, + {0x25, 0x2a, 0x62}, + {0x25, 0x2b, 0x19}, + {0x25, 0x2c, 0x08}, // Biquad - BQ8 Left - Filter: Equalizer (Q Factor) Frequency: 500 Hz Gain: 9dB QVal: 0.9 Bandwidth: 1000 Hz + {0x25, 0x2d, 0x42}, + {0x25, 0x2e, 0x7f}, + {0x25, 0x2f, 0x05}, + {0x25, 0x30, 0xf0}, + {0x25, 0x31, 0x4b}, + {0x25, 0x32, 0x4a}, + {0x25, 0x33, 0xa6}, + {0x25, 0x34, 0x07}, + {0x25, 0x35, 0x74}, + {0x25, 0x36, 0x5d}, + {0x25, 0x37, 0xba}, + {0x25, 0x38, 0x0f}, + {0x25, 0x39, 0xb4}, + {0x25, 0x3a, 0xb5}, + {0x25, 0x3b, 0x5a}, + {0x25, 0x3c, 0xf8}, + {0x25, 0x3d, 0x49}, + {0x25, 0x3e, 0x23}, + {0x25, 0x3f, 0x40}, + {0x25, 0x40, 0x08}, // Biquad - BQ9 Left - Filter: Equalizer (Q Factor) Frequency: 800 Hz Gain: 9dB QVal: 0.8 Bandwidth: 1000 Hz + {0x25, 0x41, 0x76}, + {0x25, 0x42, 0x01}, + {0x25, 0x43, 0xe6}, + {0x25, 0x44, 0xf0}, + {0x25, 0x45, 0x87}, + {0x25, 0x46, 0x3a}, + {0x25, 0x47, 0xb6}, + {0x25, 0x48, 0x07}, + {0x25, 0x49, 0x08}, + {0x25, 0x4a, 0x32}, + {0x25, 0x4b, 0xe4}, + {0x25, 0x4c, 0x0f}, + {0x25, 0x4d, 0x78}, + {0x25, 0x4e, 0xc5}, + {0x25, 0x4f, 0x4a}, + {0x25, 0x50, 0xf8}, + {0x25, 0x51, 0x81}, + {0x25, 0x52, 0xcb}, + {0x25, 0x53, 0x36}, + {0x25, 0x54, 0x08}, // Biquad - BQ10 Left - Filter: Equalizer (Q Factor) Frequency: 1250 Hz Gain: 9dB QVal: 0.8 Bandwidth: 1000 Hz + {0x25, 0x55, 0xb5}, + {0x25, 0x56, 0x28}, + {0x25, 0x57, 0x55}, + {0x25, 0x58, 0xf0}, + {0x25, 0x59, 0xd4}, + {0x25, 0x5a, 0x48}, + {0x25, 0x5b, 0xf3}, + {0x25, 0x5c, 0x06}, + {0x25, 0x5d, 0x83}, + {0x25, 0x5e, 0x97}, + {0x25, 0x5f, 0x59}, + {0x25, 0x60, 0x0f}, + {0x25, 0x61, 0x2b}, + {0x25, 0x62, 0xb7}, + {0x25, 0x63, 0x0d}, + {0x25, 0x64, 0xf8}, + {0x25, 0x65, 0xc7}, + {0x25, 0x66, 0x40}, + {0x25, 0x67, 0x52}, + {0x25, 0x68, 0x09}, // Biquad - BQ11 Left - Filter: Equalizer (Q Factor) Frequency: 2000 Hz Gain: 9dB QVal: 0.7 Bandwidth: 1000 Hz + {0x25, 0x69, 0x3e}, + {0x25, 0x6a, 0x6c}, + {0x25, 0x6b, 0xce}, + {0x25, 0x6c, 0xf1}, + {0x25, 0x6d, 0x7e}, + {0x25, 0x6e, 0x46}, + {0x25, 0x6f, 0x3e}, + {0x25, 0x70, 0x05}, + {0x25, 0x71, 0x63}, + {0x25, 0x72, 0x58}, + {0x25, 0x73, 0xa0}, + {0x25, 0x74, 0x0e}, + {0x25, 0x75, 0x81}, + {0x25, 0x76, 0xb9}, + {0x25, 0x77, 0xc2}, + {0x25, 0x78, 0xf9}, + {0x25, 0x79, 0x5e}, + {0x25, 0x7a, 0x3a}, + {0x25, 0x7b, 0x92}, + {0x25, 0x7c, 0x09}, // Biquad - BQ12 Left - Filter: Equalizer (Q Factor) Frequency: 3150 Hz Gain: 9dB QVal: 0.7 Bandwidth: 1000 Hz + {0x25, 0x7d, 0xde}, + {0x25, 0x7e, 0x04}, + {0x25, 0x7f, 0x7a}, + {0x26, 0x08, 0xf2}, + {0x26, 0x09, 0x59}, + {0x26, 0x0a, 0x5e}, + {0x26, 0x0b, 0x71}, + {0x26, 0x0c, 0x04}, + {0x26, 0x0d, 0x14}, + {0x26, 0x0e, 0x38}, + {0x26, 0x0f, 0xb0}, + {0x26, 0x10, 0x0d}, + {0x26, 0x11, 0xa6}, + {0x26, 0x12, 0xa1}, + {0x26, 0x13, 0x8f}, + {0x26, 0x14, 0xfa}, + {0x26, 0x15, 0x0d}, + {0x26, 0x16, 0xc2}, + {0x26, 0x17, 0xd6}, + {0x26, 0x18, 0x0b}, // Biquad - BQ13 Left - Filter: Equalizer (Q Factor) Frequency: 5000 Hz Gain: 9dB QVal: 0.6 Bandwidth: 1000 Hz + {0x26, 0x19, 0x1d}, + {0x26, 0x1a, 0xf7}, + {0x26, 0x1b, 0x20}, + {0x26, 0x1c, 0xf4}, + {0x26, 0x1d, 0x18}, + {0x26, 0x1e, 0x76}, + {0x26, 0x1f, 0x1f}, + {0x26, 0x20, 0x01}, + {0x26, 0x21, 0x74}, + {0x26, 0x22, 0x5e}, + {0x26, 0x23, 0xb1}, + {0x26, 0x24, 0x0b}, + {0x26, 0x25, 0xe7}, + {0x26, 0x26, 0x89}, + {0x26, 0x27, 0xe1}, + {0x26, 0x28, 0xfb}, + {0x26, 0x29, 0x6d}, + {0x26, 0x2a, 0xaa}, + {0x26, 0x2b, 0x2f}, + {0x26, 0x2c, 0x0c}, // Biquad - BQ14 Left - Filter: Equalizer (Q Factor) Frequency: 8000 Hz Gain: 9dB QVal: 0.6 Bandwidth: 1000 Hz + {0x26, 0x2d, 0x6b}, + {0x26, 0x2e, 0x4c}, + {0x26, 0x2f, 0xc5}, + {0x26, 0x30, 0xf6}, + {0x26, 0x31, 0x5a}, + {0x26, 0x32, 0x59}, + {0x26, 0x33, 0x40}, + {0x26, 0x34, 0xfe}, + {0x26, 0x35, 0xb8}, + {0x26, 0x36, 0x68}, + {0x26, 0x37, 0x6a}, + {0x26, 0x38, 0x09}, + {0x26, 0x39, 0xa5}, + {0x26, 0x3a, 0xa6}, + {0x26, 0x3b, 0xc0}, + {0x26, 0x3c, 0xfc}, + {0x26, 0x3d, 0xdc}, + {0x26, 0x3e, 0x4a}, + {0x26, 0x3f, 0xd0}, + {0x26, 0x40, 0x0f}, // Biquad - BQ15 Left - Filter: Equalizer (Q Factor) Frequency: 16000 Hz Gain: 9dB QVal: 0.5 Bandwidth: 1000 Hz + {0x26, 0x41, 0x70}, + {0x26, 0x42, 0xf3}, + {0x26, 0x43, 0xda}, + {0x26, 0x44, 0xfc}, + {0x26, 0x45, 0x17}, + {0x26, 0x46, 0x9b}, + {0x26, 0x47, 0xa8}, + {0x26, 0x48, 0xf8}, + {0x26, 0x49, 0x5f}, + {0x26, 0x4a, 0xd4}, + {0x26, 0x4b, 0xd6}, + {0x26, 0x4c, 0x03}, + {0x26, 0x4d, 0xe8}, + {0x26, 0x4e, 0x64}, + {0x26, 0x4f, 0x58}, + {0x26, 0x50, 0x00}, + {0x26, 0x51, 0x2f}, + {0x26, 0x52, 0x37}, + {0x26, 0x53, 0x4f}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_left_pa[TAS5805M_EQ_REG_PER_STEP] = { + {0x24, 0x18, 0x08}, // Biquad - BQ1 Left - Filter: Equalizer (Q Factor) Frequency: 20 Hz Gain: 10dB QVal: 2 Bandwidth: 1000 Hz + {0x24, 0x19, 0x01}, + {0x24, 0x1a, 0x72}, + {0x24, 0x1b, 0xde}, + {0x24, 0x1c, 0xf0}, + {0x24, 0x1d, 0x01}, + {0x24, 0x1e, 0x57}, + {0x24, 0x1f, 0xef}, + {0x24, 0x20, 0x07}, + {0x24, 0x21, 0xfd}, + {0x24, 0x22, 0x36}, + {0x24, 0x23, 0x19}, + {0x24, 0x24, 0x0f}, + {0x24, 0x25, 0xfe}, + {0x24, 0x26, 0xa8}, + {0x24, 0x27, 0x11}, + {0x24, 0x28, 0xf8}, + {0x24, 0x29, 0x01}, + {0x24, 0x2a, 0x57}, + {0x24, 0x2b, 0x09}, + {0x24, 0x2c, 0x08}, // Biquad - BQ2 Left - Filter: Equalizer (Q Factor) Frequency: 31.5 Hz Gain: 10dB QVal: 2 Bandwidth: 1000 Hz + {0x24, 0x2d, 0x02}, + {0x24, 0x2e, 0x48}, + {0x24, 0x2f, 0x01}, + {0x24, 0x30, 0xf0}, + {0x24, 0x31, 0x02}, + {0x24, 0x32, 0x1e}, + {0x24, 0x33, 0x67}, + {0x24, 0x34, 0x07}, + {0x24, 0x35, 0xfb}, + {0x24, 0x36, 0x9b}, + {0x24, 0x37, 0xd2}, + {0x24, 0x38, 0x0f}, + {0x24, 0x39, 0xfd}, + {0x24, 0x3a, 0xe1}, + {0x24, 0x3b, 0x99}, + {0x24, 0x3c, 0xf8}, + {0x24, 0x3d, 0x02}, + {0x24, 0x3e, 0x1c}, + {0x24, 0x3f, 0x2d}, + {0x24, 0x40, 0x08}, // Biquad - BQ3 Left - Filter: Equalizer (Q Factor) Frequency: 50 Hz Gain: 10dB QVal: 1.5 Bandwidth: 1000 Hz + {0x24, 0x41, 0x04}, + {0x24, 0x42, 0xd3}, + {0x24, 0x43, 0x48}, + {0x24, 0x44, 0xf0}, + {0x24, 0x45, 0x04}, + {0x24, 0x46, 0x7c}, + {0x24, 0x47, 0x2f}, + {0x24, 0x48, 0x07}, + {0x24, 0x49, 0xf6}, + {0x24, 0x4a, 0xb6}, + {0x24, 0x4b, 0x26}, + {0x24, 0x4c, 0x0f}, + {0x24, 0x4d, 0xfb}, + {0x24, 0x4e, 0x83}, + {0x24, 0x4f, 0xd1}, + {0x24, 0x50, 0xf8}, + {0x24, 0x51, 0x04}, + {0x24, 0x52, 0x76}, + {0x24, 0x53, 0x93}, + {0x24, 0x54, 0x08}, // Biquad - BQ4 Left - Filter: Equalizer (Q Factor) Frequency: 80 Hz Gain: 10dB QVal: 1.5 Bandwidth: 1000 Hz + {0x24, 0x55, 0x07}, + {0x24, 0x56, 0xb7}, + {0x24, 0x57, 0x28}, + {0x24, 0x58, 0xf0}, + {0x24, 0x59, 0x07}, + {0x24, 0x5a, 0x31}, + {0x24, 0x5b, 0x45}, + {0x24, 0x5c, 0x07}, + {0x24, 0x5d, 0xf1}, + {0x24, 0x5e, 0x25}, + {0x24, 0x5f, 0xec}, + {0x24, 0x60, 0x0f}, + {0x24, 0x61, 0xf8}, + {0x24, 0x62, 0xce}, + {0x24, 0x63, 0xbb}, + {0x24, 0x64, 0xf8}, + {0x24, 0x65, 0x07}, + {0x24, 0x66, 0x22}, + {0x24, 0x67, 0xec}, + {0x24, 0x68, 0x08}, // Biquad - BQ5 Left - Filter: Equalizer (Q Factor) Frequency: 125 Hz Gain: 10dB QVal: 1 Bandwidth: 1000 Hz + {0x24, 0x69, 0x12}, + {0x24, 0x6a, 0x0a}, + {0x24, 0x6b, 0x76}, + {0x24, 0x6c, 0xf0}, + {0x24, 0x6d, 0x10}, + {0x24, 0x6e, 0xd2}, + {0x24, 0x6f, 0xcc}, + {0x24, 0x70, 0x07}, + {0x24, 0x71, 0xdd}, + {0x24, 0x72, 0x45}, + {0x24, 0x73, 0xb2}, + {0x24, 0x74, 0x0f}, + {0x24, 0x75, 0xef}, + {0x24, 0x76, 0x2d}, + {0x24, 0x77, 0x34}, + {0x24, 0x78, 0xf8}, + {0x24, 0x79, 0x10}, + {0x24, 0x7a, 0xaf}, + {0x24, 0x7b, 0xd9}, + {0x24, 0x7c, 0x08}, // Biquad - BQ6 Left - Filter: Equalizer (Q Factor) Frequency: 200 Hz Gain: 10dB QVal: 1 Bandwidth: 1000 Hz + {0x24, 0x7d, 0x1c}, + {0x24, 0x7e, 0xcb}, + {0x24, 0x7f, 0x84}, + {0x25, 0x08, 0xf0}, + {0x25, 0x09, 0x1a}, + {0x25, 0x0a, 0xfb}, + {0x25, 0x0b, 0x8a}, + {0x25, 0x0c, 0x07}, + {0x25, 0x0d, 0xc8}, + {0x25, 0x0e, 0x92}, + {0x25, 0x0f, 0x32}, + {0x25, 0x10, 0x0f}, + {0x25, 0x11, 0xe5}, + {0x25, 0x12, 0x04}, + {0x25, 0x13, 0x76}, + {0x25, 0x14, 0xf8}, + {0x25, 0x15, 0x1a}, + {0x25, 0x16, 0xa2}, + {0x25, 0x17, 0x4a}, + {0x25, 0x18, 0x08}, // Biquad - BQ7 Left - Filter: Equalizer (Q Factor) Frequency: 315 Hz Gain: 10dB QVal: 0.9 Bandwidth: 1000 Hz + {0x25, 0x19, 0x32}, + {0x25, 0x1a, 0x25}, + {0x25, 0x1b, 0x8c}, + {0x25, 0x1c, 0xf0}, + {0x25, 0x1d, 0x2f}, + {0x25, 0x1e, 0x3e}, + {0x25, 0x1f, 0x6a}, + {0x25, 0x20, 0x07}, + {0x25, 0x21, 0x9f}, + {0x25, 0x22, 0x78}, + {0x25, 0x23, 0x5b}, + {0x25, 0x24, 0x0f}, + {0x25, 0x25, 0xd0}, + {0x25, 0x26, 0xc1}, + {0x25, 0x27, 0x96}, + {0x25, 0x28, 0xf8}, + {0x25, 0x29, 0x2e}, + {0x25, 0x2a, 0x62}, + {0x25, 0x2b, 0x19}, + {0x25, 0x2c, 0x08}, // Biquad - BQ8 Left - Filter: Equalizer (Q Factor) Frequency: 500 Hz Gain: 10dB QVal: 0.9 Bandwidth: 1000 Hz + {0x25, 0x2d, 0x4f}, + {0x25, 0x2e, 0x12}, + {0x25, 0x2f, 0x6f}, + {0x25, 0x30, 0xf0}, + {0x25, 0x31, 0x4b}, + {0x25, 0x32, 0x4a}, + {0x25, 0x33, 0xa6}, + {0x25, 0x34, 0x07}, + {0x25, 0x35, 0x67}, + {0x25, 0x36, 0xca}, + {0x25, 0x37, 0x50}, + {0x25, 0x38, 0x0f}, + {0x25, 0x39, 0xb4}, + {0x25, 0x3a, 0xb5}, + {0x25, 0x3b, 0x5a}, + {0x25, 0x3c, 0xf8}, + {0x25, 0x3d, 0x49}, + {0x25, 0x3e, 0x23}, + {0x25, 0x3f, 0x40}, + {0x25, 0x40, 0x08}, // Biquad - BQ9 Left - Filter: Equalizer (Q Factor) Frequency: 800 Hz Gain: 10dB QVal: 0.8 Bandwidth: 1000 Hz + {0x25, 0x41, 0x8c}, + {0x25, 0x42, 0x53}, + {0x25, 0x43, 0x3a}, + {0x25, 0x44, 0xf0}, + {0x25, 0x45, 0x87}, + {0x25, 0x46, 0x3a}, + {0x25, 0x47, 0xb6}, + {0x25, 0x48, 0x06}, + {0x25, 0x49, 0xf1}, + {0x25, 0x4a, 0xe1}, + {0x25, 0x4b, 0x8f}, + {0x25, 0x4c, 0x0f}, + {0x25, 0x4d, 0x78}, + {0x25, 0x4e, 0xc5}, + {0x25, 0x4f, 0x4a}, + {0x25, 0x50, 0xf8}, + {0x25, 0x51, 0x81}, + {0x25, 0x52, 0xcb}, + {0x25, 0x53, 0x36}, + {0x25, 0x54, 0x08}, // Biquad - BQ10 Left - Filter: Equalizer (Q Factor) Frequency: 1250 Hz Gain: 10dB QVal: 0.8 Bandwidth: 1000 Hz + {0x25, 0x55, 0xd7}, + {0x25, 0x56, 0x6b}, + {0x25, 0x57, 0x14}, + {0x25, 0x58, 0xf0}, + {0x25, 0x59, 0xd4}, + {0x25, 0x5a, 0x48}, + {0x25, 0x5b, 0xf3}, + {0x25, 0x5c, 0x06}, + {0x25, 0x5d, 0x61}, + {0x25, 0x5e, 0x54}, + {0x25, 0x5f, 0x9a}, + {0x25, 0x60, 0x0f}, + {0x25, 0x61, 0x2b}, + {0x25, 0x62, 0xb7}, + {0x25, 0x63, 0x0d}, + {0x25, 0x64, 0xf8}, + {0x25, 0x65, 0xc7}, + {0x25, 0x66, 0x40}, + {0x25, 0x67, 0x52}, + {0x25, 0x68, 0x09}, // Biquad - BQ11 Left - Filter: Equalizer (Q Factor) Frequency: 2000 Hz Gain: 10dB QVal: 0.7 Bandwidth: 1000 Hz + {0x25, 0x69, 0x7a}, + {0x25, 0x6a, 0xa5}, + {0x25, 0x6b, 0x5c}, + {0x25, 0x6c, 0xf1}, + {0x25, 0x6d, 0x7e}, + {0x25, 0x6e, 0x46}, + {0x25, 0x6f, 0x3e}, + {0x25, 0x70, 0x05}, + {0x25, 0x71, 0x27}, + {0x25, 0x72, 0x20}, + {0x25, 0x73, 0x11}, + {0x25, 0x74, 0x0e}, + {0x25, 0x75, 0x81}, + {0x25, 0x76, 0xb9}, + {0x25, 0x77, 0xc2}, + {0x25, 0x78, 0xf9}, + {0x25, 0x79, 0x5e}, + {0x25, 0x7a, 0x3a}, + {0x25, 0x7b, 0x92}, + {0x25, 0x7c, 0x0a}, // Biquad - BQ12 Left - Filter: Equalizer (Q Factor) Frequency: 3150 Hz Gain: 10dB QVal: 0.7 Bandwidth: 1000 Hz + {0x25, 0x7d, 0x38}, + {0x25, 0x7e, 0x6b}, + {0x25, 0x7f, 0xb4}, + {0x26, 0x08, 0xf2}, + {0x26, 0x09, 0x59}, + {0x26, 0x0a, 0x5e}, + {0x26, 0x0b, 0x71}, + {0x26, 0x0c, 0x03}, + {0x26, 0x0d, 0xb9}, + {0x26, 0x0e, 0xd1}, + {0x26, 0x0f, 0x76}, + {0x26, 0x10, 0x0d}, + {0x26, 0x11, 0xa6}, + {0x26, 0x12, 0xa1}, + {0x26, 0x13, 0x8f}, + {0x26, 0x14, 0xfa}, + {0x26, 0x15, 0x0d}, + {0x26, 0x16, 0xc2}, + {0x26, 0x17, 0xd6}, + {0x26, 0x18, 0x0b}, // Biquad - BQ13 Left - Filter: Equalizer (Q Factor) Frequency: 5000 Hz Gain: 10dB QVal: 0.6 Bandwidth: 1000 Hz + {0x26, 0x19, 0xb4}, + {0x26, 0x1a, 0xe0}, + {0x26, 0x1b, 0xa2}, + {0x26, 0x1c, 0xf4}, + {0x26, 0x1d, 0x18}, + {0x26, 0x1e, 0x76}, + {0x26, 0x1f, 0x1f}, + {0x26, 0x20, 0x00}, + {0x26, 0x21, 0xdd}, + {0x26, 0x22, 0x75}, + {0x26, 0x23, 0x2f}, + {0x26, 0x24, 0x0b}, + {0x26, 0x25, 0xe7}, + {0x26, 0x26, 0x89}, + {0x26, 0x27, 0xe1}, + {0x26, 0x28, 0xfb}, + {0x26, 0x29, 0x6d}, + {0x26, 0x2a, 0xaa}, + {0x26, 0x2b, 0x2f}, + {0x26, 0x2c, 0x0d}, // Biquad - BQ14 Left - Filter: Equalizer (Q Factor) Frequency: 8000 Hz Gain: 10dB QVal: 0.6 Bandwidth: 1000 Hz + {0x26, 0x2d, 0x41}, + {0x26, 0x2e, 0x40}, + {0x26, 0x2f, 0xae}, + {0x26, 0x30, 0xf6}, + {0x26, 0x31, 0x5a}, + {0x26, 0x32, 0x59}, + {0x26, 0x33, 0x40}, + {0x26, 0x34, 0xfd}, + {0x26, 0x35, 0xe2}, + {0x26, 0x36, 0x74}, + {0x26, 0x37, 0x81}, + {0x26, 0x38, 0x09}, + {0x26, 0x39, 0xa5}, + {0x26, 0x3a, 0xa6}, + {0x26, 0x3b, 0xc0}, + {0x26, 0x3c, 0xfc}, + {0x26, 0x3d, 0xdc}, + {0x26, 0x3e, 0x4a}, + {0x26, 0x3f, 0xd0}, + {0x26, 0x40, 0x10}, // Biquad - BQ15 Left - Filter: Equalizer (Q Factor) Frequency: 16000 Hz Gain: 10dB QVal: 0.5 Bandwidth: 1000 Hz + {0x26, 0x41, 0xd9}, + {0x26, 0x42, 0x38}, + {0x26, 0x43, 0x2c}, + {0x26, 0x44, 0xfc}, + {0x26, 0x45, 0x17}, + {0x26, 0x46, 0x9b}, + {0x26, 0x47, 0xa8}, + {0x26, 0x48, 0xf6}, + {0x26, 0x49, 0xf7}, + {0x26, 0x4a, 0x90}, + {0x26, 0x4b, 0x84}, + {0x26, 0x4c, 0x03}, + {0x26, 0x4d, 0xe8}, + {0x26, 0x4e, 0x64}, + {0x26, 0x4f, 0x58}, + {0x26, 0x50, 0x00}, + {0x26, 0x51, 0x2f}, + {0x26, 0x52, 0x37}, + {0x26, 0x53, 0x4f}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_left_pb[TAS5805M_EQ_REG_PER_STEP] = { + {0x24, 0x18, 0x08}, // Biquad - BQ1 Left - Filter: Equalizer (Q Factor) Frequency: 20 Hz Gain: 11dB QVal: 2 Bandwidth: 1000 Hz + {0x24, 0x19, 0x01}, + {0x24, 0x1a, 0xb5}, + {0x24, 0x1b, 0x0c}, + {0x24, 0x1c, 0xf0}, + {0x24, 0x1d, 0x01}, + {0x24, 0x1e, 0x57}, + {0x24, 0x1f, 0xef}, + {0x24, 0x20, 0x07}, + {0x24, 0x21, 0xfc}, + {0x24, 0x22, 0xf3}, + {0x24, 0x23, 0xeb}, + {0x24, 0x24, 0x0f}, + {0x24, 0x25, 0xfe}, + {0x24, 0x26, 0xa8}, + {0x24, 0x27, 0x11}, + {0x24, 0x28, 0xf8}, + {0x24, 0x29, 0x01}, + {0x24, 0x2a, 0x57}, + {0x24, 0x2b, 0x09}, + {0x24, 0x2c, 0x08}, // Biquad - BQ2 Left - Filter: Equalizer (Q Factor) Frequency: 31.5 Hz Gain: 11dB QVal: 2 Bandwidth: 1000 Hz + {0x24, 0x2d, 0x02}, + {0x24, 0x2e, 0xb0}, + {0x24, 0x2f, 0x38}, + {0x24, 0x30, 0xf0}, + {0x24, 0x31, 0x02}, + {0x24, 0x32, 0x1e}, + {0x24, 0x33, 0x67}, + {0x24, 0x34, 0x07}, + {0x24, 0x35, 0xfb}, + {0x24, 0x36, 0x33}, + {0x24, 0x37, 0x9a}, + {0x24, 0x38, 0x0f}, + {0x24, 0x39, 0xfd}, + {0x24, 0x3a, 0xe1}, + {0x24, 0x3b, 0x99}, + {0x24, 0x3c, 0xf8}, + {0x24, 0x3d, 0x02}, + {0x24, 0x3e, 0x1c}, + {0x24, 0x3f, 0x2d}, + {0x24, 0x40, 0x08}, // Biquad - BQ3 Left - Filter: Equalizer (Q Factor) Frequency: 50 Hz Gain: 11dB QVal: 1.5 Bandwidth: 1000 Hz + {0x24, 0x41, 0x05}, + {0x24, 0x42, 0xaf}, + {0x24, 0x43, 0xb7}, + {0x24, 0x44, 0xf0}, + {0x24, 0x45, 0x04}, + {0x24, 0x46, 0x7c}, + {0x24, 0x47, 0x2f}, + {0x24, 0x48, 0x07}, + {0x24, 0x49, 0xf5}, + {0x24, 0x4a, 0xd9}, + {0x24, 0x4b, 0xb7}, + {0x24, 0x4c, 0x0f}, + {0x24, 0x4d, 0xfb}, + {0x24, 0x4e, 0x83}, + {0x24, 0x4f, 0xd1}, + {0x24, 0x50, 0xf8}, + {0x24, 0x51, 0x04}, + {0x24, 0x52, 0x76}, + {0x24, 0x53, 0x93}, + {0x24, 0x54, 0x08}, // Biquad - BQ4 Left - Filter: Equalizer (Q Factor) Frequency: 80 Hz Gain: 11dB QVal: 1.5 Bandwidth: 1000 Hz + {0x24, 0x55, 0x09}, + {0x24, 0x56, 0x17}, + {0x24, 0x57, 0x9f}, + {0x24, 0x58, 0xf0}, + {0x24, 0x59, 0x07}, + {0x24, 0x5a, 0x31}, + {0x24, 0x5b, 0x45}, + {0x24, 0x5c, 0x07}, + {0x24, 0x5d, 0xef}, + {0x24, 0x5e, 0xc5}, + {0x24, 0x5f, 0x75}, + {0x24, 0x60, 0x0f}, + {0x24, 0x61, 0xf8}, + {0x24, 0x62, 0xce}, + {0x24, 0x63, 0xbb}, + {0x24, 0x64, 0xf8}, + {0x24, 0x65, 0x07}, + {0x24, 0x66, 0x22}, + {0x24, 0x67, 0xec}, + {0x24, 0x68, 0x08}, // Biquad - BQ5 Left - Filter: Equalizer (Q Factor) Frequency: 125 Hz Gain: 11dB QVal: 1 Bandwidth: 1000 Hz + {0x24, 0x69, 0x15}, + {0x24, 0x6a, 0x42}, + {0x24, 0x6b, 0x9e}, + {0x24, 0x6c, 0xf0}, + {0x24, 0x6d, 0x10}, + {0x24, 0x6e, 0xd2}, + {0x24, 0x6f, 0xcc}, + {0x24, 0x70, 0x07}, + {0x24, 0x71, 0xda}, + {0x24, 0x72, 0x0d}, + {0x24, 0x73, 0x89}, + {0x24, 0x74, 0x0f}, + {0x24, 0x75, 0xef}, + {0x24, 0x76, 0x2d}, + {0x24, 0x77, 0x34}, + {0x24, 0x78, 0xf8}, + {0x24, 0x79, 0x10}, + {0x24, 0x7a, 0xaf}, + {0x24, 0x7b, 0xd9}, + {0x24, 0x7c, 0x08}, // Biquad - BQ6 Left - Filter: Equalizer (Q Factor) Frequency: 200 Hz Gain: 11dB QVal: 1 Bandwidth: 1000 Hz + {0x24, 0x7d, 0x21}, + {0x24, 0x7e, 0xee}, + {0x24, 0x7f, 0xf5}, + {0x25, 0x08, 0xf0}, + {0x25, 0x09, 0x1a}, + {0x25, 0x0a, 0xfb}, + {0x25, 0x0b, 0x8a}, + {0x25, 0x0c, 0x07}, + {0x25, 0x0d, 0xc3}, + {0x25, 0x0e, 0x6e}, + {0x25, 0x0f, 0xc1}, + {0x25, 0x10, 0x0f}, + {0x25, 0x11, 0xe5}, + {0x25, 0x12, 0x04}, + {0x25, 0x13, 0x76}, + {0x25, 0x14, 0xf8}, + {0x25, 0x15, 0x1a}, + {0x25, 0x16, 0xa2}, + {0x25, 0x17, 0x4a}, + {0x25, 0x18, 0x08}, // Biquad - BQ7 Left - Filter: Equalizer (Q Factor) Frequency: 315 Hz Gain: 11dB QVal: 0.9 Bandwidth: 1000 Hz + {0x25, 0x19, 0x3b}, + {0x25, 0x1a, 0x18}, + {0x25, 0x1b, 0x65}, + {0x25, 0x1c, 0xf0}, + {0x25, 0x1d, 0x2f}, + {0x25, 0x1e, 0x3e}, + {0x25, 0x1f, 0x6a}, + {0x25, 0x20, 0x07}, + {0x25, 0x21, 0x96}, + {0x25, 0x22, 0x85}, + {0x25, 0x23, 0x82}, + {0x25, 0x24, 0x0f}, + {0x25, 0x25, 0xd0}, + {0x25, 0x26, 0xc1}, + {0x25, 0x27, 0x96}, + {0x25, 0x28, 0xf8}, + {0x25, 0x29, 0x2e}, + {0x25, 0x2a, 0x62}, + {0x25, 0x2b, 0x19}, + {0x25, 0x2c, 0x08}, // Biquad - BQ8 Left - Filter: Equalizer (Q Factor) Frequency: 500 Hz Gain: 11dB QVal: 0.9 Bandwidth: 1000 Hz + {0x25, 0x2d, 0x5d}, + {0x25, 0x2e, 0x2e}, + {0x25, 0x2f, 0xad}, + {0x25, 0x30, 0xf0}, + {0x25, 0x31, 0x4b}, + {0x25, 0x32, 0x4a}, + {0x25, 0x33, 0xa6}, + {0x25, 0x34, 0x07}, + {0x25, 0x35, 0x59}, + {0x25, 0x36, 0xae}, + {0x25, 0x37, 0x13}, + {0x25, 0x38, 0x0f}, + {0x25, 0x39, 0xb4}, + {0x25, 0x3a, 0xb5}, + {0x25, 0x3b, 0x5a}, + {0x25, 0x3c, 0xf8}, + {0x25, 0x3d, 0x49}, + {0x25, 0x3e, 0x23}, + {0x25, 0x3f, 0x40}, + {0x25, 0x40, 0x08}, // Biquad - BQ9 Left - Filter: Equalizer (Q Factor) Frequency: 800 Hz Gain: 11dB QVal: 0.8 Bandwidth: 1000 Hz + {0x25, 0x41, 0xa5}, + {0x25, 0x42, 0x5d}, + {0x25, 0x43, 0xb1}, + {0x25, 0x44, 0xf0}, + {0x25, 0x45, 0x87}, + {0x25, 0x46, 0x3a}, + {0x25, 0x47, 0xb6}, + {0x25, 0x48, 0x06}, + {0x25, 0x49, 0xd8}, + {0x25, 0x4a, 0xd7}, + {0x25, 0x4b, 0x19}, + {0x25, 0x4c, 0x0f}, + {0x25, 0x4d, 0x78}, + {0x25, 0x4e, 0xc5}, + {0x25, 0x4f, 0x4a}, + {0x25, 0x50, 0xf8}, + {0x25, 0x51, 0x81}, + {0x25, 0x52, 0xcb}, + {0x25, 0x53, 0x36}, + {0x25, 0x54, 0x08}, // Biquad - BQ10 Left - Filter: Equalizer (Q Factor) Frequency: 1250 Hz Gain: 11dB QVal: 0.8 Bandwidth: 1000 Hz + {0x25, 0x55, 0xfd}, + {0x25, 0x56, 0xdc}, + {0x25, 0x57, 0x04}, + {0x25, 0x58, 0xf0}, + {0x25, 0x59, 0xd4}, + {0x25, 0x5a, 0x48}, + {0x25, 0x5b, 0xf3}, + {0x25, 0x5c, 0x06}, + {0x25, 0x5d, 0x3a}, + {0x25, 0x5e, 0xe3}, + {0x25, 0x5f, 0xa9}, + {0x25, 0x60, 0x0f}, + {0x25, 0x61, 0x2b}, + {0x25, 0x62, 0xb7}, + {0x25, 0x63, 0x0d}, + {0x25, 0x64, 0xf8}, + {0x25, 0x65, 0xc7}, + {0x25, 0x66, 0x40}, + {0x25, 0x67, 0x52}, + {0x25, 0x68, 0x09}, // Biquad - BQ11 Left - Filter: Equalizer (Q Factor) Frequency: 2000 Hz Gain: 11dB QVal: 0.7 Bandwidth: 1000 Hz + {0x25, 0x69, 0xbe}, + {0x25, 0x6a, 0x37}, + {0x25, 0x6b, 0x05}, + {0x25, 0x6c, 0xf1}, + {0x25, 0x6d, 0x7e}, + {0x25, 0x6e, 0x46}, + {0x25, 0x6f, 0x3e}, + {0x25, 0x70, 0x04}, + {0x25, 0x71, 0xe3}, + {0x25, 0x72, 0x8e}, + {0x25, 0x73, 0x69}, + {0x25, 0x74, 0x0e}, + {0x25, 0x75, 0x81}, + {0x25, 0x76, 0xb9}, + {0x25, 0x77, 0xc2}, + {0x25, 0x78, 0xf9}, + {0x25, 0x79, 0x5e}, + {0x25, 0x7a, 0x3a}, + {0x25, 0x7b, 0x92}, + {0x25, 0x7c, 0x0a}, // Biquad - BQ12 Left - Filter: Equalizer (Q Factor) Frequency: 3150 Hz Gain: 11dB QVal: 0.7 Bandwidth: 1000 Hz + {0x25, 0x7d, 0x9d}, + {0x25, 0x7e, 0xda}, + {0x25, 0x7f, 0xd5}, + {0x26, 0x08, 0xf2}, + {0x26, 0x09, 0x59}, + {0x26, 0x0a, 0x5e}, + {0x26, 0x0b, 0x71}, + {0x26, 0x0c, 0x03}, + {0x26, 0x0d, 0x54}, + {0x26, 0x0e, 0x62}, + {0x26, 0x0f, 0x55}, + {0x26, 0x10, 0x0d}, + {0x26, 0x11, 0xa6}, + {0x26, 0x12, 0xa1}, + {0x26, 0x13, 0x8f}, + {0x26, 0x14, 0xfa}, + {0x26, 0x15, 0x0d}, + {0x26, 0x16, 0xc2}, + {0x26, 0x17, 0xd6}, + {0x26, 0x18, 0x0c}, // Biquad - BQ13 Left - Filter: Equalizer (Q Factor) Frequency: 5000 Hz Gain: 11dB QVal: 0.6 Bandwidth: 1000 Hz + {0x26, 0x19, 0x5e}, + {0x26, 0x1a, 0x34}, + {0x26, 0x1b, 0x25}, + {0x26, 0x1c, 0xf4}, + {0x26, 0x1d, 0x18}, + {0x26, 0x1e, 0x76}, + {0x26, 0x1f, 0x1f}, + {0x26, 0x20, 0x00}, + {0x26, 0x21, 0x34}, + {0x26, 0x22, 0x21}, + {0x26, 0x23, 0xac}, + {0x26, 0x24, 0x0b}, + {0x26, 0x25, 0xe7}, + {0x26, 0x26, 0x89}, + {0x26, 0x27, 0xe1}, + {0x26, 0x28, 0xfb}, + {0x26, 0x29, 0x6d}, + {0x26, 0x2a, 0xaa}, + {0x26, 0x2b, 0x2f}, + {0x26, 0x2c, 0x0e}, // Biquad - BQ14 Left - Filter: Equalizer (Q Factor) Frequency: 8000 Hz Gain: 11dB QVal: 0.6 Bandwidth: 1000 Hz + {0x26, 0x2d, 0x31}, + {0x26, 0x2e, 0x4f}, + {0x26, 0x2f, 0xc6}, + {0x26, 0x30, 0xf6}, + {0x26, 0x31, 0x5a}, + {0x26, 0x32, 0x59}, + {0x26, 0x33, 0x40}, + {0x26, 0x34, 0xfc}, + {0x26, 0x35, 0xf2}, + {0x26, 0x36, 0x65}, + {0x26, 0x37, 0x6a}, + {0x26, 0x38, 0x09}, + {0x26, 0x39, 0xa5}, + {0x26, 0x3a, 0xa6}, + {0x26, 0x3b, 0xc0}, + {0x26, 0x3c, 0xfc}, + {0x26, 0x3d, 0xdc}, + {0x26, 0x3e, 0x4a}, + {0x26, 0x3f, 0xd0}, + {0x26, 0x40, 0x12}, // Biquad - BQ15 Left - Filter: Equalizer (Q Factor) Frequency: 16000 Hz Gain: 11dB QVal: 0.5 Bandwidth: 1000 Hz + {0x26, 0x41, 0x6d}, + {0x26, 0x42, 0x72}, + {0x26, 0x43, 0x0d}, + {0x26, 0x44, 0xfc}, + {0x26, 0x45, 0x17}, + {0x26, 0x46, 0x9b}, + {0x26, 0x47, 0xa8}, + {0x26, 0x48, 0xf5}, + {0x26, 0x49, 0x63}, + {0x26, 0x4a, 0x56}, + {0x26, 0x4b, 0xa4}, + {0x26, 0x4c, 0x03}, + {0x26, 0x4d, 0xe8}, + {0x26, 0x4e, 0x64}, + {0x26, 0x4f, 0x58}, + {0x26, 0x50, 0x00}, + {0x26, 0x51, 0x2f}, + {0x26, 0x52, 0x37}, + {0x26, 0x53, 0x4f}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_left_pc[TAS5805M_EQ_REG_PER_STEP] = { + {0x24, 0x18, 0x08}, // Biquad - BQ1 Left - Filter: Equalizer (Q Factor) Frequency: 20 Hz Gain: 12dB QVal: 2 Bandwidth: 1000 Hz + {0x24, 0x19, 0x01}, + {0x24, 0x1a, 0xff}, + {0x24, 0x1b, 0x4e}, + {0x24, 0x1c, 0xf0}, + {0x24, 0x1d, 0x01}, + {0x24, 0x1e, 0x57}, + {0x24, 0x1f, 0xef}, + {0x24, 0x20, 0x07}, + {0x24, 0x21, 0xfc}, + {0x24, 0x22, 0xa9}, + {0x24, 0x23, 0xaa}, + {0x24, 0x24, 0x0f}, + {0x24, 0x25, 0xfe}, + {0x24, 0x26, 0xa8}, + {0x24, 0x27, 0x11}, + {0x24, 0x28, 0xf8}, + {0x24, 0x29, 0x01}, + {0x24, 0x2a, 0x57}, + {0x24, 0x2b, 0x09}, + {0x24, 0x2c, 0x08}, // Biquad - BQ2 Left - Filter: Equalizer (Q Factor) Frequency: 31.5 Hz Gain: 12dB QVal: 2 Bandwidth: 1000 Hz + {0x24, 0x2d, 0x03}, + {0x24, 0x2e, 0x25}, + {0x24, 0x2f, 0x27}, + {0x24, 0x30, 0xf0}, + {0x24, 0x31, 0x02}, + {0x24, 0x32, 0x1e}, + {0x24, 0x33, 0x67}, + {0x24, 0x34, 0x07}, + {0x24, 0x35, 0xfa}, + {0x24, 0x36, 0xbe}, + {0x24, 0x37, 0xac}, + {0x24, 0x38, 0x0f}, + {0x24, 0x39, 0xfd}, + {0x24, 0x3a, 0xe1}, + {0x24, 0x3b, 0x99}, + {0x24, 0x3c, 0xf8}, + {0x24, 0x3d, 0x02}, + {0x24, 0x3e, 0x1c}, + {0x24, 0x3f, 0x2d}, + {0x24, 0x40, 0x08}, // Biquad - BQ3 Left - Filter: Equalizer (Q Factor) Frequency: 50 Hz Gain: 12dB QVal: 1.5 Bandwidth: 1000 Hz + {0x24, 0x41, 0x06}, + {0x24, 0x42, 0xa7}, + {0x24, 0x43, 0x0c}, + {0x24, 0x44, 0xf0}, + {0x24, 0x45, 0x04}, + {0x24, 0x46, 0x7c}, + {0x24, 0x47, 0x2f}, + {0x24, 0x48, 0x07}, + {0x24, 0x49, 0xf4}, + {0x24, 0x4a, 0xe2}, + {0x24, 0x4b, 0x62}, + {0x24, 0x4c, 0x0f}, + {0x24, 0x4d, 0xfb}, + {0x24, 0x4e, 0x83}, + {0x24, 0x4f, 0xd1}, + {0x24, 0x50, 0xf8}, + {0x24, 0x51, 0x04}, + {0x24, 0x52, 0x76}, + {0x24, 0x53, 0x93}, + {0x24, 0x54, 0x08}, // Biquad - BQ4 Left - Filter: Equalizer (Q Factor) Frequency: 80 Hz Gain: 12dB QVal: 1.5 Bandwidth: 1000 Hz + {0x24, 0x55, 0x0a}, + {0x24, 0x56, 0xa3}, + {0x24, 0x57, 0x18}, + {0x24, 0x58, 0xf0}, + {0x24, 0x59, 0x07}, + {0x24, 0x5a, 0x31}, + {0x24, 0x5b, 0x45}, + {0x24, 0x5c, 0x07}, + {0x24, 0x5d, 0xee}, + {0x24, 0x5e, 0x39}, + {0x24, 0x5f, 0xfc}, + {0x24, 0x60, 0x0f}, + {0x24, 0x61, 0xf8}, + {0x24, 0x62, 0xce}, + {0x24, 0x63, 0xbb}, + {0x24, 0x64, 0xf8}, + {0x24, 0x65, 0x07}, + {0x24, 0x66, 0x22}, + {0x24, 0x67, 0xec}, + {0x24, 0x68, 0x08}, // Biquad - BQ5 Left - Filter: Equalizer (Q Factor) Frequency: 125 Hz Gain: 12dB QVal: 1 Bandwidth: 1000 Hz + {0x24, 0x69, 0x18}, + {0x24, 0x6a, 0xdf}, + {0x24, 0x6b, 0x57}, + {0x24, 0x6c, 0xf0}, + {0x24, 0x6d, 0x10}, + {0x24, 0x6e, 0xd2}, + {0x24, 0x6f, 0xcc}, + {0x24, 0x70, 0x07}, + {0x24, 0x71, 0xd6}, + {0x24, 0x72, 0x70}, + {0x24, 0x73, 0xd0}, + {0x24, 0x74, 0x0f}, + {0x24, 0x75, 0xef}, + {0x24, 0x76, 0x2d}, + {0x24, 0x77, 0x34}, + {0x24, 0x78, 0xf8}, + {0x24, 0x79, 0x10}, + {0x24, 0x7a, 0xaf}, + {0x24, 0x7b, 0xd9}, + {0x24, 0x7c, 0x08}, // Biquad - BQ6 Left - Filter: Equalizer (Q Factor) Frequency: 200 Hz Gain: 12dB QVal: 1 Bandwidth: 1000 Hz + {0x24, 0x7d, 0x27}, + {0x24, 0x7e, 0xb2}, + {0x24, 0x7f, 0xe7}, + {0x25, 0x08, 0xf0}, + {0x25, 0x09, 0x1a}, + {0x25, 0x0a, 0xfb}, + {0x25, 0x0b, 0x8a}, + {0x25, 0x0c, 0x07}, + {0x25, 0x0d, 0xbd}, + {0x25, 0x0e, 0xaa}, + {0x25, 0x0f, 0xcf}, + {0x25, 0x10, 0x0f}, + {0x25, 0x11, 0xe5}, + {0x25, 0x12, 0x04}, + {0x25, 0x13, 0x76}, + {0x25, 0x14, 0xf8}, + {0x25, 0x15, 0x1a}, + {0x25, 0x16, 0xa2}, + {0x25, 0x17, 0x4a}, + {0x25, 0x18, 0x08}, // Biquad - BQ7 Left - Filter: Equalizer (Q Factor) Frequency: 315 Hz Gain: 12dB QVal: 0.9 Bandwidth: 1000 Hz + {0x25, 0x19, 0x45}, + {0x25, 0x1a, 0x22}, + {0x25, 0x1b, 0xc4}, + {0x25, 0x1c, 0xf0}, + {0x25, 0x1d, 0x2f}, + {0x25, 0x1e, 0x3e}, + {0x25, 0x1f, 0x6a}, + {0x25, 0x20, 0x07}, + {0x25, 0x21, 0x8c}, + {0x25, 0x22, 0x7b}, + {0x25, 0x23, 0x23}, + {0x25, 0x24, 0x0f}, + {0x25, 0x25, 0xd0}, + {0x25, 0x26, 0xc1}, + {0x25, 0x27, 0x96}, + {0x25, 0x28, 0xf8}, + {0x25, 0x29, 0x2e}, + {0x25, 0x2a, 0x62}, + {0x25, 0x2b, 0x19}, + {0x25, 0x2c, 0x08}, // Biquad - BQ8 Left - Filter: Equalizer (Q Factor) Frequency: 500 Hz Gain: 12dB QVal: 0.9 Bandwidth: 1000 Hz + {0x25, 0x2d, 0x6d}, + {0x25, 0x2e, 0x03}, + {0x25, 0x2f, 0xad}, + {0x25, 0x30, 0xf0}, + {0x25, 0x31, 0x4b}, + {0x25, 0x32, 0x4a}, + {0x25, 0x33, 0xa6}, + {0x25, 0x34, 0x07}, + {0x25, 0x35, 0x49}, + {0x25, 0x36, 0xd9}, + {0x25, 0x37, 0x12}, + {0x25, 0x38, 0x0f}, + {0x25, 0x39, 0xb4}, + {0x25, 0x3a, 0xb5}, + {0x25, 0x3b, 0x5a}, + {0x25, 0x3c, 0xf8}, + {0x25, 0x3d, 0x49}, + {0x25, 0x3e, 0x23}, + {0x25, 0x3f, 0x40}, + {0x25, 0x40, 0x08}, // Biquad - BQ9 Left - Filter: Equalizer (Q Factor) Frequency: 800 Hz Gain: 12dB QVal: 0.8 Bandwidth: 1000 Hz + {0x25, 0x41, 0xc1}, + {0x25, 0x42, 0x76}, + {0x25, 0x43, 0x5a}, + {0x25, 0x44, 0xf0}, + {0x25, 0x45, 0x87}, + {0x25, 0x46, 0x3a}, + {0x25, 0x47, 0xb6}, + {0x25, 0x48, 0x06}, + {0x25, 0x49, 0xbc}, + {0x25, 0x4a, 0xbe}, + {0x25, 0x4b, 0x70}, + {0x25, 0x4c, 0x0f}, + {0x25, 0x4d, 0x78}, + {0x25, 0x4e, 0xc5}, + {0x25, 0x4f, 0x4a}, + {0x25, 0x50, 0xf8}, + {0x25, 0x51, 0x81}, + {0x25, 0x52, 0xcb}, + {0x25, 0x53, 0x36}, + {0x25, 0x54, 0x09}, // Biquad - BQ10 Left - Filter: Equalizer (Q Factor) Frequency: 1250 Hz Gain: 12dB QVal: 0.8 Bandwidth: 1000 Hz + {0x25, 0x55, 0x28}, + {0x25, 0x56, 0xfd}, + {0x25, 0x57, 0xbb}, + {0x25, 0x58, 0xf0}, + {0x25, 0x59, 0xd4}, + {0x25, 0x5a, 0x48}, + {0x25, 0x5b, 0xf3}, + {0x25, 0x5c, 0x06}, + {0x25, 0x5d, 0x0f}, + {0x25, 0x5e, 0xc1}, + {0x25, 0x5f, 0xf2}, + {0x25, 0x60, 0x0f}, + {0x25, 0x61, 0x2b}, + {0x25, 0x62, 0xb7}, + {0x25, 0x63, 0x0d}, + {0x25, 0x64, 0xf8}, + {0x25, 0x65, 0xc7}, + {0x25, 0x66, 0x40}, + {0x25, 0x67, 0x52}, + {0x25, 0x68, 0x0a}, // Biquad - BQ11 Left - Filter: Equalizer (Q Factor) Frequency: 2000 Hz Gain: 12dB QVal: 0.7 Bandwidth: 1000 Hz + {0x25, 0x69, 0x0a}, + {0x25, 0x6a, 0x07}, + {0x25, 0x6b, 0x50}, + {0x25, 0x6c, 0xf1}, + {0x25, 0x6d, 0x7e}, + {0x25, 0x6e, 0x46}, + {0x25, 0x6f, 0x3e}, + {0x25, 0x70, 0x04}, + {0x25, 0x71, 0x97}, + {0x25, 0x72, 0xbe}, + {0x25, 0x73, 0x1e}, + {0x25, 0x74, 0x0e}, + {0x25, 0x75, 0x81}, + {0x25, 0x76, 0xb9}, + {0x25, 0x77, 0xc2}, + {0x25, 0x78, 0xf9}, + {0x25, 0x79, 0x5e}, + {0x25, 0x7a, 0x3a}, + {0x25, 0x7b, 0x92}, + {0x25, 0x7c, 0x0b}, // Biquad - BQ12 Left - Filter: Equalizer (Q Factor) Frequency: 3150 Hz Gain: 12dB QVal: 0.7 Bandwidth: 1000 Hz + {0x25, 0x7d, 0x0f}, + {0x25, 0x7e, 0xaa}, + {0x25, 0x7f, 0x6e}, + {0x26, 0x08, 0xf2}, + {0x26, 0x09, 0x59}, + {0x26, 0x0a, 0x5e}, + {0x26, 0x0b, 0x71}, + {0x26, 0x0c, 0x02}, + {0x26, 0x0d, 0xe2}, + {0x26, 0x0e, 0x92}, + {0x26, 0x0f, 0xbc}, + {0x26, 0x10, 0x0d}, + {0x26, 0x11, 0xa6}, + {0x26, 0x12, 0xa1}, + {0x26, 0x13, 0x8f}, + {0x26, 0x14, 0xfa}, + {0x26, 0x15, 0x0d}, + {0x26, 0x16, 0xc2}, + {0x26, 0x17, 0xd6}, + {0x26, 0x18, 0x0d}, // Biquad - BQ13 Left - Filter: Equalizer (Q Factor) Frequency: 5000 Hz Gain: 12dB QVal: 0.6 Bandwidth: 1000 Hz + {0x26, 0x19, 0x1c}, + {0x26, 0x1a, 0x30}, + {0x26, 0x1b, 0xda}, + {0x26, 0x1c, 0xf4}, + {0x26, 0x1d, 0x18}, + {0x26, 0x1e, 0x76}, + {0x26, 0x1f, 0x1f}, + {0x26, 0x20, 0xff}, + {0x26, 0x21, 0x76}, + {0x26, 0x22, 0x24}, + {0x26, 0x23, 0xf7}, + {0x26, 0x24, 0x0b}, + {0x26, 0x25, 0xe7}, + {0x26, 0x26, 0x89}, + {0x26, 0x27, 0xe1}, + {0x26, 0x28, 0xfb}, + {0x26, 0x29, 0x6d}, + {0x26, 0x2a, 0xaa}, + {0x26, 0x2b, 0x2f}, + {0x26, 0x2c, 0x0f}, // Biquad - BQ14 Left - Filter: Equalizer (Q Factor) Frequency: 8000 Hz Gain: 12dB QVal: 0.6 Bandwidth: 1000 Hz + {0x26, 0x2d, 0x3e}, + {0x26, 0x2e, 0xa9}, + {0x26, 0x2f, 0x86}, + {0x26, 0x30, 0xf6}, + {0x26, 0x31, 0x5a}, + {0x26, 0x32, 0x59}, + {0x26, 0x33, 0x40}, + {0x26, 0x34, 0xfb}, + {0x26, 0x35, 0xe5}, + {0x26, 0x36, 0x0b}, + {0x26, 0x37, 0xaa}, + {0x26, 0x38, 0x09}, + {0x26, 0x39, 0xa5}, + {0x26, 0x3a, 0xa6}, + {0x26, 0x3b, 0xc0}, + {0x26, 0x3c, 0xfc}, + {0x26, 0x3d, 0xdc}, + {0x26, 0x3e, 0x4a}, + {0x26, 0x3f, 0xd0}, + {0x26, 0x40, 0x14}, // Biquad - BQ15 Left - Filter: Equalizer (Q Factor) Frequency: 16000 Hz Gain: 12dB QVal: 0.5 Bandwidth: 1000 Hz + {0x26, 0x41, 0x32}, + {0x26, 0x42, 0xfe}, + {0x26, 0x43, 0xa1}, + {0x26, 0x44, 0xfc}, + {0x26, 0x45, 0x17}, + {0x26, 0x46, 0x9b}, + {0x26, 0x47, 0xa8}, + {0x26, 0x48, 0xf3}, + {0x26, 0x49, 0x9d}, + {0x26, 0x4a, 0xca}, + {0x26, 0x4b, 0x10}, + {0x26, 0x4c, 0x03}, + {0x26, 0x4d, 0xe8}, + {0x26, 0x4e, 0x64}, + {0x26, 0x4f, 0x58}, + {0x26, 0x50, 0x00}, + {0x26, 0x51, 0x2f}, + {0x26, 0x52, 0x37}, + {0x26, 0x53, 0x4f}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_left_pd[TAS5805M_EQ_REG_PER_STEP] = { + {0x24, 0x18, 0x08}, // Biquad - BQ1 Left - Filter: Equalizer (Q Factor) Frequency: 20 Hz Gain: 13dB QVal: 2 Bandwidth: 1000 Hz + {0x24, 0x19, 0x02}, + {0x24, 0x1a, 0x52}, + {0x24, 0x1b, 0x9f}, + {0x24, 0x1c, 0xf0}, + {0x24, 0x1d, 0x01}, + {0x24, 0x1e, 0x57}, + {0x24, 0x1f, 0xef}, + {0x24, 0x20, 0x07}, + {0x24, 0x21, 0xfc}, + {0x24, 0x22, 0x56}, + {0x24, 0x23, 0x59}, + {0x24, 0x24, 0x0f}, + {0x24, 0x25, 0xfe}, + {0x24, 0x26, 0xa8}, + {0x24, 0x27, 0x11}, + {0x24, 0x28, 0xf8}, + {0x24, 0x29, 0x01}, + {0x24, 0x2a, 0x57}, + {0x24, 0x2b, 0x09}, + {0x24, 0x2c, 0x08}, // Biquad - BQ2 Left - Filter: Equalizer (Q Factor) Frequency: 31.5 Hz Gain: 13dB QVal: 2 Bandwidth: 1000 Hz + {0x24, 0x2d, 0x03}, + {0x24, 0x2e, 0xa8}, + {0x24, 0x2f, 0x5a}, + {0x24, 0x30, 0xf0}, + {0x24, 0x31, 0x02}, + {0x24, 0x32, 0x1e}, + {0x24, 0x33, 0x67}, + {0x24, 0x34, 0x07}, + {0x24, 0x35, 0xfa}, + {0x24, 0x36, 0x3b}, + {0x24, 0x37, 0x79}, + {0x24, 0x38, 0x0f}, + {0x24, 0x39, 0xfd}, + {0x24, 0x3a, 0xe1}, + {0x24, 0x3b, 0x99}, + {0x24, 0x3c, 0xf8}, + {0x24, 0x3d, 0x02}, + {0x24, 0x3e, 0x1c}, + {0x24, 0x3f, 0x2d}, + {0x24, 0x40, 0x08}, // Biquad - BQ3 Left - Filter: Equalizer (Q Factor) Frequency: 50 Hz Gain: 13dB QVal: 1.5 Bandwidth: 1000 Hz + {0x24, 0x41, 0x07}, + {0x24, 0x42, 0xbc}, + {0x24, 0x43, 0x8e}, + {0x24, 0x44, 0xf0}, + {0x24, 0x45, 0x04}, + {0x24, 0x46, 0x7c}, + {0x24, 0x47, 0x2f}, + {0x24, 0x48, 0x07}, + {0x24, 0x49, 0xf3}, + {0x24, 0x4a, 0xcc}, + {0x24, 0x4b, 0xdf}, + {0x24, 0x4c, 0x0f}, + {0x24, 0x4d, 0xfb}, + {0x24, 0x4e, 0x83}, + {0x24, 0x4f, 0xd1}, + {0x24, 0x50, 0xf8}, + {0x24, 0x51, 0x04}, + {0x24, 0x52, 0x76}, + {0x24, 0x53, 0x93}, + {0x24, 0x54, 0x08}, // Biquad - BQ4 Left - Filter: Equalizer (Q Factor) Frequency: 80 Hz Gain: 13dB QVal: 1.5 Bandwidth: 1000 Hz + {0x24, 0x55, 0x0c}, + {0x24, 0x56, 0x5e}, + {0x24, 0x57, 0xd2}, + {0x24, 0x58, 0xf0}, + {0x24, 0x59, 0x07}, + {0x24, 0x5a, 0x31}, + {0x24, 0x5b, 0x45}, + {0x24, 0x5c, 0x07}, + {0x24, 0x5d, 0xec}, + {0x24, 0x5e, 0x7e}, + {0x24, 0x5f, 0x42}, + {0x24, 0x60, 0x0f}, + {0x24, 0x61, 0xf8}, + {0x24, 0x62, 0xce}, + {0x24, 0x63, 0xbb}, + {0x24, 0x64, 0xf8}, + {0x24, 0x65, 0x07}, + {0x24, 0x66, 0x22}, + {0x24, 0x67, 0xec}, + {0x24, 0x68, 0x08}, // Biquad - BQ5 Left - Filter: Equalizer (Q Factor) Frequency: 125 Hz Gain: 13dB QVal: 1 Bandwidth: 1000 Hz + {0x24, 0x69, 0x1c}, + {0x24, 0x6a, 0xec}, + {0x24, 0x6b, 0xe5}, + {0x24, 0x6c, 0xf0}, + {0x24, 0x6d, 0x10}, + {0x24, 0x6e, 0xd2}, + {0x24, 0x6f, 0xcc}, + {0x24, 0x70, 0x07}, + {0x24, 0x71, 0xd2}, + {0x24, 0x72, 0x63}, + {0x24, 0x73, 0x42}, + {0x24, 0x74, 0x0f}, + {0x24, 0x75, 0xef}, + {0x24, 0x76, 0x2d}, + {0x24, 0x77, 0x34}, + {0x24, 0x78, 0xf8}, + {0x24, 0x79, 0x10}, + {0x24, 0x7a, 0xaf}, + {0x24, 0x7b, 0xd9}, + {0x24, 0x7c, 0x08}, // Biquad - BQ6 Left - Filter: Equalizer (Q Factor) Frequency: 200 Hz Gain: 13dB QVal: 1 Bandwidth: 1000 Hz + {0x24, 0x7d, 0x2e}, + {0x24, 0x7e, 0x2a}, + {0x24, 0x7f, 0xf1}, + {0x25, 0x08, 0xf0}, + {0x25, 0x09, 0x1a}, + {0x25, 0x0a, 0xfb}, + {0x25, 0x0b, 0x8a}, + {0x25, 0x0c, 0x07}, + {0x25, 0x0d, 0xb7}, + {0x25, 0x0e, 0x32}, + {0x25, 0x0f, 0xc5}, + {0x25, 0x10, 0x0f}, + {0x25, 0x11, 0xe5}, + {0x25, 0x12, 0x04}, + {0x25, 0x13, 0x76}, + {0x25, 0x14, 0xf8}, + {0x25, 0x15, 0x1a}, + {0x25, 0x16, 0xa2}, + {0x25, 0x17, 0x4a}, + {0x25, 0x18, 0x08}, // Biquad - BQ7 Left - Filter: Equalizer (Q Factor) Frequency: 315 Hz Gain: 13dB QVal: 0.9 Bandwidth: 1000 Hz + {0x25, 0x19, 0x50}, + {0x25, 0x1a, 0x66}, + {0x25, 0x1b, 0xc6}, + {0x25, 0x1c, 0xf0}, + {0x25, 0x1d, 0x2f}, + {0x25, 0x1e, 0x3e}, + {0x25, 0x1f, 0x6a}, + {0x25, 0x20, 0x07}, + {0x25, 0x21, 0x81}, + {0x25, 0x22, 0x37}, + {0x25, 0x23, 0x21}, + {0x25, 0x24, 0x0f}, + {0x25, 0x25, 0xd0}, + {0x25, 0x26, 0xc1}, + {0x25, 0x27, 0x96}, + {0x25, 0x28, 0xf8}, + {0x25, 0x29, 0x2e}, + {0x25, 0x2a, 0x62}, + {0x25, 0x2b, 0x19}, + {0x25, 0x2c, 0x08}, // Biquad - BQ8 Left - Filter: Equalizer (Q Factor) Frequency: 500 Hz Gain: 13dB QVal: 0.9 Bandwidth: 1000 Hz + {0x25, 0x2d, 0x7e}, + {0x25, 0x2e, 0xc7}, + {0x25, 0x2f, 0x38}, + {0x25, 0x30, 0xf0}, + {0x25, 0x31, 0x4b}, + {0x25, 0x32, 0x4a}, + {0x25, 0x33, 0xa6}, + {0x25, 0x34, 0x07}, + {0x25, 0x35, 0x38}, + {0x25, 0x36, 0x15}, + {0x25, 0x37, 0x87}, + {0x25, 0x38, 0x0f}, + {0x25, 0x39, 0xb4}, + {0x25, 0x3a, 0xb5}, + {0x25, 0x3b, 0x5a}, + {0x25, 0x3c, 0xf8}, + {0x25, 0x3d, 0x49}, + {0x25, 0x3e, 0x23}, + {0x25, 0x3f, 0x40}, + {0x25, 0x40, 0x08}, // Biquad - BQ9 Left - Filter: Equalizer (Q Factor) Frequency: 800 Hz Gain: 13dB QVal: 0.8 Bandwidth: 1000 Hz + {0x25, 0x41, 0xe0}, + {0x25, 0x42, 0xfc}, + {0x25, 0x43, 0xa5}, + {0x25, 0x44, 0xf0}, + {0x25, 0x45, 0x87}, + {0x25, 0x46, 0x3a}, + {0x25, 0x47, 0xb6}, + {0x25, 0x48, 0x06}, + {0x25, 0x49, 0x9d}, + {0x25, 0x4a, 0x38}, + {0x25, 0x4b, 0x25}, + {0x25, 0x4c, 0x0f}, + {0x25, 0x4d, 0x78}, + {0x25, 0x4e, 0xc5}, + {0x25, 0x4f, 0x4a}, + {0x25, 0x50, 0xf8}, + {0x25, 0x51, 0x81}, + {0x25, 0x52, 0xcb}, + {0x25, 0x53, 0x36}, + {0x25, 0x54, 0x09}, // Biquad - BQ10 Left - Filter: Equalizer (Q Factor) Frequency: 1250 Hz Gain: 13dB QVal: 0.8 Bandwidth: 1000 Hz + {0x25, 0x55, 0x59}, + {0x25, 0x56, 0x62}, + {0x25, 0x57, 0xbe}, + {0x25, 0x58, 0xf0}, + {0x25, 0x59, 0xd4}, + {0x25, 0x5a, 0x48}, + {0x25, 0x5b, 0xf3}, + {0x25, 0x5c, 0x05}, + {0x25, 0x5d, 0xdf}, + {0x25, 0x5e, 0x5c}, + {0x25, 0x5f, 0xf0}, + {0x25, 0x60, 0x0f}, + {0x25, 0x61, 0x2b}, + {0x25, 0x62, 0xb7}, + {0x25, 0x63, 0x0d}, + {0x25, 0x64, 0xf8}, + {0x25, 0x65, 0xc7}, + {0x25, 0x66, 0x40}, + {0x25, 0x67, 0x52}, + {0x25, 0x68, 0x0a}, // Biquad - BQ11 Left - Filter: Equalizer (Q Factor) Frequency: 2000 Hz Gain: 13dB QVal: 0.7 Bandwidth: 1000 Hz + {0x25, 0x69, 0x5f}, + {0x25, 0x6a, 0x17}, + {0x25, 0x6b, 0xc6}, + {0x25, 0x6c, 0xf1}, + {0x25, 0x6d, 0x7e}, + {0x25, 0x6e, 0x46}, + {0x25, 0x6f, 0x3e}, + {0x25, 0x70, 0x04}, + {0x25, 0x71, 0x42}, + {0x25, 0x72, 0xad}, + {0x25, 0x73, 0xa7}, + {0x25, 0x74, 0x0e}, + {0x25, 0x75, 0x81}, + {0x25, 0x76, 0xb9}, + {0x25, 0x77, 0xc2}, + {0x25, 0x78, 0xf9}, + {0x25, 0x79, 0x5e}, + {0x25, 0x7a, 0x3a}, + {0x25, 0x7b, 0x92}, + {0x25, 0x7c, 0x0b}, // Biquad - BQ12 Left - Filter: Equalizer (Q Factor) Frequency: 3150 Hz Gain: 13dB QVal: 0.7 Bandwidth: 1000 Hz + {0x25, 0x7d, 0x8f}, + {0x25, 0x7e, 0x5d}, + {0x25, 0x7f, 0x1b}, + {0x26, 0x08, 0xf2}, + {0x26, 0x09, 0x59}, + {0x26, 0x0a, 0x5e}, + {0x26, 0x0b, 0x71}, + {0x26, 0x0c, 0x02}, + {0x26, 0x0d, 0x62}, + {0x26, 0x0e, 0xe0}, + {0x26, 0x0f, 0x0f}, + {0x26, 0x10, 0x0d}, + {0x26, 0x11, 0xa6}, + {0x26, 0x12, 0xa1}, + {0x26, 0x13, 0x8f}, + {0x26, 0x14, 0xfa}, + {0x26, 0x15, 0x0d}, + {0x26, 0x16, 0xc2}, + {0x26, 0x17, 0xd6}, + {0x26, 0x18, 0x0d}, // Biquad - BQ13 Left - Filter: Equalizer (Q Factor) Frequency: 5000 Hz Gain: 13dB QVal: 0.6 Bandwidth: 1000 Hz + {0x26, 0x19, 0xf1}, + {0x26, 0x1a, 0x5c}, + {0x26, 0x1b, 0x22}, + {0x26, 0x1c, 0xf4}, + {0x26, 0x1d, 0x18}, + {0x26, 0x1e, 0x76}, + {0x26, 0x1f, 0x1f}, + {0x26, 0x20, 0xfe}, + {0x26, 0x21, 0xa0}, + {0x26, 0x22, 0xf9}, + {0x26, 0x23, 0xaf}, + {0x26, 0x24, 0x0b}, + {0x26, 0x25, 0xe7}, + {0x26, 0x26, 0x89}, + {0x26, 0x27, 0xe1}, + {0x26, 0x28, 0xfb}, + {0x26, 0x29, 0x6d}, + {0x26, 0x2a, 0xaa}, + {0x26, 0x2b, 0x2f}, + {0x26, 0x2c, 0x10}, // Biquad - BQ14 Left - Filter: Equalizer (Q Factor) Frequency: 8000 Hz Gain: 13dB QVal: 0.6 Bandwidth: 1000 Hz + {0x26, 0x2d, 0x6c}, + {0x26, 0x2e, 0xe0}, + {0x26, 0x2f, 0xe7}, + {0x26, 0x30, 0xf6}, + {0x26, 0x31, 0x5a}, + {0x26, 0x32, 0x59}, + {0x26, 0x33, 0x40}, + {0x26, 0x34, 0xfa}, + {0x26, 0x35, 0xb6}, + {0x26, 0x36, 0xd4}, + {0x26, 0x37, 0x49}, + {0x26, 0x38, 0x09}, + {0x26, 0x39, 0xa5}, + {0x26, 0x3a, 0xa6}, + {0x26, 0x3b, 0xc0}, + {0x26, 0x3c, 0xfc}, + {0x26, 0x3d, 0xdc}, + {0x26, 0x3e, 0x4a}, + {0x26, 0x3f, 0xd0}, + {0x26, 0x40, 0x16}, // Biquad - BQ15 Left - Filter: Equalizer (Q Factor) Frequency: 16000 Hz Gain: 13dB QVal: 0.5 Bandwidth: 1000 Hz + {0x26, 0x41, 0x2f}, + {0x26, 0x42, 0xe2}, + {0x26, 0x43, 0x98}, + {0x26, 0x44, 0xfc}, + {0x26, 0x45, 0x17}, + {0x26, 0x46, 0x9b}, + {0x26, 0x47, 0xa8}, + {0x26, 0x48, 0xf1}, + {0x26, 0x49, 0xa0}, + {0x26, 0x4a, 0xe6}, + {0x26, 0x4b, 0x19}, + {0x26, 0x4c, 0x03}, + {0x26, 0x4d, 0xe8}, + {0x26, 0x4e, 0x64}, + {0x26, 0x4f, 0x58}, + {0x26, 0x50, 0x00}, + {0x26, 0x51, 0x2f}, + {0x26, 0x52, 0x37}, + {0x26, 0x53, 0x4f}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_left_pe[TAS5805M_EQ_REG_PER_STEP] = { + {0x24, 0x18, 0x08}, // Biquad - BQ1 Left - Filter: Equalizer (Q Factor) Frequency: 20 Hz Gain: 14dB QVal: 2 Bandwidth: 1000 Hz + {0x24, 0x19, 0x02}, + {0x24, 0x1a, 0xb0}, + {0x24, 0x1b, 0x1a}, + {0x24, 0x1c, 0xf0}, + {0x24, 0x1d, 0x01}, + {0x24, 0x1e, 0x57}, + {0x24, 0x1f, 0xef}, + {0x24, 0x20, 0x07}, + {0x24, 0x21, 0xfb}, + {0x24, 0x22, 0xf8}, + {0x24, 0x23, 0xdd}, + {0x24, 0x24, 0x0f}, + {0x24, 0x25, 0xfe}, + {0x24, 0x26, 0xa8}, + {0x24, 0x27, 0x11}, + {0x24, 0x28, 0xf8}, + {0x24, 0x29, 0x01}, + {0x24, 0x2a, 0x57}, + {0x24, 0x2b, 0x09}, + {0x24, 0x2c, 0x08}, // Biquad - BQ2 Left - Filter: Equalizer (Q Factor) Frequency: 31.5 Hz Gain: 14dB QVal: 2 Bandwidth: 1000 Hz + {0x24, 0x2d, 0x04}, + {0x24, 0x2e, 0x3b}, + {0x24, 0x2f, 0x8f}, + {0x24, 0x30, 0xf0}, + {0x24, 0x31, 0x02}, + {0x24, 0x32, 0x1e}, + {0x24, 0x33, 0x67}, + {0x24, 0x34, 0x07}, + {0x24, 0x35, 0xf9}, + {0x24, 0x36, 0xa8}, + {0x24, 0x37, 0x44}, + {0x24, 0x38, 0x0f}, + {0x24, 0x39, 0xfd}, + {0x24, 0x3a, 0xe1}, + {0x24, 0x3b, 0x99}, + {0x24, 0x3c, 0xf8}, + {0x24, 0x3d, 0x02}, + {0x24, 0x3e, 0x1c}, + {0x24, 0x3f, 0x2d}, + {0x24, 0x40, 0x08}, // Biquad - BQ3 Left - Filter: Equalizer (Q Factor) Frequency: 50 Hz Gain: 14dB QVal: 1.5 Bandwidth: 1000 Hz + {0x24, 0x41, 0x08}, + {0x24, 0x42, 0xf3}, + {0x24, 0x43, 0xed}, + {0x24, 0x44, 0xf0}, + {0x24, 0x45, 0x04}, + {0x24, 0x46, 0x7c}, + {0x24, 0x47, 0x2f}, + {0x24, 0x48, 0x07}, + {0x24, 0x49, 0xf2}, + {0x24, 0x4a, 0x95}, + {0x24, 0x4b, 0x80}, + {0x24, 0x4c, 0x0f}, + {0x24, 0x4d, 0xfb}, + {0x24, 0x4e, 0x83}, + {0x24, 0x4f, 0xd1}, + {0x24, 0x50, 0xf8}, + {0x24, 0x51, 0x04}, + {0x24, 0x52, 0x76}, + {0x24, 0x53, 0x93}, + {0x24, 0x54, 0x08}, // Biquad - BQ4 Left - Filter: Equalizer (Q Factor) Frequency: 80 Hz Gain: 14dB QVal: 1.5 Bandwidth: 1000 Hz + {0x24, 0x55, 0x0e}, + {0x24, 0x56, 0x50}, + {0x24, 0x57, 0xb0}, + {0x24, 0x58, 0xf0}, + {0x24, 0x59, 0x07}, + {0x24, 0x5a, 0x31}, + {0x24, 0x5b, 0x45}, + {0x24, 0x5c, 0x07}, + {0x24, 0x5d, 0xea}, + {0x24, 0x5e, 0x8c}, + {0x24, 0x5f, 0x64}, + {0x24, 0x60, 0x0f}, + {0x24, 0x61, 0xf8}, + {0x24, 0x62, 0xce}, + {0x24, 0x63, 0xbb}, + {0x24, 0x64, 0xf8}, + {0x24, 0x65, 0x07}, + {0x24, 0x66, 0x22}, + {0x24, 0x67, 0xec}, + {0x24, 0x68, 0x08}, // Biquad - BQ5 Left - Filter: Equalizer (Q Factor) Frequency: 125 Hz Gain: 14dB QVal: 1 Bandwidth: 1000 Hz + {0x24, 0x69, 0x21}, + {0x24, 0x6a, 0x79}, + {0x24, 0x6b, 0x0d}, + {0x24, 0x6c, 0xf0}, + {0x24, 0x6d, 0x10}, + {0x24, 0x6e, 0xd2}, + {0x24, 0x6f, 0xcc}, + {0x24, 0x70, 0x07}, + {0x24, 0x71, 0xcd}, + {0x24, 0x72, 0xd7}, + {0x24, 0x73, 0x1a}, + {0x24, 0x74, 0x0f}, + {0x24, 0x75, 0xef}, + {0x24, 0x76, 0x2d}, + {0x24, 0x77, 0x34}, + {0x24, 0x78, 0xf8}, + {0x24, 0x79, 0x10}, + {0x24, 0x7a, 0xaf}, + {0x24, 0x7b, 0xd9}, + {0x24, 0x7c, 0x08}, // Biquad - BQ6 Left - Filter: Equalizer (Q Factor) Frequency: 200 Hz Gain: 14dB QVal: 1 Bandwidth: 1000 Hz + {0x24, 0x7d, 0x35}, + {0x24, 0x7e, 0x6d}, + {0x24, 0x7f, 0x0d}, + {0x25, 0x08, 0xf0}, + {0x25, 0x09, 0x1a}, + {0x25, 0x0a, 0xfb}, + {0x25, 0x0b, 0x8a}, + {0x25, 0x0c, 0x07}, + {0x25, 0x0d, 0xaf}, + {0x25, 0x0e, 0xf0}, + {0x25, 0x0f, 0xa9}, + {0x25, 0x10, 0x0f}, + {0x25, 0x11, 0xe5}, + {0x25, 0x12, 0x04}, + {0x25, 0x13, 0x76}, + {0x25, 0x14, 0xf8}, + {0x25, 0x15, 0x1a}, + {0x25, 0x16, 0xa2}, + {0x25, 0x17, 0x4a}, + {0x25, 0x18, 0x08}, // Biquad - BQ7 Left - Filter: Equalizer (Q Factor) Frequency: 315 Hz Gain: 14dB QVal: 0.9 Bandwidth: 1000 Hz + {0x25, 0x19, 0x5d}, + {0x25, 0x1a, 0x0a}, + {0x25, 0x1b, 0xae}, + {0x25, 0x1c, 0xf0}, + {0x25, 0x1d, 0x2f}, + {0x25, 0x1e, 0x3e}, + {0x25, 0x1f, 0x6a}, + {0x25, 0x20, 0x07}, + {0x25, 0x21, 0x74}, + {0x25, 0x22, 0x93}, + {0x25, 0x23, 0x39}, + {0x25, 0x24, 0x0f}, + {0x25, 0x25, 0xd0}, + {0x25, 0x26, 0xc1}, + {0x25, 0x27, 0x96}, + {0x25, 0x28, 0xf8}, + {0x25, 0x29, 0x2e}, + {0x25, 0x2a, 0x62}, + {0x25, 0x2b, 0x19}, + {0x25, 0x2c, 0x08}, // Biquad - BQ8 Left - Filter: Equalizer (Q Factor) Frequency: 500 Hz Gain: 14dB QVal: 0.9 Bandwidth: 1000 Hz + {0x25, 0x2d, 0x92}, + {0x25, 0x2e, 0xb5}, + {0x25, 0x2f, 0xa6}, + {0x25, 0x30, 0xf0}, + {0x25, 0x31, 0x4b}, + {0x25, 0x32, 0x4a}, + {0x25, 0x33, 0xa6}, + {0x25, 0x34, 0x07}, + {0x25, 0x35, 0x24}, + {0x25, 0x36, 0x27}, + {0x25, 0x37, 0x1a}, + {0x25, 0x38, 0x0f}, + {0x25, 0x39, 0xb4}, + {0x25, 0x3a, 0xb5}, + {0x25, 0x3b, 0x5a}, + {0x25, 0x3c, 0xf8}, + {0x25, 0x3d, 0x49}, + {0x25, 0x3e, 0x23}, + {0x25, 0x3f, 0x40}, + {0x25, 0x40, 0x09}, // Biquad - BQ9 Left - Filter: Equalizer (Q Factor) Frequency: 800 Hz Gain: 14dB QVal: 0.8 Bandwidth: 1000 Hz + {0x25, 0x41, 0x04}, + {0x25, 0x42, 0x5b}, + {0x25, 0x43, 0xaa}, + {0x25, 0x44, 0xf0}, + {0x25, 0x45, 0x87}, + {0x25, 0x46, 0x3a}, + {0x25, 0x47, 0xb6}, + {0x25, 0x48, 0x06}, + {0x25, 0x49, 0x79}, + {0x25, 0x4a, 0xd9}, + {0x25, 0x4b, 0x20}, + {0x25, 0x4c, 0x0f}, + {0x25, 0x4d, 0x78}, + {0x25, 0x4e, 0xc5}, + {0x25, 0x4f, 0x4a}, + {0x25, 0x50, 0xf8}, + {0x25, 0x51, 0x81}, + {0x25, 0x52, 0xcb}, + {0x25, 0x53, 0x36}, + {0x25, 0x54, 0x09}, // Biquad - BQ10 Left - Filter: Equalizer (Q Factor) Frequency: 1250 Hz Gain: 14dB QVal: 0.8 Bandwidth: 1000 Hz + {0x25, 0x55, 0x8f}, + {0x25, 0x56, 0xaf}, + {0x25, 0x57, 0x70}, + {0x25, 0x58, 0xf0}, + {0x25, 0x59, 0xd4}, + {0x25, 0x5a, 0x48}, + {0x25, 0x5b, 0xf3}, + {0x25, 0x5c, 0x05}, + {0x25, 0x5d, 0xa9}, + {0x25, 0x5e, 0x10}, + {0x25, 0x5f, 0x3e}, + {0x25, 0x60, 0x0f}, + {0x25, 0x61, 0x2b}, + {0x25, 0x62, 0xb7}, + {0x25, 0x63, 0x0d}, + {0x25, 0x64, 0xf8}, + {0x25, 0x65, 0xc7}, + {0x25, 0x66, 0x40}, + {0x25, 0x67, 0x52}, + {0x25, 0x68, 0x0a}, // Biquad - BQ11 Left - Filter: Equalizer (Q Factor) Frequency: 2000 Hz Gain: 14dB QVal: 0.7 Bandwidth: 1000 Hz + {0x25, 0x69, 0xbe}, + {0x25, 0x6a, 0x89}, + {0x25, 0x6b, 0x5e}, + {0x25, 0x6c, 0xf1}, + {0x25, 0x6d, 0x7e}, + {0x25, 0x6e, 0x46}, + {0x25, 0x6f, 0x3e}, + {0x25, 0x70, 0x03}, + {0x25, 0x71, 0xe3}, + {0x25, 0x72, 0x3c}, + {0x25, 0x73, 0x10}, + {0x25, 0x74, 0x0e}, + {0x25, 0x75, 0x81}, + {0x25, 0x76, 0xb9}, + {0x25, 0x77, 0xc2}, + {0x25, 0x78, 0xf9}, + {0x25, 0x79, 0x5e}, + {0x25, 0x7a, 0x3a}, + {0x25, 0x7b, 0x92}, + {0x25, 0x7c, 0x0c}, // Biquad - BQ12 Left - Filter: Equalizer (Q Factor) Frequency: 3150 Hz Gain: 14dB QVal: 0.7 Bandwidth: 1000 Hz + {0x25, 0x7d, 0x1e}, + {0x25, 0x7e, 0xa4}, + {0x25, 0x7f, 0xa6}, + {0x26, 0x08, 0xf2}, + {0x26, 0x09, 0x59}, + {0x26, 0x0a, 0x5e}, + {0x26, 0x0b, 0x71}, + {0x26, 0x0c, 0x01}, + {0x26, 0x0d, 0xd3}, + {0x26, 0x0e, 0x98}, + {0x26, 0x0f, 0x83}, + {0x26, 0x10, 0x0d}, + {0x26, 0x11, 0xa6}, + {0x26, 0x12, 0xa1}, + {0x26, 0x13, 0x8f}, + {0x26, 0x14, 0xfa}, + {0x26, 0x15, 0x0d}, + {0x26, 0x16, 0xc2}, + {0x26, 0x17, 0xd6}, + {0x26, 0x18, 0x0e}, // Biquad - BQ13 Left - Filter: Equalizer (Q Factor) Frequency: 5000 Hz Gain: 14dB QVal: 0.6 Bandwidth: 1000 Hz + {0x26, 0x19, 0xe0}, + {0x26, 0x1a, 0x8a}, + {0x26, 0x1b, 0x1e}, + {0x26, 0x1c, 0xf4}, + {0x26, 0x1d, 0x18}, + {0x26, 0x1e, 0x76}, + {0x26, 0x1f, 0x1f}, + {0x26, 0x20, 0xfd}, + {0x26, 0x21, 0xb1}, + {0x26, 0x22, 0xcb}, + {0x26, 0x23, 0xb2}, + {0x26, 0x24, 0x0b}, + {0x26, 0x25, 0xe7}, + {0x26, 0x26, 0x89}, + {0x26, 0x27, 0xe1}, + {0x26, 0x28, 0xfb}, + {0x26, 0x29, 0x6d}, + {0x26, 0x2a, 0xaa}, + {0x26, 0x2b, 0x2f}, + {0x26, 0x2c, 0x11}, // Biquad - BQ14 Left - Filter: Equalizer (Q Factor) Frequency: 8000 Hz Gain: 14dB QVal: 0.6 Bandwidth: 1000 Hz + {0x26, 0x2d, 0xbf}, + {0x26, 0x2e, 0xf8}, + {0x26, 0x2f, 0x87}, + {0x26, 0x30, 0xf6}, + {0x26, 0x31, 0x5a}, + {0x26, 0x32, 0x59}, + {0x26, 0x33, 0x40}, + {0x26, 0x34, 0xf9}, + {0x26, 0x35, 0x63}, + {0x26, 0x36, 0xbc}, + {0x26, 0x37, 0xa9}, + {0x26, 0x38, 0x09}, + {0x26, 0x39, 0xa5}, + {0x26, 0x3a, 0xa6}, + {0x26, 0x3b, 0xc0}, + {0x26, 0x3c, 0xfc}, + {0x26, 0x3d, 0xdc}, + {0x26, 0x3e, 0x4a}, + {0x26, 0x3f, 0xd0}, + {0x26, 0x40, 0x18}, // Biquad - BQ15 Left - Filter: Equalizer (Q Factor) Frequency: 16000 Hz Gain: 14dB QVal: 0.5 Bandwidth: 1000 Hz + {0x26, 0x41, 0x6a}, + {0x26, 0x42, 0xde}, + {0x26, 0x43, 0xa2}, + {0x26, 0x44, 0xfc}, + {0x26, 0x45, 0x17}, + {0x26, 0x46, 0x9b}, + {0x26, 0x47, 0xa8}, + {0x26, 0x48, 0xef}, + {0x26, 0x49, 0x65}, + {0x26, 0x4a, 0xea}, + {0x26, 0x4b, 0x0f}, + {0x26, 0x4c, 0x03}, + {0x26, 0x4d, 0xe8}, + {0x26, 0x4e, 0x64}, + {0x26, 0x4f, 0x58}, + {0x26, 0x50, 0x00}, + {0x26, 0x51, 0x2f}, + {0x26, 0x52, 0x37}, + {0x26, 0x53, 0x4f}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_left_pf[TAS5805M_EQ_REG_PER_STEP] = { + {0x24, 0x18, 0x08}, // Biquad - BQ1 Left - Filter: Equalizer (Q Factor) Frequency: 20 Hz Gain: 15dB QVal: 2 Bandwidth: 1000 Hz + {0x24, 0x19, 0x03}, + {0x24, 0x1a, 0x18}, + {0x24, 0x1b, 0xfe}, + {0x24, 0x1c, 0xf0}, + {0x24, 0x1d, 0x01}, + {0x24, 0x1e, 0x57}, + {0x24, 0x1f, 0xef}, + {0x24, 0x20, 0x07}, + {0x24, 0x21, 0xfb}, + {0x24, 0x22, 0x8f}, + {0x24, 0x23, 0xf9}, + {0x24, 0x24, 0x0f}, + {0x24, 0x25, 0xfe}, + {0x24, 0x26, 0xa8}, + {0x24, 0x27, 0x11}, + {0x24, 0x28, 0xf8}, + {0x24, 0x29, 0x01}, + {0x24, 0x2a, 0x57}, + {0x24, 0x2b, 0x09}, + {0x24, 0x2c, 0x08}, // Biquad - BQ2 Left - Filter: Equalizer (Q Factor) Frequency: 31.5 Hz Gain: 15dB QVal: 2 Bandwidth: 1000 Hz + {0x24, 0x2d, 0x04}, + {0x24, 0x2e, 0xe0}, + {0x24, 0x2f, 0xba}, + {0x24, 0x30, 0xf0}, + {0x24, 0x31, 0x02}, + {0x24, 0x32, 0x1e}, + {0x24, 0x33, 0x67}, + {0x24, 0x34, 0x07}, + {0x24, 0x35, 0xf9}, + {0x24, 0x36, 0x03}, + {0x24, 0x37, 0x18}, + {0x24, 0x38, 0x0f}, + {0x24, 0x39, 0xfd}, + {0x24, 0x3a, 0xe1}, + {0x24, 0x3b, 0x99}, + {0x24, 0x3c, 0xf8}, + {0x24, 0x3d, 0x02}, + {0x24, 0x3e, 0x1c}, + {0x24, 0x3f, 0x2d}, + {0x24, 0x40, 0x08}, // Biquad - BQ3 Left - Filter: Equalizer (Q Factor) Frequency: 50 Hz Gain: 15dB QVal: 1.5 Bandwidth: 1000 Hz + {0x24, 0x41, 0x0a}, + {0x24, 0x42, 0x51}, + {0x24, 0x43, 0x4b}, + {0x24, 0x44, 0xf0}, + {0x24, 0x45, 0x04}, + {0x24, 0x46, 0x7c}, + {0x24, 0x47, 0x2f}, + {0x24, 0x48, 0x07}, + {0x24, 0x49, 0xf1}, + {0x24, 0x4a, 0x38}, + {0x24, 0x4b, 0x22}, + {0x24, 0x4c, 0x0f}, + {0x24, 0x4d, 0xfb}, + {0x24, 0x4e, 0x83}, + {0x24, 0x4f, 0xd1}, + {0x24, 0x50, 0xf8}, + {0x24, 0x51, 0x04}, + {0x24, 0x52, 0x76}, + {0x24, 0x53, 0x93}, + {0x24, 0x54, 0x08}, // Biquad - BQ4 Left - Filter: Equalizer (Q Factor) Frequency: 80 Hz Gain: 15dB QVal: 1.5 Bandwidth: 1000 Hz + {0x24, 0x55, 0x10}, + {0x24, 0x56, 0x7f}, + {0x24, 0x57, 0x4f}, + {0x24, 0x58, 0xf0}, + {0x24, 0x59, 0x07}, + {0x24, 0x5a, 0x31}, + {0x24, 0x5b, 0x45}, + {0x24, 0x5c, 0x07}, + {0x24, 0x5d, 0xe8}, + {0x24, 0x5e, 0x5d}, + {0x24, 0x5f, 0xc5}, + {0x24, 0x60, 0x0f}, + {0x24, 0x61, 0xf8}, + {0x24, 0x62, 0xce}, + {0x24, 0x63, 0xbb}, + {0x24, 0x64, 0xf8}, + {0x24, 0x65, 0x07}, + {0x24, 0x66, 0x22}, + {0x24, 0x67, 0xec}, + {0x24, 0x68, 0x08}, // Biquad - BQ5 Left - Filter: Equalizer (Q Factor) Frequency: 125 Hz Gain: 15dB QVal: 1 Bandwidth: 1000 Hz + {0x24, 0x69, 0x26}, + {0x24, 0x6a, 0x93}, + {0x24, 0x6b, 0x42}, + {0x24, 0x6c, 0xf0}, + {0x24, 0x6d, 0x10}, + {0x24, 0x6e, 0xd2}, + {0x24, 0x6f, 0xcc}, + {0x24, 0x70, 0x07}, + {0x24, 0x71, 0xc8}, + {0x24, 0x72, 0xbc}, + {0x24, 0x73, 0xe6}, + {0x24, 0x74, 0x0f}, + {0x24, 0x75, 0xef}, + {0x24, 0x76, 0x2d}, + {0x24, 0x77, 0x34}, + {0x24, 0x78, 0xf8}, + {0x24, 0x79, 0x10}, + {0x24, 0x7a, 0xaf}, + {0x24, 0x7b, 0xd9}, + {0x24, 0x7c, 0x08}, // Biquad - BQ6 Left - Filter: Equalizer (Q Factor) Frequency: 200 Hz Gain: 15dB QVal: 1 Bandwidth: 1000 Hz + {0x24, 0x7d, 0x3d}, + {0x24, 0x7e, 0x91}, + {0x24, 0x7f, 0xe2}, + {0x25, 0x08, 0xf0}, + {0x25, 0x09, 0x1a}, + {0x25, 0x0a, 0xfb}, + {0x25, 0x0b, 0x8a}, + {0x25, 0x0c, 0x07}, + {0x25, 0x0d, 0xa7}, + {0x25, 0x0e, 0xcb}, + {0x25, 0x0f, 0xd4}, + {0x25, 0x10, 0x0f}, + {0x25, 0x11, 0xe5}, + {0x25, 0x12, 0x04}, + {0x25, 0x13, 0x76}, + {0x25, 0x14, 0xf8}, + {0x25, 0x15, 0x1a}, + {0x25, 0x16, 0xa2}, + {0x25, 0x17, 0x4a}, + {0x25, 0x18, 0x08}, // Biquad - BQ7 Left - Filter: Equalizer (Q Factor) Frequency: 315 Hz Gain: 15dB QVal: 0.9 Bandwidth: 1000 Hz + {0x25, 0x19, 0x6b}, + {0x25, 0x1a, 0x39}, + {0x25, 0x1b, 0x6d}, + {0x25, 0x1c, 0xf0}, + {0x25, 0x1d, 0x2f}, + {0x25, 0x1e, 0x3e}, + {0x25, 0x1f, 0x6a}, + {0x25, 0x20, 0x07}, + {0x25, 0x21, 0x66}, + {0x25, 0x22, 0x64}, + {0x25, 0x23, 0x7a}, + {0x25, 0x24, 0x0f}, + {0x25, 0x25, 0xd0}, + {0x25, 0x26, 0xc1}, + {0x25, 0x27, 0x96}, + {0x25, 0x28, 0xf8}, + {0x25, 0x29, 0x2e}, + {0x25, 0x2a, 0x62}, + {0x25, 0x2b, 0x19}, + {0x25, 0x2c, 0x08}, // Biquad - BQ8 Left - Filter: Equalizer (Q Factor) Frequency: 500 Hz Gain: 15dB QVal: 0.9 Bandwidth: 1000 Hz + {0x25, 0x2d, 0xa9}, + {0x25, 0x2e, 0x12}, + {0x25, 0x2f, 0xaa}, + {0x25, 0x30, 0xf0}, + {0x25, 0x31, 0x4b}, + {0x25, 0x32, 0x4a}, + {0x25, 0x33, 0xa6}, + {0x25, 0x34, 0x07}, + {0x25, 0x35, 0x0d}, + {0x25, 0x36, 0xca}, + {0x25, 0x37, 0x16}, + {0x25, 0x38, 0x0f}, + {0x25, 0x39, 0xb4}, + {0x25, 0x3a, 0xb5}, + {0x25, 0x3b, 0x5a}, + {0x25, 0x3c, 0xf8}, + {0x25, 0x3d, 0x49}, + {0x25, 0x3e, 0x23}, + {0x25, 0x3f, 0x40}, + {0x25, 0x40, 0x09}, // Biquad - BQ9 Left - Filter: Equalizer (Q Factor) Frequency: 800 Hz Gain: 15dB QVal: 0.8 Bandwidth: 1000 Hz + {0x25, 0x41, 0x2c}, + {0x25, 0x42, 0x0b}, + {0x25, 0x43, 0x91}, + {0x25, 0x44, 0xf0}, + {0x25, 0x45, 0x87}, + {0x25, 0x46, 0x3a}, + {0x25, 0x47, 0xb6}, + {0x25, 0x48, 0x06}, + {0x25, 0x49, 0x52}, + {0x25, 0x4a, 0x29}, + {0x25, 0x4b, 0x39}, + {0x25, 0x4c, 0x0f}, + {0x25, 0x4d, 0x78}, + {0x25, 0x4e, 0xc5}, + {0x25, 0x4f, 0x4a}, + {0x25, 0x50, 0xf8}, + {0x25, 0x51, 0x81}, + {0x25, 0x52, 0xcb}, + {0x25, 0x53, 0x36}, + {0x25, 0x54, 0x09}, // Biquad - BQ10 Left - Filter: Equalizer (Q Factor) Frequency: 1250 Hz Gain: 15dB QVal: 0.8 Bandwidth: 1000 Hz + {0x25, 0x55, 0xcc}, + {0x25, 0x56, 0x9c}, + {0x25, 0x57, 0x46}, + {0x25, 0x58, 0xf0}, + {0x25, 0x59, 0xd4}, + {0x25, 0x5a, 0x48}, + {0x25, 0x5b, 0xf3}, + {0x25, 0x5c, 0x05}, + {0x25, 0x5d, 0x6c}, + {0x25, 0x5e, 0x23}, + {0x25, 0x5f, 0x67}, + {0x25, 0x60, 0x0f}, + {0x25, 0x61, 0x2b}, + {0x25, 0x62, 0xb7}, + {0x25, 0x63, 0x0d}, + {0x25, 0x64, 0xf8}, + {0x25, 0x65, 0xc7}, + {0x25, 0x66, 0x40}, + {0x25, 0x67, 0x52}, + {0x25, 0x68, 0x0b}, // Biquad - BQ11 Left - Filter: Equalizer (Q Factor) Frequency: 2000 Hz Gain: 15dB QVal: 0.7 Bandwidth: 1000 Hz + {0x25, 0x69, 0x29}, + {0x25, 0x6a, 0xa0}, + {0x25, 0x6b, 0x4f}, + {0x25, 0x6c, 0xf1}, + {0x25, 0x6d, 0x7e}, + {0x25, 0x6e, 0x46}, + {0x25, 0x6f, 0x3e}, + {0x25, 0x70, 0x03}, + {0x25, 0x71, 0x78}, + {0x25, 0x72, 0x25}, + {0x25, 0x73, 0x1f}, + {0x25, 0x74, 0x0e}, + {0x25, 0x75, 0x81}, + {0x25, 0x76, 0xb9}, + {0x25, 0x77, 0xc2}, + {0x25, 0x78, 0xf9}, + {0x25, 0x79, 0x5e}, + {0x25, 0x7a, 0x3a}, + {0x25, 0x7b, 0x92}, + {0x25, 0x7c, 0x0c}, // Biquad - BQ12 Left - Filter: Equalizer (Q Factor) Frequency: 3150 Hz Gain: 15dB QVal: 0.7 Bandwidth: 1000 Hz + {0x25, 0x7d, 0xbf}, + {0x25, 0x7e, 0x67}, + {0x25, 0x7f, 0xc6}, + {0x26, 0x08, 0xf2}, + {0x26, 0x09, 0x59}, + {0x26, 0x0a, 0x5e}, + {0x26, 0x0b, 0x71}, + {0x26, 0x0c, 0x01}, + {0x26, 0x0d, 0x32}, + {0x26, 0x0e, 0xd5}, + {0x26, 0x0f, 0x63}, + {0x26, 0x10, 0x0d}, + {0x26, 0x11, 0xa6}, + {0x26, 0x12, 0xa1}, + {0x26, 0x13, 0x8f}, + {0x26, 0x14, 0xfa}, + {0x26, 0x15, 0x0d}, + {0x26, 0x16, 0xc2}, + {0x26, 0x17, 0xd6}, + {0x26, 0x18, 0x0f}, // Biquad - BQ13 Left - Filter: Equalizer (Q Factor) Frequency: 5000 Hz Gain: 15dB QVal: 0.6 Bandwidth: 1000 Hz + {0x26, 0x19, 0xec}, + {0x26, 0x1a, 0xe7}, + {0x26, 0x1b, 0x4b}, + {0x26, 0x1c, 0xf4}, + {0x26, 0x1d, 0x18}, + {0x26, 0x1e, 0x76}, + {0x26, 0x1f, 0x1f}, + {0x26, 0x20, 0xfc}, + {0x26, 0x21, 0xa5}, + {0x26, 0x22, 0x6e}, + {0x26, 0x23, 0x86}, + {0x26, 0x24, 0x0b}, + {0x26, 0x25, 0xe7}, + {0x26, 0x26, 0x89}, + {0x26, 0x27, 0xe1}, + {0x26, 0x28, 0xfb}, + {0x26, 0x29, 0x6d}, + {0x26, 0x2a, 0xaa}, + {0x26, 0x2b, 0x2f}, + {0x26, 0x2c, 0x13}, // Biquad - BQ14 Left - Filter: Equalizer (Q Factor) Frequency: 8000 Hz Gain: 15dB QVal: 0.6 Bandwidth: 1000 Hz + {0x26, 0x2d, 0x3c}, + {0x26, 0x2e, 0x70}, + {0x26, 0x2f, 0x49}, + {0x26, 0x30, 0xf6}, + {0x26, 0x31, 0x5a}, + {0x26, 0x32, 0x59}, + {0x26, 0x33, 0x40}, + {0x26, 0x34, 0xf7}, + {0x26, 0x35, 0xe7}, + {0x26, 0x36, 0x44}, + {0x26, 0x37, 0xe6}, + {0x26, 0x38, 0x09}, + {0x26, 0x39, 0xa5}, + {0x26, 0x3a, 0xa6}, + {0x26, 0x3b, 0xc0}, + {0x26, 0x3c, 0xfc}, + {0x26, 0x3d, 0xdc}, + {0x26, 0x3e, 0x4a}, + {0x26, 0x3f, 0xd0}, + {0x26, 0x40, 0x1a}, // Biquad - BQ15 Left - Filter: Equalizer (Q Factor) Frequency: 16000 Hz Gain: 15dB QVal: 0.5 Bandwidth: 1000 Hz + {0x26, 0x41, 0xeb}, + {0x26, 0x42, 0x86}, + {0x26, 0x43, 0x5b}, + {0x26, 0x44, 0xfc}, + {0x26, 0x45, 0x17}, + {0x26, 0x46, 0x9b}, + {0x26, 0x47, 0xa8}, + {0x26, 0x48, 0xec}, + {0x26, 0x49, 0xe5}, + {0x26, 0x4a, 0x42}, + {0x26, 0x4b, 0x56}, + {0x26, 0x4c, 0x03}, + {0x26, 0x4d, 0xe8}, + {0x26, 0x4e, 0x64}, + {0x26, 0x4f, 0x58}, + {0x26, 0x50, 0x00}, + {0x26, 0x51, 0x2f}, + {0x26, 0x52, 0x37}, + {0x26, 0x53, 0x4f}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_right_mf[TAS5805M_EQ_REG_PER_STEP] = { + {0x26, 0x54, 0x07}, // Biquad - BQ1 Right - Filter: Equalizer (Q Factor) Frequency: 20 Hz Gain: -15dB QVal: 2 Bandwidth: 1000 Hz + {0x26, 0x55, 0xfc}, + {0x26, 0x56, 0xe8}, + {0x26, 0x57, 0x34}, + {0x26, 0x58, 0xf0}, + {0x26, 0x59, 0x07}, + {0x26, 0x5a, 0x87}, + {0x26, 0x5b, 0x01}, + {0x26, 0x5c, 0x07}, + {0x26, 0x5d, 0xfb}, + {0x26, 0x5e, 0x91}, + {0x26, 0x5f, 0xb0}, + {0x26, 0x60, 0x0f}, + {0x26, 0x61, 0xf8}, + {0x26, 0x62, 0x78}, + {0x26, 0x63, 0xff}, + {0x26, 0x64, 0xf8}, + {0x26, 0x65, 0x07}, + {0x26, 0x66, 0x86}, + {0x26, 0x67, 0x1b}, + {0x26, 0x68, 0x07}, // Biquad - BQ2 Right - Filter: Equalizer (Q Factor) Frequency: 31.5 Hz Gain: -15dB QVal: 2 Bandwidth: 1000 Hz + {0x26, 0x69, 0xfb}, + {0x26, 0x6a, 0x22}, + {0x26, 0x6b, 0x3d}, + {0x26, 0x6c, 0xf0}, + {0x26, 0x6d, 0x0b}, + {0x26, 0x6e, 0xd8}, + {0x26, 0x6f, 0xa3}, + {0x26, 0x70, 0x07}, + {0x26, 0x71, 0xf9}, + {0x26, 0x72, 0x07}, + {0x26, 0x73, 0x59}, + {0x26, 0x74, 0x0f}, + {0x26, 0x75, 0xf4}, + {0x26, 0x76, 0x27}, + {0x26, 0x77, 0x5d}, + {0x26, 0x78, 0xf8}, + {0x26, 0x79, 0x0b}, + {0x26, 0x7a, 0xd6}, + {0x26, 0x7b, 0x6a}, + {0x26, 0x7c, 0x07}, // Biquad - BQ3 Right - Filter: Equalizer (Q Factor) Frequency: 50 Hz Gain: -15dB QVal: 1.5 Bandwidth: 1000 Hz + {0x26, 0x7d, 0xf5}, + {0x26, 0x7e, 0xbb}, + {0x26, 0x7f, 0xf2}, + {0x27, 0x08, 0xf0}, + {0x27, 0x09, 0x18}, + {0x27, 0x0a, 0xfe}, + {0x27, 0x0b, 0x88}, + {0x27, 0x0c, 0x07}, + {0x27, 0x0d, 0xf1}, + {0x27, 0x0e, 0x4b}, + {0x27, 0x0f, 0x1a}, + {0x27, 0x10, 0x0f}, + {0x27, 0x11, 0xe7}, + {0x27, 0x12, 0x01}, + {0x27, 0x13, 0x78}, + {0x27, 0x14, 0xf8}, + {0x27, 0x15, 0x18}, + {0x27, 0x16, 0xf8}, + {0x27, 0x17, 0xf4}, + {0x27, 0x18, 0x07}, // Biquad - BQ4 Right - Filter: Equalizer (Q Factor) Frequency: 80 Hz Gain: -15dB QVal: 1.5 Bandwidth: 1000 Hz + {0x27, 0x19, 0xef}, + {0x27, 0x1a, 0xa2}, + {0x27, 0x1b, 0x71}, + {0x27, 0x1c, 0xf0}, + {0x27, 0x1d, 0x27}, + {0x27, 0x1e, 0xdd}, + {0x27, 0x1f, 0xad}, + {0x27, 0x20, 0x07}, + {0x27, 0x21, 0xe8}, + {0x27, 0x22, 0x8e}, + {0x27, 0x23, 0x1e}, + {0x27, 0x24, 0x0f}, + {0x27, 0x25, 0xd8}, + {0x27, 0x26, 0x22}, + {0x27, 0x27, 0x53}, + {0x27, 0x28, 0xf8}, + {0x27, 0x29, 0x27}, + {0x27, 0x2a, 0xcf}, + {0x27, 0x2b, 0x71}, + {0x27, 0x2c, 0x07}, // Biquad - BQ5 Right - Filter: Equalizer (Q Factor) Frequency: 125 Hz Gain: -15dB QVal: 1 Bandwidth: 1000 Hz + {0x27, 0x2d, 0xda}, + {0x27, 0x2e, 0x23}, + {0x27, 0x2f, 0x50}, + {0x27, 0x30, 0xf0}, + {0x27, 0x31, 0x5c}, + {0x27, 0x32, 0x3c}, + {0x27, 0x33, 0x8e}, + {0x27, 0x34, 0x07}, + {0x27, 0x35, 0xc9}, + {0x27, 0x36, 0xc2}, + {0x27, 0x37, 0x70}, + {0x27, 0x38, 0x0f}, + {0x27, 0x39, 0xa3}, + {0x27, 0x3a, 0xc3}, + {0x27, 0x3b, 0x72}, + {0x27, 0x3c, 0xf8}, + {0x27, 0x3d, 0x5c}, + {0x27, 0x3e, 0x1a}, + {0x27, 0x3f, 0x40}, + {0x27, 0x40, 0x07}, // Biquad - BQ6 Right - Filter: Equalizer (Q Factor) Frequency: 200 Hz Gain: -15dB QVal: 1 Bandwidth: 1000 Hz + {0x27, 0x41, 0xc4}, + {0x27, 0x42, 0x3a}, + {0x27, 0x43, 0x25}, + {0x27, 0x44, 0xf0}, + {0x27, 0x45, 0x91}, + {0x27, 0x46, 0xbd}, + {0x27, 0x47, 0xa6}, + {0x27, 0x48, 0x07}, + {0x27, 0x49, 0xaa}, + {0x27, 0x4a, 0x5e}, + {0x27, 0x4b, 0xdb}, + {0x27, 0x4c, 0x0f}, + {0x27, 0x4d, 0x6e}, + {0x27, 0x4e, 0x42}, + {0x27, 0x4f, 0x5a}, + {0x27, 0x50, 0xf8}, + {0x27, 0x51, 0x91}, + {0x27, 0x52, 0x67}, + {0x27, 0x53, 0x01}, + {0x27, 0x54, 0x07}, // Biquad - BQ7 Right - Filter: Equalizer (Q Factor) Frequency: 315 Hz Gain: -15dB QVal: 0.9 Bandwidth: 1000 Hz + {0x27, 0x55, 0x9a}, + {0x27, 0x56, 0x1c}, + {0x27, 0x57, 0x35}, + {0x27, 0x58, 0xf0}, + {0x27, 0x59, 0xf8}, + {0x27, 0x5a, 0xac}, + {0x27, 0x5b, 0x4b}, + {0x27, 0x5c, 0x07}, + {0x27, 0x5d, 0x6e}, + {0x27, 0x5e, 0x08}, + {0x27, 0x5f, 0xdb}, + {0x27, 0x60, 0x0f}, + {0x27, 0x61, 0x07}, + {0x27, 0x62, 0x53}, + {0x27, 0x63, 0xb5}, + {0x27, 0x64, 0xf8}, + {0x27, 0x65, 0xf7}, + {0x27, 0x66, 0xda}, + {0x27, 0x67, 0xf0}, + {0x27, 0x68, 0x07}, // Biquad - BQ8 Right - Filter: Equalizer (Q Factor) Frequency: 500 Hz Gain: -15dB QVal: 0.9 Bandwidth: 1000 Hz + {0x27, 0x69, 0x63}, + {0x27, 0x6a, 0xd2}, + {0x27, 0x6b, 0x0d}, + {0x27, 0x6c, 0xf1}, + {0x27, 0x6d, 0x7d}, + {0x27, 0x6e, 0xe8}, + {0x27, 0x6f, 0xac}, + {0x27, 0x70, 0x07}, + {0x27, 0x71, 0x20}, + {0x27, 0x72, 0x42}, + {0x27, 0x73, 0xa0}, + {0x27, 0x74, 0x0e}, + {0x27, 0x75, 0x82}, + {0x27, 0x76, 0x17}, + {0x27, 0x77, 0x54}, + {0x27, 0x78, 0xf9}, + {0x27, 0x79, 0x7b}, + {0x27, 0x7a, 0xeb}, + {0x27, 0x7b, 0x53}, + {0x27, 0x7c, 0x06}, // Biquad - BQ9 Right - Filter: Equalizer (Q Factor) Frequency: 800 Hz Gain: -15dB QVal: 0.8 Bandwidth: 1000 Hz + {0x27, 0x7d, 0xfa}, + {0x27, 0x7e, 0x4b}, + {0x27, 0x7f, 0xcf}, + {0x28, 0x08, 0xf2}, + {0x28, 0x09, 0x81}, + {0x28, 0x0a, 0x5b}, + {0x28, 0x0b, 0x57}, + {0x28, 0x0c, 0x06}, + {0x28, 0x0d, 0x89}, + {0x28, 0x0e, 0x16}, + {0x28, 0x0f, 0x8a}, + {0x28, 0x10, 0x0d}, + {0x28, 0x11, 0x7e}, + {0x28, 0x12, 0xa4}, + {0x28, 0x13, 0xa9}, + {0x28, 0x14, 0xfa}, + {0x28, 0x15, 0x7c}, + {0x28, 0x16, 0x9d}, + {0x28, 0x17, 0xa7}, + {0x28, 0x18, 0x06}, // Biquad - BQ10 Right - Filter: Equalizer (Q Factor) Frequency: 1250 Hz Gain: -15dB QVal: 0.8 Bandwidth: 1000 Hz + {0x28, 0x19, 0x87}, + {0x28, 0x1a, 0xf6}, + {0x28, 0x1b, 0x8b}, + {0x28, 0x1c, 0xf3}, + {0x28, 0x1d, 0x9d}, + {0x28, 0x1e, 0x61}, + {0x28, 0x1f, 0x7d}, + {0x28, 0x20, 0x05}, + {0x28, 0x21, 0xe5}, + {0x28, 0x22, 0x4b}, + {0x28, 0x23, 0xf3}, + {0x28, 0x24, 0x0c}, + {0x28, 0x25, 0x62}, + {0x28, 0x26, 0x9e}, + {0x28, 0x27, 0x83}, + {0x28, 0x28, 0xfb}, + {0x28, 0x29, 0x92}, + {0x28, 0x2a, 0xbd}, + {0x28, 0x2b, 0x82}, + {0x28, 0x2c, 0x05}, // Biquad - BQ11 Right - Filter: Equalizer (Q Factor) Frequency: 2000 Hz Gain: -15dB QVal: 0.7 Bandwidth: 1000 Hz + {0x28, 0x2d, 0xbb}, + {0x28, 0x2e, 0xc2}, + {0x28, 0x2f, 0x12}, + {0x28, 0x30, 0xf5}, + {0x28, 0x31, 0x9a}, + {0x28, 0x32, 0x73}, + {0x28, 0x33, 0xa5}, + {0x28, 0x34, 0x04}, + {0x28, 0x35, 0xc0}, + {0x28, 0x36, 0xc1}, + {0x28, 0x37, 0xae}, + {0x28, 0x38, 0x0a}, + {0x28, 0x39, 0x65}, + {0x28, 0x3a, 0x8c}, + {0x28, 0x3b, 0x5b}, + {0x28, 0x3c, 0xfd}, + {0x28, 0x3d, 0x83}, + {0x28, 0x3e, 0x7c}, + {0x28, 0x3f, 0x40}, + {0x28, 0x40, 0x05}, // Biquad - BQ12 Right - Filter: Equalizer (Q Factor) Frequency: 3150 Hz Gain: -15dB QVal: 0.7 Bandwidth: 1000 Hz + {0x28, 0x41, 0x05}, + {0x28, 0x42, 0x40}, + {0x28, 0x43, 0xf6}, + {0x28, 0x44, 0xf7}, + {0x28, 0x45, 0x6e}, + {0x28, 0x46, 0xe4}, + {0x28, 0x47, 0x09}, + {0x28, 0x48, 0x03}, + {0x28, 0x49, 0xbb}, + {0x28, 0x4a, 0x4d}, + {0x28, 0x4b, 0xe9}, + {0x28, 0x4c, 0x08}, + {0x28, 0x4d, 0x91}, + {0x28, 0x4e, 0x1b}, + {0x28, 0x4f, 0xf7}, + {0x28, 0x50, 0xff}, + {0x28, 0x51, 0x3f}, + {0x28, 0x52, 0x71}, + {0x28, 0x53, 0x21}, + {0x28, 0x54, 0x04}, // Biquad - BQ13 Right - Filter: Equalizer (Q Factor) Frequency: 5000 Hz Gain: -15dB QVal: 0.6 Bandwidth: 1000 Hz + {0x28, 0x55, 0x04}, + {0x28, 0x56, 0xcb}, + {0x28, 0x57, 0xe7}, + {0x28, 0x58, 0xfa}, + {0x28, 0x59, 0x05}, + {0x28, 0x5a, 0x17}, + {0x28, 0x5b, 0xe0}, + {0x28, 0x5c, 0x02}, + {0x28, 0x5d, 0x4b}, + {0x28, 0x5e, 0xe8}, + {0x28, 0x5f, 0x98}, + {0x28, 0x60, 0x05}, + {0x28, 0x61, 0xfa}, + {0x28, 0x62, 0xe8}, + {0x28, 0x63, 0x20}, + {0x28, 0x64, 0x01}, + {0x28, 0x65, 0xaf}, + {0x28, 0x66, 0x4b}, + {0x28, 0x67, 0x81}, + {0x28, 0x68, 0x03}, // Biquad - BQ14 Right - Filter: Equalizer (Q Factor) Frequency: 8000 Hz Gain: -15dB QVal: 0.6 Bandwidth: 1000 Hz + {0x28, 0x69, 0x53}, + {0x28, 0x6a, 0xbb}, + {0x28, 0x6b, 0x80}, + {0x28, 0x6c, 0xfb}, + {0x28, 0x6d, 0xfc}, + {0x28, 0x6e, 0xe8}, + {0x28, 0x6f, 0xbc}, + {0x28, 0x70, 0x01}, + {0x28, 0x71, 0x4e}, + {0x28, 0x72, 0x3f}, + {0x28, 0x73, 0xfe}, + {0x28, 0x74, 0x04}, + {0x28, 0x75, 0x03}, + {0x28, 0x76, 0x17}, + {0x28, 0x77, 0x44}, + {0x28, 0x78, 0x03}, + {0x28, 0x79, 0x5e}, + {0x28, 0x7a, 0x04}, + {0x28, 0x7b, 0x82}, + {0x28, 0x7c, 0x02}, // Biquad - BQ15 Right - Filter: Equalizer (Q Factor) Frequency: 16000 Hz Gain: -15dB QVal: 0.5 Bandwidth: 1000 Hz + {0x28, 0x7d, 0x60}, + {0x28, 0x7e, 0x9e}, + {0x28, 0x7f, 0x22}, + {0x29, 0x08, 0xfe}, + {0x29, 0x09, 0xd6}, + {0x29, 0x0a, 0xb4}, + {0x29, 0x0b, 0xf8}, + {0x29, 0x0c, 0xff}, + {0x29, 0x0d, 0xf1}, + {0x29, 0x0e, 0xf7}, + {0x29, 0x0f, 0xef}, + {0x29, 0x10, 0x01}, + {0x29, 0x11, 0x29}, + {0x29, 0x12, 0x4b}, + {0x29, 0x13, 0x08}, + {0x29, 0x14, 0x05}, + {0x29, 0x15, 0xad}, + {0x29, 0x16, 0x69}, + {0x29, 0x17, 0xef}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_right_me[TAS5805M_EQ_REG_PER_STEP] = { + {0x26, 0x54, 0x07}, // Biquad - BQ1 Right - Filter: Equalizer (Q Factor) Frequency: 20 Hz Gain: -14dB QVal: 2 Bandwidth: 1000 Hz + {0x26, 0x55, 0xfd}, + {0x26, 0x56, 0x50}, + {0x26, 0x57, 0xcc}, + {0x26, 0x58, 0xf0}, + {0x26, 0x59, 0x06}, + {0x26, 0x5a, 0xb5}, + {0x26, 0x5b, 0xe2}, + {0x26, 0x5c, 0x07}, + {0x26, 0x5d, 0xfb}, + {0x26, 0x5e, 0xfa}, + {0x26, 0x5f, 0x37}, + {0x26, 0x60, 0x0f}, + {0x26, 0x61, 0xf9}, + {0x26, 0x62, 0x4a}, + {0x26, 0x63, 0x1e}, + {0x26, 0x64, 0xf8}, + {0x26, 0x65, 0x06}, + {0x26, 0x66, 0xb4}, + {0x26, 0x67, 0xfd}, + {0x26, 0x68, 0x07}, // Biquad - BQ2 Right - Filter: Equalizer (Q Factor) Frequency: 31.5 Hz Gain: -14dB QVal: 2 Bandwidth: 1000 Hz + {0x26, 0x69, 0xfb}, + {0x26, 0x6a, 0xc6}, + {0x26, 0x6b, 0xad}, + {0x26, 0x6c, 0xf0}, + {0x26, 0x6d, 0x0a}, + {0x26, 0x6e, 0x8f}, + {0x26, 0x6f, 0xef}, + {0x26, 0x70, 0x07}, + {0x26, 0x71, 0xf9}, + {0x26, 0x72, 0xab}, + {0x26, 0x73, 0x9d}, + {0x26, 0x74, 0x0f}, + {0x26, 0x75, 0xf5}, + {0x26, 0x76, 0x70}, + {0x26, 0x77, 0x11}, + {0x26, 0x78, 0xf8}, + {0x26, 0x79, 0x0a}, + {0x26, 0x7a, 0x8d}, + {0x26, 0x7b, 0xb6}, + {0x26, 0x7c, 0x07}, // Biquad - BQ3 Right - Filter: Equalizer (Q Factor) Frequency: 50 Hz Gain: -14dB QVal: 1.5 Bandwidth: 1000 Hz + {0x26, 0x7d, 0xf7}, + {0x26, 0x7e, 0x16}, + {0x26, 0x7f, 0x0c}, + {0x27, 0x08, 0xf0}, + {0x27, 0x09, 0x16}, + {0x27, 0x0a, 0x4b}, + {0x27, 0x0b, 0x17}, + {0x27, 0x0c, 0x07}, + {0x27, 0x0d, 0xf2}, + {0x27, 0x0e, 0xa4}, + {0x27, 0x0f, 0x73}, + {0x27, 0x10, 0x0f}, + {0x27, 0x11, 0xe9}, + {0x27, 0x12, 0xb4}, + {0x27, 0x13, 0xe9}, + {0x27, 0x14, 0xf8}, + {0x27, 0x15, 0x16}, + {0x27, 0x16, 0x45}, + {0x27, 0x17, 0x81}, + {0x27, 0x18, 0x07}, // Biquad - BQ4 Right - Filter: Equalizer (Q Factor) Frequency: 80 Hz Gain: -14dB QVal: 1.5 Bandwidth: 1000 Hz + {0x27, 0x19, 0xf1}, + {0x27, 0x1a, 0xc8}, + {0x27, 0x1b, 0xc0}, + {0x27, 0x1c, 0xf0}, + {0x27, 0x1d, 0x23}, + {0x27, 0x1e, 0x92}, + {0x27, 0x1f, 0xfe}, + {0x27, 0x20, 0x07}, + {0x27, 0x21, 0xea}, + {0x27, 0x22, 0xb2}, + {0x27, 0x23, 0x82}, + {0x27, 0x24, 0x0f}, + {0x27, 0x25, 0xdc}, + {0x27, 0x26, 0x6d}, + {0x27, 0x27, 0x02}, + {0x27, 0x28, 0xf8}, + {0x27, 0x29, 0x23}, + {0x27, 0x2a, 0x84}, + {0x27, 0x2b, 0xbe}, + {0x27, 0x2c, 0x07}, // Biquad - BQ5 Right - Filter: Equalizer (Q Factor) Frequency: 125 Hz Gain: -14dB QVal: 1 Bandwidth: 1000 Hz + {0x27, 0x2d, 0xdf}, + {0x27, 0x2e, 0x10}, + {0x27, 0x2f, 0xc0}, + {0x27, 0x30, 0xf0}, + {0x27, 0x31, 0x52}, + {0x27, 0x32, 0x6c}, + {0x27, 0x33, 0x09}, + {0x27, 0x34, 0x07}, + {0x27, 0x35, 0xce}, + {0x27, 0x36, 0xa5}, + {0x27, 0x37, 0x9a}, + {0x27, 0x38, 0x0f}, + {0x27, 0x39, 0xad}, + {0x27, 0x3a, 0x93}, + {0x27, 0x3b, 0xf7}, + {0x27, 0x3c, 0xf8}, + {0x27, 0x3d, 0x52}, + {0x27, 0x3e, 0x49}, + {0x27, 0x3f, 0xa6}, + {0x27, 0x40, 0x07}, // Biquad - BQ6 Right - Filter: Equalizer (Q Factor) Frequency: 200 Hz Gain: -14dB QVal: 1 Bandwidth: 1000 Hz + {0x27, 0x41, 0xcb}, + {0x27, 0x42, 0xee}, + {0x27, 0x43, 0xab}, + {0x27, 0x44, 0xf0}, + {0x27, 0x45, 0x82}, + {0x27, 0x46, 0x6e}, + {0x27, 0x47, 0x95}, + {0x27, 0x48, 0x07}, + {0x27, 0x49, 0xb1}, + {0x27, 0x4a, 0xf9}, + {0x27, 0x4b, 0xba}, + {0x27, 0x4c, 0x0f}, + {0x27, 0x4d, 0x7d}, + {0x27, 0x4e, 0x91}, + {0x27, 0x4f, 0x6b}, + {0x27, 0x50, 0xf8}, + {0x27, 0x51, 0x82}, + {0x27, 0x52, 0x17}, + {0x27, 0x53, 0x9a}, + {0x27, 0x54, 0x07}, // Biquad - BQ7 Right - Filter: Equalizer (Q Factor) Frequency: 315 Hz Gain: -14dB QVal: 0.9 Bandwidth: 1000 Hz + {0x27, 0x55, 0xa7}, + {0x27, 0x56, 0x00}, + {0x27, 0x57, 0x64}, + {0x27, 0x58, 0xf0}, + {0x27, 0x59, 0xdf}, + {0x27, 0x5a, 0x30}, + {0x27, 0x5b, 0x0d}, + {0x27, 0x5c, 0x07}, + {0x27, 0x5d, 0x7a}, + {0x27, 0x5e, 0xa2}, + {0x27, 0x5f, 0x4c}, + {0x27, 0x60, 0x0f}, + {0x27, 0x61, 0x20}, + {0x27, 0x62, 0xcf}, + {0x27, 0x63, 0xf3}, + {0x27, 0x64, 0xf8}, + {0x27, 0x65, 0xde}, + {0x27, 0x66, 0x5d}, + {0x27, 0x67, 0x4f}, + {0x27, 0x68, 0x07}, // Biquad - BQ8 Right - Filter: Equalizer (Q Factor) Frequency: 500 Hz Gain: -14dB QVal: 0.9 Bandwidth: 1000 Hz + {0x27, 0x69, 0x77}, + {0x27, 0x6a, 0x18}, + {0x27, 0x6b, 0xf7}, + {0x27, 0x6c, 0xf1}, + {0x27, 0x6d, 0x58}, + {0x27, 0x6e, 0x10}, + {0x27, 0x6f, 0x44}, + {0x27, 0x70, 0x07}, + {0x27, 0x71, 0x32}, + {0x27, 0x72, 0xd9}, + {0x27, 0x73, 0x4e}, + {0x27, 0x74, 0x0e}, + {0x27, 0x75, 0xa7}, + {0x27, 0x76, 0xef}, + {0x27, 0x77, 0xbc}, + {0x27, 0x78, 0xf9}, + {0x27, 0x79, 0x56}, + {0x27, 0x7a, 0x0d}, + {0x27, 0x7b, 0xba}, + {0x27, 0x7c, 0x07}, // Biquad - BQ9 Right - Filter: Equalizer (Q Factor) Frequency: 800 Hz Gain: -14dB QVal: 0.8 Bandwidth: 1000 Hz + {0x27, 0x7d, 0x19}, + {0x27, 0x7e, 0x01}, + {0x27, 0x7f, 0xee}, + {0x28, 0x08, 0xf2}, + {0x28, 0x09, 0x45}, + {0x28, 0x0a, 0xf6}, + {0x28, 0x0b, 0x3c}, + {0x28, 0x0c, 0x06}, + {0x28, 0x0d, 0xa5}, + {0x28, 0x0e, 0xda}, + {0x28, 0x0f, 0x64}, + {0x28, 0x10, 0x0d}, + {0x28, 0x11, 0xba}, + {0x28, 0x12, 0x09}, + {0x28, 0x13, 0xc4}, + {0x28, 0x14, 0xfa}, + {0x28, 0x15, 0x41}, + {0x28, 0x16, 0x23}, + {0x28, 0x17, 0xae}, + {0x28, 0x18, 0x06}, // Biquad - BQ10 Right - Filter: Equalizer (Q Factor) Frequency: 1250 Hz Gain: -14dB QVal: 0.8 Bandwidth: 1000 Hz + {0x28, 0x19, 0xb1}, + {0x28, 0x1a, 0x94}, + {0x28, 0x1b, 0x6b}, + {0x28, 0x1c, 0xf3}, + {0x28, 0x1d, 0x4e}, + {0x28, 0x1e, 0x76}, + {0x28, 0x1f, 0x10}, + {0x28, 0x20, 0x06}, + {0x28, 0x21, 0x0a}, + {0x28, 0x22, 0xdd}, + {0x28, 0x23, 0x4e}, + {0x28, 0x24, 0x0c}, + {0x28, 0x25, 0xb1}, + {0x28, 0x26, 0x89}, + {0x28, 0x27, 0xf0}, + {0x28, 0x28, 0xfb}, + {0x28, 0x29, 0x43}, + {0x28, 0x2a, 0x8e}, + {0x28, 0x2b, 0x47}, + {0x28, 0x2c, 0x05}, // Biquad - BQ11 Right - Filter: Equalizer (Q Factor) Frequency: 2000 Hz Gain: -14dB QVal: 0.7 Bandwidth: 1000 Hz + {0x28, 0x2d, 0xf4}, + {0x28, 0x2e, 0xe7}, + {0x28, 0x2f, 0x66}, + {0x28, 0x30, 0xf5}, + {0x28, 0x31, 0x32}, + {0x28, 0x32, 0xd3}, + {0x28, 0x33, 0xaa}, + {0x28, 0x34, 0x04}, + {0x28, 0x35, 0xf0}, + {0x28, 0x36, 0x21}, + {0x28, 0x37, 0x3e}, + {0x28, 0x38, 0x0a}, + {0x28, 0x39, 0xcd}, + {0x28, 0x3a, 0x2c}, + {0x28, 0x3b, 0x56}, + {0x28, 0x3c, 0xfd}, + {0x28, 0x3d, 0x1a}, + {0x28, 0x3e, 0xf7}, + {0x28, 0x3f, 0x5b}, + {0x28, 0x40, 0x05}, // Biquad - BQ12 Right - Filter: Equalizer (Q Factor) Frequency: 3150 Hz Gain: -14dB QVal: 0.7 Bandwidth: 1000 Hz + {0x28, 0x41, 0x47}, + {0x28, 0x42, 0xd9}, + {0x28, 0x43, 0x42}, + {0x28, 0x44, 0xf6}, + {0x28, 0x45, 0xfd}, + {0x28, 0x46, 0x41}, + {0x28, 0x47, 0x75}, + {0x28, 0x48, 0x03}, + {0x28, 0x49, 0xec}, + {0x28, 0x4a, 0xcd}, + {0x28, 0x4b, 0x95}, + {0x28, 0x4c, 0x09}, + {0x28, 0x4d, 0x02}, + {0x28, 0x4e, 0xbe}, + {0x28, 0x4f, 0x8b}, + {0x28, 0x50, 0xfe}, + {0x28, 0x51, 0xcb}, + {0x28, 0x52, 0x59}, + {0x28, 0x53, 0x2a}, + {0x28, 0x54, 0x04}, // Biquad - BQ13 Right - Filter: Equalizer (Q Factor) Frequency: 5000 Hz Gain: -14dB QVal: 0.6 Bandwidth: 1000 Hz + {0x28, 0x55, 0x4d}, + {0x28, 0x56, 0x4a}, + {0x28, 0x57, 0x12}, + {0x28, 0x58, 0xf9}, + {0x28, 0x59, 0x99}, + {0x28, 0x5a, 0x38}, + {0x28, 0x5b, 0x47}, + {0x28, 0x5c, 0x02}, + {0x28, 0x5d, 0x75}, + {0x28, 0x5e, 0x55}, + {0x28, 0x5f, 0xb7}, + {0x28, 0x60, 0x06}, + {0x28, 0x61, 0x66}, + {0x28, 0x62, 0xc7}, + {0x28, 0x63, 0xb9}, + {0x28, 0x64, 0x01}, + {0x28, 0x65, 0x3d}, + {0x28, 0x66, 0x60}, + {0x28, 0x67, 0x37}, + {0x28, 0x68, 0x03}, // Biquad - BQ14 Right - Filter: Equalizer (Q Factor) Frequency: 8000 Hz Gain: -14dB QVal: 0.6 Bandwidth: 1000 Hz + {0x28, 0x69, 0x9b}, + {0x28, 0x6a, 0x0c}, + {0x28, 0x6b, 0x56}, + {0x28, 0x6c, 0xfb}, + {0x28, 0x6d, 0xa6}, + {0x28, 0x6e, 0xe9}, + {0x28, 0x6f, 0x1a}, + {0x28, 0x70, 0x01}, + {0x28, 0x71, 0x6a}, + {0x28, 0x72, 0x3c}, + {0x28, 0x73, 0xa0}, + {0x28, 0x74, 0x04}, + {0x28, 0x75, 0x59}, + {0x28, 0x76, 0x16}, + {0x28, 0x77, 0xe6}, + {0x28, 0x78, 0x02}, + {0x28, 0x79, 0xfa}, + {0x28, 0x7a, 0xb7}, + {0x28, 0x7b, 0x0b}, + {0x28, 0x7c, 0x02}, // Biquad - BQ15 Right - Filter: Equalizer (Q Factor) Frequency: 16000 Hz Gain: -14dB QVal: 0.5 Bandwidth: 1000 Hz + {0x28, 0x7d, 0x9e}, + {0x28, 0x7e, 0xfe}, + {0x28, 0x7f, 0xca}, + {0x29, 0x08, 0xfe}, + {0x29, 0x09, 0xb8}, + {0x29, 0x0a, 0x3c}, + {0x29, 0x0b, 0xb7}, + {0x29, 0x0c, 0xff}, + {0x29, 0x0d, 0xf0}, + {0x29, 0x0e, 0x87}, + {0x29, 0x0f, 0xc8}, + {0x29, 0x10, 0x01}, + {0x29, 0x11, 0x47}, + {0x29, 0x12, 0xc3}, + {0x29, 0x13, 0x49}, + {0x29, 0x14, 0x05}, + {0x29, 0x15, 0x70}, + {0x29, 0x16, 0x79}, + {0x29, 0x17, 0x6e}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_right_md[TAS5805M_EQ_REG_PER_STEP] = { + {0x26, 0x54, 0x07}, // Biquad - BQ1 Right - Filter: Equalizer (Q Factor) Frequency: 20 Hz Gain: -13dB QVal: 2 Bandwidth: 1000 Hz + {0x26, 0x55, 0xfd}, + {0x26, 0x56, 0xae}, + {0x26, 0x57, 0x0e}, + {0x26, 0x58, 0xf0}, + {0x26, 0x59, 0x05}, + {0x26, 0x5a, 0xfb}, + {0x26, 0x5b, 0x70}, + {0x26, 0x5c, 0x07}, + {0x26, 0x5d, 0xfc}, + {0x26, 0x5e, 0x57}, + {0x26, 0x5f, 0x69}, + {0x26, 0x60, 0x0f}, + {0x26, 0x61, 0xfa}, + {0x26, 0x62, 0x04}, + {0x26, 0x63, 0x90}, + {0x26, 0x64, 0xf8}, + {0x26, 0x65, 0x05}, + {0x26, 0x66, 0xfa}, + {0x26, 0x67, 0x8a}, + {0x26, 0x68, 0x07}, // Biquad - BQ2 Right - Filter: Equalizer (Q Factor) Frequency: 31.5 Hz Gain: -13dB QVal: 2 Bandwidth: 1000 Hz + {0x26, 0x69, 0xfc}, + {0x26, 0x6a, 0x59}, + {0x26, 0x6b, 0x51}, + {0x26, 0x6c, 0xf0}, + {0x26, 0x6d, 0x09}, + {0x26, 0x6e, 0x6a}, + {0x26, 0x6f, 0xcd}, + {0x26, 0x70, 0x07}, + {0x26, 0x71, 0xfa}, + {0x26, 0x72, 0x3e}, + {0x26, 0x73, 0x1b}, + {0x26, 0x74, 0x0f}, + {0x26, 0x75, 0xf6}, + {0x26, 0x76, 0x95}, + {0x26, 0x77, 0x33}, + {0x26, 0x78, 0xf8}, + {0x26, 0x79, 0x09}, + {0x26, 0x7a, 0x68}, + {0x26, 0x7b, 0x94}, + {0x26, 0x7c, 0x07}, // Biquad - BQ3 Right - Filter: Equalizer (Q Factor) Frequency: 50 Hz Gain: -13dB QVal: 1.5 Bandwidth: 1000 Hz + {0x26, 0x7d, 0xf8}, + {0x26, 0x7e, 0x4a}, + {0x26, 0x7f, 0xe6}, + {0x27, 0x08, 0xf0}, + {0x27, 0x09, 0x13}, + {0x27, 0x0a, 0xe2}, + {0x27, 0x0b, 0x11}, + {0x27, 0x0c, 0x07}, + {0x27, 0x0d, 0xf3}, + {0x27, 0x0e, 0xd8}, + {0x27, 0x0f, 0xa0}, + {0x27, 0x10, 0x0f}, + {0x27, 0x11, 0xec}, + {0x27, 0x12, 0x1d}, + {0x27, 0x13, 0xef}, + {0x27, 0x14, 0xf8}, + {0x27, 0x15, 0x13}, + {0x27, 0x16, 0xdc}, + {0x27, 0x17, 0x7a}, + {0x27, 0x18, 0x07}, // Biquad - BQ4 Right - Filter: Equalizer (Q Factor) Frequency: 80 Hz Gain: -13dB QVal: 1.5 Bandwidth: 1000 Hz + {0x27, 0x19, 0xf3}, + {0x27, 0x1a, 0xb4}, + {0x27, 0x1b, 0x32}, + {0x27, 0x1c, 0xf0}, + {0x27, 0x1d, 0x1f}, + {0x27, 0x1e, 0xbd}, + {0x27, 0x1f, 0xd4}, + {0x27, 0x20, 0x07}, + {0x27, 0x21, 0xec}, + {0x27, 0x22, 0x9c}, + {0x27, 0x23, 0x3e}, + {0x27, 0x24, 0x0f}, + {0x27, 0x25, 0xe0}, + {0x27, 0x26, 0x42}, + {0x27, 0x27, 0x2c}, + {0x27, 0x28, 0xf8}, + {0x27, 0x29, 0x1f}, + {0x27, 0x2a, 0xaf}, + {0x27, 0x2b, 0x90}, + {0x27, 0x2c, 0x07}, // Biquad - BQ5 Right - Filter: Equalizer (Q Factor) Frequency: 125 Hz Gain: -13dB QVal: 1 Bandwidth: 1000 Hz + {0x27, 0x2d, 0xe3}, + {0x27, 0x2e, 0x7a}, + {0x27, 0x2f, 0x3b}, + {0x27, 0x30, 0xf0}, + {0x27, 0x31, 0x49}, + {0x27, 0x32, 0xa2}, + {0x27, 0x33, 0x5a}, + {0x27, 0x34, 0x07}, + {0x27, 0x35, 0xd3}, + {0x27, 0x36, 0x05}, + {0x27, 0x37, 0xe1}, + {0x27, 0x38, 0x0f}, + {0x27, 0x39, 0xb6}, + {0x27, 0x3a, 0x5d}, + {0x27, 0x3b, 0xa6}, + {0x27, 0x3c, 0xf8}, + {0x27, 0x3d, 0x49}, + {0x27, 0x3e, 0x7f}, + {0x27, 0x3f, 0xe3}, + {0x27, 0x40, 0x07}, // Biquad - BQ6 Right - Filter: Equalizer (Q Factor) Frequency: 200 Hz Gain: -13dB QVal: 1 Bandwidth: 1000 Hz + {0x27, 0x41, 0xd2}, + {0x27, 0x42, 0xd9}, + {0x27, 0x43, 0x9e}, + {0x27, 0x44, 0xf0}, + {0x27, 0x45, 0x74}, + {0x27, 0x46, 0xb0}, + {0x27, 0x47, 0x06}, + {0x27, 0x48, 0x07}, + {0x27, 0x49, 0xb8}, + {0x27, 0x4a, 0xcd}, + {0x27, 0x4b, 0xa4}, + {0x27, 0x4c, 0x0f}, + {0x27, 0x4d, 0x8b}, + {0x27, 0x4e, 0x4f}, + {0x27, 0x4f, 0xfa}, + {0x27, 0x50, 0xf8}, + {0x27, 0x51, 0x74}, + {0x27, 0x52, 0x58}, + {0x27, 0x53, 0xbe}, + {0x27, 0x54, 0x07}, // Biquad - BQ7 Right - Filter: Equalizer (Q Factor) Frequency: 315 Hz Gain: -13dB QVal: 0.9 Bandwidth: 1000 Hz + {0x27, 0x55, 0xb2}, + {0x27, 0x56, 0xa2}, + {0x27, 0x57, 0xc1}, + {0x27, 0x58, 0xf0}, + {0x27, 0x59, 0xc8}, + {0x27, 0x5a, 0x30}, + {0x27, 0x5b, 0x09}, + {0x27, 0x5c, 0x07}, + {0x27, 0x5d, 0x86}, + {0x27, 0x5e, 0x01}, + {0x27, 0x5f, 0x35}, + {0x27, 0x60, 0x0f}, + {0x27, 0x61, 0x37}, + {0x27, 0x62, 0xcf}, + {0x27, 0x63, 0xf7}, + {0x27, 0x64, 0xf8}, + {0x27, 0x65, 0xc7}, + {0x27, 0x66, 0x5c}, + {0x27, 0x67, 0x0b}, + {0x27, 0x68, 0x07}, // Biquad - BQ8 Right - Filter: Equalizer (Q Factor) Frequency: 500 Hz Gain: -13dB QVal: 0.9 Bandwidth: 1000 Hz + {0x27, 0x69, 0x88}, + {0x27, 0x6a, 0x9c}, + {0x27, 0x6b, 0xc0}, + {0x27, 0x6c, 0xf1}, + {0x27, 0x6d, 0x35}, + {0x27, 0x6e, 0xad}, + {0x27, 0x6f, 0x8a}, + {0x27, 0x70, 0x07}, + {0x27, 0x71, 0x43}, + {0x27, 0x72, 0xbc}, + {0x27, 0x73, 0xf7}, + {0x27, 0x74, 0x0e}, + {0x27, 0x75, 0xca}, + {0x27, 0x76, 0x52}, + {0x27, 0x77, 0x76}, + {0x27, 0x78, 0xf9}, + {0x27, 0x79, 0x33}, + {0x27, 0x7a, 0xa6}, + {0x27, 0x7b, 0x49}, + {0x27, 0x7c, 0x07}, // Biquad - BQ9 Right - Filter: Equalizer (Q Factor) Frequency: 800 Hz Gain: -13dB QVal: 0.8 Bandwidth: 1000 Hz + {0x27, 0x7d, 0x35}, + {0x27, 0x7e, 0x48}, + {0x27, 0x7f, 0x70}, + {0x28, 0x08, 0xf2}, + {0x28, 0x09, 0x0f}, + {0x28, 0x0a, 0x47}, + {0x28, 0x0b, 0x2c}, + {0x28, 0x0c, 0x06}, + {0x28, 0x0d, 0xc0}, + {0x28, 0x0e, 0x56}, + {0x28, 0x0f, 0x28}, + {0x28, 0x10, 0x0d}, + {0x28, 0x11, 0xf0}, + {0x28, 0x12, 0xb8}, + {0x28, 0x13, 0xd4}, + {0x28, 0x14, 0xfa}, + {0x28, 0x15, 0x0a}, + {0x28, 0x16, 0x61}, + {0x28, 0x17, 0x68}, + {0x28, 0x18, 0x06}, // Biquad - BQ10 Right - Filter: Equalizer (Q Factor) Frequency: 1250 Hz Gain: -13dB QVal: 0.8 Bandwidth: 1000 Hz + {0x28, 0x19, 0xd8}, + {0x28, 0x1a, 0x74}, + {0x28, 0x1b, 0xd4}, + {0x28, 0x1c, 0xf3}, + {0x28, 0x1d, 0x04}, + {0x28, 0x1e, 0xbc}, + {0x28, 0x1f, 0xdc}, + {0x28, 0x20, 0x06}, + {0x28, 0x21, 0x2d}, + {0x28, 0x22, 0xf5}, + {0x28, 0x23, 0x70}, + {0x28, 0x24, 0x0c}, + {0x28, 0x25, 0xfb}, + {0x28, 0x26, 0x43}, + {0x28, 0x27, 0x24}, + {0x28, 0x28, 0xfa}, + {0x28, 0x29, 0xf9}, + {0x28, 0x2a, 0x95}, + {0x28, 0x2b, 0xbd}, + {0x28, 0x2c, 0x06}, // Biquad - BQ11 Right - Filter: Equalizer (Q Factor) Frequency: 2000 Hz Gain: -13dB QVal: 0.7 Bandwidth: 1000 Hz + {0x28, 0x2d, 0x2b}, + {0x28, 0x2e, 0xb8}, + {0x28, 0x2f, 0x63}, + {0x28, 0x30, 0xf4}, + {0x28, 0x31, 0xcf}, + {0x28, 0x32, 0x6d}, + {0x28, 0x33, 0x0d}, + {0x28, 0x34, 0x05}, + {0x28, 0x35, 0x1d}, + {0x28, 0x36, 0x92}, + {0x28, 0x37, 0x72}, + {0x28, 0x38, 0x0b}, + {0x28, 0x39, 0x30}, + {0x28, 0x3a, 0x92}, + {0x28, 0x3b, 0xf3}, + {0x28, 0x3c, 0xfc}, + {0x28, 0x3d, 0xb6}, + {0x28, 0x3e, 0xb5}, + {0x28, 0x3f, 0x2b}, + {0x28, 0x40, 0x05}, // Biquad - BQ12 Right - Filter: Equalizer (Q Factor) Frequency: 3150 Hz Gain: -13dB QVal: 0.7 Bandwidth: 1000 Hz + {0x28, 0x41, 0x89}, + {0x28, 0x42, 0x4c}, + {0x28, 0x43, 0x9d}, + {0x28, 0x44, 0xf6}, + {0x28, 0x45, 0x8d}, + {0x28, 0x46, 0x92}, + {0x28, 0x47, 0xbe}, + {0x28, 0x48, 0x04}, + {0x28, 0x49, 0x1d}, + {0x28, 0x4a, 0x73}, + {0x28, 0x4b, 0x83}, + {0x28, 0x4c, 0x09}, + {0x28, 0x4d, 0x72}, + {0x28, 0x4e, 0x6d}, + {0x28, 0x4f, 0x42}, + {0x28, 0x50, 0xfe}, + {0x28, 0x51, 0x59}, + {0x28, 0x52, 0x3f}, + {0x28, 0x53, 0xe0}, + {0x28, 0x54, 0x04}, // Biquad - BQ13 Right - Filter: Equalizer (Q Factor) Frequency: 5000 Hz Gain: -13dB QVal: 0.6 Bandwidth: 1000 Hz + {0x28, 0x55, 0x97}, + {0x28, 0x56, 0x15}, + {0x28, 0x57, 0xf5}, + {0x28, 0x58, 0xf9}, + {0x28, 0x59, 0x2b}, + {0x28, 0x5a, 0x68}, + {0x28, 0x5b, 0x19}, + {0x28, 0x5c, 0x02}, + {0x28, 0x5d, 0x9f}, + {0x28, 0x5e, 0x81}, + {0x28, 0x5f, 0x88}, + {0x28, 0x60, 0x06}, + {0x28, 0x61, 0xd4}, + {0x28, 0x62, 0x97}, + {0x28, 0x63, 0xe7}, + {0x28, 0x64, 0x00}, + {0x28, 0x65, 0xc9}, + {0x28, 0x66, 0x68}, + {0x28, 0x67, 0x83}, + {0x28, 0x68, 0x03}, // Biquad - BQ14 Right - Filter: Equalizer (Q Factor) Frequency: 8000 Hz Gain: -13dB QVal: 0.6 Bandwidth: 1000 Hz + {0x28, 0x69, 0xe5}, + {0x28, 0x6a, 0x7c}, + {0x28, 0x6b, 0x35}, + {0x28, 0x6c, 0xfb}, + {0x28, 0x6d, 0x4d}, + {0x28, 0x6e, 0x25}, + {0x28, 0x6f, 0xec}, + {0x28, 0x70, 0x01}, + {0x28, 0x71, 0x87}, + {0x28, 0x72, 0x72}, + {0x28, 0x73, 0xd2}, + {0x28, 0x74, 0x04}, + {0x28, 0x75, 0xb2}, + {0x28, 0x76, 0xda}, + {0x28, 0x77, 0x14}, + {0x28, 0x78, 0x02}, + {0x28, 0x79, 0x93}, + {0x28, 0x7a, 0x10}, + {0x28, 0x7b, 0xf9}, + {0x28, 0x7c, 0x02}, // Biquad - BQ15 Right - Filter: Equalizer (Q Factor) Frequency: 16000 Hz Gain: -13dB QVal: 0.5 Bandwidth: 1000 Hz + {0x28, 0x7d, 0xe2}, + {0x28, 0x7e, 0x72}, + {0x28, 0x7f, 0xe0}, + {0x29, 0x08, 0xfe}, + {0x29, 0x09, 0x97}, + {0x29, 0x0a, 0x49}, + {0x29, 0x0b, 0xba}, + {0x29, 0x0c, 0xff}, + {0x29, 0x0d, 0xee}, + {0x29, 0x0e, 0xf9}, + {0x29, 0x0f, 0xac}, + {0x29, 0x10, 0x01}, + {0x29, 0x11, 0x68}, + {0x29, 0x12, 0xb6}, + {0x29, 0x13, 0x46}, + {0x29, 0x14, 0x05}, + {0x29, 0x15, 0x2e}, + {0x29, 0x16, 0x93}, + {0x29, 0x17, 0x74}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_right_mc[TAS5805M_EQ_REG_PER_STEP] = { + {0x26, 0x54, 0x07}, // Biquad - BQ1 Right - Filter: Equalizer (Q Factor) Frequency: 20 Hz Gain: -12dB QVal: 2 Bandwidth: 1000 Hz + {0x26, 0x55, 0xfe}, + {0x26, 0x56, 0x01}, + {0x26, 0x57, 0x32}, + {0x26, 0x58, 0xf0}, + {0x26, 0x59, 0x05}, + {0x26, 0x5a, 0x55}, + {0x26, 0x5b, 0x35}, + {0x26, 0x5c, 0x07}, + {0x26, 0x5d, 0xfc}, + {0x26, 0x5e, 0xaa}, + {0x26, 0x5f, 0x7f}, + {0x26, 0x60, 0x0f}, + {0x26, 0x61, 0xfa}, + {0x26, 0x62, 0xaa}, + {0x26, 0x63, 0xcb}, + {0x26, 0x64, 0xf8}, + {0x26, 0x65, 0x05}, + {0x26, 0x66, 0x54}, + {0x26, 0x67, 0x4f}, + {0x26, 0x68, 0x07}, // Biquad - BQ2 Right - Filter: Equalizer (Q Factor) Frequency: 31.5 Hz Gain: -12dB QVal: 2 Bandwidth: 1000 Hz + {0x26, 0x69, 0xfc}, + {0x26, 0x6a, 0xdc}, + {0x26, 0x6b, 0x15}, + {0x26, 0x6c, 0xf0}, + {0x26, 0x6d, 0x08}, + {0x26, 0x6e, 0x65}, + {0x26, 0x6f, 0x68}, + {0x26, 0x70, 0x07}, + {0x26, 0x71, 0xfa}, + {0x26, 0x72, 0xc0}, + {0x26, 0x73, 0xbc}, + {0x26, 0x74, 0x0f}, + {0x26, 0x75, 0xf7}, + {0x26, 0x76, 0x9a}, + {0x26, 0x77, 0x98}, + {0x26, 0x78, 0xf8}, + {0x26, 0x79, 0x08}, + {0x26, 0x7a, 0x63}, + {0x26, 0x7b, 0x2f}, + {0x26, 0x7c, 0x07}, // Biquad - BQ3 Right - Filter: Equalizer (Q Factor) Frequency: 50 Hz Gain: -12dB QVal: 1.5 Bandwidth: 1000 Hz + {0x26, 0x7d, 0xf9}, + {0x26, 0x7e, 0x5e}, + {0x26, 0x7f, 0x78}, + {0x27, 0x08, 0xf0}, + {0x27, 0x09, 0x11}, + {0x27, 0x0a, 0xbb}, + {0x27, 0x0b, 0x87}, + {0x27, 0x0c, 0x07}, + {0x27, 0x0d, 0xf4}, + {0x27, 0x0e, 0xeb}, + {0x27, 0x0f, 0x98}, + {0x27, 0x10, 0x0f}, + {0x27, 0x11, 0xee}, + {0x27, 0x12, 0x44}, + {0x27, 0x13, 0x79}, + {0x27, 0x14, 0xf8}, + {0x27, 0x15, 0x11}, + {0x27, 0x16, 0xb5}, + {0x27, 0x17, 0xf0}, + {0x27, 0x18, 0x07}, // Biquad - BQ4 Right - Filter: Equalizer (Q Factor) Frequency: 80 Hz Gain: -12dB QVal: 1.5 Bandwidth: 1000 Hz + {0x27, 0x19, 0xf5}, + {0x27, 0x1a, 0x6a}, + {0x27, 0x1b, 0xfa}, + {0x27, 0x1c, 0xf0}, + {0x27, 0x1d, 0x1c}, + {0x27, 0x1e, 0x51}, + {0x27, 0x1f, 0xcd}, + {0x27, 0x20, 0x07}, + {0x27, 0x21, 0xee}, + {0x27, 0x22, 0x51}, + {0x27, 0x23, 0x7f}, + {0x27, 0x24, 0x0f}, + {0x27, 0x25, 0xe3}, + {0x27, 0x26, 0xae}, + {0x27, 0x27, 0x33}, + {0x27, 0x28, 0xf8}, + {0x27, 0x29, 0x1c}, + {0x27, 0x2a, 0x43}, + {0x27, 0x2b, 0x87}, + {0x27, 0x2c, 0x07}, // Biquad - BQ5 Right - Filter: Equalizer (Q Factor) Frequency: 125 Hz Gain: -12dB QVal: 1 Bandwidth: 1000 Hz + {0x27, 0x2d, 0xe7}, + {0x27, 0x2e, 0x6d}, + {0x27, 0x2f, 0x10}, + {0x27, 0x30, 0xf0}, + {0x27, 0x31, 0x41}, + {0x27, 0x32, 0xc4}, + {0x27, 0x33, 0xff}, + {0x27, 0x34, 0x07}, + {0x27, 0x35, 0xd6}, + {0x27, 0x36, 0xf0}, + {0x27, 0x37, 0x79}, + {0x27, 0x38, 0x0f}, + {0x27, 0x39, 0xbe}, + {0x27, 0x3a, 0x3b}, + {0x27, 0x3b, 0x01}, + {0x27, 0x3c, 0xf8}, + {0x27, 0x3d, 0x41}, + {0x27, 0x3e, 0xa2}, + {0x27, 0x3f, 0x77}, + {0x27, 0x40, 0x07}, // Biquad - BQ6 Right - Filter: Equalizer (Q Factor) Frequency: 200 Hz Gain: -12dB QVal: 1 Bandwidth: 1000 Hz + {0x27, 0x41, 0xd9}, + {0x27, 0x42, 0x0e}, + {0x27, 0x43, 0x5a}, + {0x27, 0x44, 0xf0}, + {0x27, 0x45, 0x68}, + {0x27, 0x46, 0x5b}, + {0x27, 0x47, 0x7d}, + {0x27, 0x48, 0x07}, + {0x27, 0x49, 0xbe}, + {0x27, 0x4a, 0xed}, + {0x27, 0x4b, 0xb7}, + {0x27, 0x4c, 0x0f}, + {0x27, 0x4d, 0x97}, + {0x27, 0x4e, 0xa4}, + {0x27, 0x4f, 0x83}, + {0x27, 0x50, 0xf8}, + {0x27, 0x51, 0x68}, + {0x27, 0x52, 0x03}, + {0x27, 0x53, 0xef}, + {0x27, 0x54, 0x07}, // Biquad - BQ7 Right - Filter: Equalizer (Q Factor) Frequency: 315 Hz Gain: -12dB QVal: 0.9 Bandwidth: 1000 Hz + {0x27, 0x55, 0xbd}, + {0x27, 0x56, 0x1f}, + {0x27, 0x57, 0x31}, + {0x27, 0x58, 0xf0}, + {0x27, 0x59, 0xb3}, + {0x27, 0x5a, 0x75}, + {0x27, 0x5b, 0x15}, + {0x27, 0x5c, 0x07}, + {0x27, 0x5d, 0x90}, + {0x27, 0x5e, 0x40}, + {0x27, 0x5f, 0xd9}, + {0x27, 0x60, 0x0f}, + {0x27, 0x61, 0x4c}, + {0x27, 0x62, 0x8a}, + {0x27, 0x63, 0xeb}, + {0x27, 0x64, 0xf8}, + {0x27, 0x65, 0xb2}, + {0x27, 0x66, 0x9f}, + {0x27, 0x67, 0xf5}, + {0x27, 0x68, 0x07}, // Biquad - BQ8 Right - Filter: Equalizer (Q Factor) Frequency: 500 Hz Gain: -12dB QVal: 0.9 Bandwidth: 1000 Hz + {0x27, 0x69, 0x98}, + {0x27, 0x6a, 0x7e}, + {0x27, 0x6b, 0xc3}, + {0x27, 0x6c, 0xf1}, + {0x27, 0x6d, 0x16}, + {0x27, 0x6e, 0x7e}, + {0x27, 0x6f, 0xfe}, + {0x27, 0x70, 0x07}, + {0x27, 0x71, 0x53}, + {0x27, 0x72, 0x0d}, + {0x27, 0x73, 0xc6}, + {0x27, 0x74, 0x0e}, + {0x27, 0x75, 0xe9}, + {0x27, 0x76, 0x81}, + {0x27, 0x77, 0x02}, + {0x27, 0x78, 0xf9}, + {0x27, 0x79, 0x14}, + {0x27, 0x7a, 0x73}, + {0x27, 0x7b, 0x77}, + {0x27, 0x7c, 0x07}, // Biquad - BQ9 Right - Filter: Equalizer (Q Factor) Frequency: 800 Hz Gain: -12dB QVal: 0.8 Bandwidth: 1000 Hz + {0x27, 0x7d, 0x4f}, + {0x27, 0x7e, 0x3c}, + {0x27, 0x7f, 0x4e}, + {0x28, 0x08, 0xf1}, + {0x28, 0x09, 0xdd}, + {0x28, 0x0a, 0x16}, + {0x28, 0x0b, 0x22}, + {0x28, 0x0c, 0x06}, + {0x28, 0x0d, 0xd8}, + {0x28, 0x0e, 0xa4}, + {0x28, 0x0f, 0xf6}, + {0x28, 0x10, 0x0e}, + {0x28, 0x11, 0x22}, + {0x28, 0x12, 0xe9}, + {0x28, 0x13, 0xde}, + {0x28, 0x14, 0xf9}, + {0x28, 0x15, 0xd8}, + {0x28, 0x16, 0x1e}, + {0x28, 0x17, 0xbb}, + {0x28, 0x18, 0x06}, // Biquad - BQ10 Right - Filter: Equalizer (Q Factor) Frequency: 1250 Hz Gain: -12dB QVal: 0.8 Bandwidth: 1000 Hz + {0x28, 0x19, 0xfc}, + {0x28, 0x1a, 0x9f}, + {0x28, 0x1b, 0x5e}, + {0x28, 0x1c, 0xf2}, + {0x28, 0x1d, 0xc0}, + {0x28, 0x1e, 0x27}, + {0x28, 0x1f, 0x78}, + {0x28, 0x20, 0x06}, + {0x28, 0x21, 0x4e}, + {0x28, 0x22, 0x9b}, + {0x28, 0x23, 0x35}, + {0x28, 0x24, 0x0d}, + {0x28, 0x25, 0x3f}, + {0x28, 0x26, 0xd8}, + {0x28, 0x27, 0x88}, + {0x28, 0x28, 0xfa}, + {0x28, 0x29, 0xb4}, + {0x28, 0x2a, 0xc5}, + {0x28, 0x2b, 0x6c}, + {0x28, 0x2c, 0x06}, // Biquad - BQ11 Right - Filter: Equalizer (Q Factor) Frequency: 2000 Hz Gain: -12dB QVal: 0.7 Bandwidth: 1000 Hz + {0x28, 0x2d, 0x60}, + {0x28, 0x2e, 0x01}, + {0x28, 0x2f, 0xbb}, + {0x28, 0x30, 0xf4}, + {0x28, 0x31, 0x70}, + {0x28, 0x32, 0x9c}, + {0x28, 0x33, 0xd6}, + {0x28, 0x34, 0x05}, + {0x28, 0x35, 0x48}, + {0x28, 0x36, 0xea}, + {0x28, 0x37, 0xc3}, + {0x28, 0x38, 0x0b}, + {0x28, 0x39, 0x8f}, + {0x28, 0x3a, 0x63}, + {0x28, 0x3b, 0x2a}, + {0x28, 0x3c, 0xfc}, + {0x28, 0x3d, 0x57}, + {0x28, 0x3e, 0x13}, + {0x28, 0x3f, 0x82}, + {0x28, 0x40, 0x05}, // Biquad - BQ12 Right - Filter: Equalizer (Q Factor) Frequency: 3150 Hz Gain: -12dB QVal: 0.7 Bandwidth: 1000 Hz + {0x28, 0x41, 0xc9}, + {0x28, 0x42, 0x36}, + {0x28, 0x43, 0xe1}, + {0x28, 0x44, 0xf6}, + {0x28, 0x45, 0x20}, + {0x28, 0x46, 0x82}, + {0x28, 0x47, 0xc7}, + {0x28, 0x48, 0x04}, + {0x28, 0x49, 0x4c}, + {0x28, 0x4a, 0xf5}, + {0x28, 0x4b, 0x45}, + {0x28, 0x4c, 0x09}, + {0x28, 0x4d, 0xdf}, + {0x28, 0x4e, 0x7d}, + {0x28, 0x4f, 0x39}, + {0x28, 0x50, 0xfd}, + {0x28, 0x51, 0xe9}, + {0x28, 0x52, 0xd3}, + {0x28, 0x53, 0xd9}, + {0x28, 0x54, 0x04}, // Biquad - BQ13 Right - Filter: Equalizer (Q Factor) Frequency: 5000 Hz Gain: -12dB QVal: 0.6 Bandwidth: 1000 Hz + {0x28, 0x55, 0xe1}, + {0x28, 0x56, 0xb8}, + {0x28, 0x57, 0xb8}, + {0x28, 0x58, 0xf8}, + {0x28, 0x59, 0xbc}, + {0x28, 0x5a, 0x58}, + {0x28, 0x5b, 0x2b}, + {0x28, 0x5c, 0x02}, + {0x28, 0x5d, 0xca}, + {0x28, 0x5e, 0x28}, + {0x28, 0x5f, 0x25}, + {0x28, 0x60, 0x07}, + {0x28, 0x61, 0x43}, + {0x28, 0x62, 0xa7}, + {0x28, 0x63, 0xd5}, + {0x28, 0x64, 0x00}, + {0x28, 0x65, 0x54}, + {0x28, 0x66, 0x1f}, + {0x28, 0x67, 0x24}, + {0x28, 0x68, 0x04}, // Biquad - BQ14 Right - Filter: Equalizer (Q Factor) Frequency: 8000 Hz Gain: -12dB QVal: 0.6 Bandwidth: 1000 Hz + {0x28, 0x69, 0x32}, + {0x28, 0x6a, 0xba}, + {0x28, 0x6b, 0x9c}, + {0x28, 0x6c, 0xfa}, + {0x28, 0x6d, 0xf0}, + {0x28, 0x6e, 0x00}, + {0x28, 0x6f, 0x47}, + {0x28, 0x70, 0x01}, + {0x28, 0x71, 0xa5}, + {0x28, 0x72, 0xc3}, + {0x28, 0x73, 0x00}, + {0x28, 0x74, 0x05}, + {0x28, 0x75, 0x0f}, + {0x28, 0x76, 0xff}, + {0x28, 0x77, 0xb9}, + {0x28, 0x78, 0x02}, + {0x28, 0x79, 0x27}, + {0x28, 0x7a, 0x82}, + {0x28, 0x7b, 0x65}, + {0x28, 0x7c, 0x03}, // Biquad - BQ15 Right - Filter: Equalizer (Q Factor) Frequency: 16000 Hz Gain: -12dB QVal: 0.5 Bandwidth: 1000 Hz + {0x28, 0x7d, 0x2b}, + {0x28, 0x7e, 0x1f}, + {0x28, 0x7f, 0x0f}, + {0x29, 0x08, 0xfe}, + {0x29, 0x09, 0x73}, + {0x29, 0x0a, 0xca}, + {0x29, 0x0b, 0x18}, + {0x29, 0x0c, 0xff}, + {0x29, 0x0d, 0xed}, + {0x29, 0x0e, 0x4c}, + {0x29, 0x0f, 0xc2}, + {0x29, 0x10, 0x01}, + {0x29, 0x11, 0x8c}, + {0x29, 0x12, 0x35}, + {0x29, 0x13, 0xe8}, + {0x29, 0x14, 0x04}, + {0x29, 0x15, 0xe7}, + {0x29, 0x16, 0x94}, + {0x29, 0x17, 0x2f}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_right_mb[TAS5805M_EQ_REG_PER_STEP] = { + {0x26, 0x54, 0x07}, // Biquad - BQ1 Right - Filter: Equalizer (Q Factor) Frequency: 20 Hz Gain: -11dB QVal: 2 Bandwidth: 1000 Hz + {0x26, 0x55, 0xfe}, + {0x26, 0x56, 0x4b}, + {0x26, 0x57, 0x51}, + {0x26, 0x58, 0xf0}, + {0x26, 0x59, 0x04}, + {0x26, 0x5a, 0xc1}, + {0x26, 0x5b, 0x03}, + {0x26, 0x5c, 0x07}, + {0x26, 0x5d, 0xfc}, + {0x26, 0x5e, 0xf4}, + {0x26, 0x5f, 0x92}, + {0x26, 0x60, 0x0f}, + {0x26, 0x61, 0xfb}, + {0x26, 0x62, 0x3e}, + {0x26, 0x63, 0xfd}, + {0x26, 0x64, 0xf8}, + {0x26, 0x65, 0x04}, + {0x26, 0x66, 0xc0}, + {0x26, 0x67, 0x1d}, + {0x26, 0x68, 0x07}, // Biquad - BQ2 Right - Filter: Equalizer (Q Factor) Frequency: 31.5 Hz Gain: -11dB QVal: 2 Bandwidth: 1000 Hz + {0x26, 0x69, 0xfd}, + {0x26, 0x6a, 0x50}, + {0x26, 0x6b, 0xae}, + {0x26, 0x6c, 0xf0}, + {0x26, 0x6d, 0x07}, + {0x26, 0x6e, 0x7c}, + {0x26, 0x6f, 0x54}, + {0x26, 0x70, 0x07}, + {0x26, 0x71, 0xfb}, + {0x26, 0x72, 0x35}, + {0x26, 0x73, 0x37}, + {0x26, 0x74, 0x0f}, + {0x26, 0x75, 0xf8}, + {0x26, 0x76, 0x83}, + {0x26, 0x77, 0xac}, + {0x26, 0x78, 0xf8}, + {0x26, 0x79, 0x07}, + {0x26, 0x7a, 0x7a}, + {0x26, 0x7b, 0x1b}, + {0x26, 0x7c, 0x07}, // Biquad - BQ3 Right - Filter: Equalizer (Q Factor) Frequency: 50 Hz Gain: -11dB QVal: 1.5 Bandwidth: 1000 Hz + {0x26, 0x7d, 0xfa}, + {0x26, 0x7e, 0x54}, + {0x26, 0x7f, 0x51}, + {0x27, 0x08, 0xf0}, + {0x27, 0x09, 0x0f}, + {0x27, 0x0a, 0xd0}, + {0x27, 0x0b, 0x5f}, + {0x27, 0x0c, 0x07}, + {0x27, 0x0d, 0xf5}, + {0x27, 0x0e, 0xe0}, + {0x27, 0x0f, 0xe8}, + {0x27, 0x10, 0x0f}, + {0x27, 0x11, 0xf0}, + {0x27, 0x12, 0x2f}, + {0x27, 0x13, 0xa1}, + {0x27, 0x14, 0xf8}, + {0x27, 0x15, 0x0f}, + {0x27, 0x16, 0xca}, + {0x27, 0x17, 0xc7}, + {0x27, 0x18, 0x07}, // Biquad - BQ4 Right - Filter: Equalizer (Q Factor) Frequency: 80 Hz Gain: -11dB QVal: 1.5 Bandwidth: 1000 Hz + {0x27, 0x19, 0xf6}, + {0x27, 0x1a, 0xf2}, + {0x27, 0x1b, 0xab}, + {0x27, 0x1c, 0xf0}, + {0x27, 0x1d, 0x19}, + {0x27, 0x1e, 0x43}, + {0x27, 0x1f, 0xcc}, + {0x27, 0x20, 0x07}, + {0x27, 0x21, 0xef}, + {0x27, 0x22, 0xd7}, + {0x27, 0x23, 0xd2}, + {0x27, 0x24, 0x0f}, + {0x27, 0x25, 0xe6}, + {0x27, 0x26, 0xbc}, + {0x27, 0x27, 0x34}, + {0x27, 0x28, 0xf8}, + {0x27, 0x29, 0x19}, + {0x27, 0x2a, 0x35}, + {0x27, 0x2b, 0x83}, + {0x27, 0x2c, 0x07}, // Biquad - BQ5 Right - Filter: Equalizer (Q Factor) Frequency: 125 Hz Gain: -11dB QVal: 1 Bandwidth: 1000 Hz + {0x27, 0x2d, 0xea}, + {0x27, 0x2e, 0xf5}, + {0x27, 0x2f, 0x4d}, + {0x27, 0x30, 0xf0}, + {0x27, 0x31, 0x3a}, + {0x27, 0x32, 0xbb}, + {0x27, 0x33, 0xf2}, + {0x27, 0x34, 0x07}, + {0x27, 0x35, 0xda}, + {0x27, 0x36, 0x71}, + {0x27, 0x37, 0x58}, + {0x27, 0x38, 0x0f}, + {0x27, 0x39, 0xc5}, + {0x27, 0x3a, 0x44}, + {0x27, 0x3b, 0x0e}, + {0x27, 0x3c, 0xf8}, + {0x27, 0x3d, 0x3a}, + {0x27, 0x3e, 0x99}, + {0x27, 0x3f, 0x5b}, + {0x27, 0x40, 0x07}, // Biquad - BQ6 Right - Filter: Equalizer (Q Factor) Frequency: 200 Hz Gain: -11dB QVal: 1 Bandwidth: 1000 Hz + {0x27, 0x41, 0xde}, + {0x27, 0x42, 0x9e}, + {0x27, 0x43, 0xa2}, + {0x27, 0x44, 0xf0}, + {0x27, 0x45, 0x5d}, + {0x27, 0x46, 0x4d}, + {0x27, 0x47, 0xb0}, + {0x27, 0x48, 0x07}, + {0x27, 0x49, 0xc4}, + {0x27, 0x4a, 0x6b}, + {0x27, 0x4b, 0x7a}, + {0x27, 0x4c, 0x0f}, + {0x27, 0x4d, 0xa2}, + {0x27, 0x4e, 0xb2}, + {0x27, 0x4f, 0x50}, + {0x27, 0x50, 0xf8}, + {0x27, 0x51, 0x5c}, + {0x27, 0x52, 0xf5}, + {0x27, 0x53, 0xe4}, + {0x27, 0x54, 0x07}, // Biquad - BQ7 Right - Filter: Equalizer (Q Factor) Frequency: 315 Hz Gain: -11dB QVal: 0.9 Bandwidth: 1000 Hz + {0x27, 0x55, 0xc6}, + {0x27, 0x56, 0x8f}, + {0x27, 0x57, 0xe5}, + {0x27, 0x58, 0xf0}, + {0x27, 0x59, 0xa0}, + {0x27, 0x5a, 0xcb}, + {0x27, 0x5b, 0x6d}, + {0x27, 0x5c, 0x07}, + {0x27, 0x5d, 0x99}, + {0x27, 0x5e, 0x7a}, + {0x27, 0x5f, 0xd1}, + {0x27, 0x60, 0x0f}, + {0x27, 0x61, 0x5f}, + {0x27, 0x62, 0x34}, + {0x27, 0x63, 0x93}, + {0x27, 0x64, 0xf8}, + {0x27, 0x65, 0x9f}, + {0x27, 0x66, 0xf5}, + {0x27, 0x67, 0x4a}, + {0x27, 0x68, 0x07}, // Biquad - BQ8 Right - Filter: Equalizer (Q Factor) Frequency: 500 Hz Gain: -11dB QVal: 0.9 Bandwidth: 1000 Hz + {0x27, 0x69, 0xa6}, + {0x27, 0x6a, 0xdf}, + {0x27, 0x6b, 0x75}, + {0x27, 0x6c, 0xf0}, + {0x27, 0x6d, 0xfa}, + {0x27, 0x6e, 0x44}, + {0x27, 0x6f, 0xea}, + {0x27, 0x70, 0x07}, + {0x27, 0x71, 0x60}, + {0x27, 0x72, 0xeb}, + {0x27, 0x73, 0x07}, + {0x27, 0x74, 0x0f}, + {0x27, 0x75, 0x05}, + {0x27, 0x76, 0xbb}, + {0x27, 0x77, 0x16}, + {0x27, 0x78, 0xf8}, + {0x27, 0x79, 0xf8}, + {0x27, 0x7a, 0x35}, + {0x27, 0x7b, 0x84}, + {0x27, 0x7c, 0x07}, // Biquad - BQ9 Right - Filter: Equalizer (Q Factor) Frequency: 800 Hz Gain: -11dB QVal: 0.8 Bandwidth: 1000 Hz + {0x27, 0x7d, 0x66}, + {0x27, 0x7e, 0xfd}, + {0x27, 0x7f, 0x29}, + {0x28, 0x08, 0xf1}, + {0x28, 0x09, 0xaf}, + {0x28, 0x0a, 0x25}, + {0x28, 0x0b, 0xf1}, + {0x28, 0x0c, 0x06}, + {0x28, 0x0d, 0xee}, + {0x28, 0x0e, 0xe4}, + {0x28, 0x0f, 0x70}, + {0x28, 0x10, 0x0e}, + {0x28, 0x11, 0x50}, + {0x28, 0x12, 0xda}, + {0x28, 0x13, 0x0f}, + {0x28, 0x14, 0xf9}, + {0x28, 0x15, 0xaa}, + {0x28, 0x16, 0x1e}, + {0x28, 0x17, 0x67}, + {0x28, 0x18, 0x07}, // Biquad - BQ10 Right - Filter: Equalizer (Q Factor) Frequency: 1250 Hz Gain: -11dB QVal: 0.8 Bandwidth: 1000 Hz + {0x28, 0x19, 0x1e}, + {0x28, 0x1a, 0x23}, + {0x28, 0x1b, 0x28}, + {0x28, 0x1c, 0xf2}, + {0x28, 0x1d, 0x80}, + {0x28, 0x1e, 0x99}, + {0x28, 0x1f, 0x3b}, + {0x28, 0x20, 0x06}, + {0x28, 0x21, 0x6c}, + {0x28, 0x22, 0xdc}, + {0x28, 0x23, 0x43}, + {0x28, 0x24, 0x0d}, + {0x28, 0x25, 0x7f}, + {0x28, 0x26, 0x66}, + {0x28, 0x27, 0xc5}, + {0x28, 0x28, 0xfa}, + {0x28, 0x29, 0x75}, + {0x28, 0x2a, 0x00}, + {0x28, 0x2b, 0x96}, + {0x28, 0x2c, 0x06}, // Biquad - BQ11 Right - Filter: Equalizer (Q Factor) Frequency: 2000 Hz Gain: -11dB QVal: 0.7 Bandwidth: 1000 Hz + {0x28, 0x2d, 0x91}, + {0x28, 0x2e, 0x9c}, + {0x28, 0x2f, 0xe7}, + {0x28, 0x30, 0xf4}, + {0x28, 0x31, 0x16}, + {0x28, 0x32, 0xa8}, + {0x28, 0x33, 0xe3}, + {0x28, 0x34, 0x05}, + {0x28, 0x35, 0x72}, + {0x28, 0x36, 0x0a}, + {0x28, 0x37, 0x3f}, + {0x28, 0x38, 0x0b}, + {0x28, 0x39, 0xe9}, + {0x28, 0x3a, 0x57}, + {0x28, 0x3b, 0x1d}, + {0x28, 0x3c, 0xfb}, + {0x28, 0x3d, 0xfc}, + {0x28, 0x3e, 0x58}, + {0x28, 0x3f, 0xda}, + {0x28, 0x40, 0x06}, // Biquad - BQ12 Right - Filter: Equalizer (Q Factor) Frequency: 3150 Hz Gain: -11dB QVal: 0.7 Bandwidth: 1000 Hz + {0x28, 0x41, 0x07}, + {0x28, 0x42, 0x3d}, + {0x28, 0x43, 0x9b}, + {0x28, 0x44, 0xf5}, + {0x28, 0x45, 0xb6}, + {0x28, 0x46, 0xab}, + {0x28, 0x47, 0xe9}, + {0x28, 0x48, 0x04}, + {0x28, 0x49, 0x7b}, + {0x28, 0x4a, 0x0f}, + {0x28, 0x4b, 0x9f}, + {0x28, 0x4c, 0x0a}, + {0x28, 0x4d, 0x49}, + {0x28, 0x4e, 0x54}, + {0x28, 0x4f, 0x17}, + {0x28, 0x50, 0xfd}, + {0x28, 0x51, 0x7d}, + {0x28, 0x52, 0xb2}, + {0x28, 0x53, 0xc7}, + {0x28, 0x54, 0x05}, // Biquad - BQ13 Right - Filter: Equalizer (Q Factor) Frequency: 5000 Hz Gain: -11dB QVal: 0.6 Bandwidth: 1000 Hz + {0x28, 0x55, 0x2c}, + {0x28, 0x56, 0xb5}, + {0x28, 0x57, 0xf2}, + {0x28, 0x58, 0xf8}, + {0x28, 0x59, 0x4c}, + {0x28, 0x5a, 0xc1}, + {0x28, 0x5b, 0x9e}, + {0x28, 0x5c, 0x02}, + {0x28, 0x5d, 0xf5}, + {0x28, 0x5e, 0x02}, + {0x28, 0x5f, 0x74}, + {0x28, 0x60, 0x07}, + {0x28, 0x61, 0xb3}, + {0x28, 0x62, 0x3e}, + {0x28, 0x63, 0x62}, + {0x28, 0x64, 0xff}, + {0x28, 0x65, 0xde}, + {0x28, 0x66, 0x47}, + {0x28, 0x67, 0x9a}, + {0x28, 0x68, 0x04}, // Biquad - BQ14 Right - Filter: Equalizer (Q Factor) Frequency: 8000 Hz Gain: -11dB QVal: 0.6 Bandwidth: 1000 Hz + {0x28, 0x69, 0x82}, + {0x28, 0x6a, 0x67}, + {0x28, 0x6b, 0x0a}, + {0x28, 0x6c, 0xfa}, + {0x28, 0x6d, 0x8f}, + {0x28, 0x6e, 0xec}, + {0x28, 0x6f, 0x8a}, + {0x28, 0x70, 0x01}, + {0x28, 0x71, 0xc5}, + {0x28, 0x72, 0x07}, + {0x28, 0x73, 0x48}, + {0x28, 0x74, 0x05}, + {0x28, 0x75, 0x70}, + {0x28, 0x76, 0x13}, + {0x28, 0x77, 0x76}, + {0x28, 0x78, 0x01}, + {0x28, 0x79, 0xb8}, + {0x28, 0x7a, 0x91}, + {0x28, 0x7b, 0xae}, + {0x28, 0x7c, 0x03}, // Biquad - BQ15 Right - Filter: Equalizer (Q Factor) Frequency: 16000 Hz Gain: -11dB QVal: 0.5 Bandwidth: 1000 Hz + {0x28, 0x7d, 0x79}, + {0x28, 0x7e, 0x1a}, + {0x28, 0x7f, 0xdc}, + {0x29, 0x08, 0xfe}, + {0x29, 0x09, 0x4d}, + {0x29, 0x0a, 0xb2}, + {0x29, 0x0b, 0x52}, + {0x29, 0x0c, 0xff}, + {0x29, 0x0d, 0xeb}, + {0x29, 0x0e, 0x80}, + {0x29, 0x0f, 0x7f}, + {0x29, 0x10, 0x01}, + {0x29, 0x11, 0xb2}, + {0x29, 0x12, 0x4d}, + {0x29, 0x13, 0xae}, + {0x29, 0x14, 0x04}, + {0x29, 0x15, 0x9b}, + {0x29, 0x16, 0x64}, + {0x29, 0x17, 0xa5}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_right_ma[TAS5805M_EQ_REG_PER_STEP] = { + {0x26, 0x54, 0x07}, // Biquad - BQ1 Right - Filter: Equalizer (Q Factor) Frequency: 20 Hz Gain: -10dB QVal: 2 Bandwidth: 1000 Hz + {0x26, 0x55, 0xfe}, + {0x26, 0x56, 0x8d}, + {0x26, 0x57, 0x65}, + {0x26, 0x58, 0xf0}, + {0x26, 0x59, 0x04}, + {0x26, 0x5a, 0x3c}, + {0x26, 0x5b, 0xe6}, + {0x26, 0x5c, 0x07}, + {0x26, 0x5d, 0xfd}, + {0x26, 0x5e, 0x36}, + {0x26, 0x5f, 0x9b}, + {0x26, 0x60, 0x0f}, + {0x26, 0x61, 0xfb}, + {0x26, 0x62, 0xc3}, + {0x26, 0x63, 0x1a}, + {0x26, 0x64, 0xf8}, + {0x26, 0x65, 0x04}, + {0x26, 0x66, 0x3c}, + {0x26, 0x67, 0x00}, + {0x26, 0x68, 0x07}, // Biquad - BQ2 Right - Filter: Equalizer (Q Factor) Frequency: 31.5 Hz Gain: -10dB QVal: 2 Bandwidth: 1000 Hz + {0x26, 0x69, 0xfd}, + {0x26, 0x6a, 0xb8}, + {0x26, 0x6b, 0xa5}, + {0x26, 0x6c, 0xf0}, + {0x26, 0x6d, 0x06}, + {0x26, 0x6e, 0xac}, + {0x26, 0x6f, 0x83}, + {0x26, 0x70, 0x07}, + {0x26, 0x71, 0xfb}, + {0x26, 0x72, 0x9d}, + {0x26, 0x73, 0x12}, + {0x26, 0x74, 0x0f}, + {0x26, 0x75, 0xf9}, + {0x26, 0x76, 0x53}, + {0x26, 0x77, 0x7d}, + {0x26, 0x78, 0xf8}, + {0x26, 0x79, 0x06}, + {0x26, 0x7a, 0xaa}, + {0x26, 0x7b, 0x49}, + {0x26, 0x7c, 0x07}, // Biquad - BQ3 Right - Filter: Equalizer (Q Factor) Frequency: 50 Hz Gain: -10dB QVal: 1.5 Bandwidth: 1000 Hz + {0x26, 0x7d, 0xfb}, + {0x26, 0x7e, 0x2f}, + {0x26, 0x7f, 0xa0}, + {0x27, 0x08, 0xf0}, + {0x27, 0x09, 0x0e}, + {0x27, 0x0a, 0x1a}, + {0x27, 0x0b, 0x3c}, + {0x27, 0x0c, 0x07}, + {0x27, 0x0d, 0xf6}, + {0x27, 0x0e, 0xbb}, + {0x27, 0x0f, 0xbd}, + {0x27, 0x10, 0x0f}, + {0x27, 0x11, 0xf1}, + {0x27, 0x12, 0xe5}, + {0x27, 0x13, 0xc4}, + {0x27, 0x14, 0xf8}, + {0x27, 0x15, 0x0e}, + {0x27, 0x16, 0x14}, + {0x27, 0x17, 0xa4}, + {0x27, 0x18, 0x07}, // Biquad - BQ4 Right - Filter: Equalizer (Q Factor) Frequency: 80 Hz Gain: -10dB QVal: 1.5 Bandwidth: 1000 Hz + {0x27, 0x19, 0xf8}, + {0x27, 0x1a, 0x50}, + {0x27, 0x1b, 0x42}, + {0x27, 0x1c, 0xf0}, + {0x27, 0x1d, 0x16}, + {0x27, 0x1e, 0x89}, + {0x27, 0x1f, 0xd9}, + {0x27, 0x20, 0x07}, + {0x27, 0x21, 0xf1}, + {0x27, 0x22, 0x34}, + {0x27, 0x23, 0x31}, + {0x27, 0x24, 0x0f}, + {0x27, 0x25, 0xe9}, + {0x27, 0x26, 0x76}, + {0x27, 0x27, 0x27}, + {0x27, 0x28, 0xf8}, + {0x27, 0x29, 0x16}, + {0x27, 0x2a, 0x7b}, + {0x27, 0x2b, 0x8d}, + {0x27, 0x2c, 0x07}, // Biquad - BQ5 Right - Filter: Equalizer (Q Factor) Frequency: 125 Hz Gain: -10dB QVal: 1 Bandwidth: 1000 Hz + {0x27, 0x2d, 0xee}, + {0x27, 0x2e, 0x1d}, + {0x27, 0x2f, 0xdf}, + {0x27, 0x30, 0xf0}, + {0x27, 0x31, 0x34}, + {0x27, 0x32, 0x71}, + {0x27, 0x33, 0x73}, + {0x27, 0x34, 0x07}, + {0x27, 0x35, 0xdd}, + {0x27, 0x36, 0x93}, + {0x27, 0x37, 0x53}, + {0x27, 0x38, 0x0f}, + {0x27, 0x39, 0xcb}, + {0x27, 0x3a, 0x8e}, + {0x27, 0x3b, 0x8d}, + {0x27, 0x3c, 0xf8}, + {0x27, 0x3d, 0x34}, + {0x27, 0x3e, 0x4e}, + {0x27, 0x3f, 0xce}, + {0x27, 0x40, 0x07}, // Biquad - BQ6 Right - Filter: Equalizer (Q Factor) Frequency: 200 Hz Gain: -10dB QVal: 1 Bandwidth: 1000 Hz + {0x27, 0x41, 0xe3}, + {0x27, 0x42, 0x9a}, + {0x27, 0x43, 0xb1}, + {0x27, 0x44, 0xf0}, + {0x27, 0x45, 0x53}, + {0x27, 0x46, 0x66}, + {0x27, 0x47, 0x62}, + {0x27, 0x48, 0x07}, + {0x27, 0x49, 0xc9}, + {0x27, 0x4a, 0x56}, + {0x27, 0x4b, 0xf0}, + {0x27, 0x4c, 0x0f}, + {0x27, 0x4d, 0xac}, + {0x27, 0x4e, 0x99}, + {0x27, 0x4f, 0x9e}, + {0x27, 0x50, 0xf8}, + {0x27, 0x51, 0x53}, + {0x27, 0x52, 0x0e}, + {0x27, 0x53, 0x5f}, + {0x27, 0x54, 0x07}, // Biquad - BQ7 Right - Filter: Equalizer (Q Factor) Frequency: 315 Hz Gain: -10dB QVal: 0.9 Bandwidth: 1000 Hz + {0x27, 0x55, 0xcf}, + {0x27, 0x56, 0x0d}, + {0x27, 0x57, 0x47}, + {0x27, 0x58, 0xf0}, + {0x27, 0x59, 0x90}, + {0x27, 0x5a, 0x02}, + {0x27, 0x5b, 0xcd}, + {0x27, 0x5c, 0x07}, + {0x27, 0x5d, 0xa1}, + {0x27, 0x5e, 0xc6}, + {0x27, 0x5f, 0xfa}, + {0x27, 0x60, 0x0f}, + {0x27, 0x61, 0x6f}, + {0x27, 0x62, 0xfd}, + {0x27, 0x63, 0x33}, + {0x27, 0x64, 0xf8}, + {0x27, 0x65, 0x8f}, + {0x27, 0x66, 0x2b}, + {0x27, 0x67, 0xbf}, + {0x27, 0x68, 0x07}, // Biquad - BQ8 Right - Filter: Equalizer (Q Factor) Frequency: 500 Hz Gain: -10dB QVal: 0.9 Bandwidth: 1000 Hz + {0x27, 0x69, 0xb3}, + {0x27, 0x6a, 0xde}, + {0x27, 0x6b, 0x0f}, + {0x27, 0x6c, 0xf0}, + {0x27, 0x6d, 0xe0}, + {0x27, 0x6e, 0xc2}, + {0x27, 0x6f, 0x02}, + {0x27, 0x70, 0x07}, + {0x27, 0x71, 0x6d}, + {0x27, 0x72, 0x72}, + {0x27, 0x73, 0xd4}, + {0x27, 0x74, 0x0f}, + {0x27, 0x75, 0x1f}, + {0x27, 0x76, 0x3d}, + {0x27, 0x77, 0xfe}, + {0x27, 0x78, 0xf8}, + {0x27, 0x79, 0xde}, + {0x27, 0x7a, 0xaf}, + {0x27, 0x7b, 0x1c}, + {0x27, 0x7c, 0x07}, // Biquad - BQ9 Right - Filter: Equalizer (Q Factor) Frequency: 800 Hz Gain: -10dB QVal: 0.8 Bandwidth: 1000 Hz + {0x27, 0x7d, 0x7c}, + {0x27, 0x7e, 0xac}, + {0x27, 0x7f, 0x54}, + {0x28, 0x08, 0xf1}, + {0x28, 0x09, 0x85}, + {0x28, 0x0a, 0x36}, + {0x28, 0x0b, 0x26}, + {0x28, 0x0c, 0x07}, + {0x28, 0x0d, 0x03}, + {0x28, 0x0e, 0x33}, + {0x28, 0x0f, 0xcb}, + {0x28, 0x10, 0x0e}, + {0x28, 0x11, 0x7a}, + {0x28, 0x12, 0xc9}, + {0x28, 0x13, 0xda}, + {0x28, 0x14, 0xf9}, + {0x28, 0x15, 0x80}, + {0x28, 0x16, 0x1f}, + {0x28, 0x17, 0xe1}, + {0x28, 0x18, 0x07}, // Biquad - BQ10 Right - Filter: Equalizer (Q Factor) Frequency: 1250 Hz Gain: -10dB QVal: 0.8 Bandwidth: 1000 Hz + {0x28, 0x19, 0x3d}, + {0x28, 0x1a, 0x15}, + {0x28, 0x1b, 0x7c}, + {0x28, 0x1c, 0xf2}, + {0x28, 0x1d, 0x45}, + {0x28, 0x1e, 0xe9}, + {0x28, 0x1f, 0xc3}, + {0x28, 0x20, 0x06}, + {0x28, 0x21, 0x88}, + {0x28, 0x22, 0xcb}, + {0x28, 0x23, 0xd2}, + {0x28, 0x24, 0x0d}, + {0x28, 0x25, 0xba}, + {0x28, 0x26, 0x16}, + {0x28, 0x27, 0x3d}, + {0x28, 0x28, 0xfa}, + {0x28, 0x29, 0x3a}, + {0x28, 0x2a, 0x1e}, + {0x28, 0x2b, 0xb2}, + {0x28, 0x2c, 0x06}, // Biquad - BQ11 Right - Filter: Equalizer (Q Factor) Frequency: 2000 Hz Gain: -10dB QVal: 0.7 Bandwidth: 1000 Hz + {0x28, 0x2d, 0xc0}, + {0x28, 0x2e, 0x6f}, + {0x28, 0x2f, 0xce}, + {0x28, 0x30, 0xf3}, + {0x28, 0x31, 0xc1}, + {0x28, 0x32, 0xc0}, + {0x28, 0x33, 0x87}, + {0x28, 0x34, 0x05}, + {0x28, 0x35, 0x98}, + {0x28, 0x36, 0xdb}, + {0x28, 0x37, 0x44}, + {0x28, 0x38, 0x0c}, + {0x28, 0x39, 0x3e}, + {0x28, 0x3a, 0x3f}, + {0x28, 0x3b, 0x79}, + {0x28, 0x3c, 0xfb}, + {0x28, 0x3d, 0xa6}, + {0x28, 0x3e, 0xb4}, + {0x28, 0x3f, 0xee}, + {0x28, 0x40, 0x06}, // Biquad - BQ12 Right - Filter: Equalizer (Q Factor) Frequency: 3150 Hz Gain: -10dB QVal: 0.7 Bandwidth: 1000 Hz + {0x28, 0x41, 0x43}, + {0x28, 0x42, 0x11}, + {0x28, 0x43, 0xc4}, + {0x28, 0x44, 0xf5}, + {0x28, 0x45, 0x50}, + {0x28, 0x46, 0x94}, + {0x28, 0x47, 0xfb}, + {0x28, 0x48, 0x04}, + {0x28, 0x49, 0xa7}, + {0x28, 0x4a, 0x87}, + {0x28, 0x4b, 0xd4}, + {0x28, 0x4c, 0x0a}, + {0x28, 0x4d, 0xaf}, + {0x28, 0x4e, 0x6b}, + {0x28, 0x4f, 0x05}, + {0x28, 0x50, 0xfd}, + {0x28, 0x51, 0x15}, + {0x28, 0x52, 0x66}, + {0x28, 0x53, 0x67}, + {0x28, 0x54, 0x05}, // Biquad - BQ13 Right - Filter: Equalizer (Q Factor) Frequency: 5000 Hz Gain: -10dB QVal: 0.6 Bandwidth: 1000 Hz + {0x28, 0x55, 0x77}, + {0x28, 0x56, 0x8e}, + {0x28, 0x57, 0xdc}, + {0x28, 0x58, 0xf7}, + {0x28, 0x59, 0xdd}, + {0x28, 0x5a, 0x61}, + {0x28, 0x5b, 0x1b}, + {0x28, 0x5c, 0x03}, + {0x28, 0x5d, 0x1f}, + {0x28, 0x5e, 0xc8}, + {0x28, 0x5f, 0x02}, + {0x28, 0x60, 0x08}, + {0x28, 0x61, 0x22}, + {0x28, 0x62, 0x9e}, + {0x28, 0x63, 0xe5}, + {0x28, 0x64, 0xff}, + {0x28, 0x65, 0x68}, + {0x28, 0x66, 0xa9}, + {0x28, 0x67, 0x21}, + {0x28, 0x68, 0x04}, // Biquad - BQ14 Right - Filter: Equalizer (Q Factor) Frequency: 8000 Hz Gain: -10dB QVal: 0.6 Bandwidth: 1000 Hz + {0x28, 0x69, 0xd4}, + {0x28, 0x6a, 0x12}, + {0x28, 0x6b, 0x63}, + {0x28, 0x6c, 0xfa}, + {0x28, 0x6d, 0x2d}, + {0x28, 0x6e, 0x70}, + {0x28, 0x6f, 0xb1}, + {0x28, 0x70, 0x01}, + {0x28, 0x71, 0xe5}, + {0x28, 0x72, 0x14}, + {0x28, 0x73, 0x10}, + {0x28, 0x74, 0x05}, + {0x28, 0x75, 0xd2}, + {0x28, 0x76, 0x8f}, + {0x28, 0x77, 0x4f}, + {0x28, 0x78, 0x01}, + {0x28, 0x79, 0x46}, + {0x28, 0x7a, 0xd9}, + {0x28, 0x7b, 0x8d}, + {0x28, 0x7c, 0x03}, // Biquad - BQ15 Right - Filter: Equalizer (Q Factor) Frequency: 16000 Hz Gain: -10dB QVal: 0.5 Bandwidth: 1000 Hz + {0x28, 0x7d, 0xcc}, + {0x28, 0x7e, 0x6e}, + {0x28, 0x7f, 0x15}, + {0x29, 0x08, 0xfe}, + {0x29, 0x09, 0x24}, + {0x29, 0x0a, 0xfe}, + {0x29, 0x0b, 0x9a}, + {0x29, 0x0c, 0xff}, + {0x29, 0x0d, 0xe9}, + {0x29, 0x0e, 0x94}, + {0x29, 0x0f, 0xb6}, + {0x29, 0x10, 0x01}, + {0x29, 0x11, 0xdb}, + {0x29, 0x12, 0x01}, + {0x29, 0x13, 0x66}, + {0x29, 0x14, 0x04}, + {0x29, 0x15, 0x49}, + {0x29, 0x16, 0xfd}, + {0x29, 0x17, 0x35}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_right_m9[TAS5805M_EQ_REG_PER_STEP] = { + {0x26, 0x54, 0x07}, // Biquad - BQ1 Right - Filter: Equalizer (Q Factor) Frequency: 20 Hz Gain: -9dB QVal: 2 Bandwidth: 1000 Hz + {0x26, 0x55, 0xfe}, + {0x26, 0x56, 0xc8}, + {0x26, 0x57, 0x4d}, + {0x26, 0x58, 0xf0}, + {0x26, 0x59, 0x03}, + {0x26, 0x5a, 0xc7}, + {0x26, 0x5b, 0x1f}, + {0x26, 0x5c, 0x07}, + {0x26, 0x5d, 0xfd}, + {0x26, 0x5e, 0x71}, + {0x26, 0x5f, 0x79}, + {0x26, 0x60, 0x0f}, + {0x26, 0x61, 0xfc}, + {0x26, 0x62, 0x38}, + {0x26, 0x63, 0xe1}, + {0x26, 0x64, 0xf8}, + {0x26, 0x65, 0x03}, + {0x26, 0x66, 0xc6}, + {0x26, 0x67, 0x3a}, + {0x26, 0x68, 0x07}, // Biquad - BQ2 Right - Filter: Equalizer (Q Factor) Frequency: 31.5 Hz Gain: -9dB QVal: 2 Bandwidth: 1000 Hz + {0x26, 0x69, 0xfe}, + {0x26, 0x6a, 0x15}, + {0x26, 0x6b, 0x56}, + {0x26, 0x6c, 0xf0}, + {0x26, 0x6d, 0x05}, + {0x26, 0x6e, 0xf3}, + {0x26, 0x6f, 0x39}, + {0x26, 0x70, 0x07}, + {0x26, 0x71, 0xfb}, + {0x26, 0x72, 0xf9}, + {0x26, 0x73, 0xaa}, + {0x26, 0x74, 0x0f}, + {0x26, 0x75, 0xfa}, + {0x26, 0x76, 0x0c}, + {0x26, 0x77, 0xc7}, + {0x26, 0x78, 0xf8}, + {0x26, 0x79, 0x05}, + {0x26, 0x7a, 0xf1}, + {0x26, 0x7b, 0x00}, + {0x26, 0x7c, 0x07}, // Biquad - BQ3 Right - Filter: Equalizer (Q Factor) Frequency: 50 Hz Gain: -9dB QVal: 1.5 Bandwidth: 1000 Hz + {0x26, 0x7d, 0xfb}, + {0x26, 0x7e, 0xf3}, + {0x26, 0x7f, 0x3d}, + {0x27, 0x08, 0xf0}, + {0x27, 0x09, 0x0c}, + {0x27, 0x0a, 0x93}, + {0x27, 0x0b, 0x70}, + {0x27, 0x0c, 0x07}, + {0x27, 0x0d, 0xf7}, + {0x27, 0x0e, 0x7e}, + {0x27, 0x0f, 0xec}, + {0x27, 0x10, 0x0f}, + {0x27, 0x11, 0xf3}, + {0x27, 0x12, 0x6c}, + {0x27, 0x13, 0x90}, + {0x27, 0x14, 0xf8}, + {0x27, 0x15, 0x0c}, + {0x27, 0x16, 0x8d}, + {0x27, 0x17, 0xd7}, + {0x27, 0x18, 0x07}, // Biquad - BQ4 Right - Filter: Equalizer (Q Factor) Frequency: 80 Hz Gain: -9dB QVal: 1.5 Bandwidth: 1000 Hz + {0x27, 0x19, 0xf9}, + {0x27, 0x1a, 0x88}, + {0x27, 0x1b, 0x39}, + {0x27, 0x1c, 0xf0}, + {0x27, 0x1d, 0x14}, + {0x27, 0x1e, 0x1b}, + {0x27, 0x1f, 0x02}, + {0x27, 0x20, 0x07}, + {0x27, 0x21, 0xf2}, + {0x27, 0x22, 0x6b}, + {0x27, 0x23, 0x12}, + {0x27, 0x24, 0x0f}, + {0x27, 0x25, 0xeb}, + {0x27, 0x26, 0xe4}, + {0x27, 0x27, 0xfe}, + {0x27, 0x28, 0xf8}, + {0x27, 0x29, 0x14}, + {0x27, 0x2a, 0x0c}, + {0x27, 0x2b, 0xb4}, + {0x27, 0x2c, 0x07}, // Biquad - BQ5 Right - Filter: Equalizer (Q Factor) Frequency: 125 Hz Gain: -9dB QVal: 1 Bandwidth: 1000 Hz + {0x27, 0x2d, 0xf0}, + {0x27, 0x2e, 0xf0}, + {0x27, 0x2f, 0xa2}, + {0x27, 0x30, 0xf0}, + {0x27, 0x31, 0x2e}, + {0x27, 0x32, 0xd1}, + {0x27, 0x33, 0xdc}, + {0x27, 0x34, 0x07}, + {0x27, 0x35, 0xe0}, + {0x27, 0x36, 0x60}, + {0x27, 0x37, 0x33}, + {0x27, 0x38, 0x0f}, + {0x27, 0x39, 0xd1}, + {0x27, 0x3a, 0x2e}, + {0x27, 0x3b, 0x24}, + {0x27, 0x3c, 0xf8}, + {0x27, 0x3d, 0x2e}, + {0x27, 0x3e, 0xaf}, + {0x27, 0x3f, 0x2a}, + {0x27, 0x40, 0x07}, // Biquad - BQ6 Right - Filter: Equalizer (Q Factor) Frequency: 200 Hz Gain: -9dB QVal: 1 Bandwidth: 1000 Hz + {0x27, 0x41, 0xe8}, + {0x27, 0x42, 0x11}, + {0x27, 0x43, 0x50}, + {0x27, 0x44, 0xf0}, + {0x27, 0x45, 0x4a}, + {0x27, 0x46, 0x88}, + {0x27, 0x47, 0x32}, + {0x27, 0x48, 0x07}, + {0x27, 0x49, 0xcd}, + {0x27, 0x4a, 0xbe}, + {0x27, 0x4b, 0xb3}, + {0x27, 0x4c, 0x0f}, + {0x27, 0x4d, 0xb5}, + {0x27, 0x4e, 0x77}, + {0x27, 0x4f, 0xce}, + {0x27, 0x50, 0xf8}, + {0x27, 0x51, 0x4a}, + {0x27, 0x52, 0x2f}, + {0x27, 0x53, 0xfd}, + {0x27, 0x54, 0x07}, // Biquad - BQ7 Right - Filter: Equalizer (Q Factor) Frequency: 315 Hz Gain: -9dB QVal: 0.9 Bandwidth: 1000 Hz + {0x27, 0x55, 0xd6}, + {0x27, 0x56, 0xad}, + {0x27, 0x57, 0xfd}, + {0x27, 0x58, 0xf0}, + {0x27, 0x59, 0x80}, + {0x27, 0x5a, 0xee}, + {0x27, 0x5b, 0x6b}, + {0x27, 0x5c, 0x07}, + {0x27, 0x5d, 0xa9}, + {0x27, 0x5e, 0x3b}, + {0x27, 0x5f, 0x77}, + {0x27, 0x60, 0x0f}, + {0x27, 0x61, 0x7f}, + {0x27, 0x62, 0x11}, + {0x27, 0x63, 0x95}, + {0x27, 0x64, 0xf8}, + {0x27, 0x65, 0x80}, + {0x27, 0x66, 0x16}, + {0x27, 0x67, 0x8c}, + {0x27, 0x68, 0x07}, // Biquad - BQ8 Right - Filter: Equalizer (Q Factor) Frequency: 500 Hz Gain: -9dB QVal: 0.9 Bandwidth: 1000 Hz + {0x27, 0x69, 0xbf}, + {0x27, 0x6a, 0x98}, + {0x27, 0x6b, 0x51}, + {0x27, 0x6c, 0xf0}, + {0x27, 0x6d, 0xc9}, + {0x27, 0x6e, 0xbb}, + {0x27, 0x6f, 0xdf}, + {0x27, 0x70, 0x07}, + {0x27, 0x71, 0x78}, + {0x27, 0x72, 0xc1}, + {0x27, 0x73, 0xde}, + {0x27, 0x74, 0x0f}, + {0x27, 0x75, 0x36}, + {0x27, 0x76, 0x44}, + {0x27, 0x77, 0x21}, + {0x27, 0x78, 0xf8}, + {0x27, 0x79, 0xc7}, + {0x27, 0x7a, 0xa5}, + {0x27, 0x7b, 0xd1}, + {0x27, 0x7c, 0x07}, // Biquad - BQ9 Right - Filter: Equalizer (Q Factor) Frequency: 800 Hz Gain: -9dB QVal: 0.8 Bandwidth: 1000 Hz + {0x27, 0x7d, 0x90}, + {0x27, 0x7e, 0x6b}, + {0x27, 0x7f, 0xfc}, + {0x28, 0x08, 0xf1}, + {0x28, 0x09, 0x5f}, + {0x28, 0x0a, 0x04}, + {0x28, 0x0b, 0xaa}, + {0x28, 0x0c, 0x07}, + {0x28, 0x0d, 0x15}, + {0x28, 0x0e, 0xb3}, + {0x28, 0x0f, 0x0b}, + {0x28, 0x10, 0x0e}, + {0x28, 0x11, 0xa0}, + {0x28, 0x12, 0xfb}, + {0x28, 0x13, 0x56}, + {0x28, 0x14, 0xf9}, + {0x28, 0x15, 0x59}, + {0x28, 0x16, 0xe0}, + {0x28, 0x17, 0xf9}, + {0x28, 0x18, 0x07}, // Biquad - BQ10 Right - Filter: Equalizer (Q Factor) Frequency: 1250 Hz Gain: -9dB QVal: 0.8 Bandwidth: 1000 Hz + {0x28, 0x19, 0x59}, + {0x28, 0x1a, 0x90}, + {0x28, 0x1b, 0x8c}, + {0x28, 0x1c, 0xf2}, + {0x28, 0x1d, 0x0f}, + {0x28, 0x1e, 0xe7}, + {0x28, 0x1f, 0x63}, + {0x28, 0x20, 0x06}, + {0x28, 0x21, 0xa2}, + {0x28, 0x22, 0x81}, + {0x28, 0x23, 0x88}, + {0x28, 0x24, 0x0d}, + {0x28, 0x25, 0xf0}, + {0x28, 0x26, 0x18}, + {0x28, 0x27, 0x9d}, + {0x28, 0x28, 0xfa}, + {0x28, 0x29, 0x03}, + {0x28, 0x2a, 0xed}, + {0x28, 0x2b, 0xec}, + {0x28, 0x2c, 0x06}, // Biquad - BQ11 Right - Filter: Equalizer (Q Factor) Frequency: 2000 Hz Gain: -9dB QVal: 0.7 Bandwidth: 1000 Hz + {0x28, 0x2d, 0xec}, + {0x28, 0x2e, 0x6c}, + {0x28, 0x2f, 0x0e}, + {0x28, 0x30, 0xf3}, + {0x28, 0x31, 0x71}, + {0x28, 0x32, 0xfd}, + {0x28, 0x33, 0xd5}, + {0x28, 0x34, 0x05}, + {0x28, 0x35, 0xbd}, + {0x28, 0x36, 0x51}, + {0x28, 0x37, 0xe6}, + {0x28, 0x38, 0x0c}, + {0x28, 0x39, 0x8e}, + {0x28, 0x3a, 0x02}, + {0x28, 0x3b, 0x2b}, + {0x28, 0x3c, 0xfb}, + {0x28, 0x3d, 0x56}, + {0x28, 0x3e, 0x42}, + {0x28, 0x3f, 0x0b}, + {0x28, 0x40, 0x06}, // Biquad - BQ12 Right - Filter: Equalizer (Q Factor) Frequency: 3150 Hz Gain: -9dB QVal: 0.7 Bandwidth: 1000 Hz + {0x28, 0x41, 0x7c}, + {0x28, 0x42, 0x70}, + {0x28, 0x43, 0xff}, + {0x28, 0x44, 0xf4}, + {0x28, 0x45, 0xee}, + {0x28, 0x46, 0xaf}, + {0x28, 0x47, 0x3d}, + {0x28, 0x48, 0x04}, + {0x28, 0x49, 0xd2}, + {0x28, 0x4a, 0x2c}, + {0x28, 0x4b, 0x91}, + {0x28, 0x4c, 0x0b}, + {0x28, 0x4d, 0x11}, + {0x28, 0x4e, 0x50}, + {0x28, 0x4f, 0xc3}, + {0x28, 0x50, 0xfc}, + {0x28, 0x51, 0xb1}, + {0x28, 0x52, 0x62}, + {0x28, 0x53, 0x70}, + {0x28, 0x54, 0x05}, // Biquad - BQ13 Right - Filter: Equalizer (Q Factor) Frequency: 5000 Hz Gain: -9dB QVal: 0.6 Bandwidth: 1000 Hz + {0x28, 0x55, 0xc1}, + {0x28, 0x56, 0xc5}, + {0x28, 0x57, 0xa1}, + {0x28, 0x58, 0xf7}, + {0x28, 0x59, 0x6e}, + {0x28, 0x5a, 0xf1}, + {0x28, 0x5b, 0xdf}, + {0x28, 0x5c, 0x03}, + {0x28, 0x5d, 0x4a}, + {0x28, 0x5e, 0x30}, + {0x28, 0x5f, 0xe9}, + {0x28, 0x60, 0x08}, + {0x28, 0x61, 0x91}, + {0x28, 0x62, 0x0e}, + {0x28, 0x63, 0x21}, + {0x28, 0x64, 0xfe}, + {0x28, 0x65, 0xf4}, + {0x28, 0x66, 0x09}, + {0x28, 0x67, 0x76}, + {0x28, 0x68, 0x05}, // Biquad - BQ14 Right - Filter: Equalizer (Q Factor) Frequency: 8000 Hz Gain: -9dB QVal: 0.6 Bandwidth: 1000 Hz + {0x28, 0x69, 0x27}, + {0x28, 0x6a, 0x41}, + {0x28, 0x6b, 0x04}, + {0x28, 0x6c, 0xf9}, + {0x28, 0x6d, 0xc9}, + {0x28, 0x6e, 0x21}, + {0x28, 0x6f, 0xd4}, + {0x28, 0x70, 0x02}, + {0x28, 0x71, 0x05}, + {0x28, 0x72, 0xb8}, + {0x28, 0x73, 0xd5}, + {0x28, 0x74, 0x06}, + {0x28, 0x75, 0x36}, + {0x28, 0x76, 0xde}, + {0x28, 0x77, 0x2c}, + {0x28, 0x78, 0x00}, + {0x28, 0x79, 0xd3}, + {0x28, 0x7a, 0x06}, + {0x28, 0x7b, 0x27}, + {0x28, 0x7c, 0x04}, // Biquad - BQ15 Right - Filter: Equalizer (Q Factor) Frequency: 16000 Hz Gain: -9dB QVal: 0.5 Bandwidth: 1000 Hz + {0x28, 0x7d, 0x25}, + {0x28, 0x7e, 0x0e}, + {0x28, 0x7f, 0x56}, + {0x29, 0x08, 0xfd}, + {0x29, 0x09, 0xf9}, + {0x29, 0x0a, 0xb4}, + {0x29, 0x0b, 0x03}, + {0x29, 0x0c, 0xff}, + {0x29, 0x0d, 0xe7}, + {0x29, 0x0e, 0x89}, + {0x29, 0x0f, 0xa4}, + {0x29, 0x10, 0x02}, + {0x29, 0x11, 0x06}, + {0x29, 0x12, 0x4b}, + {0x29, 0x13, 0xfd}, + {0x29, 0x14, 0x03}, + {0x29, 0x15, 0xf3}, + {0x29, 0x16, 0x68}, + {0x29, 0x17, 0x06}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_right_m8[TAS5805M_EQ_REG_PER_STEP] = { + {0x26, 0x54, 0x07}, // Biquad - BQ1 Right - Filter: Equalizer (Q Factor) Frequency: 20 Hz Gain: -8dB QVal: 2 Bandwidth: 1000 Hz + {0x26, 0x55, 0xfe}, + {0x26, 0x56, 0xfc}, + {0x26, 0x57, 0xd0}, + {0x26, 0x58, 0xf0}, + {0x26, 0x59, 0x03}, + {0x26, 0x5a, 0x5e}, + {0x26, 0x5b, 0x22}, + {0x26, 0x5c, 0x07}, + {0x26, 0x5d, 0xfd}, + {0x26, 0x5e, 0xa5}, + {0x26, 0x5f, 0xf3}, + {0x26, 0x60, 0x0f}, + {0x26, 0x61, 0xfc}, + {0x26, 0x62, 0xa1}, + {0x26, 0x63, 0xde}, + {0x26, 0x64, 0xf8}, + {0x26, 0x65, 0x03}, + {0x26, 0x66, 0x5d}, + {0x26, 0x67, 0x3c}, + {0x26, 0x68, 0x07}, // Biquad - BQ2 Right - Filter: Equalizer (Q Factor) Frequency: 31.5 Hz Gain: -8dB QVal: 2 Bandwidth: 1000 Hz + {0x26, 0x69, 0xfe}, + {0x26, 0x6a, 0x67}, + {0x26, 0x6b, 0xfa}, + {0x26, 0x6c, 0xf0}, + {0x26, 0x6d, 0x05}, + {0x26, 0x6e, 0x4e}, + {0x26, 0x6f, 0x08}, + {0x26, 0x70, 0x07}, + {0x26, 0x71, 0xfc}, + {0x26, 0x72, 0x4c}, + {0x26, 0x73, 0x38}, + {0x26, 0x74, 0x0f}, + {0x26, 0x75, 0xfa}, + {0x26, 0x76, 0xb1}, + {0x26, 0x77, 0xf8}, + {0x26, 0x78, 0xf8}, + {0x26, 0x79, 0x05}, + {0x26, 0x7a, 0x4b}, + {0x26, 0x7b, 0xce}, + {0x26, 0x7c, 0x07}, // Biquad - BQ3 Right - Filter: Equalizer (Q Factor) Frequency: 50 Hz Gain: -8dB QVal: 1.5 Bandwidth: 1000 Hz + {0x26, 0x7d, 0xfc}, + {0x26, 0x7e, 0xa1}, + {0x26, 0x7f, 0xb3}, + {0x27, 0x08, 0xf0}, + {0x27, 0x09, 0x0b}, + {0x27, 0x0a, 0x36}, + {0x27, 0x0b, 0xe4}, + {0x27, 0x0c, 0x07}, + {0x27, 0x0d, 0xf8}, + {0x27, 0x0e, 0x2d}, + {0x27, 0x0f, 0x02}, + {0x27, 0x10, 0x0f}, + {0x27, 0x11, 0xf4}, + {0x27, 0x12, 0xc9}, + {0x27, 0x13, 0x1c}, + {0x27, 0x14, 0xf8}, + {0x27, 0x15, 0x0b}, + {0x27, 0x16, 0x31}, + {0x27, 0x17, 0x4b}, + {0x27, 0x18, 0x07}, // Biquad - BQ4 Right - Filter: Equalizer (Q Factor) Frequency: 80 Hz Gain: -8dB QVal: 1.5 Bandwidth: 1000 Hz + {0x27, 0x19, 0xfa}, + {0x27, 0x1a, 0x9e}, + {0x27, 0x1b, 0x94}, + {0x27, 0x1c, 0xf0}, + {0x27, 0x1d, 0x11}, + {0x27, 0x1e, 0xef}, + {0x27, 0x1f, 0x46}, + {0x27, 0x20, 0x07}, + {0x27, 0x21, 0xf3}, + {0x27, 0x22, 0x80}, + {0x27, 0x23, 0x75}, + {0x27, 0x24, 0x0f}, + {0x27, 0x25, 0xee}, + {0x27, 0x26, 0x10}, + {0x27, 0x27, 0xba}, + {0x27, 0x28, 0xf8}, + {0x27, 0x29, 0x11}, + {0x27, 0x2a, 0xe0}, + {0x27, 0x2b, 0xf7}, + {0x27, 0x2c, 0x07}, // Biquad - BQ5 Right - Filter: Equalizer (Q Factor) Frequency: 125 Hz Gain: -8dB QVal: 1 Bandwidth: 1000 Hz + {0x27, 0x2d, 0xf3}, + {0x27, 0x2e, 0x76}, + {0x27, 0x2f, 0x7f}, + {0x27, 0x30, 0xf0}, + {0x27, 0x31, 0x29}, + {0x27, 0x32, 0xcb}, + {0x27, 0x33, 0x71}, + {0x27, 0x34, 0x07}, + {0x27, 0x35, 0xe2}, + {0x27, 0x36, 0xe0}, + {0x27, 0x37, 0xcc}, + {0x27, 0x38, 0x0f}, + {0x27, 0x39, 0xd6}, + {0x27, 0x3a, 0x34}, + {0x27, 0x3b, 0x8f}, + {0x27, 0x3c, 0xf8}, + {0x27, 0x3d, 0x29}, + {0x27, 0x3e, 0xa8}, + {0x27, 0x3f, 0xb5}, + {0x27, 0x40, 0x07}, // Biquad - BQ6 Right - Filter: Equalizer (Q Factor) Frequency: 200 Hz Gain: -8dB QVal: 1 Bandwidth: 1000 Hz + {0x27, 0x41, 0xec}, + {0x27, 0x42, 0x0f}, + {0x27, 0x43, 0xf0}, + {0x27, 0x44, 0xf0}, + {0x27, 0x45, 0x42}, + {0x27, 0x46, 0x98}, + {0x27, 0x47, 0x6a}, + {0x27, 0x48, 0x07}, + {0x27, 0x49, 0xd1}, + {0x27, 0x4a, 0xb0}, + {0x27, 0x4b, 0x07}, + {0x27, 0x4c, 0x0f}, + {0x27, 0x4d, 0xbd}, + {0x27, 0x4e, 0x67}, + {0x27, 0x4f, 0x96}, + {0x27, 0x50, 0xf8}, + {0x27, 0x51, 0x42}, + {0x27, 0x52, 0x40}, + {0x27, 0x53, 0x08}, + {0x27, 0x54, 0x07}, // Biquad - BQ7 Right - Filter: Equalizer (Q Factor) Frequency: 315 Hz Gain: -8dB QVal: 0.9 Bandwidth: 1000 Hz + {0x27, 0x55, 0xdd}, + {0x27, 0x56, 0x86}, + {0x27, 0x57, 0xf3}, + {0x27, 0x58, 0xf0}, + {0x27, 0x59, 0x73}, + {0x27, 0x5a, 0x64}, + {0x27, 0x5b, 0xf1}, + {0x27, 0x5c, 0x07}, + {0x27, 0x5d, 0xaf}, + {0x27, 0x5e, 0xec}, + {0x27, 0x5f, 0xb9}, + {0x27, 0x60, 0x0f}, + {0x27, 0x61, 0x8c}, + {0x27, 0x62, 0x9b}, + {0x27, 0x63, 0x0f}, + {0x27, 0x64, 0xf8}, + {0x27, 0x65, 0x72}, + {0x27, 0x66, 0x8c}, + {0x27, 0x67, 0x55}, + {0x27, 0x68, 0x07}, // Biquad - BQ8 Right - Filter: Equalizer (Q Factor) Frequency: 500 Hz Gain: -8dB QVal: 0.9 Bandwidth: 1000 Hz + {0x27, 0x69, 0xca}, + {0x27, 0x6a, 0x2a}, + {0x27, 0x6b, 0x56}, + {0x27, 0x6c, 0xf0}, + {0x27, 0x6d, 0xb4}, + {0x27, 0x6e, 0xfb}, + {0x27, 0x6f, 0x50}, + {0x27, 0x70, 0x07}, + {0x27, 0x71, 0x82}, + {0x27, 0x72, 0xf3}, + {0x27, 0x73, 0x41}, + {0x27, 0x74, 0x0f}, + {0x27, 0x75, 0x4b}, + {0x27, 0x76, 0x04}, + {0x27, 0x77, 0xb0}, + {0x27, 0x78, 0xf8}, + {0x27, 0x79, 0xb2}, + {0x27, 0x7a, 0xe2}, + {0x27, 0x7b, 0x69}, + {0x27, 0x7c, 0x07}, // Biquad - BQ9 Right - Filter: Equalizer (Q Factor) Frequency: 800 Hz Gain: -8dB QVal: 0.8 Bandwidth: 1000 Hz + {0x27, 0x7d, 0xa2}, + {0x27, 0x7e, 0x5e}, + {0x27, 0x7f, 0x76}, + {0x28, 0x08, 0xf1}, + {0x28, 0x09, 0x3c}, + {0x28, 0x0a, 0x4f}, + {0x28, 0x0b, 0x15}, + {0x28, 0x0c, 0x07}, + {0x28, 0x0d, 0x26}, + {0x28, 0x0e, 0x82}, + {0x28, 0x0f, 0x57}, + {0x28, 0x10, 0x0e}, + {0x28, 0x11, 0xc3}, + {0x28, 0x12, 0xb0}, + {0x28, 0x13, 0xeb}, + {0x28, 0x14, 0xf9}, + {0x28, 0x15, 0x37}, + {0x28, 0x16, 0x1f}, + {0x28, 0x17, 0x33}, + {0x28, 0x18, 0x07}, // Biquad - BQ10 Right - Filter: Equalizer (Q Factor) Frequency: 1250 Hz Gain: -8dB QVal: 0.8 Bandwidth: 1000 Hz + {0x28, 0x19, 0x73}, + {0x28, 0x1a, 0xb2}, + {0x28, 0x1b, 0x39}, + {0x28, 0x1c, 0xf1}, + {0x28, 0x1d, 0xde}, + {0x28, 0x1e, 0x59}, + {0x28, 0x1f, 0x75}, + {0x28, 0x20, 0x06}, + {0x28, 0x21, 0xba}, + {0x28, 0x22, 0x18}, + {0x28, 0x23, 0x5d}, + {0x28, 0x24, 0x0e}, + {0x28, 0x25, 0x21}, + {0x28, 0x26, 0xa6}, + {0x28, 0x27, 0x8b}, + {0x28, 0x28, 0xf9}, + {0x28, 0x29, 0xd2}, + {0x28, 0x2a, 0x35}, + {0x28, 0x2b, 0x6a}, + {0x28, 0x2c, 0x07}, // Biquad - BQ11 Right - Filter: Equalizer (Q Factor) Frequency: 2000 Hz Gain: -8dB QVal: 0.7 Bandwidth: 1000 Hz + {0x28, 0x2d, 0x15}, + {0x28, 0x2e, 0x8d}, + {0x28, 0x2f, 0xfb}, + {0x28, 0x30, 0xf3}, + {0x28, 0x31, 0x27}, + {0x28, 0x32, 0x67}, + {0x28, 0x33, 0x79}, + {0x28, 0x34, 0x05}, + {0x28, 0x35, 0xdf}, + {0x28, 0x36, 0x6b}, + {0x28, 0x37, 0x1a}, + {0x28, 0x38, 0x0c}, + {0x28, 0x39, 0xd8}, + {0x28, 0x3a, 0x98}, + {0x28, 0x3b, 0x87}, + {0x28, 0x3c, 0xfb}, + {0x28, 0x3d, 0x0b}, + {0x28, 0x3e, 0x06}, + {0x28, 0x3f, 0xec}, + {0x28, 0x40, 0x06}, // Biquad - BQ12 Right - Filter: Equalizer (Q Factor) Frequency: 3150 Hz Gain: -8dB QVal: 0.7 Bandwidth: 1000 Hz + {0x28, 0x41, 0xb3}, + {0x28, 0x42, 0x26}, + {0x28, 0x43, 0x34}, + {0x28, 0x44, 0xf4}, + {0x28, 0x45, 0x91}, + {0x28, 0x46, 0x55}, + {0x28, 0x47, 0x46}, + {0x28, 0x48, 0x04}, + {0x28, 0x49, 0xfa}, + {0x28, 0x4a, 0xd6}, + {0x28, 0x4b, 0x5d}, + {0x28, 0x4c, 0x0b}, + {0x28, 0x4d, 0x6e}, + {0x28, 0x4e, 0xaa}, + {0x28, 0x4f, 0xba}, + {0x28, 0x50, 0xfc}, + {0x28, 0x51, 0x52}, + {0x28, 0x52, 0x03}, + {0x28, 0x53, 0x6f}, + {0x28, 0x54, 0x06}, // Biquad - BQ13 Right - Filter: Equalizer (Q Factor) Frequency: 5000 Hz Gain: -8dB QVal: 0.6 Bandwidth: 1000 Hz + {0x28, 0x55, 0x0a}, + {0x28, 0x56, 0xe0}, + {0x28, 0x57, 0xa9}, + {0x28, 0x58, 0xf7}, + {0x28, 0x59, 0x02}, + {0x28, 0x5a, 0x28}, + {0x28, 0x5b, 0xdd}, + {0x28, 0x5c, 0x03}, + {0x28, 0x5d, 0x73}, + {0x28, 0x5e, 0xf7}, + {0x28, 0x5f, 0xaa}, + {0x28, 0x60, 0x08}, + {0x28, 0x61, 0xfd}, + {0x28, 0x62, 0xd7}, + {0x28, 0x63, 0x23}, + {0x28, 0x64, 0xfe}, + {0x28, 0x65, 0x81}, + {0x28, 0x66, 0x27}, + {0x28, 0x67, 0xad}, + {0x28, 0x68, 0x05}, // Biquad - BQ14 Right - Filter: Equalizer (Q Factor) Frequency: 8000 Hz Gain: -8dB QVal: 0.6 Bandwidth: 1000 Hz + {0x28, 0x69, 0x7b}, + {0x28, 0x6a, 0x6d}, + {0x28, 0x6b, 0x7c}, + {0x28, 0x6c, 0xf9}, + {0x28, 0x6d, 0x63}, + {0x28, 0x6e, 0xa0}, + {0x28, 0x6f, 0xde}, + {0x28, 0x70, 0x02}, + {0x28, 0x71, 0x26}, + {0x28, 0x72, 0xc1}, + {0x28, 0x73, 0x37}, + {0x28, 0x74, 0x06}, + {0x28, 0x75, 0x9c}, + {0x28, 0x76, 0x5f}, + {0x28, 0x77, 0x22}, + {0x28, 0x78, 0x00}, + {0x28, 0x79, 0x5d}, + {0x28, 0x7a, 0xd1}, + {0x28, 0x7b, 0x4d}, + {0x28, 0x7c, 0x04}, // Biquad - BQ15 Right - Filter: Equalizer (Q Factor) Frequency: 16000 Hz Gain: -8dB QVal: 0.5 Bandwidth: 1000 Hz + {0x28, 0x7d, 0x82}, + {0x28, 0x7e, 0xdc}, + {0x28, 0x7f, 0xce}, + {0x29, 0x08, 0xfd}, + {0x29, 0x09, 0xcb}, + {0x29, 0x0a, 0xe1}, + {0x29, 0x0b, 0x9a}, + {0x29, 0x0c, 0xff}, + {0x29, 0x0d, 0xe5}, + {0x29, 0x0e, 0x5f}, + {0x29, 0x0f, 0xfe}, + {0x29, 0x10, 0x02}, + {0x29, 0x11, 0x34}, + {0x29, 0x12, 0x1e}, + {0x29, 0x13, 0x66}, + {0x29, 0x14, 0x03}, + {0x29, 0x15, 0x97}, + {0x29, 0x16, 0xc3}, + {0x29, 0x17, 0x34}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_right_m7[TAS5805M_EQ_REG_PER_STEP] = { + {0x26, 0x54, 0x07}, // Biquad - BQ1 Right - Filter: Equalizer (Q Factor) Frequency: 20 Hz Gain: -7dB QVal: 2 Bandwidth: 1000 Hz + {0x26, 0x55, 0xff}, + {0x26, 0x56, 0x2b}, + {0x26, 0x57, 0xa0}, + {0x26, 0x58, 0xf0}, + {0x26, 0x59, 0x03}, + {0x26, 0x5a, 0x00}, + {0x26, 0x5b, 0x8b}, + {0x26, 0x5c, 0x07}, + {0x26, 0x5d, 0xfd}, + {0x26, 0x5e, 0xd4}, + {0x26, 0x5f, 0xbb}, + {0x26, 0x60, 0x0f}, + {0x26, 0x61, 0xfc}, + {0x26, 0x62, 0xff}, + {0x26, 0x63, 0x75}, + {0x26, 0x64, 0xf8}, + {0x26, 0x65, 0x02}, + {0x26, 0x66, 0xff}, + {0x26, 0x67, 0xa5}, + {0x26, 0x68, 0x07}, // Biquad - BQ2 Right - Filter: Equalizer (Q Factor) Frequency: 31.5 Hz Gain: -7dB QVal: 2 Bandwidth: 1000 Hz + {0x26, 0x69, 0xfe}, + {0x26, 0x6a, 0xb1}, + {0x26, 0x6b, 0xa6}, + {0x26, 0x6c, 0xf0}, + {0x26, 0x6d, 0x04}, + {0x26, 0x6e, 0xba}, + {0x26, 0x6f, 0xc2}, + {0x26, 0x70, 0x07}, + {0x26, 0x71, 0xfc}, + {0x26, 0x72, 0x95}, + {0x26, 0x73, 0xd1}, + {0x26, 0x74, 0x0f}, + {0x26, 0x75, 0xfb}, + {0x26, 0x76, 0x45}, + {0x26, 0x77, 0x3e}, + {0x26, 0x78, 0xf8}, + {0x26, 0x79, 0x04}, + {0x26, 0x7a, 0xb8}, + {0x26, 0x7b, 0x88}, + {0x26, 0x7c, 0x07}, // Biquad - BQ3 Right - Filter: Equalizer (Q Factor) Frequency: 50 Hz Gain: -7dB QVal: 1.5 Bandwidth: 1000 Hz + {0x26, 0x7d, 0xfd}, + {0x26, 0x7e, 0x3d}, + {0x26, 0x7f, 0x4a}, + {0x27, 0x08, 0xf0}, + {0x27, 0x09, 0x0a}, + {0x27, 0x0a, 0x00}, + {0x27, 0x0b, 0x0e}, + {0x27, 0x0c, 0x07}, + {0x27, 0x0d, 0xf8}, + {0x27, 0x0e, 0xc8}, + {0x27, 0x0f, 0x42}, + {0x27, 0x10, 0x0f}, + {0x27, 0x11, 0xf5}, + {0x27, 0x12, 0xff}, + {0x27, 0x13, 0xf2}, + {0x27, 0x14, 0xf8}, + {0x27, 0x15, 0x09}, + {0x27, 0x16, 0xfa}, + {0x27, 0x17, 0x74}, + {0x27, 0x18, 0x07}, // Biquad - BQ4 Right - Filter: Equalizer (Q Factor) Frequency: 80 Hz Gain: -7dB QVal: 1.5 Bandwidth: 1000 Hz + {0x27, 0x19, 0xfb}, + {0x27, 0x1a, 0x96}, + {0x27, 0x1b, 0xea}, + {0x27, 0x1c, 0xf0}, + {0x27, 0x1d, 0x0f}, + {0x27, 0x1e, 0xff}, + {0x27, 0x1f, 0x7b}, + {0x27, 0x20, 0x07}, + {0x27, 0x21, 0xf4}, + {0x27, 0x22, 0x77}, + {0x27, 0x23, 0xed}, + {0x27, 0x24, 0x0f}, + {0x27, 0x25, 0xf0}, + {0x27, 0x26, 0x00}, + {0x27, 0x27, 0x85}, + {0x27, 0x28, 0xf8}, + {0x27, 0x29, 0x0f}, + {0x27, 0x2a, 0xf1}, + {0x27, 0x2b, 0x29}, + {0x27, 0x2c, 0x07}, // Biquad - BQ5 Right - Filter: Equalizer (Q Factor) Frequency: 125 Hz Gain: -7dB QVal: 1 Bandwidth: 1000 Hz + {0x27, 0x2d, 0xf5}, + {0x27, 0x2e, 0xb7}, + {0x27, 0x2f, 0x79}, + {0x27, 0x30, 0xf0}, + {0x27, 0x31, 0x25}, + {0x27, 0x32, 0x4e}, + {0x27, 0x33, 0x3a}, + {0x27, 0x34, 0x07}, + {0x27, 0x35, 0xe5}, + {0x27, 0x36, 0x1d}, + {0x27, 0x37, 0x13}, + {0x27, 0x38, 0x0f}, + {0x27, 0x39, 0xda}, + {0x27, 0x3a, 0xb1}, + {0x27, 0x3b, 0xc6}, + {0x27, 0x3c, 0xf8}, + {0x27, 0x3d, 0x25}, + {0x27, 0x3e, 0x2b}, + {0x27, 0x3f, 0x74}, + {0x27, 0x40, 0x07}, // Biquad - BQ6 Right - Filter: Equalizer (Q Factor) Frequency: 200 Hz Gain: -7dB QVal: 1 Bandwidth: 1000 Hz + {0x27, 0x41, 0xef}, + {0x27, 0x42, 0xa2}, + {0x27, 0x43, 0xc4}, + {0x27, 0x44, 0xf0}, + {0x27, 0x45, 0x3b}, + {0x27, 0x46, 0x7e}, + {0x27, 0x47, 0xd1}, + {0x27, 0x48, 0x07}, + {0x27, 0x49, 0xd5}, + {0x27, 0x4a, 0x36}, + {0x27, 0x4b, 0xf5}, + {0x27, 0x4c, 0x0f}, + {0x27, 0x4d, 0xc4}, + {0x27, 0x4e, 0x81}, + {0x27, 0x4f, 0x2f}, + {0x27, 0x50, 0xf8}, + {0x27, 0x51, 0x3b}, + {0x27, 0x52, 0x26}, + {0x27, 0x53, 0x48}, + {0x27, 0x54, 0x07}, // Biquad - BQ7 Right - Filter: Equalizer (Q Factor) Frequency: 315 Hz Gain: -7dB QVal: 0.9 Bandwidth: 1000 Hz + {0x27, 0x55, 0xe3}, + {0x27, 0x56, 0xab}, + {0x27, 0x57, 0x63}, + {0x27, 0x58, 0xf0}, + {0x27, 0x59, 0x67}, + {0x27, 0x5a, 0x40}, + {0x27, 0x5b, 0x55}, + {0x27, 0x5c, 0x07}, + {0x27, 0x5d, 0xb5}, + {0x27, 0x5e, 0xed}, + {0x27, 0x5f, 0x8c}, + {0x27, 0x60, 0x0f}, + {0x27, 0x61, 0x98}, + {0x27, 0x62, 0xbf}, + {0x27, 0x63, 0xab}, + {0x27, 0x64, 0xf8}, + {0x27, 0x65, 0x66}, + {0x27, 0x66, 0x67}, + {0x27, 0x67, 0x11}, + {0x27, 0x68, 0x07}, // Biquad - BQ8 Right - Filter: Equalizer (Q Factor) Frequency: 500 Hz Gain: -7dB QVal: 0.9 Bandwidth: 1000 Hz + {0x27, 0x69, 0xd3}, + {0x27, 0x6a, 0xae}, + {0x27, 0x6b, 0x80}, + {0x27, 0x6c, 0xf0}, + {0x27, 0x6d, 0xa2}, + {0x27, 0x6e, 0x4c}, + {0x27, 0x6f, 0x8c}, + {0x27, 0x70, 0x07}, + {0x27, 0x71, 0x8c}, + {0x27, 0x72, 0x20}, + {0x27, 0x73, 0x6b}, + {0x27, 0x74, 0x0f}, + {0x27, 0x75, 0x5d}, + {0x27, 0x76, 0xb3}, + {0x27, 0x77, 0x74}, + {0x27, 0x78, 0xf8}, + {0x27, 0x79, 0xa0}, + {0x27, 0x7a, 0x31}, + {0x27, 0x7b, 0x15}, + {0x27, 0x7c, 0x07}, // Biquad - BQ9 Right - Filter: Equalizer (Q Factor) Frequency: 800 Hz Gain: -7dB QVal: 0.8 Bandwidth: 1000 Hz + {0x27, 0x7d, 0xb2}, + {0x27, 0x7e, 0xa5}, + {0x27, 0x7f, 0xab}, + {0x28, 0x08, 0xf1}, + {0x28, 0x09, 0x1c}, + {0x28, 0x0a, 0xd3}, + {0x28, 0x0b, 0xd5}, + {0x28, 0x0c, 0x07}, + {0x28, 0x0d, 0x35}, + {0x28, 0x0e, 0xc1}, + {0x28, 0x0f, 0x72}, + {0x28, 0x10, 0x0e}, + {0x28, 0x11, 0xe3}, + {0x28, 0x12, 0x2c}, + {0x28, 0x13, 0x2b}, + {0x28, 0x14, 0xf9}, + {0x28, 0x15, 0x17}, + {0x28, 0x16, 0x98}, + {0x28, 0x17, 0xe3}, + {0x28, 0x18, 0x07}, // Biquad - BQ10 Right - Filter: Equalizer (Q Factor) Frequency: 1250 Hz Gain: -7dB QVal: 0.8 Bandwidth: 1000 Hz + {0x28, 0x19, 0x8b}, + {0x28, 0x1a, 0x9a}, + {0x28, 0x1b, 0xf7}, + {0x28, 0x1c, 0xf1}, + {0x28, 0x1d, 0xb1}, + {0x28, 0x1e, 0x02}, + {0x28, 0x1f, 0x69}, + {0x28, 0x20, 0x06}, + {0x28, 0x21, 0xcf}, + {0x28, 0x22, 0xad}, + {0x28, 0x23, 0x9e}, + {0x28, 0x24, 0x0e}, + {0x28, 0x25, 0x4e}, + {0x28, 0x26, 0xfd}, + {0x28, 0x27, 0x97}, + {0x28, 0x28, 0xf9}, + {0x28, 0x29, 0xa4}, + {0x28, 0x2a, 0xb7}, + {0x28, 0x2b, 0x6b}, + {0x28, 0x2c, 0x07}, // Biquad - BQ11 Right - Filter: Equalizer (Q Factor) Frequency: 2000 Hz Gain: -7dB QVal: 0.7 Bandwidth: 1000 Hz + {0x28, 0x2d, 0x3b}, + {0x28, 0x2e, 0xdb}, + {0x28, 0x2f, 0x62}, + {0x28, 0x30, 0xf2}, + {0x28, 0x31, 0xe1}, + {0x28, 0x32, 0xf2}, + {0x28, 0x33, 0xeb}, + {0x28, 0x34, 0x05}, + {0x28, 0x35, 0xff}, + {0x28, 0x36, 0x2b}, + {0x28, 0x37, 0xae}, + {0x28, 0x38, 0x0d}, + {0x28, 0x39, 0x1e}, + {0x28, 0x3a, 0x0d}, + {0x28, 0x3b, 0x15}, + {0x28, 0x3c, 0xfa}, + {0x28, 0x3d, 0xc4}, + {0x28, 0x3e, 0xf8}, + {0x28, 0x3f, 0xef}, + {0x28, 0x40, 0x06}, // Biquad - BQ12 Right - Filter: Equalizer (Q Factor) Frequency: 3150 Hz Gain: -7dB QVal: 0.7 Bandwidth: 1000 Hz + {0x28, 0x41, 0xe7}, + {0x28, 0x42, 0x09}, + {0x28, 0x43, 0xae}, + {0x28, 0x44, 0xf4}, + {0x28, 0x45, 0x38}, + {0x28, 0x46, 0xca}, + {0x28, 0x47, 0xd8}, + {0x28, 0x48, 0x05}, + {0x28, 0x49, 0x21}, + {0x28, 0x4a, 0x67}, + {0x28, 0x4b, 0xb7}, + {0x28, 0x4c, 0x0b}, + {0x28, 0x4d, 0xc7}, + {0x28, 0x4e, 0x35}, + {0x28, 0x4f, 0x28}, + {0x28, 0x50, 0xfb}, + {0x28, 0x51, 0xf7}, + {0x28, 0x52, 0x8e}, + {0x28, 0x53, 0x9b}, + {0x28, 0x54, 0x06}, // Biquad - BQ13 Right - Filter: Equalizer (Q Factor) Frequency: 5000 Hz Gain: -7dB QVal: 0.6 Bandwidth: 1000 Hz + {0x28, 0x55, 0x52}, + {0x28, 0x56, 0x6d}, + {0x28, 0x57, 0xa1}, + {0x28, 0x58, 0xf6}, + {0x28, 0x59, 0x97}, + {0x28, 0x5a, 0xb0}, + {0x28, 0x5b, 0x30}, + {0x28, 0x5c, 0x03}, + {0x28, 0x5d, 0x9c}, + {0x28, 0x5e, 0xda}, + {0x28, 0x5f, 0xf2}, + {0x28, 0x60, 0x09}, + {0x28, 0x61, 0x68}, + {0x28, 0x62, 0x4f}, + {0x28, 0x63, 0xd0}, + {0x28, 0x64, 0xfe}, + {0x28, 0x65, 0x10}, + {0x28, 0x66, 0xb7}, + {0x28, 0x67, 0x6c}, + {0x28, 0x68, 0x05}, // Biquad - BQ14 Right - Filter: Equalizer (Q Factor) Frequency: 8000 Hz Gain: -7dB QVal: 0.6 Bandwidth: 1000 Hz + {0x28, 0x69, 0xd0}, + {0x28, 0x6a, 0x0b}, + {0x28, 0x6b, 0xc7}, + {0x28, 0x6c, 0xf8}, + {0x28, 0x6d, 0xfd}, + {0x28, 0x6e, 0x96}, + {0x28, 0x6f, 0xa5}, + {0x28, 0x70, 0x02}, + {0x28, 0x71, 0x47}, + {0x28, 0x72, 0xf6}, + {0x28, 0x73, 0x44}, + {0x28, 0x74, 0x07}, + {0x28, 0x75, 0x02}, + {0x28, 0x76, 0x69}, + {0x28, 0x77, 0x5b}, + {0x28, 0x78, 0xff}, + {0x28, 0x79, 0xe7}, + {0x28, 0x7a, 0xfd}, + {0x28, 0x7b, 0xf6}, + {0x28, 0x7c, 0x04}, // Biquad - BQ15 Right - Filter: Equalizer (Q Factor) Frequency: 16000 Hz Gain: -7dB QVal: 0.5 Bandwidth: 1000 Hz + {0x28, 0x7d, 0xe5}, + {0x28, 0x7e, 0xa4}, + {0x28, 0x7f, 0x72}, + {0x29, 0x08, 0xfd}, + {0x29, 0x09, 0x9b}, + {0x29, 0x0a, 0xa1}, + {0x29, 0x0b, 0x48}, + {0x29, 0x0c, 0xff}, + {0x29, 0x0d, 0xe3}, + {0x29, 0x0e, 0x18}, + {0x29, 0x0f, 0xff}, + {0x29, 0x10, 0x02}, + {0x29, 0x11, 0x64}, + {0x29, 0x12, 0x5e}, + {0x29, 0x13, 0xb8}, + {0x29, 0x14, 0x03}, + {0x29, 0x15, 0x37}, + {0x29, 0x16, 0x42}, + {0x29, 0x17, 0x8f}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_right_m6[TAS5805M_EQ_REG_PER_STEP] = { + {0x26, 0x54, 0x07}, // Biquad - BQ1 Right - Filter: Equalizer (Q Factor) Frequency: 20 Hz Gain: -6dB QVal: 2 Bandwidth: 1000 Hz + {0x26, 0x55, 0xff}, + {0x26, 0x56, 0x55}, + {0x26, 0x57, 0x5a}, + {0x26, 0x58, 0xf0}, + {0x26, 0x59, 0x02}, + {0x26, 0x5a, 0xad}, + {0x26, 0x5b, 0x1e}, + {0x26, 0x5c, 0x07}, + {0x26, 0x5d, 0xfd}, + {0x26, 0x5e, 0xfe}, + {0x26, 0x5f, 0x6e}, + {0x26, 0x60, 0x0f}, + {0x26, 0x61, 0xfd}, + {0x26, 0x62, 0x52}, + {0x26, 0x63, 0xe2}, + {0x26, 0x64, 0xf8}, + {0x26, 0x65, 0x02}, + {0x26, 0x66, 0xac}, + {0x26, 0x67, 0x38}, + {0x26, 0x68, 0x07}, // Biquad - BQ2 Right - Filter: Equalizer (Q Factor) Frequency: 31.5 Hz Gain: -6dB QVal: 2 Bandwidth: 1000 Hz + {0x26, 0x69, 0xfe}, + {0x26, 0x6a, 0xf3}, + {0x26, 0x6b, 0x54}, + {0x26, 0x6c, 0xf0}, + {0x26, 0x6d, 0x04}, + {0x26, 0x6e, 0x37}, + {0x26, 0x6f, 0x78}, + {0x26, 0x70, 0x07}, + {0x26, 0x71, 0xfc}, + {0x26, 0x72, 0xd7}, + {0x26, 0x73, 0x6e}, + {0x26, 0x74, 0x0f}, + {0x26, 0x75, 0xfb}, + {0x26, 0x76, 0xc8}, + {0x26, 0x77, 0x88}, + {0x26, 0x78, 0xf8}, + {0x26, 0x79, 0x04}, + {0x26, 0x7a, 0x35}, + {0x26, 0x7b, 0x3e}, + {0x26, 0x7c, 0x07}, // Biquad - BQ3 Right - Filter: Equalizer (Q Factor) Frequency: 50 Hz Gain: -6dB QVal: 1.5 Bandwidth: 1000 Hz + {0x26, 0x7d, 0xfd}, + {0x26, 0x7e, 0xc8}, + {0x26, 0x7f, 0x09}, + {0x27, 0x08, 0xf0}, + {0x27, 0x09, 0x08}, + {0x27, 0x0a, 0xea}, + {0x27, 0x0b, 0xde}, + {0x27, 0x0c, 0x07}, + {0x27, 0x0d, 0xf9}, + {0x27, 0x0e, 0x52}, + {0x27, 0x0f, 0xb3}, + {0x27, 0x10, 0x0f}, + {0x27, 0x11, 0xf7}, + {0x27, 0x12, 0x15}, + {0x27, 0x13, 0x22}, + {0x27, 0x14, 0xf8}, + {0x27, 0x15, 0x08}, + {0x27, 0x16, 0xe5}, + {0x27, 0x17, 0x43}, + {0x27, 0x18, 0x07}, // Biquad - BQ4 Right - Filter: Equalizer (Q Factor) Frequency: 80 Hz Gain: -6dB QVal: 1.5 Bandwidth: 1000 Hz + {0x27, 0x19, 0xfc}, + {0x27, 0x1a, 0x74}, + {0x27, 0x1b, 0x71}, + {0x27, 0x1c, 0xf0}, + {0x27, 0x1d, 0x0e}, + {0x27, 0x1e, 0x45}, + {0x27, 0x1f, 0x34}, + {0x27, 0x20, 0x07}, + {0x27, 0x21, 0xf5}, + {0x27, 0x22, 0x54}, + {0x27, 0x23, 0xae}, + {0x27, 0x24, 0x0f}, + {0x27, 0x25, 0xf1}, + {0x27, 0x26, 0xba}, + {0x27, 0x27, 0xcc}, + {0x27, 0x28, 0xf8}, + {0x27, 0x29, 0x0e}, + {0x27, 0x2a, 0x36}, + {0x27, 0x2b, 0xe1}, + {0x27, 0x2c, 0x07}, // Biquad - BQ5 Right - Filter: Equalizer (Q Factor) Frequency: 125 Hz Gain: -6dB QVal: 1 Bandwidth: 1000 Hz + {0x27, 0x2d, 0xf7}, + {0x27, 0x2e, 0xba}, + {0x27, 0x2f, 0xc8}, + {0x27, 0x30, 0xf0}, + {0x27, 0x31, 0x21}, + {0x27, 0x32, 0x4b}, + {0x27, 0x33, 0xd8}, + {0x27, 0x34, 0x07}, + {0x27, 0x35, 0xe7}, + {0x27, 0x36, 0x1c}, + {0x27, 0x37, 0x2f}, + {0x27, 0x38, 0x0f}, + {0x27, 0x39, 0xde}, + {0x27, 0x3a, 0xb4}, + {0x27, 0x3b, 0x28}, + {0x27, 0x3c, 0xf8}, + {0x27, 0x3d, 0x21}, + {0x27, 0x3e, 0x29}, + {0x27, 0x3f, 0x09}, + {0x27, 0x40, 0x07}, // Biquad - BQ6 Right - Filter: Equalizer (Q Factor) Frequency: 200 Hz Gain: -6dB QVal: 1 Bandwidth: 1000 Hz + {0x27, 0x41, 0xf2}, + {0x27, 0x42, 0xd4}, + {0x27, 0x43, 0xd3}, + {0x27, 0x44, 0xf0}, + {0x27, 0x45, 0x35}, + {0x27, 0x46, 0x25}, + {0x27, 0x47, 0x79}, + {0x27, 0x48, 0x07}, + {0x27, 0x49, 0xd8}, + {0x27, 0x4a, 0x5e}, + {0x27, 0x4b, 0x61}, + {0x27, 0x4c, 0x0f}, + {0x27, 0x4d, 0xca}, + {0x27, 0x4e, 0xda}, + {0x27, 0x4f, 0x87}, + {0x27, 0x50, 0xf8}, + {0x27, 0x51, 0x34}, + {0x27, 0x52, 0xcc}, + {0x27, 0x53, 0xcc}, + {0x27, 0x54, 0x07}, // Biquad - BQ7 Right - Filter: Equalizer (Q Factor) Frequency: 315 Hz Gain: -6dB QVal: 0.9 Bandwidth: 1000 Hz + {0x27, 0x55, 0xe9}, + {0x27, 0x56, 0x2c}, + {0x27, 0x57, 0xef}, + {0x27, 0x58, 0xf0}, + {0x27, 0x59, 0x5c}, + {0x27, 0x5a, 0x5d}, + {0x27, 0x5b, 0xc2}, + {0x27, 0x5c, 0x07}, + {0x27, 0x5d, 0xbb}, + {0x27, 0x5e, 0x4f}, + {0x27, 0x5f, 0x2c}, + {0x27, 0x60, 0x0f}, + {0x27, 0x61, 0xa3}, + {0x27, 0x62, 0xa2}, + {0x27, 0x63, 0x3e}, + {0x27, 0x64, 0xf8}, + {0x27, 0x65, 0x5b}, + {0x27, 0x66, 0x83}, + {0x27, 0x67, 0xe6}, + {0x27, 0x68, 0x07}, // Biquad - BQ8 Right - Filter: Equalizer (Q Factor) Frequency: 500 Hz Gain: -6dB QVal: 0.9 Bandwidth: 1000 Hz + {0x27, 0x69, 0xdc}, + {0x27, 0x6a, 0x3d}, + {0x27, 0x6b, 0x6a}, + {0x27, 0x6c, 0xf0}, + {0x27, 0x6d, 0x91}, + {0x27, 0x6e, 0x7f}, + {0x27, 0x6f, 0x43}, + {0x27, 0x70, 0x07}, + {0x27, 0x71, 0x94}, + {0x27, 0x72, 0x61}, + {0x27, 0x73, 0x17}, + {0x27, 0x74, 0x0f}, + {0x27, 0x75, 0x6e}, + {0x27, 0x76, 0x80}, + {0x27, 0x77, 0xbd}, + {0x27, 0x78, 0xf8}, + {0x27, 0x79, 0x8f}, + {0x27, 0x7a, 0x61}, + {0x27, 0x7b, 0x7e}, + {0x27, 0x7c, 0x07}, // Biquad - BQ9 Right - Filter: Equalizer (Q Factor) Frequency: 800 Hz Gain: -6dB QVal: 0.8 Bandwidth: 1000 Hz + {0x27, 0x7d, 0xc1}, + {0x27, 0x7e, 0x62}, + {0x27, 0x7f, 0xa3}, + {0x28, 0x08, 0xf1}, + {0x28, 0x09, 0x00}, + {0x28, 0x0a, 0x53}, + {0x28, 0x0b, 0x06}, + {0x28, 0x0c, 0x07}, + {0x28, 0x0d, 0x43}, + {0x28, 0x0e, 0x8f}, + {0x28, 0x0f, 0x4c}, + {0x28, 0x10, 0x0e}, + {0x28, 0x11, 0xff}, + {0x28, 0x12, 0xac}, + {0x28, 0x13, 0xfa}, + {0x28, 0x14, 0xf8}, + {0x28, 0x15, 0xfb}, + {0x28, 0x16, 0x0e}, + {0x28, 0x17, 0x11}, + {0x28, 0x18, 0x07}, // Biquad - BQ10 Right - Filter: Equalizer (Q Factor) Frequency: 1250 Hz Gain: -6dB QVal: 0.8 Bandwidth: 1000 Hz + {0x28, 0x19, 0xa1}, + {0x28, 0x1a, 0x6c}, + {0x28, 0x1b, 0xd9}, + {0x28, 0x1c, 0xf1}, + {0x28, 0x1d, 0x87}, + {0x28, 0x1e, 0xa1}, + {0x28, 0x1f, 0xa6}, + {0x28, 0x20, 0x06}, + {0x28, 0x21, 0xe3}, + {0x28, 0x22, 0x60}, + {0x28, 0x23, 0x0c}, + {0x28, 0x24, 0x0e}, + {0x28, 0x25, 0x78}, + {0x28, 0x26, 0x5e}, + {0x28, 0x27, 0x5a}, + {0x28, 0x28, 0xf9}, + {0x28, 0x29, 0x7b}, + {0x28, 0x2a, 0x33}, + {0x28, 0x2b, 0x1b}, + {0x28, 0x2c, 0x07}, // Biquad - BQ11 Right - Filter: Equalizer (Q Factor) Frequency: 2000 Hz Gain: -6dB QVal: 0.7 Bandwidth: 1000 Hz + {0x28, 0x2d, 0x5f}, + {0x28, 0x2e, 0x62}, + {0x28, 0x2f, 0x39}, + {0x28, 0x30, 0xf2}, + {0x28, 0x31, 0xa1}, + {0x28, 0x32, 0x86}, + {0x28, 0x33, 0xdb}, + {0x28, 0x34, 0x06}, + {0x28, 0x35, 0x1c}, + {0x28, 0x36, 0x9f}, + {0x28, 0x37, 0x36}, + {0x28, 0x38, 0x0d}, + {0x28, 0x39, 0x5e}, + {0x28, 0x3a, 0x79}, + {0x28, 0x3b, 0x25}, + {0x28, 0x3c, 0xfa}, + {0x28, 0x3d, 0x83}, + {0x28, 0x3e, 0xfe}, + {0x28, 0x3f, 0x91}, + {0x28, 0x40, 0x07}, // Biquad - BQ12 Right - Filter: Equalizer (Q Factor) Frequency: 3150 Hz Gain: -6dB QVal: 0.7 Bandwidth: 1000 Hz + {0x28, 0x41, 0x18}, + {0x28, 0x42, 0x00}, + {0x28, 0x43, 0xbd}, + {0x28, 0x44, 0xf3}, + {0x28, 0x45, 0xe5}, + {0x28, 0x46, 0x3d}, + {0x28, 0x47, 0x7c}, + {0x28, 0x48, 0x05}, + {0x28, 0x49, 0x45}, + {0x28, 0x4a, 0xcc}, + {0x28, 0x4b, 0xc9}, + {0x28, 0x4c, 0x0c}, + {0x28, 0x4d, 0x1a}, + {0x28, 0x4e, 0xc2}, + {0x28, 0x4f, 0x84}, + {0x28, 0x50, 0xfb}, + {0x28, 0x51, 0xa2}, + {0x28, 0x52, 0x32}, + {0x28, 0x53, 0x7a}, + {0x28, 0x54, 0x06}, // Biquad - BQ13 Right - Filter: Equalizer (Q Factor) Frequency: 5000 Hz Gain: -6dB QVal: 0.6 Bandwidth: 1000 Hz + {0x28, 0x55, 0x98}, + {0x28, 0x56, 0x04}, + {0x28, 0x57, 0x28}, + {0x28, 0x58, 0xf6}, + {0x28, 0x59, 0x30}, + {0x28, 0x5a, 0x23}, + {0x28, 0x5b, 0x2c}, + {0x28, 0x5c, 0x03}, + {0x28, 0x5d, 0xc4}, + {0x28, 0x5e, 0x9f}, + {0x28, 0x5f, 0x1b}, + {0x28, 0x60, 0x09}, + {0x28, 0x61, 0xcf}, + {0x28, 0x62, 0xdc}, + {0x28, 0x63, 0xd4}, + {0x28, 0x64, 0xfd}, + {0x28, 0x65, 0xa3}, + {0x28, 0x66, 0x5c}, + {0x28, 0x67, 0xbc}, + {0x28, 0x68, 0x06}, // Biquad - BQ14 Right - Filter: Equalizer (Q Factor) Frequency: 8000 Hz Gain: -6dB QVal: 0.6 Bandwidth: 1000 Hz + {0x28, 0x69, 0x24}, + {0x28, 0x6a, 0x8c}, + {0x28, 0x6b, 0xe2}, + {0x28, 0x6c, 0xf8}, + {0x28, 0x6d, 0x97}, + {0x28, 0x6e, 0xaf}, + {0x28, 0x6f, 0x9f}, + {0x28, 0x70, 0x02}, + {0x28, 0x71, 0x69}, + {0x28, 0x72, 0x1f}, + {0x28, 0x73, 0xdd}, + {0x28, 0x74, 0x07}, + {0x28, 0x75, 0x68}, + {0x28, 0x76, 0x50}, + {0x28, 0x77, 0x61}, + {0x28, 0x78, 0xff}, + {0x28, 0x79, 0x72}, + {0x28, 0x7a, 0x53}, + {0x28, 0x7b, 0x41}, + {0x28, 0x7c, 0x05}, // Biquad - BQ15 Right - Filter: Equalizer (Q Factor) Frequency: 16000 Hz Gain: -6dB QVal: 0.5 Bandwidth: 1000 Hz + {0x28, 0x7d, 0x4d}, + {0x28, 0x7e, 0x18}, + {0x28, 0x7f, 0xc5}, + {0x29, 0x08, 0xfd}, + {0x29, 0x09, 0x69}, + {0x29, 0x0a, 0x18}, + {0x29, 0x0b, 0x6a}, + {0x29, 0x0c, 0xff}, + {0x29, 0x0d, 0xe0}, + {0x29, 0x0e, 0xb6}, + {0x29, 0x0f, 0x68}, + {0x29, 0x10, 0x02}, + {0x29, 0x11, 0x96}, + {0x29, 0x12, 0xe7}, + {0x29, 0x13, 0x96}, + {0x29, 0x14, 0x02}, + {0x29, 0x15, 0xd2}, + {0x29, 0x16, 0x30}, + {0x29, 0x17, 0xd3}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_right_m5[TAS5805M_EQ_REG_PER_STEP] = { + {0x26, 0x54, 0x07}, // Biquad - BQ1 Right - Filter: Equalizer (Q Factor) Frequency: 20 Hz Gain: -5dB QVal: 2 Bandwidth: 1000 Hz + {0x26, 0x55, 0xff}, + {0x26, 0x56, 0x7a}, + {0x26, 0x57, 0x8c}, + {0x26, 0x58, 0xf0}, + {0x26, 0x59, 0x02}, + {0x26, 0x5a, 0x62}, + {0x26, 0x5b, 0xc1}, + {0x26, 0x5c, 0x07}, + {0x26, 0x5d, 0xfe}, + {0x26, 0x5e, 0x23}, + {0x26, 0x5f, 0x9a}, + {0x26, 0x60, 0x0f}, + {0x26, 0x61, 0xfd}, + {0x26, 0x62, 0x9d}, + {0x26, 0x63, 0x3f}, + {0x26, 0x64, 0xf8}, + {0x26, 0x65, 0x02}, + {0x26, 0x66, 0x61}, + {0x26, 0x67, 0xdb}, + {0x26, 0x68, 0x07}, // Biquad - BQ2 Right - Filter: Equalizer (Q Factor) Frequency: 31.5 Hz Gain: -5dB QVal: 2 Bandwidth: 1000 Hz + {0x26, 0x69, 0xff}, + {0x26, 0x6a, 0x2d}, + {0x26, 0x6b, 0xe1}, + {0x26, 0x6c, 0xf0}, + {0x26, 0x6d, 0x03}, + {0x26, 0x6e, 0xc2}, + {0x26, 0x6f, 0x6d}, + {0x26, 0x70, 0x07}, + {0x26, 0x71, 0xfd}, + {0x26, 0x72, 0x11}, + {0x26, 0x73, 0xec}, + {0x26, 0x74, 0x0f}, + {0x26, 0x75, 0xfc}, + {0x26, 0x76, 0x3d}, + {0x26, 0x77, 0x93}, + {0x26, 0x78, 0xf8}, + {0x26, 0x79, 0x03}, + {0x26, 0x7a, 0xc0}, + {0x26, 0x7b, 0x33}, + {0x26, 0x7c, 0x07}, // Biquad - BQ3 Right - Filter: Equalizer (Q Factor) Frequency: 50 Hz Gain: -5dB QVal: 1.5 Bandwidth: 1000 Hz + {0x26, 0x7d, 0xfe}, + {0x26, 0x7e, 0x43}, + {0x26, 0x7f, 0xc2}, + {0x27, 0x08, 0xf0}, + {0x27, 0x09, 0x07}, + {0x27, 0x0a, 0xf3}, + {0x27, 0x0b, 0xb2}, + {0x27, 0x0c, 0x07}, + {0x27, 0x0d, 0xf9}, + {0x27, 0x0e, 0xce}, + {0x27, 0x0f, 0x27}, + {0x27, 0x10, 0x0f}, + {0x27, 0x11, 0xf8}, + {0x27, 0x12, 0x0c}, + {0x27, 0x13, 0x4e}, + {0x27, 0x14, 0xf8}, + {0x27, 0x15, 0x07}, + {0x27, 0x16, 0xee}, + {0x27, 0x17, 0x18}, + {0x27, 0x18, 0x07}, // Biquad - BQ4 Right - Filter: Equalizer (Q Factor) Frequency: 80 Hz Gain: -5dB QVal: 1.5 Bandwidth: 1000 Hz + {0x27, 0x19, 0xfd}, + {0x27, 0x1a, 0x3a}, + {0x27, 0x1b, 0x09}, + {0x27, 0x1c, 0xf0}, + {0x27, 0x1d, 0x0c}, + {0x27, 0x1e, 0xba}, + {0x27, 0x1f, 0xb5}, + {0x27, 0x20, 0x07}, + {0x27, 0x21, 0xf6}, + {0x27, 0x22, 0x19}, + {0x27, 0x23, 0x96}, + {0x27, 0x24, 0x0f}, + {0x27, 0x25, 0xf3}, + {0x27, 0x26, 0x45}, + {0x27, 0x27, 0x4b}, + {0x27, 0x28, 0xf8}, + {0x27, 0x29, 0x0c}, + {0x27, 0x2a, 0xac}, + {0x27, 0x2b, 0x61}, + {0x27, 0x2c, 0x07}, // Biquad - BQ5 Right - Filter: Equalizer (Q Factor) Frequency: 125 Hz Gain: -5dB QVal: 1 Bandwidth: 1000 Hz + {0x27, 0x2d, 0xf9}, + {0x27, 0x2e, 0x86}, + {0x27, 0x2f, 0xe9}, + {0x27, 0x30, 0xf0}, + {0x27, 0x31, 0x1d}, + {0x27, 0x32, 0xb7}, + {0x27, 0x33, 0x5e}, + {0x27, 0x34, 0x07}, + {0x27, 0x35, 0xe8}, + {0x27, 0x36, 0xe4}, + {0x27, 0x37, 0x90}, + {0x27, 0x38, 0x0f}, + {0x27, 0x39, 0xe2}, + {0x27, 0x3a, 0x48}, + {0x27, 0x3b, 0xa2}, + {0x27, 0x3c, 0xf8}, + {0x27, 0x3d, 0x1d}, + {0x27, 0x3e, 0x94}, + {0x27, 0x3f, 0x87}, + {0x27, 0x40, 0x07}, // Biquad - BQ6 Right - Filter: Equalizer (Q Factor) Frequency: 200 Hz Gain: -5dB QVal: 1 Bandwidth: 1000 Hz + {0x27, 0x41, 0xf5}, + {0x27, 0x42, 0xb0}, + {0x27, 0x43, 0x18}, + {0x27, 0x44, 0xf0}, + {0x27, 0x45, 0x2f}, + {0x27, 0x46, 0x78}, + {0x27, 0x47, 0x92}, + {0x27, 0x48, 0x07}, + {0x27, 0x49, 0xdb}, + {0x27, 0x4a, 0x30}, + {0x27, 0x4b, 0x23}, + {0x27, 0x4c, 0x0f}, + {0x27, 0x4d, 0xd0}, + {0x27, 0x4e, 0x87}, + {0x27, 0x4f, 0x6e}, + {0x27, 0x50, 0xf8}, + {0x27, 0x51, 0x2f}, + {0x27, 0x52, 0x1f}, + {0x27, 0x53, 0xc5}, + {0x27, 0x54, 0x07}, // Biquad - BQ7 Right - Filter: Equalizer (Q Factor) Frequency: 315 Hz Gain: -5dB QVal: 0.9 Bandwidth: 1000 Hz + {0x27, 0x55, 0xee}, + {0x27, 0x56, 0x1b}, + {0x27, 0x57, 0xaf}, + {0x27, 0x58, 0xf0}, + {0x27, 0x59, 0x52}, + {0x27, 0x5a, 0x9d}, + {0x27, 0x5b, 0x62}, + {0x27, 0x5c, 0x07}, + {0x27, 0x5d, 0xc0}, + {0x27, 0x5e, 0x21}, + {0x27, 0x5f, 0x53}, + {0x27, 0x60, 0x0f}, + {0x27, 0x61, 0xad}, + {0x27, 0x62, 0x62}, + {0x27, 0x63, 0x9e}, + {0x27, 0x64, 0xf8}, + {0x27, 0x65, 0x51}, + {0x27, 0x66, 0xc2}, + {0x27, 0x67, 0xfe}, + {0x27, 0x68, 0x07}, // Biquad - BQ8 Right - Filter: Equalizer (Q Factor) Frequency: 500 Hz Gain: -5dB QVal: 0.9 Bandwidth: 1000 Hz + {0x27, 0x69, 0xe3}, + {0x27, 0x6a, 0xed}, + {0x27, 0x6b, 0xe7}, + {0x27, 0x6c, 0xf0}, + {0x27, 0x6d, 0x82}, + {0x27, 0x6e, 0x66}, + {0x27, 0x6f, 0xa8}, + {0x27, 0x70, 0x07}, + {0x27, 0x71, 0x9b}, + {0x27, 0x72, 0xcb}, + {0x27, 0x73, 0x48}, + {0x27, 0x74, 0x0f}, + {0x27, 0x75, 0x7d}, + {0x27, 0x76, 0x99}, + {0x27, 0x77, 0x58}, + {0x27, 0x78, 0xf8}, + {0x27, 0x79, 0x80}, + {0x27, 0x7a, 0x46}, + {0x27, 0x7b, 0xd1}, + {0x27, 0x7c, 0x07}, // Biquad - BQ9 Right - Filter: Equalizer (Q Factor) Frequency: 800 Hz Gain: -5dB QVal: 0.8 Bandwidth: 1000 Hz + {0x27, 0x7d, 0xce}, + {0x27, 0x7e, 0xb5}, + {0x27, 0x7f, 0x2e}, + {0x28, 0x08, 0xf0}, + {0x28, 0x09, 0xe6}, + {0x28, 0x0a, 0x8f}, + {0x28, 0x0b, 0x22}, + {0x28, 0x0c, 0x07}, + {0x28, 0x0d, 0x50}, + {0x28, 0x0e, 0x09}, + {0x28, 0x0f, 0xb2}, + {0x28, 0x10, 0x0f}, + {0x28, 0x11, 0x19}, + {0x28, 0x12, 0x70}, + {0x28, 0x13, 0xde}, + {0x28, 0x14, 0xf8}, + {0x28, 0x15, 0xe1}, + {0x28, 0x16, 0x41}, + {0x28, 0x17, 0x20}, + {0x28, 0x18, 0x07}, // Biquad - BQ10 Right - Filter: Equalizer (Q Factor) Frequency: 1250 Hz Gain: -5dB QVal: 0.8 Bandwidth: 1000 Hz + {0x28, 0x19, 0xb5}, + {0x28, 0x1a, 0x4a}, + {0x28, 0x1b, 0xb7}, + {0x28, 0x1c, 0xf1}, + {0x28, 0x1d, 0x61}, + {0x28, 0x1e, 0xf5}, + {0x28, 0x1f, 0x18}, + {0x28, 0x20, 0x06}, + {0x28, 0x21, 0xf5}, + {0x28, 0x22, 0x4f}, + {0x28, 0x23, 0x1a}, + {0x28, 0x24, 0x0e}, + {0x28, 0x25, 0x9e}, + {0x28, 0x26, 0x0a}, + {0x28, 0x27, 0xe8}, + {0x28, 0x28, 0xf9}, + {0x28, 0x29, 0x55}, + {0x28, 0x2a, 0x66}, + {0x28, 0x2b, 0x2f}, + {0x28, 0x2c, 0x07}, // Biquad - BQ11 Right - Filter: Equalizer (Q Factor) Frequency: 2000 Hz Gain: -5dB QVal: 0.7 Bandwidth: 1000 Hz + {0x28, 0x2d, 0x80}, + {0x28, 0x2e, 0x37}, + {0x28, 0x2f, 0x39}, + {0x28, 0x30, 0xf2}, + {0x28, 0x31, 0x65}, + {0x28, 0x32, 0xfd}, + {0x28, 0x33, 0xb7}, + {0x28, 0x34, 0x06}, + {0x28, 0x35, 0x37}, + {0x28, 0x36, 0xd6}, + {0x28, 0x37, 0xdf}, + {0x28, 0x38, 0x0d}, + {0x28, 0x39, 0x9a}, + {0x28, 0x3a, 0x02}, + {0x28, 0x3b, 0x49}, + {0x28, 0x3c, 0xfa}, + {0x28, 0x3d, 0x47}, + {0x28, 0x3e, 0xf1}, + {0x28, 0x3f, 0xe9}, + {0x28, 0x40, 0x07}, // Biquad - BQ12 Right - Filter: Equalizer (Q Factor) Frequency: 3150 Hz Gain: -5dB QVal: 0.7 Bandwidth: 1000 Hz + {0x28, 0x41, 0x45}, + {0x28, 0x42, 0xfc}, + {0x28, 0x43, 0xef}, + {0x28, 0x44, 0xf3}, + {0x28, 0x45, 0x96}, + {0x28, 0x46, 0xc5}, + {0x28, 0x47, 0xd9}, + {0x28, 0x48, 0x05}, + {0x28, 0x49, 0x67}, + {0x28, 0x4a, 0xfa}, + {0x28, 0x4b, 0xd4}, + {0x28, 0x4c, 0x0c}, + {0x28, 0x4d, 0x69}, + {0x28, 0x4e, 0x3a}, + {0x28, 0x4f, 0x27}, + {0x28, 0x50, 0xfb}, + {0x28, 0x51, 0x52}, + {0x28, 0x52, 0x08}, + {0x28, 0x53, 0x3d}, + {0x28, 0x54, 0x06}, // Biquad - BQ13 Right - Filter: Equalizer (Q Factor) Frequency: 5000 Hz Gain: -5dB QVal: 0.6 Bandwidth: 1000 Hz + {0x28, 0x55, 0xdb}, + {0x28, 0x56, 0x47}, + {0x28, 0x57, 0xef}, + {0x28, 0x58, 0xf5}, + {0x28, 0x59, 0xcc}, + {0x28, 0x5a, 0x0b}, + {0x28, 0x5b, 0x2e}, + {0x28, 0x5c, 0x03}, + {0x28, 0x5d, 0xeb}, + {0x28, 0x5e, 0x0f}, + {0x28, 0x5f, 0x65}, + {0x28, 0x60, 0x0a}, + {0x28, 0x61, 0x33}, + {0x28, 0x62, 0xf4}, + {0x28, 0x63, 0xd2}, + {0x28, 0x64, 0xfd}, + {0x28, 0x65, 0x39}, + {0x28, 0x66, 0xa8}, + {0x28, 0x67, 0xab}, + {0x28, 0x68, 0x06}, // Biquad - BQ14 Right - Filter: Equalizer (Q Factor) Frequency: 8000 Hz Gain: -5dB QVal: 0.6 Bandwidth: 1000 Hz + {0x28, 0x69, 0x78}, + {0x28, 0x6a, 0x62}, + {0x28, 0x6b, 0x91}, + {0x28, 0x6c, 0xf8}, + {0x28, 0x6d, 0x32}, + {0x28, 0x6e, 0x97}, + {0x28, 0x6f, 0x4e}, + {0x28, 0x70, 0x02}, + {0x28, 0x71, 0x8a}, + {0x28, 0x72, 0x06}, + {0x28, 0x73, 0x30}, + {0x28, 0x74, 0x07}, + {0x28, 0x75, 0xcd}, + {0x28, 0x76, 0x68}, + {0x28, 0x77, 0xb2}, + {0x28, 0x78, 0xfe}, + {0x28, 0x79, 0xfd}, + {0x28, 0x7a, 0x97}, + {0x28, 0x7b, 0x3f}, + {0x28, 0x7c, 0x05}, // Biquad - BQ15 Right - Filter: Equalizer (Q Factor) Frequency: 16000 Hz Gain: -5dB QVal: 0.5 Bandwidth: 1000 Hz + {0x28, 0x7d, 0xb8}, + {0x28, 0x7e, 0xd5}, + {0x28, 0x7f, 0x5a}, + {0x29, 0x08, 0xfd}, + {0x29, 0x09, 0x34}, + {0x29, 0x0a, 0x78}, + {0x29, 0x0b, 0x0d}, + {0x29, 0x0c, 0xff}, + {0x29, 0x0d, 0xde}, + {0x29, 0x0e, 0x3a}, + {0x29, 0x0f, 0x8b}, + {0x29, 0x10, 0x02}, + {0x29, 0x11, 0xcb}, + {0x29, 0x12, 0x87}, + {0x29, 0x13, 0xf3}, + {0x29, 0x14, 0x02}, + {0x29, 0x15, 0x68}, + {0x29, 0x16, 0xf0}, + {0x29, 0x17, 0x1b}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_right_m4[TAS5805M_EQ_REG_PER_STEP] = { + {0x26, 0x54, 0x07}, // Biquad - BQ1 Right - Filter: Equalizer (Q Factor) Frequency: 20 Hz Gain: -4dB QVal: 2 Bandwidth: 1000 Hz + {0x26, 0x55, 0xff}, + {0x26, 0x56, 0x9b}, + {0x26, 0x57, 0xb3}, + {0x26, 0x58, 0xf0}, + {0x26, 0x59, 0x02}, + {0x26, 0x5a, 0x20}, + {0x26, 0x5b, 0x77}, + {0x26, 0x5c, 0x07}, + {0x26, 0x5d, 0xfe}, + {0x26, 0x5e, 0x44}, + {0x26, 0x5f, 0xbb}, + {0x26, 0x60, 0x0f}, + {0x26, 0x61, 0xfd}, + {0x26, 0x62, 0xdf}, + {0x26, 0x63, 0x89}, + {0x26, 0x64, 0xf8}, + {0x26, 0x65, 0x02}, + {0x26, 0x66, 0x1f}, + {0x26, 0x67, 0x91}, + {0x26, 0x68, 0x07}, // Biquad - BQ2 Right - Filter: Equalizer (Q Factor) Frequency: 31.5 Hz Gain: -4dB QVal: 2 Bandwidth: 1000 Hz + {0x26, 0x69, 0xff}, + {0x26, 0x6a, 0x62}, + {0x26, 0x6b, 0x13}, + {0x26, 0x6c, 0xf0}, + {0x26, 0x6d, 0x03}, + {0x26, 0x6e, 0x5a}, + {0x26, 0x6f, 0x17}, + {0x26, 0x70, 0x07}, + {0x26, 0x71, 0xfd}, + {0x26, 0x72, 0x46}, + {0x26, 0x73, 0x10}, + {0x26, 0x74, 0x0f}, + {0x26, 0x75, 0xfc}, + {0x26, 0x76, 0xa5}, + {0x26, 0x77, 0xe9}, + {0x26, 0x78, 0xf8}, + {0x26, 0x79, 0x03}, + {0x26, 0x7a, 0x57}, + {0x26, 0x7b, 0xdd}, + {0x26, 0x7c, 0x07}, // Biquad - BQ3 Right - Filter: Equalizer (Q Factor) Frequency: 50 Hz Gain: -4dB QVal: 1.5 Bandwidth: 1000 Hz + {0x26, 0x7d, 0xfe}, + {0x26, 0x7e, 0xb2}, + {0x26, 0x7f, 0x12}, + {0x27, 0x08, 0xf0}, + {0x27, 0x09, 0x07}, + {0x27, 0x0a, 0x17}, + {0x27, 0x0b, 0x4f}, + {0x27, 0x0c, 0x07}, + {0x27, 0x0d, 0xfa}, + {0x27, 0x0e, 0x3c}, + {0x27, 0x0f, 0x3a}, + {0x27, 0x10, 0x0f}, + {0x27, 0x11, 0xf8}, + {0x27, 0x12, 0xe8}, + {0x27, 0x13, 0xb1}, + {0x27, 0x14, 0xf8}, + {0x27, 0x15, 0x07}, + {0x27, 0x16, 0x11}, + {0x27, 0x17, 0xb4}, + {0x27, 0x18, 0x07}, // Biquad - BQ4 Right - Filter: Equalizer (Q Factor) Frequency: 80 Hz Gain: -4dB QVal: 1.5 Bandwidth: 1000 Hz + {0x27, 0x19, 0xfd}, + {0x27, 0x1a, 0xea}, + {0x27, 0x1b, 0x44}, + {0x27, 0x1c, 0xf0}, + {0x27, 0x1d, 0x0b}, + {0x27, 0x1e, 0x5a}, + {0x27, 0x1f, 0xdd}, + {0x27, 0x20, 0x07}, + {0x27, 0x21, 0xf6}, + {0x27, 0x22, 0xc9}, + {0x27, 0x23, 0x34}, + {0x27, 0x24, 0x0f}, + {0x27, 0x25, 0xf4}, + {0x27, 0x26, 0xa5}, + {0x27, 0x27, 0x23}, + {0x27, 0x28, 0xf8}, + {0x27, 0x29, 0x0b}, + {0x27, 0x2a, 0x4c}, + {0x27, 0x2b, 0x87}, + {0x27, 0x2c, 0x07}, // Biquad - BQ5 Right - Filter: Equalizer (Q Factor) Frequency: 125 Hz Gain: -4dB QVal: 1 Bandwidth: 1000 Hz + {0x27, 0x2d, 0xfb}, + {0x27, 0x2e, 0x21}, + {0x27, 0x2f, 0xaf}, + {0x27, 0x30, 0xf0}, + {0x27, 0x31, 0x1a}, + {0x27, 0x32, 0x85}, + {0x27, 0x33, 0x31}, + {0x27, 0x34, 0x07}, + {0x27, 0x35, 0xea}, + {0x27, 0x36, 0x7b}, + {0x27, 0x37, 0xfe}, + {0x27, 0x38, 0x0f}, + {0x27, 0x39, 0xe5}, + {0x27, 0x3a, 0x7a}, + {0x27, 0x3b, 0xcf}, + {0x27, 0x3c, 0xf8}, + {0x27, 0x3d, 0x1a}, + {0x27, 0x3e, 0x62}, + {0x27, 0x3f, 0x54}, + {0x27, 0x40, 0x07}, // Biquad - BQ6 Right - Filter: Equalizer (Q Factor) Frequency: 200 Hz Gain: -4dB QVal: 1 Bandwidth: 1000 Hz + {0x27, 0x41, 0xf8}, + {0x27, 0x42, 0x3d}, + {0x27, 0x43, 0x92}, + {0x27, 0x44, 0xf0}, + {0x27, 0x45, 0x2a}, + {0x27, 0x46, 0x66}, + {0x27, 0x47, 0x3a}, + {0x27, 0x48, 0x07}, + {0x27, 0x49, 0xdd}, + {0x27, 0x4a, 0xb5}, + {0x27, 0x4b, 0x1d}, + {0x27, 0x4c, 0x0f}, + {0x27, 0x4d, 0xd5}, + {0x27, 0x4e, 0x99}, + {0x27, 0x4f, 0xc6}, + {0x27, 0x50, 0xf8}, + {0x27, 0x51, 0x2a}, + {0x27, 0x52, 0x0d}, + {0x27, 0x53, 0x51}, + {0x27, 0x54, 0x07}, // Biquad - BQ7 Right - Filter: Equalizer (Q Factor) Frequency: 315 Hz Gain: -4dB QVal: 0.9 Bandwidth: 1000 Hz + {0x27, 0x55, 0xf2}, + {0x27, 0x56, 0x86}, + {0x27, 0x57, 0x4f}, + {0x27, 0x58, 0xf0}, + {0x27, 0x59, 0x49}, + {0x27, 0x5a, 0xe2}, + {0x27, 0x5b, 0x37}, + {0x27, 0x5c, 0x07}, + {0x27, 0x5d, 0xc4}, + {0x27, 0x5e, 0x72}, + {0x27, 0x5f, 0x57}, + {0x27, 0x60, 0x0f}, + {0x27, 0x61, 0xb6}, + {0x27, 0x62, 0x1d}, + {0x27, 0x63, 0xc9}, + {0x27, 0x64, 0xf8}, + {0x27, 0x65, 0x49}, + {0x27, 0x66, 0x07}, + {0x27, 0x67, 0x59}, + {0x27, 0x68, 0x07}, // Biquad - BQ8 Right - Filter: Equalizer (Q Factor) Frequency: 500 Hz Gain: -4dB QVal: 0.9 Bandwidth: 1000 Hz + {0x27, 0x69, 0xea}, + {0x27, 0x6a, 0xd5}, + {0x27, 0x6b, 0x0b}, + {0x27, 0x6c, 0xf0}, + {0x27, 0x6d, 0x74}, + {0x27, 0x6e, 0xd9}, + {0x27, 0x6f, 0x57}, + {0x27, 0x70, 0x07}, + {0x27, 0x71, 0xa2}, + {0x27, 0x72, 0x73}, + {0x27, 0x73, 0x50}, + {0x27, 0x74, 0x0f}, + {0x27, 0x75, 0x8b}, + {0x27, 0x76, 0x26}, + {0x27, 0x77, 0xa9}, + {0x27, 0x78, 0xf8}, + {0x27, 0x79, 0x72}, + {0x27, 0x7a, 0xb7}, + {0x27, 0x7b, 0xa5}, + {0x27, 0x7c, 0x07}, // Biquad - BQ9 Right - Filter: Equalizer (Q Factor) Frequency: 800 Hz Gain: -4dB QVal: 0.8 Bandwidth: 1000 Hz + {0x27, 0x7d, 0xda}, + {0x27, 0x7e, 0xbb}, + {0x27, 0x7f, 0xa3}, + {0x28, 0x08, 0xf0}, + {0x28, 0x09, 0xcf}, + {0x28, 0x0a, 0x4d}, + {0x28, 0x0b, 0x7d}, + {0x28, 0x0c, 0x07}, + {0x28, 0x0d, 0x5b}, + {0x28, 0x0e, 0x4d}, + {0x28, 0x0f, 0x0e}, + {0x28, 0x10, 0x0f}, + {0x28, 0x11, 0x30}, + {0x28, 0x12, 0xb2}, + {0x28, 0x13, 0x83}, + {0x28, 0x14, 0xf8}, + {0x28, 0x15, 0xc9}, + {0x28, 0x16, 0xf7}, + {0x28, 0x17, 0x4f}, + {0x28, 0x18, 0x07}, // Biquad - BQ10 Right - Filter: Equalizer (Q Factor) Frequency: 1250 Hz Gain: -4dB QVal: 0.8 Bandwidth: 1000 Hz + {0x28, 0x19, 0xc7}, + {0x28, 0x1a, 0x57}, + {0x28, 0x1b, 0x7a}, + {0x28, 0x1c, 0xf1}, + {0x28, 0x1d, 0x3f}, + {0x28, 0x1e, 0xba}, + {0x28, 0x1f, 0x88}, + {0x28, 0x20, 0x07}, + {0x28, 0x21, 0x05}, + {0x28, 0x22, 0x9a}, + {0x28, 0x23, 0x4f}, + {0x28, 0x24, 0x0e}, + {0x28, 0x25, 0xc0}, + {0x28, 0x26, 0x45}, + {0x28, 0x27, 0x78}, + {0x28, 0x28, 0xf9}, + {0x28, 0x29, 0x33}, + {0x28, 0x2a, 0x0e}, + {0x28, 0x2b, 0x37}, + {0x28, 0x2c, 0x07}, // Biquad - BQ11 Right - Filter: Equalizer (Q Factor) Frequency: 2000 Hz Gain: -4dB QVal: 0.7 Bandwidth: 1000 Hz + {0x28, 0x2d, 0x9e}, + {0x28, 0x2e, 0x74}, + {0x28, 0x2f, 0x83}, + {0x28, 0x30, 0xf2}, + {0x28, 0x31, 0x2f}, + {0x28, 0x32, 0x28}, + {0x28, 0x33, 0x1a}, + {0x28, 0x34, 0x06}, + {0x28, 0x35, 0x50}, + {0x28, 0x36, 0xe8}, + {0x28, 0x37, 0x52}, + {0x28, 0x38, 0x0d}, + {0x28, 0x39, 0xd0}, + {0x28, 0x3a, 0xd7}, + {0x28, 0x3b, 0xe6}, + {0x28, 0x3c, 0xfa}, + {0x28, 0x3d, 0x10}, + {0x28, 0x3e, 0xa3}, + {0x28, 0x3f, 0x2a}, + {0x28, 0x40, 0x07}, // Biquad - BQ12 Right - Filter: Equalizer (Q Factor) Frequency: 3150 Hz Gain: -4dB QVal: 0.7 Bandwidth: 1000 Hz + {0x28, 0x41, 0x70}, + {0x28, 0x42, 0xfa}, + {0x28, 0x43, 0xfb}, + {0x28, 0x44, 0xf3}, + {0x28, 0x45, 0x4d}, + {0x28, 0x46, 0x69}, + {0x28, 0x47, 0x89}, + {0x28, 0x48, 0x05}, + {0x28, 0x49, 0x87}, + {0x28, 0x4a, 0xef}, + {0x28, 0x4b, 0x6a}, + {0x28, 0x4c, 0x0c}, + {0x28, 0x4d, 0xb2}, + {0x28, 0x4e, 0x96}, + {0x28, 0x4f, 0x77}, + {0x28, 0x50, 0xfb}, + {0x28, 0x51, 0x07}, + {0x28, 0x52, 0x15}, + {0x28, 0x53, 0x9b}, + {0x28, 0x54, 0x07}, // Biquad - BQ13 Right - Filter: Equalizer (Q Factor) Frequency: 5000 Hz Gain: -4dB QVal: 0.6 Bandwidth: 1000 Hz + {0x28, 0x55, 0x1b}, + {0x28, 0x56, 0xea}, + {0x28, 0x57, 0x47}, + {0x28, 0x58, 0xf5}, + {0x28, 0x59, 0x6b}, + {0x28, 0x5a, 0xdd}, + {0x28, 0x5b, 0x4b}, + {0x28, 0x5c, 0x04}, + {0x28, 0x5d, 0x0f}, + {0x28, 0x5e, 0xfe}, + {0x28, 0x5f, 0xda}, + {0x28, 0x60, 0x0a}, + {0x28, 0x61, 0x94}, + {0x28, 0x62, 0x22}, + {0x28, 0x63, 0xb5}, + {0x28, 0x64, 0xfc}, + {0x28, 0x65, 0xd4}, + {0x28, 0x66, 0x16}, + {0x28, 0x67, 0xdf}, + {0x28, 0x68, 0x06}, // Biquad - BQ14 Right - Filter: Equalizer (Q Factor) Frequency: 8000 Hz Gain: -4dB QVal: 0.6 Bandwidth: 1000 Hz + {0x28, 0x69, 0xcb}, + {0x28, 0x6a, 0x03}, + {0x28, 0x6b, 0x13}, + {0x28, 0x6c, 0xf7}, + {0x28, 0x6d, 0xce}, + {0x28, 0x6e, 0xf3}, + {0x28, 0x6f, 0xd4}, + {0x28, 0x70, 0x02}, + {0x28, 0x71, 0xaa}, + {0x28, 0x72, 0x73}, + {0x28, 0x73, 0x2e}, + {0x28, 0x74, 0x08}, + {0x28, 0x75, 0x31}, + {0x28, 0x76, 0x0c}, + {0x28, 0x77, 0x2c}, + {0x28, 0x78, 0xfe}, + {0x28, 0x79, 0x8a}, + {0x28, 0x7a, 0x89}, + {0x28, 0x7b, 0xbe}, + {0x28, 0x7c, 0x06}, // Biquad - BQ15 Right - Filter: Equalizer (Q Factor) Frequency: 16000 Hz Gain: -4dB QVal: 0.5 Bandwidth: 1000 Hz + {0x28, 0x7d, 0x28}, + {0x28, 0x7e, 0x5e}, + {0x28, 0x7f, 0x41}, + {0x29, 0x08, 0xfc}, + {0x29, 0x09, 0xfd}, + {0x29, 0x0a, 0xfc}, + {0x29, 0x0b, 0xbd}, + {0x29, 0x0c, 0xff}, + {0x29, 0x0d, 0xdb}, + {0x29, 0x0e, 0xa8}, + {0x29, 0x0f, 0x44}, + {0x29, 0x10, 0x03}, + {0x29, 0x11, 0x02}, + {0x29, 0x12, 0x03}, + {0x29, 0x13, 0x43}, + {0x29, 0x14, 0x01}, + {0x29, 0x15, 0xfb}, + {0x29, 0x16, 0xf9}, + {0x29, 0x17, 0x7b}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_right_m3[TAS5805M_EQ_REG_PER_STEP] = { + {0x26, 0x54, 0x07}, // Biquad - BQ1 Right - Filter: Equalizer (Q Factor) Frequency: 20 Hz Gain: -3dB QVal: 2 Bandwidth: 1000 Hz + {0x26, 0x55, 0xff}, + {0x26, 0x56, 0xb9}, + {0x26, 0x57, 0x41}, + {0x26, 0x58, 0xf0}, + {0x26, 0x59, 0x01}, + {0x26, 0x5a, 0xe5}, + {0x26, 0x5b, 0x61}, + {0x26, 0x5c, 0x07}, + {0x26, 0x5d, 0xfe}, + {0x26, 0x5e, 0x62}, + {0x26, 0x5f, 0x44}, + {0x26, 0x60, 0x0f}, + {0x26, 0x61, 0xfe}, + {0x26, 0x62, 0x1a}, + {0x26, 0x63, 0x9f}, + {0x26, 0x64, 0xf8}, + {0x26, 0x65, 0x01}, + {0x26, 0x66, 0xe4}, + {0x26, 0x67, 0x7c}, + {0x26, 0x68, 0x07}, // Biquad - BQ2 Right - Filter: Equalizer (Q Factor) Frequency: 31.5 Hz Gain: -3dB QVal: 2 Bandwidth: 1000 Hz + {0x26, 0x69, 0xff}, + {0x26, 0x6a, 0x90}, + {0x26, 0x6b, 0x9a}, + {0x26, 0x6c, 0xf0}, + {0x26, 0x6d, 0x02}, + {0x26, 0x6e, 0xfd}, + {0x26, 0x6f, 0x16}, + {0x26, 0x70, 0x07}, + {0x26, 0x71, 0xfd}, + {0x26, 0x72, 0x74}, + {0x26, 0x73, 0x8a}, + {0x26, 0x74, 0x0f}, + {0x26, 0x75, 0xfd}, + {0x26, 0x76, 0x02}, + {0x26, 0x77, 0xea}, + {0x26, 0x78, 0xf8}, + {0x26, 0x79, 0x02}, + {0x26, 0x7a, 0xfa}, + {0x26, 0x7b, 0xdb}, + {0x26, 0x7c, 0x07}, // Biquad - BQ3 Right - Filter: Equalizer (Q Factor) Frequency: 50 Hz Gain: -3dB QVal: 1.5 Bandwidth: 1000 Hz + {0x26, 0x7d, 0xff}, + {0x26, 0x7e, 0x14}, + {0x26, 0x7f, 0x6e}, + {0x27, 0x08, 0xf0}, + {0x27, 0x09, 0x06}, + {0x27, 0x0a, 0x52}, + {0x27, 0x0b, 0xcf}, + {0x27, 0x0c, 0x07}, + {0x27, 0x0d, 0xfa}, + {0x27, 0x0e, 0x9e}, + {0x27, 0x0f, 0x5f}, + {0x27, 0x10, 0x0f}, + {0x27, 0x11, 0xf9}, + {0x27, 0x12, 0xad}, + {0x27, 0x13, 0x31}, + {0x27, 0x14, 0xf8}, + {0x27, 0x15, 0x06}, + {0x27, 0x16, 0x4d}, + {0x27, 0x17, 0x34}, + {0x27, 0x18, 0x07}, // Biquad - BQ4 Right - Filter: Equalizer (Q Factor) Frequency: 80 Hz Gain: -3dB QVal: 1.5 Bandwidth: 1000 Hz + {0x27, 0x19, 0xfe}, + {0x27, 0x1a, 0x87}, + {0x27, 0x1b, 0x6f}, + {0x27, 0x1c, 0xf0}, + {0x27, 0x1d, 0x0a}, + {0x27, 0x1e, 0x21}, + {0x27, 0x1f, 0x15}, + {0x27, 0x20, 0x07}, + {0x27, 0x21, 0xf7}, + {0x27, 0x22, 0x65}, + {0x27, 0x23, 0xd3}, + {0x27, 0x24, 0x0f}, + {0x27, 0x25, 0xf5}, + {0x27, 0x26, 0xde}, + {0x27, 0x27, 0xeb}, + {0x27, 0x28, 0xf8}, + {0x27, 0x29, 0x0a}, + {0x27, 0x2a, 0x12}, + {0x27, 0x2b, 0xbe}, + {0x27, 0x2c, 0x07}, // Biquad - BQ5 Right - Filter: Equalizer (Q Factor) Frequency: 125 Hz Gain: -3dB QVal: 1 Bandwidth: 1000 Hz + {0x27, 0x2d, 0xfc}, + {0x27, 0x2e, 0x90}, + {0x27, 0x2f, 0x54}, + {0x27, 0x30, 0xf0}, + {0x27, 0x31, 0x17}, + {0x27, 0x32, 0xaa}, + {0x27, 0x33, 0xe9}, + {0x27, 0x34, 0x07}, + {0x27, 0x35, 0xeb}, + {0x27, 0x36, 0xe7}, + {0x27, 0x37, 0xa6}, + {0x27, 0x38, 0x0f}, + {0x27, 0x39, 0xe8}, + {0x27, 0x3a, 0x55}, + {0x27, 0x3b, 0x17}, + {0x27, 0x3c, 0xf8}, + {0x27, 0x3d, 0x17}, + {0x27, 0x3e, 0x88}, + {0x27, 0x3f, 0x05}, + {0x27, 0x40, 0x07}, // Biquad - BQ6 Right - Filter: Equalizer (Q Factor) Frequency: 200 Hz Gain: -3dB QVal: 1 Bandwidth: 1000 Hz + {0x27, 0x41, 0xfa}, + {0x27, 0x42, 0x85}, + {0x27, 0x43, 0x5d}, + {0x27, 0x44, 0xf0}, + {0x27, 0x45, 0x25}, + {0x27, 0x46, 0xde}, + {0x27, 0x47, 0x55}, + {0x27, 0x48, 0x07}, + {0x27, 0x49, 0xdf}, + {0x27, 0x4a, 0xf5}, + {0x27, 0x4b, 0x51}, + {0x27, 0x4c, 0x0f}, + {0x27, 0x4d, 0xda}, + {0x27, 0x4e, 0x21}, + {0x27, 0x4f, 0xab}, + {0x27, 0x50, 0xf8}, + {0x27, 0x51, 0x25}, + {0x27, 0x52, 0x85}, + {0x27, 0x53, 0x52}, + {0x27, 0x54, 0x07}, // Biquad - BQ7 Right - Filter: Equalizer (Q Factor) Frequency: 315 Hz Gain: -3dB QVal: 0.9 Bandwidth: 1000 Hz + {0x27, 0x55, 0xf6}, + {0x27, 0x56, 0x7a}, + {0x27, 0x57, 0x22}, + {0x27, 0x58, 0xf0}, + {0x27, 0x59, 0x42}, + {0x27, 0x5a, 0x11}, + {0x27, 0x5b, 0xe9}, + {0x27, 0x5c, 0x07}, + {0x27, 0x5d, 0xc8}, + {0x27, 0x5e, 0x4f}, + {0x27, 0x5f, 0x40}, + {0x27, 0x60, 0x0f}, + {0x27, 0x61, 0xbd}, + {0x27, 0x62, 0xee}, + {0x27, 0x63, 0x17}, + {0x27, 0x64, 0xf8}, + {0x27, 0x65, 0x41}, + {0x27, 0x66, 0x36}, + {0x27, 0x67, 0x9e}, + {0x27, 0x68, 0x07}, // Biquad - BQ8 Right - Filter: Equalizer (Q Factor) Frequency: 500 Hz Gain: -3dB QVal: 0.9 Bandwidth: 1000 Hz + {0x27, 0x69, 0xf1}, + {0x27, 0x6a, 0x06}, + {0x27, 0x6b, 0x38}, + {0x27, 0x6c, 0xf0}, + {0x27, 0x6d, 0x68}, + {0x27, 0x6e, 0xb1}, + {0x27, 0x6f, 0x45}, + {0x27, 0x70, 0x07}, + {0x27, 0x71, 0xa8}, + {0x27, 0x72, 0x6b}, + {0x27, 0x73, 0xe1}, + {0x27, 0x74, 0x0f}, + {0x27, 0x75, 0x97}, + {0x27, 0x76, 0x4e}, + {0x27, 0x77, 0xbb}, + {0x27, 0x78, 0xf8}, + {0x27, 0x79, 0x66}, + {0x27, 0x7a, 0x8d}, + {0x27, 0x7b, 0xe7}, + {0x27, 0x7c, 0x07}, // Biquad - BQ9 Right - Filter: Equalizer (Q Factor) Frequency: 800 Hz Gain: -3dB QVal: 0.8 Bandwidth: 1000 Hz + {0x27, 0x7d, 0xe5}, + {0x27, 0x7e, 0x92}, + {0x27, 0x7f, 0xb4}, + {0x28, 0x08, 0xf0}, + {0x28, 0x09, 0xba}, + {0x28, 0x0a, 0x56}, + {0x28, 0x0b, 0x98}, + {0x28, 0x0c, 0x07}, + {0x28, 0x0d, 0x65}, + {0x28, 0x0e, 0x74}, + {0x28, 0x0f, 0x3f}, + {0x28, 0x10, 0x0f}, + {0x28, 0x11, 0x45}, + {0x28, 0x12, 0xa9}, + {0x28, 0x13, 0x68}, + {0x28, 0x14, 0xf8}, + {0x28, 0x15, 0xb4}, + {0x28, 0x16, 0xf9}, + {0x28, 0x17, 0x0d}, + {0x28, 0x18, 0x07}, // Biquad - BQ10 Right - Filter: Equalizer (Q Factor) Frequency: 1250 Hz Gain: -3dB QVal: 0.8 Bandwidth: 1000 Hz + {0x28, 0x19, 0xd7}, + {0x28, 0x1a, 0xb5}, + {0x28, 0x1b, 0x91}, + {0x28, 0x1c, 0xf1}, + {0x28, 0x1d, 0x20}, + {0x28, 0x1e, 0xb0}, + {0x28, 0x1f, 0xad}, + {0x28, 0x20, 0x07}, + {0x28, 0x21, 0x14}, + {0x28, 0x22, 0x60}, + {0x28, 0x23, 0xbe}, + {0x28, 0x24, 0x0e}, + {0x28, 0x25, 0xdf}, + {0x28, 0x26, 0x4f}, + {0x28, 0x27, 0x53}, + {0x28, 0x28, 0xf9}, + {0x28, 0x29, 0x13}, + {0x28, 0x2a, 0xe9}, + {0x28, 0x2b, 0xb1}, + {0x28, 0x2c, 0x07}, // Biquad - BQ11 Right - Filter: Equalizer (Q Factor) Frequency: 2000 Hz Gain: -3dB QVal: 0.7 Bandwidth: 1000 Hz + {0x28, 0x2d, 0xba}, + {0x28, 0x2e, 0x38}, + {0x28, 0x2f, 0x5c}, + {0x28, 0x30, 0xf1}, + {0x28, 0x31, 0xfc}, + {0x28, 0x32, 0xcf}, + {0x28, 0x33, 0x24}, + {0x28, 0x34, 0x06}, + {0x28, 0x35, 0x67}, + {0x28, 0x36, 0xec}, + {0x28, 0x37, 0xa7}, + {0x28, 0x38, 0x0e}, + {0x28, 0x39, 0x03}, + {0x28, 0x3a, 0x30}, + {0x28, 0x3b, 0xdc}, + {0x28, 0x3c, 0xf9}, + {0x28, 0x3d, 0xdd}, + {0x28, 0x3e, 0xda}, + {0x28, 0x3f, 0xfd}, + {0x28, 0x40, 0x07}, // Biquad - BQ12 Right - Filter: Equalizer (Q Factor) Frequency: 3150 Hz Gain: -3dB QVal: 0.7 Bandwidth: 1000 Hz + {0x28, 0x41, 0x99}, + {0x28, 0x42, 0x01}, + {0x28, 0x43, 0x7b}, + {0x28, 0x44, 0xf3}, + {0x28, 0x45, 0x09}, + {0x28, 0x46, 0x1d}, + {0x28, 0x47, 0x4b}, + {0x28, 0x48, 0x05}, + {0x28, 0x49, 0xa5}, + {0x28, 0x4a, 0xaf}, + {0x28, 0x4b, 0x70}, + {0x28, 0x4c, 0x0c}, + {0x28, 0x4d, 0xf6}, + {0x28, 0x4e, 0xe2}, + {0x28, 0x4f, 0xb5}, + {0x28, 0x50, 0xfa}, + {0x28, 0x51, 0xc1}, + {0x28, 0x52, 0x4f}, + {0x28, 0x53, 0x15}, + {0x28, 0x54, 0x07}, // Biquad - BQ13 Right - Filter: Equalizer (Q Factor) Frequency: 5000 Hz Gain: -3dB QVal: 0.6 Bandwidth: 1000 Hz + {0x28, 0x55, 0x59}, + {0x28, 0x56, 0xab}, + {0x28, 0x57, 0x10}, + {0x28, 0x58, 0xf5}, + {0x28, 0x59, 0x0f}, + {0x28, 0x5a, 0xf8}, + {0x28, 0x5b, 0xf1}, + {0x28, 0x5c, 0x04}, + {0x28, 0x5d, 0x33}, + {0x28, 0x5e, 0x48}, + {0x28, 0x5f, 0xd3}, + {0x28, 0x60, 0x0a}, + {0x28, 0x61, 0xf0}, + {0x28, 0x62, 0x07}, + {0x28, 0x63, 0x0f}, + {0x28, 0x64, 0xfc}, + {0x28, 0x65, 0x73}, + {0x28, 0x66, 0x0c}, + {0x28, 0x67, 0x1d}, + {0x28, 0x68, 0x07}, // Biquad - BQ14 Right - Filter: Equalizer (Q Factor) Frequency: 8000 Hz Gain: -3dB QVal: 0.6 Bandwidth: 1000 Hz + {0x28, 0x69, 0x1b}, + {0x28, 0x6a, 0xec}, + {0x28, 0x6b, 0x98}, + {0x28, 0x6c, 0xf7}, + {0x28, 0x6d, 0x6d}, + {0x28, 0x6e, 0x61}, + {0x28, 0x6f, 0xb8}, + {0x28, 0x70, 0x02}, + {0x28, 0x71, 0xca}, + {0x28, 0x72, 0x33}, + {0x28, 0x73, 0xe6}, + {0x28, 0x74, 0x08}, + {0x28, 0x75, 0x92}, + {0x28, 0x76, 0x9e}, + {0x28, 0x77, 0x48}, + {0x28, 0x78, 0xfe}, + {0x28, 0x79, 0x19}, + {0x28, 0x7a, 0xdf}, + {0x28, 0x7b, 0x82}, + {0x28, 0x7c, 0x06}, // Biquad - BQ15 Right - Filter: Equalizer (Q Factor) Frequency: 16000 Hz Gain: -3dB QVal: 0.5 Bandwidth: 1000 Hz + {0x28, 0x7d, 0x9b}, + {0x28, 0x7e, 0x21}, + {0x28, 0x7f, 0x67}, + {0x29, 0x08, 0xfc}, + {0x29, 0x09, 0xc5}, + {0x29, 0x0a, 0xed}, + {0x29, 0x0b, 0xd5}, + {0x29, 0x0c, 0xff}, + {0x29, 0x0d, 0xd9}, + {0x29, 0x0e, 0x02}, + {0x29, 0x0f, 0xf0}, + {0x29, 0x10, 0x03}, + {0x29, 0x11, 0x3a}, + {0x29, 0x12, 0x12}, + {0x29, 0x13, 0x2b}, + {0x29, 0x14, 0x01}, + {0x29, 0x15, 0x8b}, + {0x29, 0x16, 0xdb}, + {0x29, 0x17, 0xa9}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_right_m2[TAS5805M_EQ_REG_PER_STEP] = { + {0x26, 0x54, 0x07}, // Biquad - BQ1 Right - Filter: Equalizer (Q Factor) Frequency: 20 Hz Gain: -2dB QVal: 2 Bandwidth: 1000 Hz + {0x26, 0x55, 0xff}, + {0x26, 0x56, 0xd3}, + {0x26, 0x57, 0x98}, + {0x26, 0x58, 0xf0}, + {0x26, 0x59, 0x01}, + {0x26, 0x5a, 0xb0}, + {0x26, 0x5b, 0xb7}, + {0x26, 0x5c, 0x07}, + {0x26, 0x5d, 0xfe}, + {0x26, 0x5e, 0x7c}, + {0x26, 0x5f, 0x97}, + {0x26, 0x60, 0x0f}, + {0x26, 0x61, 0xfe}, + {0x26, 0x62, 0x4f}, + {0x26, 0x63, 0x49}, + {0x26, 0x64, 0xf8}, + {0x26, 0x65, 0x01}, + {0x26, 0x66, 0xaf}, + {0x26, 0x67, 0xd1}, + {0x26, 0x68, 0x07}, // Biquad - BQ2 Right - Filter: Equalizer (Q Factor) Frequency: 31.5 Hz Gain: -2dB QVal: 2 Bandwidth: 1000 Hz + {0x26, 0x69, 0xff}, + {0x26, 0x6a, 0xba}, + {0x26, 0x6b, 0x14}, + {0x26, 0x6c, 0xf0}, + {0x26, 0x6d, 0x02}, + {0x26, 0x6e, 0xaa}, + {0x26, 0x6f, 0x2e}, + {0x26, 0x70, 0x07}, + {0x26, 0x71, 0xfd}, + {0x26, 0x72, 0x9d}, + {0x26, 0x73, 0xf9}, + {0x26, 0x74, 0x0f}, + {0x26, 0x75, 0xfd}, + {0x26, 0x76, 0x55}, + {0x26, 0x77, 0xd2}, + {0x26, 0x78, 0xf8}, + {0x26, 0x79, 0x02}, + {0x26, 0x7a, 0xa7}, + {0x26, 0x7b, 0xf3}, + {0x26, 0x7c, 0x07}, // Biquad - BQ3 Right - Filter: Equalizer (Q Factor) Frequency: 50 Hz Gain: -2dB QVal: 1.5 Bandwidth: 1000 Hz + {0x26, 0x7d, 0xff}, + {0x26, 0x7e, 0x6c}, + {0x26, 0x7f, 0x1f}, + {0x27, 0x08, 0xf0}, + {0x27, 0x09, 0x05}, + {0x27, 0x0a, 0xa3}, + {0x27, 0x0b, 0x9e}, + {0x27, 0x0c, 0x07}, + {0x27, 0x0d, 0xfa}, + {0x27, 0x0e, 0xf5}, + {0x27, 0x0f, 0xdf}, + {0x27, 0x10, 0x0f}, + {0x27, 0x11, 0xfa}, + {0x27, 0x12, 0x5c}, + {0x27, 0x13, 0x62}, + {0x27, 0x14, 0xf8}, + {0x27, 0x15, 0x05}, + {0x27, 0x16, 0x9e}, + {0x27, 0x17, 0x02}, + {0x27, 0x18, 0x07}, // Biquad - BQ4 Right - Filter: Equalizer (Q Factor) Frequency: 80 Hz Gain: -2dB QVal: 1.5 Bandwidth: 1000 Hz + {0x27, 0x19, 0xff}, + {0x27, 0x1a, 0x13}, + {0x27, 0x1b, 0x97}, + {0x27, 0x1c, 0xf0}, + {0x27, 0x1d, 0x09}, + {0x27, 0x1e, 0x09}, + {0x27, 0x1f, 0x44}, + {0x27, 0x20, 0x07}, + {0x27, 0x21, 0xf7}, + {0x27, 0x22, 0xf1}, + {0x27, 0x23, 0x7d}, + {0x27, 0x24, 0x0f}, + {0x27, 0x25, 0xf6}, + {0x27, 0x26, 0xf6}, + {0x27, 0x27, 0xbc}, + {0x27, 0x28, 0xf8}, + {0x27, 0x29, 0x08}, + {0x27, 0x2a, 0xfa}, + {0x27, 0x2b, 0xec}, + {0x27, 0x2c, 0x07}, // Biquad - BQ5 Right - Filter: Equalizer (Q Factor) Frequency: 125 Hz Gain: -2dB QVal: 1 Bandwidth: 1000 Hz + {0x27, 0x2d, 0xfd}, + {0x27, 0x2e, 0xd7}, + {0x27, 0x2f, 0x8a}, + {0x27, 0x30, 0xf0}, + {0x27, 0x31, 0x15}, + {0x27, 0x32, 0x1f}, + {0x27, 0x33, 0x2f}, + {0x27, 0x34, 0x07}, + {0x27, 0x35, 0xed}, + {0x27, 0x36, 0x2c}, + {0x27, 0x37, 0x31}, + {0x27, 0x38, 0x0f}, + {0x27, 0x39, 0xea}, + {0x27, 0x3a, 0xe0}, + {0x27, 0x3b, 0xd1}, + {0x27, 0x3c, 0xf8}, + {0x27, 0x3d, 0x14}, + {0x27, 0x3e, 0xfc}, + {0x27, 0x3f, 0x45}, + {0x27, 0x40, 0x07}, // Biquad - BQ6 Right - Filter: Equalizer (Q Factor) Frequency: 200 Hz Gain: -2dB QVal: 1 Bandwidth: 1000 Hz + {0x27, 0x41, 0xfc}, + {0x27, 0x42, 0x8e}, + {0x27, 0x43, 0xc5}, + {0x27, 0x44, 0xf0}, + {0x27, 0x45, 0x21}, + {0x27, 0x46, 0xd2}, + {0x27, 0x47, 0x64}, + {0x27, 0x48, 0x07}, + {0x27, 0x49, 0xe1}, + {0x27, 0x4a, 0xf7}, + {0x27, 0x4b, 0xf1}, + {0x27, 0x4c, 0x0f}, + {0x27, 0x4d, 0xde}, + {0x27, 0x4e, 0x2d}, + {0x27, 0x4f, 0x9c}, + {0x27, 0x50, 0xf8}, + {0x27, 0x51, 0x21}, + {0x27, 0x52, 0x79}, + {0x27, 0x53, 0x4a}, + {0x27, 0x54, 0x07}, // Biquad - BQ7 Right - Filter: Equalizer (Q Factor) Frequency: 315 Hz Gain: -2dB QVal: 0.9 Bandwidth: 1000 Hz + {0x27, 0x55, 0xfa}, + {0x27, 0x56, 0x03}, + {0x27, 0x57, 0x3e}, + {0x27, 0x58, 0xf0}, + {0x27, 0x59, 0x3b}, + {0x27, 0x5a, 0x14}, + {0x27, 0x5b, 0x93}, + {0x27, 0x5c, 0x07}, + {0x27, 0x5d, 0xcb}, + {0x27, 0x5e, 0xc3}, + {0x27, 0x5f, 0xdc}, + {0x27, 0x60, 0x0f}, + {0x27, 0x61, 0xc4}, + {0x27, 0x62, 0xeb}, + {0x27, 0x63, 0x6d}, + {0x27, 0x64, 0xf8}, + {0x27, 0x65, 0x3a}, + {0x27, 0x66, 0x38}, + {0x27, 0x67, 0xe6}, + {0x27, 0x68, 0x07}, // Biquad - BQ8 Right - Filter: Equalizer (Q Factor) Frequency: 500 Hz Gain: -2dB QVal: 0.9 Bandwidth: 1000 Hz + {0x27, 0x69, 0xf6}, + {0x27, 0x6a, 0x93}, + {0x27, 0x6b, 0x31}, + {0x27, 0x6c, 0xf0}, + {0x27, 0x6d, 0x5d}, + {0x27, 0x6e, 0xcb}, + {0x27, 0x6f, 0x8f}, + {0x27, 0x70, 0x07}, + {0x27, 0x71, 0xad}, + {0x27, 0x72, 0xc6}, + {0x27, 0x73, 0x1b}, + {0x27, 0x74, 0x0f}, + {0x27, 0x75, 0xa2}, + {0x27, 0x76, 0x34}, + {0x27, 0x77, 0x71}, + {0x27, 0x78, 0xf8}, + {0x27, 0x79, 0x5b}, + {0x27, 0x7a, 0xa6}, + {0x27, 0x7b, 0xb3}, + {0x27, 0x7c, 0x07}, // Biquad - BQ9 Right - Filter: Equalizer (Q Factor) Frequency: 800 Hz Gain: -2dB QVal: 0.8 Bandwidth: 1000 Hz + {0x27, 0x7d, 0xef}, + {0x27, 0x7e, 0x55}, + {0x27, 0x7f, 0x53}, + {0x28, 0x08, 0xf0}, + {0x28, 0x09, 0xa7}, + {0x28, 0x0a, 0x76}, + {0x28, 0x0b, 0x57}, + {0x28, 0x0c, 0x07}, + {0x28, 0x0d, 0x6e}, + {0x28, 0x0e, 0x98}, + {0x28, 0x0f, 0x84}, + {0x28, 0x10, 0x0f}, + {0x28, 0x11, 0x58}, + {0x28, 0x12, 0x89}, + {0x28, 0x13, 0xa9}, + {0x28, 0x14, 0xf8}, + {0x28, 0x15, 0xa2}, + {0x28, 0x16, 0x12}, + {0x28, 0x17, 0x29}, + {0x28, 0x18, 0x07}, // Biquad - BQ10 Right - Filter: Equalizer (Q Factor) Frequency: 1250 Hz Gain: -2dB QVal: 0.8 Bandwidth: 1000 Hz + {0x28, 0x19, 0xe6}, + {0x28, 0x1a, 0x86}, + {0x28, 0x1b, 0x77}, + {0x28, 0x1c, 0xf1}, + {0x28, 0x1d, 0x04}, + {0x28, 0x1e, 0x98}, + {0x28, 0x1f, 0x07}, + {0x28, 0x20, 0x07}, + {0x28, 0x21, 0x21}, + {0x28, 0x22, 0xc0}, + {0x28, 0x23, 0xa1}, + {0x28, 0x24, 0x0e}, + {0x28, 0x25, 0xfb}, + {0x28, 0x26, 0x67}, + {0x28, 0x27, 0xf9}, + {0x28, 0x28, 0xf8}, + {0x28, 0x29, 0xf7}, + {0x28, 0x2a, 0xb8}, + {0x28, 0x2b, 0xe8}, + {0x28, 0x2c, 0x07}, // Biquad - BQ11 Right - Filter: Equalizer (Q Factor) Frequency: 2000 Hz Gain: -2dB QVal: 0.7 Bandwidth: 1000 Hz + {0x28, 0x2d, 0xd3}, + {0x28, 0x2e, 0xa3}, + {0x28, 0x2f, 0xfa}, + {0x28, 0x30, 0xf1}, + {0x28, 0x31, 0xce}, + {0x28, 0x32, 0xb6}, + {0x28, 0x33, 0x9b}, + {0x28, 0x34, 0x06}, + {0x28, 0x35, 0x7c}, + {0x28, 0x36, 0xff}, + {0x28, 0x37, 0x66}, + {0x28, 0x38, 0x0e}, + {0x28, 0x39, 0x31}, + {0x28, 0x3a, 0x49}, + {0x28, 0x3b, 0x65}, + {0x28, 0x3c, 0xf9}, + {0x28, 0x3d, 0xaf}, + {0x28, 0x3e, 0x5c}, + {0x28, 0x3f, 0xa0}, + {0x28, 0x40, 0x07}, // Biquad - BQ12 Right - Filter: Equalizer (Q Factor) Frequency: 3150 Hz Gain: -2dB QVal: 0.7 Bandwidth: 1000 Hz + {0x28, 0x41, 0xbe}, + {0x28, 0x42, 0x1f}, + {0x28, 0x43, 0x7d}, + {0x28, 0x44, 0xf2}, + {0x28, 0x45, 0xc9}, + {0x28, 0x46, 0xc7}, + {0x28, 0x47, 0x6b}, + {0x28, 0x48, 0x05}, + {0x28, 0x49, 0xc1}, + {0x28, 0x4a, 0x46}, + {0x28, 0x4b, 0x19}, + {0x28, 0x4c, 0x0d}, + {0x28, 0x4d, 0x36}, + {0x28, 0x4e, 0x38}, + {0x28, 0x4f, 0x95}, + {0x28, 0x50, 0xfa}, + {0x28, 0x51, 0x80}, + {0x28, 0x52, 0x9a}, + {0x28, 0x53, 0x69}, + {0x28, 0x54, 0x07}, // Biquad - BQ13 Right - Filter: Equalizer (Q Factor) Frequency: 5000 Hz Gain: -2dB QVal: 0.6 Bandwidth: 1000 Hz + {0x28, 0x55, 0x94}, + {0x28, 0x56, 0x59}, + {0x28, 0x57, 0x08}, + {0x28, 0x58, 0xf4}, + {0x28, 0x59, 0xb8}, + {0x28, 0x5a, 0xa7}, + {0x28, 0x5b, 0x68}, + {0x28, 0x5c, 0x04}, + {0x28, 0x5d, 0x54}, + {0x28, 0x5e, 0xd1}, + {0x28, 0x5f, 0x2b}, + {0x28, 0x60, 0x0b}, + {0x28, 0x61, 0x47}, + {0x28, 0x62, 0x58}, + {0x28, 0x63, 0x98}, + {0x28, 0x64, 0xfc}, + {0x28, 0x65, 0x16}, + {0x28, 0x66, 0xd5}, + {0x28, 0x67, 0xcd}, + {0x28, 0x68, 0x07}, // Biquad - BQ14 Right - Filter: Equalizer (Q Factor) Frequency: 8000 Hz Gain: -2dB QVal: 0.6 Bandwidth: 1000 Hz + {0x28, 0x69, 0x6a}, + {0x28, 0x6a, 0xa8}, + {0x28, 0x6b, 0x4b}, + {0x28, 0x6c, 0xf7}, + {0x28, 0x6d, 0x0e}, + {0x28, 0x6e, 0x70}, + {0x28, 0x6f, 0x46}, + {0x28, 0x70, 0x02}, + {0x28, 0x71, 0xe9}, + {0x28, 0x72, 0x19}, + {0x28, 0x73, 0xb6}, + {0x28, 0x74, 0x08}, + {0x28, 0x75, 0xf1}, + {0x28, 0x76, 0x8f}, + {0x28, 0x77, 0xba}, + {0x28, 0x78, 0xfd}, + {0x28, 0x79, 0xac}, + {0x28, 0x7a, 0x3d}, + {0x28, 0x7b, 0xff}, + {0x28, 0x7c, 0x07}, // Biquad - BQ15 Right - Filter: Equalizer (Q Factor) Frequency: 16000 Hz Gain: -2dB QVal: 0.5 Bandwidth: 1000 Hz + {0x28, 0x7d, 0x10}, + {0x28, 0x7e, 0x78}, + {0x28, 0x7f, 0xf4}, + {0x29, 0x08, 0xfc}, + {0x29, 0x09, 0x8c}, + {0x29, 0x0a, 0x9c}, + {0x29, 0x0b, 0x55}, + {0x29, 0x0c, 0xff}, + {0x29, 0x0d, 0xd6}, + {0x29, 0x0e, 0x4e}, + {0x29, 0x0f, 0x62}, + {0x29, 0x10, 0x03}, + {0x29, 0x11, 0x73}, + {0x29, 0x12, 0x63}, + {0x29, 0x13, 0xab}, + {0x29, 0x14, 0x01}, + {0x29, 0x15, 0x19}, + {0x29, 0x16, 0x38}, + {0x29, 0x17, 0xaa}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_right_m1[TAS5805M_EQ_REG_PER_STEP] = { + {0x26, 0x54, 0x07}, // Biquad - BQ1 Right - Filter: Equalizer (Q Factor) Frequency: 20 Hz Gain: -1dB QVal: 2 Bandwidth: 1000 Hz + {0x26, 0x55, 0xff}, + {0x26, 0x56, 0xeb}, + {0x26, 0x57, 0x13}, + {0x26, 0x58, 0xf0}, + {0x26, 0x59, 0x01}, + {0x26, 0x5a, 0x81}, + {0x26, 0x5b, 0xc6}, + {0x26, 0x5c, 0x07}, + {0x26, 0x5d, 0xfe}, + {0x26, 0x5e, 0x94}, + {0x26, 0x5f, 0x0d}, + {0x26, 0x60, 0x0f}, + {0x26, 0x61, 0xfe}, + {0x26, 0x62, 0x7e}, + {0x26, 0x63, 0x3a}, + {0x26, 0x64, 0xf8}, + {0x26, 0x65, 0x01}, + {0x26, 0x66, 0x80}, + {0x26, 0x67, 0xe0}, + {0x26, 0x68, 0x07}, // Biquad - BQ2 Right - Filter: Equalizer (Q Factor) Frequency: 31.5 Hz Gain: -1dB QVal: 2 Bandwidth: 1000 Hz + {0x26, 0x69, 0xff}, + {0x26, 0x6a, 0xdf}, + {0x26, 0x6b, 0x0c}, + {0x26, 0x6c, 0xf0}, + {0x26, 0x6d, 0x02}, + {0x26, 0x6e, 0x60}, + {0x26, 0x6f, 0x47}, + {0x26, 0x70, 0x07}, + {0x26, 0x71, 0xfd}, + {0x26, 0x72, 0xc2}, + {0x26, 0x73, 0xe7}, + {0x26, 0x74, 0x0f}, + {0x26, 0x75, 0xfd}, + {0x26, 0x76, 0x9f}, + {0x26, 0x77, 0xb9}, + {0x26, 0x78, 0xf8}, + {0x26, 0x79, 0x02}, + {0x26, 0x7a, 0x5e}, + {0x26, 0x7b, 0x0d}, + {0x26, 0x7c, 0x07}, // Biquad - BQ3 Right - Filter: Equalizer (Q Factor) Frequency: 50 Hz Gain: -1dB QVal: 1.5 Bandwidth: 1000 Hz + {0x26, 0x7d, 0xff}, + {0x26, 0x7e, 0xba}, + {0x26, 0x7f, 0x4d}, + {0x27, 0x08, 0xf0}, + {0x27, 0x09, 0x05}, + {0x27, 0x0a, 0x07}, + {0x27, 0x0b, 0x6d}, + {0x27, 0x0c, 0x07}, + {0x27, 0x0d, 0xfb}, + {0x27, 0x0e, 0x43}, + {0x27, 0x0f, 0xe1}, + {0x27, 0x10, 0x0f}, + {0x27, 0x11, 0xfa}, + {0x27, 0x12, 0xf8}, + {0x27, 0x13, 0x93}, + {0x27, 0x14, 0xf8}, + {0x27, 0x15, 0x05}, + {0x27, 0x16, 0x01}, + {0x27, 0x17, 0xd1}, + {0x27, 0x18, 0x07}, // Biquad - BQ4 Right - Filter: Equalizer (Q Factor) Frequency: 80 Hz Gain: -1dB QVal: 1.5 Bandwidth: 1000 Hz + {0x27, 0x19, 0xff}, + {0x27, 0x1a, 0x90}, + {0x27, 0x1b, 0x90}, + {0x27, 0x1c, 0xf0}, + {0x27, 0x1d, 0x08}, + {0x27, 0x1e, 0x0f}, + {0x27, 0x1f, 0xc0}, + {0x27, 0x20, 0x07}, + {0x27, 0x21, 0xf8}, + {0x27, 0x22, 0x6e}, + {0x27, 0x23, 0x08}, + {0x27, 0x24, 0x0f}, + {0x27, 0x25, 0xf7}, + {0x27, 0x26, 0xf0}, + {0x27, 0x27, 0x40}, + {0x27, 0x28, 0xf8}, + {0x27, 0x29, 0x08}, + {0x27, 0x2a, 0x01}, + {0x27, 0x2b, 0x68}, + {0x27, 0x2c, 0x07}, // Biquad - BQ5 Right - Filter: Equalizer (Q Factor) Frequency: 125 Hz Gain: -1dB QVal: 1 Bandwidth: 1000 Hz + {0x27, 0x2d, 0xfe}, + {0x27, 0x2e, 0xfb}, + {0x27, 0x2f, 0x82}, + {0x27, 0x30, 0xf0}, + {0x27, 0x31, 0x12}, + {0x27, 0x32, 0xd9}, + {0x27, 0x33, 0xa4}, + {0x27, 0x34, 0x07}, + {0x27, 0x35, 0xee}, + {0x27, 0x36, 0x4d}, + {0x27, 0x37, 0xc8}, + {0x27, 0x38, 0x0f}, + {0x27, 0x39, 0xed}, + {0x27, 0x3a, 0x26}, + {0x27, 0x3b, 0x5c}, + {0x27, 0x3c, 0xf8}, + {0x27, 0x3d, 0x12}, + {0x27, 0x3e, 0xb6}, + {0x27, 0x3f, 0xb6}, + {0x27, 0x40, 0x07}, // Biquad - BQ6 Right - Filter: Equalizer (Q Factor) Frequency: 200 Hz Gain: -1dB QVal: 1 Bandwidth: 1000 Hz + {0x27, 0x41, 0xfe}, + {0x27, 0x42, 0x60}, + {0x27, 0x43, 0x5a}, + {0x27, 0x44, 0xf0}, + {0x27, 0x45, 0x1e}, + {0x27, 0x46, 0x35}, + {0x27, 0x47, 0x5c}, + {0x27, 0x48, 0x07}, + {0x27, 0x49, 0xe3}, + {0x27, 0x4a, 0xc3}, + {0x27, 0x4b, 0x78}, + {0x27, 0x4c, 0x0f}, + {0x27, 0x4d, 0xe1}, + {0x27, 0x4e, 0xca}, + {0x27, 0x4f, 0xa4}, + {0x27, 0x50, 0xf8}, + {0x27, 0x51, 0x1d}, + {0x27, 0x52, 0xdc}, + {0x27, 0x53, 0x2e}, + {0x27, 0x54, 0x07}, // Biquad - BQ7 Right - Filter: Equalizer (Q Factor) Frequency: 315 Hz Gain: -1dB QVal: 0.9 Bandwidth: 1000 Hz + {0x27, 0x55, 0xfd}, + {0x27, 0x56, 0x2c}, + {0x27, 0x57, 0x92}, + {0x27, 0x58, 0xf0}, + {0x27, 0x59, 0x34}, + {0x27, 0x5a, 0xd4}, + {0x27, 0x5b, 0x96}, + {0x27, 0x5c, 0x07}, + {0x27, 0x5d, 0xce}, + {0x27, 0x5e, 0xda}, + {0x27, 0x5f, 0xdc}, + {0x27, 0x60, 0x0f}, + {0x27, 0x61, 0xcb}, + {0x27, 0x62, 0x2b}, + {0x27, 0x63, 0x6a}, + {0x27, 0x64, 0xf8}, + {0x27, 0x65, 0x33}, + {0x27, 0x66, 0xf8}, + {0x27, 0x67, 0x93}, + {0x27, 0x68, 0x07}, // Biquad - BQ8 Right - Filter: Equalizer (Q Factor) Frequency: 500 Hz Gain: -1dB QVal: 0.9 Bandwidth: 1000 Hz + {0x27, 0x69, 0xfb}, + {0x27, 0x6a, 0x8c}, + {0x27, 0x6b, 0x31}, + {0x27, 0x6c, 0xf0}, + {0x27, 0x6d, 0x54}, + {0x27, 0x6e, 0x08}, + {0x27, 0x6f, 0x5c}, + {0x27, 0x70, 0x07}, + {0x27, 0x71, 0xb2}, + {0x27, 0x72, 0x91}, + {0x27, 0x73, 0xa5}, + {0x27, 0x74, 0x0f}, + {0x27, 0x75, 0xab}, + {0x27, 0x76, 0xf7}, + {0x27, 0x77, 0xa4}, + {0x27, 0x78, 0xf8}, + {0x27, 0x79, 0x51}, + {0x27, 0x7a, 0xe2}, + {0x27, 0x7b, 0x2a}, + {0x27, 0x7c, 0x07}, // Biquad - BQ9 Right - Filter: Equalizer (Q Factor) Frequency: 800 Hz Gain: -1dB QVal: 0.8 Bandwidth: 1000 Hz + {0x27, 0x7d, 0xf8}, + {0x27, 0x7e, 0x1c}, + {0x27, 0x7f, 0xa4}, + {0x28, 0x08, 0xf0}, + {0x28, 0x09, 0x96}, + {0x28, 0x0a, 0x7c}, + {0x28, 0x0b, 0x17}, + {0x28, 0x0c, 0x07}, + {0x28, 0x0d, 0x76}, + {0x28, 0x0e, 0xd1}, + {0x28, 0x0f, 0x69}, + {0x28, 0x10, 0x0f}, + {0x28, 0x11, 0x69}, + {0x28, 0x12, 0x83}, + {0x28, 0x13, 0xe9}, + {0x28, 0x14, 0xf8}, + {0x28, 0x15, 0x91}, + {0x28, 0x16, 0x11}, + {0x28, 0x17, 0xf3}, + {0x28, 0x18, 0x07}, // Biquad - BQ10 Right - Filter: Equalizer (Q Factor) Frequency: 1250 Hz Gain: -1dB QVal: 0.8 Bandwidth: 1000 Hz + {0x28, 0x19, 0xf3}, + {0x28, 0x1a, 0xea}, + {0x28, 0x1b, 0x62}, + {0x28, 0x1c, 0xf0}, + {0x28, 0x1d, 0xeb}, + {0x28, 0x1e, 0x33}, + {0x28, 0x1f, 0x83}, + {0x28, 0x20, 0x07}, + {0x28, 0x21, 0x2d}, + {0x28, 0x22, 0xd7}, + {0x28, 0x23, 0x0b}, + {0x28, 0x24, 0x0f}, + {0x28, 0x25, 0x14}, + {0x28, 0x26, 0xcc}, + {0x28, 0x27, 0x7d}, + {0x28, 0x28, 0xf8}, + {0x28, 0x29, 0xde}, + {0x28, 0x2a, 0x3e}, + {0x28, 0x2b, 0x93}, + {0x28, 0x2c, 0x07}, // Biquad - BQ11 Right - Filter: Equalizer (Q Factor) Frequency: 2000 Hz Gain: -1dB QVal: 0.7 Bandwidth: 1000 Hz + {0x28, 0x2d, 0xea}, + {0x28, 0x2e, 0xda}, + {0x28, 0x2f, 0x7b}, + {0x28, 0x30, 0xf1}, + {0x28, 0x31, 0xa4}, + {0x28, 0x32, 0x9e}, + {0x28, 0x33, 0xcf}, + {0x28, 0x34, 0x06}, + {0x28, 0x35, 0x90}, + {0x28, 0x36, 0x3d}, + {0x28, 0x37, 0xad}, + {0x28, 0x38, 0x0e}, + {0x28, 0x39, 0x5b}, + {0x28, 0x3a, 0x61}, + {0x28, 0x3b, 0x31}, + {0x28, 0x3c, 0xf9}, + {0x28, 0x3d, 0x84}, + {0x28, 0x3e, 0xe7}, + {0x28, 0x3f, 0xd8}, + {0x28, 0x40, 0x07}, // Biquad - BQ12 Right - Filter: Equalizer (Q Factor) Frequency: 3150 Hz Gain: -1dB QVal: 0.7 Bandwidth: 1000 Hz + {0x28, 0x41, 0xe0}, + {0x28, 0x42, 0x6b}, + {0x28, 0x43, 0x1a}, + {0x28, 0x44, 0xf2}, + {0x28, 0x45, 0x8f}, + {0x28, 0x46, 0x42}, + {0x28, 0x47, 0x37}, + {0x28, 0x48, 0x05}, + {0x28, 0x49, 0xda}, + {0x28, 0x4a, 0xc3}, + {0x28, 0x4b, 0xd0}, + {0x28, 0x4c, 0x0d}, + {0x28, 0x4d, 0x70}, + {0x28, 0x4e, 0xbd}, + {0x28, 0x4f, 0xc9}, + {0x28, 0x50, 0xfa}, + {0x28, 0x51, 0x44}, + {0x28, 0x52, 0xd1}, + {0x28, 0x53, 0x16}, + {0x28, 0x54, 0x07}, // Biquad - BQ13 Right - Filter: Equalizer (Q Factor) Frequency: 5000 Hz Gain: -1dB QVal: 0.6 Bandwidth: 1000 Hz + {0x28, 0x55, 0xcb}, + {0x28, 0x56, 0xd1}, + {0x28, 0x57, 0x93}, + {0x28, 0x58, 0xf4}, + {0x28, 0x59, 0x66}, + {0x28, 0x5a, 0x1c}, + {0x28, 0x5b, 0x35}, + {0x28, 0x5c, 0x04}, + {0x28, 0x5d, 0x74}, + {0x28, 0x5e, 0x84}, + {0x28, 0x5f, 0x1b}, + {0x28, 0x60, 0x0b}, + {0x28, 0x61, 0x99}, + {0x28, 0x62, 0xe3}, + {0x28, 0x63, 0xcb}, + {0x28, 0x64, 0xfb}, + {0x28, 0x65, 0xbf}, + {0x28, 0x66, 0xaa}, + {0x28, 0x67, 0x52}, + {0x28, 0x68, 0x07}, // Biquad - BQ14 Right - Filter: Equalizer (Q Factor) Frequency: 8000 Hz Gain: -1dB QVal: 0.6 Bandwidth: 1000 Hz + {0x28, 0x69, 0xb6}, + {0x28, 0x6a, 0xcc}, + {0x28, 0x6b, 0xcd}, + {0x28, 0x6c, 0xf6}, + {0x28, 0x6d, 0xb2}, + {0x28, 0x6e, 0x9e}, + {0x28, 0x6f, 0x90}, + {0x28, 0x70, 0x03}, + {0x28, 0x71, 0x06}, + {0x28, 0x72, 0xfb}, + {0x28, 0x73, 0x43}, + {0x28, 0x74, 0x09}, + {0x28, 0x75, 0x4d}, + {0x28, 0x76, 0x61}, + {0x28, 0x77, 0x70}, + {0x28, 0x78, 0xfd}, + {0x28, 0x79, 0x42}, + {0x28, 0x7a, 0x37}, + {0x28, 0x7b, 0xf1}, + {0x28, 0x7c, 0x07}, // Biquad - BQ15 Right - Filter: Equalizer (Q Factor) Frequency: 16000 Hz Gain: -1dB QVal: 0.5 Bandwidth: 1000 Hz + {0x28, 0x7d, 0x87}, + {0x28, 0x7e, 0xae}, + {0x28, 0x7f, 0xa6}, + {0x29, 0x08, 0xfc}, + {0x29, 0x09, 0x52}, + {0x29, 0x0a, 0x61}, + {0x29, 0x0b, 0x46}, + {0x29, 0x0c, 0xff}, + {0x29, 0x0d, 0xd3}, + {0x29, 0x0e, 0x8e}, + {0x29, 0x0f, 0xcf}, + {0x29, 0x10, 0x03}, + {0x29, 0x11, 0xad}, + {0x29, 0x12, 0x9e}, + {0x29, 0x13, 0xba}, + {0x29, 0x14, 0x00}, + {0x29, 0x15, 0xa4}, + {0x29, 0x16, 0xc2}, + {0x29, 0x17, 0x8c}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_right_0[TAS5805M_EQ_REG_PER_STEP] = { + {0x26, 0x54, 0x08}, // Biquad - BQ1 Right - Filter: Equalizer (Q Factor) Frequency: 20 Hz QVal: 2 Bandwidth: 1000 + {0x26, 0x55, 0x00}, + {0x26, 0x56, 0x00}, + {0x26, 0x57, 0x00}, + {0x26, 0x58, 0xf0}, + {0x26, 0x59, 0x01}, + {0x26, 0x5a, 0x57}, + {0x26, 0x5b, 0xef}, + {0x26, 0x5c, 0x07}, + {0x26, 0x5d, 0xfe}, + {0x26, 0x5e, 0xa8}, + {0x26, 0x5f, 0xf7}, + {0x26, 0x60, 0x0f}, + {0x26, 0x61, 0xfe}, + {0x26, 0x62, 0xa8}, + {0x26, 0x63, 0x11}, + {0x26, 0x64, 0xf8}, + {0x26, 0x65, 0x01}, + {0x26, 0x66, 0x57}, + {0x26, 0x67, 0x09}, + {0x26, 0x68, 0x08}, // Biquad - BQ2 Right - Filter: Equalizer (Q Factor) Frequency: 31.5 Hz QVal: 2 Bandwidth: 1000 + {0x26, 0x69, 0x00}, + {0x26, 0x6a, 0x00}, + {0x26, 0x6b, 0x00}, + {0x26, 0x6c, 0xf0}, + {0x26, 0x6d, 0x02}, + {0x26, 0x6e, 0x1e}, + {0x26, 0x6f, 0x67}, + {0x26, 0x70, 0x07}, + {0x26, 0x71, 0xfd}, + {0x26, 0x72, 0xe3}, + {0x26, 0x73, 0xd3}, + {0x26, 0x74, 0x0f}, + {0x26, 0x75, 0xfd}, + {0x26, 0x76, 0xe1}, + {0x26, 0x77, 0x99}, + {0x26, 0x78, 0xf8}, + {0x26, 0x79, 0x02}, + {0x26, 0x7a, 0x1c}, + {0x26, 0x7b, 0x2d}, + {0x26, 0x7c, 0x08}, // Biquad - BQ3 Right - Filter: Equalizer (Q Factor) Frequency: 50 Hz QVal: 1.5 Bandwidth: 1000 + {0x26, 0x7d, 0x00}, + {0x26, 0x7e, 0x00}, + {0x26, 0x7f, 0x00}, + {0x27, 0x08, 0xf0}, + {0x27, 0x09, 0x04}, + {0x27, 0x0a, 0x7c}, + {0x27, 0x0b, 0x2f}, + {0x27, 0x0c, 0x07}, + {0x27, 0x0d, 0xfb}, + {0x27, 0x0e, 0x89}, + {0x27, 0x0f, 0x6d}, + {0x27, 0x10, 0x0f}, + {0x27, 0x11, 0xfb}, + {0x27, 0x12, 0x83}, + {0x27, 0x13, 0xd1}, + {0x27, 0x14, 0xf8}, + {0x27, 0x15, 0x04}, + {0x27, 0x16, 0x76}, + {0x27, 0x17, 0x93}, + {0x27, 0x18, 0x08}, // Biquad - BQ4 Right - Filter: Equalizer (Q Factor) Frequency: 80 Hz QVal: 1.5 Bandwidth: 1000 + {0x27, 0x19, 0x00}, + {0x27, 0x1a, 0x00}, + {0x27, 0x1b, 0x00}, + {0x27, 0x1c, 0xf0}, + {0x27, 0x1d, 0x07}, + {0x27, 0x1e, 0x31}, + {0x27, 0x1f, 0x45}, + {0x27, 0x20, 0x07}, + {0x27, 0x21, 0xf8}, + {0x27, 0x22, 0xdd}, + {0x27, 0x23, 0x14}, + {0x27, 0x24, 0x0f}, + {0x27, 0x25, 0xf8}, + {0x27, 0x26, 0xce}, + {0x27, 0x27, 0xbb}, + {0x27, 0x28, 0xf8}, + {0x27, 0x29, 0x07}, + {0x27, 0x2a, 0x22}, + {0x27, 0x2b, 0xec}, + {0x27, 0x2c, 0x08}, // Biquad - BQ5 Right - Filter: Equalizer (Q Factor) Frequency: 125 Hz QVal: 1 Bandwidth: 1000 + {0x27, 0x2d, 0x00}, + {0x27, 0x2e, 0x00}, + {0x27, 0x2f, 0x00}, + {0x27, 0x30, 0xf0}, + {0x27, 0x31, 0x10}, + {0x27, 0x32, 0xd2}, + {0x27, 0x33, 0xcc}, + {0x27, 0x34, 0x07}, + {0x27, 0x35, 0xef}, + {0x27, 0x36, 0x50}, + {0x27, 0x37, 0x27}, + {0x27, 0x38, 0x0f}, + {0x27, 0x39, 0xef}, + {0x27, 0x3a, 0x2d}, + {0x27, 0x3b, 0x34}, + {0x27, 0x3c, 0xf8}, + {0x27, 0x3d, 0x10}, + {0x27, 0x3e, 0xaf}, + {0x27, 0x3f, 0xd9}, + {0x27, 0x40, 0x08}, // Biquad - BQ6 Right - Filter: Equalizer (Q Factor) Frequency: 200 Hz QVal: 1 Bandwidth: 1000 + {0x27, 0x41, 0x00}, + {0x27, 0x42, 0x00}, + {0x27, 0x43, 0x00}, + {0x27, 0x44, 0xf0}, + {0x27, 0x45, 0x1a}, + {0x27, 0x46, 0xfb}, + {0x27, 0x47, 0x8a}, + {0x27, 0x48, 0x07}, + {0x27, 0x49, 0xe5}, + {0x27, 0x4a, 0x5d}, + {0x27, 0x4b, 0xb6}, + {0x27, 0x4c, 0x0f}, + {0x27, 0x4d, 0xe5}, + {0x27, 0x4e, 0x04}, + {0x27, 0x4f, 0x76}, + {0x27, 0x50, 0xf8}, + {0x27, 0x51, 0x1a}, + {0x27, 0x52, 0xa2}, + {0x27, 0x53, 0x4a}, + {0x27, 0x54, 0x08}, // Biquad - BQ7 Right - Filter: Equalizer (Q Factor) Frequency: 315 Hz QVal: 0.9 Bandwidth: 1000 + {0x27, 0x55, 0x00}, + {0x27, 0x56, 0x00}, + {0x27, 0x57, 0x00}, + {0x27, 0x58, 0xf0}, + {0x27, 0x59, 0x2f}, + {0x27, 0x5a, 0x3e}, + {0x27, 0x5b, 0x6a}, + {0x27, 0x5c, 0x07}, + {0x27, 0x5d, 0xd1}, + {0x27, 0x5e, 0x9d}, + {0x27, 0x5f, 0xe7}, + {0x27, 0x60, 0x0f}, + {0x27, 0x61, 0xd0}, + {0x27, 0x62, 0xc1}, + {0x27, 0x63, 0x96}, + {0x27, 0x64, 0xf8}, + {0x27, 0x65, 0x2e}, + {0x27, 0x66, 0x62}, + {0x27, 0x67, 0x19}, + {0x27, 0x68, 0x08}, // Biquad - BQ8 Right - Filter: Equalizer (Q Factor) Frequency: 500 Hz QVal: 0.9 Bandwidth: 1000 + {0x27, 0x69, 0x00}, + {0x27, 0x6a, 0x00}, + {0x27, 0x6b, 0x00}, + {0x27, 0x6c, 0xf0}, + {0x27, 0x6d, 0x4b}, + {0x27, 0x6e, 0x4a}, + {0x27, 0x6f, 0xa6}, + {0x27, 0x70, 0x07}, + {0x27, 0x71, 0xb6}, + {0x27, 0x72, 0xdc}, + {0x27, 0x73, 0xc0}, + {0x27, 0x74, 0x0f}, + {0x27, 0x75, 0xb4}, + {0x27, 0x76, 0xb5}, + {0x27, 0x77, 0x5a}, + {0x27, 0x78, 0xf8}, + {0x27, 0x79, 0x49}, + {0x27, 0x7a, 0x23}, + {0x27, 0x7b, 0x40}, + {0x27, 0x7c, 0x08}, // Biquad - BQ9 Right - Filter: Equalizer (Q Factor) Frequency: 800 Hz QVal: 0.8 Bandwidth: 1000 + {0x27, 0x7d, 0x00}, + {0x27, 0x7e, 0x00}, + {0x27, 0x7f, 0x00}, + {0x28, 0x08, 0xf0}, + {0x28, 0x09, 0x87}, + {0x28, 0x0a, 0x3a}, + {0x28, 0x0b, 0xb6}, + {0x28, 0x0c, 0x07}, + {0x28, 0x0d, 0x7e}, + {0x28, 0x0e, 0x34}, + {0x28, 0x0f, 0xca}, + {0x28, 0x10, 0x0f}, + {0x28, 0x11, 0x78}, + {0x28, 0x12, 0xc5}, + {0x28, 0x13, 0x4a}, + {0x28, 0x14, 0xf8}, + {0x28, 0x15, 0x81}, + {0x28, 0x16, 0xcb}, + {0x28, 0x17, 0x36}, + {0x28, 0x18, 0x08}, // Biquad - BQ10 Right - Filter: Equalizer (Q Factor) Frequency: 1250 Hz QVal: 0.8 Bandwidth: 1000 + {0x28, 0x19, 0x00}, + {0x28, 0x1a, 0x00}, + {0x28, 0x1b, 0x00}, + {0x28, 0x1c, 0xf0}, + {0x28, 0x1d, 0xd4}, + {0x28, 0x1e, 0x48}, + {0x28, 0x1f, 0xf3}, + {0x28, 0x20, 0x07}, + {0x28, 0x21, 0x38}, + {0x28, 0x22, 0xbf}, + {0x28, 0x23, 0xae}, + {0x28, 0x24, 0x0f}, + {0x28, 0x25, 0x2b}, + {0x28, 0x26, 0xb7}, + {0x28, 0x27, 0x0d}, + {0x28, 0x28, 0xf8}, + {0x28, 0x29, 0xc7}, + {0x28, 0x2a, 0x40}, + {0x28, 0x2b, 0x52}, + {0x28, 0x2c, 0x08}, // Biquad - BQ11 Right - Filter: Equalizer (Q Factor) Frequency: 2000 Hz QVal: 0.7 Bandwidth: 1000 + {0x28, 0x2d, 0x00}, + {0x28, 0x2e, 0x00}, + {0x28, 0x2f, 0x00}, + {0x28, 0x30, 0xf1}, + {0x28, 0x31, 0x7e}, + {0x28, 0x32, 0x46}, + {0x28, 0x33, 0x3e}, + {0x28, 0x34, 0x06}, + {0x28, 0x35, 0xa1}, + {0x28, 0x36, 0xc5}, + {0x28, 0x37, 0x6e}, + {0x28, 0x38, 0x0e}, + {0x28, 0x39, 0x81}, + {0x28, 0x3a, 0xb9}, + {0x28, 0x3b, 0xc2}, + {0x28, 0x3c, 0xf9}, + {0x28, 0x3d, 0x5e}, + {0x28, 0x3e, 0x3a}, + {0x28, 0x3f, 0x92}, + {0x28, 0x40, 0x08}, // Biquad - BQ12 Right - Filter: Equalizer (Q Factor) Frequency: 3150 Hz QVal: 0.7 Bandwidth: 1000 + {0x28, 0x41, 0x00}, + {0x28, 0x42, 0x00}, + {0x28, 0x43, 0x00}, + {0x28, 0x44, 0xf2}, + {0x28, 0x45, 0x59}, + {0x28, 0x46, 0x5e}, + {0x28, 0x47, 0x71}, + {0x28, 0x48, 0x05}, + {0x28, 0x49, 0xf2}, + {0x28, 0x4a, 0x3d}, + {0x28, 0x4b, 0x2a}, + {0x28, 0x4c, 0x0d}, + {0x28, 0x4d, 0xa6}, + {0x28, 0x4e, 0xa1}, + {0x28, 0x4f, 0x8f}, + {0x28, 0x50, 0xfa}, + {0x28, 0x51, 0x0d}, + {0x28, 0x52, 0xc2}, + {0x28, 0x53, 0xd6}, + {0x28, 0x54, 0x08}, // Biquad - BQ13 Right - Filter: Equalizer (Q Factor) Frequency: 5000 Hz QVal: 0.6 Bandwidth: 1000 + {0x28, 0x55, 0x00}, + {0x28, 0x56, 0x00}, + {0x28, 0x57, 0x00}, + {0x28, 0x58, 0xf4}, + {0x28, 0x59, 0x18}, + {0x28, 0x5a, 0x76}, + {0x28, 0x5b, 0x1f}, + {0x28, 0x5c, 0x04}, + {0x28, 0x5d, 0x92}, + {0x28, 0x5e, 0x55}, + {0x28, 0x5f, 0xd1}, + {0x28, 0x60, 0x0b}, + {0x28, 0x61, 0xe7}, + {0x28, 0x62, 0x89}, + {0x28, 0x63, 0xe1}, + {0x28, 0x64, 0xfb}, + {0x28, 0x65, 0x6d}, + {0x28, 0x66, 0xaa}, + {0x28, 0x67, 0x2f}, + {0x28, 0x68, 0x08}, // Biquad - BQ14 Right - Filter: Equalizer (Q Factor) Frequency: 8000 Hz QVal: 0.6 Bandwidth: 1000 + {0x28, 0x69, 0x00}, + {0x28, 0x6a, 0x00}, + {0x28, 0x6b, 0x00}, + {0x28, 0x6c, 0xf6}, + {0x28, 0x6d, 0x5a}, + {0x28, 0x6e, 0x59}, + {0x28, 0x6f, 0x40}, + {0x28, 0x70, 0x03}, + {0x28, 0x71, 0x23}, + {0x28, 0x72, 0xb5}, + {0x28, 0x73, 0x30}, + {0x28, 0x74, 0x09}, + {0x28, 0x75, 0xa5}, + {0x28, 0x76, 0xa6}, + {0x28, 0x77, 0xc0}, + {0x28, 0x78, 0xfc}, + {0x28, 0x79, 0xdc}, + {0x28, 0x7a, 0x4a}, + {0x28, 0x7b, 0xd0}, + {0x28, 0x7c, 0x08}, // Biquad - BQ15 Right - Filter: Equalizer (Q Factor) Frequency: 16000 Hz QVal: 0.5 Bandwidth: 1000 + {0x28, 0x7d, 0x00}, + {0x28, 0x7e, 0x00}, + {0x28, 0x7f, 0x00}, + {0x29, 0x08, 0xfc}, + {0x29, 0x09, 0x17}, + {0x29, 0x0a, 0x9b}, + {0x29, 0x0b, 0xa8}, + {0x29, 0x0c, 0xff}, + {0x29, 0x0d, 0xd0}, + {0x29, 0x0e, 0xc8}, + {0x29, 0x0f, 0xb1}, + {0x29, 0x10, 0x03}, + {0x29, 0x11, 0xe8}, + {0x29, 0x12, 0x64}, + {0x29, 0x13, 0x58}, + {0x29, 0x14, 0x00}, + {0x29, 0x15, 0x2f}, + {0x29, 0x16, 0x37}, + {0x29, 0x17, 0x4f}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_right_p1[TAS5805M_EQ_REG_PER_STEP] = { + {0x26, 0x54, 0x08}, // Biquad - BQ1 Right - Filter: Equalizer (Q Factor) Frequency: 20 Hz Gain: 1dB QVal: 2 Bandwidth: 1000 Hz + {0x26, 0x55, 0x00}, + {0x26, 0x56, 0x14}, + {0x26, 0x57, 0xee}, + {0x26, 0x58, 0xf0}, + {0x26, 0x59, 0x01}, + {0x26, 0x5a, 0x57}, + {0x26, 0x5b, 0xef}, + {0x26, 0x5c, 0x07}, + {0x26, 0x5d, 0xfe}, + {0x26, 0x5e, 0x94}, + {0x26, 0x5f, 0x0a}, + {0x26, 0x60, 0x0f}, + {0x26, 0x61, 0xfe}, + {0x26, 0x62, 0xa8}, + {0x26, 0x63, 0x11}, + {0x26, 0x64, 0xf8}, + {0x26, 0x65, 0x01}, + {0x26, 0x66, 0x57}, + {0x26, 0x67, 0x09}, + {0x26, 0x68, 0x08}, // Biquad - BQ2 Right - Filter: Equalizer (Q Factor) Frequency: 31.5 Hz Gain: 1dB QVal: 2 Bandwidth: 1000 Hz + {0x26, 0x69, 0x00}, + {0x26, 0x6a, 0x20}, + {0x26, 0x6b, 0xf5}, + {0x26, 0x6c, 0xf0}, + {0x26, 0x6d, 0x02}, + {0x26, 0x6e, 0x1e}, + {0x26, 0x6f, 0x67}, + {0x26, 0x70, 0x07}, + {0x26, 0x71, 0xfd}, + {0x26, 0x72, 0xc2}, + {0x26, 0x73, 0xde}, + {0x26, 0x74, 0x0f}, + {0x26, 0x75, 0xfd}, + {0x26, 0x76, 0xe1}, + {0x26, 0x77, 0x99}, + {0x26, 0x78, 0xf8}, + {0x26, 0x79, 0x02}, + {0x26, 0x7a, 0x1c}, + {0x26, 0x7b, 0x2d}, + {0x26, 0x7c, 0x08}, // Biquad - BQ3 Right - Filter: Equalizer (Q Factor) Frequency: 50 Hz Gain: 1dB QVal: 1.5 Bandwidth: 1000 Hz + {0x26, 0x7d, 0x00}, + {0x26, 0x7e, 0x45}, + {0x26, 0x7f, 0xb5}, + {0x27, 0x08, 0xf0}, + {0x27, 0x09, 0x04}, + {0x27, 0x0a, 0x7c}, + {0x27, 0x0b, 0x2f}, + {0x27, 0x0c, 0x07}, + {0x27, 0x0d, 0xfb}, + {0x27, 0x0e, 0x43}, + {0x27, 0x0f, 0xb8}, + {0x27, 0x10, 0x0f}, + {0x27, 0x11, 0xfb}, + {0x27, 0x12, 0x83}, + {0x27, 0x13, 0xd1}, + {0x27, 0x14, 0xf8}, + {0x27, 0x15, 0x04}, + {0x27, 0x16, 0x76}, + {0x27, 0x17, 0x93}, + {0x27, 0x18, 0x08}, // Biquad - BQ4 Right - Filter: Equalizer (Q Factor) Frequency: 80 Hz Gain: 1dB QVal: 1.5 Bandwidth: 1000 Hz + {0x27, 0x19, 0x00}, + {0x27, 0x1a, 0x6f}, + {0x27, 0x1b, 0x75}, + {0x27, 0x1c, 0xf0}, + {0x27, 0x1d, 0x07}, + {0x27, 0x1e, 0x31}, + {0x27, 0x1f, 0x45}, + {0x27, 0x20, 0x07}, + {0x27, 0x21, 0xf8}, + {0x27, 0x22, 0x6d}, + {0x27, 0x23, 0x9e}, + {0x27, 0x24, 0x0f}, + {0x27, 0x25, 0xf8}, + {0x27, 0x26, 0xce}, + {0x27, 0x27, 0xbb}, + {0x27, 0x28, 0xf8}, + {0x27, 0x29, 0x07}, + {0x27, 0x2a, 0x22}, + {0x27, 0x2b, 0xec}, + {0x27, 0x2c, 0x08}, // Biquad - BQ5 Right - Filter: Equalizer (Q Factor) Frequency: 125 Hz Gain: 1dB QVal: 1 Bandwidth: 1000 Hz + {0x27, 0x2d, 0x01}, + {0x27, 0x2e, 0x04}, + {0x27, 0x2f, 0x9f}, + {0x27, 0x30, 0xf0}, + {0x27, 0x31, 0x10}, + {0x27, 0x32, 0xd2}, + {0x27, 0x33, 0xcc}, + {0x27, 0x34, 0x07}, + {0x27, 0x35, 0xee}, + {0x27, 0x36, 0x4b}, + {0x27, 0x37, 0x88}, + {0x27, 0x38, 0x0f}, + {0x27, 0x39, 0xef}, + {0x27, 0x3a, 0x2d}, + {0x27, 0x3b, 0x34}, + {0x27, 0x3c, 0xf8}, + {0x27, 0x3d, 0x10}, + {0x27, 0x3e, 0xaf}, + {0x27, 0x3f, 0xd9}, + {0x27, 0x40, 0x08}, // Biquad - BQ6 Right - Filter: Equalizer (Q Factor) Frequency: 200 Hz Gain: 1dB QVal: 1 Bandwidth: 1000 Hz + {0x27, 0x41, 0x01}, + {0x27, 0x42, 0x9f}, + {0x27, 0x43, 0xfa}, + {0x27, 0x44, 0xf0}, + {0x27, 0x45, 0x1a}, + {0x27, 0x46, 0xfb}, + {0x27, 0x47, 0x8a}, + {0x27, 0x48, 0x07}, + {0x27, 0x49, 0xe3}, + {0x27, 0x4a, 0xbd}, + {0x27, 0x4b, 0xbc}, + {0x27, 0x4c, 0x0f}, + {0x27, 0x4d, 0xe5}, + {0x27, 0x4e, 0x04}, + {0x27, 0x4f, 0x76}, + {0x27, 0x50, 0xf8}, + {0x27, 0x51, 0x1a}, + {0x27, 0x52, 0xa2}, + {0x27, 0x53, 0x4a}, + {0x27, 0x54, 0x08}, // Biquad - BQ7 Right - Filter: Equalizer (Q Factor) Frequency: 315 Hz Gain: 1dB QVal: 0.9 Bandwidth: 1000 Hz + {0x27, 0x55, 0x02}, + {0x27, 0x56, 0xd4}, + {0x27, 0x57, 0x6e}, + {0x27, 0x58, 0xf0}, + {0x27, 0x59, 0x2f}, + {0x27, 0x5a, 0x3e}, + {0x27, 0x5b, 0x6a}, + {0x27, 0x5c, 0x07}, + {0x27, 0x5d, 0xce}, + {0x27, 0x5e, 0xc9}, + {0x27, 0x5f, 0x79}, + {0x27, 0x60, 0x0f}, + {0x27, 0x61, 0xd0}, + {0x27, 0x62, 0xc1}, + {0x27, 0x63, 0x96}, + {0x27, 0x64, 0xf8}, + {0x27, 0x65, 0x2e}, + {0x27, 0x66, 0x62}, + {0x27, 0x67, 0x19}, + {0x27, 0x68, 0x08}, // Biquad - BQ8 Right - Filter: Equalizer (Q Factor) Frequency: 500 Hz Gain: 1dB QVal: 0.9 Bandwidth: 1000 Hz + {0x27, 0x69, 0x04}, + {0x27, 0x6a, 0x76}, + {0x27, 0x6b, 0x4a}, + {0x27, 0x6c, 0xf0}, + {0x27, 0x6d, 0x4b}, + {0x27, 0x6e, 0x4a}, + {0x27, 0x6f, 0xa6}, + {0x27, 0x70, 0x07}, + {0x27, 0x71, 0xb2}, + {0x27, 0x72, 0x66}, + {0x27, 0x73, 0x75}, + {0x27, 0x74, 0x0f}, + {0x27, 0x75, 0xb4}, + {0x27, 0x76, 0xb5}, + {0x27, 0x77, 0x5a}, + {0x27, 0x78, 0xf8}, + {0x27, 0x79, 0x49}, + {0x27, 0x7a, 0x23}, + {0x27, 0x7b, 0x40}, + {0x27, 0x7c, 0x08}, // Biquad - BQ9 Right - Filter: Equalizer (Q Factor) Frequency: 800 Hz Gain: 1dB QVal: 0.8 Bandwidth: 1000 Hz + {0x27, 0x7d, 0x07}, + {0x27, 0x7e, 0xeb}, + {0x27, 0x7f, 0x2b}, + {0x28, 0x08, 0xf0}, + {0x28, 0x09, 0x87}, + {0x28, 0x0a, 0x3a}, + {0x28, 0x0b, 0xb6}, + {0x28, 0x0c, 0x07}, + {0x28, 0x0d, 0x76}, + {0x28, 0x0e, 0x49}, + {0x28, 0x0f, 0x9f}, + {0x28, 0x10, 0x0f}, + {0x28, 0x11, 0x78}, + {0x28, 0x12, 0xc5}, + {0x28, 0x13, 0x4a}, + {0x28, 0x14, 0xf8}, + {0x28, 0x15, 0x81}, + {0x28, 0x16, 0xcb}, + {0x28, 0x17, 0x36}, + {0x28, 0x18, 0x08}, // Biquad - BQ10 Right - Filter: Equalizer (Q Factor) Frequency: 1250 Hz Gain: 1dB QVal: 0.8 Bandwidth: 1000 Hz + {0x28, 0x19, 0x0c}, + {0x28, 0x1a, 0x27}, + {0x28, 0x1b, 0xfa}, + {0x28, 0x1c, 0xf0}, + {0x28, 0x1d, 0xd4}, + {0x28, 0x1e, 0x48}, + {0x28, 0x1f, 0xf3}, + {0x28, 0x20, 0x07}, + {0x28, 0x21, 0x2c}, + {0x28, 0x22, 0x97}, + {0x28, 0x23, 0xb3}, + {0x28, 0x24, 0x0f}, + {0x28, 0x25, 0x2b}, + {0x28, 0x26, 0xb7}, + {0x28, 0x27, 0x0d}, + {0x28, 0x28, 0xf8}, + {0x28, 0x29, 0xc7}, + {0x28, 0x2a, 0x40}, + {0x28, 0x2b, 0x52}, + {0x28, 0x2c, 0x08}, // Biquad - BQ11 Right - Filter: Equalizer (Q Factor) Frequency: 2000 Hz Gain: 1dB QVal: 0.7 Bandwidth: 1000 Hz + {0x28, 0x2d, 0x15}, + {0x28, 0x2e, 0x5e}, + {0x28, 0x2f, 0x00}, + {0x28, 0x30, 0xf1}, + {0x28, 0x31, 0x7e}, + {0x28, 0x32, 0x46}, + {0x28, 0x33, 0x3e}, + {0x28, 0x34, 0x06}, + {0x28, 0x35, 0x8c}, + {0x28, 0x36, 0x67}, + {0x28, 0x37, 0x6e}, + {0x28, 0x38, 0x0e}, + {0x28, 0x39, 0x81}, + {0x28, 0x3a, 0xb9}, + {0x28, 0x3b, 0xc2}, + {0x28, 0x3c, 0xf9}, + {0x28, 0x3d, 0x5e}, + {0x28, 0x3e, 0x3a}, + {0x28, 0x3f, 0x92}, + {0x28, 0x40, 0x08}, // Biquad - BQ12 Right - Filter: Equalizer (Q Factor) Frequency: 3150 Hz Gain: 1dB QVal: 0.7 Bandwidth: 1000 Hz + {0x28, 0x41, 0x20}, + {0x28, 0x42, 0x13}, + {0x28, 0x43, 0x87}, + {0x28, 0x44, 0xf2}, + {0x28, 0x45, 0x59}, + {0x28, 0x46, 0x5e}, + {0x28, 0x47, 0x71}, + {0x28, 0x48, 0x05}, + {0x28, 0x49, 0xd2}, + {0x28, 0x4a, 0x29}, + {0x28, 0x4b, 0xa3}, + {0x28, 0x4c, 0x0d}, + {0x28, 0x4d, 0xa6}, + {0x28, 0x4e, 0xa1}, + {0x28, 0x4f, 0x8f}, + {0x28, 0x50, 0xfa}, + {0x28, 0x51, 0x0d}, + {0x28, 0x52, 0xc2}, + {0x28, 0x53, 0xd6}, + {0x28, 0x54, 0x08}, // Biquad - BQ13 Right - Filter: Equalizer (Q Factor) Frequency: 5000 Hz Gain: 1dB QVal: 0.6 Bandwidth: 1000 Hz + {0x28, 0x55, 0x35}, + {0x28, 0x56, 0x8b}, + {0x28, 0x57, 0xb0}, + {0x28, 0x58, 0xf4}, + {0x28, 0x59, 0x18}, + {0x28, 0x5a, 0x76}, + {0x28, 0x5b, 0x1f}, + {0x28, 0x5c, 0x04}, + {0x28, 0x5d, 0x5c}, + {0x28, 0x5e, 0xca}, + {0x28, 0x5f, 0x21}, + {0x28, 0x60, 0x0b}, + {0x28, 0x61, 0xe7}, + {0x28, 0x62, 0x89}, + {0x28, 0x63, 0xe1}, + {0x28, 0x64, 0xfb}, + {0x28, 0x65, 0x6d}, + {0x28, 0x66, 0xaa}, + {0x28, 0x67, 0x2f}, + {0x28, 0x68, 0x08}, // Biquad - BQ14 Right - Filter: Equalizer (Q Factor) Frequency: 8000 Hz Gain: 1dB QVal: 0.6 Bandwidth: 1000 Hz + {0x28, 0x69, 0x4b}, + {0x28, 0x6a, 0xe9}, + {0x28, 0x6b, 0xce}, + {0x28, 0x6c, 0xf6}, + {0x28, 0x6d, 0x5a}, + {0x28, 0x6e, 0x59}, + {0x28, 0x6f, 0x40}, + {0x28, 0x70, 0x02}, + {0x28, 0x71, 0xd7}, + {0x28, 0x72, 0xcb}, + {0x28, 0x73, 0x61}, + {0x28, 0x74, 0x09}, + {0x28, 0x75, 0xa5}, + {0x28, 0x76, 0xa6}, + {0x28, 0x77, 0xc0}, + {0x28, 0x78, 0xfc}, + {0x28, 0x79, 0xdc}, + {0x28, 0x7a, 0x4a}, + {0x28, 0x7b, 0xd0}, + {0x28, 0x7c, 0x08}, // Biquad - BQ15 Right - Filter: Equalizer (Q Factor) Frequency: 16000 Hz Gain: 1dB QVal: 0.5 Bandwidth: 1000 Hz + {0x28, 0x7d, 0x7f}, + {0x28, 0x7e, 0xd3}, + {0x28, 0x7f, 0xd8}, + {0x29, 0x08, 0xfc}, + {0x29, 0x09, 0x17}, + {0x29, 0x0a, 0x9b}, + {0x29, 0x0b, 0xa8}, + {0x29, 0x0c, 0xff}, + {0x29, 0x0d, 0x50}, + {0x29, 0x0e, 0xf4}, + {0x29, 0x0f, 0xd9}, + {0x29, 0x10, 0x03}, + {0x29, 0x11, 0xe8}, + {0x29, 0x12, 0x64}, + {0x29, 0x13, 0x58}, + {0x29, 0x14, 0x00}, + {0x29, 0x15, 0x2f}, + {0x29, 0x16, 0x37}, + {0x29, 0x17, 0x4f}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_right_p2[TAS5805M_EQ_REG_PER_STEP] = { + {0x26, 0x54, 0x08}, // Biquad - BQ1 Right - Filter: Equalizer (Q Factor) Frequency: 20 Hz Gain: 2dB QVal: 2 Bandwidth: 1000 Hz + {0x26, 0x55, 0x00}, + {0x26, 0x56, 0x2c}, + {0x26, 0x57, 0x69}, + {0x26, 0x58, 0xf0}, + {0x26, 0x59, 0x01}, + {0x26, 0x5a, 0x57}, + {0x26, 0x5b, 0xef}, + {0x26, 0x5c, 0x07}, + {0x26, 0x5d, 0xfe}, + {0x26, 0x5e, 0x7c}, + {0x26, 0x5f, 0x8e}, + {0x26, 0x60, 0x0f}, + {0x26, 0x61, 0xfe}, + {0x26, 0x62, 0xa8}, + {0x26, 0x63, 0x11}, + {0x26, 0x64, 0xf8}, + {0x26, 0x65, 0x01}, + {0x26, 0x66, 0x57}, + {0x26, 0x67, 0x09}, + {0x26, 0x68, 0x08}, // Biquad - BQ2 Right - Filter: Equalizer (Q Factor) Frequency: 31.5 Hz Gain: 2dB QVal: 2 Bandwidth: 1000 Hz + {0x26, 0x69, 0x00}, + {0x26, 0x6a, 0x45}, + {0x26, 0x6b, 0xef}, + {0x26, 0x6c, 0xf0}, + {0x26, 0x6d, 0x02}, + {0x26, 0x6e, 0x1e}, + {0x26, 0x6f, 0x67}, + {0x26, 0x70, 0x07}, + {0x26, 0x71, 0xfd}, + {0x26, 0x72, 0x9d}, + {0x26, 0x73, 0xe4}, + {0x26, 0x74, 0x0f}, + {0x26, 0x75, 0xfd}, + {0x26, 0x76, 0xe1}, + {0x26, 0x77, 0x99}, + {0x26, 0x78, 0xf8}, + {0x26, 0x79, 0x02}, + {0x26, 0x7a, 0x1c}, + {0x26, 0x7b, 0x2d}, + {0x26, 0x7c, 0x08}, // Biquad - BQ3 Right - Filter: Equalizer (Q Factor) Frequency: 50 Hz Gain: 2dB QVal: 1.5 Bandwidth: 1000 Hz + {0x26, 0x7d, 0x00}, + {0x26, 0x7e, 0x93}, + {0x26, 0x7f, 0xec}, + {0x27, 0x08, 0xf0}, + {0x27, 0x09, 0x04}, + {0x27, 0x0a, 0x7c}, + {0x27, 0x0b, 0x2f}, + {0x27, 0x0c, 0x07}, + {0x27, 0x0d, 0xfa}, + {0x27, 0x0e, 0xf5}, + {0x27, 0x0f, 0x82}, + {0x27, 0x10, 0x0f}, + {0x27, 0x11, 0xfb}, + {0x27, 0x12, 0x83}, + {0x27, 0x13, 0xd1}, + {0x27, 0x14, 0xf8}, + {0x27, 0x15, 0x04}, + {0x27, 0x16, 0x76}, + {0x27, 0x17, 0x93}, + {0x27, 0x18, 0x08}, // Biquad - BQ4 Right - Filter: Equalizer (Q Factor) Frequency: 80 Hz Gain: 2dB QVal: 1.5 Bandwidth: 1000 Hz + {0x27, 0x19, 0x00}, + {0x27, 0x1a, 0xec}, + {0x27, 0x1b, 0x85}, + {0x27, 0x1c, 0xf0}, + {0x27, 0x1d, 0x07}, + {0x27, 0x1e, 0x31}, + {0x27, 0x1f, 0x45}, + {0x27, 0x20, 0x07}, + {0x27, 0x21, 0xf7}, + {0x27, 0x22, 0xf0}, + {0x27, 0x23, 0x8f}, + {0x27, 0x24, 0x0f}, + {0x27, 0x25, 0xf8}, + {0x27, 0x26, 0xce}, + {0x27, 0x27, 0xbb}, + {0x27, 0x28, 0xf8}, + {0x27, 0x29, 0x07}, + {0x27, 0x2a, 0x22}, + {0x27, 0x2b, 0xec}, + {0x27, 0x2c, 0x08}, // Biquad - BQ5 Right - Filter: Equalizer (Q Factor) Frequency: 125 Hz Gain: 2dB QVal: 1 Bandwidth: 1000 Hz + {0x27, 0x2d, 0x02}, + {0x27, 0x2e, 0x29}, + {0x27, 0x2f, 0x0b}, + {0x27, 0x30, 0xf0}, + {0x27, 0x31, 0x10}, + {0x27, 0x32, 0xd2}, + {0x27, 0x33, 0xcc}, + {0x27, 0x34, 0x07}, + {0x27, 0x35, 0xed}, + {0x27, 0x36, 0x27}, + {0x27, 0x37, 0x1c}, + {0x27, 0x38, 0x0f}, + {0x27, 0x39, 0xef}, + {0x27, 0x3a, 0x2d}, + {0x27, 0x3b, 0x34}, + {0x27, 0x3c, 0xf8}, + {0x27, 0x3d, 0x10}, + {0x27, 0x3e, 0xaf}, + {0x27, 0x3f, 0xd9}, + {0x27, 0x40, 0x08}, // Biquad - BQ6 Right - Filter: Equalizer (Q Factor) Frequency: 200 Hz Gain: 2dB QVal: 1 Bandwidth: 1000 Hz + {0x27, 0x41, 0x03}, + {0x27, 0x42, 0x72}, + {0x27, 0x43, 0xb7}, + {0x27, 0x44, 0xf0}, + {0x27, 0x45, 0x1a}, + {0x27, 0x46, 0xfb}, + {0x27, 0x47, 0x8a}, + {0x27, 0x48, 0x07}, + {0x27, 0x49, 0xe1}, + {0x27, 0x4a, 0xea}, + {0x27, 0x4b, 0xff}, + {0x27, 0x4c, 0x0f}, + {0x27, 0x4d, 0xe5}, + {0x27, 0x4e, 0x04}, + {0x27, 0x4f, 0x76}, + {0x27, 0x50, 0xf8}, + {0x27, 0x51, 0x1a}, + {0x27, 0x52, 0xa2}, + {0x27, 0x53, 0x4a}, + {0x27, 0x54, 0x08}, // Biquad - BQ7 Right - Filter: Equalizer (Q Factor) Frequency: 315 Hz Gain: 2dB QVal: 0.9 Bandwidth: 1000 Hz + {0x27, 0x55, 0x06}, + {0x27, 0x56, 0x01}, + {0x27, 0x57, 0x41}, + {0x27, 0x58, 0xf0}, + {0x27, 0x59, 0x2f}, + {0x27, 0x5a, 0x3e}, + {0x27, 0x5b, 0x6a}, + {0x27, 0x5c, 0x07}, + {0x27, 0x5d, 0xcb}, + {0x27, 0x5e, 0x9c}, + {0x27, 0x5f, 0xa7}, + {0x27, 0x60, 0x0f}, + {0x27, 0x61, 0xd0}, + {0x27, 0x62, 0xc1}, + {0x27, 0x63, 0x96}, + {0x27, 0x64, 0xf8}, + {0x27, 0x65, 0x2e}, + {0x27, 0x66, 0x62}, + {0x27, 0x67, 0x19}, + {0x27, 0x68, 0x08}, // Biquad - BQ8 Right - Filter: Equalizer (Q Factor) Frequency: 500 Hz Gain: 2dB QVal: 0.9 Bandwidth: 1000 Hz + {0x27, 0x69, 0x09}, + {0x27, 0x6a, 0x77}, + {0x27, 0x6b, 0xf6}, + {0x27, 0x6c, 0xf0}, + {0x27, 0x6d, 0x4b}, + {0x27, 0x6e, 0x4a}, + {0x27, 0x6f, 0xa6}, + {0x27, 0x70, 0x07}, + {0x27, 0x71, 0xad}, + {0x27, 0x72, 0x64}, + {0x27, 0x73, 0xc9}, + {0x27, 0x74, 0x0f}, + {0x27, 0x75, 0xb4}, + {0x27, 0x76, 0xb5}, + {0x27, 0x77, 0x5a}, + {0x27, 0x78, 0xf8}, + {0x27, 0x79, 0x49}, + {0x27, 0x7a, 0x23}, + {0x27, 0x7b, 0x40}, + {0x27, 0x7c, 0x08}, // Biquad - BQ9 Right - Filter: Equalizer (Q Factor) Frequency: 800 Hz Gain: 2dB QVal: 0.8 Bandwidth: 1000 Hz + {0x27, 0x7d, 0x10}, + {0x27, 0x7e, 0xcd}, + {0x27, 0x7f, 0xaf}, + {0x28, 0x08, 0xf0}, + {0x28, 0x09, 0x87}, + {0x28, 0x0a, 0x3a}, + {0x28, 0x0b, 0xb6}, + {0x28, 0x0c, 0x07}, + {0x28, 0x0d, 0x6d}, + {0x28, 0x0e, 0x67}, + {0x28, 0x0f, 0x1b}, + {0x28, 0x10, 0x0f}, + {0x28, 0x11, 0x78}, + {0x28, 0x12, 0xc5}, + {0x28, 0x13, 0x4a}, + {0x28, 0x14, 0xf8}, + {0x28, 0x15, 0x81}, + {0x28, 0x16, 0xcb}, + {0x28, 0x17, 0x36}, + {0x28, 0x18, 0x08}, // Biquad - BQ10 Right - Filter: Equalizer (Q Factor) Frequency: 1250 Hz Gain: 2dB QVal: 0.8 Bandwidth: 1000 Hz + {0x28, 0x19, 0x19}, + {0x28, 0x1a, 0xcb}, + {0x28, 0x1b, 0xad}, + {0x28, 0x1c, 0xf0}, + {0x28, 0x1d, 0xd4}, + {0x28, 0x1e, 0x48}, + {0x28, 0x1f, 0xf3}, + {0x28, 0x20, 0x07}, + {0x28, 0x21, 0x1e}, + {0x28, 0x22, 0xf4}, + {0x28, 0x23, 0x01}, + {0x28, 0x24, 0x0f}, + {0x28, 0x25, 0x2b}, + {0x28, 0x26, 0xb7}, + {0x28, 0x27, 0x0d}, + {0x28, 0x28, 0xf8}, + {0x28, 0x29, 0xc7}, + {0x28, 0x2a, 0x40}, + {0x28, 0x2b, 0x52}, + {0x28, 0x2c, 0x08}, // Biquad - BQ11 Right - Filter: Equalizer (Q Factor) Frequency: 2000 Hz Gain: 2dB QVal: 0.7 Bandwidth: 1000 Hz + {0x28, 0x2d, 0x2d}, + {0x28, 0x2e, 0x57}, + {0x28, 0x2f, 0x71}, + {0x28, 0x30, 0xf1}, + {0x28, 0x31, 0x7e}, + {0x28, 0x32, 0x46}, + {0x28, 0x33, 0x3e}, + {0x28, 0x34, 0x06}, + {0x28, 0x35, 0x74}, + {0x28, 0x36, 0x6d}, + {0x28, 0x37, 0xfd}, + {0x28, 0x38, 0x0e}, + {0x28, 0x39, 0x81}, + {0x28, 0x3a, 0xb9}, + {0x28, 0x3b, 0xc2}, + {0x28, 0x3c, 0xf9}, + {0x28, 0x3d, 0x5e}, + {0x28, 0x3e, 0x3a}, + {0x28, 0x3f, 0x92}, + {0x28, 0x40, 0x08}, // Biquad - BQ12 Right - Filter: Equalizer (Q Factor) Frequency: 3150 Hz Gain: 2dB QVal: 0.7 Bandwidth: 1000 Hz + {0x28, 0x41, 0x44}, + {0x28, 0x42, 0x11}, + {0x28, 0x43, 0x03}, + {0x28, 0x44, 0xf2}, + {0x28, 0x45, 0x59}, + {0x28, 0x46, 0x5e}, + {0x28, 0x47, 0x71}, + {0x28, 0x48, 0x05}, + {0x28, 0x49, 0xae}, + {0x28, 0x4a, 0x2c}, + {0x28, 0x4b, 0x27}, + {0x28, 0x4c, 0x0d}, + {0x28, 0x4d, 0xa6}, + {0x28, 0x4e, 0xa1}, + {0x28, 0x4f, 0x8f}, + {0x28, 0x50, 0xfa}, + {0x28, 0x51, 0x0d}, + {0x28, 0x52, 0xc2}, + {0x28, 0x53, 0xd6}, + {0x28, 0x54, 0x08}, // Biquad - BQ13 Right - Filter: Equalizer (Q Factor) Frequency: 5000 Hz Gain: 2dB QVal: 0.6 Bandwidth: 1000 Hz + {0x28, 0x55, 0x71}, + {0x28, 0x56, 0x9f}, + {0x28, 0x57, 0xf7}, + {0x28, 0x58, 0xf4}, + {0x28, 0x59, 0x18}, + {0x28, 0x5a, 0x76}, + {0x28, 0x5b, 0x1f}, + {0x28, 0x5c, 0x04}, + {0x28, 0x5d, 0x20}, + {0x28, 0x5e, 0xb5}, + {0x28, 0x5f, 0xda}, + {0x28, 0x60, 0x0b}, + {0x28, 0x61, 0xe7}, + {0x28, 0x62, 0x89}, + {0x28, 0x63, 0xe1}, + {0x28, 0x64, 0xfb}, + {0x28, 0x65, 0x6d}, + {0x28, 0x66, 0xaa}, + {0x28, 0x67, 0x2f}, + {0x28, 0x68, 0x08}, // Biquad - BQ14 Right - Filter: Equalizer (Q Factor) Frequency: 8000 Hz Gain: 2dB QVal: 0.6 Bandwidth: 1000 Hz + {0x28, 0x69, 0xa1}, + {0x28, 0x6a, 0x16}, + {0x28, 0x6b, 0xe6}, + {0x28, 0x6c, 0xf6}, + {0x28, 0x6d, 0x5a}, + {0x28, 0x6e, 0x59}, + {0x28, 0x6f, 0x40}, + {0x28, 0x70, 0x02}, + {0x28, 0x71, 0x82}, + {0x28, 0x72, 0x9e}, + {0x28, 0x73, 0x4a}, + {0x28, 0x74, 0x09}, + {0x28, 0x75, 0xa5}, + {0x28, 0x76, 0xa6}, + {0x28, 0x77, 0xc0}, + {0x28, 0x78, 0xfc}, + {0x28, 0x79, 0xdc}, + {0x28, 0x7a, 0x4a}, + {0x28, 0x7b, 0xd0}, + {0x28, 0x7c, 0x09}, // Biquad - BQ15 Right - Filter: Equalizer (Q Factor) Frequency: 16000 Hz Gain: 2dB QVal: 0.5 Bandwidth: 1000 Hz + {0x28, 0x7d, 0x0f}, + {0x28, 0x7e, 0x40}, + {0x28, 0x7f, 0x99}, + {0x29, 0x08, 0xfc}, + {0x29, 0x09, 0x17}, + {0x29, 0x0a, 0x9b}, + {0x29, 0x0b, 0xa8}, + {0x29, 0x0c, 0xfe}, + {0x29, 0x0d, 0xc1}, + {0x29, 0x0e, 0x88}, + {0x29, 0x0f, 0x18}, + {0x29, 0x10, 0x03}, + {0x29, 0x11, 0xe8}, + {0x29, 0x12, 0x64}, + {0x29, 0x13, 0x58}, + {0x29, 0x14, 0x00}, + {0x29, 0x15, 0x2f}, + {0x29, 0x16, 0x37}, + {0x29, 0x17, 0x4f}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_right_p3[TAS5805M_EQ_REG_PER_STEP] = { + {0x26, 0x54, 0x08}, // Biquad - BQ1 Right - Filter: Equalizer (Q Factor) Frequency: 20 Hz Gain: 3dB QVal: 2 Bandwidth: 1000 Hz + {0x26, 0x55, 0x00}, + {0x26, 0x56, 0x46}, + {0x26, 0x57, 0xc2}, + {0x26, 0x58, 0xf0}, + {0x26, 0x59, 0x01}, + {0x26, 0x5a, 0x57}, + {0x26, 0x5b, 0xef}, + {0x26, 0x5c, 0x07}, + {0x26, 0x5d, 0xfe}, + {0x26, 0x5e, 0x62}, + {0x26, 0x5f, 0x36}, + {0x26, 0x60, 0x0f}, + {0x26, 0x61, 0xfe}, + {0x26, 0x62, 0xa8}, + {0x26, 0x63, 0x11}, + {0x26, 0x64, 0xf8}, + {0x26, 0x65, 0x01}, + {0x26, 0x66, 0x57}, + {0x26, 0x67, 0x09}, + {0x26, 0x68, 0x08}, // Biquad - BQ2 Right - Filter: Equalizer (Q Factor) Frequency: 31.5 Hz Gain: 3dB QVal: 2 Bandwidth: 1000 Hz + {0x26, 0x69, 0x00}, + {0x26, 0x6a, 0x6f}, + {0x26, 0x6b, 0x6c}, + {0x26, 0x6c, 0xf0}, + {0x26, 0x6d, 0x02}, + {0x26, 0x6e, 0x1e}, + {0x26, 0x6f, 0x67}, + {0x26, 0x70, 0x07}, + {0x26, 0x71, 0xfd}, + {0x26, 0x72, 0x74}, + {0x26, 0x73, 0x67}, + {0x26, 0x74, 0x0f}, + {0x26, 0x75, 0xfd}, + {0x26, 0x76, 0xe1}, + {0x26, 0x77, 0x99}, + {0x26, 0x78, 0xf8}, + {0x26, 0x79, 0x02}, + {0x26, 0x7a, 0x1c}, + {0x26, 0x7b, 0x2d}, + {0x26, 0x7c, 0x08}, // Biquad - BQ3 Right - Filter: Equalizer (Q Factor) Frequency: 50 Hz Gain: 3dB QVal: 1.5 Bandwidth: 1000 Hz + {0x26, 0x7d, 0x00}, + {0x26, 0x7e, 0xeb}, + {0x26, 0x7f, 0xad}, + {0x27, 0x08, 0xf0}, + {0x27, 0x09, 0x04}, + {0x27, 0x0a, 0x7c}, + {0x27, 0x0b, 0x2f}, + {0x27, 0x0c, 0x07}, + {0x27, 0x0d, 0xfa}, + {0x27, 0x0e, 0x9d}, + {0x27, 0x0f, 0xc0}, + {0x27, 0x10, 0x0f}, + {0x27, 0x11, 0xfb}, + {0x27, 0x12, 0x83}, + {0x27, 0x13, 0xd1}, + {0x27, 0x14, 0xf8}, + {0x27, 0x15, 0x04}, + {0x27, 0x16, 0x76}, + {0x27, 0x17, 0x93}, + {0x27, 0x18, 0x08}, // Biquad - BQ4 Right - Filter: Equalizer (Q Factor) Frequency: 80 Hz Gain: 3dB QVal: 1.5 Bandwidth: 1000 Hz + {0x27, 0x19, 0x01}, + {0x27, 0x1a, 0x78}, + {0x27, 0x1b, 0xd6}, + {0x27, 0x1c, 0xf0}, + {0x27, 0x1d, 0x07}, + {0x27, 0x1e, 0x31}, + {0x27, 0x1f, 0x45}, + {0x27, 0x20, 0x07}, + {0x27, 0x21, 0xf7}, + {0x27, 0x22, 0x64}, + {0x27, 0x23, 0x3e}, + {0x27, 0x24, 0x0f}, + {0x27, 0x25, 0xf8}, + {0x27, 0x26, 0xce}, + {0x27, 0x27, 0xbb}, + {0x27, 0x28, 0xf8}, + {0x27, 0x29, 0x07}, + {0x27, 0x2a, 0x22}, + {0x27, 0x2b, 0xec}, + {0x27, 0x2c, 0x08}, // Biquad - BQ5 Right - Filter: Equalizer (Q Factor) Frequency: 125 Hz Gain: 3dB QVal: 1 Bandwidth: 1000 Hz + {0x27, 0x2d, 0x03}, + {0x27, 0x2e, 0x71}, + {0x27, 0x2f, 0x26}, + {0x27, 0x30, 0xf0}, + {0x27, 0x31, 0x10}, + {0x27, 0x32, 0xd2}, + {0x27, 0x33, 0xcc}, + {0x27, 0x34, 0x07}, + {0x27, 0x35, 0xeb}, + {0x27, 0x36, 0xdf}, + {0x27, 0x37, 0x01}, + {0x27, 0x38, 0x0f}, + {0x27, 0x39, 0xef}, + {0x27, 0x3a, 0x2d}, + {0x27, 0x3b, 0x34}, + {0x27, 0x3c, 0xf8}, + {0x27, 0x3d, 0x10}, + {0x27, 0x3e, 0xaf}, + {0x27, 0x3f, 0xd9}, + {0x27, 0x40, 0x08}, // Biquad - BQ6 Right - Filter: Equalizer (Q Factor) Frequency: 200 Hz Gain: 3dB QVal: 1 Bandwidth: 1000 Hz + {0x27, 0x41, 0x05}, + {0x27, 0x42, 0x7e}, + {0x27, 0x43, 0x66}, + {0x27, 0x44, 0xf0}, + {0x27, 0x45, 0x1a}, + {0x27, 0x46, 0xfb}, + {0x27, 0x47, 0x8a}, + {0x27, 0x48, 0x07}, + {0x27, 0x49, 0xdf}, + {0x27, 0x4a, 0xdf}, + {0x27, 0x4b, 0x50}, + {0x27, 0x4c, 0x0f}, + {0x27, 0x4d, 0xe5}, + {0x27, 0x4e, 0x04}, + {0x27, 0x4f, 0x76}, + {0x27, 0x50, 0xf8}, + {0x27, 0x51, 0x1a}, + {0x27, 0x52, 0xa2}, + {0x27, 0x53, 0x4a}, + {0x27, 0x54, 0x08}, // Biquad - BQ7 Right - Filter: Equalizer (Q Factor) Frequency: 315 Hz Gain: 3dB QVal: 0.9 Bandwidth: 1000 Hz + {0x27, 0x55, 0x09}, + {0x27, 0x56, 0x91}, + {0x27, 0x57, 0x41}, + {0x27, 0x58, 0xf0}, + {0x27, 0x59, 0x2f}, + {0x27, 0x5a, 0x3e}, + {0x27, 0x5b, 0x6a}, + {0x27, 0x5c, 0x07}, + {0x27, 0x5d, 0xc8}, + {0x27, 0x5e, 0x0c}, + {0x27, 0x5f, 0xa6}, + {0x27, 0x60, 0x0f}, + {0x27, 0x61, 0xd0}, + {0x27, 0x62, 0xc1}, + {0x27, 0x63, 0x96}, + {0x27, 0x64, 0xf8}, + {0x27, 0x65, 0x2e}, + {0x27, 0x66, 0x62}, + {0x27, 0x67, 0x19}, + {0x27, 0x68, 0x08}, // Biquad - BQ8 Right - Filter: Equalizer (Q Factor) Frequency: 500 Hz Gain: 3dB QVal: 0.9 Bandwidth: 1000 Hz + {0x27, 0x69, 0x0f}, + {0x27, 0x6a, 0x16}, + {0x27, 0x6b, 0x06}, + {0x27, 0x6c, 0xf0}, + {0x27, 0x6d, 0x4b}, + {0x27, 0x6e, 0x4a}, + {0x27, 0x6f, 0xa6}, + {0x27, 0x70, 0x07}, + {0x27, 0x71, 0xa7}, + {0x27, 0x72, 0xc6}, + {0x27, 0x73, 0xba}, + {0x27, 0x74, 0x0f}, + {0x27, 0x75, 0xb4}, + {0x27, 0x76, 0xb5}, + {0x27, 0x77, 0x5a}, + {0x27, 0x78, 0xf8}, + {0x27, 0x79, 0x49}, + {0x27, 0x7a, 0x23}, + {0x27, 0x7b, 0x40}, + {0x27, 0x7c, 0x08}, // Biquad - BQ9 Right - Filter: Equalizer (Q Factor) Frequency: 800 Hz Gain: 3dB QVal: 0.8 Bandwidth: 1000 Hz + {0x27, 0x7d, 0x1a}, + {0x27, 0x7e, 0xc5}, + {0x27, 0x7f, 0xbc}, + {0x28, 0x08, 0xf0}, + {0x28, 0x09, 0x87}, + {0x28, 0x0a, 0x3a}, + {0x28, 0x0b, 0xb6}, + {0x28, 0x0c, 0x07}, + {0x28, 0x0d, 0x63}, + {0x28, 0x0e, 0x6f}, + {0x28, 0x0f, 0x0d}, + {0x28, 0x10, 0x0f}, + {0x28, 0x11, 0x78}, + {0x28, 0x12, 0xc5}, + {0x28, 0x13, 0x4a}, + {0x28, 0x14, 0xf8}, + {0x28, 0x15, 0x81}, + {0x28, 0x16, 0xcb}, + {0x28, 0x17, 0x36}, + {0x28, 0x18, 0x08}, // Biquad - BQ10 Right - Filter: Equalizer (Q Factor) Frequency: 1250 Hz Gain: 3dB QVal: 0.8 Bandwidth: 1000 Hz + {0x28, 0x19, 0x29}, + {0x28, 0x1a, 0x19}, + {0x28, 0x1b, 0x6c}, + {0x28, 0x1c, 0xf0}, + {0x28, 0x1d, 0xd4}, + {0x28, 0x1e, 0x48}, + {0x28, 0x1f, 0xf3}, + {0x28, 0x20, 0x07}, + {0x28, 0x21, 0x0f}, + {0x28, 0x22, 0xa6}, + {0x28, 0x23, 0x41}, + {0x28, 0x24, 0x0f}, + {0x28, 0x25, 0x2b}, + {0x28, 0x26, 0xb7}, + {0x28, 0x27, 0x0d}, + {0x28, 0x28, 0xf8}, + {0x28, 0x29, 0xc7}, + {0x28, 0x2a, 0x40}, + {0x28, 0x2b, 0x52}, + {0x28, 0x2c, 0x08}, // Biquad - BQ11 Right - Filter: Equalizer (Q Factor) Frequency: 2000 Hz Gain: 3dB QVal: 0.7 Bandwidth: 1000 Hz + {0x28, 0x2d, 0x48}, + {0x28, 0x2e, 0x3d}, + {0x28, 0x2f, 0xc3}, + {0x28, 0x30, 0xf1}, + {0x28, 0x31, 0x7e}, + {0x28, 0x32, 0x46}, + {0x28, 0x33, 0x3e}, + {0x28, 0x34, 0x06}, + {0x28, 0x35, 0x59}, + {0x28, 0x36, 0x87}, + {0x28, 0x37, 0xab}, + {0x28, 0x38, 0x0e}, + {0x28, 0x39, 0x81}, + {0x28, 0x3a, 0xb9}, + {0x28, 0x3b, 0xc2}, + {0x28, 0x3c, 0xf9}, + {0x28, 0x3d, 0x5e}, + {0x28, 0x3e, 0x3a}, + {0x28, 0x3f, 0x92}, + {0x28, 0x40, 0x08}, // Biquad - BQ12 Right - Filter: Equalizer (Q Factor) Frequency: 3150 Hz Gain: 3dB QVal: 0.7 Bandwidth: 1000 Hz + {0x28, 0x41, 0x6c}, + {0x28, 0x42, 0x72}, + {0x28, 0x43, 0xb6}, + {0x28, 0x44, 0xf2}, + {0x28, 0x45, 0x59}, + {0x28, 0x46, 0x5e}, + {0x28, 0x47, 0x71}, + {0x28, 0x48, 0x05}, + {0x28, 0x49, 0x85}, + {0x28, 0x4a, 0xca}, + {0x28, 0x4b, 0x74}, + {0x28, 0x4c, 0x0d}, + {0x28, 0x4d, 0xa6}, + {0x28, 0x4e, 0xa1}, + {0x28, 0x4f, 0x8f}, + {0x28, 0x50, 0xfa}, + {0x28, 0x51, 0x0d}, + {0x28, 0x52, 0xc2}, + {0x28, 0x53, 0xd6}, + {0x28, 0x54, 0x08}, // Biquad - BQ13 Right - Filter: Equalizer (Q Factor) Frequency: 5000 Hz Gain: 3dB QVal: 0.6 Bandwidth: 1000 Hz + {0x28, 0x55, 0xb5}, + {0x28, 0x56, 0x08}, + {0x28, 0x57, 0xeb}, + {0x28, 0x58, 0xf4}, + {0x28, 0x59, 0x18}, + {0x28, 0x5a, 0x76}, + {0x28, 0x5b, 0x1f}, + {0x28, 0x5c, 0x03}, + {0x28, 0x5d, 0xdd}, + {0x28, 0x5e, 0x4c}, + {0x28, 0x5f, 0xe6}, + {0x28, 0x60, 0x0b}, + {0x28, 0x61, 0xe7}, + {0x28, 0x62, 0x89}, + {0x28, 0x63, 0xe1}, + {0x28, 0x64, 0xfb}, + {0x28, 0x65, 0x6d}, + {0x28, 0x66, 0xaa}, + {0x28, 0x67, 0x2f}, + {0x28, 0x68, 0x09}, // Biquad - BQ14 Right - Filter: Equalizer (Q Factor) Frequency: 8000 Hz Gain: 3dB QVal: 0.6 Bandwidth: 1000 Hz + {0x28, 0x69, 0x00}, + {0x28, 0x6a, 0xa8}, + {0x28, 0x6b, 0x9c}, + {0x28, 0x6c, 0xf6}, + {0x28, 0x6d, 0x5a}, + {0x28, 0x6e, 0x59}, + {0x28, 0x6f, 0x40}, + {0x28, 0x70, 0x02}, + {0x28, 0x71, 0x23}, + {0x28, 0x72, 0x0c}, + {0x28, 0x73, 0x93}, + {0x28, 0x74, 0x09}, + {0x28, 0x75, 0xa5}, + {0x28, 0x76, 0xa6}, + {0x28, 0x77, 0xc0}, + {0x28, 0x78, 0xfc}, + {0x28, 0x79, 0xdc}, + {0x28, 0x7a, 0x4a}, + {0x28, 0x7b, 0xd0}, + {0x28, 0x7c, 0x09}, // Biquad - BQ15 Right - Filter: Equalizer (Q Factor) Frequency: 16000 Hz Gain: 3dB QVal: 0.5 Bandwidth: 1000 Hz + {0x28, 0x7d, 0xb0}, + {0x28, 0x7e, 0x2d}, + {0x28, 0x7f, 0x7a}, + {0x29, 0x08, 0xfc}, + {0x29, 0x09, 0x17}, + {0x29, 0x0a, 0x9b}, + {0x29, 0x0b, 0xa8}, + {0x29, 0x0c, 0xfe}, + {0x29, 0x0d, 0x20}, + {0x29, 0x0e, 0x9b}, + {0x29, 0x0f, 0x37}, + {0x29, 0x10, 0x03}, + {0x29, 0x11, 0xe8}, + {0x29, 0x12, 0x64}, + {0x29, 0x13, 0x58}, + {0x29, 0x14, 0x00}, + {0x29, 0x15, 0x2f}, + {0x29, 0x16, 0x37}, + {0x29, 0x17, 0x4f}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_right_p4[TAS5805M_EQ_REG_PER_STEP] = { + {0x26, 0x54, 0x08}, // Biquad - BQ1 Right - Filter: Equalizer (Q Factor) Frequency: 20 Hz Gain: 4dB QVal: 2 Bandwidth: 1000 Hz + {0x26, 0x55, 0x00}, + {0x26, 0x56, 0x64}, + {0x26, 0x57, 0x52}, + {0x26, 0x58, 0xf0}, + {0x26, 0x59, 0x01}, + {0x26, 0x5a, 0x57}, + {0x26, 0x5b, 0xef}, + {0x26, 0x5c, 0x07}, + {0x26, 0x5d, 0xfe}, + {0x26, 0x5e, 0x44}, + {0x26, 0x5f, 0xa6}, + {0x26, 0x60, 0x0f}, + {0x26, 0x61, 0xfe}, + {0x26, 0x62, 0xa8}, + {0x26, 0x63, 0x11}, + {0x26, 0x64, 0xf8}, + {0x26, 0x65, 0x01}, + {0x26, 0x66, 0x57}, + {0x26, 0x67, 0x09}, + {0x26, 0x68, 0x08}, // Biquad - BQ2 Right - Filter: Equalizer (Q Factor) Frequency: 31.5 Hz Gain: 4dB QVal: 2 Bandwidth: 1000 Hz + {0x26, 0x69, 0x00}, + {0x26, 0x6a, 0x9d}, + {0x26, 0x6b, 0xf9}, + {0x26, 0x6c, 0xf0}, + {0x26, 0x6d, 0x02}, + {0x26, 0x6e, 0x1e}, + {0x26, 0x6f, 0x67}, + {0x26, 0x70, 0x07}, + {0x26, 0x71, 0xfd}, + {0x26, 0x72, 0x45}, + {0x26, 0x73, 0xda}, + {0x26, 0x74, 0x0f}, + {0x26, 0x75, 0xfd}, + {0x26, 0x76, 0xe1}, + {0x26, 0x77, 0x99}, + {0x26, 0x78, 0xf8}, + {0x26, 0x79, 0x02}, + {0x26, 0x7a, 0x1c}, + {0x26, 0x7b, 0x2d}, + {0x26, 0x7c, 0x08}, // Biquad - BQ3 Right - Filter: Equalizer (Q Factor) Frequency: 50 Hz Gain: 4dB QVal: 1.5 Bandwidth: 1000 Hz + {0x26, 0x7d, 0x01}, + {0x26, 0x7e, 0x4e}, + {0x26, 0x7f, 0x24}, + {0x27, 0x08, 0xf0}, + {0x27, 0x09, 0x04}, + {0x27, 0x0a, 0x7c}, + {0x27, 0x0b, 0x2f}, + {0x27, 0x0c, 0x07}, + {0x27, 0x0d, 0xfa}, + {0x27, 0x0e, 0x3b}, + {0x27, 0x0f, 0x49}, + {0x27, 0x10, 0x0f}, + {0x27, 0x11, 0xfb}, + {0x27, 0x12, 0x83}, + {0x27, 0x13, 0xd1}, + {0x27, 0x14, 0xf8}, + {0x27, 0x15, 0x04}, + {0x27, 0x16, 0x76}, + {0x27, 0x17, 0x93}, + {0x27, 0x18, 0x08}, // Biquad - BQ4 Right - Filter: Equalizer (Q Factor) Frequency: 80 Hz Gain: 4dB QVal: 1.5 Bandwidth: 1000 Hz + {0x27, 0x19, 0x02}, + {0x27, 0x1a, 0x16}, + {0x27, 0x1b, 0x47}, + {0x27, 0x1c, 0xf0}, + {0x27, 0x1d, 0x07}, + {0x27, 0x1e, 0x31}, + {0x27, 0x1f, 0x45}, + {0x27, 0x20, 0x07}, + {0x27, 0x21, 0xf6}, + {0x27, 0x22, 0xc6}, + {0x27, 0x23, 0xcd}, + {0x27, 0x24, 0x0f}, + {0x27, 0x25, 0xf8}, + {0x27, 0x26, 0xce}, + {0x27, 0x27, 0xbb}, + {0x27, 0x28, 0xf8}, + {0x27, 0x29, 0x07}, + {0x27, 0x2a, 0x22}, + {0x27, 0x2b, 0xec}, + {0x27, 0x2c, 0x08}, // Biquad - BQ5 Right - Filter: Equalizer (Q Factor) Frequency: 125 Hz Gain: 4dB QVal: 1 Bandwidth: 1000 Hz + {0x27, 0x2d, 0x04}, + {0x27, 0x2e, 0xe1}, + {0x27, 0x2f, 0x49}, + {0x27, 0x30, 0xf0}, + {0x27, 0x31, 0x10}, + {0x27, 0x32, 0xd2}, + {0x27, 0x33, 0xcc}, + {0x27, 0x34, 0x07}, + {0x27, 0x35, 0xea}, + {0x27, 0x36, 0x6e}, + {0x27, 0x37, 0xde}, + {0x27, 0x38, 0x0f}, + {0x27, 0x39, 0xef}, + {0x27, 0x3a, 0x2d}, + {0x27, 0x3b, 0x34}, + {0x27, 0x3c, 0xf8}, + {0x27, 0x3d, 0x10}, + {0x27, 0x3e, 0xaf}, + {0x27, 0x3f, 0xd9}, + {0x27, 0x40, 0x08}, // Biquad - BQ6 Right - Filter: Equalizer (Q Factor) Frequency: 200 Hz Gain: 4dB QVal: 1 Bandwidth: 1000 Hz + {0x27, 0x41, 0x07}, + {0x27, 0x42, 0xc9}, + {0x27, 0x43, 0xfc}, + {0x27, 0x44, 0xf0}, + {0x27, 0x45, 0x1a}, + {0x27, 0x46, 0xfb}, + {0x27, 0x47, 0x8a}, + {0x27, 0x48, 0x07}, + {0x27, 0x49, 0xdd}, + {0x27, 0x4a, 0x93}, + {0x27, 0x4b, 0xba}, + {0x27, 0x4c, 0x0f}, + {0x27, 0x4d, 0xe5}, + {0x27, 0x4e, 0x04}, + {0x27, 0x4f, 0x76}, + {0x27, 0x50, 0xf8}, + {0x27, 0x51, 0x1a}, + {0x27, 0x52, 0xa2}, + {0x27, 0x53, 0x4a}, + {0x27, 0x54, 0x08}, // Biquad - BQ7 Right - Filter: Equalizer (Q Factor) Frequency: 315 Hz Gain: 4dB QVal: 0.9 Bandwidth: 1000 Hz + {0x27, 0x55, 0x0d}, + {0x27, 0x56, 0x90}, + {0x27, 0x57, 0x8a}, + {0x27, 0x58, 0xf0}, + {0x27, 0x59, 0x2f}, + {0x27, 0x5a, 0x3e}, + {0x27, 0x5b, 0x6a}, + {0x27, 0x5c, 0x07}, + {0x27, 0x5d, 0xc4}, + {0x27, 0x5e, 0x0d}, + {0x27, 0x5f, 0x5d}, + {0x27, 0x60, 0x0f}, + {0x27, 0x61, 0xd0}, + {0x27, 0x62, 0xc1}, + {0x27, 0x63, 0x96}, + {0x27, 0x64, 0xf8}, + {0x27, 0x65, 0x2e}, + {0x27, 0x66, 0x62}, + {0x27, 0x67, 0x19}, + {0x27, 0x68, 0x08}, // Biquad - BQ8 Right - Filter: Equalizer (Q Factor) Frequency: 500 Hz Gain: 4dB QVal: 0.9 Bandwidth: 1000 Hz + {0x27, 0x69, 0x15}, + {0x27, 0x6a, 0x63}, + {0x27, 0x6b, 0x8d}, + {0x27, 0x6c, 0xf0}, + {0x27, 0x6d, 0x4b}, + {0x27, 0x6e, 0x4a}, + {0x27, 0x6f, 0xa6}, + {0x27, 0x70, 0x07}, + {0x27, 0x71, 0xa1}, + {0x27, 0x72, 0x79}, + {0x27, 0x73, 0x33}, + {0x27, 0x74, 0x0f}, + {0x27, 0x75, 0xb4}, + {0x27, 0x76, 0xb5}, + {0x27, 0x77, 0x5a}, + {0x27, 0x78, 0xf8}, + {0x27, 0x79, 0x49}, + {0x27, 0x7a, 0x23}, + {0x27, 0x7b, 0x40}, + {0x27, 0x7c, 0x08}, // Biquad - BQ9 Right - Filter: Equalizer (Q Factor) Frequency: 800 Hz Gain: 4dB QVal: 0.8 Bandwidth: 1000 Hz + {0x27, 0x7d, 0x25}, + {0x27, 0x7e, 0xf5}, + {0x27, 0x7f, 0x2f}, + {0x28, 0x08, 0xf0}, + {0x28, 0x09, 0x87}, + {0x28, 0x0a, 0x3a}, + {0x28, 0x0b, 0xb6}, + {0x28, 0x0c, 0x07}, + {0x28, 0x0d, 0x58}, + {0x28, 0x0e, 0x3f}, + {0x28, 0x0f, 0x9a}, + {0x28, 0x10, 0x0f}, + {0x28, 0x11, 0x78}, + {0x28, 0x12, 0xc5}, + {0x28, 0x13, 0x4a}, + {0x28, 0x14, 0xf8}, + {0x28, 0x15, 0x81}, + {0x28, 0x16, 0xcb}, + {0x28, 0x17, 0x36}, + {0x28, 0x18, 0x08}, // Biquad - BQ10 Right - Filter: Equalizer (Q Factor) Frequency: 1250 Hz Gain: 4dB QVal: 0.8 Bandwidth: 1000 Hz + {0x28, 0x19, 0x3a}, + {0x28, 0x1a, 0x45}, + {0x28, 0x1b, 0x36}, + {0x28, 0x1c, 0xf0}, + {0x28, 0x1d, 0xd4}, + {0x28, 0x1e, 0x48}, + {0x28, 0x1f, 0xf3}, + {0x28, 0x20, 0x06}, + {0x28, 0x21, 0xfe}, + {0x28, 0x22, 0x7a}, + {0x28, 0x23, 0x78}, + {0x28, 0x24, 0x0f}, + {0x28, 0x25, 0x2b}, + {0x28, 0x26, 0xb7}, + {0x28, 0x27, 0x0d}, + {0x28, 0x28, 0xf8}, + {0x28, 0x29, 0xc7}, + {0x28, 0x2a, 0x40}, + {0x28, 0x2b, 0x52}, + {0x28, 0x2c, 0x08}, // Biquad - BQ11 Right - Filter: Equalizer (Q Factor) Frequency: 2000 Hz Gain: 4dB QVal: 0.7 Bandwidth: 1000 Hz + {0x28, 0x2d, 0x66}, + {0x28, 0x2e, 0x6c}, + {0x28, 0x2f, 0x58}, + {0x28, 0x30, 0xf1}, + {0x28, 0x31, 0x7e}, + {0x28, 0x32, 0x46}, + {0x28, 0x33, 0x3e}, + {0x28, 0x34, 0x06}, + {0x28, 0x35, 0x3b}, + {0x28, 0x36, 0x59}, + {0x28, 0x37, 0x16}, + {0x28, 0x38, 0x0e}, + {0x28, 0x39, 0x81}, + {0x28, 0x3a, 0xb9}, + {0x28, 0x3b, 0xc2}, + {0x28, 0x3c, 0xf9}, + {0x28, 0x3d, 0x5e}, + {0x28, 0x3e, 0x3a}, + {0x28, 0x3f, 0x92}, + {0x28, 0x40, 0x08}, // Biquad - BQ12 Right - Filter: Equalizer (Q Factor) Frequency: 3150 Hz Gain: 4dB QVal: 0.7 Bandwidth: 1000 Hz + {0x28, 0x41, 0x99}, + {0x28, 0x42, 0xc1}, + {0x28, 0x43, 0xcd}, + {0x28, 0x44, 0xf2}, + {0x28, 0x45, 0x59}, + {0x28, 0x46, 0x5e}, + {0x28, 0x47, 0x71}, + {0x28, 0x48, 0x05}, + {0x28, 0x49, 0x58}, + {0x28, 0x4a, 0x7b}, + {0x28, 0x4b, 0x5d}, + {0x28, 0x4c, 0x0d}, + {0x28, 0x4d, 0xa6}, + {0x28, 0x4e, 0xa1}, + {0x28, 0x4f, 0x8f}, + {0x28, 0x50, 0xfa}, + {0x28, 0x51, 0x0d}, + {0x28, 0x52, 0xc2}, + {0x28, 0x53, 0xd6}, + {0x28, 0x54, 0x09}, // Biquad - BQ13 Right - Filter: Equalizer (Q Factor) Frequency: 5000 Hz Gain: 4dB QVal: 0.6 Bandwidth: 1000 Hz + {0x28, 0x55, 0x00}, + {0x28, 0x56, 0xab}, + {0x28, 0x57, 0x8a}, + {0x28, 0x58, 0xf4}, + {0x28, 0x59, 0x18}, + {0x28, 0x5a, 0x76}, + {0x28, 0x5b, 0x1f}, + {0x28, 0x5c, 0x03}, + {0x28, 0x5d, 0x91}, + {0x28, 0x5e, 0xaa}, + {0x28, 0x5f, 0x47}, + {0x28, 0x60, 0x0b}, + {0x28, 0x61, 0xe7}, + {0x28, 0x62, 0x89}, + {0x28, 0x63, 0xe1}, + {0x28, 0x64, 0xfb}, + {0x28, 0x65, 0x6d}, + {0x28, 0x66, 0xaa}, + {0x28, 0x67, 0x2f}, + {0x28, 0x68, 0x09}, // Biquad - BQ14 Right - Filter: Equalizer (Q Factor) Frequency: 8000 Hz Gain: 4dB QVal: 0.6 Bandwidth: 1000 Hz + {0x28, 0x69, 0x6b}, + {0x28, 0x6a, 0xe3}, + {0x28, 0x6b, 0x97}, + {0x28, 0x6c, 0xf6}, + {0x28, 0x6d, 0x5a}, + {0x28, 0x6e, 0x59}, + {0x28, 0x6f, 0x40}, + {0x28, 0x70, 0x01}, + {0x28, 0x71, 0xb7}, + {0x28, 0x72, 0xd1}, + {0x28, 0x73, 0x98}, + {0x28, 0x74, 0x09}, + {0x28, 0x75, 0xa5}, + {0x28, 0x76, 0xa6}, + {0x28, 0x77, 0xc0}, + {0x28, 0x78, 0xfc}, + {0x28, 0x79, 0xdc}, + {0x28, 0x7a, 0x4a}, + {0x28, 0x7b, 0xd0}, + {0x28, 0x7c, 0x0a}, // Biquad - BQ15 Right - Filter: Equalizer (Q Factor) Frequency: 16000 Hz Gain: 4dB QVal: 0.5 Bandwidth: 1000 Hz + {0x28, 0x7d, 0x64}, + {0x28, 0x7e, 0xbd}, + {0x28, 0x7f, 0x22}, + {0x29, 0x08, 0xfc}, + {0x29, 0x09, 0x17}, + {0x29, 0x0a, 0x9b}, + {0x29, 0x0b, 0xa8}, + {0x29, 0x0c, 0xfd}, + {0x29, 0x0d, 0x6c}, + {0x29, 0x0e, 0x0b}, + {0x29, 0x0f, 0x8f}, + {0x29, 0x10, 0x03}, + {0x29, 0x11, 0xe8}, + {0x29, 0x12, 0x64}, + {0x29, 0x13, 0x58}, + {0x29, 0x14, 0x00}, + {0x29, 0x15, 0x2f}, + {0x29, 0x16, 0x37}, + {0x29, 0x17, 0x4f}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_right_p5[TAS5805M_EQ_REG_PER_STEP] = { + {0x26, 0x54, 0x08}, // Biquad - BQ1 Right - Filter: Equalizer (Q Factor) Frequency: 20 Hz Gain: 5dB QVal: 2 Bandwidth: 1000 Hz + {0x26, 0x55, 0x00}, + {0x26, 0x56, 0x85}, + {0x26, 0x57, 0x7d}, + {0x26, 0x58, 0xf0}, + {0x26, 0x59, 0x01}, + {0x26, 0x5a, 0x57}, + {0x26, 0x5b, 0xef}, + {0x26, 0x5c, 0x07}, + {0x26, 0x5d, 0xfe}, + {0x26, 0x5e, 0x23}, + {0x26, 0x5f, 0x7a}, + {0x26, 0x60, 0x0f}, + {0x26, 0x61, 0xfe}, + {0x26, 0x62, 0xa8}, + {0x26, 0x63, 0x11}, + {0x26, 0x64, 0xf8}, + {0x26, 0x65, 0x01}, + {0x26, 0x66, 0x57}, + {0x26, 0x67, 0x09}, + {0x26, 0x68, 0x08}, // Biquad - BQ2 Right - Filter: Equalizer (Q Factor) Frequency: 31.5 Hz Gain: 5dB QVal: 2 Bandwidth: 1000 Hz + {0x26, 0x69, 0x00}, + {0x26, 0x6a, 0xd2}, + {0x26, 0x6b, 0x34}, + {0x26, 0x6c, 0xf0}, + {0x26, 0x6d, 0x02}, + {0x26, 0x6e, 0x1e}, + {0x26, 0x6f, 0x67}, + {0x26, 0x70, 0x07}, + {0x26, 0x71, 0xfd}, + {0x26, 0x72, 0x11}, + {0x26, 0x73, 0x9f}, + {0x26, 0x74, 0x0f}, + {0x26, 0x75, 0xfd}, + {0x26, 0x76, 0xe1}, + {0x26, 0x77, 0x99}, + {0x26, 0x78, 0xf8}, + {0x26, 0x79, 0x02}, + {0x26, 0x7a, 0x1c}, + {0x26, 0x7b, 0x2d}, + {0x26, 0x7c, 0x08}, // Biquad - BQ3 Right - Filter: Equalizer (Q Factor) Frequency: 50 Hz Gain: 5dB QVal: 1.5 Bandwidth: 1000 Hz + {0x26, 0x7d, 0x01}, + {0x26, 0x7e, 0xbc}, + {0x26, 0x7f, 0x9f}, + {0x27, 0x08, 0xf0}, + {0x27, 0x09, 0x04}, + {0x27, 0x0a, 0x7c}, + {0x27, 0x0b, 0x2f}, + {0x27, 0x0c, 0x07}, + {0x27, 0x0d, 0xf9}, + {0x27, 0x0e, 0xcc}, + {0x27, 0x0f, 0xcf}, + {0x27, 0x10, 0x0f}, + {0x27, 0x11, 0xfb}, + {0x27, 0x12, 0x83}, + {0x27, 0x13, 0xd1}, + {0x27, 0x14, 0xf8}, + {0x27, 0x15, 0x04}, + {0x27, 0x16, 0x76}, + {0x27, 0x17, 0x93}, + {0x27, 0x18, 0x08}, // Biquad - BQ4 Right - Filter: Equalizer (Q Factor) Frequency: 80 Hz Gain: 5dB QVal: 1.5 Bandwidth: 1000 Hz + {0x27, 0x19, 0x02}, + {0x27, 0x1a, 0xc6}, + {0x27, 0x1b, 0xed}, + {0x27, 0x1c, 0xf0}, + {0x27, 0x1d, 0x07}, + {0x27, 0x1e, 0x31}, + {0x27, 0x1f, 0x45}, + {0x27, 0x20, 0x07}, + {0x27, 0x21, 0xf6}, + {0x27, 0x22, 0x16}, + {0x27, 0x23, 0x26}, + {0x27, 0x24, 0x0f}, + {0x27, 0x25, 0xf8}, + {0x27, 0x26, 0xce}, + {0x27, 0x27, 0xbb}, + {0x27, 0x28, 0xf8}, + {0x27, 0x29, 0x07}, + {0x27, 0x2a, 0x22}, + {0x27, 0x2b, 0xec}, + {0x27, 0x2c, 0x08}, // Biquad - BQ5 Right - Filter: Equalizer (Q Factor) Frequency: 125 Hz Gain: 5dB QVal: 1 Bandwidth: 1000 Hz + {0x27, 0x2d, 0x06}, + {0x27, 0x2e, 0x7e}, + {0x27, 0x2f, 0x58}, + {0x27, 0x30, 0xf0}, + {0x27, 0x31, 0x10}, + {0x27, 0x32, 0xd2}, + {0x27, 0x33, 0xcc}, + {0x27, 0x34, 0x07}, + {0x27, 0x35, 0xe8}, + {0x27, 0x36, 0xd1}, + {0x27, 0x37, 0xcf}, + {0x27, 0x38, 0x0f}, + {0x27, 0x39, 0xef}, + {0x27, 0x3a, 0x2d}, + {0x27, 0x3b, 0x34}, + {0x27, 0x3c, 0xf8}, + {0x27, 0x3d, 0x10}, + {0x27, 0x3e, 0xaf}, + {0x27, 0x3f, 0xd9}, + {0x27, 0x40, 0x08}, // Biquad - BQ6 Right - Filter: Equalizer (Q Factor) Frequency: 200 Hz Gain: 5dB QVal: 1 Bandwidth: 1000 Hz + {0x27, 0x41, 0x0a}, + {0x27, 0x42, 0x5d}, + {0x27, 0x43, 0x44}, + {0x27, 0x44, 0xf0}, + {0x27, 0x45, 0x1a}, + {0x27, 0x46, 0xfb}, + {0x27, 0x47, 0x8a}, + {0x27, 0x48, 0x07}, + {0x27, 0x49, 0xdb}, + {0x27, 0x4a, 0x00}, + {0x27, 0x4b, 0x72}, + {0x27, 0x4c, 0x0f}, + {0x27, 0x4d, 0xe5}, + {0x27, 0x4e, 0x04}, + {0x27, 0x4f, 0x76}, + {0x27, 0x50, 0xf8}, + {0x27, 0x51, 0x1a}, + {0x27, 0x52, 0xa2}, + {0x27, 0x53, 0x4a}, + {0x27, 0x54, 0x08}, // Biquad - BQ7 Right - Filter: Equalizer (Q Factor) Frequency: 315 Hz Gain: 5dB QVal: 0.9 Bandwidth: 1000 Hz + {0x27, 0x55, 0x12}, + {0x27, 0x56, 0x0c}, + {0x27, 0x57, 0xaf}, + {0x27, 0x58, 0xf0}, + {0x27, 0x59, 0x2f}, + {0x27, 0x5a, 0x3e}, + {0x27, 0x5b, 0x6a}, + {0x27, 0x5c, 0x07}, + {0x27, 0x5d, 0xbf}, + {0x27, 0x5e, 0x91}, + {0x27, 0x5f, 0x38}, + {0x27, 0x60, 0x0f}, + {0x27, 0x61, 0xd0}, + {0x27, 0x62, 0xc1}, + {0x27, 0x63, 0x96}, + {0x27, 0x64, 0xf8}, + {0x27, 0x65, 0x2e}, + {0x27, 0x66, 0x62}, + {0x27, 0x67, 0x19}, + {0x27, 0x68, 0x08}, // Biquad - BQ8 Right - Filter: Equalizer (Q Factor) Frequency: 500 Hz Gain: 5dB QVal: 0.9 Bandwidth: 1000 Hz + {0x27, 0x69, 0x1c}, + {0x27, 0x6a, 0x75}, + {0x27, 0x6b, 0xf6}, + {0x27, 0x6c, 0xf0}, + {0x27, 0x6d, 0x4b}, + {0x27, 0x6e, 0x4a}, + {0x27, 0x6f, 0xa6}, + {0x27, 0x70, 0x07}, + {0x27, 0x71, 0x9a}, + {0x27, 0x72, 0x66}, + {0x27, 0x73, 0xca}, + {0x27, 0x74, 0x0f}, + {0x27, 0x75, 0xb4}, + {0x27, 0x76, 0xb5}, + {0x27, 0x77, 0x5a}, + {0x27, 0x78, 0xf8}, + {0x27, 0x79, 0x49}, + {0x27, 0x7a, 0x23}, + {0x27, 0x7b, 0x40}, + {0x27, 0x7c, 0x08}, // Biquad - BQ9 Right - Filter: Equalizer (Q Factor) Frequency: 800 Hz Gain: 5dB QVal: 0.8 Bandwidth: 1000 Hz + {0x27, 0x7d, 0x32}, + {0x27, 0x7e, 0x82}, + {0x27, 0x7f, 0x07}, + {0x28, 0x08, 0xf0}, + {0x28, 0x09, 0x87}, + {0x28, 0x0a, 0x3a}, + {0x28, 0x0b, 0xb6}, + {0x28, 0x0c, 0x07}, + {0x28, 0x0d, 0x4b}, + {0x28, 0x0e, 0xb2}, + {0x28, 0x0f, 0xc3}, + {0x28, 0x10, 0x0f}, + {0x28, 0x11, 0x78}, + {0x28, 0x12, 0xc5}, + {0x28, 0x13, 0x4a}, + {0x28, 0x14, 0xf8}, + {0x28, 0x15, 0x81}, + {0x28, 0x16, 0xcb}, + {0x28, 0x17, 0x36}, + {0x28, 0x18, 0x08}, // Biquad - BQ10 Right - Filter: Equalizer (Q Factor) Frequency: 1250 Hz Gain: 5dB QVal: 0.8 Bandwidth: 1000 Hz + {0x28, 0x19, 0x4d}, + {0x28, 0x1a, 0x89}, + {0x28, 0x1b, 0x5d}, + {0x28, 0x1c, 0xf0}, + {0x28, 0x1d, 0xd4}, + {0x28, 0x1e, 0x48}, + {0x28, 0x1f, 0xf3}, + {0x28, 0x20, 0x06}, + {0x28, 0x21, 0xeb}, + {0x28, 0x22, 0x36}, + {0x28, 0x23, 0x51}, + {0x28, 0x24, 0x0f}, + {0x28, 0x25, 0x2b}, + {0x28, 0x26, 0xb7}, + {0x28, 0x27, 0x0d}, + {0x28, 0x28, 0xf8}, + {0x28, 0x29, 0xc7}, + {0x28, 0x2a, 0x40}, + {0x28, 0x2b, 0x52}, + {0x28, 0x2c, 0x08}, // Biquad - BQ11 Right - Filter: Equalizer (Q Factor) Frequency: 2000 Hz Gain: 5dB QVal: 0.7 Bandwidth: 1000 Hz + {0x28, 0x2d, 0x88}, + {0x28, 0x2e, 0x49}, + {0x28, 0x2f, 0xb6}, + {0x28, 0x30, 0xf1}, + {0x28, 0x31, 0x7e}, + {0x28, 0x32, 0x46}, + {0x28, 0x33, 0x3e}, + {0x28, 0x34, 0x06}, + {0x28, 0x35, 0x19}, + {0x28, 0x36, 0x7b}, + {0x28, 0x37, 0xb8}, + {0x28, 0x38, 0x0e}, + {0x28, 0x39, 0x81}, + {0x28, 0x3a, 0xb9}, + {0x28, 0x3b, 0xc2}, + {0x28, 0x3c, 0xf9}, + {0x28, 0x3d, 0x5e}, + {0x28, 0x3e, 0x3a}, + {0x28, 0x3f, 0x92}, + {0x28, 0x40, 0x08}, // Biquad - BQ12 Right - Filter: Equalizer (Q Factor) Frequency: 3150 Hz Gain: 5dB QVal: 0.7 Bandwidth: 1000 Hz + {0x28, 0x41, 0xcc}, + {0x28, 0x42, 0x98}, + {0x28, 0x43, 0x32}, + {0x28, 0x44, 0xf2}, + {0x28, 0x45, 0x59}, + {0x28, 0x46, 0x5e}, + {0x28, 0x47, 0x71}, + {0x28, 0x48, 0x05}, + {0x28, 0x49, 0x25}, + {0x28, 0x4a, 0xa4}, + {0x28, 0x4b, 0xf8}, + {0x28, 0x4c, 0x0d}, + {0x28, 0x4d, 0xa6}, + {0x28, 0x4e, 0xa1}, + {0x28, 0x4f, 0x8f}, + {0x28, 0x50, 0xfa}, + {0x28, 0x51, 0x0d}, + {0x28, 0x52, 0xc2}, + {0x28, 0x53, 0xd6}, + {0x28, 0x54, 0x09}, // Biquad - BQ13 Right - Filter: Equalizer (Q Factor) Frequency: 5000 Hz Gain: 5dB QVal: 0.6 Bandwidth: 1000 Hz + {0x28, 0x55, 0x55}, + {0x28, 0x56, 0x88}, + {0x28, 0x57, 0xc2}, + {0x28, 0x58, 0xf4}, + {0x28, 0x59, 0x18}, + {0x28, 0x5a, 0x76}, + {0x28, 0x5b, 0x1f}, + {0x28, 0x5c, 0x03}, + {0x28, 0x5d, 0x3c}, + {0x28, 0x5e, 0xcd}, + {0x28, 0x5f, 0x0f}, + {0x28, 0x60, 0x0b}, + {0x28, 0x61, 0xe7}, + {0x28, 0x62, 0x89}, + {0x28, 0x63, 0xe1}, + {0x28, 0x64, 0xfb}, + {0x28, 0x65, 0x6d}, + {0x28, 0x66, 0xaa}, + {0x28, 0x67, 0x2f}, + {0x28, 0x68, 0x09}, // Biquad - BQ14 Right - Filter: Equalizer (Q Factor) Frequency: 8000 Hz Gain: 5dB QVal: 0.6 Bandwidth: 1000 Hz + {0x28, 0x69, 0xe4}, + {0x28, 0x6a, 0x34}, + {0x28, 0x6b, 0x1a}, + {0x28, 0x6c, 0xf6}, + {0x28, 0x6d, 0x5a}, + {0x28, 0x6e, 0x59}, + {0x28, 0x6f, 0x40}, + {0x28, 0x70, 0x01}, + {0x28, 0x71, 0x3f}, + {0x28, 0x72, 0x81}, + {0x28, 0x73, 0x16}, + {0x28, 0x74, 0x09}, + {0x28, 0x75, 0xa5}, + {0x28, 0x76, 0xa6}, + {0x28, 0x77, 0xc0}, + {0x28, 0x78, 0xfc}, + {0x28, 0x79, 0xdc}, + {0x28, 0x7a, 0x4a}, + {0x28, 0x7b, 0xd0}, + {0x28, 0x7c, 0x0b}, // Biquad - BQ15 Right - Filter: Equalizer (Q Factor) Frequency: 16000 Hz Gain: 5dB QVal: 0.5 Bandwidth: 1000 Hz + {0x28, 0x7d, 0x2f}, + {0x28, 0x7e, 0x54}, + {0x28, 0x7f, 0xee}, + {0x29, 0x08, 0xfc}, + {0x29, 0x09, 0x17}, + {0x29, 0x0a, 0x9b}, + {0x29, 0x0b, 0xa8}, + {0x29, 0x0c, 0xfc}, + {0x29, 0x0d, 0xa1}, + {0x29, 0x0e, 0x73}, + {0x29, 0x0f, 0xc3}, + {0x29, 0x10, 0x03}, + {0x29, 0x11, 0xe8}, + {0x29, 0x12, 0x64}, + {0x29, 0x13, 0x58}, + {0x29, 0x14, 0x00}, + {0x29, 0x15, 0x2f}, + {0x29, 0x16, 0x37}, + {0x29, 0x17, 0x4f}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_right_p6[TAS5805M_EQ_REG_PER_STEP] = { + {0x26, 0x54, 0x08}, // Biquad - BQ1 Right - Filter: Equalizer (Q Factor) Frequency: 20 Hz Gain: 6dB QVal: 2 Bandwidth: 1000 Hz + {0x26, 0x55, 0x00}, + {0x26, 0x56, 0xaa}, + {0x26, 0x57, 0xb4}, + {0x26, 0x58, 0xf0}, + {0x26, 0x59, 0x01}, + {0x26, 0x5a, 0x57}, + {0x26, 0x5b, 0xef}, + {0x26, 0x5c, 0x07}, + {0x26, 0x5d, 0xfd}, + {0x26, 0x5e, 0xfe}, + {0x26, 0x5f, 0x43}, + {0x26, 0x60, 0x0f}, + {0x26, 0x61, 0xfe}, + {0x26, 0x62, 0xa8}, + {0x26, 0x63, 0x11}, + {0x26, 0x64, 0xf8}, + {0x26, 0x65, 0x01}, + {0x26, 0x66, 0x57}, + {0x26, 0x67, 0x09}, + {0x26, 0x68, 0x08}, // Biquad - BQ2 Right - Filter: Equalizer (Q Factor) Frequency: 31.5 Hz Gain: 6dB QVal: 2 Bandwidth: 1000 Hz + {0x26, 0x69, 0x01}, + {0x26, 0x6a, 0x0c}, + {0x26, 0x6b, 0xcf}, + {0x26, 0x6c, 0xf0}, + {0x26, 0x6d, 0x02}, + {0x26, 0x6e, 0x1e}, + {0x26, 0x6f, 0x67}, + {0x26, 0x70, 0x07}, + {0x26, 0x71, 0xfc}, + {0x26, 0x72, 0xd7}, + {0x26, 0x73, 0x04}, + {0x26, 0x74, 0x0f}, + {0x26, 0x75, 0xfd}, + {0x26, 0x76, 0xe1}, + {0x26, 0x77, 0x99}, + {0x26, 0x78, 0xf8}, + {0x26, 0x79, 0x02}, + {0x26, 0x7a, 0x1c}, + {0x26, 0x7b, 0x2d}, + {0x26, 0x7c, 0x08}, // Biquad - BQ3 Right - Filter: Equalizer (Q Factor) Frequency: 50 Hz Gain: 6dB QVal: 1.5 Bandwidth: 1000 Hz + {0x26, 0x7d, 0x02}, + {0x26, 0x7e, 0x38}, + {0x26, 0x7f, 0x94}, + {0x27, 0x08, 0xf0}, + {0x27, 0x09, 0x04}, + {0x27, 0x0a, 0x7c}, + {0x27, 0x0b, 0x2f}, + {0x27, 0x0c, 0x07}, + {0x27, 0x0d, 0xf9}, + {0x27, 0x0e, 0x50}, + {0x27, 0x0f, 0xd9}, + {0x27, 0x10, 0x0f}, + {0x27, 0x11, 0xfb}, + {0x27, 0x12, 0x83}, + {0x27, 0x13, 0xd1}, + {0x27, 0x14, 0xf8}, + {0x27, 0x15, 0x04}, + {0x27, 0x16, 0x76}, + {0x27, 0x17, 0x93}, + {0x27, 0x18, 0x08}, // Biquad - BQ4 Right - Filter: Equalizer (Q Factor) Frequency: 80 Hz Gain: 6dB QVal: 1.5 Bandwidth: 1000 Hz + {0x27, 0x19, 0x03}, + {0x27, 0x1a, 0x8d}, + {0x27, 0x1b, 0x22}, + {0x27, 0x1c, 0xf0}, + {0x27, 0x1d, 0x07}, + {0x27, 0x1e, 0x31}, + {0x27, 0x1f, 0x45}, + {0x27, 0x20, 0x07}, + {0x27, 0x21, 0xf5}, + {0x27, 0x22, 0x4f}, + {0x27, 0x23, 0xf2}, + {0x27, 0x24, 0x0f}, + {0x27, 0x25, 0xf8}, + {0x27, 0x26, 0xce}, + {0x27, 0x27, 0xbb}, + {0x27, 0x28, 0xf8}, + {0x27, 0x29, 0x07}, + {0x27, 0x2a, 0x22}, + {0x27, 0x2b, 0xec}, + {0x27, 0x2c, 0x08}, // Biquad - BQ5 Right - Filter: Equalizer (Q Factor) Frequency: 125 Hz Gain: 6dB QVal: 1 Bandwidth: 1000 Hz + {0x27, 0x2d, 0x08}, + {0x27, 0x2e, 0x4d}, + {0x27, 0x2f, 0xce}, + {0x27, 0x30, 0xf0}, + {0x27, 0x31, 0x10}, + {0x27, 0x32, 0xd2}, + {0x27, 0x33, 0xcc}, + {0x27, 0x34, 0x07}, + {0x27, 0x35, 0xe7}, + {0x27, 0x36, 0x02}, + {0x27, 0x37, 0x59}, + {0x27, 0x38, 0x0f}, + {0x27, 0x39, 0xef}, + {0x27, 0x3a, 0x2d}, + {0x27, 0x3b, 0x34}, + {0x27, 0x3c, 0xf8}, + {0x27, 0x3d, 0x10}, + {0x27, 0x3e, 0xaf}, + {0x27, 0x3f, 0xd9}, + {0x27, 0x40, 0x08}, // Biquad - BQ6 Right - Filter: Equalizer (Q Factor) Frequency: 200 Hz Gain: 6dB QVal: 1 Bandwidth: 1000 Hz + {0x27, 0x41, 0x0d}, + {0x27, 0x42, 0x40}, + {0x27, 0x43, 0xfe}, + {0x27, 0x44, 0xf0}, + {0x27, 0x45, 0x1a}, + {0x27, 0x46, 0xfb}, + {0x27, 0x47, 0x8a}, + {0x27, 0x48, 0x07}, + {0x27, 0x49, 0xd8}, + {0x27, 0x4a, 0x1c}, + {0x27, 0x4b, 0xb8}, + {0x27, 0x4c, 0x0f}, + {0x27, 0x4d, 0xe5}, + {0x27, 0x4e, 0x04}, + {0x27, 0x4f, 0x76}, + {0x27, 0x50, 0xf8}, + {0x27, 0x51, 0x1a}, + {0x27, 0x52, 0xa2}, + {0x27, 0x53, 0x4a}, + {0x27, 0x54, 0x08}, // Biquad - BQ7 Right - Filter: Equalizer (Q Factor) Frequency: 315 Hz Gain: 6dB QVal: 0.9 Bandwidth: 1000 Hz + {0x27, 0x55, 0x17}, + {0x27, 0x56, 0x14}, + {0x27, 0x57, 0xec}, + {0x27, 0x58, 0xf0}, + {0x27, 0x59, 0x2f}, + {0x27, 0x5a, 0x3e}, + {0x27, 0x5b, 0x6a}, + {0x27, 0x5c, 0x07}, + {0x27, 0x5d, 0xba}, + {0x27, 0x5e, 0x88}, + {0x27, 0x5f, 0xfc}, + {0x27, 0x60, 0x0f}, + {0x27, 0x61, 0xd0}, + {0x27, 0x62, 0xc1}, + {0x27, 0x63, 0x96}, + {0x27, 0x64, 0xf8}, + {0x27, 0x65, 0x2e}, + {0x27, 0x66, 0x62}, + {0x27, 0x67, 0x19}, + {0x27, 0x68, 0x08}, // Biquad - BQ8 Right - Filter: Equalizer (Q Factor) Frequency: 500 Hz Gain: 6dB QVal: 0.9 Bandwidth: 1000 Hz + {0x27, 0x69, 0x24}, + {0x27, 0x6a, 0x65}, + {0x27, 0x6b, 0x46}, + {0x27, 0x6c, 0xf0}, + {0x27, 0x6d, 0x4b}, + {0x27, 0x6e, 0x4a}, + {0x27, 0x6f, 0xa6}, + {0x27, 0x70, 0x07}, + {0x27, 0x71, 0x92}, + {0x27, 0x72, 0x77}, + {0x27, 0x73, 0x7a}, + {0x27, 0x74, 0x0f}, + {0x27, 0x75, 0xb4}, + {0x27, 0x76, 0xb5}, + {0x27, 0x77, 0x5a}, + {0x27, 0x78, 0xf8}, + {0x27, 0x79, 0x49}, + {0x27, 0x7a, 0x23}, + {0x27, 0x7b, 0x40}, + {0x27, 0x7c, 0x08}, // Biquad - BQ9 Right - Filter: Equalizer (Q Factor) Frequency: 800 Hz Gain: 6dB QVal: 0.8 Bandwidth: 1000 Hz + {0x27, 0x7d, 0x40}, + {0x27, 0x7e, 0x96}, + {0x27, 0x7f, 0xe5}, + {0x28, 0x08, 0xf0}, + {0x28, 0x09, 0x87}, + {0x28, 0x0a, 0x3a}, + {0x28, 0x0b, 0xb6}, + {0x28, 0x0c, 0x07}, + {0x28, 0x0d, 0x3d}, + {0x28, 0x0e, 0x9d}, + {0x28, 0x0f, 0xe5}, + {0x28, 0x10, 0x0f}, + {0x28, 0x11, 0x78}, + {0x28, 0x12, 0xc5}, + {0x28, 0x13, 0x4a}, + {0x28, 0x14, 0xf8}, + {0x28, 0x15, 0x81}, + {0x28, 0x16, 0xcb}, + {0x28, 0x17, 0x36}, + {0x28, 0x18, 0x08}, // Biquad - BQ10 Right - Filter: Equalizer (Q Factor) Frequency: 1250 Hz Gain: 6dB QVal: 0.8 Bandwidth: 1000 Hz + {0x28, 0x19, 0x63}, + {0x28, 0x1a, 0x27}, + {0x28, 0x1b, 0x54}, + {0x28, 0x1c, 0xf0}, + {0x28, 0x1d, 0xd4}, + {0x28, 0x1e, 0x48}, + {0x28, 0x1f, 0xf3}, + {0x28, 0x20, 0x06}, + {0x28, 0x21, 0xd5}, + {0x28, 0x22, 0x98}, + {0x28, 0x23, 0x59}, + {0x28, 0x24, 0x0f}, + {0x28, 0x25, 0x2b}, + {0x28, 0x26, 0xb7}, + {0x28, 0x27, 0x0d}, + {0x28, 0x28, 0xf8}, + {0x28, 0x29, 0xc7}, + {0x28, 0x2a, 0x40}, + {0x28, 0x2b, 0x52}, + {0x28, 0x2c, 0x08}, // Biquad - BQ11 Right - Filter: Equalizer (Q Factor) Frequency: 2000 Hz Gain: 6dB QVal: 0.7 Bandwidth: 1000 Hz + {0x28, 0x2d, 0xae}, + {0x28, 0x2e, 0x48}, + {0x28, 0x2f, 0xe6}, + {0x28, 0x30, 0xf1}, + {0x28, 0x31, 0x7e}, + {0x28, 0x32, 0x46}, + {0x28, 0x33, 0x3e}, + {0x28, 0x34, 0x05}, + {0x28, 0x35, 0xf3}, + {0x28, 0x36, 0x7c}, + {0x28, 0x37, 0x88}, + {0x28, 0x38, 0x0e}, + {0x28, 0x39, 0x81}, + {0x28, 0x3a, 0xb9}, + {0x28, 0x3b, 0xc2}, + {0x28, 0x3c, 0xf9}, + {0x28, 0x3d, 0x5e}, + {0x28, 0x3e, 0x3a}, + {0x28, 0x3f, 0x92}, + {0x28, 0x40, 0x09}, // Biquad - BQ12 Right - Filter: Equalizer (Q Factor) Frequency: 3150 Hz Gain: 6dB QVal: 0.7 Bandwidth: 1000 Hz + {0x28, 0x41, 0x05}, + {0x28, 0x42, 0xa2}, + {0x28, 0x43, 0x95}, + {0x28, 0x44, 0xf2}, + {0x28, 0x45, 0x59}, + {0x28, 0x46, 0x5e}, + {0x28, 0x47, 0x71}, + {0x28, 0x48, 0x04}, + {0x28, 0x49, 0xec}, + {0x28, 0x4a, 0x9a}, + {0x28, 0x4b, 0x94}, + {0x28, 0x4c, 0x0d}, + {0x28, 0x4d, 0xa6}, + {0x28, 0x4e, 0xa1}, + {0x28, 0x4f, 0x8f}, + {0x28, 0x50, 0xfa}, + {0x28, 0x51, 0x0d}, + {0x28, 0x52, 0xc2}, + {0x28, 0x53, 0xd6}, + {0x28, 0x54, 0x09}, // Biquad - BQ13 Right - Filter: Equalizer (Q Factor) Frequency: 5000 Hz Gain: 6dB QVal: 0.6 Bandwidth: 1000 Hz + {0x28, 0x55, 0xb4}, + {0x28, 0x56, 0xc0}, + {0x28, 0x57, 0xdb}, + {0x28, 0x58, 0xf4}, + {0x28, 0x59, 0x18}, + {0x28, 0x5a, 0x76}, + {0x28, 0x5b, 0x1f}, + {0x28, 0x5c, 0x02}, + {0x28, 0x5d, 0xdd}, + {0x28, 0x5e, 0x94}, + {0x28, 0x5f, 0xf6}, + {0x28, 0x60, 0x0b}, + {0x28, 0x61, 0xe7}, + {0x28, 0x62, 0x89}, + {0x28, 0x63, 0xe1}, + {0x28, 0x64, 0xfb}, + {0x28, 0x65, 0x6d}, + {0x28, 0x66, 0xaa}, + {0x28, 0x67, 0x2f}, + {0x28, 0x68, 0x0a}, // Biquad - BQ14 Right - Filter: Equalizer (Q Factor) Frequency: 8000 Hz Gain: 6dB QVal: 0.6 Bandwidth: 1000 Hz + {0x28, 0x69, 0x6b}, + {0x28, 0x6a, 0x32}, + {0x28, 0x6b, 0xd7}, + {0x28, 0x6c, 0xf6}, + {0x28, 0x6d, 0x5a}, + {0x28, 0x6e, 0x59}, + {0x28, 0x6f, 0x40}, + {0x28, 0x70, 0x00}, + {0x28, 0x71, 0xb8}, + {0x28, 0x72, 0x82}, + {0x28, 0x73, 0x59}, + {0x28, 0x74, 0x09}, + {0x28, 0x75, 0xa5}, + {0x28, 0x76, 0xa6}, + {0x28, 0x77, 0xc0}, + {0x28, 0x78, 0xfc}, + {0x28, 0x79, 0xdc}, + {0x28, 0x7a, 0x4a}, + {0x28, 0x7b, 0xd0}, + {0x28, 0x7c, 0x0c}, // Biquad - BQ15 Right - Filter: Equalizer (Q Factor) Frequency: 16000 Hz Gain: 6dB QVal: 0.5 Bandwidth: 1000 Hz + {0x28, 0x7d, 0x12}, + {0x28, 0x7e, 0xa5}, + {0x28, 0x7f, 0x11}, + {0x29, 0x08, 0xfc}, + {0x29, 0x09, 0x17}, + {0x29, 0x0a, 0x9b}, + {0x29, 0x0b, 0xa8}, + {0x29, 0x0c, 0xfb}, + {0x29, 0x0d, 0xbe}, + {0x29, 0x0e, 0x23}, + {0x29, 0x0f, 0xa0}, + {0x29, 0x10, 0x03}, + {0x29, 0x11, 0xe8}, + {0x29, 0x12, 0x64}, + {0x29, 0x13, 0x58}, + {0x29, 0x14, 0x00}, + {0x29, 0x15, 0x2f}, + {0x29, 0x16, 0x37}, + {0x29, 0x17, 0x4f}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_right_p7[TAS5805M_EQ_REG_PER_STEP] = { + {0x26, 0x54, 0x08}, // Biquad - BQ1 Right - Filter: Equalizer (Q Factor) Frequency: 20 Hz Gain: 7dB QVal: 2 Bandwidth: 1000 Hz + {0x26, 0x55, 0x00}, + {0x26, 0x56, 0xd4}, + {0x26, 0x57, 0x76}, + {0x26, 0x58, 0xf0}, + {0x26, 0x59, 0x01}, + {0x26, 0x5a, 0x57}, + {0x26, 0x5b, 0xef}, + {0x26, 0x5c, 0x07}, + {0x26, 0x5d, 0xfd}, + {0x26, 0x5e, 0xd4}, + {0x26, 0x5f, 0x81}, + {0x26, 0x60, 0x0f}, + {0x26, 0x61, 0xfe}, + {0x26, 0x62, 0xa8}, + {0x26, 0x63, 0x11}, + {0x26, 0x64, 0xf8}, + {0x26, 0x65, 0x01}, + {0x26, 0x66, 0x57}, + {0x26, 0x67, 0x09}, + {0x26, 0x68, 0x08}, // Biquad - BQ2 Right - Filter: Equalizer (Q Factor) Frequency: 31.5 Hz Gain: 7dB QVal: 2 Bandwidth: 1000 Hz + {0x26, 0x69, 0x01}, + {0x26, 0x6a, 0x4e}, + {0x26, 0x6b, 0x90}, + {0x26, 0x6c, 0xf0}, + {0x26, 0x6d, 0x02}, + {0x26, 0x6e, 0x1e}, + {0x26, 0x6f, 0x67}, + {0x26, 0x70, 0x07}, + {0x26, 0x71, 0xfc}, + {0x26, 0x72, 0x95}, + {0x26, 0x73, 0x43}, + {0x26, 0x74, 0x0f}, + {0x26, 0x75, 0xfd}, + {0x26, 0x76, 0xe1}, + {0x26, 0x77, 0x99}, + {0x26, 0x78, 0xf8}, + {0x26, 0x79, 0x02}, + {0x26, 0x7a, 0x1c}, + {0x26, 0x7b, 0x2d}, + {0x26, 0x7c, 0x08}, // Biquad - BQ3 Right - Filter: Equalizer (Q Factor) Frequency: 50 Hz Gain: 7dB QVal: 1.5 Bandwidth: 1000 Hz + {0x26, 0x7d, 0x02}, + {0x26, 0x7e, 0xc3}, + {0x26, 0x7f, 0xaa}, + {0x27, 0x08, 0xf0}, + {0x27, 0x09, 0x04}, + {0x27, 0x0a, 0x7c}, + {0x27, 0x0b, 0x2f}, + {0x27, 0x0c, 0x07}, + {0x27, 0x0d, 0xf8}, + {0x27, 0x0e, 0xc5}, + {0x27, 0x0f, 0xc3}, + {0x27, 0x10, 0x0f}, + {0x27, 0x11, 0xfb}, + {0x27, 0x12, 0x83}, + {0x27, 0x13, 0xd1}, + {0x27, 0x14, 0xf8}, + {0x27, 0x15, 0x04}, + {0x27, 0x16, 0x76}, + {0x27, 0x17, 0x93}, + {0x27, 0x18, 0x08}, // Biquad - BQ4 Right - Filter: Equalizer (Q Factor) Frequency: 80 Hz Gain: 7dB QVal: 1.5 Bandwidth: 1000 Hz + {0x27, 0x19, 0x04}, + {0x27, 0x1a, 0x6b}, + {0x27, 0x1b, 0x86}, + {0x27, 0x1c, 0xf0}, + {0x27, 0x1d, 0x07}, + {0x27, 0x1e, 0x31}, + {0x27, 0x1f, 0x45}, + {0x27, 0x20, 0x07}, + {0x27, 0x21, 0xf4}, + {0x27, 0x22, 0x71}, + {0x27, 0x23, 0x8e}, + {0x27, 0x24, 0x0f}, + {0x27, 0x25, 0xf8}, + {0x27, 0x26, 0xce}, + {0x27, 0x27, 0xbb}, + {0x27, 0x28, 0xf8}, + {0x27, 0x29, 0x07}, + {0x27, 0x2a, 0x22}, + {0x27, 0x2b, 0xec}, + {0x27, 0x2c, 0x08}, // Biquad - BQ5 Right - Filter: Equalizer (Q Factor) Frequency: 125 Hz Gain: 7dB QVal: 1 Bandwidth: 1000 Hz + {0x27, 0x2d, 0x0a}, + {0x27, 0x2e, 0x55}, + {0x27, 0x2f, 0xd0}, + {0x27, 0x30, 0xf0}, + {0x27, 0x31, 0x10}, + {0x27, 0x32, 0xd2}, + {0x27, 0x33, 0xcc}, + {0x27, 0x34, 0x07}, + {0x27, 0x35, 0xe4}, + {0x27, 0x36, 0xfa}, + {0x27, 0x37, 0x57}, + {0x27, 0x38, 0x0f}, + {0x27, 0x39, 0xef}, + {0x27, 0x3a, 0x2d}, + {0x27, 0x3b, 0x34}, + {0x27, 0x3c, 0xf8}, + {0x27, 0x3d, 0x10}, + {0x27, 0x3e, 0xaf}, + {0x27, 0x3f, 0xd9}, + {0x27, 0x40, 0x08}, // Biquad - BQ6 Right - Filter: Equalizer (Q Factor) Frequency: 200 Hz Gain: 7dB QVal: 1 Bandwidth: 1000 Hz + {0x27, 0x41, 0x10}, + {0x27, 0x42, 0x7e}, + {0x27, 0x43, 0xfb}, + {0x27, 0x44, 0xf0}, + {0x27, 0x45, 0x1a}, + {0x27, 0x46, 0xfb}, + {0x27, 0x47, 0x8a}, + {0x27, 0x48, 0x07}, + {0x27, 0x49, 0xd4}, + {0x27, 0x4a, 0xde}, + {0x27, 0x4b, 0xbc}, + {0x27, 0x4c, 0x0f}, + {0x27, 0x4d, 0xe5}, + {0x27, 0x4e, 0x04}, + {0x27, 0x4f, 0x76}, + {0x27, 0x50, 0xf8}, + {0x27, 0x51, 0x1a}, + {0x27, 0x52, 0xa2}, + {0x27, 0x53, 0x4a}, + {0x27, 0x54, 0x08}, // Biquad - BQ7 Right - Filter: Equalizer (Q Factor) Frequency: 315 Hz Gain: 7dB QVal: 0.9 Bandwidth: 1000 Hz + {0x27, 0x55, 0x1c}, + {0x27, 0x56, 0xba}, + {0x27, 0x57, 0x59}, + {0x27, 0x58, 0xf0}, + {0x27, 0x59, 0x2f}, + {0x27, 0x5a, 0x3e}, + {0x27, 0x5b, 0x6a}, + {0x27, 0x5c, 0x07}, + {0x27, 0x5d, 0xb4}, + {0x27, 0x5e, 0xe3}, + {0x27, 0x5f, 0x8e}, + {0x27, 0x60, 0x0f}, + {0x27, 0x61, 0xd0}, + {0x27, 0x62, 0xc1}, + {0x27, 0x63, 0x96}, + {0x27, 0x64, 0xf8}, + {0x27, 0x65, 0x2e}, + {0x27, 0x66, 0x62}, + {0x27, 0x67, 0x19}, + {0x27, 0x68, 0x08}, // Biquad - BQ8 Right - Filter: Equalizer (Q Factor) Frequency: 500 Hz Gain: 7dB QVal: 0.9 Bandwidth: 1000 Hz + {0x27, 0x69, 0x2d}, + {0x27, 0x6a, 0x4c}, + {0x27, 0x6b, 0x71}, + {0x27, 0x6c, 0xf0}, + {0x27, 0x6d, 0x4b}, + {0x27, 0x6e, 0x4a}, + {0x27, 0x6f, 0xa6}, + {0x27, 0x70, 0x07}, + {0x27, 0x71, 0x89}, + {0x27, 0x72, 0x90}, + {0x27, 0x73, 0x4e}, + {0x27, 0x74, 0x0f}, + {0x27, 0x75, 0xb4}, + {0x27, 0x76, 0xb5}, + {0x27, 0x77, 0x5a}, + {0x27, 0x78, 0xf8}, + {0x27, 0x79, 0x49}, + {0x27, 0x7a, 0x23}, + {0x27, 0x7b, 0x40}, + {0x27, 0x7c, 0x08}, // Biquad - BQ9 Right - Filter: Equalizer (Q Factor) Frequency: 800 Hz Gain: 7dB QVal: 0.8 Bandwidth: 1000 Hz + {0x27, 0x7d, 0x50}, + {0x27, 0x7e, 0x63}, + {0x27, 0x7f, 0xa0}, + {0x28, 0x08, 0xf0}, + {0x28, 0x09, 0x87}, + {0x28, 0x0a, 0x3a}, + {0x28, 0x0b, 0xb6}, + {0x28, 0x0c, 0x07}, + {0x28, 0x0d, 0x2d}, + {0x28, 0x0e, 0xd1}, + {0x28, 0x0f, 0x2a}, + {0x28, 0x10, 0x0f}, + {0x28, 0x11, 0x78}, + {0x28, 0x12, 0xc5}, + {0x28, 0x13, 0x4a}, + {0x28, 0x14, 0xf8}, + {0x28, 0x15, 0x81}, + {0x28, 0x16, 0xcb}, + {0x28, 0x17, 0x36}, + {0x28, 0x18, 0x08}, // Biquad - BQ10 Right - Filter: Equalizer (Q Factor) Frequency: 1250 Hz Gain: 7dB QVal: 0.8 Bandwidth: 1000 Hz + {0x28, 0x19, 0x7b}, + {0x28, 0x1a, 0x68}, + {0x28, 0x1b, 0x8b}, + {0x28, 0x1c, 0xf0}, + {0x28, 0x1d, 0xd4}, + {0x28, 0x1e, 0x48}, + {0x28, 0x1f, 0xf3}, + {0x28, 0x20, 0x06}, + {0x28, 0x21, 0xbd}, + {0x28, 0x22, 0x57}, + {0x28, 0x23, 0x23}, + {0x28, 0x24, 0x0f}, + {0x28, 0x25, 0x2b}, + {0x28, 0x26, 0xb7}, + {0x28, 0x27, 0x0d}, + {0x28, 0x28, 0xf8}, + {0x28, 0x29, 0xc7}, + {0x28, 0x2a, 0x40}, + {0x28, 0x2b, 0x52}, + {0x28, 0x2c, 0x08}, // Biquad - BQ11 Right - Filter: Equalizer (Q Factor) Frequency: 2000 Hz Gain: 7dB QVal: 0.7 Bandwidth: 1000 Hz + {0x28, 0x2d, 0xd8}, + {0x28, 0x2e, 0xea}, + {0x28, 0x2f, 0xfc}, + {0x28, 0x30, 0xf1}, + {0x28, 0x31, 0x7e}, + {0x28, 0x32, 0x46}, + {0x28, 0x33, 0x3e}, + {0x28, 0x34, 0x05}, + {0x28, 0x35, 0xc8}, + {0x28, 0x36, 0xda}, + {0x28, 0x37, 0x72}, + {0x28, 0x38, 0x0e}, + {0x28, 0x39, 0x81}, + {0x28, 0x3a, 0xb9}, + {0x28, 0x3b, 0xc2}, + {0x28, 0x3c, 0xf9}, + {0x28, 0x3d, 0x5e}, + {0x28, 0x3e, 0x3a}, + {0x28, 0x3f, 0x92}, + {0x28, 0x40, 0x09}, // Biquad - BQ12 Right - Filter: Equalizer (Q Factor) Frequency: 3150 Hz Gain: 7dB QVal: 0.7 Bandwidth: 1000 Hz + {0x28, 0x41, 0x45}, + {0x28, 0x42, 0xa2}, + {0x28, 0x43, 0xbc}, + {0x28, 0x44, 0xf2}, + {0x28, 0x45, 0x59}, + {0x28, 0x46, 0x5e}, + {0x28, 0x47, 0x71}, + {0x28, 0x48, 0x04}, + {0x28, 0x49, 0xac}, + {0x28, 0x4a, 0x9a}, + {0x28, 0x4b, 0x6e}, + {0x28, 0x4c, 0x0d}, + {0x28, 0x4d, 0xa6}, + {0x28, 0x4e, 0xa1}, + {0x28, 0x4f, 0x8f}, + {0x28, 0x50, 0xfa}, + {0x28, 0x51, 0x0d}, + {0x28, 0x52, 0xc2}, + {0x28, 0x53, 0xd6}, + {0x28, 0x54, 0x0a}, // Biquad - BQ13 Right - Filter: Equalizer (Q Factor) Frequency: 5000 Hz Gain: 7dB QVal: 0.6 Bandwidth: 1000 Hz + {0x28, 0x55, 0x1f}, + {0x28, 0x56, 0x97}, + {0x28, 0x57, 0x49}, + {0x28, 0x58, 0xf4}, + {0x28, 0x59, 0x18}, + {0x28, 0x5a, 0x76}, + {0x28, 0x5b, 0x1f}, + {0x28, 0x5c, 0x02}, + {0x28, 0x5d, 0x72}, + {0x28, 0x5e, 0xbe}, + {0x28, 0x5f, 0x88}, + {0x28, 0x60, 0x0b}, + {0x28, 0x61, 0xe7}, + {0x28, 0x62, 0x89}, + {0x28, 0x63, 0xe1}, + {0x28, 0x64, 0xfb}, + {0x28, 0x65, 0x6d}, + {0x28, 0x66, 0xaa}, + {0x28, 0x67, 0x2f}, + {0x28, 0x68, 0x0b}, // Biquad - BQ14 Right - Filter: Equalizer (Q Factor) Frequency: 8000 Hz Gain: 7dB QVal: 0.6 Bandwidth: 1000 Hz + {0x28, 0x69, 0x02}, + {0x28, 0x6a, 0xaa}, + {0x28, 0x6b, 0x61}, + {0x28, 0x6c, 0xf6}, + {0x28, 0x6d, 0x5a}, + {0x28, 0x6e, 0x59}, + {0x28, 0x6f, 0x40}, + {0x28, 0x70, 0x00}, + {0x28, 0x71, 0x21}, + {0x28, 0x72, 0x0a}, + {0x28, 0x73, 0xce}, + {0x28, 0x74, 0x09}, + {0x28, 0x75, 0xa5}, + {0x28, 0x76, 0xa6}, + {0x28, 0x77, 0xc0}, + {0x28, 0x78, 0xfc}, + {0x28, 0x79, 0xdc}, + {0x28, 0x7a, 0x4a}, + {0x28, 0x7b, 0xd0}, + {0x28, 0x7c, 0x0d}, // Biquad - BQ15 Right - Filter: Equalizer (Q Factor) Frequency: 16000 Hz Gain: 7dB QVal: 0.5 Bandwidth: 1000 Hz + {0x28, 0x7d, 0x11}, + {0x28, 0x7e, 0xb1}, + {0x28, 0x7f, 0xb7}, + {0x29, 0x08, 0xfc}, + {0x29, 0x09, 0x17}, + {0x29, 0x0a, 0x9b}, + {0x29, 0x0b, 0xa8}, + {0x29, 0x0c, 0xfa}, + {0x29, 0x0d, 0xbf}, + {0x29, 0x0e, 0x16}, + {0x29, 0x0f, 0xf9}, + {0x29, 0x10, 0x03}, + {0x29, 0x11, 0xe8}, + {0x29, 0x12, 0x64}, + {0x29, 0x13, 0x58}, + {0x29, 0x14, 0x00}, + {0x29, 0x15, 0x2f}, + {0x29, 0x16, 0x37}, + {0x29, 0x17, 0x4f}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_right_p8[TAS5805M_EQ_REG_PER_STEP] = { + {0x26, 0x54, 0x08}, // Biquad - BQ1 Right - Filter: Equalizer (Q Factor) Frequency: 20 Hz Gain: 8dB QVal: 2 Bandwidth: 1000 Hz + {0x26, 0x55, 0x01}, + {0x26, 0x56, 0x03}, + {0x26, 0x57, 0x50}, + {0x26, 0x58, 0xf0}, + {0x26, 0x59, 0x01}, + {0x26, 0x5a, 0x57}, + {0x26, 0x5b, 0xef}, + {0x26, 0x5c, 0x07}, + {0x26, 0x5d, 0xfd}, + {0x26, 0x5e, 0xa5}, + {0x26, 0x5f, 0xa7}, + {0x26, 0x60, 0x0f}, + {0x26, 0x61, 0xfe}, + {0x26, 0x62, 0xa8}, + {0x26, 0x63, 0x11}, + {0x26, 0x64, 0xf8}, + {0x26, 0x65, 0x01}, + {0x26, 0x66, 0x57}, + {0x26, 0x67, 0x09}, + {0x26, 0x68, 0x08}, // Biquad - BQ2 Right - Filter: Equalizer (Q Factor) Frequency: 31.5 Hz Gain: 8dB QVal: 2 Bandwidth: 1000 Hz + {0x26, 0x69, 0x01}, + {0x26, 0x6a, 0x98}, + {0x26, 0x6b, 0x58}, + {0x26, 0x6c, 0xf0}, + {0x26, 0x6d, 0x02}, + {0x26, 0x6e, 0x1e}, + {0x26, 0x6f, 0x67}, + {0x26, 0x70, 0x07}, + {0x26, 0x71, 0xfc}, + {0x26, 0x72, 0x4b}, + {0x26, 0x73, 0x7b}, + {0x26, 0x74, 0x0f}, + {0x26, 0x75, 0xfd}, + {0x26, 0x76, 0xe1}, + {0x26, 0x77, 0x99}, + {0x26, 0x78, 0xf8}, + {0x26, 0x79, 0x02}, + {0x26, 0x7a, 0x1c}, + {0x26, 0x7b, 0x2d}, + {0x26, 0x7c, 0x08}, // Biquad - BQ3 Right - Filter: Equalizer (Q Factor) Frequency: 50 Hz Gain: 8dB QVal: 1.5 Bandwidth: 1000 Hz + {0x26, 0x7d, 0x03}, + {0x26, 0x7e, 0x5f}, + {0x26, 0x7f, 0xb8}, + {0x27, 0x08, 0xf0}, + {0x27, 0x09, 0x04}, + {0x27, 0x0a, 0x7c}, + {0x27, 0x0b, 0x2f}, + {0x27, 0x0c, 0x07}, + {0x27, 0x0d, 0xf8}, + {0x27, 0x0e, 0x29}, + {0x27, 0x0f, 0xb5}, + {0x27, 0x10, 0x0f}, + {0x27, 0x11, 0xfb}, + {0x27, 0x12, 0x83}, + {0x27, 0x13, 0xd1}, + {0x27, 0x14, 0xf8}, + {0x27, 0x15, 0x04}, + {0x27, 0x16, 0x76}, + {0x27, 0x17, 0x93}, + {0x27, 0x18, 0x08}, // Biquad - BQ4 Right - Filter: Equalizer (Q Factor) Frequency: 80 Hz Gain: 8dB QVal: 1.5 Bandwidth: 1000 Hz + {0x27, 0x19, 0x05}, + {0x27, 0x1a, 0x65}, + {0x27, 0x1b, 0x0d}, + {0x27, 0x1c, 0xf0}, + {0x27, 0x1d, 0x07}, + {0x27, 0x1e, 0x31}, + {0x27, 0x1f, 0x45}, + {0x27, 0x20, 0x07}, + {0x27, 0x21, 0xf3}, + {0x27, 0x22, 0x78}, + {0x27, 0x23, 0x07}, + {0x27, 0x24, 0x0f}, + {0x27, 0x25, 0xf8}, + {0x27, 0x26, 0xce}, + {0x27, 0x27, 0xbb}, + {0x27, 0x28, 0xf8}, + {0x27, 0x29, 0x07}, + {0x27, 0x2a, 0x22}, + {0x27, 0x2b, 0xec}, + {0x27, 0x2c, 0x08}, // Biquad - BQ5 Right - Filter: Equalizer (Q Factor) Frequency: 125 Hz Gain: 8dB QVal: 1 Bandwidth: 1000 Hz + {0x27, 0x2d, 0x0c}, + {0x27, 0x2e, 0x9d}, + {0x27, 0x2f, 0x46}, + {0x27, 0x30, 0xf0}, + {0x27, 0x31, 0x10}, + {0x27, 0x32, 0xd2}, + {0x27, 0x33, 0xcc}, + {0x27, 0x34, 0x07}, + {0x27, 0x35, 0xe2}, + {0x27, 0x36, 0xb2}, + {0x27, 0x37, 0xe1}, + {0x27, 0x38, 0x0f}, + {0x27, 0x39, 0xef}, + {0x27, 0x3a, 0x2d}, + {0x27, 0x3b, 0x34}, + {0x27, 0x3c, 0xf8}, + {0x27, 0x3d, 0x10}, + {0x27, 0x3e, 0xaf}, + {0x27, 0x3f, 0xd9}, + {0x27, 0x40, 0x08}, // Biquad - BQ6 Right - Filter: Equalizer (Q Factor) Frequency: 200 Hz Gain: 8dB QVal: 1 Bandwidth: 1000 Hz + {0x27, 0x41, 0x14}, + {0x27, 0x42, 0x22}, + {0x27, 0x43, 0x3d}, + {0x27, 0x44, 0xf0}, + {0x27, 0x45, 0x1a}, + {0x27, 0x46, 0xfb}, + {0x27, 0x47, 0x8a}, + {0x27, 0x48, 0x07}, + {0x27, 0x49, 0xd1}, + {0x27, 0x4a, 0x3b}, + {0x27, 0x4b, 0x79}, + {0x27, 0x4c, 0x0f}, + {0x27, 0x4d, 0xe5}, + {0x27, 0x4e, 0x04}, + {0x27, 0x4f, 0x76}, + {0x27, 0x50, 0xf8}, + {0x27, 0x51, 0x1a}, + {0x27, 0x52, 0xa2}, + {0x27, 0x53, 0x4a}, + {0x27, 0x54, 0x08}, // Biquad - BQ7 Right - Filter: Equalizer (Q Factor) Frequency: 315 Hz Gain: 8dB QVal: 0.9 Bandwidth: 1000 Hz + {0x27, 0x55, 0x23}, + {0x27, 0x56, 0x10}, + {0x27, 0x57, 0x24}, + {0x27, 0x58, 0xf0}, + {0x27, 0x59, 0x2f}, + {0x27, 0x5a, 0x3e}, + {0x27, 0x5b, 0x6a}, + {0x27, 0x5c, 0x07}, + {0x27, 0x5d, 0xae}, + {0x27, 0x5e, 0x8d}, + {0x27, 0x5f, 0xc3}, + {0x27, 0x60, 0x0f}, + {0x27, 0x61, 0xd0}, + {0x27, 0x62, 0xc1}, + {0x27, 0x63, 0x96}, + {0x27, 0x64, 0xf8}, + {0x27, 0x65, 0x2e}, + {0x27, 0x66, 0x62}, + {0x27, 0x67, 0x19}, + {0x27, 0x68, 0x08}, // Biquad - BQ8 Right - Filter: Equalizer (Q Factor) Frequency: 500 Hz Gain: 8dB QVal: 0.9 Bandwidth: 1000 Hz + {0x27, 0x69, 0x37}, + {0x27, 0x6a, 0x49}, + {0x27, 0x6b, 0xb7}, + {0x27, 0x6c, 0xf0}, + {0x27, 0x6d, 0x4b}, + {0x27, 0x6e, 0x4a}, + {0x27, 0x6f, 0xa6}, + {0x27, 0x70, 0x07}, + {0x27, 0x71, 0x7f}, + {0x27, 0x72, 0x93}, + {0x27, 0x73, 0x09}, + {0x27, 0x74, 0x0f}, + {0x27, 0x75, 0xb4}, + {0x27, 0x76, 0xb5}, + {0x27, 0x77, 0x5a}, + {0x27, 0x78, 0xf8}, + {0x27, 0x79, 0x49}, + {0x27, 0x7a, 0x23}, + {0x27, 0x7b, 0x40}, + {0x27, 0x7c, 0x08}, // Biquad - BQ9 Right - Filter: Equalizer (Q Factor) Frequency: 800 Hz Gain: 8dB QVal: 0.8 Bandwidth: 1000 Hz + {0x27, 0x7d, 0x62}, + {0x27, 0x7e, 0x1d}, + {0x27, 0x7f, 0xe3}, + {0x28, 0x08, 0xf0}, + {0x28, 0x09, 0x87}, + {0x28, 0x0a, 0x3a}, + {0x28, 0x0b, 0xb6}, + {0x28, 0x0c, 0x07}, + {0x28, 0x0d, 0x1c}, + {0x28, 0x0e, 0x16}, + {0x28, 0x0f, 0xe7}, + {0x28, 0x10, 0x0f}, + {0x28, 0x11, 0x78}, + {0x28, 0x12, 0xc5}, + {0x28, 0x13, 0x4a}, + {0x28, 0x14, 0xf8}, + {0x28, 0x15, 0x81}, + {0x28, 0x16, 0xcb}, + {0x28, 0x17, 0x36}, + {0x28, 0x18, 0x08}, // Biquad - BQ10 Right - Filter: Equalizer (Q Factor) Frequency: 1250 Hz Gain: 8dB QVal: 0.8 Bandwidth: 1000 Hz + {0x28, 0x19, 0x96}, + {0x28, 0x1a, 0x9f}, + {0x28, 0x1b, 0x65}, + {0x28, 0x1c, 0xf0}, + {0x28, 0x1d, 0xd4}, + {0x28, 0x1e, 0x48}, + {0x28, 0x1f, 0xf3}, + {0x28, 0x20, 0x06}, + {0x28, 0x21, 0xa2}, + {0x28, 0x22, 0x20}, + {0x28, 0x23, 0x49}, + {0x28, 0x24, 0x0f}, + {0x28, 0x25, 0x2b}, + {0x28, 0x26, 0xb7}, + {0x28, 0x27, 0x0d}, + {0x28, 0x28, 0xf8}, + {0x28, 0x29, 0xc7}, + {0x28, 0x2a, 0x40}, + {0x28, 0x2b, 0x52}, + {0x28, 0x2c, 0x09}, // Biquad - BQ11 Right - Filter: Equalizer (Q Factor) Frequency: 2000 Hz Gain: 8dB QVal: 0.7 Bandwidth: 1000 Hz + {0x28, 0x2d, 0x08}, + {0x28, 0x2e, 0xc0}, + {0x28, 0x2f, 0xca}, + {0x28, 0x30, 0xf1}, + {0x28, 0x31, 0x7e}, + {0x28, 0x32, 0x46}, + {0x28, 0x33, 0x3e}, + {0x28, 0x34, 0x05}, + {0x28, 0x35, 0x99}, + {0x28, 0x36, 0x04}, + {0x28, 0x37, 0xa4}, + {0x28, 0x38, 0x0e}, + {0x28, 0x39, 0x81}, + {0x28, 0x3a, 0xb9}, + {0x28, 0x3b, 0xc2}, + {0x28, 0x3c, 0xf9}, + {0x28, 0x3d, 0x5e}, + {0x28, 0x3e, 0x3a}, + {0x28, 0x3f, 0x92}, + {0x28, 0x40, 0x09}, // Biquad - BQ12 Right - Filter: Equalizer (Q Factor) Frequency: 3150 Hz Gain: 8dB QVal: 0.7 Bandwidth: 1000 Hz + {0x28, 0x41, 0x8d}, + {0x28, 0x42, 0x72}, + {0x28, 0x43, 0x0e}, + {0x28, 0x44, 0xf2}, + {0x28, 0x45, 0x59}, + {0x28, 0x46, 0x5e}, + {0x28, 0x47, 0x71}, + {0x28, 0x48, 0x04}, + {0x28, 0x49, 0x64}, + {0x28, 0x4a, 0xcb}, + {0x28, 0x4b, 0x1c}, + {0x28, 0x4c, 0x0d}, + {0x28, 0x4d, 0xa6}, + {0x28, 0x4e, 0xa1}, + {0x28, 0x4f, 0x8f}, + {0x28, 0x50, 0xfa}, + {0x28, 0x51, 0x0d}, + {0x28, 0x52, 0xc2}, + {0x28, 0x53, 0xd6}, + {0x28, 0x54, 0x0a}, // Biquad - BQ13 Right - Filter: Equalizer (Q Factor) Frequency: 5000 Hz Gain: 8dB QVal: 0.6 Bandwidth: 1000 Hz + {0x28, 0x55, 0x97}, + {0x28, 0x56, 0x76}, + {0x28, 0x57, 0xf9}, + {0x28, 0x58, 0xf4}, + {0x28, 0x59, 0x18}, + {0x28, 0x5a, 0x76}, + {0x28, 0x5b, 0x1f}, + {0x28, 0x5c, 0x01}, + {0x28, 0x5d, 0xfa}, + {0x28, 0x5e, 0xde}, + {0x28, 0x5f, 0xd8}, + {0x28, 0x60, 0x0b}, + {0x28, 0x61, 0xe7}, + {0x28, 0x62, 0x89}, + {0x28, 0x63, 0xe1}, + {0x28, 0x64, 0xfb}, + {0x28, 0x65, 0x6d}, + {0x28, 0x66, 0xaa}, + {0x28, 0x67, 0x2f}, + {0x28, 0x68, 0x0b}, // Biquad - BQ14 Right - Filter: Equalizer (Q Factor) Frequency: 8000 Hz Gain: 8dB QVal: 0.6 Bandwidth: 1000 Hz + {0x28, 0x69, 0xac}, + {0x28, 0x6a, 0x9d}, + {0x28, 0x6b, 0x41}, + {0x28, 0x6c, 0xf6}, + {0x28, 0x6d, 0x5a}, + {0x28, 0x6e, 0x59}, + {0x28, 0x6f, 0x40}, + {0x28, 0x70, 0xff}, + {0x28, 0x71, 0x77}, + {0x28, 0x72, 0x17}, + {0x28, 0x73, 0xee}, + {0x28, 0x74, 0x09}, + {0x28, 0x75, 0xa5}, + {0x28, 0x76, 0xa6}, + {0x28, 0x77, 0xc0}, + {0x28, 0x78, 0xfc}, + {0x28, 0x79, 0xdc}, + {0x28, 0x7a, 0x4a}, + {0x28, 0x7b, 0xd0}, + {0x28, 0x7c, 0x0e}, // Biquad - BQ15 Right - Filter: Equalizer (Q Factor) Frequency: 16000 Hz Gain: 8dB QVal: 0.5 Bandwidth: 1000 Hz + {0x28, 0x7d, 0x2f}, + {0x28, 0x7e, 0xdd}, + {0x28, 0x7f, 0x47}, + {0x29, 0x08, 0xfc}, + {0x29, 0x09, 0x17}, + {0x29, 0x0a, 0x9b}, + {0x29, 0x0b, 0xa8}, + {0x29, 0x0c, 0xf9}, + {0x29, 0x0d, 0xa0}, + {0x29, 0x0e, 0xeb}, + {0x29, 0x0f, 0x6a}, + {0x29, 0x10, 0x03}, + {0x29, 0x11, 0xe8}, + {0x29, 0x12, 0x64}, + {0x29, 0x13, 0x58}, + {0x29, 0x14, 0x00}, + {0x29, 0x15, 0x2f}, + {0x29, 0x16, 0x37}, + {0x29, 0x17, 0x4f}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_right_p9[TAS5805M_EQ_REG_PER_STEP] = { + {0x26, 0x54, 0x08}, // Biquad - BQ1 Right - Filter: Equalizer (Q Factor) Frequency: 20 Hz Gain: 9dB QVal: 2 Bandwidth: 1000 Hz + {0x26, 0x55, 0x01}, + {0x26, 0x56, 0x37}, + {0x26, 0x57, 0xe2}, + {0x26, 0x58, 0xf0}, + {0x26, 0x59, 0x01}, + {0x26, 0x5a, 0x57}, + {0x26, 0x5b, 0xef}, + {0x26, 0x5c, 0x07}, + {0x26, 0x5d, 0xfd}, + {0x26, 0x5e, 0x71}, + {0x26, 0x5f, 0x15}, + {0x26, 0x60, 0x0f}, + {0x26, 0x61, 0xfe}, + {0x26, 0x62, 0xa8}, + {0x26, 0x63, 0x11}, + {0x26, 0x64, 0xf8}, + {0x26, 0x65, 0x01}, + {0x26, 0x66, 0x57}, + {0x26, 0x67, 0x09}, + {0x26, 0x68, 0x08}, // Biquad - BQ2 Right - Filter: Equalizer (Q Factor) Frequency: 31.5 Hz Gain: 9dB QVal: 2 Bandwidth: 1000 Hz + {0x26, 0x69, 0x01}, + {0x26, 0x6a, 0xeb}, + {0x26, 0x6b, 0x20}, + {0x26, 0x6c, 0xf0}, + {0x26, 0x6d, 0x02}, + {0x26, 0x6e, 0x1e}, + {0x26, 0x6f, 0x67}, + {0x26, 0x70, 0x07}, + {0x26, 0x71, 0xfb}, + {0x26, 0x72, 0xf8}, + {0x26, 0x73, 0xb3}, + {0x26, 0x74, 0x0f}, + {0x26, 0x75, 0xfd}, + {0x26, 0x76, 0xe1}, + {0x26, 0x77, 0x99}, + {0x26, 0x78, 0xf8}, + {0x26, 0x79, 0x02}, + {0x26, 0x7a, 0x1c}, + {0x26, 0x7b, 0x2d}, + {0x26, 0x7c, 0x08}, // Biquad - BQ3 Right - Filter: Equalizer (Q Factor) Frequency: 50 Hz Gain: 9dB QVal: 1.5 Bandwidth: 1000 Hz + {0x26, 0x7d, 0x04}, + {0x26, 0x7e, 0x0e}, + {0x26, 0x7f, 0xd1}, + {0x27, 0x08, 0xf0}, + {0x27, 0x09, 0x04}, + {0x27, 0x0a, 0x7c}, + {0x27, 0x0b, 0x2f}, + {0x27, 0x0c, 0x07}, + {0x27, 0x0d, 0xf7}, + {0x27, 0x0e, 0x7a}, + {0x27, 0x0f, 0x9c}, + {0x27, 0x10, 0x0f}, + {0x27, 0x11, 0xfb}, + {0x27, 0x12, 0x83}, + {0x27, 0x13, 0xd1}, + {0x27, 0x14, 0xf8}, + {0x27, 0x15, 0x04}, + {0x27, 0x16, 0x76}, + {0x27, 0x17, 0x93}, + {0x27, 0x18, 0x08}, // Biquad - BQ4 Right - Filter: Equalizer (Q Factor) Frequency: 80 Hz Gain: 9dB QVal: 1.5 Bandwidth: 1000 Hz + {0x27, 0x19, 0x06}, + {0x27, 0x1a, 0x7d}, + {0x27, 0x1b, 0x05}, + {0x27, 0x1c, 0xf0}, + {0x27, 0x1d, 0x07}, + {0x27, 0x1e, 0x31}, + {0x27, 0x1f, 0x45}, + {0x27, 0x20, 0x07}, + {0x27, 0x21, 0xf2}, + {0x27, 0x22, 0x60}, + {0x27, 0x23, 0x0e}, + {0x27, 0x24, 0x0f}, + {0x27, 0x25, 0xf8}, + {0x27, 0x26, 0xce}, + {0x27, 0x27, 0xbb}, + {0x27, 0x28, 0xf8}, + {0x27, 0x29, 0x07}, + {0x27, 0x2a, 0x22}, + {0x27, 0x2b, 0xec}, + {0x27, 0x2c, 0x08}, // Biquad - BQ5 Right - Filter: Equalizer (Q Factor) Frequency: 125 Hz Gain: 9dB QVal: 1 Bandwidth: 1000 Hz + {0x27, 0x2d, 0x0f}, + {0x27, 0x2e, 0x2b}, + {0x27, 0x2f, 0xed}, + {0x27, 0x30, 0xf0}, + {0x27, 0x31, 0x10}, + {0x27, 0x32, 0xd2}, + {0x27, 0x33, 0xcc}, + {0x27, 0x34, 0x07}, + {0x27, 0x35, 0xe0}, + {0x27, 0x36, 0x24}, + {0x27, 0x37, 0x3a}, + {0x27, 0x38, 0x0f}, + {0x27, 0x39, 0xef}, + {0x27, 0x3a, 0x2d}, + {0x27, 0x3b, 0x34}, + {0x27, 0x3c, 0xf8}, + {0x27, 0x3d, 0x10}, + {0x27, 0x3e, 0xaf}, + {0x27, 0x3f, 0xd9}, + {0x27, 0x40, 0x08}, // Biquad - BQ6 Right - Filter: Equalizer (Q Factor) Frequency: 200 Hz Gain: 9dB QVal: 1 Bandwidth: 1000 Hz + {0x27, 0x41, 0x18}, + {0x27, 0x42, 0x37}, + {0x27, 0x43, 0x21}, + {0x27, 0x44, 0xf0}, + {0x27, 0x45, 0x1a}, + {0x27, 0x46, 0xfb}, + {0x27, 0x47, 0x8a}, + {0x27, 0x48, 0x07}, + {0x27, 0x49, 0xcd}, + {0x27, 0x4a, 0x26}, + {0x27, 0x4b, 0x95}, + {0x27, 0x4c, 0x0f}, + {0x27, 0x4d, 0xe5}, + {0x27, 0x4e, 0x04}, + {0x27, 0x4f, 0x76}, + {0x27, 0x50, 0xf8}, + {0x27, 0x51, 0x1a}, + {0x27, 0x52, 0xa2}, + {0x27, 0x53, 0x4a}, + {0x27, 0x54, 0x08}, // Biquad - BQ7 Right - Filter: Equalizer (Q Factor) Frequency: 315 Hz Gain: 9dB QVal: 0.9 Bandwidth: 1000 Hz + {0x27, 0x55, 0x2a}, + {0x27, 0x56, 0x2b}, + {0x27, 0x57, 0xd4}, + {0x27, 0x58, 0xf0}, + {0x27, 0x59, 0x2f}, + {0x27, 0x5a, 0x3e}, + {0x27, 0x5b, 0x6a}, + {0x27, 0x5c, 0x07}, + {0x27, 0x5d, 0xa7}, + {0x27, 0x5e, 0x72}, + {0x27, 0x5f, 0x13}, + {0x27, 0x60, 0x0f}, + {0x27, 0x61, 0xd0}, + {0x27, 0x62, 0xc1}, + {0x27, 0x63, 0x96}, + {0x27, 0x64, 0xf8}, + {0x27, 0x65, 0x2e}, + {0x27, 0x66, 0x62}, + {0x27, 0x67, 0x19}, + {0x27, 0x68, 0x08}, // Biquad - BQ8 Right - Filter: Equalizer (Q Factor) Frequency: 500 Hz Gain: 9dB QVal: 0.9 Bandwidth: 1000 Hz + {0x27, 0x69, 0x42}, + {0x27, 0x6a, 0x7f}, + {0x27, 0x6b, 0x05}, + {0x27, 0x6c, 0xf0}, + {0x27, 0x6d, 0x4b}, + {0x27, 0x6e, 0x4a}, + {0x27, 0x6f, 0xa6}, + {0x27, 0x70, 0x07}, + {0x27, 0x71, 0x74}, + {0x27, 0x72, 0x5d}, + {0x27, 0x73, 0xba}, + {0x27, 0x74, 0x0f}, + {0x27, 0x75, 0xb4}, + {0x27, 0x76, 0xb5}, + {0x27, 0x77, 0x5a}, + {0x27, 0x78, 0xf8}, + {0x27, 0x79, 0x49}, + {0x27, 0x7a, 0x23}, + {0x27, 0x7b, 0x40}, + {0x27, 0x7c, 0x08}, // Biquad - BQ9 Right - Filter: Equalizer (Q Factor) Frequency: 800 Hz Gain: 9dB QVal: 0.8 Bandwidth: 1000 Hz + {0x27, 0x7d, 0x76}, + {0x27, 0x7e, 0x01}, + {0x27, 0x7f, 0xe6}, + {0x28, 0x08, 0xf0}, + {0x28, 0x09, 0x87}, + {0x28, 0x0a, 0x3a}, + {0x28, 0x0b, 0xb6}, + {0x28, 0x0c, 0x07}, + {0x28, 0x0d, 0x08}, + {0x28, 0x0e, 0x32}, + {0x28, 0x0f, 0xe4}, + {0x28, 0x10, 0x0f}, + {0x28, 0x11, 0x78}, + {0x28, 0x12, 0xc5}, + {0x28, 0x13, 0x4a}, + {0x28, 0x14, 0xf8}, + {0x28, 0x15, 0x81}, + {0x28, 0x16, 0xcb}, + {0x28, 0x17, 0x36}, + {0x28, 0x18, 0x08}, // Biquad - BQ10 Right - Filter: Equalizer (Q Factor) Frequency: 1250 Hz Gain: 9dB QVal: 0.8 Bandwidth: 1000 Hz + {0x28, 0x19, 0xb5}, + {0x28, 0x1a, 0x28}, + {0x28, 0x1b, 0x55}, + {0x28, 0x1c, 0xf0}, + {0x28, 0x1d, 0xd4}, + {0x28, 0x1e, 0x48}, + {0x28, 0x1f, 0xf3}, + {0x28, 0x20, 0x06}, + {0x28, 0x21, 0x83}, + {0x28, 0x22, 0x97}, + {0x28, 0x23, 0x59}, + {0x28, 0x24, 0x0f}, + {0x28, 0x25, 0x2b}, + {0x28, 0x26, 0xb7}, + {0x28, 0x27, 0x0d}, + {0x28, 0x28, 0xf8}, + {0x28, 0x29, 0xc7}, + {0x28, 0x2a, 0x40}, + {0x28, 0x2b, 0x52}, + {0x28, 0x2c, 0x09}, // Biquad - BQ11 Right - Filter: Equalizer (Q Factor) Frequency: 2000 Hz Gain: 9dB QVal: 0.7 Bandwidth: 1000 Hz + {0x28, 0x2d, 0x3e}, + {0x28, 0x2e, 0x6c}, + {0x28, 0x2f, 0xce}, + {0x28, 0x30, 0xf1}, + {0x28, 0x31, 0x7e}, + {0x28, 0x32, 0x46}, + {0x28, 0x33, 0x3e}, + {0x28, 0x34, 0x05}, + {0x28, 0x35, 0x63}, + {0x28, 0x36, 0x58}, + {0x28, 0x37, 0xa0}, + {0x28, 0x38, 0x0e}, + {0x28, 0x39, 0x81}, + {0x28, 0x3a, 0xb9}, + {0x28, 0x3b, 0xc2}, + {0x28, 0x3c, 0xf9}, + {0x28, 0x3d, 0x5e}, + {0x28, 0x3e, 0x3a}, + {0x28, 0x3f, 0x92}, + {0x28, 0x40, 0x09}, // Biquad - BQ12 Right - Filter: Equalizer (Q Factor) Frequency: 3150 Hz Gain: 9dB QVal: 0.7 Bandwidth: 1000 Hz + {0x28, 0x41, 0xde}, + {0x28, 0x42, 0x04}, + {0x28, 0x43, 0x7a}, + {0x28, 0x44, 0xf2}, + {0x28, 0x45, 0x59}, + {0x28, 0x46, 0x5e}, + {0x28, 0x47, 0x71}, + {0x28, 0x48, 0x04}, + {0x28, 0x49, 0x14}, + {0x28, 0x4a, 0x38}, + {0x28, 0x4b, 0xb0}, + {0x28, 0x4c, 0x0d}, + {0x28, 0x4d, 0xa6}, + {0x28, 0x4e, 0xa1}, + {0x28, 0x4f, 0x8f}, + {0x28, 0x50, 0xfa}, + {0x28, 0x51, 0x0d}, + {0x28, 0x52, 0xc2}, + {0x28, 0x53, 0xd6}, + {0x28, 0x54, 0x0b}, // Biquad - BQ13 Right - Filter: Equalizer (Q Factor) Frequency: 5000 Hz Gain: 9dB QVal: 0.6 Bandwidth: 1000 Hz + {0x28, 0x55, 0x1d}, + {0x28, 0x56, 0xf7}, + {0x28, 0x57, 0x20}, + {0x28, 0x58, 0xf4}, + {0x28, 0x59, 0x18}, + {0x28, 0x5a, 0x76}, + {0x28, 0x5b, 0x1f}, + {0x28, 0x5c, 0x01}, + {0x28, 0x5d, 0x74}, + {0x28, 0x5e, 0x5e}, + {0x28, 0x5f, 0xb1}, + {0x28, 0x60, 0x0b}, + {0x28, 0x61, 0xe7}, + {0x28, 0x62, 0x89}, + {0x28, 0x63, 0xe1}, + {0x28, 0x64, 0xfb}, + {0x28, 0x65, 0x6d}, + {0x28, 0x66, 0xaa}, + {0x28, 0x67, 0x2f}, + {0x28, 0x68, 0x0c}, // Biquad - BQ14 Right - Filter: Equalizer (Q Factor) Frequency: 8000 Hz Gain: 9dB QVal: 0.6 Bandwidth: 1000 Hz + {0x28, 0x69, 0x6b}, + {0x28, 0x6a, 0x4c}, + {0x28, 0x6b, 0xc5}, + {0x28, 0x6c, 0xf6}, + {0x28, 0x6d, 0x5a}, + {0x28, 0x6e, 0x59}, + {0x28, 0x6f, 0x40}, + {0x28, 0x70, 0xfe}, + {0x28, 0x71, 0xb8}, + {0x28, 0x72, 0x68}, + {0x28, 0x73, 0x6a}, + {0x28, 0x74, 0x09}, + {0x28, 0x75, 0xa5}, + {0x28, 0x76, 0xa6}, + {0x28, 0x77, 0xc0}, + {0x28, 0x78, 0xfc}, + {0x28, 0x79, 0xdc}, + {0x28, 0x7a, 0x4a}, + {0x28, 0x7b, 0xd0}, + {0x28, 0x7c, 0x0f}, // Biquad - BQ15 Right - Filter: Equalizer (Q Factor) Frequency: 16000 Hz Gain: 9dB QVal: 0.5 Bandwidth: 1000 Hz + {0x28, 0x7d, 0x70}, + {0x28, 0x7e, 0xf3}, + {0x28, 0x7f, 0xda}, + {0x29, 0x08, 0xfc}, + {0x29, 0x09, 0x17}, + {0x29, 0x0a, 0x9b}, + {0x29, 0x0b, 0xa8}, + {0x29, 0x0c, 0xf8}, + {0x29, 0x0d, 0x5f}, + {0x29, 0x0e, 0xd4}, + {0x29, 0x0f, 0xd6}, + {0x29, 0x10, 0x03}, + {0x29, 0x11, 0xe8}, + {0x29, 0x12, 0x64}, + {0x29, 0x13, 0x58}, + {0x29, 0x14, 0x00}, + {0x29, 0x15, 0x2f}, + {0x29, 0x16, 0x37}, + {0x29, 0x17, 0x4f}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_right_pa[TAS5805M_EQ_REG_PER_STEP] = { + {0x26, 0x54, 0x08}, // Biquad - BQ1 Right - Filter: Equalizer (Q Factor) Frequency: 20 Hz Gain: 10dB QVal: 2 Bandwidth: 1000 Hz + {0x26, 0x55, 0x01}, + {0x26, 0x56, 0x72}, + {0x26, 0x57, 0xde}, + {0x26, 0x58, 0xf0}, + {0x26, 0x59, 0x01}, + {0x26, 0x5a, 0x57}, + {0x26, 0x5b, 0xef}, + {0x26, 0x5c, 0x07}, + {0x26, 0x5d, 0xfd}, + {0x26, 0x5e, 0x36}, + {0x26, 0x5f, 0x19}, + {0x26, 0x60, 0x0f}, + {0x26, 0x61, 0xfe}, + {0x26, 0x62, 0xa8}, + {0x26, 0x63, 0x11}, + {0x26, 0x64, 0xf8}, + {0x26, 0x65, 0x01}, + {0x26, 0x66, 0x57}, + {0x26, 0x67, 0x09}, + {0x26, 0x68, 0x08}, // Biquad - BQ2 Right - Filter: Equalizer (Q Factor) Frequency: 31.5 Hz Gain: 10dB QVal: 2 Bandwidth: 1000 Hz + {0x26, 0x69, 0x02}, + {0x26, 0x6a, 0x48}, + {0x26, 0x6b, 0x01}, + {0x26, 0x6c, 0xf0}, + {0x26, 0x6d, 0x02}, + {0x26, 0x6e, 0x1e}, + {0x26, 0x6f, 0x67}, + {0x26, 0x70, 0x07}, + {0x26, 0x71, 0xfb}, + {0x26, 0x72, 0x9b}, + {0x26, 0x73, 0xd2}, + {0x26, 0x74, 0x0f}, + {0x26, 0x75, 0xfd}, + {0x26, 0x76, 0xe1}, + {0x26, 0x77, 0x99}, + {0x26, 0x78, 0xf8}, + {0x26, 0x79, 0x02}, + {0x26, 0x7a, 0x1c}, + {0x26, 0x7b, 0x2d}, + {0x26, 0x7c, 0x08}, // Biquad - BQ3 Right - Filter: Equalizer (Q Factor) Frequency: 50 Hz Gain: 10dB QVal: 1.5 Bandwidth: 1000 Hz + {0x26, 0x7d, 0x04}, + {0x26, 0x7e, 0xd3}, + {0x26, 0x7f, 0x48}, + {0x27, 0x08, 0xf0}, + {0x27, 0x09, 0x04}, + {0x27, 0x0a, 0x7c}, + {0x27, 0x0b, 0x2f}, + {0x27, 0x0c, 0x07}, + {0x27, 0x0d, 0xf6}, + {0x27, 0x0e, 0xb6}, + {0x27, 0x0f, 0x26}, + {0x27, 0x10, 0x0f}, + {0x27, 0x11, 0xfb}, + {0x27, 0x12, 0x83}, + {0x27, 0x13, 0xd1}, + {0x27, 0x14, 0xf8}, + {0x27, 0x15, 0x04}, + {0x27, 0x16, 0x76}, + {0x27, 0x17, 0x93}, + {0x27, 0x18, 0x08}, // Biquad - BQ4 Right - Filter: Equalizer (Q Factor) Frequency: 80 Hz Gain: 10dB QVal: 1.5 Bandwidth: 1000 Hz + {0x27, 0x19, 0x07}, + {0x27, 0x1a, 0xb7}, + {0x27, 0x1b, 0x28}, + {0x27, 0x1c, 0xf0}, + {0x27, 0x1d, 0x07}, + {0x27, 0x1e, 0x31}, + {0x27, 0x1f, 0x45}, + {0x27, 0x20, 0x07}, + {0x27, 0x21, 0xf1}, + {0x27, 0x22, 0x25}, + {0x27, 0x23, 0xec}, + {0x27, 0x24, 0x0f}, + {0x27, 0x25, 0xf8}, + {0x27, 0x26, 0xce}, + {0x27, 0x27, 0xbb}, + {0x27, 0x28, 0xf8}, + {0x27, 0x29, 0x07}, + {0x27, 0x2a, 0x22}, + {0x27, 0x2b, 0xec}, + {0x27, 0x2c, 0x08}, // Biquad - BQ5 Right - Filter: Equalizer (Q Factor) Frequency: 125 Hz Gain: 10dB QVal: 1 Bandwidth: 1000 Hz + {0x27, 0x2d, 0x12}, + {0x27, 0x2e, 0x0a}, + {0x27, 0x2f, 0x76}, + {0x27, 0x30, 0xf0}, + {0x27, 0x31, 0x10}, + {0x27, 0x32, 0xd2}, + {0x27, 0x33, 0xcc}, + {0x27, 0x34, 0x07}, + {0x27, 0x35, 0xdd}, + {0x27, 0x36, 0x45}, + {0x27, 0x37, 0xb2}, + {0x27, 0x38, 0x0f}, + {0x27, 0x39, 0xef}, + {0x27, 0x3a, 0x2d}, + {0x27, 0x3b, 0x34}, + {0x27, 0x3c, 0xf8}, + {0x27, 0x3d, 0x10}, + {0x27, 0x3e, 0xaf}, + {0x27, 0x3f, 0xd9}, + {0x27, 0x40, 0x08}, // Biquad - BQ6 Right - Filter: Equalizer (Q Factor) Frequency: 200 Hz Gain: 10dB QVal: 1 Bandwidth: 1000 Hz + {0x27, 0x41, 0x1c}, + {0x27, 0x42, 0xcb}, + {0x27, 0x43, 0x84}, + {0x27, 0x44, 0xf0}, + {0x27, 0x45, 0x1a}, + {0x27, 0x46, 0xfb}, + {0x27, 0x47, 0x8a}, + {0x27, 0x48, 0x07}, + {0x27, 0x49, 0xc8}, + {0x27, 0x4a, 0x92}, + {0x27, 0x4b, 0x32}, + {0x27, 0x4c, 0x0f}, + {0x27, 0x4d, 0xe5}, + {0x27, 0x4e, 0x04}, + {0x27, 0x4f, 0x76}, + {0x27, 0x50, 0xf8}, + {0x27, 0x51, 0x1a}, + {0x27, 0x52, 0xa2}, + {0x27, 0x53, 0x4a}, + {0x27, 0x54, 0x08}, // Biquad - BQ7 Right - Filter: Equalizer (Q Factor) Frequency: 315 Hz Gain: 10dB QVal: 0.9 Bandwidth: 1000 Hz + {0x27, 0x55, 0x32}, + {0x27, 0x56, 0x25}, + {0x27, 0x57, 0x8c}, + {0x27, 0x58, 0xf0}, + {0x27, 0x59, 0x2f}, + {0x27, 0x5a, 0x3e}, + {0x27, 0x5b, 0x6a}, + {0x27, 0x5c, 0x07}, + {0x27, 0x5d, 0x9f}, + {0x27, 0x5e, 0x78}, + {0x27, 0x5f, 0x5b}, + {0x27, 0x60, 0x0f}, + {0x27, 0x61, 0xd0}, + {0x27, 0x62, 0xc1}, + {0x27, 0x63, 0x96}, + {0x27, 0x64, 0xf8}, + {0x27, 0x65, 0x2e}, + {0x27, 0x66, 0x62}, + {0x27, 0x67, 0x19}, + {0x27, 0x68, 0x08}, // Biquad - BQ8 Right - Filter: Equalizer (Q Factor) Frequency: 500 Hz Gain: 10dB QVal: 0.9 Bandwidth: 1000 Hz + {0x27, 0x69, 0x4f}, + {0x27, 0x6a, 0x12}, + {0x27, 0x6b, 0x6f}, + {0x27, 0x6c, 0xf0}, + {0x27, 0x6d, 0x4b}, + {0x27, 0x6e, 0x4a}, + {0x27, 0x6f, 0xa6}, + {0x27, 0x70, 0x07}, + {0x27, 0x71, 0x67}, + {0x27, 0x72, 0xca}, + {0x27, 0x73, 0x50}, + {0x27, 0x74, 0x0f}, + {0x27, 0x75, 0xb4}, + {0x27, 0x76, 0xb5}, + {0x27, 0x77, 0x5a}, + {0x27, 0x78, 0xf8}, + {0x27, 0x79, 0x49}, + {0x27, 0x7a, 0x23}, + {0x27, 0x7b, 0x40}, + {0x27, 0x7c, 0x08}, // Biquad - BQ9 Right - Filter: Equalizer (Q Factor) Frequency: 800 Hz Gain: 10dB QVal: 0.8 Bandwidth: 1000 Hz + {0x27, 0x7d, 0x8c}, + {0x27, 0x7e, 0x53}, + {0x27, 0x7f, 0x3a}, + {0x28, 0x08, 0xf0}, + {0x28, 0x09, 0x87}, + {0x28, 0x0a, 0x3a}, + {0x28, 0x0b, 0xb6}, + {0x28, 0x0c, 0x06}, + {0x28, 0x0d, 0xf1}, + {0x28, 0x0e, 0xe1}, + {0x28, 0x0f, 0x8f}, + {0x28, 0x10, 0x0f}, + {0x28, 0x11, 0x78}, + {0x28, 0x12, 0xc5}, + {0x28, 0x13, 0x4a}, + {0x28, 0x14, 0xf8}, + {0x28, 0x15, 0x81}, + {0x28, 0x16, 0xcb}, + {0x28, 0x17, 0x36}, + {0x28, 0x18, 0x08}, // Biquad - BQ10 Right - Filter: Equalizer (Q Factor) Frequency: 1250 Hz Gain: 10dB QVal: 0.8 Bandwidth: 1000 Hz + {0x28, 0x19, 0xd7}, + {0x28, 0x1a, 0x6b}, + {0x28, 0x1b, 0x14}, + {0x28, 0x1c, 0xf0}, + {0x28, 0x1d, 0xd4}, + {0x28, 0x1e, 0x48}, + {0x28, 0x1f, 0xf3}, + {0x28, 0x20, 0x06}, + {0x28, 0x21, 0x61}, + {0x28, 0x22, 0x54}, + {0x28, 0x23, 0x9a}, + {0x28, 0x24, 0x0f}, + {0x28, 0x25, 0x2b}, + {0x28, 0x26, 0xb7}, + {0x28, 0x27, 0x0d}, + {0x28, 0x28, 0xf8}, + {0x28, 0x29, 0xc7}, + {0x28, 0x2a, 0x40}, + {0x28, 0x2b, 0x52}, + {0x28, 0x2c, 0x09}, // Biquad - BQ11 Right - Filter: Equalizer (Q Factor) Frequency: 2000 Hz Gain: 10dB QVal: 0.7 Bandwidth: 1000 Hz + {0x28, 0x2d, 0x7a}, + {0x28, 0x2e, 0xa5}, + {0x28, 0x2f, 0x5c}, + {0x28, 0x30, 0xf1}, + {0x28, 0x31, 0x7e}, + {0x28, 0x32, 0x46}, + {0x28, 0x33, 0x3e}, + {0x28, 0x34, 0x05}, + {0x28, 0x35, 0x27}, + {0x28, 0x36, 0x20}, + {0x28, 0x37, 0x11}, + {0x28, 0x38, 0x0e}, + {0x28, 0x39, 0x81}, + {0x28, 0x3a, 0xb9}, + {0x28, 0x3b, 0xc2}, + {0x28, 0x3c, 0xf9}, + {0x28, 0x3d, 0x5e}, + {0x28, 0x3e, 0x3a}, + {0x28, 0x3f, 0x92}, + {0x28, 0x40, 0x0a}, // Biquad - BQ12 Right - Filter: Equalizer (Q Factor) Frequency: 3150 Hz Gain: 10dB QVal: 0.7 Bandwidth: 1000 Hz + {0x28, 0x41, 0x38}, + {0x28, 0x42, 0x6b}, + {0x28, 0x43, 0xb4}, + {0x28, 0x44, 0xf2}, + {0x28, 0x45, 0x59}, + {0x28, 0x46, 0x5e}, + {0x28, 0x47, 0x71}, + {0x28, 0x48, 0x03}, + {0x28, 0x49, 0xb9}, + {0x28, 0x4a, 0xd1}, + {0x28, 0x4b, 0x76}, + {0x28, 0x4c, 0x0d}, + {0x28, 0x4d, 0xa6}, + {0x28, 0x4e, 0xa1}, + {0x28, 0x4f, 0x8f}, + {0x28, 0x50, 0xfa}, + {0x28, 0x51, 0x0d}, + {0x28, 0x52, 0xc2}, + {0x28, 0x53, 0xd6}, + {0x28, 0x54, 0x0b}, // Biquad - BQ13 Right - Filter: Equalizer (Q Factor) Frequency: 5000 Hz Gain: 10dB QVal: 0.6 Bandwidth: 1000 Hz + {0x28, 0x55, 0xb4}, + {0x28, 0x56, 0xe0}, + {0x28, 0x57, 0xa2}, + {0x28, 0x58, 0xf4}, + {0x28, 0x59, 0x18}, + {0x28, 0x5a, 0x76}, + {0x28, 0x5b, 0x1f}, + {0x28, 0x5c, 0x00}, + {0x28, 0x5d, 0xdd}, + {0x28, 0x5e, 0x75}, + {0x28, 0x5f, 0x2f}, + {0x28, 0x60, 0x0b}, + {0x28, 0x61, 0xe7}, + {0x28, 0x62, 0x89}, + {0x28, 0x63, 0xe1}, + {0x28, 0x64, 0xfb}, + {0x28, 0x65, 0x6d}, + {0x28, 0x66, 0xaa}, + {0x28, 0x67, 0x2f}, + {0x28, 0x68, 0x0d}, // Biquad - BQ14 Right - Filter: Equalizer (Q Factor) Frequency: 8000 Hz Gain: 10dB QVal: 0.6 Bandwidth: 1000 Hz + {0x28, 0x69, 0x41}, + {0x28, 0x6a, 0x40}, + {0x28, 0x6b, 0xae}, + {0x28, 0x6c, 0xf6}, + {0x28, 0x6d, 0x5a}, + {0x28, 0x6e, 0x59}, + {0x28, 0x6f, 0x40}, + {0x28, 0x70, 0xfd}, + {0x28, 0x71, 0xe2}, + {0x28, 0x72, 0x74}, + {0x28, 0x73, 0x81}, + {0x28, 0x74, 0x09}, + {0x28, 0x75, 0xa5}, + {0x28, 0x76, 0xa6}, + {0x28, 0x77, 0xc0}, + {0x28, 0x78, 0xfc}, + {0x28, 0x79, 0xdc}, + {0x28, 0x7a, 0x4a}, + {0x28, 0x7b, 0xd0}, + {0x28, 0x7c, 0x10}, // Biquad - BQ15 Right - Filter: Equalizer (Q Factor) Frequency: 16000 Hz Gain: 10dB QVal: 0.5 Bandwidth: 1000 Hz + {0x28, 0x7d, 0xd9}, + {0x28, 0x7e, 0x38}, + {0x28, 0x7f, 0x2c}, + {0x29, 0x08, 0xfc}, + {0x29, 0x09, 0x17}, + {0x29, 0x0a, 0x9b}, + {0x29, 0x0b, 0xa8}, + {0x29, 0x0c, 0xf6}, + {0x29, 0x0d, 0xf7}, + {0x29, 0x0e, 0x90}, + {0x29, 0x0f, 0x84}, + {0x29, 0x10, 0x03}, + {0x29, 0x11, 0xe8}, + {0x29, 0x12, 0x64}, + {0x29, 0x13, 0x58}, + {0x29, 0x14, 0x00}, + {0x29, 0x15, 0x2f}, + {0x29, 0x16, 0x37}, + {0x29, 0x17, 0x4f}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_right_pb[TAS5805M_EQ_REG_PER_STEP] = { + {0x26, 0x54, 0x08}, // Biquad - BQ1 Right - Filter: Equalizer (Q Factor) Frequency: 20 Hz Gain: 11dB QVal: 2 Bandwidth: 1000 Hz + {0x26, 0x55, 0x01}, + {0x26, 0x56, 0xb5}, + {0x26, 0x57, 0x0c}, + {0x26, 0x58, 0xf0}, + {0x26, 0x59, 0x01}, + {0x26, 0x5a, 0x57}, + {0x26, 0x5b, 0xef}, + {0x26, 0x5c, 0x07}, + {0x26, 0x5d, 0xfc}, + {0x26, 0x5e, 0xf3}, + {0x26, 0x5f, 0xeb}, + {0x26, 0x60, 0x0f}, + {0x26, 0x61, 0xfe}, + {0x26, 0x62, 0xa8}, + {0x26, 0x63, 0x11}, + {0x26, 0x64, 0xf8}, + {0x26, 0x65, 0x01}, + {0x26, 0x66, 0x57}, + {0x26, 0x67, 0x09}, + {0x26, 0x68, 0x08}, // Biquad - BQ2 Right - Filter: Equalizer (Q Factor) Frequency: 31.5 Hz Gain: 11dB QVal: 2 Bandwidth: 1000 Hz + {0x26, 0x69, 0x02}, + {0x26, 0x6a, 0xb0}, + {0x26, 0x6b, 0x38}, + {0x26, 0x6c, 0xf0}, + {0x26, 0x6d, 0x02}, + {0x26, 0x6e, 0x1e}, + {0x26, 0x6f, 0x67}, + {0x26, 0x70, 0x07}, + {0x26, 0x71, 0xfb}, + {0x26, 0x72, 0x33}, + {0x26, 0x73, 0x9a}, + {0x26, 0x74, 0x0f}, + {0x26, 0x75, 0xfd}, + {0x26, 0x76, 0xe1}, + {0x26, 0x77, 0x99}, + {0x26, 0x78, 0xf8}, + {0x26, 0x79, 0x02}, + {0x26, 0x7a, 0x1c}, + {0x26, 0x7b, 0x2d}, + {0x26, 0x7c, 0x08}, // Biquad - BQ3 Right - Filter: Equalizer (Q Factor) Frequency: 50 Hz Gain: 11dB QVal: 1.5 Bandwidth: 1000 Hz + {0x26, 0x7d, 0x05}, + {0x26, 0x7e, 0xaf}, + {0x26, 0x7f, 0xb7}, + {0x27, 0x08, 0xf0}, + {0x27, 0x09, 0x04}, + {0x27, 0x0a, 0x7c}, + {0x27, 0x0b, 0x2f}, + {0x27, 0x0c, 0x07}, + {0x27, 0x0d, 0xf5}, + {0x27, 0x0e, 0xd9}, + {0x27, 0x0f, 0xb7}, + {0x27, 0x10, 0x0f}, + {0x27, 0x11, 0xfb}, + {0x27, 0x12, 0x83}, + {0x27, 0x13, 0xd1}, + {0x27, 0x14, 0xf8}, + {0x27, 0x15, 0x04}, + {0x27, 0x16, 0x76}, + {0x27, 0x17, 0x93}, + {0x27, 0x18, 0x08}, // Biquad - BQ4 Right - Filter: Equalizer (Q Factor) Frequency: 80 Hz Gain: 11dB QVal: 1.5 Bandwidth: 1000 Hz + {0x27, 0x19, 0x09}, + {0x27, 0x1a, 0x17}, + {0x27, 0x1b, 0x9f}, + {0x27, 0x1c, 0xf0}, + {0x27, 0x1d, 0x07}, + {0x27, 0x1e, 0x31}, + {0x27, 0x1f, 0x45}, + {0x27, 0x20, 0x07}, + {0x27, 0x21, 0xef}, + {0x27, 0x22, 0xc5}, + {0x27, 0x23, 0x75}, + {0x27, 0x24, 0x0f}, + {0x27, 0x25, 0xf8}, + {0x27, 0x26, 0xce}, + {0x27, 0x27, 0xbb}, + {0x27, 0x28, 0xf8}, + {0x27, 0x29, 0x07}, + {0x27, 0x2a, 0x22}, + {0x27, 0x2b, 0xec}, + {0x27, 0x2c, 0x08}, // Biquad - BQ5 Right - Filter: Equalizer (Q Factor) Frequency: 125 Hz Gain: 11dB QVal: 1 Bandwidth: 1000 Hz + {0x27, 0x2d, 0x15}, + {0x27, 0x2e, 0x42}, + {0x27, 0x2f, 0x9e}, + {0x27, 0x30, 0xf0}, + {0x27, 0x31, 0x10}, + {0x27, 0x32, 0xd2}, + {0x27, 0x33, 0xcc}, + {0x27, 0x34, 0x07}, + {0x27, 0x35, 0xda}, + {0x27, 0x36, 0x0d}, + {0x27, 0x37, 0x89}, + {0x27, 0x38, 0x0f}, + {0x27, 0x39, 0xef}, + {0x27, 0x3a, 0x2d}, + {0x27, 0x3b, 0x34}, + {0x27, 0x3c, 0xf8}, + {0x27, 0x3d, 0x10}, + {0x27, 0x3e, 0xaf}, + {0x27, 0x3f, 0xd9}, + {0x27, 0x40, 0x08}, // Biquad - BQ6 Right - Filter: Equalizer (Q Factor) Frequency: 200 Hz Gain: 11dB QVal: 1 Bandwidth: 1000 Hz + {0x27, 0x41, 0x21}, + {0x27, 0x42, 0xee}, + {0x27, 0x43, 0xf5}, + {0x27, 0x44, 0xf0}, + {0x27, 0x45, 0x1a}, + {0x27, 0x46, 0xfb}, + {0x27, 0x47, 0x8a}, + {0x27, 0x48, 0x07}, + {0x27, 0x49, 0xc3}, + {0x27, 0x4a, 0x6e}, + {0x27, 0x4b, 0xc1}, + {0x27, 0x4c, 0x0f}, + {0x27, 0x4d, 0xe5}, + {0x27, 0x4e, 0x04}, + {0x27, 0x4f, 0x76}, + {0x27, 0x50, 0xf8}, + {0x27, 0x51, 0x1a}, + {0x27, 0x52, 0xa2}, + {0x27, 0x53, 0x4a}, + {0x27, 0x54, 0x08}, // Biquad - BQ7 Right - Filter: Equalizer (Q Factor) Frequency: 315 Hz Gain: 11dB QVal: 0.9 Bandwidth: 1000 Hz + {0x27, 0x55, 0x3b}, + {0x27, 0x56, 0x18}, + {0x27, 0x57, 0x65}, + {0x27, 0x58, 0xf0}, + {0x27, 0x59, 0x2f}, + {0x27, 0x5a, 0x3e}, + {0x27, 0x5b, 0x6a}, + {0x27, 0x5c, 0x07}, + {0x27, 0x5d, 0x96}, + {0x27, 0x5e, 0x85}, + {0x27, 0x5f, 0x82}, + {0x27, 0x60, 0x0f}, + {0x27, 0x61, 0xd0}, + {0x27, 0x62, 0xc1}, + {0x27, 0x63, 0x96}, + {0x27, 0x64, 0xf8}, + {0x27, 0x65, 0x2e}, + {0x27, 0x66, 0x62}, + {0x27, 0x67, 0x19}, + {0x27, 0x68, 0x08}, // Biquad - BQ8 Right - Filter: Equalizer (Q Factor) Frequency: 500 Hz Gain: 11dB QVal: 0.9 Bandwidth: 1000 Hz + {0x27, 0x69, 0x5d}, + {0x27, 0x6a, 0x2e}, + {0x27, 0x6b, 0xad}, + {0x27, 0x6c, 0xf0}, + {0x27, 0x6d, 0x4b}, + {0x27, 0x6e, 0x4a}, + {0x27, 0x6f, 0xa6}, + {0x27, 0x70, 0x07}, + {0x27, 0x71, 0x59}, + {0x27, 0x72, 0xae}, + {0x27, 0x73, 0x13}, + {0x27, 0x74, 0x0f}, + {0x27, 0x75, 0xb4}, + {0x27, 0x76, 0xb5}, + {0x27, 0x77, 0x5a}, + {0x27, 0x78, 0xf8}, + {0x27, 0x79, 0x49}, + {0x27, 0x7a, 0x23}, + {0x27, 0x7b, 0x40}, + {0x27, 0x7c, 0x08}, // Biquad - BQ9 Right - Filter: Equalizer (Q Factor) Frequency: 800 Hz Gain: 11dB QVal: 0.8 Bandwidth: 1000 Hz + {0x27, 0x7d, 0xa5}, + {0x27, 0x7e, 0x5d}, + {0x27, 0x7f, 0xb1}, + {0x28, 0x08, 0xf0}, + {0x28, 0x09, 0x87}, + {0x28, 0x0a, 0x3a}, + {0x28, 0x0b, 0xb6}, + {0x28, 0x0c, 0x06}, + {0x28, 0x0d, 0xd8}, + {0x28, 0x0e, 0xd7}, + {0x28, 0x0f, 0x19}, + {0x28, 0x10, 0x0f}, + {0x28, 0x11, 0x78}, + {0x28, 0x12, 0xc5}, + {0x28, 0x13, 0x4a}, + {0x28, 0x14, 0xf8}, + {0x28, 0x15, 0x81}, + {0x28, 0x16, 0xcb}, + {0x28, 0x17, 0x36}, + {0x28, 0x18, 0x08}, // Biquad - BQ10 Right - Filter: Equalizer (Q Factor) Frequency: 1250 Hz Gain: 11dB QVal: 0.8 Bandwidth: 1000 Hz + {0x28, 0x19, 0xfd}, + {0x28, 0x1a, 0xdc}, + {0x28, 0x1b, 0x04}, + {0x28, 0x1c, 0xf0}, + {0x28, 0x1d, 0xd4}, + {0x28, 0x1e, 0x48}, + {0x28, 0x1f, 0xf3}, + {0x28, 0x20, 0x06}, + {0x28, 0x21, 0x3a}, + {0x28, 0x22, 0xe3}, + {0x28, 0x23, 0xa9}, + {0x28, 0x24, 0x0f}, + {0x28, 0x25, 0x2b}, + {0x28, 0x26, 0xb7}, + {0x28, 0x27, 0x0d}, + {0x28, 0x28, 0xf8}, + {0x28, 0x29, 0xc7}, + {0x28, 0x2a, 0x40}, + {0x28, 0x2b, 0x52}, + {0x28, 0x2c, 0x09}, // Biquad - BQ11 Right - Filter: Equalizer (Q Factor) Frequency: 2000 Hz Gain: 11dB QVal: 0.7 Bandwidth: 1000 Hz + {0x28, 0x2d, 0xbe}, + {0x28, 0x2e, 0x37}, + {0x28, 0x2f, 0x05}, + {0x28, 0x30, 0xf1}, + {0x28, 0x31, 0x7e}, + {0x28, 0x32, 0x46}, + {0x28, 0x33, 0x3e}, + {0x28, 0x34, 0x04}, + {0x28, 0x35, 0xe3}, + {0x28, 0x36, 0x8e}, + {0x28, 0x37, 0x69}, + {0x28, 0x38, 0x0e}, + {0x28, 0x39, 0x81}, + {0x28, 0x3a, 0xb9}, + {0x28, 0x3b, 0xc2}, + {0x28, 0x3c, 0xf9}, + {0x28, 0x3d, 0x5e}, + {0x28, 0x3e, 0x3a}, + {0x28, 0x3f, 0x92}, + {0x28, 0x40, 0x0a}, // Biquad - BQ12 Right - Filter: Equalizer (Q Factor) Frequency: 3150 Hz Gain: 11dB QVal: 0.7 Bandwidth: 1000 Hz + {0x28, 0x41, 0x9d}, + {0x28, 0x42, 0xda}, + {0x28, 0x43, 0xd5}, + {0x28, 0x44, 0xf2}, + {0x28, 0x45, 0x59}, + {0x28, 0x46, 0x5e}, + {0x28, 0x47, 0x71}, + {0x28, 0x48, 0x03}, + {0x28, 0x49, 0x54}, + {0x28, 0x4a, 0x62}, + {0x28, 0x4b, 0x55}, + {0x28, 0x4c, 0x0d}, + {0x28, 0x4d, 0xa6}, + {0x28, 0x4e, 0xa1}, + {0x28, 0x4f, 0x8f}, + {0x28, 0x50, 0xfa}, + {0x28, 0x51, 0x0d}, + {0x28, 0x52, 0xc2}, + {0x28, 0x53, 0xd6}, + {0x28, 0x54, 0x0c}, // Biquad - BQ13 Right - Filter: Equalizer (Q Factor) Frequency: 5000 Hz Gain: 11dB QVal: 0.6 Bandwidth: 1000 Hz + {0x28, 0x55, 0x5e}, + {0x28, 0x56, 0x34}, + {0x28, 0x57, 0x25}, + {0x28, 0x58, 0xf4}, + {0x28, 0x59, 0x18}, + {0x28, 0x5a, 0x76}, + {0x28, 0x5b, 0x1f}, + {0x28, 0x5c, 0x00}, + {0x28, 0x5d, 0x34}, + {0x28, 0x5e, 0x21}, + {0x28, 0x5f, 0xac}, + {0x28, 0x60, 0x0b}, + {0x28, 0x61, 0xe7}, + {0x28, 0x62, 0x89}, + {0x28, 0x63, 0xe1}, + {0x28, 0x64, 0xfb}, + {0x28, 0x65, 0x6d}, + {0x28, 0x66, 0xaa}, + {0x28, 0x67, 0x2f}, + {0x28, 0x68, 0x0e}, // Biquad - BQ14 Right - Filter: Equalizer (Q Factor) Frequency: 8000 Hz Gain: 11dB QVal: 0.6 Bandwidth: 1000 Hz + {0x28, 0x69, 0x31}, + {0x28, 0x6a, 0x4f}, + {0x28, 0x6b, 0xc6}, + {0x28, 0x6c, 0xf6}, + {0x28, 0x6d, 0x5a}, + {0x28, 0x6e, 0x59}, + {0x28, 0x6f, 0x40}, + {0x28, 0x70, 0xfc}, + {0x28, 0x71, 0xf2}, + {0x28, 0x72, 0x65}, + {0x28, 0x73, 0x6a}, + {0x28, 0x74, 0x09}, + {0x28, 0x75, 0xa5}, + {0x28, 0x76, 0xa6}, + {0x28, 0x77, 0xc0}, + {0x28, 0x78, 0xfc}, + {0x28, 0x79, 0xdc}, + {0x28, 0x7a, 0x4a}, + {0x28, 0x7b, 0xd0}, + {0x28, 0x7c, 0x12}, // Biquad - BQ15 Right - Filter: Equalizer (Q Factor) Frequency: 16000 Hz Gain: 11dB QVal: 0.5 Bandwidth: 1000 Hz + {0x28, 0x7d, 0x6d}, + {0x28, 0x7e, 0x72}, + {0x28, 0x7f, 0x0d}, + {0x29, 0x08, 0xfc}, + {0x29, 0x09, 0x17}, + {0x29, 0x0a, 0x9b}, + {0x29, 0x0b, 0xa8}, + {0x29, 0x0c, 0xf5}, + {0x29, 0x0d, 0x63}, + {0x29, 0x0e, 0x56}, + {0x29, 0x0f, 0xa4}, + {0x29, 0x10, 0x03}, + {0x29, 0x11, 0xe8}, + {0x29, 0x12, 0x64}, + {0x29, 0x13, 0x58}, + {0x29, 0x14, 0x00}, + {0x29, 0x15, 0x2f}, + {0x29, 0x16, 0x37}, + {0x29, 0x17, 0x4f}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_right_pc[TAS5805M_EQ_REG_PER_STEP] = { + {0x26, 0x54, 0x08}, // Biquad - BQ1 Right - Filter: Equalizer (Q Factor) Frequency: 20 Hz Gain: 12dB QVal: 2 Bandwidth: 1000 Hz + {0x26, 0x55, 0x01}, + {0x26, 0x56, 0xff}, + {0x26, 0x57, 0x4e}, + {0x26, 0x58, 0xf0}, + {0x26, 0x59, 0x01}, + {0x26, 0x5a, 0x57}, + {0x26, 0x5b, 0xef}, + {0x26, 0x5c, 0x07}, + {0x26, 0x5d, 0xfc}, + {0x26, 0x5e, 0xa9}, + {0x26, 0x5f, 0xaa}, + {0x26, 0x60, 0x0f}, + {0x26, 0x61, 0xfe}, + {0x26, 0x62, 0xa8}, + {0x26, 0x63, 0x11}, + {0x26, 0x64, 0xf8}, + {0x26, 0x65, 0x01}, + {0x26, 0x66, 0x57}, + {0x26, 0x67, 0x09}, + {0x26, 0x68, 0x08}, // Biquad - BQ2 Right - Filter: Equalizer (Q Factor) Frequency: 31.5 Hz Gain: 12dB QVal: 2 Bandwidth: 1000 Hz + {0x26, 0x69, 0x03}, + {0x26, 0x6a, 0x25}, + {0x26, 0x6b, 0x27}, + {0x26, 0x6c, 0xf0}, + {0x26, 0x6d, 0x02}, + {0x26, 0x6e, 0x1e}, + {0x26, 0x6f, 0x67}, + {0x26, 0x70, 0x07}, + {0x26, 0x71, 0xfa}, + {0x26, 0x72, 0xbe}, + {0x26, 0x73, 0xac}, + {0x26, 0x74, 0x0f}, + {0x26, 0x75, 0xfd}, + {0x26, 0x76, 0xe1}, + {0x26, 0x77, 0x99}, + {0x26, 0x78, 0xf8}, + {0x26, 0x79, 0x02}, + {0x26, 0x7a, 0x1c}, + {0x26, 0x7b, 0x2d}, + {0x26, 0x7c, 0x08}, // Biquad - BQ3 Right - Filter: Equalizer (Q Factor) Frequency: 50 Hz Gain: 12dB QVal: 1.5 Bandwidth: 1000 Hz + {0x26, 0x7d, 0x06}, + {0x26, 0x7e, 0xa7}, + {0x26, 0x7f, 0x0c}, + {0x27, 0x08, 0xf0}, + {0x27, 0x09, 0x04}, + {0x27, 0x0a, 0x7c}, + {0x27, 0x0b, 0x2f}, + {0x27, 0x0c, 0x07}, + {0x27, 0x0d, 0xf4}, + {0x27, 0x0e, 0xe2}, + {0x27, 0x0f, 0x62}, + {0x27, 0x10, 0x0f}, + {0x27, 0x11, 0xfb}, + {0x27, 0x12, 0x83}, + {0x27, 0x13, 0xd1}, + {0x27, 0x14, 0xf8}, + {0x27, 0x15, 0x04}, + {0x27, 0x16, 0x76}, + {0x27, 0x17, 0x93}, + {0x27, 0x18, 0x08}, // Biquad - BQ4 Right - Filter: Equalizer (Q Factor) Frequency: 80 Hz Gain: 12dB QVal: 1.5 Bandwidth: 1000 Hz + {0x27, 0x19, 0x0a}, + {0x27, 0x1a, 0xa3}, + {0x27, 0x1b, 0x18}, + {0x27, 0x1c, 0xf0}, + {0x27, 0x1d, 0x07}, + {0x27, 0x1e, 0x31}, + {0x27, 0x1f, 0x45}, + {0x27, 0x20, 0x07}, + {0x27, 0x21, 0xee}, + {0x27, 0x22, 0x39}, + {0x27, 0x23, 0xfc}, + {0x27, 0x24, 0x0f}, + {0x27, 0x25, 0xf8}, + {0x27, 0x26, 0xce}, + {0x27, 0x27, 0xbb}, + {0x27, 0x28, 0xf8}, + {0x27, 0x29, 0x07}, + {0x27, 0x2a, 0x22}, + {0x27, 0x2b, 0xec}, + {0x27, 0x2c, 0x08}, // Biquad - BQ5 Right - Filter: Equalizer (Q Factor) Frequency: 125 Hz Gain: 12dB QVal: 1 Bandwidth: 1000 Hz + {0x27, 0x2d, 0x18}, + {0x27, 0x2e, 0xdf}, + {0x27, 0x2f, 0x57}, + {0x27, 0x30, 0xf0}, + {0x27, 0x31, 0x10}, + {0x27, 0x32, 0xd2}, + {0x27, 0x33, 0xcc}, + {0x27, 0x34, 0x07}, + {0x27, 0x35, 0xd6}, + {0x27, 0x36, 0x70}, + {0x27, 0x37, 0xd0}, + {0x27, 0x38, 0x0f}, + {0x27, 0x39, 0xef}, + {0x27, 0x3a, 0x2d}, + {0x27, 0x3b, 0x34}, + {0x27, 0x3c, 0xf8}, + {0x27, 0x3d, 0x10}, + {0x27, 0x3e, 0xaf}, + {0x27, 0x3f, 0xd9}, + {0x27, 0x40, 0x08}, // Biquad - BQ6 Right - Filter: Equalizer (Q Factor) Frequency: 200 Hz Gain: 12dB QVal: 1 Bandwidth: 1000 Hz + {0x27, 0x41, 0x27}, + {0x27, 0x42, 0xb2}, + {0x27, 0x43, 0xe7}, + {0x27, 0x44, 0xf0}, + {0x27, 0x45, 0x1a}, + {0x27, 0x46, 0xfb}, + {0x27, 0x47, 0x8a}, + {0x27, 0x48, 0x07}, + {0x27, 0x49, 0xbd}, + {0x27, 0x4a, 0xaa}, + {0x27, 0x4b, 0xcf}, + {0x27, 0x4c, 0x0f}, + {0x27, 0x4d, 0xe5}, + {0x27, 0x4e, 0x04}, + {0x27, 0x4f, 0x76}, + {0x27, 0x50, 0xf8}, + {0x27, 0x51, 0x1a}, + {0x27, 0x52, 0xa2}, + {0x27, 0x53, 0x4a}, + {0x27, 0x54, 0x08}, // Biquad - BQ7 Right - Filter: Equalizer (Q Factor) Frequency: 315 Hz Gain: 12dB QVal: 0.9 Bandwidth: 1000 Hz + {0x27, 0x55, 0x45}, + {0x27, 0x56, 0x22}, + {0x27, 0x57, 0xc4}, + {0x27, 0x58, 0xf0}, + {0x27, 0x59, 0x2f}, + {0x27, 0x5a, 0x3e}, + {0x27, 0x5b, 0x6a}, + {0x27, 0x5c, 0x07}, + {0x27, 0x5d, 0x8c}, + {0x27, 0x5e, 0x7b}, + {0x27, 0x5f, 0x23}, + {0x27, 0x60, 0x0f}, + {0x27, 0x61, 0xd0}, + {0x27, 0x62, 0xc1}, + {0x27, 0x63, 0x96}, + {0x27, 0x64, 0xf8}, + {0x27, 0x65, 0x2e}, + {0x27, 0x66, 0x62}, + {0x27, 0x67, 0x19}, + {0x27, 0x68, 0x08}, // Biquad - BQ8 Right - Filter: Equalizer (Q Factor) Frequency: 500 Hz Gain: 12dB QVal: 0.9 Bandwidth: 1000 Hz + {0x27, 0x69, 0x6d}, + {0x27, 0x6a, 0x03}, + {0x27, 0x6b, 0xad}, + {0x27, 0x6c, 0xf0}, + {0x27, 0x6d, 0x4b}, + {0x27, 0x6e, 0x4a}, + {0x27, 0x6f, 0xa6}, + {0x27, 0x70, 0x07}, + {0x27, 0x71, 0x49}, + {0x27, 0x72, 0xd9}, + {0x27, 0x73, 0x12}, + {0x27, 0x74, 0x0f}, + {0x27, 0x75, 0xb4}, + {0x27, 0x76, 0xb5}, + {0x27, 0x77, 0x5a}, + {0x27, 0x78, 0xf8}, + {0x27, 0x79, 0x49}, + {0x27, 0x7a, 0x23}, + {0x27, 0x7b, 0x40}, + {0x27, 0x7c, 0x08}, // Biquad - BQ9 Right - Filter: Equalizer (Q Factor) Frequency: 800 Hz Gain: 12dB QVal: 0.8 Bandwidth: 1000 Hz + {0x27, 0x7d, 0xc1}, + {0x27, 0x7e, 0x76}, + {0x27, 0x7f, 0x5a}, + {0x28, 0x08, 0xf0}, + {0x28, 0x09, 0x87}, + {0x28, 0x0a, 0x3a}, + {0x28, 0x0b, 0xb6}, + {0x28, 0x0c, 0x06}, + {0x28, 0x0d, 0xbc}, + {0x28, 0x0e, 0xbe}, + {0x28, 0x0f, 0x70}, + {0x28, 0x10, 0x0f}, + {0x28, 0x11, 0x78}, + {0x28, 0x12, 0xc5}, + {0x28, 0x13, 0x4a}, + {0x28, 0x14, 0xf8}, + {0x28, 0x15, 0x81}, + {0x28, 0x16, 0xcb}, + {0x28, 0x17, 0x36}, + {0x28, 0x18, 0x09}, // Biquad - BQ10 Right - Filter: Equalizer (Q Factor) Frequency: 1250 Hz Gain: 12dB QVal: 0.8 Bandwidth: 1000 Hz + {0x28, 0x19, 0x28}, + {0x28, 0x1a, 0xfd}, + {0x28, 0x1b, 0xbb}, + {0x28, 0x1c, 0xf0}, + {0x28, 0x1d, 0xd4}, + {0x28, 0x1e, 0x48}, + {0x28, 0x1f, 0xf3}, + {0x28, 0x20, 0x06}, + {0x28, 0x21, 0x0f}, + {0x28, 0x22, 0xc1}, + {0x28, 0x23, 0xf2}, + {0x28, 0x24, 0x0f}, + {0x28, 0x25, 0x2b}, + {0x28, 0x26, 0xb7}, + {0x28, 0x27, 0x0d}, + {0x28, 0x28, 0xf8}, + {0x28, 0x29, 0xc7}, + {0x28, 0x2a, 0x40}, + {0x28, 0x2b, 0x52}, + {0x28, 0x2c, 0x0a}, // Biquad - BQ11 Right - Filter: Equalizer (Q Factor) Frequency: 2000 Hz Gain: 12dB QVal: 0.7 Bandwidth: 1000 Hz + {0x28, 0x2d, 0x0a}, + {0x28, 0x2e, 0x07}, + {0x28, 0x2f, 0x50}, + {0x28, 0x30, 0xf1}, + {0x28, 0x31, 0x7e}, + {0x28, 0x32, 0x46}, + {0x28, 0x33, 0x3e}, + {0x28, 0x34, 0x04}, + {0x28, 0x35, 0x97}, + {0x28, 0x36, 0xbe}, + {0x28, 0x37, 0x1e}, + {0x28, 0x38, 0x0e}, + {0x28, 0x39, 0x81}, + {0x28, 0x3a, 0xb9}, + {0x28, 0x3b, 0xc2}, + {0x28, 0x3c, 0xf9}, + {0x28, 0x3d, 0x5e}, + {0x28, 0x3e, 0x3a}, + {0x28, 0x3f, 0x92}, + {0x28, 0x40, 0x0b}, // Biquad - BQ12 Right - Filter: Equalizer (Q Factor) Frequency: 3150 Hz Gain: 12dB QVal: 0.7 Bandwidth: 1000 Hz + {0x28, 0x41, 0x0f}, + {0x28, 0x42, 0xaa}, + {0x28, 0x43, 0x6e}, + {0x28, 0x44, 0xf2}, + {0x28, 0x45, 0x59}, + {0x28, 0x46, 0x5e}, + {0x28, 0x47, 0x71}, + {0x28, 0x48, 0x02}, + {0x28, 0x49, 0xe2}, + {0x28, 0x4a, 0x92}, + {0x28, 0x4b, 0xbc}, + {0x28, 0x4c, 0x0d}, + {0x28, 0x4d, 0xa6}, + {0x28, 0x4e, 0xa1}, + {0x28, 0x4f, 0x8f}, + {0x28, 0x50, 0xfa}, + {0x28, 0x51, 0x0d}, + {0x28, 0x52, 0xc2}, + {0x28, 0x53, 0xd6}, + {0x28, 0x54, 0x0d}, // Biquad - BQ13 Right - Filter: Equalizer (Q Factor) Frequency: 5000 Hz Gain: 12dB QVal: 0.6 Bandwidth: 1000 Hz + {0x28, 0x55, 0x1c}, + {0x28, 0x56, 0x30}, + {0x28, 0x57, 0xda}, + {0x28, 0x58, 0xf4}, + {0x28, 0x59, 0x18}, + {0x28, 0x5a, 0x76}, + {0x28, 0x5b, 0x1f}, + {0x28, 0x5c, 0xff}, + {0x28, 0x5d, 0x76}, + {0x28, 0x5e, 0x24}, + {0x28, 0x5f, 0xf7}, + {0x28, 0x60, 0x0b}, + {0x28, 0x61, 0xe7}, + {0x28, 0x62, 0x89}, + {0x28, 0x63, 0xe1}, + {0x28, 0x64, 0xfb}, + {0x28, 0x65, 0x6d}, + {0x28, 0x66, 0xaa}, + {0x28, 0x67, 0x2f}, + {0x28, 0x68, 0x0f}, // Biquad - BQ14 Right - Filter: Equalizer (Q Factor) Frequency: 8000 Hz Gain: 12dB QVal: 0.6 Bandwidth: 1000 Hz + {0x28, 0x69, 0x3e}, + {0x28, 0x6a, 0xa9}, + {0x28, 0x6b, 0x86}, + {0x28, 0x6c, 0xf6}, + {0x28, 0x6d, 0x5a}, + {0x28, 0x6e, 0x59}, + {0x28, 0x6f, 0x40}, + {0x28, 0x70, 0xfb}, + {0x28, 0x71, 0xe5}, + {0x28, 0x72, 0x0b}, + {0x28, 0x73, 0xaa}, + {0x28, 0x74, 0x09}, + {0x28, 0x75, 0xa5}, + {0x28, 0x76, 0xa6}, + {0x28, 0x77, 0xc0}, + {0x28, 0x78, 0xfc}, + {0x28, 0x79, 0xdc}, + {0x28, 0x7a, 0x4a}, + {0x28, 0x7b, 0xd0}, + {0x28, 0x7c, 0x14}, // Biquad - BQ15 Right - Filter: Equalizer (Q Factor) Frequency: 16000 Hz Gain: 12dB QVal: 0.5 Bandwidth: 1000 Hz + {0x28, 0x7d, 0x32}, + {0x28, 0x7e, 0xfe}, + {0x28, 0x7f, 0xa1}, + {0x29, 0x08, 0xfc}, + {0x29, 0x09, 0x17}, + {0x29, 0x0a, 0x9b}, + {0x29, 0x0b, 0xa8}, + {0x29, 0x0c, 0xf3}, + {0x29, 0x0d, 0x9d}, + {0x29, 0x0e, 0xca}, + {0x29, 0x0f, 0x10}, + {0x29, 0x10, 0x03}, + {0x29, 0x11, 0xe8}, + {0x29, 0x12, 0x64}, + {0x29, 0x13, 0x58}, + {0x29, 0x14, 0x00}, + {0x29, 0x15, 0x2f}, + {0x29, 0x16, 0x37}, + {0x29, 0x17, 0x4f}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_right_pd[TAS5805M_EQ_REG_PER_STEP] = { + {0x26, 0x54, 0x08}, // Biquad - BQ1 Right - Filter: Equalizer (Q Factor) Frequency: 20 Hz Gain: 13dB QVal: 2 Bandwidth: 1000 Hz + {0x26, 0x55, 0x02}, + {0x26, 0x56, 0x52}, + {0x26, 0x57, 0x9f}, + {0x26, 0x58, 0xf0}, + {0x26, 0x59, 0x01}, + {0x26, 0x5a, 0x57}, + {0x26, 0x5b, 0xef}, + {0x26, 0x5c, 0x07}, + {0x26, 0x5d, 0xfc}, + {0x26, 0x5e, 0x56}, + {0x26, 0x5f, 0x59}, + {0x26, 0x60, 0x0f}, + {0x26, 0x61, 0xfe}, + {0x26, 0x62, 0xa8}, + {0x26, 0x63, 0x11}, + {0x26, 0x64, 0xf8}, + {0x26, 0x65, 0x01}, + {0x26, 0x66, 0x57}, + {0x26, 0x67, 0x09}, + {0x26, 0x68, 0x08}, // Biquad - BQ2 Right - Filter: Equalizer (Q Factor) Frequency: 31.5 Hz Gain: 13dB QVal: 2 Bandwidth: 1000 Hz + {0x26, 0x69, 0x03}, + {0x26, 0x6a, 0xa8}, + {0x26, 0x6b, 0x5a}, + {0x26, 0x6c, 0xf0}, + {0x26, 0x6d, 0x02}, + {0x26, 0x6e, 0x1e}, + {0x26, 0x6f, 0x67}, + {0x26, 0x70, 0x07}, + {0x26, 0x71, 0xfa}, + {0x26, 0x72, 0x3b}, + {0x26, 0x73, 0x79}, + {0x26, 0x74, 0x0f}, + {0x26, 0x75, 0xfd}, + {0x26, 0x76, 0xe1}, + {0x26, 0x77, 0x99}, + {0x26, 0x78, 0xf8}, + {0x26, 0x79, 0x02}, + {0x26, 0x7a, 0x1c}, + {0x26, 0x7b, 0x2d}, + {0x26, 0x7c, 0x08}, // Biquad - BQ3 Right - Filter: Equalizer (Q Factor) Frequency: 50 Hz Gain: 13dB QVal: 1.5 Bandwidth: 1000 Hz + {0x26, 0x7d, 0x07}, + {0x26, 0x7e, 0xbc}, + {0x26, 0x7f, 0x8e}, + {0x27, 0x08, 0xf0}, + {0x27, 0x09, 0x04}, + {0x27, 0x0a, 0x7c}, + {0x27, 0x0b, 0x2f}, + {0x27, 0x0c, 0x07}, + {0x27, 0x0d, 0xf3}, + {0x27, 0x0e, 0xcc}, + {0x27, 0x0f, 0xdf}, + {0x27, 0x10, 0x0f}, + {0x27, 0x11, 0xfb}, + {0x27, 0x12, 0x83}, + {0x27, 0x13, 0xd1}, + {0x27, 0x14, 0xf8}, + {0x27, 0x15, 0x04}, + {0x27, 0x16, 0x76}, + {0x27, 0x17, 0x93}, + {0x27, 0x18, 0x08}, // Biquad - BQ4 Right - Filter: Equalizer (Q Factor) Frequency: 80 Hz Gain: 13dB QVal: 1.5 Bandwidth: 1000 Hz + {0x27, 0x19, 0x0c}, + {0x27, 0x1a, 0x5e}, + {0x27, 0x1b, 0xd2}, + {0x27, 0x1c, 0xf0}, + {0x27, 0x1d, 0x07}, + {0x27, 0x1e, 0x31}, + {0x27, 0x1f, 0x45}, + {0x27, 0x20, 0x07}, + {0x27, 0x21, 0xec}, + {0x27, 0x22, 0x7e}, + {0x27, 0x23, 0x42}, + {0x27, 0x24, 0x0f}, + {0x27, 0x25, 0xf8}, + {0x27, 0x26, 0xce}, + {0x27, 0x27, 0xbb}, + {0x27, 0x28, 0xf8}, + {0x27, 0x29, 0x07}, + {0x27, 0x2a, 0x22}, + {0x27, 0x2b, 0xec}, + {0x27, 0x2c, 0x08}, // Biquad - BQ5 Right - Filter: Equalizer (Q Factor) Frequency: 125 Hz Gain: 13dB QVal: 1 Bandwidth: 1000 Hz + {0x27, 0x2d, 0x1c}, + {0x27, 0x2e, 0xec}, + {0x27, 0x2f, 0xe5}, + {0x27, 0x30, 0xf0}, + {0x27, 0x31, 0x10}, + {0x27, 0x32, 0xd2}, + {0x27, 0x33, 0xcc}, + {0x27, 0x34, 0x07}, + {0x27, 0x35, 0xd2}, + {0x27, 0x36, 0x63}, + {0x27, 0x37, 0x42}, + {0x27, 0x38, 0x0f}, + {0x27, 0x39, 0xef}, + {0x27, 0x3a, 0x2d}, + {0x27, 0x3b, 0x34}, + {0x27, 0x3c, 0xf8}, + {0x27, 0x3d, 0x10}, + {0x27, 0x3e, 0xaf}, + {0x27, 0x3f, 0xd9}, + {0x27, 0x40, 0x08}, // Biquad - BQ6 Right - Filter: Equalizer (Q Factor) Frequency: 200 Hz Gain: 13dB QVal: 1 Bandwidth: 1000 Hz + {0x27, 0x41, 0x2e}, + {0x27, 0x42, 0x2a}, + {0x27, 0x43, 0xf1}, + {0x27, 0x44, 0xf0}, + {0x27, 0x45, 0x1a}, + {0x27, 0x46, 0xfb}, + {0x27, 0x47, 0x8a}, + {0x27, 0x48, 0x07}, + {0x27, 0x49, 0xb7}, + {0x27, 0x4a, 0x32}, + {0x27, 0x4b, 0xc5}, + {0x27, 0x4c, 0x0f}, + {0x27, 0x4d, 0xe5}, + {0x27, 0x4e, 0x04}, + {0x27, 0x4f, 0x76}, + {0x27, 0x50, 0xf8}, + {0x27, 0x51, 0x1a}, + {0x27, 0x52, 0xa2}, + {0x27, 0x53, 0x4a}, + {0x27, 0x54, 0x08}, // Biquad - BQ7 Right - Filter: Equalizer (Q Factor) Frequency: 315 Hz Gain: 13dB QVal: 0.9 Bandwidth: 1000 Hz + {0x27, 0x55, 0x50}, + {0x27, 0x56, 0x66}, + {0x27, 0x57, 0xc6}, + {0x27, 0x58, 0xf0}, + {0x27, 0x59, 0x2f}, + {0x27, 0x5a, 0x3e}, + {0x27, 0x5b, 0x6a}, + {0x27, 0x5c, 0x07}, + {0x27, 0x5d, 0x81}, + {0x27, 0x5e, 0x37}, + {0x27, 0x5f, 0x21}, + {0x27, 0x60, 0x0f}, + {0x27, 0x61, 0xd0}, + {0x27, 0x62, 0xc1}, + {0x27, 0x63, 0x96}, + {0x27, 0x64, 0xf8}, + {0x27, 0x65, 0x2e}, + {0x27, 0x66, 0x62}, + {0x27, 0x67, 0x19}, + {0x27, 0x68, 0x08}, // Biquad - BQ8 Right - Filter: Equalizer (Q Factor) Frequency: 500 Hz Gain: 13dB QVal: 0.9 Bandwidth: 1000 Hz + {0x27, 0x69, 0x7e}, + {0x27, 0x6a, 0xc7}, + {0x27, 0x6b, 0x38}, + {0x27, 0x6c, 0xf0}, + {0x27, 0x6d, 0x4b}, + {0x27, 0x6e, 0x4a}, + {0x27, 0x6f, 0xa6}, + {0x27, 0x70, 0x07}, + {0x27, 0x71, 0x38}, + {0x27, 0x72, 0x15}, + {0x27, 0x73, 0x87}, + {0x27, 0x74, 0x0f}, + {0x27, 0x75, 0xb4}, + {0x27, 0x76, 0xb5}, + {0x27, 0x77, 0x5a}, + {0x27, 0x78, 0xf8}, + {0x27, 0x79, 0x49}, + {0x27, 0x7a, 0x23}, + {0x27, 0x7b, 0x40}, + {0x27, 0x7c, 0x08}, // Biquad - BQ9 Right - Filter: Equalizer (Q Factor) Frequency: 800 Hz Gain: 13dB QVal: 0.8 Bandwidth: 1000 Hz + {0x27, 0x7d, 0xe0}, + {0x27, 0x7e, 0xfc}, + {0x27, 0x7f, 0xa5}, + {0x28, 0x08, 0xf0}, + {0x28, 0x09, 0x87}, + {0x28, 0x0a, 0x3a}, + {0x28, 0x0b, 0xb6}, + {0x28, 0x0c, 0x06}, + {0x28, 0x0d, 0x9d}, + {0x28, 0x0e, 0x38}, + {0x28, 0x0f, 0x25}, + {0x28, 0x10, 0x0f}, + {0x28, 0x11, 0x78}, + {0x28, 0x12, 0xc5}, + {0x28, 0x13, 0x4a}, + {0x28, 0x14, 0xf8}, + {0x28, 0x15, 0x81}, + {0x28, 0x16, 0xcb}, + {0x28, 0x17, 0x36}, + {0x28, 0x18, 0x09}, // Biquad - BQ10 Right - Filter: Equalizer (Q Factor) Frequency: 1250 Hz Gain: 13dB QVal: 0.8 Bandwidth: 1000 Hz + {0x28, 0x19, 0x59}, + {0x28, 0x1a, 0x62}, + {0x28, 0x1b, 0xbe}, + {0x28, 0x1c, 0xf0}, + {0x28, 0x1d, 0xd4}, + {0x28, 0x1e, 0x48}, + {0x28, 0x1f, 0xf3}, + {0x28, 0x20, 0x05}, + {0x28, 0x21, 0xdf}, + {0x28, 0x22, 0x5c}, + {0x28, 0x23, 0xf0}, + {0x28, 0x24, 0x0f}, + {0x28, 0x25, 0x2b}, + {0x28, 0x26, 0xb7}, + {0x28, 0x27, 0x0d}, + {0x28, 0x28, 0xf8}, + {0x28, 0x29, 0xc7}, + {0x28, 0x2a, 0x40}, + {0x28, 0x2b, 0x52}, + {0x28, 0x2c, 0x0a}, // Biquad - BQ11 Right - Filter: Equalizer (Q Factor) Frequency: 2000 Hz Gain: 13dB QVal: 0.7 Bandwidth: 1000 Hz + {0x28, 0x2d, 0x5f}, + {0x28, 0x2e, 0x17}, + {0x28, 0x2f, 0xc6}, + {0x28, 0x30, 0xf1}, + {0x28, 0x31, 0x7e}, + {0x28, 0x32, 0x46}, + {0x28, 0x33, 0x3e}, + {0x28, 0x34, 0x04}, + {0x28, 0x35, 0x42}, + {0x28, 0x36, 0xad}, + {0x28, 0x37, 0xa7}, + {0x28, 0x38, 0x0e}, + {0x28, 0x39, 0x81}, + {0x28, 0x3a, 0xb9}, + {0x28, 0x3b, 0xc2}, + {0x28, 0x3c, 0xf9}, + {0x28, 0x3d, 0x5e}, + {0x28, 0x3e, 0x3a}, + {0x28, 0x3f, 0x92}, + {0x28, 0x40, 0x0b}, // Biquad - BQ12 Right - Filter: Equalizer (Q Factor) Frequency: 3150 Hz Gain: 13dB QVal: 0.7 Bandwidth: 1000 Hz + {0x28, 0x41, 0x8f}, + {0x28, 0x42, 0x5d}, + {0x28, 0x43, 0x1b}, + {0x28, 0x44, 0xf2}, + {0x28, 0x45, 0x59}, + {0x28, 0x46, 0x5e}, + {0x28, 0x47, 0x71}, + {0x28, 0x48, 0x02}, + {0x28, 0x49, 0x62}, + {0x28, 0x4a, 0xe0}, + {0x28, 0x4b, 0x0f}, + {0x28, 0x4c, 0x0d}, + {0x28, 0x4d, 0xa6}, + {0x28, 0x4e, 0xa1}, + {0x28, 0x4f, 0x8f}, + {0x28, 0x50, 0xfa}, + {0x28, 0x51, 0x0d}, + {0x28, 0x52, 0xc2}, + {0x28, 0x53, 0xd6}, + {0x28, 0x54, 0x0d}, // Biquad - BQ13 Right - Filter: Equalizer (Q Factor) Frequency: 5000 Hz Gain: 13dB QVal: 0.6 Bandwidth: 1000 Hz + {0x28, 0x55, 0xf1}, + {0x28, 0x56, 0x5c}, + {0x28, 0x57, 0x22}, + {0x28, 0x58, 0xf4}, + {0x28, 0x59, 0x18}, + {0x28, 0x5a, 0x76}, + {0x28, 0x5b, 0x1f}, + {0x28, 0x5c, 0xfe}, + {0x28, 0x5d, 0xa0}, + {0x28, 0x5e, 0xf9}, + {0x28, 0x5f, 0xaf}, + {0x28, 0x60, 0x0b}, + {0x28, 0x61, 0xe7}, + {0x28, 0x62, 0x89}, + {0x28, 0x63, 0xe1}, + {0x28, 0x64, 0xfb}, + {0x28, 0x65, 0x6d}, + {0x28, 0x66, 0xaa}, + {0x28, 0x67, 0x2f}, + {0x28, 0x68, 0x10}, // Biquad - BQ14 Right - Filter: Equalizer (Q Factor) Frequency: 8000 Hz Gain: 13dB QVal: 0.6 Bandwidth: 1000 Hz + {0x28, 0x69, 0x6c}, + {0x28, 0x6a, 0xe0}, + {0x28, 0x6b, 0xe7}, + {0x28, 0x6c, 0xf6}, + {0x28, 0x6d, 0x5a}, + {0x28, 0x6e, 0x59}, + {0x28, 0x6f, 0x40}, + {0x28, 0x70, 0xfa}, + {0x28, 0x71, 0xb6}, + {0x28, 0x72, 0xd4}, + {0x28, 0x73, 0x49}, + {0x28, 0x74, 0x09}, + {0x28, 0x75, 0xa5}, + {0x28, 0x76, 0xa6}, + {0x28, 0x77, 0xc0}, + {0x28, 0x78, 0xfc}, + {0x28, 0x79, 0xdc}, + {0x28, 0x7a, 0x4a}, + {0x28, 0x7b, 0xd0}, + {0x28, 0x7c, 0x16}, // Biquad - BQ15 Right - Filter: Equalizer (Q Factor) Frequency: 16000 Hz Gain: 13dB QVal: 0.5 Bandwidth: 1000 Hz + {0x28, 0x7d, 0x2f}, + {0x28, 0x7e, 0xe2}, + {0x28, 0x7f, 0x98}, + {0x29, 0x08, 0xfc}, + {0x29, 0x09, 0x17}, + {0x29, 0x0a, 0x9b}, + {0x29, 0x0b, 0xa8}, + {0x29, 0x0c, 0xf1}, + {0x29, 0x0d, 0xa0}, + {0x29, 0x0e, 0xe6}, + {0x29, 0x0f, 0x19}, + {0x29, 0x10, 0x03}, + {0x29, 0x11, 0xe8}, + {0x29, 0x12, 0x64}, + {0x29, 0x13, 0x58}, + {0x29, 0x14, 0x00}, + {0x29, 0x15, 0x2f}, + {0x29, 0x16, 0x37}, + {0x29, 0x17, 0x4f}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_right_pe[TAS5805M_EQ_REG_PER_STEP] = { + {0x26, 0x54, 0x08}, // Biquad - BQ1 Right - Filter: Equalizer (Q Factor) Frequency: 20 Hz Gain: 14dB QVal: 2 Bandwidth: 1000 Hz + {0x26, 0x55, 0x02}, + {0x26, 0x56, 0xb0}, + {0x26, 0x57, 0x1a}, + {0x26, 0x58, 0xf0}, + {0x26, 0x59, 0x01}, + {0x26, 0x5a, 0x57}, + {0x26, 0x5b, 0xef}, + {0x26, 0x5c, 0x07}, + {0x26, 0x5d, 0xfb}, + {0x26, 0x5e, 0xf8}, + {0x26, 0x5f, 0xdd}, + {0x26, 0x60, 0x0f}, + {0x26, 0x61, 0xfe}, + {0x26, 0x62, 0xa8}, + {0x26, 0x63, 0x11}, + {0x26, 0x64, 0xf8}, + {0x26, 0x65, 0x01}, + {0x26, 0x66, 0x57}, + {0x26, 0x67, 0x09}, + {0x26, 0x68, 0x08}, // Biquad - BQ2 Right - Filter: Equalizer (Q Factor) Frequency: 31.5 Hz Gain: 14dB QVal: 2 Bandwidth: 1000 Hz + {0x26, 0x69, 0x04}, + {0x26, 0x6a, 0x3b}, + {0x26, 0x6b, 0x8f}, + {0x26, 0x6c, 0xf0}, + {0x26, 0x6d, 0x02}, + {0x26, 0x6e, 0x1e}, + {0x26, 0x6f, 0x67}, + {0x26, 0x70, 0x07}, + {0x26, 0x71, 0xf9}, + {0x26, 0x72, 0xa8}, + {0x26, 0x73, 0x44}, + {0x26, 0x74, 0x0f}, + {0x26, 0x75, 0xfd}, + {0x26, 0x76, 0xe1}, + {0x26, 0x77, 0x99}, + {0x26, 0x78, 0xf8}, + {0x26, 0x79, 0x02}, + {0x26, 0x7a, 0x1c}, + {0x26, 0x7b, 0x2d}, + {0x26, 0x7c, 0x08}, // Biquad - BQ3 Right - Filter: Equalizer (Q Factor) Frequency: 50 Hz Gain: 14dB QVal: 1.5 Bandwidth: 1000 Hz + {0x26, 0x7d, 0x08}, + {0x26, 0x7e, 0xf3}, + {0x26, 0x7f, 0xed}, + {0x27, 0x08, 0xf0}, + {0x27, 0x09, 0x04}, + {0x27, 0x0a, 0x7c}, + {0x27, 0x0b, 0x2f}, + {0x27, 0x0c, 0x07}, + {0x27, 0x0d, 0xf2}, + {0x27, 0x0e, 0x95}, + {0x27, 0x0f, 0x80}, + {0x27, 0x10, 0x0f}, + {0x27, 0x11, 0xfb}, + {0x27, 0x12, 0x83}, + {0x27, 0x13, 0xd1}, + {0x27, 0x14, 0xf8}, + {0x27, 0x15, 0x04}, + {0x27, 0x16, 0x76}, + {0x27, 0x17, 0x93}, + {0x27, 0x18, 0x08}, // Biquad - BQ4 Right - Filter: Equalizer (Q Factor) Frequency: 80 Hz Gain: 14dB QVal: 1.5 Bandwidth: 1000 Hz + {0x27, 0x19, 0x0e}, + {0x27, 0x1a, 0x50}, + {0x27, 0x1b, 0xb0}, + {0x27, 0x1c, 0xf0}, + {0x27, 0x1d, 0x07}, + {0x27, 0x1e, 0x31}, + {0x27, 0x1f, 0x45}, + {0x27, 0x20, 0x07}, + {0x27, 0x21, 0xea}, + {0x27, 0x22, 0x8c}, + {0x27, 0x23, 0x64}, + {0x27, 0x24, 0x0f}, + {0x27, 0x25, 0xf8}, + {0x27, 0x26, 0xce}, + {0x27, 0x27, 0xbb}, + {0x27, 0x28, 0xf8}, + {0x27, 0x29, 0x07}, + {0x27, 0x2a, 0x22}, + {0x27, 0x2b, 0xec}, + {0x27, 0x2c, 0x08}, // Biquad - BQ5 Right - Filter: Equalizer (Q Factor) Frequency: 125 Hz Gain: 14dB QVal: 1 Bandwidth: 1000 Hz + {0x27, 0x2d, 0x21}, + {0x27, 0x2e, 0x79}, + {0x27, 0x2f, 0x0d}, + {0x27, 0x30, 0xf0}, + {0x27, 0x31, 0x10}, + {0x27, 0x32, 0xd2}, + {0x27, 0x33, 0xcc}, + {0x27, 0x34, 0x07}, + {0x27, 0x35, 0xcd}, + {0x27, 0x36, 0xd7}, + {0x27, 0x37, 0x1a}, + {0x27, 0x38, 0x0f}, + {0x27, 0x39, 0xef}, + {0x27, 0x3a, 0x2d}, + {0x27, 0x3b, 0x34}, + {0x27, 0x3c, 0xf8}, + {0x27, 0x3d, 0x10}, + {0x27, 0x3e, 0xaf}, + {0x27, 0x3f, 0xd9}, + {0x27, 0x40, 0x08}, // Biquad - BQ6 Right - Filter: Equalizer (Q Factor) Frequency: 200 Hz Gain: 14dB QVal: 1 Bandwidth: 1000 Hz + {0x27, 0x41, 0x35}, + {0x27, 0x42, 0x6d}, + {0x27, 0x43, 0x0d}, + {0x27, 0x44, 0xf0}, + {0x27, 0x45, 0x1a}, + {0x27, 0x46, 0xfb}, + {0x27, 0x47, 0x8a}, + {0x27, 0x48, 0x07}, + {0x27, 0x49, 0xaf}, + {0x27, 0x4a, 0xf0}, + {0x27, 0x4b, 0xa9}, + {0x27, 0x4c, 0x0f}, + {0x27, 0x4d, 0xe5}, + {0x27, 0x4e, 0x04}, + {0x27, 0x4f, 0x76}, + {0x27, 0x50, 0xf8}, + {0x27, 0x51, 0x1a}, + {0x27, 0x52, 0xa2}, + {0x27, 0x53, 0x4a}, + {0x27, 0x54, 0x08}, // Biquad - BQ7 Right - Filter: Equalizer (Q Factor) Frequency: 315 Hz Gain: 14dB QVal: 0.9 Bandwidth: 1000 Hz + {0x27, 0x55, 0x5d}, + {0x27, 0x56, 0x0a}, + {0x27, 0x57, 0xae}, + {0x27, 0x58, 0xf0}, + {0x27, 0x59, 0x2f}, + {0x27, 0x5a, 0x3e}, + {0x27, 0x5b, 0x6a}, + {0x27, 0x5c, 0x07}, + {0x27, 0x5d, 0x74}, + {0x27, 0x5e, 0x93}, + {0x27, 0x5f, 0x39}, + {0x27, 0x60, 0x0f}, + {0x27, 0x61, 0xd0}, + {0x27, 0x62, 0xc1}, + {0x27, 0x63, 0x96}, + {0x27, 0x64, 0xf8}, + {0x27, 0x65, 0x2e}, + {0x27, 0x66, 0x62}, + {0x27, 0x67, 0x19}, + {0x27, 0x68, 0x08}, // Biquad - BQ8 Right - Filter: Equalizer (Q Factor) Frequency: 500 Hz Gain: 14dB QVal: 0.9 Bandwidth: 1000 Hz + {0x27, 0x69, 0x92}, + {0x27, 0x6a, 0xb5}, + {0x27, 0x6b, 0xa6}, + {0x27, 0x6c, 0xf0}, + {0x27, 0x6d, 0x4b}, + {0x27, 0x6e, 0x4a}, + {0x27, 0x6f, 0xa6}, + {0x27, 0x70, 0x07}, + {0x27, 0x71, 0x24}, + {0x27, 0x72, 0x27}, + {0x27, 0x73, 0x1a}, + {0x27, 0x74, 0x0f}, + {0x27, 0x75, 0xb4}, + {0x27, 0x76, 0xb5}, + {0x27, 0x77, 0x5a}, + {0x27, 0x78, 0xf8}, + {0x27, 0x79, 0x49}, + {0x27, 0x7a, 0x23}, + {0x27, 0x7b, 0x40}, + {0x27, 0x7c, 0x09}, // Biquad - BQ9 Right - Filter: Equalizer (Q Factor) Frequency: 800 Hz Gain: 14dB QVal: 0.8 Bandwidth: 1000 Hz + {0x27, 0x7d, 0x04}, + {0x27, 0x7e, 0x5b}, + {0x27, 0x7f, 0xaa}, + {0x28, 0x08, 0xf0}, + {0x28, 0x09, 0x87}, + {0x28, 0x0a, 0x3a}, + {0x28, 0x0b, 0xb6}, + {0x28, 0x0c, 0x06}, + {0x28, 0x0d, 0x79}, + {0x28, 0x0e, 0xd9}, + {0x28, 0x0f, 0x20}, + {0x28, 0x10, 0x0f}, + {0x28, 0x11, 0x78}, + {0x28, 0x12, 0xc5}, + {0x28, 0x13, 0x4a}, + {0x28, 0x14, 0xf8}, + {0x28, 0x15, 0x81}, + {0x28, 0x16, 0xcb}, + {0x28, 0x17, 0x36}, + {0x28, 0x18, 0x09}, // Biquad - BQ10 Right - Filter: Equalizer (Q Factor) Frequency: 1250 Hz Gain: 14dB QVal: 0.8 Bandwidth: 1000 Hz + {0x28, 0x19, 0x8f}, + {0x28, 0x1a, 0xaf}, + {0x28, 0x1b, 0x70}, + {0x28, 0x1c, 0xf0}, + {0x28, 0x1d, 0xd4}, + {0x28, 0x1e, 0x48}, + {0x28, 0x1f, 0xf3}, + {0x28, 0x20, 0x05}, + {0x28, 0x21, 0xa9}, + {0x28, 0x22, 0x10}, + {0x28, 0x23, 0x3e}, + {0x28, 0x24, 0x0f}, + {0x28, 0x25, 0x2b}, + {0x28, 0x26, 0xb7}, + {0x28, 0x27, 0x0d}, + {0x28, 0x28, 0xf8}, + {0x28, 0x29, 0xc7}, + {0x28, 0x2a, 0x40}, + {0x28, 0x2b, 0x52}, + {0x28, 0x2c, 0x0a}, // Biquad - BQ11 Right - Filter: Equalizer (Q Factor) Frequency: 2000 Hz Gain: 14dB QVal: 0.7 Bandwidth: 1000 Hz + {0x28, 0x2d, 0xbe}, + {0x28, 0x2e, 0x89}, + {0x28, 0x2f, 0x5e}, + {0x28, 0x30, 0xf1}, + {0x28, 0x31, 0x7e}, + {0x28, 0x32, 0x46}, + {0x28, 0x33, 0x3e}, + {0x28, 0x34, 0x03}, + {0x28, 0x35, 0xe3}, + {0x28, 0x36, 0x3c}, + {0x28, 0x37, 0x10}, + {0x28, 0x38, 0x0e}, + {0x28, 0x39, 0x81}, + {0x28, 0x3a, 0xb9}, + {0x28, 0x3b, 0xc2}, + {0x28, 0x3c, 0xf9}, + {0x28, 0x3d, 0x5e}, + {0x28, 0x3e, 0x3a}, + {0x28, 0x3f, 0x92}, + {0x28, 0x40, 0x0c}, // Biquad - BQ12 Right - Filter: Equalizer (Q Factor) Frequency: 3150 Hz Gain: 14dB QVal: 0.7 Bandwidth: 1000 Hz + {0x28, 0x41, 0x1e}, + {0x28, 0x42, 0xa4}, + {0x28, 0x43, 0xa6}, + {0x28, 0x44, 0xf2}, + {0x28, 0x45, 0x59}, + {0x28, 0x46, 0x5e}, + {0x28, 0x47, 0x71}, + {0x28, 0x48, 0x01}, + {0x28, 0x49, 0xd3}, + {0x28, 0x4a, 0x98}, + {0x28, 0x4b, 0x83}, + {0x28, 0x4c, 0x0d}, + {0x28, 0x4d, 0xa6}, + {0x28, 0x4e, 0xa1}, + {0x28, 0x4f, 0x8f}, + {0x28, 0x50, 0xfa}, + {0x28, 0x51, 0x0d}, + {0x28, 0x52, 0xc2}, + {0x28, 0x53, 0xd6}, + {0x28, 0x54, 0x0e}, // Biquad - BQ13 Right - Filter: Equalizer (Q Factor) Frequency: 5000 Hz Gain: 14dB QVal: 0.6 Bandwidth: 1000 Hz + {0x28, 0x55, 0xe0}, + {0x28, 0x56, 0x8a}, + {0x28, 0x57, 0x1e}, + {0x28, 0x58, 0xf4}, + {0x28, 0x59, 0x18}, + {0x28, 0x5a, 0x76}, + {0x28, 0x5b, 0x1f}, + {0x28, 0x5c, 0xfd}, + {0x28, 0x5d, 0xb1}, + {0x28, 0x5e, 0xcb}, + {0x28, 0x5f, 0xb2}, + {0x28, 0x60, 0x0b}, + {0x28, 0x61, 0xe7}, + {0x28, 0x62, 0x89}, + {0x28, 0x63, 0xe1}, + {0x28, 0x64, 0xfb}, + {0x28, 0x65, 0x6d}, + {0x28, 0x66, 0xaa}, + {0x28, 0x67, 0x2f}, + {0x28, 0x68, 0x11}, // Biquad - BQ14 Right - Filter: Equalizer (Q Factor) Frequency: 8000 Hz Gain: 14dB QVal: 0.6 Bandwidth: 1000 Hz + {0x28, 0x69, 0xbf}, + {0x28, 0x6a, 0xf8}, + {0x28, 0x6b, 0x87}, + {0x28, 0x6c, 0xf6}, + {0x28, 0x6d, 0x5a}, + {0x28, 0x6e, 0x59}, + {0x28, 0x6f, 0x40}, + {0x28, 0x70, 0xf9}, + {0x28, 0x71, 0x63}, + {0x28, 0x72, 0xbc}, + {0x28, 0x73, 0xa9}, + {0x28, 0x74, 0x09}, + {0x28, 0x75, 0xa5}, + {0x28, 0x76, 0xa6}, + {0x28, 0x77, 0xc0}, + {0x28, 0x78, 0xfc}, + {0x28, 0x79, 0xdc}, + {0x28, 0x7a, 0x4a}, + {0x28, 0x7b, 0xd0}, + {0x28, 0x7c, 0x18}, // Biquad - BQ15 Right - Filter: Equalizer (Q Factor) Frequency: 16000 Hz Gain: 14dB QVal: 0.5 Bandwidth: 1000 Hz + {0x28, 0x7d, 0x6a}, + {0x28, 0x7e, 0xde}, + {0x28, 0x7f, 0xa2}, + {0x29, 0x08, 0xfc}, + {0x29, 0x09, 0x17}, + {0x29, 0x0a, 0x9b}, + {0x29, 0x0b, 0xa8}, + {0x29, 0x0c, 0xef}, + {0x29, 0x0d, 0x65}, + {0x29, 0x0e, 0xea}, + {0x29, 0x0f, 0x0f}, + {0x29, 0x10, 0x03}, + {0x29, 0x11, 0xe8}, + {0x29, 0x12, 0x64}, + {0x29, 0x13, 0x58}, + {0x29, 0x14, 0x00}, + {0x29, 0x15, 0x2f}, + {0x29, 0x16, 0x37}, + {0x29, 0x17, 0x4f}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_right_pf[TAS5805M_EQ_REG_PER_STEP] = { + {0x26, 0x54, 0x08}, // Biquad - BQ1 Right - Filter: Equalizer (Q Factor) Frequency: 20 Hz Gain: 15dB QVal: 2 Bandwidth: 1000 Hz + {0x26, 0x55, 0x03}, + {0x26, 0x56, 0x18}, + {0x26, 0x57, 0xfe}, + {0x26, 0x58, 0xf0}, + {0x26, 0x59, 0x01}, + {0x26, 0x5a, 0x57}, + {0x26, 0x5b, 0xef}, + {0x26, 0x5c, 0x07}, + {0x26, 0x5d, 0xfb}, + {0x26, 0x5e, 0x8f}, + {0x26, 0x5f, 0xf9}, + {0x26, 0x60, 0x0f}, + {0x26, 0x61, 0xfe}, + {0x26, 0x62, 0xa8}, + {0x26, 0x63, 0x11}, + {0x26, 0x64, 0xf8}, + {0x26, 0x65, 0x01}, + {0x26, 0x66, 0x57}, + {0x26, 0x67, 0x09}, + {0x26, 0x68, 0x08}, // Biquad - BQ2 Right - Filter: Equalizer (Q Factor) Frequency: 31.5 Hz Gain: 15dB QVal: 2 Bandwidth: 1000 Hz + {0x26, 0x69, 0x04}, + {0x26, 0x6a, 0xe0}, + {0x26, 0x6b, 0xba}, + {0x26, 0x6c, 0xf0}, + {0x26, 0x6d, 0x02}, + {0x26, 0x6e, 0x1e}, + {0x26, 0x6f, 0x67}, + {0x26, 0x70, 0x07}, + {0x26, 0x71, 0xf9}, + {0x26, 0x72, 0x03}, + {0x26, 0x73, 0x18}, + {0x26, 0x74, 0x0f}, + {0x26, 0x75, 0xfd}, + {0x26, 0x76, 0xe1}, + {0x26, 0x77, 0x99}, + {0x26, 0x78, 0xf8}, + {0x26, 0x79, 0x02}, + {0x26, 0x7a, 0x1c}, + {0x26, 0x7b, 0x2d}, + {0x26, 0x7c, 0x08}, // Biquad - BQ3 Right - Filter: Equalizer (Q Factor) Frequency: 50 Hz Gain: 15dB QVal: 1.5 Bandwidth: 1000 Hz + {0x26, 0x7d, 0x0a}, + {0x26, 0x7e, 0x51}, + {0x26, 0x7f, 0x4b}, + {0x27, 0x08, 0xf0}, + {0x27, 0x09, 0x04}, + {0x27, 0x0a, 0x7c}, + {0x27, 0x0b, 0x2f}, + {0x27, 0x0c, 0x07}, + {0x27, 0x0d, 0xf1}, + {0x27, 0x0e, 0x38}, + {0x27, 0x0f, 0x22}, + {0x27, 0x10, 0x0f}, + {0x27, 0x11, 0xfb}, + {0x27, 0x12, 0x83}, + {0x27, 0x13, 0xd1}, + {0x27, 0x14, 0xf8}, + {0x27, 0x15, 0x04}, + {0x27, 0x16, 0x76}, + {0x27, 0x17, 0x93}, + {0x27, 0x18, 0x08}, // Biquad - BQ4 Right - Filter: Equalizer (Q Factor) Frequency: 80 Hz Gain: 15dB QVal: 1.5 Bandwidth: 1000 Hz + {0x27, 0x19, 0x10}, + {0x27, 0x1a, 0x7f}, + {0x27, 0x1b, 0x4f}, + {0x27, 0x1c, 0xf0}, + {0x27, 0x1d, 0x07}, + {0x27, 0x1e, 0x31}, + {0x27, 0x1f, 0x45}, + {0x27, 0x20, 0x07}, + {0x27, 0x21, 0xe8}, + {0x27, 0x22, 0x5d}, + {0x27, 0x23, 0xc5}, + {0x27, 0x24, 0x0f}, + {0x27, 0x25, 0xf8}, + {0x27, 0x26, 0xce}, + {0x27, 0x27, 0xbb}, + {0x27, 0x28, 0xf8}, + {0x27, 0x29, 0x07}, + {0x27, 0x2a, 0x22}, + {0x27, 0x2b, 0xec}, + {0x27, 0x2c, 0x08}, // Biquad - BQ5 Right - Filter: Equalizer (Q Factor) Frequency: 125 Hz Gain: 15dB QVal: 1 Bandwidth: 1000 Hz + {0x27, 0x2d, 0x26}, + {0x27, 0x2e, 0x93}, + {0x27, 0x2f, 0x42}, + {0x27, 0x30, 0xf0}, + {0x27, 0x31, 0x10}, + {0x27, 0x32, 0xd2}, + {0x27, 0x33, 0xcc}, + {0x27, 0x34, 0x07}, + {0x27, 0x35, 0xc8}, + {0x27, 0x36, 0xbc}, + {0x27, 0x37, 0xe6}, + {0x27, 0x38, 0x0f}, + {0x27, 0x39, 0xef}, + {0x27, 0x3a, 0x2d}, + {0x27, 0x3b, 0x34}, + {0x27, 0x3c, 0xf8}, + {0x27, 0x3d, 0x10}, + {0x27, 0x3e, 0xaf}, + {0x27, 0x3f, 0xd9}, + {0x27, 0x40, 0x08}, // Biquad - BQ6 Right - Filter: Equalizer (Q Factor) Frequency: 200 Hz Gain: 15dB QVal: 1 Bandwidth: 1000 Hz + {0x27, 0x41, 0x3d}, + {0x27, 0x42, 0x91}, + {0x27, 0x43, 0xe2}, + {0x27, 0x44, 0xf0}, + {0x27, 0x45, 0x1a}, + {0x27, 0x46, 0xfb}, + {0x27, 0x47, 0x8a}, + {0x27, 0x48, 0x07}, + {0x27, 0x49, 0xa7}, + {0x27, 0x4a, 0xcb}, + {0x27, 0x4b, 0xd4}, + {0x27, 0x4c, 0x0f}, + {0x27, 0x4d, 0xe5}, + {0x27, 0x4e, 0x04}, + {0x27, 0x4f, 0x76}, + {0x27, 0x50, 0xf8}, + {0x27, 0x51, 0x1a}, + {0x27, 0x52, 0xa2}, + {0x27, 0x53, 0x4a}, + {0x27, 0x54, 0x08}, // Biquad - BQ7 Right - Filter: Equalizer (Q Factor) Frequency: 315 Hz Gain: 15dB QVal: 0.9 Bandwidth: 1000 Hz + {0x27, 0x55, 0x6b}, + {0x27, 0x56, 0x39}, + {0x27, 0x57, 0x6d}, + {0x27, 0x58, 0xf0}, + {0x27, 0x59, 0x2f}, + {0x27, 0x5a, 0x3e}, + {0x27, 0x5b, 0x6a}, + {0x27, 0x5c, 0x07}, + {0x27, 0x5d, 0x66}, + {0x27, 0x5e, 0x64}, + {0x27, 0x5f, 0x7a}, + {0x27, 0x60, 0x0f}, + {0x27, 0x61, 0xd0}, + {0x27, 0x62, 0xc1}, + {0x27, 0x63, 0x96}, + {0x27, 0x64, 0xf8}, + {0x27, 0x65, 0x2e}, + {0x27, 0x66, 0x62}, + {0x27, 0x67, 0x19}, + {0x27, 0x68, 0x08}, // Biquad - BQ8 Right - Filter: Equalizer (Q Factor) Frequency: 500 Hz Gain: 15dB QVal: 0.9 Bandwidth: 1000 Hz + {0x27, 0x69, 0xa9}, + {0x27, 0x6a, 0x12}, + {0x27, 0x6b, 0xaa}, + {0x27, 0x6c, 0xf0}, + {0x27, 0x6d, 0x4b}, + {0x27, 0x6e, 0x4a}, + {0x27, 0x6f, 0xa6}, + {0x27, 0x70, 0x07}, + {0x27, 0x71, 0x0d}, + {0x27, 0x72, 0xca}, + {0x27, 0x73, 0x16}, + {0x27, 0x74, 0x0f}, + {0x27, 0x75, 0xb4}, + {0x27, 0x76, 0xb5}, + {0x27, 0x77, 0x5a}, + {0x27, 0x78, 0xf8}, + {0x27, 0x79, 0x49}, + {0x27, 0x7a, 0x23}, + {0x27, 0x7b, 0x40}, + {0x27, 0x7c, 0x09}, // Biquad - BQ9 Right - Filter: Equalizer (Q Factor) Frequency: 800 Hz Gain: 15dB QVal: 0.8 Bandwidth: 1000 Hz + {0x27, 0x7d, 0x2c}, + {0x27, 0x7e, 0x0b}, + {0x27, 0x7f, 0x91}, + {0x28, 0x08, 0xf0}, + {0x28, 0x09, 0x87}, + {0x28, 0x0a, 0x3a}, + {0x28, 0x0b, 0xb6}, + {0x28, 0x0c, 0x06}, + {0x28, 0x0d, 0x52}, + {0x28, 0x0e, 0x29}, + {0x28, 0x0f, 0x39}, + {0x28, 0x10, 0x0f}, + {0x28, 0x11, 0x78}, + {0x28, 0x12, 0xc5}, + {0x28, 0x13, 0x4a}, + {0x28, 0x14, 0xf8}, + {0x28, 0x15, 0x81}, + {0x28, 0x16, 0xcb}, + {0x28, 0x17, 0x36}, + {0x28, 0x18, 0x09}, // Biquad - BQ10 Right - Filter: Equalizer (Q Factor) Frequency: 1250 Hz Gain: 15dB QVal: 0.8 Bandwidth: 1000 Hz + {0x28, 0x19, 0xcc}, + {0x28, 0x1a, 0x9c}, + {0x28, 0x1b, 0x46}, + {0x28, 0x1c, 0xf0}, + {0x28, 0x1d, 0xd4}, + {0x28, 0x1e, 0x48}, + {0x28, 0x1f, 0xf3}, + {0x28, 0x20, 0x05}, + {0x28, 0x21, 0x6c}, + {0x28, 0x22, 0x23}, + {0x28, 0x23, 0x67}, + {0x28, 0x24, 0x0f}, + {0x28, 0x25, 0x2b}, + {0x28, 0x26, 0xb7}, + {0x28, 0x27, 0x0d}, + {0x28, 0x28, 0xf8}, + {0x28, 0x29, 0xc7}, + {0x28, 0x2a, 0x40}, + {0x28, 0x2b, 0x52}, + {0x28, 0x2c, 0x0b}, // Biquad - BQ11 Right - Filter: Equalizer (Q Factor) Frequency: 2000 Hz Gain: 15dB QVal: 0.7 Bandwidth: 1000 Hz + {0x28, 0x2d, 0x29}, + {0x28, 0x2e, 0xa0}, + {0x28, 0x2f, 0x4f}, + {0x28, 0x30, 0xf1}, + {0x28, 0x31, 0x7e}, + {0x28, 0x32, 0x46}, + {0x28, 0x33, 0x3e}, + {0x28, 0x34, 0x03}, + {0x28, 0x35, 0x78}, + {0x28, 0x36, 0x25}, + {0x28, 0x37, 0x1f}, + {0x28, 0x38, 0x0e}, + {0x28, 0x39, 0x81}, + {0x28, 0x3a, 0xb9}, + {0x28, 0x3b, 0xc2}, + {0x28, 0x3c, 0xf9}, + {0x28, 0x3d, 0x5e}, + {0x28, 0x3e, 0x3a}, + {0x28, 0x3f, 0x92}, + {0x28, 0x40, 0x0c}, // Biquad - BQ12 Right - Filter: Equalizer (Q Factor) Frequency: 3150 Hz Gain: 15dB QVal: 0.7 Bandwidth: 1000 Hz + {0x28, 0x41, 0xbf}, + {0x28, 0x42, 0x67}, + {0x28, 0x43, 0xc6}, + {0x28, 0x44, 0xf2}, + {0x28, 0x45, 0x59}, + {0x28, 0x46, 0x5e}, + {0x28, 0x47, 0x71}, + {0x28, 0x48, 0x01}, + {0x28, 0x49, 0x32}, + {0x28, 0x4a, 0xd5}, + {0x28, 0x4b, 0x63}, + {0x28, 0x4c, 0x0d}, + {0x28, 0x4d, 0xa6}, + {0x28, 0x4e, 0xa1}, + {0x28, 0x4f, 0x8f}, + {0x28, 0x50, 0xfa}, + {0x28, 0x51, 0x0d}, + {0x28, 0x52, 0xc2}, + {0x28, 0x53, 0xd6}, + {0x28, 0x54, 0x0f}, // Biquad - BQ13 Right - Filter: Equalizer (Q Factor) Frequency: 5000 Hz Gain: 15dB QVal: 0.6 Bandwidth: 1000 Hz + {0x28, 0x55, 0xec}, + {0x28, 0x56, 0xe7}, + {0x28, 0x57, 0x4b}, + {0x28, 0x58, 0xf4}, + {0x28, 0x59, 0x18}, + {0x28, 0x5a, 0x76}, + {0x28, 0x5b, 0x1f}, + {0x28, 0x5c, 0xfc}, + {0x28, 0x5d, 0xa5}, + {0x28, 0x5e, 0x6e}, + {0x28, 0x5f, 0x86}, + {0x28, 0x60, 0x0b}, + {0x28, 0x61, 0xe7}, + {0x28, 0x62, 0x89}, + {0x28, 0x63, 0xe1}, + {0x28, 0x64, 0xfb}, + {0x28, 0x65, 0x6d}, + {0x28, 0x66, 0xaa}, + {0x28, 0x67, 0x2f}, + {0x28, 0x68, 0x13}, // Biquad - BQ14 Right - Filter: Equalizer (Q Factor) Frequency: 8000 Hz Gain: 15dB QVal: 0.6 Bandwidth: 1000 Hz + {0x28, 0x69, 0x3c}, + {0x28, 0x6a, 0x70}, + {0x28, 0x6b, 0x49}, + {0x28, 0x6c, 0xf6}, + {0x28, 0x6d, 0x5a}, + {0x28, 0x6e, 0x59}, + {0x28, 0x6f, 0x40}, + {0x28, 0x70, 0xf7}, + {0x28, 0x71, 0xe7}, + {0x28, 0x72, 0x44}, + {0x28, 0x73, 0xe6}, + {0x28, 0x74, 0x09}, + {0x28, 0x75, 0xa5}, + {0x28, 0x76, 0xa6}, + {0x28, 0x77, 0xc0}, + {0x28, 0x78, 0xfc}, + {0x28, 0x79, 0xdc}, + {0x28, 0x7a, 0x4a}, + {0x28, 0x7b, 0xd0}, + {0x28, 0x7c, 0x1a}, // Biquad - BQ15 Right - Filter: Equalizer (Q Factor) Frequency: 16000 Hz Gain: 15dB QVal: 0.5 Bandwidth: 1000 Hz + {0x28, 0x7d, 0xeb}, + {0x28, 0x7e, 0x86}, + {0x28, 0x7f, 0x5b}, + {0x29, 0x08, 0xfc}, + {0x29, 0x09, 0x17}, + {0x29, 0x0a, 0x9b}, + {0x29, 0x0b, 0xa8}, + {0x29, 0x0c, 0xec}, + {0x29, 0x0d, 0xe5}, + {0x29, 0x0e, 0x42}, + {0x29, 0x0f, 0x56}, + {0x29, 0x10, 0x03}, + {0x29, 0x11, 0xe8}, + {0x29, 0x12, 0x64}, + {0x29, 0x13, 0x58}, + {0x29, 0x14, 0x00}, + {0x29, 0x15, 0x2f}, + {0x29, 0x16, 0x37}, + {0x29, 0x17, 0x4f}, + }; + + static const reg_sequence_eq *tas5805m_eq_registers_left[] = { + tas5805m_eq_registers_left_mf, + tas5805m_eq_registers_left_me, + tas5805m_eq_registers_left_md, + tas5805m_eq_registers_left_mc, + tas5805m_eq_registers_left_mb, + tas5805m_eq_registers_left_ma, + tas5805m_eq_registers_left_m9, + tas5805m_eq_registers_left_m8, + tas5805m_eq_registers_left_m7, + tas5805m_eq_registers_left_m6, + tas5805m_eq_registers_left_m5, + tas5805m_eq_registers_left_m4, + tas5805m_eq_registers_left_m3, + tas5805m_eq_registers_left_m2, + tas5805m_eq_registers_left_m1, + tas5805m_eq_registers_left_0, + tas5805m_eq_registers_left_p1, + tas5805m_eq_registers_left_p2, + tas5805m_eq_registers_left_p3, + tas5805m_eq_registers_left_p4, + tas5805m_eq_registers_left_p5, + tas5805m_eq_registers_left_p6, + tas5805m_eq_registers_left_p7, + tas5805m_eq_registers_left_p8, + tas5805m_eq_registers_left_p9, + tas5805m_eq_registers_left_pa, + tas5805m_eq_registers_left_pb, + tas5805m_eq_registers_left_pc, + tas5805m_eq_registers_left_pd, + tas5805m_eq_registers_left_pe, + tas5805m_eq_registers_left_pf, + }; + + static const reg_sequence_eq *tas5805m_eq_registers_right[] = { + tas5805m_eq_registers_right_mf, + tas5805m_eq_registers_right_me, + tas5805m_eq_registers_right_md, + tas5805m_eq_registers_right_mc, + tas5805m_eq_registers_right_mb, + tas5805m_eq_registers_right_ma, + tas5805m_eq_registers_right_m9, + tas5805m_eq_registers_right_m8, + tas5805m_eq_registers_right_m7, + tas5805m_eq_registers_right_m6, + tas5805m_eq_registers_right_m5, + tas5805m_eq_registers_right_m4, + tas5805m_eq_registers_right_m3, + tas5805m_eq_registers_right_m2, + tas5805m_eq_registers_right_m1, + tas5805m_eq_registers_right_0, + tas5805m_eq_registers_right_p1, + tas5805m_eq_registers_right_p2, + tas5805m_eq_registers_right_p3, + tas5805m_eq_registers_right_p4, + tas5805m_eq_registers_right_p5, + tas5805m_eq_registers_right_p6, + tas5805m_eq_registers_right_p7, + tas5805m_eq_registers_right_p8, + tas5805m_eq_registers_right_p9, + tas5805m_eq_registers_right_pa, + tas5805m_eq_registers_right_pb, + tas5805m_eq_registers_right_pc, + tas5805m_eq_registers_right_pd, + tas5805m_eq_registers_right_pe, + tas5805m_eq_registers_right_pf, + }; + +#ifdef __cplusplus +} +#endif + +#endif /* CONFIG_DAC_TAS5805M_EQ_SUPPORT */ \ No newline at end of file diff --git a/components/custom_board/tas5805m/include/tas5805m_eq_profiles.h b/components/custom_board/tas5805m/include/tas5805m_eq_profiles.h new file mode 100644 index 00000000..1eb7b119 --- /dev/null +++ b/components/custom_board/tas5805m/include/tas5805m_eq_profiles.h @@ -0,0 +1,2718 @@ +#pragma once + +#if defined(CONFIG_DAC_TAS5805M_EQ_SUPPORT) + +#include "tas5805m_eq.h" + +#ifdef __cplusplus +extern "C" +{ +#endif + + // 2 bands use to create 4-order filter, 1 more band to compensate the gain for HF filter + // 1: Chebyshev 2nd-order low-pass or high-pass filter + // 2: Chebyshev 2nd-order low-pass or high-pass filter + // 3: High Shelf + +#define TAS5805M_EQ_PROFILE_BANDS 3 +#define TAS5805M_EQ_PROFILE_REG_PER_STEP (TAS5805M_EQ_PROFILE_BANDS * TAS5805M_EQ_KOEF_PER_BAND * TAS5805M_EQ_REG_PER_KOEF) + + static const reg_sequence_eq tas5805m_eq_registers_left_flat[TAS5805M_EQ_PROFILE_REG_PER_STEP] = { + {0x24, 0x18, 0x08}, // Biquad - BQ1 Left - Filter: All Pass Frequency: 1000 Hz QVal: 0.71 Bandwidth: 1000 Hz + {0x24, 0x19, 0x00}, + {0x24, 0x1a, 0x00}, + {0x24, 0x1b, 0x00}, + {0x24, 0x1c, 0x00}, + {0x24, 0x1d, 0x00}, + {0x24, 0x1e, 0x00}, + {0x24, 0x1f, 0x00}, + {0x24, 0x20, 0x00}, + {0x24, 0x21, 0x00}, + {0x24, 0x22, 0x00}, + {0x24, 0x23, 0x00}, + {0x24, 0x24, 0x00}, + {0x24, 0x25, 0x00}, + {0x24, 0x26, 0x00}, + {0x24, 0x27, 0x00}, + {0x24, 0x28, 0x00}, + {0x24, 0x29, 0x00}, + {0x24, 0x2a, 0x00}, + {0x24, 0x2b, 0x00}, + {0x24, 0x2c, 0x08}, // Biquad - BQ2 Left - Filter: All Pass Frequency: 1000 Hz QVal: 0.71 Bandwidth: 1000 Hz + {0x24, 0x2d, 0x00}, + {0x24, 0x2e, 0x00}, + {0x24, 0x2f, 0x00}, + {0x24, 0x30, 0x00}, + {0x24, 0x31, 0x00}, + {0x24, 0x32, 0x00}, + {0x24, 0x33, 0x00}, + {0x24, 0x34, 0x00}, + {0x24, 0x35, 0x00}, + {0x24, 0x36, 0x00}, + {0x24, 0x37, 0x00}, + {0x24, 0x38, 0x00}, + {0x24, 0x39, 0x00}, + {0x24, 0x3a, 0x00}, + {0x24, 0x3b, 0x00}, + {0x24, 0x3c, 0x00}, + {0x24, 0x3d, 0x00}, + {0x24, 0x3e, 0x00}, + {0x24, 0x3f, 0x00}, + {0x24, 0x40, 0x08}, // Biquad - BQ3 Left - Filter: All Pass Frequency: 1000 Hz QVal: 0.71 Bandwidth: 1000 Hz + {0x24, 0x41, 0x00}, + {0x24, 0x42, 0x00}, + {0x24, 0x43, 0x00}, + {0x24, 0x44, 0x00}, + {0x24, 0x45, 0x00}, + {0x24, 0x46, 0x00}, + {0x24, 0x47, 0x00}, + {0x24, 0x48, 0x00}, + {0x24, 0x49, 0x00}, + {0x24, 0x4a, 0x00}, + {0x24, 0x4b, 0x00}, + {0x24, 0x4c, 0x00}, + {0x24, 0x4d, 0x00}, + {0x24, 0x4e, 0x00}, + {0x24, 0x4f, 0x00}, + {0x24, 0x50, 0x00}, + {0x24, 0x51, 0x00}, + {0x24, 0x52, 0x00}, + {0x24, 0x53, 0x00}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_left_lf_60[TAS5805M_EQ_PROFILE_REG_PER_STEP] = { + {0x24, 0x18, 0x00}, // Biquad - BQ1 Left - Filter: Low Pass-Chebyshev Frequency: 60 Hz QVal: 0.71 Bandwidth: 1000 Hz + {0x24, 0x19, 0x00}, + {0x24, 0x1a, 0x02}, + {0x24, 0x1b, 0xe3}, + {0x24, 0x1c, 0x00}, + {0x24, 0x1d, 0x00}, + {0x24, 0x1e, 0x05}, + {0x24, 0x1f, 0xc5}, + {0x24, 0x20, 0x00}, + {0x24, 0x21, 0x00}, + {0x24, 0x22, 0x02}, + {0x24, 0x23, 0xe3}, + {0x24, 0x24, 0x0f}, + {0x24, 0x25, 0xf4}, + {0x24, 0x26, 0x84}, + {0x24, 0x27, 0xcd}, + {0x24, 0x28, 0xf8}, + {0x24, 0x29, 0x0b}, + {0x24, 0x2a, 0x6e}, + {0x24, 0x2b, 0xfa}, + {0x24, 0x2c, 0x00}, // Biquad - BQ2 Left - Filter: Low Pass-Chebyshev Frequency: 60 Hz QVal: 0.71 Bandwidth: 1000 Hz + {0x24, 0x2d, 0x00}, + {0x24, 0x2e, 0x02}, + {0x24, 0x2f, 0xe3}, + {0x24, 0x30, 0x00}, + {0x24, 0x31, 0x00}, + {0x24, 0x32, 0x05}, + {0x24, 0x33, 0xc5}, + {0x24, 0x34, 0x00}, + {0x24, 0x35, 0x00}, + {0x24, 0x36, 0x02}, + {0x24, 0x37, 0xe3}, + {0x24, 0x38, 0x0f}, + {0x24, 0x39, 0xf4}, + {0x24, 0x3a, 0x84}, + {0x24, 0x3b, 0xcd}, + {0x24, 0x3c, 0xf8}, + {0x24, 0x3d, 0x0b}, + {0x24, 0x3e, 0x6e}, + {0x24, 0x3f, 0xfa}, + {0x24, 0x40, 0x08}, // Biquad - BQ3 Left - Filter: All Pass Frequency: 1000 Hz QVal: 0.71 Bandwidth: 1000 Hz + {0x24, 0x41, 0x00}, + {0x24, 0x42, 0x00}, + {0x24, 0x43, 0x00}, + {0x24, 0x44, 0x00}, + {0x24, 0x45, 0x00}, + {0x24, 0x46, 0x00}, + {0x24, 0x47, 0x00}, + {0x24, 0x48, 0x00}, + {0x24, 0x49, 0x00}, + {0x24, 0x4a, 0x00}, + {0x24, 0x4b, 0x00}, + {0x24, 0x4c, 0x00}, + {0x24, 0x4d, 0x00}, + {0x24, 0x4e, 0x00}, + {0x24, 0x4f, 0x00}, + {0x24, 0x50, 0x00}, + {0x24, 0x51, 0x00}, + {0x24, 0x52, 0x00}, + {0x24, 0x53, 0x00}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_left_lf_70[TAS5805M_EQ_PROFILE_REG_PER_STEP] = { + {0x24, 0x18, 0x00}, // Biquad - BQ1 Left - Filter: Low Pass-Chebyshev Frequency: 70 Hz QVal: 0.71 Bandwidth: 1000 Hz + {0x24, 0x19, 0x00}, + {0x24, 0x1a, 0x03}, + {0x24, 0x1b, 0xed}, + {0x24, 0x1c, 0x00}, + {0x24, 0x1d, 0x00}, + {0x24, 0x1e, 0x07}, + {0x24, 0x1f, 0xda}, + {0x24, 0x20, 0x00}, + {0x24, 0x21, 0x00}, + {0x24, 0x22, 0x03}, + {0x24, 0x23, 0xed}, + {0x24, 0x24, 0x0f}, + {0x24, 0x25, 0xf2}, + {0x24, 0x26, 0x9a}, + {0x24, 0x27, 0x28}, + {0x24, 0x28, 0xf8}, + {0x24, 0x29, 0x0d}, + {0x24, 0x2a, 0x55}, + {0x24, 0x2b, 0x36}, + {0x24, 0x2c, 0x00}, // Biquad - BQ2 Left - Filter: Low Pass-Chebyshev Frequency: 70 Hz QVal: 0.71 Bandwidth: 1000 Hz + {0x24, 0x2d, 0x00}, + {0x24, 0x2e, 0x03}, + {0x24, 0x2f, 0xed}, + {0x24, 0x30, 0x00}, + {0x24, 0x31, 0x00}, + {0x24, 0x32, 0x07}, + {0x24, 0x33, 0xda}, + {0x24, 0x34, 0x00}, + {0x24, 0x35, 0x00}, + {0x24, 0x36, 0x03}, + {0x24, 0x37, 0xed}, + {0x24, 0x38, 0x0f}, + {0x24, 0x39, 0xf2}, + {0x24, 0x3a, 0x9a}, + {0x24, 0x3b, 0x28}, + {0x24, 0x3c, 0xf8}, + {0x24, 0x3d, 0x0d}, + {0x24, 0x3e, 0x55}, + {0x24, 0x3f, 0x36}, + {0x24, 0x40, 0x08}, // Biquad - BQ3 Left - Filter: All Pass Frequency: 1000 Hz QVal: 0.71 Bandwidth: 1000 Hz + {0x24, 0x41, 0x00}, + {0x24, 0x42, 0x00}, + {0x24, 0x43, 0x00}, + {0x24, 0x44, 0x00}, + {0x24, 0x45, 0x00}, + {0x24, 0x46, 0x00}, + {0x24, 0x47, 0x00}, + {0x24, 0x48, 0x00}, + {0x24, 0x49, 0x00}, + {0x24, 0x4a, 0x00}, + {0x24, 0x4b, 0x00}, + {0x24, 0x4c, 0x00}, + {0x24, 0x4d, 0x00}, + {0x24, 0x4e, 0x00}, + {0x24, 0x4f, 0x00}, + {0x24, 0x50, 0x00}, + {0x24, 0x51, 0x00}, + {0x24, 0x52, 0x00}, + {0x24, 0x53, 0x00}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_left_lf_80[TAS5805M_EQ_PROFILE_REG_PER_STEP] = { + {0x24, 0x18, 0x00}, // Biquad - BQ1 Left - Filter: Low Pass-Chebyshev Frequency: 80 Hz QVal: 0.71 Bandwidth: 1000 Hz + {0x24, 0x19, 0x00}, + {0x24, 0x1a, 0x05}, + {0x24, 0x1b, 0x20}, + {0x24, 0x1c, 0x00}, + {0x24, 0x1d, 0x00}, + {0x24, 0x1e, 0x0a}, + {0x24, 0x1f, 0x40}, + {0x24, 0x20, 0x00}, + {0x24, 0x21, 0x00}, + {0x24, 0x22, 0x05}, + {0x24, 0x23, 0x20}, + {0x24, 0x24, 0x0f}, + {0x24, 0x25, 0xf0}, + {0x24, 0x26, 0xaf}, + {0x24, 0x27, 0x4c}, + {0x24, 0x28, 0xf8}, + {0x24, 0x29, 0x0f}, + {0x24, 0x2a, 0x3a}, + {0x24, 0x2b, 0xfe}, + {0x24, 0x2c, 0x00}, // Biquad - BQ2 Left - Filter: Low Pass-Chebyshev Frequency: 80 Hz QVal: 0.71 Bandwidth: 1000 Hz + {0x24, 0x2d, 0x00}, + {0x24, 0x2e, 0x05}, + {0x24, 0x2f, 0x20}, + {0x24, 0x30, 0x00}, + {0x24, 0x31, 0x00}, + {0x24, 0x32, 0x0a}, + {0x24, 0x33, 0x40}, + {0x24, 0x34, 0x00}, + {0x24, 0x35, 0x00}, + {0x24, 0x36, 0x05}, + {0x24, 0x37, 0x20}, + {0x24, 0x38, 0x0f}, + {0x24, 0x39, 0xf0}, + {0x24, 0x3a, 0xaf}, + {0x24, 0x3b, 0x4c}, + {0x24, 0x3c, 0xf8}, + {0x24, 0x3d, 0x0f}, + {0x24, 0x3e, 0x3a}, + {0x24, 0x3f, 0xfe}, + {0x24, 0x40, 0x08}, // Biquad - BQ3 Left - Filter: All Pass Frequency: 1000 Hz QVal: 0.71 Bandwidth: 1000 Hz + {0x24, 0x41, 0x00}, + {0x24, 0x42, 0x00}, + {0x24, 0x43, 0x00}, + {0x24, 0x44, 0x00}, + {0x24, 0x45, 0x00}, + {0x24, 0x46, 0x00}, + {0x24, 0x47, 0x00}, + {0x24, 0x48, 0x00}, + {0x24, 0x49, 0x00}, + {0x24, 0x4a, 0x00}, + {0x24, 0x4b, 0x00}, + {0x24, 0x4c, 0x00}, + {0x24, 0x4d, 0x00}, + {0x24, 0x4e, 0x00}, + {0x24, 0x4f, 0x00}, + {0x24, 0x50, 0x00}, + {0x24, 0x51, 0x00}, + {0x24, 0x52, 0x00}, + {0x24, 0x53, 0x00}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_left_lf_90[TAS5805M_EQ_PROFILE_REG_PER_STEP] = { + {0x24, 0x18, 0x00}, // Biquad - BQ1 Left - Filter: Low Pass-Chebyshev Frequency: 90 Hz QVal: 0.71 Bandwidth: 1000 Hz + {0x24, 0x19, 0x00}, + {0x24, 0x1a, 0x06}, + {0x24, 0x1b, 0x7c}, + {0x24, 0x1c, 0x00}, + {0x24, 0x1d, 0x00}, + {0x24, 0x1e, 0x0c}, + {0x24, 0x1f, 0xf7}, + {0x24, 0x20, 0x00}, + {0x24, 0x21, 0x00}, + {0x24, 0x22, 0x06}, + {0x24, 0x23, 0x7c}, + {0x24, 0x24, 0x0f}, + {0x24, 0x25, 0xee}, + {0x24, 0x26, 0xc4}, + {0x24, 0x27, 0x37}, + {0x24, 0x28, 0xf8}, + {0x24, 0x29, 0x11}, + {0x24, 0x2a, 0x20}, + {0x24, 0x2b, 0x52}, + {0x24, 0x2c, 0x00}, // Biquad - BQ2 Left - Filter: Low Pass-Chebyshev Frequency: 90 Hz QVal: 0.71 Bandwidth: 1000 Hz + {0x24, 0x2d, 0x00}, + {0x24, 0x2e, 0x06}, + {0x24, 0x2f, 0x7c}, + {0x24, 0x30, 0x00}, + {0x24, 0x31, 0x00}, + {0x24, 0x32, 0x0c}, + {0x24, 0x33, 0xf7}, + {0x24, 0x34, 0x00}, + {0x24, 0x35, 0x00}, + {0x24, 0x36, 0x06}, + {0x24, 0x37, 0x7c}, + {0x24, 0x38, 0x0f}, + {0x24, 0x39, 0xee}, + {0x24, 0x3a, 0xc4}, + {0x24, 0x3b, 0x37}, + {0x24, 0x3c, 0xf8}, + {0x24, 0x3d, 0x11}, + {0x24, 0x3e, 0x20}, + {0x24, 0x3f, 0x52}, + {0x24, 0x40, 0x08}, // Biquad - BQ3 Left - Filter: All Pass Frequency: 1000 Hz QVal: 0.71 Bandwidth: 1000 Hz + {0x24, 0x41, 0x00}, + {0x24, 0x42, 0x00}, + {0x24, 0x43, 0x00}, + {0x24, 0x44, 0x00}, + {0x24, 0x45, 0x00}, + {0x24, 0x46, 0x00}, + {0x24, 0x47, 0x00}, + {0x24, 0x48, 0x00}, + {0x24, 0x49, 0x00}, + {0x24, 0x4a, 0x00}, + {0x24, 0x4b, 0x00}, + {0x24, 0x4c, 0x00}, + {0x24, 0x4d, 0x00}, + {0x24, 0x4e, 0x00}, + {0x24, 0x4f, 0x00}, + {0x24, 0x50, 0x00}, + {0x24, 0x51, 0x00}, + {0x24, 0x52, 0x00}, + {0x24, 0x53, 0x00}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_left_lf_100[TAS5805M_EQ_PROFILE_REG_PER_STEP] = { + {0x24, 0x18, 0x00}, // Biquad - BQ1 Left - Filter: Low Pass-Chebyshev Frequency: 100 Hz QVal: 0.71 Bandwidth: 1000 Hz + {0x24, 0x19, 0x00}, + {0x24, 0x1a, 0x08}, + {0x24, 0x1b, 0x00}, + {0x24, 0x1c, 0x00}, + {0x24, 0x1d, 0x00}, + {0x24, 0x1e, 0x10}, + {0x24, 0x1f, 0x00}, + {0x24, 0x20, 0x00}, + {0x24, 0x21, 0x00}, + {0x24, 0x22, 0x08}, + {0x24, 0x23, 0x00}, + {0x24, 0x24, 0x0f}, + {0x24, 0x25, 0xec}, + {0x24, 0x26, 0xd8}, + {0x24, 0x27, 0xea}, + {0x24, 0x28, 0xf8}, + {0x24, 0x29, 0x13}, + {0x24, 0x2a, 0x05}, + {0x24, 0x2b, 0x31}, + {0x24, 0x2c, 0x00}, // Biquad - BQ2 Left - Filter: Low Pass-Chebyshev Frequency: 100 Hz QVal: 0.71 Bandwidth: 1000 Hz + {0x24, 0x2d, 0x00}, + {0x24, 0x2e, 0x08}, + {0x24, 0x2f, 0x00}, + {0x24, 0x30, 0x00}, + {0x24, 0x31, 0x00}, + {0x24, 0x32, 0x10}, + {0x24, 0x33, 0x00}, + {0x24, 0x34, 0x00}, + {0x24, 0x35, 0x00}, + {0x24, 0x36, 0x08}, + {0x24, 0x37, 0x00}, + {0x24, 0x38, 0x0f}, + {0x24, 0x39, 0xec}, + {0x24, 0x3a, 0xd8}, + {0x24, 0x3b, 0xea}, + {0x24, 0x3c, 0xf8}, + {0x24, 0x3d, 0x13}, + {0x24, 0x3e, 0x05}, + {0x24, 0x3f, 0x31}, + {0x24, 0x40, 0x08}, // Biquad - BQ3 Left - Filter: All Pass Frequency: 1000 Hz QVal: 0.71 Bandwidth: 1000 Hz + {0x24, 0x41, 0x00}, + {0x24, 0x42, 0x00}, + {0x24, 0x43, 0x00}, + {0x24, 0x44, 0x00}, + {0x24, 0x45, 0x00}, + {0x24, 0x46, 0x00}, + {0x24, 0x47, 0x00}, + {0x24, 0x48, 0x00}, + {0x24, 0x49, 0x00}, + {0x24, 0x4a, 0x00}, + {0x24, 0x4b, 0x00}, + {0x24, 0x4c, 0x00}, + {0x24, 0x4d, 0x00}, + {0x24, 0x4e, 0x00}, + {0x24, 0x4f, 0x00}, + {0x24, 0x50, 0x00}, + {0x24, 0x51, 0x00}, + {0x24, 0x52, 0x00}, + {0x24, 0x53, 0x00}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_left_lf_110[TAS5805M_EQ_PROFILE_REG_PER_STEP] = { + {0x24, 0x18, 0x00}, // Biquad - BQ1 Left - Filter: Low Pass-Chebyshev Frequency: 110 Hz QVal: 0.71 Bandwidth: 1000 Hz + {0x24, 0x19, 0x00}, + {0x24, 0x1a, 0x09}, + {0x24, 0x1b, 0xad}, + {0x24, 0x1c, 0x00}, + {0x24, 0x1d, 0x00}, + {0x24, 0x1e, 0x13}, + {0x24, 0x1f, 0x59}, + {0x24, 0x20, 0x00}, + {0x24, 0x21, 0x00}, + {0x24, 0x22, 0x09}, + {0x24, 0x23, 0xad}, + {0x24, 0x24, 0x0f}, + {0x24, 0x25, 0xea}, + {0x24, 0x26, 0xed}, + {0x24, 0x27, 0x66}, + {0x24, 0x28, 0xf8}, + {0x24, 0x29, 0x14}, + {0x24, 0x2a, 0xe9}, + {0x24, 0x2b, 0x9c}, + {0x24, 0x2c, 0x00}, // Biquad - BQ2 Left - Filter: Low Pass-Chebyshev Frequency: 110 Hz QVal: 0.71 Bandwidth: 1000 Hz + {0x24, 0x2d, 0x00}, + {0x24, 0x2e, 0x09}, + {0x24, 0x2f, 0xad}, + {0x24, 0x30, 0x00}, + {0x24, 0x31, 0x00}, + {0x24, 0x32, 0x13}, + {0x24, 0x33, 0x59}, + {0x24, 0x34, 0x00}, + {0x24, 0x35, 0x00}, + {0x24, 0x36, 0x09}, + {0x24, 0x37, 0xad}, + {0x24, 0x38, 0x0f}, + {0x24, 0x39, 0xea}, + {0x24, 0x3a, 0xed}, + {0x24, 0x3b, 0x66}, + {0x24, 0x3c, 0xf8}, + {0x24, 0x3d, 0x14}, + {0x24, 0x3e, 0xe9}, + {0x24, 0x3f, 0x9c}, + {0x24, 0x40, 0x08}, // Biquad - BQ3 Left - Filter: All Pass Frequency: 1000 Hz QVal: 0.71 Bandwidth: 1000 Hz + {0x24, 0x41, 0x00}, + {0x24, 0x42, 0x00}, + {0x24, 0x43, 0x00}, + {0x24, 0x44, 0x00}, + {0x24, 0x45, 0x00}, + {0x24, 0x46, 0x00}, + {0x24, 0x47, 0x00}, + {0x24, 0x48, 0x00}, + {0x24, 0x49, 0x00}, + {0x24, 0x4a, 0x00}, + {0x24, 0x4b, 0x00}, + {0x24, 0x4c, 0x00}, + {0x24, 0x4d, 0x00}, + {0x24, 0x4e, 0x00}, + {0x24, 0x4f, 0x00}, + {0x24, 0x50, 0x00}, + {0x24, 0x51, 0x00}, + {0x24, 0x52, 0x00}, + {0x24, 0x53, 0x00}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_left_lf_120[TAS5805M_EQ_PROFILE_REG_PER_STEP] = { + {0x24, 0x18, 0x00}, // Biquad - BQ1 Left - Filter: Low Pass-Chebyshev Frequency: 120 Hz QVal: 0.71 Bandwidth: 1000 Hz + {0x24, 0x19, 0x00}, + {0x24, 0x1a, 0x0b}, + {0x24, 0x1b, 0x82}, + {0x24, 0x1c, 0x00}, + {0x24, 0x1d, 0x00}, + {0x24, 0x1e, 0x17}, + {0x24, 0x1f, 0x04}, + {0x24, 0x20, 0x00}, + {0x24, 0x21, 0x00}, + {0x24, 0x22, 0x0b}, + {0x24, 0x23, 0x82}, + {0x24, 0x24, 0x0f}, + {0x24, 0x25, 0xe9}, + {0x24, 0x26, 0x01}, + {0x24, 0x27, 0xaa}, + {0x24, 0x28, 0xf8}, + {0x24, 0x29, 0x16}, + {0x24, 0x2a, 0xcd}, + {0x24, 0x2b, 0x93}, + {0x24, 0x2c, 0x00}, // Biquad - BQ2 Left - Filter: Low Pass-Chebyshev Frequency: 120 Hz QVal: 0.71 Bandwidth: 1000 Hz + {0x24, 0x2d, 0x00}, + {0x24, 0x2e, 0x0b}, + {0x24, 0x2f, 0x82}, + {0x24, 0x30, 0x00}, + {0x24, 0x31, 0x00}, + {0x24, 0x32, 0x17}, + {0x24, 0x33, 0x04}, + {0x24, 0x34, 0x00}, + {0x24, 0x35, 0x00}, + {0x24, 0x36, 0x0b}, + {0x24, 0x37, 0x82}, + {0x24, 0x38, 0x0f}, + {0x24, 0x39, 0xe9}, + {0x24, 0x3a, 0x01}, + {0x24, 0x3b, 0xaa}, + {0x24, 0x3c, 0xf8}, + {0x24, 0x3d, 0x16}, + {0x24, 0x3e, 0xcd}, + {0x24, 0x3f, 0x93}, + {0x24, 0x40, 0x08}, // Biquad - BQ3 Left - Filter: All Pass Frequency: 1000 Hz QVal: 0.71 Bandwidth: 1000 Hz + {0x24, 0x41, 0x00}, + {0x24, 0x42, 0x00}, + {0x24, 0x43, 0x00}, + {0x24, 0x44, 0x00}, + {0x24, 0x45, 0x00}, + {0x24, 0x46, 0x00}, + {0x24, 0x47, 0x00}, + {0x24, 0x48, 0x00}, + {0x24, 0x49, 0x00}, + {0x24, 0x4a, 0x00}, + {0x24, 0x4b, 0x00}, + {0x24, 0x4c, 0x00}, + {0x24, 0x4d, 0x00}, + {0x24, 0x4e, 0x00}, + {0x24, 0x4f, 0x00}, + {0x24, 0x50, 0x00}, + {0x24, 0x51, 0x00}, + {0x24, 0x52, 0x00}, + {0x24, 0x53, 0x00}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_left_lf_130[TAS5805M_EQ_PROFILE_REG_PER_STEP] = { + {0x24, 0x18, 0x00}, // Biquad - BQ1 Left - Filter: Low Pass-Chebyshev Frequency: 130 Hz QVal: 0.71 Bandwidth: 1000 Hz + {0x24, 0x19, 0x00}, + {0x24, 0x1a, 0x0d}, + {0x24, 0x1b, 0x80}, + {0x24, 0x1c, 0x00}, + {0x24, 0x1d, 0x00}, + {0x24, 0x1e, 0x1b}, + {0x24, 0x1f, 0x00}, + {0x24, 0x20, 0x00}, + {0x24, 0x21, 0x00}, + {0x24, 0x22, 0x0d}, + {0x24, 0x23, 0x80}, + {0x24, 0x24, 0x0f}, + {0x24, 0x25, 0xe7}, + {0x24, 0x26, 0x15}, + {0x24, 0x27, 0xb6}, + {0x24, 0x28, 0xf8}, + {0x24, 0x29, 0x18}, + {0x24, 0x2a, 0xb1}, + {0x24, 0x2b, 0x16}, + {0x24, 0x2c, 0x00}, // Biquad - BQ2 Left - Filter: Low Pass-Chebyshev Frequency: 130 Hz QVal: 0.71 Bandwidth: 1000 Hz + {0x24, 0x2d, 0x00}, + {0x24, 0x2e, 0x0d}, + {0x24, 0x2f, 0x80}, + {0x24, 0x30, 0x00}, + {0x24, 0x31, 0x00}, + {0x24, 0x32, 0x1b}, + {0x24, 0x33, 0x00}, + {0x24, 0x34, 0x00}, + {0x24, 0x35, 0x00}, + {0x24, 0x36, 0x0d}, + {0x24, 0x37, 0x80}, + {0x24, 0x38, 0x0f}, + {0x24, 0x39, 0xe7}, + {0x24, 0x3a, 0x15}, + {0x24, 0x3b, 0xb6}, + {0x24, 0x3c, 0xf8}, + {0x24, 0x3d, 0x18}, + {0x24, 0x3e, 0xb1}, + {0x24, 0x3f, 0x16}, + {0x24, 0x40, 0x08}, // Biquad - BQ3 Left - Filter: All Pass Frequency: 1000 Hz QVal: 0.71 Bandwidth: 1000 Hz + {0x24, 0x41, 0x00}, + {0x24, 0x42, 0x00}, + {0x24, 0x43, 0x00}, + {0x24, 0x44, 0x00}, + {0x24, 0x45, 0x00}, + {0x24, 0x46, 0x00}, + {0x24, 0x47, 0x00}, + {0x24, 0x48, 0x00}, + {0x24, 0x49, 0x00}, + {0x24, 0x4a, 0x00}, + {0x24, 0x4b, 0x00}, + {0x24, 0x4c, 0x00}, + {0x24, 0x4d, 0x00}, + {0x24, 0x4e, 0x00}, + {0x24, 0x4f, 0x00}, + {0x24, 0x50, 0x00}, + {0x24, 0x51, 0x00}, + {0x24, 0x52, 0x00}, + {0x24, 0x53, 0x00}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_left_lf_140[TAS5805M_EQ_PROFILE_REG_PER_STEP] = { + {0x24, 0x18, 0x00}, // Biquad - BQ1 Left - Filter: Low Pass-Chebyshev Frequency: 140 Hz QVal: 0.71 Bandwidth: 1000 Hz + {0x24, 0x19, 0x00}, + {0x24, 0x1a, 0x0f}, + {0x24, 0x1b, 0xa6}, + {0x24, 0x1c, 0x00}, + {0x24, 0x1d, 0x00}, + {0x24, 0x1e, 0x1f}, + {0x24, 0x1f, 0x4d}, + {0x24, 0x20, 0x00}, + {0x24, 0x21, 0x00}, + {0x24, 0x22, 0x0f}, + {0x24, 0x23, 0xa6}, + {0x24, 0x24, 0x0f}, + {0x24, 0x25, 0xe5}, + {0x24, 0x26, 0x29}, + {0x24, 0x27, 0x8b}, + {0x24, 0x28, 0xf8}, + {0x24, 0x29, 0x1a}, + {0x24, 0x2a, 0x94}, + {0x24, 0x2b, 0x26}, + {0x24, 0x2c, 0x00}, // Biquad - BQ2 Left - Filter: Low Pass-Chebyshev Frequency: 140 Hz QVal: 0.71 Bandwidth: 1000 Hz + {0x24, 0x2d, 0x00}, + {0x24, 0x2e, 0x0f}, + {0x24, 0x2f, 0xa6}, + {0x24, 0x30, 0x00}, + {0x24, 0x31, 0x00}, + {0x24, 0x32, 0x1f}, + {0x24, 0x33, 0x4d}, + {0x24, 0x34, 0x00}, + {0x24, 0x35, 0x00}, + {0x24, 0x36, 0x0f}, + {0x24, 0x37, 0xa6}, + {0x24, 0x38, 0x0f}, + {0x24, 0x39, 0xe5}, + {0x24, 0x3a, 0x29}, + {0x24, 0x3b, 0x8b}, + {0x24, 0x3c, 0xf8}, + {0x24, 0x3d, 0x1a}, + {0x24, 0x3e, 0x94}, + {0x24, 0x3f, 0x26}, + {0x24, 0x40, 0x08}, // Biquad - BQ3 Left - Filter: All Pass Frequency: 1000 Hz QVal: 0.71 Bandwidth: 1000 Hz + {0x24, 0x41, 0x00}, + {0x24, 0x42, 0x00}, + {0x24, 0x43, 0x00}, + {0x24, 0x44, 0x00}, + {0x24, 0x45, 0x00}, + {0x24, 0x46, 0x00}, + {0x24, 0x47, 0x00}, + {0x24, 0x48, 0x00}, + {0x24, 0x49, 0x00}, + {0x24, 0x4a, 0x00}, + {0x24, 0x4b, 0x00}, + {0x24, 0x4c, 0x00}, + {0x24, 0x4d, 0x00}, + {0x24, 0x4e, 0x00}, + {0x24, 0x4f, 0x00}, + {0x24, 0x50, 0x00}, + {0x24, 0x51, 0x00}, + {0x24, 0x52, 0x00}, + {0x24, 0x53, 0x00}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_left_lf_150[TAS5805M_EQ_PROFILE_REG_PER_STEP] = { + {0x24, 0x18, 0x00}, // Biquad - BQ1 Left - Filter: Low Pass-Chebyshev Frequency: 150 Hz QVal: 0.71 Bandwidth: 1000 Hz + {0x24, 0x19, 0x00}, + {0x24, 0x1a, 0x11}, + {0x24, 0x1b, 0xf5}, + {0x24, 0x1c, 0x00}, + {0x24, 0x1d, 0x00}, + {0x24, 0x1e, 0x23}, + {0x24, 0x1f, 0xea}, + {0x24, 0x20, 0x00}, + {0x24, 0x21, 0x00}, + {0x24, 0x22, 0x11}, + {0x24, 0x23, 0xf5}, + {0x24, 0x24, 0x0f}, + {0x24, 0x25, 0xe3}, + {0x24, 0x26, 0x3d}, + {0x24, 0x27, 0x2a}, + {0x24, 0x28, 0xf8}, + {0x24, 0x29, 0x1c}, + {0x24, 0x2a, 0x76}, + {0x24, 0x2b, 0xc1}, + {0x24, 0x2c, 0x00}, // Biquad - BQ2 Left - Filter: Low Pass-Chebyshev Frequency: 150 Hz QVal: 0.71 Bandwidth: 1000 Hz + {0x24, 0x2d, 0x00}, + {0x24, 0x2e, 0x11}, + {0x24, 0x2f, 0xf5}, + {0x24, 0x30, 0x00}, + {0x24, 0x31, 0x00}, + {0x24, 0x32, 0x23}, + {0x24, 0x33, 0xea}, + {0x24, 0x34, 0x00}, + {0x24, 0x35, 0x00}, + {0x24, 0x36, 0x11}, + {0x24, 0x37, 0xf5}, + {0x24, 0x38, 0x0f}, + {0x24, 0x39, 0xe3}, + {0x24, 0x3a, 0x3d}, + {0x24, 0x3b, 0x2a}, + {0x24, 0x3c, 0xf8}, + {0x24, 0x3d, 0x1c}, + {0x24, 0x3e, 0x76}, + {0x24, 0x3f, 0xc1}, + {0x24, 0x40, 0x08}, // Biquad - BQ3 Left - Filter: All Pass Frequency: 1000 Hz QVal: 0.71 Bandwidth: 1000 Hz + {0x24, 0x41, 0x00}, + {0x24, 0x42, 0x00}, + {0x24, 0x43, 0x00}, + {0x24, 0x44, 0x00}, + {0x24, 0x45, 0x00}, + {0x24, 0x46, 0x00}, + {0x24, 0x47, 0x00}, + {0x24, 0x48, 0x00}, + {0x24, 0x49, 0x00}, + {0x24, 0x4a, 0x00}, + {0x24, 0x4b, 0x00}, + {0x24, 0x4c, 0x00}, + {0x24, 0x4d, 0x00}, + {0x24, 0x4e, 0x00}, + {0x24, 0x4f, 0x00}, + {0x24, 0x50, 0x00}, + {0x24, 0x51, 0x00}, + {0x24, 0x52, 0x00}, + {0x24, 0x53, 0x00}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_left_hf_60[TAS5805M_EQ_PROFILE_REG_PER_STEP] = { + {0x24, 0x18, 0x07}, // Biquad - BQ1 Left - Filter: High Pass-Chebyshev Frequency: 60 Hz QVal: 0.5 Bandwidth: 1000 Hz + {0x24, 0x19, 0x89}, + {0x24, 0x1a, 0xde}, + {0x24, 0x1b, 0x6d}, + {0x24, 0x1c, 0xf0}, + {0x24, 0x1d, 0xec}, + {0x24, 0x1e, 0x43}, + {0x24, 0x1f, 0x27}, + {0x24, 0x20, 0x07}, + {0x24, 0x21, 0x89}, + {0x24, 0x22, 0xde}, + {0x24, 0x23, 0x6d}, + {0x24, 0x24, 0x0f}, + {0x24, 0x25, 0xf8}, + {0x24, 0x26, 0x6e}, + {0x24, 0x27, 0x5f}, + {0x24, 0x28, 0xf8}, + {0x24, 0x29, 0x07}, + {0x24, 0x2a, 0x8c}, + {0x24, 0x2b, 0x4f}, + {0x24, 0x2c, 0x07}, // Biquad - BQ2 Left - Filter: High Pass-Chebyshev Frequency: 60 Hz QVal: 0.5 Bandwidth: 1000 Hz + {0x24, 0x2d, 0x89}, + {0x24, 0x2e, 0xde}, + {0x24, 0x2f, 0x6d}, + {0x24, 0x30, 0xf0}, + {0x24, 0x31, 0xec}, + {0x24, 0x32, 0x43}, + {0x24, 0x33, 0x27}, + {0x24, 0x34, 0x07}, + {0x24, 0x35, 0x89}, + {0x24, 0x36, 0xde}, + {0x24, 0x37, 0x6d}, + {0x24, 0x38, 0x0f}, + {0x24, 0x39, 0xf8}, + {0x24, 0x3a, 0x6e}, + {0x24, 0x3b, 0x5f}, + {0x24, 0x3c, 0xf8}, + {0x24, 0x3d, 0x07}, + {0x24, 0x3e, 0x8c}, + {0x24, 0x3f, 0x4f}, + {0x24, 0x40, 0x08}, // Biquad - BQ3 Left - Filter: High Shelf Frequency: 200 Hz Gain: 1dB QVal: 0.5 Bandwidth: 1000 Hz + {0x24, 0x41, 0xf8}, + {0x24, 0x42, 0x2c}, + {0x24, 0x43, 0x87}, + {0x24, 0x44, 0xee}, + {0x24, 0x45, 0x49}, + {0x24, 0x46, 0xb1}, + {0x24, 0x47, 0x28}, + {0x24, 0x48, 0x08}, + {0x24, 0x49, 0xbe}, + {0x24, 0x4a, 0x80}, + {0x24, 0x4b, 0x36}, + {0x24, 0x4c, 0x0f}, + {0x24, 0x4d, 0xc9}, + {0x24, 0x4e, 0x2f}, + {0x24, 0x4f, 0xb1}, + {0x24, 0x50, 0xf8}, + {0x24, 0x51, 0x36}, + {0x24, 0x52, 0x72}, + {0x24, 0x53, 0x6a}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_left_hf_70[TAS5805M_EQ_PROFILE_REG_PER_STEP] = { + {0x24, 0x18, 0x07}, // Biquad - BQ1 Left - Filter: High Pass-Chebyshev Frequency: 70 Hz QVal: 0.5 Bandwidth: 1000 Hz + {0x24, 0x19, 0x89}, + {0x24, 0x1a, 0x46}, + {0x24, 0x1b, 0x48}, + {0x24, 0x1c, 0xf0}, + {0x24, 0x1d, 0xed}, + {0x24, 0x1e, 0x73}, + {0x24, 0x1f, 0x70}, + {0x24, 0x20, 0x07}, + {0x24, 0x21, 0x89}, + {0x24, 0x22, 0x46}, + {0x24, 0x23, 0x48}, + {0x24, 0x24, 0x0f}, + {0x24, 0x25, 0xf7}, + {0x24, 0x26, 0x2b}, + {0x24, 0x27, 0x18}, + {0x24, 0x28, 0xf8}, + {0x24, 0x29, 0x08}, + {0x24, 0x2a, 0xcd}, + {0x24, 0x2b, 0xaa}, + {0x24, 0x2c, 0x07}, // Biquad - BQ2 Left - Filter: High Pass-Chebyshev Frequency: 70 Hz QVal: 0.5 Bandwidth: 1000 Hz + {0x24, 0x2d, 0x89}, + {0x24, 0x2e, 0x46}, + {0x24, 0x2f, 0x48}, + {0x24, 0x30, 0xf0}, + {0x24, 0x31, 0xed}, + {0x24, 0x32, 0x73}, + {0x24, 0x33, 0x70}, + {0x24, 0x34, 0x07}, + {0x24, 0x35, 0x89}, + {0x24, 0x36, 0x46}, + {0x24, 0x37, 0x48}, + {0x24, 0x38, 0x0f}, + {0x24, 0x39, 0xf7}, + {0x24, 0x3a, 0x2b}, + {0x24, 0x3b, 0x18}, + {0x24, 0x3c, 0xf8}, + {0x24, 0x3d, 0x08}, + {0x24, 0x3e, 0xcd}, + {0x24, 0x3f, 0xaa}, + {0x24, 0x40, 0x08}, // Biquad - BQ3 Left - Filter: High Shelf Frequency: 200 Hz Gain: 1dB QVal: 0.5 Bandwidth: 1000 Hz + {0x24, 0x41, 0xf8}, + {0x24, 0x42, 0x2c}, + {0x24, 0x43, 0x87}, + {0x24, 0x44, 0xee}, + {0x24, 0x45, 0x49}, + {0x24, 0x46, 0xb1}, + {0x24, 0x47, 0x28}, + {0x24, 0x48, 0x08}, + {0x24, 0x49, 0xbe}, + {0x24, 0x4a, 0x80}, + {0x24, 0x4b, 0x36}, + {0x24, 0x4c, 0x0f}, + {0x24, 0x4d, 0xc9}, + {0x24, 0x4e, 0x2f}, + {0x24, 0x4f, 0xb1}, + {0x24, 0x50, 0xf8}, + {0x24, 0x51, 0x36}, + {0x24, 0x52, 0x72}, + {0x24, 0x53, 0x6a}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_left_hf_80[TAS5805M_EQ_PROFILE_REG_PER_STEP] = { + {0x24, 0x18, 0x07}, // Biquad - BQ1 Left - Filter: High Pass-Chebyshev Frequency: 80 Hz QVal: 0.5 Bandwidth: 1000 Hz + {0x24, 0x19, 0x88}, + {0x24, 0x1a, 0xae}, + {0x24, 0x1b, 0x29}, + {0x24, 0x1c, 0xf0}, + {0x24, 0x1d, 0xee}, + {0x24, 0x1e, 0xa3}, + {0x24, 0x1f, 0xae}, + {0x24, 0x20, 0x07}, + {0x24, 0x21, 0x88}, + {0x24, 0x22, 0xae}, + {0x24, 0x23, 0x29}, + {0x24, 0x24, 0x0f}, + {0x24, 0x25, 0xf5}, + {0x24, 0x26, 0xe7}, + {0x24, 0x27, 0xb8}, + {0x24, 0x28, 0xf8}, + {0x24, 0x29, 0x0a}, + {0x24, 0x2a, 0x0e}, + {0x24, 0x2b, 0xd3}, + {0x24, 0x2c, 0x07}, // Biquad - BQ2 Left - Filter: High Pass-Chebyshev Frequency: 80 Hz QVal: 0.5 Bandwidth: 1000 Hz + {0x24, 0x2d, 0x88}, + {0x24, 0x2e, 0xae}, + {0x24, 0x2f, 0x29}, + {0x24, 0x30, 0xf0}, + {0x24, 0x31, 0xee}, + {0x24, 0x32, 0xa3}, + {0x24, 0x33, 0xae}, + {0x24, 0x34, 0x07}, + {0x24, 0x35, 0x88}, + {0x24, 0x36, 0xae}, + {0x24, 0x37, 0x29}, + {0x24, 0x38, 0x0f}, + {0x24, 0x39, 0xf5}, + {0x24, 0x3a, 0xe7}, + {0x24, 0x3b, 0xb8}, + {0x24, 0x3c, 0xf8}, + {0x24, 0x3d, 0x0a}, + {0x24, 0x3e, 0x0e}, + {0x24, 0x3f, 0xd3}, + {0x24, 0x40, 0x08}, // Biquad - BQ3 Left - Filter: High Shelf Frequency: 200 Hz Gain: 1dB QVal: 0.5 Bandwidth: 1000 Hz + {0x24, 0x41, 0xf8}, + {0x24, 0x42, 0x2c}, + {0x24, 0x43, 0x87}, + {0x24, 0x44, 0xee}, + {0x24, 0x45, 0x49}, + {0x24, 0x46, 0xb1}, + {0x24, 0x47, 0x28}, + {0x24, 0x48, 0x08}, + {0x24, 0x49, 0xbe}, + {0x24, 0x4a, 0x80}, + {0x24, 0x4b, 0x36}, + {0x24, 0x4c, 0x0f}, + {0x24, 0x4d, 0xc9}, + {0x24, 0x4e, 0x2f}, + {0x24, 0x4f, 0xb1}, + {0x24, 0x50, 0xf8}, + {0x24, 0x51, 0x36}, + {0x24, 0x52, 0x72}, + {0x24, 0x53, 0x6a}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_left_hf_90[TAS5805M_EQ_PROFILE_REG_PER_STEP] = { + {0x24, 0x18, 0x07}, // Biquad - BQ1 Left - Filter: High Pass-Chebyshev Frequency: 90 Hz QVal: 0.5 Bandwidth: 1000 Hz + {0x24, 0x19, 0x88}, + {0x24, 0x1a, 0x16}, + {0x24, 0x1b, 0x11}, + {0x24, 0x1c, 0xf0}, + {0x24, 0x1d, 0xef}, + {0x24, 0x1e, 0xd3}, + {0x24, 0x1f, 0xdf}, + {0x24, 0x20, 0x07}, + {0x24, 0x21, 0x88}, + {0x24, 0x22, 0x16}, + {0x24, 0x23, 0x11}, + {0x24, 0x24, 0x0f}, + {0x24, 0x25, 0xf4}, + {0x24, 0x26, 0xa4}, + {0x24, 0x27, 0x3f}, + {0x24, 0x28, 0xf8}, + {0x24, 0x29, 0x0b}, + {0x24, 0x2a, 0x4f}, + {0x24, 0x2b, 0xca}, + {0x24, 0x2c, 0x07}, // Biquad - BQ2 Left - Filter: High Pass-Chebyshev Frequency: 90 Hz QVal: 0.5 Bandwidth: 1000 Hz + {0x24, 0x2d, 0x88}, + {0x24, 0x2e, 0x16}, + {0x24, 0x2f, 0x11}, + {0x24, 0x30, 0xf0}, + {0x24, 0x31, 0xef}, + {0x24, 0x32, 0xd3}, + {0x24, 0x33, 0xdf}, + {0x24, 0x34, 0x07}, + {0x24, 0x35, 0x88}, + {0x24, 0x36, 0x16}, + {0x24, 0x37, 0x11}, + {0x24, 0x38, 0x0f}, + {0x24, 0x39, 0xf4}, + {0x24, 0x3a, 0xa4}, + {0x24, 0x3b, 0x3f}, + {0x24, 0x3c, 0xf8}, + {0x24, 0x3d, 0x0b}, + {0x24, 0x3e, 0x4f}, + {0x24, 0x3f, 0xca}, + {0x24, 0x40, 0x08}, // Biquad - BQ3 Left - Filter: High Shelf Frequency: 200 Hz Gain: 1dB QVal: 0.5 Bandwidth: 1000 Hz + {0x24, 0x41, 0xf8}, + {0x24, 0x42, 0x2c}, + {0x24, 0x43, 0x87}, + {0x24, 0x44, 0xee}, + {0x24, 0x45, 0x49}, + {0x24, 0x46, 0xb1}, + {0x24, 0x47, 0x28}, + {0x24, 0x48, 0x08}, + {0x24, 0x49, 0xbe}, + {0x24, 0x4a, 0x80}, + {0x24, 0x4b, 0x36}, + {0x24, 0x4c, 0x0f}, + {0x24, 0x4d, 0xc9}, + {0x24, 0x4e, 0x2f}, + {0x24, 0x4f, 0xb1}, + {0x24, 0x50, 0xf8}, + {0x24, 0x51, 0x36}, + {0x24, 0x52, 0x72}, + {0x24, 0x53, 0x6a}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_left_hf_100[TAS5805M_EQ_PROFILE_REG_PER_STEP] = { + {0x24, 0x18, 0x07}, // Biquad - BQ1 Left - Filter: High Pass-Chebyshev Frequency: 100 Hz QVal: 0.5 Bandwidth: 1000 Hz + {0x24, 0x19, 0x87}, + {0x24, 0x1a, 0x7d}, + {0x24, 0x1b, 0xfe}, + {0x24, 0x1c, 0xf0}, + {0x24, 0x1d, 0xf1}, + {0x24, 0x1e, 0x04}, + {0x24, 0x1f, 0x04}, + {0x24, 0x20, 0x07}, + {0x24, 0x21, 0x87}, + {0x24, 0x22, 0x7d}, + {0x24, 0x23, 0xfe}, + {0x24, 0x24, 0x0f}, + {0x24, 0x25, 0xf3}, + {0x24, 0x26, 0x60}, + {0x24, 0x27, 0xae}, + {0x24, 0x28, 0xf8}, + {0x24, 0x29, 0x0c}, + {0x24, 0x2a, 0x90}, + {0x24, 0x2b, 0x8e}, + {0x24, 0x2c, 0x07}, // Biquad - BQ2 Left - Filter: High Pass-Chebyshev Frequency: 100 Hz QVal: 0.5 Bandwidth: 1000 Hz + {0x24, 0x2d, 0x87}, + {0x24, 0x2e, 0x7d}, + {0x24, 0x2f, 0xfe}, + {0x24, 0x30, 0xf0}, + {0x24, 0x31, 0xf1}, + {0x24, 0x32, 0x04}, + {0x24, 0x33, 0x04}, + {0x24, 0x34, 0x07}, + {0x24, 0x35, 0x87}, + {0x24, 0x36, 0x7d}, + {0x24, 0x37, 0xfe}, + {0x24, 0x38, 0x0f}, + {0x24, 0x39, 0xf3}, + {0x24, 0x3a, 0x60}, + {0x24, 0x3b, 0xae}, + {0x24, 0x3c, 0xf8}, + {0x24, 0x3d, 0x0c}, + {0x24, 0x3e, 0x90}, + {0x24, 0x3f, 0x8e}, + {0x24, 0x40, 0x08}, // Biquad - BQ3 Left - Filter: High Shelf Frequency: 200 Hz Gain: 1dB QVal: 0.5 Bandwidth: 1000 Hz + {0x24, 0x41, 0xf8}, + {0x24, 0x42, 0x2c}, + {0x24, 0x43, 0x87}, + {0x24, 0x44, 0xee}, + {0x24, 0x45, 0x49}, + {0x24, 0x46, 0xb1}, + {0x24, 0x47, 0x28}, + {0x24, 0x48, 0x08}, + {0x24, 0x49, 0xbe}, + {0x24, 0x4a, 0x80}, + {0x24, 0x4b, 0x36}, + {0x24, 0x4c, 0x0f}, + {0x24, 0x4d, 0xc9}, + {0x24, 0x4e, 0x2f}, + {0x24, 0x4f, 0xb1}, + {0x24, 0x50, 0xf8}, + {0x24, 0x51, 0x36}, + {0x24, 0x52, 0x72}, + {0x24, 0x53, 0x6a}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_left_hf_110[TAS5805M_EQ_PROFILE_REG_PER_STEP] = { + {0x24, 0x18, 0x07}, // Biquad - BQ1 Left - Filter: High Pass-Chebyshev Frequency: 110 Hz QVal: 0.5 Bandwidth: 1000 Hz + {0x24, 0x19, 0x86}, + {0x24, 0x1a, 0xe5}, + {0x24, 0x1b, 0xf2}, + {0x24, 0x1c, 0xf0}, + {0x24, 0x1d, 0xf2}, + {0x24, 0x1e, 0x34}, + {0x24, 0x1f, 0x1d}, + {0x24, 0x20, 0x07}, + {0x24, 0x21, 0x86}, + {0x24, 0x22, 0xe5}, + {0x24, 0x23, 0xf2}, + {0x24, 0x24, 0x0f}, + {0x24, 0x25, 0xf2}, + {0x24, 0x26, 0x1d}, + {0x24, 0x27, 0x04}, + {0x24, 0x28, 0xf8}, + {0x24, 0x29, 0x0d}, + {0x24, 0x2a, 0xd1}, + {0x24, 0x2b, 0x1f}, + {0x24, 0x2c, 0x07}, // Biquad - BQ2 Left - Filter: High Pass-Chebyshev Frequency: 110 Hz QVal: 0.5 Bandwidth: 1000 Hz + {0x24, 0x2d, 0x86}, + {0x24, 0x2e, 0xe5}, + {0x24, 0x2f, 0xf2}, + {0x24, 0x30, 0xf0}, + {0x24, 0x31, 0xf2}, + {0x24, 0x32, 0x34}, + {0x24, 0x33, 0x1d}, + {0x24, 0x34, 0x07}, + {0x24, 0x35, 0x86}, + {0x24, 0x36, 0xe5}, + {0x24, 0x37, 0xf2}, + {0x24, 0x38, 0x0f}, + {0x24, 0x39, 0xf2}, + {0x24, 0x3a, 0x1d}, + {0x24, 0x3b, 0x04}, + {0x24, 0x3c, 0xf8}, + {0x24, 0x3d, 0x0d}, + {0x24, 0x3e, 0xd1}, + {0x24, 0x3f, 0x1f}, + {0x24, 0x40, 0x08}, // Biquad - BQ3 Left - Filter: High Shelf Frequency: 220 Hz Gain: 1dB QVal: 0.5 Bandwidth: 1000 Hz + {0x24, 0x41, 0xf8}, + {0x24, 0x42, 0x00}, + {0x24, 0x43, 0xd4}, + {0x24, 0x44, 0xee}, + {0x24, 0x45, 0x4f}, + {0x24, 0x46, 0xca}, + {0x24, 0x47, 0xe2}, + {0x24, 0x48, 0x08}, + {0x24, 0x49, 0xb8}, + {0x24, 0x4a, 0xa5}, + {0x24, 0x4b, 0xbf}, + {0x24, 0x4c, 0x0f}, + {0x24, 0x4d, 0xc3}, + {0x24, 0x4e, 0xbe}, + {0x24, 0x4f, 0xbd}, + {0x24, 0x50, 0xf8}, + {0x24, 0x51, 0x3b}, + {0x24, 0x52, 0xcf}, + {0x24, 0x53, 0xce}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_left_hf_120[TAS5805M_EQ_PROFILE_REG_PER_STEP] = { + {0x24, 0x18, 0x07}, // Biquad - BQ1 Left - Filter: High Pass-Chebyshev Frequency: 120 Hz QVal: 0.5 Bandwidth: 1000 Hz + {0x24, 0x19, 0x86}, + {0x24, 0x1a, 0x4d}, + {0x24, 0x1b, 0xeb}, + {0x24, 0x1c, 0xf0}, + {0x24, 0x1d, 0xf3}, + {0x24, 0x1e, 0x64}, + {0x24, 0x1f, 0x29}, + {0x24, 0x20, 0x07}, + {0x24, 0x21, 0x86}, + {0x24, 0x22, 0x4d}, + {0x24, 0x23, 0xeb}, + {0x24, 0x24, 0x0f}, + {0x24, 0x25, 0xf0}, + {0x24, 0x26, 0xd9}, + {0x24, 0x27, 0x42}, + {0x24, 0x28, 0xf8}, + {0x24, 0x29, 0x0f}, + {0x24, 0x2a, 0x11}, + {0x24, 0x2b, 0x7e}, + {0x24, 0x2c, 0x07}, // Biquad - BQ2 Left - Filter: High Pass-Chebyshev Frequency: 120 Hz QVal: 0.5 Bandwidth: 1000 Hz + {0x24, 0x2d, 0x86}, + {0x24, 0x2e, 0x4d}, + {0x24, 0x2f, 0xeb}, + {0x24, 0x30, 0xf0}, + {0x24, 0x31, 0xf3}, + {0x24, 0x32, 0x64}, + {0x24, 0x33, 0x29}, + {0x24, 0x34, 0x07}, + {0x24, 0x35, 0x86}, + {0x24, 0x36, 0x4d}, + {0x24, 0x37, 0xeb}, + {0x24, 0x38, 0x0f}, + {0x24, 0x39, 0xf0}, + {0x24, 0x3a, 0xd9}, + {0x24, 0x3b, 0x42}, + {0x24, 0x3c, 0xf8}, + {0x24, 0x3d, 0x0f}, + {0x24, 0x3e, 0x11}, + {0x24, 0x3f, 0x7e}, + {0x24, 0x40, 0x08}, // Biquad - BQ3 Left - Filter: High Shelf Frequency: 240 Hz Gain: 1dB QVal: 0.5 Bandwidth: 1000 Hz + {0x24, 0x41, 0xf7}, + {0x24, 0x42, 0xd5}, + {0x24, 0x43, 0x31}, + {0x24, 0x44, 0xee}, + {0x24, 0x45, 0x55}, + {0x24, 0x46, 0xe2}, + {0x24, 0x47, 0x6d}, + {0x24, 0x48, 0x08}, + {0x24, 0x49, 0xb2}, + {0x24, 0x4a, 0xcf}, + {0x24, 0x4b, 0x3a}, + {0x24, 0x4c, 0x0f}, + {0x24, 0x4d, 0xbe}, + {0x24, 0x4e, 0x4f}, + {0x24, 0x4f, 0xa2}, + {0x24, 0x50, 0xf8}, + {0x24, 0x51, 0x41}, + {0x24, 0x52, 0x29}, + {0x24, 0x53, 0x86}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_left_hf_130[TAS5805M_EQ_PROFILE_REG_PER_STEP] = { + {0x24, 0x18, 0x07}, // Biquad - BQ1 Left - Filter: High Pass-Chebyshev Frequency: 130 Hz QVal: 0.5 Bandwidth: 1000 Hz + {0x24, 0x19, 0x85}, + {0x24, 0x1a, 0xb5}, + {0x24, 0x1b, 0xeb}, + {0x24, 0x1c, 0xf0}, + {0x24, 0x1d, 0xf4}, + {0x24, 0x1e, 0x94}, + {0x24, 0x1f, 0x29}, + {0x24, 0x20, 0x07}, + {0x24, 0x21, 0x85}, + {0x24, 0x22, 0xb5}, + {0x24, 0x23, 0xeb}, + {0x24, 0x24, 0x0f}, + {0x24, 0x25, 0xef}, + {0x24, 0x26, 0x95}, + {0x24, 0x27, 0x67}, + {0x24, 0x28, 0xf8}, + {0x24, 0x29, 0x10}, + {0x24, 0x2a, 0x51}, + {0x24, 0x2b, 0xaa}, + {0x24, 0x2c, 0x07}, // Biquad - BQ2 Left - Filter: High Pass-Chebyshev Frequency: 130 Hz QVal: 0.5 Bandwidth: 1000 Hz + {0x24, 0x2d, 0x85}, + {0x24, 0x2e, 0xb5}, + {0x24, 0x2f, 0xeb}, + {0x24, 0x30, 0xf0}, + {0x24, 0x31, 0xf4}, + {0x24, 0x32, 0x94}, + {0x24, 0x33, 0x29}, + {0x24, 0x34, 0x07}, + {0x24, 0x35, 0x85}, + {0x24, 0x36, 0xb5}, + {0x24, 0x37, 0xeb}, + {0x24, 0x38, 0x0f}, + {0x24, 0x39, 0xef}, + {0x24, 0x3a, 0x95}, + {0x24, 0x3b, 0x67}, + {0x24, 0x3c, 0xf8}, + {0x24, 0x3d, 0x10}, + {0x24, 0x3e, 0x51}, + {0x24, 0x3f, 0xaa}, + {0x24, 0x40, 0x08}, // Biquad - BQ3 Left - Filter: High Shelf Frequency: 260 Hz Gain: 1dB QVal: 0.5 Bandwidth: 1000 Hz + {0x24, 0x41, 0xf7}, + {0x24, 0x42, 0xa9}, + {0x24, 0x43, 0x9d}, + {0x24, 0x44, 0xee}, + {0x24, 0x45, 0x5b}, + {0x24, 0x46, 0xf7}, + {0x24, 0x47, 0xca}, + {0x24, 0x48, 0x08}, + {0x24, 0x49, 0xac}, + {0x24, 0x4a, 0xfc}, + {0x24, 0x4b, 0xa4}, + {0x24, 0x4c, 0x0f}, + {0x24, 0x4d, 0xb8}, + {0x24, 0x4e, 0xe2}, + {0x24, 0x4f, 0x5e}, + {0x24, 0x50, 0xf8}, + {0x24, 0x51, 0x46}, + {0x24, 0x52, 0x7f}, + {0x24, 0x53, 0x96}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_left_hf_140[TAS5805M_EQ_PROFILE_REG_PER_STEP] = { + {0x24, 0x18, 0x07}, // Biquad - BQ1 Left - Filter: High Pass-Chebyshev Frequency: 140 Hz QVal: 0.5 Bandwidth: 1000 Hz + {0x24, 0x19, 0x85}, + {0x24, 0x1a, 0x1d}, + {0x24, 0x1b, 0xf1}, + {0x24, 0x1c, 0xf0}, + {0x24, 0x1d, 0xf5}, + {0x24, 0x1e, 0xc4}, + {0x24, 0x1f, 0x1d}, + {0x24, 0x20, 0x07}, + {0x24, 0x21, 0x85}, + {0x24, 0x22, 0x1d}, + {0x24, 0x23, 0xf1}, + {0x24, 0x24, 0x0f}, + {0x24, 0x25, 0xee}, + {0x24, 0x26, 0x51}, + {0x24, 0x27, 0x74}, + {0x24, 0x28, 0xf8}, + {0x24, 0x29, 0x11}, + {0x24, 0x2a, 0x91}, + {0x24, 0x2b, 0xa4}, + {0x24, 0x2c, 0x07}, // Biquad - BQ2 Left - Filter: High Pass-Chebyshev Frequency: 140 Hz QVal: 0.5 Bandwidth: 1000 Hz + {0x24, 0x2d, 0x85}, + {0x24, 0x2e, 0x1d}, + {0x24, 0x2f, 0xf1}, + {0x24, 0x30, 0xf0}, + {0x24, 0x31, 0xf5}, + {0x24, 0x32, 0xc4}, + {0x24, 0x33, 0x1d}, + {0x24, 0x34, 0x07}, + {0x24, 0x35, 0x85}, + {0x24, 0x36, 0x1d}, + {0x24, 0x37, 0xf1}, + {0x24, 0x38, 0x0f}, + {0x24, 0x39, 0xee}, + {0x24, 0x3a, 0x51}, + {0x24, 0x3b, 0x74}, + {0x24, 0x3c, 0xf8}, + {0x24, 0x3d, 0x11}, + {0x24, 0x3e, 0x91}, + {0x24, 0x3f, 0xa4}, + {0x24, 0x40, 0x08}, // Biquad - BQ3 Left - Filter: High Shelf Frequency: 280 Hz Gain: 1dB QVal: 0.5 Bandwidth: 1000 Hz + {0x24, 0x41, 0xf7}, + {0x24, 0x42, 0x7e}, + {0x24, 0x43, 0x18}, + {0x24, 0x44, 0xee}, + {0x24, 0x45, 0x62}, + {0x24, 0x46, 0x0a}, + {0x24, 0x47, 0xfb}, + {0x24, 0x48, 0x08}, + {0x24, 0x49, 0xa7}, + {0x24, 0x4a, 0x2d}, + {0x24, 0x4b, 0xfa}, + {0x24, 0x4c, 0x0f}, + {0x24, 0x4d, 0xb3}, + {0x24, 0x4e, 0x76}, + {0x24, 0x4f, 0xf2}, + {0x24, 0x50, 0xf8}, + {0x24, 0x51, 0x4b}, + {0x24, 0x52, 0xd2}, + {0x24, 0x53, 0x01}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_left_hf_150[TAS5805M_EQ_PROFILE_REG_PER_STEP] = { + {0x24, 0x18, 0x07}, // Biquad - BQ1 Left - Filter: High Pass-Chebyshev Frequency: 150 Hz QVal: 0.5 Bandwidth: 1000 Hz + {0x24, 0x19, 0x84}, + {0x24, 0x1a, 0x85}, + {0x24, 0x1b, 0xfd}, + {0x24, 0x1c, 0xf0}, + {0x24, 0x1d, 0xf6}, + {0x24, 0x1e, 0xf4}, + {0x24, 0x1f, 0x05}, + {0x24, 0x20, 0x07}, + {0x24, 0x21, 0x84}, + {0x24, 0x22, 0x85}, + {0x24, 0x23, 0xfd}, + {0x24, 0x24, 0x0f}, + {0x24, 0x25, 0xed}, + {0x24, 0x26, 0x0d}, + {0x24, 0x27, 0x68}, + {0x24, 0x28, 0xf8}, + {0x24, 0x29, 0x12}, + {0x24, 0x2a, 0xd1}, + {0x24, 0x2b, 0x6b}, + {0x24, 0x2c, 0x07}, // Biquad - BQ2 Left - Filter: High Pass-Chebyshev Frequency: 150 Hz QVal: 0.5 Bandwidth: 1000 Hz + {0x24, 0x2d, 0x84}, + {0x24, 0x2e, 0x85}, + {0x24, 0x2f, 0xfd}, + {0x24, 0x30, 0xf0}, + {0x24, 0x31, 0xf6}, + {0x24, 0x32, 0xf4}, + {0x24, 0x33, 0x05}, + {0x24, 0x34, 0x07}, + {0x24, 0x35, 0x84}, + {0x24, 0x36, 0x85}, + {0x24, 0x37, 0xfd}, + {0x24, 0x38, 0x0f}, + {0x24, 0x39, 0xed}, + {0x24, 0x3a, 0x0d}, + {0x24, 0x3b, 0x68}, + {0x24, 0x3c, 0xf8}, + {0x24, 0x3d, 0x12}, + {0x24, 0x3e, 0xd1}, + {0x24, 0x3f, 0x6b}, + {0x24, 0x40, 0x08}, // Biquad - BQ3 Left - Filter: High Shelf Frequency: 300 Hz Gain: 1dB QVal: 0.5 Bandwidth: 1000 Hz + {0x24, 0x41, 0xf7}, + {0x24, 0x42, 0x52}, + {0x24, 0x43, 0xa3}, + {0x24, 0x44, 0xee}, + {0x24, 0x45, 0x68}, + {0x24, 0x46, 0x1c}, + {0x24, 0x47, 0x01}, + {0x24, 0x48, 0x08}, + {0x24, 0x49, 0xa1}, + {0x24, 0x4a, 0x63}, + {0x24, 0x4b, 0x38}, + {0x24, 0x4c, 0x0f}, + {0x24, 0x4d, 0xae}, + {0x24, 0x4e, 0x0d}, + {0x24, 0x4f, 0x5a}, + {0x24, 0x50, 0xf8}, + {0x24, 0x51, 0x51}, + {0x24, 0x52, 0x20}, + {0x24, 0x53, 0xca}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_right_flat[TAS5805M_EQ_PROFILE_REG_PER_STEP] = { + {0x26, 0x54, 0x08}, // Biquad - BQ1 Right - Filter: All Pass Frequency: 1000 Hz QVal: 0.71 Bandwidth: 1000 Hz + {0x26, 0x55, 0x00}, + {0x26, 0x56, 0x00}, + {0x26, 0x57, 0x00}, + {0x26, 0x58, 0x00}, + {0x26, 0x59, 0x00}, + {0x26, 0x5a, 0x00}, + {0x26, 0x5b, 0x00}, + {0x26, 0x5c, 0x00}, + {0x26, 0x5d, 0x00}, + {0x26, 0x5e, 0x00}, + {0x26, 0x5f, 0x00}, + {0x26, 0x60, 0x00}, + {0x26, 0x61, 0x00}, + {0x26, 0x62, 0x00}, + {0x26, 0x63, 0x00}, + {0x26, 0x64, 0x00}, + {0x26, 0x65, 0x00}, + {0x26, 0x66, 0x00}, + {0x26, 0x67, 0x00}, + {0x26, 0x68, 0x08}, // Biquad - BQ2 Right - Filter: All Pass Frequency: 1000 Hz QVal: 0.71 Bandwidth: 1000 Hz + {0x26, 0x69, 0x00}, + {0x26, 0x6a, 0x00}, + {0x26, 0x6b, 0x00}, + {0x26, 0x6c, 0x00}, + {0x26, 0x6d, 0x00}, + {0x26, 0x6e, 0x00}, + {0x26, 0x6f, 0x00}, + {0x26, 0x70, 0x00}, + {0x26, 0x71, 0x00}, + {0x26, 0x72, 0x00}, + {0x26, 0x73, 0x00}, + {0x26, 0x74, 0x00}, + {0x26, 0x75, 0x00}, + {0x26, 0x76, 0x00}, + {0x26, 0x77, 0x00}, + {0x26, 0x78, 0x00}, + {0x26, 0x79, 0x00}, + {0x26, 0x7a, 0x00}, + {0x26, 0x7b, 0x00}, + {0x26, 0x7c, 0x08}, // Biquad - BQ3 Right - Filter: All Pass Frequency: 1000 Hz QVal: 0.71 Bandwidth: 1000 Hz + {0x26, 0x7d, 0x00}, + {0x26, 0x7e, 0x00}, + {0x26, 0x7f, 0x00}, + {0x27, 0x08, 0x00}, + {0x27, 0x09, 0x00}, + {0x27, 0x0a, 0x00}, + {0x27, 0x0b, 0x00}, + {0x27, 0x0c, 0x00}, + {0x27, 0x0d, 0x00}, + {0x27, 0x0e, 0x00}, + {0x27, 0x0f, 0x00}, + {0x27, 0x10, 0x00}, + {0x27, 0x11, 0x00}, + {0x27, 0x12, 0x00}, + {0x27, 0x13, 0x00}, + {0x27, 0x14, 0x00}, + {0x27, 0x15, 0x00}, + {0x27, 0x16, 0x00}, + {0x27, 0x17, 0x00}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_right_lf_60[TAS5805M_EQ_PROFILE_REG_PER_STEP] = { + {0x26, 0x54, 0x00}, // Biquad - BQ1 Right - Filter: Low Pass-Chebyshev Frequency: 60 Hz QVal: 0.71 Bandwidth: 1000 Hz + {0x26, 0x55, 0x00}, + {0x26, 0x56, 0x02}, + {0x26, 0x57, 0xe3}, + {0x26, 0x58, 0x00}, + {0x26, 0x59, 0x00}, + {0x26, 0x5a, 0x05}, + {0x26, 0x5b, 0xc5}, + {0x26, 0x5c, 0x00}, + {0x26, 0x5d, 0x00}, + {0x26, 0x5e, 0x02}, + {0x26, 0x5f, 0xe3}, + {0x26, 0x60, 0x0f}, + {0x26, 0x61, 0xf4}, + {0x26, 0x62, 0x84}, + {0x26, 0x63, 0xcd}, + {0x26, 0x64, 0xf8}, + {0x26, 0x65, 0x0b}, + {0x26, 0x66, 0x6e}, + {0x26, 0x67, 0xfa}, + {0x26, 0x68, 0x00}, // Biquad - BQ2 Right - Filter: Low Pass-Chebyshev Frequency: 60 Hz QVal: 0.71 Bandwidth: 1000 Hz + {0x26, 0x69, 0x00}, + {0x26, 0x6a, 0x02}, + {0x26, 0x6b, 0xe3}, + {0x26, 0x6c, 0x00}, + {0x26, 0x6d, 0x00}, + {0x26, 0x6e, 0x05}, + {0x26, 0x6f, 0xc5}, + {0x26, 0x70, 0x00}, + {0x26, 0x71, 0x00}, + {0x26, 0x72, 0x02}, + {0x26, 0x73, 0xe3}, + {0x26, 0x74, 0x0f}, + {0x26, 0x75, 0xf4}, + {0x26, 0x76, 0x84}, + {0x26, 0x77, 0xcd}, + {0x26, 0x78, 0xf8}, + {0x26, 0x79, 0x0b}, + {0x26, 0x7a, 0x6e}, + {0x26, 0x7b, 0xfa}, + {0x26, 0x7c, 0x08}, // Biquad - BQ3 Right - Filter: All Pass Frequency: 1000 Hz QVal: 0.71 Bandwidth: 1000 Hz + {0x26, 0x7d, 0x00}, + {0x26, 0x7e, 0x00}, + {0x26, 0x7f, 0x00}, + {0x27, 0x08, 0x00}, + {0x27, 0x09, 0x00}, + {0x27, 0x0a, 0x00}, + {0x27, 0x0b, 0x00}, + {0x27, 0x0c, 0x00}, + {0x27, 0x0d, 0x00}, + {0x27, 0x0e, 0x00}, + {0x27, 0x0f, 0x00}, + {0x27, 0x10, 0x00}, + {0x27, 0x11, 0x00}, + {0x27, 0x12, 0x00}, + {0x27, 0x13, 0x00}, + {0x27, 0x14, 0x00}, + {0x27, 0x15, 0x00}, + {0x27, 0x16, 0x00}, + {0x27, 0x17, 0x00}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_right_lf_70[TAS5805M_EQ_PROFILE_REG_PER_STEP] = { + {0x26, 0x54, 0x00}, // Biquad - BQ1 Right - Filter: Low Pass-Chebyshev Frequency: 70 Hz QVal: 0.71 Bandwidth: 1000 Hz + {0x26, 0x55, 0x00}, + {0x26, 0x56, 0x03}, + {0x26, 0x57, 0xed}, + {0x26, 0x58, 0x00}, + {0x26, 0x59, 0x00}, + {0x26, 0x5a, 0x07}, + {0x26, 0x5b, 0xda}, + {0x26, 0x5c, 0x00}, + {0x26, 0x5d, 0x00}, + {0x26, 0x5e, 0x03}, + {0x26, 0x5f, 0xed}, + {0x26, 0x60, 0x0f}, + {0x26, 0x61, 0xf2}, + {0x26, 0x62, 0x9a}, + {0x26, 0x63, 0x28}, + {0x26, 0x64, 0xf8}, + {0x26, 0x65, 0x0d}, + {0x26, 0x66, 0x55}, + {0x26, 0x67, 0x36}, + {0x26, 0x68, 0x00}, // Biquad - BQ2 Right - Filter: Low Pass-Chebyshev Frequency: 70 Hz QVal: 0.71 Bandwidth: 1000 Hz + {0x26, 0x69, 0x00}, + {0x26, 0x6a, 0x03}, + {0x26, 0x6b, 0xed}, + {0x26, 0x6c, 0x00}, + {0x26, 0x6d, 0x00}, + {0x26, 0x6e, 0x07}, + {0x26, 0x6f, 0xda}, + {0x26, 0x70, 0x00}, + {0x26, 0x71, 0x00}, + {0x26, 0x72, 0x03}, + {0x26, 0x73, 0xed}, + {0x26, 0x74, 0x0f}, + {0x26, 0x75, 0xf2}, + {0x26, 0x76, 0x9a}, + {0x26, 0x77, 0x28}, + {0x26, 0x78, 0xf8}, + {0x26, 0x79, 0x0d}, + {0x26, 0x7a, 0x55}, + {0x26, 0x7b, 0x36}, + {0x26, 0x7c, 0x08}, // Biquad - BQ3 Right - Filter: All Pass Frequency: 1000 Hz QVal: 0.71 Bandwidth: 1000 Hz + {0x26, 0x7d, 0x00}, + {0x26, 0x7e, 0x00}, + {0x26, 0x7f, 0x00}, + {0x27, 0x08, 0x00}, + {0x27, 0x09, 0x00}, + {0x27, 0x0a, 0x00}, + {0x27, 0x0b, 0x00}, + {0x27, 0x0c, 0x00}, + {0x27, 0x0d, 0x00}, + {0x27, 0x0e, 0x00}, + {0x27, 0x0f, 0x00}, + {0x27, 0x10, 0x00}, + {0x27, 0x11, 0x00}, + {0x27, 0x12, 0x00}, + {0x27, 0x13, 0x00}, + {0x27, 0x14, 0x00}, + {0x27, 0x15, 0x00}, + {0x27, 0x16, 0x00}, + {0x27, 0x17, 0x00}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_right_lf_80[TAS5805M_EQ_PROFILE_REG_PER_STEP] = { + {0x26, 0x54, 0x00}, // Biquad - BQ1 Right - Filter: Low Pass-Chebyshev Frequency: 80 Hz QVal: 0.71 Bandwidth: 1000 Hz + {0x26, 0x55, 0x00}, + {0x26, 0x56, 0x05}, + {0x26, 0x57, 0x20}, + {0x26, 0x58, 0x00}, + {0x26, 0x59, 0x00}, + {0x26, 0x5a, 0x0a}, + {0x26, 0x5b, 0x40}, + {0x26, 0x5c, 0x00}, + {0x26, 0x5d, 0x00}, + {0x26, 0x5e, 0x05}, + {0x26, 0x5f, 0x20}, + {0x26, 0x60, 0x0f}, + {0x26, 0x61, 0xf0}, + {0x26, 0x62, 0xaf}, + {0x26, 0x63, 0x4c}, + {0x26, 0x64, 0xf8}, + {0x26, 0x65, 0x0f}, + {0x26, 0x66, 0x3a}, + {0x26, 0x67, 0xfe}, + {0x26, 0x68, 0x00}, // Biquad - BQ2 Left - Filter: Low Pass-Chebyshev Frequency: 80 Hz QVal: 0.71 Bandwidth: 1000 Hz + {0x26, 0x69, 0x00}, + {0x26, 0x6a, 0x05}, + {0x26, 0x6b, 0x20}, + {0x26, 0x6c, 0x00}, + {0x26, 0x6d, 0x00}, + {0x26, 0x6e, 0x0a}, + {0x26, 0x6f, 0x40}, + {0x26, 0x70, 0x00}, + {0x26, 0x71, 0x00}, + {0x26, 0x72, 0x05}, + {0x26, 0x73, 0x20}, + {0x26, 0x74, 0x0f}, + {0x26, 0x75, 0xf0}, + {0x26, 0x76, 0xaf}, + {0x26, 0x77, 0x4c}, + {0x26, 0x78, 0xf8}, + {0x26, 0x79, 0x0f}, + {0x26, 0x7a, 0x3a}, + {0x26, 0x7b, 0xfe}, + {0x26, 0x7c, 0x08}, // Biquad - BQ3 Right - Filter: All Pass Frequency: 1000 Hz QVal: 0.71 Bandwidth: 1000 Hz + {0x26, 0x7d, 0x00}, + {0x26, 0x7e, 0x00}, + {0x26, 0x7f, 0x00}, + {0x27, 0x08, 0x00}, + {0x27, 0x09, 0x00}, + {0x27, 0x0a, 0x00}, + {0x27, 0x0b, 0x00}, + {0x27, 0x0c, 0x00}, + {0x27, 0x0d, 0x00}, + {0x27, 0x0e, 0x00}, + {0x27, 0x0f, 0x00}, + {0x27, 0x10, 0x00}, + {0x27, 0x11, 0x00}, + {0x27, 0x12, 0x00}, + {0x27, 0x13, 0x00}, + {0x27, 0x14, 0x00}, + {0x27, 0x15, 0x00}, + {0x27, 0x16, 0x00}, + {0x27, 0x17, 0x00}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_right_lf_90[TAS5805M_EQ_PROFILE_REG_PER_STEP] = { + {0x26, 0x54, 0x00}, // Biquad - BQ1 Right - Filter: Low Pass-Chebyshev Frequency: 90 Hz QVal: 0.71 Bandwidth: 1000 Hz + {0x26, 0x55, 0x00}, + {0x26, 0x56, 0x06}, + {0x26, 0x57, 0x7c}, + {0x26, 0x58, 0x00}, + {0x26, 0x59, 0x00}, + {0x26, 0x5a, 0x0c}, + {0x26, 0x5b, 0xf7}, + {0x26, 0x5c, 0x00}, + {0x26, 0x5d, 0x00}, + {0x26, 0x5e, 0x06}, + {0x26, 0x5f, 0x7c}, + {0x26, 0x60, 0x0f}, + {0x26, 0x61, 0xee}, + {0x26, 0x62, 0xc4}, + {0x26, 0x63, 0x37}, + {0x26, 0x64, 0xf8}, + {0x26, 0x65, 0x11}, + {0x26, 0x66, 0x20}, + {0x26, 0x67, 0x52}, + {0x26, 0x68, 0x00}, // Biquad - BQ2 Right - Filter: Low Pass-Chebyshev Frequency: 90 Hz QVal: 0.71 Bandwidth: 1000 Hz + {0x26, 0x69, 0x00}, + {0x26, 0x6a, 0x06}, + {0x26, 0x6b, 0x7c}, + {0x26, 0x6c, 0x00}, + {0x26, 0x6d, 0x00}, + {0x26, 0x6e, 0x0c}, + {0x26, 0x6f, 0xf7}, + {0x26, 0x70, 0x00}, + {0x26, 0x71, 0x00}, + {0x26, 0x72, 0x06}, + {0x26, 0x73, 0x7c}, + {0x26, 0x74, 0x0f}, + {0x26, 0x75, 0xee}, + {0x26, 0x76, 0xc4}, + {0x26, 0x77, 0x37}, + {0x26, 0x78, 0xf8}, + {0x26, 0x79, 0x11}, + {0x26, 0x7a, 0x20}, + {0x26, 0x7b, 0x52}, + {0x26, 0x7c, 0x08}, // Biquad - BQ3 Right - Filter: All Pass Frequency: 1000 Hz QVal: 0.71 Bandwidth: 1000 Hz + {0x26, 0x7d, 0x00}, + {0x26, 0x7e, 0x00}, + {0x26, 0x7f, 0x00}, + {0x27, 0x08, 0x00}, + {0x27, 0x09, 0x00}, + {0x27, 0x0a, 0x00}, + {0x27, 0x0b, 0x00}, + {0x27, 0x0c, 0x00}, + {0x27, 0x0d, 0x00}, + {0x27, 0x0e, 0x00}, + {0x27, 0x0f, 0x00}, + {0x27, 0x10, 0x00}, + {0x27, 0x11, 0x00}, + {0x27, 0x12, 0x00}, + {0x27, 0x13, 0x00}, + {0x27, 0x14, 0x00}, + {0x27, 0x15, 0x00}, + {0x27, 0x16, 0x00}, + {0x27, 0x17, 0x00}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_right_lf_100[TAS5805M_EQ_PROFILE_REG_PER_STEP] = { + {0x26, 0x54, 0x00}, // Biquad - BQ1 Right - Filter: Low Pass-Chebyshev Frequency: 100 Hz QVal: 0.71 Bandwidth: 1000 Hz + {0x26, 0x55, 0x00}, + {0x26, 0x56, 0x08}, + {0x26, 0x57, 0x00}, + {0x26, 0x58, 0x00}, + {0x26, 0x59, 0x00}, + {0x26, 0x5a, 0x10}, + {0x26, 0x5b, 0x00}, + {0x26, 0x5c, 0x00}, + {0x26, 0x5d, 0x00}, + {0x26, 0x5e, 0x08}, + {0x26, 0x5f, 0x00}, + {0x26, 0x60, 0x0f}, + {0x26, 0x61, 0xec}, + {0x26, 0x62, 0xd8}, + {0x26, 0x63, 0xea}, + {0x26, 0x64, 0xf8}, + {0x26, 0x65, 0x13}, + {0x26, 0x66, 0x05}, + {0x26, 0x67, 0x31}, + {0x26, 0x68, 0x00}, // Biquad - BQ2 Right - Filter: Low Pass-Chebyshev Frequency: 100 Hz QVal: 0.71 Bandwidth: 1000 Hz + {0x26, 0x69, 0x00}, + {0x26, 0x6a, 0x08}, + {0x26, 0x6b, 0x00}, + {0x26, 0x6c, 0x00}, + {0x26, 0x6d, 0x00}, + {0x26, 0x6e, 0x10}, + {0x26, 0x6f, 0x00}, + {0x26, 0x70, 0x00}, + {0x26, 0x71, 0x00}, + {0x26, 0x72, 0x08}, + {0x26, 0x73, 0x00}, + {0x26, 0x74, 0x0f}, + {0x26, 0x75, 0xec}, + {0x26, 0x76, 0xd8}, + {0x26, 0x77, 0xea}, + {0x26, 0x78, 0xf8}, + {0x26, 0x79, 0x13}, + {0x26, 0x7a, 0x05}, + {0x26, 0x7b, 0x31}, + {0x26, 0x7c, 0x08}, // Biquad - BQ3 Right - Filter: All Pass Frequency: 1000 Hz QVal: 0.71 Bandwidth: 1000 Hz + {0x26, 0x7d, 0x00}, + {0x26, 0x7e, 0x00}, + {0x26, 0x7f, 0x00}, + {0x27, 0x08, 0x00}, + {0x27, 0x09, 0x00}, + {0x27, 0x0a, 0x00}, + {0x27, 0x0b, 0x00}, + {0x27, 0x0c, 0x00}, + {0x27, 0x0d, 0x00}, + {0x27, 0x0e, 0x00}, + {0x27, 0x0f, 0x00}, + {0x27, 0x10, 0x00}, + {0x27, 0x11, 0x00}, + {0x27, 0x12, 0x00}, + {0x27, 0x13, 0x00}, + {0x27, 0x14, 0x00}, + {0x27, 0x15, 0x00}, + {0x27, 0x16, 0x00}, + {0x27, 0x17, 0x00}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_right_lf_110[TAS5805M_EQ_PROFILE_REG_PER_STEP] = { + {0x26, 0x54, 0x00}, // Biquad - BQ1 Left - Filter: Low Pass-Chebyshev Frequency: 110 Hz QVal: 0.71 Bandwidth: 1000 + {0x26, 0x55, 0x00}, + {0x26, 0x56, 0x09}, + {0x26, 0x57, 0xad}, + {0x26, 0x58, 0x00}, + {0x26, 0x59, 0x00}, + {0x26, 0x5a, 0x13}, + {0x26, 0x5b, 0x59}, + {0x26, 0x5c, 0x00}, + {0x26, 0x5d, 0x00}, + {0x26, 0x5e, 0x09}, + {0x26, 0x5f, 0xad}, + {0x26, 0x60, 0x0f}, + {0x26, 0x61, 0xea}, + {0x26, 0x62, 0xed}, + {0x26, 0x63, 0x66}, + {0x26, 0x64, 0xf8}, + {0x26, 0x65, 0x14}, + {0x26, 0x66, 0xe9}, + {0x26, 0x67, 0x9c}, + {0x26, 0x68, 0x00}, // Biquad - BQ2 Left - Filter: Low Pass-Chebyshev Frequency: 110 Hz QVal: 0.71 Bandwidth: 1000 + {0x26, 0x69, 0x00}, + {0x26, 0x6a, 0x09}, + {0x26, 0x6b, 0xad}, + {0x26, 0x6c, 0x00}, + {0x26, 0x6d, 0x00}, + {0x26, 0x6e, 0x13}, + {0x26, 0x6f, 0x59}, + {0x26, 0x70, 0x00}, + {0x26, 0x71, 0x00}, + {0x26, 0x72, 0x09}, + {0x26, 0x73, 0xad}, + {0x26, 0x74, 0x0f}, + {0x26, 0x75, 0xea}, + {0x26, 0x76, 0xed}, + {0x26, 0x77, 0x66}, + {0x26, 0x78, 0xf8}, + {0x26, 0x79, 0x14}, + {0x26, 0x7a, 0xe9}, + {0x26, 0x7b, 0x9c}, + {0x26, 0x7c, 0x08}, // Biquad - BQ3 Right - Filter: All Pass Frequency: 1000 Hz QVal: 0.71 Bandwidth: 1000 Hz + {0x26, 0x7d, 0x00}, + {0x26, 0x7e, 0x00}, + {0x26, 0x7f, 0x00}, + {0x27, 0x08, 0x00}, + {0x27, 0x09, 0x00}, + {0x27, 0x0a, 0x00}, + {0x27, 0x0b, 0x00}, + {0x27, 0x0c, 0x00}, + {0x27, 0x0d, 0x00}, + {0x27, 0x0e, 0x00}, + {0x27, 0x0f, 0x00}, + {0x27, 0x10, 0x00}, + {0x27, 0x11, 0x00}, + {0x27, 0x12, 0x00}, + {0x27, 0x13, 0x00}, + {0x27, 0x14, 0x00}, + {0x27, 0x15, 0x00}, + {0x27, 0x16, 0x00}, + {0x27, 0x17, 0x00}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_right_lf_120[TAS5805M_EQ_PROFILE_REG_PER_STEP] = { + {0x26, 0x54, 0x00}, // Biquad - BQ1 Left - Filter: Low Pass-Chebyshev Frequency: 120 Hz QVal: 0.71 Bandwidth: 1000 Hz + {0x26, 0x55, 0x00}, + {0x26, 0x56, 0x0b}, + {0x26, 0x57, 0x82}, + {0x26, 0x58, 0x00}, + {0x26, 0x59, 0x00}, + {0x26, 0x5a, 0x17}, + {0x26, 0x5b, 0x04}, + {0x26, 0x5c, 0x00}, + {0x26, 0x5d, 0x00}, + {0x26, 0x5e, 0x0b}, + {0x26, 0x5f, 0x82}, + {0x26, 0x60, 0x0f}, + {0x26, 0x61, 0xe9}, + {0x26, 0x62, 0x01}, + {0x26, 0x63, 0xaa}, + {0x26, 0x64, 0xf8}, + {0x26, 0x65, 0x16}, + {0x26, 0x66, 0xcd}, + {0x26, 0x67, 0x93}, + {0x26, 0x68, 0x00}, // Biquad - BQ2 Right - Filter: Low Pass-Chebyshev Frequency: 120 Hz QVal: 0.71 Bandwidth: 1000 Hz + {0x26, 0x69, 0x00}, + {0x26, 0x6a, 0x0b}, + {0x26, 0x6b, 0x82}, + {0x26, 0x6c, 0x00}, + {0x26, 0x6d, 0x00}, + {0x26, 0x6e, 0x17}, + {0x26, 0x6f, 0x04}, + {0x26, 0x70, 0x00}, + {0x26, 0x71, 0x00}, + {0x26, 0x72, 0x0b}, + {0x26, 0x73, 0x82}, + {0x26, 0x74, 0x0f}, + {0x26, 0x75, 0xe9}, + {0x26, 0x76, 0x01}, + {0x26, 0x77, 0xaa}, + {0x26, 0x78, 0xf8}, + {0x26, 0x79, 0x16}, + {0x26, 0x7a, 0xcd}, + {0x26, 0x7b, 0x93}, + {0x26, 0x7c, 0x08}, // Biquad - BQ3 Right - Filter: All Pass Frequency: 1000 Hz QVal: 0.71 Bandwidth: 1000 Hz + {0x26, 0x7d, 0x00}, + {0x26, 0x7e, 0x00}, + {0x26, 0x7f, 0x00}, + {0x27, 0x08, 0x00}, + {0x27, 0x09, 0x00}, + {0x27, 0x0a, 0x00}, + {0x27, 0x0b, 0x00}, + {0x27, 0x0c, 0x00}, + {0x27, 0x0d, 0x00}, + {0x27, 0x0e, 0x00}, + {0x27, 0x0f, 0x00}, + {0x27, 0x10, 0x00}, + {0x27, 0x11, 0x00}, + {0x27, 0x12, 0x00}, + {0x27, 0x13, 0x00}, + {0x27, 0x14, 0x00}, + {0x27, 0x15, 0x00}, + {0x27, 0x16, 0x00}, + {0x27, 0x17, 0x00}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_right_lf_130[TAS5805M_EQ_PROFILE_REG_PER_STEP] = { + {0x26, 0x54, 0x00}, // Biquad - BQ1 Left - Filter: Low Pass-Chebyshev Frequency: 130 Hz QVal: 0.71 Bandwidth: 1000 + {0x26, 0x55, 0x00}, + {0x26, 0x56, 0x0d}, + {0x26, 0x57, 0x80}, + {0x26, 0x58, 0x00}, + {0x26, 0x59, 0x00}, + {0x26, 0x5a, 0x1b}, + {0x26, 0x5b, 0x00}, + {0x26, 0x5c, 0x00}, + {0x26, 0x5d, 0x00}, + {0x26, 0x5e, 0x0d}, + {0x26, 0x5f, 0x80}, + {0x26, 0x60, 0x0f}, + {0x26, 0x61, 0xe7}, + {0x26, 0x62, 0x15}, + {0x26, 0x63, 0xb6}, + {0x26, 0x64, 0xf8}, + {0x26, 0x65, 0x18}, + {0x26, 0x66, 0xb1}, + {0x26, 0x67, 0x16}, + {0x26, 0x68, 0x00}, // Biquad - BQ2 Right - Filter: Low Pass-Chebyshev Frequency: 130 Hz QVal: 0.71 Bandwidth: 1000 Hz + {0x26, 0x69, 0x00}, + {0x26, 0x6a, 0x0d}, + {0x26, 0x6b, 0x80}, + {0x26, 0x6c, 0x00}, + {0x26, 0x6d, 0x00}, + {0x26, 0x6e, 0x1b}, + {0x26, 0x6f, 0x00}, + {0x26, 0x70, 0x00}, + {0x26, 0x71, 0x00}, + {0x26, 0x72, 0x0d}, + {0x26, 0x73, 0x80}, + {0x26, 0x74, 0x0f}, + {0x26, 0x75, 0xe7}, + {0x26, 0x76, 0x15}, + {0x26, 0x77, 0xb6}, + {0x26, 0x78, 0xf8}, + {0x26, 0x79, 0x18}, + {0x26, 0x7a, 0xb1}, + {0x26, 0x7b, 0x16}, + {0x26, 0x7c, 0x08}, // Biquad - BQ3 Right - Filter: All Pass Frequency: 1000 Hz QVal: 0.71 Bandwidth: 1000 Hz + {0x26, 0x7d, 0x00}, + {0x26, 0x7e, 0x00}, + {0x26, 0x7f, 0x00}, + {0x27, 0x08, 0x00}, + {0x27, 0x09, 0x00}, + {0x27, 0x0a, 0x00}, + {0x27, 0x0b, 0x00}, + {0x27, 0x0c, 0x00}, + {0x27, 0x0d, 0x00}, + {0x27, 0x0e, 0x00}, + {0x27, 0x0f, 0x00}, + {0x27, 0x10, 0x00}, + {0x27, 0x11, 0x00}, + {0x27, 0x12, 0x00}, + {0x27, 0x13, 0x00}, + {0x27, 0x14, 0x00}, + {0x27, 0x15, 0x00}, + {0x27, 0x16, 0x00}, + {0x27, 0x17, 0x00}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_right_lf_140[TAS5805M_EQ_PROFILE_REG_PER_STEP] = { + {0x26, 0x54, 0x00}, // Biquad - BQ1 Right - Filter: Low Pass-Chebyshev Frequency: 140 Hz QVal: 0.71 Bandwidth: 1000 Hz + {0x26, 0x55, 0x00}, + {0x26, 0x56, 0x0f}, + {0x26, 0x57, 0xa6}, + {0x26, 0x58, 0x00}, + {0x26, 0x59, 0x00}, + {0x26, 0x5a, 0x1f}, + {0x26, 0x5b, 0x4d}, + {0x26, 0x5c, 0x00}, + {0x26, 0x5d, 0x00}, + {0x26, 0x5e, 0x0f}, + {0x26, 0x5f, 0xa6}, + {0x26, 0x60, 0x0f}, + {0x26, 0x61, 0xe5}, + {0x26, 0x62, 0x29}, + {0x26, 0x63, 0x8b}, + {0x26, 0x64, 0xf8}, + {0x26, 0x65, 0x1a}, + {0x26, 0x66, 0x94}, + {0x26, 0x67, 0x26}, + {0x26, 0x68, 0x00}, // Biquad - BQ2 Right - Filter: Low Pass-Chebyshev Frequency: 140 Hz QVal: 0.71 Bandwidth: 1000 Hz + {0x26, 0x69, 0x00}, + {0x26, 0x6a, 0x0f}, + {0x26, 0x6b, 0xa6}, + {0x26, 0x6c, 0x00}, + {0x26, 0x6d, 0x00}, + {0x26, 0x6e, 0x1f}, + {0x26, 0x6f, 0x4d}, + {0x26, 0x70, 0x00}, + {0x26, 0x71, 0x00}, + {0x26, 0x72, 0x0f}, + {0x26, 0x73, 0xa6}, + {0x26, 0x74, 0x0f}, + {0x26, 0x75, 0xe5}, + {0x26, 0x76, 0x29}, + {0x26, 0x77, 0x8b}, + {0x26, 0x78, 0xf8}, + {0x26, 0x79, 0x1a}, + {0x26, 0x7a, 0x94}, + {0x26, 0x7b, 0x26}, + {0x26, 0x7c, 0x08}, // Biquad - BQ3 Right - Filter: All Pass Frequency: 1000 Hz QVal: 0.71 Bandwidth: 1000 Hz + {0x26, 0x7d, 0x00}, + {0x26, 0x7e, 0x00}, + {0x26, 0x7f, 0x00}, + {0x27, 0x08, 0x00}, + {0x27, 0x09, 0x00}, + {0x27, 0x0a, 0x00}, + {0x27, 0x0b, 0x00}, + {0x27, 0x0c, 0x00}, + {0x27, 0x0d, 0x00}, + {0x27, 0x0e, 0x00}, + {0x27, 0x0f, 0x00}, + {0x27, 0x10, 0x00}, + {0x27, 0x11, 0x00}, + {0x27, 0x12, 0x00}, + {0x27, 0x13, 0x00}, + {0x27, 0x14, 0x00}, + {0x27, 0x15, 0x00}, + {0x27, 0x16, 0x00}, + {0x27, 0x17, 0x00}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_right_lf_150[TAS5805M_EQ_PROFILE_REG_PER_STEP] = { + {0x26, 0x54, 0x00}, // Biquad - BQ1 Right - Filter: Low Pass-Chebyshev Frequency: 150 Hz QVal: 0.71 Bandwidth: 1000 Hz + {0x26, 0x55, 0x00}, + {0x26, 0x56, 0x11}, + {0x26, 0x57, 0xf5}, + {0x26, 0x58, 0x00}, + {0x26, 0x59, 0x00}, + {0x26, 0x5a, 0x23}, + {0x26, 0x5b, 0xea}, + {0x26, 0x5c, 0x00}, + {0x26, 0x5d, 0x00}, + {0x26, 0x5e, 0x11}, + {0x26, 0x5f, 0xf5}, + {0x26, 0x60, 0x0f}, + {0x26, 0x61, 0xe3}, + {0x26, 0x62, 0x3d}, + {0x26, 0x63, 0x2a}, + {0x26, 0x64, 0xf8}, + {0x26, 0x65, 0x1c}, + {0x26, 0x66, 0x76}, + {0x26, 0x67, 0xc1}, + {0x26, 0x68, 0x00}, // Biquad - BQ2 Right - Filter: Low Pass-Chebyshev Frequency: 150 Hz QVal: 0.71 Bandwidth: 1000 Hz + {0x26, 0x69, 0x00}, + {0x26, 0x6a, 0x11}, + {0x26, 0x6b, 0xf5}, + {0x26, 0x6c, 0x00}, + {0x26, 0x6d, 0x00}, + {0x26, 0x6e, 0x23}, + {0x26, 0x6f, 0xea}, + {0x26, 0x70, 0x00}, + {0x26, 0x71, 0x00}, + {0x26, 0x72, 0x11}, + {0x26, 0x73, 0xf5}, + {0x26, 0x74, 0x0f}, + {0x26, 0x75, 0xe3}, + {0x26, 0x76, 0x3d}, + {0x26, 0x77, 0x2a}, + {0x26, 0x78, 0xf8}, + {0x26, 0x79, 0x1c}, + {0x26, 0x7a, 0x76}, + {0x26, 0x7b, 0xc1}, + {0x26, 0x7c, 0x08}, // Biquad - BQ3 Right - Filter: All Pass Frequency: 1000 Hz QVal: 0.71 Bandwidth: 1000 Hz + {0x26, 0x7d, 0x00}, + {0x26, 0x7e, 0x00}, + {0x26, 0x7f, 0x00}, + {0x27, 0x08, 0x00}, + {0x27, 0x09, 0x00}, + {0x27, 0x0a, 0x00}, + {0x27, 0x0b, 0x00}, + {0x27, 0x0c, 0x00}, + {0x27, 0x0d, 0x00}, + {0x27, 0x0e, 0x00}, + {0x27, 0x0f, 0x00}, + {0x27, 0x10, 0x00}, + {0x27, 0x11, 0x00}, + {0x27, 0x12, 0x00}, + {0x27, 0x13, 0x00}, + {0x27, 0x14, 0x00}, + {0x27, 0x15, 0x00}, + {0x27, 0x16, 0x00}, + {0x27, 0x17, 0x00}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_right_hf_60[TAS5805M_EQ_PROFILE_REG_PER_STEP] = { + {0x26, 0x54, 0x07}, // Biquad - BQ1 Right - Filter: High Pass-Chebyshev Frequency: 60 Hz QVal: 0.5 Bandwidth: 1000 Hz + {0x26, 0x55, 0x89}, + {0x26, 0x56, 0xde}, + {0x26, 0x57, 0x6d}, + {0x26, 0x58, 0xf0}, + {0x26, 0x59, 0xec}, + {0x26, 0x5a, 0x43}, + {0x26, 0x5b, 0x27}, + {0x26, 0x5c, 0x07}, + {0x26, 0x5d, 0x89}, + {0x26, 0x5e, 0xde}, + {0x26, 0x5f, 0x6d}, + {0x26, 0x60, 0x0f}, + {0x26, 0x61, 0xf8}, + {0x26, 0x62, 0x6e}, + {0x26, 0x63, 0x5f}, + {0x26, 0x64, 0xf8}, + {0x26, 0x65, 0x07}, + {0x26, 0x66, 0x8c}, + {0x26, 0x67, 0x4f}, + {0x26, 0x68, 0x07}, // Biquad - BQ2 Right - Filter: High Pass-Chebyshev Frequency: 60 Hz QVal: 0.5 Bandwidth: 1000 Hz + {0x26, 0x69, 0x89}, + {0x26, 0x6a, 0xde}, + {0x26, 0x6b, 0x6d}, + {0x26, 0x6c, 0xf0}, + {0x26, 0x6d, 0xec}, + {0x26, 0x6e, 0x43}, + {0x26, 0x6f, 0x27}, + {0x26, 0x70, 0x07}, + {0x26, 0x71, 0x89}, + {0x26, 0x72, 0xde}, + {0x26, 0x73, 0x6d}, + {0x26, 0x74, 0x0f}, + {0x26, 0x75, 0xf8}, + {0x26, 0x76, 0x6e}, + {0x26, 0x77, 0x5f}, + {0x26, 0x78, 0xf8}, + {0x26, 0x79, 0x07}, + {0x26, 0x7a, 0x8c}, + {0x26, 0x7b, 0x4f}, + {0x26, 0x7c, 0x08}, // Biquad - BQ3 Right - Filter: High Shelf Frequency: 200 Hz Gain: 1dB QVal: 0.5 + {0x26, 0x7d, 0xf8}, + {0x26, 0x7e, 0x2c}, + {0x26, 0x7f, 0x87}, + {0x27, 0x08, 0xee}, + {0x27, 0x09, 0x49}, + {0x27, 0x0a, 0xb1}, + {0x27, 0x0b, 0x28}, + {0x27, 0x0c, 0x08}, + {0x27, 0x0d, 0xbe}, + {0x27, 0x0e, 0x80}, + {0x27, 0x0f, 0x36}, + {0x27, 0x10, 0x0f}, + {0x27, 0x11, 0xc9}, + {0x27, 0x12, 0x2f}, + {0x27, 0x13, 0xb1}, + {0x27, 0x14, 0xf8}, + {0x27, 0x15, 0x36}, + {0x27, 0x16, 0x72}, + {0x27, 0x17, 0x6a}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_right_hf_70[TAS5805M_EQ_PROFILE_REG_PER_STEP] = { + {0x26, 0x54, 0x07}, // Biquad - BQ1 Left - Filter: High Pass-Chebyshev Frequency: 70 Hz QVal: 0.5 Bandwidth: 1000 + {0x26, 0x55, 0x89}, + {0x26, 0x56, 0x46}, + {0x26, 0x57, 0x48}, + {0x26, 0x58, 0xf0}, + {0x26, 0x59, 0xed}, + {0x26, 0x5a, 0x73}, + {0x26, 0x5b, 0x70}, + {0x26, 0x5c, 0x07}, + {0x26, 0x5d, 0x89}, + {0x26, 0x5e, 0x46}, + {0x26, 0x5f, 0x48}, + {0x26, 0x60, 0x0f}, + {0x26, 0x61, 0xf7}, + {0x26, 0x62, 0x2b}, + {0x26, 0x63, 0x18}, + {0x26, 0x64, 0xf8}, + {0x26, 0x65, 0x08}, + {0x26, 0x66, 0xcd}, + {0x26, 0x67, 0xaa}, + {0x26, 0x68, 0x07}, // Biquad - BQ2 Left - Filter: High Pass-Chebyshev Frequency: 70 Hz QVal: 0.5 Bandwidth: 1000 + {0x26, 0x69, 0x89}, + {0x26, 0x6a, 0x46}, + {0x26, 0x6b, 0x48}, + {0x26, 0x6c, 0xf0}, + {0x26, 0x6d, 0xed}, + {0x26, 0x6e, 0x73}, + {0x26, 0x6f, 0x70}, + {0x26, 0x70, 0x07}, + {0x26, 0x71, 0x89}, + {0x26, 0x72, 0x46}, + {0x26, 0x73, 0x48}, + {0x26, 0x74, 0x0f}, + {0x26, 0x75, 0xf7}, + {0x26, 0x76, 0x2b}, + {0x26, 0x77, 0x18}, + {0x26, 0x78, 0xf8}, + {0x26, 0x79, 0x08}, + {0x26, 0x7a, 0xcd}, + {0x26, 0x7b, 0xaa}, + {0x26, 0x7c, 0x08}, // Biquad - BQ3 Left - Filter: High Shelf Frequency: 200 Hz Gain: 1dB QVal: 0.5 + {0x26, 0x7d, 0xf8}, + {0x26, 0x7e, 0x2c}, + {0x26, 0x7f, 0x87}, + {0x27, 0x08, 0xee}, + {0x27, 0x09, 0x49}, + {0x27, 0x0a, 0xb1}, + {0x27, 0x0b, 0x28}, + {0x27, 0x0c, 0x08}, + {0x27, 0x0d, 0xbe}, + {0x27, 0x0e, 0x80}, + {0x27, 0x0f, 0x36}, + {0x27, 0x10, 0x0f}, + {0x27, 0x11, 0xc9}, + {0x27, 0x12, 0x2f}, + {0x27, 0x13, 0xb1}, + {0x27, 0x14, 0xf8}, + {0x27, 0x15, 0x36}, + {0x27, 0x16, 0x72}, + {0x27, 0x17, 0x6a}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_right_hf_80[TAS5805M_EQ_PROFILE_REG_PER_STEP] = { + {0x26, 0x54, 0x07}, // Biquad - BQ1 Right - Filter: High Pass-Chebyshev Frequency: 80 Hz QVal: 0.5 Bandwidth: 1000 Hz + {0x26, 0x55, 0x88}, + {0x26, 0x56, 0xae}, + {0x26, 0x57, 0x29}, + {0x26, 0x58, 0xf0}, + {0x26, 0x59, 0xee}, + {0x26, 0x5a, 0xa3}, + {0x26, 0x5b, 0xae}, + {0x26, 0x5c, 0x07}, + {0x26, 0x5d, 0x88}, + {0x26, 0x5e, 0xae}, + {0x26, 0x5f, 0x29}, + {0x26, 0x60, 0x0f}, + {0x26, 0x61, 0xf5}, + {0x26, 0x62, 0xe7}, + {0x26, 0x63, 0xb8}, + {0x26, 0x64, 0xf8}, + {0x26, 0x65, 0x0a}, + {0x26, 0x66, 0x0e}, + {0x26, 0x67, 0xd3}, + {0x26, 0x68, 0x07}, // Biquad - BQ2 Right - Filter: High Pass-Chebyshev Frequency: 80 Hz QVal: 0.5 Bandwidth: 1000 Hz + {0x26, 0x69, 0x88}, + {0x26, 0x6a, 0xae}, + {0x26, 0x6b, 0x29}, + {0x26, 0x6c, 0xf0}, + {0x26, 0x6d, 0xee}, + {0x26, 0x6e, 0xa3}, + {0x26, 0x6f, 0xae}, + {0x26, 0x70, 0x07}, + {0x26, 0x71, 0x88}, + {0x26, 0x72, 0xae}, + {0x26, 0x73, 0x29}, + {0x26, 0x74, 0x0f}, + {0x26, 0x75, 0xf5}, + {0x26, 0x76, 0xe7}, + {0x26, 0x77, 0xb8}, + {0x26, 0x78, 0xf8}, + {0x26, 0x79, 0x0a}, + {0x26, 0x7a, 0x0e}, + {0x26, 0x7b, 0xd3}, + {0x26, 0x7c, 0x08}, // Biquad - BQ3 Right - Filter: High Shelf Frequency: 200 Hz Gain: 1dB QVal: 0.5 + {0x26, 0x7d, 0xf8}, + {0x26, 0x7e, 0x2c}, + {0x26, 0x7f, 0x87}, + {0x27, 0x08, 0xee}, + {0x27, 0x09, 0x49}, + {0x27, 0x0a, 0xb1}, + {0x27, 0x0b, 0x28}, + {0x27, 0x0c, 0x08}, + {0x27, 0x0d, 0xbe}, + {0x27, 0x0e, 0x80}, + {0x27, 0x0f, 0x36}, + {0x27, 0x10, 0x0f}, + {0x27, 0x11, 0xc9}, + {0x27, 0x12, 0x2f}, + {0x27, 0x13, 0xb1}, + {0x27, 0x14, 0xf8}, + {0x27, 0x15, 0x36}, + {0x27, 0x16, 0x72}, + {0x27, 0x17, 0x6a}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_right_hf_90[TAS5805M_EQ_PROFILE_REG_PER_STEP] = { + {0x26, 0x54, 0x07}, // Biquad - BQ1 Right - Filter: High Pass-Chebyshev Frequency: 90 Hz QVal: 0.5 Bandwidth: 1000 Hz + {0x26, 0x55, 0x88}, + {0x26, 0x56, 0x16}, + {0x26, 0x57, 0x11}, + {0x26, 0x58, 0xf0}, + {0x26, 0x59, 0xef}, + {0x26, 0x5a, 0xd3}, + {0x26, 0x5b, 0xdf}, + {0x26, 0x5c, 0x07}, + {0x26, 0x5d, 0x88}, + {0x26, 0x5e, 0x16}, + {0x26, 0x5f, 0x11}, + {0x26, 0x60, 0x0f}, + {0x26, 0x61, 0xf4}, + {0x26, 0x62, 0xa4}, + {0x26, 0x63, 0x3f}, + {0x26, 0x64, 0xf8}, + {0x26, 0x65, 0x0b}, + {0x26, 0x66, 0x4f}, + {0x26, 0x67, 0xca}, + {0x26, 0x68, 0x07}, // Biquad - BQ2 Right - Filter: High Pass-Chebyshev Frequency: 90 Hz QVal: 0.5 Bandwidth: 1000 Hz + {0x26, 0x69, 0x88}, + {0x26, 0x6a, 0x16}, + {0x26, 0x6b, 0x11}, + {0x26, 0x6c, 0xf0}, + {0x26, 0x6d, 0xef}, + {0x26, 0x6e, 0xd3}, + {0x26, 0x6f, 0xdf}, + {0x26, 0x70, 0x07}, + {0x26, 0x71, 0x88}, + {0x26, 0x72, 0x16}, + {0x26, 0x73, 0x11}, + {0x26, 0x74, 0x0f}, + {0x26, 0x75, 0xf4}, + {0x26, 0x76, 0xa4}, + {0x26, 0x77, 0x3f}, + {0x26, 0x78, 0xf8}, + {0x26, 0x79, 0x0b}, + {0x26, 0x7a, 0x4f}, + {0x26, 0x7b, 0xca}, + {0x26, 0x7c, 0x08}, // Biquad - BQ3 Right - Filter: High Shelf Frequency: 200 Hz Gain: 1dB QVal: 0.5 + {0x26, 0x7d, 0xf8}, + {0x26, 0x7e, 0x2c}, + {0x26, 0x7f, 0x87}, + {0x27, 0x08, 0xee}, + {0x27, 0x09, 0x49}, + {0x27, 0x0a, 0xb1}, + {0x27, 0x0b, 0x28}, + {0x27, 0x0c, 0x08}, + {0x27, 0x0d, 0xbe}, + {0x27, 0x0e, 0x80}, + {0x27, 0x0f, 0x36}, + {0x27, 0x10, 0x0f}, + {0x27, 0x11, 0xc9}, + {0x27, 0x12, 0x2f}, + {0x27, 0x13, 0xb1}, + {0x27, 0x14, 0xf8}, + {0x27, 0x15, 0x36}, + {0x27, 0x16, 0x72}, + {0x27, 0x17, 0x6a}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_right_hf_100[TAS5805M_EQ_PROFILE_REG_PER_STEP] = { + {0x26, 0x54, 0x07}, // Biquad - BQ1 Right - Filter: High Pass-Chebyshev Frequency: 100 Hz QVal: 0.5 Bandwidth: 1000 Hz + {0x26, 0x55, 0x87}, + {0x26, 0x56, 0x7d}, + {0x26, 0x57, 0xfe}, + {0x26, 0x58, 0xf0}, + {0x26, 0x59, 0xf1}, + {0x26, 0x5a, 0x04}, + {0x26, 0x5b, 0x04}, + {0x26, 0x5c, 0x07}, + {0x26, 0x5d, 0x87}, + {0x26, 0x5e, 0x7d}, + {0x26, 0x5f, 0xfe}, + {0x26, 0x60, 0x0f}, + {0x26, 0x61, 0xf3}, + {0x26, 0x62, 0x60}, + {0x26, 0x63, 0xae}, + {0x26, 0x64, 0xf8}, + {0x26, 0x65, 0x0c}, + {0x26, 0x66, 0x90}, + {0x26, 0x67, 0x8e}, + {0x26, 0x68, 0x07}, // Biquad - BQ2 Right - Filter: High Pass-Chebyshev Frequency: 100 Hz QVal: 0.5 Bandwidth: 1000 Hz + {0x26, 0x69, 0x87}, + {0x26, 0x6a, 0x7d}, + {0x26, 0x6b, 0xfe}, + {0x26, 0x6c, 0xf0}, + {0x26, 0x6d, 0xf1}, + {0x26, 0x6e, 0x04}, + {0x26, 0x6f, 0x04}, + {0x26, 0x70, 0x07}, + {0x26, 0x71, 0x87}, + {0x26, 0x72, 0x7d}, + {0x26, 0x73, 0xfe}, + {0x26, 0x74, 0x0f}, + {0x26, 0x75, 0xf3}, + {0x26, 0x76, 0x60}, + {0x26, 0x77, 0xae}, + {0x26, 0x78, 0xf8}, + {0x26, 0x79, 0x0c}, + {0x26, 0x7a, 0x90}, + {0x26, 0x7b, 0x8e}, + {0x26, 0x7c, 0x08}, // Biquad - BQ3 Right - Filter: High Shelf Frequency: 200 Hz Gain: 1dB QVal: 0.5 + {0x26, 0x7d, 0xf8}, + {0x26, 0x7e, 0x2c}, + {0x26, 0x7f, 0x87}, + {0x27, 0x08, 0xee}, + {0x27, 0x09, 0x49}, + {0x27, 0x0a, 0xb1}, + {0x27, 0x0b, 0x28}, + {0x27, 0x0c, 0x08}, + {0x27, 0x0d, 0xbe}, + {0x27, 0x0e, 0x80}, + {0x27, 0x0f, 0x36}, + {0x27, 0x10, 0x0f}, + {0x27, 0x11, 0xc9}, + {0x27, 0x12, 0x2f}, + {0x27, 0x13, 0xb1}, + {0x27, 0x14, 0xf8}, + {0x27, 0x15, 0x36}, + {0x27, 0x16, 0x72}, + {0x27, 0x17, 0x6a}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_right_hf_110[TAS5805M_EQ_PROFILE_REG_PER_STEP] = { + {0x26, 0x54, 0x07}, // Biquad - BQ1 Right - Filter: High Pass-Chebyshev Frequency: 110 Hz QVal: 0.5 Bandwidth: 1000 Hz + {0x26, 0x55, 0x86}, + {0x26, 0x56, 0xe5}, + {0x26, 0x57, 0xf2}, + {0x26, 0x58, 0xf0}, + {0x26, 0x59, 0xf2}, + {0x26, 0x5a, 0x34}, + {0x26, 0x5b, 0x1d}, + {0x26, 0x5c, 0x07}, + {0x26, 0x5d, 0x86}, + {0x26, 0x5e, 0xe5}, + {0x26, 0x5f, 0xf2}, + {0x26, 0x60, 0x0f}, + {0x26, 0x61, 0xf2}, + {0x26, 0x62, 0x1d}, + {0x26, 0x63, 0x04}, + {0x26, 0x64, 0xf8}, + {0x26, 0x65, 0x0d}, + {0x26, 0x66, 0xd1}, + {0x26, 0x67, 0x1f}, + {0x26, 0x68, 0x07}, // Biquad - BQ2 Right - Filter: High Pass-Chebyshev Frequency: 110 Hz QVal: 0.5 Bandwidth: 1000 Hz + {0x26, 0x69, 0x86}, + {0x26, 0x6a, 0xe5}, + {0x26, 0x6b, 0xf2}, + {0x26, 0x6c, 0xf0}, + {0x26, 0x6d, 0xf2}, + {0x26, 0x6e, 0x34}, + {0x26, 0x6f, 0x1d}, + {0x26, 0x70, 0x07}, + {0x26, 0x71, 0x86}, + {0x26, 0x72, 0xe5}, + {0x26, 0x73, 0xf2}, + {0x26, 0x74, 0x0f}, + {0x26, 0x75, 0xf2}, + {0x26, 0x76, 0x1d}, + {0x26, 0x77, 0x04}, + {0x26, 0x78, 0xf8}, + {0x26, 0x79, 0x0d}, + {0x26, 0x7a, 0xd1}, + {0x26, 0x7b, 0x1f}, + {0x26, 0x7c, 0x08}, // Biquad - BQ3 Right - Filter: High Shelf Frequency: 220 Hz Gain: 1dB QVal: 0.5 + {0x26, 0x7d, 0xf8}, + {0x26, 0x7e, 0x00}, + {0x26, 0x7f, 0xd4}, + {0x27, 0x08, 0xee}, + {0x27, 0x09, 0x4f}, + {0x27, 0x0a, 0xca}, + {0x27, 0x0b, 0xe2}, + {0x27, 0x0c, 0x08}, + {0x27, 0x0d, 0xb8}, + {0x27, 0x0e, 0xa5}, + {0x27, 0x0f, 0xbf}, + {0x27, 0x10, 0x0f}, + {0x27, 0x11, 0xc3}, + {0x27, 0x12, 0xbe}, + {0x27, 0x13, 0xbd}, + {0x27, 0x14, 0xf8}, + {0x27, 0x15, 0x3b}, + {0x27, 0x16, 0xcf}, + {0x27, 0x17, 0xce}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_right_hf_120[TAS5805M_EQ_PROFILE_REG_PER_STEP] = { + {0x26, 0x54, 0x07}, // Biquad - BQ1 Right - Filter: High Pass-Chebyshev Frequency: 120 Hz QVal: 0.5 Bandwidth: 1000 Hz + {0x26, 0x55, 0x86}, + {0x26, 0x56, 0x4d}, + {0x26, 0x57, 0xeb}, + {0x26, 0x58, 0xf0}, + {0x26, 0x59, 0xf3}, + {0x26, 0x5a, 0x64}, + {0x26, 0x5b, 0x29}, + {0x26, 0x5c, 0x07}, + {0x26, 0x5d, 0x86}, + {0x26, 0x5e, 0x4d}, + {0x26, 0x5f, 0xeb}, + {0x26, 0x60, 0x0f}, + {0x26, 0x61, 0xf0}, + {0x26, 0x62, 0xd9}, + {0x26, 0x63, 0x42}, + {0x26, 0x64, 0xf8}, + {0x26, 0x65, 0x0f}, + {0x26, 0x66, 0x11}, + {0x26, 0x67, 0x7e}, + {0x26, 0x68, 0x07}, // Biquad - BQ2 Right - Filter: High Pass-Chebyshev Frequency: 120 Hz QVal: 0.5 Bandwidth: 1000 Hz + {0x26, 0x69, 0x86}, + {0x26, 0x6a, 0x4d}, + {0x26, 0x6b, 0xeb}, + {0x26, 0x6c, 0xf0}, + {0x26, 0x6d, 0xf3}, + {0x26, 0x6e, 0x64}, + {0x26, 0x6f, 0x29}, + {0x26, 0x70, 0x07}, + {0x26, 0x71, 0x86}, + {0x26, 0x72, 0x4d}, + {0x26, 0x73, 0xeb}, + {0x26, 0x74, 0x0f}, + {0x26, 0x75, 0xf0}, + {0x26, 0x76, 0xd9}, + {0x26, 0x77, 0x42}, + {0x26, 0x78, 0xf8}, + {0x26, 0x79, 0x0f}, + {0x26, 0x7a, 0x11}, + {0x26, 0x7b, 0x7e}, + {0x26, 0x7c, 0x08}, // Biquad - BQ3 Right - Filter: High Shelf Frequency: 240 Hz Gain: 1dB QVal: 0.5 + {0x26, 0x7d, 0xf7}, + {0x26, 0x7e, 0xd5}, + {0x26, 0x7f, 0x31}, + {0x27, 0x08, 0xee}, + {0x27, 0x09, 0x55}, + {0x27, 0x0a, 0xe2}, + {0x27, 0x0b, 0x6d}, + {0x27, 0x0c, 0x08}, + {0x27, 0x0d, 0xb2}, + {0x27, 0x0e, 0xcf}, + {0x27, 0x0f, 0x3a}, + {0x27, 0x10, 0x0f}, + {0x27, 0x11, 0xbe}, + {0x27, 0x12, 0x4f}, + {0x27, 0x13, 0xa2}, + {0x27, 0x14, 0xf8}, + {0x27, 0x15, 0x41}, + {0x27, 0x16, 0x29}, + {0x27, 0x17, 0x86}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_right_hf_130[TAS5805M_EQ_PROFILE_REG_PER_STEP] = { + {0x26, 0x54, 0x07}, // Biquad - BQ1 Right - Filter: High Pass-Chebyshev Frequency: 130 Hz QVal: 0.5 Bandwidth: 1000 Hz + {0x26, 0x55, 0x85}, + {0x26, 0x56, 0xb5}, + {0x26, 0x57, 0xeb}, + {0x26, 0x58, 0xf0}, + {0x26, 0x59, 0xf4}, + {0x26, 0x5a, 0x94}, + {0x26, 0x5b, 0x29}, + {0x26, 0x5c, 0x07}, + {0x26, 0x5d, 0x85}, + {0x26, 0x5e, 0xb5}, + {0x26, 0x5f, 0xeb}, + {0x26, 0x60, 0x0f}, + {0x26, 0x61, 0xef}, + {0x26, 0x62, 0x95}, + {0x26, 0x63, 0x67}, + {0x26, 0x64, 0xf8}, + {0x26, 0x65, 0x10}, + {0x26, 0x66, 0x51}, + {0x26, 0x67, 0xaa}, + {0x26, 0x68, 0x07}, // Biquad - BQ2 Right - Filter: High Pass-Chebyshev Frequency: 130 Hz QVal: 0.5 Bandwidth: 1000 Hz + {0x26, 0x69, 0x85}, + {0x26, 0x6a, 0xb5}, + {0x26, 0x6b, 0xeb}, + {0x26, 0x6c, 0xf0}, + {0x26, 0x6d, 0xf4}, + {0x26, 0x6e, 0x94}, + {0x26, 0x6f, 0x29}, + {0x26, 0x70, 0x07}, + {0x26, 0x71, 0x85}, + {0x26, 0x72, 0xb5}, + {0x26, 0x73, 0xeb}, + {0x26, 0x74, 0x0f}, + {0x26, 0x75, 0xef}, + {0x26, 0x76, 0x95}, + {0x26, 0x77, 0x67}, + {0x26, 0x78, 0xf8}, + {0x26, 0x79, 0x10}, + {0x26, 0x7a, 0x51}, + {0x26, 0x7b, 0xaa}, + {0x26, 0x7c, 0x08}, // Biquad - BQ3 Right - Filter: High Shelf Frequency: 260 Hz Gain: 1dB QVal: 0.5 + {0x26, 0x7d, 0xf7}, + {0x26, 0x7e, 0xa9}, + {0x26, 0x7f, 0x9d}, + {0x27, 0x08, 0xee}, + {0x27, 0x09, 0x5b}, + {0x27, 0x0a, 0xf7}, + {0x27, 0x0b, 0xca}, + {0x27, 0x0c, 0x08}, + {0x27, 0x0d, 0xac}, + {0x27, 0x0e, 0xfc}, + {0x27, 0x0f, 0xa4}, + {0x27, 0x10, 0x0f}, + {0x27, 0x11, 0xb8}, + {0x27, 0x12, 0xe2}, + {0x27, 0x13, 0x5e}, + {0x27, 0x14, 0xf8}, + {0x27, 0x15, 0x46}, + {0x27, 0x16, 0x7f}, + {0x27, 0x17, 0x96}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_right_hf_140[TAS5805M_EQ_PROFILE_REG_PER_STEP] = { + {0x26, 0x54, 0x07}, // Biquad - BQ1 Right - Filter: High Pass-Chebyshev Frequency: 140 Hz QVal: 0.5 Bandwidth: 1000 Hz + {0x26, 0x55, 0x85}, + {0x26, 0x56, 0x1d}, + {0x26, 0x57, 0xf1}, + {0x26, 0x58, 0xf0}, + {0x26, 0x59, 0xf5}, + {0x26, 0x5a, 0xc4}, + {0x26, 0x5b, 0x1d}, + {0x26, 0x5c, 0x07}, + {0x26, 0x5d, 0x85}, + {0x26, 0x5e, 0x1d}, + {0x26, 0x5f, 0xf1}, + {0x26, 0x60, 0x0f}, + {0x26, 0x61, 0xee}, + {0x26, 0x62, 0x51}, + {0x26, 0x63, 0x74}, + {0x26, 0x64, 0xf8}, + {0x26, 0x65, 0x11}, + {0x26, 0x66, 0x91}, + {0x26, 0x67, 0xa4}, + {0x26, 0x68, 0x07}, // Biquad - BQ2 Right - Filter: High Pass-Chebyshev Frequency: 140 Hz QVal: 0.5 Bandwidth: 1000 Hz + {0x26, 0x69, 0x85}, + {0x26, 0x6a, 0x1d}, + {0x26, 0x6b, 0xf1}, + {0x26, 0x6c, 0xf0}, + {0x26, 0x6d, 0xf5}, + {0x26, 0x6e, 0xc4}, + {0x26, 0x6f, 0x1d}, + {0x26, 0x70, 0x07}, + {0x26, 0x71, 0x85}, + {0x26, 0x72, 0x1d}, + {0x26, 0x73, 0xf1}, + {0x26, 0x74, 0x0f}, + {0x26, 0x75, 0xee}, + {0x26, 0x76, 0x51}, + {0x26, 0x77, 0x74}, + {0x26, 0x78, 0xf8}, + {0x26, 0x79, 0x11}, + {0x26, 0x7a, 0x91}, + {0x26, 0x7b, 0xa4}, + {0x26, 0x7c, 0x08}, // Biquad - BQ3 Right - Filter: High Shelf Frequency: 280 Hz Gain: 1dB QVal: 0.5 + {0x26, 0x7d, 0xf7}, + {0x26, 0x7e, 0x7e}, + {0x26, 0x7f, 0x18}, + {0x27, 0x08, 0xee}, + {0x27, 0x09, 0x62}, + {0x27, 0x0a, 0x0a}, + {0x27, 0x0b, 0xfb}, + {0x27, 0x0c, 0x08}, + {0x27, 0x0d, 0xa7}, + {0x27, 0x0e, 0x2d}, + {0x27, 0x0f, 0xfa}, + {0x27, 0x10, 0x0f}, + {0x27, 0x11, 0xb3}, + {0x27, 0x12, 0x76}, + {0x27, 0x13, 0xf2}, + {0x27, 0x14, 0xf8}, + {0x27, 0x15, 0x4b}, + {0x27, 0x16, 0xd2}, + {0x27, 0x17, 0x01}, + }; + + static const reg_sequence_eq tas5805m_eq_registers_right_hf_150[TAS5805M_EQ_PROFILE_REG_PER_STEP] = { + {0x26, 0x54, 0x07}, // Biquad - BQ1 Right - Filter: High Pass-Chebyshev Frequency: 150 Hz QVal: 0.5 Bandwidth: 1000 Hz + {0x26, 0x55, 0x84}, + {0x26, 0x56, 0x85}, + {0x26, 0x57, 0xfd}, + {0x26, 0x58, 0xf0}, + {0x26, 0x59, 0xf6}, + {0x26, 0x5a, 0xf4}, + {0x26, 0x5b, 0x05}, + {0x26, 0x5c, 0x07}, + {0x26, 0x5d, 0x84}, + {0x26, 0x5e, 0x85}, + {0x26, 0x5f, 0xfd}, + {0x26, 0x60, 0x0f}, + {0x26, 0x61, 0xed}, + {0x26, 0x62, 0x0d}, + {0x26, 0x63, 0x68}, + {0x26, 0x64, 0xf8}, + {0x26, 0x65, 0x12}, + {0x26, 0x66, 0xd1}, + {0x26, 0x67, 0x6b}, + {0x26, 0x68, 0x07}, // Biquad - BQ2 Right - Filter: High Pass-Chebyshev Frequency: 150 Hz QVal: 0.5 Bandwidth: 1000 Hz + {0x26, 0x69, 0x84}, + {0x26, 0x6a, 0x85}, + {0x26, 0x6b, 0xfd}, + {0x26, 0x6c, 0xf0}, + {0x26, 0x6d, 0xf6}, + {0x26, 0x6e, 0xf4}, + {0x26, 0x6f, 0x05}, + {0x26, 0x70, 0x07}, + {0x26, 0x71, 0x84}, + {0x26, 0x72, 0x85}, + {0x26, 0x73, 0xfd}, + {0x26, 0x74, 0x0f}, + {0x26, 0x75, 0xed}, + {0x26, 0x76, 0x0d}, + {0x26, 0x77, 0x68}, + {0x26, 0x78, 0xf8}, + {0x26, 0x79, 0x12}, + {0x26, 0x7a, 0xd1}, + {0x26, 0x7b, 0x6b}, + {0x26, 0x7c, 0x08}, // Biquad - BQ3 Right - Filter: High Shelf Frequency: 300 Hz Gain: 1dB QVal: 0.5 + {0x26, 0x7d, 0xf7}, + {0x26, 0x7e, 0x52}, + {0x26, 0x7f, 0xa3}, + {0x27, 0x08, 0xee}, + {0x27, 0x09, 0x68}, + {0x27, 0x0a, 0x1c}, + {0x27, 0x0b, 0x01}, + {0x27, 0x0c, 0x08}, + {0x27, 0x0d, 0xa1}, + {0x27, 0x0e, 0x63}, + {0x27, 0x0f, 0x38}, + {0x27, 0x10, 0x0f}, + {0x27, 0x11, 0xae}, + {0x27, 0x12, 0x0d}, + {0x27, 0x13, 0x5a}, + {0x27, 0x14, 0xf8}, + {0x27, 0x15, 0x51}, + {0x27, 0x16, 0x20}, + {0x27, 0x17, 0xca}, + }; + + static const reg_sequence_eq *tas5805m_eq_profile_left_registers[] = { + tas5805m_eq_registers_left_flat, + tas5805m_eq_registers_left_lf_60, + tas5805m_eq_registers_left_lf_70, + tas5805m_eq_registers_left_lf_80, + tas5805m_eq_registers_left_lf_90, + tas5805m_eq_registers_left_lf_100, + tas5805m_eq_registers_left_lf_110, + tas5805m_eq_registers_left_lf_120, + tas5805m_eq_registers_left_lf_130, + tas5805m_eq_registers_left_lf_140, + tas5805m_eq_registers_left_lf_150, + tas5805m_eq_registers_left_hf_60, + tas5805m_eq_registers_left_hf_70, + tas5805m_eq_registers_left_hf_80, + tas5805m_eq_registers_left_hf_90, + tas5805m_eq_registers_left_hf_100, + tas5805m_eq_registers_left_hf_110, + tas5805m_eq_registers_left_hf_120, + tas5805m_eq_registers_left_hf_130, + tas5805m_eq_registers_left_hf_140, + tas5805m_eq_registers_left_hf_150, + }; + + static const reg_sequence_eq *tas5805m_eq_profile_right_registers[] = { + tas5805m_eq_registers_right_flat, + tas5805m_eq_registers_right_lf_60, + tas5805m_eq_registers_right_lf_70, + tas5805m_eq_registers_right_lf_80, + tas5805m_eq_registers_right_lf_90, + tas5805m_eq_registers_right_lf_100, + tas5805m_eq_registers_right_lf_110, + tas5805m_eq_registers_right_lf_120, + tas5805m_eq_registers_right_lf_130, + tas5805m_eq_registers_right_lf_140, + tas5805m_eq_registers_right_lf_150, + tas5805m_eq_registers_right_hf_60, + tas5805m_eq_registers_right_hf_70, + tas5805m_eq_registers_right_hf_80, + tas5805m_eq_registers_right_hf_90, + tas5805m_eq_registers_right_hf_100, + tas5805m_eq_registers_right_hf_110, + tas5805m_eq_registers_right_hf_120, + tas5805m_eq_registers_right_hf_130, + tas5805m_eq_registers_right_hf_140, + tas5805m_eq_registers_right_hf_150, + }; + +#ifdef __cplusplus +} +#endif + +#endif /* CONFIG_DAC_TAS5805M_EQ_SUPPORT */ \ No newline at end of file diff --git a/components/custom_board/tas5805m/include/tas5805m_reg_cfg.h b/components/custom_board/tas5805m/include/tas5805m_reg_cfg.h index c68e5062..45f1fa2a 100644 --- a/components/custom_board/tas5805m/include/tas5805m_reg_cfg.h +++ b/components/custom_board/tas5805m/include/tas5805m_reg_cfg.h @@ -97,9 +97,14 @@ extern "C" #define TAS5805M_PIN_CONTROL2_REGISTER 0x75 #define TAS5805M_MISC_CONTROL_REGISTER 0x76 #define TAS5805M_FAULT_CLEAR_REGISTER 0x78 -/* TAS5805M_REG_FAULT register values */ + +// TAS5805M_REG_FAULT register values */ #define TAS5805M_ANALOG_FAULT_CLEAR 0x80 +// EQ registers +#define TAS5805M_CTRL_EQ_ON 0x00 +#define TAS5805M_CTRL_EQ_OFF 0x01 + // Mixer registers #define TAS5805M_REG_BOOK_5 0x8c #define TAS5805M_REG_BOOK_5_MIXER_PAGE 0x29 diff --git a/components/custom_board/tas5805m/include/tas5805m_types.h b/components/custom_board/tas5805m/include/tas5805m_types.h index 5059859c..fd9b5d41 100644 --- a/components/custom_board/tas5805m/include/tas5805m_types.h +++ b/components/custom_board/tas5805m/include/tas5805m_types.h @@ -80,13 +80,6 @@ typedef struct { uint8_t ot_warn; } TAS5805M_FAULT; -/* Cached state structure */ -typedef struct { - int8_t volume; - TAS5805M_CTRL_STATE state; - TAS5805M_MIXER_MODE mixer_mode; -} TAS5805_STATE; - // Analog gain #define TAS5805M_MAX_GAIN 0 #define TAS5805M_MIN_GAIN 31 @@ -125,6 +118,45 @@ static const uint8_t tas5805m_again[TAS5805M_MIN_GAIN + 1] = { 0x1F, /* -15.5dB */ }; +typedef enum { + TAS5805M_EQ_MODE_OFF = 0b0111, + TAS5805M_EQ_MODE_ON = 0b0110, + TAS5805M_EQ_MODE_BIAMP = 0b1110, + TAS5805M_EQ_MODE_BIAMP_OFF = 0b1111, +} TAS5805M_EQ_MODE; + +typedef enum { + TAS5805M_EQ_CHANNELS_LEFT = 0x00, + TAS5805M_EQ_CHANNELS_RIGHT = 0x01, + TAS5805M_EQ_CHANNELS_BOTH = 0x00, +} TAS5805M_EQ_CHANNELS; + +#define TAS5805M_EQ_PROFILES 21 + +typedef enum { + FLAT = 0, // 0dB + LF_60HZ_CUTOFF = 1, // Low Frequency 60Hz cutoff + LF_70HZ_CUTOFF = 2, // Low Frequency 40Hz cutoff + LF_80HZ_CUTOFF = 3, // Low Frequency 80Hz cutoff + LF_90HZ_CUTOFF = 4, // Low Frequency 90Hz cutoff + LF_100HZ_CUTOFF = 5, // Low Frequency 100Hz cutoff + LF_110HZ_CUTOFF = 6, // Low Frequency 110Hz cutoff + LF_120HZ_CUTOFF = 7, // Low Frequency 120Hz cutoff + LF_130HZ_CUTOFF = 8, // Low Frequency 130Hz cutoff + LF_140HZ_CUTOFF = 9, // Low Frequency 140Hz cutoff + LF_150HZ_CUTOFF = 10, // Low Frequency 150Hz cutoff + HF_60HZ_CUTOFF = 11, // High Frequency 60Hz cutoff + HF_70HZ_CUTOFF = 12, // High Frequency 70Hz cutoff + HF_80HZ_CUTOFF = 13, // High Frequency 80Hz cutoff + HF_90HZ_CUTOFF = 14, // High Frequency 90Hz cutoff + HF_100HZ_CUTOFF = 15, // High Frequency 100Hz cutoff + HF_110HZ_CUTOFF = 16, // High Frequency 110Hz cutoff + HF_120HZ_CUTOFF = 17, // High Frequency 120Hz cutoff + HF_130HZ_CUTOFF = 18, // High Frequency 130Hz cutoff + HF_140HZ_CUTOFF = 19, // High Frequency 140Hz cutoff + HF_150HZ_CUTOFF = 20, // High Frequency 150Hz cutoff +} TAS5805M_EQ_PROFILE; + #ifdef __cplusplus } #endif diff --git a/components/custom_board/tas5805m/tas5805m.c b/components/custom_board/tas5805m/tas5805m.c index e981d864..d2f723db 100644 --- a/components/custom_board/tas5805m/tas5805m.c +++ b/components/custom_board/tas5805m/tas5805m.c @@ -205,84 +205,10 @@ esp_err_t tas5805m_init() { return ret; } - // Check if Bridge-Mode is enabled -#if defined(CONFIG_DAC_BRIDGE_MODE_MONO) || defined(CONFIG_DAC_BRIDGE_MODE_LEFT) || defined(CONFIG_DAC_BRIDGE_MODE_RIGHT) - ESP_LOGD(TAG, "%s: Setting Bridge-Mode", __func__); - - // enable bridge mode - ret = tas5805m_write_byte(TAS5805M_DEVICE_CTRL_1_REGISTER, 0x04); - - // Mixer config - ret |= tas5805m_write_byte(0x0, 0x0); - ret |= tas5805m_write_byte(0x7f, 0x8c); - ret |= tas5805m_write_byte(0x0, 0x29); - - #if defined(CONFIG_DAC_BRIDGE_MODE_MONO) - ESP_LOGI(TAG, "%s: Defining Bridge-Mode to Mono", __func__); - // Left mixer input to left ouput (-6 dB) - ret |= tas5805m_write_byte(0x18, 0x00); - ret |= tas5805m_write_byte(0x19, 0x40); - ret |= tas5805m_write_byte(0x1a, 0x26); - ret |= tas5805m_write_byte(0x1b, 0xe7); - - // Right mixer input to left ouput (-6 dB) - ret |= tas5805m_write_byte(0x1c, 0x00); - ret |= tas5805m_write_byte(0x1d, 0x40); - ret |= tas5805m_write_byte(0x1e, 0x26); - ret |= tas5805m_write_byte(0x1f, 0xe7); - - #elif defined(CONFIG_DAC_BRIDGE_MODE_LEFT) - ESP_LOGI(TAG, "%s: Defining Bridge-Mode to Left", __func__); - // Left mixer input to left ouput (0 dB) - ret |= tas5805m_write_byte(0x18, 0x00); - ret |= tas5805m_write_byte(0x19, 0x80); - ret |= tas5805m_write_byte(0x1a, 0x00); - ret |= tas5805m_write_byte(0x1b, 0x00); - - // Right mixer input to left ouput (-110 dB) - ret |= tas5805m_write_byte(0x1c, 0x00); - ret |= tas5805m_write_byte(0x1d, 0x00); - ret |= tas5805m_write_byte(0x1e, 0x00); - ret |= tas5805m_write_byte(0x1f, 0x00); - - #elif defined(CONFIG_DAC_BRIDGE_MODE_RIGHT) - ESP_LOGI(TAG, "%s: Defining Bridge-Mode to Right", __func__); - // Left mixer input to left ouput (-110 dB) - ret |= tas5805m_write_byte(0x18, 0x00); - ret |= tas5805m_write_byte(0x19, 0x00); - ret |= tas5805m_write_byte(0x1a, 0x00); - ret |= tas5805m_write_byte(0x1b, 0x00); - - // Right mixer input to left ouput (0 dB) - ret |= tas5805m_write_byte(0x1c, 0x00); - ret |= tas5805m_write_byte(0x1d, 0x80); - ret |= tas5805m_write_byte(0x1e, 0x00); - ret |= tas5805m_write_byte(0x1f, 0x00); - - #endif - - // Left mixer input to right ouput (-110 dB as the right output is not used) - ret |= tas5805m_write_byte(0x20, 0x00); - ret |= tas5805m_write_byte(0x21, 0x00); - ret |= tas5805m_write_byte(0x22, 0x00); - ret |= tas5805m_write_byte(0x23, 0x00); - - // Right mixer input to right ouput (-110 dB as the right output is not used) - ret |= tas5805m_write_byte(0x24, 0x00); - ret |= tas5805m_write_byte(0x25, 0x00); - ret |= tas5805m_write_byte(0x26, 0x00); - ret |= tas5805m_write_byte(0x27, 0x00); - - - // End config - ret |= tas5805m_write_byte(0x0, 0x0); - ret |= tas5805m_write_byte(0x7f, 0x0); - - if (ret != ESP_OK) { - ESP_LOGE(TAG, "%s: Setting Bridge-Mode failed", __func__); - return ret; - } -#endif + /* Bridge-mode configuration removed: bridge mode is now controlled at runtime + via the UI and persisted through settings. If you need to reintroduce + compile-time bridge-mode options, re-add the Kconfig choice and the + corresponding conditional code here. */ return ret; } @@ -772,4 +698,191 @@ void tas5805m_decode_faults(TAS5805M_FAULT fault) if (fault.ot_warn & (1 << 2)) ESP_LOGW(TAG, "%s: Over temperature warning", __func__); } -} \ No newline at end of file +} + +/* EQ-related functions and data: compile only when enabled in Kconfig */ +#if defined(CONFIG_DAC_TAS5805M_EQ_SUPPORT) + +esp_err_t tas5805m_get_eq_mode(TAS5805M_EQ_MODE *mode) +{ + uint8_t value = 0; + esp_err_t err = tas5805m_read_byte(TAS5805M_DSP_MISC_REGISTER, &value); + if (err != ESP_OK) + { + ESP_LOGE(TAG, "%s: Error during I2C transmission: %s", __func__, esp_err_to_name(err)); + return err; + } + + // Extract the EQ mode from the value + *mode = (TAS5805M_EQ_MODE)(value & 0b00001111); + return ESP_OK; +} + +esp_err_t tas5805m_set_eq_mode(TAS5805M_EQ_MODE mode) +{ + ESP_LOGD(TAG, "%s: Setting EQ MODE to %d", __func__, mode); + return tas5805m_write_byte(TAS5805M_DSP_MISC_REGISTER, (uint8_t)mode); +} + +esp_err_t tas5805m_set_eq(bool enable) +{ + ESP_LOGD(TAG, "%s: Setting EQ to %d", __func__, enable); + return tas5805m_write_byte(TAS5805M_DSP_MISC_REGISTER, enable ? TAS5805M_CTRL_EQ_ON : TAS5805M_CTRL_EQ_OFF); +} + +esp_err_t tas5805m_get_eq_gain(int band, int *gain) +{ + return tas5805m_get_eq_gain_channel(TAS5805M_EQ_CHANNELS_LEFT, band, gain); +} + +esp_err_t tas5805m_get_eq_gain_channel(TAS5805M_EQ_CHANNELS channel, int band, int *gain) +{ + switch (channel) + { + case TAS5805M_EQ_CHANNELS_RIGHT: + *gain = tas5805m_state.eq_gain_r[band]; + break; + default: + *gain = tas5805m_state.eq_gain_l[band]; + break; + } + return ESP_OK; +} + +esp_err_t tas5805m_set_eq_gain(int band, int gain) { + return tas5805m_set_eq_gain_channel(TAS5805M_EQ_CHANNELS_LEFT, band, gain); +} + +esp_err_t tas5805m_set_eq_gain_channel(TAS5805M_EQ_CHANNELS channel, int band, int gain) +{ + if (band < 0 || band >= TAS5805M_EQ_BANDS) + { + ESP_LOGE(TAG, "%s: Invalid band %d", __func__, band); + return ESP_ERR_INVALID_ARG; + } + + if (gain < TAS5805M_EQ_MIN_DB || gain > TAS5805M_EQ_MAX_DB) + { + ESP_LOGE(TAG, "%s: Invalid gain %d", __func__, gain); + return ESP_ERR_INVALID_ARG; + } + + int current_page = 0; + int ret = ESP_OK; + ESP_LOGD(TAG, "%s: Setting EQ band %d (%d Hz) to gain %d", __func__, band, tas5805m_eq_bands[band], gain); + + int x = gain + TAS5805M_EQ_MAX_DB; + int y = band * TAS5805M_EQ_KOEF_PER_BAND * TAS5805M_EQ_REG_PER_KOEF; + + const reg_sequence_eq **eq_maps = (channel == TAS5805M_EQ_CHANNELS_RIGHT) ? tas5805m_eq_registers_right : tas5805m_eq_registers_left; + + for (int i = 0; i < TAS5805M_EQ_KOEF_PER_BAND * TAS5805M_EQ_REG_PER_KOEF; i += TAS5805M_EQ_REG_PER_KOEF) + { + const reg_sequence_eq *reg_value0 = &eq_maps[x][y + i + 0]; + const reg_sequence_eq *reg_value1 = &eq_maps[x][y + i + 1]; + const reg_sequence_eq *reg_value2 = &eq_maps[x][y + i + 2]; + const reg_sequence_eq *reg_value3 = &eq_maps[x][y + i + 3]; + + if (reg_value0 == NULL || reg_value1 == NULL || reg_value2 == NULL || reg_value3 == NULL) { + ESP_LOGW(TAG, "%s: NULL pointer encountered at row[%d]", __func__, y + i); + continue; + } + + // Assume all 4 reg values are in the same page, seems to be true for all BQ registers + if (reg_value0->page != current_page) { + TAS5805M_SET_BOOK_AND_PAGE(TAS5805M_REG_BOOK_EQ, reg_value0->page); + current_page = reg_value0->page; + } + + uint8_t address = reg_value0->offset; + uint32_t value = reg_value0->value | + (reg_value1->value << 8) | + (reg_value2->value << 16) | + (reg_value3->value << 24); + + ESP_LOGV(TAG, "%s: + %d: w 0x%x 0x%x 0x%x 0x%x 0x%x -> 0x%x", __func__, i, + reg_value0->offset, reg_value0->value, + reg_value1->value, reg_value2->value, reg_value3->value, value); + ret = ret | tas5805m_write_bytes(&address, 1, (uint8_t *)&value, sizeof(value)); + if (ret != ESP_OK) { + ESP_LOGE(TAG, "%s: Error writing to register 0x%x", __func__, address); + } + } + + if (channel == TAS5805M_EQ_CHANNELS_RIGHT) + tas5805m_state.eq_gain_r[band] = gain; + else + tas5805m_state.eq_gain_l[band] = gain; + + TAS5805M_SET_BOOK_AND_PAGE(TAS5805M_REG_BOOK_CONTROL_PORT, TAS5805M_REG_PAGE_ZERO); + return ret; +} + +esp_err_t tas5805m_get_eq_profile(TAS5805M_EQ_PROFILE *profile) +{ + return tas5805m_get_eq_profile_channel(TAS5805M_EQ_CHANNELS_LEFT, profile); +} + +esp_err_t tas5805m_get_eq_profile_channel(TAS5805M_EQ_CHANNELS channel, TAS5805M_EQ_PROFILE *profile) +{ + *profile = tas5805m_state.eq_profile[channel]; + return ESP_OK; +} + +esp_err_t tas5805m_set_eq_profile(TAS5805M_EQ_PROFILE profile) { + return tas5805m_set_eq_profile_channel(TAS5805M_EQ_CHANNELS_LEFT, profile); +} + +esp_err_t tas5805m_set_eq_profile_channel(TAS5805M_EQ_CHANNELS channel, TAS5805M_EQ_PROFILE profile) +{ + // Apply preset EQ gains for the selected profile + int current_page = 0; + int ret = ESP_OK; + ESP_LOGD(TAG, "%s: Setting EQ profile to %d", __func__, profile); + + const reg_sequence_eq **eq_maps = (channel == TAS5805M_EQ_CHANNELS_RIGHT) ? tas5805m_eq_profile_right_registers : tas5805m_eq_profile_left_registers; + + int x = (uint8_t)profile; + for (int i = 0; i < TAS5805M_EQ_PROFILE_REG_PER_STEP; i += TAS5805M_EQ_REG_PER_KOEF) + { + const reg_sequence_eq *reg_value0 = &eq_maps[x][i + 0]; + const reg_sequence_eq *reg_value1 = &eq_maps[x][i + 1]; + const reg_sequence_eq *reg_value2 = &eq_maps[x][i + 2]; + const reg_sequence_eq *reg_value3 = &eq_maps[x][i + 3]; + + if (reg_value0 == NULL || reg_value1 == NULL || reg_value2 == NULL || reg_value3 == NULL) { + ESP_LOGW(TAG, "%s: NULL pointer encountered at row[%d]", __func__, i); + continue; + } + + // Assume all 4 reg values are in the same page, seems to be true for all BQ registers + if (reg_value0->page != current_page) { + current_page = reg_value0->page; + TAS5805M_SET_BOOK_AND_PAGE(TAS5805M_REG_BOOK_EQ, reg_value0->page); + } + + uint8_t address = reg_value0->offset; + uint32_t value = reg_value0->value | + (reg_value1->value << 8) | + (reg_value2->value << 16) | + (reg_value3->value << 24); + + // ESP_LOGV(TAG, "%s: + %d: w 0x%x 0x%x 0x%x 0x%x 0x%x -> 0x%x", __func__, i, + // reg_value0->offset, reg_value0->value, + // reg_value1->value, reg_value2->value, reg_value3->value, value); + ret = ret | tas5805m_write_bytes(&address, 1, (uint8_t *)&value, sizeof(value)); + // ret = ret | tas5805m_write_byte(reg_value->offset, reg_value->value); + if (ret != ESP_OK) { + ESP_LOGE(TAG, "%s: Error writing to register 0x%x", __func__, address); + } + } + + // Set the EQ profile + tas5805m_state.eq_profile[channel] = profile; + + + TAS5805M_SET_BOOK_AND_PAGE(TAS5805M_REG_BOOK_CONTROL_PORT, TAS5805M_REG_PAGE_ZERO); + return ret; +} + +#endif /* CONFIG_DAC_TAS5805M_EQ_SUPPORT */ From ece19f1bb4390fffdaf8cb9ce1a86c6ba82d075c Mon Sep 17 00:00:00 2001 From: Andriy Malyshenko Date: Wed, 26 Nov 2025 23:06:41 +0100 Subject: [PATCH 17/58] config changes --- components/audio_board/Kconfig.projbuild | 26 ++++++++---------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/components/audio_board/Kconfig.projbuild b/components/audio_board/Kconfig.projbuild index 7933cebd..3555ff45 100644 --- a/components/audio_board/Kconfig.projbuild +++ b/components/audio_board/Kconfig.projbuild @@ -182,28 +182,20 @@ menu "Audio Board" default 33 help GPIO number to power down the DAC + + config DAC_TAS5805M_EQ_SUPPORT + bool "Enable TAS5805M equalizer support" + default n + help + When enabled, build includes optional TAS5805M equalizer support. + Equalizer configuration and runtime control remain available via + the device UI. Default: disabled. endmenu menu "DAC-Operation-Mode" depends on DAC_TAS5805M - choice DAC_BRIDGE_MODE - prompt "Bridge-Mode selection" - default DAC_BRIDGE_MODE_DISABLED - - config DAC_BRIDGE_MODE_DISABLED - bool "Stereo (bridge mode disabled)" - - config DAC_BRIDGE_MODE_MONO - bool "Mono mode (Left + Right / 2)" - - config DAC_BRIDGE_MODE_LEFT - bool "Output left input channel" - - config DAC_BRIDGE_MODE_RIGHT - bool "Output right input channel" - - endchoice + # Bridge mode selection moved to runtime UI; compile-time Kconfig removed endmenu menu "Merus MA120x0 interface Configuration" From e7d67d1fb9f7e155f17ef8e5056ae30975e19947 Mon Sep 17 00:00:00 2001 From: Andriy Malyshenko Date: Thu, 27 Nov 2025 18:48:04 +0100 Subject: [PATCH 18/58] Added EQ mode (with persistance and restore on boot) --- components/audio_board/Kconfig.projbuild | 15 +- .../include/tas5805m_settings.h | 7 + .../tas5805m_settings/tas5805m_settings.c | 214 ++++++++++++++++++ 3 files changed, 228 insertions(+), 8 deletions(-) diff --git a/components/audio_board/Kconfig.projbuild b/components/audio_board/Kconfig.projbuild index 3555ff45..935a2bfb 100644 --- a/components/audio_board/Kconfig.projbuild +++ b/components/audio_board/Kconfig.projbuild @@ -173,7 +173,7 @@ menu "Audio Board" endmenu - menu "TAS5805M interface Configuration" + menu "TAS5805M interface configuration" depends on DAC_TAS5805M config PIN_DAC_PWDN @@ -183,21 +183,20 @@ menu "Audio Board" help GPIO number to power down the DAC + endmenu + + menu "TAS5805M DSP Support" + depends on DAC_TAS5805M + config DAC_TAS5805M_EQ_SUPPORT bool "Enable TAS5805M equalizer support" - default n + default false help When enabled, build includes optional TAS5805M equalizer support. Equalizer configuration and runtime control remain available via the device UI. Default: disabled. endmenu - menu "DAC-Operation-Mode" - depends on DAC_TAS5805M - - # Bridge mode selection moved to runtime UI; compile-time Kconfig removed - endmenu - menu "Merus MA120x0 interface Configuration" depends on DAC_MA120X0 diff --git a/components/tas5805m_settings/include/tas5805m_settings.h b/components/tas5805m_settings/include/tas5805m_settings.h index e0b2e861..db8f5129 100644 --- a/components/tas5805m_settings/include/tas5805m_settings.h +++ b/components/tas5805m_settings/include/tas5805m_settings.h @@ -30,6 +30,8 @@ extern "C" { #define TAS5805M_NVS_KEY_BD_FREQ "bd_freq" // Mixer mode (persisted) #define TAS5805M_NVS_KEY_MIXER_MODE "mixer_mode" +// EQ mode (persisted) +#define TAS5805M_NVS_KEY_EQ_MODE "eq_mode" // Digital Volume Settings (in 0.5dB steps) - kept for UI scaling/display #define TAS5805M_DIGITAL_VOL_MIN -207 // -103.5 dB @@ -72,6 +74,11 @@ esp_err_t tas5805m_settings_save_mixer_mode(TAS5805M_MIXER_MODE mode); /** Load mixer mode from NVS */ esp_err_t tas5805m_settings_load_mixer_mode(TAS5805M_MIXER_MODE *mode); +/** Save EQ mode to NVS */ +esp_err_t tas5805m_settings_save_eq_mode(TAS5805M_EQ_MODE mode); +/** Load EQ mode from NVS */ +esp_err_t tas5805m_settings_load_eq_mode(TAS5805M_EQ_MODE *mode); + /** Get current TAS5805M settings as a JSON string */ esp_err_t tas5805m_settings_get_json(char *json_out, size_t max_len); diff --git a/components/tas5805m_settings/tas5805m_settings.c b/components/tas5805m_settings/tas5805m_settings.c index 20dba5fe..2cef9bb6 100644 --- a/components/tas5805m_settings/tas5805m_settings.c +++ b/components/tas5805m_settings/tas5805m_settings.c @@ -47,6 +47,21 @@ static const char* tas5805m_mixer_mode_to_string(TAS5805M_MIXER_MODE mode) { } } +static const char* tas5805m_eq_mode_to_string(TAS5805M_EQ_MODE mode) { +#if defined(CONFIG_DAC_TAS5805M_EQ_SUPPORT) + switch (mode) { + case TAS5805M_EQ_MODE_OFF: return "OFF"; + case TAS5805M_EQ_MODE_ON: return "ON"; + case TAS5805M_EQ_MODE_BIAMP: return "BI-AMP"; + case TAS5805M_EQ_MODE_BIAMP_OFF: return "BI-AMP (OFF)"; + default: return "Unknown"; + } +#else + (void)mode; + return "OFF"; +#endif +} + esp_err_t tas5805m_settings_init(void) { if (tas5805m_settings_mutex == NULL) { tas5805m_settings_mutex = xSemaphoreCreateMutex(); @@ -83,6 +98,8 @@ esp_err_t tas5805m_settings_save_analog_gain(int gain_half_db) { err = nvs_commit(h); } nvs_close(h); + } else { + ESP_LOGW(TAG, "%s: Failed to open NVS namespace '%s': %s", __func__, TAS5805M_NVS_NAMESPACE, esp_err_to_name(err)); } xSemaphoreGive(tas5805m_settings_mutex); @@ -104,8 +121,15 @@ esp_err_t tas5805m_settings_load_analog_gain(int *gain_half_db) { err = nvs_get_i32(h, TAS5805M_NVS_KEY_ANALOG_GAIN, &v); if (err == ESP_OK) { *gain_half_db = (int)v; + ESP_LOGD(TAG, "%s: Loaded analog gain from NVS: %d", __func__, *gain_half_db); + } else if (err == ESP_ERR_NVS_NOT_FOUND) { + ESP_LOGD(TAG, "%s: NVS key '%s' not found", __func__, TAS5805M_NVS_KEY_ANALOG_GAIN); + } else { + ESP_LOGW(TAG, "%s: Failed to read analog gain from NVS: %s", __func__, esp_err_to_name(err)); } nvs_close(h); + } else { + ESP_LOGW(TAG, "%s: Failed to open NVS namespace '%s': %s", __func__, TAS5805M_NVS_NAMESPACE, esp_err_to_name(err)); } xSemaphoreGive(tas5805m_settings_mutex); @@ -129,6 +153,8 @@ esp_err_t tas5805m_settings_save_dac_mode(TAS5805M_DAC_MODE mode) { err = nvs_commit(h); } nvs_close(h); + } else { + ESP_LOGW(TAG, "%s: Failed to open NVS namespace '%s': %s", __func__, TAS5805M_NVS_NAMESPACE, esp_err_to_name(err)); } xSemaphoreGive(tas5805m_settings_mutex); @@ -160,8 +186,14 @@ esp_err_t tas5805m_settings_load_dac_mode(TAS5805M_DAC_MODE *mode) { *mode = (TAS5805M_DAC_MODE)v; ESP_LOGD(TAG, "%s: DAC mode from NVS: %d (%s)", __func__, (int)*mode, *mode == TAS5805M_DAC_MODE_BTL ? "BTL" : "PBTL"); + } else if (err == ESP_ERR_NVS_NOT_FOUND) { + ESP_LOGD(TAG, "%s: NVS key '%s' not found", __func__, TAS5805M_NVS_KEY_DAC_MODE); + } else { + ESP_LOGW(TAG, "%s: Failed to read DAC mode from NVS: %s", __func__, esp_err_to_name(err)); } nvs_close(h); + } else { + ESP_LOGW(TAG, "%s: Failed to open NVS namespace '%s': %s", __func__, TAS5805M_NVS_NAMESPACE, esp_err_to_name(err)); } xSemaphoreGive(tas5805m_settings_mutex); @@ -193,6 +225,8 @@ esp_err_t tas5805m_settings_save_modulation_mode(TAS5805M_MOD_MODE mode, err = nvs_commit(h); } nvs_close(h); + } else { + ESP_LOGW(TAG, "%s: Failed to open NVS namespace '%s': %s", __func__, TAS5805M_NVS_NAMESPACE, esp_err_to_name(err)); } xSemaphoreGive(tas5805m_settings_mutex); @@ -224,9 +258,13 @@ esp_err_t tas5805m_settings_load_modulation_mode(TAS5805M_MOD_MODE *mode, err = nvs_get_i32(h, TAS5805M_NVS_KEY_MOD_MODE, &v_mode); if (err == ESP_OK) { err = nvs_get_i32(h, TAS5805M_NVS_KEY_SW_FREQ, &v_freq); + } else if (err == ESP_ERR_NVS_NOT_FOUND) { + ESP_LOGD(TAG, "%s: NVS key '%s' not found", __func__, TAS5805M_NVS_KEY_MOD_MODE); } if (err == ESP_OK) { err = nvs_get_i32(h, TAS5805M_NVS_KEY_BD_FREQ, &v_bd); + } else if (err == ESP_ERR_NVS_NOT_FOUND) { + ESP_LOGD(TAG, "%s: NVS key '%s' not found", __func__, TAS5805M_NVS_KEY_SW_FREQ); } if (err == ESP_OK) { *mode = (TAS5805M_MOD_MODE)v_mode; @@ -234,8 +272,12 @@ esp_err_t tas5805m_settings_load_modulation_mode(TAS5805M_MOD_MODE *mode, *bd_freq = (TAS5805M_BD_FREQ)v_bd; ESP_LOGD(TAG, "%s: Modulation mode from NVS: mode=%d, freq=%d, bd_freq=%d", __func__, (int)*mode, (int)*freq, (int)*bd_freq); + } else if (err != ESP_ERR_NVS_NOT_FOUND) { + ESP_LOGW(TAG, "%s: Failed to read modulation mode from NVS: %s", __func__, esp_err_to_name(err)); } nvs_close(h); + } else { + ESP_LOGW(TAG, "%s: Failed to open NVS namespace '%s': %s", __func__, TAS5805M_NVS_NAMESPACE, esp_err_to_name(err)); } xSemaphoreGive(tas5805m_settings_mutex); @@ -260,6 +302,8 @@ esp_err_t tas5805m_settings_save_mixer_mode(TAS5805M_MIXER_MODE mode) { err = nvs_commit(h); } nvs_close(h); + } else { + ESP_LOGW(TAG, "%s: Failed to open NVS namespace '%s': %s", __func__, TAS5805M_NVS_NAMESPACE, esp_err_to_name(err)); } xSemaphoreGive(tas5805m_settings_mutex); @@ -290,8 +334,78 @@ esp_err_t tas5805m_settings_load_mixer_mode(TAS5805M_MIXER_MODE *mode) { if (err == ESP_OK) { *mode = (TAS5805M_MIXER_MODE)v; ESP_LOGD(TAG, "%s: Mixer mode from NVS: %d", __func__, (int)*mode); + } else if (err == ESP_ERR_NVS_NOT_FOUND) { + ESP_LOGD(TAG, "%s: NVS key '%s' not found", __func__, TAS5805M_NVS_KEY_MIXER_MODE); + } else { + ESP_LOGW(TAG, "%s: Failed to read mixer mode from NVS: %s", __func__, esp_err_to_name(err)); } nvs_close(h); + } else { + ESP_LOGW(TAG, "%s: Failed to open NVS namespace '%s': %s", __func__, TAS5805M_NVS_NAMESPACE, esp_err_to_name(err)); + } + + xSemaphoreGive(tas5805m_settings_mutex); + return err; +} + +/** Save EQ mode to NVS */ +esp_err_t tas5805m_settings_save_eq_mode(TAS5805M_EQ_MODE mode) { + ESP_LOGD(TAG, "%s: mode=%d", __func__, (int)mode); + + if (!tas5805m_settings_mutex) return ESP_ERR_INVALID_STATE; + + if (xSemaphoreTake(tas5805m_settings_mutex, pdMS_TO_TICKS(5000)) != pdTRUE) { + return ESP_ERR_TIMEOUT; + } + + nvs_handle_t h; + esp_err_t err = nvs_open(TAS5805M_NVS_NAMESPACE, NVS_READWRITE, &h); + if (err == ESP_OK) { + err = nvs_set_i32(h, TAS5805M_NVS_KEY_EQ_MODE, (int32_t)mode); + if (err == ESP_OK) { + err = nvs_commit(h); + } + nvs_close(h); + } else { + ESP_LOGW(TAG, "%s: Failed to open NVS namespace '%s': %s", __func__, TAS5805M_NVS_NAMESPACE, esp_err_to_name(err)); + } + + xSemaphoreGive(tas5805m_settings_mutex); + + if (err == ESP_OK) { + ESP_LOGI(TAG, "%s: EQ mode saved: %d", __func__, (int)mode); + } else { + ESP_LOGE(TAG, "%s: Failed to save EQ mode: %s", __func__, esp_err_to_name(err)); + } + + return err; +} + +/** Load EQ mode from NVS */ +esp_err_t tas5805m_settings_load_eq_mode(TAS5805M_EQ_MODE *mode) { + if (!mode) return ESP_ERR_INVALID_ARG; + if (!tas5805m_settings_mutex) return ESP_ERR_INVALID_STATE; + + if (xSemaphoreTake(tas5805m_settings_mutex, pdMS_TO_TICKS(5000)) != pdTRUE) { + return ESP_ERR_TIMEOUT; + } + + nvs_handle_t h; + esp_err_t err = nvs_open(TAS5805M_NVS_NAMESPACE, NVS_READONLY, &h); + if (err == ESP_OK) { + int32_t v = 0; + err = nvs_get_i32(h, TAS5805M_NVS_KEY_EQ_MODE, &v); + if (err == ESP_OK) { + *mode = (TAS5805M_EQ_MODE)v; + ESP_LOGD(TAG, "%s: EQ mode from NVS: %d", __func__, (int)*mode); + } else if (err == ESP_ERR_NVS_NOT_FOUND) { + ESP_LOGD(TAG, "%s: NVS key '%s' not found", __func__, TAS5805M_NVS_KEY_EQ_MODE); + } else { + ESP_LOGW(TAG, "%s: Failed to read EQ mode from NVS: %s", __func__, esp_err_to_name(err)); + } + nvs_close(h); + } else { + ESP_LOGW(TAG, "%s: Failed to open NVS namespace '%s': %s", __func__, TAS5805M_NVS_NAMESPACE, esp_err_to_name(err)); } xSemaphoreGive(tas5805m_settings_mutex); @@ -362,6 +476,16 @@ esp_err_t tas5805m_settings_get_json(char *json_out, size_t max_len) { cJSON_AddNumberToObject(root, "modulation_mode", (int)mod_mode); cJSON_AddNumberToObject(root, "sw_freq", (int)sw_freq); cJSON_AddNumberToObject(root, "bd_freq", (int)bd_freq); + + /* EQ mode - query driver when available, otherwise default to OFF */ + TAS5805M_EQ_MODE eq_mode_val = TAS5805M_EQ_MODE_OFF; +#if defined(CONFIG_DAC_TAS5805M_EQ_SUPPORT) + if (tas5805m_get_eq_mode(&eq_mode_val) != ESP_OK) { + eq_mode_val = TAS5805M_EQ_MODE_OFF; + } +#endif + cJSON_AddNumberToObject(root, "eq_mode", (int)eq_mode_val); + cJSON_AddStringToObject(root, "eq_mode_name", tas5805m_eq_mode_to_string(eq_mode_val)); /* Mixer mode from cached state */ cJSON_AddNumberToObject(root, "mixer_mode", (int)dac_state.mixer_mode); cJSON_AddStringToObject(root, "mixer_mode_name", tas5805m_mixer_mode_to_string(dac_state.mixer_mode)); @@ -521,6 +645,28 @@ esp_err_t tas5805m_settings_set_from_json(const char *json_in) { } } + // Update EQ mode if present + cJSON *eq_mode_item = cJSON_GetObjectItem(root, "eq_mode"); + if (cJSON_IsNumber(eq_mode_item)) { + TAS5805M_EQ_MODE new_eq = (TAS5805M_EQ_MODE)eq_mode_item->valueint; +#if defined(CONFIG_DAC_TAS5805M_EQ_SUPPORT) + err = tas5805m_set_eq_mode(new_eq); + if (err == ESP_OK) { + ESP_LOGI(TAG, "%s: Applied EQ mode %d (%s) to DAC", __func__, (int)new_eq, tas5805m_eq_mode_to_string(new_eq)); + /* Persist EQ mode */ + esp_err_t serr = tas5805m_settings_save_eq_mode(new_eq); + if (serr != ESP_OK) { + ESP_LOGW(TAG, "%s: Failed to persist EQ mode: %s", __func__, esp_err_to_name(serr)); + } + } else { + ESP_LOGE(TAG, "%s: Failed to apply EQ mode: %s", __func__, esp_err_to_name(err)); + } +#else + ESP_LOGW(TAG, "%s: EQ support disabled in build; ignoring EQ mode change", __func__); + (void)new_eq; +#endif + } + cJSON_Delete(root); return err; } @@ -568,6 +714,13 @@ esp_err_t tas5805m_settings_get_schema_json(char *json_out, size_t max_len) { sw_freq = SW_FREQ_768K; bd_freq = SW_FREQ_80K; } + /* EQ mode - query driver when available, otherwise default to OFF */ + TAS5805M_EQ_MODE eq_mode_val = TAS5805M_EQ_MODE_OFF; +#if defined(CONFIG_DAC_TAS5805M_EQ_SUPPORT) + if (tas5805m_get_eq_mode(&eq_mode_val) != ESP_OK) { + eq_mode_val = TAS5805M_EQ_MODE_OFF; + } +#endif // Build schema JSON cJSON *root = cJSON_CreateObject(); @@ -829,6 +982,54 @@ esp_err_t tas5805m_settings_get_schema_json(char *json_out, size_t max_len) { cJSON_AddItemToObject(dac_config_group, "parameters", dac_config_params); cJSON_AddItemToArray(groups, dac_config_group); + // ===== EQ Group ===== + cJSON *eq_group = cJSON_CreateObject(); + cJSON_AddStringToObject(eq_group, "name", "EQ"); + cJSON_AddStringToObject(eq_group, "description", "Equalizer mode"); + + cJSON *eq_params = cJSON_CreateArray(); + + cJSON *eq_mode_param = cJSON_CreateObject(); + cJSON_AddStringToObject(eq_mode_param, "key", "eq_mode"); + cJSON_AddStringToObject(eq_mode_param, "name", "EQ Mode"); + cJSON_AddStringToObject(eq_mode_param, "type", "enum"); + cJSON_AddNumberToObject(eq_mode_param, "current", (int)eq_mode_val); + + cJSON *eq_mode_values = cJSON_CreateArray(); + +#if defined(CONFIG_DAC_TAS5805M_EQ_SUPPORT) + cJSON *eq_off = cJSON_CreateObject(); + cJSON_AddNumberToObject(eq_off, "value", TAS5805M_EQ_MODE_OFF); + cJSON_AddStringToObject(eq_off, "name", "OFF"); + cJSON_AddItemToArray(eq_mode_values, eq_off); + + cJSON *eq_on = cJSON_CreateObject(); + cJSON_AddNumberToObject(eq_on, "value", TAS5805M_EQ_MODE_ON); + cJSON_AddStringToObject(eq_on, "name", "ON"); + cJSON_AddItemToArray(eq_mode_values, eq_on); + + cJSON *eq_biamp = cJSON_CreateObject(); + cJSON_AddNumberToObject(eq_biamp, "value", TAS5805M_EQ_MODE_BIAMP); + cJSON_AddStringToObject(eq_biamp, "name", "BI-AMP"); + cJSON_AddItemToArray(eq_mode_values, eq_biamp); + + cJSON *eq_biamp_off = cJSON_CreateObject(); + cJSON_AddNumberToObject(eq_biamp_off, "value", TAS5805M_EQ_MODE_BIAMP_OFF); + cJSON_AddStringToObject(eq_biamp_off, "name", "BI-AMP (OFF)"); + cJSON_AddItemToArray(eq_mode_values, eq_biamp_off); +#else + /* EQ support disabled - only provide OFF value so UI shows a single readonly option */ + cJSON *eq_off = cJSON_CreateObject(); + cJSON_AddNumberToObject(eq_off, "value", TAS5805M_EQ_MODE_OFF); + cJSON_AddStringToObject(eq_off, "name", "OFF"); + cJSON_AddItemToArray(eq_mode_values, eq_off); +#endif + + cJSON_AddItemToObject(eq_mode_param, "values", eq_mode_values); + cJSON_AddItemToArray(eq_params, eq_mode_param); + cJSON_AddItemToObject(eq_group, "parameters", eq_params); + cJSON_AddItemToArray(groups, eq_group); + // End groups cJSON_AddItemToObject(root, "groups", groups); @@ -911,6 +1112,19 @@ esp_err_t tas5805m_settings_apply_all(void) { } } + // Apply EQ mode (if persisted) + TAS5805M_EQ_MODE eq_mode; + if (tas5805m_settings_load_eq_mode(&eq_mode) == ESP_OK) { + ESP_LOGI(TAG, "%s: Restoring EQ mode=%d", __func__, (int)eq_mode); +#if defined(CONFIG_DAC_TAS5805M_EQ_SUPPORT) + if (tas5805m_set_eq_mode(eq_mode) != ESP_OK) { + ESP_LOGW(TAG, "%s: Failed to apply saved EQ mode", __func__); + } +#else + ESP_LOGW(TAG, "%s: EQ support disabled in build; ignoring persisted EQ mode", __func__); +#endif + } + ESP_LOGI(TAG, "%s: Persisted settings application complete", __func__); return ESP_OK; } From d385ae14dce3b404ff2884cd66170cc398a8cab8 Mon Sep 17 00:00:00 2001 From: Andriy Malyshenko Date: Thu, 27 Nov 2025 23:23:27 +0100 Subject: [PATCH 19/58] Added 15-band equilizer --- .../include/tas5805m_settings.h | 8 + .../tas5805m_settings/tas5805m_settings.c | 206 ++ sdkconfig.hifi-esp32-plus | 2506 +++++++++++++++ sdkconfig.louder-esp32 | 2513 +++++++++++++++ sdkconfig.louder-esp32s3 | 2681 +++++++++++++++++ 5 files changed, 7914 insertions(+) create mode 100644 sdkconfig.hifi-esp32-plus create mode 100644 sdkconfig.louder-esp32 create mode 100644 sdkconfig.louder-esp32s3 diff --git a/components/tas5805m_settings/include/tas5805m_settings.h b/components/tas5805m_settings/include/tas5805m_settings.h index db8f5129..4b640f70 100644 --- a/components/tas5805m_settings/include/tas5805m_settings.h +++ b/components/tas5805m_settings/include/tas5805m_settings.h @@ -32,6 +32,9 @@ extern "C" { #define TAS5805M_NVS_KEY_MIXER_MODE "mixer_mode" // EQ mode (persisted) #define TAS5805M_NVS_KEY_EQ_MODE "eq_mode" +// EQ per-band gain keys prefix (final key will be e.g. "eq_gain_l_0" or "eq_gain_r_3") +#define TAS5805M_NVS_KEY_EQ_GAIN_L_PREFIX "eq_gain_l_" +#define TAS5805M_NVS_KEY_EQ_GAIN_R_PREFIX "eq_gain_r_" // Digital Volume Settings (in 0.5dB steps) - kept for UI scaling/display #define TAS5805M_DIGITAL_VOL_MIN -207 // -103.5 dB @@ -79,6 +82,11 @@ esp_err_t tas5805m_settings_save_eq_mode(TAS5805M_EQ_MODE mode); /** Load EQ mode from NVS */ esp_err_t tas5805m_settings_load_eq_mode(TAS5805M_EQ_MODE *mode); +/** Save per-band EQ gain for a channel to NVS (gain in dB, integer) */ +esp_err_t tas5805m_settings_save_eq_gain(TAS5805M_EQ_CHANNELS ch, int band, int gain_db); +/** Load per-band EQ gain for a channel from NVS */ +esp_err_t tas5805m_settings_load_eq_gain(TAS5805M_EQ_CHANNELS ch, int band, int *gain_db); + /** Get current TAS5805M settings as a JSON string */ esp_err_t tas5805m_settings_get_json(char *json_out, size_t max_len); diff --git a/components/tas5805m_settings/tas5805m_settings.c b/components/tas5805m_settings/tas5805m_settings.c index 2cef9bb6..d6c3078a 100644 --- a/components/tas5805m_settings/tas5805m_settings.c +++ b/components/tas5805m_settings/tas5805m_settings.c @@ -381,6 +381,79 @@ esp_err_t tas5805m_settings_save_eq_mode(TAS5805M_EQ_MODE mode) { return err; } +/** Save per-band EQ gain for a specific channel */ +esp_err_t tas5805m_settings_save_eq_gain(TAS5805M_EQ_CHANNELS ch, int band, int gain_db) { + ESP_LOGD(TAG, "%s: ch=%d band=%d gain=%d", __func__, (int)ch, band, gain_db); + + if (!tas5805m_settings_mutex) return ESP_ERR_INVALID_STATE; + if (band < 0 || band >= TAS5805M_EQ_BANDS) return ESP_ERR_INVALID_ARG; + + if (xSemaphoreTake(tas5805m_settings_mutex, pdMS_TO_TICKS(5000)) != pdTRUE) { + return ESP_ERR_TIMEOUT; + } + + char key[32]; + if (ch == TAS5805M_EQ_CHANNELS_LEFT) { + snprintf(key, sizeof(key), "%s%d", TAS5805M_NVS_KEY_EQ_GAIN_L_PREFIX, band); + } else { + snprintf(key, sizeof(key), "%s%d", TAS5805M_NVS_KEY_EQ_GAIN_R_PREFIX, band); + } + + nvs_handle_t h; + esp_err_t err = nvs_open(TAS5805M_NVS_NAMESPACE, NVS_READWRITE, &h); + if (err == ESP_OK) { + err = nvs_set_i32(h, key, (int32_t)gain_db); + if (err == ESP_OK) { + err = nvs_commit(h); + } + nvs_close(h); + } else { + ESP_LOGW(TAG, "%s: Failed to open NVS namespace '%s': %s", __func__, TAS5805M_NVS_NAMESPACE, esp_err_to_name(err)); + } + + xSemaphoreGive(tas5805m_settings_mutex); + return err; +} + +/** Load per-band EQ gain for a specific channel */ +esp_err_t tas5805m_settings_load_eq_gain(TAS5805M_EQ_CHANNELS ch, int band, int *gain_db) { + if (!gain_db) return ESP_ERR_INVALID_ARG; + if (!tas5805m_settings_mutex) return ESP_ERR_INVALID_STATE; + if (band < 0 || band >= TAS5805M_EQ_BANDS) return ESP_ERR_INVALID_ARG; + + if (xSemaphoreTake(tas5805m_settings_mutex, pdMS_TO_TICKS(5000)) != pdTRUE) { + return ESP_ERR_TIMEOUT; + } + + char key[32]; + if (ch == TAS5805M_EQ_CHANNELS_LEFT) { + snprintf(key, sizeof(key), "%s%d", TAS5805M_NVS_KEY_EQ_GAIN_L_PREFIX, band); + } else { + snprintf(key, sizeof(key), "%s%d", TAS5805M_NVS_KEY_EQ_GAIN_R_PREFIX, band); + } + + nvs_handle_t h; + esp_err_t err = nvs_open(TAS5805M_NVS_NAMESPACE, NVS_READONLY, &h); + if (err == ESP_OK) { + int32_t v = 0; + err = nvs_get_i32(h, key, &v); + if (err == ESP_OK) { + *gain_db = (int)v; + ESP_LOGD(TAG, "%s: Loaded %s=%d from NVS", __func__, key, *gain_db); + } else if (err == ESP_ERR_NVS_NOT_FOUND) { + ESP_LOGD(TAG, "%s: NVS key '%s' not found", __func__, key); + } else { + ESP_LOGW(TAG, "%s: Failed to read '%s' from NVS: %s", __func__, key, esp_err_to_name(err)); + } + nvs_close(h); + } else { + ESP_LOGW(TAG, "%s: Failed to open NVS namespace '%s': %s", __func__, TAS5805M_NVS_NAMESPACE, esp_err_to_name(err)); + } + + xSemaphoreGive(tas5805m_settings_mutex); + return err; +} + /** Load EQ mode from NVS */ esp_err_t tas5805m_settings_load_eq_mode(TAS5805M_EQ_MODE *mode) { if (!mode) return ESP_ERR_INVALID_ARG; @@ -490,6 +563,23 @@ esp_err_t tas5805m_settings_get_json(char *json_out, size_t max_len) { cJSON_AddNumberToObject(root, "mixer_mode", (int)dac_state.mixer_mode); cJSON_AddStringToObject(root, "mixer_mode_name", tas5805m_mixer_mode_to_string(dac_state.mixer_mode)); + /* Per-band EQ gains (left/right) so UI can display current values without refresh */ +#if defined(CONFIG_DAC_TAS5805M_EQ_SUPPORT) + for (int band = 0; band < TAS5805M_EQ_BANDS; ++band) { + int gain = 0; + if (tas5805m_get_eq_gain_channel(TAS5805M_EQ_CHANNELS_LEFT, band, &gain) == ESP_OK) { + char key_l[32]; + snprintf(key_l, sizeof(key_l), "%s%d", TAS5805M_NVS_KEY_EQ_GAIN_L_PREFIX, band); + cJSON_AddNumberToObject(root, key_l, gain); + } + if (tas5805m_get_eq_gain_channel(TAS5805M_EQ_CHANNELS_RIGHT, band, &gain) == ESP_OK) { + char key_r[32]; + snprintf(key_r, sizeof(key_r), "%s%d", TAS5805M_NVS_KEY_EQ_GAIN_R_PREFIX, band); + cJSON_AddNumberToObject(root, key_r, gain); + } + } +#endif + // Render to string char *json_str = cJSON_PrintUnformatted(root); cJSON_Delete(root); @@ -667,6 +757,48 @@ esp_err_t tas5805m_settings_set_from_json(const char *json_in) { #endif } + // Handle per-band EQ gain keys in deterministic order: left then right per band +#if defined(CONFIG_DAC_TAS5805M_EQ_SUPPORT) + for (int band = 0; band < TAS5805M_EQ_BANDS; ++band) { + char key_l[32]; + char key_r[32]; + snprintf(key_l, sizeof(key_l), "%s%d", TAS5805M_NVS_KEY_EQ_GAIN_L_PREFIX, band); + snprintf(key_r, sizeof(key_r), "%s%d", TAS5805M_NVS_KEY_EQ_GAIN_R_PREFIX, band); + + cJSON *item_l = cJSON_GetObjectItem(root, key_l); + if (cJSON_IsNumber(item_l)) { + int gain = item_l->valueint; + esp_err_t serr = tas5805m_set_eq_gain_channel(TAS5805M_EQ_CHANNELS_LEFT, band, gain); + if (serr == ESP_OK) { + ESP_LOGI(TAG, "%s: Applied EQ gain L band %d = %d", __func__, band, gain); + esp_err_t perr = tas5805m_settings_save_eq_gain(TAS5805M_EQ_CHANNELS_LEFT, band, gain); + if (perr != ESP_OK) { + ESP_LOGW(TAG, "%s: Failed to persist EQ gain L band %d: %s", __func__, band, esp_err_to_name(perr)); + } + } else { + ESP_LOGE(TAG, "%s: Failed to apply EQ gain L band %d: %s", __func__, band, esp_err_to_name(serr)); + } + } + + cJSON *item_r = cJSON_GetObjectItem(root, key_r); + if (cJSON_IsNumber(item_r)) { + int gain = item_r->valueint; + esp_err_t serr = tas5805m_set_eq_gain_channel(TAS5805M_EQ_CHANNELS_RIGHT, band, gain); + if (serr == ESP_OK) { + ESP_LOGI(TAG, "%s: Applied EQ gain R band %d = %d", __func__, band, gain); + esp_err_t perr = tas5805m_settings_save_eq_gain(TAS5805M_EQ_CHANNELS_RIGHT, band, gain); + if (perr != ESP_OK) { + ESP_LOGW(TAG, "%s: Failed to persist EQ gain R band %d: %s", __func__, band, esp_err_to_name(perr)); + } + } else { + ESP_LOGE(TAG, "%s: Failed to apply EQ gain R band %d: %s", __func__, band, esp_err_to_name(serr)); + } + } + } +#else + (void)root; // keep compiler happy when EQ support disabled +#endif + cJSON_Delete(root); return err; } @@ -1028,6 +1160,58 @@ esp_err_t tas5805m_settings_get_schema_json(char *json_out, size_t max_len) { cJSON_AddItemToObject(eq_mode_param, "values", eq_mode_values); cJSON_AddItemToArray(eq_params, eq_mode_param); cJSON_AddItemToObject(eq_group, "parameters", eq_params); + /* Add per-band sliders for left and right channels (if EQ supported) */ +#if defined(CONFIG_DAC_TAS5805M_EQ_SUPPORT) + for (int band = 0; band < TAS5805M_EQ_BANDS; ++band) { + int cur_l = 0, cur_r = 0; + if (tas5805m_get_eq_gain_channel(TAS5805M_EQ_CHANNELS_LEFT, band, &cur_l) != ESP_OK) { + cur_l = 0; + } + if (tas5805m_get_eq_gain_channel(TAS5805M_EQ_CHANNELS_RIGHT, band, &cur_r) != ESP_OK) { + cur_r = 0; + } + + char key_l[32]; + char key_r[32]; + snprintf(key_l, sizeof(key_l), "%s%d", TAS5805M_NVS_KEY_EQ_GAIN_L_PREFIX, band); + snprintf(key_r, sizeof(key_r), "%s%d", TAS5805M_NVS_KEY_EQ_GAIN_R_PREFIX, band); + + // Frequency label for this band (Hz) - use tas5805m_eq_bands + char freq_label[32] = {0}; + snprintf(freq_label, sizeof(freq_label), "%d Hz", tas5805m_eq_bands[band]); + + cJSON *param_l = cJSON_CreateObject(); + cJSON_AddStringToObject(param_l, "key", key_l); + // Name uses frequency and channel: " (L)" + char name_l[48]; + snprintf(name_l, sizeof(name_l), "%s (L)", freq_label); + cJSON_AddStringToObject(param_l, "name", name_l); + cJSON_AddStringToObject(param_l, "type", "range"); + cJSON_AddStringToObject(param_l, "unit", "dB"); + cJSON_AddStringToObject(param_l, "label", freq_label); + cJSON_AddNumberToObject(param_l, "min", TAS5805M_EQ_MIN_DB); + cJSON_AddNumberToObject(param_l, "max", TAS5805M_EQ_MAX_DB); + cJSON_AddNumberToObject(param_l, "step", 1); + cJSON_AddNumberToObject(param_l, "default", 0); + cJSON_AddNumberToObject(param_l, "current", cur_l); + cJSON_AddItemToArray(eq_params, param_l); + + cJSON *param_r = cJSON_CreateObject(); + cJSON_AddStringToObject(param_r, "key", key_r); + char name_r[48]; + snprintf(name_r, sizeof(name_r), "%s (R)", freq_label); + cJSON_AddStringToObject(param_r, "name", name_r); + cJSON_AddStringToObject(param_r, "type", "range"); + cJSON_AddStringToObject(param_r, "unit", "dB"); + cJSON_AddStringToObject(param_r, "label", freq_label); + cJSON_AddNumberToObject(param_r, "min", TAS5805M_EQ_MIN_DB); + cJSON_AddNumberToObject(param_r, "max", TAS5805M_EQ_MAX_DB); + cJSON_AddNumberToObject(param_r, "step", 1); + cJSON_AddNumberToObject(param_r, "default", 0); + cJSON_AddNumberToObject(param_r, "current", cur_r); + cJSON_AddItemToArray(eq_params, param_r); + } +#endif cJSON_AddItemToArray(groups, eq_group); // End groups @@ -1125,6 +1309,28 @@ esp_err_t tas5805m_settings_apply_all(void) { #endif } +#if defined(CONFIG_DAC_TAS5805M_EQ_SUPPORT) + // Restore per-band EQ gains for both channels if persisted + for (int band = 0; band < TAS5805M_EQ_BANDS; ++band) { + int gain = 0; + if (tas5805m_settings_load_eq_gain(TAS5805M_EQ_CHANNELS_LEFT, band, &gain) == ESP_OK) { + if (tas5805m_set_eq_gain_channel(TAS5805M_EQ_CHANNELS_LEFT, band, gain) != ESP_OK) { + ESP_LOGW(TAG, "%s: Failed to apply saved EQ gain L band %d", __func__, band); + } else { + ESP_LOGI(TAG, "%s: Restored EQ gain L band %d = %d", __func__, band, gain); + } + } + + if (tas5805m_settings_load_eq_gain(TAS5805M_EQ_CHANNELS_RIGHT, band, &gain) == ESP_OK) { + if (tas5805m_set_eq_gain_channel(TAS5805M_EQ_CHANNELS_RIGHT, band, gain) != ESP_OK) { + ESP_LOGW(TAG, "%s: Failed to apply saved EQ gain R band %d", __func__, band); + } else { + ESP_LOGI(TAG, "%s: Restored EQ gain R band %d = %d", __func__, band, gain); + } + } + } +#endif + ESP_LOGI(TAG, "%s: Persisted settings application complete", __func__); return ESP_OK; } diff --git a/sdkconfig.hifi-esp32-plus b/sdkconfig.hifi-esp32-plus new file mode 100644 index 00000000..826e1d16 --- /dev/null +++ b/sdkconfig.hifi-esp32-plus @@ -0,0 +1,2506 @@ +# +# Automatically generated file. DO NOT EDIT. +# Espressif IoT Development Framework (ESP-IDF) 5.5.1 Project Configuration +# +CONFIG_SOC_CAPS_ECO_VER_MAX=301 +CONFIG_SOC_ADC_SUPPORTED=y +CONFIG_SOC_DAC_SUPPORTED=y +CONFIG_SOC_UART_SUPPORTED=y +CONFIG_SOC_MCPWM_SUPPORTED=y +CONFIG_SOC_GPTIMER_SUPPORTED=y +CONFIG_SOC_SDMMC_HOST_SUPPORTED=y +CONFIG_SOC_BT_SUPPORTED=y +CONFIG_SOC_PCNT_SUPPORTED=y +CONFIG_SOC_PHY_SUPPORTED=y +CONFIG_SOC_WIFI_SUPPORTED=y +CONFIG_SOC_SDIO_SLAVE_SUPPORTED=y +CONFIG_SOC_TWAI_SUPPORTED=y +CONFIG_SOC_EFUSE_SUPPORTED=y +CONFIG_SOC_EMAC_SUPPORTED=y +CONFIG_SOC_ULP_SUPPORTED=y +CONFIG_SOC_CCOMP_TIMER_SUPPORTED=y +CONFIG_SOC_RTC_FAST_MEM_SUPPORTED=y +CONFIG_SOC_RTC_SLOW_MEM_SUPPORTED=y +CONFIG_SOC_RTC_MEM_SUPPORTED=y +CONFIG_SOC_I2S_SUPPORTED=y +CONFIG_SOC_RMT_SUPPORTED=y +CONFIG_SOC_SDM_SUPPORTED=y +CONFIG_SOC_GPSPI_SUPPORTED=y +CONFIG_SOC_LEDC_SUPPORTED=y +CONFIG_SOC_I2C_SUPPORTED=y +CONFIG_SOC_SUPPORT_COEXISTENCE=y +CONFIG_SOC_AES_SUPPORTED=y +CONFIG_SOC_MPI_SUPPORTED=y +CONFIG_SOC_SHA_SUPPORTED=y +CONFIG_SOC_FLASH_ENC_SUPPORTED=y +CONFIG_SOC_SECURE_BOOT_SUPPORTED=y +CONFIG_SOC_TOUCH_SENSOR_SUPPORTED=y +CONFIG_SOC_BOD_SUPPORTED=y +CONFIG_SOC_ULP_FSM_SUPPORTED=y +CONFIG_SOC_CLK_TREE_SUPPORTED=y +CONFIG_SOC_MPU_SUPPORTED=y +CONFIG_SOC_WDT_SUPPORTED=y +CONFIG_SOC_SPI_FLASH_SUPPORTED=y +CONFIG_SOC_RNG_SUPPORTED=y +CONFIG_SOC_LIGHT_SLEEP_SUPPORTED=y +CONFIG_SOC_DEEP_SLEEP_SUPPORTED=y +CONFIG_SOC_LP_PERIPH_SHARE_INTERRUPT=y +CONFIG_SOC_PM_SUPPORTED=y +CONFIG_SOC_DPORT_WORKAROUND_DIS_INTERRUPT_LVL=5 +CONFIG_SOC_XTAL_SUPPORT_26M=y +CONFIG_SOC_XTAL_SUPPORT_40M=y +CONFIG_SOC_XTAL_SUPPORT_AUTO_DETECT=y +CONFIG_SOC_ADC_RTC_CTRL_SUPPORTED=y +CONFIG_SOC_ADC_DIG_CTRL_SUPPORTED=y +CONFIG_SOC_ADC_DMA_SUPPORTED=y +CONFIG_SOC_ADC_PERIPH_NUM=2 +CONFIG_SOC_ADC_MAX_CHANNEL_NUM=10 +CONFIG_SOC_ADC_ATTEN_NUM=4 +CONFIG_SOC_ADC_DIGI_CONTROLLER_NUM=2 +CONFIG_SOC_ADC_PATT_LEN_MAX=16 +CONFIG_SOC_ADC_DIGI_MIN_BITWIDTH=9 +CONFIG_SOC_ADC_DIGI_MAX_BITWIDTH=12 +CONFIG_SOC_ADC_DIGI_RESULT_BYTES=2 +CONFIG_SOC_ADC_DIGI_DATA_BYTES_PER_CONV=4 +CONFIG_SOC_ADC_DIGI_MONITOR_NUM=0 +CONFIG_SOC_ADC_SAMPLE_FREQ_THRES_HIGH=2 +CONFIG_SOC_ADC_SAMPLE_FREQ_THRES_LOW=20 +CONFIG_SOC_ADC_RTC_MIN_BITWIDTH=9 +CONFIG_SOC_ADC_RTC_MAX_BITWIDTH=12 +CONFIG_SOC_ADC_SHARED_POWER=y +CONFIG_SOC_BROWNOUT_RESET_SUPPORTED=y +CONFIG_SOC_SHARED_IDCACHE_SUPPORTED=y +CONFIG_SOC_IDCACHE_PER_CORE=y +CONFIG_SOC_CPU_CORES_NUM=2 +CONFIG_SOC_CPU_INTR_NUM=32 +CONFIG_SOC_CPU_HAS_FPU=y +CONFIG_SOC_HP_CPU_HAS_MULTIPLE_CORES=y +CONFIG_SOC_CPU_BREAKPOINTS_NUM=2 +CONFIG_SOC_CPU_WATCHPOINTS_NUM=2 +CONFIG_SOC_CPU_WATCHPOINT_MAX_REGION_SIZE=0x40 +CONFIG_SOC_DAC_CHAN_NUM=2 +CONFIG_SOC_DAC_RESOLUTION=8 +CONFIG_SOC_DAC_DMA_16BIT_ALIGN=y +CONFIG_SOC_GPIO_PORT=1 +CONFIG_SOC_GPIO_PIN_COUNT=40 +CONFIG_SOC_GPIO_VALID_GPIO_MASK=0xFFFFFFFFFF +CONFIG_SOC_GPIO_IN_RANGE_MAX=39 +CONFIG_SOC_GPIO_OUT_RANGE_MAX=33 +CONFIG_SOC_GPIO_VALID_DIGITAL_IO_PAD_MASK=0xEF0FEA +CONFIG_SOC_GPIO_CLOCKOUT_BY_IO_MUX=y +CONFIG_SOC_GPIO_CLOCKOUT_CHANNEL_NUM=3 +CONFIG_SOC_GPIO_SUPPORT_HOLD_IO_IN_DSLP=y +CONFIG_SOC_I2C_NUM=2 +CONFIG_SOC_HP_I2C_NUM=2 +CONFIG_SOC_I2C_FIFO_LEN=32 +CONFIG_SOC_I2C_CMD_REG_NUM=16 +CONFIG_SOC_I2C_SUPPORT_SLAVE=y +CONFIG_SOC_I2C_SUPPORT_APB=y +CONFIG_SOC_I2C_SUPPORT_10BIT_ADDR=y +CONFIG_SOC_I2C_STOP_INDEPENDENT=y +CONFIG_SOC_I2S_NUM=2 +CONFIG_SOC_I2S_HW_VERSION_1=y +CONFIG_SOC_I2S_SUPPORTS_APLL=y +CONFIG_SOC_I2S_SUPPORTS_PLL_F160M=y +CONFIG_SOC_I2S_SUPPORTS_PDM=y +CONFIG_SOC_I2S_SUPPORTS_PDM_TX=y +CONFIG_SOC_I2S_SUPPORTS_PCM2PDM=y +CONFIG_SOC_I2S_SUPPORTS_PDM_RX=y +CONFIG_SOC_I2S_SUPPORTS_PDM2PCM=y +CONFIG_SOC_I2S_PDM_MAX_TX_LINES=1 +CONFIG_SOC_I2S_PDM_MAX_RX_LINES=1 +CONFIG_SOC_I2S_SUPPORTS_ADC_DAC=y +CONFIG_SOC_I2S_SUPPORTS_ADC=y +CONFIG_SOC_I2S_SUPPORTS_DAC=y +CONFIG_SOC_I2S_SUPPORTS_LCD_CAMERA=y +CONFIG_SOC_I2S_MAX_DATA_WIDTH=24 +CONFIG_SOC_I2S_TRANS_SIZE_ALIGN_WORD=y +CONFIG_SOC_I2S_LCD_I80_VARIANT=y +CONFIG_SOC_LCD_I80_SUPPORTED=y +CONFIG_SOC_LCD_I80_BUSES=2 +CONFIG_SOC_LCD_I80_BUS_WIDTH=24 +CONFIG_SOC_LEDC_HAS_TIMER_SPECIFIC_MUX=y +CONFIG_SOC_LEDC_SUPPORT_APB_CLOCK=y +CONFIG_SOC_LEDC_SUPPORT_REF_TICK=y +CONFIG_SOC_LEDC_SUPPORT_HS_MODE=y +CONFIG_SOC_LEDC_TIMER_NUM=4 +CONFIG_SOC_LEDC_CHANNEL_NUM=8 +CONFIG_SOC_LEDC_TIMER_BIT_WIDTH=20 +CONFIG_SOC_MCPWM_GROUPS=2 +CONFIG_SOC_MCPWM_TIMERS_PER_GROUP=3 +CONFIG_SOC_MCPWM_OPERATORS_PER_GROUP=3 +CONFIG_SOC_MCPWM_COMPARATORS_PER_OPERATOR=2 +CONFIG_SOC_MCPWM_GENERATORS_PER_OPERATOR=2 +CONFIG_SOC_MCPWM_TRIGGERS_PER_OPERATOR=2 +CONFIG_SOC_MCPWM_GPIO_FAULTS_PER_GROUP=3 +CONFIG_SOC_MCPWM_CAPTURE_TIMERS_PER_GROUP=y +CONFIG_SOC_MCPWM_CAPTURE_CHANNELS_PER_TIMER=3 +CONFIG_SOC_MCPWM_GPIO_SYNCHROS_PER_GROUP=3 +CONFIG_SOC_MMU_PERIPH_NUM=2 +CONFIG_SOC_MMU_LINEAR_ADDRESS_REGION_NUM=3 +CONFIG_SOC_MPU_MIN_REGION_SIZE=0x20000000 +CONFIG_SOC_MPU_REGIONS_MAX_NUM=8 +CONFIG_SOC_PCNT_GROUPS=1 +CONFIG_SOC_PCNT_UNITS_PER_GROUP=8 +CONFIG_SOC_PCNT_CHANNELS_PER_UNIT=2 +CONFIG_SOC_PCNT_THRES_POINT_PER_UNIT=2 +CONFIG_SOC_RMT_GROUPS=1 +CONFIG_SOC_RMT_TX_CANDIDATES_PER_GROUP=8 +CONFIG_SOC_RMT_RX_CANDIDATES_PER_GROUP=8 +CONFIG_SOC_RMT_CHANNELS_PER_GROUP=8 +CONFIG_SOC_RMT_MEM_WORDS_PER_CHANNEL=64 +CONFIG_SOC_RMT_SUPPORT_REF_TICK=y +CONFIG_SOC_RMT_SUPPORT_APB=y +CONFIG_SOC_RMT_CHANNEL_CLK_INDEPENDENT=y +CONFIG_SOC_RTCIO_PIN_COUNT=18 +CONFIG_SOC_RTCIO_INPUT_OUTPUT_SUPPORTED=y +CONFIG_SOC_RTCIO_HOLD_SUPPORTED=y +CONFIG_SOC_RTCIO_WAKE_SUPPORTED=y +CONFIG_SOC_SDM_GROUPS=1 +CONFIG_SOC_SDM_CHANNELS_PER_GROUP=8 +CONFIG_SOC_SDM_CLK_SUPPORT_APB=y +CONFIG_SOC_SPI_HD_BOTH_INOUT_SUPPORTED=y +CONFIG_SOC_SPI_AS_CS_SUPPORTED=y +CONFIG_SOC_SPI_PERIPH_NUM=3 +CONFIG_SOC_SPI_DMA_CHAN_NUM=2 +CONFIG_SOC_SPI_MAX_CS_NUM=3 +CONFIG_SOC_SPI_SUPPORT_CLK_APB=y +CONFIG_SOC_SPI_MAXIMUM_BUFFER_SIZE=64 +CONFIG_SOC_SPI_MAX_PRE_DIVIDER=8192 +CONFIG_SOC_MEMSPI_SRC_FREQ_80M_SUPPORTED=y +CONFIG_SOC_MEMSPI_SRC_FREQ_40M_SUPPORTED=y +CONFIG_SOC_MEMSPI_SRC_FREQ_26M_SUPPORTED=y +CONFIG_SOC_MEMSPI_SRC_FREQ_20M_SUPPORTED=y +CONFIG_SOC_TIMER_GROUPS=2 +CONFIG_SOC_TIMER_GROUP_TIMERS_PER_GROUP=2 +CONFIG_SOC_TIMER_GROUP_COUNTER_BIT_WIDTH=64 +CONFIG_SOC_TIMER_GROUP_TOTAL_TIMERS=4 +CONFIG_SOC_TIMER_GROUP_SUPPORT_APB=y +CONFIG_SOC_LP_TIMER_BIT_WIDTH_LO=32 +CONFIG_SOC_LP_TIMER_BIT_WIDTH_HI=16 +CONFIG_SOC_TOUCH_SENSOR_VERSION=1 +CONFIG_SOC_TOUCH_SENSOR_NUM=10 +CONFIG_SOC_TOUCH_MIN_CHAN_ID=0 +CONFIG_SOC_TOUCH_MAX_CHAN_ID=9 +CONFIG_SOC_TOUCH_SUPPORT_SLEEP_WAKEUP=y +CONFIG_SOC_TOUCH_SAMPLE_CFG_NUM=1 +CONFIG_SOC_TWAI_CONTROLLER_NUM=1 +CONFIG_SOC_TWAI_MASK_FILTER_NUM=1 +CONFIG_SOC_TWAI_BRP_MIN=2 +CONFIG_SOC_TWAI_CLK_SUPPORT_APB=y +CONFIG_SOC_TWAI_SUPPORT_MULTI_ADDRESS_LAYOUT=y +CONFIG_SOC_UART_NUM=3 +CONFIG_SOC_UART_HP_NUM=3 +CONFIG_SOC_UART_SUPPORT_APB_CLK=y +CONFIG_SOC_UART_SUPPORT_REF_TICK=y +CONFIG_SOC_UART_FIFO_LEN=128 +CONFIG_SOC_UART_BITRATE_MAX=5000000 +CONFIG_SOC_UART_WAKEUP_SUPPORT_ACTIVE_THRESH_MODE=y +CONFIG_SOC_SPIRAM_SUPPORTED=y +CONFIG_SOC_SPI_MEM_SUPPORT_CONFIG_GPIO_BY_EFUSE=y +CONFIG_SOC_SHA_SUPPORT_PARALLEL_ENG=y +CONFIG_SOC_SHA_ENDIANNESS_BE=y +CONFIG_SOC_SHA_SUPPORT_SHA1=y +CONFIG_SOC_SHA_SUPPORT_SHA256=y +CONFIG_SOC_SHA_SUPPORT_SHA384=y +CONFIG_SOC_SHA_SUPPORT_SHA512=y +CONFIG_SOC_MPI_MEM_BLOCKS_NUM=4 +CONFIG_SOC_MPI_OPERATIONS_NUM=1 +CONFIG_SOC_RSA_MAX_BIT_LEN=4096 +CONFIG_SOC_AES_SUPPORT_AES_128=y +CONFIG_SOC_AES_SUPPORT_AES_192=y +CONFIG_SOC_AES_SUPPORT_AES_256=y +CONFIG_SOC_SECURE_BOOT_V1=y +CONFIG_SOC_EFUSE_SECURE_BOOT_KEY_DIGESTS=1 +CONFIG_SOC_FLASH_ENCRYPTED_XTS_AES_BLOCK_MAX=32 +CONFIG_SOC_PHY_DIG_REGS_MEM_SIZE=21 +CONFIG_SOC_PM_SUPPORT_EXT0_WAKEUP=y +CONFIG_SOC_PM_SUPPORT_EXT1_WAKEUP=y +CONFIG_SOC_PM_SUPPORT_EXT_WAKEUP=y +CONFIG_SOC_PM_SUPPORT_TOUCH_SENSOR_WAKEUP=y +CONFIG_SOC_PM_SUPPORT_RTC_PERIPH_PD=y +CONFIG_SOC_PM_SUPPORT_RTC_FAST_MEM_PD=y +CONFIG_SOC_PM_SUPPORT_RTC_SLOW_MEM_PD=y +CONFIG_SOC_PM_SUPPORT_RC_FAST_PD=y +CONFIG_SOC_PM_SUPPORT_VDDSDIO_PD=y +CONFIG_SOC_PM_SUPPORT_MODEM_PD=y +CONFIG_SOC_CONFIGURABLE_VDDSDIO_SUPPORTED=y +CONFIG_SOC_PM_MODEM_PD_BY_SW=y +CONFIG_SOC_CLK_APLL_SUPPORTED=y +CONFIG_SOC_CLK_RC_FAST_D256_SUPPORTED=y +CONFIG_SOC_RTC_SLOW_CLK_SUPPORT_RC_FAST_D256=y +CONFIG_SOC_CLK_RC_FAST_SUPPORT_CALIBRATION=y +CONFIG_SOC_CLK_XTAL32K_SUPPORTED=y +CONFIG_SOC_CLK_LP_FAST_SUPPORT_XTAL_D4=y +CONFIG_SOC_SDMMC_USE_IOMUX=y +CONFIG_SOC_SDMMC_NUM_SLOTS=2 +CONFIG_SOC_WIFI_WAPI_SUPPORT=y +CONFIG_SOC_WIFI_CSI_SUPPORT=y +CONFIG_SOC_WIFI_MESH_SUPPORT=y +CONFIG_SOC_WIFI_SUPPORT_VARIABLE_BEACON_WINDOW=y +CONFIG_SOC_WIFI_NAN_SUPPORT=y +CONFIG_SOC_BLE_SUPPORTED=y +CONFIG_SOC_BLE_MESH_SUPPORTED=y +CONFIG_SOC_BT_CLASSIC_SUPPORTED=y +CONFIG_SOC_BLUFI_SUPPORTED=y +CONFIG_SOC_BT_H2C_ENC_KEY_CTRL_ENH_VSC_SUPPORTED=y +CONFIG_SOC_BLE_MULTI_CONN_OPTIMIZATION=y +CONFIG_SOC_ULP_HAS_ADC=y +CONFIG_SOC_PHY_COMBO_MODULE=y +CONFIG_SOC_EMAC_RMII_CLK_OUT_INTERNAL_LOOPBACK=y +CONFIG_IDF_CMAKE=y +CONFIG_IDF_TOOLCHAIN="gcc" +CONFIG_IDF_TOOLCHAIN_GCC=y +CONFIG_IDF_TARGET_ARCH_XTENSA=y +CONFIG_IDF_TARGET_ARCH="xtensa" +CONFIG_IDF_TARGET="esp32" +CONFIG_IDF_INIT_VERSION="5.5.1" +CONFIG_IDF_TARGET_ESP32=y +CONFIG_IDF_FIRMWARE_CHIP_ID=0x0000 + +# +# Build type +# +CONFIG_APP_BUILD_TYPE_APP_2NDBOOT=y +# CONFIG_APP_BUILD_TYPE_RAM is not set +CONFIG_APP_BUILD_GENERATE_BINARIES=y +CONFIG_APP_BUILD_BOOTLOADER=y +CONFIG_APP_BUILD_USE_FLASH_SECTIONS=y +# CONFIG_APP_REPRODUCIBLE_BUILD is not set +# CONFIG_APP_NO_BLOBS is not set +# CONFIG_APP_COMPATIBLE_PRE_V2_1_BOOTLOADERS is not set +# CONFIG_APP_COMPATIBLE_PRE_V3_1_BOOTLOADERS is not set +# end of Build type + +# +# Bootloader config +# + +# +# Bootloader manager +# +CONFIG_BOOTLOADER_COMPILE_TIME_DATE=y +CONFIG_BOOTLOADER_PROJECT_VER=1 +# end of Bootloader manager + +# +# Application Rollback +# +CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE=y +# CONFIG_BOOTLOADER_APP_ANTI_ROLLBACK is not set +# end of Application Rollback + +# +# Recovery Bootloader and Rollback +# +# end of Recovery Bootloader and Rollback + +CONFIG_BOOTLOADER_OFFSET_IN_FLASH=0x1000 +CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE=y +# CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_DEBUG is not set +# CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_PERF is not set +# CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_NONE is not set + +# +# Log +# +CONFIG_BOOTLOADER_LOG_VERSION_1=y +CONFIG_BOOTLOADER_LOG_VERSION=1 +# CONFIG_BOOTLOADER_LOG_LEVEL_NONE is not set +CONFIG_BOOTLOADER_LOG_LEVEL_ERROR=y +# CONFIG_BOOTLOADER_LOG_LEVEL_WARN is not set +# CONFIG_BOOTLOADER_LOG_LEVEL_INFO is not set +# CONFIG_BOOTLOADER_LOG_LEVEL_DEBUG is not set +# CONFIG_BOOTLOADER_LOG_LEVEL_VERBOSE is not set +CONFIG_BOOTLOADER_LOG_LEVEL=1 + +# +# Format +# +# CONFIG_BOOTLOADER_LOG_COLORS is not set +CONFIG_BOOTLOADER_LOG_TIMESTAMP_SOURCE_CPU_TICKS=y +# end of Format + +# +# Settings +# +CONFIG_BOOTLOADER_LOG_MODE_TEXT_EN=y +CONFIG_BOOTLOADER_LOG_MODE_TEXT=y +# end of Settings +# end of Log + +# +# Serial Flash Configurations +# +# CONFIG_BOOTLOADER_SPI_CUSTOM_WP_PIN is not set +CONFIG_BOOTLOADER_SPI_WP_PIN=7 +# CONFIG_BOOTLOADER_FLASH_DC_AWARE is not set +CONFIG_BOOTLOADER_FLASH_XMC_SUPPORT=y +# end of Serial Flash Configurations + +CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_9V=y +# CONFIG_BOOTLOADER_FACTORY_RESET is not set +# CONFIG_BOOTLOADER_APP_TEST is not set +CONFIG_BOOTLOADER_REGION_PROTECTION_ENABLE=y +CONFIG_BOOTLOADER_WDT_ENABLE=y +# CONFIG_BOOTLOADER_WDT_DISABLE_IN_USER_CODE is not set +CONFIG_BOOTLOADER_WDT_TIME_MS=9000 +# CONFIG_BOOTLOADER_SKIP_VALIDATE_IN_DEEP_SLEEP is not set +# CONFIG_BOOTLOADER_SKIP_VALIDATE_ON_POWER_ON is not set +# CONFIG_BOOTLOADER_SKIP_VALIDATE_ALWAYS is not set +CONFIG_BOOTLOADER_RESERVE_RTC_SIZE=0 +# CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC is not set +# end of Bootloader config + +# +# Security features +# +CONFIG_SECURE_BOOT_V1_SUPPORTED=y +# CONFIG_SECURE_SIGNED_APPS_NO_SECURE_BOOT is not set +# CONFIG_SECURE_BOOT is not set +# CONFIG_SECURE_FLASH_ENC_ENABLED is not set +# end of Security features + +# +# Application manager +# +CONFIG_APP_COMPILE_TIME_DATE=y +# CONFIG_APP_EXCLUDE_PROJECT_VER_VAR is not set +# CONFIG_APP_EXCLUDE_PROJECT_NAME_VAR is not set +# CONFIG_APP_PROJECT_VER_FROM_CONFIG is not set +CONFIG_APP_RETRIEVE_LEN_ELF_SHA=16 +# end of Application manager + +CONFIG_ESP_ROM_HAS_CRC_LE=y +CONFIG_ESP_ROM_HAS_CRC_BE=y +CONFIG_ESP_ROM_HAS_MZ_CRC32=y +CONFIG_ESP_ROM_HAS_JPEG_DECODE=y +CONFIG_ESP_ROM_HAS_UART_BUF_SWITCH=y +CONFIG_ESP_ROM_NEEDS_SWSETUP_WORKAROUND=y +CONFIG_ESP_ROM_HAS_NEWLIB=y +CONFIG_ESP_ROM_HAS_NEWLIB_NANO_FORMAT=y +CONFIG_ESP_ROM_HAS_NEWLIB_32BIT_TIME=y +CONFIG_ESP_ROM_HAS_SW_FLOAT=y +CONFIG_ESP_ROM_USB_OTG_NUM=-1 +CONFIG_ESP_ROM_USB_SERIAL_DEVICE_NUM=-1 +CONFIG_ESP_ROM_SUPPORT_DEEP_SLEEP_WAKEUP_STUB=y +CONFIG_ESP_ROM_HAS_OUTPUT_PUTC_FUNC=y + +# +# Serial flasher config +# +# CONFIG_ESPTOOLPY_NO_STUB is not set +CONFIG_ESPTOOLPY_FLASHMODE_QIO=y +# CONFIG_ESPTOOLPY_FLASHMODE_QOUT is not set +# CONFIG_ESPTOOLPY_FLASHMODE_DIO is not set +# CONFIG_ESPTOOLPY_FLASHMODE_DOUT is not set +CONFIG_ESPTOOLPY_FLASH_SAMPLE_MODE_STR=y +CONFIG_ESPTOOLPY_FLASHMODE="dio" +CONFIG_ESPTOOLPY_FLASHFREQ_80M=y +# CONFIG_ESPTOOLPY_FLASHFREQ_40M is not set +# CONFIG_ESPTOOLPY_FLASHFREQ_26M is not set +# CONFIG_ESPTOOLPY_FLASHFREQ_20M is not set +CONFIG_ESPTOOLPY_FLASHFREQ="80m" +# CONFIG_ESPTOOLPY_FLASHSIZE_1MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_2MB is not set +CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y +# CONFIG_ESPTOOLPY_FLASHSIZE_8MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_16MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_32MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_64MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_128MB is not set +CONFIG_ESPTOOLPY_FLASHSIZE="4MB" +# CONFIG_ESPTOOLPY_HEADER_FLASHSIZE_UPDATE is not set +CONFIG_ESPTOOLPY_BEFORE_RESET=y +# CONFIG_ESPTOOLPY_BEFORE_NORESET is not set +CONFIG_ESPTOOLPY_BEFORE="default_reset" +CONFIG_ESPTOOLPY_AFTER_RESET=y +# CONFIG_ESPTOOLPY_AFTER_NORESET is not set +CONFIG_ESPTOOLPY_AFTER="hard_reset" +CONFIG_ESPTOOLPY_MONITOR_BAUD=115200 +# end of Serial flasher config + +# +# Partition Table +# +# CONFIG_PARTITION_TABLE_SINGLE_APP is not set +# CONFIG_PARTITION_TABLE_SINGLE_APP_LARGE is not set +# CONFIG_PARTITION_TABLE_TWO_OTA is not set +# CONFIG_PARTITION_TABLE_TWO_OTA_LARGE is not set +CONFIG_PARTITION_TABLE_CUSTOM=y +CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv" +CONFIG_PARTITION_TABLE_FILENAME="partitions.csv" +CONFIG_PARTITION_TABLE_OFFSET=0x8000 +CONFIG_PARTITION_TABLE_MD5=y +# end of Partition Table + +# +# Snapclient Configuration +# +CONFIG_SNAPSERVER_USE_MDNS=y +# CONFIG_SNAPCLIENT_CONNECT_IPV6 is not set +CONFIG_SNAPCLIENT_NAME="hifi-esp32" + +# +# HTTP Server Setting +# +CONFIG_WEB_PORT=80 +# end of HTTP Server Setting + +CONFIG_USE_SAMPLE_INSERTION=y +# end of Snapclient Configuration + +# +# Audio Board +# +CONFIG_AUDIO_BOARD_CUSTOM=y +# CONFIG_ESP_LYRAT_V4_3_BOARD is not set +# CONFIG_ESP_LYRAT_V4_2_BOARD is not set +# CONFIG_ESP_LYRATD_MSC_V2_1_BOARD is not set +# CONFIG_ESP_LYRATD_MSC_V2_2_BOARD is not set +# CONFIG_ESP_LYRAT_MINI_V1_1_BOARD is not set +# CONFIG_ESP32_KORVO_DU1906_BOARD is not set +# CONFIG_ESP32_S2_KALUGA_1_V1_2_BOARD is not set +# CONFIG_ESP_AI_THINKER_ES8388_BOARD is not set + +# +# Custom Audio Board +# +CONFIG_DAC_PCM51XX=y +# CONFIG_DAC_PCM5102A is not set +# CONFIG_DAC_MA120 is not set +# CONFIG_DAC_MA120X0 is not set +# CONFIG_DAC_ADAU1961 is not set +# CONFIG_DAC_MAX98357 is not set +# CONFIG_DAC_TAS5805M is not set +# CONFIG_DAC_PT8211 is not set + +# +# DAC I2C control interface +# +CONFIG_DAC_I2C_SDA=27 +CONFIG_DAC_I2C_SCL=21 +CONFIG_DAC_I2C_ADDR=0x4D +# end of DAC I2C control interface + +# +# I2S master interface +# +CONFIG_MASTER_I2S_MCLK_PIN=0 +CONFIG_MASTER_I2S_BCK_PIN=26 +CONFIG_MASTER_I2S_LRCK_PIN=25 +CONFIG_MASTER_I2S_DATAOUT_PIN=22 +# end of I2S master interface + +# +# Logic-Level-Settings +# +# CONFIG_INVERT_MCLK_LEVEL is not set +# CONFIG_INVERT_WORD_SELECT_LEVEL is not set +# CONFIG_INVERT_BCLK_LEVEL is not set +# end of Logic-Level-Settings +# end of Custom Audio Board +# end of Audio Board + +# +# ESP32 DSP processor config +# +CONFIG_USE_DSP_PROCESSOR=y +# CONFIG_SNAPCLIENT_MIX_LR_TO_MONO is not set +CONFIG_SNAPCLIENT_DSP_FLOW_STEREO=y +# CONFIG_SNAPCLIENT_DSP_FLOW_BASSBOOST is not set +# CONFIG_SNAPCLIENT_DSP_FLOW_BIAMP is not set +# CONFIG_SNAPCLIENT_DSP_FLOW_BASS_TREBLE_EQ is not set +CONFIG_USE_BIQUAD_ASM=y +# CONFIG_SNAPCLIENT_USE_SOFT_VOL is not set +# end of ESP32 DSP processor config + +# +# SNTP Configuration +# +CONFIG_SNTP_TIMEZONE="UTC" +CONFIG_SNTP_SERVER="pool.ntp.org" +# end of SNTP Configuration + +# +# Snapclient Ethernet Configuration +# +CONFIG_ENV_GPIO_RANGE_MIN=0 +CONFIG_ENV_GPIO_RANGE_MAX=39 +CONFIG_ENV_GPIO_IN_RANGE_MAX=39 +CONFIG_ENV_GPIO_OUT_RANGE_MAX=33 +# CONFIG_SNAPCLIENT_USE_INTERNAL_ETHERNET is not set +# CONFIG_SNAPCLIENT_USE_SPI_ETHERNET is not set +# end of Snapclient Ethernet Configuration + +# +# Wifi Configuration +# +CONFIG_ENABLE_WIFI_PROVISIONING=y +# CONFIG_WIFI_AUTH_WEP is not set +# CONFIG_WIFI_AUTH_WPA_PSK is not set +# CONFIG_WIFI_AUTH_WPA2_PSK is not set +# CONFIG_WIFI_AUTH_WPA_WPA2_PSK is not set +CONFIG_WIFI_AUTH_WPA2_WPA3_PSK=y +# CONFIG_WIFI_AUTH_ENTERPRISE is not set +# CONFIG_WIFI_AUTH_WPA2_ENTERPRISE is not set +# CONFIG_WIFI_AUTH_WPA3_PSK is not set +# CONFIG_WIFI_AUTH_WPA3_ENT_192 is not set +# CONFIG_WIFI_AUTH_WAPI_PSK is not set +# CONFIG_WIFI_AUTH_OWE is not set +CONFIG_WIFI_MAXIMUM_RETRY=0 +# end of Wifi Configuration + +# +# Compiler options +# +# CONFIG_COMPILER_OPTIMIZATION_DEBUG is not set +# CONFIG_COMPILER_OPTIMIZATION_SIZE is not set +CONFIG_COMPILER_OPTIMIZATION_PERF=y +# CONFIG_COMPILER_OPTIMIZATION_NONE is not set +CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE=y +# CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT is not set +# CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE is not set +CONFIG_COMPILER_ASSERT_NDEBUG_EVALUATE=y +CONFIG_COMPILER_FLOAT_LIB_FROM_GCCLIB=y +CONFIG_COMPILER_OPTIMIZATION_ASSERTION_LEVEL=2 +# CONFIG_COMPILER_OPTIMIZATION_CHECKS_SILENT is not set +CONFIG_COMPILER_HIDE_PATHS_MACROS=y +# CONFIG_COMPILER_CXX_EXCEPTIONS is not set +# CONFIG_COMPILER_CXX_RTTI is not set +CONFIG_COMPILER_STACK_CHECK_MODE_NONE=y +# CONFIG_COMPILER_STACK_CHECK_MODE_NORM is not set +# CONFIG_COMPILER_STACK_CHECK_MODE_STRONG is not set +# CONFIG_COMPILER_STACK_CHECK_MODE_ALL is not set +# CONFIG_COMPILER_NO_MERGE_CONSTANTS is not set +# CONFIG_COMPILER_WARN_WRITE_STRINGS is not set +CONFIG_COMPILER_DISABLE_DEFAULT_ERRORS=y +# CONFIG_COMPILER_DISABLE_GCC12_WARNINGS is not set +# CONFIG_COMPILER_DISABLE_GCC13_WARNINGS is not set +# CONFIG_COMPILER_DISABLE_GCC14_WARNINGS is not set +# CONFIG_COMPILER_DUMP_RTL_FILES is not set +CONFIG_COMPILER_RT_LIB_GCCLIB=y +CONFIG_COMPILER_RT_LIB_NAME="gcc" +CONFIG_COMPILER_ORPHAN_SECTIONS_WARNING=y +# CONFIG_COMPILER_ORPHAN_SECTIONS_PLACE is not set +# CONFIG_COMPILER_STATIC_ANALYZER is not set +# end of Compiler options + +# +# Component config +# + +# +# Application Level Tracing +# +# CONFIG_APPTRACE_DEST_JTAG is not set +CONFIG_APPTRACE_DEST_NONE=y +# CONFIG_APPTRACE_DEST_UART1 is not set +# CONFIG_APPTRACE_DEST_UART2 is not set +CONFIG_APPTRACE_DEST_UART_NONE=y +CONFIG_APPTRACE_UART_TASK_PRIO=1 +CONFIG_APPTRACE_LOCK_ENABLE=y +# end of Application Level Tracing + +# +# Bluetooth +# +# CONFIG_BT_ENABLED is not set + +# +# Common Options +# +# CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED is not set +# CONFIG_BT_BLE_LOG_UHCI_OUT_ENABLED is not set +# end of Common Options +# end of Bluetooth + +# +# Console Library +# +# CONFIG_CONSOLE_SORTED_HELP is not set +# end of Console Library + +# +# Driver Configurations +# + +# +# Legacy TWAI Driver Configurations +# +# CONFIG_TWAI_SKIP_LEGACY_CONFLICT_CHECK is not set +# CONFIG_TWAI_ERRATA_FIX_BUS_OFF_REC is not set +# CONFIG_TWAI_ERRATA_FIX_TX_INTR_LOST is not set +# CONFIG_TWAI_ERRATA_FIX_RX_FRAME_INVALID is not set +# CONFIG_TWAI_ERRATA_FIX_RX_FIFO_CORRUPT is not set +# CONFIG_TWAI_ERRATA_FIX_LISTEN_ONLY_DOM is not set +# end of Legacy TWAI Driver Configurations + +# +# Legacy ADC Driver Configuration +# +CONFIG_ADC_DISABLE_DAC=y +# CONFIG_ADC_SUPPRESS_DEPRECATE_WARN is not set +# CONFIG_ADC_SKIP_LEGACY_CONFLICT_CHECK is not set + +# +# Legacy ADC Calibration Configuration +# +CONFIG_ADC_CAL_EFUSE_TP_ENABLE=y +CONFIG_ADC_CAL_EFUSE_VREF_ENABLE=y +CONFIG_ADC_CAL_LUT_ENABLE=y +# CONFIG_ADC_CALI_SUPPRESS_DEPRECATE_WARN is not set +# end of Legacy ADC Calibration Configuration +# end of Legacy ADC Driver Configuration + +# +# Legacy DAC Driver Configurations +# +# CONFIG_DAC_SUPPRESS_DEPRECATE_WARN is not set +# CONFIG_DAC_SKIP_LEGACY_CONFLICT_CHECK is not set +# end of Legacy DAC Driver Configurations + +# +# Legacy MCPWM Driver Configurations +# +# CONFIG_MCPWM_SUPPRESS_DEPRECATE_WARN is not set +# CONFIG_MCPWM_SKIP_LEGACY_CONFLICT_CHECK is not set +# end of Legacy MCPWM Driver Configurations + +# +# Legacy Timer Group Driver Configurations +# +# CONFIG_GPTIMER_SUPPRESS_DEPRECATE_WARN is not set +# CONFIG_GPTIMER_SKIP_LEGACY_CONFLICT_CHECK is not set +# end of Legacy Timer Group Driver Configurations + +# +# Legacy RMT Driver Configurations +# +# CONFIG_RMT_SUPPRESS_DEPRECATE_WARN is not set +# CONFIG_RMT_SKIP_LEGACY_CONFLICT_CHECK is not set +# end of Legacy RMT Driver Configurations + +# +# Legacy I2S Driver Configurations +# +# CONFIG_I2S_SUPPRESS_DEPRECATE_WARN is not set +# CONFIG_I2S_SKIP_LEGACY_CONFLICT_CHECK is not set +# end of Legacy I2S Driver Configurations + +# +# Legacy I2C Driver Configurations +# +# CONFIG_I2C_SKIP_LEGACY_CONFLICT_CHECK is not set +# end of Legacy I2C Driver Configurations + +# +# Legacy PCNT Driver Configurations +# +# CONFIG_PCNT_SUPPRESS_DEPRECATE_WARN is not set +# CONFIG_PCNT_SKIP_LEGACY_CONFLICT_CHECK is not set +# end of Legacy PCNT Driver Configurations + +# +# Legacy SDM Driver Configurations +# +# CONFIG_SDM_SUPPRESS_DEPRECATE_WARN is not set +# CONFIG_SDM_SKIP_LEGACY_CONFLICT_CHECK is not set +# end of Legacy SDM Driver Configurations + +# +# Legacy Touch Sensor Driver Configurations +# +# CONFIG_TOUCH_SUPPRESS_DEPRECATE_WARN is not set +# CONFIG_TOUCH_SKIP_LEGACY_CONFLICT_CHECK is not set +# end of Legacy Touch Sensor Driver Configurations +# end of Driver Configurations + +# +# eFuse Bit Manager +# +# CONFIG_EFUSE_CUSTOM_TABLE is not set +# CONFIG_EFUSE_VIRTUAL is not set +# CONFIG_EFUSE_CODE_SCHEME_COMPAT_NONE is not set +CONFIG_EFUSE_CODE_SCHEME_COMPAT_3_4=y +# CONFIG_EFUSE_CODE_SCHEME_COMPAT_REPEAT is not set +CONFIG_EFUSE_MAX_BLK_LEN=192 +# end of eFuse Bit Manager + +# +# ESP-TLS +# +CONFIG_ESP_TLS_USING_MBEDTLS=y +# CONFIG_ESP_TLS_USE_SECURE_ELEMENT is not set +# CONFIG_ESP_TLS_CLIENT_SESSION_TICKETS is not set +# CONFIG_ESP_TLS_SERVER_SESSION_TICKETS is not set +# CONFIG_ESP_TLS_SERVER_CERT_SELECT_HOOK is not set +# CONFIG_ESP_TLS_SERVER_MIN_AUTH_MODE_OPTIONAL is not set +# CONFIG_ESP_TLS_PSK_VERIFICATION is not set +# CONFIG_ESP_TLS_INSECURE is not set +CONFIG_ESP_TLS_DYN_BUF_STRATEGY_SUPPORTED=y +# end of ESP-TLS + +# +# ADC and ADC Calibration +# +# CONFIG_ADC_ONESHOT_CTRL_FUNC_IN_IRAM is not set +# CONFIG_ADC_CONTINUOUS_ISR_IRAM_SAFE is not set + +# +# ADC Calibration Configurations +# +CONFIG_ADC_CALI_EFUSE_TP_ENABLE=y +CONFIG_ADC_CALI_EFUSE_VREF_ENABLE=y +CONFIG_ADC_CALI_LUT_ENABLE=y +# end of ADC Calibration Configurations + +CONFIG_ADC_DISABLE_DAC_OUTPUT=y +# CONFIG_ADC_ENABLE_DEBUG_LOG is not set +# end of ADC and ADC Calibration + +# +# Wireless Coexistence +# +CONFIG_ESP_COEX_ENABLED=y +# CONFIG_ESP_COEX_GPIO_DEBUG is not set +# end of Wireless Coexistence + +# +# Common ESP-related +# +CONFIG_ESP_ERR_TO_NAME_LOOKUP=y +# end of Common ESP-related + +# +# ESP-Driver:DAC Configurations +# +# CONFIG_DAC_CTRL_FUNC_IN_IRAM is not set +# CONFIG_DAC_ISR_IRAM_SAFE is not set +# CONFIG_DAC_ENABLE_DEBUG_LOG is not set +CONFIG_DAC_DMA_AUTO_16BIT_ALIGN=y +# end of ESP-Driver:DAC Configurations + +# +# ESP-Driver:GPIO Configurations +# +# CONFIG_GPIO_ESP32_SUPPORT_SWITCH_SLP_PULL is not set +# CONFIG_GPIO_CTRL_FUNC_IN_IRAM is not set +# end of ESP-Driver:GPIO Configurations + +# +# ESP-Driver:GPTimer Configurations +# +CONFIG_GPTIMER_ISR_HANDLER_IN_IRAM=y +# CONFIG_GPTIMER_CTRL_FUNC_IN_IRAM is not set +# CONFIG_GPTIMER_ISR_CACHE_SAFE is not set +CONFIG_GPTIMER_OBJ_CACHE_SAFE=y +# CONFIG_GPTIMER_ENABLE_DEBUG_LOG is not set +# end of ESP-Driver:GPTimer Configurations + +# +# ESP-Driver:I2C Configurations +# +# CONFIG_I2C_ISR_IRAM_SAFE is not set +# CONFIG_I2C_ENABLE_DEBUG_LOG is not set +# CONFIG_I2C_ENABLE_SLAVE_DRIVER_VERSION_2 is not set +CONFIG_I2C_MASTER_ISR_HANDLER_IN_IRAM=y +# end of ESP-Driver:I2C Configurations + +# +# ESP-Driver:I2S Configurations +# +# CONFIG_I2S_ISR_IRAM_SAFE is not set +# CONFIG_I2S_ENABLE_DEBUG_LOG is not set +# end of ESP-Driver:I2S Configurations + +# +# ESP-Driver:LEDC Configurations +# +# CONFIG_LEDC_CTRL_FUNC_IN_IRAM is not set +# end of ESP-Driver:LEDC Configurations + +# +# ESP-Driver:MCPWM Configurations +# +CONFIG_MCPWM_ISR_HANDLER_IN_IRAM=y +# CONFIG_MCPWM_ISR_CACHE_SAFE is not set +# CONFIG_MCPWM_CTRL_FUNC_IN_IRAM is not set +CONFIG_MCPWM_OBJ_CACHE_SAFE=y +# CONFIG_MCPWM_ENABLE_DEBUG_LOG is not set +# end of ESP-Driver:MCPWM Configurations + +# +# ESP-Driver:PCNT Configurations +# +# CONFIG_PCNT_CTRL_FUNC_IN_IRAM is not set +# CONFIG_PCNT_ISR_IRAM_SAFE is not set +# CONFIG_PCNT_ENABLE_DEBUG_LOG is not set +# end of ESP-Driver:PCNT Configurations + +# +# ESP-Driver:RMT Configurations +# +CONFIG_RMT_ENCODER_FUNC_IN_IRAM=y +CONFIG_RMT_TX_ISR_HANDLER_IN_IRAM=y +CONFIG_RMT_RX_ISR_HANDLER_IN_IRAM=y +# CONFIG_RMT_RECV_FUNC_IN_IRAM is not set +# CONFIG_RMT_TX_ISR_CACHE_SAFE is not set +# CONFIG_RMT_RX_ISR_CACHE_SAFE is not set +CONFIG_RMT_OBJ_CACHE_SAFE=y +# CONFIG_RMT_ENABLE_DEBUG_LOG is not set +# CONFIG_RMT_ISR_IRAM_SAFE is not set +# end of ESP-Driver:RMT Configurations + +# +# ESP-Driver:Sigma Delta Modulator Configurations +# +# CONFIG_SDM_CTRL_FUNC_IN_IRAM is not set +# CONFIG_SDM_ENABLE_DEBUG_LOG is not set +# end of ESP-Driver:Sigma Delta Modulator Configurations + +# +# ESP-Driver:SPI Configurations +# +CONFIG_SPI_MASTER_ISR_IN_IRAM=y +# CONFIG_SPI_SLAVE_IN_IRAM is not set +# CONFIG_SPI_SLAVE_ISR_IN_IRAM is not set +# end of ESP-Driver:SPI Configurations + +# +# ESP-Driver:Touch Sensor Configurations +# +# CONFIG_TOUCH_CTRL_FUNC_IN_IRAM is not set +# CONFIG_TOUCH_ISR_IRAM_SAFE is not set +# CONFIG_TOUCH_ENABLE_DEBUG_LOG is not set +# CONFIG_TOUCH_SKIP_FSM_CHECK is not set +# end of ESP-Driver:Touch Sensor Configurations + +# +# ESP-Driver:TWAI Configurations +# +# CONFIG_TWAI_ISR_IN_IRAM is not set +# CONFIG_TWAI_ISR_CACHE_SAFE is not set +# CONFIG_TWAI_ENABLE_DEBUG_LOG is not set +# end of ESP-Driver:TWAI Configurations + +# +# ESP-Driver:UART Configurations +# +# CONFIG_UART_ISR_IN_IRAM is not set +# end of ESP-Driver:UART Configurations + +# +# ESP-Driver:UHCI Configurations +# +# CONFIG_UHCI_ISR_HANDLER_IN_IRAM is not set +# CONFIG_UHCI_ISR_CACHE_SAFE is not set +# CONFIG_UHCI_ENABLE_DEBUG_LOG is not set +# end of ESP-Driver:UHCI Configurations + +# +# Ethernet +# +CONFIG_ETH_ENABLED=y +CONFIG_ETH_USE_ESP32_EMAC=y +CONFIG_ETH_PHY_INTERFACE_RMII=y +CONFIG_ETH_RMII_CLK_INPUT=y +# CONFIG_ETH_RMII_CLK_OUTPUT is not set +CONFIG_ETH_RMII_CLK_IN_GPIO=0 +CONFIG_ETH_DMA_BUFFER_SIZE=1024 +CONFIG_ETH_DMA_RX_BUFFER_NUM=30 +CONFIG_ETH_DMA_TX_BUFFER_NUM=5 +# CONFIG_ETH_SOFT_FLOW_CONTROL is not set +# CONFIG_ETH_IRAM_OPTIMIZATION is not set +# CONFIG_ETH_USE_SPI_ETHERNET is not set +# CONFIG_ETH_USE_OPENETH is not set +# CONFIG_ETH_TRANSMIT_MUTEX is not set +# end of Ethernet + +# +# Event Loop Library +# +# CONFIG_ESP_EVENT_LOOP_PROFILING is not set +CONFIG_ESP_EVENT_POST_FROM_ISR=y +# CONFIG_ESP_EVENT_POST_FROM_IRAM_ISR is not set +# end of Event Loop Library + +# +# GDB Stub +# +CONFIG_ESP_GDBSTUB_ENABLED=y +# CONFIG_ESP_SYSTEM_GDBSTUB_RUNTIME is not set +CONFIG_ESP_GDBSTUB_SUPPORT_TASKS=y +CONFIG_ESP_GDBSTUB_MAX_TASKS=32 +# end of GDB Stub + +# +# ESP HID +# +CONFIG_ESPHID_TASK_SIZE_BT=2048 +CONFIG_ESPHID_TASK_SIZE_BLE=4096 +# end of ESP HID + +# +# ESP HTTP client +# +CONFIG_ESP_HTTP_CLIENT_ENABLE_HTTPS=y +# CONFIG_ESP_HTTP_CLIENT_ENABLE_BASIC_AUTH is not set +# CONFIG_ESP_HTTP_CLIENT_ENABLE_DIGEST_AUTH is not set +# CONFIG_ESP_HTTP_CLIENT_ENABLE_CUSTOM_TRANSPORT is not set +CONFIG_ESP_HTTP_CLIENT_EVENT_POST_TIMEOUT=2000 +# end of ESP HTTP client + +# +# HTTP Server +# +CONFIG_HTTPD_MAX_REQ_HDR_LEN=1024 +CONFIG_HTTPD_MAX_URI_LEN=512 +CONFIG_HTTPD_ERR_RESP_NO_DELAY=y +CONFIG_HTTPD_PURGE_BUF_LEN=32 +# CONFIG_HTTPD_LOG_PURGE_DATA is not set +# CONFIG_HTTPD_WS_SUPPORT is not set +# CONFIG_HTTPD_QUEUE_WORK_BLOCKING is not set +CONFIG_HTTPD_SERVER_EVENT_POST_TIMEOUT=2000 +# end of HTTP Server + +# +# ESP HTTPS OTA +# +# CONFIG_ESP_HTTPS_OTA_DECRYPT_CB is not set +# CONFIG_ESP_HTTPS_OTA_ALLOW_HTTP is not set +CONFIG_ESP_HTTPS_OTA_EVENT_POST_TIMEOUT=2000 +# end of ESP HTTPS OTA + +# +# ESP HTTPS server +# +# CONFIG_ESP_HTTPS_SERVER_ENABLE is not set +CONFIG_ESP_HTTPS_SERVER_EVENT_POST_TIMEOUT=2000 +# CONFIG_ESP_HTTPS_SERVER_CERT_SELECT_HOOK is not set +# end of ESP HTTPS server + +# +# Hardware Settings +# + +# +# Chip revision +# +CONFIG_ESP32_REV_MIN_0=y +# CONFIG_ESP32_REV_MIN_1 is not set +# CONFIG_ESP32_REV_MIN_1_1 is not set +# CONFIG_ESP32_REV_MIN_2 is not set +# CONFIG_ESP32_REV_MIN_3 is not set +# CONFIG_ESP32_REV_MIN_3_1 is not set +CONFIG_ESP32_REV_MIN=0 +CONFIG_ESP32_REV_MIN_FULL=0 +CONFIG_ESP_REV_MIN_FULL=0 + +# +# Maximum Supported ESP32 Revision (Rev v3.99) +# +CONFIG_ESP32_REV_MAX_FULL=399 +CONFIG_ESP_REV_MAX_FULL=399 +CONFIG_ESP_EFUSE_BLOCK_REV_MIN_FULL=0 +CONFIG_ESP_EFUSE_BLOCK_REV_MAX_FULL=99 + +# +# Maximum Supported ESP32 eFuse Block Revision (eFuse Block Rev v0.99) +# +# end of Chip revision + +# +# MAC Config +# +CONFIG_ESP_MAC_ADDR_UNIVERSE_WIFI_STA=y +CONFIG_ESP_MAC_ADDR_UNIVERSE_WIFI_AP=y +CONFIG_ESP_MAC_ADDR_UNIVERSE_BT=y +CONFIG_ESP_MAC_ADDR_UNIVERSE_ETH=y +CONFIG_ESP_MAC_UNIVERSAL_MAC_ADDRESSES_FOUR=y +CONFIG_ESP_MAC_UNIVERSAL_MAC_ADDRESSES=4 +# CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES_TWO is not set +CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES_FOUR=y +CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES=4 +# CONFIG_ESP_MAC_IGNORE_MAC_CRC_ERROR is not set +# CONFIG_ESP_MAC_USE_CUSTOM_MAC_AS_BASE_MAC is not set +# end of MAC Config + +# +# Sleep Config +# +CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND=y +CONFIG_ESP_SLEEP_PSRAM_LEAKAGE_WORKAROUND=y +# CONFIG_ESP_SLEEP_MSPI_NEED_ALL_IO_PU is not set +CONFIG_ESP_SLEEP_RTC_BUS_ISO_WORKAROUND=y +# CONFIG_ESP_SLEEP_GPIO_RESET_WORKAROUND is not set +CONFIG_ESP_SLEEP_WAIT_FLASH_READY_EXTRA_DELAY=2000 +# CONFIG_ESP_SLEEP_CACHE_SAFE_ASSERTION is not set +# CONFIG_ESP_SLEEP_DEBUG is not set +CONFIG_ESP_SLEEP_GPIO_ENABLE_INTERNAL_RESISTORS=y +# end of Sleep Config + +# +# RTC Clock Config +# +CONFIG_RTC_CLK_SRC_INT_RC=y +# CONFIG_RTC_CLK_SRC_EXT_CRYS is not set +# CONFIG_RTC_CLK_SRC_EXT_OSC is not set +# CONFIG_RTC_CLK_SRC_INT_8MD256 is not set +CONFIG_RTC_CLK_CAL_CYCLES=1024 +# end of RTC Clock Config + +# +# Peripheral Control +# +CONFIG_ESP_PERIPH_CTRL_FUNC_IN_IRAM=y +CONFIG_ESP_REGI2C_CTRL_FUNC_IN_IRAM=y +# end of Peripheral Control + +# +# Main XTAL Config +# +# CONFIG_XTAL_FREQ_26 is not set +# CONFIG_XTAL_FREQ_32 is not set +CONFIG_XTAL_FREQ_40=y +# CONFIG_XTAL_FREQ_AUTO is not set +CONFIG_XTAL_FREQ=40 +# end of Main XTAL Config + +# +# Power Supplier +# + +# +# Brownout Detector +# +CONFIG_ESP_BROWNOUT_DET=y +# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_0 is not set +# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_1 is not set +# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_2 is not set +# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_3 is not set +CONFIG_ESP_BROWNOUT_DET_LVL_SEL_4=y +# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_5 is not set +# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_6 is not set +# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_7 is not set +CONFIG_ESP_BROWNOUT_DET_LVL=4 +CONFIG_ESP_BROWNOUT_USE_INTR=y +# end of Brownout Detector +# end of Power Supplier + +CONFIG_ESP_SPI_BUS_LOCK_ISR_FUNCS_IN_IRAM=y +CONFIG_ESP_INTR_IN_IRAM=y +# end of Hardware Settings + +# +# ESP-Driver:LCD Controller Configurations +# +# CONFIG_LCD_ENABLE_DEBUG_LOG is not set +# end of ESP-Driver:LCD Controller Configurations + +# +# ESP-MM: Memory Management Configurations +# +# end of ESP-MM: Memory Management Configurations + +# +# ESP NETIF Adapter +# +CONFIG_ESP_NETIF_IP_LOST_TIMER_INTERVAL=120 +# CONFIG_ESP_NETIF_PROVIDE_CUSTOM_IMPLEMENTATION is not set +CONFIG_ESP_NETIF_TCPIP_LWIP=y +# CONFIG_ESP_NETIF_LOOPBACK is not set +CONFIG_ESP_NETIF_USES_TCPIP_WITH_BSD_API=y +CONFIG_ESP_NETIF_REPORT_DATA_TRAFFIC=y +# CONFIG_ESP_NETIF_RECEIVE_REPORT_ERRORS is not set +# CONFIG_ESP_NETIF_L2_TAP is not set +# CONFIG_ESP_NETIF_BRIDGE_EN is not set +# CONFIG_ESP_NETIF_SET_DNS_PER_DEFAULT_NETIF is not set +# end of ESP NETIF Adapter + +# +# Partition API Configuration +# +# end of Partition API Configuration + +# +# PHY +# +CONFIG_ESP_PHY_ENABLED=y +CONFIG_ESP_PHY_CALIBRATION_AND_DATA_STORAGE=y +# CONFIG_ESP_PHY_INIT_DATA_IN_PARTITION is not set +CONFIG_ESP_PHY_MAX_WIFI_TX_POWER=20 +CONFIG_ESP_PHY_MAX_TX_POWER=20 +CONFIG_ESP_PHY_REDUCE_TX_POWER=y +# CONFIG_ESP_PHY_ENABLE_CERT_TEST is not set +CONFIG_ESP_PHY_RF_CAL_PARTIAL=y +# CONFIG_ESP_PHY_RF_CAL_NONE is not set +# CONFIG_ESP_PHY_RF_CAL_FULL is not set +CONFIG_ESP_PHY_CALIBRATION_MODE=0 +CONFIG_ESP_PHY_PLL_TRACK_PERIOD_MS=1000 +# CONFIG_ESP_PHY_PLL_TRACK_DEBUG is not set +# CONFIG_ESP_PHY_RECORD_USED_TIME is not set +CONFIG_ESP_PHY_IRAM_OPT=y +# CONFIG_ESP_PHY_DEBUG is not set +# end of PHY + +# +# Power Management +# +CONFIG_PM_SLEEP_FUNC_IN_IRAM=y +# CONFIG_PM_ENABLE is not set +CONFIG_PM_SLP_IRAM_OPT=y +# end of Power Management + +# +# ESP PSRAM +# +CONFIG_SPIRAM=y + +# +# SPI RAM config +# +CONFIG_SPIRAM_MODE_QUAD=y +CONFIG_SPIRAM_TYPE_AUTO=y +# CONFIG_SPIRAM_TYPE_ESPPSRAM16 is not set +# CONFIG_SPIRAM_TYPE_ESPPSRAM32 is not set +# CONFIG_SPIRAM_TYPE_ESPPSRAM64 is not set +# CONFIG_SPIRAM_SPEED_40M is not set +CONFIG_SPIRAM_SPEED_80M=y +CONFIG_SPIRAM_SPEED=80 +CONFIG_SPIRAM_BOOT_HW_INIT=y +CONFIG_SPIRAM_BOOT_INIT=y +CONFIG_SPIRAM_PRE_CONFIGURE_MEMORY_PROTECTION=y +# CONFIG_SPIRAM_IGNORE_NOTFOUND is not set +# CONFIG_SPIRAM_USE_MEMMAP is not set +# CONFIG_SPIRAM_USE_CAPS_ALLOC is not set +CONFIG_SPIRAM_USE_MALLOC=y +CONFIG_SPIRAM_MEMTEST=y +CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=16384 +# CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP is not set +CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=32768 +# CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set +# CONFIG_SPIRAM_ALLOW_NOINIT_SEG_EXTERNAL_MEMORY is not set +CONFIG_SPIRAM_CACHE_WORKAROUND=y + +# +# SPIRAM cache workaround debugging +# +CONFIG_SPIRAM_CACHE_WORKAROUND_STRATEGY_MEMW=y +# CONFIG_SPIRAM_CACHE_WORKAROUND_STRATEGY_DUPLDST is not set +# CONFIG_SPIRAM_CACHE_WORKAROUND_STRATEGY_NOPS is not set +# end of SPIRAM cache workaround debugging + +# +# SPIRAM workaround libraries placement +# +CONFIG_SPIRAM_CACHE_LIBJMP_IN_IRAM=y +CONFIG_SPIRAM_CACHE_LIBMATH_IN_IRAM=y +CONFIG_SPIRAM_CACHE_LIBNUMPARSER_IN_IRAM=y +CONFIG_SPIRAM_CACHE_LIBIO_IN_IRAM=y +CONFIG_SPIRAM_CACHE_LIBTIME_IN_IRAM=y +CONFIG_SPIRAM_CACHE_LIBCHAR_IN_IRAM=y +CONFIG_SPIRAM_CACHE_LIBMEM_IN_IRAM=y +CONFIG_SPIRAM_CACHE_LIBSTR_IN_IRAM=y +CONFIG_SPIRAM_CACHE_LIBRAND_IN_IRAM=y +CONFIG_SPIRAM_CACHE_LIBENV_IN_IRAM=y +CONFIG_SPIRAM_CACHE_LIBFILE_IN_IRAM=y +CONFIG_SPIRAM_CACHE_LIBMISC_IN_IRAM=y +# end of SPIRAM workaround libraries placement + +CONFIG_SPIRAM_BANKSWITCH_ENABLE=y +CONFIG_SPIRAM_BANKSWITCH_RESERVE=8 +# CONFIG_SPIRAM_OCCUPY_HSPI_HOST is not set +CONFIG_SPIRAM_OCCUPY_VSPI_HOST=y +# CONFIG_SPIRAM_OCCUPY_NO_HOST is not set + +# +# PSRAM clock and cs IO for ESP32-DOWD +# +CONFIG_D0WD_PSRAM_CLK_IO=17 +CONFIG_D0WD_PSRAM_CS_IO=16 +# end of PSRAM clock and cs IO for ESP32-DOWD + +# +# PSRAM clock and cs IO for ESP32-D2WD +# +CONFIG_D2WD_PSRAM_CLK_IO=9 +CONFIG_D2WD_PSRAM_CS_IO=10 +# end of PSRAM clock and cs IO for ESP32-D2WD + +# +# PSRAM clock and cs IO for ESP32-PICO-D4 +# +CONFIG_PICO_PSRAM_CS_IO=10 +# end of PSRAM clock and cs IO for ESP32-PICO-D4 + +# CONFIG_SPIRAM_2T_MODE is not set +# end of SPI RAM config +# end of ESP PSRAM + +# +# ESP Ringbuf +# +# CONFIG_RINGBUF_PLACE_FUNCTIONS_INTO_FLASH is not set +# end of ESP Ringbuf + +# +# ESP-ROM +# +CONFIG_ESP_ROM_PRINT_IN_IRAM=y +# end of ESP-ROM + +# +# ESP Security Specific +# +# end of ESP Security Specific + +# +# ESP System Settings +# +# CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_80 is not set +# CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_160 is not set +CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y +CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ=240 + +# +# Memory +# +# CONFIG_ESP32_USE_FIXED_STATIC_RAM_SIZE is not set + +# +# Non-backward compatible options +# +# CONFIG_ESP_SYSTEM_ESP32_SRAM1_REGION_AS_IRAM is not set +# end of Non-backward compatible options +# end of Memory + +# +# Trace memory +# +# CONFIG_ESP32_TRAX is not set +CONFIG_ESP32_TRACEMEM_RESERVE_DRAM=0x0 +# end of Trace memory + +CONFIG_ESP_SYSTEM_IN_IRAM=y +# CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT is not set +CONFIG_ESP_SYSTEM_PANIC_PRINT_REBOOT=y +# CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT is not set +# CONFIG_ESP_SYSTEM_PANIC_GDBSTUB is not set +CONFIG_ESP_SYSTEM_PANIC_REBOOT_DELAY_SECONDS=0 + +# +# Memory protection +# +# end of Memory protection + +CONFIG_ESP_SYSTEM_EVENT_QUEUE_SIZE=32 +CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=2304 +CONFIG_ESP_MAIN_TASK_STACK_SIZE=3072 +CONFIG_ESP_MAIN_TASK_AFFINITY_CPU0=y +# CONFIG_ESP_MAIN_TASK_AFFINITY_CPU1 is not set +# CONFIG_ESP_MAIN_TASK_AFFINITY_NO_AFFINITY is not set +CONFIG_ESP_MAIN_TASK_AFFINITY=0x0 +CONFIG_ESP_MINIMAL_SHARED_STACK_SIZE=2048 +CONFIG_ESP_CONSOLE_UART_DEFAULT=y +# CONFIG_ESP_CONSOLE_UART_CUSTOM is not set +# CONFIG_ESP_CONSOLE_NONE is not set +CONFIG_ESP_CONSOLE_UART=y +CONFIG_ESP_CONSOLE_UART_NUM=0 +CONFIG_ESP_CONSOLE_ROM_SERIAL_PORT_NUM=0 +CONFIG_ESP_CONSOLE_UART_BAUDRATE=115200 +CONFIG_ESP_INT_WDT=y +CONFIG_ESP_INT_WDT_TIMEOUT_MS=300 +CONFIG_ESP_INT_WDT_CHECK_CPU1=y +CONFIG_ESP_TASK_WDT_EN=y +CONFIG_ESP_TASK_WDT_INIT=y +# CONFIG_ESP_TASK_WDT_PANIC is not set +CONFIG_ESP_TASK_WDT_TIMEOUT_S=5 +CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0=y +CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU1=y +# CONFIG_ESP_PANIC_HANDLER_IRAM is not set +# CONFIG_ESP_DEBUG_STUBS_ENABLE is not set +CONFIG_ESP_DEBUG_OCDAWARE=y +# CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_5 is not set +CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_4=y +# CONFIG_ESP32_DISABLE_BASIC_ROM_CONSOLE is not set +CONFIG_ESP32_ECO3_CACHE_LOCK_FIX=y +# end of ESP System Settings + +# +# IPC (Inter-Processor Call) +# +CONFIG_ESP_IPC_ENABLE=y +CONFIG_ESP_IPC_TASK_STACK_SIZE=1024 +CONFIG_ESP_IPC_USES_CALLERS_PRIORITY=y +CONFIG_ESP_IPC_ISR_ENABLE=y +# end of IPC (Inter-Processor Call) + +# +# ESP Timer (High Resolution Timer) +# +CONFIG_ESP_TIMER_IN_IRAM=y +# CONFIG_ESP_TIMER_PROFILING is not set +CONFIG_ESP_TIME_FUNCS_USE_RTC_TIMER=y +CONFIG_ESP_TIME_FUNCS_USE_ESP_TIMER=y +CONFIG_ESP_TIMER_TASK_STACK_SIZE=2048 +CONFIG_ESP_TIMER_INTERRUPT_LEVEL=1 +# CONFIG_ESP_TIMER_SHOW_EXPERIMENTAL is not set +CONFIG_ESP_TIMER_TASK_AFFINITY=0x0 +CONFIG_ESP_TIMER_TASK_AFFINITY_CPU0=y +CONFIG_ESP_TIMER_ISR_AFFINITY_CPU0=y +# CONFIG_ESP_TIMER_SUPPORTS_ISR_DISPATCH_METHOD is not set +CONFIG_ESP_TIMER_IMPL_TG0_LAC=y +# end of ESP Timer (High Resolution Timer) + +# +# Wi-Fi +# +CONFIG_ESP_WIFI_ENABLED=y +CONFIG_ESP_WIFI_STATIC_RX_BUFFER_NUM=8 +CONFIG_ESP_WIFI_DYNAMIC_RX_BUFFER_NUM=64 +CONFIG_ESP_WIFI_STATIC_TX_BUFFER=y +# CONFIG_ESP_WIFI_DYNAMIC_TX_BUFFER is not set +CONFIG_ESP_WIFI_TX_BUFFER_TYPE=0 +CONFIG_ESP_WIFI_STATIC_TX_BUFFER_NUM=8 +CONFIG_ESP_WIFI_STATIC_RX_MGMT_BUFFER=y +# CONFIG_ESP_WIFI_DYNAMIC_RX_MGMT_BUFFER is not set +CONFIG_ESP_WIFI_DYNAMIC_RX_MGMT_BUF=0 +CONFIG_ESP_WIFI_RX_MGMT_BUF_NUM_DEF=5 +# CONFIG_ESP_WIFI_CSI_ENABLED is not set +CONFIG_ESP_WIFI_AMPDU_TX_ENABLED=y +CONFIG_ESP_WIFI_TX_BA_WIN=8 +CONFIG_ESP_WIFI_AMPDU_RX_ENABLED=y +CONFIG_ESP_WIFI_RX_BA_WIN=16 +CONFIG_ESP_WIFI_NVS_ENABLED=y +CONFIG_ESP_WIFI_TASK_PINNED_TO_CORE_0=y +# CONFIG_ESP_WIFI_TASK_PINNED_TO_CORE_1 is not set +CONFIG_ESP_WIFI_SOFTAP_BEACON_MAX_LEN=752 +CONFIG_ESP_WIFI_MGMT_SBUF_NUM=32 +# CONFIG_ESP_WIFI_IRAM_OPT is not set +# CONFIG_ESP_WIFI_EXTRA_IRAM_OPT is not set +CONFIG_ESP_WIFI_RX_IRAM_OPT=y +CONFIG_ESP_WIFI_ENABLE_WPA3_SAE=y +CONFIG_ESP_WIFI_ENABLE_SAE_PK=y +CONFIG_ESP_WIFI_ENABLE_SAE_H2E=y +CONFIG_ESP_WIFI_SOFTAP_SAE_SUPPORT=y +CONFIG_ESP_WIFI_ENABLE_WPA3_OWE_STA=y +# CONFIG_ESP_WIFI_SLP_IRAM_OPT is not set +CONFIG_ESP_WIFI_SLP_DEFAULT_MIN_ACTIVE_TIME=50 +# CONFIG_ESP_WIFI_BSS_MAX_IDLE_SUPPORT is not set +CONFIG_ESP_WIFI_SLP_DEFAULT_MAX_ACTIVE_TIME=10 +CONFIG_ESP_WIFI_SLP_DEFAULT_WAIT_BROADCAST_DATA_TIME=15 +# CONFIG_ESP_WIFI_STA_DISCONNECTED_PM_ENABLE is not set +# CONFIG_ESP_WIFI_GMAC_SUPPORT is not set +CONFIG_ESP_WIFI_SOFTAP_SUPPORT=y +# CONFIG_ESP_WIFI_SLP_BEACON_LOST_OPT is not set +CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM=7 +# CONFIG_ESP_WIFI_NAN_ENABLE is not set +CONFIG_ESP_WIFI_MBEDTLS_CRYPTO=y +CONFIG_ESP_WIFI_MBEDTLS_TLS_CLIENT=y +# CONFIG_ESP_WIFI_WAPI_PSK is not set +# CONFIG_ESP_WIFI_11KV_SUPPORT is not set +# CONFIG_ESP_WIFI_MBO_SUPPORT is not set +# CONFIG_ESP_WIFI_DPP_SUPPORT is not set +# CONFIG_ESP_WIFI_11R_SUPPORT is not set +# CONFIG_ESP_WIFI_WPS_SOFTAP_REGISTRAR is not set + +# +# WPS Configuration Options +# +# CONFIG_ESP_WIFI_WPS_STRICT is not set +# CONFIG_ESP_WIFI_WPS_PASSPHRASE is not set +# end of WPS Configuration Options + +# CONFIG_ESP_WIFI_DEBUG_PRINT is not set +# CONFIG_ESP_WIFI_TESTING_OPTIONS is not set +CONFIG_ESP_WIFI_ENTERPRISE_SUPPORT=y +# CONFIG_ESP_WIFI_ENT_FREE_DYNAMIC_BUFFER is not set +# end of Wi-Fi + +# +# Core dump +# +# CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH is not set +# CONFIG_ESP_COREDUMP_ENABLE_TO_UART is not set +CONFIG_ESP_COREDUMP_ENABLE_TO_NONE=y +# end of Core dump + +# +# FAT Filesystem support +# +CONFIG_FATFS_VOLUME_COUNT=2 +CONFIG_FATFS_LFN_NONE=y +# CONFIG_FATFS_LFN_HEAP is not set +# CONFIG_FATFS_LFN_STACK is not set +# CONFIG_FATFS_SECTOR_512 is not set +CONFIG_FATFS_SECTOR_4096=y +# CONFIG_FATFS_CODEPAGE_DYNAMIC is not set +CONFIG_FATFS_CODEPAGE_437=y +# CONFIG_FATFS_CODEPAGE_720 is not set +# CONFIG_FATFS_CODEPAGE_737 is not set +# CONFIG_FATFS_CODEPAGE_771 is not set +# CONFIG_FATFS_CODEPAGE_775 is not set +# CONFIG_FATFS_CODEPAGE_850 is not set +# CONFIG_FATFS_CODEPAGE_852 is not set +# CONFIG_FATFS_CODEPAGE_855 is not set +# CONFIG_FATFS_CODEPAGE_857 is not set +# CONFIG_FATFS_CODEPAGE_860 is not set +# CONFIG_FATFS_CODEPAGE_861 is not set +# CONFIG_FATFS_CODEPAGE_862 is not set +# CONFIG_FATFS_CODEPAGE_863 is not set +# CONFIG_FATFS_CODEPAGE_864 is not set +# CONFIG_FATFS_CODEPAGE_865 is not set +# CONFIG_FATFS_CODEPAGE_866 is not set +# CONFIG_FATFS_CODEPAGE_869 is not set +# CONFIG_FATFS_CODEPAGE_932 is not set +# CONFIG_FATFS_CODEPAGE_936 is not set +# CONFIG_FATFS_CODEPAGE_949 is not set +# CONFIG_FATFS_CODEPAGE_950 is not set +CONFIG_FATFS_CODEPAGE=437 +CONFIG_FATFS_FS_LOCK=0 +CONFIG_FATFS_TIMEOUT_MS=10000 +CONFIG_FATFS_PER_FILE_CACHE=y +CONFIG_FATFS_ALLOC_PREFER_EXTRAM=y +# CONFIG_FATFS_USE_FASTSEEK is not set +CONFIG_FATFS_USE_STRFUNC_NONE=y +# CONFIG_FATFS_USE_STRFUNC_WITHOUT_CRLF_CONV is not set +# CONFIG_FATFS_USE_STRFUNC_WITH_CRLF_CONV is not set +CONFIG_FATFS_VFS_FSTAT_BLKSIZE=0 +# CONFIG_FATFS_IMMEDIATE_FSYNC is not set +# CONFIG_FATFS_USE_LABEL is not set +CONFIG_FATFS_LINK_LOCK=y +# CONFIG_FATFS_USE_DYN_BUFFERS is not set + +# +# File system free space calculation behavior +# +CONFIG_FATFS_DONT_TRUST_FREE_CLUSTER_CNT=0 +CONFIG_FATFS_DONT_TRUST_LAST_ALLOC=0 +# end of File system free space calculation behavior +# end of FAT Filesystem support + +# +# FreeRTOS +# + +# +# Kernel +# +# CONFIG_FREERTOS_SMP is not set +# CONFIG_FREERTOS_UNICORE is not set +CONFIG_FREERTOS_HZ=1000 +# CONFIG_FREERTOS_CHECK_STACKOVERFLOW_NONE is not set +# CONFIG_FREERTOS_CHECK_STACKOVERFLOW_PTRVAL is not set +CONFIG_FREERTOS_CHECK_STACKOVERFLOW_CANARY=y +CONFIG_FREERTOS_THREAD_LOCAL_STORAGE_POINTERS=1 +CONFIG_FREERTOS_IDLE_TASK_STACKSIZE=768 +# CONFIG_FREERTOS_USE_IDLE_HOOK is not set +# CONFIG_FREERTOS_USE_TICK_HOOK is not set +CONFIG_FREERTOS_MAX_TASK_NAME_LEN=10 +CONFIG_FREERTOS_ENABLE_BACKWARD_COMPATIBILITY=y +CONFIG_FREERTOS_USE_TIMERS=y +CONFIG_FREERTOS_TIMER_SERVICE_TASK_NAME="Tmr Svc" +# CONFIG_FREERTOS_TIMER_TASK_AFFINITY_CPU0 is not set +# CONFIG_FREERTOS_TIMER_TASK_AFFINITY_CPU1 is not set +CONFIG_FREERTOS_TIMER_TASK_NO_AFFINITY=y +CONFIG_FREERTOS_TIMER_SERVICE_TASK_CORE_AFFINITY=0x7FFFFFFF +CONFIG_FREERTOS_TIMER_TASK_PRIORITY=1 +CONFIG_FREERTOS_TIMER_TASK_STACK_DEPTH=1536 +CONFIG_FREERTOS_TIMER_QUEUE_LENGTH=5 +CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE=0 +CONFIG_FREERTOS_TASK_NOTIFICATION_ARRAY_ENTRIES=1 +# CONFIG_FREERTOS_USE_TRACE_FACILITY is not set +# CONFIG_FREERTOS_USE_LIST_DATA_INTEGRITY_CHECK_BYTES is not set +# CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS is not set +# CONFIG_FREERTOS_USE_APPLICATION_TASK_TAG is not set +# end of Kernel + +# +# Port +# +# CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK is not set +CONFIG_FREERTOS_TLSP_DELETION_CALLBACKS=y +# CONFIG_FREERTOS_TASK_PRE_DELETION_HOOK is not set +# CONFIG_FREERTOS_ENABLE_STATIC_TASK_CLEAN_UP is not set +CONFIG_FREERTOS_CHECK_MUTEX_GIVEN_BY_OWNER=y +CONFIG_FREERTOS_ISR_STACKSIZE=1536 +CONFIG_FREERTOS_INTERRUPT_BACKTRACE=y +# CONFIG_FREERTOS_FPU_IN_ISR is not set +CONFIG_FREERTOS_TICK_SUPPORT_CORETIMER=y +CONFIG_FREERTOS_CORETIMER_0=y +# CONFIG_FREERTOS_CORETIMER_1 is not set +CONFIG_FREERTOS_SYSTICK_USES_CCOUNT=y +CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH=y +# CONFIG_FREERTOS_CHECK_PORT_CRITICAL_COMPLIANCE is not set +# end of Port + +# +# Extra +# +# CONFIG_FREERTOS_TASK_CREATE_ALLOW_EXT_MEM is not set +# end of Extra + +CONFIG_FREERTOS_PORT=y +CONFIG_FREERTOS_NO_AFFINITY=0x7FFFFFFF +CONFIG_FREERTOS_SUPPORT_STATIC_ALLOCATION=y +CONFIG_FREERTOS_DEBUG_OCDAWARE=y +CONFIG_FREERTOS_ENABLE_TASK_SNAPSHOT=y +CONFIG_FREERTOS_PLACE_SNAPSHOT_FUNS_INTO_FLASH=y +CONFIG_FREERTOS_NUMBER_OF_CORES=2 +CONFIG_FREERTOS_IN_IRAM=y +# end of FreeRTOS + +# +# Hardware Abstraction Layer (HAL) and Low Level (LL) +# +CONFIG_HAL_ASSERTION_EQUALS_SYSTEM=y +# CONFIG_HAL_ASSERTION_DISABLE is not set +# CONFIG_HAL_ASSERTION_SILENT is not set +# CONFIG_HAL_ASSERTION_ENABLE is not set +CONFIG_HAL_DEFAULT_ASSERTION_LEVEL=2 +# end of Hardware Abstraction Layer (HAL) and Low Level (LL) + +# +# Heap memory debugging +# +CONFIG_HEAP_POISONING_DISABLED=y +# CONFIG_HEAP_POISONING_LIGHT is not set +# CONFIG_HEAP_POISONING_COMPREHENSIVE is not set +CONFIG_HEAP_TRACING_OFF=y +# CONFIG_HEAP_TRACING_STANDALONE is not set +# CONFIG_HEAP_TRACING_TOHOST is not set +# CONFIG_HEAP_USE_HOOKS is not set +# CONFIG_HEAP_TASK_TRACKING is not set +# CONFIG_HEAP_ABORT_WHEN_ALLOCATION_FAILS is not set +# CONFIG_HEAP_PLACE_FUNCTION_INTO_FLASH is not set +# end of Heap memory debugging + +# +# Log +# +CONFIG_LOG_VERSION_1=y +# CONFIG_LOG_VERSION_2 is not set +CONFIG_LOG_VERSION=1 + +# +# Log Level +# +# CONFIG_LOG_DEFAULT_LEVEL_NONE is not set +# CONFIG_LOG_DEFAULT_LEVEL_ERROR is not set +# CONFIG_LOG_DEFAULT_LEVEL_WARN is not set +# CONFIG_LOG_DEFAULT_LEVEL_INFO is not set +CONFIG_LOG_DEFAULT_LEVEL_DEBUG=y +# CONFIG_LOG_DEFAULT_LEVEL_VERBOSE is not set +CONFIG_LOG_DEFAULT_LEVEL=4 +CONFIG_LOG_MAXIMUM_EQUALS_DEFAULT=y +# CONFIG_LOG_MAXIMUM_LEVEL_VERBOSE is not set +CONFIG_LOG_MAXIMUM_LEVEL=4 + +# +# Level Settings +# +# CONFIG_LOG_MASTER_LEVEL is not set +CONFIG_LOG_DYNAMIC_LEVEL_CONTROL=y +# CONFIG_LOG_TAG_LEVEL_IMPL_NONE is not set +# CONFIG_LOG_TAG_LEVEL_IMPL_LINKED_LIST is not set +CONFIG_LOG_TAG_LEVEL_IMPL_CACHE_AND_LINKED_LIST=y +# CONFIG_LOG_TAG_LEVEL_CACHE_ARRAY is not set +CONFIG_LOG_TAG_LEVEL_CACHE_BINARY_MIN_HEAP=y +CONFIG_LOG_TAG_LEVEL_IMPL_CACHE_SIZE=31 +# end of Level Settings +# end of Log Level + +# +# Format +# +CONFIG_LOG_COLORS=y +CONFIG_LOG_TIMESTAMP_SOURCE_RTOS=y +# CONFIG_LOG_TIMESTAMP_SOURCE_SYSTEM is not set +# end of Format + +# +# Settings +# +CONFIG_LOG_MODE_TEXT_EN=y +CONFIG_LOG_MODE_TEXT=y +# end of Settings + +CONFIG_LOG_IN_IRAM=y +# end of Log + +# +# LWIP +# +CONFIG_LWIP_ENABLE=y +CONFIG_LWIP_LOCAL_HOSTNAME="espressif" +CONFIG_LWIP_TCPIP_TASK_PRIO=18 +# CONFIG_LWIP_TCPIP_CORE_LOCKING is not set +# CONFIG_LWIP_CHECK_THREAD_SAFETY is not set +CONFIG_LWIP_DNS_SUPPORT_MDNS_QUERIES=y +# CONFIG_LWIP_L2_TO_L3_COPY is not set +# CONFIG_LWIP_IRAM_OPTIMIZATION is not set +# CONFIG_LWIP_EXTRA_IRAM_OPTIMIZATION is not set +CONFIG_LWIP_TIMERS_ONDEMAND=y +CONFIG_LWIP_ND6=y +# CONFIG_LWIP_FORCE_ROUTER_FORWARDING is not set +CONFIG_LWIP_MAX_SOCKETS=6 +# CONFIG_LWIP_USE_ONLY_LWIP_SELECT is not set +# CONFIG_LWIP_SO_LINGER is not set +CONFIG_LWIP_SO_REUSE=y +# CONFIG_LWIP_SO_REUSE_RXTOALL is not set +# CONFIG_LWIP_SO_RCVBUF is not set +# CONFIG_LWIP_NETBUF_RECVINFO is not set +CONFIG_LWIP_IP_DEFAULT_TTL=64 +CONFIG_LWIP_IP4_FRAG=y +CONFIG_LWIP_IP6_FRAG=y +# CONFIG_LWIP_IP4_REASSEMBLY is not set +# CONFIG_LWIP_IP6_REASSEMBLY is not set +CONFIG_LWIP_IP_REASS_MAX_PBUFS=10 +# CONFIG_LWIP_IP_FORWARD is not set +# CONFIG_LWIP_STATS is not set +CONFIG_LWIP_ESP_GRATUITOUS_ARP=y +CONFIG_LWIP_GARP_TMR_INTERVAL=60 +CONFIG_LWIP_ESP_MLDV6_REPORT=y +CONFIG_LWIP_MLDV6_TMR_INTERVAL=40 +CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=32 +CONFIG_LWIP_DHCP_DOES_ARP_CHECK=y +# CONFIG_LWIP_DHCP_DOES_ACD_CHECK is not set +# CONFIG_LWIP_DHCP_DOES_NOT_CHECK_OFFERED_IP is not set +# CONFIG_LWIP_DHCP_DISABLE_CLIENT_ID is not set +CONFIG_LWIP_DHCP_DISABLE_VENDOR_CLASS_ID=y +# CONFIG_LWIP_DHCP_RESTORE_LAST_IP is not set +CONFIG_LWIP_DHCP_OPTIONS_LEN=69 +CONFIG_LWIP_NUM_NETIF_CLIENT_DATA=0 +CONFIG_LWIP_DHCP_COARSE_TIMER_SECS=1 + +# +# DHCP server +# +CONFIG_LWIP_DHCPS=y +CONFIG_LWIP_DHCPS_LEASE_UNIT=60 +CONFIG_LWIP_DHCPS_MAX_STATION_NUM=8 +CONFIG_LWIP_DHCPS_STATIC_ENTRIES=y +CONFIG_LWIP_DHCPS_ADD_DNS=y +# end of DHCP server + +# CONFIG_LWIP_AUTOIP is not set +CONFIG_LWIP_IPV4=y +CONFIG_LWIP_IPV6=y +# CONFIG_LWIP_IPV6_AUTOCONFIG is not set +CONFIG_LWIP_IPV6_NUM_ADDRESSES=3 +# CONFIG_LWIP_IPV6_FORWARD is not set +# CONFIG_LWIP_NETIF_STATUS_CALLBACK is not set +CONFIG_LWIP_NETIF_LOOPBACK=y +CONFIG_LWIP_LOOPBACK_MAX_PBUFS=8 + +# +# TCP +# +CONFIG_LWIP_MAX_ACTIVE_TCP=6 +CONFIG_LWIP_MAX_LISTENING_TCP=6 +CONFIG_LWIP_TCP_HIGH_SPEED_RETRANSMISSION=y +CONFIG_LWIP_TCP_MAXRTX=12 +CONFIG_LWIP_TCP_SYNMAXRTX=12 +CONFIG_LWIP_TCP_MSS=1460 +CONFIG_LWIP_TCP_TMR_INTERVAL=250 +CONFIG_LWIP_TCP_MSL=60000 +CONFIG_LWIP_TCP_FIN_WAIT_TIMEOUT=20000 +CONFIG_LWIP_TCP_SND_BUF_DEFAULT=11680 +CONFIG_LWIP_TCP_WND_DEFAULT=11680 +CONFIG_LWIP_TCP_RECVMBOX_SIZE=10 +CONFIG_LWIP_TCP_ACCEPTMBOX_SIZE=6 +CONFIG_LWIP_TCP_QUEUE_OOSEQ=y +CONFIG_LWIP_TCP_OOSEQ_TIMEOUT=6 +CONFIG_LWIP_TCP_OOSEQ_MAX_PBUFS=4 +CONFIG_LWIP_TCP_SACK_OUT=y +CONFIG_LWIP_TCP_OVERSIZE_MSS=y +# CONFIG_LWIP_TCP_OVERSIZE_QUARTER_MSS is not set +# CONFIG_LWIP_TCP_OVERSIZE_DISABLE is not set +CONFIG_LWIP_TCP_RTO_TIME=1500 +# end of TCP + +# +# UDP +# +CONFIG_LWIP_MAX_UDP_PCBS=1 +CONFIG_LWIP_UDP_RECVMBOX_SIZE=6 +# end of UDP + +# +# Checksums +# +# CONFIG_LWIP_CHECKSUM_CHECK_IP is not set +# CONFIG_LWIP_CHECKSUM_CHECK_UDP is not set +CONFIG_LWIP_CHECKSUM_CHECK_ICMP=y +# end of Checksums + +CONFIG_LWIP_TCPIP_TASK_STACK_SIZE=3072 +# CONFIG_LWIP_TCPIP_TASK_AFFINITY_NO_AFFINITY is not set +CONFIG_LWIP_TCPIP_TASK_AFFINITY_CPU0=y +# CONFIG_LWIP_TCPIP_TASK_AFFINITY_CPU1 is not set +CONFIG_LWIP_TCPIP_TASK_AFFINITY=0x0 +CONFIG_LWIP_IPV6_MEMP_NUM_ND6_QUEUE=3 +CONFIG_LWIP_IPV6_ND6_NUM_NEIGHBORS=5 +CONFIG_LWIP_IPV6_ND6_NUM_PREFIXES=5 +CONFIG_LWIP_IPV6_ND6_NUM_ROUTERS=3 +CONFIG_LWIP_IPV6_ND6_NUM_DESTINATIONS=10 +# CONFIG_LWIP_PPP_SUPPORT is not set +# CONFIG_LWIP_SLIP_SUPPORT is not set + +# +# ICMP +# +CONFIG_LWIP_ICMP=y +# CONFIG_LWIP_MULTICAST_PING is not set +# CONFIG_LWIP_BROADCAST_PING is not set +# end of ICMP + +# +# LWIP RAW API +# +CONFIG_LWIP_MAX_RAW_PCBS=16 +# end of LWIP RAW API + +# +# SNTP +# +CONFIG_LWIP_SNTP_MAX_SERVERS=1 +# CONFIG_LWIP_DHCP_GET_NTP_SRV is not set +CONFIG_LWIP_SNTP_UPDATE_DELAY=3600000 +CONFIG_LWIP_SNTP_STARTUP_DELAY=y +CONFIG_LWIP_SNTP_MAXIMUM_STARTUP_DELAY=5000 +# end of SNTP + +# +# DNS +# +CONFIG_LWIP_DNS_MAX_HOST_IP=1 +CONFIG_LWIP_DNS_MAX_SERVERS=3 +# CONFIG_LWIP_FALLBACK_DNS_SERVER_SUPPORT is not set +# CONFIG_LWIP_DNS_SETSERVER_WITH_NETIF is not set +# CONFIG_LWIP_USE_ESP_GETADDRINFO is not set +# end of DNS + +CONFIG_LWIP_BRIDGEIF_MAX_PORTS=7 +CONFIG_LWIP_ESP_LWIP_ASSERT=y + +# +# Hooks +# +# CONFIG_LWIP_HOOK_TCP_ISN_NONE is not set +CONFIG_LWIP_HOOK_TCP_ISN_DEFAULT=y +# CONFIG_LWIP_HOOK_TCP_ISN_CUSTOM is not set +CONFIG_LWIP_HOOK_IP6_ROUTE_NONE=y +# CONFIG_LWIP_HOOK_IP6_ROUTE_DEFAULT is not set +# CONFIG_LWIP_HOOK_IP6_ROUTE_CUSTOM is not set +CONFIG_LWIP_HOOK_ND6_GET_GW_NONE=y +# CONFIG_LWIP_HOOK_ND6_GET_GW_DEFAULT is not set +# CONFIG_LWIP_HOOK_ND6_GET_GW_CUSTOM is not set +CONFIG_LWIP_HOOK_IP6_SELECT_SRC_ADDR_NONE=y +# CONFIG_LWIP_HOOK_IP6_SELECT_SRC_ADDR_DEFAULT is not set +# CONFIG_LWIP_HOOK_IP6_SELECT_SRC_ADDR_CUSTOM is not set +CONFIG_LWIP_HOOK_DHCP_EXTRA_OPTION_NONE=y +# CONFIG_LWIP_HOOK_DHCP_EXTRA_OPTION_DEFAULT is not set +# CONFIG_LWIP_HOOK_DHCP_EXTRA_OPTION_CUSTOM is not set +CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_NONE=y +# CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_DEFAULT is not set +# CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_CUSTOM is not set +CONFIG_LWIP_HOOK_DNS_EXT_RESOLVE_NONE=y +# CONFIG_LWIP_HOOK_DNS_EXT_RESOLVE_CUSTOM is not set +CONFIG_LWIP_HOOK_IP6_INPUT_NONE=y +# CONFIG_LWIP_HOOK_IP6_INPUT_DEFAULT is not set +# CONFIG_LWIP_HOOK_IP6_INPUT_CUSTOM is not set +# end of Hooks + +# CONFIG_LWIP_DEBUG is not set +# end of LWIP + +# +# mbedTLS +# +CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC=y +# CONFIG_MBEDTLS_EXTERNAL_MEM_ALLOC is not set +# CONFIG_MBEDTLS_DEFAULT_MEM_ALLOC is not set +# CONFIG_MBEDTLS_CUSTOM_MEM_ALLOC is not set +CONFIG_MBEDTLS_ASYMMETRIC_CONTENT_LEN=y +CONFIG_MBEDTLS_SSL_IN_CONTENT_LEN=16384 +CONFIG_MBEDTLS_SSL_OUT_CONTENT_LEN=4096 +# CONFIG_MBEDTLS_DYNAMIC_BUFFER is not set +# CONFIG_MBEDTLS_DEBUG is not set + +# +# mbedTLS v3.x related +# +# CONFIG_MBEDTLS_SSL_PROTO_TLS1_3 is not set +# CONFIG_MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH is not set +# CONFIG_MBEDTLS_X509_TRUSTED_CERT_CALLBACK is not set +# CONFIG_MBEDTLS_SSL_CONTEXT_SERIALIZATION is not set +CONFIG_MBEDTLS_SSL_KEEP_PEER_CERTIFICATE=y +# CONFIG_MBEDTLS_SSL_KEYING_MATERIAL_EXPORT is not set +CONFIG_MBEDTLS_PKCS7_C=y +# end of mbedTLS v3.x related + +# +# Certificate Bundle +# +# CONFIG_MBEDTLS_CERTIFICATE_BUNDLE is not set +# end of Certificate Bundle + +# CONFIG_MBEDTLS_ECP_RESTARTABLE is not set +CONFIG_MBEDTLS_CMAC_C=y +CONFIG_MBEDTLS_HARDWARE_AES=y +# CONFIG_MBEDTLS_GCM_SUPPORT_NON_AES_CIPHER is not set +CONFIG_MBEDTLS_HARDWARE_MPI=y +# CONFIG_MBEDTLS_LARGE_KEY_SOFTWARE_MPI is not set +CONFIG_MBEDTLS_HARDWARE_SHA=y +CONFIG_MBEDTLS_ROM_MD5=y +# CONFIG_MBEDTLS_ATCA_HW_ECDSA_SIGN is not set +# CONFIG_MBEDTLS_ATCA_HW_ECDSA_VERIFY is not set +CONFIG_MBEDTLS_HAVE_TIME=y +# CONFIG_MBEDTLS_PLATFORM_TIME_ALT is not set +# CONFIG_MBEDTLS_HAVE_TIME_DATE is not set +CONFIG_MBEDTLS_ECDSA_DETERMINISTIC=y +CONFIG_MBEDTLS_SHA1_C=y +CONFIG_MBEDTLS_SHA512_C=y +# CONFIG_MBEDTLS_SHA3_C is not set +CONFIG_MBEDTLS_TLS_SERVER_AND_CLIENT=y +# CONFIG_MBEDTLS_TLS_SERVER_ONLY is not set +# CONFIG_MBEDTLS_TLS_CLIENT_ONLY is not set +# CONFIG_MBEDTLS_TLS_DISABLED is not set +CONFIG_MBEDTLS_TLS_SERVER=y +CONFIG_MBEDTLS_TLS_CLIENT=y +CONFIG_MBEDTLS_TLS_ENABLED=y + +# +# TLS Key Exchange Methods +# +# CONFIG_MBEDTLS_PSK_MODES is not set +CONFIG_MBEDTLS_KEY_EXCHANGE_RSA=y +CONFIG_MBEDTLS_KEY_EXCHANGE_ELLIPTIC_CURVE=y +CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_RSA=y +CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA=y +CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA=y +CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_RSA=y +# end of TLS Key Exchange Methods + +CONFIG_MBEDTLS_SSL_RENEGOTIATION=y +CONFIG_MBEDTLS_SSL_PROTO_TLS1_2=y +# CONFIG_MBEDTLS_SSL_PROTO_GMTSSL1_1 is not set +# CONFIG_MBEDTLS_SSL_PROTO_DTLS is not set +CONFIG_MBEDTLS_SSL_ALPN=y +CONFIG_MBEDTLS_CLIENT_SSL_SESSION_TICKETS=y +CONFIG_MBEDTLS_SERVER_SSL_SESSION_TICKETS=y + +# +# Symmetric Ciphers +# +CONFIG_MBEDTLS_AES_C=y +# CONFIG_MBEDTLS_CAMELLIA_C is not set +# CONFIG_MBEDTLS_DES_C is not set +# CONFIG_MBEDTLS_BLOWFISH_C is not set +# CONFIG_MBEDTLS_XTEA_C is not set +CONFIG_MBEDTLS_CCM_C=y +CONFIG_MBEDTLS_GCM_C=y +# CONFIG_MBEDTLS_NIST_KW_C is not set +# end of Symmetric Ciphers + +# CONFIG_MBEDTLS_RIPEMD160_C is not set + +# +# Certificates +# +CONFIG_MBEDTLS_PEM_PARSE_C=y +CONFIG_MBEDTLS_PEM_WRITE_C=y +CONFIG_MBEDTLS_X509_CRL_PARSE_C=y +CONFIG_MBEDTLS_X509_CSR_PARSE_C=y +# end of Certificates + +CONFIG_MBEDTLS_ECP_C=y +CONFIG_MBEDTLS_PK_PARSE_EC_EXTENDED=y +CONFIG_MBEDTLS_PK_PARSE_EC_COMPRESSED=y +# CONFIG_MBEDTLS_DHM_C is not set +CONFIG_MBEDTLS_ECDH_C=y +CONFIG_MBEDTLS_ECDSA_C=y +# CONFIG_MBEDTLS_ECJPAKE_C is not set +CONFIG_MBEDTLS_ECP_DP_SECP192R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP224R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP256R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP384R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP521R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP192K1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP224K1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP256K1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_BP256R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_BP384R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_BP512R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_CURVE25519_ENABLED=y +CONFIG_MBEDTLS_ECP_NIST_OPTIM=y +CONFIG_MBEDTLS_ECP_FIXED_POINT_OPTIM=y +# CONFIG_MBEDTLS_POLY1305_C is not set +# CONFIG_MBEDTLS_CHACHA20_C is not set +# CONFIG_MBEDTLS_HKDF_C is not set +# CONFIG_MBEDTLS_THREADING_C is not set +CONFIG_MBEDTLS_ERROR_STRINGS=y +CONFIG_MBEDTLS_FS_IO=y +# CONFIG_MBEDTLS_ALLOW_WEAK_CERTIFICATE_VERIFICATION is not set +# end of mbedTLS + +# +# ESP-MQTT Configurations +# +CONFIG_MQTT_PROTOCOL_311=y +# CONFIG_MQTT_PROTOCOL_5 is not set +CONFIG_MQTT_TRANSPORT_SSL=y +CONFIG_MQTT_TRANSPORT_WEBSOCKET=y +CONFIG_MQTT_TRANSPORT_WEBSOCKET_SECURE=y +# CONFIG_MQTT_MSG_ID_INCREMENTAL is not set +# CONFIG_MQTT_SKIP_PUBLISH_IF_DISCONNECTED is not set +# CONFIG_MQTT_REPORT_DELETED_MESSAGES is not set +# CONFIG_MQTT_USE_CUSTOM_CONFIG is not set +# CONFIG_MQTT_TASK_CORE_SELECTION_ENABLED is not set +# CONFIG_MQTT_CUSTOM_OUTBOX is not set +# end of ESP-MQTT Configurations + +# +# LibC +# +CONFIG_LIBC_NEWLIB=y +CONFIG_LIBC_MISC_IN_IRAM=y +CONFIG_LIBC_LOCKS_PLACE_IN_IRAM=y +CONFIG_LIBC_STDOUT_LINE_ENDING_CRLF=y +# CONFIG_LIBC_STDOUT_LINE_ENDING_LF is not set +# CONFIG_LIBC_STDOUT_LINE_ENDING_CR is not set +# CONFIG_LIBC_STDIN_LINE_ENDING_CRLF is not set +# CONFIG_LIBC_STDIN_LINE_ENDING_LF is not set +CONFIG_LIBC_STDIN_LINE_ENDING_CR=y +# CONFIG_LIBC_NEWLIB_NANO_FORMAT is not set +CONFIG_LIBC_TIME_SYSCALL_USE_RTC_HRT=y +# CONFIG_LIBC_TIME_SYSCALL_USE_RTC is not set +# CONFIG_LIBC_TIME_SYSCALL_USE_HRT is not set +# CONFIG_LIBC_TIME_SYSCALL_USE_NONE is not set +# end of LibC + +CONFIG_STDATOMIC_S32C1I_SPIRAM_WORKAROUND=y + +# +# NVS +# +# CONFIG_NVS_ASSERT_ERROR_CHECK is not set +# CONFIG_NVS_LEGACY_DUP_KEYS_COMPATIBILITY is not set +# CONFIG_NVS_ALLOCATE_CACHE_IN_SPIRAM is not set +# end of NVS + +# +# OpenThread +# +# CONFIG_OPENTHREAD_ENABLED is not set + +# +# OpenThread Spinel +# +# CONFIG_OPENTHREAD_SPINEL_ONLY is not set +# end of OpenThread Spinel +# end of OpenThread + +# +# Protocomm +# +CONFIG_ESP_PROTOCOMM_SUPPORT_SECURITY_VERSION_0=y +CONFIG_ESP_PROTOCOMM_SUPPORT_SECURITY_VERSION_1=y +CONFIG_ESP_PROTOCOMM_SUPPORT_SECURITY_VERSION_2=y +CONFIG_ESP_PROTOCOMM_SUPPORT_SECURITY_PATCH_VERSION=y +# end of Protocomm + +# +# PThreads +# +CONFIG_PTHREAD_TASK_PRIO_DEFAULT=5 +CONFIG_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072 +CONFIG_PTHREAD_STACK_MIN=768 +CONFIG_PTHREAD_DEFAULT_CORE_NO_AFFINITY=y +# CONFIG_PTHREAD_DEFAULT_CORE_0 is not set +# CONFIG_PTHREAD_DEFAULT_CORE_1 is not set +CONFIG_PTHREAD_TASK_CORE_DEFAULT=-1 +CONFIG_PTHREAD_TASK_NAME_DEFAULT="pthread" +# end of PThreads + +# +# MMU Config +# +CONFIG_MMU_PAGE_SIZE_64KB=y +CONFIG_MMU_PAGE_MODE="64KB" +CONFIG_MMU_PAGE_SIZE=0x10000 +# end of MMU Config + +# +# Main Flash configuration +# + +# +# SPI Flash behavior when brownout +# +CONFIG_SPI_FLASH_BROWNOUT_RESET_XMC=y +CONFIG_SPI_FLASH_BROWNOUT_RESET=y +# end of SPI Flash behavior when brownout + +# +# Optional and Experimental Features (READ DOCS FIRST) +# + +# +# Features here require specific hardware (READ DOCS FIRST!) +# +CONFIG_SPI_FLASH_SUSPEND_TSUS_VAL_US=50 +# CONFIG_SPI_FLASH_FORCE_ENABLE_XMC_C_SUSPEND is not set +# CONFIG_SPI_FLASH_FORCE_ENABLE_C6_H2_SUSPEND is not set +CONFIG_SPI_FLASH_PLACE_FUNCTIONS_IN_IRAM=y +# end of Optional and Experimental Features (READ DOCS FIRST) +# end of Main Flash configuration + +# +# SPI Flash driver +# +# CONFIG_SPI_FLASH_VERIFY_WRITE is not set +# CONFIG_SPI_FLASH_ENABLE_COUNTERS is not set +CONFIG_SPI_FLASH_ROM_DRIVER_PATCH=y +CONFIG_SPI_FLASH_DANGEROUS_WRITE_ABORTS=y +# CONFIG_SPI_FLASH_DANGEROUS_WRITE_FAILS is not set +# CONFIG_SPI_FLASH_DANGEROUS_WRITE_ALLOWED is not set +# CONFIG_SPI_FLASH_SHARE_SPI1_BUS is not set +# CONFIG_SPI_FLASH_BYPASS_BLOCK_ERASE is not set +CONFIG_SPI_FLASH_YIELD_DURING_ERASE=y +CONFIG_SPI_FLASH_ERASE_YIELD_DURATION_MS=20 +CONFIG_SPI_FLASH_ERASE_YIELD_TICKS=1 +CONFIG_SPI_FLASH_WRITE_CHUNK_SIZE=8192 +# CONFIG_SPI_FLASH_SIZE_OVERRIDE is not set +# CONFIG_SPI_FLASH_CHECK_ERASE_TIMEOUT_DISABLED is not set +# CONFIG_SPI_FLASH_OVERRIDE_CHIP_DRIVER_LIST is not set + +# +# Auto-detect flash chips +# +CONFIG_SPI_FLASH_VENDOR_XMC_SUPPORT_ENABLED=y +CONFIG_SPI_FLASH_VENDOR_GD_SUPPORT_ENABLED=y +CONFIG_SPI_FLASH_VENDOR_ISSI_SUPPORT_ENABLED=y +CONFIG_SPI_FLASH_VENDOR_MXIC_SUPPORT_ENABLED=y +CONFIG_SPI_FLASH_VENDOR_WINBOND_SUPPORT_ENABLED=y +CONFIG_SPI_FLASH_SUPPORT_ISSI_CHIP=y +CONFIG_SPI_FLASH_SUPPORT_MXIC_CHIP=y +CONFIG_SPI_FLASH_SUPPORT_GD_CHIP=y +CONFIG_SPI_FLASH_SUPPORT_WINBOND_CHIP=y +# CONFIG_SPI_FLASH_SUPPORT_BOYA_CHIP is not set +# CONFIG_SPI_FLASH_SUPPORT_TH_CHIP is not set +# end of Auto-detect flash chips + +CONFIG_SPI_FLASH_ENABLE_ENCRYPTED_READ_WRITE=y +# end of SPI Flash driver + +# +# SPIFFS Configuration +# +CONFIG_SPIFFS_MAX_PARTITIONS=3 + +# +# SPIFFS Cache Configuration +# +CONFIG_SPIFFS_CACHE=y +CONFIG_SPIFFS_CACHE_WR=y +# CONFIG_SPIFFS_CACHE_STATS is not set +# end of SPIFFS Cache Configuration + +CONFIG_SPIFFS_PAGE_CHECK=y +CONFIG_SPIFFS_GC_MAX_RUNS=10 +# CONFIG_SPIFFS_GC_STATS is not set +CONFIG_SPIFFS_PAGE_SIZE=256 +CONFIG_SPIFFS_OBJ_NAME_LEN=32 +# CONFIG_SPIFFS_FOLLOW_SYMLINKS is not set +CONFIG_SPIFFS_USE_MAGIC=y +CONFIG_SPIFFS_USE_MAGIC_LENGTH=y +CONFIG_SPIFFS_META_LENGTH=4 +CONFIG_SPIFFS_USE_MTIME=y + +# +# Debug Configuration +# +# CONFIG_SPIFFS_DBG is not set +# CONFIG_SPIFFS_API_DBG is not set +# CONFIG_SPIFFS_GC_DBG is not set +# CONFIG_SPIFFS_CACHE_DBG is not set +# CONFIG_SPIFFS_CHECK_DBG is not set +# CONFIG_SPIFFS_TEST_VISUALISATION is not set +# end of Debug Configuration +# end of SPIFFS Configuration + +# +# TCP Transport +# + +# +# Websocket +# +CONFIG_WS_TRANSPORT=y +CONFIG_WS_BUFFER_SIZE=1024 +# CONFIG_WS_DYNAMIC_BUFFER is not set +# end of Websocket +# end of TCP Transport + +# +# Ultra Low Power (ULP) Co-processor +# +# CONFIG_ULP_COPROC_ENABLED is not set + +# +# ULP Debugging Options +# +# end of ULP Debugging Options +# end of Ultra Low Power (ULP) Co-processor + +# +# Unity unit testing library +# +CONFIG_UNITY_ENABLE_FLOAT=y +CONFIG_UNITY_ENABLE_DOUBLE=y +# CONFIG_UNITY_ENABLE_64BIT is not set +# CONFIG_UNITY_ENABLE_COLOR is not set +CONFIG_UNITY_ENABLE_IDF_TEST_RUNNER=y +# CONFIG_UNITY_ENABLE_FIXTURE is not set +# CONFIG_UNITY_ENABLE_BACKTRACE_ON_FAIL is not set +# CONFIG_UNITY_TEST_ORDER_BY_FILE_PATH_AND_LINE is not set +# end of Unity unit testing library + +# +# Virtual file system +# +CONFIG_VFS_SUPPORT_IO=y +CONFIG_VFS_SUPPORT_DIR=y +CONFIG_VFS_SUPPORT_SELECT=y +CONFIG_VFS_SUPPRESS_SELECT_DEBUG_OUTPUT=y +# CONFIG_VFS_SELECT_IN_RAM is not set +CONFIG_VFS_SUPPORT_TERMIOS=y +CONFIG_VFS_MAX_COUNT=8 + +# +# Host File System I/O (Semihosting) +# +CONFIG_VFS_SEMIHOSTFS_MAX_MOUNT_POINTS=1 +# end of Host File System I/O (Semihosting) + +CONFIG_VFS_INITIALIZE_DEV_NULL=y +# end of Virtual file system + +# +# Wear Levelling +# +# CONFIG_WL_SECTOR_SIZE_512 is not set +CONFIG_WL_SECTOR_SIZE_4096=y +CONFIG_WL_SECTOR_SIZE=4096 +# end of Wear Levelling + +# +# Wi-Fi Provisioning Manager +# +CONFIG_WIFI_PROV_SCAN_MAX_ENTRIES=16 +CONFIG_WIFI_PROV_AUTOSTOP_TIMEOUT=30 +CONFIG_WIFI_PROV_STA_ALL_CHANNEL_SCAN=y +# CONFIG_WIFI_PROV_STA_FAST_SCAN is not set +# end of Wi-Fi Provisioning Manager + +# +# WebSocket Server +# +CONFIG_WEBSOCKET_SERVER_MAX_CLIENTS=1 +CONFIG_WEBSOCKET_SERVER_QUEUE_SIZE=2 +CONFIG_WEBSOCKET_SERVER_QUEUE_TIMEOUT=30 +CONFIG_WEBSOCKET_SERVER_TASK_STACK_DEPTH=3000 +CONFIG_WEBSOCKET_SERVER_TASK_PRIORITY=5 +# CONFIG_WEBSOCKET_SERVER_PINNED is not set +# end of WebSocket Server + +# +# DSP Library +# +CONFIG_DSP_OPTIMIZATIONS_SUPPORTED=y +# CONFIG_DSP_ANSI is not set +CONFIG_DSP_OPTIMIZED=y +CONFIG_DSP_OPTIMIZATION=1 +# CONFIG_DSP_MAX_FFT_SIZE_512 is not set +# CONFIG_DSP_MAX_FFT_SIZE_1024 is not set +# CONFIG_DSP_MAX_FFT_SIZE_2048 is not set +CONFIG_DSP_MAX_FFT_SIZE_4096=y +# CONFIG_DSP_MAX_FFT_SIZE_8192 is not set +# CONFIG_DSP_MAX_FFT_SIZE_16384 is not set +# CONFIG_DSP_MAX_FFT_SIZE_32768 is not set +CONFIG_DSP_MAX_FFT_SIZE=4096 +# end of DSP Library + +# +# mDNS +# +CONFIG_MDNS_MAX_INTERFACES=3 +CONFIG_MDNS_MAX_SERVICES=10 +CONFIG_MDNS_TASK_PRIORITY=1 +CONFIG_MDNS_ACTION_QUEUE_LEN=16 +CONFIG_MDNS_TASK_STACK_SIZE=2816 +CONFIG_MDNS_TASK_AFFINITY_NO_AFFINITY=y +# CONFIG_MDNS_TASK_AFFINITY_CPU0 is not set +# CONFIG_MDNS_TASK_AFFINITY_CPU1 is not set +CONFIG_MDNS_TASK_AFFINITY=0x7FFFFFFF + +# +# MDNS Memory Configuration +# +# CONFIG_MDNS_TASK_CREATE_FROM_SPIRAM is not set +CONFIG_MDNS_TASK_CREATE_FROM_INTERNAL=y +# CONFIG_MDNS_MEMORY_ALLOC_SPIRAM is not set +CONFIG_MDNS_MEMORY_ALLOC_INTERNAL=y +# CONFIG_MDNS_MEMORY_CUSTOM_IMPL is not set +# end of MDNS Memory Configuration + +CONFIG_MDNS_SERVICE_ADD_TIMEOUT_MS=2000 +CONFIG_MDNS_TIMER_PERIOD_MS=100 +# CONFIG_MDNS_NETWORKING_SOCKET is not set +# CONFIG_MDNS_SKIP_SUPPRESSING_OWN_QUERIES is not set +# CONFIG_MDNS_ENABLE_DEBUG_PRINTS is not set +CONFIG_MDNS_ENABLE_CONSOLE_CLI=y +# CONFIG_MDNS_RESPOND_REVERSE_QUERIES is not set +CONFIG_MDNS_MULTIPLE_INSTANCE=y + +# +# MDNS Predefined interfaces +# +CONFIG_MDNS_PREDEF_NETIF_STA=y +CONFIG_MDNS_PREDEF_NETIF_AP=y +CONFIG_MDNS_PREDEF_NETIF_ETH=y +# end of MDNS Predefined interfaces +# end of mDNS +# end of Component config + +# CONFIG_IDF_EXPERIMENTAL_FEATURES is not set + +# Deprecated options for backward compatibility +# CONFIG_APP_BUILD_TYPE_ELF_RAM is not set +# CONFIG_NO_BLOBS is not set +# CONFIG_ESP32_NO_BLOBS is not set +# CONFIG_ESP32_COMPATIBLE_PRE_V2_1_BOOTLOADERS is not set +# CONFIG_ESP32_COMPATIBLE_PRE_V3_1_BOOTLOADERS is not set +CONFIG_APP_ROLLBACK_ENABLE=y +# CONFIG_APP_ANTI_ROLLBACK is not set +# CONFIG_LOG_BOOTLOADER_LEVEL_NONE is not set +CONFIG_LOG_BOOTLOADER_LEVEL_ERROR=y +# CONFIG_LOG_BOOTLOADER_LEVEL_WARN is not set +# CONFIG_LOG_BOOTLOADER_LEVEL_INFO is not set +# CONFIG_LOG_BOOTLOADER_LEVEL_DEBUG is not set +# CONFIG_LOG_BOOTLOADER_LEVEL_VERBOSE is not set +CONFIG_LOG_BOOTLOADER_LEVEL=1 +# CONFIG_FLASH_ENCRYPTION_ENABLED is not set +CONFIG_FLASHMODE_QIO=y +# CONFIG_FLASHMODE_QOUT is not set +# CONFIG_FLASHMODE_DIO is not set +# CONFIG_FLASHMODE_DOUT is not set +CONFIG_MONITOR_BAUD=115200 +# CONFIG_OPTIMIZATION_LEVEL_DEBUG is not set +# CONFIG_COMPILER_OPTIMIZATION_LEVEL_DEBUG is not set +# CONFIG_COMPILER_OPTIMIZATION_DEFAULT is not set +# CONFIG_OPTIMIZATION_LEVEL_RELEASE is not set +# CONFIG_COMPILER_OPTIMIZATION_LEVEL_RELEASE is not set +CONFIG_OPTIMIZATION_ASSERTIONS_ENABLED=y +# CONFIG_OPTIMIZATION_ASSERTIONS_SILENT is not set +# CONFIG_OPTIMIZATION_ASSERTIONS_DISABLED is not set +CONFIG_OPTIMIZATION_ASSERTION_LEVEL=2 +# CONFIG_CXX_EXCEPTIONS is not set +CONFIG_STACK_CHECK_NONE=y +# CONFIG_STACK_CHECK_NORM is not set +# CONFIG_STACK_CHECK_STRONG is not set +# CONFIG_STACK_CHECK_ALL is not set +# CONFIG_WARN_WRITE_STRINGS is not set +# CONFIG_ESP32_APPTRACE_DEST_TRAX is not set +CONFIG_ESP32_APPTRACE_DEST_NONE=y +CONFIG_ESP32_APPTRACE_LOCK_ENABLE=y +CONFIG_ADC2_DISABLE_DAC=y +# CONFIG_GPTIMER_ISR_IRAM_SAFE is not set +# CONFIG_MCPWM_ISR_IRAM_SAFE is not set +# CONFIG_EVENT_LOOP_PROFILING is not set +CONFIG_POST_EVENTS_FROM_ISR=y +# CONFIG_POST_EVENTS_FROM_IRAM_ISR is not set +CONFIG_GDBSTUB_SUPPORT_TASKS=y +CONFIG_GDBSTUB_MAX_TASKS=32 +# CONFIG_OTA_ALLOW_HTTP is not set +# CONFIG_TWO_UNIVERSAL_MAC_ADDRESS is not set +CONFIG_FOUR_UNIVERSAL_MAC_ADDRESS=y +CONFIG_NUMBER_OF_UNIVERSAL_MAC_ADDRESS=4 +CONFIG_ESP32_DEEP_SLEEP_WAKEUP_DELAY=2000 +CONFIG_ESP_SLEEP_DEEP_SLEEP_WAKEUP_DELAY=2000 +CONFIG_ESP32_RTC_CLK_SRC_INT_RC=y +CONFIG_ESP32_RTC_CLOCK_SOURCE_INTERNAL_RC=y +# CONFIG_ESP32_RTC_CLK_SRC_EXT_CRYS is not set +# CONFIG_ESP32_RTC_CLOCK_SOURCE_EXTERNAL_CRYSTAL is not set +# CONFIG_ESP32_RTC_CLK_SRC_EXT_OSC is not set +# CONFIG_ESP32_RTC_CLOCK_SOURCE_EXTERNAL_OSC is not set +# CONFIG_ESP32_RTC_CLK_SRC_INT_8MD256 is not set +# CONFIG_ESP32_RTC_CLOCK_SOURCE_INTERNAL_8MD256 is not set +CONFIG_ESP32_RTC_CLK_CAL_CYCLES=1024 +CONFIG_PERIPH_CTRL_FUNC_IN_IRAM=y +# CONFIG_ESP32_XTAL_FREQ_26 is not set +CONFIG_ESP32_XTAL_FREQ_40=y +# CONFIG_ESP32_XTAL_FREQ_AUTO is not set +CONFIG_ESP32_XTAL_FREQ=40 +CONFIG_BROWNOUT_DET=y +CONFIG_ESP32_BROWNOUT_DET=y +# CONFIG_BROWNOUT_DET_LVL_SEL_0 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_0 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_1 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_1 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_2 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_2 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_3 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_3 is not set +CONFIG_BROWNOUT_DET_LVL_SEL_4=y +CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_4=y +# CONFIG_BROWNOUT_DET_LVL_SEL_5 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_5 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_6 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_6 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_7 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_7 is not set +CONFIG_BROWNOUT_DET_LVL=4 +CONFIG_ESP32_BROWNOUT_DET_LVL=4 +CONFIG_ESP_SYSTEM_BROWNOUT_INTR=y +CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE=y +# CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION is not set +CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER=20 +CONFIG_ESP32_PHY_MAX_TX_POWER=20 +CONFIG_REDUCE_PHY_TX_POWER=y +CONFIG_ESP32_REDUCE_PHY_TX_POWER=y +CONFIG_SPIRAM_SUPPORT=y +CONFIG_ESP32_SPIRAM_SUPPORT=y +# CONFIG_WIFI_LWIP_ALLOCATION_FROM_SPIRAM_FIRST is not set +# CONFIG_ESP32_DEFAULT_CPU_FREQ_80 is not set +# CONFIG_ESP32_DEFAULT_CPU_FREQ_160 is not set +CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y +CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=240 +CONFIG_TRACEMEM_RESERVE_DRAM=0x0 +# CONFIG_ESP32_PANIC_PRINT_HALT is not set +CONFIG_ESP32_PANIC_PRINT_REBOOT=y +# CONFIG_ESP32_PANIC_SILENT_REBOOT is not set +# CONFIG_ESP32_PANIC_GDBSTUB is not set +CONFIG_SYSTEM_EVENT_QUEUE_SIZE=32 +CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=2304 +CONFIG_MAIN_TASK_STACK_SIZE=3072 +CONFIG_CONSOLE_UART_DEFAULT=y +# CONFIG_CONSOLE_UART_CUSTOM is not set +# CONFIG_CONSOLE_UART_NONE is not set +# CONFIG_ESP_CONSOLE_UART_NONE is not set +CONFIG_CONSOLE_UART=y +CONFIG_CONSOLE_UART_NUM=0 +CONFIG_CONSOLE_UART_BAUDRATE=115200 +CONFIG_INT_WDT=y +CONFIG_INT_WDT_TIMEOUT_MS=300 +CONFIG_INT_WDT_CHECK_CPU1=y +CONFIG_TASK_WDT=y +CONFIG_ESP_TASK_WDT=y +# CONFIG_TASK_WDT_PANIC is not set +CONFIG_TASK_WDT_TIMEOUT_S=5 +CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU0=y +CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU1=y +# CONFIG_ESP32_DEBUG_STUBS_ENABLE is not set +CONFIG_ESP32_DEBUG_OCDAWARE=y +# CONFIG_DISABLE_BASIC_ROM_CONSOLE is not set +CONFIG_IPC_TASK_STACK_SIZE=1024 +CONFIG_TIMER_TASK_STACK_SIZE=2048 +CONFIG_ESP32_WIFI_ENABLED=y +CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=8 +CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=64 +CONFIG_ESP32_WIFI_STATIC_TX_BUFFER=y +# CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER is not set +CONFIG_ESP32_WIFI_TX_BUFFER_TYPE=0 +CONFIG_ESP32_WIFI_STATIC_TX_BUFFER_NUM=8 +# CONFIG_ESP32_WIFI_CSI_ENABLED is not set +CONFIG_ESP32_WIFI_AMPDU_TX_ENABLED=y +CONFIG_ESP32_WIFI_TX_BA_WIN=8 +CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED=y +CONFIG_ESP32_WIFI_RX_BA_WIN=16 +CONFIG_ESP32_WIFI_NVS_ENABLED=y +CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_0=y +# CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_1 is not set +CONFIG_ESP32_WIFI_SOFTAP_BEACON_MAX_LEN=752 +CONFIG_ESP32_WIFI_MGMT_SBUF_NUM=32 +# CONFIG_ESP32_WIFI_IRAM_OPT is not set +CONFIG_ESP32_WIFI_RX_IRAM_OPT=y +CONFIG_ESP32_WIFI_ENABLE_WPA3_SAE=y +CONFIG_ESP32_WIFI_ENABLE_WPA3_OWE_STA=y +CONFIG_WPA_MBEDTLS_CRYPTO=y +CONFIG_WPA_MBEDTLS_TLS_CLIENT=y +# CONFIG_WPA_WAPI_PSK is not set +# CONFIG_WPA_11KV_SUPPORT is not set +# CONFIG_WPA_MBO_SUPPORT is not set +# CONFIG_WPA_DPP_SUPPORT is not set +# CONFIG_WPA_11R_SUPPORT is not set +# CONFIG_WPA_WPS_SOFTAP_REGISTRAR is not set +# CONFIG_WPA_WPS_STRICT is not set +# CONFIG_WPA_DEBUG_PRINT is not set +# CONFIG_WPA_TESTING_OPTIONS is not set +# CONFIG_ESP32_ENABLE_COREDUMP_TO_FLASH is not set +# CONFIG_ESP32_ENABLE_COREDUMP_TO_UART is not set +CONFIG_ESP32_ENABLE_COREDUMP_TO_NONE=y +CONFIG_TIMER_TASK_PRIORITY=1 +CONFIG_TIMER_TASK_STACK_DEPTH=1536 +CONFIG_TIMER_QUEUE_LENGTH=5 +# CONFIG_ENABLE_STATIC_TASK_CLEAN_UP_HOOK is not set +# CONFIG_SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY is not set +# CONFIG_HAL_ASSERTION_SILIENT is not set +# CONFIG_L2_TO_L3_COPY is not set +CONFIG_ESP_GRATUITOUS_ARP=y +CONFIG_GARP_TMR_INTERVAL=60 +CONFIG_TCPIP_RECVMBOX_SIZE=32 +CONFIG_TCP_MAXRTX=12 +CONFIG_TCP_SYNMAXRTX=12 +CONFIG_TCP_MSS=1460 +CONFIG_TCP_MSL=60000 +CONFIG_TCP_SND_BUF_DEFAULT=11680 +CONFIG_TCP_WND_DEFAULT=11680 +CONFIG_TCP_RECVMBOX_SIZE=10 +CONFIG_TCP_QUEUE_OOSEQ=y +CONFIG_TCP_OVERSIZE_MSS=y +# CONFIG_TCP_OVERSIZE_QUARTER_MSS is not set +# CONFIG_TCP_OVERSIZE_DISABLE is not set +CONFIG_UDP_RECVMBOX_SIZE=6 +CONFIG_TCPIP_TASK_STACK_SIZE=3072 +# CONFIG_TCPIP_TASK_AFFINITY_NO_AFFINITY is not set +CONFIG_TCPIP_TASK_AFFINITY_CPU0=y +# CONFIG_TCPIP_TASK_AFFINITY_CPU1 is not set +CONFIG_TCPIP_TASK_AFFINITY=0x0 +# CONFIG_PPP_SUPPORT is not set +CONFIG_NEWLIB_STDOUT_LINE_ENDING_CRLF=y +# CONFIG_NEWLIB_STDOUT_LINE_ENDING_LF is not set +# CONFIG_NEWLIB_STDOUT_LINE_ENDING_CR is not set +# CONFIG_NEWLIB_STDIN_LINE_ENDING_CRLF is not set +# CONFIG_NEWLIB_STDIN_LINE_ENDING_LF is not set +CONFIG_NEWLIB_STDIN_LINE_ENDING_CR=y +# CONFIG_NEWLIB_NANO_FORMAT is not set +CONFIG_NEWLIB_TIME_SYSCALL_USE_RTC_HRT=y +CONFIG_ESP32_TIME_SYSCALL_USE_RTC_HRT=y +CONFIG_ESP32_TIME_SYSCALL_USE_RTC_FRC1=y +# CONFIG_NEWLIB_TIME_SYSCALL_USE_RTC is not set +# CONFIG_ESP32_TIME_SYSCALL_USE_RTC is not set +# CONFIG_NEWLIB_TIME_SYSCALL_USE_HRT is not set +# CONFIG_ESP32_TIME_SYSCALL_USE_HRT is not set +# CONFIG_ESP32_TIME_SYSCALL_USE_FRC1 is not set +# CONFIG_NEWLIB_TIME_SYSCALL_USE_NONE is not set +# CONFIG_ESP32_TIME_SYSCALL_USE_NONE is not set +CONFIG_ESP32_PTHREAD_TASK_PRIO_DEFAULT=5 +CONFIG_ESP32_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072 +CONFIG_ESP32_PTHREAD_STACK_MIN=768 +CONFIG_ESP32_DEFAULT_PTHREAD_CORE_NO_AFFINITY=y +# CONFIG_ESP32_DEFAULT_PTHREAD_CORE_0 is not set +# CONFIG_ESP32_DEFAULT_PTHREAD_CORE_1 is not set +CONFIG_ESP32_PTHREAD_TASK_CORE_DEFAULT=-1 +CONFIG_ESP32_PTHREAD_TASK_NAME_DEFAULT="pthread" +CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ABORTS=y +# CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_FAILS is not set +# CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ALLOWED is not set +# CONFIG_ESP32_ULP_COPROC_ENABLED is not set +CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT=y +CONFIG_SUPPORT_TERMIOS=y +CONFIG_SEMIHOSTFS_MAX_MOUNT_POINTS=1 +# End of deprecated options diff --git a/sdkconfig.louder-esp32 b/sdkconfig.louder-esp32 new file mode 100644 index 00000000..12508af3 --- /dev/null +++ b/sdkconfig.louder-esp32 @@ -0,0 +1,2513 @@ +# +# Automatically generated file. DO NOT EDIT. +# Espressif IoT Development Framework (ESP-IDF) 5.5.1 Project Configuration +# +CONFIG_SOC_CAPS_ECO_VER_MAX=301 +CONFIG_SOC_ADC_SUPPORTED=y +CONFIG_SOC_DAC_SUPPORTED=y +CONFIG_SOC_UART_SUPPORTED=y +CONFIG_SOC_MCPWM_SUPPORTED=y +CONFIG_SOC_GPTIMER_SUPPORTED=y +CONFIG_SOC_SDMMC_HOST_SUPPORTED=y +CONFIG_SOC_BT_SUPPORTED=y +CONFIG_SOC_PCNT_SUPPORTED=y +CONFIG_SOC_PHY_SUPPORTED=y +CONFIG_SOC_WIFI_SUPPORTED=y +CONFIG_SOC_SDIO_SLAVE_SUPPORTED=y +CONFIG_SOC_TWAI_SUPPORTED=y +CONFIG_SOC_EFUSE_SUPPORTED=y +CONFIG_SOC_EMAC_SUPPORTED=y +CONFIG_SOC_ULP_SUPPORTED=y +CONFIG_SOC_CCOMP_TIMER_SUPPORTED=y +CONFIG_SOC_RTC_FAST_MEM_SUPPORTED=y +CONFIG_SOC_RTC_SLOW_MEM_SUPPORTED=y +CONFIG_SOC_RTC_MEM_SUPPORTED=y +CONFIG_SOC_I2S_SUPPORTED=y +CONFIG_SOC_RMT_SUPPORTED=y +CONFIG_SOC_SDM_SUPPORTED=y +CONFIG_SOC_GPSPI_SUPPORTED=y +CONFIG_SOC_LEDC_SUPPORTED=y +CONFIG_SOC_I2C_SUPPORTED=y +CONFIG_SOC_SUPPORT_COEXISTENCE=y +CONFIG_SOC_AES_SUPPORTED=y +CONFIG_SOC_MPI_SUPPORTED=y +CONFIG_SOC_SHA_SUPPORTED=y +CONFIG_SOC_FLASH_ENC_SUPPORTED=y +CONFIG_SOC_SECURE_BOOT_SUPPORTED=y +CONFIG_SOC_TOUCH_SENSOR_SUPPORTED=y +CONFIG_SOC_BOD_SUPPORTED=y +CONFIG_SOC_ULP_FSM_SUPPORTED=y +CONFIG_SOC_CLK_TREE_SUPPORTED=y +CONFIG_SOC_MPU_SUPPORTED=y +CONFIG_SOC_WDT_SUPPORTED=y +CONFIG_SOC_SPI_FLASH_SUPPORTED=y +CONFIG_SOC_RNG_SUPPORTED=y +CONFIG_SOC_LIGHT_SLEEP_SUPPORTED=y +CONFIG_SOC_DEEP_SLEEP_SUPPORTED=y +CONFIG_SOC_LP_PERIPH_SHARE_INTERRUPT=y +CONFIG_SOC_PM_SUPPORTED=y +CONFIG_SOC_DPORT_WORKAROUND_DIS_INTERRUPT_LVL=5 +CONFIG_SOC_XTAL_SUPPORT_26M=y +CONFIG_SOC_XTAL_SUPPORT_40M=y +CONFIG_SOC_XTAL_SUPPORT_AUTO_DETECT=y +CONFIG_SOC_ADC_RTC_CTRL_SUPPORTED=y +CONFIG_SOC_ADC_DIG_CTRL_SUPPORTED=y +CONFIG_SOC_ADC_DMA_SUPPORTED=y +CONFIG_SOC_ADC_PERIPH_NUM=2 +CONFIG_SOC_ADC_MAX_CHANNEL_NUM=10 +CONFIG_SOC_ADC_ATTEN_NUM=4 +CONFIG_SOC_ADC_DIGI_CONTROLLER_NUM=2 +CONFIG_SOC_ADC_PATT_LEN_MAX=16 +CONFIG_SOC_ADC_DIGI_MIN_BITWIDTH=9 +CONFIG_SOC_ADC_DIGI_MAX_BITWIDTH=12 +CONFIG_SOC_ADC_DIGI_RESULT_BYTES=2 +CONFIG_SOC_ADC_DIGI_DATA_BYTES_PER_CONV=4 +CONFIG_SOC_ADC_DIGI_MONITOR_NUM=0 +CONFIG_SOC_ADC_SAMPLE_FREQ_THRES_HIGH=2 +CONFIG_SOC_ADC_SAMPLE_FREQ_THRES_LOW=20 +CONFIG_SOC_ADC_RTC_MIN_BITWIDTH=9 +CONFIG_SOC_ADC_RTC_MAX_BITWIDTH=12 +CONFIG_SOC_ADC_SHARED_POWER=y +CONFIG_SOC_BROWNOUT_RESET_SUPPORTED=y +CONFIG_SOC_SHARED_IDCACHE_SUPPORTED=y +CONFIG_SOC_IDCACHE_PER_CORE=y +CONFIG_SOC_CPU_CORES_NUM=2 +CONFIG_SOC_CPU_INTR_NUM=32 +CONFIG_SOC_CPU_HAS_FPU=y +CONFIG_SOC_HP_CPU_HAS_MULTIPLE_CORES=y +CONFIG_SOC_CPU_BREAKPOINTS_NUM=2 +CONFIG_SOC_CPU_WATCHPOINTS_NUM=2 +CONFIG_SOC_CPU_WATCHPOINT_MAX_REGION_SIZE=0x40 +CONFIG_SOC_DAC_CHAN_NUM=2 +CONFIG_SOC_DAC_RESOLUTION=8 +CONFIG_SOC_DAC_DMA_16BIT_ALIGN=y +CONFIG_SOC_GPIO_PORT=1 +CONFIG_SOC_GPIO_PIN_COUNT=40 +CONFIG_SOC_GPIO_VALID_GPIO_MASK=0xFFFFFFFFFF +CONFIG_SOC_GPIO_IN_RANGE_MAX=39 +CONFIG_SOC_GPIO_OUT_RANGE_MAX=33 +CONFIG_SOC_GPIO_VALID_DIGITAL_IO_PAD_MASK=0xEF0FEA +CONFIG_SOC_GPIO_CLOCKOUT_BY_IO_MUX=y +CONFIG_SOC_GPIO_CLOCKOUT_CHANNEL_NUM=3 +CONFIG_SOC_GPIO_SUPPORT_HOLD_IO_IN_DSLP=y +CONFIG_SOC_I2C_NUM=2 +CONFIG_SOC_HP_I2C_NUM=2 +CONFIG_SOC_I2C_FIFO_LEN=32 +CONFIG_SOC_I2C_CMD_REG_NUM=16 +CONFIG_SOC_I2C_SUPPORT_SLAVE=y +CONFIG_SOC_I2C_SUPPORT_APB=y +CONFIG_SOC_I2C_SUPPORT_10BIT_ADDR=y +CONFIG_SOC_I2C_STOP_INDEPENDENT=y +CONFIG_SOC_I2S_NUM=2 +CONFIG_SOC_I2S_HW_VERSION_1=y +CONFIG_SOC_I2S_SUPPORTS_APLL=y +CONFIG_SOC_I2S_SUPPORTS_PLL_F160M=y +CONFIG_SOC_I2S_SUPPORTS_PDM=y +CONFIG_SOC_I2S_SUPPORTS_PDM_TX=y +CONFIG_SOC_I2S_SUPPORTS_PCM2PDM=y +CONFIG_SOC_I2S_SUPPORTS_PDM_RX=y +CONFIG_SOC_I2S_SUPPORTS_PDM2PCM=y +CONFIG_SOC_I2S_PDM_MAX_TX_LINES=1 +CONFIG_SOC_I2S_PDM_MAX_RX_LINES=1 +CONFIG_SOC_I2S_SUPPORTS_ADC_DAC=y +CONFIG_SOC_I2S_SUPPORTS_ADC=y +CONFIG_SOC_I2S_SUPPORTS_DAC=y +CONFIG_SOC_I2S_SUPPORTS_LCD_CAMERA=y +CONFIG_SOC_I2S_MAX_DATA_WIDTH=24 +CONFIG_SOC_I2S_TRANS_SIZE_ALIGN_WORD=y +CONFIG_SOC_I2S_LCD_I80_VARIANT=y +CONFIG_SOC_LCD_I80_SUPPORTED=y +CONFIG_SOC_LCD_I80_BUSES=2 +CONFIG_SOC_LCD_I80_BUS_WIDTH=24 +CONFIG_SOC_LEDC_HAS_TIMER_SPECIFIC_MUX=y +CONFIG_SOC_LEDC_SUPPORT_APB_CLOCK=y +CONFIG_SOC_LEDC_SUPPORT_REF_TICK=y +CONFIG_SOC_LEDC_SUPPORT_HS_MODE=y +CONFIG_SOC_LEDC_TIMER_NUM=4 +CONFIG_SOC_LEDC_CHANNEL_NUM=8 +CONFIG_SOC_LEDC_TIMER_BIT_WIDTH=20 +CONFIG_SOC_MCPWM_GROUPS=2 +CONFIG_SOC_MCPWM_TIMERS_PER_GROUP=3 +CONFIG_SOC_MCPWM_OPERATORS_PER_GROUP=3 +CONFIG_SOC_MCPWM_COMPARATORS_PER_OPERATOR=2 +CONFIG_SOC_MCPWM_GENERATORS_PER_OPERATOR=2 +CONFIG_SOC_MCPWM_TRIGGERS_PER_OPERATOR=2 +CONFIG_SOC_MCPWM_GPIO_FAULTS_PER_GROUP=3 +CONFIG_SOC_MCPWM_CAPTURE_TIMERS_PER_GROUP=y +CONFIG_SOC_MCPWM_CAPTURE_CHANNELS_PER_TIMER=3 +CONFIG_SOC_MCPWM_GPIO_SYNCHROS_PER_GROUP=3 +CONFIG_SOC_MMU_PERIPH_NUM=2 +CONFIG_SOC_MMU_LINEAR_ADDRESS_REGION_NUM=3 +CONFIG_SOC_MPU_MIN_REGION_SIZE=0x20000000 +CONFIG_SOC_MPU_REGIONS_MAX_NUM=8 +CONFIG_SOC_PCNT_GROUPS=1 +CONFIG_SOC_PCNT_UNITS_PER_GROUP=8 +CONFIG_SOC_PCNT_CHANNELS_PER_UNIT=2 +CONFIG_SOC_PCNT_THRES_POINT_PER_UNIT=2 +CONFIG_SOC_RMT_GROUPS=1 +CONFIG_SOC_RMT_TX_CANDIDATES_PER_GROUP=8 +CONFIG_SOC_RMT_RX_CANDIDATES_PER_GROUP=8 +CONFIG_SOC_RMT_CHANNELS_PER_GROUP=8 +CONFIG_SOC_RMT_MEM_WORDS_PER_CHANNEL=64 +CONFIG_SOC_RMT_SUPPORT_REF_TICK=y +CONFIG_SOC_RMT_SUPPORT_APB=y +CONFIG_SOC_RMT_CHANNEL_CLK_INDEPENDENT=y +CONFIG_SOC_RTCIO_PIN_COUNT=18 +CONFIG_SOC_RTCIO_INPUT_OUTPUT_SUPPORTED=y +CONFIG_SOC_RTCIO_HOLD_SUPPORTED=y +CONFIG_SOC_RTCIO_WAKE_SUPPORTED=y +CONFIG_SOC_SDM_GROUPS=1 +CONFIG_SOC_SDM_CHANNELS_PER_GROUP=8 +CONFIG_SOC_SDM_CLK_SUPPORT_APB=y +CONFIG_SOC_SPI_HD_BOTH_INOUT_SUPPORTED=y +CONFIG_SOC_SPI_AS_CS_SUPPORTED=y +CONFIG_SOC_SPI_PERIPH_NUM=3 +CONFIG_SOC_SPI_DMA_CHAN_NUM=2 +CONFIG_SOC_SPI_MAX_CS_NUM=3 +CONFIG_SOC_SPI_SUPPORT_CLK_APB=y +CONFIG_SOC_SPI_MAXIMUM_BUFFER_SIZE=64 +CONFIG_SOC_SPI_MAX_PRE_DIVIDER=8192 +CONFIG_SOC_MEMSPI_SRC_FREQ_80M_SUPPORTED=y +CONFIG_SOC_MEMSPI_SRC_FREQ_40M_SUPPORTED=y +CONFIG_SOC_MEMSPI_SRC_FREQ_26M_SUPPORTED=y +CONFIG_SOC_MEMSPI_SRC_FREQ_20M_SUPPORTED=y +CONFIG_SOC_TIMER_GROUPS=2 +CONFIG_SOC_TIMER_GROUP_TIMERS_PER_GROUP=2 +CONFIG_SOC_TIMER_GROUP_COUNTER_BIT_WIDTH=64 +CONFIG_SOC_TIMER_GROUP_TOTAL_TIMERS=4 +CONFIG_SOC_TIMER_GROUP_SUPPORT_APB=y +CONFIG_SOC_LP_TIMER_BIT_WIDTH_LO=32 +CONFIG_SOC_LP_TIMER_BIT_WIDTH_HI=16 +CONFIG_SOC_TOUCH_SENSOR_VERSION=1 +CONFIG_SOC_TOUCH_SENSOR_NUM=10 +CONFIG_SOC_TOUCH_MIN_CHAN_ID=0 +CONFIG_SOC_TOUCH_MAX_CHAN_ID=9 +CONFIG_SOC_TOUCH_SUPPORT_SLEEP_WAKEUP=y +CONFIG_SOC_TOUCH_SAMPLE_CFG_NUM=1 +CONFIG_SOC_TWAI_CONTROLLER_NUM=1 +CONFIG_SOC_TWAI_MASK_FILTER_NUM=1 +CONFIG_SOC_TWAI_BRP_MIN=2 +CONFIG_SOC_TWAI_CLK_SUPPORT_APB=y +CONFIG_SOC_TWAI_SUPPORT_MULTI_ADDRESS_LAYOUT=y +CONFIG_SOC_UART_NUM=3 +CONFIG_SOC_UART_HP_NUM=3 +CONFIG_SOC_UART_SUPPORT_APB_CLK=y +CONFIG_SOC_UART_SUPPORT_REF_TICK=y +CONFIG_SOC_UART_FIFO_LEN=128 +CONFIG_SOC_UART_BITRATE_MAX=5000000 +CONFIG_SOC_UART_WAKEUP_SUPPORT_ACTIVE_THRESH_MODE=y +CONFIG_SOC_SPIRAM_SUPPORTED=y +CONFIG_SOC_SPI_MEM_SUPPORT_CONFIG_GPIO_BY_EFUSE=y +CONFIG_SOC_SHA_SUPPORT_PARALLEL_ENG=y +CONFIG_SOC_SHA_ENDIANNESS_BE=y +CONFIG_SOC_SHA_SUPPORT_SHA1=y +CONFIG_SOC_SHA_SUPPORT_SHA256=y +CONFIG_SOC_SHA_SUPPORT_SHA384=y +CONFIG_SOC_SHA_SUPPORT_SHA512=y +CONFIG_SOC_MPI_MEM_BLOCKS_NUM=4 +CONFIG_SOC_MPI_OPERATIONS_NUM=1 +CONFIG_SOC_RSA_MAX_BIT_LEN=4096 +CONFIG_SOC_AES_SUPPORT_AES_128=y +CONFIG_SOC_AES_SUPPORT_AES_192=y +CONFIG_SOC_AES_SUPPORT_AES_256=y +CONFIG_SOC_SECURE_BOOT_V1=y +CONFIG_SOC_EFUSE_SECURE_BOOT_KEY_DIGESTS=1 +CONFIG_SOC_FLASH_ENCRYPTED_XTS_AES_BLOCK_MAX=32 +CONFIG_SOC_PHY_DIG_REGS_MEM_SIZE=21 +CONFIG_SOC_PM_SUPPORT_EXT0_WAKEUP=y +CONFIG_SOC_PM_SUPPORT_EXT1_WAKEUP=y +CONFIG_SOC_PM_SUPPORT_EXT_WAKEUP=y +CONFIG_SOC_PM_SUPPORT_TOUCH_SENSOR_WAKEUP=y +CONFIG_SOC_PM_SUPPORT_RTC_PERIPH_PD=y +CONFIG_SOC_PM_SUPPORT_RTC_FAST_MEM_PD=y +CONFIG_SOC_PM_SUPPORT_RTC_SLOW_MEM_PD=y +CONFIG_SOC_PM_SUPPORT_RC_FAST_PD=y +CONFIG_SOC_PM_SUPPORT_VDDSDIO_PD=y +CONFIG_SOC_PM_SUPPORT_MODEM_PD=y +CONFIG_SOC_CONFIGURABLE_VDDSDIO_SUPPORTED=y +CONFIG_SOC_PM_MODEM_PD_BY_SW=y +CONFIG_SOC_CLK_APLL_SUPPORTED=y +CONFIG_SOC_CLK_RC_FAST_D256_SUPPORTED=y +CONFIG_SOC_RTC_SLOW_CLK_SUPPORT_RC_FAST_D256=y +CONFIG_SOC_CLK_RC_FAST_SUPPORT_CALIBRATION=y +CONFIG_SOC_CLK_XTAL32K_SUPPORTED=y +CONFIG_SOC_CLK_LP_FAST_SUPPORT_XTAL_D4=y +CONFIG_SOC_SDMMC_USE_IOMUX=y +CONFIG_SOC_SDMMC_NUM_SLOTS=2 +CONFIG_SOC_WIFI_WAPI_SUPPORT=y +CONFIG_SOC_WIFI_CSI_SUPPORT=y +CONFIG_SOC_WIFI_MESH_SUPPORT=y +CONFIG_SOC_WIFI_SUPPORT_VARIABLE_BEACON_WINDOW=y +CONFIG_SOC_WIFI_NAN_SUPPORT=y +CONFIG_SOC_BLE_SUPPORTED=y +CONFIG_SOC_BLE_MESH_SUPPORTED=y +CONFIG_SOC_BT_CLASSIC_SUPPORTED=y +CONFIG_SOC_BLUFI_SUPPORTED=y +CONFIG_SOC_BT_H2C_ENC_KEY_CTRL_ENH_VSC_SUPPORTED=y +CONFIG_SOC_BLE_MULTI_CONN_OPTIMIZATION=y +CONFIG_SOC_ULP_HAS_ADC=y +CONFIG_SOC_PHY_COMBO_MODULE=y +CONFIG_SOC_EMAC_RMII_CLK_OUT_INTERNAL_LOOPBACK=y +CONFIG_IDF_CMAKE=y +CONFIG_IDF_TOOLCHAIN="gcc" +CONFIG_IDF_TOOLCHAIN_GCC=y +CONFIG_IDF_TARGET_ARCH_XTENSA=y +CONFIG_IDF_TARGET_ARCH="xtensa" +CONFIG_IDF_TARGET="esp32" +CONFIG_IDF_INIT_VERSION="5.5.1" +CONFIG_IDF_TARGET_ESP32=y +CONFIG_IDF_FIRMWARE_CHIP_ID=0x0000 + +# +# Build type +# +CONFIG_APP_BUILD_TYPE_APP_2NDBOOT=y +# CONFIG_APP_BUILD_TYPE_RAM is not set +CONFIG_APP_BUILD_GENERATE_BINARIES=y +CONFIG_APP_BUILD_BOOTLOADER=y +CONFIG_APP_BUILD_USE_FLASH_SECTIONS=y +# CONFIG_APP_REPRODUCIBLE_BUILD is not set +# CONFIG_APP_NO_BLOBS is not set +# CONFIG_APP_COMPATIBLE_PRE_V2_1_BOOTLOADERS is not set +# CONFIG_APP_COMPATIBLE_PRE_V3_1_BOOTLOADERS is not set +# end of Build type + +# +# Bootloader config +# + +# +# Bootloader manager +# +CONFIG_BOOTLOADER_COMPILE_TIME_DATE=y +CONFIG_BOOTLOADER_PROJECT_VER=1 +# end of Bootloader manager + +# +# Application Rollback +# +CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE=y +# CONFIG_BOOTLOADER_APP_ANTI_ROLLBACK is not set +# end of Application Rollback + +# +# Recovery Bootloader and Rollback +# +# end of Recovery Bootloader and Rollback + +CONFIG_BOOTLOADER_OFFSET_IN_FLASH=0x1000 +CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE=y +# CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_DEBUG is not set +# CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_PERF is not set +# CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_NONE is not set + +# +# Log +# +CONFIG_BOOTLOADER_LOG_VERSION_1=y +CONFIG_BOOTLOADER_LOG_VERSION=1 +# CONFIG_BOOTLOADER_LOG_LEVEL_NONE is not set +# CONFIG_BOOTLOADER_LOG_LEVEL_ERROR is not set +# CONFIG_BOOTLOADER_LOG_LEVEL_WARN is not set +CONFIG_BOOTLOADER_LOG_LEVEL_INFO=y +# CONFIG_BOOTLOADER_LOG_LEVEL_DEBUG is not set +# CONFIG_BOOTLOADER_LOG_LEVEL_VERBOSE is not set +CONFIG_BOOTLOADER_LOG_LEVEL=3 + +# +# Format +# +# CONFIG_BOOTLOADER_LOG_COLORS is not set +CONFIG_BOOTLOADER_LOG_TIMESTAMP_SOURCE_CPU_TICKS=y +# end of Format + +# +# Settings +# +CONFIG_BOOTLOADER_LOG_MODE_TEXT_EN=y +CONFIG_BOOTLOADER_LOG_MODE_TEXT=y +# end of Settings +# end of Log + +# +# Serial Flash Configurations +# +# CONFIG_BOOTLOADER_SPI_CUSTOM_WP_PIN is not set +CONFIG_BOOTLOADER_SPI_WP_PIN=7 +# CONFIG_BOOTLOADER_FLASH_DC_AWARE is not set +CONFIG_BOOTLOADER_FLASH_XMC_SUPPORT=y +# end of Serial Flash Configurations + +CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_9V=y +# CONFIG_BOOTLOADER_FACTORY_RESET is not set +# CONFIG_BOOTLOADER_APP_TEST is not set +CONFIG_BOOTLOADER_REGION_PROTECTION_ENABLE=y +CONFIG_BOOTLOADER_WDT_ENABLE=y +# CONFIG_BOOTLOADER_WDT_DISABLE_IN_USER_CODE is not set +CONFIG_BOOTLOADER_WDT_TIME_MS=9000 +# CONFIG_BOOTLOADER_SKIP_VALIDATE_IN_DEEP_SLEEP is not set +# CONFIG_BOOTLOADER_SKIP_VALIDATE_ON_POWER_ON is not set +# CONFIG_BOOTLOADER_SKIP_VALIDATE_ALWAYS is not set +CONFIG_BOOTLOADER_RESERVE_RTC_SIZE=0 +# CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC is not set +# end of Bootloader config + +# +# Security features +# +CONFIG_SECURE_BOOT_V1_SUPPORTED=y +# CONFIG_SECURE_SIGNED_APPS_NO_SECURE_BOOT is not set +# CONFIG_SECURE_BOOT is not set +# CONFIG_SECURE_FLASH_ENC_ENABLED is not set +# end of Security features + +# +# Application manager +# +CONFIG_APP_COMPILE_TIME_DATE=y +# CONFIG_APP_EXCLUDE_PROJECT_VER_VAR is not set +# CONFIG_APP_EXCLUDE_PROJECT_NAME_VAR is not set +# CONFIG_APP_PROJECT_VER_FROM_CONFIG is not set +CONFIG_APP_RETRIEVE_LEN_ELF_SHA=16 +# end of Application manager + +CONFIG_ESP_ROM_HAS_CRC_LE=y +CONFIG_ESP_ROM_HAS_CRC_BE=y +CONFIG_ESP_ROM_HAS_MZ_CRC32=y +CONFIG_ESP_ROM_HAS_JPEG_DECODE=y +CONFIG_ESP_ROM_HAS_UART_BUF_SWITCH=y +CONFIG_ESP_ROM_NEEDS_SWSETUP_WORKAROUND=y +CONFIG_ESP_ROM_HAS_NEWLIB=y +CONFIG_ESP_ROM_HAS_NEWLIB_NANO_FORMAT=y +CONFIG_ESP_ROM_HAS_NEWLIB_32BIT_TIME=y +CONFIG_ESP_ROM_HAS_SW_FLOAT=y +CONFIG_ESP_ROM_USB_OTG_NUM=-1 +CONFIG_ESP_ROM_USB_SERIAL_DEVICE_NUM=-1 +CONFIG_ESP_ROM_SUPPORT_DEEP_SLEEP_WAKEUP_STUB=y +CONFIG_ESP_ROM_HAS_OUTPUT_PUTC_FUNC=y + +# +# Serial flasher config +# +# CONFIG_ESPTOOLPY_NO_STUB is not set +CONFIG_ESPTOOLPY_FLASHMODE_QIO=y +# CONFIG_ESPTOOLPY_FLASHMODE_QOUT is not set +# CONFIG_ESPTOOLPY_FLASHMODE_DIO is not set +# CONFIG_ESPTOOLPY_FLASHMODE_DOUT is not set +CONFIG_ESPTOOLPY_FLASH_SAMPLE_MODE_STR=y +CONFIG_ESPTOOLPY_FLASHMODE="dio" +CONFIG_ESPTOOLPY_FLASHFREQ_80M=y +# CONFIG_ESPTOOLPY_FLASHFREQ_40M is not set +# CONFIG_ESPTOOLPY_FLASHFREQ_26M is not set +# CONFIG_ESPTOOLPY_FLASHFREQ_20M is not set +CONFIG_ESPTOOLPY_FLASHFREQ="80m" +# CONFIG_ESPTOOLPY_FLASHSIZE_1MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_2MB is not set +CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y +# CONFIG_ESPTOOLPY_FLASHSIZE_8MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_16MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_32MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_64MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_128MB is not set +CONFIG_ESPTOOLPY_FLASHSIZE="4MB" +# CONFIG_ESPTOOLPY_HEADER_FLASHSIZE_UPDATE is not set +CONFIG_ESPTOOLPY_BEFORE_RESET=y +# CONFIG_ESPTOOLPY_BEFORE_NORESET is not set +CONFIG_ESPTOOLPY_BEFORE="default_reset" +CONFIG_ESPTOOLPY_AFTER_RESET=y +# CONFIG_ESPTOOLPY_AFTER_NORESET is not set +CONFIG_ESPTOOLPY_AFTER="hard_reset" +CONFIG_ESPTOOLPY_MONITOR_BAUD=115200 +# end of Serial flasher config + +# +# Partition Table +# +# CONFIG_PARTITION_TABLE_SINGLE_APP is not set +# CONFIG_PARTITION_TABLE_SINGLE_APP_LARGE is not set +# CONFIG_PARTITION_TABLE_TWO_OTA is not set +# CONFIG_PARTITION_TABLE_TWO_OTA_LARGE is not set +CONFIG_PARTITION_TABLE_CUSTOM=y +CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv" +CONFIG_PARTITION_TABLE_FILENAME="partitions.csv" +CONFIG_PARTITION_TABLE_OFFSET=0x8000 +CONFIG_PARTITION_TABLE_MD5=y +# end of Partition Table + +# +# Snapclient Configuration +# +# CONFIG_SNAPSERVER_USE_MDNS is not set +# CONFIG_SNAPCLIENT_CONNECT_IPV6 is not set +CONFIG_SNAPSERVER_HOST="192.168.1.49" +CONFIG_SNAPSERVER_PORT=1704 +CONFIG_SNAPCLIENT_NAME="louder-esp32" + +# +# HTTP Server Setting +# +CONFIG_WEB_PORT=80 +# end of HTTP Server Setting + +CONFIG_USE_SAMPLE_INSERTION=y +# end of Snapclient Configuration + +# +# Audio Board +# +CONFIG_AUDIO_BOARD_CUSTOM=y +# CONFIG_ESP_LYRAT_V4_3_BOARD is not set +# CONFIG_ESP_LYRAT_V4_2_BOARD is not set +# CONFIG_ESP_LYRATD_MSC_V2_1_BOARD is not set +# CONFIG_ESP_LYRATD_MSC_V2_2_BOARD is not set +# CONFIG_ESP_LYRAT_MINI_V1_1_BOARD is not set +# CONFIG_ESP32_KORVO_DU1906_BOARD is not set +# CONFIG_ESP32_S2_KALUGA_1_V1_2_BOARD is not set +# CONFIG_ESP_AI_THINKER_ES8388_BOARD is not set + +# +# Custom Audio Board +# +# CONFIG_DAC_PCM51XX is not set +# CONFIG_DAC_PCM5102A is not set +# CONFIG_DAC_MA120 is not set +# CONFIG_DAC_MA120X0 is not set +# CONFIG_DAC_ADAU1961 is not set +# CONFIG_DAC_MAX98357 is not set +CONFIG_DAC_TAS5805M=y +# CONFIG_DAC_PT8211 is not set + +# +# DAC I2C control interface +# +CONFIG_DAC_I2C_SDA=21 +CONFIG_DAC_I2C_SCL=27 +CONFIG_DAC_I2C_ADDR=0x2d +# end of DAC I2C control interface + +# +# I2S master interface +# +CONFIG_MASTER_I2S_MCLK_PIN=0 +CONFIG_MASTER_I2S_BCK_PIN=26 +CONFIG_MASTER_I2S_LRCK_PIN=25 +CONFIG_MASTER_I2S_DATAOUT_PIN=22 +# end of I2S master interface + +# +# TAS5805M interface configuration +# +CONFIG_PIN_DAC_PWDN=33 +# end of TAS5805M interface configuration + +# +# TAS5805M DSP Support +# +# CONFIG_DAC_TAS5805M_EQ_SUPPORT is not set +# end of TAS5805M DSP Support + +# +# Logic-Level-Settings +# +# CONFIG_INVERT_MCLK_LEVEL is not set +# CONFIG_INVERT_WORD_SELECT_LEVEL is not set +# CONFIG_INVERT_BCLK_LEVEL is not set +# end of Logic-Level-Settings +# end of Custom Audio Board +# end of Audio Board + +# +# ESP32 DSP processor config +# +# CONFIG_USE_DSP_PROCESSOR is not set +# end of ESP32 DSP processor config + +# +# SNTP Configuration +# +CONFIG_SNTP_TIMEZONE="UTC" +CONFIG_SNTP_SERVER="pool.ntp.org" +# end of SNTP Configuration + +# +# Snapclient Ethernet Configuration +# +CONFIG_ENV_GPIO_RANGE_MIN=0 +CONFIG_ENV_GPIO_RANGE_MAX=39 +CONFIG_ENV_GPIO_IN_RANGE_MAX=39 +CONFIG_ENV_GPIO_OUT_RANGE_MAX=33 +# CONFIG_SNAPCLIENT_USE_INTERNAL_ETHERNET is not set +# CONFIG_SNAPCLIENT_USE_SPI_ETHERNET is not set +# end of Snapclient Ethernet Configuration + +# +# Wifi Configuration +# +CONFIG_ENABLE_WIFI_PROVISIONING=y +# CONFIG_WIFI_AUTH_WEP is not set +# CONFIG_WIFI_AUTH_WPA_PSK is not set +# CONFIG_WIFI_AUTH_WPA2_PSK is not set +# CONFIG_WIFI_AUTH_WPA_WPA2_PSK is not set +CONFIG_WIFI_AUTH_WPA2_WPA3_PSK=y +# CONFIG_WIFI_AUTH_ENTERPRISE is not set +# CONFIG_WIFI_AUTH_WPA2_ENTERPRISE is not set +# CONFIG_WIFI_AUTH_WPA3_PSK is not set +# CONFIG_WIFI_AUTH_WPA3_ENT_192 is not set +# CONFIG_WIFI_AUTH_WAPI_PSK is not set +# CONFIG_WIFI_AUTH_OWE is not set +CONFIG_WIFI_MAXIMUM_RETRY=0 +# end of Wifi Configuration + +# +# Compiler options +# +# CONFIG_COMPILER_OPTIMIZATION_DEBUG is not set +# CONFIG_COMPILER_OPTIMIZATION_SIZE is not set +CONFIG_COMPILER_OPTIMIZATION_PERF=y +# CONFIG_COMPILER_OPTIMIZATION_NONE is not set +CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE=y +# CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT is not set +# CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE is not set +CONFIG_COMPILER_ASSERT_NDEBUG_EVALUATE=y +CONFIG_COMPILER_FLOAT_LIB_FROM_GCCLIB=y +CONFIG_COMPILER_OPTIMIZATION_ASSERTION_LEVEL=2 +# CONFIG_COMPILER_OPTIMIZATION_CHECKS_SILENT is not set +CONFIG_COMPILER_HIDE_PATHS_MACROS=y +# CONFIG_COMPILER_CXX_EXCEPTIONS is not set +# CONFIG_COMPILER_CXX_RTTI is not set +CONFIG_COMPILER_STACK_CHECK_MODE_NONE=y +# CONFIG_COMPILER_STACK_CHECK_MODE_NORM is not set +# CONFIG_COMPILER_STACK_CHECK_MODE_STRONG is not set +# CONFIG_COMPILER_STACK_CHECK_MODE_ALL is not set +# CONFIG_COMPILER_NO_MERGE_CONSTANTS is not set +# CONFIG_COMPILER_WARN_WRITE_STRINGS is not set +CONFIG_COMPILER_DISABLE_DEFAULT_ERRORS=y +# CONFIG_COMPILER_DISABLE_GCC12_WARNINGS is not set +# CONFIG_COMPILER_DISABLE_GCC13_WARNINGS is not set +# CONFIG_COMPILER_DISABLE_GCC14_WARNINGS is not set +# CONFIG_COMPILER_DUMP_RTL_FILES is not set +CONFIG_COMPILER_RT_LIB_GCCLIB=y +CONFIG_COMPILER_RT_LIB_NAME="gcc" +CONFIG_COMPILER_ORPHAN_SECTIONS_WARNING=y +# CONFIG_COMPILER_ORPHAN_SECTIONS_PLACE is not set +# CONFIG_COMPILER_STATIC_ANALYZER is not set +# end of Compiler options + +# +# Component config +# + +# +# Application Level Tracing +# +# CONFIG_APPTRACE_DEST_JTAG is not set +CONFIG_APPTRACE_DEST_NONE=y +# CONFIG_APPTRACE_DEST_UART1 is not set +# CONFIG_APPTRACE_DEST_UART2 is not set +CONFIG_APPTRACE_DEST_UART_NONE=y +CONFIG_APPTRACE_UART_TASK_PRIO=1 +CONFIG_APPTRACE_LOCK_ENABLE=y +# end of Application Level Tracing + +# +# Bluetooth +# +# CONFIG_BT_ENABLED is not set + +# +# Common Options +# +# CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED is not set +# CONFIG_BT_BLE_LOG_UHCI_OUT_ENABLED is not set +# end of Common Options +# end of Bluetooth + +# +# Console Library +# +# CONFIG_CONSOLE_SORTED_HELP is not set +# end of Console Library + +# +# Driver Configurations +# + +# +# Legacy TWAI Driver Configurations +# +# CONFIG_TWAI_SKIP_LEGACY_CONFLICT_CHECK is not set +# CONFIG_TWAI_ERRATA_FIX_BUS_OFF_REC is not set +# CONFIG_TWAI_ERRATA_FIX_TX_INTR_LOST is not set +# CONFIG_TWAI_ERRATA_FIX_RX_FRAME_INVALID is not set +# CONFIG_TWAI_ERRATA_FIX_RX_FIFO_CORRUPT is not set +# CONFIG_TWAI_ERRATA_FIX_LISTEN_ONLY_DOM is not set +# end of Legacy TWAI Driver Configurations + +# +# Legacy ADC Driver Configuration +# +CONFIG_ADC_DISABLE_DAC=y +# CONFIG_ADC_SUPPRESS_DEPRECATE_WARN is not set +# CONFIG_ADC_SKIP_LEGACY_CONFLICT_CHECK is not set + +# +# Legacy ADC Calibration Configuration +# +CONFIG_ADC_CAL_EFUSE_TP_ENABLE=y +CONFIG_ADC_CAL_EFUSE_VREF_ENABLE=y +CONFIG_ADC_CAL_LUT_ENABLE=y +# CONFIG_ADC_CALI_SUPPRESS_DEPRECATE_WARN is not set +# end of Legacy ADC Calibration Configuration +# end of Legacy ADC Driver Configuration + +# +# Legacy DAC Driver Configurations +# +# CONFIG_DAC_SUPPRESS_DEPRECATE_WARN is not set +# CONFIG_DAC_SKIP_LEGACY_CONFLICT_CHECK is not set +# end of Legacy DAC Driver Configurations + +# +# Legacy MCPWM Driver Configurations +# +# CONFIG_MCPWM_SUPPRESS_DEPRECATE_WARN is not set +# CONFIG_MCPWM_SKIP_LEGACY_CONFLICT_CHECK is not set +# end of Legacy MCPWM Driver Configurations + +# +# Legacy Timer Group Driver Configurations +# +# CONFIG_GPTIMER_SUPPRESS_DEPRECATE_WARN is not set +# CONFIG_GPTIMER_SKIP_LEGACY_CONFLICT_CHECK is not set +# end of Legacy Timer Group Driver Configurations + +# +# Legacy RMT Driver Configurations +# +# CONFIG_RMT_SUPPRESS_DEPRECATE_WARN is not set +# CONFIG_RMT_SKIP_LEGACY_CONFLICT_CHECK is not set +# end of Legacy RMT Driver Configurations + +# +# Legacy I2S Driver Configurations +# +# CONFIG_I2S_SUPPRESS_DEPRECATE_WARN is not set +# CONFIG_I2S_SKIP_LEGACY_CONFLICT_CHECK is not set +# end of Legacy I2S Driver Configurations + +# +# Legacy I2C Driver Configurations +# +# CONFIG_I2C_SKIP_LEGACY_CONFLICT_CHECK is not set +# end of Legacy I2C Driver Configurations + +# +# Legacy PCNT Driver Configurations +# +# CONFIG_PCNT_SUPPRESS_DEPRECATE_WARN is not set +# CONFIG_PCNT_SKIP_LEGACY_CONFLICT_CHECK is not set +# end of Legacy PCNT Driver Configurations + +# +# Legacy SDM Driver Configurations +# +# CONFIG_SDM_SUPPRESS_DEPRECATE_WARN is not set +# CONFIG_SDM_SKIP_LEGACY_CONFLICT_CHECK is not set +# end of Legacy SDM Driver Configurations + +# +# Legacy Touch Sensor Driver Configurations +# +# CONFIG_TOUCH_SUPPRESS_DEPRECATE_WARN is not set +# CONFIG_TOUCH_SKIP_LEGACY_CONFLICT_CHECK is not set +# end of Legacy Touch Sensor Driver Configurations +# end of Driver Configurations + +# +# eFuse Bit Manager +# +# CONFIG_EFUSE_CUSTOM_TABLE is not set +# CONFIG_EFUSE_VIRTUAL is not set +# CONFIG_EFUSE_CODE_SCHEME_COMPAT_NONE is not set +CONFIG_EFUSE_CODE_SCHEME_COMPAT_3_4=y +# CONFIG_EFUSE_CODE_SCHEME_COMPAT_REPEAT is not set +CONFIG_EFUSE_MAX_BLK_LEN=192 +# end of eFuse Bit Manager + +# +# ESP-TLS +# +CONFIG_ESP_TLS_USING_MBEDTLS=y +# CONFIG_ESP_TLS_USE_SECURE_ELEMENT is not set +# CONFIG_ESP_TLS_CLIENT_SESSION_TICKETS is not set +# CONFIG_ESP_TLS_SERVER_SESSION_TICKETS is not set +# CONFIG_ESP_TLS_SERVER_CERT_SELECT_HOOK is not set +# CONFIG_ESP_TLS_SERVER_MIN_AUTH_MODE_OPTIONAL is not set +# CONFIG_ESP_TLS_PSK_VERIFICATION is not set +# CONFIG_ESP_TLS_INSECURE is not set +CONFIG_ESP_TLS_DYN_BUF_STRATEGY_SUPPORTED=y +# end of ESP-TLS + +# +# ADC and ADC Calibration +# +# CONFIG_ADC_ONESHOT_CTRL_FUNC_IN_IRAM is not set +# CONFIG_ADC_CONTINUOUS_ISR_IRAM_SAFE is not set + +# +# ADC Calibration Configurations +# +CONFIG_ADC_CALI_EFUSE_TP_ENABLE=y +CONFIG_ADC_CALI_EFUSE_VREF_ENABLE=y +CONFIG_ADC_CALI_LUT_ENABLE=y +# end of ADC Calibration Configurations + +CONFIG_ADC_DISABLE_DAC_OUTPUT=y +# CONFIG_ADC_ENABLE_DEBUG_LOG is not set +# end of ADC and ADC Calibration + +# +# Wireless Coexistence +# +CONFIG_ESP_COEX_ENABLED=y +# CONFIG_ESP_COEX_GPIO_DEBUG is not set +# end of Wireless Coexistence + +# +# Common ESP-related +# +CONFIG_ESP_ERR_TO_NAME_LOOKUP=y +# end of Common ESP-related + +# +# ESP-Driver:DAC Configurations +# +# CONFIG_DAC_CTRL_FUNC_IN_IRAM is not set +# CONFIG_DAC_ISR_IRAM_SAFE is not set +# CONFIG_DAC_ENABLE_DEBUG_LOG is not set +CONFIG_DAC_DMA_AUTO_16BIT_ALIGN=y +# end of ESP-Driver:DAC Configurations + +# +# ESP-Driver:GPIO Configurations +# +# CONFIG_GPIO_ESP32_SUPPORT_SWITCH_SLP_PULL is not set +# CONFIG_GPIO_CTRL_FUNC_IN_IRAM is not set +# end of ESP-Driver:GPIO Configurations + +# +# ESP-Driver:GPTimer Configurations +# +CONFIG_GPTIMER_ISR_HANDLER_IN_IRAM=y +# CONFIG_GPTIMER_CTRL_FUNC_IN_IRAM is not set +# CONFIG_GPTIMER_ISR_CACHE_SAFE is not set +CONFIG_GPTIMER_OBJ_CACHE_SAFE=y +# CONFIG_GPTIMER_ENABLE_DEBUG_LOG is not set +# end of ESP-Driver:GPTimer Configurations + +# +# ESP-Driver:I2C Configurations +# +# CONFIG_I2C_ISR_IRAM_SAFE is not set +# CONFIG_I2C_ENABLE_DEBUG_LOG is not set +# CONFIG_I2C_ENABLE_SLAVE_DRIVER_VERSION_2 is not set +CONFIG_I2C_MASTER_ISR_HANDLER_IN_IRAM=y +# end of ESP-Driver:I2C Configurations + +# +# ESP-Driver:I2S Configurations +# +# CONFIG_I2S_ISR_IRAM_SAFE is not set +# CONFIG_I2S_ENABLE_DEBUG_LOG is not set +# end of ESP-Driver:I2S Configurations + +# +# ESP-Driver:LEDC Configurations +# +# CONFIG_LEDC_CTRL_FUNC_IN_IRAM is not set +# end of ESP-Driver:LEDC Configurations + +# +# ESP-Driver:MCPWM Configurations +# +CONFIG_MCPWM_ISR_HANDLER_IN_IRAM=y +# CONFIG_MCPWM_ISR_CACHE_SAFE is not set +# CONFIG_MCPWM_CTRL_FUNC_IN_IRAM is not set +CONFIG_MCPWM_OBJ_CACHE_SAFE=y +# CONFIG_MCPWM_ENABLE_DEBUG_LOG is not set +# end of ESP-Driver:MCPWM Configurations + +# +# ESP-Driver:PCNT Configurations +# +# CONFIG_PCNT_CTRL_FUNC_IN_IRAM is not set +# CONFIG_PCNT_ISR_IRAM_SAFE is not set +# CONFIG_PCNT_ENABLE_DEBUG_LOG is not set +# end of ESP-Driver:PCNT Configurations + +# +# ESP-Driver:RMT Configurations +# +CONFIG_RMT_ENCODER_FUNC_IN_IRAM=y +CONFIG_RMT_TX_ISR_HANDLER_IN_IRAM=y +CONFIG_RMT_RX_ISR_HANDLER_IN_IRAM=y +# CONFIG_RMT_RECV_FUNC_IN_IRAM is not set +# CONFIG_RMT_TX_ISR_CACHE_SAFE is not set +# CONFIG_RMT_RX_ISR_CACHE_SAFE is not set +CONFIG_RMT_OBJ_CACHE_SAFE=y +# CONFIG_RMT_ENABLE_DEBUG_LOG is not set +# CONFIG_RMT_ISR_IRAM_SAFE is not set +# end of ESP-Driver:RMT Configurations + +# +# ESP-Driver:Sigma Delta Modulator Configurations +# +# CONFIG_SDM_CTRL_FUNC_IN_IRAM is not set +# CONFIG_SDM_ENABLE_DEBUG_LOG is not set +# end of ESP-Driver:Sigma Delta Modulator Configurations + +# +# ESP-Driver:SPI Configurations +# +CONFIG_SPI_MASTER_ISR_IN_IRAM=y +# CONFIG_SPI_SLAVE_IN_IRAM is not set +# CONFIG_SPI_SLAVE_ISR_IN_IRAM is not set +# end of ESP-Driver:SPI Configurations + +# +# ESP-Driver:Touch Sensor Configurations +# +# CONFIG_TOUCH_CTRL_FUNC_IN_IRAM is not set +# CONFIG_TOUCH_ISR_IRAM_SAFE is not set +# CONFIG_TOUCH_ENABLE_DEBUG_LOG is not set +# CONFIG_TOUCH_SKIP_FSM_CHECK is not set +# end of ESP-Driver:Touch Sensor Configurations + +# +# ESP-Driver:TWAI Configurations +# +# CONFIG_TWAI_ISR_IN_IRAM is not set +# CONFIG_TWAI_ISR_CACHE_SAFE is not set +# CONFIG_TWAI_ENABLE_DEBUG_LOG is not set +# end of ESP-Driver:TWAI Configurations + +# +# ESP-Driver:UART Configurations +# +# CONFIG_UART_ISR_IN_IRAM is not set +# end of ESP-Driver:UART Configurations + +# +# ESP-Driver:UHCI Configurations +# +# CONFIG_UHCI_ISR_HANDLER_IN_IRAM is not set +# CONFIG_UHCI_ISR_CACHE_SAFE is not set +# CONFIG_UHCI_ENABLE_DEBUG_LOG is not set +# end of ESP-Driver:UHCI Configurations + +# +# Ethernet +# +CONFIG_ETH_ENABLED=y +CONFIG_ETH_USE_ESP32_EMAC=y +CONFIG_ETH_PHY_INTERFACE_RMII=y +CONFIG_ETH_RMII_CLK_INPUT=y +# CONFIG_ETH_RMII_CLK_OUTPUT is not set +CONFIG_ETH_RMII_CLK_IN_GPIO=0 +CONFIG_ETH_DMA_BUFFER_SIZE=1024 +CONFIG_ETH_DMA_RX_BUFFER_NUM=30 +CONFIG_ETH_DMA_TX_BUFFER_NUM=5 +# CONFIG_ETH_SOFT_FLOW_CONTROL is not set +# CONFIG_ETH_IRAM_OPTIMIZATION is not set +# CONFIG_ETH_USE_SPI_ETHERNET is not set +# CONFIG_ETH_USE_OPENETH is not set +# CONFIG_ETH_TRANSMIT_MUTEX is not set +# end of Ethernet + +# +# Event Loop Library +# +# CONFIG_ESP_EVENT_LOOP_PROFILING is not set +CONFIG_ESP_EVENT_POST_FROM_ISR=y +# CONFIG_ESP_EVENT_POST_FROM_IRAM_ISR is not set +# end of Event Loop Library + +# +# GDB Stub +# +CONFIG_ESP_GDBSTUB_ENABLED=y +# CONFIG_ESP_SYSTEM_GDBSTUB_RUNTIME is not set +CONFIG_ESP_GDBSTUB_SUPPORT_TASKS=y +CONFIG_ESP_GDBSTUB_MAX_TASKS=32 +# end of GDB Stub + +# +# ESP HID +# +CONFIG_ESPHID_TASK_SIZE_BT=2048 +CONFIG_ESPHID_TASK_SIZE_BLE=4096 +# end of ESP HID + +# +# ESP HTTP client +# +CONFIG_ESP_HTTP_CLIENT_ENABLE_HTTPS=y +# CONFIG_ESP_HTTP_CLIENT_ENABLE_BASIC_AUTH is not set +# CONFIG_ESP_HTTP_CLIENT_ENABLE_DIGEST_AUTH is not set +# CONFIG_ESP_HTTP_CLIENT_ENABLE_CUSTOM_TRANSPORT is not set +CONFIG_ESP_HTTP_CLIENT_EVENT_POST_TIMEOUT=2000 +# end of ESP HTTP client + +# +# HTTP Server +# +CONFIG_HTTPD_MAX_REQ_HDR_LEN=1024 +CONFIG_HTTPD_MAX_URI_LEN=512 +CONFIG_HTTPD_ERR_RESP_NO_DELAY=y +CONFIG_HTTPD_PURGE_BUF_LEN=32 +# CONFIG_HTTPD_LOG_PURGE_DATA is not set +# CONFIG_HTTPD_WS_SUPPORT is not set +# CONFIG_HTTPD_QUEUE_WORK_BLOCKING is not set +CONFIG_HTTPD_SERVER_EVENT_POST_TIMEOUT=2000 +# end of HTTP Server + +# +# ESP HTTPS OTA +# +# CONFIG_ESP_HTTPS_OTA_DECRYPT_CB is not set +# CONFIG_ESP_HTTPS_OTA_ALLOW_HTTP is not set +CONFIG_ESP_HTTPS_OTA_EVENT_POST_TIMEOUT=2000 +# end of ESP HTTPS OTA + +# +# ESP HTTPS server +# +# CONFIG_ESP_HTTPS_SERVER_ENABLE is not set +CONFIG_ESP_HTTPS_SERVER_EVENT_POST_TIMEOUT=2000 +# CONFIG_ESP_HTTPS_SERVER_CERT_SELECT_HOOK is not set +# end of ESP HTTPS server + +# +# Hardware Settings +# + +# +# Chip revision +# +CONFIG_ESP32_REV_MIN_0=y +# CONFIG_ESP32_REV_MIN_1 is not set +# CONFIG_ESP32_REV_MIN_1_1 is not set +# CONFIG_ESP32_REV_MIN_2 is not set +# CONFIG_ESP32_REV_MIN_3 is not set +# CONFIG_ESP32_REV_MIN_3_1 is not set +CONFIG_ESP32_REV_MIN=0 +CONFIG_ESP32_REV_MIN_FULL=0 +CONFIG_ESP_REV_MIN_FULL=0 + +# +# Maximum Supported ESP32 Revision (Rev v3.99) +# +CONFIG_ESP32_REV_MAX_FULL=399 +CONFIG_ESP_REV_MAX_FULL=399 +CONFIG_ESP_EFUSE_BLOCK_REV_MIN_FULL=0 +CONFIG_ESP_EFUSE_BLOCK_REV_MAX_FULL=99 + +# +# Maximum Supported ESP32 eFuse Block Revision (eFuse Block Rev v0.99) +# +# end of Chip revision + +# +# MAC Config +# +CONFIG_ESP_MAC_ADDR_UNIVERSE_WIFI_STA=y +CONFIG_ESP_MAC_ADDR_UNIVERSE_WIFI_AP=y +CONFIG_ESP_MAC_ADDR_UNIVERSE_BT=y +CONFIG_ESP_MAC_ADDR_UNIVERSE_ETH=y +CONFIG_ESP_MAC_UNIVERSAL_MAC_ADDRESSES_FOUR=y +CONFIG_ESP_MAC_UNIVERSAL_MAC_ADDRESSES=4 +# CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES_TWO is not set +CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES_FOUR=y +CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES=4 +# CONFIG_ESP_MAC_IGNORE_MAC_CRC_ERROR is not set +# CONFIG_ESP_MAC_USE_CUSTOM_MAC_AS_BASE_MAC is not set +# end of MAC Config + +# +# Sleep Config +# +CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND=y +CONFIG_ESP_SLEEP_PSRAM_LEAKAGE_WORKAROUND=y +# CONFIG_ESP_SLEEP_MSPI_NEED_ALL_IO_PU is not set +CONFIG_ESP_SLEEP_RTC_BUS_ISO_WORKAROUND=y +# CONFIG_ESP_SLEEP_GPIO_RESET_WORKAROUND is not set +CONFIG_ESP_SLEEP_WAIT_FLASH_READY_EXTRA_DELAY=2000 +# CONFIG_ESP_SLEEP_CACHE_SAFE_ASSERTION is not set +# CONFIG_ESP_SLEEP_DEBUG is not set +CONFIG_ESP_SLEEP_GPIO_ENABLE_INTERNAL_RESISTORS=y +# end of Sleep Config + +# +# RTC Clock Config +# +CONFIG_RTC_CLK_SRC_INT_RC=y +# CONFIG_RTC_CLK_SRC_EXT_CRYS is not set +# CONFIG_RTC_CLK_SRC_EXT_OSC is not set +# CONFIG_RTC_CLK_SRC_INT_8MD256 is not set +CONFIG_RTC_CLK_CAL_CYCLES=1024 +# end of RTC Clock Config + +# +# Peripheral Control +# +CONFIG_ESP_PERIPH_CTRL_FUNC_IN_IRAM=y +CONFIG_ESP_REGI2C_CTRL_FUNC_IN_IRAM=y +# end of Peripheral Control + +# +# Main XTAL Config +# +# CONFIG_XTAL_FREQ_26 is not set +# CONFIG_XTAL_FREQ_32 is not set +CONFIG_XTAL_FREQ_40=y +# CONFIG_XTAL_FREQ_AUTO is not set +CONFIG_XTAL_FREQ=40 +# end of Main XTAL Config + +# +# Power Supplier +# + +# +# Brownout Detector +# +CONFIG_ESP_BROWNOUT_DET=y +# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_0 is not set +# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_1 is not set +# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_2 is not set +# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_3 is not set +CONFIG_ESP_BROWNOUT_DET_LVL_SEL_4=y +# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_5 is not set +# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_6 is not set +# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_7 is not set +CONFIG_ESP_BROWNOUT_DET_LVL=4 +CONFIG_ESP_BROWNOUT_USE_INTR=y +# end of Brownout Detector +# end of Power Supplier + +CONFIG_ESP_SPI_BUS_LOCK_ISR_FUNCS_IN_IRAM=y +CONFIG_ESP_INTR_IN_IRAM=y +# end of Hardware Settings + +# +# ESP-Driver:LCD Controller Configurations +# +# CONFIG_LCD_ENABLE_DEBUG_LOG is not set +# end of ESP-Driver:LCD Controller Configurations + +# +# ESP-MM: Memory Management Configurations +# +# end of ESP-MM: Memory Management Configurations + +# +# ESP NETIF Adapter +# +CONFIG_ESP_NETIF_IP_LOST_TIMER_INTERVAL=120 +# CONFIG_ESP_NETIF_PROVIDE_CUSTOM_IMPLEMENTATION is not set +CONFIG_ESP_NETIF_TCPIP_LWIP=y +# CONFIG_ESP_NETIF_LOOPBACK is not set +CONFIG_ESP_NETIF_USES_TCPIP_WITH_BSD_API=y +CONFIG_ESP_NETIF_REPORT_DATA_TRAFFIC=y +# CONFIG_ESP_NETIF_RECEIVE_REPORT_ERRORS is not set +# CONFIG_ESP_NETIF_L2_TAP is not set +# CONFIG_ESP_NETIF_BRIDGE_EN is not set +# CONFIG_ESP_NETIF_SET_DNS_PER_DEFAULT_NETIF is not set +# end of ESP NETIF Adapter + +# +# Partition API Configuration +# +# end of Partition API Configuration + +# +# PHY +# +CONFIG_ESP_PHY_ENABLED=y +CONFIG_ESP_PHY_CALIBRATION_AND_DATA_STORAGE=y +# CONFIG_ESP_PHY_INIT_DATA_IN_PARTITION is not set +CONFIG_ESP_PHY_MAX_WIFI_TX_POWER=20 +CONFIG_ESP_PHY_MAX_TX_POWER=20 +CONFIG_ESP_PHY_REDUCE_TX_POWER=y +# CONFIG_ESP_PHY_ENABLE_CERT_TEST is not set +CONFIG_ESP_PHY_RF_CAL_PARTIAL=y +# CONFIG_ESP_PHY_RF_CAL_NONE is not set +# CONFIG_ESP_PHY_RF_CAL_FULL is not set +CONFIG_ESP_PHY_CALIBRATION_MODE=0 +CONFIG_ESP_PHY_PLL_TRACK_PERIOD_MS=1000 +# CONFIG_ESP_PHY_PLL_TRACK_DEBUG is not set +# CONFIG_ESP_PHY_RECORD_USED_TIME is not set +CONFIG_ESP_PHY_IRAM_OPT=y +# CONFIG_ESP_PHY_DEBUG is not set +# end of PHY + +# +# Power Management +# +CONFIG_PM_SLEEP_FUNC_IN_IRAM=y +# CONFIG_PM_ENABLE is not set +CONFIG_PM_SLP_IRAM_OPT=y +# end of Power Management + +# +# ESP PSRAM +# +CONFIG_SPIRAM=y + +# +# SPI RAM config +# +CONFIG_SPIRAM_MODE_QUAD=y +CONFIG_SPIRAM_TYPE_AUTO=y +# CONFIG_SPIRAM_TYPE_ESPPSRAM16 is not set +# CONFIG_SPIRAM_TYPE_ESPPSRAM32 is not set +# CONFIG_SPIRAM_TYPE_ESPPSRAM64 is not set +# CONFIG_SPIRAM_SPEED_40M is not set +CONFIG_SPIRAM_SPEED_80M=y +CONFIG_SPIRAM_SPEED=80 +CONFIG_SPIRAM_BOOT_HW_INIT=y +CONFIG_SPIRAM_BOOT_INIT=y +CONFIG_SPIRAM_PRE_CONFIGURE_MEMORY_PROTECTION=y +# CONFIG_SPIRAM_IGNORE_NOTFOUND is not set +# CONFIG_SPIRAM_USE_MEMMAP is not set +# CONFIG_SPIRAM_USE_CAPS_ALLOC is not set +CONFIG_SPIRAM_USE_MALLOC=y +CONFIG_SPIRAM_MEMTEST=y +CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=16384 +# CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP is not set +CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=32768 +# CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set +# CONFIG_SPIRAM_ALLOW_NOINIT_SEG_EXTERNAL_MEMORY is not set +CONFIG_SPIRAM_CACHE_WORKAROUND=y + +# +# SPIRAM cache workaround debugging +# +CONFIG_SPIRAM_CACHE_WORKAROUND_STRATEGY_MEMW=y +# CONFIG_SPIRAM_CACHE_WORKAROUND_STRATEGY_DUPLDST is not set +# CONFIG_SPIRAM_CACHE_WORKAROUND_STRATEGY_NOPS is not set +# end of SPIRAM cache workaround debugging + +# +# SPIRAM workaround libraries placement +# +CONFIG_SPIRAM_CACHE_LIBJMP_IN_IRAM=y +CONFIG_SPIRAM_CACHE_LIBMATH_IN_IRAM=y +CONFIG_SPIRAM_CACHE_LIBNUMPARSER_IN_IRAM=y +CONFIG_SPIRAM_CACHE_LIBIO_IN_IRAM=y +CONFIG_SPIRAM_CACHE_LIBTIME_IN_IRAM=y +CONFIG_SPIRAM_CACHE_LIBCHAR_IN_IRAM=y +CONFIG_SPIRAM_CACHE_LIBMEM_IN_IRAM=y +CONFIG_SPIRAM_CACHE_LIBSTR_IN_IRAM=y +CONFIG_SPIRAM_CACHE_LIBRAND_IN_IRAM=y +CONFIG_SPIRAM_CACHE_LIBENV_IN_IRAM=y +CONFIG_SPIRAM_CACHE_LIBFILE_IN_IRAM=y +CONFIG_SPIRAM_CACHE_LIBMISC_IN_IRAM=y +# end of SPIRAM workaround libraries placement + +CONFIG_SPIRAM_BANKSWITCH_ENABLE=y +CONFIG_SPIRAM_BANKSWITCH_RESERVE=8 +# CONFIG_SPIRAM_OCCUPY_HSPI_HOST is not set +CONFIG_SPIRAM_OCCUPY_VSPI_HOST=y +# CONFIG_SPIRAM_OCCUPY_NO_HOST is not set + +# +# PSRAM clock and cs IO for ESP32-DOWD +# +CONFIG_D0WD_PSRAM_CLK_IO=17 +CONFIG_D0WD_PSRAM_CS_IO=16 +# end of PSRAM clock and cs IO for ESP32-DOWD + +# +# PSRAM clock and cs IO for ESP32-D2WD +# +CONFIG_D2WD_PSRAM_CLK_IO=9 +CONFIG_D2WD_PSRAM_CS_IO=10 +# end of PSRAM clock and cs IO for ESP32-D2WD + +# +# PSRAM clock and cs IO for ESP32-PICO-D4 +# +CONFIG_PICO_PSRAM_CS_IO=10 +# end of PSRAM clock and cs IO for ESP32-PICO-D4 + +# CONFIG_SPIRAM_2T_MODE is not set +# end of SPI RAM config +# end of ESP PSRAM + +# +# ESP Ringbuf +# +# CONFIG_RINGBUF_PLACE_FUNCTIONS_INTO_FLASH is not set +# end of ESP Ringbuf + +# +# ESP-ROM +# +CONFIG_ESP_ROM_PRINT_IN_IRAM=y +# end of ESP-ROM + +# +# ESP Security Specific +# +# end of ESP Security Specific + +# +# ESP System Settings +# +# CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_80 is not set +# CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_160 is not set +CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y +CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ=240 + +# +# Memory +# +# CONFIG_ESP32_USE_FIXED_STATIC_RAM_SIZE is not set + +# +# Non-backward compatible options +# +# CONFIG_ESP_SYSTEM_ESP32_SRAM1_REGION_AS_IRAM is not set +# end of Non-backward compatible options +# end of Memory + +# +# Trace memory +# +# CONFIG_ESP32_TRAX is not set +CONFIG_ESP32_TRACEMEM_RESERVE_DRAM=0x0 +# end of Trace memory + +CONFIG_ESP_SYSTEM_IN_IRAM=y +# CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT is not set +CONFIG_ESP_SYSTEM_PANIC_PRINT_REBOOT=y +# CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT is not set +# CONFIG_ESP_SYSTEM_PANIC_GDBSTUB is not set +CONFIG_ESP_SYSTEM_PANIC_REBOOT_DELAY_SECONDS=0 + +# +# Memory protection +# +# end of Memory protection + +CONFIG_ESP_SYSTEM_EVENT_QUEUE_SIZE=32 +CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=2304 +CONFIG_ESP_MAIN_TASK_STACK_SIZE=2560 +CONFIG_ESP_MAIN_TASK_AFFINITY_CPU0=y +# CONFIG_ESP_MAIN_TASK_AFFINITY_CPU1 is not set +# CONFIG_ESP_MAIN_TASK_AFFINITY_NO_AFFINITY is not set +CONFIG_ESP_MAIN_TASK_AFFINITY=0x0 +CONFIG_ESP_MINIMAL_SHARED_STACK_SIZE=2048 +CONFIG_ESP_CONSOLE_UART_DEFAULT=y +# CONFIG_ESP_CONSOLE_UART_CUSTOM is not set +# CONFIG_ESP_CONSOLE_NONE is not set +CONFIG_ESP_CONSOLE_UART=y +CONFIG_ESP_CONSOLE_UART_NUM=0 +CONFIG_ESP_CONSOLE_ROM_SERIAL_PORT_NUM=0 +CONFIG_ESP_CONSOLE_UART_BAUDRATE=115200 +CONFIG_ESP_INT_WDT=y +CONFIG_ESP_INT_WDT_TIMEOUT_MS=300 +CONFIG_ESP_INT_WDT_CHECK_CPU1=y +CONFIG_ESP_TASK_WDT_EN=y +CONFIG_ESP_TASK_WDT_INIT=y +# CONFIG_ESP_TASK_WDT_PANIC is not set +CONFIG_ESP_TASK_WDT_TIMEOUT_S=5 +CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0=y +CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU1=y +# CONFIG_ESP_PANIC_HANDLER_IRAM is not set +# CONFIG_ESP_DEBUG_STUBS_ENABLE is not set +CONFIG_ESP_DEBUG_OCDAWARE=y +# CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_5 is not set +CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_4=y +# CONFIG_ESP32_DISABLE_BASIC_ROM_CONSOLE is not set +CONFIG_ESP32_ECO3_CACHE_LOCK_FIX=y +# end of ESP System Settings + +# +# IPC (Inter-Processor Call) +# +CONFIG_ESP_IPC_ENABLE=y +CONFIG_ESP_IPC_TASK_STACK_SIZE=1024 +CONFIG_ESP_IPC_USES_CALLERS_PRIORITY=y +CONFIG_ESP_IPC_ISR_ENABLE=y +# end of IPC (Inter-Processor Call) + +# +# ESP Timer (High Resolution Timer) +# +CONFIG_ESP_TIMER_IN_IRAM=y +# CONFIG_ESP_TIMER_PROFILING is not set +CONFIG_ESP_TIME_FUNCS_USE_RTC_TIMER=y +CONFIG_ESP_TIME_FUNCS_USE_ESP_TIMER=y +CONFIG_ESP_TIMER_TASK_STACK_SIZE=2048 +CONFIG_ESP_TIMER_INTERRUPT_LEVEL=1 +# CONFIG_ESP_TIMER_SHOW_EXPERIMENTAL is not set +CONFIG_ESP_TIMER_TASK_AFFINITY=0x0 +CONFIG_ESP_TIMER_TASK_AFFINITY_CPU0=y +CONFIG_ESP_TIMER_ISR_AFFINITY_CPU0=y +# CONFIG_ESP_TIMER_SUPPORTS_ISR_DISPATCH_METHOD is not set +CONFIG_ESP_TIMER_IMPL_TG0_LAC=y +# end of ESP Timer (High Resolution Timer) + +# +# Wi-Fi +# +CONFIG_ESP_WIFI_ENABLED=y +CONFIG_ESP_WIFI_STATIC_RX_BUFFER_NUM=8 +CONFIG_ESP_WIFI_DYNAMIC_RX_BUFFER_NUM=64 +CONFIG_ESP_WIFI_STATIC_TX_BUFFER=y +# CONFIG_ESP_WIFI_DYNAMIC_TX_BUFFER is not set +CONFIG_ESP_WIFI_TX_BUFFER_TYPE=0 +CONFIG_ESP_WIFI_STATIC_TX_BUFFER_NUM=8 +CONFIG_ESP_WIFI_STATIC_RX_MGMT_BUFFER=y +# CONFIG_ESP_WIFI_DYNAMIC_RX_MGMT_BUFFER is not set +CONFIG_ESP_WIFI_DYNAMIC_RX_MGMT_BUF=0 +CONFIG_ESP_WIFI_RX_MGMT_BUF_NUM_DEF=5 +# CONFIG_ESP_WIFI_CSI_ENABLED is not set +CONFIG_ESP_WIFI_AMPDU_TX_ENABLED=y +CONFIG_ESP_WIFI_TX_BA_WIN=8 +CONFIG_ESP_WIFI_AMPDU_RX_ENABLED=y +CONFIG_ESP_WIFI_RX_BA_WIN=16 +CONFIG_ESP_WIFI_NVS_ENABLED=y +CONFIG_ESP_WIFI_TASK_PINNED_TO_CORE_0=y +# CONFIG_ESP_WIFI_TASK_PINNED_TO_CORE_1 is not set +CONFIG_ESP_WIFI_SOFTAP_BEACON_MAX_LEN=752 +CONFIG_ESP_WIFI_MGMT_SBUF_NUM=32 +# CONFIG_ESP_WIFI_IRAM_OPT is not set +# CONFIG_ESP_WIFI_EXTRA_IRAM_OPT is not set +CONFIG_ESP_WIFI_RX_IRAM_OPT=y +CONFIG_ESP_WIFI_ENABLE_WPA3_SAE=y +CONFIG_ESP_WIFI_ENABLE_SAE_PK=y +CONFIG_ESP_WIFI_ENABLE_SAE_H2E=y +CONFIG_ESP_WIFI_SOFTAP_SAE_SUPPORT=y +CONFIG_ESP_WIFI_ENABLE_WPA3_OWE_STA=y +# CONFIG_ESP_WIFI_SLP_IRAM_OPT is not set +CONFIG_ESP_WIFI_SLP_DEFAULT_MIN_ACTIVE_TIME=50 +# CONFIG_ESP_WIFI_BSS_MAX_IDLE_SUPPORT is not set +CONFIG_ESP_WIFI_SLP_DEFAULT_MAX_ACTIVE_TIME=10 +CONFIG_ESP_WIFI_SLP_DEFAULT_WAIT_BROADCAST_DATA_TIME=15 +# CONFIG_ESP_WIFI_STA_DISCONNECTED_PM_ENABLE is not set +# CONFIG_ESP_WIFI_GMAC_SUPPORT is not set +CONFIG_ESP_WIFI_SOFTAP_SUPPORT=y +# CONFIG_ESP_WIFI_SLP_BEACON_LOST_OPT is not set +CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM=7 +# CONFIG_ESP_WIFI_NAN_ENABLE is not set +CONFIG_ESP_WIFI_MBEDTLS_CRYPTO=y +CONFIG_ESP_WIFI_MBEDTLS_TLS_CLIENT=y +# CONFIG_ESP_WIFI_WAPI_PSK is not set +# CONFIG_ESP_WIFI_11KV_SUPPORT is not set +# CONFIG_ESP_WIFI_MBO_SUPPORT is not set +# CONFIG_ESP_WIFI_DPP_SUPPORT is not set +# CONFIG_ESP_WIFI_11R_SUPPORT is not set +# CONFIG_ESP_WIFI_WPS_SOFTAP_REGISTRAR is not set + +# +# WPS Configuration Options +# +# CONFIG_ESP_WIFI_WPS_STRICT is not set +# CONFIG_ESP_WIFI_WPS_PASSPHRASE is not set +# end of WPS Configuration Options + +# CONFIG_ESP_WIFI_DEBUG_PRINT is not set +# CONFIG_ESP_WIFI_TESTING_OPTIONS is not set +CONFIG_ESP_WIFI_ENTERPRISE_SUPPORT=y +# CONFIG_ESP_WIFI_ENT_FREE_DYNAMIC_BUFFER is not set +# end of Wi-Fi + +# +# Core dump +# +# CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH is not set +# CONFIG_ESP_COREDUMP_ENABLE_TO_UART is not set +CONFIG_ESP_COREDUMP_ENABLE_TO_NONE=y +# end of Core dump + +# +# FAT Filesystem support +# +CONFIG_FATFS_VOLUME_COUNT=2 +CONFIG_FATFS_LFN_NONE=y +# CONFIG_FATFS_LFN_HEAP is not set +# CONFIG_FATFS_LFN_STACK is not set +# CONFIG_FATFS_SECTOR_512 is not set +CONFIG_FATFS_SECTOR_4096=y +# CONFIG_FATFS_CODEPAGE_DYNAMIC is not set +CONFIG_FATFS_CODEPAGE_437=y +# CONFIG_FATFS_CODEPAGE_720 is not set +# CONFIG_FATFS_CODEPAGE_737 is not set +# CONFIG_FATFS_CODEPAGE_771 is not set +# CONFIG_FATFS_CODEPAGE_775 is not set +# CONFIG_FATFS_CODEPAGE_850 is not set +# CONFIG_FATFS_CODEPAGE_852 is not set +# CONFIG_FATFS_CODEPAGE_855 is not set +# CONFIG_FATFS_CODEPAGE_857 is not set +# CONFIG_FATFS_CODEPAGE_860 is not set +# CONFIG_FATFS_CODEPAGE_861 is not set +# CONFIG_FATFS_CODEPAGE_862 is not set +# CONFIG_FATFS_CODEPAGE_863 is not set +# CONFIG_FATFS_CODEPAGE_864 is not set +# CONFIG_FATFS_CODEPAGE_865 is not set +# CONFIG_FATFS_CODEPAGE_866 is not set +# CONFIG_FATFS_CODEPAGE_869 is not set +# CONFIG_FATFS_CODEPAGE_932 is not set +# CONFIG_FATFS_CODEPAGE_936 is not set +# CONFIG_FATFS_CODEPAGE_949 is not set +# CONFIG_FATFS_CODEPAGE_950 is not set +CONFIG_FATFS_CODEPAGE=437 +CONFIG_FATFS_FS_LOCK=0 +CONFIG_FATFS_TIMEOUT_MS=10000 +CONFIG_FATFS_PER_FILE_CACHE=y +CONFIG_FATFS_ALLOC_PREFER_EXTRAM=y +# CONFIG_FATFS_USE_FASTSEEK is not set +CONFIG_FATFS_USE_STRFUNC_NONE=y +# CONFIG_FATFS_USE_STRFUNC_WITHOUT_CRLF_CONV is not set +# CONFIG_FATFS_USE_STRFUNC_WITH_CRLF_CONV is not set +CONFIG_FATFS_VFS_FSTAT_BLKSIZE=0 +# CONFIG_FATFS_IMMEDIATE_FSYNC is not set +# CONFIG_FATFS_USE_LABEL is not set +CONFIG_FATFS_LINK_LOCK=y +# CONFIG_FATFS_USE_DYN_BUFFERS is not set + +# +# File system free space calculation behavior +# +CONFIG_FATFS_DONT_TRUST_FREE_CLUSTER_CNT=0 +CONFIG_FATFS_DONT_TRUST_LAST_ALLOC=0 +# end of File system free space calculation behavior +# end of FAT Filesystem support + +# +# FreeRTOS +# + +# +# Kernel +# +# CONFIG_FREERTOS_SMP is not set +# CONFIG_FREERTOS_UNICORE is not set +CONFIG_FREERTOS_HZ=1000 +# CONFIG_FREERTOS_CHECK_STACKOVERFLOW_NONE is not set +# CONFIG_FREERTOS_CHECK_STACKOVERFLOW_PTRVAL is not set +CONFIG_FREERTOS_CHECK_STACKOVERFLOW_CANARY=y +CONFIG_FREERTOS_THREAD_LOCAL_STORAGE_POINTERS=1 +CONFIG_FREERTOS_IDLE_TASK_STACKSIZE=768 +# CONFIG_FREERTOS_USE_IDLE_HOOK is not set +# CONFIG_FREERTOS_USE_TICK_HOOK is not set +CONFIG_FREERTOS_MAX_TASK_NAME_LEN=10 +CONFIG_FREERTOS_ENABLE_BACKWARD_COMPATIBILITY=y +CONFIG_FREERTOS_USE_TIMERS=y +CONFIG_FREERTOS_TIMER_SERVICE_TASK_NAME="Tmr Svc" +# CONFIG_FREERTOS_TIMER_TASK_AFFINITY_CPU0 is not set +# CONFIG_FREERTOS_TIMER_TASK_AFFINITY_CPU1 is not set +CONFIG_FREERTOS_TIMER_TASK_NO_AFFINITY=y +CONFIG_FREERTOS_TIMER_SERVICE_TASK_CORE_AFFINITY=0x7FFFFFFF +CONFIG_FREERTOS_TIMER_TASK_PRIORITY=1 +CONFIG_FREERTOS_TIMER_TASK_STACK_DEPTH=1536 +CONFIG_FREERTOS_TIMER_QUEUE_LENGTH=5 +CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE=0 +CONFIG_FREERTOS_TASK_NOTIFICATION_ARRAY_ENTRIES=1 +# CONFIG_FREERTOS_USE_TRACE_FACILITY is not set +# CONFIG_FREERTOS_USE_LIST_DATA_INTEGRITY_CHECK_BYTES is not set +# CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS is not set +# CONFIG_FREERTOS_USE_APPLICATION_TASK_TAG is not set +# end of Kernel + +# +# Port +# +# CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK is not set +CONFIG_FREERTOS_TLSP_DELETION_CALLBACKS=y +# CONFIG_FREERTOS_TASK_PRE_DELETION_HOOK is not set +# CONFIG_FREERTOS_ENABLE_STATIC_TASK_CLEAN_UP is not set +CONFIG_FREERTOS_CHECK_MUTEX_GIVEN_BY_OWNER=y +CONFIG_FREERTOS_ISR_STACKSIZE=1536 +CONFIG_FREERTOS_INTERRUPT_BACKTRACE=y +# CONFIG_FREERTOS_FPU_IN_ISR is not set +CONFIG_FREERTOS_TICK_SUPPORT_CORETIMER=y +CONFIG_FREERTOS_CORETIMER_0=y +# CONFIG_FREERTOS_CORETIMER_1 is not set +CONFIG_FREERTOS_SYSTICK_USES_CCOUNT=y +CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH=y +# CONFIG_FREERTOS_CHECK_PORT_CRITICAL_COMPLIANCE is not set +# end of Port + +# +# Extra +# +# CONFIG_FREERTOS_TASK_CREATE_ALLOW_EXT_MEM is not set +# end of Extra + +CONFIG_FREERTOS_PORT=y +CONFIG_FREERTOS_NO_AFFINITY=0x7FFFFFFF +CONFIG_FREERTOS_SUPPORT_STATIC_ALLOCATION=y +CONFIG_FREERTOS_DEBUG_OCDAWARE=y +CONFIG_FREERTOS_ENABLE_TASK_SNAPSHOT=y +CONFIG_FREERTOS_PLACE_SNAPSHOT_FUNS_INTO_FLASH=y +CONFIG_FREERTOS_NUMBER_OF_CORES=2 +CONFIG_FREERTOS_IN_IRAM=y +# end of FreeRTOS + +# +# Hardware Abstraction Layer (HAL) and Low Level (LL) +# +CONFIG_HAL_ASSERTION_EQUALS_SYSTEM=y +# CONFIG_HAL_ASSERTION_DISABLE is not set +# CONFIG_HAL_ASSERTION_SILENT is not set +# CONFIG_HAL_ASSERTION_ENABLE is not set +CONFIG_HAL_DEFAULT_ASSERTION_LEVEL=2 +# end of Hardware Abstraction Layer (HAL) and Low Level (LL) + +# +# Heap memory debugging +# +CONFIG_HEAP_POISONING_DISABLED=y +# CONFIG_HEAP_POISONING_LIGHT is not set +# CONFIG_HEAP_POISONING_COMPREHENSIVE is not set +CONFIG_HEAP_TRACING_OFF=y +# CONFIG_HEAP_TRACING_STANDALONE is not set +# CONFIG_HEAP_TRACING_TOHOST is not set +# CONFIG_HEAP_USE_HOOKS is not set +# CONFIG_HEAP_TASK_TRACKING is not set +# CONFIG_HEAP_ABORT_WHEN_ALLOCATION_FAILS is not set +# CONFIG_HEAP_PLACE_FUNCTION_INTO_FLASH is not set +# end of Heap memory debugging + +# +# Log +# +CONFIG_LOG_VERSION_1=y +# CONFIG_LOG_VERSION_2 is not set +CONFIG_LOG_VERSION=1 + +# +# Log Level +# +# CONFIG_LOG_DEFAULT_LEVEL_NONE is not set +# CONFIG_LOG_DEFAULT_LEVEL_ERROR is not set +# CONFIG_LOG_DEFAULT_LEVEL_WARN is not set +# CONFIG_LOG_DEFAULT_LEVEL_INFO is not set +CONFIG_LOG_DEFAULT_LEVEL_DEBUG=y +# CONFIG_LOG_DEFAULT_LEVEL_VERBOSE is not set +CONFIG_LOG_DEFAULT_LEVEL=4 +CONFIG_LOG_MAXIMUM_EQUALS_DEFAULT=y +# CONFIG_LOG_MAXIMUM_LEVEL_VERBOSE is not set +CONFIG_LOG_MAXIMUM_LEVEL=4 + +# +# Level Settings +# +# CONFIG_LOG_MASTER_LEVEL is not set +CONFIG_LOG_DYNAMIC_LEVEL_CONTROL=y +# CONFIG_LOG_TAG_LEVEL_IMPL_NONE is not set +# CONFIG_LOG_TAG_LEVEL_IMPL_LINKED_LIST is not set +CONFIG_LOG_TAG_LEVEL_IMPL_CACHE_AND_LINKED_LIST=y +# CONFIG_LOG_TAG_LEVEL_CACHE_ARRAY is not set +CONFIG_LOG_TAG_LEVEL_CACHE_BINARY_MIN_HEAP=y +CONFIG_LOG_TAG_LEVEL_IMPL_CACHE_SIZE=31 +# end of Level Settings +# end of Log Level + +# +# Format +# +CONFIG_LOG_COLORS=y +CONFIG_LOG_TIMESTAMP_SOURCE_RTOS=y +# CONFIG_LOG_TIMESTAMP_SOURCE_SYSTEM is not set +# end of Format + +# +# Settings +# +CONFIG_LOG_MODE_TEXT_EN=y +CONFIG_LOG_MODE_TEXT=y +# end of Settings + +CONFIG_LOG_IN_IRAM=y +# end of Log + +# +# LWIP +# +CONFIG_LWIP_ENABLE=y +CONFIG_LWIP_LOCAL_HOSTNAME="espressif" +CONFIG_LWIP_TCPIP_TASK_PRIO=18 +# CONFIG_LWIP_TCPIP_CORE_LOCKING is not set +# CONFIG_LWIP_CHECK_THREAD_SAFETY is not set +CONFIG_LWIP_DNS_SUPPORT_MDNS_QUERIES=y +# CONFIG_LWIP_L2_TO_L3_COPY is not set +# CONFIG_LWIP_IRAM_OPTIMIZATION is not set +# CONFIG_LWIP_EXTRA_IRAM_OPTIMIZATION is not set +CONFIG_LWIP_TIMERS_ONDEMAND=y +CONFIG_LWIP_ND6=y +# CONFIG_LWIP_FORCE_ROUTER_FORWARDING is not set +CONFIG_LWIP_MAX_SOCKETS=10 +# CONFIG_LWIP_USE_ONLY_LWIP_SELECT is not set +# CONFIG_LWIP_SO_LINGER is not set +CONFIG_LWIP_SO_REUSE=y +# CONFIG_LWIP_SO_REUSE_RXTOALL is not set +# CONFIG_LWIP_SO_RCVBUF is not set +# CONFIG_LWIP_NETBUF_RECVINFO is not set +CONFIG_LWIP_IP_DEFAULT_TTL=64 +CONFIG_LWIP_IP4_FRAG=y +CONFIG_LWIP_IP6_FRAG=y +# CONFIG_LWIP_IP4_REASSEMBLY is not set +# CONFIG_LWIP_IP6_REASSEMBLY is not set +CONFIG_LWIP_IP_REASS_MAX_PBUFS=10 +# CONFIG_LWIP_IP_FORWARD is not set +# CONFIG_LWIP_STATS is not set +CONFIG_LWIP_ESP_GRATUITOUS_ARP=y +CONFIG_LWIP_GARP_TMR_INTERVAL=60 +CONFIG_LWIP_ESP_MLDV6_REPORT=y +CONFIG_LWIP_MLDV6_TMR_INTERVAL=40 +CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=32 +CONFIG_LWIP_DHCP_DOES_ARP_CHECK=y +# CONFIG_LWIP_DHCP_DOES_ACD_CHECK is not set +# CONFIG_LWIP_DHCP_DOES_NOT_CHECK_OFFERED_IP is not set +# CONFIG_LWIP_DHCP_DISABLE_CLIENT_ID is not set +CONFIG_LWIP_DHCP_DISABLE_VENDOR_CLASS_ID=y +# CONFIG_LWIP_DHCP_RESTORE_LAST_IP is not set +CONFIG_LWIP_DHCP_OPTIONS_LEN=69 +CONFIG_LWIP_NUM_NETIF_CLIENT_DATA=0 +CONFIG_LWIP_DHCP_COARSE_TIMER_SECS=1 + +# +# DHCP server +# +CONFIG_LWIP_DHCPS=y +CONFIG_LWIP_DHCPS_LEASE_UNIT=60 +CONFIG_LWIP_DHCPS_MAX_STATION_NUM=8 +CONFIG_LWIP_DHCPS_STATIC_ENTRIES=y +CONFIG_LWIP_DHCPS_ADD_DNS=y +# end of DHCP server + +# CONFIG_LWIP_AUTOIP is not set +CONFIG_LWIP_IPV4=y +CONFIG_LWIP_IPV6=y +# CONFIG_LWIP_IPV6_AUTOCONFIG is not set +CONFIG_LWIP_IPV6_NUM_ADDRESSES=3 +# CONFIG_LWIP_IPV6_FORWARD is not set +# CONFIG_LWIP_NETIF_STATUS_CALLBACK is not set +CONFIG_LWIP_NETIF_LOOPBACK=y +CONFIG_LWIP_LOOPBACK_MAX_PBUFS=8 + +# +# TCP +# +CONFIG_LWIP_MAX_ACTIVE_TCP=6 +CONFIG_LWIP_MAX_LISTENING_TCP=6 +CONFIG_LWIP_TCP_HIGH_SPEED_RETRANSMISSION=y +CONFIG_LWIP_TCP_MAXRTX=12 +CONFIG_LWIP_TCP_SYNMAXRTX=12 +CONFIG_LWIP_TCP_MSS=1460 +CONFIG_LWIP_TCP_TMR_INTERVAL=250 +CONFIG_LWIP_TCP_MSL=60000 +CONFIG_LWIP_TCP_FIN_WAIT_TIMEOUT=20000 +CONFIG_LWIP_TCP_SND_BUF_DEFAULT=11680 +CONFIG_LWIP_TCP_WND_DEFAULT=11680 +CONFIG_LWIP_TCP_RECVMBOX_SIZE=10 +CONFIG_LWIP_TCP_ACCEPTMBOX_SIZE=6 +CONFIG_LWIP_TCP_QUEUE_OOSEQ=y +CONFIG_LWIP_TCP_OOSEQ_TIMEOUT=6 +CONFIG_LWIP_TCP_OOSEQ_MAX_PBUFS=4 +CONFIG_LWIP_TCP_SACK_OUT=y +CONFIG_LWIP_TCP_OVERSIZE_MSS=y +# CONFIG_LWIP_TCP_OVERSIZE_QUARTER_MSS is not set +# CONFIG_LWIP_TCP_OVERSIZE_DISABLE is not set +CONFIG_LWIP_TCP_RTO_TIME=1500 +# end of TCP + +# +# UDP +# +CONFIG_LWIP_MAX_UDP_PCBS=1 +CONFIG_LWIP_UDP_RECVMBOX_SIZE=6 +# end of UDP + +# +# Checksums +# +# CONFIG_LWIP_CHECKSUM_CHECK_IP is not set +# CONFIG_LWIP_CHECKSUM_CHECK_UDP is not set +CONFIG_LWIP_CHECKSUM_CHECK_ICMP=y +# end of Checksums + +CONFIG_LWIP_TCPIP_TASK_STACK_SIZE=3072 +# CONFIG_LWIP_TCPIP_TASK_AFFINITY_NO_AFFINITY is not set +CONFIG_LWIP_TCPIP_TASK_AFFINITY_CPU0=y +# CONFIG_LWIP_TCPIP_TASK_AFFINITY_CPU1 is not set +CONFIG_LWIP_TCPIP_TASK_AFFINITY=0x0 +CONFIG_LWIP_IPV6_MEMP_NUM_ND6_QUEUE=3 +CONFIG_LWIP_IPV6_ND6_NUM_NEIGHBORS=5 +CONFIG_LWIP_IPV6_ND6_NUM_PREFIXES=5 +CONFIG_LWIP_IPV6_ND6_NUM_ROUTERS=3 +CONFIG_LWIP_IPV6_ND6_NUM_DESTINATIONS=10 +# CONFIG_LWIP_PPP_SUPPORT is not set +# CONFIG_LWIP_SLIP_SUPPORT is not set + +# +# ICMP +# +CONFIG_LWIP_ICMP=y +# CONFIG_LWIP_MULTICAST_PING is not set +# CONFIG_LWIP_BROADCAST_PING is not set +# end of ICMP + +# +# LWIP RAW API +# +CONFIG_LWIP_MAX_RAW_PCBS=16 +# end of LWIP RAW API + +# +# SNTP +# +CONFIG_LWIP_SNTP_MAX_SERVERS=1 +# CONFIG_LWIP_DHCP_GET_NTP_SRV is not set +CONFIG_LWIP_SNTP_UPDATE_DELAY=3600000 +CONFIG_LWIP_SNTP_STARTUP_DELAY=y +CONFIG_LWIP_SNTP_MAXIMUM_STARTUP_DELAY=5000 +# end of SNTP + +# +# DNS +# +CONFIG_LWIP_DNS_MAX_HOST_IP=1 +CONFIG_LWIP_DNS_MAX_SERVERS=3 +# CONFIG_LWIP_FALLBACK_DNS_SERVER_SUPPORT is not set +# CONFIG_LWIP_DNS_SETSERVER_WITH_NETIF is not set +# CONFIG_LWIP_USE_ESP_GETADDRINFO is not set +# end of DNS + +CONFIG_LWIP_BRIDGEIF_MAX_PORTS=7 +CONFIG_LWIP_ESP_LWIP_ASSERT=y + +# +# Hooks +# +# CONFIG_LWIP_HOOK_TCP_ISN_NONE is not set +CONFIG_LWIP_HOOK_TCP_ISN_DEFAULT=y +# CONFIG_LWIP_HOOK_TCP_ISN_CUSTOM is not set +CONFIG_LWIP_HOOK_IP6_ROUTE_NONE=y +# CONFIG_LWIP_HOOK_IP6_ROUTE_DEFAULT is not set +# CONFIG_LWIP_HOOK_IP6_ROUTE_CUSTOM is not set +CONFIG_LWIP_HOOK_ND6_GET_GW_NONE=y +# CONFIG_LWIP_HOOK_ND6_GET_GW_DEFAULT is not set +# CONFIG_LWIP_HOOK_ND6_GET_GW_CUSTOM is not set +CONFIG_LWIP_HOOK_IP6_SELECT_SRC_ADDR_NONE=y +# CONFIG_LWIP_HOOK_IP6_SELECT_SRC_ADDR_DEFAULT is not set +# CONFIG_LWIP_HOOK_IP6_SELECT_SRC_ADDR_CUSTOM is not set +CONFIG_LWIP_HOOK_DHCP_EXTRA_OPTION_NONE=y +# CONFIG_LWIP_HOOK_DHCP_EXTRA_OPTION_DEFAULT is not set +# CONFIG_LWIP_HOOK_DHCP_EXTRA_OPTION_CUSTOM is not set +CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_NONE=y +# CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_DEFAULT is not set +# CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_CUSTOM is not set +CONFIG_LWIP_HOOK_DNS_EXT_RESOLVE_NONE=y +# CONFIG_LWIP_HOOK_DNS_EXT_RESOLVE_CUSTOM is not set +CONFIG_LWIP_HOOK_IP6_INPUT_NONE=y +# CONFIG_LWIP_HOOK_IP6_INPUT_DEFAULT is not set +# CONFIG_LWIP_HOOK_IP6_INPUT_CUSTOM is not set +# end of Hooks + +# CONFIG_LWIP_DEBUG is not set +# end of LWIP + +# +# mbedTLS +# +CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC=y +# CONFIG_MBEDTLS_EXTERNAL_MEM_ALLOC is not set +# CONFIG_MBEDTLS_DEFAULT_MEM_ALLOC is not set +# CONFIG_MBEDTLS_CUSTOM_MEM_ALLOC is not set +CONFIG_MBEDTLS_ASYMMETRIC_CONTENT_LEN=y +CONFIG_MBEDTLS_SSL_IN_CONTENT_LEN=16384 +CONFIG_MBEDTLS_SSL_OUT_CONTENT_LEN=4096 +# CONFIG_MBEDTLS_DYNAMIC_BUFFER is not set +# CONFIG_MBEDTLS_DEBUG is not set + +# +# mbedTLS v3.x related +# +# CONFIG_MBEDTLS_SSL_PROTO_TLS1_3 is not set +# CONFIG_MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH is not set +# CONFIG_MBEDTLS_X509_TRUSTED_CERT_CALLBACK is not set +# CONFIG_MBEDTLS_SSL_CONTEXT_SERIALIZATION is not set +CONFIG_MBEDTLS_SSL_KEEP_PEER_CERTIFICATE=y +# CONFIG_MBEDTLS_SSL_KEYING_MATERIAL_EXPORT is not set +CONFIG_MBEDTLS_PKCS7_C=y +# end of mbedTLS v3.x related + +# +# Certificate Bundle +# +# CONFIG_MBEDTLS_CERTIFICATE_BUNDLE is not set +# end of Certificate Bundle + +# CONFIG_MBEDTLS_ECP_RESTARTABLE is not set +CONFIG_MBEDTLS_CMAC_C=y +CONFIG_MBEDTLS_HARDWARE_AES=y +# CONFIG_MBEDTLS_GCM_SUPPORT_NON_AES_CIPHER is not set +CONFIG_MBEDTLS_HARDWARE_MPI=y +# CONFIG_MBEDTLS_LARGE_KEY_SOFTWARE_MPI is not set +CONFIG_MBEDTLS_HARDWARE_SHA=y +CONFIG_MBEDTLS_ROM_MD5=y +# CONFIG_MBEDTLS_ATCA_HW_ECDSA_SIGN is not set +# CONFIG_MBEDTLS_ATCA_HW_ECDSA_VERIFY is not set +CONFIG_MBEDTLS_HAVE_TIME=y +# CONFIG_MBEDTLS_PLATFORM_TIME_ALT is not set +# CONFIG_MBEDTLS_HAVE_TIME_DATE is not set +CONFIG_MBEDTLS_ECDSA_DETERMINISTIC=y +CONFIG_MBEDTLS_SHA1_C=y +CONFIG_MBEDTLS_SHA512_C=y +# CONFIG_MBEDTLS_SHA3_C is not set +CONFIG_MBEDTLS_TLS_SERVER_AND_CLIENT=y +# CONFIG_MBEDTLS_TLS_SERVER_ONLY is not set +# CONFIG_MBEDTLS_TLS_CLIENT_ONLY is not set +# CONFIG_MBEDTLS_TLS_DISABLED is not set +CONFIG_MBEDTLS_TLS_SERVER=y +CONFIG_MBEDTLS_TLS_CLIENT=y +CONFIG_MBEDTLS_TLS_ENABLED=y + +# +# TLS Key Exchange Methods +# +# CONFIG_MBEDTLS_PSK_MODES is not set +CONFIG_MBEDTLS_KEY_EXCHANGE_RSA=y +CONFIG_MBEDTLS_KEY_EXCHANGE_ELLIPTIC_CURVE=y +CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_RSA=y +CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA=y +CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA=y +CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_RSA=y +# end of TLS Key Exchange Methods + +CONFIG_MBEDTLS_SSL_RENEGOTIATION=y +CONFIG_MBEDTLS_SSL_PROTO_TLS1_2=y +# CONFIG_MBEDTLS_SSL_PROTO_GMTSSL1_1 is not set +# CONFIG_MBEDTLS_SSL_PROTO_DTLS is not set +CONFIG_MBEDTLS_SSL_ALPN=y +CONFIG_MBEDTLS_CLIENT_SSL_SESSION_TICKETS=y +CONFIG_MBEDTLS_SERVER_SSL_SESSION_TICKETS=y + +# +# Symmetric Ciphers +# +CONFIG_MBEDTLS_AES_C=y +# CONFIG_MBEDTLS_CAMELLIA_C is not set +# CONFIG_MBEDTLS_DES_C is not set +# CONFIG_MBEDTLS_BLOWFISH_C is not set +# CONFIG_MBEDTLS_XTEA_C is not set +CONFIG_MBEDTLS_CCM_C=y +CONFIG_MBEDTLS_GCM_C=y +# CONFIG_MBEDTLS_NIST_KW_C is not set +# end of Symmetric Ciphers + +# CONFIG_MBEDTLS_RIPEMD160_C is not set + +# +# Certificates +# +CONFIG_MBEDTLS_PEM_PARSE_C=y +CONFIG_MBEDTLS_PEM_WRITE_C=y +CONFIG_MBEDTLS_X509_CRL_PARSE_C=y +CONFIG_MBEDTLS_X509_CSR_PARSE_C=y +# end of Certificates + +CONFIG_MBEDTLS_ECP_C=y +CONFIG_MBEDTLS_PK_PARSE_EC_EXTENDED=y +CONFIG_MBEDTLS_PK_PARSE_EC_COMPRESSED=y +# CONFIG_MBEDTLS_DHM_C is not set +CONFIG_MBEDTLS_ECDH_C=y +CONFIG_MBEDTLS_ECDSA_C=y +# CONFIG_MBEDTLS_ECJPAKE_C is not set +CONFIG_MBEDTLS_ECP_DP_SECP192R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP224R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP256R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP384R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP521R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP192K1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP224K1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP256K1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_BP256R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_BP384R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_BP512R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_CURVE25519_ENABLED=y +CONFIG_MBEDTLS_ECP_NIST_OPTIM=y +CONFIG_MBEDTLS_ECP_FIXED_POINT_OPTIM=y +# CONFIG_MBEDTLS_POLY1305_C is not set +# CONFIG_MBEDTLS_CHACHA20_C is not set +# CONFIG_MBEDTLS_HKDF_C is not set +# CONFIG_MBEDTLS_THREADING_C is not set +CONFIG_MBEDTLS_ERROR_STRINGS=y +CONFIG_MBEDTLS_FS_IO=y +# CONFIG_MBEDTLS_ALLOW_WEAK_CERTIFICATE_VERIFICATION is not set +# end of mbedTLS + +# +# ESP-MQTT Configurations +# +CONFIG_MQTT_PROTOCOL_311=y +# CONFIG_MQTT_PROTOCOL_5 is not set +CONFIG_MQTT_TRANSPORT_SSL=y +CONFIG_MQTT_TRANSPORT_WEBSOCKET=y +CONFIG_MQTT_TRANSPORT_WEBSOCKET_SECURE=y +# CONFIG_MQTT_MSG_ID_INCREMENTAL is not set +# CONFIG_MQTT_SKIP_PUBLISH_IF_DISCONNECTED is not set +# CONFIG_MQTT_REPORT_DELETED_MESSAGES is not set +# CONFIG_MQTT_USE_CUSTOM_CONFIG is not set +# CONFIG_MQTT_TASK_CORE_SELECTION_ENABLED is not set +# CONFIG_MQTT_CUSTOM_OUTBOX is not set +# end of ESP-MQTT Configurations + +# +# LibC +# +CONFIG_LIBC_NEWLIB=y +CONFIG_LIBC_MISC_IN_IRAM=y +CONFIG_LIBC_LOCKS_PLACE_IN_IRAM=y +CONFIG_LIBC_STDOUT_LINE_ENDING_CRLF=y +# CONFIG_LIBC_STDOUT_LINE_ENDING_LF is not set +# CONFIG_LIBC_STDOUT_LINE_ENDING_CR is not set +# CONFIG_LIBC_STDIN_LINE_ENDING_CRLF is not set +# CONFIG_LIBC_STDIN_LINE_ENDING_LF is not set +CONFIG_LIBC_STDIN_LINE_ENDING_CR=y +# CONFIG_LIBC_NEWLIB_NANO_FORMAT is not set +CONFIG_LIBC_TIME_SYSCALL_USE_RTC_HRT=y +# CONFIG_LIBC_TIME_SYSCALL_USE_RTC is not set +# CONFIG_LIBC_TIME_SYSCALL_USE_HRT is not set +# CONFIG_LIBC_TIME_SYSCALL_USE_NONE is not set +# end of LibC + +CONFIG_STDATOMIC_S32C1I_SPIRAM_WORKAROUND=y + +# +# NVS +# +# CONFIG_NVS_ASSERT_ERROR_CHECK is not set +# CONFIG_NVS_LEGACY_DUP_KEYS_COMPATIBILITY is not set +# CONFIG_NVS_ALLOCATE_CACHE_IN_SPIRAM is not set +# end of NVS + +# +# OpenThread +# +# CONFIG_OPENTHREAD_ENABLED is not set + +# +# OpenThread Spinel +# +# CONFIG_OPENTHREAD_SPINEL_ONLY is not set +# end of OpenThread Spinel +# end of OpenThread + +# +# Protocomm +# +CONFIG_ESP_PROTOCOMM_SUPPORT_SECURITY_VERSION_0=y +CONFIG_ESP_PROTOCOMM_SUPPORT_SECURITY_VERSION_1=y +CONFIG_ESP_PROTOCOMM_SUPPORT_SECURITY_VERSION_2=y +CONFIG_ESP_PROTOCOMM_SUPPORT_SECURITY_PATCH_VERSION=y +# end of Protocomm + +# +# PThreads +# +CONFIG_PTHREAD_TASK_PRIO_DEFAULT=5 +CONFIG_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072 +CONFIG_PTHREAD_STACK_MIN=768 +CONFIG_PTHREAD_DEFAULT_CORE_NO_AFFINITY=y +# CONFIG_PTHREAD_DEFAULT_CORE_0 is not set +# CONFIG_PTHREAD_DEFAULT_CORE_1 is not set +CONFIG_PTHREAD_TASK_CORE_DEFAULT=-1 +CONFIG_PTHREAD_TASK_NAME_DEFAULT="pthread" +# end of PThreads + +# +# MMU Config +# +CONFIG_MMU_PAGE_SIZE_64KB=y +CONFIG_MMU_PAGE_MODE="64KB" +CONFIG_MMU_PAGE_SIZE=0x10000 +# end of MMU Config + +# +# Main Flash configuration +# + +# +# SPI Flash behavior when brownout +# +CONFIG_SPI_FLASH_BROWNOUT_RESET_XMC=y +CONFIG_SPI_FLASH_BROWNOUT_RESET=y +# end of SPI Flash behavior when brownout + +# +# Optional and Experimental Features (READ DOCS FIRST) +# + +# +# Features here require specific hardware (READ DOCS FIRST!) +# +CONFIG_SPI_FLASH_SUSPEND_TSUS_VAL_US=50 +# CONFIG_SPI_FLASH_FORCE_ENABLE_XMC_C_SUSPEND is not set +# CONFIG_SPI_FLASH_FORCE_ENABLE_C6_H2_SUSPEND is not set +CONFIG_SPI_FLASH_PLACE_FUNCTIONS_IN_IRAM=y +# end of Optional and Experimental Features (READ DOCS FIRST) +# end of Main Flash configuration + +# +# SPI Flash driver +# +# CONFIG_SPI_FLASH_VERIFY_WRITE is not set +# CONFIG_SPI_FLASH_ENABLE_COUNTERS is not set +CONFIG_SPI_FLASH_ROM_DRIVER_PATCH=y +CONFIG_SPI_FLASH_DANGEROUS_WRITE_ABORTS=y +# CONFIG_SPI_FLASH_DANGEROUS_WRITE_FAILS is not set +# CONFIG_SPI_FLASH_DANGEROUS_WRITE_ALLOWED is not set +# CONFIG_SPI_FLASH_SHARE_SPI1_BUS is not set +# CONFIG_SPI_FLASH_BYPASS_BLOCK_ERASE is not set +CONFIG_SPI_FLASH_YIELD_DURING_ERASE=y +CONFIG_SPI_FLASH_ERASE_YIELD_DURATION_MS=20 +CONFIG_SPI_FLASH_ERASE_YIELD_TICKS=1 +CONFIG_SPI_FLASH_WRITE_CHUNK_SIZE=8192 +# CONFIG_SPI_FLASH_SIZE_OVERRIDE is not set +# CONFIG_SPI_FLASH_CHECK_ERASE_TIMEOUT_DISABLED is not set +# CONFIG_SPI_FLASH_OVERRIDE_CHIP_DRIVER_LIST is not set + +# +# Auto-detect flash chips +# +CONFIG_SPI_FLASH_VENDOR_XMC_SUPPORT_ENABLED=y +CONFIG_SPI_FLASH_VENDOR_GD_SUPPORT_ENABLED=y +CONFIG_SPI_FLASH_VENDOR_ISSI_SUPPORT_ENABLED=y +CONFIG_SPI_FLASH_VENDOR_MXIC_SUPPORT_ENABLED=y +CONFIG_SPI_FLASH_VENDOR_WINBOND_SUPPORT_ENABLED=y +CONFIG_SPI_FLASH_SUPPORT_ISSI_CHIP=y +CONFIG_SPI_FLASH_SUPPORT_MXIC_CHIP=y +CONFIG_SPI_FLASH_SUPPORT_GD_CHIP=y +CONFIG_SPI_FLASH_SUPPORT_WINBOND_CHIP=y +# CONFIG_SPI_FLASH_SUPPORT_BOYA_CHIP is not set +# CONFIG_SPI_FLASH_SUPPORT_TH_CHIP is not set +# end of Auto-detect flash chips + +CONFIG_SPI_FLASH_ENABLE_ENCRYPTED_READ_WRITE=y +# end of SPI Flash driver + +# +# SPIFFS Configuration +# +CONFIG_SPIFFS_MAX_PARTITIONS=3 + +# +# SPIFFS Cache Configuration +# +CONFIG_SPIFFS_CACHE=y +CONFIG_SPIFFS_CACHE_WR=y +# CONFIG_SPIFFS_CACHE_STATS is not set +# end of SPIFFS Cache Configuration + +CONFIG_SPIFFS_PAGE_CHECK=y +CONFIG_SPIFFS_GC_MAX_RUNS=10 +# CONFIG_SPIFFS_GC_STATS is not set +CONFIG_SPIFFS_PAGE_SIZE=256 +CONFIG_SPIFFS_OBJ_NAME_LEN=32 +# CONFIG_SPIFFS_FOLLOW_SYMLINKS is not set +CONFIG_SPIFFS_USE_MAGIC=y +CONFIG_SPIFFS_USE_MAGIC_LENGTH=y +CONFIG_SPIFFS_META_LENGTH=4 +CONFIG_SPIFFS_USE_MTIME=y + +# +# Debug Configuration +# +# CONFIG_SPIFFS_DBG is not set +# CONFIG_SPIFFS_API_DBG is not set +# CONFIG_SPIFFS_GC_DBG is not set +# CONFIG_SPIFFS_CACHE_DBG is not set +# CONFIG_SPIFFS_CHECK_DBG is not set +# CONFIG_SPIFFS_TEST_VISUALISATION is not set +# end of Debug Configuration +# end of SPIFFS Configuration + +# +# TCP Transport +# + +# +# Websocket +# +CONFIG_WS_TRANSPORT=y +CONFIG_WS_BUFFER_SIZE=1024 +# CONFIG_WS_DYNAMIC_BUFFER is not set +# end of Websocket +# end of TCP Transport + +# +# Ultra Low Power (ULP) Co-processor +# +# CONFIG_ULP_COPROC_ENABLED is not set + +# +# ULP Debugging Options +# +# end of ULP Debugging Options +# end of Ultra Low Power (ULP) Co-processor + +# +# Unity unit testing library +# +CONFIG_UNITY_ENABLE_FLOAT=y +CONFIG_UNITY_ENABLE_DOUBLE=y +# CONFIG_UNITY_ENABLE_64BIT is not set +# CONFIG_UNITY_ENABLE_COLOR is not set +CONFIG_UNITY_ENABLE_IDF_TEST_RUNNER=y +# CONFIG_UNITY_ENABLE_FIXTURE is not set +# CONFIG_UNITY_ENABLE_BACKTRACE_ON_FAIL is not set +# CONFIG_UNITY_TEST_ORDER_BY_FILE_PATH_AND_LINE is not set +# end of Unity unit testing library + +# +# Virtual file system +# +CONFIG_VFS_SUPPORT_IO=y +CONFIG_VFS_SUPPORT_DIR=y +CONFIG_VFS_SUPPORT_SELECT=y +CONFIG_VFS_SUPPRESS_SELECT_DEBUG_OUTPUT=y +# CONFIG_VFS_SELECT_IN_RAM is not set +CONFIG_VFS_SUPPORT_TERMIOS=y +CONFIG_VFS_MAX_COUNT=8 + +# +# Host File System I/O (Semihosting) +# +CONFIG_VFS_SEMIHOSTFS_MAX_MOUNT_POINTS=1 +# end of Host File System I/O (Semihosting) + +CONFIG_VFS_INITIALIZE_DEV_NULL=y +# end of Virtual file system + +# +# Wear Levelling +# +# CONFIG_WL_SECTOR_SIZE_512 is not set +CONFIG_WL_SECTOR_SIZE_4096=y +CONFIG_WL_SECTOR_SIZE=4096 +# end of Wear Levelling + +# +# Wi-Fi Provisioning Manager +# +CONFIG_WIFI_PROV_SCAN_MAX_ENTRIES=16 +CONFIG_WIFI_PROV_AUTOSTOP_TIMEOUT=30 +CONFIG_WIFI_PROV_STA_ALL_CHANNEL_SCAN=y +# CONFIG_WIFI_PROV_STA_FAST_SCAN is not set +# end of Wi-Fi Provisioning Manager + +# +# WebSocket Server +# +CONFIG_WEBSOCKET_SERVER_MAX_CLIENTS=1 +CONFIG_WEBSOCKET_SERVER_QUEUE_SIZE=2 +CONFIG_WEBSOCKET_SERVER_QUEUE_TIMEOUT=30 +CONFIG_WEBSOCKET_SERVER_TASK_STACK_DEPTH=3000 +CONFIG_WEBSOCKET_SERVER_TASK_PRIORITY=5 +# CONFIG_WEBSOCKET_SERVER_PINNED is not set +# end of WebSocket Server + +# +# DSP Library +# +CONFIG_DSP_OPTIMIZATIONS_SUPPORTED=y +# CONFIG_DSP_ANSI is not set +CONFIG_DSP_OPTIMIZED=y +CONFIG_DSP_OPTIMIZATION=1 +# CONFIG_DSP_MAX_FFT_SIZE_512 is not set +# CONFIG_DSP_MAX_FFT_SIZE_1024 is not set +# CONFIG_DSP_MAX_FFT_SIZE_2048 is not set +CONFIG_DSP_MAX_FFT_SIZE_4096=y +# CONFIG_DSP_MAX_FFT_SIZE_8192 is not set +# CONFIG_DSP_MAX_FFT_SIZE_16384 is not set +# CONFIG_DSP_MAX_FFT_SIZE_32768 is not set +CONFIG_DSP_MAX_FFT_SIZE=4096 +# end of DSP Library + +# +# mDNS +# +CONFIG_MDNS_MAX_INTERFACES=3 +CONFIG_MDNS_MAX_SERVICES=10 +CONFIG_MDNS_TASK_PRIORITY=1 +CONFIG_MDNS_ACTION_QUEUE_LEN=16 +CONFIG_MDNS_TASK_STACK_SIZE=2816 +CONFIG_MDNS_TASK_AFFINITY_NO_AFFINITY=y +# CONFIG_MDNS_TASK_AFFINITY_CPU0 is not set +# CONFIG_MDNS_TASK_AFFINITY_CPU1 is not set +CONFIG_MDNS_TASK_AFFINITY=0x7FFFFFFF + +# +# MDNS Memory Configuration +# +# CONFIG_MDNS_TASK_CREATE_FROM_SPIRAM is not set +CONFIG_MDNS_TASK_CREATE_FROM_INTERNAL=y +# CONFIG_MDNS_MEMORY_ALLOC_SPIRAM is not set +CONFIG_MDNS_MEMORY_ALLOC_INTERNAL=y +# CONFIG_MDNS_MEMORY_CUSTOM_IMPL is not set +# end of MDNS Memory Configuration + +CONFIG_MDNS_SERVICE_ADD_TIMEOUT_MS=2000 +CONFIG_MDNS_TIMER_PERIOD_MS=100 +# CONFIG_MDNS_NETWORKING_SOCKET is not set +# CONFIG_MDNS_SKIP_SUPPRESSING_OWN_QUERIES is not set +# CONFIG_MDNS_ENABLE_DEBUG_PRINTS is not set +CONFIG_MDNS_ENABLE_CONSOLE_CLI=y +# CONFIG_MDNS_RESPOND_REVERSE_QUERIES is not set +CONFIG_MDNS_MULTIPLE_INSTANCE=y + +# +# MDNS Predefined interfaces +# +CONFIG_MDNS_PREDEF_NETIF_STA=y +CONFIG_MDNS_PREDEF_NETIF_AP=y +CONFIG_MDNS_PREDEF_NETIF_ETH=y +# end of MDNS Predefined interfaces +# end of mDNS +# end of Component config + +# CONFIG_IDF_EXPERIMENTAL_FEATURES is not set + +# Deprecated options for backward compatibility +# CONFIG_APP_BUILD_TYPE_ELF_RAM is not set +# CONFIG_NO_BLOBS is not set +# CONFIG_ESP32_NO_BLOBS is not set +# CONFIG_ESP32_COMPATIBLE_PRE_V2_1_BOOTLOADERS is not set +# CONFIG_ESP32_COMPATIBLE_PRE_V3_1_BOOTLOADERS is not set +CONFIG_APP_ROLLBACK_ENABLE=y +# CONFIG_APP_ANTI_ROLLBACK is not set +# CONFIG_LOG_BOOTLOADER_LEVEL_NONE is not set +# CONFIG_LOG_BOOTLOADER_LEVEL_ERROR is not set +# CONFIG_LOG_BOOTLOADER_LEVEL_WARN is not set +CONFIG_LOG_BOOTLOADER_LEVEL_INFO=y +# CONFIG_LOG_BOOTLOADER_LEVEL_DEBUG is not set +# CONFIG_LOG_BOOTLOADER_LEVEL_VERBOSE is not set +CONFIG_LOG_BOOTLOADER_LEVEL=3 +# CONFIG_FLASH_ENCRYPTION_ENABLED is not set +CONFIG_FLASHMODE_QIO=y +# CONFIG_FLASHMODE_QOUT is not set +# CONFIG_FLASHMODE_DIO is not set +# CONFIG_FLASHMODE_DOUT is not set +CONFIG_MONITOR_BAUD=115200 +# CONFIG_OPTIMIZATION_LEVEL_DEBUG is not set +# CONFIG_COMPILER_OPTIMIZATION_LEVEL_DEBUG is not set +# CONFIG_COMPILER_OPTIMIZATION_DEFAULT is not set +# CONFIG_OPTIMIZATION_LEVEL_RELEASE is not set +# CONFIG_COMPILER_OPTIMIZATION_LEVEL_RELEASE is not set +CONFIG_OPTIMIZATION_ASSERTIONS_ENABLED=y +# CONFIG_OPTIMIZATION_ASSERTIONS_SILENT is not set +# CONFIG_OPTIMIZATION_ASSERTIONS_DISABLED is not set +CONFIG_OPTIMIZATION_ASSERTION_LEVEL=2 +# CONFIG_CXX_EXCEPTIONS is not set +CONFIG_STACK_CHECK_NONE=y +# CONFIG_STACK_CHECK_NORM is not set +# CONFIG_STACK_CHECK_STRONG is not set +# CONFIG_STACK_CHECK_ALL is not set +# CONFIG_WARN_WRITE_STRINGS is not set +# CONFIG_ESP32_APPTRACE_DEST_TRAX is not set +CONFIG_ESP32_APPTRACE_DEST_NONE=y +CONFIG_ESP32_APPTRACE_LOCK_ENABLE=y +CONFIG_ADC2_DISABLE_DAC=y +# CONFIG_GPTIMER_ISR_IRAM_SAFE is not set +# CONFIG_MCPWM_ISR_IRAM_SAFE is not set +# CONFIG_EVENT_LOOP_PROFILING is not set +CONFIG_POST_EVENTS_FROM_ISR=y +# CONFIG_POST_EVENTS_FROM_IRAM_ISR is not set +CONFIG_GDBSTUB_SUPPORT_TASKS=y +CONFIG_GDBSTUB_MAX_TASKS=32 +# CONFIG_OTA_ALLOW_HTTP is not set +# CONFIG_TWO_UNIVERSAL_MAC_ADDRESS is not set +CONFIG_FOUR_UNIVERSAL_MAC_ADDRESS=y +CONFIG_NUMBER_OF_UNIVERSAL_MAC_ADDRESS=4 +CONFIG_ESP32_DEEP_SLEEP_WAKEUP_DELAY=2000 +CONFIG_ESP_SLEEP_DEEP_SLEEP_WAKEUP_DELAY=2000 +CONFIG_ESP32_RTC_CLK_SRC_INT_RC=y +CONFIG_ESP32_RTC_CLOCK_SOURCE_INTERNAL_RC=y +# CONFIG_ESP32_RTC_CLK_SRC_EXT_CRYS is not set +# CONFIG_ESP32_RTC_CLOCK_SOURCE_EXTERNAL_CRYSTAL is not set +# CONFIG_ESP32_RTC_CLK_SRC_EXT_OSC is not set +# CONFIG_ESP32_RTC_CLOCK_SOURCE_EXTERNAL_OSC is not set +# CONFIG_ESP32_RTC_CLK_SRC_INT_8MD256 is not set +# CONFIG_ESP32_RTC_CLOCK_SOURCE_INTERNAL_8MD256 is not set +CONFIG_ESP32_RTC_CLK_CAL_CYCLES=1024 +CONFIG_PERIPH_CTRL_FUNC_IN_IRAM=y +# CONFIG_ESP32_XTAL_FREQ_26 is not set +CONFIG_ESP32_XTAL_FREQ_40=y +# CONFIG_ESP32_XTAL_FREQ_AUTO is not set +CONFIG_ESP32_XTAL_FREQ=40 +CONFIG_BROWNOUT_DET=y +CONFIG_ESP32_BROWNOUT_DET=y +# CONFIG_BROWNOUT_DET_LVL_SEL_0 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_0 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_1 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_1 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_2 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_2 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_3 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_3 is not set +CONFIG_BROWNOUT_DET_LVL_SEL_4=y +CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_4=y +# CONFIG_BROWNOUT_DET_LVL_SEL_5 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_5 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_6 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_6 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_7 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_7 is not set +CONFIG_BROWNOUT_DET_LVL=4 +CONFIG_ESP32_BROWNOUT_DET_LVL=4 +CONFIG_ESP_SYSTEM_BROWNOUT_INTR=y +CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE=y +# CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION is not set +CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER=20 +CONFIG_ESP32_PHY_MAX_TX_POWER=20 +CONFIG_REDUCE_PHY_TX_POWER=y +CONFIG_ESP32_REDUCE_PHY_TX_POWER=y +CONFIG_SPIRAM_SUPPORT=y +CONFIG_ESP32_SPIRAM_SUPPORT=y +# CONFIG_WIFI_LWIP_ALLOCATION_FROM_SPIRAM_FIRST is not set +# CONFIG_ESP32_DEFAULT_CPU_FREQ_80 is not set +# CONFIG_ESP32_DEFAULT_CPU_FREQ_160 is not set +CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y +CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=240 +CONFIG_TRACEMEM_RESERVE_DRAM=0x0 +# CONFIG_ESP32_PANIC_PRINT_HALT is not set +CONFIG_ESP32_PANIC_PRINT_REBOOT=y +# CONFIG_ESP32_PANIC_SILENT_REBOOT is not set +# CONFIG_ESP32_PANIC_GDBSTUB is not set +CONFIG_SYSTEM_EVENT_QUEUE_SIZE=32 +CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=2304 +CONFIG_MAIN_TASK_STACK_SIZE=2560 +CONFIG_CONSOLE_UART_DEFAULT=y +# CONFIG_CONSOLE_UART_CUSTOM is not set +# CONFIG_CONSOLE_UART_NONE is not set +# CONFIG_ESP_CONSOLE_UART_NONE is not set +CONFIG_CONSOLE_UART=y +CONFIG_CONSOLE_UART_NUM=0 +CONFIG_CONSOLE_UART_BAUDRATE=115200 +CONFIG_INT_WDT=y +CONFIG_INT_WDT_TIMEOUT_MS=300 +CONFIG_INT_WDT_CHECK_CPU1=y +CONFIG_TASK_WDT=y +CONFIG_ESP_TASK_WDT=y +# CONFIG_TASK_WDT_PANIC is not set +CONFIG_TASK_WDT_TIMEOUT_S=5 +CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU0=y +CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU1=y +# CONFIG_ESP32_DEBUG_STUBS_ENABLE is not set +CONFIG_ESP32_DEBUG_OCDAWARE=y +# CONFIG_DISABLE_BASIC_ROM_CONSOLE is not set +CONFIG_IPC_TASK_STACK_SIZE=1024 +CONFIG_TIMER_TASK_STACK_SIZE=2048 +CONFIG_ESP32_WIFI_ENABLED=y +CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=8 +CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=64 +CONFIG_ESP32_WIFI_STATIC_TX_BUFFER=y +# CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER is not set +CONFIG_ESP32_WIFI_TX_BUFFER_TYPE=0 +CONFIG_ESP32_WIFI_STATIC_TX_BUFFER_NUM=8 +# CONFIG_ESP32_WIFI_CSI_ENABLED is not set +CONFIG_ESP32_WIFI_AMPDU_TX_ENABLED=y +CONFIG_ESP32_WIFI_TX_BA_WIN=8 +CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED=y +CONFIG_ESP32_WIFI_RX_BA_WIN=16 +CONFIG_ESP32_WIFI_NVS_ENABLED=y +CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_0=y +# CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_1 is not set +CONFIG_ESP32_WIFI_SOFTAP_BEACON_MAX_LEN=752 +CONFIG_ESP32_WIFI_MGMT_SBUF_NUM=32 +# CONFIG_ESP32_WIFI_IRAM_OPT is not set +CONFIG_ESP32_WIFI_RX_IRAM_OPT=y +CONFIG_ESP32_WIFI_ENABLE_WPA3_SAE=y +CONFIG_ESP32_WIFI_ENABLE_WPA3_OWE_STA=y +CONFIG_WPA_MBEDTLS_CRYPTO=y +CONFIG_WPA_MBEDTLS_TLS_CLIENT=y +# CONFIG_WPA_WAPI_PSK is not set +# CONFIG_WPA_11KV_SUPPORT is not set +# CONFIG_WPA_MBO_SUPPORT is not set +# CONFIG_WPA_DPP_SUPPORT is not set +# CONFIG_WPA_11R_SUPPORT is not set +# CONFIG_WPA_WPS_SOFTAP_REGISTRAR is not set +# CONFIG_WPA_WPS_STRICT is not set +# CONFIG_WPA_DEBUG_PRINT is not set +# CONFIG_WPA_TESTING_OPTIONS is not set +# CONFIG_ESP32_ENABLE_COREDUMP_TO_FLASH is not set +# CONFIG_ESP32_ENABLE_COREDUMP_TO_UART is not set +CONFIG_ESP32_ENABLE_COREDUMP_TO_NONE=y +CONFIG_TIMER_TASK_PRIORITY=1 +CONFIG_TIMER_TASK_STACK_DEPTH=1536 +CONFIG_TIMER_QUEUE_LENGTH=5 +# CONFIG_ENABLE_STATIC_TASK_CLEAN_UP_HOOK is not set +# CONFIG_SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY is not set +# CONFIG_HAL_ASSERTION_SILIENT is not set +# CONFIG_L2_TO_L3_COPY is not set +CONFIG_ESP_GRATUITOUS_ARP=y +CONFIG_GARP_TMR_INTERVAL=60 +CONFIG_TCPIP_RECVMBOX_SIZE=32 +CONFIG_TCP_MAXRTX=12 +CONFIG_TCP_SYNMAXRTX=12 +CONFIG_TCP_MSS=1460 +CONFIG_TCP_MSL=60000 +CONFIG_TCP_SND_BUF_DEFAULT=11680 +CONFIG_TCP_WND_DEFAULT=11680 +CONFIG_TCP_RECVMBOX_SIZE=10 +CONFIG_TCP_QUEUE_OOSEQ=y +CONFIG_TCP_OVERSIZE_MSS=y +# CONFIG_TCP_OVERSIZE_QUARTER_MSS is not set +# CONFIG_TCP_OVERSIZE_DISABLE is not set +CONFIG_UDP_RECVMBOX_SIZE=6 +CONFIG_TCPIP_TASK_STACK_SIZE=3072 +# CONFIG_TCPIP_TASK_AFFINITY_NO_AFFINITY is not set +CONFIG_TCPIP_TASK_AFFINITY_CPU0=y +# CONFIG_TCPIP_TASK_AFFINITY_CPU1 is not set +CONFIG_TCPIP_TASK_AFFINITY=0x0 +# CONFIG_PPP_SUPPORT is not set +CONFIG_NEWLIB_STDOUT_LINE_ENDING_CRLF=y +# CONFIG_NEWLIB_STDOUT_LINE_ENDING_LF is not set +# CONFIG_NEWLIB_STDOUT_LINE_ENDING_CR is not set +# CONFIG_NEWLIB_STDIN_LINE_ENDING_CRLF is not set +# CONFIG_NEWLIB_STDIN_LINE_ENDING_LF is not set +CONFIG_NEWLIB_STDIN_LINE_ENDING_CR=y +# CONFIG_NEWLIB_NANO_FORMAT is not set +CONFIG_NEWLIB_TIME_SYSCALL_USE_RTC_HRT=y +CONFIG_ESP32_TIME_SYSCALL_USE_RTC_HRT=y +CONFIG_ESP32_TIME_SYSCALL_USE_RTC_FRC1=y +# CONFIG_NEWLIB_TIME_SYSCALL_USE_RTC is not set +# CONFIG_ESP32_TIME_SYSCALL_USE_RTC is not set +# CONFIG_NEWLIB_TIME_SYSCALL_USE_HRT is not set +# CONFIG_ESP32_TIME_SYSCALL_USE_HRT is not set +# CONFIG_ESP32_TIME_SYSCALL_USE_FRC1 is not set +# CONFIG_NEWLIB_TIME_SYSCALL_USE_NONE is not set +# CONFIG_ESP32_TIME_SYSCALL_USE_NONE is not set +CONFIG_ESP32_PTHREAD_TASK_PRIO_DEFAULT=5 +CONFIG_ESP32_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072 +CONFIG_ESP32_PTHREAD_STACK_MIN=768 +CONFIG_ESP32_DEFAULT_PTHREAD_CORE_NO_AFFINITY=y +# CONFIG_ESP32_DEFAULT_PTHREAD_CORE_0 is not set +# CONFIG_ESP32_DEFAULT_PTHREAD_CORE_1 is not set +CONFIG_ESP32_PTHREAD_TASK_CORE_DEFAULT=-1 +CONFIG_ESP32_PTHREAD_TASK_NAME_DEFAULT="pthread" +CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ABORTS=y +# CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_FAILS is not set +# CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ALLOWED is not set +# CONFIG_ESP32_ULP_COPROC_ENABLED is not set +CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT=y +CONFIG_SUPPORT_TERMIOS=y +CONFIG_SEMIHOSTFS_MAX_MOUNT_POINTS=1 +# End of deprecated options diff --git a/sdkconfig.louder-esp32s3 b/sdkconfig.louder-esp32s3 new file mode 100644 index 00000000..3932be28 --- /dev/null +++ b/sdkconfig.louder-esp32s3 @@ -0,0 +1,2681 @@ +# +# Automatically generated file. DO NOT EDIT. +# Espressif IoT Development Framework (ESP-IDF) 5.5.1 Project Configuration +# +CONFIG_SOC_ADC_SUPPORTED=y +CONFIG_SOC_UART_SUPPORTED=y +CONFIG_SOC_PCNT_SUPPORTED=y +CONFIG_SOC_PHY_SUPPORTED=y +CONFIG_SOC_WIFI_SUPPORTED=y +CONFIG_SOC_TWAI_SUPPORTED=y +CONFIG_SOC_GDMA_SUPPORTED=y +CONFIG_SOC_UHCI_SUPPORTED=y +CONFIG_SOC_AHB_GDMA_SUPPORTED=y +CONFIG_SOC_GPTIMER_SUPPORTED=y +CONFIG_SOC_LCDCAM_SUPPORTED=y +CONFIG_SOC_LCDCAM_CAM_SUPPORTED=y +CONFIG_SOC_LCDCAM_I80_LCD_SUPPORTED=y +CONFIG_SOC_LCDCAM_RGB_LCD_SUPPORTED=y +CONFIG_SOC_MCPWM_SUPPORTED=y +CONFIG_SOC_DEDICATED_GPIO_SUPPORTED=y +CONFIG_SOC_CACHE_SUPPORT_WRAP=y +CONFIG_SOC_ULP_SUPPORTED=y +CONFIG_SOC_ULP_FSM_SUPPORTED=y +CONFIG_SOC_RISCV_COPROC_SUPPORTED=y +CONFIG_SOC_BT_SUPPORTED=y +CONFIG_SOC_USB_OTG_SUPPORTED=y +CONFIG_SOC_USB_SERIAL_JTAG_SUPPORTED=y +CONFIG_SOC_CCOMP_TIMER_SUPPORTED=y +CONFIG_SOC_ASYNC_MEMCPY_SUPPORTED=y +CONFIG_SOC_SUPPORTS_SECURE_DL_MODE=y +CONFIG_SOC_EFUSE_KEY_PURPOSE_FIELD=y +CONFIG_SOC_EFUSE_SUPPORTED=y +CONFIG_SOC_SDMMC_HOST_SUPPORTED=y +CONFIG_SOC_RTC_FAST_MEM_SUPPORTED=y +CONFIG_SOC_RTC_SLOW_MEM_SUPPORTED=y +CONFIG_SOC_RTC_MEM_SUPPORTED=y +CONFIG_SOC_PSRAM_DMA_CAPABLE=y +CONFIG_SOC_XT_WDT_SUPPORTED=y +CONFIG_SOC_I2S_SUPPORTED=y +CONFIG_SOC_RMT_SUPPORTED=y +CONFIG_SOC_SDM_SUPPORTED=y +CONFIG_SOC_GPSPI_SUPPORTED=y +CONFIG_SOC_LEDC_SUPPORTED=y +CONFIG_SOC_I2C_SUPPORTED=y +CONFIG_SOC_SYSTIMER_SUPPORTED=y +CONFIG_SOC_SUPPORT_COEXISTENCE=y +CONFIG_SOC_TEMP_SENSOR_SUPPORTED=y +CONFIG_SOC_AES_SUPPORTED=y +CONFIG_SOC_MPI_SUPPORTED=y +CONFIG_SOC_SHA_SUPPORTED=y +CONFIG_SOC_HMAC_SUPPORTED=y +CONFIG_SOC_DIG_SIGN_SUPPORTED=y +CONFIG_SOC_FLASH_ENC_SUPPORTED=y +CONFIG_SOC_SECURE_BOOT_SUPPORTED=y +CONFIG_SOC_MEMPROT_SUPPORTED=y +CONFIG_SOC_TOUCH_SENSOR_SUPPORTED=y +CONFIG_SOC_BOD_SUPPORTED=y +CONFIG_SOC_CLK_TREE_SUPPORTED=y +CONFIG_SOC_MPU_SUPPORTED=y +CONFIG_SOC_WDT_SUPPORTED=y +CONFIG_SOC_SPI_FLASH_SUPPORTED=y +CONFIG_SOC_RNG_SUPPORTED=y +CONFIG_SOC_LIGHT_SLEEP_SUPPORTED=y +CONFIG_SOC_DEEP_SLEEP_SUPPORTED=y +CONFIG_SOC_LP_PERIPH_SHARE_INTERRUPT=y +CONFIG_SOC_PM_SUPPORTED=y +CONFIG_SOC_SIMD_INSTRUCTION_SUPPORTED=y +CONFIG_SOC_XTAL_SUPPORT_40M=y +CONFIG_SOC_APPCPU_HAS_CLOCK_GATING_BUG=y +CONFIG_SOC_ADC_RTC_CTRL_SUPPORTED=y +CONFIG_SOC_ADC_DIG_CTRL_SUPPORTED=y +CONFIG_SOC_ADC_ARBITER_SUPPORTED=y +CONFIG_SOC_ADC_DIG_IIR_FILTER_SUPPORTED=y +CONFIG_SOC_ADC_MONITOR_SUPPORTED=y +CONFIG_SOC_ADC_DMA_SUPPORTED=y +CONFIG_SOC_ADC_PERIPH_NUM=2 +CONFIG_SOC_ADC_MAX_CHANNEL_NUM=10 +CONFIG_SOC_ADC_ATTEN_NUM=4 +CONFIG_SOC_ADC_DIGI_CONTROLLER_NUM=2 +CONFIG_SOC_ADC_PATT_LEN_MAX=24 +CONFIG_SOC_ADC_DIGI_MIN_BITWIDTH=12 +CONFIG_SOC_ADC_DIGI_MAX_BITWIDTH=12 +CONFIG_SOC_ADC_DIGI_RESULT_BYTES=4 +CONFIG_SOC_ADC_DIGI_DATA_BYTES_PER_CONV=4 +CONFIG_SOC_ADC_DIGI_IIR_FILTER_NUM=2 +CONFIG_SOC_ADC_DIGI_MONITOR_NUM=2 +CONFIG_SOC_ADC_SAMPLE_FREQ_THRES_HIGH=83333 +CONFIG_SOC_ADC_SAMPLE_FREQ_THRES_LOW=611 +CONFIG_SOC_ADC_RTC_MIN_BITWIDTH=12 +CONFIG_SOC_ADC_RTC_MAX_BITWIDTH=12 +CONFIG_SOC_ADC_CALIBRATION_V1_SUPPORTED=y +CONFIG_SOC_ADC_SELF_HW_CALI_SUPPORTED=y +CONFIG_SOC_ADC_SHARED_POWER=y +CONFIG_SOC_APB_BACKUP_DMA=y +CONFIG_SOC_BROWNOUT_RESET_SUPPORTED=y +CONFIG_SOC_CACHE_WRITEBACK_SUPPORTED=y +CONFIG_SOC_CACHE_FREEZE_SUPPORTED=y +CONFIG_SOC_CACHE_ACS_INVALID_STATE_ON_PANIC=y +CONFIG_SOC_CPU_CORES_NUM=2 +CONFIG_SOC_CPU_INTR_NUM=32 +CONFIG_SOC_CPU_HAS_FPU=y +CONFIG_SOC_HP_CPU_HAS_MULTIPLE_CORES=y +CONFIG_SOC_CPU_BREAKPOINTS_NUM=2 +CONFIG_SOC_CPU_WATCHPOINTS_NUM=2 +CONFIG_SOC_CPU_WATCHPOINT_MAX_REGION_SIZE=0x40 +CONFIG_SOC_SIMD_PREFERRED_DATA_ALIGNMENT=16 +CONFIG_SOC_DS_SIGNATURE_MAX_BIT_LEN=4096 +CONFIG_SOC_DS_KEY_PARAM_MD_IV_LENGTH=16 +CONFIG_SOC_DS_KEY_CHECK_MAX_WAIT_US=1100 +CONFIG_SOC_AHB_GDMA_VERSION=1 +CONFIG_SOC_GDMA_NUM_GROUPS_MAX=1 +CONFIG_SOC_GDMA_PAIRS_PER_GROUP=5 +CONFIG_SOC_GDMA_PAIRS_PER_GROUP_MAX=5 +CONFIG_SOC_AHB_GDMA_SUPPORT_PSRAM=y +CONFIG_SOC_GPIO_PORT=1 +CONFIG_SOC_GPIO_PIN_COUNT=49 +CONFIG_SOC_GPIO_SUPPORT_PIN_GLITCH_FILTER=y +CONFIG_SOC_GPIO_FILTER_CLK_SUPPORT_APB=y +CONFIG_SOC_GPIO_SUPPORT_RTC_INDEPENDENT=y +CONFIG_SOC_GPIO_SUPPORT_FORCE_HOLD=y +CONFIG_SOC_GPIO_VALID_GPIO_MASK=0x1FFFFFFFFFFFF +CONFIG_SOC_GPIO_IN_RANGE_MAX=48 +CONFIG_SOC_GPIO_OUT_RANGE_MAX=48 +CONFIG_SOC_GPIO_VALID_DIGITAL_IO_PAD_MASK=0x0001FFFFFC000000 +CONFIG_SOC_GPIO_CLOCKOUT_BY_IO_MUX=y +CONFIG_SOC_GPIO_CLOCKOUT_CHANNEL_NUM=3 +CONFIG_SOC_GPIO_SUPPORT_HOLD_IO_IN_DSLP=y +CONFIG_SOC_DEDIC_GPIO_OUT_CHANNELS_NUM=8 +CONFIG_SOC_DEDIC_GPIO_IN_CHANNELS_NUM=8 +CONFIG_SOC_DEDIC_GPIO_OUT_AUTO_ENABLE=y +CONFIG_SOC_I2C_NUM=2 +CONFIG_SOC_HP_I2C_NUM=2 +CONFIG_SOC_I2C_FIFO_LEN=32 +CONFIG_SOC_I2C_CMD_REG_NUM=8 +CONFIG_SOC_I2C_SUPPORT_SLAVE=y +CONFIG_SOC_I2C_SUPPORT_HW_CLR_BUS=y +CONFIG_SOC_I2C_SUPPORT_XTAL=y +CONFIG_SOC_I2C_SUPPORT_RTC=y +CONFIG_SOC_I2C_SUPPORT_10BIT_ADDR=y +CONFIG_SOC_I2C_SLAVE_SUPPORT_BROADCAST=y +CONFIG_SOC_I2C_SLAVE_SUPPORT_I2CRAM_ACCESS=y +CONFIG_SOC_I2C_SLAVE_CAN_GET_STRETCH_CAUSE=y +CONFIG_SOC_I2S_NUM=2 +CONFIG_SOC_I2S_HW_VERSION_2=y +CONFIG_SOC_I2S_SUPPORTS_XTAL=y +CONFIG_SOC_I2S_SUPPORTS_PLL_F160M=y +CONFIG_SOC_I2S_SUPPORTS_PCM=y +CONFIG_SOC_I2S_SUPPORTS_PDM=y +CONFIG_SOC_I2S_SUPPORTS_PDM_TX=y +CONFIG_SOC_I2S_SUPPORTS_PCM2PDM=y +CONFIG_SOC_I2S_SUPPORTS_PDM_RX=y +CONFIG_SOC_I2S_SUPPORTS_PDM2PCM=y +CONFIG_SOC_I2S_PDM_MAX_TX_LINES=2 +CONFIG_SOC_I2S_PDM_MAX_RX_LINES=4 +CONFIG_SOC_I2S_SUPPORTS_TDM=y +CONFIG_SOC_LEDC_SUPPORT_APB_CLOCK=y +CONFIG_SOC_LEDC_SUPPORT_XTAL_CLOCK=y +CONFIG_SOC_LEDC_TIMER_NUM=4 +CONFIG_SOC_LEDC_CHANNEL_NUM=8 +CONFIG_SOC_LEDC_TIMER_BIT_WIDTH=14 +CONFIG_SOC_LEDC_SUPPORT_FADE_STOP=y +CONFIG_SOC_MCPWM_GROUPS=2 +CONFIG_SOC_MCPWM_TIMERS_PER_GROUP=3 +CONFIG_SOC_MCPWM_OPERATORS_PER_GROUP=3 +CONFIG_SOC_MCPWM_COMPARATORS_PER_OPERATOR=2 +CONFIG_SOC_MCPWM_GENERATORS_PER_OPERATOR=2 +CONFIG_SOC_MCPWM_TRIGGERS_PER_OPERATOR=2 +CONFIG_SOC_MCPWM_GPIO_FAULTS_PER_GROUP=3 +CONFIG_SOC_MCPWM_CAPTURE_TIMERS_PER_GROUP=y +CONFIG_SOC_MCPWM_CAPTURE_CHANNELS_PER_TIMER=3 +CONFIG_SOC_MCPWM_GPIO_SYNCHROS_PER_GROUP=3 +CONFIG_SOC_MCPWM_SWSYNC_CAN_PROPAGATE=y +CONFIG_SOC_MMU_LINEAR_ADDRESS_REGION_NUM=1 +CONFIG_SOC_MMU_PERIPH_NUM=1 +CONFIG_SOC_MPU_MIN_REGION_SIZE=0x20000000 +CONFIG_SOC_MPU_REGIONS_MAX_NUM=8 +CONFIG_SOC_PCNT_GROUPS=1 +CONFIG_SOC_PCNT_UNITS_PER_GROUP=4 +CONFIG_SOC_PCNT_CHANNELS_PER_UNIT=2 +CONFIG_SOC_PCNT_THRES_POINT_PER_UNIT=2 +CONFIG_SOC_RMT_GROUPS=1 +CONFIG_SOC_RMT_TX_CANDIDATES_PER_GROUP=4 +CONFIG_SOC_RMT_RX_CANDIDATES_PER_GROUP=4 +CONFIG_SOC_RMT_CHANNELS_PER_GROUP=8 +CONFIG_SOC_RMT_MEM_WORDS_PER_CHANNEL=48 +CONFIG_SOC_RMT_SUPPORT_RX_PINGPONG=y +CONFIG_SOC_RMT_SUPPORT_RX_DEMODULATION=y +CONFIG_SOC_RMT_SUPPORT_TX_ASYNC_STOP=y +CONFIG_SOC_RMT_SUPPORT_TX_LOOP_COUNT=y +CONFIG_SOC_RMT_SUPPORT_TX_LOOP_AUTO_STOP=y +CONFIG_SOC_RMT_SUPPORT_TX_SYNCHRO=y +CONFIG_SOC_RMT_SUPPORT_TX_CARRIER_DATA_ONLY=y +CONFIG_SOC_RMT_SUPPORT_XTAL=y +CONFIG_SOC_RMT_SUPPORT_RC_FAST=y +CONFIG_SOC_RMT_SUPPORT_APB=y +CONFIG_SOC_RMT_SUPPORT_DMA=y +CONFIG_SOC_LCD_I80_SUPPORTED=y +CONFIG_SOC_LCD_RGB_SUPPORTED=y +CONFIG_SOC_LCD_I80_BUSES=1 +CONFIG_SOC_LCD_RGB_PANELS=1 +CONFIG_SOC_LCD_I80_BUS_WIDTH=16 +CONFIG_SOC_LCD_RGB_DATA_WIDTH=16 +CONFIG_SOC_LCD_SUPPORT_RGB_YUV_CONV=y +CONFIG_SOC_LCDCAM_I80_NUM_BUSES=1 +CONFIG_SOC_LCDCAM_I80_BUS_WIDTH=16 +CONFIG_SOC_LCDCAM_RGB_NUM_PANELS=1 +CONFIG_SOC_LCDCAM_RGB_DATA_WIDTH=16 +CONFIG_SOC_RTC_CNTL_CPU_PD_DMA_BUS_WIDTH=128 +CONFIG_SOC_RTC_CNTL_CPU_PD_REG_FILE_NUM=549 +CONFIG_SOC_RTC_CNTL_TAGMEM_PD_DMA_BUS_WIDTH=128 +CONFIG_SOC_RTCIO_PIN_COUNT=22 +CONFIG_SOC_RTCIO_INPUT_OUTPUT_SUPPORTED=y +CONFIG_SOC_RTCIO_HOLD_SUPPORTED=y +CONFIG_SOC_RTCIO_WAKE_SUPPORTED=y +CONFIG_SOC_LP_IO_CLOCK_IS_INDEPENDENT=y +CONFIG_SOC_SDM_GROUPS=1 +CONFIG_SOC_SDM_CHANNELS_PER_GROUP=8 +CONFIG_SOC_SDM_CLK_SUPPORT_APB=y +CONFIG_SOC_SPI_PERIPH_NUM=3 +CONFIG_SOC_SPI_MAX_CS_NUM=6 +CONFIG_SOC_SPI_MAXIMUM_BUFFER_SIZE=64 +CONFIG_SOC_SPI_SUPPORT_DDRCLK=y +CONFIG_SOC_SPI_SLAVE_SUPPORT_SEG_TRANS=y +CONFIG_SOC_SPI_SUPPORT_CD_SIG=y +CONFIG_SOC_SPI_SUPPORT_CONTINUOUS_TRANS=y +CONFIG_SOC_SPI_SUPPORT_SLAVE_HD_VER2=y +CONFIG_SOC_SPI_SUPPORT_CLK_APB=y +CONFIG_SOC_SPI_SUPPORT_CLK_XTAL=y +CONFIG_SOC_SPI_PERIPH_SUPPORT_CONTROL_DUMMY_OUT=y +CONFIG_SOC_MEMSPI_IS_INDEPENDENT=y +CONFIG_SOC_SPI_MAX_PRE_DIVIDER=16 +CONFIG_SOC_SPI_SUPPORT_OCT=y +CONFIG_SOC_SPI_SCT_SUPPORTED=y +CONFIG_SOC_SPI_SCT_REG_NUM=14 +CONFIG_SOC_SPI_SCT_BUFFER_NUM_MAX=y +CONFIG_SOC_SPI_SCT_CONF_BITLEN_MAX=0x3FFFA +CONFIG_SOC_MEMSPI_SRC_FREQ_120M_SUPPORTED=y +CONFIG_SOC_MEMSPI_SRC_FREQ_80M_SUPPORTED=y +CONFIG_SOC_MEMSPI_SRC_FREQ_40M_SUPPORTED=y +CONFIG_SOC_MEMSPI_SRC_FREQ_20M_SUPPORTED=y +CONFIG_SOC_SPIRAM_SUPPORTED=y +CONFIG_SOC_SPIRAM_XIP_SUPPORTED=y +CONFIG_SOC_SYSTIMER_COUNTER_NUM=2 +CONFIG_SOC_SYSTIMER_ALARM_NUM=3 +CONFIG_SOC_SYSTIMER_BIT_WIDTH_LO=32 +CONFIG_SOC_SYSTIMER_BIT_WIDTH_HI=20 +CONFIG_SOC_SYSTIMER_FIXED_DIVIDER=y +CONFIG_SOC_SYSTIMER_INT_LEVEL=y +CONFIG_SOC_SYSTIMER_ALARM_MISS_COMPENSATE=y +CONFIG_SOC_TIMER_GROUPS=2 +CONFIG_SOC_TIMER_GROUP_TIMERS_PER_GROUP=2 +CONFIG_SOC_TIMER_GROUP_COUNTER_BIT_WIDTH=54 +CONFIG_SOC_TIMER_GROUP_SUPPORT_XTAL=y +CONFIG_SOC_TIMER_GROUP_SUPPORT_APB=y +CONFIG_SOC_TIMER_GROUP_TOTAL_TIMERS=4 +CONFIG_SOC_LP_TIMER_BIT_WIDTH_LO=32 +CONFIG_SOC_LP_TIMER_BIT_WIDTH_HI=16 +CONFIG_SOC_TOUCH_SENSOR_VERSION=2 +CONFIG_SOC_TOUCH_SENSOR_NUM=15 +CONFIG_SOC_TOUCH_MIN_CHAN_ID=1 +CONFIG_SOC_TOUCH_MAX_CHAN_ID=14 +CONFIG_SOC_TOUCH_SUPPORT_BENCHMARK=y +CONFIG_SOC_TOUCH_SUPPORT_SLEEP_WAKEUP=y +CONFIG_SOC_TOUCH_SUPPORT_WATERPROOF=y +CONFIG_SOC_TOUCH_SUPPORT_PROX_SENSING=y +CONFIG_SOC_TOUCH_SUPPORT_DENOISE_CHAN=y +CONFIG_SOC_TOUCH_PROXIMITY_CHANNEL_NUM=3 +CONFIG_SOC_TOUCH_PROXIMITY_MEAS_DONE_SUPPORTED=y +CONFIG_SOC_TOUCH_SAMPLE_CFG_NUM=1 +CONFIG_SOC_TWAI_CONTROLLER_NUM=1 +CONFIG_SOC_TWAI_MASK_FILTER_NUM=1 +CONFIG_SOC_TWAI_CLK_SUPPORT_APB=y +CONFIG_SOC_TWAI_BRP_MIN=2 +CONFIG_SOC_TWAI_BRP_MAX=16384 +CONFIG_SOC_TWAI_SUPPORTS_RX_STATUS=y +CONFIG_SOC_UART_NUM=3 +CONFIG_SOC_UART_HP_NUM=3 +CONFIG_SOC_UART_FIFO_LEN=128 +CONFIG_SOC_UART_BITRATE_MAX=5000000 +CONFIG_SOC_UART_SUPPORT_FSM_TX_WAIT_SEND=y +CONFIG_SOC_UART_SUPPORT_WAKEUP_INT=y +CONFIG_SOC_UART_SUPPORT_APB_CLK=y +CONFIG_SOC_UART_SUPPORT_RTC_CLK=y +CONFIG_SOC_UART_SUPPORT_XTAL_CLK=y +CONFIG_SOC_UART_WAKEUP_SUPPORT_ACTIVE_THRESH_MODE=y +CONFIG_SOC_UHCI_NUM=1 +CONFIG_SOC_USB_OTG_PERIPH_NUM=1 +CONFIG_SOC_SHA_DMA_MAX_BUFFER_SIZE=3968 +CONFIG_SOC_SHA_SUPPORT_DMA=y +CONFIG_SOC_SHA_SUPPORT_RESUME=y +CONFIG_SOC_SHA_GDMA=y +CONFIG_SOC_SHA_SUPPORT_SHA1=y +CONFIG_SOC_SHA_SUPPORT_SHA224=y +CONFIG_SOC_SHA_SUPPORT_SHA256=y +CONFIG_SOC_SHA_SUPPORT_SHA384=y +CONFIG_SOC_SHA_SUPPORT_SHA512=y +CONFIG_SOC_SHA_SUPPORT_SHA512_224=y +CONFIG_SOC_SHA_SUPPORT_SHA512_256=y +CONFIG_SOC_SHA_SUPPORT_SHA512_T=y +CONFIG_SOC_MPI_MEM_BLOCKS_NUM=4 +CONFIG_SOC_MPI_OPERATIONS_NUM=3 +CONFIG_SOC_RSA_MAX_BIT_LEN=4096 +CONFIG_SOC_AES_SUPPORT_DMA=y +CONFIG_SOC_AES_GDMA=y +CONFIG_SOC_AES_SUPPORT_AES_128=y +CONFIG_SOC_AES_SUPPORT_AES_256=y +CONFIG_SOC_PM_SUPPORT_EXT0_WAKEUP=y +CONFIG_SOC_PM_SUPPORT_EXT1_WAKEUP=y +CONFIG_SOC_PM_SUPPORT_EXT_WAKEUP=y +CONFIG_SOC_PM_SUPPORT_WIFI_WAKEUP=y +CONFIG_SOC_PM_SUPPORT_BT_WAKEUP=y +CONFIG_SOC_PM_SUPPORT_TOUCH_SENSOR_WAKEUP=y +CONFIG_SOC_PM_SUPPORT_CPU_PD=y +CONFIG_SOC_PM_SUPPORT_TAGMEM_PD=y +CONFIG_SOC_PM_SUPPORT_RTC_PERIPH_PD=y +CONFIG_SOC_PM_SUPPORT_RC_FAST_PD=y +CONFIG_SOC_PM_SUPPORT_VDDSDIO_PD=y +CONFIG_SOC_PM_SUPPORT_MAC_BB_PD=y +CONFIG_SOC_PM_SUPPORT_MODEM_PD=y +CONFIG_SOC_CONFIGURABLE_VDDSDIO_SUPPORTED=y +CONFIG_SOC_PM_SUPPORT_DEEPSLEEP_CHECK_STUB_ONLY=y +CONFIG_SOC_PM_CPU_RETENTION_BY_RTCCNTL=y +CONFIG_SOC_PM_MODEM_RETENTION_BY_BACKUPDMA=y +CONFIG_SOC_PM_MODEM_PD_BY_SW=y +CONFIG_SOC_CLK_RC_FAST_D256_SUPPORTED=y +CONFIG_SOC_RTC_SLOW_CLK_SUPPORT_RC_FAST_D256=y +CONFIG_SOC_CLK_RC_FAST_SUPPORT_CALIBRATION=y +CONFIG_SOC_CLK_XTAL32K_SUPPORTED=y +CONFIG_SOC_CLK_LP_FAST_SUPPORT_XTAL_D2=y +CONFIG_SOC_EFUSE_DIS_DOWNLOAD_ICACHE=y +CONFIG_SOC_EFUSE_DIS_DOWNLOAD_DCACHE=y +CONFIG_SOC_EFUSE_HARD_DIS_JTAG=y +CONFIG_SOC_EFUSE_DIS_USB_JTAG=y +CONFIG_SOC_EFUSE_SOFT_DIS_JTAG=y +CONFIG_SOC_EFUSE_DIS_DIRECT_BOOT=y +CONFIG_SOC_EFUSE_DIS_ICACHE=y +CONFIG_SOC_EFUSE_BLOCK9_KEY_PURPOSE_QUIRK=y +CONFIG_SOC_SECURE_BOOT_V2_RSA=y +CONFIG_SOC_EFUSE_SECURE_BOOT_KEY_DIGESTS=3 +CONFIG_SOC_EFUSE_REVOKE_BOOT_KEY_DIGESTS=y +CONFIG_SOC_SUPPORT_SECURE_BOOT_REVOKE_KEY=y +CONFIG_SOC_FLASH_ENCRYPTED_XTS_AES_BLOCK_MAX=64 +CONFIG_SOC_FLASH_ENCRYPTION_XTS_AES=y +CONFIG_SOC_FLASH_ENCRYPTION_XTS_AES_OPTIONS=y +CONFIG_SOC_FLASH_ENCRYPTION_XTS_AES_128=y +CONFIG_SOC_FLASH_ENCRYPTION_XTS_AES_256=y +CONFIG_SOC_MEMPROT_CPU_PREFETCH_PAD_SIZE=16 +CONFIG_SOC_MEMPROT_MEM_ALIGN_SIZE=256 +CONFIG_SOC_PHY_DIG_REGS_MEM_SIZE=21 +CONFIG_SOC_MAC_BB_PD_MEM_SIZE=192 +CONFIG_SOC_WIFI_LIGHT_SLEEP_CLK_WIDTH=12 +CONFIG_SOC_SPI_MEM_SUPPORT_AUTO_WAIT_IDLE=y +CONFIG_SOC_SPI_MEM_SUPPORT_AUTO_SUSPEND=y +CONFIG_SOC_SPI_MEM_SUPPORT_AUTO_RESUME=y +CONFIG_SOC_SPI_MEM_SUPPORT_SW_SUSPEND=y +CONFIG_SOC_SPI_MEM_SUPPORT_FLASH_OPI_MODE=y +CONFIG_SOC_SPI_MEM_SUPPORT_TIMING_TUNING=y +CONFIG_SOC_SPI_MEM_SUPPORT_CONFIG_GPIO_BY_EFUSE=y +CONFIG_SOC_SPI_MEM_SUPPORT_WRAP=y +CONFIG_SOC_MEMSPI_TIMING_TUNING_BY_MSPI_DELAY=y +CONFIG_SOC_MEMSPI_CORE_CLK_SHARED_WITH_PSRAM=y +CONFIG_SOC_SPI_MEM_SUPPORT_CACHE_32BIT_ADDR_MAP=y +CONFIG_SOC_COEX_HW_PTI=y +CONFIG_SOC_EXTERNAL_COEX_LEADER_TX_LINE=y +CONFIG_SOC_SDMMC_USE_GPIO_MATRIX=y +CONFIG_SOC_SDMMC_NUM_SLOTS=2 +CONFIG_SOC_SDMMC_SUPPORT_XTAL_CLOCK=y +CONFIG_SOC_SDMMC_DELAY_PHASE_NUM=4 +CONFIG_SOC_TEMPERATURE_SENSOR_SUPPORT_FAST_RC=y +CONFIG_SOC_WIFI_HW_TSF=y +CONFIG_SOC_WIFI_FTM_SUPPORT=y +CONFIG_SOC_WIFI_GCMP_SUPPORT=y +CONFIG_SOC_WIFI_WAPI_SUPPORT=y +CONFIG_SOC_WIFI_CSI_SUPPORT=y +CONFIG_SOC_WIFI_MESH_SUPPORT=y +CONFIG_SOC_WIFI_SUPPORT_VARIABLE_BEACON_WINDOW=y +CONFIG_SOC_WIFI_PHY_NEEDS_USB_WORKAROUND=y +CONFIG_SOC_BLE_SUPPORTED=y +CONFIG_SOC_BLE_MESH_SUPPORTED=y +CONFIG_SOC_BLE_50_SUPPORTED=y +CONFIG_SOC_BLE_DEVICE_PRIVACY_SUPPORTED=y +CONFIG_SOC_BLUFI_SUPPORTED=y +CONFIG_SOC_ULP_HAS_ADC=y +CONFIG_SOC_PHY_COMBO_MODULE=y +CONFIG_SOC_LCDCAM_CAM_SUPPORT_RGB_YUV_CONV=y +CONFIG_SOC_LCDCAM_CAM_PERIPH_NUM=1 +CONFIG_SOC_LCDCAM_CAM_DATA_WIDTH_MAX=16 +CONFIG_IDF_CMAKE=y +CONFIG_IDF_TOOLCHAIN="gcc" +CONFIG_IDF_TOOLCHAIN_GCC=y +CONFIG_IDF_TARGET_ARCH_XTENSA=y +CONFIG_IDF_TARGET_ARCH="xtensa" +CONFIG_IDF_TARGET="esp32s3" +CONFIG_IDF_INIT_VERSION="5.5.1" +CONFIG_IDF_TARGET_ESP32S3=y +CONFIG_IDF_FIRMWARE_CHIP_ID=0x0009 + +# +# Build type +# +CONFIG_APP_BUILD_TYPE_APP_2NDBOOT=y +# CONFIG_APP_BUILD_TYPE_RAM is not set +CONFIG_APP_BUILD_GENERATE_BINARIES=y +CONFIG_APP_BUILD_BOOTLOADER=y +CONFIG_APP_BUILD_USE_FLASH_SECTIONS=y +# CONFIG_APP_REPRODUCIBLE_BUILD is not set +# CONFIG_APP_NO_BLOBS is not set +# end of Build type + +# +# Bootloader config +# + +# +# Bootloader manager +# +CONFIG_BOOTLOADER_COMPILE_TIME_DATE=y +CONFIG_BOOTLOADER_PROJECT_VER=1 +# end of Bootloader manager + +# +# Application Rollback +# +CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE=y +# CONFIG_BOOTLOADER_APP_ANTI_ROLLBACK is not set +# end of Application Rollback + +# +# Recovery Bootloader and Rollback +# +# end of Recovery Bootloader and Rollback + +CONFIG_BOOTLOADER_OFFSET_IN_FLASH=0x0 +CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE=y +# CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_DEBUG is not set +# CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_PERF is not set +# CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_NONE is not set + +# +# Log +# +CONFIG_BOOTLOADER_LOG_VERSION_1=y +CONFIG_BOOTLOADER_LOG_VERSION=1 +# CONFIG_BOOTLOADER_LOG_LEVEL_NONE is not set +# CONFIG_BOOTLOADER_LOG_LEVEL_ERROR is not set +# CONFIG_BOOTLOADER_LOG_LEVEL_WARN is not set +CONFIG_BOOTLOADER_LOG_LEVEL_INFO=y +# CONFIG_BOOTLOADER_LOG_LEVEL_DEBUG is not set +# CONFIG_BOOTLOADER_LOG_LEVEL_VERBOSE is not set +CONFIG_BOOTLOADER_LOG_LEVEL=3 + +# +# Format +# +# CONFIG_BOOTLOADER_LOG_COLORS is not set +CONFIG_BOOTLOADER_LOG_TIMESTAMP_SOURCE_CPU_TICKS=y +# end of Format + +# +# Settings +# +CONFIG_BOOTLOADER_LOG_MODE_TEXT_EN=y +CONFIG_BOOTLOADER_LOG_MODE_TEXT=y +# end of Settings +# end of Log + +# +# Serial Flash Configurations +# +# CONFIG_BOOTLOADER_FLASH_DC_AWARE is not set +CONFIG_BOOTLOADER_FLASH_XMC_SUPPORT=y +# end of Serial Flash Configurations + +CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_9V=y +# CONFIG_BOOTLOADER_FACTORY_RESET is not set +# CONFIG_BOOTLOADER_APP_TEST is not set +CONFIG_BOOTLOADER_REGION_PROTECTION_ENABLE=y +CONFIG_BOOTLOADER_WDT_ENABLE=y +# CONFIG_BOOTLOADER_WDT_DISABLE_IN_USER_CODE is not set +CONFIG_BOOTLOADER_WDT_TIME_MS=9000 +# CONFIG_BOOTLOADER_SKIP_VALIDATE_IN_DEEP_SLEEP is not set +# CONFIG_BOOTLOADER_SKIP_VALIDATE_ON_POWER_ON is not set +# CONFIG_BOOTLOADER_SKIP_VALIDATE_ALWAYS is not set +CONFIG_BOOTLOADER_RESERVE_RTC_SIZE=0 +# CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC is not set +# end of Bootloader config + +# +# Security features +# +CONFIG_SECURE_BOOT_V2_RSA_SUPPORTED=y +CONFIG_SECURE_BOOT_V2_PREFERRED=y +# CONFIG_SECURE_SIGNED_APPS_NO_SECURE_BOOT is not set +# CONFIG_SECURE_BOOT is not set +# CONFIG_SECURE_FLASH_ENC_ENABLED is not set +CONFIG_SECURE_ROM_DL_MODE_ENABLED=y +# end of Security features + +# +# Application manager +# +CONFIG_APP_COMPILE_TIME_DATE=y +# CONFIG_APP_EXCLUDE_PROJECT_VER_VAR is not set +# CONFIG_APP_EXCLUDE_PROJECT_NAME_VAR is not set +# CONFIG_APP_PROJECT_VER_FROM_CONFIG is not set +CONFIG_APP_RETRIEVE_LEN_ELF_SHA=16 +# end of Application manager + +CONFIG_ESP_ROM_HAS_CRC_LE=y +CONFIG_ESP_ROM_HAS_CRC_BE=y +CONFIG_ESP_ROM_HAS_MZ_CRC32=y +CONFIG_ESP_ROM_HAS_JPEG_DECODE=y +CONFIG_ESP_ROM_UART_CLK_IS_XTAL=y +CONFIG_ESP_ROM_HAS_RETARGETABLE_LOCKING=y +CONFIG_ESP_ROM_USB_OTG_NUM=3 +CONFIG_ESP_ROM_USB_SERIAL_DEVICE_NUM=4 +CONFIG_ESP_ROM_HAS_ERASE_0_REGION_BUG=y +CONFIG_ESP_ROM_HAS_ENCRYPTED_WRITES_USING_LEGACY_DRV=y +CONFIG_ESP_ROM_GET_CLK_FREQ=y +CONFIG_ESP_ROM_HAS_HAL_WDT=y +CONFIG_ESP_ROM_NEEDS_SWSETUP_WORKAROUND=y +CONFIG_ESP_ROM_HAS_LAYOUT_TABLE=y +CONFIG_ESP_ROM_HAS_SPI_FLASH=y +CONFIG_ESP_ROM_HAS_SPI_FLASH_MMAP=y +CONFIG_ESP_ROM_HAS_ETS_PRINTF_BUG=y +CONFIG_ESP_ROM_HAS_NEWLIB=y +CONFIG_ESP_ROM_HAS_NEWLIB_NANO_FORMAT=y +CONFIG_ESP_ROM_HAS_NEWLIB_32BIT_TIME=y +CONFIG_ESP_ROM_NEEDS_SET_CACHE_MMU_SIZE=y +CONFIG_ESP_ROM_RAM_APP_NEEDS_MMU_INIT=y +CONFIG_ESP_ROM_HAS_FLASH_COUNT_PAGES_BUG=y +CONFIG_ESP_ROM_HAS_CACHE_SUSPEND_WAITI_BUG=y +CONFIG_ESP_ROM_HAS_CACHE_WRITEBACK_BUG=y +CONFIG_ESP_ROM_HAS_SW_FLOAT=y +CONFIG_ESP_ROM_HAS_VERSION=y +CONFIG_ESP_ROM_SUPPORT_DEEP_SLEEP_WAKEUP_STUB=y +CONFIG_ESP_ROM_HAS_OUTPUT_PUTC_FUNC=y +CONFIG_ESP_ROM_CONSOLE_OUTPUT_SECONDARY=y + +# +# Boot ROM Behavior +# +CONFIG_BOOT_ROM_LOG_ALWAYS_ON=y +# CONFIG_BOOT_ROM_LOG_ALWAYS_OFF is not set +# CONFIG_BOOT_ROM_LOG_ON_GPIO_HIGH is not set +# CONFIG_BOOT_ROM_LOG_ON_GPIO_LOW is not set +# end of Boot ROM Behavior + +# +# Serial flasher config +# +# CONFIG_ESPTOOLPY_NO_STUB is not set +# CONFIG_ESPTOOLPY_OCT_FLASH is not set +CONFIG_ESPTOOLPY_FLASH_MODE_AUTO_DETECT=y +# CONFIG_ESPTOOLPY_FLASHMODE_QIO is not set +# CONFIG_ESPTOOLPY_FLASHMODE_QOUT is not set +CONFIG_ESPTOOLPY_FLASHMODE_DIO=y +# CONFIG_ESPTOOLPY_FLASHMODE_DOUT is not set +CONFIG_ESPTOOLPY_FLASH_SAMPLE_MODE_STR=y +CONFIG_ESPTOOLPY_FLASHMODE="dio" +# CONFIG_ESPTOOLPY_FLASHFREQ_120M is not set +CONFIG_ESPTOOLPY_FLASHFREQ_80M=y +# CONFIG_ESPTOOLPY_FLASHFREQ_40M is not set +# CONFIG_ESPTOOLPY_FLASHFREQ_20M is not set +CONFIG_ESPTOOLPY_FLASHFREQ="80m" +# CONFIG_ESPTOOLPY_FLASHSIZE_1MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_2MB is not set +CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y +# CONFIG_ESPTOOLPY_FLASHSIZE_8MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_16MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_32MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_64MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_128MB is not set +CONFIG_ESPTOOLPY_FLASHSIZE="4MB" +# CONFIG_ESPTOOLPY_HEADER_FLASHSIZE_UPDATE is not set +CONFIG_ESPTOOLPY_BEFORE_RESET=y +# CONFIG_ESPTOOLPY_BEFORE_NORESET is not set +CONFIG_ESPTOOLPY_BEFORE="default_reset" +CONFIG_ESPTOOLPY_AFTER_RESET=y +# CONFIG_ESPTOOLPY_AFTER_NORESET is not set +CONFIG_ESPTOOLPY_AFTER="hard_reset" +CONFIG_ESPTOOLPY_MONITOR_BAUD=115200 +# end of Serial flasher config + +# +# Partition Table +# +# CONFIG_PARTITION_TABLE_SINGLE_APP is not set +# CONFIG_PARTITION_TABLE_SINGLE_APP_LARGE is not set +# CONFIG_PARTITION_TABLE_TWO_OTA is not set +# CONFIG_PARTITION_TABLE_TWO_OTA_LARGE is not set +CONFIG_PARTITION_TABLE_CUSTOM=y +CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv" +CONFIG_PARTITION_TABLE_FILENAME="partitions.csv" +CONFIG_PARTITION_TABLE_OFFSET=0x8000 +CONFIG_PARTITION_TABLE_MD5=y +# end of Partition Table + +# +# Snapclient Configuration +# +CONFIG_SNAPSERVER_USE_MDNS=y +# CONFIG_SNAPCLIENT_CONNECT_IPV6 is not set +CONFIG_SNAPCLIENT_NAME="louder-esp32s3" + +# +# HTTP Server Setting +# +CONFIG_WEB_PORT=80 +# end of HTTP Server Setting + +CONFIG_USE_SAMPLE_INSERTION=y +# end of Snapclient Configuration + +# +# Audio Board +# +CONFIG_AUDIO_BOARD_CUSTOM=y +# CONFIG_ESP_LYRAT_V4_3_BOARD is not set +# CONFIG_ESP_LYRAT_V4_2_BOARD is not set +# CONFIG_ESP_LYRATD_MSC_V2_1_BOARD is not set +# CONFIG_ESP_LYRATD_MSC_V2_2_BOARD is not set +# CONFIG_ESP_LYRAT_MINI_V1_1_BOARD is not set +# CONFIG_ESP32_KORVO_DU1906_BOARD is not set +# CONFIG_ESP32_S2_KALUGA_1_V1_2_BOARD is not set +# CONFIG_ESP_AI_THINKER_ES8388_BOARD is not set + +# +# Custom Audio Board +# +# CONFIG_DAC_PCM51XX is not set +# CONFIG_DAC_PCM5102A is not set +# CONFIG_DAC_MA120 is not set +# CONFIG_DAC_MA120X0 is not set +# CONFIG_DAC_ADAU1961 is not set +# CONFIG_DAC_MAX98357 is not set +CONFIG_DAC_TAS5805M=y +# CONFIG_DAC_PT8211 is not set + +# +# DAC I2C control interface +# +CONFIG_DAC_I2C_SDA=8 +CONFIG_DAC_I2C_SCL=9 +CONFIG_DAC_I2C_ADDR=0x2D +# end of DAC I2C control interface + +# +# I2S master interface +# +CONFIG_MASTER_I2S_MCLK_PIN=0 +CONFIG_MASTER_I2S_BCK_PIN=14 +CONFIG_MASTER_I2S_LRCK_PIN=15 +CONFIG_MASTER_I2S_DATAOUT_PIN=16 +# end of I2S master interface + +# +# TAS5805M interface Configuration +# +CONFIG_PIN_DAC_PWDN=17 +# end of TAS5805M interface Configuration + +# +# DAC-Operation-Mode +# +CONFIG_DAC_BRIDGE_MODE_DISABLED=y +# CONFIG_DAC_BRIDGE_MODE_MONO is not set +# CONFIG_DAC_BRIDGE_MODE_LEFT is not set +# CONFIG_DAC_BRIDGE_MODE_RIGHT is not set +# end of DAC-Operation-Mode + +# +# Logic-Level-Settings +# +# CONFIG_INVERT_MCLK_LEVEL is not set +# CONFIG_INVERT_WORD_SELECT_LEVEL is not set +# CONFIG_INVERT_BCLK_LEVEL is not set +# end of Logic-Level-Settings +# end of Custom Audio Board +# end of Audio Board + +# +# ESP32 DSP processor config +# +CONFIG_USE_DSP_PROCESSOR=y +# CONFIG_SNAPCLIENT_MIX_LR_TO_MONO is not set +# CONFIG_USE_BIQUAD_ASM is not set +# CONFIG_SNAPCLIENT_USE_SOFT_VOL is not set +# end of ESP32 DSP processor config + +# +# SNTP Configuration +# +CONFIG_SNTP_TIMEZONE="UTC" +CONFIG_SNTP_SERVER="pool.ntp.org" +# end of SNTP Configuration + +# +# Snapclient Ethernet Configuration +# +CONFIG_ENV_GPIO_RANGE_MIN=0 +CONFIG_ENV_GPIO_RANGE_MAX=48 +CONFIG_ENV_GPIO_IN_RANGE_MAX=48 +CONFIG_ENV_GPIO_OUT_RANGE_MAX=48 +# CONFIG_SNAPCLIENT_USE_SPI_ETHERNET is not set +# end of Snapclient Ethernet Configuration + +# +# Wifi Configuration +# +CONFIG_ENABLE_WIFI_PROVISIONING=y +# CONFIG_WIFI_AUTH_WEP is not set +# CONFIG_WIFI_AUTH_WPA_PSK is not set +# CONFIG_WIFI_AUTH_WPA2_PSK is not set +# CONFIG_WIFI_AUTH_WPA_WPA2_PSK is not set +CONFIG_WIFI_AUTH_WPA2_WPA3_PSK=y +# CONFIG_WIFI_AUTH_ENTERPRISE is not set +# CONFIG_WIFI_AUTH_WPA2_ENTERPRISE is not set +# CONFIG_WIFI_AUTH_WPA3_PSK is not set +# CONFIG_WIFI_AUTH_WPA3_ENT_192 is not set +# CONFIG_WIFI_AUTH_WAPI_PSK is not set +# CONFIG_WIFI_AUTH_OWE is not set +CONFIG_WIFI_MAXIMUM_RETRY=0 +# end of Wifi Configuration + +# +# Compiler options +# +# CONFIG_COMPILER_OPTIMIZATION_DEBUG is not set +# CONFIG_COMPILER_OPTIMIZATION_SIZE is not set +CONFIG_COMPILER_OPTIMIZATION_PERF=y +# CONFIG_COMPILER_OPTIMIZATION_NONE is not set +CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE=y +# CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT is not set +# CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE is not set +CONFIG_COMPILER_ASSERT_NDEBUG_EVALUATE=y +CONFIG_COMPILER_FLOAT_LIB_FROM_GCCLIB=y +CONFIG_COMPILER_OPTIMIZATION_ASSERTION_LEVEL=2 +# CONFIG_COMPILER_OPTIMIZATION_CHECKS_SILENT is not set +CONFIG_COMPILER_HIDE_PATHS_MACROS=y +# CONFIG_COMPILER_CXX_EXCEPTIONS is not set +# CONFIG_COMPILER_CXX_RTTI is not set +CONFIG_COMPILER_STACK_CHECK_MODE_NONE=y +# CONFIG_COMPILER_STACK_CHECK_MODE_NORM is not set +# CONFIG_COMPILER_STACK_CHECK_MODE_STRONG is not set +# CONFIG_COMPILER_STACK_CHECK_MODE_ALL is not set +# CONFIG_COMPILER_NO_MERGE_CONSTANTS is not set +# CONFIG_COMPILER_WARN_WRITE_STRINGS is not set +CONFIG_COMPILER_DISABLE_DEFAULT_ERRORS=y +# CONFIG_COMPILER_DISABLE_GCC12_WARNINGS is not set +# CONFIG_COMPILER_DISABLE_GCC13_WARNINGS is not set +# CONFIG_COMPILER_DISABLE_GCC14_WARNINGS is not set +# CONFIG_COMPILER_DUMP_RTL_FILES is not set +CONFIG_COMPILER_RT_LIB_GCCLIB=y +CONFIG_COMPILER_RT_LIB_NAME="gcc" +CONFIG_COMPILER_ORPHAN_SECTIONS_WARNING=y +# CONFIG_COMPILER_ORPHAN_SECTIONS_PLACE is not set +# CONFIG_COMPILER_STATIC_ANALYZER is not set +# end of Compiler options + +# +# Component config +# + +# +# Application Level Tracing +# +# CONFIG_APPTRACE_DEST_JTAG is not set +CONFIG_APPTRACE_DEST_NONE=y +# CONFIG_APPTRACE_DEST_UART1 is not set +# CONFIG_APPTRACE_DEST_UART2 is not set +# CONFIG_APPTRACE_DEST_USB_CDC is not set +CONFIG_APPTRACE_DEST_UART_NONE=y +CONFIG_APPTRACE_UART_TASK_PRIO=1 +CONFIG_APPTRACE_LOCK_ENABLE=y +# end of Application Level Tracing + +# +# Bluetooth +# +# CONFIG_BT_ENABLED is not set + +# +# Common Options +# +# CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED is not set +# CONFIG_BT_BLE_LOG_UHCI_OUT_ENABLED is not set +# end of Common Options +# end of Bluetooth + +# +# Console Library +# +# CONFIG_CONSOLE_SORTED_HELP is not set +# end of Console Library + +# +# Driver Configurations +# + +# +# Legacy TWAI Driver Configurations +# +# CONFIG_TWAI_SKIP_LEGACY_CONFLICT_CHECK is not set +CONFIG_TWAI_ERRATA_FIX_LISTEN_ONLY_DOM=y +# end of Legacy TWAI Driver Configurations + +# +# Legacy ADC Driver Configuration +# +# CONFIG_ADC_SUPPRESS_DEPRECATE_WARN is not set +# CONFIG_ADC_SKIP_LEGACY_CONFLICT_CHECK is not set + +# +# Legacy ADC Calibration Configuration +# +# CONFIG_ADC_CALI_SUPPRESS_DEPRECATE_WARN is not set +# end of Legacy ADC Calibration Configuration +# end of Legacy ADC Driver Configuration + +# +# Legacy MCPWM Driver Configurations +# +# CONFIG_MCPWM_SUPPRESS_DEPRECATE_WARN is not set +# CONFIG_MCPWM_SKIP_LEGACY_CONFLICT_CHECK is not set +# end of Legacy MCPWM Driver Configurations + +# +# Legacy Timer Group Driver Configurations +# +# CONFIG_GPTIMER_SUPPRESS_DEPRECATE_WARN is not set +# CONFIG_GPTIMER_SKIP_LEGACY_CONFLICT_CHECK is not set +# end of Legacy Timer Group Driver Configurations + +# +# Legacy RMT Driver Configurations +# +# CONFIG_RMT_SUPPRESS_DEPRECATE_WARN is not set +# CONFIG_RMT_SKIP_LEGACY_CONFLICT_CHECK is not set +# end of Legacy RMT Driver Configurations + +# +# Legacy I2S Driver Configurations +# +# CONFIG_I2S_SUPPRESS_DEPRECATE_WARN is not set +# CONFIG_I2S_SKIP_LEGACY_CONFLICT_CHECK is not set +# end of Legacy I2S Driver Configurations + +# +# Legacy I2C Driver Configurations +# +# CONFIG_I2C_SKIP_LEGACY_CONFLICT_CHECK is not set +# end of Legacy I2C Driver Configurations + +# +# Legacy PCNT Driver Configurations +# +# CONFIG_PCNT_SUPPRESS_DEPRECATE_WARN is not set +# CONFIG_PCNT_SKIP_LEGACY_CONFLICT_CHECK is not set +# end of Legacy PCNT Driver Configurations + +# +# Legacy SDM Driver Configurations +# +# CONFIG_SDM_SUPPRESS_DEPRECATE_WARN is not set +# CONFIG_SDM_SKIP_LEGACY_CONFLICT_CHECK is not set +# end of Legacy SDM Driver Configurations + +# +# Legacy Temperature Sensor Driver Configurations +# +# CONFIG_TEMP_SENSOR_SUPPRESS_DEPRECATE_WARN is not set +# CONFIG_TEMP_SENSOR_SKIP_LEGACY_CONFLICT_CHECK is not set +# end of Legacy Temperature Sensor Driver Configurations + +# +# Legacy Touch Sensor Driver Configurations +# +# CONFIG_TOUCH_SUPPRESS_DEPRECATE_WARN is not set +# CONFIG_TOUCH_SKIP_LEGACY_CONFLICT_CHECK is not set +# end of Legacy Touch Sensor Driver Configurations +# end of Driver Configurations + +# +# eFuse Bit Manager +# +# CONFIG_EFUSE_CUSTOM_TABLE is not set +# CONFIG_EFUSE_VIRTUAL is not set +CONFIG_EFUSE_MAX_BLK_LEN=256 +# end of eFuse Bit Manager + +# +# ESP-TLS +# +CONFIG_ESP_TLS_USING_MBEDTLS=y +# CONFIG_ESP_TLS_USE_SECURE_ELEMENT is not set +CONFIG_ESP_TLS_USE_DS_PERIPHERAL=y +# CONFIG_ESP_TLS_CLIENT_SESSION_TICKETS is not set +# CONFIG_ESP_TLS_SERVER_SESSION_TICKETS is not set +# CONFIG_ESP_TLS_SERVER_CERT_SELECT_HOOK is not set +# CONFIG_ESP_TLS_SERVER_MIN_AUTH_MODE_OPTIONAL is not set +# CONFIG_ESP_TLS_PSK_VERIFICATION is not set +# CONFIG_ESP_TLS_INSECURE is not set +CONFIG_ESP_TLS_DYN_BUF_STRATEGY_SUPPORTED=y +# end of ESP-TLS + +# +# ADC and ADC Calibration +# +# CONFIG_ADC_ONESHOT_CTRL_FUNC_IN_IRAM is not set +# CONFIG_ADC_CONTINUOUS_ISR_IRAM_SAFE is not set +# CONFIG_ADC_CONTINUOUS_FORCE_USE_ADC2_ON_C3_S3 is not set +# CONFIG_ADC_ENABLE_DEBUG_LOG is not set +# end of ADC and ADC Calibration + +# +# Wireless Coexistence +# +CONFIG_ESP_COEX_ENABLED=y +# CONFIG_ESP_COEX_EXTERNAL_COEXIST_ENABLE is not set +# CONFIG_ESP_COEX_GPIO_DEBUG is not set +# end of Wireless Coexistence + +# +# Common ESP-related +# +CONFIG_ESP_ERR_TO_NAME_LOOKUP=y +# end of Common ESP-related + +# +# ESP-Driver:Camera Controller Configurations +# +# CONFIG_CAM_CTLR_DVP_CAM_ISR_CACHE_SAFE is not set +# end of ESP-Driver:Camera Controller Configurations + +# +# ESP-Driver:GPIO Configurations +# +# CONFIG_GPIO_CTRL_FUNC_IN_IRAM is not set +# end of ESP-Driver:GPIO Configurations + +# +# ESP-Driver:GPTimer Configurations +# +CONFIG_GPTIMER_ISR_HANDLER_IN_IRAM=y +# CONFIG_GPTIMER_CTRL_FUNC_IN_IRAM is not set +# CONFIG_GPTIMER_ISR_CACHE_SAFE is not set +CONFIG_GPTIMER_OBJ_CACHE_SAFE=y +# CONFIG_GPTIMER_ENABLE_DEBUG_LOG is not set +# end of ESP-Driver:GPTimer Configurations + +# +# ESP-Driver:I2C Configurations +# +# CONFIG_I2C_ISR_IRAM_SAFE is not set +# CONFIG_I2C_ENABLE_DEBUG_LOG is not set +# CONFIG_I2C_ENABLE_SLAVE_DRIVER_VERSION_2 is not set +CONFIG_I2C_MASTER_ISR_HANDLER_IN_IRAM=y +# end of ESP-Driver:I2C Configurations + +# +# ESP-Driver:I2S Configurations +# +# CONFIG_I2S_ISR_IRAM_SAFE is not set +# CONFIG_I2S_ENABLE_DEBUG_LOG is not set +# end of ESP-Driver:I2S Configurations + +# +# ESP-Driver:LEDC Configurations +# +# CONFIG_LEDC_CTRL_FUNC_IN_IRAM is not set +# end of ESP-Driver:LEDC Configurations + +# +# ESP-Driver:MCPWM Configurations +# +CONFIG_MCPWM_ISR_HANDLER_IN_IRAM=y +# CONFIG_MCPWM_ISR_CACHE_SAFE is not set +# CONFIG_MCPWM_CTRL_FUNC_IN_IRAM is not set +CONFIG_MCPWM_OBJ_CACHE_SAFE=y +# CONFIG_MCPWM_ENABLE_DEBUG_LOG is not set +# end of ESP-Driver:MCPWM Configurations + +# +# ESP-Driver:PCNT Configurations +# +# CONFIG_PCNT_CTRL_FUNC_IN_IRAM is not set +# CONFIG_PCNT_ISR_IRAM_SAFE is not set +# CONFIG_PCNT_ENABLE_DEBUG_LOG is not set +# end of ESP-Driver:PCNT Configurations + +# +# ESP-Driver:RMT Configurations +# +CONFIG_RMT_ENCODER_FUNC_IN_IRAM=y +CONFIG_RMT_TX_ISR_HANDLER_IN_IRAM=y +CONFIG_RMT_RX_ISR_HANDLER_IN_IRAM=y +# CONFIG_RMT_RECV_FUNC_IN_IRAM is not set +# CONFIG_RMT_TX_ISR_CACHE_SAFE is not set +# CONFIG_RMT_RX_ISR_CACHE_SAFE is not set +CONFIG_RMT_OBJ_CACHE_SAFE=y +# CONFIG_RMT_ENABLE_DEBUG_LOG is not set +# CONFIG_RMT_ISR_IRAM_SAFE is not set +# end of ESP-Driver:RMT Configurations + +# +# ESP-Driver:Sigma Delta Modulator Configurations +# +# CONFIG_SDM_CTRL_FUNC_IN_IRAM is not set +# CONFIG_SDM_ENABLE_DEBUG_LOG is not set +# end of ESP-Driver:Sigma Delta Modulator Configurations + +# +# ESP-Driver:SPI Configurations +# +# CONFIG_SPI_MASTER_IN_IRAM is not set +CONFIG_SPI_MASTER_ISR_IN_IRAM=y +# CONFIG_SPI_SLAVE_IN_IRAM is not set +CONFIG_SPI_SLAVE_ISR_IN_IRAM=y +# end of ESP-Driver:SPI Configurations + +# +# ESP-Driver:Touch Sensor Configurations +# +# CONFIG_TOUCH_CTRL_FUNC_IN_IRAM is not set +# CONFIG_TOUCH_ISR_IRAM_SAFE is not set +# CONFIG_TOUCH_ENABLE_DEBUG_LOG is not set +# CONFIG_TOUCH_SKIP_FSM_CHECK is not set +# end of ESP-Driver:Touch Sensor Configurations + +# +# ESP-Driver:Temperature Sensor Configurations +# +# CONFIG_TEMP_SENSOR_ENABLE_DEBUG_LOG is not set +# end of ESP-Driver:Temperature Sensor Configurations + +# +# ESP-Driver:TWAI Configurations +# +# CONFIG_TWAI_ISR_IN_IRAM is not set +# CONFIG_TWAI_ISR_CACHE_SAFE is not set +# CONFIG_TWAI_ENABLE_DEBUG_LOG is not set +# end of ESP-Driver:TWAI Configurations + +# +# ESP-Driver:UART Configurations +# +# CONFIG_UART_ISR_IN_IRAM is not set +# end of ESP-Driver:UART Configurations + +# +# ESP-Driver:UHCI Configurations +# +# CONFIG_UHCI_ISR_HANDLER_IN_IRAM is not set +# CONFIG_UHCI_ISR_CACHE_SAFE is not set +# CONFIG_UHCI_ENABLE_DEBUG_LOG is not set +# end of ESP-Driver:UHCI Configurations + +# +# ESP-Driver:USB Serial/JTAG Configuration +# +CONFIG_USJ_ENABLE_USB_SERIAL_JTAG=y +# end of ESP-Driver:USB Serial/JTAG Configuration + +# +# Ethernet +# +CONFIG_ETH_ENABLED=y +CONFIG_ETH_USE_SPI_ETHERNET=y +# CONFIG_ETH_SPI_ETHERNET_DM9051 is not set +# CONFIG_ETH_SPI_ETHERNET_W5500 is not set +# CONFIG_ETH_SPI_ETHERNET_KSZ8851SNL is not set +# CONFIG_ETH_USE_OPENETH is not set +# CONFIG_ETH_TRANSMIT_MUTEX is not set +# end of Ethernet + +# +# Event Loop Library +# +# CONFIG_ESP_EVENT_LOOP_PROFILING is not set +CONFIG_ESP_EVENT_POST_FROM_ISR=y +CONFIG_ESP_EVENT_POST_FROM_IRAM_ISR=y +# end of Event Loop Library + +# +# GDB Stub +# +CONFIG_ESP_GDBSTUB_ENABLED=y +# CONFIG_ESP_SYSTEM_GDBSTUB_RUNTIME is not set +CONFIG_ESP_GDBSTUB_SUPPORT_TASKS=y +CONFIG_ESP_GDBSTUB_MAX_TASKS=32 +# end of GDB Stub + +# +# ESP HID +# +CONFIG_ESPHID_TASK_SIZE_BT=2048 +CONFIG_ESPHID_TASK_SIZE_BLE=4096 +# end of ESP HID + +# +# ESP HTTP client +# +CONFIG_ESP_HTTP_CLIENT_ENABLE_HTTPS=y +# CONFIG_ESP_HTTP_CLIENT_ENABLE_BASIC_AUTH is not set +# CONFIG_ESP_HTTP_CLIENT_ENABLE_DIGEST_AUTH is not set +# CONFIG_ESP_HTTP_CLIENT_ENABLE_CUSTOM_TRANSPORT is not set +CONFIG_ESP_HTTP_CLIENT_EVENT_POST_TIMEOUT=2000 +# end of ESP HTTP client + +# +# HTTP Server +# +CONFIG_HTTPD_MAX_REQ_HDR_LEN=512 +CONFIG_HTTPD_MAX_URI_LEN=512 +CONFIG_HTTPD_ERR_RESP_NO_DELAY=y +CONFIG_HTTPD_PURGE_BUF_LEN=32 +# CONFIG_HTTPD_LOG_PURGE_DATA is not set +# CONFIG_HTTPD_WS_SUPPORT is not set +# CONFIG_HTTPD_QUEUE_WORK_BLOCKING is not set +CONFIG_HTTPD_SERVER_EVENT_POST_TIMEOUT=2000 +# end of HTTP Server + +# +# ESP HTTPS OTA +# +# CONFIG_ESP_HTTPS_OTA_DECRYPT_CB is not set +# CONFIG_ESP_HTTPS_OTA_ALLOW_HTTP is not set +CONFIG_ESP_HTTPS_OTA_EVENT_POST_TIMEOUT=2000 +# end of ESP HTTPS OTA + +# +# ESP HTTPS server +# +# CONFIG_ESP_HTTPS_SERVER_ENABLE is not set +CONFIG_ESP_HTTPS_SERVER_EVENT_POST_TIMEOUT=2000 +# CONFIG_ESP_HTTPS_SERVER_CERT_SELECT_HOOK is not set +# end of ESP HTTPS server + +# +# Hardware Settings +# + +# +# Chip revision +# +CONFIG_ESP32S3_REV_MIN_0=y +# CONFIG_ESP32S3_REV_MIN_1 is not set +# CONFIG_ESP32S3_REV_MIN_2 is not set +CONFIG_ESP32S3_REV_MIN_FULL=0 +CONFIG_ESP_REV_MIN_FULL=0 + +# +# Maximum Supported ESP32-S3 Revision (Rev v0.99) +# +CONFIG_ESP32S3_REV_MAX_FULL=99 +CONFIG_ESP_REV_MAX_FULL=99 +CONFIG_ESP_EFUSE_BLOCK_REV_MIN_FULL=0 +CONFIG_ESP_EFUSE_BLOCK_REV_MAX_FULL=199 + +# +# Maximum Supported ESP32-S3 eFuse Block Revision (eFuse Block Rev v1.99) +# +# end of Chip revision + +# +# MAC Config +# +CONFIG_ESP_MAC_ADDR_UNIVERSE_WIFI_STA=y +CONFIG_ESP_MAC_ADDR_UNIVERSE_WIFI_AP=y +CONFIG_ESP_MAC_ADDR_UNIVERSE_BT=y +CONFIG_ESP_MAC_ADDR_UNIVERSE_ETH=y +CONFIG_ESP_MAC_UNIVERSAL_MAC_ADDRESSES_FOUR=y +CONFIG_ESP_MAC_UNIVERSAL_MAC_ADDRESSES=4 +# CONFIG_ESP32S3_UNIVERSAL_MAC_ADDRESSES_TWO is not set +CONFIG_ESP32S3_UNIVERSAL_MAC_ADDRESSES_FOUR=y +CONFIG_ESP32S3_UNIVERSAL_MAC_ADDRESSES=4 +# CONFIG_ESP_MAC_USE_CUSTOM_MAC_AS_BASE_MAC is not set +# end of MAC Config + +# +# Sleep Config +# +CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND=y +CONFIG_ESP_SLEEP_PSRAM_LEAKAGE_WORKAROUND=y +CONFIG_ESP_SLEEP_MSPI_NEED_ALL_IO_PU=y +CONFIG_ESP_SLEEP_RTC_BUS_ISO_WORKAROUND=y +CONFIG_ESP_SLEEP_GPIO_RESET_WORKAROUND=y +CONFIG_ESP_SLEEP_WAIT_FLASH_READY_EXTRA_DELAY=2000 +# CONFIG_ESP_SLEEP_CACHE_SAFE_ASSERTION is not set +# CONFIG_ESP_SLEEP_DEBUG is not set +CONFIG_ESP_SLEEP_GPIO_ENABLE_INTERNAL_RESISTORS=y +# end of Sleep Config + +# +# RTC Clock Config +# +CONFIG_RTC_CLK_SRC_INT_RC=y +# CONFIG_RTC_CLK_SRC_EXT_CRYS is not set +# CONFIG_RTC_CLK_SRC_EXT_OSC is not set +# CONFIG_RTC_CLK_SRC_INT_8MD256 is not set +CONFIG_RTC_CLK_CAL_CYCLES=1024 +# end of RTC Clock Config + +# +# Peripheral Control +# +CONFIG_ESP_PERIPH_CTRL_FUNC_IN_IRAM=y +CONFIG_ESP_REGI2C_CTRL_FUNC_IN_IRAM=y +# end of Peripheral Control + +# +# GDMA Configurations +# +CONFIG_GDMA_CTRL_FUNC_IN_IRAM=y +CONFIG_GDMA_ISR_HANDLER_IN_IRAM=y +CONFIG_GDMA_OBJ_DRAM_SAFE=y +# CONFIG_GDMA_ENABLE_DEBUG_LOG is not set +# CONFIG_GDMA_ISR_IRAM_SAFE is not set +# end of GDMA Configurations + +# +# Main XTAL Config +# +CONFIG_XTAL_FREQ_40=y +CONFIG_XTAL_FREQ=40 +# end of Main XTAL Config + +# +# Power Supplier +# + +# +# Brownout Detector +# +CONFIG_ESP_BROWNOUT_DET=y +CONFIG_ESP_BROWNOUT_DET_LVL_SEL_7=y +# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_6 is not set +# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_5 is not set +# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_4 is not set +# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_3 is not set +# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_2 is not set +# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_1 is not set +CONFIG_ESP_BROWNOUT_DET_LVL=7 +CONFIG_ESP_BROWNOUT_USE_INTR=y +# end of Brownout Detector +# end of Power Supplier + +CONFIG_ESP_SPI_BUS_LOCK_ISR_FUNCS_IN_IRAM=y +CONFIG_ESP_INTR_IN_IRAM=y +# end of Hardware Settings + +# +# ESP-Driver:LCD Controller Configurations +# +# CONFIG_LCD_ENABLE_DEBUG_LOG is not set +# CONFIG_LCD_RGB_ISR_IRAM_SAFE is not set +# CONFIG_LCD_RGB_RESTART_IN_VSYNC is not set +# end of ESP-Driver:LCD Controller Configurations + +# +# ESP-MM: Memory Management Configurations +# +# CONFIG_ESP_MM_CACHE_MSYNC_C2M_CHUNKED_OPS is not set +# end of ESP-MM: Memory Management Configurations + +# +# ESP NETIF Adapter +# +CONFIG_ESP_NETIF_IP_LOST_TIMER_INTERVAL=120 +# CONFIG_ESP_NETIF_PROVIDE_CUSTOM_IMPLEMENTATION is not set +CONFIG_ESP_NETIF_TCPIP_LWIP=y +# CONFIG_ESP_NETIF_LOOPBACK is not set +CONFIG_ESP_NETIF_USES_TCPIP_WITH_BSD_API=y +CONFIG_ESP_NETIF_REPORT_DATA_TRAFFIC=y +# CONFIG_ESP_NETIF_RECEIVE_REPORT_ERRORS is not set +# CONFIG_ESP_NETIF_L2_TAP is not set +# CONFIG_ESP_NETIF_BRIDGE_EN is not set +# CONFIG_ESP_NETIF_SET_DNS_PER_DEFAULT_NETIF is not set +# end of ESP NETIF Adapter + +# +# Partition API Configuration +# +# end of Partition API Configuration + +# +# PHY +# +CONFIG_ESP_PHY_ENABLED=y +CONFIG_ESP_PHY_CALIBRATION_AND_DATA_STORAGE=y +# CONFIG_ESP_PHY_INIT_DATA_IN_PARTITION is not set +CONFIG_ESP_PHY_MAX_WIFI_TX_POWER=20 +CONFIG_ESP_PHY_MAX_TX_POWER=20 +# CONFIG_ESP_PHY_REDUCE_TX_POWER is not set +CONFIG_ESP_PHY_ENABLE_USB=y +# CONFIG_ESP_PHY_ENABLE_CERT_TEST is not set +CONFIG_ESP_PHY_RF_CAL_PARTIAL=y +# CONFIG_ESP_PHY_RF_CAL_NONE is not set +# CONFIG_ESP_PHY_RF_CAL_FULL is not set +CONFIG_ESP_PHY_CALIBRATION_MODE=0 +CONFIG_ESP_PHY_PLL_TRACK_PERIOD_MS=1000 +# CONFIG_ESP_PHY_PLL_TRACK_DEBUG is not set +# CONFIG_ESP_PHY_RECORD_USED_TIME is not set +CONFIG_ESP_PHY_IRAM_OPT=y +# CONFIG_ESP_PHY_DEBUG is not set +# end of PHY + +# +# Power Management +# +CONFIG_PM_SLEEP_FUNC_IN_IRAM=y +# CONFIG_PM_ENABLE is not set +CONFIG_PM_SLP_IRAM_OPT=y +CONFIG_PM_POWER_DOWN_CPU_IN_LIGHT_SLEEP=y +CONFIG_PM_RESTORE_CACHE_TAGMEM_AFTER_LIGHT_SLEEP=y +# end of Power Management + +# +# ESP PSRAM +# +CONFIG_SPIRAM=y + +# +# SPI RAM config +# +# CONFIG_SPIRAM_MODE_QUAD is not set +CONFIG_SPIRAM_MODE_OCT=y +CONFIG_SPIRAM_TYPE_AUTO=y +# CONFIG_SPIRAM_TYPE_ESPPSRAM64 is not set +CONFIG_SPIRAM_CLK_IO=30 +CONFIG_SPIRAM_CS_IO=26 +# CONFIG_SPIRAM_XIP_FROM_PSRAM is not set +# CONFIG_SPIRAM_FETCH_INSTRUCTIONS is not set +# CONFIG_SPIRAM_RODATA is not set +CONFIG_SPIRAM_SPEED_80M=y +# CONFIG_SPIRAM_SPEED_40M is not set +CONFIG_SPIRAM_SPEED=80 +# CONFIG_SPIRAM_ECC_ENABLE is not set +CONFIG_SPIRAM_BOOT_HW_INIT=y +CONFIG_SPIRAM_BOOT_INIT=y +CONFIG_SPIRAM_PRE_CONFIGURE_MEMORY_PROTECTION=y +# CONFIG_SPIRAM_IGNORE_NOTFOUND is not set +# CONFIG_SPIRAM_USE_CAPS_ALLOC is not set +CONFIG_SPIRAM_USE_MALLOC=y +CONFIG_SPIRAM_MEMTEST=y +CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=16384 +# CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP is not set +CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=32768 +# CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set +# CONFIG_SPIRAM_ALLOW_NOINIT_SEG_EXTERNAL_MEMORY is not set +# end of SPI RAM config +# end of ESP PSRAM + +# +# ESP Ringbuf +# +# CONFIG_RINGBUF_PLACE_FUNCTIONS_INTO_FLASH is not set +# end of ESP Ringbuf + +# +# ESP-ROM +# +CONFIG_ESP_ROM_PRINT_IN_IRAM=y +# end of ESP-ROM + +# +# ESP Security Specific +# +# end of ESP Security Specific + +# +# ESP System Settings +# +# CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_80 is not set +# CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_160 is not set +CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y +CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ=240 + +# +# Cache config +# +CONFIG_ESP32S3_INSTRUCTION_CACHE_16KB=y +# CONFIG_ESP32S3_INSTRUCTION_CACHE_32KB is not set +CONFIG_ESP32S3_INSTRUCTION_CACHE_SIZE=0x4000 +# CONFIG_ESP32S3_INSTRUCTION_CACHE_4WAYS is not set +CONFIG_ESP32S3_INSTRUCTION_CACHE_8WAYS=y +CONFIG_ESP32S3_ICACHE_ASSOCIATED_WAYS=8 +# CONFIG_ESP32S3_INSTRUCTION_CACHE_LINE_16B is not set +CONFIG_ESP32S3_INSTRUCTION_CACHE_LINE_32B=y +CONFIG_ESP32S3_INSTRUCTION_CACHE_LINE_SIZE=32 +# CONFIG_ESP32S3_DATA_CACHE_16KB is not set +CONFIG_ESP32S3_DATA_CACHE_32KB=y +# CONFIG_ESP32S3_DATA_CACHE_64KB is not set +CONFIG_ESP32S3_DATA_CACHE_SIZE=0x8000 +# CONFIG_ESP32S3_DATA_CACHE_4WAYS is not set +CONFIG_ESP32S3_DATA_CACHE_8WAYS=y +CONFIG_ESP32S3_DCACHE_ASSOCIATED_WAYS=8 +# CONFIG_ESP32S3_DATA_CACHE_LINE_16B is not set +CONFIG_ESP32S3_DATA_CACHE_LINE_32B=y +# CONFIG_ESP32S3_DATA_CACHE_LINE_64B is not set +CONFIG_ESP32S3_DATA_CACHE_LINE_SIZE=32 +# end of Cache config + +# +# Memory +# +# CONFIG_ESP32S3_RTCDATA_IN_FAST_MEM is not set +# CONFIG_ESP32S3_USE_FIXED_STATIC_RAM_SIZE is not set +# end of Memory + +# +# Trace memory +# +# CONFIG_ESP32S3_TRAX is not set +CONFIG_ESP32S3_TRACEMEM_RESERVE_DRAM=0x0 +# end of Trace memory + +CONFIG_ESP_SYSTEM_IN_IRAM=y +# CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT is not set +CONFIG_ESP_SYSTEM_PANIC_PRINT_REBOOT=y +# CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT is not set +# CONFIG_ESP_SYSTEM_PANIC_GDBSTUB is not set +CONFIG_ESP_SYSTEM_PANIC_REBOOT_DELAY_SECONDS=0 +CONFIG_ESP_SYSTEM_RTC_FAST_MEM_AS_HEAP_DEPCHECK=y +CONFIG_ESP_SYSTEM_ALLOW_RTC_FAST_MEM_AS_HEAP=y + +# +# Memory protection +# +CONFIG_ESP_SYSTEM_MEMPROT_FEATURE=y +CONFIG_ESP_SYSTEM_MEMPROT_FEATURE_LOCK=y +# end of Memory protection + +CONFIG_ESP_SYSTEM_EVENT_QUEUE_SIZE=32 +CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=2304 +CONFIG_ESP_MAIN_TASK_STACK_SIZE=3584 +CONFIG_ESP_MAIN_TASK_AFFINITY_CPU0=y +# CONFIG_ESP_MAIN_TASK_AFFINITY_CPU1 is not set +# CONFIG_ESP_MAIN_TASK_AFFINITY_NO_AFFINITY is not set +CONFIG_ESP_MAIN_TASK_AFFINITY=0x0 +CONFIG_ESP_MINIMAL_SHARED_STACK_SIZE=2048 +CONFIG_ESP_CONSOLE_UART_DEFAULT=y +# CONFIG_ESP_CONSOLE_USB_CDC is not set +# CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG is not set +# CONFIG_ESP_CONSOLE_UART_CUSTOM is not set +# CONFIG_ESP_CONSOLE_NONE is not set +# CONFIG_ESP_CONSOLE_SECONDARY_NONE is not set +CONFIG_ESP_CONSOLE_SECONDARY_USB_SERIAL_JTAG=y +CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG_ENABLED=y +CONFIG_ESP_CONSOLE_UART=y +CONFIG_ESP_CONSOLE_UART_NUM=0 +CONFIG_ESP_CONSOLE_ROM_SERIAL_PORT_NUM=0 +CONFIG_ESP_CONSOLE_UART_BAUDRATE=115200 +CONFIG_ESP_INT_WDT=y +CONFIG_ESP_INT_WDT_TIMEOUT_MS=300 +CONFIG_ESP_INT_WDT_CHECK_CPU1=y +CONFIG_ESP_TASK_WDT_EN=y +CONFIG_ESP_TASK_WDT_INIT=y +# CONFIG_ESP_TASK_WDT_PANIC is not set +CONFIG_ESP_TASK_WDT_TIMEOUT_S=5 +CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0=y +CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU1=y +# CONFIG_ESP_PANIC_HANDLER_IRAM is not set +# CONFIG_ESP_DEBUG_STUBS_ENABLE is not set +CONFIG_ESP_DEBUG_OCDAWARE=y +CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_4=y +CONFIG_ESP_SYSTEM_BBPLL_RECALIB=y +# end of ESP System Settings + +# +# IPC (Inter-Processor Call) +# +CONFIG_ESP_IPC_ENABLE=y +CONFIG_ESP_IPC_TASK_STACK_SIZE=1280 +CONFIG_ESP_IPC_USES_CALLERS_PRIORITY=y +CONFIG_ESP_IPC_ISR_ENABLE=y +# end of IPC (Inter-Processor Call) + +# +# ESP Timer (High Resolution Timer) +# +CONFIG_ESP_TIMER_IN_IRAM=y +# CONFIG_ESP_TIMER_PROFILING is not set +CONFIG_ESP_TIME_FUNCS_USE_RTC_TIMER=y +CONFIG_ESP_TIME_FUNCS_USE_ESP_TIMER=y +CONFIG_ESP_TIMER_TASK_STACK_SIZE=3584 +CONFIG_ESP_TIMER_INTERRUPT_LEVEL=1 +# CONFIG_ESP_TIMER_SHOW_EXPERIMENTAL is not set +CONFIG_ESP_TIMER_TASK_AFFINITY=0x0 +CONFIG_ESP_TIMER_TASK_AFFINITY_CPU0=y +CONFIG_ESP_TIMER_ISR_AFFINITY_CPU0=y +# CONFIG_ESP_TIMER_SUPPORTS_ISR_DISPATCH_METHOD is not set +CONFIG_ESP_TIMER_IMPL_SYSTIMER=y +# end of ESP Timer (High Resolution Timer) + +# +# Wi-Fi +# +CONFIG_ESP_WIFI_ENABLED=y +CONFIG_ESP_WIFI_STATIC_RX_BUFFER_NUM=10 +CONFIG_ESP_WIFI_DYNAMIC_RX_BUFFER_NUM=32 +CONFIG_ESP_WIFI_STATIC_TX_BUFFER=y +# CONFIG_ESP_WIFI_DYNAMIC_TX_BUFFER is not set +CONFIG_ESP_WIFI_TX_BUFFER_TYPE=0 +CONFIG_ESP_WIFI_STATIC_TX_BUFFER_NUM=16 +CONFIG_ESP_WIFI_STATIC_RX_MGMT_BUFFER=y +# CONFIG_ESP_WIFI_DYNAMIC_RX_MGMT_BUFFER is not set +CONFIG_ESP_WIFI_DYNAMIC_RX_MGMT_BUF=0 +CONFIG_ESP_WIFI_RX_MGMT_BUF_NUM_DEF=5 +# CONFIG_ESP_WIFI_CSI_ENABLED is not set +CONFIG_ESP_WIFI_AMPDU_TX_ENABLED=y +CONFIG_ESP_WIFI_TX_BA_WIN=6 +CONFIG_ESP_WIFI_AMPDU_RX_ENABLED=y +CONFIG_ESP_WIFI_RX_BA_WIN=6 +CONFIG_ESP_WIFI_NVS_ENABLED=y +CONFIG_ESP_WIFI_TASK_PINNED_TO_CORE_0=y +# CONFIG_ESP_WIFI_TASK_PINNED_TO_CORE_1 is not set +CONFIG_ESP_WIFI_SOFTAP_BEACON_MAX_LEN=752 +CONFIG_ESP_WIFI_MGMT_SBUF_NUM=32 +CONFIG_ESP_WIFI_IRAM_OPT=y +# CONFIG_ESP_WIFI_EXTRA_IRAM_OPT is not set +CONFIG_ESP_WIFI_RX_IRAM_OPT=y +CONFIG_ESP_WIFI_ENABLE_WPA3_SAE=y +CONFIG_ESP_WIFI_ENABLE_SAE_PK=y +CONFIG_ESP_WIFI_ENABLE_SAE_H2E=y +CONFIG_ESP_WIFI_SOFTAP_SAE_SUPPORT=y +CONFIG_ESP_WIFI_ENABLE_WPA3_OWE_STA=y +# CONFIG_ESP_WIFI_SLP_IRAM_OPT is not set +CONFIG_ESP_WIFI_SLP_DEFAULT_MIN_ACTIVE_TIME=50 +# CONFIG_ESP_WIFI_BSS_MAX_IDLE_SUPPORT is not set +CONFIG_ESP_WIFI_SLP_DEFAULT_MAX_ACTIVE_TIME=10 +CONFIG_ESP_WIFI_SLP_DEFAULT_WAIT_BROADCAST_DATA_TIME=15 +# CONFIG_ESP_WIFI_FTM_ENABLE is not set +CONFIG_ESP_WIFI_STA_DISCONNECTED_PM_ENABLE=y +# CONFIG_ESP_WIFI_GCMP_SUPPORT is not set +# CONFIG_ESP_WIFI_GMAC_SUPPORT is not set +CONFIG_ESP_WIFI_SOFTAP_SUPPORT=y +# CONFIG_ESP_WIFI_SLP_BEACON_LOST_OPT is not set +CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM=7 +CONFIG_ESP_WIFI_MBEDTLS_CRYPTO=y +CONFIG_ESP_WIFI_MBEDTLS_TLS_CLIENT=y +# CONFIG_ESP_WIFI_WAPI_PSK is not set +# CONFIG_ESP_WIFI_SUITE_B_192 is not set +# CONFIG_ESP_WIFI_11KV_SUPPORT is not set +# CONFIG_ESP_WIFI_MBO_SUPPORT is not set +# CONFIG_ESP_WIFI_DPP_SUPPORT is not set +# CONFIG_ESP_WIFI_11R_SUPPORT is not set +# CONFIG_ESP_WIFI_WPS_SOFTAP_REGISTRAR is not set + +# +# WPS Configuration Options +# +# CONFIG_ESP_WIFI_WPS_STRICT is not set +# CONFIG_ESP_WIFI_WPS_PASSPHRASE is not set +# end of WPS Configuration Options + +# CONFIG_ESP_WIFI_DEBUG_PRINT is not set +# CONFIG_ESP_WIFI_TESTING_OPTIONS is not set +CONFIG_ESP_WIFI_ENTERPRISE_SUPPORT=y +# CONFIG_ESP_WIFI_ENT_FREE_DYNAMIC_BUFFER is not set +# end of Wi-Fi + +# +# Core dump +# +# CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH is not set +# CONFIG_ESP_COREDUMP_ENABLE_TO_UART is not set +CONFIG_ESP_COREDUMP_ENABLE_TO_NONE=y +# end of Core dump + +# +# FAT Filesystem support +# +CONFIG_FATFS_VOLUME_COUNT=2 +CONFIG_FATFS_LFN_NONE=y +# CONFIG_FATFS_LFN_HEAP is not set +# CONFIG_FATFS_LFN_STACK is not set +# CONFIG_FATFS_SECTOR_512 is not set +CONFIG_FATFS_SECTOR_4096=y +# CONFIG_FATFS_CODEPAGE_DYNAMIC is not set +CONFIG_FATFS_CODEPAGE_437=y +# CONFIG_FATFS_CODEPAGE_720 is not set +# CONFIG_FATFS_CODEPAGE_737 is not set +# CONFIG_FATFS_CODEPAGE_771 is not set +# CONFIG_FATFS_CODEPAGE_775 is not set +# CONFIG_FATFS_CODEPAGE_850 is not set +# CONFIG_FATFS_CODEPAGE_852 is not set +# CONFIG_FATFS_CODEPAGE_855 is not set +# CONFIG_FATFS_CODEPAGE_857 is not set +# CONFIG_FATFS_CODEPAGE_860 is not set +# CONFIG_FATFS_CODEPAGE_861 is not set +# CONFIG_FATFS_CODEPAGE_862 is not set +# CONFIG_FATFS_CODEPAGE_863 is not set +# CONFIG_FATFS_CODEPAGE_864 is not set +# CONFIG_FATFS_CODEPAGE_865 is not set +# CONFIG_FATFS_CODEPAGE_866 is not set +# CONFIG_FATFS_CODEPAGE_869 is not set +# CONFIG_FATFS_CODEPAGE_932 is not set +# CONFIG_FATFS_CODEPAGE_936 is not set +# CONFIG_FATFS_CODEPAGE_949 is not set +# CONFIG_FATFS_CODEPAGE_950 is not set +CONFIG_FATFS_CODEPAGE=437 +CONFIG_FATFS_FS_LOCK=0 +CONFIG_FATFS_TIMEOUT_MS=10000 +CONFIG_FATFS_PER_FILE_CACHE=y +CONFIG_FATFS_ALLOC_PREFER_EXTRAM=y +# CONFIG_FATFS_USE_FASTSEEK is not set +CONFIG_FATFS_USE_STRFUNC_NONE=y +# CONFIG_FATFS_USE_STRFUNC_WITHOUT_CRLF_CONV is not set +# CONFIG_FATFS_USE_STRFUNC_WITH_CRLF_CONV is not set +CONFIG_FATFS_VFS_FSTAT_BLKSIZE=0 +# CONFIG_FATFS_IMMEDIATE_FSYNC is not set +# CONFIG_FATFS_USE_LABEL is not set +CONFIG_FATFS_LINK_LOCK=y +# CONFIG_FATFS_USE_DYN_BUFFERS is not set + +# +# File system free space calculation behavior +# +CONFIG_FATFS_DONT_TRUST_FREE_CLUSTER_CNT=0 +CONFIG_FATFS_DONT_TRUST_LAST_ALLOC=0 +# end of File system free space calculation behavior +# end of FAT Filesystem support + +# +# FreeRTOS +# + +# +# Kernel +# +# CONFIG_FREERTOS_SMP is not set +# CONFIG_FREERTOS_UNICORE is not set +CONFIG_FREERTOS_HZ=1000 +# CONFIG_FREERTOS_CHECK_STACKOVERFLOW_NONE is not set +# CONFIG_FREERTOS_CHECK_STACKOVERFLOW_PTRVAL is not set +CONFIG_FREERTOS_CHECK_STACKOVERFLOW_CANARY=y +CONFIG_FREERTOS_THREAD_LOCAL_STORAGE_POINTERS=1 +CONFIG_FREERTOS_IDLE_TASK_STACKSIZE=1536 +# CONFIG_FREERTOS_USE_IDLE_HOOK is not set +# CONFIG_FREERTOS_USE_TICK_HOOK is not set +CONFIG_FREERTOS_MAX_TASK_NAME_LEN=16 +CONFIG_FREERTOS_ENABLE_BACKWARD_COMPATIBILITY=y +CONFIG_FREERTOS_USE_TIMERS=y +CONFIG_FREERTOS_TIMER_SERVICE_TASK_NAME="Tmr Svc" +# CONFIG_FREERTOS_TIMER_TASK_AFFINITY_CPU0 is not set +# CONFIG_FREERTOS_TIMER_TASK_AFFINITY_CPU1 is not set +CONFIG_FREERTOS_TIMER_TASK_NO_AFFINITY=y +CONFIG_FREERTOS_TIMER_SERVICE_TASK_CORE_AFFINITY=0x7FFFFFFF +CONFIG_FREERTOS_TIMER_TASK_PRIORITY=1 +CONFIG_FREERTOS_TIMER_TASK_STACK_DEPTH=2048 +CONFIG_FREERTOS_TIMER_QUEUE_LENGTH=10 +CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE=0 +CONFIG_FREERTOS_TASK_NOTIFICATION_ARRAY_ENTRIES=1 +# CONFIG_FREERTOS_USE_TRACE_FACILITY is not set +# CONFIG_FREERTOS_USE_LIST_DATA_INTEGRITY_CHECK_BYTES is not set +# CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS is not set +# CONFIG_FREERTOS_USE_APPLICATION_TASK_TAG is not set +# end of Kernel + +# +# Port +# +# CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK is not set +CONFIG_FREERTOS_TLSP_DELETION_CALLBACKS=y +# CONFIG_FREERTOS_TASK_PRE_DELETION_HOOK is not set +# CONFIG_FREERTOS_ENABLE_STATIC_TASK_CLEAN_UP is not set +CONFIG_FREERTOS_CHECK_MUTEX_GIVEN_BY_OWNER=y +CONFIG_FREERTOS_ISR_STACKSIZE=1536 +CONFIG_FREERTOS_INTERRUPT_BACKTRACE=y +# CONFIG_FREERTOS_FPU_IN_ISR is not set +CONFIG_FREERTOS_TICK_SUPPORT_SYSTIMER=y +CONFIG_FREERTOS_CORETIMER_SYSTIMER_LVL1=y +# CONFIG_FREERTOS_CORETIMER_SYSTIMER_LVL3 is not set +CONFIG_FREERTOS_SYSTICK_USES_SYSTIMER=y +# CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH is not set +# CONFIG_FREERTOS_CHECK_PORT_CRITICAL_COMPLIANCE is not set +# end of Port + +# +# Extra +# +CONFIG_FREERTOS_TASK_CREATE_ALLOW_EXT_MEM=y +# end of Extra + +CONFIG_FREERTOS_PORT=y +CONFIG_FREERTOS_NO_AFFINITY=0x7FFFFFFF +CONFIG_FREERTOS_SUPPORT_STATIC_ALLOCATION=y +CONFIG_FREERTOS_DEBUG_OCDAWARE=y +CONFIG_FREERTOS_ENABLE_TASK_SNAPSHOT=y +CONFIG_FREERTOS_PLACE_SNAPSHOT_FUNS_INTO_FLASH=y +CONFIG_FREERTOS_NUMBER_OF_CORES=2 +CONFIG_FREERTOS_IN_IRAM=y +# end of FreeRTOS + +# +# Hardware Abstraction Layer (HAL) and Low Level (LL) +# +CONFIG_HAL_ASSERTION_EQUALS_SYSTEM=y +# CONFIG_HAL_ASSERTION_DISABLE is not set +# CONFIG_HAL_ASSERTION_SILENT is not set +# CONFIG_HAL_ASSERTION_ENABLE is not set +CONFIG_HAL_DEFAULT_ASSERTION_LEVEL=2 +CONFIG_HAL_WDT_USE_ROM_IMPL=y +# end of Hardware Abstraction Layer (HAL) and Low Level (LL) + +# +# Heap memory debugging +# +CONFIG_HEAP_POISONING_DISABLED=y +# CONFIG_HEAP_POISONING_LIGHT is not set +# CONFIG_HEAP_POISONING_COMPREHENSIVE is not set +CONFIG_HEAP_TRACING_OFF=y +# CONFIG_HEAP_TRACING_STANDALONE is not set +# CONFIG_HEAP_TRACING_TOHOST is not set +# CONFIG_HEAP_USE_HOOKS is not set +# CONFIG_HEAP_TASK_TRACKING is not set +# CONFIG_HEAP_ABORT_WHEN_ALLOCATION_FAILS is not set +# CONFIG_HEAP_PLACE_FUNCTION_INTO_FLASH is not set +# end of Heap memory debugging + +# +# Log +# +CONFIG_LOG_VERSION_1=y +# CONFIG_LOG_VERSION_2 is not set +CONFIG_LOG_VERSION=1 + +# +# Log Level +# +# CONFIG_LOG_DEFAULT_LEVEL_NONE is not set +# CONFIG_LOG_DEFAULT_LEVEL_ERROR is not set +# CONFIG_LOG_DEFAULT_LEVEL_WARN is not set +# CONFIG_LOG_DEFAULT_LEVEL_INFO is not set +CONFIG_LOG_DEFAULT_LEVEL_DEBUG=y +# CONFIG_LOG_DEFAULT_LEVEL_VERBOSE is not set +CONFIG_LOG_DEFAULT_LEVEL=4 +CONFIG_LOG_MAXIMUM_EQUALS_DEFAULT=y +# CONFIG_LOG_MAXIMUM_LEVEL_VERBOSE is not set +CONFIG_LOG_MAXIMUM_LEVEL=4 + +# +# Level Settings +# +# CONFIG_LOG_MASTER_LEVEL is not set +CONFIG_LOG_DYNAMIC_LEVEL_CONTROL=y +# CONFIG_LOG_TAG_LEVEL_IMPL_NONE is not set +# CONFIG_LOG_TAG_LEVEL_IMPL_LINKED_LIST is not set +CONFIG_LOG_TAG_LEVEL_IMPL_CACHE_AND_LINKED_LIST=y +# CONFIG_LOG_TAG_LEVEL_CACHE_ARRAY is not set +CONFIG_LOG_TAG_LEVEL_CACHE_BINARY_MIN_HEAP=y +CONFIG_LOG_TAG_LEVEL_IMPL_CACHE_SIZE=31 +# end of Level Settings +# end of Log Level + +# +# Format +# +CONFIG_LOG_COLORS=y +CONFIG_LOG_TIMESTAMP_SOURCE_RTOS=y +# CONFIG_LOG_TIMESTAMP_SOURCE_SYSTEM is not set +# end of Format + +# +# Settings +# +CONFIG_LOG_MODE_TEXT_EN=y +CONFIG_LOG_MODE_TEXT=y +# end of Settings + +CONFIG_LOG_IN_IRAM=y +# end of Log + +# +# LWIP +# +CONFIG_LWIP_ENABLE=y +CONFIG_LWIP_LOCAL_HOSTNAME="espressif" +CONFIG_LWIP_TCPIP_TASK_PRIO=18 +# CONFIG_LWIP_TCPIP_CORE_LOCKING is not set +# CONFIG_LWIP_CHECK_THREAD_SAFETY is not set +CONFIG_LWIP_DNS_SUPPORT_MDNS_QUERIES=y +# CONFIG_LWIP_L2_TO_L3_COPY is not set +# CONFIG_LWIP_IRAM_OPTIMIZATION is not set +# CONFIG_LWIP_EXTRA_IRAM_OPTIMIZATION is not set +CONFIG_LWIP_TIMERS_ONDEMAND=y +CONFIG_LWIP_ND6=y +# CONFIG_LWIP_FORCE_ROUTER_FORWARDING is not set +CONFIG_LWIP_MAX_SOCKETS=10 +# CONFIG_LWIP_USE_ONLY_LWIP_SELECT is not set +# CONFIG_LWIP_SO_LINGER is not set +CONFIG_LWIP_SO_REUSE=y +CONFIG_LWIP_SO_REUSE_RXTOALL=y +# CONFIG_LWIP_SO_RCVBUF is not set +# CONFIG_LWIP_NETBUF_RECVINFO is not set +CONFIG_LWIP_IP_DEFAULT_TTL=64 +CONFIG_LWIP_IP4_FRAG=y +CONFIG_LWIP_IP6_FRAG=y +# CONFIG_LWIP_IP4_REASSEMBLY is not set +# CONFIG_LWIP_IP6_REASSEMBLY is not set +CONFIG_LWIP_IP_REASS_MAX_PBUFS=10 +# CONFIG_LWIP_IP_FORWARD is not set +# CONFIG_LWIP_STATS is not set +CONFIG_LWIP_ESP_GRATUITOUS_ARP=y +CONFIG_LWIP_GARP_TMR_INTERVAL=60 +CONFIG_LWIP_ESP_MLDV6_REPORT=y +CONFIG_LWIP_MLDV6_TMR_INTERVAL=40 +CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=32 +CONFIG_LWIP_DHCP_DOES_ARP_CHECK=y +# CONFIG_LWIP_DHCP_DOES_ACD_CHECK is not set +# CONFIG_LWIP_DHCP_DOES_NOT_CHECK_OFFERED_IP is not set +# CONFIG_LWIP_DHCP_DISABLE_CLIENT_ID is not set +CONFIG_LWIP_DHCP_DISABLE_VENDOR_CLASS_ID=y +# CONFIG_LWIP_DHCP_RESTORE_LAST_IP is not set +CONFIG_LWIP_DHCP_OPTIONS_LEN=69 +CONFIG_LWIP_NUM_NETIF_CLIENT_DATA=0 +CONFIG_LWIP_DHCP_COARSE_TIMER_SECS=1 + +# +# DHCP server +# +CONFIG_LWIP_DHCPS=y +CONFIG_LWIP_DHCPS_LEASE_UNIT=60 +CONFIG_LWIP_DHCPS_MAX_STATION_NUM=8 +CONFIG_LWIP_DHCPS_STATIC_ENTRIES=y +CONFIG_LWIP_DHCPS_ADD_DNS=y +# end of DHCP server + +# CONFIG_LWIP_AUTOIP is not set +CONFIG_LWIP_IPV4=y +CONFIG_LWIP_IPV6=y +# CONFIG_LWIP_IPV6_AUTOCONFIG is not set +CONFIG_LWIP_IPV6_NUM_ADDRESSES=3 +# CONFIG_LWIP_IPV6_FORWARD is not set +# CONFIG_LWIP_NETIF_STATUS_CALLBACK is not set +CONFIG_LWIP_NETIF_LOOPBACK=y +CONFIG_LWIP_LOOPBACK_MAX_PBUFS=8 + +# +# TCP +# +CONFIG_LWIP_MAX_ACTIVE_TCP=16 +CONFIG_LWIP_MAX_LISTENING_TCP=16 +CONFIG_LWIP_TCP_HIGH_SPEED_RETRANSMISSION=y +CONFIG_LWIP_TCP_MAXRTX=12 +CONFIG_LWIP_TCP_SYNMAXRTX=12 +CONFIG_LWIP_TCP_MSS=1440 +CONFIG_LWIP_TCP_TMR_INTERVAL=250 +CONFIG_LWIP_TCP_MSL=60000 +CONFIG_LWIP_TCP_FIN_WAIT_TIMEOUT=20000 +CONFIG_LWIP_TCP_SND_BUF_DEFAULT=5744 +CONFIG_LWIP_TCP_WND_DEFAULT=5744 +CONFIG_LWIP_TCP_RECVMBOX_SIZE=6 +CONFIG_LWIP_TCP_ACCEPTMBOX_SIZE=6 +CONFIG_LWIP_TCP_QUEUE_OOSEQ=y +CONFIG_LWIP_TCP_OOSEQ_TIMEOUT=6 +CONFIG_LWIP_TCP_OOSEQ_MAX_PBUFS=4 +# CONFIG_LWIP_TCP_SACK_OUT is not set +CONFIG_LWIP_TCP_OVERSIZE_MSS=y +# CONFIG_LWIP_TCP_OVERSIZE_QUARTER_MSS is not set +# CONFIG_LWIP_TCP_OVERSIZE_DISABLE is not set +CONFIG_LWIP_TCP_RTO_TIME=1500 +# end of TCP + +# +# UDP +# +CONFIG_LWIP_MAX_UDP_PCBS=16 +CONFIG_LWIP_UDP_RECVMBOX_SIZE=6 +# end of UDP + +# +# Checksums +# +# CONFIG_LWIP_CHECKSUM_CHECK_IP is not set +# CONFIG_LWIP_CHECKSUM_CHECK_UDP is not set +CONFIG_LWIP_CHECKSUM_CHECK_ICMP=y +# end of Checksums + +CONFIG_LWIP_TCPIP_TASK_STACK_SIZE=3072 +CONFIG_LWIP_TCPIP_TASK_AFFINITY_NO_AFFINITY=y +# CONFIG_LWIP_TCPIP_TASK_AFFINITY_CPU0 is not set +# CONFIG_LWIP_TCPIP_TASK_AFFINITY_CPU1 is not set +CONFIG_LWIP_TCPIP_TASK_AFFINITY=0x7FFFFFFF +CONFIG_LWIP_IPV6_MEMP_NUM_ND6_QUEUE=3 +CONFIG_LWIP_IPV6_ND6_NUM_NEIGHBORS=5 +CONFIG_LWIP_IPV6_ND6_NUM_PREFIXES=5 +CONFIG_LWIP_IPV6_ND6_NUM_ROUTERS=3 +CONFIG_LWIP_IPV6_ND6_NUM_DESTINATIONS=10 +# CONFIG_LWIP_PPP_SUPPORT is not set +# CONFIG_LWIP_SLIP_SUPPORT is not set + +# +# ICMP +# +CONFIG_LWIP_ICMP=y +# CONFIG_LWIP_MULTICAST_PING is not set +# CONFIG_LWIP_BROADCAST_PING is not set +# end of ICMP + +# +# LWIP RAW API +# +CONFIG_LWIP_MAX_RAW_PCBS=16 +# end of LWIP RAW API + +# +# SNTP +# +CONFIG_LWIP_SNTP_MAX_SERVERS=1 +# CONFIG_LWIP_DHCP_GET_NTP_SRV is not set +CONFIG_LWIP_SNTP_UPDATE_DELAY=3600000 +CONFIG_LWIP_SNTP_STARTUP_DELAY=y +CONFIG_LWIP_SNTP_MAXIMUM_STARTUP_DELAY=5000 +# end of SNTP + +# +# DNS +# +CONFIG_LWIP_DNS_MAX_HOST_IP=1 +CONFIG_LWIP_DNS_MAX_SERVERS=3 +# CONFIG_LWIP_FALLBACK_DNS_SERVER_SUPPORT is not set +# CONFIG_LWIP_DNS_SETSERVER_WITH_NETIF is not set +# CONFIG_LWIP_USE_ESP_GETADDRINFO is not set +# end of DNS + +CONFIG_LWIP_BRIDGEIF_MAX_PORTS=7 +CONFIG_LWIP_ESP_LWIP_ASSERT=y + +# +# Hooks +# +# CONFIG_LWIP_HOOK_TCP_ISN_NONE is not set +CONFIG_LWIP_HOOK_TCP_ISN_DEFAULT=y +# CONFIG_LWIP_HOOK_TCP_ISN_CUSTOM is not set +CONFIG_LWIP_HOOK_IP6_ROUTE_NONE=y +# CONFIG_LWIP_HOOK_IP6_ROUTE_DEFAULT is not set +# CONFIG_LWIP_HOOK_IP6_ROUTE_CUSTOM is not set +CONFIG_LWIP_HOOK_ND6_GET_GW_NONE=y +# CONFIG_LWIP_HOOK_ND6_GET_GW_DEFAULT is not set +# CONFIG_LWIP_HOOK_ND6_GET_GW_CUSTOM is not set +CONFIG_LWIP_HOOK_IP6_SELECT_SRC_ADDR_NONE=y +# CONFIG_LWIP_HOOK_IP6_SELECT_SRC_ADDR_DEFAULT is not set +# CONFIG_LWIP_HOOK_IP6_SELECT_SRC_ADDR_CUSTOM is not set +CONFIG_LWIP_HOOK_DHCP_EXTRA_OPTION_NONE=y +# CONFIG_LWIP_HOOK_DHCP_EXTRA_OPTION_DEFAULT is not set +# CONFIG_LWIP_HOOK_DHCP_EXTRA_OPTION_CUSTOM is not set +CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_NONE=y +# CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_DEFAULT is not set +# CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_CUSTOM is not set +CONFIG_LWIP_HOOK_DNS_EXT_RESOLVE_NONE=y +# CONFIG_LWIP_HOOK_DNS_EXT_RESOLVE_CUSTOM is not set +CONFIG_LWIP_HOOK_IP6_INPUT_NONE=y +# CONFIG_LWIP_HOOK_IP6_INPUT_DEFAULT is not set +# CONFIG_LWIP_HOOK_IP6_INPUT_CUSTOM is not set +# end of Hooks + +# CONFIG_LWIP_DEBUG is not set +# end of LWIP + +# +# mbedTLS +# +CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC=y +# CONFIG_MBEDTLS_EXTERNAL_MEM_ALLOC is not set +# CONFIG_MBEDTLS_DEFAULT_MEM_ALLOC is not set +# CONFIG_MBEDTLS_CUSTOM_MEM_ALLOC is not set +CONFIG_MBEDTLS_ASYMMETRIC_CONTENT_LEN=y +CONFIG_MBEDTLS_SSL_IN_CONTENT_LEN=16384 +CONFIG_MBEDTLS_SSL_OUT_CONTENT_LEN=4096 +# CONFIG_MBEDTLS_DYNAMIC_BUFFER is not set +# CONFIG_MBEDTLS_DEBUG is not set + +# +# mbedTLS v3.x related +# +# CONFIG_MBEDTLS_SSL_PROTO_TLS1_3 is not set +# CONFIG_MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH is not set +# CONFIG_MBEDTLS_X509_TRUSTED_CERT_CALLBACK is not set +# CONFIG_MBEDTLS_SSL_CONTEXT_SERIALIZATION is not set +CONFIG_MBEDTLS_SSL_KEEP_PEER_CERTIFICATE=y +# CONFIG_MBEDTLS_SSL_KEYING_MATERIAL_EXPORT is not set +CONFIG_MBEDTLS_PKCS7_C=y +# end of mbedTLS v3.x related + +# +# Certificate Bundle +# +CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=y +CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_FULL=y +# CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_CMN is not set +# CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_NONE is not set +# CONFIG_MBEDTLS_CUSTOM_CERTIFICATE_BUNDLE is not set +# CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEPRECATED_LIST is not set +CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_MAX_CERTS=200 +# end of Certificate Bundle + +# CONFIG_MBEDTLS_ECP_RESTARTABLE is not set +CONFIG_MBEDTLS_CMAC_C=y +CONFIG_MBEDTLS_HARDWARE_AES=y +CONFIG_MBEDTLS_AES_USE_INTERRUPT=y +CONFIG_MBEDTLS_AES_INTERRUPT_LEVEL=0 +# CONFIG_MBEDTLS_GCM_SUPPORT_NON_AES_CIPHER is not set +CONFIG_MBEDTLS_HARDWARE_MPI=y +# CONFIG_MBEDTLS_LARGE_KEY_SOFTWARE_MPI is not set +CONFIG_MBEDTLS_MPI_USE_INTERRUPT=y +CONFIG_MBEDTLS_MPI_INTERRUPT_LEVEL=0 +CONFIG_MBEDTLS_HARDWARE_SHA=y +CONFIG_MBEDTLS_ROM_MD5=y +# CONFIG_MBEDTLS_ATCA_HW_ECDSA_SIGN is not set +# CONFIG_MBEDTLS_ATCA_HW_ECDSA_VERIFY is not set +CONFIG_MBEDTLS_HAVE_TIME=y +# CONFIG_MBEDTLS_PLATFORM_TIME_ALT is not set +# CONFIG_MBEDTLS_HAVE_TIME_DATE is not set +CONFIG_MBEDTLS_ECDSA_DETERMINISTIC=y +CONFIG_MBEDTLS_SHA1_C=y +CONFIG_MBEDTLS_SHA512_C=y +# CONFIG_MBEDTLS_SHA3_C is not set +CONFIG_MBEDTLS_TLS_SERVER_AND_CLIENT=y +# CONFIG_MBEDTLS_TLS_SERVER_ONLY is not set +# CONFIG_MBEDTLS_TLS_CLIENT_ONLY is not set +# CONFIG_MBEDTLS_TLS_DISABLED is not set +CONFIG_MBEDTLS_TLS_SERVER=y +CONFIG_MBEDTLS_TLS_CLIENT=y +CONFIG_MBEDTLS_TLS_ENABLED=y + +# +# TLS Key Exchange Methods +# +# CONFIG_MBEDTLS_PSK_MODES is not set +CONFIG_MBEDTLS_KEY_EXCHANGE_RSA=y +CONFIG_MBEDTLS_KEY_EXCHANGE_ELLIPTIC_CURVE=y +CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_RSA=y +CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA=y +CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA=y +CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_RSA=y +# end of TLS Key Exchange Methods + +CONFIG_MBEDTLS_SSL_RENEGOTIATION=y +CONFIG_MBEDTLS_SSL_PROTO_TLS1_2=y +# CONFIG_MBEDTLS_SSL_PROTO_GMTSSL1_1 is not set +# CONFIG_MBEDTLS_SSL_PROTO_DTLS is not set +CONFIG_MBEDTLS_SSL_ALPN=y +CONFIG_MBEDTLS_CLIENT_SSL_SESSION_TICKETS=y +CONFIG_MBEDTLS_SERVER_SSL_SESSION_TICKETS=y + +# +# Symmetric Ciphers +# +CONFIG_MBEDTLS_AES_C=y +# CONFIG_MBEDTLS_CAMELLIA_C is not set +# CONFIG_MBEDTLS_DES_C is not set +# CONFIG_MBEDTLS_BLOWFISH_C is not set +# CONFIG_MBEDTLS_XTEA_C is not set +CONFIG_MBEDTLS_CCM_C=y +CONFIG_MBEDTLS_GCM_C=y +# CONFIG_MBEDTLS_NIST_KW_C is not set +# end of Symmetric Ciphers + +# CONFIG_MBEDTLS_RIPEMD160_C is not set + +# +# Certificates +# +CONFIG_MBEDTLS_PEM_PARSE_C=y +CONFIG_MBEDTLS_PEM_WRITE_C=y +CONFIG_MBEDTLS_X509_CRL_PARSE_C=y +CONFIG_MBEDTLS_X509_CSR_PARSE_C=y +# end of Certificates + +CONFIG_MBEDTLS_ECP_C=y +CONFIG_MBEDTLS_PK_PARSE_EC_EXTENDED=y +CONFIG_MBEDTLS_PK_PARSE_EC_COMPRESSED=y +# CONFIG_MBEDTLS_DHM_C is not set +CONFIG_MBEDTLS_ECDH_C=y +CONFIG_MBEDTLS_ECDSA_C=y +# CONFIG_MBEDTLS_ECJPAKE_C is not set +CONFIG_MBEDTLS_ECP_DP_SECP192R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP224R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP256R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP384R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP521R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP192K1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP224K1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP256K1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_BP256R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_BP384R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_BP512R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_CURVE25519_ENABLED=y +CONFIG_MBEDTLS_ECP_NIST_OPTIM=y +CONFIG_MBEDTLS_ECP_FIXED_POINT_OPTIM=y +# CONFIG_MBEDTLS_POLY1305_C is not set +# CONFIG_MBEDTLS_CHACHA20_C is not set +# CONFIG_MBEDTLS_HKDF_C is not set +# CONFIG_MBEDTLS_THREADING_C is not set +CONFIG_MBEDTLS_ERROR_STRINGS=y +CONFIG_MBEDTLS_FS_IO=y +# CONFIG_MBEDTLS_ALLOW_WEAK_CERTIFICATE_VERIFICATION is not set +# end of mbedTLS + +# +# ESP-MQTT Configurations +# +CONFIG_MQTT_PROTOCOL_311=y +# CONFIG_MQTT_PROTOCOL_5 is not set +CONFIG_MQTT_TRANSPORT_SSL=y +CONFIG_MQTT_TRANSPORT_WEBSOCKET=y +CONFIG_MQTT_TRANSPORT_WEBSOCKET_SECURE=y +# CONFIG_MQTT_MSG_ID_INCREMENTAL is not set +# CONFIG_MQTT_SKIP_PUBLISH_IF_DISCONNECTED is not set +# CONFIG_MQTT_REPORT_DELETED_MESSAGES is not set +# CONFIG_MQTT_USE_CUSTOM_CONFIG is not set +# CONFIG_MQTT_TASK_CORE_SELECTION_ENABLED is not set +# CONFIG_MQTT_CUSTOM_OUTBOX is not set +# end of ESP-MQTT Configurations + +# +# LibC +# +CONFIG_LIBC_NEWLIB=y +CONFIG_LIBC_MISC_IN_IRAM=y +CONFIG_LIBC_LOCKS_PLACE_IN_IRAM=y +CONFIG_LIBC_STDOUT_LINE_ENDING_CRLF=y +# CONFIG_LIBC_STDOUT_LINE_ENDING_LF is not set +# CONFIG_LIBC_STDOUT_LINE_ENDING_CR is not set +# CONFIG_LIBC_STDIN_LINE_ENDING_CRLF is not set +# CONFIG_LIBC_STDIN_LINE_ENDING_LF is not set +CONFIG_LIBC_STDIN_LINE_ENDING_CR=y +# CONFIG_LIBC_NEWLIB_NANO_FORMAT is not set +CONFIG_LIBC_TIME_SYSCALL_USE_RTC_HRT=y +# CONFIG_LIBC_TIME_SYSCALL_USE_RTC is not set +# CONFIG_LIBC_TIME_SYSCALL_USE_HRT is not set +# CONFIG_LIBC_TIME_SYSCALL_USE_NONE is not set +# end of LibC + +CONFIG_STDATOMIC_S32C1I_SPIRAM_WORKAROUND=y + +# +# NVS +# +# CONFIG_NVS_ENCRYPTION is not set +# CONFIG_NVS_ASSERT_ERROR_CHECK is not set +# CONFIG_NVS_LEGACY_DUP_KEYS_COMPATIBILITY is not set +# CONFIG_NVS_ALLOCATE_CACHE_IN_SPIRAM is not set +# end of NVS + +# +# OpenThread +# +# CONFIG_OPENTHREAD_ENABLED is not set + +# +# OpenThread Spinel +# +# CONFIG_OPENTHREAD_SPINEL_ONLY is not set +# end of OpenThread Spinel +# end of OpenThread + +# +# Protocomm +# +CONFIG_ESP_PROTOCOMM_SUPPORT_SECURITY_VERSION_0=y +CONFIG_ESP_PROTOCOMM_SUPPORT_SECURITY_VERSION_1=y +CONFIG_ESP_PROTOCOMM_SUPPORT_SECURITY_VERSION_2=y +CONFIG_ESP_PROTOCOMM_SUPPORT_SECURITY_PATCH_VERSION=y +# end of Protocomm + +# +# PThreads +# +CONFIG_PTHREAD_TASK_PRIO_DEFAULT=5 +CONFIG_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072 +CONFIG_PTHREAD_STACK_MIN=768 +CONFIG_PTHREAD_DEFAULT_CORE_NO_AFFINITY=y +# CONFIG_PTHREAD_DEFAULT_CORE_0 is not set +# CONFIG_PTHREAD_DEFAULT_CORE_1 is not set +CONFIG_PTHREAD_TASK_CORE_DEFAULT=-1 +CONFIG_PTHREAD_TASK_NAME_DEFAULT="pthread" +# end of PThreads + +# +# MMU Config +# +CONFIG_MMU_PAGE_SIZE_64KB=y +CONFIG_MMU_PAGE_MODE="64KB" +CONFIG_MMU_PAGE_SIZE=0x10000 +# end of MMU Config + +# +# Main Flash configuration +# + +# +# SPI Flash behavior when brownout +# +CONFIG_SPI_FLASH_BROWNOUT_RESET_XMC=y +CONFIG_SPI_FLASH_BROWNOUT_RESET=y +# end of SPI Flash behavior when brownout + +# +# Optional and Experimental Features (READ DOCS FIRST) +# + +# +# Features here require specific hardware (READ DOCS FIRST!) +# +# CONFIG_SPI_FLASH_HPM_ENA is not set +CONFIG_SPI_FLASH_HPM_AUTO=y +# CONFIG_SPI_FLASH_HPM_DIS is not set +CONFIG_SPI_FLASH_HPM_ON=y +CONFIG_SPI_FLASH_HPM_DC_AUTO=y +# CONFIG_SPI_FLASH_HPM_DC_DISABLE is not set +# CONFIG_SPI_FLASH_AUTO_SUSPEND is not set +CONFIG_SPI_FLASH_SUSPEND_TSUS_VAL_US=50 +# CONFIG_SPI_FLASH_FORCE_ENABLE_XMC_C_SUSPEND is not set +# CONFIG_SPI_FLASH_FORCE_ENABLE_C6_H2_SUSPEND is not set +CONFIG_SPI_FLASH_PLACE_FUNCTIONS_IN_IRAM=y +# end of Optional and Experimental Features (READ DOCS FIRST) +# end of Main Flash configuration + +# +# SPI Flash driver +# +# CONFIG_SPI_FLASH_VERIFY_WRITE is not set +# CONFIG_SPI_FLASH_ENABLE_COUNTERS is not set +CONFIG_SPI_FLASH_ROM_DRIVER_PATCH=y +# CONFIG_SPI_FLASH_ROM_IMPL is not set +CONFIG_SPI_FLASH_DANGEROUS_WRITE_ABORTS=y +# CONFIG_SPI_FLASH_DANGEROUS_WRITE_FAILS is not set +# CONFIG_SPI_FLASH_DANGEROUS_WRITE_ALLOWED is not set +# CONFIG_SPI_FLASH_BYPASS_BLOCK_ERASE is not set +CONFIG_SPI_FLASH_YIELD_DURING_ERASE=y +CONFIG_SPI_FLASH_ERASE_YIELD_DURATION_MS=20 +CONFIG_SPI_FLASH_ERASE_YIELD_TICKS=1 +CONFIG_SPI_FLASH_WRITE_CHUNK_SIZE=8192 +# CONFIG_SPI_FLASH_SIZE_OVERRIDE is not set +# CONFIG_SPI_FLASH_CHECK_ERASE_TIMEOUT_DISABLED is not set +# CONFIG_SPI_FLASH_OVERRIDE_CHIP_DRIVER_LIST is not set + +# +# Auto-detect flash chips +# +CONFIG_SPI_FLASH_VENDOR_XMC_SUPPORT_ENABLED=y +CONFIG_SPI_FLASH_VENDOR_GD_SUPPORT_ENABLED=y +CONFIG_SPI_FLASH_VENDOR_ISSI_SUPPORT_ENABLED=y +CONFIG_SPI_FLASH_VENDOR_MXIC_SUPPORT_ENABLED=y +CONFIG_SPI_FLASH_VENDOR_WINBOND_SUPPORT_ENABLED=y +CONFIG_SPI_FLASH_VENDOR_BOYA_SUPPORT_ENABLED=y +CONFIG_SPI_FLASH_VENDOR_TH_SUPPORT_ENABLED=y +CONFIG_SPI_FLASH_SUPPORT_ISSI_CHIP=y +CONFIG_SPI_FLASH_SUPPORT_MXIC_CHIP=y +CONFIG_SPI_FLASH_SUPPORT_GD_CHIP=y +CONFIG_SPI_FLASH_SUPPORT_WINBOND_CHIP=y +CONFIG_SPI_FLASH_SUPPORT_BOYA_CHIP=y +CONFIG_SPI_FLASH_SUPPORT_TH_CHIP=y +CONFIG_SPI_FLASH_SUPPORT_MXIC_OPI_CHIP=y +# end of Auto-detect flash chips + +CONFIG_SPI_FLASH_ENABLE_ENCRYPTED_READ_WRITE=y +# end of SPI Flash driver + +# +# SPIFFS Configuration +# +CONFIG_SPIFFS_MAX_PARTITIONS=3 + +# +# SPIFFS Cache Configuration +# +CONFIG_SPIFFS_CACHE=y +CONFIG_SPIFFS_CACHE_WR=y +# CONFIG_SPIFFS_CACHE_STATS is not set +# end of SPIFFS Cache Configuration + +CONFIG_SPIFFS_PAGE_CHECK=y +CONFIG_SPIFFS_GC_MAX_RUNS=10 +# CONFIG_SPIFFS_GC_STATS is not set +CONFIG_SPIFFS_PAGE_SIZE=256 +CONFIG_SPIFFS_OBJ_NAME_LEN=32 +# CONFIG_SPIFFS_FOLLOW_SYMLINKS is not set +CONFIG_SPIFFS_USE_MAGIC=y +CONFIG_SPIFFS_USE_MAGIC_LENGTH=y +CONFIG_SPIFFS_META_LENGTH=4 +CONFIG_SPIFFS_USE_MTIME=y + +# +# Debug Configuration +# +# CONFIG_SPIFFS_DBG is not set +# CONFIG_SPIFFS_API_DBG is not set +# CONFIG_SPIFFS_GC_DBG is not set +# CONFIG_SPIFFS_CACHE_DBG is not set +# CONFIG_SPIFFS_CHECK_DBG is not set +# CONFIG_SPIFFS_TEST_VISUALISATION is not set +# end of Debug Configuration +# end of SPIFFS Configuration + +# +# TCP Transport +# + +# +# Websocket +# +CONFIG_WS_TRANSPORT=y +CONFIG_WS_BUFFER_SIZE=1024 +# CONFIG_WS_DYNAMIC_BUFFER is not set +# end of Websocket +# end of TCP Transport + +# +# Ultra Low Power (ULP) Co-processor +# +# CONFIG_ULP_COPROC_ENABLED is not set + +# +# ULP Debugging Options +# +# end of ULP Debugging Options +# end of Ultra Low Power (ULP) Co-processor + +# +# Unity unit testing library +# +CONFIG_UNITY_ENABLE_FLOAT=y +CONFIG_UNITY_ENABLE_DOUBLE=y +# CONFIG_UNITY_ENABLE_64BIT is not set +# CONFIG_UNITY_ENABLE_COLOR is not set +CONFIG_UNITY_ENABLE_IDF_TEST_RUNNER=y +# CONFIG_UNITY_ENABLE_FIXTURE is not set +# CONFIG_UNITY_ENABLE_BACKTRACE_ON_FAIL is not set +# CONFIG_UNITY_TEST_ORDER_BY_FILE_PATH_AND_LINE is not set +# end of Unity unit testing library + +# +# USB-OTG +# +CONFIG_USB_HOST_CONTROL_TRANSFER_MAX_SIZE=256 +CONFIG_USB_HOST_HW_BUFFER_BIAS_BALANCED=y +# CONFIG_USB_HOST_HW_BUFFER_BIAS_IN is not set +# CONFIG_USB_HOST_HW_BUFFER_BIAS_PERIODIC_OUT is not set + +# +# Hub Driver Configuration +# + +# +# Root Port configuration +# +CONFIG_USB_HOST_DEBOUNCE_DELAY_MS=250 +CONFIG_USB_HOST_RESET_HOLD_MS=30 +CONFIG_USB_HOST_RESET_RECOVERY_MS=30 +CONFIG_USB_HOST_SET_ADDR_RECOVERY_MS=10 +# end of Root Port configuration + +# CONFIG_USB_HOST_HUBS_SUPPORTED is not set +# end of Hub Driver Configuration + +# CONFIG_USB_HOST_ENABLE_ENUM_FILTER_CALLBACK is not set +CONFIG_USB_OTG_SUPPORTED=y +# end of USB-OTG + +# +# Virtual file system +# +CONFIG_VFS_SUPPORT_IO=y +CONFIG_VFS_SUPPORT_DIR=y +CONFIG_VFS_SUPPORT_SELECT=y +CONFIG_VFS_SUPPRESS_SELECT_DEBUG_OUTPUT=y +# CONFIG_VFS_SELECT_IN_RAM is not set +CONFIG_VFS_SUPPORT_TERMIOS=y +CONFIG_VFS_MAX_COUNT=8 + +# +# Host File System I/O (Semihosting) +# +CONFIG_VFS_SEMIHOSTFS_MAX_MOUNT_POINTS=1 +# end of Host File System I/O (Semihosting) + +CONFIG_VFS_INITIALIZE_DEV_NULL=y +# end of Virtual file system + +# +# Wear Levelling +# +# CONFIG_WL_SECTOR_SIZE_512 is not set +CONFIG_WL_SECTOR_SIZE_4096=y +CONFIG_WL_SECTOR_SIZE=4096 +# end of Wear Levelling + +# +# Wi-Fi Provisioning Manager +# +CONFIG_WIFI_PROV_SCAN_MAX_ENTRIES=16 +CONFIG_WIFI_PROV_AUTOSTOP_TIMEOUT=30 +CONFIG_WIFI_PROV_STA_ALL_CHANNEL_SCAN=y +# CONFIG_WIFI_PROV_STA_FAST_SCAN is not set +# end of Wi-Fi Provisioning Manager + +# +# WebSocket Server +# +CONFIG_WEBSOCKET_SERVER_MAX_CLIENTS=20 +CONFIG_WEBSOCKET_SERVER_QUEUE_SIZE=10 +CONFIG_WEBSOCKET_SERVER_QUEUE_TIMEOUT=30 +CONFIG_WEBSOCKET_SERVER_TASK_STACK_DEPTH=6000 +CONFIG_WEBSOCKET_SERVER_TASK_PRIORITY=5 +# CONFIG_WEBSOCKET_SERVER_PINNED is not set +# end of WebSocket Server + +# +# DSP Library +# +CONFIG_DSP_OPTIMIZATIONS_SUPPORTED=y +# CONFIG_DSP_ANSI is not set +CONFIG_DSP_OPTIMIZED=y +CONFIG_DSP_OPTIMIZATION=1 +# CONFIG_DSP_MAX_FFT_SIZE_512 is not set +# CONFIG_DSP_MAX_FFT_SIZE_1024 is not set +# CONFIG_DSP_MAX_FFT_SIZE_2048 is not set +CONFIG_DSP_MAX_FFT_SIZE_4096=y +# CONFIG_DSP_MAX_FFT_SIZE_8192 is not set +# CONFIG_DSP_MAX_FFT_SIZE_16384 is not set +# CONFIG_DSP_MAX_FFT_SIZE_32768 is not set +CONFIG_DSP_MAX_FFT_SIZE=4096 +# end of DSP Library + +# +# mDNS +# +CONFIG_MDNS_MAX_INTERFACES=3 +CONFIG_MDNS_MAX_SERVICES=10 +CONFIG_MDNS_TASK_PRIORITY=1 +CONFIG_MDNS_ACTION_QUEUE_LEN=16 +CONFIG_MDNS_TASK_STACK_SIZE=2816 +CONFIG_MDNS_TASK_AFFINITY_NO_AFFINITY=y +# CONFIG_MDNS_TASK_AFFINITY_CPU0 is not set +# CONFIG_MDNS_TASK_AFFINITY_CPU1 is not set +CONFIG_MDNS_TASK_AFFINITY=0x7FFFFFFF + +# +# MDNS Memory Configuration +# +# CONFIG_MDNS_TASK_CREATE_FROM_SPIRAM is not set +CONFIG_MDNS_TASK_CREATE_FROM_INTERNAL=y +# CONFIG_MDNS_MEMORY_ALLOC_SPIRAM is not set +CONFIG_MDNS_MEMORY_ALLOC_INTERNAL=y +# CONFIG_MDNS_MEMORY_CUSTOM_IMPL is not set +# end of MDNS Memory Configuration + +CONFIG_MDNS_SERVICE_ADD_TIMEOUT_MS=2000 +CONFIG_MDNS_TIMER_PERIOD_MS=100 +# CONFIG_MDNS_NETWORKING_SOCKET is not set +# CONFIG_MDNS_SKIP_SUPPRESSING_OWN_QUERIES is not set +# CONFIG_MDNS_ENABLE_DEBUG_PRINTS is not set +CONFIG_MDNS_ENABLE_CONSOLE_CLI=y +# CONFIG_MDNS_RESPOND_REVERSE_QUERIES is not set +CONFIG_MDNS_MULTIPLE_INSTANCE=y + +# +# MDNS Predefined interfaces +# +CONFIG_MDNS_PREDEF_NETIF_STA=y +CONFIG_MDNS_PREDEF_NETIF_AP=y +CONFIG_MDNS_PREDEF_NETIF_ETH=y +# end of MDNS Predefined interfaces +# end of mDNS +# end of Component config + +# CONFIG_IDF_EXPERIMENTAL_FEATURES is not set + +# Deprecated options for backward compatibility +# CONFIG_APP_BUILD_TYPE_ELF_RAM is not set +# CONFIG_NO_BLOBS is not set +CONFIG_APP_ROLLBACK_ENABLE=y +# CONFIG_APP_ANTI_ROLLBACK is not set +# CONFIG_LOG_BOOTLOADER_LEVEL_NONE is not set +# CONFIG_LOG_BOOTLOADER_LEVEL_ERROR is not set +# CONFIG_LOG_BOOTLOADER_LEVEL_WARN is not set +CONFIG_LOG_BOOTLOADER_LEVEL_INFO=y +# CONFIG_LOG_BOOTLOADER_LEVEL_DEBUG is not set +# CONFIG_LOG_BOOTLOADER_LEVEL_VERBOSE is not set +CONFIG_LOG_BOOTLOADER_LEVEL=3 +# CONFIG_FLASH_ENCRYPTION_ENABLED is not set +# CONFIG_FLASHMODE_QIO is not set +# CONFIG_FLASHMODE_QOUT is not set +CONFIG_FLASHMODE_DIO=y +# CONFIG_FLASHMODE_DOUT is not set +CONFIG_MONITOR_BAUD=115200 +# CONFIG_OPTIMIZATION_LEVEL_DEBUG is not set +# CONFIG_COMPILER_OPTIMIZATION_LEVEL_DEBUG is not set +# CONFIG_COMPILER_OPTIMIZATION_DEFAULT is not set +# CONFIG_OPTIMIZATION_LEVEL_RELEASE is not set +# CONFIG_COMPILER_OPTIMIZATION_LEVEL_RELEASE is not set +CONFIG_OPTIMIZATION_ASSERTIONS_ENABLED=y +# CONFIG_OPTIMIZATION_ASSERTIONS_SILENT is not set +# CONFIG_OPTIMIZATION_ASSERTIONS_DISABLED is not set +CONFIG_OPTIMIZATION_ASSERTION_LEVEL=2 +# CONFIG_CXX_EXCEPTIONS is not set +CONFIG_STACK_CHECK_NONE=y +# CONFIG_STACK_CHECK_NORM is not set +# CONFIG_STACK_CHECK_STRONG is not set +# CONFIG_STACK_CHECK_ALL is not set +# CONFIG_WARN_WRITE_STRINGS is not set +# CONFIG_ESP32_APPTRACE_DEST_TRAX is not set +CONFIG_ESP32_APPTRACE_DEST_NONE=y +CONFIG_ESP32_APPTRACE_LOCK_ENABLE=y +# CONFIG_EXTERNAL_COEX_ENABLE is not set +# CONFIG_ESP_WIFI_EXTERNAL_COEXIST_ENABLE is not set +# CONFIG_CAM_CTLR_DVP_CAM_ISR_IRAM_SAFE is not set +# CONFIG_GPTIMER_ISR_IRAM_SAFE is not set +# CONFIG_MCPWM_ISR_IRAM_SAFE is not set +# CONFIG_EVENT_LOOP_PROFILING is not set +CONFIG_POST_EVENTS_FROM_ISR=y +CONFIG_POST_EVENTS_FROM_IRAM_ISR=y +CONFIG_GDBSTUB_SUPPORT_TASKS=y +CONFIG_GDBSTUB_MAX_TASKS=32 +# CONFIG_OTA_ALLOW_HTTP is not set +CONFIG_ESP32S3_DEEP_SLEEP_WAKEUP_DELAY=2000 +CONFIG_ESP_SLEEP_DEEP_SLEEP_WAKEUP_DELAY=2000 +CONFIG_ESP32S3_RTC_CLK_SRC_INT_RC=y +# CONFIG_ESP32S3_RTC_CLK_SRC_EXT_CRYS is not set +# CONFIG_ESP32S3_RTC_CLK_SRC_EXT_OSC is not set +# CONFIG_ESP32S3_RTC_CLK_SRC_INT_8MD256 is not set +CONFIG_ESP32S3_RTC_CLK_CAL_CYCLES=1024 +CONFIG_PERIPH_CTRL_FUNC_IN_IRAM=y +CONFIG_BROWNOUT_DET=y +CONFIG_ESP32S3_BROWNOUT_DET=y +CONFIG_BROWNOUT_DET_LVL_SEL_7=y +CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_7=y +# CONFIG_BROWNOUT_DET_LVL_SEL_6 is not set +# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_6 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_5 is not set +# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_5 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_4 is not set +# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_4 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_3 is not set +# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_3 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_2 is not set +# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_2 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_1 is not set +# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_1 is not set +CONFIG_BROWNOUT_DET_LVL=7 +CONFIG_ESP32S3_BROWNOUT_DET_LVL=7 +CONFIG_ESP_SYSTEM_BROWNOUT_INTR=y +CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE=y +# CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION is not set +CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER=20 +CONFIG_ESP32_PHY_MAX_TX_POWER=20 +# CONFIG_REDUCE_PHY_TX_POWER is not set +# CONFIG_ESP32_REDUCE_PHY_TX_POWER is not set +CONFIG_ESP_SYSTEM_PM_POWER_DOWN_CPU=y +CONFIG_PM_POWER_DOWN_TAGMEM_IN_LIGHT_SLEEP=y +CONFIG_ESP32S3_SPIRAM_SUPPORT=y +CONFIG_DEFAULT_PSRAM_CLK_IO=30 +CONFIG_DEFAULT_PSRAM_CS_IO=26 +# CONFIG_ESP32S3_DEFAULT_CPU_FREQ_80 is not set +# CONFIG_ESP32S3_DEFAULT_CPU_FREQ_160 is not set +CONFIG_ESP32S3_DEFAULT_CPU_FREQ_240=y +CONFIG_ESP32S3_DEFAULT_CPU_FREQ_MHZ=240 +CONFIG_SYSTEM_EVENT_QUEUE_SIZE=32 +CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=2304 +CONFIG_MAIN_TASK_STACK_SIZE=3584 +CONFIG_CONSOLE_UART_DEFAULT=y +# CONFIG_CONSOLE_UART_CUSTOM is not set +# CONFIG_CONSOLE_UART_NONE is not set +# CONFIG_ESP_CONSOLE_UART_NONE is not set +CONFIG_CONSOLE_UART=y +CONFIG_CONSOLE_UART_NUM=0 +CONFIG_CONSOLE_UART_BAUDRATE=115200 +CONFIG_INT_WDT=y +CONFIG_INT_WDT_TIMEOUT_MS=300 +CONFIG_INT_WDT_CHECK_CPU1=y +CONFIG_TASK_WDT=y +CONFIG_ESP_TASK_WDT=y +# CONFIG_TASK_WDT_PANIC is not set +CONFIG_TASK_WDT_TIMEOUT_S=5 +CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU0=y +CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU1=y +# CONFIG_ESP32_DEBUG_STUBS_ENABLE is not set +CONFIG_ESP32S3_DEBUG_OCDAWARE=y +CONFIG_IPC_TASK_STACK_SIZE=1280 +CONFIG_TIMER_TASK_STACK_SIZE=3584 +CONFIG_ESP32_WIFI_ENABLED=y +CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=10 +CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=32 +CONFIG_ESP32_WIFI_STATIC_TX_BUFFER=y +# CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER is not set +CONFIG_ESP32_WIFI_TX_BUFFER_TYPE=0 +CONFIG_ESP32_WIFI_STATIC_TX_BUFFER_NUM=16 +# CONFIG_ESP32_WIFI_CSI_ENABLED is not set +CONFIG_ESP32_WIFI_AMPDU_TX_ENABLED=y +CONFIG_ESP32_WIFI_TX_BA_WIN=6 +CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED=y +CONFIG_ESP32_WIFI_RX_BA_WIN=6 +CONFIG_ESP32_WIFI_NVS_ENABLED=y +CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_0=y +# CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_1 is not set +CONFIG_ESP32_WIFI_SOFTAP_BEACON_MAX_LEN=752 +CONFIG_ESP32_WIFI_MGMT_SBUF_NUM=32 +CONFIG_ESP32_WIFI_IRAM_OPT=y +CONFIG_ESP32_WIFI_RX_IRAM_OPT=y +CONFIG_ESP32_WIFI_ENABLE_WPA3_SAE=y +CONFIG_ESP32_WIFI_ENABLE_WPA3_OWE_STA=y +CONFIG_WPA_MBEDTLS_CRYPTO=y +CONFIG_WPA_MBEDTLS_TLS_CLIENT=y +# CONFIG_WPA_WAPI_PSK is not set +# CONFIG_WPA_SUITE_B_192 is not set +# CONFIG_WPA_11KV_SUPPORT is not set +# CONFIG_WPA_MBO_SUPPORT is not set +# CONFIG_WPA_DPP_SUPPORT is not set +# CONFIG_WPA_11R_SUPPORT is not set +# CONFIG_WPA_WPS_SOFTAP_REGISTRAR is not set +# CONFIG_WPA_WPS_STRICT is not set +# CONFIG_WPA_DEBUG_PRINT is not set +# CONFIG_WPA_TESTING_OPTIONS is not set +# CONFIG_ESP32_ENABLE_COREDUMP_TO_FLASH is not set +# CONFIG_ESP32_ENABLE_COREDUMP_TO_UART is not set +CONFIG_ESP32_ENABLE_COREDUMP_TO_NONE=y +CONFIG_TIMER_TASK_PRIORITY=1 +CONFIG_TIMER_TASK_STACK_DEPTH=2048 +CONFIG_TIMER_QUEUE_LENGTH=10 +# CONFIG_ENABLE_STATIC_TASK_CLEAN_UP_HOOK is not set +CONFIG_SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY=y +# CONFIG_HAL_ASSERTION_SILIENT is not set +# CONFIG_L2_TO_L3_COPY is not set +CONFIG_ESP_GRATUITOUS_ARP=y +CONFIG_GARP_TMR_INTERVAL=60 +CONFIG_TCPIP_RECVMBOX_SIZE=32 +CONFIG_TCP_MAXRTX=12 +CONFIG_TCP_SYNMAXRTX=12 +CONFIG_TCP_MSS=1440 +CONFIG_TCP_MSL=60000 +CONFIG_TCP_SND_BUF_DEFAULT=5744 +CONFIG_TCP_WND_DEFAULT=5744 +CONFIG_TCP_RECVMBOX_SIZE=6 +CONFIG_TCP_QUEUE_OOSEQ=y +CONFIG_TCP_OVERSIZE_MSS=y +# CONFIG_TCP_OVERSIZE_QUARTER_MSS is not set +# CONFIG_TCP_OVERSIZE_DISABLE is not set +CONFIG_UDP_RECVMBOX_SIZE=6 +CONFIG_TCPIP_TASK_STACK_SIZE=3072 +CONFIG_TCPIP_TASK_AFFINITY_NO_AFFINITY=y +# CONFIG_TCPIP_TASK_AFFINITY_CPU0 is not set +# CONFIG_TCPIP_TASK_AFFINITY_CPU1 is not set +CONFIG_TCPIP_TASK_AFFINITY=0x7FFFFFFF +# CONFIG_PPP_SUPPORT is not set +CONFIG_NEWLIB_STDOUT_LINE_ENDING_CRLF=y +# CONFIG_NEWLIB_STDOUT_LINE_ENDING_LF is not set +# CONFIG_NEWLIB_STDOUT_LINE_ENDING_CR is not set +# CONFIG_NEWLIB_STDIN_LINE_ENDING_CRLF is not set +# CONFIG_NEWLIB_STDIN_LINE_ENDING_LF is not set +CONFIG_NEWLIB_STDIN_LINE_ENDING_CR=y +# CONFIG_NEWLIB_NANO_FORMAT is not set +CONFIG_NEWLIB_TIME_SYSCALL_USE_RTC_HRT=y +CONFIG_ESP32S3_TIME_SYSCALL_USE_RTC_SYSTIMER=y +CONFIG_ESP32S3_TIME_SYSCALL_USE_RTC_FRC1=y +# CONFIG_NEWLIB_TIME_SYSCALL_USE_RTC is not set +# CONFIG_ESP32S3_TIME_SYSCALL_USE_RTC is not set +# CONFIG_NEWLIB_TIME_SYSCALL_USE_HRT is not set +# CONFIG_ESP32S3_TIME_SYSCALL_USE_SYSTIMER is not set +# CONFIG_ESP32S3_TIME_SYSCALL_USE_FRC1 is not set +# CONFIG_NEWLIB_TIME_SYSCALL_USE_NONE is not set +# CONFIG_ESP32S3_TIME_SYSCALL_USE_NONE is not set +CONFIG_ESP32_PTHREAD_TASK_PRIO_DEFAULT=5 +CONFIG_ESP32_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072 +CONFIG_ESP32_PTHREAD_STACK_MIN=768 +CONFIG_ESP32_DEFAULT_PTHREAD_CORE_NO_AFFINITY=y +# CONFIG_ESP32_DEFAULT_PTHREAD_CORE_0 is not set +# CONFIG_ESP32_DEFAULT_PTHREAD_CORE_1 is not set +CONFIG_ESP32_PTHREAD_TASK_CORE_DEFAULT=-1 +CONFIG_ESP32_PTHREAD_TASK_NAME_DEFAULT="pthread" +CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ABORTS=y +# CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_FAILS is not set +# CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ALLOWED is not set +CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT=y +CONFIG_SUPPORT_TERMIOS=y +CONFIG_SEMIHOSTFS_MAX_MOUNT_POINTS=1 +# End of deprecated options From 86d77dac550afdb253dfdde5b6b7acedaba04076 Mon Sep 17 00:00:00 2001 From: Andriy Malyshenko Date: Fri, 28 Nov 2025 10:45:25 +0100 Subject: [PATCH 20/58] Added mode switch: 15-band EQ or EQ presets --- .../include/tas5805m_settings.h | 27 + .../tas5805m_settings/tas5805m_settings.c | 481 ++++++++++++++++-- .../ui_http_server/html/dac-settings.html | 86 +++- 3 files changed, 548 insertions(+), 46 deletions(-) diff --git a/components/tas5805m_settings/include/tas5805m_settings.h b/components/tas5805m_settings/include/tas5805m_settings.h index 4b640f70..fc28bd38 100644 --- a/components/tas5805m_settings/include/tas5805m_settings.h +++ b/components/tas5805m_settings/include/tas5805m_settings.h @@ -35,6 +35,28 @@ extern "C" { // EQ per-band gain keys prefix (final key will be e.g. "eq_gain_l_0" or "eq_gain_r_3") #define TAS5805M_NVS_KEY_EQ_GAIN_L_PREFIX "eq_gain_l_" #define TAS5805M_NVS_KEY_EQ_GAIN_R_PREFIX "eq_gain_r_" +// EQ profile/preset keys for left/right channels +#define TAS5805M_NVS_KEY_EQ_PROFILE_L "eq_profile_l" +#define TAS5805M_NVS_KEY_EQ_PROFILE_R "eq_profile_r" +// EQ UI mode (controls which UI elements are shown and how values are applied) +#define TAS5805M_NVS_KEY_EQ_UI_MODE "eq_ui_mode" + +/** EQ UI modes exposed to the settings UI. These control visibility and apply behavior. + * Defined here so the settings module owns the UI contract. Values are persisted to NVS. + */ +typedef enum { + TAS5805M_EQ_UI_MODE_OFF = 0, + TAS5805M_EQ_UI_MODE_15_BAND = 1, + TAS5805M_EQ_UI_MODE_15_BAND_BIAMP = 2, + TAS5805M_EQ_UI_MODE_PRESETS = 3, +} TAS5805M_EQ_UI_MODE; + +/** Convert an EQ UI mode to human-readable name (for schema name fields) */ +const char *tas5805m_eq_ui_mode_to_string(TAS5805M_EQ_UI_MODE m); + +/** Save/Load the UI mode selection to NVS */ +esp_err_t tas5805m_settings_save_eq_ui_mode(TAS5805M_EQ_UI_MODE mode); +esp_err_t tas5805m_settings_load_eq_ui_mode(TAS5805M_EQ_UI_MODE *mode); // Digital Volume Settings (in 0.5dB steps) - kept for UI scaling/display #define TAS5805M_DIGITAL_VOL_MIN -207 // -103.5 dB @@ -87,6 +109,11 @@ esp_err_t tas5805m_settings_save_eq_gain(TAS5805M_EQ_CHANNELS ch, int band, int /** Load per-band EQ gain for a channel from NVS */ esp_err_t tas5805m_settings_load_eq_gain(TAS5805M_EQ_CHANNELS ch, int band, int *gain_db); +/** Save EQ profile/preset for a specific channel to NVS */ +esp_err_t tas5805m_settings_save_eq_profile(TAS5805M_EQ_CHANNELS ch, TAS5805M_EQ_PROFILE profile); +/** Load EQ profile/preset for a specific channel from NVS */ +esp_err_t tas5805m_settings_load_eq_profile(TAS5805M_EQ_CHANNELS ch, TAS5805M_EQ_PROFILE *profile); + /** Get current TAS5805M settings as a JSON string */ esp_err_t tas5805m_settings_get_json(char *json_out, size_t max_len); diff --git a/components/tas5805m_settings/tas5805m_settings.c b/components/tas5805m_settings/tas5805m_settings.c index d6c3078a..1d85bf83 100644 --- a/components/tas5805m_settings/tas5805m_settings.c +++ b/components/tas5805m_settings/tas5805m_settings.c @@ -62,6 +62,61 @@ static const char* tas5805m_eq_mode_to_string(TAS5805M_EQ_MODE mode) { #endif } +/* Human readable names for the new EQ UI mode (defined in header) */ +const char *tas5805m_eq_ui_mode_to_string(TAS5805M_EQ_UI_MODE m) { + switch (m) { + case TAS5805M_EQ_UI_MODE_OFF: return "OFF"; + case TAS5805M_EQ_UI_MODE_15_BAND: return "15-band"; + case TAS5805M_EQ_UI_MODE_15_BAND_BIAMP: return "15-band (bi-amp)"; + case TAS5805M_EQ_UI_MODE_PRESETS: return "EQ Presets"; + default: return "Unknown"; + } +} + +/** Save UI mode to NVS */ +esp_err_t tas5805m_settings_save_eq_ui_mode(TAS5805M_EQ_UI_MODE mode) { + ESP_LOGD(TAG, "%s: mode=%d", __func__, (int)mode); + if (!tas5805m_settings_mutex) return ESP_ERR_INVALID_STATE; + if (xSemaphoreTake(tas5805m_settings_mutex, pdMS_TO_TICKS(5000)) != pdTRUE) return ESP_ERR_TIMEOUT; + nvs_handle_t h; + esp_err_t err = nvs_open(TAS5805M_NVS_NAMESPACE, NVS_READWRITE, &h); + if (err == ESP_OK) { + err = nvs_set_i32(h, TAS5805M_NVS_KEY_EQ_UI_MODE, (int32_t)mode); + if (err == ESP_OK) err = nvs_commit(h); + nvs_close(h); + } else { + ESP_LOGW(TAG, "%s: Failed to open NVS namespace '%s': %s", __func__, TAS5805M_NVS_NAMESPACE, esp_err_to_name(err)); + } + xSemaphoreGive(tas5805m_settings_mutex); + return err; +} + +/** Load UI mode from NVS */ +esp_err_t tas5805m_settings_load_eq_ui_mode(TAS5805M_EQ_UI_MODE *mode) { + if (!mode) return ESP_ERR_INVALID_ARG; + if (!tas5805m_settings_mutex) return ESP_ERR_INVALID_STATE; + if (xSemaphoreTake(tas5805m_settings_mutex, pdMS_TO_TICKS(5000)) != pdTRUE) return ESP_ERR_TIMEOUT; + nvs_handle_t h; + esp_err_t err = nvs_open(TAS5805M_NVS_NAMESPACE, NVS_READONLY, &h); + if (err == ESP_OK) { + int32_t v = 0; + err = nvs_get_i32(h, TAS5805M_NVS_KEY_EQ_UI_MODE, &v); + if (err == ESP_OK) { + *mode = (TAS5805M_EQ_UI_MODE)v; + ESP_LOGD(TAG, "%s: Loaded %s=%d from NVS", __func__, TAS5805M_NVS_KEY_EQ_UI_MODE, (int)*mode); + } else if (err == ESP_ERR_NVS_NOT_FOUND) { + ESP_LOGD(TAG, "%s: NVS key '%s' not found", __func__, TAS5805M_NVS_KEY_EQ_UI_MODE); + } else { + ESP_LOGW(TAG, "%s: Failed to read '%s' from NVS: %s", __func__, TAS5805M_NVS_KEY_EQ_UI_MODE, esp_err_to_name(err)); + } + nvs_close(h); + } else { + ESP_LOGW(TAG, "%s: Failed to open NVS namespace '%s': %s", __func__, TAS5805M_NVS_NAMESPACE, esp_err_to_name(err)); + } + xSemaphoreGive(tas5805m_settings_mutex); + return err; +} + esp_err_t tas5805m_settings_init(void) { if (tas5805m_settings_mutex == NULL) { tas5805m_settings_mutex = xSemaphoreCreateMutex(); @@ -454,6 +509,67 @@ esp_err_t tas5805m_settings_load_eq_gain(TAS5805M_EQ_CHANNELS ch, int band, int return err; } +/** Save EQ profile/preset for a specific channel */ +esp_err_t tas5805m_settings_save_eq_profile(TAS5805M_EQ_CHANNELS ch, TAS5805M_EQ_PROFILE profile) { + ESP_LOGD(TAG, "%s: ch=%d profile=%d", __func__, (int)ch, (int)profile); + + if (!tas5805m_settings_mutex) return ESP_ERR_INVALID_STATE; + + if (xSemaphoreTake(tas5805m_settings_mutex, pdMS_TO_TICKS(5000)) != pdTRUE) { + return ESP_ERR_TIMEOUT; + } + + const char *key = (ch == TAS5805M_EQ_CHANNELS_LEFT) ? TAS5805M_NVS_KEY_EQ_PROFILE_L : TAS5805M_NVS_KEY_EQ_PROFILE_R; + + nvs_handle_t h; + esp_err_t err = nvs_open(TAS5805M_NVS_NAMESPACE, NVS_READWRITE, &h); + if (err == ESP_OK) { + err = nvs_set_i32(h, key, (int32_t)profile); + if (err == ESP_OK) { + err = nvs_commit(h); + } + nvs_close(h); + } else { + ESP_LOGW(TAG, "%s: Failed to open NVS namespace '%s': %s", __func__, TAS5805M_NVS_NAMESPACE, esp_err_to_name(err)); + } + + xSemaphoreGive(tas5805m_settings_mutex); + return err; +} + +/** Load EQ profile/preset for a specific channel */ +esp_err_t tas5805m_settings_load_eq_profile(TAS5805M_EQ_CHANNELS ch, TAS5805M_EQ_PROFILE *profile) { + if (!profile) return ESP_ERR_INVALID_ARG; + if (!tas5805m_settings_mutex) return ESP_ERR_INVALID_STATE; + + if (xSemaphoreTake(tas5805m_settings_mutex, pdMS_TO_TICKS(5000)) != pdTRUE) { + return ESP_ERR_TIMEOUT; + } + + const char *key = (ch == TAS5805M_EQ_CHANNELS_LEFT) ? TAS5805M_NVS_KEY_EQ_PROFILE_L : TAS5805M_NVS_KEY_EQ_PROFILE_R; + + nvs_handle_t h; + esp_err_t err = nvs_open(TAS5805M_NVS_NAMESPACE, NVS_READONLY, &h); + if (err == ESP_OK) { + int32_t v = 0; + err = nvs_get_i32(h, key, &v); + if (err == ESP_OK) { + *profile = (TAS5805M_EQ_PROFILE)v; + ESP_LOGD(TAG, "%s: Loaded %s=%d from NVS", __func__, key, (int)*profile); + } else if (err == ESP_ERR_NVS_NOT_FOUND) { + ESP_LOGD(TAG, "%s: NVS key '%s' not found", __func__, key); + } else { + ESP_LOGW(TAG, "%s: Failed to read '%s' from NVS: %s", __func__, key, esp_err_to_name(err)); + } + nvs_close(h); + } else { + ESP_LOGW(TAG, "%s: Failed to open NVS namespace '%s': %s", __func__, TAS5805M_NVS_NAMESPACE, esp_err_to_name(err)); + } + + xSemaphoreGive(tas5805m_settings_mutex); + return err; +} + /** Load EQ mode from NVS */ esp_err_t tas5805m_settings_load_eq_mode(TAS5805M_EQ_MODE *mode) { if (!mode) return ESP_ERR_INVALID_ARG; @@ -559,6 +675,28 @@ esp_err_t tas5805m_settings_get_json(char *json_out, size_t max_len) { #endif cJSON_AddNumberToObject(root, "eq_mode", (int)eq_mode_val); cJSON_AddStringToObject(root, "eq_mode_name", tas5805m_eq_mode_to_string(eq_mode_val)); + /* EQ UI mode (controls which UI elements to show) - prefer persisted value */ + TAS5805M_EQ_UI_MODE ui_mode_val = TAS5805M_EQ_UI_MODE_OFF; + if (tas5805m_settings_load_eq_ui_mode(&ui_mode_val) != ESP_OK) { + /* derive from driver eq_mode if not persisted */ + if (eq_mode_val == TAS5805M_EQ_MODE_OFF) ui_mode_val = TAS5805M_EQ_UI_MODE_OFF; + else if (eq_mode_val == TAS5805M_EQ_MODE_ON) ui_mode_val = TAS5805M_EQ_UI_MODE_15_BAND; + else ui_mode_val = TAS5805M_EQ_UI_MODE_15_BAND_BIAMP; + } + cJSON_AddNumberToObject(root, "eq_ui_mode", (int)ui_mode_val); + cJSON_AddStringToObject(root, "eq_ui_mode_name", tas5805m_eq_ui_mode_to_string(ui_mode_val)); + /* EQ profile/preset per channel */ +#if defined(CONFIG_DAC_TAS5805M_EQ_SUPPORT) + { + TAS5805M_EQ_PROFILE prof_l = FLAT, prof_r = FLAT; + if (tas5805m_get_eq_profile_channel(TAS5805M_EQ_CHANNELS_LEFT, &prof_l) == ESP_OK) { + cJSON_AddNumberToObject(root, "eq_profile_l", (int)prof_l); + } + if (tas5805m_get_eq_profile_channel(TAS5805M_EQ_CHANNELS_RIGHT, &prof_r) == ESP_OK) { + cJSON_AddNumberToObject(root, "eq_profile_r", (int)prof_r); + } + } +#endif /* Mixer mode from cached state */ cJSON_AddNumberToObject(root, "mixer_mode", (int)dac_state.mixer_mode); cJSON_AddStringToObject(root, "mixer_mode_name", tas5805m_mixer_mode_to_string(dac_state.mixer_mode)); @@ -757,6 +895,110 @@ esp_err_t tas5805m_settings_set_from_json(const char *json_in) { #endif } + // Update EQ UI selection if present. This controls which UI elements are shown + // and how values are applied/persisted (15-band vs presets etc.). We persist + // the UI selection in NVS and map it to the underlying driver EQ mode. + cJSON *eq_ui_item = cJSON_GetObjectItem(root, "eq_ui_mode"); + if (cJSON_IsNumber(eq_ui_item)) { + TAS5805M_EQ_UI_MODE ui = (TAS5805M_EQ_UI_MODE)eq_ui_item->valueint; + ESP_LOGI(TAG, "%s: Requested EQ UI mode %d", __func__, (int)ui); + + // Persist UI selection + esp_err_t uerr = tas5805m_settings_save_eq_ui_mode(ui); + if (uerr != ESP_OK) { + ESP_LOGW(TAG, "%s: Failed to persist EQ UI mode: %s", __func__, esp_err_to_name(uerr)); + } + +#if defined(CONFIG_DAC_TAS5805M_EQ_SUPPORT) + TAS5805M_EQ_MODE drv = TAS5805M_EQ_MODE_OFF; + switch (ui) { + case TAS5805M_EQ_UI_MODE_OFF: drv = TAS5805M_EQ_MODE_OFF; break; + case TAS5805M_EQ_UI_MODE_15_BAND: drv = TAS5805M_EQ_MODE_ON; break; + case TAS5805M_EQ_UI_MODE_15_BAND_BIAMP: drv = TAS5805M_EQ_MODE_BIAMP; break; + case TAS5805M_EQ_UI_MODE_PRESETS: drv = TAS5805M_EQ_MODE_BIAMP; break; + default: drv = TAS5805M_EQ_MODE_OFF; break; + } + + esp_err_t serr = tas5805m_set_eq_mode(drv); + if (serr == ESP_OK) { + ESP_LOGI(TAG, "%s: Applied driver EQ mode %d for UI selection %d", __func__, (int)drv, (int)ui); + } else { + ESP_LOGE(TAG, "%s: Failed to set driver EQ mode: %s", __func__, esp_err_to_name(serr)); + } + + // Immediately apply persisted data according to selected UI mode + if (ui == TAS5805M_EQ_UI_MODE_15_BAND) { + for (int band = 0; band < TAS5805M_EQ_BANDS; ++band) { + int gain = 0; + if (tas5805m_settings_load_eq_gain(TAS5805M_EQ_CHANNELS_LEFT, band, &gain) == ESP_OK) { + if (tas5805m_set_eq_gain_channel(TAS5805M_EQ_CHANNELS_LEFT, band, gain) == ESP_OK) { + ESP_LOGI(TAG, "%s: Applied L band %d = %d (15-band)", __func__, band, gain); + } + } + } + } else if (ui == TAS5805M_EQ_UI_MODE_15_BAND_BIAMP) { + for (int band = 0; band < TAS5805M_EQ_BANDS; ++band) { + int gain = 0; + if (tas5805m_settings_load_eq_gain(TAS5805M_EQ_CHANNELS_LEFT, band, &gain) == ESP_OK) { + tas5805m_set_eq_gain_channel(TAS5805M_EQ_CHANNELS_LEFT, band, gain); + } + if (tas5805m_settings_load_eq_gain(TAS5805M_EQ_CHANNELS_RIGHT, band, &gain) == ESP_OK) { + tas5805m_set_eq_gain_channel(TAS5805M_EQ_CHANNELS_RIGHT, band, gain); + } + } + } else if (ui == TAS5805M_EQ_UI_MODE_PRESETS) { + TAS5805M_EQ_PROFILE prof = FLAT; + if (tas5805m_settings_load_eq_profile(TAS5805M_EQ_CHANNELS_LEFT, &prof) == ESP_OK) { + tas5805m_set_eq_profile_channel(TAS5805M_EQ_CHANNELS_LEFT, prof); + } + if (tas5805m_settings_load_eq_profile(TAS5805M_EQ_CHANNELS_RIGHT, &prof) == ESP_OK) { + tas5805m_set_eq_profile_channel(TAS5805M_EQ_CHANNELS_RIGHT, prof); + } + } +#else + ESP_LOGW(TAG, "%s: EQ support disabled; ignoring eq_ui_mode change", __func__); +#endif + } + + // Update EQ profile/preset per channel if present + cJSON *eq_prof_l_item = cJSON_GetObjectItem(root, "eq_profile_l"); + if (cJSON_IsNumber(eq_prof_l_item)) { + TAS5805M_EQ_PROFILE p = (TAS5805M_EQ_PROFILE)eq_prof_l_item->valueint; +#if defined(CONFIG_DAC_TAS5805M_EQ_SUPPORT) + esp_err_t serr = tas5805m_set_eq_profile_channel(TAS5805M_EQ_CHANNELS_LEFT, p); + if (serr == ESP_OK) { + ESP_LOGI(TAG, "%s: Applied EQ profile L = %d", __func__, (int)p); + esp_err_t perr = tas5805m_settings_save_eq_profile(TAS5805M_EQ_CHANNELS_LEFT, p); + if (perr != ESP_OK) { + ESP_LOGW(TAG, "%s: Failed to persist EQ profile L: %s", __func__, esp_err_to_name(perr)); + } + } else { + ESP_LOGE(TAG, "%s: Failed to apply EQ profile L: %s", __func__, esp_err_to_name(serr)); + } +#else + ESP_LOGW(TAG, "%s: EQ support disabled; ignoring eq_profile_l", __func__); +#endif + } + + cJSON *eq_prof_r_item = cJSON_GetObjectItem(root, "eq_profile_r"); + if (cJSON_IsNumber(eq_prof_r_item)) { + TAS5805M_EQ_PROFILE p = (TAS5805M_EQ_PROFILE)eq_prof_r_item->valueint; +#if defined(CONFIG_DAC_TAS5805M_EQ_SUPPORT) + esp_err_t serr = tas5805m_set_eq_profile_channel(TAS5805M_EQ_CHANNELS_RIGHT, p); + if (serr == ESP_OK) { + ESP_LOGI(TAG, "%s: Applied EQ profile R = %d", __func__, (int)p); + esp_err_t perr = tas5805m_settings_save_eq_profile(TAS5805M_EQ_CHANNELS_RIGHT, p); + if (perr != ESP_OK) { + ESP_LOGW(TAG, "%s: Failed to persist EQ profile R: %s", __func__, esp_err_to_name(perr)); + } + } else { + ESP_LOGE(TAG, "%s: Failed to apply EQ profile R: %s", __func__, esp_err_to_name(serr)); + } +#else + ESP_LOGW(TAG, "%s: EQ support disabled; ignoring eq_profile_r", __func__); +#endif + } + // Handle per-band EQ gain keys in deterministic order: left then right per band #if defined(CONFIG_DAC_TAS5805M_EQ_SUPPORT) for (int band = 0; band < TAS5805M_EQ_BANDS; ++band) { @@ -1121,44 +1363,149 @@ esp_err_t tas5805m_settings_get_schema_json(char *json_out, size_t max_len) { cJSON *eq_params = cJSON_CreateArray(); - cJSON *eq_mode_param = cJSON_CreateObject(); - cJSON_AddStringToObject(eq_mode_param, "key", "eq_mode"); - cJSON_AddStringToObject(eq_mode_param, "name", "EQ Mode"); - cJSON_AddStringToObject(eq_mode_param, "type", "enum"); - cJSON_AddNumberToObject(eq_mode_param, "current", (int)eq_mode_val); + // Replace legacy EQ mode with a UI-focused EQ selection that controls which UI elements are shown + cJSON *eq_ui_param = cJSON_CreateObject(); + cJSON_AddStringToObject(eq_ui_param, "key", "eq_ui_mode"); + cJSON_AddStringToObject(eq_ui_param, "name", "EQ Mode"); + cJSON_AddStringToObject(eq_ui_param, "type", "enum"); + + // Determine current UI mode: prefer persisted UI selection, otherwise derive from driver eq_mode + TAS5805M_EQ_UI_MODE cur_ui_mode = TAS5805M_EQ_UI_MODE_OFF; + if (tas5805m_settings_load_eq_ui_mode(&cur_ui_mode) != ESP_OK) { + // fallback: map driver eq_mode to a reasonable UI mode +#if defined(CONFIG_DAC_TAS5805M_EQ_SUPPORT) + TAS5805M_EQ_MODE drv = TAS5805M_EQ_MODE_OFF; + if (tas5805m_get_eq_mode(&drv) == ESP_OK) { + if (drv == TAS5805M_EQ_MODE_OFF) cur_ui_mode = TAS5805M_EQ_UI_MODE_OFF; + else if (drv == TAS5805M_EQ_MODE_ON) cur_ui_mode = TAS5805M_EQ_UI_MODE_15_BAND; + else cur_ui_mode = TAS5805M_EQ_UI_MODE_15_BAND_BIAMP; + } +#endif + } - cJSON *eq_mode_values = cJSON_CreateArray(); + cJSON_AddNumberToObject(eq_ui_param, "current", (int)cur_ui_mode); + cJSON *eq_ui_values = cJSON_CreateArray(); + cJSON *v_off = cJSON_CreateObject(); + cJSON_AddNumberToObject(v_off, "value", (int)TAS5805M_EQ_UI_MODE_OFF); + cJSON_AddStringToObject(v_off, "name", "OFF"); + cJSON_AddItemToArray(eq_ui_values, v_off); + + cJSON *v_15 = cJSON_CreateObject(); + cJSON_AddNumberToObject(v_15, "value", (int)TAS5805M_EQ_UI_MODE_15_BAND); + cJSON_AddStringToObject(v_15, "name", "15-band"); + cJSON_AddItemToArray(eq_ui_values, v_15); + + cJSON *v_15_bi = cJSON_CreateObject(); + cJSON_AddNumberToObject(v_15_bi, "value", (int)TAS5805M_EQ_UI_MODE_15_BAND_BIAMP); + cJSON_AddStringToObject(v_15_bi, "name", "15-band (bi-amp)"); + cJSON_AddItemToArray(eq_ui_values, v_15_bi); + + cJSON *v_preset = cJSON_CreateObject(); + cJSON_AddNumberToObject(v_preset, "value", (int)TAS5805M_EQ_UI_MODE_PRESETS); + cJSON_AddStringToObject(v_preset, "name", "EQ Presets"); + cJSON_AddItemToArray(eq_ui_values, v_preset); + + cJSON_AddItemToObject(eq_ui_param, "values", eq_ui_values); + cJSON_AddItemToArray(eq_params, eq_ui_param); + + // EQ Preset / Profile per channel #if defined(CONFIG_DAC_TAS5805M_EQ_SUPPORT) - cJSON *eq_off = cJSON_CreateObject(); - cJSON_AddNumberToObject(eq_off, "value", TAS5805M_EQ_MODE_OFF); - cJSON_AddStringToObject(eq_off, "name", "OFF"); - cJSON_AddItemToArray(eq_mode_values, eq_off); - - cJSON *eq_on = cJSON_CreateObject(); - cJSON_AddNumberToObject(eq_on, "value", TAS5805M_EQ_MODE_ON); - cJSON_AddStringToObject(eq_on, "name", "ON"); - cJSON_AddItemToArray(eq_mode_values, eq_on); - - cJSON *eq_biamp = cJSON_CreateObject(); - cJSON_AddNumberToObject(eq_biamp, "value", TAS5805M_EQ_MODE_BIAMP); - cJSON_AddStringToObject(eq_biamp, "name", "BI-AMP"); - cJSON_AddItemToArray(eq_mode_values, eq_biamp); - - cJSON *eq_biamp_off = cJSON_CreateObject(); - cJSON_AddNumberToObject(eq_biamp_off, "value", TAS5805M_EQ_MODE_BIAMP_OFF); - cJSON_AddStringToObject(eq_biamp_off, "name", "BI-AMP (OFF)"); - cJSON_AddItemToArray(eq_mode_values, eq_biamp_off); + { + TAS5805M_EQ_PROFILE cur_prof_l = FLAT, cur_prof_r = FLAT; + if (tas5805m_get_eq_profile_channel(TAS5805M_EQ_CHANNELS_LEFT, &cur_prof_l) != ESP_OK) cur_prof_l = FLAT; + if (tas5805m_get_eq_profile_channel(TAS5805M_EQ_CHANNELS_RIGHT, &cur_prof_r) != ESP_OK) cur_prof_r = FLAT; + + cJSON *prof_l_param = cJSON_CreateObject(); + cJSON_AddStringToObject(prof_l_param, "key", "eq_profile_l"); + cJSON_AddStringToObject(prof_l_param, "name", "EQ Preset (L)"); + cJSON_AddStringToObject(prof_l_param, "type", "enum"); + cJSON_AddNumberToObject(prof_l_param, "current", (int)cur_prof_l); + + cJSON *prof_l_values = cJSON_CreateArray(); + cJSON *v; + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", FLAT); cJSON_AddStringToObject(v, "name", "Flat"); cJSON_AddItemToArray(prof_l_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", LF_60HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "LF 60 Hz Cutoff"); cJSON_AddItemToArray(prof_l_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", LF_70HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "LF 70 Hz Cutoff"); cJSON_AddItemToArray(prof_l_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", LF_80HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "LF 80 Hz Cutoff"); cJSON_AddItemToArray(prof_l_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", LF_90HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "LF 90 Hz Cutoff"); cJSON_AddItemToArray(prof_l_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", LF_100HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "LF 100 Hz Cutoff"); cJSON_AddItemToArray(prof_l_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", LF_110HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "LF 110 Hz Cutoff"); cJSON_AddItemToArray(prof_l_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", LF_120HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "LF 120 Hz Cutoff"); cJSON_AddItemToArray(prof_l_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", LF_130HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "LF 130 Hz Cutoff"); cJSON_AddItemToArray(prof_l_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", LF_140HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "LF 140 Hz Cutoff"); cJSON_AddItemToArray(prof_l_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", LF_150HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "LF 150 Hz Cutoff"); cJSON_AddItemToArray(prof_l_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", HF_60HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "HF 60 Hz Cutoff"); cJSON_AddItemToArray(prof_l_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", HF_70HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "HF 70 Hz Cutoff"); cJSON_AddItemToArray(prof_l_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", HF_80HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "HF 80 Hz Cutoff"); cJSON_AddItemToArray(prof_l_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", HF_90HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "HF 90 Hz Cutoff"); cJSON_AddItemToArray(prof_l_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", HF_100HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "HF 100 Hz Cutoff"); cJSON_AddItemToArray(prof_l_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", HF_110HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "HF 110 Hz Cutoff"); cJSON_AddItemToArray(prof_l_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", HF_120HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "HF 120 Hz Cutoff"); cJSON_AddItemToArray(prof_l_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", HF_130HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "HF 130 Hz Cutoff"); cJSON_AddItemToArray(prof_l_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", HF_140HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "HF 140 Hz Cutoff"); cJSON_AddItemToArray(prof_l_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", HF_150HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "HF 150 Hz Cutoff"); cJSON_AddItemToArray(prof_l_values, v); + + cJSON_AddItemToObject(prof_l_param, "values", prof_l_values); + cJSON_AddItemToArray(eq_params, prof_l_param); + + // Right channel + cJSON *prof_r_param = cJSON_CreateObject(); + cJSON_AddStringToObject(prof_r_param, "key", "eq_profile_r"); + cJSON_AddStringToObject(prof_r_param, "name", "EQ Preset (R)"); + cJSON_AddStringToObject(prof_r_param, "type", "enum"); + cJSON_AddNumberToObject(prof_r_param, "current", (int)cur_prof_r); + + // reuse same values array content for right channel + cJSON *prof_r_values = cJSON_CreateArray(); + // clone by creating new objects (same entries) + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", FLAT); cJSON_AddStringToObject(v, "name", "Flat"); cJSON_AddItemToArray(prof_r_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", LF_60HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "LF 60 Hz Cutoff"); cJSON_AddItemToArray(prof_r_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", LF_70HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "LF 70 Hz Cutoff"); cJSON_AddItemToArray(prof_r_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", LF_80HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "LF 80 Hz Cutoff"); cJSON_AddItemToArray(prof_r_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", LF_90HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "LF 90 Hz Cutoff"); cJSON_AddItemToArray(prof_r_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", LF_100HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "LF 100 Hz Cutoff"); cJSON_AddItemToArray(prof_r_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", LF_110HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "LF 110 Hz Cutoff"); cJSON_AddItemToArray(prof_r_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", LF_120HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "LF 120 Hz Cutoff"); cJSON_AddItemToArray(prof_r_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", LF_130HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "LF 130 Hz Cutoff"); cJSON_AddItemToArray(prof_r_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", LF_140HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "LF 140 Hz Cutoff"); cJSON_AddItemToArray(prof_r_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", LF_150HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "LF 150 Hz Cutoff"); cJSON_AddItemToArray(prof_r_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", HF_60HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "HF 60 Hz Cutoff"); cJSON_AddItemToArray(prof_r_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", HF_70HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "HF 70 Hz Cutoff"); cJSON_AddItemToArray(prof_r_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", HF_80HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "HF 80 Hz Cutoff"); cJSON_AddItemToArray(prof_r_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", HF_90HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "HF 90 Hz Cutoff"); cJSON_AddItemToArray(prof_r_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", HF_100HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "HF 100 Hz Cutoff"); cJSON_AddItemToArray(prof_r_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", HF_110HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "HF 110 Hz Cutoff"); cJSON_AddItemToArray(prof_r_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", HF_120HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "HF 120 Hz Cutoff"); cJSON_AddItemToArray(prof_r_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", HF_130HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "HF 130 Hz Cutoff"); cJSON_AddItemToArray(prof_r_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", HF_140HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "HF 140 Hz Cutoff"); cJSON_AddItemToArray(prof_r_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", HF_150HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "HF 150 Hz Cutoff"); cJSON_AddItemToArray(prof_r_values, v); + + cJSON_AddItemToObject(prof_r_param, "values", prof_r_values); + cJSON_AddItemToArray(eq_params, prof_r_param); + } #else - /* EQ support disabled - only provide OFF value so UI shows a single readonly option */ - cJSON *eq_off = cJSON_CreateObject(); - cJSON_AddNumberToObject(eq_off, "value", TAS5805M_EQ_MODE_OFF); - cJSON_AddStringToObject(eq_off, "name", "OFF"); - cJSON_AddItemToArray(eq_mode_values, eq_off); + // If EQ support disabled, provide readonly placeholders for presets + cJSON *prof_l_param = cJSON_CreateObject(); + cJSON_AddStringToObject(prof_l_param, "key", "eq_profile_l"); + cJSON_AddStringToObject(prof_l_param, "name", "EQ Preset (L)"); + cJSON_AddStringToObject(prof_l_param, "type", "enum"); + cJSON_AddNumberToObject(prof_l_param, "current", (int)FLAT); + cJSON *prof_l_vals = cJSON_CreateArray(); + cJSON *pv = cJSON_CreateObject(); cJSON_AddNumberToObject(pv, "value", FLAT); cJSON_AddStringToObject(pv, "name", "Flat"); cJSON_AddItemToArray(prof_l_vals, pv); + cJSON_AddItemToObject(prof_l_param, "values", prof_l_vals); + cJSON_AddItemToArray(eq_params, prof_l_param); + + cJSON *prof_r_param = cJSON_CreateObject(); + cJSON_AddStringToObject(prof_r_param, "key", "eq_profile_r"); + cJSON_AddStringToObject(prof_r_param, "name", "EQ Preset (R)"); + cJSON_AddStringToObject(prof_r_param, "type", "enum"); + cJSON_AddNumberToObject(prof_r_param, "current", (int)FLAT); + cJSON *prof_r_vals = cJSON_CreateArray(); + pv = cJSON_CreateObject(); cJSON_AddNumberToObject(pv, "value", FLAT); cJSON_AddStringToObject(pv, "name", "Flat"); cJSON_AddItemToArray(prof_r_vals, pv); + cJSON_AddItemToObject(prof_r_param, "values", prof_r_vals); + cJSON_AddItemToArray(eq_params, prof_r_param); #endif - - cJSON_AddItemToObject(eq_mode_param, "values", eq_mode_values); - cJSON_AddItemToArray(eq_params, eq_mode_param); cJSON_AddItemToObject(eq_group, "parameters", eq_params); /* Add per-band sliders for left and right channels (if EQ supported) */ #if defined(CONFIG_DAC_TAS5805M_EQ_SUPPORT) @@ -1310,22 +1657,66 @@ esp_err_t tas5805m_settings_apply_all(void) { } #if defined(CONFIG_DAC_TAS5805M_EQ_SUPPORT) - // Restore per-band EQ gains for both channels if persisted - for (int band = 0; band < TAS5805M_EQ_BANDS; ++band) { - int gain = 0; - if (tas5805m_settings_load_eq_gain(TAS5805M_EQ_CHANNELS_LEFT, band, &gain) == ESP_OK) { - if (tas5805m_set_eq_gain_channel(TAS5805M_EQ_CHANNELS_LEFT, band, gain) != ESP_OK) { - ESP_LOGW(TAG, "%s: Failed to apply saved EQ gain L band %d", __func__, band); + // Restore EQ based on persisted UI selection (eq_ui_mode). If no UI selection + // is persisted, derive a reasonable default from the saved driver EQ mode. + TAS5805M_EQ_UI_MODE ui_mode = TAS5805M_EQ_UI_MODE_OFF; + if (tas5805m_settings_load_eq_ui_mode(&ui_mode) != ESP_OK) { + // derive from saved eq_mode + if (eq_mode == TAS5805M_EQ_MODE_OFF) ui_mode = TAS5805M_EQ_UI_MODE_OFF; + else if (eq_mode == TAS5805M_EQ_MODE_ON) ui_mode = TAS5805M_EQ_UI_MODE_15_BAND; + else ui_mode = TAS5805M_EQ_UI_MODE_15_BAND_BIAMP; + } + + ESP_LOGI(TAG, "%s: Restoring EQ using UI mode %d (%s)", __func__, (int)ui_mode, tas5805m_eq_ui_mode_to_string(ui_mode)); + + if (ui_mode == TAS5805M_EQ_UI_MODE_OFF) { + // nothing to restore + } else if (ui_mode == TAS5805M_EQ_UI_MODE_15_BAND) { + // Apply left-channel per-band gains + for (int band = 0; band < TAS5805M_EQ_BANDS; ++band) { + int gain = 0; + if (tas5805m_settings_load_eq_gain(TAS5805M_EQ_CHANNELS_LEFT, band, &gain) == ESP_OK) { + if (tas5805m_set_eq_gain_channel(TAS5805M_EQ_CHANNELS_LEFT, band, gain) != ESP_OK) { + ESP_LOGW(TAG, "%s: Failed to apply saved EQ gain L band %d", __func__, band); + } else { + ESP_LOGI(TAG, "%s: Restored EQ gain L band %d = %d", __func__, band, gain); + } + } + } + } else if (ui_mode == TAS5805M_EQ_UI_MODE_15_BAND_BIAMP) { + // Apply both channels per-band gains + for (int band = 0; band < TAS5805M_EQ_BANDS; ++band) { + int gain = 0; + if (tas5805m_settings_load_eq_gain(TAS5805M_EQ_CHANNELS_LEFT, band, &gain) == ESP_OK) { + if (tas5805m_set_eq_gain_channel(TAS5805M_EQ_CHANNELS_LEFT, band, gain) != ESP_OK) { + ESP_LOGW(TAG, "%s: Failed to apply saved EQ gain L band %d", __func__, band); + } else { + ESP_LOGI(TAG, "%s: Restored EQ gain L band %d = %d", __func__, band, gain); + } + } + if (tas5805m_settings_load_eq_gain(TAS5805M_EQ_CHANNELS_RIGHT, band, &gain) == ESP_OK) { + if (tas5805m_set_eq_gain_channel(TAS5805M_EQ_CHANNELS_RIGHT, band, gain) != ESP_OK) { + ESP_LOGW(TAG, "%s: Failed to apply saved EQ gain R band %d", __func__, band); + } else { + ESP_LOGI(TAG, "%s: Restored EQ gain R band %d = %d", __func__, band, gain); + } + } + } + } else if (ui_mode == TAS5805M_EQ_UI_MODE_PRESETS) { + // Apply persisted EQ profiles for both channels + TAS5805M_EQ_PROFILE prof = FLAT; + if (tas5805m_settings_load_eq_profile(TAS5805M_EQ_CHANNELS_LEFT, &prof) == ESP_OK) { + if (tas5805m_set_eq_profile_channel(TAS5805M_EQ_CHANNELS_LEFT, prof) != ESP_OK) { + ESP_LOGW(TAG, "%s: Failed to apply saved EQ profile L", __func__); } else { - ESP_LOGI(TAG, "%s: Restored EQ gain L band %d = %d", __func__, band, gain); + ESP_LOGI(TAG, "%s: Restored EQ profile L = %d", __func__, (int)prof); } } - - if (tas5805m_settings_load_eq_gain(TAS5805M_EQ_CHANNELS_RIGHT, band, &gain) == ESP_OK) { - if (tas5805m_set_eq_gain_channel(TAS5805M_EQ_CHANNELS_RIGHT, band, gain) != ESP_OK) { - ESP_LOGW(TAG, "%s: Failed to apply saved EQ gain R band %d", __func__, band); + if (tas5805m_settings_load_eq_profile(TAS5805M_EQ_CHANNELS_RIGHT, &prof) == ESP_OK) { + if (tas5805m_set_eq_profile_channel(TAS5805M_EQ_CHANNELS_RIGHT, prof) != ESP_OK) { + ESP_LOGW(TAG, "%s: Failed to apply saved EQ profile R", __func__); } else { - ESP_LOGI(TAG, "%s: Restored EQ gain R band %d = %d", __func__, band, gain); + ESP_LOGI(TAG, "%s: Restored EQ profile R = %d", __func__, (int)prof); } } } diff --git a/components/ui_http_server/html/dac-settings.html b/components/ui_http_server/html/dac-settings.html index 05b4b5fe..1a154812 100644 --- a/components/ui_http_server/html/dac-settings.html +++ b/components/ui_http_server/html/dac-settings.html @@ -268,6 +268,9 @@

TAS5805M DAC Settings

2s
+
+ +
@@ -456,6 +459,25 @@

TAS5805M DAC Settings

container.innerHTML = ''; + // Determine EQ UI mode (used to show/hide EQ controls) + let uiMode = null; + // Prefer value from currentSettings + if (currentSettings && typeof currentSettings.eq_ui_mode !== 'undefined') { + uiMode = currentSettings.eq_ui_mode; + } else { + // Fallback: check schema param + for (const g of schema.groups) { + if (!g.parameters) continue; + for (const p of g.parameters) { + if (p.key === 'eq_ui_mode') { + uiMode = p.current; + break; + } + } + if (uiMode !== null) break; + } + } + // Render each group for (const group of schema.groups) { const groupDiv = document.createElement('div'); @@ -470,6 +492,30 @@

TAS5805M DAC Settings

// Render parameters in this group for (const param of group.parameters) { + // Conditionally hide/show EQ-related parameters based on uiMode + if (param && typeof param.key === 'string') { + // per-band sliders: keys start with 'eq_gain_' + if (param.key.startsWith('eq_gain_')) { + if (uiMode === null || uiMode === undefined) { + // if unknown, show nothing; safe default: hide + continue; + } + if (uiMode === 0) { // OFF + continue; + } + if (uiMode === 1) { // 15-band (left only) + if (!param.key.startsWith('eq_gain_l_')) continue; + } + if (uiMode === 3) { // PRESETS -> hide band sliders + continue; + } + // uiMode === 2 => show both + } + // presets keys: eq_profile_l / eq_profile_r -> only show for PRESETS + if (param.key === 'eq_profile_l' || param.key === 'eq_profile_r') { + if (uiMode !== 3) continue; + } + } const controlDiv = document.createElement('div'); controlDiv.className = 'parameter-control'; @@ -614,8 +660,46 @@

TAS5805M DAC Settings

} } + // Reset all EQ bands to zero (0 dB) and send to backend + async function resetEQ() { + if (!schema) return; + if (!confirm('Reset all EQ bands to 0 dB for both channels?')) return; + + // Build payload with all eq_gain_* keys set to 0 + const data = {}; + for (const group of schema.groups) { + if (!group.parameters) continue; + for (const param of group.parameters) { + if (typeof param.key === 'string' && param.key.startsWith('eq_gain_')) { + data[param.key] = 0; + } + } + } + + if (Object.keys(data).length === 0) { + alert('No EQ parameters found in schema.'); + return; + } + + try { + const resp = await postRequest('/api/dac/settings', data); + if (!resp.ok) throw new Error('Failed to reset EQ'); + // Refresh current settings and UI + await loadCurrentSettings(); + renderUI(); + alert('EQ reset to 0 dB applied'); + } catch (err) { + console.error('Error resetting EQ:', err); + alert('Failed to reset EQ.'); + } + } + // Initialize on page load - document.addEventListener('DOMContentLoaded', loadSchema); + document.addEventListener('DOMContentLoaded', () => { + loadSchema(); + const btn = document.getElementById('eq-reset-btn'); + if (btn) btn.addEventListener('click', resetEQ); + }); // Stop polling when page is unloaded window.addEventListener('beforeunload', stopPolling); From db76ced45658913c2e2eaefcbb5d565257bc2b20 Mon Sep 17 00:00:00 2001 From: Andriy Malyshenko Date: Fri, 28 Nov 2025 15:29:55 +0100 Subject: [PATCH 21/58] Added mixer compensation gains --- .../custom_board/tas5805m/include/tas5805m.h | 45 +++++ .../tas5805m/include/tas5805m_reg_cfg.h | 6 + .../tas5805m/include/tas5805m_types.h | 4 + components/custom_board/tas5805m/tas5805m.c | 99 +++++++++++ .../include/tas5805m_settings.h | 8 + .../tas5805m_settings/tas5805m_settings.c | 168 ++++++++++++++++++ 6 files changed, 330 insertions(+) diff --git a/components/custom_board/tas5805m/include/tas5805m.h b/components/custom_board/tas5805m/include/tas5805m.h index c6fd4068..cec5aca5 100644 --- a/components/custom_board/tas5805m/include/tas5805m.h +++ b/components/custom_board/tas5805m/include/tas5805m.h @@ -55,6 +55,10 @@ typedef struct { TAS5805M_CTRL_STATE state; TAS5805M_MIXER_MODE mixer_mode; + /* Cached per-output channel gain in dB (-24..24), default 0 dB */ + int8_t channel_gain_l; + int8_t channel_gain_r; + #if defined(CONFIG_DAC_TAS5805M_EQ_SUPPORT) int8_t eq_gain_l[TAS5805M_EQ_BANDS]; int8_t eq_gain_r[TAS5805M_EQ_BANDS]; @@ -289,6 +293,23 @@ esp_err_t tas5805m_set_mixer_mode(TAS5805M_MIXER_MODE mode); esp_err_t tas5805m_set_mixer_gain(TAS5805M_MIXER_CHANNELS channel, uint32_t gain); +/** + * @brief Set the mixer gain of the TAS5805M + * (4-bytes value, representing decimal in 9.23 format) + * + * @param channel: The channel to set the gain for + * @param gain: The gain to set + * + * @return + * - ESP_OK + * - ESP_FAIL + */ +esp_err_t tas5805m_set_channel_gain(TAS5805M_EQ_CHANNELS channel, + int8_t gain_db); + +/** Get cached per-output channel gain (dB) */ +esp_err_t tas5805m_get_channel_gain(TAS5805M_EQ_CHANNELS channel, int8_t *gain_db); + /** * @brief Get the faults of the TAS5805M * @@ -436,6 +457,30 @@ esp_err_t tas5805m_set_eq_profile_channel(TAS5805M_EQ_CHANNELS channel, #endif /* CONFIG_DAC_TAS5805M_EQ_SUPPORT */ +/** + * @brief Swap the endianness of a 32-bit integer. + * + * @param val Input 32-bit integer. + * @return 32-bit integer with swapped endianness. + */ +uint32_t tas5805m_swap_endian_32(uint32_t val); + +/** + * @brief Convert a Q9.23 fixed-point value to a float. + * + * @param raw Q9.23 value as a 32-bit unsigned integer. + * @return float-precision floating point representation. + */ +float tas5805m_q9_23_to_float(uint32_t raw); + +/** + * @brief Convert a float to a Q9.23 fixed-point value. + * + * @param value float-precision floating point input. + * @return Q9.23 fixed-point value as a 32-bit unsigned integer. + */ +uint32_t tas5805m_float_to_q9_23(float value); + #ifdef __cplusplus } #endif diff --git a/components/custom_board/tas5805m/include/tas5805m_reg_cfg.h b/components/custom_board/tas5805m/include/tas5805m_reg_cfg.h index 45f1fa2a..a64eff79 100644 --- a/components/custom_board/tas5805m/include/tas5805m_reg_cfg.h +++ b/components/custom_board/tas5805m/include/tas5805m_reg_cfg.h @@ -112,6 +112,7 @@ extern "C" #define TAS5805M_REG_RIGHT_TO_LEFT_GAIN 0x1c #define TAS5805M_REG_LEFT_TO_RIGHT_GAIN 0x20 #define TAS5805M_REG_RIGHT_TO_RIGHT_GAIN 0x24 + #define TAS5805M_REG_BOOK_5_VOLUME_PAGE 0x2a #define TAS5805M_REG_LEFT_VOLUME 0x24 #define TAS5805M_REG_RIGHT_VOLUME 0x28 @@ -121,4 +122,9 @@ extern "C" #define TAS5805M_MIXER_VALUE_MINUS6DB 0x00004000 #define TAS5805M_MIXER_VALUE_PLUS6DB 0x00000000 +#define TAS5805M_MIXER_VALUE_MINDB -24 +#define TAS5805M_MIXER_VALUE_MAXDB 24 +#define TAS5805M_MIXER_VALUES_COUNT (TAS5805M_MIXER_VALUE_MAXDB - TAS5805M_MIXER_VALUE_MINDB + 1) + + #endif diff --git a/components/custom_board/tas5805m/include/tas5805m_types.h b/components/custom_board/tas5805m/include/tas5805m_types.h index fd9b5d41..400824b9 100644 --- a/components/custom_board/tas5805m/include/tas5805m_types.h +++ b/components/custom_board/tas5805m/include/tas5805m_types.h @@ -157,6 +157,10 @@ typedef enum { HF_150HZ_CUTOFF = 20, // High Frequency 150Hz cutoff } TAS5805M_EQ_PROFILE; +#define TAS5805M_MIXER_VALUE_MINDB -24 +#define TAS5805M_MIXER_VALUE_MAXDB 24 +#define TAS5805M_MIXER_VALUES_COUNT (TAS5805M_MIXER_VALUE_MAXDB - TAS5805M_MIXER_VALUE_MINDB + 1) + #ifdef __cplusplus } #endif diff --git a/components/custom_board/tas5805m/tas5805m.c b/components/custom_board/tas5805m/tas5805m.c index d2f723db..fa96298c 100644 --- a/components/custom_board/tas5805m/tas5805m.c +++ b/components/custom_board/tas5805m/tas5805m.c @@ -29,6 +29,7 @@ #include "esp_log.h" #include "i2c_bus.h" #include "tas5805m_reg_cfg.h" +#include static const char *TAG = "TAS5805M"; @@ -44,6 +45,8 @@ static TAS5805_STATE tas5805m_state = { .volume = 0, .state = TAS5805M_CTRL_PLAY, .mixer_mode = MIXER_STEREO, + .channel_gain_l = 0, + .channel_gain_r = 0, }; /* Default I2C config */ @@ -610,6 +613,65 @@ esp_err_t tas5805m_set_mixer_gain(TAS5805M_MIXER_CHANNELS channel, uint32_t gain return ret; } + +// Set output channel volume using mixer gain lookup table +esp_err_t tas5805m_set_channel_gain(TAS5805M_EQ_CHANNELS channel, int8_t gain_db) +{ + ESP_LOGD(TAG, "%s: Setting channel %d volume to %d dB", __func__, channel, gain_db); + + if (gain_db < TAS5805M_MIXER_VALUE_MINDB || gain_db > TAS5805M_MIXER_VALUE_MAXDB) { + ESP_LOGE(TAG, "%s: Invalid gain_db %d, must be between %d and %d", __func__, gain_db, TAS5805M_MIXER_VALUE_MINDB, TAS5805M_MIXER_VALUE_MAXDB); + return ESP_ERR_INVALID_ARG; + } + + /* Convert dB to linear gain and then to Q9.23 register format */ + float linear = powf(10.0f, ((float)gain_db) / 20.0f); + uint32_t reg_value = tas5805m_float_to_q9_23(linear); + + uint8_t reg; + if (channel == TAS5805M_EQ_CHANNELS_RIGHT) { + reg = TAS5805M_REG_RIGHT_VOLUME; + } else { + // Default to left for any other value (matches other EQ channel helpers) + reg = TAS5805M_REG_LEFT_VOLUME; + } + + TAS5805M_SET_BOOK_AND_PAGE(TAS5805M_REG_BOOK_5, TAS5805M_REG_BOOK_5_VOLUME_PAGE); + int ret = tas5805m_write_bytes(®, 1, (uint8_t *)®_value, sizeof(reg_value)); + if (ret != ESP_OK) { + ESP_LOGE(TAG, "%s: Failed to write volume register 0x%02x: %s", __func__, reg, esp_err_to_name(ret)); + } else { + ESP_LOGD(TAG, "%s: Wrote volume register 0x%02x with value 0x%08x", __func__, reg, reg_value); + } + + TAS5805M_SET_BOOK_AND_PAGE(TAS5805M_REG_BOOK_CONTROL_PORT, TAS5805M_REG_PAGE_ZERO); + if (ret == ESP_OK) { + if (channel == TAS5805M_EQ_CHANNELS_RIGHT) { + tas5805m_state.channel_gain_r = gain_db; + } else { + tas5805m_state.channel_gain_l = gain_db; + } + } + + return ret; +} + +esp_err_t tas5805m_get_channel_gain(TAS5805M_EQ_CHANNELS channel, int8_t *gain_db) +{ + if (gain_db == NULL) { + return ESP_ERR_INVALID_ARG; + } + + if (channel == TAS5805M_EQ_CHANNELS_RIGHT) { + *gain_db = tas5805m_state.channel_gain_r; + } else { + *gain_db = tas5805m_state.channel_gain_l; + } + + ESP_LOGV(TAG, "%s: Returning cached channel %d gain %d dB", __func__, channel, *gain_db); + return ESP_OK; +} + esp_err_t tas5805m_clear_faults() { ESP_LOGD(TAG, "%s: Clearing faults", __func__); @@ -886,3 +948,40 @@ esp_err_t tas5805m_set_eq_profile_channel(TAS5805M_EQ_CHANNELS channel, TAS5805M } #endif /* CONFIG_DAC_TAS5805M_EQ_SUPPORT */ + +/* ------------------------- + Q9.23 conversions + ------------------------- */ + +float tas5805m_q9_23_to_float(uint32_t raw) +{ + uint32_t val = tas5805m_swap_endian_32(raw); + int32_t signed_val = (int32_t)val; + float result = (float)signed_val / 8388608.0f; // 2^23 + ESP_LOGD(TAG, "%s: raw=0x%08X, signed_val=%d -> result=%f", + __func__, raw, signed_val, result); + return result; +} + +uint32_t tas5805m_float_to_q9_23(float value) +{ + if (value > 255.999999f) value = 255.999999f; + if (value < -256.0f) value = -256.0f; + + int32_t fixed_val = (int32_t)(value * (1 << 23)); + uint32_t le_val = tas5805m_swap_endian_32((uint32_t)fixed_val); + + ESP_LOGD(TAG, "%s: value=%f -> fixed_val=%d, le_val=0x%08X", + __func__, value, fixed_val, le_val); + + return le_val; +} + +// Utility: swap endian for 32-bit values +uint32_t tas5805m_swap_endian_32(uint32_t val) +{ + return ((val & 0xFF) << 24) | + ((val & 0xFF00) << 8) | + ((val & 0xFF0000) >> 8) | + ((val >> 24) & 0xFF); +} \ No newline at end of file diff --git a/components/tas5805m_settings/include/tas5805m_settings.h b/components/tas5805m_settings/include/tas5805m_settings.h index fc28bd38..0a5fbac3 100644 --- a/components/tas5805m_settings/include/tas5805m_settings.h +++ b/components/tas5805m_settings/include/tas5805m_settings.h @@ -40,6 +40,9 @@ extern "C" { #define TAS5805M_NVS_KEY_EQ_PROFILE_R "eq_profile_r" // EQ UI mode (controls which UI elements are shown and how values are applied) #define TAS5805M_NVS_KEY_EQ_UI_MODE "eq_ui_mode" +// Channel gain NVS keys (single value per output channel, in dB) +#define TAS5805M_NVS_KEY_CHANNEL_GAIN_L "channel_gain_l" +#define TAS5805M_NVS_KEY_CHANNEL_GAIN_R "channel_gain_r" /** EQ UI modes exposed to the settings UI. These control visibility and apply behavior. * Defined here so the settings module owns the UI contract. Values are persisted to NVS. @@ -114,6 +117,11 @@ esp_err_t tas5805m_settings_save_eq_profile(TAS5805M_EQ_CHANNELS ch, TAS5805M_EQ /** Load EQ profile/preset for a specific channel from NVS */ esp_err_t tas5805m_settings_load_eq_profile(TAS5805M_EQ_CHANNELS ch, TAS5805M_EQ_PROFILE *profile); +/** Save per-output channel gain (single value per channel, in dB) */ +esp_err_t tas5805m_settings_save_channel_gain(TAS5805M_EQ_CHANNELS ch, int gain_db); +/** Load per-output channel gain (single value per channel, in dB) */ +esp_err_t tas5805m_settings_load_channel_gain(TAS5805M_EQ_CHANNELS ch, int *gain_db); + /** Get current TAS5805M settings as a JSON string */ esp_err_t tas5805m_settings_get_json(char *json_out, size_t max_len); diff --git a/components/tas5805m_settings/tas5805m_settings.c b/components/tas5805m_settings/tas5805m_settings.c index 1d85bf83..7f76c3ed 100644 --- a/components/tas5805m_settings/tas5805m_settings.c +++ b/components/tas5805m_settings/tas5805m_settings.c @@ -570,6 +570,67 @@ esp_err_t tas5805m_settings_load_eq_profile(TAS5805M_EQ_CHANNELS ch, TAS5805M_EQ return err; } +/** Save per-output channel gain (single value per channel, in dB) */ +esp_err_t tas5805m_settings_save_channel_gain(TAS5805M_EQ_CHANNELS ch, int gain_db) { + ESP_LOGD(TAG, "%s: ch=%d gain=%d", __func__, (int)ch, gain_db); + + if (!tas5805m_settings_mutex) return ESP_ERR_INVALID_STATE; + + if (xSemaphoreTake(tas5805m_settings_mutex, pdMS_TO_TICKS(5000)) != pdTRUE) { + return ESP_ERR_TIMEOUT; + } + + const char *key = (ch == TAS5805M_EQ_CHANNELS_LEFT) ? TAS5805M_NVS_KEY_CHANNEL_GAIN_L : TAS5805M_NVS_KEY_CHANNEL_GAIN_R; + + nvs_handle_t h; + esp_err_t err = nvs_open(TAS5805M_NVS_NAMESPACE, NVS_READWRITE, &h); + if (err == ESP_OK) { + err = nvs_set_i32(h, key, (int32_t)gain_db); + if (err == ESP_OK) { + err = nvs_commit(h); + } + nvs_close(h); + } else { + ESP_LOGW(TAG, "%s: Failed to open NVS namespace '%s': %s", __func__, TAS5805M_NVS_NAMESPACE, esp_err_to_name(err)); + } + + xSemaphoreGive(tas5805m_settings_mutex); + return err; +} + +/** Load per-output channel gain (single value per channel, in dB) */ +esp_err_t tas5805m_settings_load_channel_gain(TAS5805M_EQ_CHANNELS ch, int *gain_db) { + if (!gain_db) return ESP_ERR_INVALID_ARG; + if (!tas5805m_settings_mutex) return ESP_ERR_INVALID_STATE; + + if (xSemaphoreTake(tas5805m_settings_mutex, pdMS_TO_TICKS(5000)) != pdTRUE) { + return ESP_ERR_TIMEOUT; + } + + const char *key = (ch == TAS5805M_EQ_CHANNELS_LEFT) ? TAS5805M_NVS_KEY_CHANNEL_GAIN_L : TAS5805M_NVS_KEY_CHANNEL_GAIN_R; + + nvs_handle_t h; + esp_err_t err = nvs_open(TAS5805M_NVS_NAMESPACE, NVS_READONLY, &h); + if (err == ESP_OK) { + int32_t v = 0; + err = nvs_get_i32(h, key, &v); + if (err == ESP_OK) { + *gain_db = (int)v; + ESP_LOGD(TAG, "%s: Loaded %s=%d from NVS", __func__, key, *gain_db); + } else if (err == ESP_ERR_NVS_NOT_FOUND) { + ESP_LOGD(TAG, "%s: NVS key '%s' not found", __func__, key); + } else { + ESP_LOGW(TAG, "%s: Failed to read '%s' from NVS: %s", __func__, key, esp_err_to_name(err)); + } + nvs_close(h); + } else { + ESP_LOGW(TAG, "%s: Failed to open NVS namespace '%s': %s", __func__, TAS5805M_NVS_NAMESPACE, esp_err_to_name(err)); + } + + xSemaphoreGive(tas5805m_settings_mutex); + return err; +} + /** Load EQ mode from NVS */ esp_err_t tas5805m_settings_load_eq_mode(TAS5805M_EQ_MODE *mode) { if (!mode) return ESP_ERR_INVALID_ARG; @@ -695,6 +756,16 @@ esp_err_t tas5805m_settings_get_json(char *json_out, size_t max_len) { if (tas5805m_get_eq_profile_channel(TAS5805M_EQ_CHANNELS_RIGHT, &prof_r) == ESP_OK) { cJSON_AddNumberToObject(root, "eq_profile_r", (int)prof_r); } + + /* Channel gain (left/right) for presets UI */ + int ch_gain = 0; + int8_t chg = 0; + if (tas5805m_get_channel_gain(TAS5805M_EQ_CHANNELS_LEFT, &chg) == ESP_OK) { + cJSON_AddNumberToObject(root, "channel_gain_l", (int)chg); + } + if (tas5805m_get_channel_gain(TAS5805M_EQ_CHANNELS_RIGHT, &chg) == ESP_OK) { + cJSON_AddNumberToObject(root, "channel_gain_r", (int)chg); + } } #endif /* Mixer mode from cached state */ @@ -999,6 +1070,45 @@ esp_err_t tas5805m_settings_set_from_json(const char *json_in) { #endif } + /* Channel gain (L/R) handling for presets UI */ + cJSON *ch_gain_l_item = cJSON_GetObjectItem(root, TAS5805M_NVS_KEY_CHANNEL_GAIN_L); + if (cJSON_IsNumber(ch_gain_l_item)) { + int gain = ch_gain_l_item->valueint; +#if defined(CONFIG_DAC_TAS5805M_EQ_SUPPORT) + esp_err_t serr = tas5805m_set_channel_gain(TAS5805M_EQ_CHANNELS_LEFT, (int8_t)gain); + if (serr == ESP_OK) { + ESP_LOGI(TAG, "%s: Applied Channel Gain L = %d dB", __func__, gain); + esp_err_t perr = tas5805m_settings_save_channel_gain(TAS5805M_EQ_CHANNELS_LEFT, gain); + if (perr != ESP_OK) { + ESP_LOGW(TAG, "%s: Failed to persist Channel Gain L: %s", __func__, esp_err_to_name(perr)); + } + } else { + ESP_LOGE(TAG, "%s: Failed to apply Channel Gain L: %s", __func__, esp_err_to_name(serr)); + } +#else + ESP_LOGW(TAG, "%s: EQ support disabled; ignoring channel_gain_l", __func__); +#endif + } + + cJSON *ch_gain_r_item = cJSON_GetObjectItem(root, TAS5805M_NVS_KEY_CHANNEL_GAIN_R); + if (cJSON_IsNumber(ch_gain_r_item)) { + int gain = ch_gain_r_item->valueint; +#if defined(CONFIG_DAC_TAS5805M_EQ_SUPPORT) + esp_err_t serr = tas5805m_set_channel_gain(TAS5805M_EQ_CHANNELS_RIGHT, (int8_t)gain); + if (serr == ESP_OK) { + ESP_LOGI(TAG, "%s: Applied Channel Gain R = %d dB", __func__, gain); + esp_err_t perr = tas5805m_settings_save_channel_gain(TAS5805M_EQ_CHANNELS_RIGHT, gain); + if (perr != ESP_OK) { + ESP_LOGW(TAG, "%s: Failed to persist Channel Gain R: %s", __func__, esp_err_to_name(perr)); + } + } else { + ESP_LOGE(TAG, "%s: Failed to apply Channel Gain R: %s", __func__, esp_err_to_name(serr)); + } +#else + ESP_LOGW(TAG, "%s: EQ support disabled; ignoring channel_gain_r", __func__); +#endif + } + // Handle per-band EQ gain keys in deterministic order: left then right per band #if defined(CONFIG_DAC_TAS5805M_EQ_SUPPORT) for (int band = 0; band < TAS5805M_EQ_BANDS; ++band) { @@ -1356,6 +1466,46 @@ esp_err_t tas5805m_settings_get_schema_json(char *json_out, size_t max_len) { cJSON_AddItemToObject(dac_config_group, "parameters", dac_config_params); cJSON_AddItemToArray(groups, dac_config_group); + // ===== Channel Gain Group (always visible) ===== + { + cJSON *ch_group = cJSON_CreateObject(); + cJSON_AddStringToObject(ch_group, "name", "Mixer Gain"); + cJSON_AddStringToObject(ch_group, "description", "Mixer gain"); + + cJSON *ch_params = cJSON_CreateArray(); + + int8_t cur_ch_l = 0, cur_ch_r = 0; + if (tas5805m_get_channel_gain(TAS5805M_EQ_CHANNELS_LEFT, &cur_ch_l) != ESP_OK) cur_ch_l = 0; + if (tas5805m_get_channel_gain(TAS5805M_EQ_CHANNELS_RIGHT, &cur_ch_r) != ESP_OK) cur_ch_r = 0; + + cJSON *ch_l_param = cJSON_CreateObject(); + cJSON_AddStringToObject(ch_l_param, "key", TAS5805M_NVS_KEY_CHANNEL_GAIN_L); + cJSON_AddStringToObject(ch_l_param, "name", "Channel Gain (L)"); + cJSON_AddStringToObject(ch_l_param, "type", "range"); + cJSON_AddStringToObject(ch_l_param, "unit", "dB"); + cJSON_AddNumberToObject(ch_l_param, "min", TAS5805M_MIXER_VALUE_MINDB); + cJSON_AddNumberToObject(ch_l_param, "max", TAS5805M_MIXER_VALUE_MAXDB); + cJSON_AddNumberToObject(ch_l_param, "step", 1); + cJSON_AddNumberToObject(ch_l_param, "default", 0); + cJSON_AddNumberToObject(ch_l_param, "current", (int)cur_ch_l); + cJSON_AddItemToArray(ch_params, ch_l_param); + + cJSON *ch_r_param = cJSON_CreateObject(); + cJSON_AddStringToObject(ch_r_param, "key", TAS5805M_NVS_KEY_CHANNEL_GAIN_R); + cJSON_AddStringToObject(ch_r_param, "name", "Channel Gain (R)"); + cJSON_AddStringToObject(ch_r_param, "type", "range"); + cJSON_AddStringToObject(ch_r_param, "unit", "dB"); + cJSON_AddNumberToObject(ch_r_param, "min", TAS5805M_MIXER_VALUE_MINDB); + cJSON_AddNumberToObject(ch_r_param, "max", TAS5805M_MIXER_VALUE_MAXDB); + cJSON_AddNumberToObject(ch_r_param, "step", 1); + cJSON_AddNumberToObject(ch_r_param, "default", 0); + cJSON_AddNumberToObject(ch_r_param, "current", (int)cur_ch_r); + cJSON_AddItemToArray(ch_params, ch_r_param); + + cJSON_AddItemToObject(ch_group, "parameters", ch_params); + cJSON_AddItemToArray(groups, ch_group); + } + // ===== EQ Group ===== cJSON *eq_group = cJSON_CreateObject(); cJSON_AddStringToObject(eq_group, "name", "EQ"); @@ -1483,6 +1633,8 @@ esp_err_t tas5805m_settings_get_schema_json(char *json_out, size_t max_len) { cJSON_AddItemToObject(prof_r_param, "values", prof_r_values); cJSON_AddItemToArray(eq_params, prof_r_param); + + } #else // If EQ support disabled, provide readonly placeholders for presets @@ -1719,6 +1871,22 @@ esp_err_t tas5805m_settings_apply_all(void) { ESP_LOGI(TAG, "%s: Restored EQ profile R = %d", __func__, (int)prof); } } + /* Restore per-output channel gain values (if any) */ + int ch_gain = 0; + if (tas5805m_settings_load_channel_gain(TAS5805M_EQ_CHANNELS_LEFT, &ch_gain) == ESP_OK) { + if (tas5805m_set_channel_gain(TAS5805M_EQ_CHANNELS_LEFT, (int8_t)ch_gain) != ESP_OK) { + ESP_LOGW(TAG, "%s: Failed to apply saved Channel Gain L", __func__); + } else { + ESP_LOGI(TAG, "%s: Restored Channel Gain L = %d dB", __func__, ch_gain); + } + } + if (tas5805m_settings_load_channel_gain(TAS5805M_EQ_CHANNELS_RIGHT, &ch_gain) == ESP_OK) { + if (tas5805m_set_channel_gain(TAS5805M_EQ_CHANNELS_RIGHT, (int8_t)ch_gain) != ESP_OK) { + ESP_LOGW(TAG, "%s: Failed to apply saved Channel Gain R", __func__); + } else { + ESP_LOGI(TAG, "%s: Restored Channel Gain R = %d dB", __func__, ch_gain); + } + } } #endif From 3d7092f117dc2b9a6e9ef9b135caeee6562a18c7 Mon Sep 17 00:00:00 2001 From: Andriy Malyshenko Date: Sun, 30 Nov 2025 22:46:27 +0100 Subject: [PATCH 22/58] Apply tas5805m settings after DAc init passed (need I2S clock) --- .../tas5805m/include/tas5805m_reg_cfg.h | 4 ++ components/custom_board/tas5805m/tas5805m.c | 7 +++ .../tas5805m_settings/tas5805m_settings.c | 53 +++++++++++++++++++ main/main.c | 11 ++-- 4 files changed, 71 insertions(+), 4 deletions(-) diff --git a/components/custom_board/tas5805m/include/tas5805m_reg_cfg.h b/components/custom_board/tas5805m/include/tas5805m_reg_cfg.h index a64eff79..baba5080 100644 --- a/components/custom_board/tas5805m/include/tas5805m_reg_cfg.h +++ b/components/custom_board/tas5805m/include/tas5805m_reg_cfg.h @@ -98,6 +98,10 @@ extern "C" #define TAS5805M_MISC_CONTROL_REGISTER 0x76 #define TAS5805M_FAULT_CLEAR_REGISTER 0x78 +/* TAS5805M_REG_RESET_CTRL register values */ +#define TAS5805M_RESET_CONTROL_PORT BIT(0) +#define TAS5805M_RESET_DSP BIT(4) + // TAS5805M_REG_FAULT register values */ #define TAS5805M_ANALOG_FAULT_CLEAR 0x80 diff --git a/components/custom_board/tas5805m/tas5805m.c b/components/custom_board/tas5805m/tas5805m.c index fa96298c..57576134 100644 --- a/components/custom_board/tas5805m/tas5805m.c +++ b/components/custom_board/tas5805m/tas5805m.c @@ -194,6 +194,13 @@ esp_err_t tas5805m_init() { ESP_LOGW(TAG, "%s: Setting to HI Z", __func__); ESP_ERROR_CHECK(tas5805m_set_state(TAS5805M_CTRL_HI_Z)); + + // Send RESET register flag to reset all registers to default state + esp_err_t ret = tas5805m_write_byte(TAS5805M_RESET_CTRL_REGISTER, TAS5805M_RESET_CONTROL_PORT | TAS5805M_RESET_DSP); + if (ret != ESP_OK) { + ESP_LOGW(TAG, "%s: Failed to set RESET flag: %s", __func__, esp_err_to_name(ret)); + } + vTaskDelay(10 / portTICK_PERIOD_MS); if (ret != ESP_OK) { ESP_LOGW(TAG, "%s: Set DAC state failed", __func__); diff --git a/components/tas5805m_settings/tas5805m_settings.c b/components/tas5805m_settings/tas5805m_settings.c index 7f76c3ed..451306da 100644 --- a/components/tas5805m_settings/tas5805m_settings.c +++ b/components/tas5805m_settings/tas5805m_settings.c @@ -17,6 +17,47 @@ static const char *TAG = "tas5805m_settings"; // Mutex for thread-safe NVS access static SemaphoreHandle_t tas5805m_settings_mutex = NULL; +// Whether persisted settings have been restored already +static bool tas5805m_settings_restored = false; +// Whether the polling task has been started +static bool tas5805m_settings_poll_started = false; + +// Background polling task: waits for TAS5805M to enter PLAY state and then +// triggers a one-time settings application. Exits after a timeout. +static void tas5805m_poll_for_play_task(void *arg) +{ + (void)arg; + const TickType_t total_timeout = pdMS_TO_TICKS(10000); // 10s total + const TickType_t poll_interval = pdMS_TO_TICKS(200); + TickType_t start = xTaskGetTickCount(); + + ESP_LOGI(TAG, "%s: Polling for codec PLAY state (timeout %u ms)", __func__, (unsigned int)pdTICKS_TO_MS(total_timeout)); + + while ((xTaskGetTickCount() - start) < total_timeout) { + TAS5805_STATE st; + if (tas5805m_get_state(&st) == ESP_OK) { + if ((st.state & TAS5805M_CTRL_PLAY) == TAS5805M_CTRL_PLAY) { + ESP_LOGI(TAG, "%s: Codec entered PLAY — applying persisted settings", __func__); + // Call apply_all (it is safe to call from task context) + esp_err_t r = tas5805m_settings_apply_all(); + if (r == ESP_OK) { + tas5805m_settings_restored = true; + } else { + ESP_LOGW(TAG, "%s: tas5805m_settings_apply_all() returned %s", __func__, esp_err_to_name(r)); + } + break; + } + } + vTaskDelay(poll_interval); + } + + if (!tas5805m_settings_restored) { + ESP_LOGW(TAG, "%s: Timed out waiting for codec PLAY state — persisted settings not applied", __func__); + } + + tas5805m_settings_poll_started = false; + vTaskDelete(NULL); +} /** * Convert TAS5805M_CTRL_STATE enum to human-readable string @@ -127,6 +168,18 @@ esp_err_t tas5805m_settings_init(void) { } ESP_LOGI(TAG, "%s: TAS5805M settings manager initialized", __func__); + /* Start polling task to detect codec START/PLAY and apply persisted + settings once codec is actually running (I2S clocks present). This + avoids requiring the driver to call into settings directly. */ + if (!tas5805m_settings_restored && !tas5805m_settings_poll_started) { + BaseType_t tx = xTaskCreate(tas5805m_poll_for_play_task, "tas5805m_poll_play", 4096, NULL, tskIDLE_PRIORITY + 2, NULL); + if (tx == pdPASS) { + tas5805m_settings_poll_started = true; + ESP_LOGD(TAG, "%s: Started polling task for codec PLAY", __func__); + } else { + ESP_LOGW(TAG, "%s: Failed to start polling task; persisted settings may not be applied automatically", __func__); + } + } return ESP_OK; } diff --git a/main/main.c b/main/main.c index 9ded8fdc..e9781373 100644 --- a/main/main.c +++ b/main/main.c @@ -2713,10 +2713,6 @@ void app_main(void) { vTaskDelay(portMAX_DELAY); } - // Apply persisted TAS5805M settings now that the codec has been initialized - if (tas5805m_settings_apply_all() != ESP_OK) { - ESP_LOGW(TAG, "Failed to apply persisted TAS5805M settings at boot"); - } audio_hal_ctrl_codec(board_handle->audio_hal, AUDIO_HAL_CODEC_MODE_DECODE, AUDIO_HAL_CTRL_STOP); @@ -2766,6 +2762,13 @@ void app_main(void) { init_snapcast(audioQHdl); init_player(i2s_pin_config0, I2S_NUM_0); + #ifdef CONFIG_DAC_TAS5805M + // Apply persisted TAS5805M settings now that the codec has been initialized + if (tas5805m_settings_apply_all() != ESP_OK) { + ESP_LOGW(TAG, "Failed to apply persisted TAS5805M settings at boot"); + } + #endif + // ensure there is no noise from DAC { gpio_config_t gpioCfg = { From dc203ad1ad837db01cf442a1df8aa6c7461d51d2 Mon Sep 17 00:00:00 2001 From: Andriy Malyshenko Date: Wed, 3 Dec 2025 23:10:49 +0100 Subject: [PATCH 23/58] apply settings after I2S clock is present - fix --- components/custom_board/tas5805m/tas5805m.c | 6 +-- .../tas5805m_settings/tas5805m_settings.c | 45 +++++++++++++++---- main/main.c | 4 +- 3 files changed, 42 insertions(+), 13 deletions(-) diff --git a/components/custom_board/tas5805m/tas5805m.c b/components/custom_board/tas5805m/tas5805m.c index 57576134..4e531fe8 100644 --- a/components/custom_board/tas5805m/tas5805m.c +++ b/components/custom_board/tas5805m/tas5805m.c @@ -191,12 +191,12 @@ esp_err_t tas5805m_init() { gpio_set_level(TAS5805M_GPIO_PDN, 1); vTaskDelay(10 / portTICK_PERIOD_MS); - ESP_LOGW(TAG, "%s: Setting to HI Z", __func__); + ESP_LOGI(TAG, "%s: Setting to HI Z", __func__); ESP_ERROR_CHECK(tas5805m_set_state(TAS5805M_CTRL_HI_Z)); // Send RESET register flag to reset all registers to default state - esp_err_t ret = tas5805m_write_byte(TAS5805M_RESET_CTRL_REGISTER, TAS5805M_RESET_CONTROL_PORT | TAS5805M_RESET_DSP); + ret = tas5805m_write_byte(TAS5805M_RESET_CTRL_REGISTER, TAS5805M_RESET_CONTROL_PORT | TAS5805M_RESET_DSP); if (ret != ESP_OK) { ESP_LOGW(TAG, "%s: Failed to set RESET flag: %s", __func__, esp_err_to_name(ret)); } @@ -207,7 +207,7 @@ esp_err_t tas5805m_init() { return ret; } - ESP_LOGW(TAG, "%s: Setting to PLAY (muted)", __func__); + ESP_LOGI(TAG, "%s: Setting to PLAY (muted)", __func__); ESP_ERROR_CHECK(tas5805m_set_state(TAS5805M_CTRL_MUTE | TAS5805M_CTRL_PLAY)); if (ret != ESP_OK) { diff --git a/components/tas5805m_settings/tas5805m_settings.c b/components/tas5805m_settings/tas5805m_settings.c index 451306da..31ae335f 100644 --- a/components/tas5805m_settings/tas5805m_settings.c +++ b/components/tas5805m_settings/tas5805m_settings.c @@ -27,13 +27,11 @@ static bool tas5805m_settings_poll_started = false; static void tas5805m_poll_for_play_task(void *arg) { (void)arg; - const TickType_t total_timeout = pdMS_TO_TICKS(10000); // 10s total const TickType_t poll_interval = pdMS_TO_TICKS(200); - TickType_t start = xTaskGetTickCount(); - ESP_LOGI(TAG, "%s: Polling for codec PLAY state (timeout %u ms)", __func__, (unsigned int)pdTICKS_TO_MS(total_timeout)); + ESP_LOGI(TAG, "%s: Polling for codec PLAY state (no timeout)", __func__); - while ((xTaskGetTickCount() - start) < total_timeout) { + for (;;) { TAS5805_STATE st; if (tas5805m_get_state(&st) == ESP_OK) { if ((st.state & TAS5805M_CTRL_PLAY) == TAS5805M_CTRL_PLAY) { @@ -51,10 +49,6 @@ static void tas5805m_poll_for_play_task(void *arg) vTaskDelay(poll_interval); } - if (!tas5805m_settings_restored) { - ESP_LOGW(TAG, "%s: Timed out waiting for codec PLAY state — persisted settings not applied", __func__); - } - tas5805m_settings_poll_started = false; vTaskDelete(NULL); } @@ -168,6 +162,41 @@ esp_err_t tas5805m_settings_init(void) { } ESP_LOGI(TAG, "%s: TAS5805M settings manager initialized", __func__); + /* Apply settings that are safe to write immediately (don't require the + full DAC I2S clocks to be running). These values may be applied by + hardware/driver even if the DAC isn't fully started and therefore + should be attempted here so UI changes take effect quickly. */ + { + int ana_gain = 0; + if (tas5805m_settings_load_analog_gain(&ana_gain) == ESP_OK) { + uint8_t gain = (uint8_t)ana_gain; + if (tas5805m_set_again(gain) == ESP_OK) { + ESP_LOGI(TAG, "%s: Applied persisted analog gain=%d", __func__, gain); + } else { + ESP_LOGW(TAG, "%s: Failed to apply persisted analog gain=%d", __func__, gain); + } + } + + TAS5805M_DAC_MODE dm; + if (tas5805m_settings_load_dac_mode(&dm) == ESP_OK) { + if (tas5805m_set_dac_mode(dm) == ESP_OK) { + ESP_LOGI(TAG, "%s: Applied persisted DAC mode=%d", __func__, (int)dm); + } else { + ESP_LOGW(TAG, "%s: Failed to apply persisted DAC mode=%d", __func__, (int)dm); + } + } + + TAS5805M_MOD_MODE mm; + TAS5805M_SW_FREQ sf; + TAS5805M_BD_FREQ bf; + if (tas5805m_settings_load_modulation_mode(&mm, &sf, &bf) == ESP_OK) { + if (tas5805m_set_modulation_mode(mm, sf, bf) == ESP_OK) { + ESP_LOGI(TAG, "%s: Applied persisted modulation mode=%d sw=%d bd=%d", __func__, (int)mm, (int)sf, (int)bf); + } else { + ESP_LOGW(TAG, "%s: Failed to apply persisted modulation mode=%d sw=%d bd=%d", __func__, (int)mm, (int)sf, (int)bf); + } + } + } /* Start polling task to detect codec START/PLAY and apply persisted settings once codec is actually running (I2S clocks present). This avoids requiring the driver to call into settings directly. */ diff --git a/main/main.c b/main/main.c index e9781373..ff0c3e39 100644 --- a/main/main.c +++ b/main/main.c @@ -2764,8 +2764,8 @@ void app_main(void) { #ifdef CONFIG_DAC_TAS5805M // Apply persisted TAS5805M settings now that the codec has been initialized - if (tas5805m_settings_apply_all() != ESP_OK) { - ESP_LOGW(TAG, "Failed to apply persisted TAS5805M settings at boot"); + if (tas5805m_settings_init() != ESP_OK) { + ESP_LOGW(TAG, "Failed to init persisted TAS5805M settings"); } #endif From 3cc92ec5738afc99c6760d982ebe9e04a06926bf Mon Sep 17 00:00:00 2001 From: Andriy Malyshenko Date: Thu, 4 Dec 2025 22:14:11 +0100 Subject: [PATCH 24/58] dsiable eq controls, when eq support is disabled --- .../tas5805m_settings/tas5805m_settings.c | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/components/tas5805m_settings/tas5805m_settings.c b/components/tas5805m_settings/tas5805m_settings.c index 31ae335f..0d988d76 100644 --- a/components/tas5805m_settings/tas5805m_settings.c +++ b/components/tas5805m_settings/tas5805m_settings.c @@ -13,6 +13,18 @@ #include "freertos/semphr.h" #include "cJSON.h" +/* When EQ support is disabled at build time the driver headers may not + * declare EQ-related constants such as TAS5805M_EQ_BANDS. The settings + * module intentionally keeps persistence and UI helpers compiled even + * when driver EQ support is disabled; provide a safe fallback value so + * those helpers still build without pulling in the driver headers. + */ +#if !defined(CONFIG_DAC_TAS5805M_EQ_SUPPORT) +#ifndef TAS5805M_EQ_BANDS +#define TAS5805M_EQ_BANDS 0 +#endif +#endif + static const char *TAG = "tas5805m_settings"; // Mutex for thread-safe NVS access @@ -1622,7 +1634,7 @@ esp_err_t tas5805m_settings_get_schema_json(char *json_out, size_t max_len) { cJSON_AddNumberToObject(v_off, "value", (int)TAS5805M_EQ_UI_MODE_OFF); cJSON_AddStringToObject(v_off, "name", "OFF"); cJSON_AddItemToArray(eq_ui_values, v_off); - +#if defined(CONFIG_DAC_TAS5805M_EQ_SUPPORT) cJSON *v_15 = cJSON_CreateObject(); cJSON_AddNumberToObject(v_15, "value", (int)TAS5805M_EQ_UI_MODE_15_BAND); cJSON_AddStringToObject(v_15, "name", "15-band"); @@ -1637,6 +1649,12 @@ esp_err_t tas5805m_settings_get_schema_json(char *json_out, size_t max_len) { cJSON_AddNumberToObject(v_preset, "value", (int)TAS5805M_EQ_UI_MODE_PRESETS); cJSON_AddStringToObject(v_preset, "name", "EQ Presets"); cJSON_AddItemToArray(eq_ui_values, v_preset); +#else + /* When EQ support is disabled expose only OFF and mark the control readonly + * so the UI shows the section but doesn't allow changing it. + */ + cJSON_AddBoolToObject(eq_ui_param, "readonly", true); +#endif cJSON_AddItemToObject(eq_ui_param, "values", eq_ui_values); cJSON_AddItemToArray(eq_params, eq_ui_param); From eb06b6b2e2b8826c467f2c9a66fbbd4feef2c157 Mon Sep 17 00:00:00 2001 From: Andriy Malyshenko Date: Fri, 5 Dec 2025 19:17:18 +0100 Subject: [PATCH 25/58] Bugs with eq restore and build error fixes --- .../include/tas5805m_settings.h | 14 +- .../tas5805m_settings/tas5805m_settings.c | 213 +++++++++++------- main/CMakeLists.txt | 2 +- main/main.c | 6 +- 4 files changed, 146 insertions(+), 89 deletions(-) diff --git a/components/tas5805m_settings/include/tas5805m_settings.h b/components/tas5805m_settings/include/tas5805m_settings.h index 0a5fbac3..f342038c 100644 --- a/components/tas5805m_settings/include/tas5805m_settings.h +++ b/components/tas5805m_settings/include/tas5805m_settings.h @@ -18,6 +18,8 @@ extern "C" { #include #include +#if CONFIG_DAC_TAS5805M + #include "tas5805m_types.h" #include "tas5805m.h" @@ -132,7 +134,17 @@ esp_err_t tas5805m_settings_set_from_json(const char *json_in); esp_err_t tas5805m_settings_get_schema_json(char *json_out, size_t max_len); /** Apply all persisted TAS5805M settings from NVS to the hardware. */ -esp_err_t tas5805m_settings_apply_all(void); +/** Apply settings that are safe to write immediately (before audio playback). + * Examples: DAC mode, analog gain, modulation mode, mixer mode. + */ +esp_err_t tas5805m_settings_apply_early(void); + +/** Apply settings that require the codec to be running (delayed restore), + * e.g. EQ mode, per-band gains, EQ profiles and channel gains. + */ +esp_err_t tas5805m_settings_apply_delayed(void); + +#endif /* CONFIG_DAC_TAS5805M */ #ifdef __cplusplus } diff --git a/components/tas5805m_settings/tas5805m_settings.c b/components/tas5805m_settings/tas5805m_settings.c index 0d988d76..3846fffe 100644 --- a/components/tas5805m_settings/tas5805m_settings.c +++ b/components/tas5805m_settings/tas5805m_settings.c @@ -5,6 +5,8 @@ #include "tas5805m_settings.h" +#if CONFIG_DAC_TAS5805M + #include #include "esp_log.h" #include "nvs_flash.h" @@ -47,13 +49,13 @@ static void tas5805m_poll_for_play_task(void *arg) TAS5805_STATE st; if (tas5805m_get_state(&st) == ESP_OK) { if ((st.state & TAS5805M_CTRL_PLAY) == TAS5805M_CTRL_PLAY) { - ESP_LOGI(TAG, "%s: Codec entered PLAY — applying persisted settings", __func__); - // Call apply_all (it is safe to call from task context) - esp_err_t r = tas5805m_settings_apply_all(); + ESP_LOGI(TAG, "%s: Codec entered PLAY — applying delayed persisted settings", __func__); + // Call delayed apply (requires codec to be running) + esp_err_t r = tas5805m_settings_apply_delayed(); if (r == ESP_OK) { tas5805m_settings_restored = true; } else { - ESP_LOGW(TAG, "%s: tas5805m_settings_apply_all() returned %s", __func__, esp_err_to_name(r)); + ESP_LOGW(TAG, "%s: tas5805m_settings_apply_delayed() returned %s", __func__, esp_err_to_name(r)); } break; } @@ -174,40 +176,11 @@ esp_err_t tas5805m_settings_init(void) { } ESP_LOGI(TAG, "%s: TAS5805M settings manager initialized", __func__); - /* Apply settings that are safe to write immediately (don't require the - full DAC I2S clocks to be running). These values may be applied by - hardware/driver even if the DAC isn't fully started and therefore - should be attempted here so UI changes take effect quickly. */ - { - int ana_gain = 0; - if (tas5805m_settings_load_analog_gain(&ana_gain) == ESP_OK) { - uint8_t gain = (uint8_t)ana_gain; - if (tas5805m_set_again(gain) == ESP_OK) { - ESP_LOGI(TAG, "%s: Applied persisted analog gain=%d", __func__, gain); - } else { - ESP_LOGW(TAG, "%s: Failed to apply persisted analog gain=%d", __func__, gain); - } - } - - TAS5805M_DAC_MODE dm; - if (tas5805m_settings_load_dac_mode(&dm) == ESP_OK) { - if (tas5805m_set_dac_mode(dm) == ESP_OK) { - ESP_LOGI(TAG, "%s: Applied persisted DAC mode=%d", __func__, (int)dm); - } else { - ESP_LOGW(TAG, "%s: Failed to apply persisted DAC mode=%d", __func__, (int)dm); - } - } - - TAS5805M_MOD_MODE mm; - TAS5805M_SW_FREQ sf; - TAS5805M_BD_FREQ bf; - if (tas5805m_settings_load_modulation_mode(&mm, &sf, &bf) == ESP_OK) { - if (tas5805m_set_modulation_mode(mm, sf, bf) == ESP_OK) { - ESP_LOGI(TAG, "%s: Applied persisted modulation mode=%d sw=%d bd=%d", __func__, (int)mm, (int)sf, (int)bf); - } else { - ESP_LOGW(TAG, "%s: Failed to apply persisted modulation mode=%d sw=%d bd=%d", __func__, (int)mm, (int)sf, (int)bf); - } - } + /* Apply early settings that are safe to write before the codec starts + (DAC mode, analog gain, modulation mode, mixer mode). Use the + dedicated helper so callers and init share the same behavior. */ + if (tas5805m_settings_apply_early() != ESP_OK) { + ESP_LOGD(TAG, "%s: Early settings apply reported errors (continuing)", __func__); } /* Start polling task to detect codec START/PLAY and apply persisted settings once codec is actually running (I2S clocks present). This @@ -844,21 +817,51 @@ esp_err_t tas5805m_settings_get_json(char *json_out, size_t max_len) { #if defined(CONFIG_DAC_TAS5805M_EQ_SUPPORT) { TAS5805M_EQ_PROFILE prof_l = FLAT, prof_r = FLAT; - if (tas5805m_get_eq_profile_channel(TAS5805M_EQ_CHANNELS_LEFT, &prof_l) == ESP_OK) { - cJSON_AddNumberToObject(root, "eq_profile_l", (int)prof_l); - } - if (tas5805m_get_eq_profile_channel(TAS5805M_EQ_CHANNELS_RIGHT, &prof_r) == ESP_OK) { - cJSON_AddNumberToObject(root, "eq_profile_r", (int)prof_r); - } + if (tas5805m_settings_restored) { + if (tas5805m_get_eq_profile_channel(TAS5805M_EQ_CHANNELS_LEFT, &prof_l) == ESP_OK) { + cJSON_AddNumberToObject(root, "eq_profile_l", (int)prof_l); + } else { + if (tas5805m_settings_load_eq_profile(TAS5805M_EQ_CHANNELS_LEFT, &prof_l) == ESP_OK) { + cJSON_AddNumberToObject(root, "eq_profile_l", (int)prof_l); + } + } - /* Channel gain (left/right) for presets UI */ - int ch_gain = 0; - int8_t chg = 0; - if (tas5805m_get_channel_gain(TAS5805M_EQ_CHANNELS_LEFT, &chg) == ESP_OK) { - cJSON_AddNumberToObject(root, "channel_gain_l", (int)chg); - } - if (tas5805m_get_channel_gain(TAS5805M_EQ_CHANNELS_RIGHT, &chg) == ESP_OK) { - cJSON_AddNumberToObject(root, "channel_gain_r", (int)chg); + if (tas5805m_get_eq_profile_channel(TAS5805M_EQ_CHANNELS_RIGHT, &prof_r) == ESP_OK) { + cJSON_AddNumberToObject(root, "eq_profile_r", (int)prof_r); + } else { + if (tas5805m_settings_load_eq_profile(TAS5805M_EQ_CHANNELS_RIGHT, &prof_r) == ESP_OK) { + cJSON_AddNumberToObject(root, "eq_profile_r", (int)prof_r); + } + } + + /* Channel gain (left/right) for presets UI */ + int ch_gain = 0; + int8_t chg = 0; + if (tas5805m_get_channel_gain(TAS5805M_EQ_CHANNELS_LEFT, &chg) == ESP_OK) { + cJSON_AddNumberToObject(root, "channel_gain_l", (int)chg); + } else if (tas5805m_settings_load_channel_gain(TAS5805M_EQ_CHANNELS_LEFT, &ch_gain) == ESP_OK) { + cJSON_AddNumberToObject(root, "channel_gain_l", (int)ch_gain); + } + if (tas5805m_get_channel_gain(TAS5805M_EQ_CHANNELS_RIGHT, &chg) == ESP_OK) { + cJSON_AddNumberToObject(root, "channel_gain_r", (int)chg); + } else if (tas5805m_settings_load_channel_gain(TAS5805M_EQ_CHANNELS_RIGHT, &ch_gain) == ESP_OK) { + cJSON_AddNumberToObject(root, "channel_gain_r", (int)ch_gain); + } + } else { + /* Not restored yet — use persisted values from NVS so UI reflects saved settings */ + if (tas5805m_settings_load_eq_profile(TAS5805M_EQ_CHANNELS_LEFT, &prof_l) == ESP_OK) { + cJSON_AddNumberToObject(root, "eq_profile_l", (int)prof_l); + } + if (tas5805m_settings_load_eq_profile(TAS5805M_EQ_CHANNELS_RIGHT, &prof_r) == ESP_OK) { + cJSON_AddNumberToObject(root, "eq_profile_r", (int)prof_r); + } + int ch_gain = 0; + if (tas5805m_settings_load_channel_gain(TAS5805M_EQ_CHANNELS_LEFT, &ch_gain) == ESP_OK) { + cJSON_AddNumberToObject(root, "channel_gain_l", (int)ch_gain); + } + if (tas5805m_settings_load_channel_gain(TAS5805M_EQ_CHANNELS_RIGHT, &ch_gain) == ESP_OK) { + cJSON_AddNumberToObject(root, "channel_gain_r", (int)ch_gain); + } } } #endif @@ -866,19 +869,42 @@ esp_err_t tas5805m_settings_get_json(char *json_out, size_t max_len) { cJSON_AddNumberToObject(root, "mixer_mode", (int)dac_state.mixer_mode); cJSON_AddStringToObject(root, "mixer_mode_name", tas5805m_mixer_mode_to_string(dac_state.mixer_mode)); - /* Per-band EQ gains (left/right) so UI can display current values without refresh */ + /* Per-band EQ gains (left/right) so UI can display current values without refresh. + * Prefer reading current driver state; if driver isn't ready or returns an error + * fall back to persisted values from NVS so the UI reflects saved settings. + */ #if defined(CONFIG_DAC_TAS5805M_EQ_SUPPORT) for (int band = 0; band < TAS5805M_EQ_BANDS; ++band) { int gain = 0; - if (tas5805m_get_eq_gain_channel(TAS5805M_EQ_CHANNELS_LEFT, band, &gain) == ESP_OK) { - char key_l[32]; - snprintf(key_l, sizeof(key_l), "%s%d", TAS5805M_NVS_KEY_EQ_GAIN_L_PREFIX, band); - cJSON_AddNumberToObject(root, key_l, gain); - } - if (tas5805m_get_eq_gain_channel(TAS5805M_EQ_CHANNELS_RIGHT, band, &gain) == ESP_OK) { - char key_r[32]; - snprintf(key_r, sizeof(key_r), "%s%d", TAS5805M_NVS_KEY_EQ_GAIN_R_PREFIX, band); - cJSON_AddNumberToObject(root, key_r, gain); + char key_l[32]; + char key_r[32]; + snprintf(key_l, sizeof(key_l), "%s%d", TAS5805M_NVS_KEY_EQ_GAIN_L_PREFIX, band); + snprintf(key_r, sizeof(key_r), "%s%d", TAS5805M_NVS_KEY_EQ_GAIN_R_PREFIX, band); + + if (tas5805m_settings_restored) { + // Left channel: prefer driver value, otherwise load persisted NVS value + if (tas5805m_get_eq_gain_channel(TAS5805M_EQ_CHANNELS_LEFT, band, &gain) == ESP_OK) { + cJSON_AddNumberToObject(root, key_l, gain); + } else if (tas5805m_settings_load_eq_gain(TAS5805M_EQ_CHANNELS_LEFT, band, &gain) == ESP_OK) { + cJSON_AddNumberToObject(root, key_l, gain); + } + + // Right channel: prefer driver value, otherwise load persisted NVS value + gain = 0; + if (tas5805m_get_eq_gain_channel(TAS5805M_EQ_CHANNELS_RIGHT, band, &gain) == ESP_OK) { + cJSON_AddNumberToObject(root, key_r, gain); + } else if (tas5805m_settings_load_eq_gain(TAS5805M_EQ_CHANNELS_RIGHT, band, &gain) == ESP_OK) { + cJSON_AddNumberToObject(root, key_r, gain); + } + } else { + /* Not yet restored; use persisted values only */ + if (tas5805m_settings_load_eq_gain(TAS5805M_EQ_CHANNELS_LEFT, band, &gain) == ESP_OK) { + cJSON_AddNumberToObject(root, key_l, gain); + } + gain = 0; + if (tas5805m_settings_load_eq_gain(TAS5805M_EQ_CHANNELS_RIGHT, band, &gain) == ESP_OK) { + cJSON_AddNumberToObject(root, key_r, gain); + } } } #endif @@ -905,12 +931,12 @@ esp_err_t tas5805m_settings_get_json(char *json_out, size_t max_len) { json_out[max_len - 1] = '\0'; cJSON_free(json_str); - ESP_LOGD(TAG, "%s: JSON generated: %s", __func__, json_out); + ESP_LOGV(TAG, "%s: JSON generated: %s", __func__, json_out); return ESP_OK; } esp_err_t tas5805m_settings_set_from_json(const char *json_in) { - ESP_LOGD(TAG, "%s: json=%s", __func__, json_in); + ESP_LOGV(TAG, "%s: json=%s", __func__, json_in); if (!json_in) return ESP_ERR_INVALID_ARG; @@ -1087,6 +1113,13 @@ esp_err_t tas5805m_settings_set_from_json(const char *json_in) { esp_err_t serr = tas5805m_set_eq_mode(drv); if (serr == ESP_OK) { ESP_LOGI(TAG, "%s: Applied driver EQ mode %d for UI selection %d", __func__, (int)drv, (int)ui); + /* Persist the mapped driver EQ mode as well so both UI and driver + * mode remain consistent across reboots. + */ + esp_err_t perr = tas5805m_settings_save_eq_mode(drv); + if (perr != ESP_OK) { + ESP_LOGW(TAG, "%s: Failed to persist driver EQ mode: %s", __func__, esp_err_to_name(perr)); + } } else { ESP_LOGE(TAG, "%s: Failed to set driver EQ mode: %s", __func__, esp_err_to_name(serr)); } @@ -1763,11 +1796,16 @@ esp_err_t tas5805m_settings_get_schema_json(char *json_out, size_t max_len) { #if defined(CONFIG_DAC_TAS5805M_EQ_SUPPORT) for (int band = 0; band < TAS5805M_EQ_BANDS; ++band) { int cur_l = 0, cur_r = 0; + // Try to read current value from driver; if unavailable, fall back to persisted NVS value if (tas5805m_get_eq_gain_channel(TAS5805M_EQ_CHANNELS_LEFT, band, &cur_l) != ESP_OK) { - cur_l = 0; + if (tas5805m_settings_load_eq_gain(TAS5805M_EQ_CHANNELS_LEFT, band, &cur_l) != ESP_OK) { + cur_l = 0; + } } if (tas5805m_get_eq_gain_channel(TAS5805M_EQ_CHANNELS_RIGHT, band, &cur_r) != ESP_OK) { - cur_r = 0; + if (tas5805m_settings_load_eq_gain(TAS5805M_EQ_CHANNELS_RIGHT, band, &cur_r) != ESP_OK) { + cur_r = 0; + } } char key_l[32]; @@ -1842,19 +1880,13 @@ esp_err_t tas5805m_settings_get_schema_json(char *json_out, size_t max_len) { return ESP_OK; } -esp_err_t tas5805m_settings_apply_all(void) { - ESP_LOGI(TAG, "%s: Applying persisted TAS5805M settings from NVS", __func__); - - // Ensure settings manager is initialized - esp_err_t err = tas5805m_settings_init(); - if (err != ESP_OK) { - ESP_LOGW(TAG, "%s: settings init failed: %s", __func__, esp_err_to_name(err)); - // continue; we'll still try to load values - } - - // NOTE: DAC state and digital volume are intentionally NOT restored here - // because they are considered application-managed/read-only and should not - // be persisted/restored automatically at boot. +/* Apply early settings that are safe to write before audio playback starts. + * This includes: analog gain, DAC mode, modulation mode, mixer mode. + */ +esp_err_t tas5805m_settings_apply_early(void) { + ESP_LOGI(TAG, "%s: Applying early TAS5805M settings from NVS", __func__); + // NOTE: don't call tas5805m_settings_init() here to avoid recursion; caller + // should ensure init() has been called. // Apply analog gain (raw register index) int ana_gain = 0; @@ -1885,7 +1917,17 @@ esp_err_t tas5805m_settings_apply_all(void) { ESP_LOGW(TAG, "%s: Failed to apply saved modulation mode", __func__); } } + + ESP_LOGI(TAG, "%s: Early persisted settings application complete", __func__); + return ESP_OK; +} +/* Apply settings that require the codec to be running (delayed restore). +* This restores EQ mode, per-band gains, profiles and channel gains. +*/ +esp_err_t tas5805m_settings_apply_delayed(void) { + ESP_LOGI(TAG, "%s: Applying delayed TAS5805M settings from NVS", __func__); + // Apply mixer mode TAS5805M_MIXER_MODE mixer_mode; if (tas5805m_settings_load_mixer_mode(&mixer_mode) == ESP_OK) { @@ -1895,17 +1937,16 @@ esp_err_t tas5805m_settings_apply_all(void) { } } - // Apply EQ mode (if persisted) - TAS5805M_EQ_MODE eq_mode; + TAS5805M_EQ_MODE eq_mode = TAS5805M_EQ_MODE_OFF; if (tas5805m_settings_load_eq_mode(&eq_mode) == ESP_OK) { ESP_LOGI(TAG, "%s: Restoring EQ mode=%d", __func__, (int)eq_mode); -#if defined(CONFIG_DAC_TAS5805M_EQ_SUPPORT) + #if defined(CONFIG_DAC_TAS5805M_EQ_SUPPORT) if (tas5805m_set_eq_mode(eq_mode) != ESP_OK) { ESP_LOGW(TAG, "%s: Failed to apply saved EQ mode", __func__); } -#else + #else ESP_LOGW(TAG, "%s: EQ support disabled in build; ignoring persisted EQ mode", __func__); -#endif + #endif } #if defined(CONFIG_DAC_TAS5805M_EQ_SUPPORT) @@ -1990,6 +2031,8 @@ esp_err_t tas5805m_settings_apply_all(void) { } #endif - ESP_LOGI(TAG, "%s: Persisted settings application complete", __func__); + ESP_LOGI(TAG, "%s: Delayed persisted settings application complete", __func__); return ESP_OK; } + +#endif /* CONFIG_DAC_TAS5805M */ diff --git a/main/CMakeLists.txt b/main/CMakeLists.txt index 72a1e7f1..864c1c2c 100644 --- a/main/CMakeLists.txt +++ b/main/CMakeLists.txt @@ -2,7 +2,7 @@ idf_component_register(SRCS "main.c" INCLUDE_DIRS "." PRIV_REQUIRES esp_timer esp_wifi nvs_flash audio_board audio_hal audio_sal net_functions opus flac ota_server - ui_http_server network_interface custom_board settings_manager + ui_http_server network_interface custom_board settings_manager tas5805m_settings ) set_source_files_properties(main.c PROPERTIES COMPILE_FLAGS -Wno-implicit-fallthrough) diff --git a/main/main.c b/main/main.c index ff0c3e39..2c100c0b 100644 --- a/main/main.c +++ b/main/main.c @@ -58,7 +58,9 @@ #include "snapcast.h" #include "ui_http_server.h" #include "settings_manager.h" +#if CONFIG_DAC_TAS5805M #include "tas5805m_settings.h" +#endif static bool isCachedChunk = false; static uint32_t cachedBlocks = 0; @@ -2626,7 +2628,7 @@ void app_main(void) { esp_log_level_set("httpd_uri", ESP_LOG_WARN); esp_log_level_set("UI_HTTP", ESP_LOG_WARN); esp_log_level_set("TAS5805M", ESP_LOG_DEBUG); - esp_log_level_set("tas5805m_settings", ESP_LOG_INFO); + esp_log_level_set("tas5805m_settings", ESP_LOG_DEBUG); #if CONFIG_SNAPCLIENT_USE_INTERNAL_ETHERNET || \ CONFIG_SNAPCLIENT_USE_SPI_ETHERNET @@ -2762,7 +2764,7 @@ void app_main(void) { init_snapcast(audioQHdl); init_player(i2s_pin_config0, I2S_NUM_0); - #ifdef CONFIG_DAC_TAS5805M + #if CONFIG_DAC_TAS5805M // Apply persisted TAS5805M settings now that the codec has been initialized if (tas5805m_settings_init() != ESP_OK) { ESP_LOGW(TAG, "Failed to init persisted TAS5805M settings"); From 131d2f236e6745bb73b653c55f3c4abe32f0a17d Mon Sep 17 00:00:00 2001 From: Andriy Malyshenko Date: Fri, 5 Dec 2025 22:32:29 +0100 Subject: [PATCH 26/58] Eq vertical slider layout --- .../tas5805m_settings/tas5805m_settings.c | 43 ++++-- .../ui_http_server/html/dac-settings.html | 137 ++++++++++++++++++ main/main.c | 2 +- 3 files changed, 171 insertions(+), 11 deletions(-) diff --git a/components/tas5805m_settings/tas5805m_settings.c b/components/tas5805m_settings/tas5805m_settings.c index 3846fffe..46b05197 100644 --- a/components/tas5805m_settings/tas5805m_settings.c +++ b/components/tas5805m_settings/tas5805m_settings.c @@ -1637,6 +1637,7 @@ esp_err_t tas5805m_settings_get_schema_json(char *json_out, size_t max_len) { cJSON *eq_group = cJSON_CreateObject(); cJSON_AddStringToObject(eq_group, "name", "EQ"); cJSON_AddStringToObject(eq_group, "description", "Equalizer mode"); + cJSON_AddStringToObject(eq_group, "layout", "eq-controls"); cJSON *eq_params = cJSON_CreateArray(); @@ -1792,8 +1793,23 @@ esp_err_t tas5805m_settings_get_schema_json(char *json_out, size_t max_len) { cJSON_AddItemToArray(eq_params, prof_r_param); #endif cJSON_AddItemToObject(eq_group, "parameters", eq_params); + cJSON_AddItemToArray(groups, eq_group); + /* Add per-band sliders for left and right channels (if EQ supported) */ #if defined(CONFIG_DAC_TAS5805M_EQ_SUPPORT) + // Create sub-groups for left and right channel EQ bands + cJSON *eq_bands_left = cJSON_CreateObject(); + cJSON_AddStringToObject(eq_bands_left, "name", "Left channel"); + cJSON_AddStringToObject(eq_bands_left, "layout", "eq-bands"); + cJSON_AddStringToObject(eq_bands_left, "channel", "left"); + cJSON *eq_bands_left_params = cJSON_CreateArray(); + + cJSON *eq_bands_right = cJSON_CreateObject(); + cJSON_AddStringToObject(eq_bands_right, "name", "Right Channel"); + cJSON_AddStringToObject(eq_bands_right, "layout", "eq-bands"); + cJSON_AddStringToObject(eq_bands_right, "channel", "right"); + cJSON *eq_bands_right_params = cJSON_CreateArray(); + for (int band = 0; band < TAS5805M_EQ_BANDS; ++band) { int cur_l = 0, cur_r = 0; // Try to read current value from driver; if unavailable, fall back to persisted NVS value @@ -1819,37 +1835,44 @@ esp_err_t tas5805m_settings_get_schema_json(char *json_out, size_t max_len) { cJSON *param_l = cJSON_CreateObject(); cJSON_AddStringToObject(param_l, "key", key_l); - // Name uses frequency and channel: " (L)" - char name_l[48]; - snprintf(name_l, sizeof(name_l), "%s (L)", freq_label); - cJSON_AddStringToObject(param_l, "name", name_l); + cJSON_AddStringToObject(param_l, "name", freq_label); cJSON_AddStringToObject(param_l, "type", "range"); cJSON_AddStringToObject(param_l, "unit", "dB"); cJSON_AddStringToObject(param_l, "label", freq_label); + cJSON_AddStringToObject(param_l, "layout", "vertical"); + cJSON_AddStringToObject(param_l, "channel", "L"); + cJSON_AddNumberToObject(param_l, "band", band); cJSON_AddNumberToObject(param_l, "min", TAS5805M_EQ_MIN_DB); cJSON_AddNumberToObject(param_l, "max", TAS5805M_EQ_MAX_DB); cJSON_AddNumberToObject(param_l, "step", 1); cJSON_AddNumberToObject(param_l, "default", 0); cJSON_AddNumberToObject(param_l, "current", cur_l); - cJSON_AddItemToArray(eq_params, param_l); + cJSON_AddItemToArray(eq_bands_left_params, param_l); cJSON *param_r = cJSON_CreateObject(); cJSON_AddStringToObject(param_r, "key", key_r); - char name_r[48]; - snprintf(name_r, sizeof(name_r), "%s (R)", freq_label); - cJSON_AddStringToObject(param_r, "name", name_r); + cJSON_AddStringToObject(param_r, "name", freq_label); cJSON_AddStringToObject(param_r, "type", "range"); cJSON_AddStringToObject(param_r, "unit", "dB"); cJSON_AddStringToObject(param_r, "label", freq_label); + cJSON_AddStringToObject(param_r, "layout", "vertical"); + cJSON_AddStringToObject(param_r, "channel", "R"); + cJSON_AddNumberToObject(param_r, "band", band); cJSON_AddNumberToObject(param_r, "min", TAS5805M_EQ_MIN_DB); cJSON_AddNumberToObject(param_r, "max", TAS5805M_EQ_MAX_DB); cJSON_AddNumberToObject(param_r, "step", 1); cJSON_AddNumberToObject(param_r, "default", 0); cJSON_AddNumberToObject(param_r, "current", cur_r); - cJSON_AddItemToArray(eq_params, param_r); + cJSON_AddItemToArray(eq_bands_right_params, param_r); } + + cJSON_AddItemToObject(eq_bands_left, "parameters", eq_bands_left_params); + cJSON_AddItemToObject(eq_bands_right, "parameters", eq_bands_right_params); + + // Add EQ band sub-groups to main groups array (after EQ group) + cJSON_AddItemToArray(groups, eq_bands_left); + cJSON_AddItemToArray(groups, eq_bands_right); #endif - cJSON_AddItemToArray(groups, eq_group); // End groups cJSON_AddItemToObject(root, "groups", groups); diff --git a/components/ui_http_server/html/dac-settings.html b/components/ui_http_server/html/dac-settings.html index 1a154812..312bbae4 100644 --- a/components/ui_http_server/html/dac-settings.html +++ b/components/ui_http_server/html/dac-settings.html @@ -255,6 +255,82 @@ transform: scale(0.8); } } + + /* EQ Bands Layout - Vertical Sliders */ + .eq-bands-container { + display: flex; + flex-direction: row; + gap: 8px; + padding: 20px; + background-color: white; + border-radius: 8px; + box-shadow: 0 2px 4px rgba(0,0,0,0.1); + overflow-x: auto; + margin-bottom: 20px; + } + + .eq-band-slider { + display: flex; + flex-direction: column; + align-items: center; + min-width: 43px; + gap: 8px; + } + + .eq-band-slider .slider-label { + font-size: 11px; + color: #666; + font-weight: 500; + text-align: center; + white-space: nowrap; + writing-mode: horizontal-tb; + } + + .eq-band-slider .slider-value { + font-size: 13px; + color: #007bff; + font-weight: bold; + min-height: 20px; + text-align: center; + } + + .eq-band-slider input[type="range"] { + -webkit-appearance: slider-vertical; + writing-mode: bt-lr; + width: 8px; + height: 200px; + background: #ddd; + border-radius: 4px; + outline: none; + margin: 10px 0; + } + + .eq-band-slider input[type="range"]::-webkit-slider-thumb { + -webkit-appearance: none; + appearance: none; + width: 20px; + height: 20px; + border-radius: 50%; + background: #007bff; + cursor: pointer; + } + + .eq-band-slider input[type="range"]::-moz-range-thumb { + width: 20px; + height: 20px; + border-radius: 50%; + background: #007bff; + cursor: pointer; + border: none; + } + + .eq-bands-header { + font-size: 18px; + font-weight: bold; + color: #333; + margin-bottom: 10px; + padding: 0 20px; + } @@ -480,6 +556,64 @@

TAS5805M DAC Settings

// Render each group for (const group of schema.groups) { + // Check if this is an EQ bands group (vertical sliders layout) + if (group.layout === 'eq-bands') { + // Conditionally show/hide based on uiMode + let showGroup = false; + if (uiMode === 1 && group.channel === 'left') showGroup = true; // 15-band: left only (shown as "Both channels") + if (uiMode === 2) showGroup = true; // 15-band bi-amp: both channels + + if (!showGroup) continue; + + // Render EQ bands as vertical sliders + const bandsHeader = document.createElement('div'); + bandsHeader.className = 'eq-bands-header'; + bandsHeader.textContent = group.name; + container.appendChild(bandsHeader); + + const bandsContainer = document.createElement('div'); + bandsContainer.className = 'eq-bands-container'; + + for (const param of group.parameters) { + const bandSlider = document.createElement('div'); + bandSlider.className = 'eq-band-slider'; + + const label = document.createElement('div'); + label.className = 'slider-label'; + label.textContent = param.name; + + const slider = document.createElement('input'); + slider.type = 'range'; + slider.id = param.key; + slider.min = param.min; + slider.max = param.max; + slider.step = param.step || 1; + slider.value = param.current || param.default || 0; + slider.orient = 'vertical'; + + const valueDisplay = document.createElement('div'); + valueDisplay.className = 'slider-value'; + valueDisplay.id = `${param.key}-value`; + valueDisplay.textContent = `${param.current || param.default || 0} ${param.unit || ''}`; + + slider.addEventListener('input', (e) => { + valueDisplay.textContent = `${e.target.value} ${param.unit || ''}`; + }); + + slider.addEventListener('change', (e) => { + handleParameterChange(param.key, parseInt(e.target.value)); + }); + + bandSlider.appendChild(label); + bandSlider.appendChild(slider); + bandSlider.appendChild(valueDisplay); + bandsContainer.appendChild(bandSlider); + } + + container.appendChild(bandsContainer); + continue; // Skip normal group rendering + } + const groupDiv = document.createElement('div'); groupDiv.className = 'group-container'; @@ -492,6 +626,9 @@

TAS5805M DAC Settings

// Render parameters in this group for (const param of group.parameters) { + // Skip parameters that are now handled by eq-bands layout + if (param && param.layout === 'vertical') continue; + // Conditionally hide/show EQ-related parameters based on uiMode if (param && typeof param.key === 'string') { // per-band sliders: keys start with 'eq_gain_' diff --git a/main/main.c b/main/main.c index 2c100c0b..79727501 100644 --- a/main/main.c +++ b/main/main.c @@ -2628,7 +2628,7 @@ void app_main(void) { esp_log_level_set("httpd_uri", ESP_LOG_WARN); esp_log_level_set("UI_HTTP", ESP_LOG_WARN); esp_log_level_set("TAS5805M", ESP_LOG_DEBUG); - esp_log_level_set("tas5805m_settings", ESP_LOG_DEBUG); + esp_log_level_set("tas5805m_settings", ESP_LOG_INFO); #if CONFIG_SNAPCLIENT_USE_INTERNAL_ETHERNET || \ CONFIG_SNAPCLIENT_USE_SPI_ETHERNET From f056afd0d88b2cced23eefbb8a86ce47a5eb9e6f Mon Sep 17 00:00:00 2001 From: Andriy Malyshenko Date: Mon, 5 Jan 2026 19:15:59 +0100 Subject: [PATCH 27/58] Added dedicated tab for the EQ and refactored json API --- .../custom_board/tas5805m/include/tas5805m.h | 61 + components/custom_board/tas5805m/tas5805m.c | 203 +- .../dsp_processor_settings.c | 2 +- .../settings_manager/settings_manager.c | 7 + .../include/tas5805m_settings.h | 39 +- .../tas5805m_settings/tas5805m_settings.c | 1994 +++++++++++++++-- components/ui_http_server/CMakeLists.txt | 2 + .../ui_http_server/html/dac-settings.html | 144 +- .../ui_http_server/html/eq-settings.html | 778 +++++++ components/ui_http_server/html/index.html | 9 + components/ui_http_server/html/settings-ui.js | 245 ++ 11 files changed, 3154 insertions(+), 330 deletions(-) create mode 100644 components/ui_http_server/html/eq-settings.html create mode 100644 components/ui_http_server/html/settings-ui.js diff --git a/components/custom_board/tas5805m/include/tas5805m.h b/components/custom_board/tas5805m/include/tas5805m.h index cec5aca5..76458174 100644 --- a/components/custom_board/tas5805m/include/tas5805m.h +++ b/components/custom_board/tas5805m/include/tas5805m.h @@ -455,6 +455,51 @@ esp_err_t tas5805m_set_eq_profile(TAS5805M_EQ_PROFILE profile); esp_err_t tas5805m_set_eq_profile_channel(TAS5805M_EQ_CHANNELS channel, TAS5805M_EQ_PROFILE profile); +/** + * @brief Read biquad filter coefficients for a specific channel and band. + * + * Reads the 5 biquad coefficients (B0, B1, B2, A1, A2) from the DSP registers + * and converts them from Q5.27 format to float values. + * + * @param channel Left or right channel + * @param band Band index (0-14) + * @param b0 Output: B0 coefficient (feedforward) + * @param b1 Output: B1 coefficient (feedforward) + * @param b2 Output: B2 coefficient (feedforward) + * @param a1 Output: A1 coefficient (feedback) + * @param a2 Output: A2 coefficient (feedback) + * + * @return + * - ESP_OK on success + * - ESP_ERR_INVALID_ARG if parameters are NULL or band is out of range + * - ESP_FAIL on I2C communication error + */ +esp_err_t tas5805m_read_biquad_coefficients(TAS5805M_EQ_CHANNELS channel, int band, + float *b0, float *b1, float *b2, + float *a1, float *a2); + +/** + * @brief Write biquad filter coefficients for a specific channel and band. + * + * Converts float coefficients to Q5.27 format and writes them to the DSP registers. + * + * @param channel Left or right channel + * @param band Band index (0-14) + * @param b0 B0 coefficient (feedforward) + * @param b1 B1 coefficient (feedforward) + * @param b2 B2 coefficient (feedforward) + * @param a1 A1 coefficient (feedback) + * @param a2 A2 coefficient (feedback) + * + * @return + * - ESP_OK on success + * - ESP_ERR_INVALID_ARG if band is out of range + * - ESP_FAIL on I2C communication error + */ +esp_err_t tas5805m_write_biquad_coefficients(TAS5805M_EQ_CHANNELS channel, int band, + float b0, float b1, float b2, + float a1, float a2); + #endif /* CONFIG_DAC_TAS5805M_EQ_SUPPORT */ /** @@ -481,6 +526,22 @@ float tas5805m_q9_23_to_float(uint32_t raw); */ uint32_t tas5805m_float_to_q9_23(float value); +/** + * @brief Convert a Q5.27 fixed-point value to a float. + * + * @param raw Q5.27 value as a 32-bit unsigned integer. + * @return float-precision floating point representation. + */ +float tas5805m_q5_27_to_float(uint32_t raw); + +/** + * @brief Convert a float to a Q5.27 fixed-point value. + * + * @param value float-precision floating point input. + * @return Q5.27 fixed-point value as a 32-bit unsigned integer. + */ +uint32_t tas5805m_float_to_q5_27(float value); + #ifdef __cplusplus } #endif diff --git a/components/custom_board/tas5805m/tas5805m.c b/components/custom_board/tas5805m/tas5805m.c index 4e531fe8..4a505f22 100644 --- a/components/custom_board/tas5805m/tas5805m.c +++ b/components/custom_board/tas5805m/tas5805m.c @@ -170,6 +170,49 @@ esp_err_t tas5805m_write_bytes(uint8_t *reg, return ret; } +esp_err_t tas5805m_read_bytes(uint8_t *reg, int regLen, uint8_t *data, int datalen) +{ + int ret = ESP_OK; + ESP_LOGV(TAG, "%s: 0x%02x -> [%d] bytes", __func__, *reg, datalen); + + i2c_cmd_handle_t cmd = i2c_cmd_link_create(); + ret |= i2c_master_start(cmd); + ret |= i2c_master_write_byte(cmd, TAS5805M_ADDRESS << 1 | WRITE_BIT, ACK_CHECK_EN); + ret |= i2c_master_write(cmd, reg, regLen, ACK_CHECK_EN); + ret |= i2c_master_stop(cmd); + ret = i2c_master_cmd_begin(I2C_TAS5805M_MASTER_NUM, cmd, 1000 / portTICK_RATE_MS); + i2c_cmd_link_delete(cmd); + + if (ret != ESP_OK) { + ESP_LOGE(TAG, "%s: Error during I2C write phase: %s", __func__, esp_err_to_name(ret)); + return ret; + } + + vTaskDelay(1 / portTICK_PERIOD_MS); + + cmd = i2c_cmd_link_create(); + ret |= i2c_master_start(cmd); + ret |= i2c_master_write_byte(cmd, TAS5805M_ADDRESS << 1 | READ_BIT, ACK_CHECK_EN); + if (datalen > 1) { + ret |= i2c_master_read(cmd, data, datalen - 1, ACK_VAL); + } + ret |= i2c_master_read_byte(cmd, data + datalen - 1, NACK_VAL); + ret |= i2c_master_stop(cmd); + ret = i2c_master_cmd_begin(I2C_TAS5805M_MASTER_NUM, cmd, 1000 / portTICK_RATE_MS); + + if (ret != ESP_OK) { + ESP_LOGE(TAG, "%s: Error during I2C read phase: %s", __func__, esp_err_to_name(ret)); + } else { + for (int i = 0; i < datalen; i++) { + ESP_LOGV(TAG, "%s: [%d] = 0x%02x", __func__, i, data[i]); + } + } + + i2c_cmd_link_delete(cmd); + + return ret; +} + // Inits the TAS5805M change Settings in Menuconfig to enable Bridge-Mode esp_err_t tas5805m_init() { ESP_LOGD(TAG, "%s: Initializing TAS5805M", __func__); @@ -949,11 +992,145 @@ esp_err_t tas5805m_set_eq_profile_channel(TAS5805M_EQ_CHANNELS channel, TAS5805M // Set the EQ profile tas5805m_state.eq_profile[channel] = profile; - TAS5805M_SET_BOOK_AND_PAGE(TAS5805M_REG_BOOK_CONTROL_PORT, TAS5805M_REG_PAGE_ZERO); return ret; } +/* ------------------------- + Biquad coefficient access + ------------------------- */ + +/** + * @brief Get the register offset for a specific biquad coefficient. + * + * Each band has 5 coefficients (B0, B1, B2, A1, A2) stored sequentially. + * Each coefficient is 4 bytes in Q5.27 format. + * + * @param channel Left or right channel + * @param band Band index (0-14) + * @param coef_index Coefficient index (0=B0, 1=B1, 2=B2, 3=A1, 4=A2) + * @param page Output: page number + * @param offset Output: register offset + * @return ESP_OK on success + */ +static esp_err_t tas5805m_get_biquad_register(TAS5805M_EQ_CHANNELS channel, int band, + int coef_index, uint8_t *page, uint8_t *offset) +{ + if (band < 0 || band >= TAS5805M_EQ_BANDS) { + ESP_LOGE(TAG, "%s: Invalid band %d", __func__, band); + return ESP_ERR_INVALID_ARG; + } + + if (coef_index < 0 || coef_index >= TAS5805M_EQ_KOEF_PER_BAND) { + ESP_LOGE(TAG, "%s: Invalid coefficient index %d", __func__, coef_index); + return ESP_ERR_INVALID_ARG; + } + + // Calculate position in the register map + // We need to look at the data tables to find the pattern + // From tas5805m_set_eq_gain_channel: gain 0dB is at index TAS5805M_EQ_MAX_DB + const reg_sequence_eq **eq_maps = (channel == TAS5805M_EQ_CHANNELS_RIGHT) ? + tas5805m_eq_registers_right : tas5805m_eq_registers_left; + + // Use 0dB gain (middle of the range) as reference for current coefficient positions + int gain_index = TAS5805M_EQ_MAX_DB; // 0dB + int base_index = band * TAS5805M_EQ_KOEF_PER_BAND * TAS5805M_EQ_REG_PER_KOEF; + int coef_offset = coef_index * TAS5805M_EQ_REG_PER_KOEF; + int reg_index = base_index + coef_offset; + + const reg_sequence_eq *reg = &eq_maps[gain_index][reg_index]; + *page = reg->page; + *offset = reg->offset; + + return ESP_OK; +} + +esp_err_t tas5805m_read_biquad_coefficients(TAS5805M_EQ_CHANNELS channel, int band, + float *b0, float *b1, float *b2, + float *a1, float *a2) +{ + if (!b0 || !b1 || !b2 || !a1 || !a2) { + return ESP_ERR_INVALID_ARG; + } + + ESP_LOGD(TAG, "%s: Reading biquad coefficients for channel %d, band %d", + __func__, channel, band); + + esp_err_t ret = ESP_OK; + uint8_t page, offset; + uint32_t raw_value; + + // Read each coefficient + float *coeffs[] = {b0, b1, b2, a1, a2}; + const char *names[] = {"B0", "B1", "B2", "A1", "A2"}; + + for (int i = 0; i < TAS5805M_EQ_KOEF_PER_BAND; i++) { + ret = tas5805m_get_biquad_register(channel, band, i, &page, &offset); + if (ret != ESP_OK) { + return ret; + } + + TAS5805M_SET_BOOK_AND_PAGE(TAS5805M_REG_BOOK_EQ, page); + + ret = tas5805m_read_bytes(&offset, 1, (uint8_t *)&raw_value, sizeof(raw_value)); + if (ret != ESP_OK) { + ESP_LOGE(TAG, "%s: Failed to read coefficient %s: %s", + __func__, names[i], esp_err_to_name(ret)); + break; + } + + *coeffs[i] = tas5805m_q5_27_to_float(raw_value); + ESP_LOGD(TAG, "%s: %s = %f (raw: 0x%08X)", __func__, names[i], *coeffs[i], raw_value); + } + + TAS5805M_SET_BOOK_AND_PAGE(TAS5805M_REG_BOOK_CONTROL_PORT, TAS5805M_REG_PAGE_ZERO); + return ret; +} + +esp_err_t tas5805m_write_biquad_coefficients(TAS5805M_EQ_CHANNELS channel, int band, + float b0, float b1, float b2, + float a1, float a2) +{ + ESP_LOGD(TAG, "%s: Writing biquad coefficients for channel %d, band %d", + __func__, channel, band); + ESP_LOGD(TAG, "%s: B0=%f, B1=%f, B2=%f, A1=%f, A2=%f", + __func__, b0, b1, b2, a1, a2); + + esp_err_t ret = ESP_OK; + uint8_t current_page = 0; + uint8_t page, offset; + uint32_t raw_value; + + float coeffs[] = {b0, b1, b2, a1, a2}; + const char *names[] = {"B0", "B1", "B2", "A1", "A2"}; + + for (int i = 0; i < TAS5805M_EQ_KOEF_PER_BAND; i++) { + ret = tas5805m_get_biquad_register(channel, band, i, &page, &offset); + if (ret != ESP_OK) { + return ret; + } + + if (page != current_page) { + TAS5805M_SET_BOOK_AND_PAGE(TAS5805M_REG_BOOK_EQ, page); + current_page = page; + } + + raw_value = tas5805m_float_to_q5_27(coeffs[i]); + ESP_LOGD(TAG, "%s: Writing %s = %f -> 0x%08X to offset 0x%02X", + __func__, names[i], coeffs[i], raw_value, offset); + + ret = tas5805m_write_bytes(&offset, 1, (uint8_t *)&raw_value, sizeof(raw_value)); + if (ret != ESP_OK) { + ESP_LOGE(TAG, "%s: Failed to write coefficient %s: %s", + __func__, names[i], esp_err_to_name(ret)); + break; + } + } + + TAS5805M_SET_BOOK_AND_PAGE(TAS5805M_REG_BOOK_CONTROL_PORT, TAS5805M_REG_PAGE_ZERO); + return ret; +} + #endif /* CONFIG_DAC_TAS5805M_EQ_SUPPORT */ /* ------------------------- @@ -984,6 +1161,30 @@ uint32_t tas5805m_float_to_q9_23(float value) return le_val; } +float tas5805m_q5_27_to_float(uint32_t raw) +{ + uint32_t val = tas5805m_swap_endian_32(raw); + int32_t signed_val = (int32_t)val; + float result = (float)signed_val / 134217728.0f; // 2^27 + ESP_LOGD(TAG, "%s: raw=0x%08X, signed_val=%d -> result=%f", + __func__, raw, signed_val, result); + return result; +} + +uint32_t tas5805m_float_to_q5_27(float value) +{ + if (value > 15.999999f) value = 15.999999f; + if (value < -16.0f) value = -16.0f; + + int32_t fixed_val = (int32_t)(value * (1 << 27)); + uint32_t le_val = tas5805m_swap_endian_32((uint32_t)fixed_val); + + ESP_LOGD(TAG, "%s: value=%f -> fixed_val=%d, le_val=0x%08X", + __func__, value, fixed_val, le_val); + + return le_val; +} + // Utility: swap endian for 32-bit values uint32_t tas5805m_swap_endian_32(uint32_t val) { diff --git a/components/dsp_processor_settings/dsp_processor_settings.c b/components/dsp_processor_settings/dsp_processor_settings.c index c019b09e..63a34503 100644 --- a/components/dsp_processor_settings/dsp_processor_settings.c +++ b/components/dsp_processor_settings/dsp_processor_settings.c @@ -190,7 +190,7 @@ esp_err_t dsp_settings_get_json(char *json_out, size_t max_len) { } // Add active flow - dspFlows_t active_flow = dspfEQBassTreble; // default + dspFlows_t active_flow = dspfStereo; // default if (dsp_settings_load_active_flow(&active_flow) == ESP_OK) { cJSON_AddNumberToObject(root, "active_flow", (int)active_flow); } diff --git a/components/settings_manager/settings_manager.c b/components/settings_manager/settings_manager.c index 83143c72..4aec7ce1 100644 --- a/components/settings_manager/settings_manager.c +++ b/components/settings_manager/settings_manager.c @@ -519,6 +519,13 @@ esp_err_t settings_get_json(char *json_out, size_t max_len) { cJSON_AddBoolToObject(root, "dac_available", false); #endif + // Add EQ availability flag +#if defined(CONFIG_DAC_TAS5805M_EQ_SUPPORT) + cJSON_AddBoolToObject(root, "eq_available", true); +#else + cJSON_AddBoolToObject(root, "eq_available", false); +#endif + // Render to string char *json_str = cJSON_PrintUnformatted(root); cJSON_Delete(root); diff --git a/components/tas5805m_settings/include/tas5805m_settings.h b/components/tas5805m_settings/include/tas5805m_settings.h index f342038c..6dec196f 100644 --- a/components/tas5805m_settings/include/tas5805m_settings.h +++ b/components/tas5805m_settings/include/tas5805m_settings.h @@ -45,6 +45,9 @@ extern "C" { // Channel gain NVS keys (single value per output channel, in dB) #define TAS5805M_NVS_KEY_CHANNEL_GAIN_L "channel_gain_l" #define TAS5805M_NVS_KEY_CHANNEL_GAIN_R "channel_gain_r" +// Manual biquad coefficient NVS key prefixes (final key: "bq_l__b0" etc.) +#define TAS5805M_NVS_KEY_BQ_L_PREFIX "bq_l_" +#define TAS5805M_NVS_KEY_BQ_R_PREFIX "bq_r_" /** EQ UI modes exposed to the settings UI. These control visibility and apply behavior. * Defined here so the settings module owns the UI contract. Values are persisted to NVS. @@ -54,6 +57,7 @@ typedef enum { TAS5805M_EQ_UI_MODE_15_BAND = 1, TAS5805M_EQ_UI_MODE_15_BAND_BIAMP = 2, TAS5805M_EQ_UI_MODE_PRESETS = 3, + TAS5805M_EQ_UI_MODE_MANUAL = 4, } TAS5805M_EQ_UI_MODE; /** Convert an EQ UI mode to human-readable name (for schema name fields) */ @@ -124,14 +128,41 @@ esp_err_t tas5805m_settings_save_channel_gain(TAS5805M_EQ_CHANNELS ch, int gain_ /** Load per-output channel gain (single value per channel, in dB) */ esp_err_t tas5805m_settings_load_channel_gain(TAS5805M_EQ_CHANNELS ch, int *gain_db); +/** Save manual biquad coefficients for a specific channel and band to NVS */ +esp_err_t tas5805m_settings_save_biquad_coefficients(TAS5805M_EQ_CHANNELS ch, int band, + float b0, float b1, float b2, + float a1, float a2); +/** Load manual biquad coefficients for a specific channel and band from NVS */ +esp_err_t tas5805m_settings_load_biquad_coefficients(TAS5805M_EQ_CHANNELS ch, int band, + float *b0, float *b1, float *b2, + float *a1, float *a2); + /** Get current TAS5805M settings as a JSON string */ -esp_err_t tas5805m_settings_get_json(char *json_out, size_t max_len); +//esp_err_t tas5805m_settings_get_json(char *json_out, size_t max_len); + +/** Get TAS5805M settings schema as JSON */ +//esp_err_t tas5805m_settings_get_schema_json(char *json_out, size_t max_len); /** Update TAS5805M settings from a JSON string */ -esp_err_t tas5805m_settings_set_from_json(const char *json_in); +//esp_err_t tas5805m_settings_set_from_json(const char *json_in); -/** Get TAS5805M settings schema as JSON */ -esp_err_t tas5805m_settings_get_schema_json(char *json_out, size_t max_len); +/** Get current TAS5805M DAC-only settings as JSON (excludes EQ) */ +esp_err_t tas5805m_settings_get_dac_json(char *json_out, size_t max_len); + +/** Get TAS5805M DAC-only schema as JSON (excludes EQ) */ +esp_err_t tas5805m_settings_get_dac_schema_json(char *json_out, size_t max_len); + +/** Update TAS5805M DAC-only settings from JSON (excludes EQ) */ +esp_err_t tas5805m_settings_set_dac_from_json(const char *json_in); + +/** Get current TAS5805M EQ-only settings as JSON */ +esp_err_t tas5805m_settings_get_eq_json(char *json_out, size_t max_len); + +/** Get TAS5805M EQ-only schema as JSON */ +esp_err_t tas5805m_settings_get_eq_schema_json(char *json_out, size_t max_len); + +/** Update TAS5805M EQ settings from JSON */ +esp_err_t tas5805m_settings_set_eq_from_json(const char *json_in); /** Apply all persisted TAS5805M settings from NVS to the hardware. */ /** Apply settings that are safe to write immediately (before audio playback). diff --git a/components/tas5805m_settings/tas5805m_settings.c b/components/tas5805m_settings/tas5805m_settings.c index 46b05197..431b37ea 100644 --- a/components/tas5805m_settings/tas5805m_settings.c +++ b/components/tas5805m_settings/tas5805m_settings.c @@ -35,6 +35,8 @@ static SemaphoreHandle_t tas5805m_settings_mutex = NULL; static bool tas5805m_settings_restored = false; // Whether the polling task has been started static bool tas5805m_settings_poll_started = false; +// Whether I2S clock is available (tas5805m_settings_apply_delayed has been called) +static bool tas5805m_i2s_clock_ready = false; // Background polling task: waits for TAS5805M to enter PLAY state and then // triggers a one-time settings application. Exits after a timeout. @@ -118,6 +120,7 @@ const char *tas5805m_eq_ui_mode_to_string(TAS5805M_EQ_UI_MODE m) { case TAS5805M_EQ_UI_MODE_15_BAND: return "15-band"; case TAS5805M_EQ_UI_MODE_15_BAND_BIAMP: return "15-band (bi-amp)"; case TAS5805M_EQ_UI_MODE_PRESETS: return "EQ Presets"; + case TAS5805M_EQ_UI_MODE_MANUAL: return "Manual"; default: return "Unknown"; } } @@ -197,12 +200,6 @@ esp_err_t tas5805m_settings_init(void) { return ESP_OK; } -/* Digital volume persistence removed. - * Digital volume is treated as read-only / managed by the TAS5805M driver - * and is not persisted to NVS. Previous save/load functions and the - * corresponding NVS key were intentionally removed. - */ - esp_err_t tas5805m_settings_save_analog_gain(int gain_half_db) { ESP_LOGD(TAG, "%s: gain_half_db=%d", __func__, gain_half_db); @@ -698,6 +695,138 @@ esp_err_t tas5805m_settings_load_channel_gain(TAS5805M_EQ_CHANNELS ch, int *gain return err; } +/** Save manual biquad coefficients for a specific channel and band to NVS. + * Keys are formatted as: "bq_l__b0", "bq_l__b1", etc. + */ +esp_err_t tas5805m_settings_save_biquad_coefficients(TAS5805M_EQ_CHANNELS ch, int band, + float b0, float b1, float b2, + float a1, float a2) { +#if !defined(CONFIG_DAC_TAS5805M_EQ_SUPPORT) + return ESP_ERR_NOT_SUPPORTED; +#else + if (band < 0 || band >= TAS5805M_EQ_BANDS) { + ESP_LOGE(TAG, "%s: Invalid band %d", __func__, band); + return ESP_ERR_INVALID_ARG; + } + + ESP_LOGD(TAG, "%s: ch=%d band=%d b0=%f b1=%f b2=%f a1=%f a2=%f", + __func__, (int)ch, band, b0, b1, b2, a1, a2); + + if (!tas5805m_settings_mutex) return ESP_ERR_INVALID_STATE; + + if (xSemaphoreTake(tas5805m_settings_mutex, pdMS_TO_TICKS(5000)) != pdTRUE) { + return ESP_ERR_TIMEOUT; + } + + const char *prefix = (ch == TAS5805M_EQ_CHANNELS_LEFT) ? TAS5805M_NVS_KEY_BQ_L_PREFIX : TAS5805M_NVS_KEY_BQ_R_PREFIX; + char key[32]; + + nvs_handle_t h; + esp_err_t err = nvs_open(TAS5805M_NVS_NAMESPACE, NVS_READWRITE, &h); + if (err != ESP_OK) { + ESP_LOGW(TAG, "%s: Failed to open NVS namespace '%s': %s", __func__, TAS5805M_NVS_NAMESPACE, esp_err_to_name(err)); + xSemaphoreGive(tas5805m_settings_mutex); + return err; + } + + // Save each coefficient as a 32-bit blob (float) + snprintf(key, sizeof(key), "%s%d_b0", prefix, band); + err |= nvs_set_blob(h, key, &b0, sizeof(float)); + + snprintf(key, sizeof(key), "%s%d_b1", prefix, band); + err |= nvs_set_blob(h, key, &b1, sizeof(float)); + + snprintf(key, sizeof(key), "%s%d_b2", prefix, band); + err |= nvs_set_blob(h, key, &b2, sizeof(float)); + + snprintf(key, sizeof(key), "%s%d_a1", prefix, band); + err |= nvs_set_blob(h, key, &a1, sizeof(float)); + + snprintf(key, sizeof(key), "%s%d_a2", prefix, band); + err |= nvs_set_blob(h, key, &a2, sizeof(float)); + + if (err == ESP_OK) { + err = nvs_commit(h); + } + nvs_close(h); + + xSemaphoreGive(tas5805m_settings_mutex); + return err; +#endif +} + +/** Load manual biquad coefficients for a specific channel and band from NVS */ +esp_err_t tas5805m_settings_load_biquad_coefficients(TAS5805M_EQ_CHANNELS ch, int band, + float *b0, float *b1, float *b2, + float *a1, float *a2) { +#if !defined(CONFIG_DAC_TAS5805M_EQ_SUPPORT) + return ESP_ERR_NOT_SUPPORTED; +#else + if (!b0 || !b1 || !b2 || !a1 || !a2) return ESP_ERR_INVALID_ARG; + + if (band < 0 || band >= TAS5805M_EQ_BANDS) { + ESP_LOGE(TAG, "%s: Invalid band %d", __func__, band); + return ESP_ERR_INVALID_ARG; + } + + if (!tas5805m_settings_mutex) return ESP_ERR_INVALID_STATE; + + if (xSemaphoreTake(tas5805m_settings_mutex, pdMS_TO_TICKS(5000)) != pdTRUE) { + return ESP_ERR_TIMEOUT; + } + + const char *prefix = (ch == TAS5805M_EQ_CHANNELS_LEFT) ? TAS5805M_NVS_KEY_BQ_L_PREFIX : TAS5805M_NVS_KEY_BQ_R_PREFIX; + char key[32]; + + nvs_handle_t h; + esp_err_t err = nvs_open(TAS5805M_NVS_NAMESPACE, NVS_READONLY, &h); + if (err != ESP_OK) { + ESP_LOGW(TAG, "%s: Failed to open NVS namespace '%s': %s", __func__, TAS5805M_NVS_NAMESPACE, esp_err_to_name(err)); + xSemaphoreGive(tas5805m_settings_mutex); + return err; + } + + // Load each coefficient as a 32-bit blob (float) + size_t sz = sizeof(float); + + snprintf(key, sizeof(key), "%s%d_b0", prefix, band); + err = nvs_get_blob(h, key, b0, &sz); + if (err != ESP_OK) goto cleanup; + + sz = sizeof(float); + snprintf(key, sizeof(key), "%s%d_b1", prefix, band); + err = nvs_get_blob(h, key, b1, &sz); + if (err != ESP_OK) goto cleanup; + + sz = sizeof(float); + snprintf(key, sizeof(key), "%s%d_b2", prefix, band); + err = nvs_get_blob(h, key, b2, &sz); + if (err != ESP_OK) goto cleanup; + + sz = sizeof(float); + snprintf(key, sizeof(key), "%s%d_a1", prefix, band); + err = nvs_get_blob(h, key, a1, &sz); + if (err != ESP_OK) goto cleanup; + + sz = sizeof(float); + snprintf(key, sizeof(key), "%s%d_a2", prefix, band); + err = nvs_get_blob(h, key, a2, &sz); + if (err != ESP_OK) goto cleanup; + + ESP_LOGD(TAG, "%s: Loaded ch=%d band=%d: b0=%f b1=%f b2=%f a1=%f a2=%f", + __func__, (int)ch, band, *b0, *b1, *b2, *a1, *a2); + +cleanup: + if (err != ESP_OK && err != ESP_ERR_NVS_NOT_FOUND) { + ESP_LOGW(TAG, "%s: Failed to read biquad coefficients for ch=%d band=%d: %s", + __func__, (int)ch, band, esp_err_to_name(err)); + } + nvs_close(h); + xSemaphoreGive(tas5805m_settings_mutex); + return err; +#endif +} + /** Load EQ mode from NVS */ esp_err_t tas5805m_settings_load_eq_mode(TAS5805M_EQ_MODE *mode) { if (!mode) return ESP_ERR_INVALID_ARG; @@ -750,7 +879,7 @@ esp_err_t tas5805m_settings_get_json(char *json_out, size_t max_len) { dac_mode = TAS5805M_DAC_MODE_BTL; } - // Get modulation mode + /* Get current modulation mode and frequencies */ TAS5805M_MOD_MODE mod_mode; TAS5805M_SW_FREQ sw_freq; TAS5805M_BD_FREQ bd_freq; @@ -1107,6 +1236,7 @@ esp_err_t tas5805m_settings_set_from_json(const char *json_in) { case TAS5805M_EQ_UI_MODE_15_BAND: drv = TAS5805M_EQ_MODE_ON; break; case TAS5805M_EQ_UI_MODE_15_BAND_BIAMP: drv = TAS5805M_EQ_MODE_BIAMP; break; case TAS5805M_EQ_UI_MODE_PRESETS: drv = TAS5805M_EQ_MODE_BIAMP; break; + case TAS5805M_EQ_UI_MODE_MANUAL: drv = TAS5805M_EQ_MODE_BIAMP; break; default: drv = TAS5805M_EQ_MODE_OFF; break; } @@ -1274,6 +1404,107 @@ esp_err_t tas5805m_settings_set_from_json(const char *json_in) { } } } + + // Handle manual biquad coefficients (keys like "bq_l_0_b0", "bq_l_0_b1", etc.) + // Parse and save to NVS only. Application to hardware happens only when user clicks Apply. + for (int band = 0; band < TAS5805M_EQ_BANDS; ++band) { + float b0_l = 1, b1_l = 0, b2_l = 0, a1_l = 0, a2_l = 0; + float b0_r = 1, b1_r = 0, b2_r = 0, a1_r = 0, a2_r = 0; + bool has_l = true, has_r = true; + + // Parse left channel coefficients + char key[32]; + snprintf(key, sizeof(key), "bq_l_%d_b0", band); + cJSON *item = cJSON_GetObjectItem(root, key); + if (cJSON_IsNumber(item)) b0_l = (float)item->valuedouble; else has_l = false; + + snprintf(key, sizeof(key), "bq_l_%d_b1", band); + item = cJSON_GetObjectItem(root, key); + if (cJSON_IsNumber(item)) b1_l = (float)item->valuedouble; else has_l = false; + + snprintf(key, sizeof(key), "bq_l_%d_b2", band); + item = cJSON_GetObjectItem(root, key); + if (cJSON_IsNumber(item)) b2_l = (float)item->valuedouble; else has_l = false; + + snprintf(key, sizeof(key), "bq_l_%d_a1", band); + item = cJSON_GetObjectItem(root, key); + if (cJSON_IsNumber(item)) a1_l = (float)item->valuedouble; else has_l = false; + + snprintf(key, sizeof(key), "bq_l_%d_a2", band); + item = cJSON_GetObjectItem(root, key); + if (cJSON_IsNumber(item)) a2_l = (float)item->valuedouble; else has_l = false; + + // Parse right channel coefficients + snprintf(key, sizeof(key), "bq_r_%d_b0", band); + item = cJSON_GetObjectItem(root, key); + if (cJSON_IsNumber(item)) b0_r = (float)item->valuedouble; else has_r = false; + + snprintf(key, sizeof(key), "bq_r_%d_b1", band); + item = cJSON_GetObjectItem(root, key); + if (cJSON_IsNumber(item)) b1_r = (float)item->valuedouble; else has_r = false; + + snprintf(key, sizeof(key), "bq_r_%d_b2", band); + item = cJSON_GetObjectItem(root, key); + if (cJSON_IsNumber(item)) b2_r = (float)item->valuedouble; else has_r = false; + + snprintf(key, sizeof(key), "bq_r_%d_a1", band); + item = cJSON_GetObjectItem(root, key); + if (cJSON_IsNumber(item)) a1_r = (float)item->valuedouble; else has_r = false; + + snprintf(key, sizeof(key), "bq_r_%d_a2", band); + item = cJSON_GetObjectItem(root, key); + if (cJSON_IsNumber(item)) a2_r = (float)item->valuedouble; else has_r = false; + + // Save to NVS if all coefficients were provided + if (has_l) { + esp_err_t perr = tas5805m_settings_save_biquad_coefficients(TAS5805M_EQ_CHANNELS_LEFT, band, + b0_l, b1_l, b2_l, a1_l, a2_l); + if (perr == ESP_OK) { + ESP_LOGI(TAG, "%s: Saved manual BQ L band %d to NVS", __func__, band); + } else { + ESP_LOGW(TAG, "%s: Failed to save manual BQ L band %d: %s", __func__, band, esp_err_to_name(perr)); + } + } + + if (has_r) { + esp_err_t perr = tas5805m_settings_save_biquad_coefficients(TAS5805M_EQ_CHANNELS_RIGHT, band, + b0_r, b1_r, b2_r, a1_r, a2_r); + if (perr == ESP_OK) { + ESP_LOGI(TAG, "%s: Saved manual BQ R band %d to NVS", __func__, band); + } else { + ESP_LOGW(TAG, "%s: Failed to save manual BQ R band %d: %s", __func__, band, esp_err_to_name(perr)); + } + } + } + + // Check if user requested to apply manual coefficients (special "apply_manual_bq" flag) + cJSON *apply_item = cJSON_GetObjectItem(root, "apply_manual_bq"); + if (cJSON_IsTrue(apply_item)) { + ESP_LOGI(TAG, "%s: Applying manual biquad coefficients to hardware", __func__); + for (int band = 0; band < TAS5805M_EQ_BANDS; ++band) { + float b0, b1, b2, a1, a2; + // Left channel + if (tas5805m_settings_load_biquad_coefficients(TAS5805M_EQ_CHANNELS_LEFT, band, + &b0, &b1, &b2, &a1, &a2) == ESP_OK) { + esp_err_t werr = tas5805m_write_biquad_coefficients(TAS5805M_EQ_CHANNELS_LEFT, band, + b0, b1, b2, a1, a2); + if (werr != ESP_OK) { + ESP_LOGW(TAG, "%s: Failed to write manual BQ L band %d: %s", + __func__, band, esp_err_to_name(werr)); + } + } + // Right channel + if (tas5805m_settings_load_biquad_coefficients(TAS5805M_EQ_CHANNELS_RIGHT, band, + &b0, &b1, &b2, &a1, &a2) == ESP_OK) { + esp_err_t werr = tas5805m_write_biquad_coefficients(TAS5805M_EQ_CHANNELS_RIGHT, band, + b0, b1, b2, a1, a2); + if (werr != ESP_OK) { + ESP_LOGW(TAG, "%s: Failed to write manual BQ R band %d: %s", + __func__, band, esp_err_to_name(werr)); + } + } + } + } #else (void)root; // keep compiler happy when EQ support disabled #endif @@ -1341,6 +1572,9 @@ esp_err_t tas5805m_settings_get_schema_json(char *json_out, size_t max_len) { } cJSON *groups = cJSON_CreateArray(); + /* eq_params is referenced from both EQ-enabled and EQ-disabled branches + * ensure the variable is declared in all compilation configurations. */ + cJSON *eq_params = NULL; // ===== Volume Group ===== cJSON *volume_group = cJSON_CreateObject(); @@ -1498,7 +1732,7 @@ esp_err_t tas5805m_settings_get_schema_json(char *json_out, size_t max_len) { cJSON_AddItemToObject(mixer_mode_param, "values", mixer_mode_values); cJSON_AddItemToArray(dac_config_params, mixer_mode_param); - + // Modulation Mode parameter cJSON *mod_mode_param = cJSON_CreateObject(); cJSON_AddStringToObject(mod_mode_param, "key", "modulation_mode"); @@ -1507,7 +1741,6 @@ esp_err_t tas5805m_settings_get_schema_json(char *json_out, size_t max_len) { cJSON_AddNumberToObject(mod_mode_param, "current", (int)mod_mode); cJSON *mod_mode_values = cJSON_CreateArray(); - cJSON *mod_bd = cJSON_CreateObject(); cJSON_AddNumberToObject(mod_bd, "value", MOD_MODE_BD); cJSON_AddStringToObject(mod_bd, "name", "BD Mode"); @@ -1525,7 +1758,7 @@ esp_err_t tas5805m_settings_get_schema_json(char *json_out, size_t max_len) { cJSON_AddItemToObject(mod_mode_param, "values", mod_mode_values); cJSON_AddItemToArray(dac_config_params, mod_mode_param); - + // Switching Frequency parameter cJSON *sw_freq_param = cJSON_CreateObject(); cJSON_AddStringToObject(sw_freq_param, "key", "sw_freq"); @@ -1534,7 +1767,6 @@ esp_err_t tas5805m_settings_get_schema_json(char *json_out, size_t max_len) { cJSON_AddNumberToObject(sw_freq_param, "current", (int)sw_freq); cJSON *sw_freq_values = cJSON_CreateArray(); - cJSON *freq_768k = cJSON_CreateObject(); cJSON_AddNumberToObject(freq_768k, "value", SW_FREQ_768K); cJSON_AddStringToObject(freq_768k, "name", "768 kHz"); @@ -1557,16 +1789,15 @@ esp_err_t tas5805m_settings_get_schema_json(char *json_out, size_t max_len) { cJSON_AddItemToObject(sw_freq_param, "values", sw_freq_values); cJSON_AddItemToArray(dac_config_params, sw_freq_param); - + // BD Frequency parameter cJSON *bd_freq_param = cJSON_CreateObject(); cJSON_AddStringToObject(bd_freq_param, "key", "bd_freq"); cJSON_AddStringToObject(bd_freq_param, "name", "BD Frequency"); cJSON_AddStringToObject(bd_freq_param, "type", "enum"); cJSON_AddNumberToObject(bd_freq_param, "current", (int)bd_freq); - + cJSON *bd_freq_values = cJSON_CreateArray(); - cJSON *bd_80k = cJSON_CreateObject(); cJSON_AddNumberToObject(bd_80k, "value", SW_FREQ_80K); cJSON_AddStringToObject(bd_80k, "name", "80 kHz"); @@ -1590,57 +1821,6 @@ esp_err_t tas5805m_settings_get_schema_json(char *json_out, size_t max_len) { cJSON_AddItemToObject(bd_freq_param, "values", bd_freq_values); cJSON_AddItemToArray(dac_config_params, bd_freq_param); - cJSON_AddItemToObject(dac_config_group, "parameters", dac_config_params); - cJSON_AddItemToArray(groups, dac_config_group); - - // ===== Channel Gain Group (always visible) ===== - { - cJSON *ch_group = cJSON_CreateObject(); - cJSON_AddStringToObject(ch_group, "name", "Mixer Gain"); - cJSON_AddStringToObject(ch_group, "description", "Mixer gain"); - - cJSON *ch_params = cJSON_CreateArray(); - - int8_t cur_ch_l = 0, cur_ch_r = 0; - if (tas5805m_get_channel_gain(TAS5805M_EQ_CHANNELS_LEFT, &cur_ch_l) != ESP_OK) cur_ch_l = 0; - if (tas5805m_get_channel_gain(TAS5805M_EQ_CHANNELS_RIGHT, &cur_ch_r) != ESP_OK) cur_ch_r = 0; - - cJSON *ch_l_param = cJSON_CreateObject(); - cJSON_AddStringToObject(ch_l_param, "key", TAS5805M_NVS_KEY_CHANNEL_GAIN_L); - cJSON_AddStringToObject(ch_l_param, "name", "Channel Gain (L)"); - cJSON_AddStringToObject(ch_l_param, "type", "range"); - cJSON_AddStringToObject(ch_l_param, "unit", "dB"); - cJSON_AddNumberToObject(ch_l_param, "min", TAS5805M_MIXER_VALUE_MINDB); - cJSON_AddNumberToObject(ch_l_param, "max", TAS5805M_MIXER_VALUE_MAXDB); - cJSON_AddNumberToObject(ch_l_param, "step", 1); - cJSON_AddNumberToObject(ch_l_param, "default", 0); - cJSON_AddNumberToObject(ch_l_param, "current", (int)cur_ch_l); - cJSON_AddItemToArray(ch_params, ch_l_param); - - cJSON *ch_r_param = cJSON_CreateObject(); - cJSON_AddStringToObject(ch_r_param, "key", TAS5805M_NVS_KEY_CHANNEL_GAIN_R); - cJSON_AddStringToObject(ch_r_param, "name", "Channel Gain (R)"); - cJSON_AddStringToObject(ch_r_param, "type", "range"); - cJSON_AddStringToObject(ch_r_param, "unit", "dB"); - cJSON_AddNumberToObject(ch_r_param, "min", TAS5805M_MIXER_VALUE_MINDB); - cJSON_AddNumberToObject(ch_r_param, "max", TAS5805M_MIXER_VALUE_MAXDB); - cJSON_AddNumberToObject(ch_r_param, "step", 1); - cJSON_AddNumberToObject(ch_r_param, "default", 0); - cJSON_AddNumberToObject(ch_r_param, "current", (int)cur_ch_r); - cJSON_AddItemToArray(ch_params, ch_r_param); - - cJSON_AddItemToObject(ch_group, "parameters", ch_params); - cJSON_AddItemToArray(groups, ch_group); - } - - // ===== EQ Group ===== - cJSON *eq_group = cJSON_CreateObject(); - cJSON_AddStringToObject(eq_group, "name", "EQ"); - cJSON_AddStringToObject(eq_group, "description", "Equalizer mode"); - cJSON_AddStringToObject(eq_group, "layout", "eq-controls"); - - cJSON *eq_params = cJSON_CreateArray(); - // Replace legacy EQ mode with a UI-focused EQ selection that controls which UI elements are shown cJSON *eq_ui_param = cJSON_CreateObject(); cJSON_AddStringToObject(eq_ui_param, "key", "eq_ui_mode"); @@ -1683,6 +1863,11 @@ esp_err_t tas5805m_settings_get_schema_json(char *json_out, size_t max_len) { cJSON_AddNumberToObject(v_preset, "value", (int)TAS5805M_EQ_UI_MODE_PRESETS); cJSON_AddStringToObject(v_preset, "name", "EQ Presets"); cJSON_AddItemToArray(eq_ui_values, v_preset); + + cJSON *v_manual = cJSON_CreateObject(); + cJSON_AddNumberToObject(v_manual, "value", (int)TAS5805M_EQ_UI_MODE_MANUAL); + cJSON_AddStringToObject(v_manual, "name", "Manual"); + cJSON_AddItemToArray(eq_ui_values, v_manual); #else /* When EQ support is disabled expose only OFF and mark the control readonly * so the UI shows the section but doesn't allow changing it. @@ -1731,7 +1916,9 @@ esp_err_t tas5805m_settings_get_schema_json(char *json_out, size_t max_len) { v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", HF_150HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "HF 150 Hz Cutoff"); cJSON_AddItemToArray(prof_l_values, v); cJSON_AddItemToObject(prof_l_param, "values", prof_l_values); - cJSON_AddItemToArray(eq_params, prof_l_param); + /* Preset selectors are placed into a dedicated group so the UI can + * show/hide the entire presets section when the UI mode is set to + * 'Presets'. We'll add them to the presets group later. */ // Right channel cJSON *prof_r_param = cJSON_CreateObject(); @@ -1792,8 +1979,6 @@ esp_err_t tas5805m_settings_get_schema_json(char *json_out, size_t max_len) { cJSON_AddItemToObject(prof_r_param, "values", prof_r_vals); cJSON_AddItemToArray(eq_params, prof_r_param); #endif - cJSON_AddItemToObject(eq_group, "parameters", eq_params); - cJSON_AddItemToArray(groups, eq_group); /* Add per-band sliders for left and right channels (if EQ supported) */ #if defined(CONFIG_DAC_TAS5805M_EQ_SUPPORT) @@ -1872,6 +2057,88 @@ esp_err_t tas5805m_settings_get_schema_json(char *json_out, size_t max_len) { // Add EQ band sub-groups to main groups array (after EQ group) cJSON_AddItemToArray(groups, eq_bands_left); cJSON_AddItemToArray(groups, eq_bands_right); + + /* Add manual biquad coefficient groups for left and right channels */ + cJSON *bq_left_group = cJSON_CreateObject(); + cJSON_AddStringToObject(bq_left_group, "name", "Manual Biquad Coefficients (Left)"); + cJSON_AddStringToObject(bq_left_group, "layout", "biquad-manual"); + cJSON_AddStringToObject(bq_left_group, "channel", "left"); + cJSON *bq_left_params = cJSON_CreateArray(); + + cJSON *bq_right_group = cJSON_CreateObject(); + cJSON_AddStringToObject(bq_right_group, "name", "Manual Biquad Coefficients (Right)"); + cJSON_AddStringToObject(bq_right_group, "layout", "biquad-manual"); + cJSON_AddStringToObject(bq_right_group, "channel", "right"); + cJSON *bq_right_params = cJSON_CreateArray(); + + // For each band, create 5 float inputs (B0, B1, B2, A1, A2) for both channels + for (int band = 0; band < TAS5805M_EQ_BANDS; ++band) { + char freq_label[32]; + snprintf(freq_label, sizeof(freq_label), "Band %d (%d Hz)", band, tas5805m_eq_bands[band]); + + const char *coef_names[] = {"B0", "B1", "B2", "A1", "A2"}; + const char *coef_keys[] = {"b0", "b1", "b2", "a1", "a2"}; + + for (int c = 0; c < 5; ++c) { + // Left channel + char key_l[32]; + snprintf(key_l, sizeof(key_l), "bq_l_%d_%s", band, coef_keys[c]); + + cJSON *coef_l = cJSON_CreateObject(); + cJSON_AddStringToObject(coef_l, "key", key_l); + cJSON_AddStringToObject(coef_l, "name", coef_names[c]); + cJSON_AddStringToObject(coef_l, "type", "float"); + cJSON_AddStringToObject(coef_l, "band_label", freq_label); + cJSON_AddNumberToObject(coef_l, "band", band); + cJSON_AddNumberToObject(coef_l, "coef_index", c); + cJSON_AddNumberToObject(coef_l, "min", -16.0); + cJSON_AddNumberToObject(coef_l, "max", 15.999999); + cJSON_AddNumberToObject(coef_l, "step", 0.000001); + cJSON_AddNumberToObject(coef_l, "default", (c == 0) ? 1.0 : 0.0); // B0 defaults to 1.0, others to 0.0 + + // Try to load current value from NVS + float b0=1.0, b1=0.0, b2=0.0, a1=0.0, a2=0.0; + if (tas5805m_settings_load_biquad_coefficients(TAS5805M_EQ_CHANNELS_LEFT, band, &b0, &b1, &b2, &a1, &a2) == ESP_OK) { + float vals[] = {b0, b1, b2, a1, a2}; + cJSON_AddNumberToObject(coef_l, "current", vals[c]); + } else { + cJSON_AddNumberToObject(coef_l, "current", (c == 0) ? 1.0 : 0.0); + } + cJSON_AddItemToArray(bq_left_params, coef_l); + + // Right channel + char key_r[32]; + snprintf(key_r, sizeof(key_r), "bq_r_%d_%s", band, coef_keys[c]); + + cJSON *coef_r = cJSON_CreateObject(); + cJSON_AddStringToObject(coef_r, "key", key_r); + cJSON_AddStringToObject(coef_r, "name", coef_names[c]); + cJSON_AddStringToObject(coef_r, "type", "float"); + cJSON_AddStringToObject(coef_r, "band_label", freq_label); + cJSON_AddNumberToObject(coef_r, "band", band); + cJSON_AddNumberToObject(coef_r, "coef_index", c); + cJSON_AddNumberToObject(coef_r, "min", -16.0); + cJSON_AddNumberToObject(coef_r, "max", 15.999999); + cJSON_AddNumberToObject(coef_r, "step", 0.000001); + cJSON_AddNumberToObject(coef_r, "default", (c == 0) ? 1.0 : 0.0); + + // Try to load current value from NVS + b0=1.0; b1=0.0; b2=0.0; a1=0.0; a2=0.0; + if (tas5805m_settings_load_biquad_coefficients(TAS5805M_EQ_CHANNELS_RIGHT, band, &b0, &b1, &b2, &a1, &a2) == ESP_OK) { + float vals[] = {b0, b1, b2, a1, a2}; + cJSON_AddNumberToObject(coef_r, "current", vals[c]); + } else { + cJSON_AddNumberToObject(coef_r, "current", (c == 0) ? 1.0 : 0.0); + } + cJSON_AddItemToArray(bq_right_params, coef_r); + } + } + + cJSON_AddItemToObject(bq_left_group, "parameters", bq_left_params); + cJSON_AddItemToObject(bq_right_group, "parameters", bq_right_params); + + cJSON_AddItemToArray(groups, bq_left_group); + cJSON_AddItemToArray(groups, bq_right_group); #endif // End groups @@ -1903,158 +2170,1509 @@ esp_err_t tas5805m_settings_get_schema_json(char *json_out, size_t max_len) { return ESP_OK; } -/* Apply early settings that are safe to write before audio playback starts. - * This includes: analog gain, DAC mode, modulation mode, mixer mode. +/** + * Get DAC-only schema as JSON string + * This includes only the basic DAC configuration groups (Volume, State, DAC Configuration) */ -esp_err_t tas5805m_settings_apply_early(void) { - ESP_LOGI(TAG, "%s: Applying early TAS5805M settings from NVS", __func__); - // NOTE: don't call tas5805m_settings_init() here to avoid recursion; caller - // should ensure init() has been called. +esp_err_t tas5805m_settings_get_dac_schema_json(char *json_out, size_t max_len) { + ESP_LOGD(TAG, "%s: max_len=%zu", __func__, max_len); + + if (!json_out || max_len == 0) { + return ESP_ERR_INVALID_ARG; + } - // Apply analog gain (raw register index) - int ana_gain = 0; - if (tas5805m_settings_load_analog_gain(&ana_gain) == ESP_OK) { - uint8_t gain = (uint8_t)ana_gain; - ESP_LOGI(TAG, "%s: Restoring analog gain raw=%d", __func__, gain); - if (tas5805m_set_again(gain) != ESP_OK) { - ESP_LOGW(TAG, "%s: Failed to apply saved analog gain", __func__); - } + // Get current state for schema + TAS5805_STATE dac_state; + esp_err_t err = tas5805m_get_state(&dac_state); + if (err != ESP_OK) { + ESP_LOGE(TAG, "%s: Failed to get DAC state: %s", __func__, esp_err_to_name(err)); + dac_state.state = TAS5805M_CTRL_PLAY; + } + + uint8_t digital_volume; + if (tas5805m_get_digital_volume(&digital_volume) != ESP_OK) { + digital_volume = TAS5805M_VOLUME_DIGITAL_DEFAULT; + } + + uint8_t analog_gain; + if (tas5805m_get_again(&analog_gain) != ESP_OK) { + analog_gain = 0; } - // Apply DAC mode TAS5805M_DAC_MODE dac_mode; - if (tas5805m_settings_load_dac_mode(&dac_mode) == ESP_OK) { - ESP_LOGI(TAG, "%s: Restoring DAC mode=%d", __func__, (int)dac_mode); - if (tas5805m_set_dac_mode(dac_mode) != ESP_OK) { - ESP_LOGW(TAG, "%s: Failed to apply saved DAC mode", __func__); - } + if (tas5805m_get_dac_mode(&dac_mode) != ESP_OK) { + dac_mode = TAS5805M_DAC_MODE_BTL; } - // Apply modulation mode (mode, sw_freq, bd_freq) + /* Get current modulation mode and frequencies */ TAS5805M_MOD_MODE mod_mode; TAS5805M_SW_FREQ sw_freq; TAS5805M_BD_FREQ bd_freq; - if (tas5805m_settings_load_modulation_mode(&mod_mode, &sw_freq, &bd_freq) == ESP_OK) { - ESP_LOGI(TAG, "%s: Restoring modulation mode=%d, sw=%d, bd=%d", __func__, (int)mod_mode, (int)sw_freq, (int)bd_freq); - if (tas5805m_set_modulation_mode(mod_mode, sw_freq, bd_freq) != ESP_OK) { - ESP_LOGW(TAG, "%s: Failed to apply saved modulation mode", __func__); - } - } - - ESP_LOGI(TAG, "%s: Early persisted settings application complete", __func__); - return ESP_OK; -} - -/* Apply settings that require the codec to be running (delayed restore). -* This restores EQ mode, per-band gains, profiles and channel gains. -*/ -esp_err_t tas5805m_settings_apply_delayed(void) { - ESP_LOGI(TAG, "%s: Applying delayed TAS5805M settings from NVS", __func__); - - // Apply mixer mode - TAS5805M_MIXER_MODE mixer_mode; - if (tas5805m_settings_load_mixer_mode(&mixer_mode) == ESP_OK) { - ESP_LOGI(TAG, "%s: Restoring mixer mode=%d", __func__, (int)mixer_mode); - if (tas5805m_set_mixer_mode(mixer_mode) != ESP_OK) { - ESP_LOGW(TAG, "%s: Failed to apply saved mixer mode", __func__); - } + if (tas5805m_get_modulation_mode(&mod_mode, &sw_freq, &bd_freq) != ESP_OK) { + mod_mode = MOD_MODE_BD; + sw_freq = SW_FREQ_768K; + bd_freq = SW_FREQ_80K; } - TAS5805M_EQ_MODE eq_mode = TAS5805M_EQ_MODE_OFF; - if (tas5805m_settings_load_eq_mode(&eq_mode) == ESP_OK) { - ESP_LOGI(TAG, "%s: Restoring EQ mode=%d", __func__, (int)eq_mode); - #if defined(CONFIG_DAC_TAS5805M_EQ_SUPPORT) - if (tas5805m_set_eq_mode(eq_mode) != ESP_OK) { - ESP_LOGW(TAG, "%s: Failed to apply saved EQ mode", __func__); - } - #else - ESP_LOGW(TAG, "%s: EQ support disabled in build; ignoring persisted EQ mode", __func__); - #endif + // Build minimal DAC schema + cJSON *root = cJSON_CreateObject(); + if (!root) { + ESP_LOGE(TAG, "%s: Failed to create JSON root", __func__); + return ESP_ERR_NO_MEM; } -#if defined(CONFIG_DAC_TAS5805M_EQ_SUPPORT) - // Restore EQ based on persisted UI selection (eq_ui_mode). If no UI selection - // is persisted, derive a reasonable default from the saved driver EQ mode. - TAS5805M_EQ_UI_MODE ui_mode = TAS5805M_EQ_UI_MODE_OFF; - if (tas5805m_settings_load_eq_ui_mode(&ui_mode) != ESP_OK) { - // derive from saved eq_mode - if (eq_mode == TAS5805M_EQ_MODE_OFF) ui_mode = TAS5805M_EQ_UI_MODE_OFF; - else if (eq_mode == TAS5805M_EQ_MODE_ON) ui_mode = TAS5805M_EQ_UI_MODE_15_BAND; - else ui_mode = TAS5805M_EQ_UI_MODE_15_BAND_BIAMP; - } + cJSON *groups = cJSON_CreateArray(); + + // Volume Group + cJSON *volume_group = cJSON_CreateObject(); + cJSON_AddStringToObject(volume_group, "name", "Volume"); + cJSON_AddStringToObject(volume_group, "description", "Digital and analog volume control"); + + cJSON *volume_params = cJSON_CreateArray(); + + cJSON *dig_vol_param = cJSON_CreateObject(); + cJSON_AddStringToObject(dig_vol_param, "key", "digital_volume"); + cJSON_AddStringToObject(dig_vol_param, "name", "Digital Volume"); + cJSON_AddStringToObject(dig_vol_param, "type", "range"); + cJSON_AddStringToObject(dig_vol_param, "unit", ""); + cJSON_AddNumberToObject(dig_vol_param, "min", TAS5805M_VOLUME_DIGITAL_MIN); + cJSON_AddNumberToObject(dig_vol_param, "max", TAS5805M_VOLUME_DIGITAL_MAX); + cJSON_AddNumberToObject(dig_vol_param, "step", 1); + cJSON_AddNumberToObject(dig_vol_param, "default", TAS5805M_VOLUME_DIGITAL_DEFAULT); + cJSON_AddNumberToObject(dig_vol_param, "current", digital_volume); + cJSON_AddBoolToObject(dig_vol_param, "readonly", true); + cJSON_AddItemToArray(volume_params, dig_vol_param); + + cJSON *ana_gain_param = cJSON_CreateObject(); + cJSON_AddStringToObject(ana_gain_param, "key", "analog_gain"); + cJSON_AddStringToObject(ana_gain_param, "name", "Analog Gain"); + cJSON_AddStringToObject(ana_gain_param, "type", "range"); + cJSON_AddStringToObject(ana_gain_param, "unit", ""); + cJSON_AddNumberToObject(ana_gain_param, "min", 0); + cJSON_AddNumberToObject(ana_gain_param, "max", 31); + cJSON_AddNumberToObject(ana_gain_param, "step", 1); + cJSON_AddNumberToObject(ana_gain_param, "default", 0); + cJSON_AddNumberToObject(ana_gain_param, "current", analog_gain); + cJSON_AddItemToArray(volume_params, ana_gain_param); + + cJSON_AddItemToObject(volume_group, "parameters", volume_params); + cJSON_AddItemToArray(groups, volume_group); + + // State Group + cJSON *state_group = cJSON_CreateObject(); + cJSON_AddStringToObject(state_group, "name", "State"); + cJSON_AddStringToObject(state_group, "description", "DAC power and operation state"); + + cJSON *state_params = cJSON_CreateArray(); + + cJSON *state_param = cJSON_CreateObject(); + cJSON_AddStringToObject(state_param, "key", "state"); + cJSON_AddStringToObject(state_param, "name", "DAC State"); + cJSON_AddStringToObject(state_param, "type", "enum"); + cJSON_AddNumberToObject(state_param, "current", (int)dac_state.state); + cJSON_AddBoolToObject(state_param, "readonly", true); + + cJSON *state_values = cJSON_CreateArray(); + cJSON *val_deep_sleep = cJSON_CreateObject(); + cJSON_AddNumberToObject(val_deep_sleep, "value", TAS5805M_CTRL_DEEP_SLEEP); + cJSON_AddStringToObject(val_deep_sleep, "name", "Deep Sleep"); + cJSON_AddItemToArray(state_values, val_deep_sleep); + + cJSON *val_sleep = cJSON_CreateObject(); + cJSON_AddNumberToObject(val_sleep, "value", TAS5805M_CTRL_SLEEP); + cJSON_AddStringToObject(val_sleep, "name", "Sleep"); + cJSON_AddItemToArray(state_values, val_sleep); + + cJSON *val_hiz = cJSON_CreateObject(); + cJSON_AddNumberToObject(val_hiz, "value", TAS5805M_CTRL_HI_Z); + cJSON_AddStringToObject(val_hiz, "name", "Hi-Z"); + cJSON_AddItemToArray(state_values, val_hiz); + + cJSON *val_play = cJSON_CreateObject(); + cJSON_AddNumberToObject(val_play, "value", TAS5805M_CTRL_PLAY); + cJSON_AddStringToObject(val_play, "name", "Play"); + cJSON_AddItemToArray(state_values, val_play); + + cJSON *val_play_mute = cJSON_CreateObject(); + cJSON_AddNumberToObject(val_play_mute, "value", TAS5805M_CTRL_PLAY_MUTE); + cJSON_AddStringToObject(val_play_mute, "name", "Play (Muted)"); + cJSON_AddItemToArray(state_values, val_play_mute); + + cJSON_AddItemToObject(state_param, "values", state_values); + cJSON_AddItemToArray(state_params, state_param); + + cJSON_AddItemToObject(state_group, "parameters", state_params); + cJSON_AddItemToArray(groups, state_group); + + // DAC Configuration Group - simplified + cJSON *dac_config_group = cJSON_CreateObject(); + cJSON_AddStringToObject(dac_config_group, "name", "DAC Configuration"); + cJSON_AddStringToObject(dac_config_group, "description", "DAC mode and mixer settings"); + cJSON_AddStringToObject(dac_config_group, "layout", "dac-config"); + + cJSON *dac_config_params = cJSON_CreateArray(); + + cJSON *dac_mode_param = cJSON_CreateObject(); + cJSON_AddStringToObject(dac_mode_param, "key", "dac_mode"); + cJSON_AddStringToObject(dac_mode_param, "name", "DAC Mode"); + cJSON_AddStringToObject(dac_mode_param, "type", "enum"); + cJSON_AddNumberToObject(dac_mode_param, "current", (int)dac_mode); + + cJSON *dac_mode_values = cJSON_CreateArray(); + cJSON *dac_mode_btl = cJSON_CreateObject(); + cJSON_AddNumberToObject(dac_mode_btl, "value", TAS5805M_DAC_MODE_BTL); + cJSON_AddStringToObject(dac_mode_btl, "name", "BTL (Bridge Tied Load)"); + cJSON_AddItemToArray(dac_mode_values, dac_mode_btl); + + cJSON *dac_mode_pbtl = cJSON_CreateObject(); + cJSON_AddNumberToObject(dac_mode_pbtl, "value", TAS5805M_DAC_MODE_PBTL); + cJSON_AddStringToObject(dac_mode_pbtl, "name", "PBTL (Parallel Load)"); + cJSON_AddItemToArray(dac_mode_values, dac_mode_pbtl); + + cJSON_AddItemToObject(dac_mode_param, "values", dac_mode_values); + cJSON_AddItemToArray(dac_config_params, dac_mode_param); + + // Mixer Mode + cJSON *mixer_mode_param = cJSON_CreateObject(); + cJSON_AddStringToObject(mixer_mode_param, "key", "mixer_mode"); + cJSON_AddStringToObject(mixer_mode_param, "name", "Mixer Mode"); + cJSON_AddStringToObject(mixer_mode_param, "type", "enum"); + cJSON_AddNumberToObject(mixer_mode_param, "current", (int)dac_state.mixer_mode); + + cJSON *mixer_values = cJSON_CreateArray(); + const char *mixer_names[] = {"Stereo", "Stereo (Inverse)", "Mono", "Right", "Left"}; + for (int i = MIXER_STEREO; i <= MIXER_LEFT; ++i) { + cJSON *mv = cJSON_CreateObject(); + cJSON_AddNumberToObject(mv, "value", i); + cJSON_AddStringToObject(mv, "name", mixer_names[i - 1]); + cJSON_AddItemToArray(mixer_values, mv); + } + cJSON_AddItemToObject(mixer_mode_param, "values", mixer_values); + cJSON_AddItemToArray(dac_config_params, mixer_mode_param); + + // Modulation Mode + cJSON *mod_mode_param = cJSON_CreateObject(); + cJSON_AddStringToObject(mod_mode_param, "key", "modulation_mode"); + cJSON_AddStringToObject(mod_mode_param, "name", "Modulation Mode"); + cJSON_AddStringToObject(mod_mode_param, "type", "enum"); + cJSON_AddNumberToObject(mod_mode_param, "current", (int)mod_mode); + + cJSON *mod_values = cJSON_CreateArray(); + cJSON *mod_bd = cJSON_CreateObject(); + cJSON_AddNumberToObject(mod_bd, "value", MOD_MODE_BD); + cJSON_AddStringToObject(mod_bd, "name", "BD"); + cJSON_AddItemToArray(mod_values, mod_bd); + + cJSON *mod_1spw = cJSON_CreateObject(); + cJSON_AddNumberToObject(mod_1spw, "value", MOD_MODE_1SPW); + cJSON_AddStringToObject(mod_1spw, "name", "1SPW"); + cJSON_AddItemToArray(mod_values, mod_1spw); + + cJSON *mod_hybrid = cJSON_CreateObject(); + cJSON_AddNumberToObject(mod_hybrid, "value", MOD_MODE_HYBRID); + cJSON_AddStringToObject(mod_hybrid, "name", "Hybrid"); + cJSON_AddItemToArray(mod_values, mod_hybrid); + + cJSON_AddItemToObject(mod_mode_param, "values", mod_values); + cJSON_AddItemToArray(dac_config_params, mod_mode_param); + + // Switching Frequency + cJSON *sw_freq_param = cJSON_CreateObject(); + cJSON_AddStringToObject(sw_freq_param, "key", "sw_freq"); + cJSON_AddStringToObject(sw_freq_param, "name", "Switching Frequency"); + cJSON_AddStringToObject(sw_freq_param, "type", "enum"); + cJSON_AddNumberToObject(sw_freq_param, "current", (int)sw_freq); + + cJSON *sw_freq_values = cJSON_CreateArray(); + cJSON *freq_768k = cJSON_CreateObject(); + cJSON_AddNumberToObject(freq_768k, "value", SW_FREQ_768K); + cJSON_AddStringToObject(freq_768k, "name", "768 kHz"); + cJSON_AddItemToArray(sw_freq_values, freq_768k); + + cJSON *freq_384k = cJSON_CreateObject(); + cJSON_AddNumberToObject(freq_384k, "value", SW_FREQ_384K); + cJSON_AddStringToObject(freq_384k, "name", "384 kHz"); + cJSON_AddItemToArray(sw_freq_values, freq_384k); + + cJSON *freq_480k = cJSON_CreateObject(); + cJSON_AddNumberToObject(freq_480k, "value", SW_FREQ_480K); + cJSON_AddStringToObject(freq_480k, "name", "480 kHz"); + cJSON_AddItemToArray(sw_freq_values, freq_480k); + + cJSON *freq_576k = cJSON_CreateObject(); + cJSON_AddNumberToObject(freq_576k, "value", SW_FREQ_576K); + cJSON_AddStringToObject(freq_576k, "name", "576 kHz"); + cJSON_AddItemToArray(sw_freq_values, freq_576k); + + cJSON_AddItemToObject(sw_freq_param, "values", sw_freq_values); + cJSON_AddItemToArray(dac_config_params, sw_freq_param); + + // BD Frequency + cJSON *bd_freq_param = cJSON_CreateObject(); + cJSON_AddStringToObject(bd_freq_param, "key", "bd_freq"); + cJSON_AddStringToObject(bd_freq_param, "name", "BD Frequency"); + cJSON_AddStringToObject(bd_freq_param, "type", "enum"); + cJSON_AddNumberToObject(bd_freq_param, "current", (int)bd_freq); + + cJSON *bd_freq_values = cJSON_CreateArray(); + cJSON *bd_80k = cJSON_CreateObject(); + cJSON_AddNumberToObject(bd_80k, "value", SW_FREQ_80K); + cJSON_AddStringToObject(bd_80k, "name", "80 kHz"); + cJSON_AddItemToArray(bd_freq_values, bd_80k); + + cJSON *bd_100k = cJSON_CreateObject(); + cJSON_AddNumberToObject(bd_100k, "value", SW_FREQ_100K); + cJSON_AddStringToObject(bd_100k, "name", "100 kHz"); + cJSON_AddItemToArray(bd_freq_values, bd_100k); + + cJSON *bd_120k = cJSON_CreateObject(); + cJSON_AddNumberToObject(bd_120k, "value", SW_FREQ_120K); + cJSON_AddStringToObject(bd_120k, "name", "120 kHz"); + cJSON_AddItemToArray(bd_freq_values, bd_120k); + + cJSON *bd_175k = cJSON_CreateObject(); + cJSON_AddNumberToObject(bd_175k, "value", SW_FREQ_175K); + cJSON_AddStringToObject(bd_175k, "name", "175 kHz"); + cJSON_AddItemToArray(bd_freq_values, bd_175k); + + cJSON_AddItemToObject(bd_freq_param, "values", bd_freq_values); + cJSON_AddItemToArray(dac_config_params, bd_freq_param); + + cJSON_AddItemToObject(dac_config_group, "parameters", dac_config_params); + cJSON_AddItemToArray(groups, dac_config_group); + + cJSON_AddItemToObject(root, "groups", groups); + + // Render to string + char *json_str = cJSON_PrintUnformatted(root); + cJSON_Delete(root); + + if (!json_str) { + ESP_LOGE(TAG, "%s: Failed to render JSON", __func__); + return ESP_ERR_NO_MEM; + } + + size_t json_len = strlen(json_str); + if (json_len >= max_len) { + ESP_LOGE(TAG, "%s: JSON too large for buffer (%zu >= %zu)", __func__, json_len, max_len); + cJSON_free(json_str); + return ESP_ERR_INVALID_SIZE; + } + + strncpy(json_out, json_str, max_len - 1); + json_out[max_len - 1] = '\0'; + cJSON_free(json_str); + + ESP_LOGD(TAG, "%s: DAC schema JSON generated", __func__); + return ESP_OK; +} + +/** + * Get EQ-only schema as JSON string + * This includes only the EQ-related groups + */ +esp_err_t tas5805m_settings_get_eq_schema_json(char *json_out, size_t max_len) { + ESP_LOGD(TAG, "%s: max_len=%zu", __func__, max_len); + + if (!json_out || max_len == 0) { + return ESP_ERR_INVALID_ARG; + } + + cJSON *root = cJSON_CreateObject(); + if (!root) { + ESP_LOGE(TAG, "%s: Failed to create JSON root", __func__); + return ESP_ERR_NO_MEM; + } + + cJSON *groups = cJSON_CreateArray(); + + // ===== Channel Gain Group (always visible, first in EQ schema) ===== + { + cJSON *ch_group = cJSON_CreateObject(); + cJSON_AddStringToObject(ch_group, "name", "Channel Gain"); + cJSON_AddStringToObject(ch_group, "description", "Per-channel mixer gain control"); + + cJSON *ch_params = cJSON_CreateArray(); + + int8_t cur_ch_l = 0, cur_ch_r = 0; + if (tas5805m_get_channel_gain(TAS5805M_EQ_CHANNELS_LEFT, &cur_ch_l) != ESP_OK) cur_ch_l = 0; + if (tas5805m_get_channel_gain(TAS5805M_EQ_CHANNELS_RIGHT, &cur_ch_r) != ESP_OK) cur_ch_r = 0; + + cJSON *ch_l_param = cJSON_CreateObject(); + cJSON_AddStringToObject(ch_l_param, "key", TAS5805M_NVS_KEY_CHANNEL_GAIN_L); + cJSON_AddStringToObject(ch_l_param, "name", "Channel Gain (L)"); + cJSON_AddStringToObject(ch_l_param, "type", "range"); + cJSON_AddStringToObject(ch_l_param, "unit", "dB"); + cJSON_AddNumberToObject(ch_l_param, "min", TAS5805M_MIXER_VALUE_MINDB); + cJSON_AddNumberToObject(ch_l_param, "max", TAS5805M_MIXER_VALUE_MAXDB); + cJSON_AddNumberToObject(ch_l_param, "step", 1); + cJSON_AddNumberToObject(ch_l_param, "default", 0); + cJSON_AddNumberToObject(ch_l_param, "current", (int)cur_ch_l); + cJSON_AddItemToArray(ch_params, ch_l_param); + + cJSON *ch_r_param = cJSON_CreateObject(); + cJSON_AddStringToObject(ch_r_param, "key", TAS5805M_NVS_KEY_CHANNEL_GAIN_R); + cJSON_AddStringToObject(ch_r_param, "name", "Channel Gain (R)"); + cJSON_AddStringToObject(ch_r_param, "type", "range"); + cJSON_AddStringToObject(ch_r_param, "unit", "dB"); + cJSON_AddNumberToObject(ch_r_param, "min", TAS5805M_MIXER_VALUE_MINDB); + cJSON_AddNumberToObject(ch_r_param, "max", TAS5805M_MIXER_VALUE_MAXDB); + cJSON_AddNumberToObject(ch_r_param, "step", 1); + cJSON_AddNumberToObject(ch_r_param, "default", 0); + cJSON_AddNumberToObject(ch_r_param, "current", (int)cur_ch_r); + cJSON_AddItemToArray(ch_params, ch_r_param); + + cJSON_AddItemToObject(ch_group, "parameters", ch_params); + cJSON_AddItemToArray(groups, ch_group); + } + +#if defined(CONFIG_DAC_TAS5805M_EQ_SUPPORT) + // Get current EQ mode + TAS5805M_EQ_MODE eq_mode_val = TAS5805M_EQ_MODE_OFF; + tas5805m_get_eq_mode(&eq_mode_val); + + // EQ Mode Group + cJSON *eq_mode_group = cJSON_CreateObject(); + cJSON_AddStringToObject(eq_mode_group, "name", "EQ Mode"); + cJSON_AddStringToObject(eq_mode_group, "description", "Equalizer operation mode"); + + cJSON *eq_mode_params = cJSON_CreateArray(); + + cJSON *eq_ui_mode_param = cJSON_CreateObject(); + cJSON_AddStringToObject(eq_ui_mode_param, "key", "eq_ui_mode"); + cJSON_AddStringToObject(eq_ui_mode_param, "name", "EQ UI Mode"); + cJSON_AddStringToObject(eq_ui_mode_param, "type", "enum"); + + TAS5805M_EQ_UI_MODE ui_mode = TAS5805M_EQ_UI_MODE_OFF; + tas5805m_settings_load_eq_ui_mode(&ui_mode); + cJSON_AddNumberToObject(eq_ui_mode_param, "current", (int)ui_mode); + + cJSON *eq_ui_mode_values = cJSON_CreateArray(); + const char *ui_mode_names[] = {"Off", "15-Band", "15-Band Bi-Amp", "Presets", "Manual"}; + for (int i = 0; i <= TAS5805M_EQ_UI_MODE_MANUAL; ++i) { + cJSON *val = cJSON_CreateObject(); + cJSON_AddNumberToObject(val, "value", i); + cJSON_AddStringToObject(val, "name", ui_mode_names[i]); + cJSON_AddItemToArray(eq_ui_mode_values, val); + } + cJSON_AddItemToObject(eq_ui_mode_param, "values", eq_ui_mode_values); + cJSON_AddItemToArray(eq_mode_params, eq_ui_mode_param); + + cJSON_AddItemToObject(eq_mode_group, "parameters", eq_mode_params); + cJSON_AddItemToArray(groups, eq_mode_group); + + /* Create main EQ group and parameters array so subsequent blocks can + * append parameters (presets, profiles, etc.). This mirrors the DAC + * schema layout and ensures `eq_params` is defined before use. */ + cJSON *eq_group = cJSON_CreateObject(); + cJSON_AddStringToObject(eq_group, "name", "EQ"); + cJSON_AddStringToObject(eq_group, "description", "Equalizer settings"); + cJSON_AddStringToObject(eq_group, "layout", "eq-controls"); + cJSON *eq_params = cJSON_CreateArray(); + + /* EQ Preset / Profile per channel (so UI 'Presets' mode has controls) */ +#if defined(CONFIG_DAC_TAS5805M_EQ_SUPPORT) + { + TAS5805M_EQ_PROFILE cur_prof_l = FLAT, cur_prof_r = FLAT; + if (tas5805m_get_eq_profile_channel(TAS5805M_EQ_CHANNELS_LEFT, &cur_prof_l) != ESP_OK) cur_prof_l = FLAT; + if (tas5805m_get_eq_profile_channel(TAS5805M_EQ_CHANNELS_RIGHT, &cur_prof_r) != ESP_OK) cur_prof_r = FLAT; + + cJSON *prof_l_param = cJSON_CreateObject(); + cJSON_AddStringToObject(prof_l_param, "key", "eq_profile_l"); + cJSON_AddStringToObject(prof_l_param, "name", "EQ Preset (L)"); + cJSON_AddStringToObject(prof_l_param, "type", "enum"); + cJSON_AddNumberToObject(prof_l_param, "current", (int)cur_prof_l); + + cJSON *prof_l_values = cJSON_CreateArray(); + cJSON *v; + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", FLAT); cJSON_AddStringToObject(v, "name", "Flat"); cJSON_AddItemToArray(prof_l_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", LF_60HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "LF 60 Hz Cutoff"); cJSON_AddItemToArray(prof_l_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", LF_70HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "LF 70 Hz Cutoff"); cJSON_AddItemToArray(prof_l_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", LF_80HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "LF 80 Hz Cutoff"); cJSON_AddItemToArray(prof_l_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", LF_90HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "LF 90 Hz Cutoff"); cJSON_AddItemToArray(prof_l_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", LF_100HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "LF 100 Hz Cutoff"); cJSON_AddItemToArray(prof_l_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", LF_110HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "LF 110 Hz Cutoff"); cJSON_AddItemToArray(prof_l_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", LF_120HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "LF 120 Hz Cutoff"); cJSON_AddItemToArray(prof_l_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", LF_130HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "LF 130 Hz Cutoff"); cJSON_AddItemToArray(prof_l_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", LF_140HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "LF 140 Hz Cutoff"); cJSON_AddItemToArray(prof_l_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", LF_150HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "LF 150 Hz Cutoff"); cJSON_AddItemToArray(prof_l_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", HF_60HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "HF 60 Hz Cutoff"); cJSON_AddItemToArray(prof_l_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", HF_70HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "HF 70 Hz Cutoff"); cJSON_AddItemToArray(prof_l_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", HF_80HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "HF 80 Hz Cutoff"); cJSON_AddItemToArray(prof_l_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", HF_90HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "HF 90 Hz Cutoff"); cJSON_AddItemToArray(prof_l_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", HF_100HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "HF 100 Hz Cutoff"); cJSON_AddItemToArray(prof_l_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", HF_110HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "HF 110 Hz Cutoff"); cJSON_AddItemToArray(prof_l_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", HF_120HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "HF 120 Hz Cutoff"); cJSON_AddItemToArray(prof_l_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", HF_130HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "HF 130 Hz Cutoff"); cJSON_AddItemToArray(prof_l_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", HF_140HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "HF 140 Hz Cutoff"); cJSON_AddItemToArray(prof_l_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", HF_150HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "HF 150 Hz Cutoff"); cJSON_AddItemToArray(prof_l_values, v); + + cJSON_AddItemToObject(prof_l_param, "values", prof_l_values); + + /* Right channel preset selector */ + cJSON *prof_r_param = cJSON_CreateObject(); + cJSON_AddStringToObject(prof_r_param, "key", "eq_profile_r"); + cJSON_AddStringToObject(prof_r_param, "name", "EQ Preset (R)"); + cJSON_AddStringToObject(prof_r_param, "type", "enum"); + cJSON_AddNumberToObject(prof_r_param, "current", (int)cur_prof_r); + + cJSON *prof_r_values = cJSON_CreateArray(); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", FLAT); cJSON_AddStringToObject(v, "name", "Flat"); cJSON_AddItemToArray(prof_r_values, v); + /* clone same list entries for right channel */ + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", LF_60HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "LF 60 Hz Cutoff"); cJSON_AddItemToArray(prof_r_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", LF_70HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "LF 70 Hz Cutoff"); cJSON_AddItemToArray(prof_r_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", LF_80HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "LF 80 Hz Cutoff"); cJSON_AddItemToArray(prof_r_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", LF_90HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "LF 90 Hz Cutoff"); cJSON_AddItemToArray(prof_r_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", LF_100HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "LF 100 Hz Cutoff"); cJSON_AddItemToArray(prof_r_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", LF_110HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "LF 110 Hz Cutoff"); cJSON_AddItemToArray(prof_r_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", LF_120HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "LF 120 Hz Cutoff"); cJSON_AddItemToArray(prof_r_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", LF_130HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "LF 130 Hz Cutoff"); cJSON_AddItemToArray(prof_r_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", LF_140HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "LF 140 Hz Cutoff"); cJSON_AddItemToArray(prof_r_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", LF_150HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "LF 150 Hz Cutoff"); cJSON_AddItemToArray(prof_r_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", HF_60HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "HF 60 Hz Cutoff"); cJSON_AddItemToArray(prof_r_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", HF_70HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "HF 70 Hz Cutoff"); cJSON_AddItemToArray(prof_r_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", HF_80HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "HF 80 Hz Cutoff"); cJSON_AddItemToArray(prof_r_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", HF_90HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "HF 90 Hz Cutoff"); cJSON_AddItemToArray(prof_r_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", HF_100HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "HF 100 Hz Cutoff"); cJSON_AddItemToArray(prof_r_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", HF_110HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "HF 110 Hz Cutoff"); cJSON_AddItemToArray(prof_r_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", HF_120HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "HF 120 Hz Cutoff"); cJSON_AddItemToArray(prof_r_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", HF_130HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "HF 130 Hz Cutoff"); cJSON_AddItemToArray(prof_r_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", HF_140HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "HF 140 Hz Cutoff"); cJSON_AddItemToArray(prof_r_values, v); + v = cJSON_CreateObject(); cJSON_AddNumberToObject(v, "value", HF_150HZ_CUTOFF); cJSON_AddStringToObject(v, "name", "HF 150 Hz Cutoff"); cJSON_AddItemToArray(prof_r_values, v); + + cJSON_AddItemToObject(prof_r_param, "values", prof_r_values); + /* Create presets group and add both parameters so it can be hidden */ + cJSON *eq_presets_group = cJSON_CreateObject(); + cJSON_AddStringToObject(eq_presets_group, "name", "EQ Presets"); + cJSON_AddStringToObject(eq_presets_group, "description", "Preset profiles for left and right channels"); + cJSON_AddStringToObject(eq_presets_group, "layout", "eq-presets"); + cJSON *eq_presets_params = cJSON_CreateArray(); + cJSON_AddItemToArray(eq_presets_params, prof_l_param); + cJSON_AddItemToArray(eq_presets_params, prof_r_param); + cJSON_AddItemToObject(eq_presets_group, "parameters", eq_presets_params); + cJSON_AddItemToArray(groups, eq_presets_group); + } +#else + /* If EQ support disabled provide readonly placeholders */ + cJSON *prof_l_param = cJSON_CreateObject(); + cJSON_AddStringToObject(prof_l_param, "key", "eq_profile_l"); + cJSON_AddStringToObject(prof_l_param, "name", "EQ Preset (L)"); + cJSON_AddStringToObject(prof_l_param, "type", "enum"); + cJSON_AddNumberToObject(prof_l_param, "current", (int)FLAT); + cJSON *prof_l_vals = cJSON_CreateArray(); + cJSON *pv = cJSON_CreateObject(); cJSON_AddNumberToObject(pv, "value", FLAT); cJSON_AddStringToObject(pv, "name", "Flat"); cJSON_AddItemToArray(prof_l_vals, pv); + cJSON_AddItemToObject(prof_l_param, "values", prof_l_vals); + + cJSON *prof_r_param = cJSON_CreateObject(); + cJSON_AddStringToObject(prof_r_param, "key", "eq_profile_r"); + cJSON_AddStringToObject(prof_r_param, "name", "EQ Preset (R)"); + cJSON_AddStringToObject(prof_r_param, "type", "enum"); + cJSON_AddNumberToObject(prof_r_param, "current", (int)FLAT); + cJSON *prof_r_vals = cJSON_CreateArray(); + pv = cJSON_CreateObject(); cJSON_AddNumberToObject(pv, "value", FLAT); cJSON_AddStringToObject(pv, "name", "Flat"); cJSON_AddItemToArray(prof_r_vals, pv); + cJSON_AddItemToObject(prof_r_param, "values", prof_r_vals); + /* Create presets group for readonly placeholders when EQ support disabled */ + cJSON *eq_presets_group = cJSON_CreateObject(); + cJSON_AddStringToObject(eq_presets_group, "name", "EQ Presets"); + cJSON_AddStringToObject(eq_presets_group, "description", "Preset profiles (readonly)"); + cJSON_AddStringToObject(eq_presets_group, "layout", "eq-presets"); + cJSON *eq_presets_params = cJSON_CreateArray(); + cJSON_AddItemToArray(eq_presets_params, prof_l_param); + cJSON_AddItemToArray(eq_presets_params, prof_r_param); + cJSON_AddItemToObject(eq_presets_group, "parameters", eq_presets_params); + cJSON_AddItemToArray(groups, eq_presets_group); +#endif + + // EQ Bands Group (Left Channel) + cJSON *eq_bands_left = cJSON_CreateObject(); + cJSON_AddStringToObject(eq_bands_left, "name", "EQ Bands (Left)"); + cJSON_AddStringToObject(eq_bands_left, "description", "15-band parametric equalizer for left channel"); + cJSON_AddStringToObject(eq_bands_left, "layout", "eq-bands"); + cJSON_AddStringToObject(eq_bands_left, "channel", "left"); + + cJSON *eq_bands_left_params = cJSON_CreateArray(); + for (int band = 0; band < TAS5805M_EQ_BANDS; ++band) { + int gain = 0; + tas5805m_settings_load_eq_gain(TAS5805M_EQ_CHANNELS_LEFT, band, &gain); + + cJSON *band_param = cJSON_CreateObject(); + char key[32]; + char freq_label[32]; + snprintf(key, sizeof(key), "eq_gain_l_%d", band); + snprintf(freq_label, sizeof(freq_label), "%d Hz", tas5805m_eq_bands[band]); + + cJSON_AddStringToObject(band_param, "key", key); + cJSON_AddStringToObject(band_param, "name", freq_label); + cJSON_AddStringToObject(band_param, "type", "range"); + cJSON_AddStringToObject(band_param, "unit", "dB"); + cJSON_AddStringToObject(band_param, "label", freq_label); + cJSON_AddStringToObject(band_param, "layout", "vertical"); + cJSON_AddNumberToObject(band_param, "band", band); + cJSON_AddNumberToObject(band_param, "min", TAS5805M_EQ_MIN_DB); + cJSON_AddNumberToObject(band_param, "max", TAS5805M_EQ_MAX_DB); + cJSON_AddNumberToObject(band_param, "step", 1); + cJSON_AddNumberToObject(band_param, "default", 0); + cJSON_AddNumberToObject(band_param, "current", gain); + + cJSON_AddItemToArray(eq_bands_left_params, band_param); + } + cJSON_AddItemToObject(eq_bands_left, "parameters", eq_bands_left_params); + cJSON_AddItemToArray(groups, eq_bands_left); + + // EQ Bands Group (Right Channel) + cJSON *eq_bands_right = cJSON_CreateObject(); + cJSON_AddStringToObject(eq_bands_right, "name", "EQ Bands (Right)"); + cJSON_AddStringToObject(eq_bands_right, "description", "15-band parametric equalizer for right channel"); + cJSON_AddStringToObject(eq_bands_right, "layout", "eq-bands"); + cJSON_AddStringToObject(eq_bands_right, "channel", "right"); + + cJSON *eq_bands_right_params = cJSON_CreateArray(); + for (int band = 0; band < TAS5805M_EQ_BANDS; ++band) { + int gain = 0; + tas5805m_settings_load_eq_gain(TAS5805M_EQ_CHANNELS_RIGHT, band, &gain); + + cJSON *band_param = cJSON_CreateObject(); + char key[32]; + char freq_label[32]; + snprintf(key, sizeof(key), "eq_gain_r_%d", band); + snprintf(freq_label, sizeof(freq_label), "%d Hz", tas5805m_eq_bands[band]); + + cJSON_AddStringToObject(band_param, "key", key); + cJSON_AddStringToObject(band_param, "name", freq_label); + cJSON_AddStringToObject(band_param, "type", "range"); + cJSON_AddStringToObject(band_param, "unit", "dB"); + cJSON_AddStringToObject(band_param, "label", freq_label); + cJSON_AddStringToObject(band_param, "layout", "vertical"); + cJSON_AddNumberToObject(band_param, "band", band); + cJSON_AddNumberToObject(band_param, "min", TAS5805M_EQ_MIN_DB); + cJSON_AddNumberToObject(band_param, "max", TAS5805M_EQ_MAX_DB); + cJSON_AddNumberToObject(band_param, "step", 1); + cJSON_AddNumberToObject(band_param, "default", 0); + cJSON_AddNumberToObject(band_param, "current", gain); + + cJSON_AddItemToArray(eq_bands_right_params, band_param); + } + cJSON_AddItemToObject(eq_bands_right, "parameters", eq_bands_right_params); + cJSON_AddItemToArray(groups, eq_bands_right); + + // Biquad Coefficients (Left) - always visible, collapsible, editable only in manual mode + // Read actual coefficients from device to show current DSP state + cJSON *bq_manual_left = cJSON_CreateObject(); + cJSON_AddStringToObject(bq_manual_left, "name", "Biquad Coefficients (Left)"); + + const char *left_description; + if (ui_mode == TAS5805M_EQ_UI_MODE_MANUAL) { + left_description = "Direct biquad coefficient control for left channel. Use 'Sync' to read from DAC, 'Apply' to write to DAC"; + } else { + left_description = "Stored manual biquad coefficients (read-only). Use 'Sync' to read current values from DAC"; + } + cJSON_AddStringToObject(bq_manual_left, "description", left_description); + + cJSON_AddStringToObject(bq_manual_left, "layout", "biquad-manual"); + cJSON_AddStringToObject(bq_manual_left, "channel", "left"); + cJSON_AddBoolToObject(bq_manual_left, "collapsible", true); + cJSON_AddBoolToObject(bq_manual_left, "collapsed", ui_mode != TAS5805M_EQ_UI_MODE_MANUAL); + + cJSON *bq_manual_left_params = cJSON_CreateArray(); + for (int band = 0; band < TAS5805M_EQ_BANDS; ++band) { + float b0 = 1.0f, b1 = 0.0f, b2 = 0.0f, a1 = 0.0f, a2 = 0.0f; + + // Load from NVS (stored manual coefficients) + tas5805m_settings_load_biquad_coefficients(TAS5805M_EQ_CHANNELS_LEFT, band, &b0, &b1, &b2, &a1, &a2); + + char band_label[32]; + snprintf(band_label, sizeof(band_label), "BQ %d", band); + + const char *coeff_names[] = {"b0", "b1", "b2", "a0", "a1", "a2"}; + float coeff_values[6]; + coeff_values[0] = b0; coeff_values[1] = b1; coeff_values[2] = b2; + coeff_values[3] = 1.0f; /* a0 is always 1.0 */ + coeff_values[4] = a1; coeff_values[5] = a2; + + bool is_manual_mode = (ui_mode == TAS5805M_EQ_UI_MODE_MANUAL); + + for (int c = 0; c < 6; ++c) { + cJSON *coeff_param = cJSON_CreateObject(); + char key[32]; + snprintf(key, sizeof(key), "bq_l_%d_%s", band, coeff_names[c]); + + cJSON_AddStringToObject(coeff_param, "key", key); + cJSON_AddStringToObject(coeff_param, "name", coeff_names[c]); + cJSON_AddStringToObject(coeff_param, "type", "float"); + cJSON_AddNumberToObject(coeff_param, "min", -16.0); + cJSON_AddNumberToObject(coeff_param, "max", 15.999999); + cJSON_AddNumberToObject(coeff_param, "step", 0.000001); + cJSON_AddNumberToObject(coeff_param, "current", coeff_values[c]); + + // a0 is always readonly (fixed at 1.0) + // Other coefficients are readonly unless in manual mode + if (c == 3 || !is_manual_mode) { + cJSON_AddBoolToObject(coeff_param, "readonly", true); + } + + cJSON_AddNumberToObject(coeff_param, "band", band); + cJSON_AddStringToObject(coeff_param, "band_label", band_label); + cJSON_AddStringToObject(coeff_param, "layout", "biquad-manual"); + + cJSON_AddItemToArray(bq_manual_left_params, coeff_param); + } + } + cJSON_AddItemToObject(bq_manual_left, "parameters", bq_manual_left_params); + cJSON_AddItemToArray(groups, bq_manual_left); + + // Biquad Coefficients (Right) - always visible, collapsible, editable only in manual mode + cJSON *bq_manual_right = cJSON_CreateObject(); + cJSON_AddStringToObject(bq_manual_right, "name", "Biquad Coefficients (Right)"); + + const char *right_description; + if (ui_mode == TAS5805M_EQ_UI_MODE_MANUAL) { + right_description = "Direct biquad coefficient control for right channel. Use 'Sync' to read from DAC, 'Apply' to write to DAC"; + } else { + right_description = "Stored manual biquad coefficients (read-only). Use 'Sync' to read current values from DAC"; + } + cJSON_AddStringToObject(bq_manual_right, "description", right_description); + + cJSON_AddStringToObject(bq_manual_right, "layout", "biquad-manual"); + cJSON_AddStringToObject(bq_manual_right, "channel", "right"); + cJSON_AddBoolToObject(bq_manual_right, "collapsible", true); + cJSON_AddBoolToObject(bq_manual_right, "collapsed", ui_mode != TAS5805M_EQ_UI_MODE_MANUAL); + + cJSON *bq_manual_right_params = cJSON_CreateArray(); + for (int band = 0; band < TAS5805M_EQ_BANDS; ++band) { + float b0 = 1.0f, b1 = 0.0f, b2 = 0.0f, a1 = 0.0f, a2 = 0.0f; + + // Load from NVS (stored manual coefficients) + tas5805m_settings_load_biquad_coefficients(TAS5805M_EQ_CHANNELS_RIGHT, band, &b0, &b1, &b2, &a1, &a2); + + char band_label[32]; + snprintf(band_label, sizeof(band_label), "BQ %d", band); + + const char *coeff_names[] = {"b0", "b1", "b2", "a0", "a1", "a2"}; + float coeff_values[6]; + coeff_values[0] = b0; coeff_values[1] = b1; coeff_values[2] = b2; + coeff_values[3] = 1.0f; /* a0 */ + coeff_values[4] = a1; coeff_values[5] = a2; + + bool is_manual_mode = (ui_mode == TAS5805M_EQ_UI_MODE_MANUAL); + + for (int c = 0; c < 6; ++c) { + cJSON *coeff_param = cJSON_CreateObject(); + char key[32]; + snprintf(key, sizeof(key), "bq_r_%d_%s", band, coeff_names[c]); + + cJSON_AddStringToObject(coeff_param, "key", key); + cJSON_AddStringToObject(coeff_param, "name", coeff_names[c]); + cJSON_AddStringToObject(coeff_param, "type", "float"); + cJSON_AddNumberToObject(coeff_param, "min", -16.0); + cJSON_AddNumberToObject(coeff_param, "max", 15.999999); + cJSON_AddNumberToObject(coeff_param, "step", 0.000001); + cJSON_AddNumberToObject(coeff_param, "current", coeff_values[c]); + + // a0 is always readonly (fixed at 1.0)and", band); + cJSON_AddStringToObject(coeff_param, "band_label", band_label); + cJSON_AddStringToObject(coeff_param, "layout", "biquad-manual"); + + cJSON_AddItemToArray(bq_manual_right_params, coeff_param); + } + } + cJSON_AddItemToObject(bq_manual_right, "parameters", bq_manual_right_params); + cJSON_AddItemToArray(groups, bq_manual_right); +#endif + + cJSON_AddItemToObject(root, "groups", groups); + + // Render to string + char *json_str = cJSON_PrintUnformatted(root); + cJSON_Delete(root); + + if (!json_str) { + ESP_LOGE(TAG, "%s: Failed to render JSON", __func__); + return ESP_ERR_NO_MEM; + } + + size_t json_len = strlen(json_str); + if (json_len >= max_len) { + ESP_LOGE(TAG, "%s: JSON too large for buffer (%zu >= %zu)", __func__, json_len, max_len); + cJSON_free(json_str); + return ESP_ERR_INVALID_SIZE; + } + + strncpy(json_out, json_str, max_len - 1); + json_out[max_len - 1] = '\0'; + cJSON_free(json_str); + + ESP_LOGD(TAG, "%s: EQ schema JSON generated", __func__); + return ESP_OK; +} + +/* Apply early settings that are safe to write before audio playback starts. + * This includes: analog gain, DAC mode, modulation mode, mixer mode. + */ +esp_err_t tas5805m_settings_apply_early(void) { + ESP_LOGI(TAG, "%s: Applying early TAS5805M settings from NVS", __func__); + // NOTE: don't call tas5805m_settings_init() here to avoid recursion; caller + // should ensure init() has been called. + + // Apply analog gain (raw register index) + int ana_gain = 0; + if (tas5805m_settings_load_analog_gain(&ana_gain) == ESP_OK) { + uint8_t gain = (uint8_t)ana_gain; + ESP_LOGI(TAG, "%s: Restoring analog gain raw=%d", __func__, gain); + if (tas5805m_set_again(gain) != ESP_OK) { + ESP_LOGW(TAG, "%s: Failed to apply saved analog gain", __func__); + } + } + + // Apply DAC mode + TAS5805M_DAC_MODE dac_mode; + if (tas5805m_settings_load_dac_mode(&dac_mode) == ESP_OK) { + ESP_LOGI(TAG, "%s: Restoring DAC mode=%d", __func__, (int)dac_mode); + if (tas5805m_set_dac_mode(dac_mode) != ESP_OK) { + ESP_LOGW(TAG, "%s: Failed to apply saved DAC mode", __func__); + } + } + + // Apply modulation mode (mode, sw_freq, bd_freq) + TAS5805M_MOD_MODE mod_mode; + TAS5805M_SW_FREQ sw_freq; + TAS5805M_BD_FREQ bd_freq; + if (tas5805m_settings_load_modulation_mode(&mod_mode, &sw_freq, &bd_freq) == ESP_OK) { + ESP_LOGI(TAG, "%s: Restoring modulation mode=%d, sw=%d, bd=%d", __func__, (int)mod_mode, (int)sw_freq, (int)bd_freq); + if (tas5805m_set_modulation_mode(mod_mode, sw_freq, bd_freq) != ESP_OK) { + ESP_LOGW(TAG, "%s: Failed to apply saved modulation mode", __func__); + } + } + + ESP_LOGI(TAG, "%s: Early persisted settings application complete", __func__); + return ESP_OK; +} + +/* Apply settings that require the codec to be running (delayed restore). +* This restores EQ mode, per-band gains, profiles and channel gains. +*/ +esp_err_t tas5805m_settings_apply_delayed(void) { + ESP_LOGI(TAG, "%s: Applying delayed TAS5805M settings from NVS", __func__); + + // Mark I2S clock as ready (codec is running and can be queried) + tas5805m_i2s_clock_ready = true; + + // Apply mixer mode + TAS5805M_MIXER_MODE mixer_mode; + if (tas5805m_settings_load_mixer_mode(&mixer_mode) == ESP_OK) { + ESP_LOGI(TAG, "%s: Restoring mixer mode=%d", __func__, (int)mixer_mode); + if (tas5805m_set_mixer_mode(mixer_mode) != ESP_OK) { + ESP_LOGW(TAG, "%s: Failed to apply saved mixer mode", __func__); + } + } + + TAS5805M_EQ_MODE eq_mode = TAS5805M_EQ_MODE_OFF; + if (tas5805m_settings_load_eq_mode(&eq_mode) == ESP_OK) { + ESP_LOGI(TAG, "%s: Restoring EQ mode=%d", __func__, (int)eq_mode); + #if defined(CONFIG_DAC_TAS5805M_EQ_SUPPORT) + if (tas5805m_set_eq_mode(eq_mode) != ESP_OK) { + ESP_LOGW(TAG, "%s: Failed to apply saved EQ mode", __func__); + } + #else + ESP_LOGW(TAG, "%s: EQ support disabled in build; ignoring persisted EQ mode", __func__); + #endif + } + +#if defined(CONFIG_DAC_TAS5805M_EQ_SUPPORT) + // Restore EQ based on persisted UI selection (eq_ui_mode). If no UI selection + // is persisted, derive a reasonable default from the saved driver EQ mode. + TAS5805M_EQ_UI_MODE ui_mode = TAS5805M_EQ_UI_MODE_OFF; + if (tas5805m_settings_load_eq_ui_mode(&ui_mode) != ESP_OK) { + // derive from saved eq_mode + if (eq_mode == TAS5805M_EQ_MODE_OFF) ui_mode = TAS5805M_EQ_UI_MODE_OFF; + else if (eq_mode == TAS5805M_EQ_MODE_ON) ui_mode = TAS5805M_EQ_UI_MODE_15_BAND; + else ui_mode = TAS5805M_EQ_UI_MODE_15_BAND_BIAMP; + } + + ESP_LOGI(TAG, "%s: Restoring EQ using UI mode %d (%s)", __func__, (int)ui_mode, tas5805m_eq_ui_mode_to_string(ui_mode)); + + if (ui_mode == TAS5805M_EQ_UI_MODE_OFF) { + // nothing to restore + } else if (ui_mode == TAS5805M_EQ_UI_MODE_15_BAND) { + // Apply left-channel per-band gains + for (int band = 0; band < TAS5805M_EQ_BANDS; ++band) { + int gain = 0; + if (tas5805m_settings_load_eq_gain(TAS5805M_EQ_CHANNELS_LEFT, band, &gain) == ESP_OK) { + if (tas5805m_set_eq_gain_channel(TAS5805M_EQ_CHANNELS_LEFT, band, gain) != ESP_OK) { + ESP_LOGW(TAG, "%s: Failed to apply saved EQ gain L band %d", __func__, band); + } else { + ESP_LOGI(TAG, "%s: Restored EQ gain L band %d = %d", __func__, band, gain); + } + } + } + } else if (ui_mode == TAS5805M_EQ_UI_MODE_15_BAND_BIAMP) { + // Apply both channels per-band gains + for (int band = 0; band < TAS5805M_EQ_BANDS; ++band) { + int gain = 0; + if (tas5805m_settings_load_eq_gain(TAS5805M_EQ_CHANNELS_LEFT, band, &gain) == ESP_OK) { + if (tas5805m_set_eq_gain_channel(TAS5805M_EQ_CHANNELS_LEFT, band, gain) != ESP_OK) { + ESP_LOGW(TAG, "%s: Failed to apply saved EQ gain L band %d", __func__, band); + } else { + ESP_LOGI(TAG, "%s: Restored EQ gain L band %d = %d", __func__, band, gain); + } + } + if (tas5805m_settings_load_eq_gain(TAS5805M_EQ_CHANNELS_RIGHT, band, &gain) == ESP_OK) { + if (tas5805m_set_eq_gain_channel(TAS5805M_EQ_CHANNELS_RIGHT, band, gain) != ESP_OK) { + ESP_LOGW(TAG, "%s: Failed to apply saved EQ gain R band %d", __func__, band); + } else { + ESP_LOGI(TAG, "%s: Restored EQ gain R band %d = %d", __func__, band, gain); + } + } + } + } else if (ui_mode == TAS5805M_EQ_UI_MODE_PRESETS) { + // Apply persisted EQ profiles for both channels + TAS5805M_EQ_PROFILE prof = FLAT; + if (tas5805m_settings_load_eq_profile(TAS5805M_EQ_CHANNELS_LEFT, &prof) == ESP_OK) { + if (tas5805m_set_eq_profile_channel(TAS5805M_EQ_CHANNELS_LEFT, prof) != ESP_OK) { + ESP_LOGW(TAG, "%s: Failed to apply saved EQ profile L", __func__); + } else { + ESP_LOGI(TAG, "%s: Restored EQ profile L = %d", __func__, (int)prof); + } + } + if (tas5805m_settings_load_eq_profile(TAS5805M_EQ_CHANNELS_RIGHT, &prof) == ESP_OK) { + if (tas5805m_set_eq_profile_channel(TAS5805M_EQ_CHANNELS_RIGHT, prof) != ESP_OK) { + ESP_LOGW(TAG, "%s: Failed to apply saved EQ profile R", __func__); + } else { + ESP_LOGI(TAG, "%s: Restored EQ profile R = %d", __func__, (int)prof); + } + } + /* Restore per-output channel gain values (if any) */ + int ch_gain = 0; + if (tas5805m_settings_load_channel_gain(TAS5805M_EQ_CHANNELS_LEFT, &ch_gain) == ESP_OK) { + if (tas5805m_set_channel_gain(TAS5805M_EQ_CHANNELS_LEFT, (int8_t)ch_gain) != ESP_OK) { + ESP_LOGW(TAG, "%s: Failed to apply saved Channel Gain L", __func__); + } else { + ESP_LOGI(TAG, "%s: Restored Channel Gain L = %d dB", __func__, ch_gain); + } + } + if (tas5805m_settings_load_channel_gain(TAS5805M_EQ_CHANNELS_RIGHT, &ch_gain) == ESP_OK) { + if (tas5805m_set_channel_gain(TAS5805M_EQ_CHANNELS_RIGHT, (int8_t)ch_gain) != ESP_OK) { + ESP_LOGW(TAG, "%s: Failed to apply saved Channel Gain R", __func__); + } else { + ESP_LOGI(TAG, "%s: Restored Channel Gain R = %d dB", __func__, ch_gain); + } + } + } else if (ui_mode == TAS5805M_EQ_UI_MODE_MANUAL) { + // Apply persisted manual biquad coefficients for both channels + ESP_LOGI(TAG, "%s: Restoring manual biquad coefficients", __func__); + for (int band = 0; band < TAS5805M_EQ_BANDS; ++band) { + float b0, b1, b2, a1, a2; + // Left channel + if (tas5805m_settings_load_biquad_coefficients(TAS5805M_EQ_CHANNELS_LEFT, band, + &b0, &b1, &b2, &a1, &a2) == ESP_OK) { + if (tas5805m_write_biquad_coefficients(TAS5805M_EQ_CHANNELS_LEFT, band, + b0, b1, b2, a1, a2) != ESP_OK) { + ESP_LOGW(TAG, "%s: Failed to apply saved manual BQ L band %d", __func__, band); + } else { + ESP_LOGD(TAG, "%s: Restored manual BQ L band %d", __func__, band); + } + } + // Right channel + if (tas5805m_settings_load_biquad_coefficients(TAS5805M_EQ_CHANNELS_RIGHT, band, + &b0, &b1, &b2, &a1, &a2) == ESP_OK) { + if (tas5805m_write_biquad_coefficients(TAS5805M_EQ_CHANNELS_RIGHT, band, + b0, b1, b2, a1, a2) != ESP_OK) { + ESP_LOGW(TAG, "%s: Failed to apply saved manual BQ R band %d", __func__, band); + } else { + ESP_LOGD(TAG, "%s: Restored manual BQ R band %d", __func__, band); + } + } + } + } +#endif + + ESP_LOGI(TAG, "%s: Delayed persisted settings application complete", __func__); + return ESP_OK; +} + +/** + * Get DAC-only settings as JSON string + */ +esp_err_t tas5805m_settings_get_dac_json(char *json_out, size_t max_len) { + ESP_LOGD(TAG, "%s: max_len=%zu", __func__, max_len); + + if (!json_out || max_len == 0) { + return ESP_ERR_INVALID_ARG; + } + + // Get current state + TAS5805_STATE dac_state; + esp_err_t err = tas5805m_get_state(&dac_state); + if (err != ESP_OK) { + ESP_LOGE(TAG, "%s: Failed to get DAC state: %s", __func__, esp_err_to_name(err)); + return err; + } + + // Get current digital volume (raw value) + uint8_t digital_volume; + if (tas5805m_get_digital_volume(&digital_volume) != ESP_OK) { + digital_volume = TAS5805M_VOLUME_DIGITAL_DEFAULT; + } + + // Get current analog gain (raw value) + uint8_t analog_gain; + if (tas5805m_get_again(&analog_gain) != ESP_OK) { + analog_gain = 0; + } + + // Get current DAC mode + TAS5805M_DAC_MODE dac_mode; + if (tas5805m_get_dac_mode(&dac_mode) != ESP_OK) { + dac_mode = TAS5805M_DAC_MODE_BTL; + } + + // Get current modulation mode + TAS5805M_MOD_MODE mod_mode; + TAS5805M_SW_FREQ sw_freq; + TAS5805M_BD_FREQ bd_freq; + if (tas5805m_get_modulation_mode(&mod_mode, &sw_freq, &bd_freq) != ESP_OK) { + mod_mode = MOD_MODE_BD; + sw_freq = SW_FREQ_768K; + bd_freq = SW_FREQ_80K; + } + + // Build JSON + cJSON *root = cJSON_CreateObject(); + if (!root) { + ESP_LOGE(TAG, "%s: Failed to create JSON root", __func__); + return ESP_ERR_NO_MEM; + } + + // Add DAC-only settings + cJSON_AddNumberToObject(root, "state", (int)dac_state.state); + cJSON_AddNumberToObject(root, "digital_volume", digital_volume); + cJSON_AddNumberToObject(root, "analog_gain", analog_gain); + cJSON_AddNumberToObject(root, "dac_mode", (int)dac_mode); + cJSON_AddNumberToObject(root, "mod_mode", (int)mod_mode); + cJSON_AddNumberToObject(root, "sw_freq", (int)sw_freq); + cJSON_AddNumberToObject(root, "bd_freq", (int)bd_freq); + cJSON_AddNumberToObject(root, "mixer_mode", (int)dac_state.mixer_mode); + + // Render to string + char *json_str = cJSON_PrintUnformatted(root); + cJSON_Delete(root); + + if (!json_str) { + ESP_LOGE(TAG, "%s: Failed to render JSON", __func__); + return ESP_ERR_NO_MEM; + } + + size_t json_len = strlen(json_str); + if (json_len >= max_len) { + ESP_LOGE(TAG, "%s: JSON too large for buffer (%zu >= %zu)", __func__, json_len, max_len); + cJSON_free(json_str); + return ESP_ERR_INVALID_SIZE; + } + + strncpy(json_out, json_str, max_len - 1); + json_out[max_len - 1] = '\0'; + cJSON_free(json_str); + + ESP_LOGD(TAG, "%s: DAC JSON generated: %s", __func__, json_out); + return ESP_OK; +} + +/** + * Get EQ-only settings as JSON string + */ +esp_err_t tas5805m_settings_get_eq_json(char *json_out, size_t max_len) { + ESP_LOGD(TAG, "%s: max_len=%zu", __func__, max_len); + + if (!json_out || max_len == 0) { + return ESP_ERR_INVALID_ARG; + } + + cJSON *root = cJSON_CreateObject(); + if (!root) { + ESP_LOGE(TAG, "%s: Failed to create JSON root", __func__); + return ESP_ERR_NO_MEM; + } + +#if defined(CONFIG_DAC_TAS5805M_EQ_SUPPORT) + // Get current EQ mode + TAS5805M_EQ_MODE eq_mode_val = TAS5805M_EQ_MODE_OFF; + if (tas5805m_get_eq_mode(&eq_mode_val) != ESP_OK) { + eq_mode_val = TAS5805M_EQ_MODE_OFF; + } + cJSON_AddNumberToObject(root, "eq_mode", (int)eq_mode_val); + + // Get current EQ UI mode + TAS5805M_EQ_UI_MODE ui_mode = TAS5805M_EQ_UI_MODE_OFF; + tas5805m_settings_load_eq_ui_mode(&ui_mode); + cJSON_AddNumberToObject(root, "eq_ui_mode", (int)ui_mode); + + // Get EQ profiles + TAS5805M_EQ_PROFILE prof_l = FLAT, prof_r = FLAT; + tas5805m_settings_load_eq_profile(TAS5805M_EQ_CHANNELS_LEFT, &prof_l); + tas5805m_settings_load_eq_profile(TAS5805M_EQ_CHANNELS_RIGHT, &prof_r); + cJSON_AddNumberToObject(root, "eq_profile_left", (int)prof_l); + cJSON_AddNumberToObject(root, "eq_profile_right", (int)prof_r); + + // Get channel gains + int ch_gain_l = 0, ch_gain_r = 0; + tas5805m_settings_load_channel_gain(TAS5805M_EQ_CHANNELS_LEFT, &ch_gain_l); + tas5805m_settings_load_channel_gain(TAS5805M_EQ_CHANNELS_RIGHT, &ch_gain_r); + cJSON_AddNumberToObject(root, "channel_gain_left", ch_gain_l); + cJSON_AddNumberToObject(root, "channel_gain_right", ch_gain_r); + + // Get per-band gains + for (int band = 0; band < TAS5805M_EQ_BANDS; ++band) { + int gain_l = 0, gain_r = 0; + tas5805m_settings_load_eq_gain(TAS5805M_EQ_CHANNELS_LEFT, band, &gain_l); + tas5805m_settings_load_eq_gain(TAS5805M_EQ_CHANNELS_RIGHT, band, &gain_r); + + char key[32]; + snprintf(key, sizeof(key), "eq_gain_l_%d", band); + cJSON_AddNumberToObject(root, key, gain_l); + snprintf(key, sizeof(key), "eq_gain_r_%d", band); + cJSON_AddNumberToObject(root, key, gain_r); + } + + // Get manual biquad coefficients if in manual mode + if (ui_mode == TAS5805M_EQ_UI_MODE_MANUAL) { + for (int band = 0; band < TAS5805M_EQ_BANDS; ++band) { + float b0, b1, b2, a1, a2; + char key[32]; + + // Left channel + if (tas5805m_settings_load_biquad_coefficients(TAS5805M_EQ_CHANNELS_LEFT, band, + &b0, &b1, &b2, &a1, &a2) == ESP_OK) { + snprintf(key, sizeof(key), "bq_l_%d_b0", band); + cJSON_AddNumberToObject(root, key, b0); + snprintf(key, sizeof(key), "bq_l_%d_b1", band); + cJSON_AddNumberToObject(root, key, b1); + snprintf(key, sizeof(key), "bq_l_%d_b2", band); + cJSON_AddNumberToObject(root, key, b2); + snprintf(key, sizeof(key), "bq_l_%d_a1", band); + cJSON_AddNumberToObject(root, key, a1); + snprintf(key, sizeof(key), "bq_l_%d_a2", band); + cJSON_AddNumberToObject(root, key, a2); + } + + // Right channel + if (tas5805m_settings_load_biquad_coefficients(TAS5805M_EQ_CHANNELS_RIGHT, band, + &b0, &b1, &b2, &a1, &a2) == ESP_OK) { + snprintf(key, sizeof(key), "bq_r_%d_b0", band); + cJSON_AddNumberToObject(root, key, b0); + snprintf(key, sizeof(key), "bq_r_%d_b1", band); + cJSON_AddNumberToObject(root, key, b1); + snprintf(key, sizeof(key), "bq_r_%d_b2", band); + cJSON_AddNumberToObject(root, key, b2); + snprintf(key, sizeof(key), "bq_r_%d_a1", band); + cJSON_AddNumberToObject(root, key, a1); + snprintf(key, sizeof(key), "bq_r_%d_a2", band); + cJSON_AddNumberToObject(root, key, a2); + } + } + } +#else + // EQ support disabled + cJSON_AddNumberToObject(root, "eq_mode", 0); + cJSON_AddNumberToObject(root, "eq_ui_mode", 0); +#endif + + // Render to string + char *json_str = cJSON_PrintUnformatted(root); + cJSON_Delete(root); - ESP_LOGI(TAG, "%s: Restoring EQ using UI mode %d (%s)", __func__, (int)ui_mode, tas5805m_eq_ui_mode_to_string(ui_mode)); + if (!json_str) { + ESP_LOGE(TAG, "%s: Failed to render JSON", __func__); + return ESP_ERR_NO_MEM; + } - if (ui_mode == TAS5805M_EQ_UI_MODE_OFF) { - // nothing to restore - } else if (ui_mode == TAS5805M_EQ_UI_MODE_15_BAND) { - // Apply left-channel per-band gains - for (int band = 0; band < TAS5805M_EQ_BANDS; ++band) { - int gain = 0; - if (tas5805m_settings_load_eq_gain(TAS5805M_EQ_CHANNELS_LEFT, band, &gain) == ESP_OK) { - if (tas5805m_set_eq_gain_channel(TAS5805M_EQ_CHANNELS_LEFT, band, gain) != ESP_OK) { - ESP_LOGW(TAG, "%s: Failed to apply saved EQ gain L band %d", __func__, band); - } else { - ESP_LOGI(TAG, "%s: Restored EQ gain L band %d = %d", __func__, band, gain); - } - } + size_t json_len = strlen(json_str); + if (json_len >= max_len) { + ESP_LOGE(TAG, "%s: JSON too large for buffer (%zu >= %zu)", __func__, json_len, max_len); + cJSON_free(json_str); + return ESP_ERR_INVALID_SIZE; + } + + strncpy(json_out, json_str, max_len - 1); + json_out[max_len - 1] = '\0'; + cJSON_free(json_str); + + ESP_LOGD(TAG, "%s: EQ JSON generated: %s", __func__, json_out); + return ESP_OK; +} + +/** + * Update DAC-only settings from JSON (excludes EQ settings) + * Handles: state, digital_volume, analog_gain, dac_mode, modulation_mode, mixer_mode + */ +esp_err_t tas5805m_settings_set_dac_from_json(const char *json_in) { + ESP_LOGV(TAG, "%s: json=%s", __func__, json_in); + + if (!json_in) return ESP_ERR_INVALID_ARG; + + cJSON *root = cJSON_Parse(json_in); + if (!root) { + ESP_LOGE(TAG, "%s: Failed to parse JSON", __func__); + return ESP_ERR_INVALID_ARG; + } + + esp_err_t err = ESP_OK; + + // Update state if present + cJSON *state_item = cJSON_GetObjectItem(root, "state"); + if (cJSON_IsNumber(state_item)) { + TAS5805M_CTRL_STATE new_state = (TAS5805M_CTRL_STATE)state_item->valueint; + + // Apply to DAC (do NOT persist state - state is managed by application) + err = tas5805m_set_state(new_state); + if (err == ESP_OK) { + ESP_LOGI(TAG, "%s: Applied state %d (%s) to DAC (not persisted)", __func__, + (int)new_state, tas5805m_state_to_string(new_state)); + } else { + ESP_LOGE(TAG, "%s: Failed to apply state to DAC: %s", + __func__, esp_err_to_name(err)); } - } else if (ui_mode == TAS5805M_EQ_UI_MODE_15_BAND_BIAMP) { - // Apply both channels per-band gains - for (int band = 0; band < TAS5805M_EQ_BANDS; ++band) { - int gain = 0; - if (tas5805m_settings_load_eq_gain(TAS5805M_EQ_CHANNELS_LEFT, band, &gain) == ESP_OK) { - if (tas5805m_set_eq_gain_channel(TAS5805M_EQ_CHANNELS_LEFT, band, gain) != ESP_OK) { - ESP_LOGW(TAG, "%s: Failed to apply saved EQ gain L band %d", __func__, band); - } else { - ESP_LOGI(TAG, "%s: Restored EQ gain L band %d = %d", __func__, band, gain); - } + } + + // Update digital volume if present (expects raw uint8_t value) + cJSON *dig_vol_item = cJSON_GetObjectItem(root, "digital_volume"); + if (cJSON_IsNumber(dig_vol_item)) { + uint8_t vol = (uint8_t)dig_vol_item->valueint; + + // Apply to DAC (do NOT persist digital volume - managed by application) + err = tas5805m_set_digital_volume(vol); + if (err == ESP_OK) { + ESP_LOGI(TAG, "%s: Applied digital volume %d to DAC (not persisted)", __func__, vol); + } else { + ESP_LOGE(TAG, "%s: Failed to apply digital volume: %s", + __func__, esp_err_to_name(err)); + } + } + + // Update analog gain if present (expects uint8_t 0-31) + cJSON *ana_gain_item = cJSON_GetObjectItem(root, "analog_gain"); + if (cJSON_IsNumber(ana_gain_item)) { + uint8_t gain = (uint8_t)ana_gain_item->valueint; + + err = tas5805m_set_again(gain); + if (err == ESP_OK) { + ESP_LOGI(TAG, "%s: Applied analog gain %d to DAC", __func__, gain); + // Note: We're saving the raw value, conversion to half_db would need lookup table + tas5805m_settings_save_analog_gain((int)gain); + } else { + ESP_LOGE(TAG, "%s: Failed to apply analog gain: %s", + __func__, esp_err_to_name(err)); + } + } + + // Update DAC mode if present + cJSON *dac_mode_item = cJSON_GetObjectItem(root, "dac_mode"); + if (cJSON_IsNumber(dac_mode_item)) { + TAS5805M_DAC_MODE mode = (TAS5805M_DAC_MODE)dac_mode_item->valueint; + + err = tas5805m_set_dac_mode(mode); + if (err == ESP_OK) { + ESP_LOGI(TAG, "%s: Applied DAC mode %d (%s) to DAC", __func__, + (int)mode, mode == TAS5805M_DAC_MODE_BTL ? "BTL" : "PBTL"); + tas5805m_settings_save_dac_mode(mode); + } else { + ESP_LOGE(TAG, "%s: Failed to apply DAC mode: %s", + __func__, esp_err_to_name(err)); + } + } + + // Update modulation mode if any parameter provided. Support partial updates + // (UI typically sends only the changed parameter). We'll query current + // modulation settings from the driver and apply a merged update. + cJSON *mod_mode_item = cJSON_GetObjectItem(root, "modulation_mode"); + cJSON *sw_freq_item = cJSON_GetObjectItem(root, "sw_freq"); + cJSON *bd_freq_item = cJSON_GetObjectItem(root, "bd_freq"); + + if (cJSON_IsNumber(mod_mode_item) || cJSON_IsNumber(sw_freq_item) || cJSON_IsNumber(bd_freq_item)) { + TAS5805M_MOD_MODE cur_mod = MOD_MODE_BD; + TAS5805M_SW_FREQ cur_sw = SW_FREQ_768K; + TAS5805M_BD_FREQ cur_bd = SW_FREQ_80K; + + // Read current values where possible + if (tas5805m_get_modulation_mode(&cur_mod, &cur_sw, &cur_bd) != ESP_OK) { + ESP_LOGW(TAG, "%s: Failed to read current modulation mode, using defaults", __func__); + } + + // Override with provided values + if (cJSON_IsNumber(mod_mode_item)) { + cur_mod = (TAS5805M_MOD_MODE)mod_mode_item->valueint; + } + if (cJSON_IsNumber(sw_freq_item)) { + cur_sw = (TAS5805M_SW_FREQ)sw_freq_item->valueint; + } + if (cJSON_IsNumber(bd_freq_item)) { + cur_bd = (TAS5805M_BD_FREQ)bd_freq_item->valueint; + } + + // Apply merged settings + err = tas5805m_set_modulation_mode(cur_mod, cur_sw, cur_bd); + if (err == ESP_OK) { + ESP_LOGI(TAG, "%s: Applied modulation mode: mode=%d, freq=%d, bd_freq=%d", + __func__, (int)cur_mod, (int)cur_sw, (int)cur_bd); + tas5805m_settings_save_modulation_mode(cur_mod, cur_sw, cur_bd); + } else { + ESP_LOGE(TAG, "%s: Failed to apply modulation mode: %s", + __func__, esp_err_to_name(err)); + } + } + + // Update mixer mode if present + cJSON *mixer_mode_item = cJSON_GetObjectItem(root, "mixer_mode"); + if (cJSON_IsNumber(mixer_mode_item)) { + TAS5805M_MIXER_MODE mode = (TAS5805M_MIXER_MODE)mixer_mode_item->valueint; + err = tas5805m_set_mixer_mode(mode); + if (err == ESP_OK) { + ESP_LOGI(TAG, "%s: Applied mixer mode %d to DAC", __func__, (int)mode); + tas5805m_settings_save_mixer_mode(mode); + } else { + ESP_LOGE(TAG, "%s: Failed to apply mixer mode: %s", __func__, esp_err_to_name(err)); + } + } + + cJSON_Delete(root); + return err; +} + +/** + * Update EQ settings from JSON + */ +esp_err_t tas5805m_settings_set_eq_from_json(const char *json_in) { + if (!json_in) { + return ESP_ERR_INVALID_ARG; + } + + ESP_LOGD(TAG, "%s: Parsing EQ JSON: %s", __func__, json_in); + + cJSON *root = cJSON_Parse(json_in); + if (!root) { + ESP_LOGE(TAG, "%s: Failed to parse JSON", __func__); + return ESP_ERR_INVALID_ARG; + } + +#if defined(CONFIG_DAC_TAS5805M_EQ_SUPPORT) + bool apply_manual_bq = false; + bool sync_manual_bq = false; + + cJSON *apply_flag = cJSON_GetObjectItem(root, "apply_manual_bq"); + if (apply_flag && cJSON_IsBool(apply_flag)) { + apply_manual_bq = cJSON_IsTrue(apply_flag); + } + + cJSON *sync_flag = cJSON_GetObjectItem(root, "sync_manual_bq"); + if (sync_flag && cJSON_IsBool(sync_flag)) { + sync_manual_bq = cJSON_IsTrue(sync_flag); + } + + // Process EQ settings + cJSON *item = NULL; + cJSON_ArrayForEach(item, root) { + const char *key = item->string; + + if (strcmp(key, "eq_ui_mode") == 0 && cJSON_IsNumber(item)) { + TAS5805M_EQ_UI_MODE ui_mode = (TAS5805M_EQ_UI_MODE)item->valueint; + ESP_LOGI(TAG, "%s: Setting EQ UI mode to %d", __func__, (int)ui_mode); + tas5805m_settings_save_eq_ui_mode(ui_mode); + + // Convert UI mode to driver mode and apply + TAS5805M_EQ_MODE eq_mode = TAS5805M_EQ_MODE_OFF; + if (ui_mode == TAS5805M_EQ_UI_MODE_OFF) { + eq_mode = TAS5805M_EQ_MODE_OFF; + } else if (ui_mode == TAS5805M_EQ_UI_MODE_15_BAND) { + // 15-band (left channel only) uses standard EQ mode + eq_mode = TAS5805M_EQ_MODE_ON; + } else { + // 15-band biamp, presets, and manual all use BIAMP mode + eq_mode = TAS5805M_EQ_MODE_BIAMP; } - if (tas5805m_settings_load_eq_gain(TAS5805M_EQ_CHANNELS_RIGHT, band, &gain) == ESP_OK) { - if (tas5805m_set_eq_gain_channel(TAS5805M_EQ_CHANNELS_RIGHT, band, gain) != ESP_OK) { - ESP_LOGW(TAG, "%s: Failed to apply saved EQ gain R band %d", __func__, band); - } else { - ESP_LOGI(TAG, "%s: Restored EQ gain R band %d = %d", __func__, band, gain); + tas5805m_set_eq_mode(eq_mode); + tas5805m_settings_save_eq_mode(eq_mode); + + // Apply saved state for the new mode + if (ui_mode == TAS5805M_EQ_UI_MODE_15_BAND) { + // Apply saved per-band gains for left channel + ESP_LOGI(TAG, "%s: Applying saved 15-band EQ gains (left channel)", __func__); + for (int band = 0; band < TAS5805M_EQ_BANDS; ++band) { + int gain = 0; + if (tas5805m_settings_load_eq_gain(TAS5805M_EQ_CHANNELS_LEFT, band, &gain) == ESP_OK) { + tas5805m_set_eq_gain_channel(TAS5805M_EQ_CHANNELS_LEFT, band, gain); + } + } + } else if (ui_mode == TAS5805M_EQ_UI_MODE_15_BAND_BIAMP) { + // Apply saved per-band gains for both channels + ESP_LOGI(TAG, "%s: Applying saved 15-band biamp EQ gains", __func__); + for (int band = 0; band < TAS5805M_EQ_BANDS; ++band) { + int gain = 0; + if (tas5805m_settings_load_eq_gain(TAS5805M_EQ_CHANNELS_LEFT, band, &gain) == ESP_OK) { + tas5805m_set_eq_gain_channel(TAS5805M_EQ_CHANNELS_LEFT, band, gain); + } + if (tas5805m_settings_load_eq_gain(TAS5805M_EQ_CHANNELS_RIGHT, band, &gain) == ESP_OK) { + tas5805m_set_eq_gain_channel(TAS5805M_EQ_CHANNELS_RIGHT, band, gain); + } + } + } else if (ui_mode == TAS5805M_EQ_UI_MODE_PRESETS) { + // Apply saved preset profiles + TAS5805M_EQ_PROFILE prof_l = FLAT; + TAS5805M_EQ_PROFILE prof_r = FLAT; + if (tas5805m_settings_load_eq_profile(TAS5805M_EQ_CHANNELS_LEFT, &prof_l) == ESP_OK) { + ESP_LOGI(TAG, "%s: Applying saved preset left=%d", __func__, (int)prof_l); + tas5805m_set_eq_profile_channel(TAS5805M_EQ_CHANNELS_LEFT, prof_l); + } + if (tas5805m_settings_load_eq_profile(TAS5805M_EQ_CHANNELS_RIGHT, &prof_r) == ESP_OK) { + ESP_LOGI(TAG, "%s: Applying saved preset right=%d", __func__, (int)prof_r); + tas5805m_set_eq_profile_channel(TAS5805M_EQ_CHANNELS_RIGHT, prof_r); + } + } else if (ui_mode == TAS5805M_EQ_UI_MODE_MANUAL) { + // Apply saved manual biquad coefficients + ESP_LOGI(TAG, "%s: Applying saved manual biquad coefficients", __func__); + for (int band = 0; band < TAS5805M_EQ_BANDS; ++band) { + float b0, b1, b2, a1, a2; + if (tas5805m_settings_load_biquad_coefficients(TAS5805M_EQ_CHANNELS_LEFT, band, + &b0, &b1, &b2, &a1, &a2) == ESP_OK) { + tas5805m_write_biquad_coefficients(TAS5805M_EQ_CHANNELS_LEFT, band, b0, b1, b2, a1, a2); + } + if (tas5805m_settings_load_biquad_coefficients(TAS5805M_EQ_CHANNELS_RIGHT, band, + &b0, &b1, &b2, &a1, &a2) == ESP_OK) { + tas5805m_write_biquad_coefficients(TAS5805M_EQ_CHANNELS_RIGHT, band, b0, b1, b2, a1, a2); + } + } + + // Sync from device to NVS when switching to manual mode + // This captures the current DAC state as the starting point for manual editing + ESP_LOGI(TAG, "%s: Syncing current DAC coefficients to NVS for manual mode", __func__); + for (int band = 0; band < TAS5805M_EQ_BANDS; ++band) { + float b0, b1, b2, a1, a2; + if (tas5805m_read_biquad_coefficients(TAS5805M_EQ_CHANNELS_LEFT, band, + &b0, &b1, &b2, &a1, &a2) == ESP_OK) { + tas5805m_settings_save_biquad_coefficients(TAS5805M_EQ_CHANNELS_LEFT, band, b0, b1, b2, a1, a2); + } + if (tas5805m_read_biquad_coefficients(TAS5805M_EQ_CHANNELS_RIGHT, band, + &b0, &b1, &b2, &a1, &a2) == ESP_OK) { + tas5805m_settings_save_biquad_coefficients(TAS5805M_EQ_CHANNELS_RIGHT, band, b0, b1, b2, a1, a2); + } } } } - } else if (ui_mode == TAS5805M_EQ_UI_MODE_PRESETS) { - // Apply persisted EQ profiles for both channels - TAS5805M_EQ_PROFILE prof = FLAT; - if (tas5805m_settings_load_eq_profile(TAS5805M_EQ_CHANNELS_LEFT, &prof) == ESP_OK) { - if (tas5805m_set_eq_profile_channel(TAS5805M_EQ_CHANNELS_LEFT, prof) != ESP_OK) { - ESP_LOGW(TAG, "%s: Failed to apply saved EQ profile L", __func__); - } else { - ESP_LOGI(TAG, "%s: Restored EQ profile L = %d", __func__, (int)prof); + else if (strcmp(key, "eq_profile_l") == 0 && cJSON_IsNumber(item)) { + TAS5805M_EQ_PROFILE prof = (TAS5805M_EQ_PROFILE)item->valueint; + ESP_LOGI(TAG, "%s: Setting EQ profile left to %d", __func__, (int)prof); + tas5805m_set_eq_profile_channel(TAS5805M_EQ_CHANNELS_LEFT, prof); + tas5805m_settings_save_eq_profile(TAS5805M_EQ_CHANNELS_LEFT, prof); + } + else if (strcmp(key, "eq_profile_r") == 0 && cJSON_IsNumber(item)) { + TAS5805M_EQ_PROFILE prof = (TAS5805M_EQ_PROFILE)item->valueint; + ESP_LOGI(TAG, "%s: Setting EQ profile right to %d", __func__, (int)prof); + tas5805m_set_eq_profile_channel(TAS5805M_EQ_CHANNELS_RIGHT, prof); + tas5805m_settings_save_eq_profile(TAS5805M_EQ_CHANNELS_RIGHT, prof); + } + else if (strcmp(key, "channel_gain_l") == 0 && cJSON_IsNumber(item)) { + int8_t gain = (int8_t)item->valueint; + ESP_LOGI(TAG, "%s: Setting channel gain left to %d", __func__, gain); + tas5805m_set_channel_gain(TAS5805M_EQ_CHANNELS_LEFT, gain); + tas5805m_settings_save_channel_gain(TAS5805M_EQ_CHANNELS_LEFT, gain); + } + else if (strcmp(key, "channel_gain_r") == 0 && cJSON_IsNumber(item)) { + int8_t gain = (int8_t)item->valueint; + ESP_LOGI(TAG, "%s: Setting channel gain right to %d", __func__, gain); + tas5805m_set_channel_gain(TAS5805M_EQ_CHANNELS_RIGHT, gain); + tas5805m_settings_save_channel_gain(TAS5805M_EQ_CHANNELS_RIGHT, gain); + } + else if (strncmp(key, "eq_gain_l_", 10) == 0 && cJSON_IsNumber(item)) { + int band = atoi(key + 10); + if (band >= 0 && band < TAS5805M_EQ_BANDS) { + int gain = item->valueint; + ESP_LOGI(TAG, "%s: Setting EQ gain left band %d to %d", __func__, band, gain); + tas5805m_set_eq_gain_channel(TAS5805M_EQ_CHANNELS_LEFT, band, gain); + tas5805m_settings_save_eq_gain(TAS5805M_EQ_CHANNELS_LEFT, band, gain); } } - if (tas5805m_settings_load_eq_profile(TAS5805M_EQ_CHANNELS_RIGHT, &prof) == ESP_OK) { - if (tas5805m_set_eq_profile_channel(TAS5805M_EQ_CHANNELS_RIGHT, prof) != ESP_OK) { - ESP_LOGW(TAG, "%s: Failed to apply saved EQ profile R", __func__); - } else { - ESP_LOGI(TAG, "%s: Restored EQ profile R = %d", __func__, (int)prof); + else if (strncmp(key, "eq_gain_r_", 10) == 0 && cJSON_IsNumber(item)) { + int band = atoi(key + 10); + if (band >= 0 && band < TAS5805M_EQ_BANDS) { + int gain = item->valueint; + ESP_LOGI(TAG, "%s: Setting EQ gain right band %d to %d", __func__, band, gain); + tas5805m_set_eq_gain_channel(TAS5805M_EQ_CHANNELS_RIGHT, band, gain); + tas5805m_settings_save_eq_gain(TAS5805M_EQ_CHANNELS_RIGHT, band, gain); } } - /* Restore per-output channel gain values (if any) */ - int ch_gain = 0; - if (tas5805m_settings_load_channel_gain(TAS5805M_EQ_CHANNELS_LEFT, &ch_gain) == ESP_OK) { - if (tas5805m_set_channel_gain(TAS5805M_EQ_CHANNELS_LEFT, (int8_t)ch_gain) != ESP_OK) { - ESP_LOGW(TAG, "%s: Failed to apply saved Channel Gain L", __func__); - } else { - ESP_LOGI(TAG, "%s: Restored Channel Gain L = %d dB", __func__, ch_gain); + else if (strncmp(key, "bq_", 3) == 0 && cJSON_IsNumber(item)) { + // Biquad coefficient - save to NVS but don't apply yet + // Format: bq___ + char ch = key[3]; + int band = atoi(key + 5); + const char *coeff = strrchr(key, '_') + 1; + + if ((ch == 'l' || ch == 'r') && band >= 0 && band < TAS5805M_EQ_BANDS) { + TAS5805M_EQ_CHANNELS channel = (ch == 'l') ? TAS5805M_EQ_CHANNELS_LEFT : TAS5805M_EQ_CHANNELS_RIGHT; + float value = (float)item->valuedouble; + + // Load existing coefficients + float b0 = 1.0f, b1 = 0.0f, b2 = 0.0f, a1 = 0.0f, a2 = 0.0f; + tas5805m_settings_load_biquad_coefficients(channel, band, &b0, &b1, &b2, &a1, &a2); + + // Update specific coefficient + if (strcmp(coeff, "b0") == 0) b0 = value; + else if (strcmp(coeff, "b1") == 0) b1 = value; + else if (strcmp(coeff, "b2") == 0) b2 = value; + else if (strcmp(coeff, "a1") == 0) a1 = value; + else if (strcmp(coeff, "a2") == 0) a2 = value; + + // Save back to NVS + tas5805m_settings_save_biquad_coefficients(channel, band, b0, b1, b2, a1, a2); + ESP_LOGD(TAG, "%s: Saved biquad %s band %d %s = %.6f", __func__, + ch == 'l' ? "left" : "right", band, coeff, value); } } - if (tas5805m_settings_load_channel_gain(TAS5805M_EQ_CHANNELS_RIGHT, &ch_gain) == ESP_OK) { - if (tas5805m_set_channel_gain(TAS5805M_EQ_CHANNELS_RIGHT, (int8_t)ch_gain) != ESP_OK) { - ESP_LOGW(TAG, "%s: Failed to apply saved Channel Gain R", __func__); - } else { - ESP_LOGI(TAG, "%s: Restored Channel Gain R = %d dB", __func__, ch_gain); + } + + // Apply manual biquad coefficients if requested + if (apply_manual_bq) { + ESP_LOGI(TAG, "%s: Applying manual biquad coefficients to hardware", __func__); + for (int band = 0; band < TAS5805M_EQ_BANDS; ++band) { + float b0, b1, b2, a1, a2; + + // Left channel + if (tas5805m_settings_load_biquad_coefficients(TAS5805M_EQ_CHANNELS_LEFT, band, + &b0, &b1, &b2, &a1, &a2) == ESP_OK) { + tas5805m_write_biquad_coefficients(TAS5805M_EQ_CHANNELS_LEFT, band, b0, b1, b2, a1, a2); + } + + // Right channel + if (tas5805m_settings_load_biquad_coefficients(TAS5805M_EQ_CHANNELS_RIGHT, band, + &b0, &b1, &b2, &a1, &a2) == ESP_OK) { + tas5805m_write_biquad_coefficients(TAS5805M_EQ_CHANNELS_RIGHT, band, b0, b1, b2, a1, a2); + } + } + } + + // Sync manual biquad coefficients from hardware if requested + if (sync_manual_bq) { + ESP_LOGI(TAG, "%s: Syncing biquad coefficients from hardware to NVS", __func__); + for (int band = 0; band < TAS5805M_EQ_BANDS; ++band) { + float b0, b1, b2, a1, a2; + + // Left channel + if (tas5805m_read_biquad_coefficients(TAS5805M_EQ_CHANNELS_LEFT, band, + &b0, &b1, &b2, &a1, &a2) == ESP_OK) { + tas5805m_settings_save_biquad_coefficients(TAS5805M_EQ_CHANNELS_LEFT, band, b0, b1, b2, a1, a2); + ESP_LOGD(TAG, "%s: Synced L band %d: b0=%.6f b1=%.6f b2=%.6f a1=%.6f a2=%.6f", + __func__, band, b0, b1, b2, a1, a2); + } + + // Right channel + if (tas5805m_read_biquad_coefficients(TAS5805M_EQ_CHANNELS_RIGHT, band, + &b0, &b1, &b2, &a1, &a2) == ESP_OK) { + tas5805m_settings_save_biquad_coefficients(TAS5805M_EQ_CHANNELS_RIGHT, band, b0, b1, b2, a1, a2); + ESP_LOGD(TAG, "%s: Synced R band %d: b0=%.6f b1=%.6f b2=%.6f a1=%.6f a2=%.6f", + __func__, band, b0, b1, b2, a1, a2); } } } #endif - ESP_LOGI(TAG, "%s: Delayed persisted settings application complete", __func__); + cJSON_Delete(root); return ESP_OK; } diff --git a/components/ui_http_server/CMakeLists.txt b/components/ui_http_server/CMakeLists.txt index 8a41d1fc..ca2b173a 100644 --- a/components/ui_http_server/CMakeLists.txt +++ b/components/ui_http_server/CMakeLists.txt @@ -4,8 +4,10 @@ idf_component_register(SRCS "ui_http_server.c" PRIV_REQUIRES custom_board EMBED_TXTFILES html/index.html html/index.js + html/settings-ui.js html/styles.css html/general-settings.html html/dsp-settings.html html/dac-settings.html + html/eq-settings.html EMBED_FILES html/favicon.ico) diff --git a/components/ui_http_server/html/dac-settings.html b/components/ui_http_server/html/dac-settings.html index 312bbae4..28fc7475 100644 --- a/components/ui_http_server/html/dac-settings.html +++ b/components/ui_http_server/html/dac-settings.html @@ -344,9 +344,7 @@

TAS5805M DAC Settings

2s
-
- -
+
@@ -535,83 +533,11 @@

TAS5805M DAC Settings

container.innerHTML = ''; - // Determine EQ UI mode (used to show/hide EQ controls) - let uiMode = null; - // Prefer value from currentSettings - if (currentSettings && typeof currentSettings.eq_ui_mode !== 'undefined') { - uiMode = currentSettings.eq_ui_mode; - } else { - // Fallback: check schema param - for (const g of schema.groups) { - if (!g.parameters) continue; - for (const p of g.parameters) { - if (p.key === 'eq_ui_mode') { - uiMode = p.current; - break; - } - } - if (uiMode !== null) break; - } - } - - // Render each group + // Render each group (skip EQ-specific groups) for (const group of schema.groups) { - // Check if this is an EQ bands group (vertical sliders layout) - if (group.layout === 'eq-bands') { - // Conditionally show/hide based on uiMode - let showGroup = false; - if (uiMode === 1 && group.channel === 'left') showGroup = true; // 15-band: left only (shown as "Both channels") - if (uiMode === 2) showGroup = true; // 15-band bi-amp: both channels - - if (!showGroup) continue; - - // Render EQ bands as vertical sliders - const bandsHeader = document.createElement('div'); - bandsHeader.className = 'eq-bands-header'; - bandsHeader.textContent = group.name; - container.appendChild(bandsHeader); - - const bandsContainer = document.createElement('div'); - bandsContainer.className = 'eq-bands-container'; - - for (const param of group.parameters) { - const bandSlider = document.createElement('div'); - bandSlider.className = 'eq-band-slider'; - - const label = document.createElement('div'); - label.className = 'slider-label'; - label.textContent = param.name; - - const slider = document.createElement('input'); - slider.type = 'range'; - slider.id = param.key; - slider.min = param.min; - slider.max = param.max; - slider.step = param.step || 1; - slider.value = param.current || param.default || 0; - slider.orient = 'vertical'; - - const valueDisplay = document.createElement('div'); - valueDisplay.className = 'slider-value'; - valueDisplay.id = `${param.key}-value`; - valueDisplay.textContent = `${param.current || param.default || 0} ${param.unit || ''}`; - - slider.addEventListener('input', (e) => { - valueDisplay.textContent = `${e.target.value} ${param.unit || ''}`; - }); - - slider.addEventListener('change', (e) => { - handleParameterChange(param.key, parseInt(e.target.value)); - }); - - bandSlider.appendChild(label); - bandSlider.appendChild(slider); - bandSlider.appendChild(valueDisplay); - bandsContainer.appendChild(bandSlider); - } - - container.appendChild(bandsContainer); - continue; // Skip normal group rendering + // Skip groups that belong to EQ UI (they are moved to the dedicated EQ tab) + if (group.layout === 'eq-bands' || group.layout === 'biquad-manual' || (group.name && group.name.toLowerCase().includes('eq'))) { + continue; } const groupDiv = document.createElement('div'); @@ -629,28 +555,10 @@

TAS5805M DAC Settings

// Skip parameters that are now handled by eq-bands layout if (param && param.layout === 'vertical') continue; - // Conditionally hide/show EQ-related parameters based on uiMode + // Skip any EQ-specific parameters (moved to EQ tab) if (param && typeof param.key === 'string') { - // per-band sliders: keys start with 'eq_gain_' - if (param.key.startsWith('eq_gain_')) { - if (uiMode === null || uiMode === undefined) { - // if unknown, show nothing; safe default: hide - continue; - } - if (uiMode === 0) { // OFF - continue; - } - if (uiMode === 1) { // 15-band (left only) - if (!param.key.startsWith('eq_gain_l_')) continue; - } - if (uiMode === 3) { // PRESETS -> hide band sliders - continue; - } - // uiMode === 2 => show both - } - // presets keys: eq_profile_l / eq_profile_r -> only show for PRESETS - if (param.key === 'eq_profile_l' || param.key === 'eq_profile_r') { - if (uiMode !== 3) continue; + if (param.key.startsWith('eq_') || param.key.startsWith('bq_')) { + continue; } } const controlDiv = document.createElement('div'); @@ -797,45 +705,9 @@

TAS5805M DAC Settings

} } - // Reset all EQ bands to zero (0 dB) and send to backend - async function resetEQ() { - if (!schema) return; - if (!confirm('Reset all EQ bands to 0 dB for both channels?')) return; - - // Build payload with all eq_gain_* keys set to 0 - const data = {}; - for (const group of schema.groups) { - if (!group.parameters) continue; - for (const param of group.parameters) { - if (typeof param.key === 'string' && param.key.startsWith('eq_gain_')) { - data[param.key] = 0; - } - } - } - - if (Object.keys(data).length === 0) { - alert('No EQ parameters found in schema.'); - return; - } - - try { - const resp = await postRequest('/api/dac/settings', data); - if (!resp.ok) throw new Error('Failed to reset EQ'); - // Refresh current settings and UI - await loadCurrentSettings(); - renderUI(); - alert('EQ reset to 0 dB applied'); - } catch (err) { - console.error('Error resetting EQ:', err); - alert('Failed to reset EQ.'); - } - } - // Initialize on page load document.addEventListener('DOMContentLoaded', () => { loadSchema(); - const btn = document.getElementById('eq-reset-btn'); - if (btn) btn.addEventListener('click', resetEQ); }); // Stop polling when page is unloaded diff --git a/components/ui_http_server/html/eq-settings.html b/components/ui_http_server/html/eq-settings.html new file mode 100644 index 00000000..f405647c --- /dev/null +++ b/components/ui_http_server/html/eq-settings.html @@ -0,0 +1,778 @@ + + + + + + ESP32 Snapclient EQ Control + + + + + + +

EQ Settings

+
+
Loading EQ settings...
+
+ + + + diff --git a/components/ui_http_server/html/index.html b/components/ui_http_server/html/index.html index 6cba0e6f..eb9e7634 100644 --- a/components/ui_http_server/html/index.html +++ b/components/ui_http_server/html/index.html @@ -91,6 +91,7 @@

ESP32 Snapclient

  • General Settings
  • + @@ -126,6 +127,14 @@

    ESP32 Snapclient

    dacTab.style.display = 'block'; } } + + // Show EQ tab if eq_available is true + if (capabilities.eq_available === true) { + const eqTab = document.getElementById('eq-tab'); + if (eqTab) { + eqTab.style.display = 'block'; + } + } } catch (error) { console.error('Error checking DSP availability:', error); // DSP and DAC tabs remain hidden on error diff --git a/components/ui_http_server/html/settings-ui.js b/components/ui_http_server/html/settings-ui.js new file mode 100644 index 00000000..a09fc0c0 --- /dev/null +++ b/components/ui_http_server/html/settings-ui.js @@ -0,0 +1,245 @@ +/* Shared UI helpers for settings pages + * Exposes helper functions on window.settingsUI + */ +(function () { + 'use strict'; + + function formatValue(value, unit, decimals) { + if (value === undefined || value === null) return ''; + if (decimals !== undefined) return Number(value).toFixed(decimals) + (unit || ''); + return String(value) + (unit || ''); + } + + function debounce(fn, wait) { + let t = null; + return function () { + const args = arguments; + clearTimeout(t); + t = setTimeout(() => fn.apply(this, args), wait); + }; + } + + // Render a parameter control (enum, range, float) -- returns HTMLElement + function renderParameter(param, currentSettings, onChange) { + const controlDiv = document.createElement('div'); + controlDiv.className = 'parameter-control'; + + // Priority: param.current (from schema response) > currentSettings[param.key] > param.default + const value = (param.current !== undefined) ? param.current : + ((currentSettings && currentSettings[param.key] !== undefined) ? currentSettings[param.key] : param.default); + + // Check if value is null (coefficients not available before I2S clock) + const isValueUnavailable = (value === null || value === undefined); + + if (param.type === 'enum') { + const label = document.createElement('label'); + label.textContent = param.name; + controlDiv.appendChild(label); + + const select = document.createElement('select'); + if (param.readonly) select.disabled = true; + param.values.forEach(option => { + const opt = document.createElement('option'); + opt.value = option.value; + opt.textContent = option.name; + if (value == option.value) opt.selected = true; + select.appendChild(opt); + }); + select.onchange = function () { + if (onChange) onChange(param.key, parseInt(this.value)); + }; + controlDiv.appendChild(select); + return controlDiv; + } + + if (param.type === 'range') { + const info = document.createElement('div'); + info.className = 'param-info'; + const nameSpan = document.createElement('span'); + nameSpan.className = 'param-name'; + nameSpan.textContent = param.name; + const valueSpan = document.createElement('span'); + valueSpan.className = 'param-value'; + valueSpan.textContent = isValueUnavailable ? 'n/a' : formatValue(value, param.unit, param.decimals); + info.appendChild(nameSpan); + info.appendChild(valueSpan); + controlDiv.appendChild(info); + + const slider = document.createElement('input'); + slider.type = 'range'; + slider.min = param.min; + slider.max = param.max; + if (param.step !== undefined) slider.step = param.step; + slider.value = isValueUnavailable ? param.min : value; + if (param.readonly || isValueUnavailable) slider.disabled = true; + + slider.oninput = function () { + valueSpan.textContent = formatValue(this.value, param.unit, param.decimals); + }; + + slider.onchange = function () { + if (onChange) onChange(param.key, parseFloat(this.value)); + }; + + controlDiv.appendChild(slider); + return controlDiv; + } + + if (param.type === 'float') { + const label = document.createElement('label'); + label.textContent = param.name; + controlDiv.appendChild(label); + + const input = document.createElement('input'); + input.type = 'number'; + // Use param.step if provided, default to 0.000001 for 6 decimal places + const step = param.step !== undefined ? param.step : 0.000001; + input.step = step; + // Calculate decimals needed from step value (5.27 format = up to 6 decimals for 0.000001) + let decimals = 1; + if (Number.isFinite(step)) { + const stepStr = String(step); + if (stepStr.indexOf('.') !== -1) { + decimals = stepStr.split('.')[1].length; + } + } + input.setAttribute('data-decimals', decimals); + + if (param.min !== undefined) input.min = param.min; + if (param.max !== undefined) input.max = param.max; + + // Display 'n/a' if value is unavailable, otherwise format with proper decimals + if (isValueUnavailable) { + input.value = 'n/a'; + input.disabled = true; + } else { + input.value = Number(value).toFixed(decimals); + if (param.readonly) input.disabled = true; + } + + input.onchange = function () { + if (onChange) onChange(param.key, parseFloat(this.value)); + }; + // Update display on input to show proper formatting + input.oninput = function () { + const dec = parseInt(this.getAttribute('data-decimals')); + this.value = Number(this.value).toFixed(dec); + }; + controlDiv.appendChild(input); + return controlDiv; + } + + // Unknown type fallback + const p = document.createElement('p'); + p.textContent = `Unsupported parameter type: ${param.type}`; + controlDiv.appendChild(p); + return controlDiv; + } + + // Vertical slider renderer for EQ band display + function renderVerticalSlider(param, currentSettings, onChange) { + const sliderDiv = document.createElement('div'); + sliderDiv.className = 'eq-band-slider'; + + // Priority: param.current (from schema response) > currentSettings[param.key] > param.default + const value = (param.current !== undefined) ? param.current : + ((currentSettings && currentSettings[param.key] !== undefined) ? currentSettings[param.key] : param.default); + + const valueDisplay = document.createElement('div'); + valueDisplay.className = 'value-display'; + valueDisplay.textContent = `${value}${param.unit || ''}`; + sliderDiv.appendChild(valueDisplay); + + const slider = document.createElement('input'); + slider.type = 'range'; + slider.min = param.min; + slider.max = param.max; + slider.step = param.step || 1; + slider.value = value; + slider.oninput = function () { + valueDisplay.textContent = `${this.value}${param.unit || ''}`; + }; + slider.onchange = function () { + if (onChange) onChange(param.key, parseInt(this.value)); + }; + sliderDiv.appendChild(slider); + + const label = document.createElement('label'); + label.textContent = param.label || param.name; + sliderDiv.appendChild(label); + + return sliderDiv; + } + + // Visibility helpers for EQ groups + function updateGroupVisibility(groupDiv, currentSettings) { + const layout = groupDiv.getAttribute('data-layout'); + const channel = groupDiv.getAttribute('data-channel'); + if (!layout) return; + const uiMode = (currentSettings && currentSettings.eq_ui_mode !== undefined) ? currentSettings.eq_ui_mode : 0; + + if (layout === 'eq-bands') { + if (uiMode === 1) { + groupDiv.style.display = (channel === 'left') ? 'block' : 'none'; + } else if (uiMode === 2) { + groupDiv.style.display = 'block'; + } else { + groupDiv.style.display = 'none'; + } + } + + if (layout === 'biquad-manual') { + // Always show biquad section, but expand/collapse based on mode + groupDiv.style.display = 'block'; + const isManualMode = (uiMode === 4); + + if (isManualMode) { + groupDiv.classList.remove('collapsed'); + } else { + groupDiv.classList.add('collapsed'); + } + + // Update readonly state of inputs when mode changes + const inputs = groupDiv.querySelectorAll('input[type="number"]'); + inputs.forEach(input => { + const isA0 = input.id && input.id.includes('_a0'); + if (isA0) { + input.disabled = true; // a0 always readonly + } else { + input.disabled = !isManualMode; + } + }); + + // Update button group: always visible, but Apply button only enabled in manual mode + const buttonGroup = groupDiv.querySelector('.button-group'); + if (buttonGroup) { + buttonGroup.style.display = 'flex'; // Always visible + const applyButton = buttonGroup.querySelector('.apply-button'); + if (applyButton) { + applyButton.disabled = !isManualMode; + } + } + } + + if (layout === 'eq-presets') { + groupDiv.style.display = (uiMode === 3) ? 'block' : 'none'; + } + } + + function updateAllGroupVisibility(currentSettings) { + document.querySelectorAll('.parameter-group[data-layout]').forEach(group => { + updateGroupVisibility(group, currentSettings); + }); + } + + // Export API + window.settingsUI = { + formatValue, + debounce, + renderParameter, + renderVerticalSlider, + updateGroupVisibility, + updateAllGroupVisibility, + }; + +})(); From c13a7f94ada0b3f0581076a431b5c5f8698290db Mon Sep 17 00:00:00 2001 From: Andriy Malyshenko Date: Thu, 8 Jan 2026 12:13:21 +0100 Subject: [PATCH 28/58] Removed BQ editor, restored develop version of the dsp_processor --- components/dsp_processor/CMakeLists.txt | 2 +- components/dsp_processor/dsp_processor.c | 320 +-- .../dsp_processor/include/dsp_processor.h | 128 +- .../dsp_processor_settings/CMakeLists.txt | 2 +- .../dsp_processor_settings.c | 1023 +++++---- .../include/dsp_processor_settings.h | 58 +- .../include/tas5805m_settings.h | 13 - .../tas5805m_settings/tas5805m_settings.c | 615 +----- .../ui_http_server/html/dac-settings.html | 18 +- .../ui_http_server/html/eq-settings.html | 170 -- components/ui_http_server/ui_http_server.c | 1841 ++++++++++------- partitions.csv | 10 +- 12 files changed, 1999 insertions(+), 2201 deletions(-) diff --git a/components/dsp_processor/CMakeLists.txt b/components/dsp_processor/CMakeLists.txt index 87fd6744..d8353364 100644 --- a/components/dsp_processor/CMakeLists.txt +++ b/components/dsp_processor/CMakeLists.txt @@ -1,5 +1,5 @@ set(COMPONENT_REQUIRES) -set(COMPONENT_PRIV_REQUIRES esp-dsp lightsnapcast dsp_processor_settings) +set(COMPONENT_PRIV_REQUIRES esp-dsp lightsnapcast) list(APPEND COMPONENT_ADD_INCLUDEDIRS ./include) set(COMPONENT_SRCS ./dsp_processor.c) diff --git a/components/dsp_processor/dsp_processor.c b/components/dsp_processor/dsp_processor.c index 77a57f00..96490c80 100644 --- a/components/dsp_processor/dsp_processor.c +++ b/components/dsp_processor/dsp_processor.c @@ -5,34 +5,52 @@ #include #include "freertos/FreeRTOS.h" +#include "freertos/semphr.h" #if CONFIG_USE_DSP_PROCESSOR #include "dsp_processor.h" -#include "dsp_processor_settings.h" #include "dsps_biquad.h" #include "dsps_biquad_gen.h" #include "esp_log.h" -#include "freertos/queue.h" #include "player.h" +typedef struct ptype { + int filtertype; + float freq; + float gain; + float q; + float *in, *out; + float coeffs[5]; + float w[2]; +} ptype_t; + +typedef struct dsp_all_params_s { + dspFlows_t active_flow; + struct { + float fc_1; + float gain_1; + float fc_3; + float gain_3; + } flow_params[DSP_FLOW_COUNT]; +} dsp_all_params_t; + #ifdef CONFIG_USE_BIQUAD_ASM #define BIQUAD dsps_biquad_f32_ae32 #else #define BIQUAD dsps_biquad_f32 #endif -static const char *TAG = "dspProc"; +static const char *TAG = "dsp_proc"; #define DSP_PROCESSOR_LEN 16 -static QueueHandle_t filterUpdateQHdl = NULL; +// Legacy queue removed. Use paramsChangedSemaphoreHandle to notify worker of updates. +static SemaphoreHandle_t paramsChangedSemaphoreHandle = NULL; +static SemaphoreHandle_t params_mutex = NULL; // Centralized parameter storage - one set of parameters per DSP flow static dsp_all_params_t all_params; -// Legacy single filterParams for backward compatibility with worker thread -static filterParams_t filterParams; - static ptype_t *filter = NULL; static double dynamic_vol = 1.0; @@ -54,20 +72,6 @@ dspFlows_t dspFlowInit = dspfStereo; void dsp_processor_init(void) { ESP_LOGD(TAG, "%s: initializing", __func__); init = false; - - if (filterUpdateQHdl) { - vQueueDelete(filterUpdateQHdl); - filterUpdateQHdl = NULL; - } - - // have a max queue length of 1 here because we use xQueueOverwrite - // to write to the queue - filterUpdateQHdl = xQueueCreate(1, sizeof(filterParams_t)); - if (filterUpdateQHdl == NULL) { - ESP_LOGE(TAG, "%s: Failed to create filter update queue", __func__); - return; - } - // Initialize all_params with defaults for each flow memset(&all_params, 0, sizeof(dsp_all_params_t)); all_params.active_flow = dspFlowInit; @@ -91,48 +95,24 @@ void dsp_processor_init(void) { // dspfStereo has no parameters (pass-through with volume only) // dspf2DOT1 and dspfFunkyHonda not yet implemented - // Load saved parameters from NVS for all flows - ESP_LOGI(TAG, "%s: Loading saved parameters from NVS", __func__); - for (int flow = 0; flow < DSP_FLOW_COUNT; flow++) { - int32_t fc_1, gain_1, fc_2, gain_2, fc_3, gain_3; - - // Load each parameter, keeping defaults if not found in NVS - if (dsp_settings_load_flow_param((dspFlows_t)flow, "fc_1", &fc_1) == ESP_OK) { - all_params.flow_params[flow].fc_1 = (float)fc_1; - } - if (dsp_settings_load_flow_param((dspFlows_t)flow, "gain_1", &gain_1) == ESP_OK) { - all_params.flow_params[flow].gain_1 = (float)gain_1; - } - if (dsp_settings_load_flow_param((dspFlows_t)flow, "fc_2", &fc_2) == ESP_OK) { - all_params.flow_params[flow].fc_2 = (float)fc_2; - } - if (dsp_settings_load_flow_param((dspFlows_t)flow, "gain_2", &gain_2) == ESP_OK) { - all_params.flow_params[flow].gain_2 = (float)gain_2; - } - if (dsp_settings_load_flow_param((dspFlows_t)flow, "fc_3", &fc_3) == ESP_OK) { - all_params.flow_params[flow].fc_3 = (float)fc_3; - } - if (dsp_settings_load_flow_param((dspFlows_t)flow, "gain_3", &gain_3) == ESP_OK) { - all_params.flow_params[flow].gain_3 = (float)gain_3; + // Note: Do not read settings here to avoid circular dependency. The + // dsp_processor_settings component will call dsp_processor_set_params_for_flow() + // and dsp_processor_switch_flow() during its init to apply saved settings. + + if (params_mutex == NULL) { + params_mutex = xSemaphoreCreateMutex(); + if (params_mutex == NULL) { + ESP_LOGW(TAG, "%s: failed to create params mutex", __func__); } } - - // Load saved active flow - dspFlows_t saved_flow; - if (dsp_settings_load_active_flow(&saved_flow) == ESP_OK) { - all_params.active_flow = saved_flow; - ESP_LOGI(TAG, "%s: Restored active flow: %d", __func__, saved_flow); + if (paramsChangedSemaphoreHandle == NULL) { + paramsChangedSemaphoreHandle = xSemaphoreCreateBinary(); + if (paramsChangedSemaphoreHandle == NULL) { + ESP_LOGW(TAG, "%s: failed to create params changed semaphore", __func__); + } else { + xSemaphoreTake(paramsChangedSemaphoreHandle, 10); + } } - - // Initialize legacy filterParams from active flow - filterParams.dspFlow = all_params.active_flow; - filterParams.fc_1 = all_params.flow_params[all_params.active_flow].fc_1; - filterParams.gain_1 = all_params.flow_params[all_params.active_flow].gain_1; - filterParams.fc_2 = all_params.flow_params[all_params.active_flow].fc_2; - filterParams.gain_2 = all_params.flow_params[all_params.active_flow].gain_2; - filterParams.fc_3 = all_params.flow_params[all_params.active_flow].fc_3; - filterParams.gain_3 = all_params.flow_params[all_params.active_flow].gain_3; - ESP_LOGI(TAG, "%s: Initialized with flow=%d, fc_1=%.1f, gain_1=%.1f", __func__, all_params.active_flow, all_params.flow_params[all_params.active_flow].fc_1, @@ -161,11 +141,15 @@ void dsp_processor_uninit(void) { filter = NULL; } - if (filterUpdateQHdl) { - vQueueDelete(filterUpdateQHdl); - filterUpdateQHdl = NULL; + if (params_mutex) { + vSemaphoreDelete(params_mutex); + params_mutex = NULL; } + if (paramsChangedSemaphoreHandle) { + vSemaphoreDelete(paramsChangedSemaphoreHandle); + paramsChangedSemaphoreHandle = NULL; + } init = false; ESP_LOGI(TAG, "%s: uninit done", __func__); @@ -173,40 +157,45 @@ void dsp_processor_uninit(void) { /** * Update filter parameters - * Updates both the static filterParams immediately and queues for worker thread + * Updates centralized storage and queues for worker thread */ esp_err_t dsp_processor_update_filter_params(filterParams_t *params) { ESP_LOGD(TAG, "%s: updating filter params", __func__); - // Update static filterParams immediately so get_capabilities returns current value - memcpy(&filterParams, params, sizeof(filterParams_t)); - - // Also update centralized storage for the current flow + // Update centralized storage for the current flow dspFlows_t flow = params->dspFlow; if (flow >= 0 && flow < DSP_FLOW_COUNT) { // Validate flow index - all_params.active_flow = flow; - all_params.flow_params[flow].fc_1 = params->fc_1; - all_params.flow_params[flow].gain_1 = params->gain_1; - all_params.flow_params[flow].fc_2 = params->fc_2; - all_params.flow_params[flow].gain_2 = params->gain_2; - all_params.flow_params[flow].fc_3 = params->fc_3; - all_params.flow_params[flow].gain_3 = params->gain_3; - } - - if (filterUpdateQHdl) { - if (xQueueOverwrite(filterUpdateQHdl, params) == pdTRUE) { - return ESP_OK; + // Acquire mutex once, update parameters and set the notification flag + if (params_mutex && (xSemaphoreTake(params_mutex, portMAX_DELAY) == pdTRUE)) { + all_params.active_flow = flow; + all_params.flow_params[flow].fc_1 = params->fc_1; + all_params.flow_params[flow].gain_1 = params->gain_1; + all_params.flow_params[flow].fc_3 = params->fc_3; + all_params.flow_params[flow].gain_3 = params->gain_3; + xSemaphoreGive(paramsChangedSemaphoreHandle); + xSemaphoreGive(params_mutex); + } else { + // No mutex available: best-effort update + all_params.active_flow = flow; + all_params.flow_params[flow].fc_1 = params->fc_1; + all_params.flow_params[flow].gain_1 = params->gain_1; + all_params.flow_params[flow].fc_3 = params->fc_3; + all_params.flow_params[flow].gain_3 = params->gain_3; + xSemaphoreGive(paramsChangedSemaphoreHandle); } } + + // Worker polls params_changed; we set it while holding the mutex above + // to ensure atomic visibility. Nothing more to do here. - return ESP_FAIL; + return ESP_OK; } /** * */ static int32_t dsp_processor_gen_filter(ptype_t *filter, uint32_t cnt) { - ESP_LOGD(TAG, "%s: generating %d filters", __func__, cnt); + ESP_LOGD(TAG, "%s: generating %lu filters", __func__, (unsigned long)cnt); if ((filter == NULL) && (cnt > 0)) { return ESP_FAIL; } @@ -265,6 +254,7 @@ int dsp_processor_worker(void *p_pcmChnk, const void *p_scSet) { if (samplerate == 0) { samplerate = 44100; + ESP_LOGW(TAG, "%s: Sample rate is not set, using default: %lu", __func__, (unsigned long)samplerate); } int16_t len = pcmChnk->fragment->size / ((bits / 8) * ch); @@ -273,17 +263,47 @@ int dsp_processor_worker(void *p_pcmChnk, const void *p_scSet) { // volatile needed to ensure 32 bit access volatile uint32_t *audio_tmp = (volatile uint32_t *)(pcmChnk->fragment->payload); - dspFlows_t dspFlow; + + // Local working copy of filter parameters + static filterParams_t currentFilterParams = {0}; + static bool paramsInitialized = false; + + // Initialize on first run + if (!paramsInitialized) { + currentFilterParams.dspFlow = all_params.active_flow; + currentFilterParams.fc_1 = all_params.flow_params[all_params.active_flow].fc_1; + currentFilterParams.gain_1 = all_params.flow_params[all_params.active_flow].gain_1; + currentFilterParams.fc_3 = all_params.flow_params[all_params.active_flow].fc_3; + currentFilterParams.gain_3 = all_params.flow_params[all_params.active_flow].gain_3; + paramsInitialized = true; + } - // check if we need to update filters - if (xQueueReceive(filterUpdateQHdl, &filterParams, pdMS_TO_TICKS(0)) == - pdTRUE) { - init = false; + // If parameters were changed by API, copy them from centralized storage + if (xSemaphoreTake(paramsChangedSemaphoreHandle, 0) == pdTRUE) { + // Copy under mutex to avoid torn reads + if (params_mutex) { + xSemaphoreTake(params_mutex, portMAX_DELAY); + } else { + ESP_LOGW(TAG, "%s: params mutex not available, proceeding without mutex", __func__); + } + + dspFlows_t aflow = all_params.active_flow; + currentFilterParams.dspFlow = aflow; + currentFilterParams.fc_1 = all_params.flow_params[aflow].fc_1; + currentFilterParams.gain_1 = all_params.flow_params[aflow].gain_1; + currentFilterParams.fc_3 = all_params.flow_params[aflow].fc_3; + currentFilterParams.gain_3 = all_params.flow_params[aflow].gain_3; + if (params_mutex) { + xSemaphoreGive(params_mutex); + } else { + ESP_LOGW(TAG, "%s: params mutex not available, proceeding without mutex", __func__); + } - // TODO: store filterParams in NVM + ESP_LOGI(TAG, "Applying filter update: flow=%d", currentFilterParams.dspFlow); + init = false; } - dspFlow = filterParams.dspFlow; + dspFlows_t dspFlow = currentFilterParams.dspFlow; if (init == false) { uint32_t cnt = 0; @@ -301,10 +321,10 @@ int dsp_processor_worker(void *p_pcmChnk, const void *p_scSet) { (ptype_t *)heap_caps_malloc(sizeof(ptype_t) * cnt, MALLOC_CAP_8BIT); if (filter) { // simple EQ control of low and high frequencies (bass, treble) - float bass_fc = filterParams.fc_1 / samplerate; - float bass_gain = filterParams.gain_1; - float treble_fc = filterParams.fc_3 / samplerate; - float treble_gain = filterParams.gain_3; + float bass_fc = currentFilterParams.fc_1 / samplerate; + float bass_gain = currentFilterParams.gain_1; + float treble_fc = currentFilterParams.fc_3 / samplerate; + float treble_gain = currentFilterParams.gain_3; // filters for CH 0 filter[0] = (ptype_t){LOWSHELF, bass_fc, bass_gain, 0.707, @@ -336,8 +356,8 @@ int dsp_processor_worker(void *p_pcmChnk, const void *p_scSet) { filter = (ptype_t *)heap_caps_malloc(sizeof(ptype_t) * cnt, MALLOC_CAP_8BIT); if (filter) { - float bass_fc = filterParams.fc_1 / samplerate; - float bass_gain = filterParams.gain_1; + float bass_fc = currentFilterParams.fc_1 / samplerate; + float bass_gain = currentFilterParams.gain_1; filter[0] = (ptype_t){LOWSHELF, bass_fc, bass_gain, 0.707, NULL, NULL, {0, 0, 0, 0, 0}, {0, 0}}; @@ -345,7 +365,7 @@ int dsp_processor_worker(void *p_pcmChnk, const void *p_scSet) { NULL, NULL, {0, 0, 0, 0, 0}, {0, 0}}; ESP_LOGI(TAG, "got new setting for dspfBassBoost: fc=%.1f gain=%.1f", - filterParams.fc_1, filterParams.gain_1); + currentFilterParams.fc_1, currentFilterParams.gain_1); } else { ESP_LOGE(TAG, "failed to get memory for filter"); } @@ -359,10 +379,10 @@ int dsp_processor_worker(void *p_pcmChnk, const void *p_scSet) { filter = (ptype_t *)heap_caps_malloc(sizeof(ptype_t) * cnt, MALLOC_CAP_8BIT); if (filter) { - float lp_fc = filterParams.fc_1 / samplerate; - float lp_gain = filterParams.gain_1; - float hp_fc = filterParams.fc_3 / samplerate; - float hp_gain = filterParams.gain_3; + float lp_fc = currentFilterParams.fc_1 / samplerate; + float lp_gain = currentFilterParams.gain_1; + float hp_fc = currentFilterParams.fc_3 / samplerate; + float hp_gain = currentFilterParams.gain_3; filter[0] = (ptype_t){LPF, lp_fc, lp_gain, 0.707, NULL, NULL, {0, 0, 0, 0, 0}, {0, 0}}; @@ -756,43 +776,6 @@ void dsp_processor_set_volome(double volume) { dynamic_vol = volume; } } - -/** - * Get current DSP flow - */ -dspFlows_t dsp_processor_get_current_flow(void) { - ESP_LOGD(TAG, "%s: returning flow=%d", __func__, filterParams.dspFlow); - return filterParams.dspFlow; -} - -/** - * Get all parameters (centralized storage) - */ -const dsp_all_params_t* dsp_processor_get_all_params(void) { - return &all_params; -} - -/** - * Get parameters for a specific flow - */ -esp_err_t dsp_processor_get_params_for_flow(dspFlows_t flow, filterParams_t *params) { - ESP_LOGD(TAG, "%s: getting params for flow %d", __func__, flow); - - if (params == NULL || flow < 0 || flow >= DSP_FLOW_COUNT) { - return ESP_ERR_INVALID_ARG; - } - - params->dspFlow = flow; - params->fc_1 = all_params.flow_params[flow].fc_1; - params->gain_1 = all_params.flow_params[flow].gain_1; - params->fc_2 = all_params.flow_params[flow].fc_2; - params->gain_2 = all_params.flow_params[flow].gain_2; - params->fc_3 = all_params.flow_params[flow].fc_3; - params->gain_3 = all_params.flow_params[flow].gain_3; - - return ESP_OK; -} - /** * Set parameters for a specific flow (without switching to it) */ @@ -804,21 +787,41 @@ esp_err_t dsp_processor_set_params_for_flow(dspFlows_t flow, const filterParams_ } // Update centralized storage for this specific flow + if (params_mutex) { + xSemaphoreTake(params_mutex, portMAX_DELAY); + } else { + ESP_LOGW(TAG, "%s: params mutex not available, proceeding without mutex", __func__); + } + all_params.flow_params[flow].fc_1 = params->fc_1; all_params.flow_params[flow].gain_1 = params->gain_1; - all_params.flow_params[flow].fc_2 = params->fc_2; - all_params.flow_params[flow].gain_2 = params->gain_2; all_params.flow_params[flow].fc_3 = params->fc_3; all_params.flow_params[flow].gain_3 = params->gain_3; + if (params_mutex) { + xSemaphoreGive(params_mutex); + } else { + ESP_LOGW(TAG, "%s: params mutex not available, proceeding without mutex", __func__); + } // If this is the active flow, also update the legacy filterParams and notify worker - if (flow == all_params.active_flow) { + if (params_mutex) { + xSemaphoreTake(params_mutex, portMAX_DELAY); + } else { + ESP_LOGW(TAG, "%s: params mutex not available, proceeding without mutex", __func__); + } + + bool is_active = (flow == all_params.active_flow); + if (params_mutex) { + xSemaphoreGive(params_mutex); + } else { + ESP_LOGW(TAG, "%s: params mutex not available, proceeding without mutex", __func__); + } + + if (is_active) { filterParams_t temp_params; temp_params.dspFlow = flow; temp_params.fc_1 = params->fc_1; temp_params.gain_1 = params->gain_1; - temp_params.fc_2 = params->fc_2; - temp_params.gain_2 = params->gain_2; temp_params.fc_3 = params->fc_3; temp_params.gain_3 = params->gain_3; @@ -828,4 +831,37 @@ esp_err_t dsp_processor_set_params_for_flow(dspFlows_t flow, const filterParams_ return ESP_OK; } +/** + * Switch to a different DSP flow + */ +esp_err_t dsp_processor_switch_flow(dspFlows_t flow) { + if (flow < 0 || flow >= DSP_FLOW_COUNT) { + ESP_LOGE(TAG, "%s: invalid flow %d", __func__, flow); + return ESP_ERR_INVALID_ARG; + } + + ESP_LOGI(TAG, "%s: switching from flow %d to %d", __func__, all_params.active_flow, flow); + // Set active flow under mutex and capture params to apply + if (params_mutex) { + xSemaphoreTake(params_mutex, portMAX_DELAY); + } else { + ESP_LOGW(TAG, "%s: params mutex not available, proceeding without mutex", __func__); + } + + all_params.active_flow = flow; + filterParams_t params; + params.dspFlow = flow; + params.fc_1 = all_params.flow_params[flow].fc_1; + params.gain_1 = all_params.flow_params[flow].gain_1; + params.fc_3 = all_params.flow_params[flow].fc_3; + params.gain_3 = all_params.flow_params[flow].gain_3; + if (params_mutex) { + xSemaphoreGive(params_mutex); + } else { + ESP_LOGW(TAG, "%s: params mutex not available, proceeding without mutex", __func__); + } + + return dsp_processor_update_filter_params(¶ms); +} + #endif diff --git a/components/dsp_processor/include/dsp_processor.h b/components/dsp_processor/include/dsp_processor.h index 16c3c1d1..5099dcf4 100644 --- a/components/dsp_processor/include/dsp_processor.h +++ b/components/dsp_processor/include/dsp_processor.h @@ -6,52 +6,8 @@ extern "C" { #endif #include "esp_err.h" - -/** - * DSP Parameter Limits - Configurable at compile time - * - * These defines control the min/max/default values for all DSP parameters - * exposed in the UI. Modify these values before compilation to set appropriate - * limits for your audio system. - * - * All frequency values are in Hz - * All gain values are in dB - */ - -#define DSP_BASS_FREQ_MIN 30.0f -#define DSP_BASS_FREQ_MAX 500.0f -#define DSP_BASS_FREQ_DEFAULT 150.0f -#define DSP_BASS_FREQ_STEP 5.0f - -#define DSP_TREBLE_FREQ_MIN 2000.0f -#define DSP_TREBLE_FREQ_MAX 16000.0f -#define DSP_TREBLE_FREQ_DEFAULT 8000.0f -#define DSP_TREBLE_FREQ_STEP 100.0f - -#define DSP_GAIN_MIN -15.0f -#define DSP_GAIN_MAX 15.0f -#define DSP_GAIN_DEFAULT 0.0f -#define DSP_GAIN_STEP 1.0f - -#define DSP_BASSBOOST_GAIN_MIN -18.0f -#define DSP_BASSBOOST_GAIN_MAX 18.0f -#define DSP_BASSBOOST_GAIN_DEFAULT 9.0f -#define DSP_BASSBOOST_GAIN_STEP 1.0f - -#define DSP_CROSSOVER_FREQ_MIN 80.0f -#define DSP_CROSSOVER_FREQ_MAX 3000.0f -#define DSP_CROSSOVER_FREQ_DEFAULT 500.0f -#define DSP_CROSSOVER_FREQ_STEP 10.0f - -typedef enum dspFlows { - dspfStereo, - dspfBiamp, - dspf2DOT1, - dspfFunkyHonda, - dspfBassBoost, - dspfEQBassTreble, - DSP_FLOW_COUNT // Total number of DSP flows -} dspFlows_t; +#include "dsp_types.h" +#include "freertos/FreeRTOS.h" enum filtertypes { LPF, @@ -66,83 +22,13 @@ enum filtertypes { HIGHSHELF }; -// Each audio processor node consist of a data struct holding the -// required weights and states for processing an automomous processing -// function. The high level parameters is maintained in the structure -// as well -// Process node -typedef struct ptype { - int filtertype; - float freq; - float gain; - float q; - float *in, *out; - float coeffs[5]; - float w[2]; -} ptype_t; - -// used to dynamically change used filters and their parameters -typedef struct filterParams_s { - dspFlows_t dspFlow; - float fc_1; - float gain_1; - float fc_2; - float gain_2; - float fc_3; - float gain_3; -} filterParams_t; - -/** - * Centralized parameter storage for all DSP flows - * Each DSP flow has its own isolated parameter set to prevent collisions - * when switching between flows. This ensures that changing "gain" in one - * flow doesn't affect "gain" in another flow. - */ -typedef struct dsp_all_params_s { - dspFlows_t active_flow; // Currently active DSP flow - - // Parameters for each DSP flow (indexed by dspFlows_t enum) - struct { - float fc_1; // Primary frequency (bass/crossover) - float gain_1; // Primary gain (bass/boost) - float fc_2; // Secondary frequency - float gain_2; // Secondary gain - float fc_3; // Tertiary frequency (treble/high crossover) - float gain_3; // Tertiary gain (treble) - } flow_params[DSP_FLOW_COUNT]; // One entry per dspFlows_t enum value -} dsp_all_params_t; - -// TODO: this is unused, remove??? -// Process flow -typedef struct pnode { - ptype_t process; - struct pnode *next; -} pnode_t; void dsp_processor_init(void); void dsp_processor_uninit(void); int dsp_processor_worker(void *pcmChnk, const void *scSet); esp_err_t dsp_processor_update_filter_params(filterParams_t *params); -void dsp_processor_set_volome(double volume); -/** - * Get current DSP flow - */ -dspFlows_t dsp_processor_get_current_flow(void); - -/** - * Get all parameters (centralized storage for all flows) - * Returns pointer to internal storage - do not modify directly - */ -const dsp_all_params_t* dsp_processor_get_all_params(void); - -/** - * Get parameters for a specific flow - * @param flow The DSP flow to get parameters for - * @param params Output parameter structure - * @return ESP_OK on success - */ -esp_err_t dsp_processor_get_params_for_flow(dspFlows_t flow, filterParams_t *params); +void dsp_processor_set_volome(double volume); /** * Set parameters for a specific flow (without switching to it) @@ -153,6 +39,14 @@ esp_err_t dsp_processor_get_params_for_flow(dspFlows_t flow, filterParams_t *par */ esp_err_t dsp_processor_set_params_for_flow(dspFlows_t flow, const filterParams_t *params); +/** + * Switch to a different DSP flow + * This activates the flow and applies its stored parameters + * @param flow The DSP flow to switch to + * @return ESP_OK on success + */ +esp_err_t dsp_processor_switch_flow(dspFlows_t flow); + #ifdef __cplusplus } #endif diff --git a/components/dsp_processor_settings/CMakeLists.txt b/components/dsp_processor_settings/CMakeLists.txt index 7e158df3..31cabb38 100644 --- a/components/dsp_processor_settings/CMakeLists.txt +++ b/components/dsp_processor_settings/CMakeLists.txt @@ -1,5 +1,5 @@ idf_component_register( SRCS "dsp_processor_settings.c" INCLUDE_DIRS "include" - REQUIRES nvs_flash dsp_processor json + REQUIRES nvs_flash json dsp_processor ) diff --git a/components/dsp_processor_settings/dsp_processor_settings.c b/components/dsp_processor_settings/dsp_processor_settings.c index 63a34503..6685aae6 100644 --- a/components/dsp_processor_settings/dsp_processor_settings.c +++ b/components/dsp_processor_settings/dsp_processor_settings.c @@ -5,13 +5,14 @@ #include "dsp_processor_settings.h" -#include +#include "cJSON.h" +#include "dsp_processor.h" #include "esp_log.h" -#include "nvs_flash.h" -#include "nvs.h" #include "freertos/FreeRTOS.h" #include "freertos/semphr.h" -#include "cJSON.h" +#include "nvs.h" +#include "nvs_flash.h" +#include static const char *TAG = "dsp_settings"; static const char *NVS_NAMESPACE = "dsp_settings"; @@ -20,435 +21,633 @@ static const char *NVS_KEY_ACTIVE_FLOW = "active_flow"; // Mutex for thread-safe NVS access static SemaphoreHandle_t dsp_settings_mutex = NULL; + /** * Generate flow-specific NVS key * Format: "flow__" (e.g., "flow_5_fc_1") */ -static void make_flow_key(char *out_key, size_t out_size, dspFlows_t flow, const char *param) { - snprintf(out_key, out_size, "flow_%d_%s", (int)flow, param); +static void make_flow_key(char *out_key, size_t out_size, dspFlows_t flow, + const char *param) { + if (!out_key || out_size == 0 || !param) { + return; + } + + snprintf(out_key, out_size, "flow_%d_%s", (int)flow, param); } esp_err_t dsp_settings_init(void) { - if (dsp_settings_mutex == NULL) { - dsp_settings_mutex = xSemaphoreCreateMutex(); - if (dsp_settings_mutex == NULL) { - ESP_LOGE(TAG, "%s: Failed to create mutex", __func__); - return ESP_ERR_NO_MEM; - } - } - - ESP_LOGI(TAG, "%s: DSP settings manager initialized", __func__); - return ESP_OK; + if (dsp_settings_mutex == NULL) { + dsp_settings_mutex = xSemaphoreCreateMutex(); + if (dsp_settings_mutex == NULL) { + ESP_LOGE(TAG, "%s: Failed to create mutex", __func__); + return ESP_ERR_NO_MEM; + } + } + + ESP_LOGI(TAG, "%s: DSP settings manager initialized", __func__); + // Restore DSP parameters into dsp_processor so the processor has the + // persisted configuration after both modules are initialized. + // Note: caller (main) must initialize dsp_processor before calling + // dsp_settings_init() so these calls succeed. + dspFlows_t active = dspfStereo; + if (dsp_settings_load_active_flow(&active) == ESP_OK) { + ESP_LOGI(TAG, "%s: Restoring DSP active flow %d", __func__, active); + + // For each flow, load stored params and apply to dsp_processor + for (int f = 0; f < DSP_FLOW_COUNT; f++) { + filterParams_t params; + memset(¶ms, 0, sizeof(params)); + if (dsp_settings_get_flow_params((dspFlows_t)f, ¶ms) == ESP_OK) { + esp_err_t e = dsp_processor_set_params_for_flow((dspFlows_t)f, ¶ms); + if (e != ESP_OK) { + ESP_LOGW(TAG, "%s: Failed to apply params for flow %d: %s", __func__, f, esp_err_to_name(e)); + } else { + ESP_LOGD(TAG, "%s: Restored params for flow %d: fc_1=%.2f gain_1=%.2f fc_3=%.2f gain_3=%.2f", + __func__, f, params.fc_1, params.gain_1, params.fc_3, params.gain_3); + } + } else { + ESP_LOGD(TAG, "%s: No stored params for flow %d", __func__, f); + } + } + } + + // Finally, instruct dsp_processor to switch to the active flow + esp_err_t se = dsp_processor_switch_flow(active); + if (se != ESP_OK) { + ESP_LOGW(TAG, "%s: dsp_processor_switch_flow failed: %s", __func__, esp_err_to_name(se)); + } + return ESP_OK; } esp_err_t dsp_settings_save_active_flow(dspFlows_t flow) { - ESP_LOGD(TAG, "%s: flow=%d", __func__, (int)flow); - - if (!dsp_settings_mutex) { - ESP_LOGE(TAG, "%s: Not initialized", __func__); - return ESP_ERR_INVALID_STATE; - } - - if (xSemaphoreTake(dsp_settings_mutex, pdMS_TO_TICKS(5000)) != pdTRUE) { - ESP_LOGE(TAG, "%s: Failed to acquire mutex (timeout)", __func__); - return ESP_ERR_TIMEOUT; - } - - nvs_handle_t h; - esp_err_t err = nvs_open(NVS_NAMESPACE, NVS_READWRITE, &h); - if (err != ESP_OK) { - ESP_LOGE(TAG, "%s: Failed to open NVS: %s", __func__, esp_err_to_name(err)); - xSemaphoreGive(dsp_settings_mutex); - return err; - } - - err = nvs_set_i32(h, NVS_KEY_ACTIVE_FLOW, (int32_t)flow); - if (err == ESP_OK) { - err = nvs_commit(h); - } - - nvs_close(h); - xSemaphoreGive(dsp_settings_mutex); - - if (err == ESP_OK) { - ESP_LOGI(TAG, "%s: Active flow saved: %d", __func__, (int)flow); - } else { - ESP_LOGE(TAG, "%s: Failed to save active flow: %s", __func__, esp_err_to_name(err)); - } - - return err; + if (flow < 0 || flow >= DSP_FLOW_COUNT) { + ESP_LOGE(TAG, "%s: invalid flow %d", __func__, flow); + return ESP_ERR_INVALID_ARG; + } + + ESP_LOGD(TAG, "%s: flow=%d", __func__, (int)flow); + + if (!dsp_settings_mutex) { + ESP_LOGE(TAG, "%s: Not initialized", __func__); + return ESP_ERR_INVALID_STATE; + } + + if (xSemaphoreTake(dsp_settings_mutex, pdMS_TO_TICKS(5000)) != pdTRUE) { + ESP_LOGE(TAG, "%s: Failed to acquire mutex (timeout)", __func__); + return ESP_ERR_TIMEOUT; + } + + nvs_handle_t h; + esp_err_t err = nvs_open(NVS_NAMESPACE, NVS_READWRITE, &h); + if (err != ESP_OK) { + ESP_LOGE(TAG, "%s: Failed to open NVS: %s", __func__, + esp_err_to_name(err)); + xSemaphoreGive(dsp_settings_mutex); + return err; + } + + err = nvs_set_i32(h, NVS_KEY_ACTIVE_FLOW, (int32_t)flow); + if (err == ESP_OK) { + err = nvs_commit(h); + } + + nvs_close(h); + xSemaphoreGive(dsp_settings_mutex); + + if (err == ESP_OK) { + ESP_LOGI(TAG, "%s: Active flow saved: %d", __func__, (int)flow); + } else { + ESP_LOGE(TAG, "%s: Failed to save active flow: %s", __func__, + esp_err_to_name(err)); + } + + return err; } esp_err_t dsp_settings_load_active_flow(dspFlows_t *flow) { - ESP_LOGD(TAG, "%s: entered", __func__); - - if (!flow) return ESP_ERR_INVALID_ARG; - if (!dsp_settings_mutex) return ESP_ERR_INVALID_STATE; - - if (xSemaphoreTake(dsp_settings_mutex, pdMS_TO_TICKS(5000)) != pdTRUE) { - return ESP_ERR_TIMEOUT; - } - - nvs_handle_t h; - esp_err_t err = nvs_open(NVS_NAMESPACE, NVS_READONLY, &h); - if (err == ESP_OK) { - int32_t v = 0; - err = nvs_get_i32(h, NVS_KEY_ACTIVE_FLOW, &v); - nvs_close(h); - if (err == ESP_OK) { - *flow = (dspFlows_t)v; - ESP_LOGD(TAG, "%s: Active flow from NVS: %d", __func__, (int)*flow); - } else if (err != ESP_ERR_NVS_NOT_FOUND) { - ESP_LOGW(TAG, "%s: NVS read error: %s", __func__, esp_err_to_name(err)); - } - } - - xSemaphoreGive(dsp_settings_mutex); - return err; + ESP_LOGD(TAG, "%s: entered", __func__); + + if (!flow) + return ESP_ERR_INVALID_ARG; + if (!dsp_settings_mutex) + return ESP_ERR_INVALID_STATE; + + if (xSemaphoreTake(dsp_settings_mutex, pdMS_TO_TICKS(5000)) != pdTRUE) { + return ESP_ERR_TIMEOUT; + } + + nvs_handle_t h; + esp_err_t err = nvs_open(NVS_NAMESPACE, NVS_READONLY, &h); + if (err == ESP_OK) { + int32_t v = 0; + err = nvs_get_i32(h, NVS_KEY_ACTIVE_FLOW, &v); + nvs_close(h); + if (err == ESP_OK) { + *flow = (dspFlows_t)v; + ESP_LOGD(TAG, "%s: Active flow from NVS: %d", __func__, (int)*flow); + } else if (err != ESP_ERR_NVS_NOT_FOUND) { + ESP_LOGW(TAG, "%s: NVS read error: %s", __func__, + esp_err_to_name(err)); + } + } + + xSemaphoreGive(dsp_settings_mutex); + return err; } -esp_err_t dsp_settings_save_flow_param(dspFlows_t flow, const char *param_name, int32_t value) { - ESP_LOGD(TAG, "%s: flow=%d param=%s value=%d", __func__, (int)flow, param_name, (int)value); - - if (!param_name) return ESP_ERR_INVALID_ARG; - if (!dsp_settings_mutex) return ESP_ERR_INVALID_STATE; - - char key[32]; - make_flow_key(key, sizeof(key), flow, param_name); - - if (xSemaphoreTake(dsp_settings_mutex, pdMS_TO_TICKS(5000)) != pdTRUE) { - return ESP_ERR_TIMEOUT; - } - - nvs_handle_t h; - esp_err_t err = nvs_open(NVS_NAMESPACE, NVS_READWRITE, &h); - if (err != ESP_OK) { - xSemaphoreGive(dsp_settings_mutex); - return err; - } - - err = nvs_set_i32(h, key, value); - if (err == ESP_OK) { - err = nvs_commit(h); - } - - nvs_close(h); - xSemaphoreGive(dsp_settings_mutex); - - if (err == ESP_OK) { - ESP_LOGD(TAG, "%s: Saved %s=%d", __func__, key, (int)value); - } else { - ESP_LOGE(TAG, "%s: Failed to save %s: %s", __func__, key, esp_err_to_name(err)); - } - - return err; +esp_err_t dsp_settings_save_flow_param(dspFlows_t flow, const char *param_name, + int32_t value) { + ESP_LOGD(TAG, "%s: flow=%d param=%s value=%d", __func__, (int)flow, + param_name, (int)value); + + if (!param_name) + return ESP_ERR_INVALID_ARG; + if (!dsp_settings_mutex) + return ESP_ERR_INVALID_STATE; + + char key[32]; + make_flow_key(key, sizeof(key), flow, param_name); + + if (xSemaphoreTake(dsp_settings_mutex, pdMS_TO_TICKS(5000)) != pdTRUE) { + return ESP_ERR_TIMEOUT; + } + + nvs_handle_t h; + esp_err_t err = nvs_open(NVS_NAMESPACE, NVS_READWRITE, &h); + if (err != ESP_OK) { + xSemaphoreGive(dsp_settings_mutex); + return err; + } + + err = nvs_set_i32(h, key, value); + if (err == ESP_OK) { + err = nvs_commit(h); + } + + nvs_close(h); + xSemaphoreGive(dsp_settings_mutex); + + if (err == ESP_OK) { + ESP_LOGD(TAG, "%s: Saved %s=%d", __func__, key, (int)value); + } else { + ESP_LOGE(TAG, "%s: Failed to save %s: %s", __func__, key, + esp_err_to_name(err)); + } + + return err; } -esp_err_t dsp_settings_load_flow_param(dspFlows_t flow, const char *param_name, int32_t *value) { - ESP_LOGD(TAG, "%s: flow=%d param=%s", __func__, (int)flow, param_name); - - if (!param_name || !value) return ESP_ERR_INVALID_ARG; - if (!dsp_settings_mutex) return ESP_ERR_INVALID_STATE; - - char key[32]; - make_flow_key(key, sizeof(key), flow, param_name); - - if (xSemaphoreTake(dsp_settings_mutex, pdMS_TO_TICKS(5000)) != pdTRUE) { - return ESP_ERR_TIMEOUT; - } - - nvs_handle_t h; - esp_err_t err = nvs_open(NVS_NAMESPACE, NVS_READONLY, &h); - if (err == ESP_OK) { - int32_t v = 0; - err = nvs_get_i32(h, key, &v); - nvs_close(h); - if (err == ESP_OK) { - *value = v; - ESP_LOGD(TAG, "%s: Loaded %s=%d", __func__, key, (int)*value); - } else if (err != ESP_ERR_NVS_NOT_FOUND) { - ESP_LOGW(TAG, "%s: NVS read error for %s: %s", __func__, key, esp_err_to_name(err)); - } - } - - xSemaphoreGive(dsp_settings_mutex); - return err; +esp_err_t dsp_settings_load_flow_param(dspFlows_t flow, const char *param_name, + int32_t *value) { + ESP_LOGV(TAG, "%s: flow=%d param=%s", __func__, (int)flow, param_name); + + if (!param_name || !value) + return ESP_ERR_INVALID_ARG; + if (!dsp_settings_mutex) + return ESP_ERR_INVALID_STATE; + + if (flow < 0 || flow >= DSP_FLOW_COUNT) { + ESP_LOGE(TAG, "%s: invalid flow %d", __func__, flow); + return ESP_ERR_INVALID_ARG; + } + + char key[32]; + make_flow_key(key, sizeof(key), flow, param_name); + + if (xSemaphoreTake(dsp_settings_mutex, pdMS_TO_TICKS(5000)) != pdTRUE) { + return ESP_ERR_TIMEOUT; + } + + nvs_handle_t h; + esp_err_t err = nvs_open(NVS_NAMESPACE, NVS_READONLY, &h); + if (err == ESP_OK) { + int32_t v = 0; + err = nvs_get_i32(h, key, &v); + nvs_close(h); + if (err == ESP_OK) { + *value = v; + ESP_LOGD(TAG, "%s: Loaded %s=%d", __func__, key, (int)*value); + } else if (err != ESP_ERR_NVS_NOT_FOUND) { + ESP_LOGW(TAG, "%s: NVS read error for %s: %s", __func__, key, + esp_err_to_name(err)); + } + } + + xSemaphoreGive(dsp_settings_mutex); + return err; } esp_err_t dsp_settings_get_json(char *json_out, size_t max_len) { - ESP_LOGI(TAG, "%s: Start - buffer=%p size=%zu", __func__, json_out, max_len); - - if (!json_out || max_len == 0) { - ESP_LOGE(TAG, "%s: Invalid arguments", __func__); - return ESP_ERR_INVALID_ARG; - } - - cJSON *root = cJSON_CreateObject(); - if (!root) { - ESP_LOGE(TAG, "%s: Failed to create JSON object", __func__); - return ESP_ERR_NO_MEM; - } - - // Add active flow - dspFlows_t active_flow = dspfStereo; // default - if (dsp_settings_load_active_flow(&active_flow) == ESP_OK) { - cJSON_AddNumberToObject(root, "active_flow", (int)active_flow); - } - - // Add flow schema with current values - cJSON *schema = cJSON_CreateArray(); - if (!schema) { - cJSON_Delete(root); - return ESP_ERR_NO_MEM; - } - - // Flow: dspfStereo (0) - cJSON *stereo = cJSON_CreateObject(); - cJSON_AddStringToObject(stereo, "id", "dspfStereo"); - cJSON_AddStringToObject(stereo, "name", "Stereo Pass-Through"); - cJSON_AddStringToObject(stereo, "description", "No DSP processing, optional soft volume"); - cJSON_AddNumberToObject(stereo, "enum_value", 0); - cJSON_AddItemToObject(stereo, "parameters", cJSON_CreateArray()); - cJSON_AddItemToArray(schema, stereo); - - // Flow: dspfEQBassTreble (5) - cJSON *eq = cJSON_CreateObject(); - cJSON_AddStringToObject(eq, "id", "dspfEQBassTreble"); - cJSON_AddStringToObject(eq, "name", "Bass & Treble EQ"); - cJSON_AddStringToObject(eq, "description", "Simple 2-band equalizer with bass and treble controls"); - cJSON_AddNumberToObject(eq, "enum_value", 5); - cJSON *eq_params = cJSON_CreateArray(); - - // Bass frequency - cJSON *p1 = cJSON_CreateObject(); - cJSON_AddStringToObject(p1, "key", "fc_1"); - cJSON_AddStringToObject(p1, "name", "Bass Frequency"); - cJSON_AddStringToObject(p1, "unit", "Hz"); - cJSON_AddNumberToObject(p1, "min", 20); - cJSON_AddNumberToObject(p1, "max", 300); - cJSON_AddNumberToObject(p1, "default", 100); - cJSON_AddNumberToObject(p1, "step", 10); - int32_t val_fc1 = 100; - dsp_settings_load_flow_param(dspfEQBassTreble, "fc_1", &val_fc1); - cJSON_AddNumberToObject(p1, "current", val_fc1); - cJSON_AddItemToArray(eq_params, p1); - - // Bass gain - cJSON *p2 = cJSON_CreateObject(); - cJSON_AddStringToObject(p2, "key", "gain_1"); - cJSON_AddStringToObject(p2, "name", "Bass Gain"); - cJSON_AddStringToObject(p2, "unit", "dB"); - cJSON_AddNumberToObject(p2, "min", -15); - cJSON_AddNumberToObject(p2, "max", 15); - cJSON_AddNumberToObject(p2, "default", 0); - cJSON_AddNumberToObject(p2, "step", 1); - int32_t val_g1 = 0; - dsp_settings_load_flow_param(dspfEQBassTreble, "gain_1", &val_g1); - cJSON_AddNumberToObject(p2, "current", val_g1); - cJSON_AddItemToArray(eq_params, p2); - - // Treble frequency - cJSON *p3 = cJSON_CreateObject(); - cJSON_AddStringToObject(p3, "key", "fc_3"); - cJSON_AddStringToObject(p3, "name", "Treble Frequency"); - cJSON_AddStringToObject(p3, "unit", "Hz"); - cJSON_AddNumberToObject(p3, "min", 2000); - cJSON_AddNumberToObject(p3, "max", 16000); - cJSON_AddNumberToObject(p3, "default", 8000); - cJSON_AddNumberToObject(p3, "step", 500); - int32_t val_fc3 = 8000; - dsp_settings_load_flow_param(dspfEQBassTreble, "fc_3", &val_fc3); - cJSON_AddNumberToObject(p3, "current", val_fc3); - cJSON_AddItemToArray(eq_params, p3); - - // Treble gain - cJSON *p4 = cJSON_CreateObject(); - cJSON_AddStringToObject(p4, "key", "gain_3"); - cJSON_AddStringToObject(p4, "name", "Treble Gain"); - cJSON_AddStringToObject(p4, "unit", "dB"); - cJSON_AddNumberToObject(p4, "min", -15); - cJSON_AddNumberToObject(p4, "max", 15); - cJSON_AddNumberToObject(p4, "default", 0); - cJSON_AddNumberToObject(p4, "step", 1); - int32_t val_g3 = 0; - dsp_settings_load_flow_param(dspfEQBassTreble, "gain_3", &val_g3); - cJSON_AddNumberToObject(p4, "current", val_g3); - cJSON_AddItemToArray(eq_params, p4); - - cJSON_AddItemToObject(eq, "parameters", eq_params); - cJSON_AddItemToArray(schema, eq); - - // Flow: dspfBassBoost (4) - cJSON *boost = cJSON_CreateObject(); - cJSON_AddStringToObject(boost, "id", "dspfBassBoost"); - cJSON_AddStringToObject(boost, "name", "Bass Boost"); - cJSON_AddStringToObject(boost, "description", "Adjustable bass enhancement"); - cJSON_AddNumberToObject(boost, "enum_value", 4); - cJSON *boost_params = cJSON_CreateArray(); - - cJSON *bp1 = cJSON_CreateObject(); - cJSON_AddStringToObject(bp1, "key", "fc_1"); - cJSON_AddStringToObject(bp1, "name", "Bass Frequency"); - cJSON_AddStringToObject(bp1, "unit", "Hz"); - cJSON_AddNumberToObject(bp1, "min", 20); - cJSON_AddNumberToObject(bp1, "max", 300); - cJSON_AddNumberToObject(bp1, "default", 100); - cJSON_AddNumberToObject(bp1, "step", 10); - int32_t val_b_fc1 = 100; - dsp_settings_load_flow_param(dspfBassBoost, "fc_1", &val_b_fc1); - cJSON_AddNumberToObject(bp1, "current", val_b_fc1); - cJSON_AddItemToArray(boost_params, bp1); - - cJSON *bp2 = cJSON_CreateObject(); - cJSON_AddStringToObject(bp2, "key", "gain_1"); - cJSON_AddStringToObject(bp2, "name", "Bass Gain"); - cJSON_AddStringToObject(bp2, "unit", "dB"); - cJSON_AddNumberToObject(bp2, "min", 0); - cJSON_AddNumberToObject(bp2, "max", 24); - cJSON_AddNumberToObject(bp2, "default", 12); - cJSON_AddNumberToObject(bp2, "step", 1); - int32_t val_b_g1 = 12; - dsp_settings_load_flow_param(dspfBassBoost, "gain_1", &val_b_g1); - cJSON_AddNumberToObject(bp2, "current", val_b_g1); - cJSON_AddItemToArray(boost_params, bp2); - - cJSON_AddItemToObject(boost, "parameters", boost_params); - cJSON_AddItemToArray(schema, boost); - - // Flow: dspfBiamp (1) - cJSON *biamp = cJSON_CreateObject(); - cJSON_AddStringToObject(biamp, "id", "dspfBiamp"); - cJSON_AddStringToObject(biamp, "name", "Bi-Amp Crossover"); - cJSON_AddStringToObject(biamp, "description", "Channel 0: Low-pass, Channel 1: High-pass"); - cJSON_AddNumberToObject(biamp, "enum_value", 1); - cJSON *biamp_params = cJSON_CreateArray(); - - cJSON *bip1 = cJSON_CreateObject(); - cJSON_AddStringToObject(bip1, "key", "fc_1"); - cJSON_AddStringToObject(bip1, "name", "Low-Pass Frequency"); - cJSON_AddStringToObject(bip1, "unit", "Hz"); - cJSON_AddNumberToObject(bip1, "min", 20); - cJSON_AddNumberToObject(bip1, "max", 20000); - cJSON_AddNumberToObject(bip1, "default", 200); - cJSON_AddNumberToObject(bip1, "step", 10); - int32_t val_bi_fc1 = 200; - dsp_settings_load_flow_param(dspfBiamp, "fc_1", &val_bi_fc1); - cJSON_AddNumberToObject(bip1, "current", val_bi_fc1); - cJSON_AddItemToArray(biamp_params, bip1); - - cJSON *bip2 = cJSON_CreateObject(); - cJSON_AddStringToObject(bip2, "key", "gain_1"); - cJSON_AddStringToObject(bip2, "name", "Low-Pass Gain"); - cJSON_AddStringToObject(bip2, "unit", "dB"); - cJSON_AddNumberToObject(bip2, "min", -15); - cJSON_AddNumberToObject(bip2, "max", 15); - cJSON_AddNumberToObject(bip2, "default", 0); - cJSON_AddNumberToObject(bip2, "step", 1); - int32_t val_bi_g1 = 0; - dsp_settings_load_flow_param(dspfBiamp, "gain_1", &val_bi_g1); - cJSON_AddNumberToObject(bip2, "current", val_bi_g1); - cJSON_AddItemToArray(biamp_params, bip2); - - cJSON *bip3 = cJSON_CreateObject(); - cJSON_AddStringToObject(bip3, "key", "fc_3"); - cJSON_AddStringToObject(bip3, "name", "High-Pass Frequency"); - cJSON_AddStringToObject(bip3, "unit", "Hz"); - cJSON_AddNumberToObject(bip3, "min", 20); - cJSON_AddNumberToObject(bip3, "max", 20000); - cJSON_AddNumberToObject(bip3, "default", 200); - cJSON_AddNumberToObject(bip3, "step", 10); - int32_t val_bi_fc3 = 200; - dsp_settings_load_flow_param(dspfBiamp, "fc_3", &val_bi_fc3); - cJSON_AddNumberToObject(bip3, "current", val_bi_fc3); - cJSON_AddItemToArray(biamp_params, bip3); - - cJSON *bip4 = cJSON_CreateObject(); - cJSON_AddStringToObject(bip4, "key", "gain_3"); - cJSON_AddStringToObject(bip4, "name", "High-Pass Gain"); - cJSON_AddStringToObject(bip4, "unit", "dB"); - cJSON_AddNumberToObject(bip4, "min", -15); - cJSON_AddNumberToObject(bip4, "max", 15); - cJSON_AddNumberToObject(bip4, "default", 0); - cJSON_AddNumberToObject(bip4, "step", 1); - int32_t val_bi_g3 = 0; - dsp_settings_load_flow_param(dspfBiamp, "gain_3", &val_bi_g3); - cJSON_AddNumberToObject(bip4, "current", val_bi_g3); - cJSON_AddItemToArray(biamp_params, bip4); - - cJSON_AddItemToObject(biamp, "parameters", biamp_params); - cJSON_AddItemToArray(schema, biamp); - - cJSON_AddItemToObject(root, "flows", schema); - - // Render to string - char *json_str = cJSON_PrintUnformatted(root); - cJSON_Delete(root); - - if (!json_str) { - ESP_LOGE(TAG, "%s: Failed to render JSON", __func__); - return ESP_ERR_NO_MEM; - } - - size_t json_len = strlen(json_str); - ESP_LOGD(TAG, "%s: Generated JSON size: %zu bytes (buffer size: %zu)", __func__, json_len, max_len); - - if (json_len >= max_len) { - ESP_LOGE(TAG, "%s: JSON too large for buffer (%zu >= %zu)", __func__, json_len, max_len); - cJSON_free(json_str); - return ESP_ERR_INVALID_SIZE; - } - - strncpy(json_out, json_str, max_len - 1); - json_out[max_len - 1] = '\0'; - cJSON_free(json_str); - - ESP_LOGD(TAG, "%s: JSON generated: %s", __func__, json_out); - return ESP_OK; + ESP_LOGI(TAG, "%s: Start - buffer=%p size=%zu", __func__, json_out, + max_len); + + if (!json_out || max_len == 0) { + ESP_LOGE(TAG, "%s: Invalid arguments", __func__); + return ESP_ERR_INVALID_ARG; + } + + cJSON *root = cJSON_CreateObject(); + if (!root) { + ESP_LOGE(TAG, "%s: Failed to create JSON object", __func__); + return ESP_ERR_NO_MEM; + } + + // Add active flow. Default to Stereo pass-through if nothing is stored + // Attempt to load stored value; if not present, keep the default. + dspFlows_t active_flow = dspfStereo; // default + (void)dsp_settings_load_active_flow(&active_flow); + cJSON_AddNumberToObject(root, "active_flow", (int)active_flow); + + // Add flow schema with current values + cJSON *schema = cJSON_CreateArray(); + if (!schema) { + cJSON_Delete(root); + return ESP_ERR_NO_MEM; + } + + // Flow: dspfStereo (0) + cJSON *stereo = cJSON_CreateObject(); + cJSON_AddStringToObject(stereo, "id", "dspfStereo"); + cJSON_AddStringToObject(stereo, "name", "Stereo Pass-Through"); + cJSON_AddStringToObject(stereo, "description", + "No DSP processing, optional soft volume"); + cJSON_AddNumberToObject(stereo, "enum_value", 0); + cJSON_AddItemToObject(stereo, "parameters", cJSON_CreateArray()); + cJSON_AddItemToArray(schema, stereo); + + // Flow: dspfEQBassTreble (5) + cJSON *eq = cJSON_CreateObject(); + cJSON_AddStringToObject(eq, "id", "dspfEQBassTreble"); + cJSON_AddStringToObject(eq, "name", "Bass & Treble EQ"); + cJSON_AddStringToObject( + eq, "description", + "Simple 2-band equalizer with bass and treble controls"); + cJSON_AddNumberToObject(eq, "enum_value", 5); + cJSON *eq_params = cJSON_CreateArray(); + + // Bass frequency + cJSON *p1 = cJSON_CreateObject(); + cJSON_AddStringToObject(p1, "key", "fc_1"); + cJSON_AddStringToObject(p1, "name", "Bass Frequency"); + cJSON_AddStringToObject(p1, "unit", "Hz"); + cJSON_AddNumberToObject(p1, "min", (int)DSP_BASS_FREQ_MIN); + cJSON_AddNumberToObject(p1, "max", (int)DSP_BASS_FREQ_MAX); + cJSON_AddNumberToObject(p1, "default", (int)DSP_BASS_FREQ_DEFAULT); + cJSON_AddNumberToObject(p1, "step", (int)DSP_BASS_FREQ_STEP); + int32_t val_fc1 = 100; + dsp_settings_load_flow_param(dspfEQBassTreble, "fc_1", &val_fc1); + cJSON_AddNumberToObject(p1, "current", val_fc1); + cJSON_AddItemToArray(eq_params, p1); + + // Bass gain + cJSON *p2 = cJSON_CreateObject(); + cJSON_AddStringToObject(p2, "key", "gain_1"); + cJSON_AddStringToObject(p2, "name", "Bass Gain"); + cJSON_AddStringToObject(p2, "unit", "dB"); + cJSON_AddNumberToObject(p2, "min", (int)DSP_GAIN_MIN); + cJSON_AddNumberToObject(p2, "max", (int)DSP_GAIN_MAX); + cJSON_AddNumberToObject(p2, "default", (int)DSP_GAIN_DEFAULT); + cJSON_AddNumberToObject(p2, "step", (int)DSP_GAIN_STEP); + int32_t val_g1 = 0; + dsp_settings_load_flow_param(dspfEQBassTreble, "gain_1", &val_g1); + cJSON_AddNumberToObject(p2, "current", val_g1); + cJSON_AddItemToArray(eq_params, p2); + + // Treble frequency + cJSON *p3 = cJSON_CreateObject(); + cJSON_AddStringToObject(p3, "key", "fc_3"); + cJSON_AddStringToObject(p3, "name", "Treble Frequency"); + cJSON_AddStringToObject(p3, "unit", "Hz"); + cJSON_AddNumberToObject(p3, "min", (int)DSP_TREBLE_FREQ_MIN); + cJSON_AddNumberToObject(p3, "max", (int)DSP_TREBLE_FREQ_MAX); + cJSON_AddNumberToObject(p3, "default", (int)DSP_TREBLE_FREQ_DEFAULT); + cJSON_AddNumberToObject(p3, "step", (int)DSP_TREBLE_FREQ_STEP); + int32_t val_fc3 = 8000; + dsp_settings_load_flow_param(dspfEQBassTreble, "fc_3", &val_fc3); + cJSON_AddNumberToObject(p3, "current", val_fc3); + cJSON_AddItemToArray(eq_params, p3); + + // Treble gain + cJSON *p4 = cJSON_CreateObject(); + cJSON_AddStringToObject(p4, "key", "gain_3"); + cJSON_AddStringToObject(p4, "name", "Treble Gain"); + cJSON_AddStringToObject(p4, "unit", "dB"); + cJSON_AddNumberToObject(p4, "min", (int)DSP_GAIN_MIN); + cJSON_AddNumberToObject(p4, "max", (int)DSP_GAIN_MAX); + cJSON_AddNumberToObject(p4, "default", (int)DSP_GAIN_DEFAULT); + cJSON_AddNumberToObject(p4, "step", (int)DSP_GAIN_STEP); + int32_t val_g3 = 0; + dsp_settings_load_flow_param(dspfEQBassTreble, "gain_3", &val_g3); + cJSON_AddNumberToObject(p4, "current", val_g3); + cJSON_AddItemToArray(eq_params, p4); + + cJSON_AddItemToObject(eq, "parameters", eq_params); + cJSON_AddItemToArray(schema, eq); + + // Flow: dspfBassBoost (4) + cJSON *boost = cJSON_CreateObject(); + cJSON_AddStringToObject(boost, "id", "dspfBassBoost"); + cJSON_AddStringToObject(boost, "name", "Bass Boost"); + cJSON_AddStringToObject(boost, "description", + "Adjustable bass enhancement"); + cJSON_AddNumberToObject(boost, "enum_value", 4); + cJSON *boost_params = cJSON_CreateArray(); + + cJSON *bp1 = cJSON_CreateObject(); + cJSON_AddStringToObject(bp1, "key", "fc_1"); + cJSON_AddStringToObject(bp1, "name", "Bass Frequency"); + cJSON_AddStringToObject(bp1, "unit", "Hz"); + cJSON_AddNumberToObject(bp1, "min", (int)DSP_BASS_FREQ_MIN); + cJSON_AddNumberToObject(bp1, "max", (int)DSP_BASS_FREQ_MAX); + cJSON_AddNumberToObject(bp1, "default", (int)DSP_BASS_FREQ_DEFAULT); + cJSON_AddNumberToObject(bp1, "step", (int)DSP_BASS_FREQ_STEP); + int32_t val_b_fc1 = 100; + dsp_settings_load_flow_param(dspfBassBoost, "fc_1", &val_b_fc1); + cJSON_AddNumberToObject(bp1, "current", val_b_fc1); + cJSON_AddItemToArray(boost_params, bp1); + + cJSON *bp2 = cJSON_CreateObject(); + cJSON_AddStringToObject(bp2, "key", "gain_1"); + cJSON_AddStringToObject(bp2, "name", "Bass Gain"); + cJSON_AddStringToObject(bp2, "unit", "dB"); + cJSON_AddNumberToObject(bp2, "min", (int)DSP_BASSBOOST_GAIN_MIN); + cJSON_AddNumberToObject(bp2, "max", (int)DSP_BASSBOOST_GAIN_MAX); + cJSON_AddNumberToObject(bp2, "default", (int)DSP_BASSBOOST_GAIN_DEFAULT); + cJSON_AddNumberToObject(bp2, "step", (int)DSP_BASSBOOST_GAIN_STEP); + int32_t val_b_g1 = 12; + dsp_settings_load_flow_param(dspfBassBoost, "gain_1", &val_b_g1); + cJSON_AddNumberToObject(bp2, "current", val_b_g1); + cJSON_AddItemToArray(boost_params, bp2); + + cJSON_AddItemToObject(boost, "parameters", boost_params); + cJSON_AddItemToArray(schema, boost); + + // Flow: dspfBiamp (1) + cJSON *biamp = cJSON_CreateObject(); + cJSON_AddStringToObject(biamp, "id", "dspfBiamp"); + cJSON_AddStringToObject(biamp, "name", "Bi-Amp Crossover"); + cJSON_AddStringToObject(biamp, "description", + "Channel 0: Low-pass, Channel 1: High-pass"); + cJSON_AddNumberToObject(biamp, "enum_value", 1); + cJSON *biamp_params = cJSON_CreateArray(); + + cJSON *bip1 = cJSON_CreateObject(); + cJSON_AddStringToObject(bip1, "key", "fc_1"); + cJSON_AddStringToObject(bip1, "name", "Low-Pass Frequency"); + cJSON_AddStringToObject(bip1, "unit", "Hz"); + cJSON_AddNumberToObject(bip1, "min", (int)DSP_CROSSOVER_FREQ_MIN); + cJSON_AddNumberToObject(bip1, "max", (int)DSP_CROSSOVER_FREQ_MAX); + cJSON_AddNumberToObject(bip1, "default", (int)DSP_CROSSOVER_FREQ_DEFAULT); + cJSON_AddNumberToObject(bip1, "step", (int)DSP_CROSSOVER_FREQ_STEP); + int32_t val_bi_fc1 = 200; + dsp_settings_load_flow_param(dspfBiamp, "fc_1", &val_bi_fc1); + cJSON_AddNumberToObject(bip1, "current", val_bi_fc1); + cJSON_AddItemToArray(biamp_params, bip1); + + cJSON *bip2 = cJSON_CreateObject(); + cJSON_AddStringToObject(bip2, "key", "gain_1"); + cJSON_AddStringToObject(bip2, "name", "Low-Pass Gain"); + cJSON_AddStringToObject(bip2, "unit", "dB"); + cJSON_AddNumberToObject(bip2, "min", (int)DSP_GAIN_MIN); + cJSON_AddNumberToObject(bip2, "max", (int)DSP_GAIN_MAX); + cJSON_AddNumberToObject(bip2, "default", (int)DSP_GAIN_DEFAULT); + cJSON_AddNumberToObject(bip2, "step", (int)DSP_GAIN_STEP); + int32_t val_bi_g1 = 0; + dsp_settings_load_flow_param(dspfBiamp, "gain_1", &val_bi_g1); + cJSON_AddNumberToObject(bip2, "current", val_bi_g1); + cJSON_AddItemToArray(biamp_params, bip2); + + cJSON *bip3 = cJSON_CreateObject(); + cJSON_AddStringToObject(bip3, "key", "fc_3"); + cJSON_AddStringToObject(bip3, "name", "High-Pass Frequency"); + cJSON_AddStringToObject(bip3, "unit", "Hz"); + cJSON_AddNumberToObject(bip3, "min", (int)DSP_CROSSOVER_FREQ_MIN); + cJSON_AddNumberToObject(bip3, "max", (int)DSP_CROSSOVER_FREQ_MAX); + cJSON_AddNumberToObject(bip3, "default", (int)DSP_CROSSOVER_FREQ_DEFAULT); + cJSON_AddNumberToObject(bip3, "step", (int)DSP_CROSSOVER_FREQ_STEP); + int32_t val_bi_fc3 = 200; + dsp_settings_load_flow_param(dspfBiamp, "fc_3", &val_bi_fc3); + cJSON_AddNumberToObject(bip3, "current", val_bi_fc3); + cJSON_AddItemToArray(biamp_params, bip3); + + cJSON *bip4 = cJSON_CreateObject(); + cJSON_AddStringToObject(bip4, "key", "gain_3"); + cJSON_AddStringToObject(bip4, "name", "High-Pass Gain"); + cJSON_AddStringToObject(bip4, "unit", "dB"); + cJSON_AddNumberToObject(bip4, "min", (int)DSP_GAIN_MIN); + cJSON_AddNumberToObject(bip4, "max", (int)DSP_GAIN_MAX); + cJSON_AddNumberToObject(bip4, "default", (int)DSP_GAIN_DEFAULT); + cJSON_AddNumberToObject(bip4, "step", (int)DSP_GAIN_STEP); + int32_t val_bi_g3 = 0; + dsp_settings_load_flow_param(dspfBiamp, "gain_3", &val_bi_g3); + cJSON_AddNumberToObject(bip4, "current", val_bi_g3); + cJSON_AddItemToArray(biamp_params, bip4); + + cJSON_AddItemToObject(biamp, "parameters", biamp_params); + cJSON_AddItemToArray(schema, biamp); + + cJSON_AddItemToObject(root, "flows", schema); + + // Render to string + char *json_str = cJSON_PrintUnformatted(root); + cJSON_Delete(root); + + if (!json_str) { + ESP_LOGE(TAG, "%s: Failed to render JSON", __func__); + return ESP_ERR_NO_MEM; + } + + size_t json_len = strlen(json_str); + ESP_LOGI(TAG, "%s: Generated JSON size: %zu bytes (buffer size: %zu)", + __func__, json_len, max_len); + + if (json_len >= max_len) { + ESP_LOGE(TAG, "%s: JSON too large for buffer (%zu >= %zu)", __func__, + json_len, max_len); + cJSON_free(json_str); + return ESP_ERR_INVALID_SIZE; + } + + strncpy(json_out, json_str, max_len - 1); + json_out[max_len - 1] = '\0'; + cJSON_free(json_str); + + ESP_LOGV(TAG, "%s: JSON generated: %s", __func__, json_out); + return ESP_OK; } esp_err_t dsp_settings_set_from_json(const char *json_in) { - ESP_LOGD(TAG, "%s: json=%s", __func__, json_in); - - if (!json_in) return ESP_ERR_INVALID_ARG; - - cJSON *root = cJSON_Parse(json_in); - if (!root) { - ESP_LOGE(TAG, "%s: Failed to parse JSON", __func__); - return ESP_ERR_INVALID_ARG; - } - - esp_err_t err = ESP_OK; - - // Update active flow if present - cJSON *active_flow = cJSON_GetObjectItem(root, "active_flow"); - if (cJSON_IsNumber(active_flow)) { - err = dsp_settings_save_active_flow((dspFlows_t)active_flow->valueint); - if (err != ESP_OK) { - ESP_LOGW(TAG, "%s: Failed to save active_flow", __func__); - } - } - - // Iterate through all items and save flow parameters - // Expecting keys like "flow_5_fc_1", "flow_5_gain_1", etc. - cJSON *item = NULL; - cJSON_ArrayForEach(item, root) { - if (cJSON_IsNumber(item) && item->string) { - // Parse key format: "flow_X_param" - if (strncmp(item->string, "flow_", 5) == 0) { - int flow_id; - char param_name[16]; - if (sscanf(item->string, "flow_%d_%15s", &flow_id, param_name) == 2) { - esp_err_t save_err = dsp_settings_save_flow_param( - (dspFlows_t)flow_id, param_name, item->valueint); - if (save_err != ESP_OK) { - ESP_LOGW(TAG, "%s: Failed to save %s", __func__, item->string); - err = save_err; - } - } - } - } - } - - cJSON_Delete(root); - return err; + ESP_LOGD(TAG, "%s: json=%s", __func__, json_in); + + if (!json_in) + return ESP_ERR_INVALID_ARG; + + cJSON *root = cJSON_Parse(json_in); + if (!root) { + ESP_LOGE(TAG, "%s: Failed to parse JSON", __func__); + return ESP_ERR_INVALID_ARG; + } + + esp_err_t err = ESP_OK; + + // Update active flow if present + cJSON *active_flow = cJSON_GetObjectItem(root, "active_flow"); + if (cJSON_IsNumber(active_flow)) { + err = dsp_settings_save_active_flow((dspFlows_t)active_flow->valueint); + if (err != ESP_OK) { + ESP_LOGW(TAG, "%s: Failed to save active_flow", __func__); + } + } + + // Iterate through all items and save flow parameters + // Expecting keys like "flow_5_fc_1", "flow_5_gain_1", etc. + cJSON *item = NULL; + cJSON_ArrayForEach(item, root) { + if (cJSON_IsNumber(item) && item->string) { + // Parse key format: "flow_X_param" + if (strncmp(item->string, "flow_", 5) == 0) { + int flow_id; + char param_name[16]; + if (sscanf(item->string, "flow_%d_%15s", &flow_id, + param_name) == 2) { + esp_err_t save_err = dsp_settings_save_flow_param( + (dspFlows_t)flow_id, param_name, item->valueint); + if (save_err != ESP_OK) { + ESP_LOGW(TAG, "%s: Failed to save %s", __func__, + item->string); + err = save_err; + } + } + } + } + } + + cJSON_Delete(root); + return err; +} + +/** + * Get current active flow + */ +dspFlows_t dsp_settings_get_active_flow(void) { + dspFlows_t flow = dspfStereo; + if (dsp_settings_load_active_flow(&flow) == ESP_OK) { + return flow; + } + return flow; +} + +/** + * Get parameters for a specific flow + */ +esp_err_t dsp_settings_get_flow_params(dspFlows_t flow, + filterParams_t *params) { + if (!params || flow < 0 || flow >= DSP_FLOW_COUNT) { + return ESP_ERR_INVALID_ARG; + } + + params->dspFlow = flow; + + int32_t v = 0; + if (dsp_settings_load_flow_param(flow, "fc_1", &v) == ESP_OK) { + params->fc_1 = (float)v; + } else { + params->fc_1 = DSP_BASS_FREQ_DEFAULT; + } + + if (dsp_settings_load_flow_param(flow, "gain_1", &v) == ESP_OK) { + params->gain_1 = (float)v; + } else { + params->gain_1 = DSP_GAIN_DEFAULT; + } + + if (dsp_settings_load_flow_param(flow, "fc_3", &v) == ESP_OK) { + params->fc_3 = (float)v; + } else { + params->fc_3 = DSP_TREBLE_FREQ_DEFAULT; + } + + if (dsp_settings_load_flow_param(flow, "gain_3", &v) == ESP_OK) { + params->gain_3 = (float)v; + } else { + params->gain_3 = DSP_GAIN_DEFAULT; + } + + return ESP_OK; +} + +/** + * Set parameters for a specific flow and notify subscribers + */ +esp_err_t dsp_settings_set_flow_params(dspFlows_t flow, + const filterParams_t *params) { + if (!params || flow < 0 || flow >= DSP_FLOW_COUNT) { + return ESP_ERR_INVALID_ARG; + } + + ESP_LOGI(TAG, "Setting params for flow %d: fc_1=%.1f gain_1=%.1f", flow, + params->fc_1, params->gain_1); + + // Save to NVS + esp_err_t err = ESP_OK; + err |= dsp_settings_save_flow_param(flow, "fc_1", (int32_t)params->fc_1); + err |= + dsp_settings_save_flow_param(flow, "gain_1", (int32_t)params->gain_1); + err |= dsp_settings_save_flow_param(flow, "fc_3", (int32_t)params->fc_3); + err |= + dsp_settings_save_flow_param(flow, "gain_3", (int32_t)params->gain_3); + if (err == ESP_OK) { + // If the flow we just saved is currently active, apply it to the + // DSP processor. Read active flow from NVS on demand. + dspFlows_t active = dspfStereo; + if (dsp_settings_load_active_flow(&active) == ESP_OK && active == flow) { + esp_err_t e = dsp_processor_set_params_for_flow(flow, params); + if (e == ESP_OK) { + ESP_LOGD(TAG, "Applied params to DSP processor for active flow"); + } else { + ESP_LOGW(TAG, "Failed to apply params to DSP processor: %s", + esp_err_to_name(e)); + } + } + } + + return err; +} + +/** + * Switch active flow and notify subscribers + */ +esp_err_t dsp_settings_switch_active_flow(dspFlows_t flow) { + if (flow < 0 || flow >= DSP_FLOW_COUNT) { + return ESP_ERR_INVALID_ARG; + } + + ESP_LOGI(TAG, "Switching active flow to %d", flow); + + // Save to NVS + esp_err_t err = dsp_settings_save_active_flow(flow); + if (err == ESP_OK) { + // Get parameters for the new flow and apply to DSP processor + filterParams_t params; + if (dsp_settings_get_flow_params(flow, ¶ms) == ESP_OK) { + esp_err_t e = dsp_processor_set_params_for_flow(flow, ¶ms); + if (e != ESP_OK) { + ESP_LOGW(TAG, "Failed to set params for flow on DSP processor: %s", + esp_err_to_name(e)); + } + } else { + ESP_LOGW(TAG, "Failed to load params for flow %d", flow); + } + + // Now instruct processor to switch to the new flow + esp_err_t e = dsp_processor_switch_flow(flow); + if (e == ESP_OK) { + ESP_LOGD(TAG, "DSP processor switched to flow %d", flow); + } else { + ESP_LOGW(TAG, "DSP processor failed to switch flow: %s", + esp_err_to_name(e)); + } + } + + return err; } diff --git a/components/dsp_processor_settings/include/dsp_processor_settings.h b/components/dsp_processor_settings/include/dsp_processor_settings.h index e1436934..b25c56c9 100644 --- a/components/dsp_processor_settings/include/dsp_processor_settings.h +++ b/components/dsp_processor_settings/include/dsp_processor_settings.h @@ -15,10 +15,10 @@ extern "C" { #endif +#include "dsp_types.h" #include #include #include -#include "dsp_processor.h" /** * Initialize DSP settings manager @@ -42,36 +42,38 @@ esp_err_t dsp_settings_load_active_flow(dspFlows_t *flow); /** * Save a flow-specific integer parameter to NVS * Format: "flow__" (e.g., "flow_5_fc_1") - * + * * @param flow The DSP flow this parameter belongs to - * @param param_name Parameter name (e.g., "fc_1", "gain_2") + * @param param_name Parameter name (e.g., "fc_1", "gain_1") * @param value Parameter value */ -esp_err_t dsp_settings_save_flow_param(dspFlows_t flow, const char *param_name, int32_t value); +esp_err_t dsp_settings_save_flow_param(dspFlows_t flow, const char *param_name, + int32_t value); /** * Load a flow-specific integer parameter from NVS - * + * * @param flow The DSP flow this parameter belongs to * @param param_name Parameter name * @param value Pointer to store the loaded value * @return ESP_OK on success, ESP_ERR_NVS_NOT_FOUND if not set */ -esp_err_t dsp_settings_load_flow_param(dspFlows_t flow, const char *param_name, int32_t *value); +esp_err_t dsp_settings_load_flow_param(dspFlows_t flow, const char *param_name, + int32_t *value); /** * Get all DSP settings as a JSON string * Includes active flow and all flow-specific parameters - * + * * @param json_out Buffer to store JSON string (caller must allocate) * @param max_len Maximum size of output buffer * @return ESP_OK on success - * + * * Example output: * { * "active_flow": 5, * "flows": { - * "5": {"fc_1": 150, "gain_1": 0, "fc_2": 8000, "gain_2": 0} + * "5": {"fc_1": 150, "gain_1": 0, "fc_3": 8000, "gain_3": 0} * } * } */ @@ -80,10 +82,10 @@ esp_err_t dsp_settings_get_json(char *json_out, size_t max_len); /** * Update DSP settings from a JSON string * Parses JSON and saves values to NVS - * + * * @param json_in JSON string containing settings to update * @return ESP_OK on success - * + * * Expected format: * { * "active_flow": 5, @@ -93,6 +95,40 @@ esp_err_t dsp_settings_get_json(char *json_out, size_t max_len); */ esp_err_t dsp_settings_set_from_json(const char *json_in); +/** + * Get current active flow + * @return Current active DSP flow + */ +dspFlows_t dsp_settings_get_active_flow(void); + +/** + * Get parameters for a specific flow + * @param flow DSP flow to query + * @param params Output structure for parameters + * @return ESP_OK on success + */ +esp_err_t dsp_settings_get_flow_params(dspFlows_t flow, filterParams_t *params); + +/** + * Set parameters for a specific flow + * Persists to NVS and updates cache + * + * @param flow DSP flow to update + * @param params New parameters + * @return ESP_OK on success + */ +esp_err_t dsp_settings_set_flow_params(dspFlows_t flow, + const filterParams_t *params); + +/** + * Switch active flow + * Persists to NVS and updates cache + * + * @param flow New active flow + * @return ESP_OK on success + */ +esp_err_t dsp_settings_switch_active_flow(dspFlows_t flow); + #ifdef __cplusplus } #endif diff --git a/components/tas5805m_settings/include/tas5805m_settings.h b/components/tas5805m_settings/include/tas5805m_settings.h index 6dec196f..c6f692ce 100644 --- a/components/tas5805m_settings/include/tas5805m_settings.h +++ b/components/tas5805m_settings/include/tas5805m_settings.h @@ -45,9 +45,6 @@ extern "C" { // Channel gain NVS keys (single value per output channel, in dB) #define TAS5805M_NVS_KEY_CHANNEL_GAIN_L "channel_gain_l" #define TAS5805M_NVS_KEY_CHANNEL_GAIN_R "channel_gain_r" -// Manual biquad coefficient NVS key prefixes (final key: "bq_l__b0" etc.) -#define TAS5805M_NVS_KEY_BQ_L_PREFIX "bq_l_" -#define TAS5805M_NVS_KEY_BQ_R_PREFIX "bq_r_" /** EQ UI modes exposed to the settings UI. These control visibility and apply behavior. * Defined here so the settings module owns the UI contract. Values are persisted to NVS. @@ -57,7 +54,6 @@ typedef enum { TAS5805M_EQ_UI_MODE_15_BAND = 1, TAS5805M_EQ_UI_MODE_15_BAND_BIAMP = 2, TAS5805M_EQ_UI_MODE_PRESETS = 3, - TAS5805M_EQ_UI_MODE_MANUAL = 4, } TAS5805M_EQ_UI_MODE; /** Convert an EQ UI mode to human-readable name (for schema name fields) */ @@ -128,15 +124,6 @@ esp_err_t tas5805m_settings_save_channel_gain(TAS5805M_EQ_CHANNELS ch, int gain_ /** Load per-output channel gain (single value per channel, in dB) */ esp_err_t tas5805m_settings_load_channel_gain(TAS5805M_EQ_CHANNELS ch, int *gain_db); -/** Save manual biquad coefficients for a specific channel and band to NVS */ -esp_err_t tas5805m_settings_save_biquad_coefficients(TAS5805M_EQ_CHANNELS ch, int band, - float b0, float b1, float b2, - float a1, float a2); -/** Load manual biquad coefficients for a specific channel and band from NVS */ -esp_err_t tas5805m_settings_load_biquad_coefficients(TAS5805M_EQ_CHANNELS ch, int band, - float *b0, float *b1, float *b2, - float *a1, float *a2); - /** Get current TAS5805M settings as a JSON string */ //esp_err_t tas5805m_settings_get_json(char *json_out, size_t max_len); diff --git a/components/tas5805m_settings/tas5805m_settings.c b/components/tas5805m_settings/tas5805m_settings.c index 431b37ea..78725da8 100644 --- a/components/tas5805m_settings/tas5805m_settings.c +++ b/components/tas5805m_settings/tas5805m_settings.c @@ -120,7 +120,6 @@ const char *tas5805m_eq_ui_mode_to_string(TAS5805M_EQ_UI_MODE m) { case TAS5805M_EQ_UI_MODE_15_BAND: return "15-band"; case TAS5805M_EQ_UI_MODE_15_BAND_BIAMP: return "15-band (bi-amp)"; case TAS5805M_EQ_UI_MODE_PRESETS: return "EQ Presets"; - case TAS5805M_EQ_UI_MODE_MANUAL: return "Manual"; default: return "Unknown"; } } @@ -695,138 +694,6 @@ esp_err_t tas5805m_settings_load_channel_gain(TAS5805M_EQ_CHANNELS ch, int *gain return err; } -/** Save manual biquad coefficients for a specific channel and band to NVS. - * Keys are formatted as: "bq_l__b0", "bq_l__b1", etc. - */ -esp_err_t tas5805m_settings_save_biquad_coefficients(TAS5805M_EQ_CHANNELS ch, int band, - float b0, float b1, float b2, - float a1, float a2) { -#if !defined(CONFIG_DAC_TAS5805M_EQ_SUPPORT) - return ESP_ERR_NOT_SUPPORTED; -#else - if (band < 0 || band >= TAS5805M_EQ_BANDS) { - ESP_LOGE(TAG, "%s: Invalid band %d", __func__, band); - return ESP_ERR_INVALID_ARG; - } - - ESP_LOGD(TAG, "%s: ch=%d band=%d b0=%f b1=%f b2=%f a1=%f a2=%f", - __func__, (int)ch, band, b0, b1, b2, a1, a2); - - if (!tas5805m_settings_mutex) return ESP_ERR_INVALID_STATE; - - if (xSemaphoreTake(tas5805m_settings_mutex, pdMS_TO_TICKS(5000)) != pdTRUE) { - return ESP_ERR_TIMEOUT; - } - - const char *prefix = (ch == TAS5805M_EQ_CHANNELS_LEFT) ? TAS5805M_NVS_KEY_BQ_L_PREFIX : TAS5805M_NVS_KEY_BQ_R_PREFIX; - char key[32]; - - nvs_handle_t h; - esp_err_t err = nvs_open(TAS5805M_NVS_NAMESPACE, NVS_READWRITE, &h); - if (err != ESP_OK) { - ESP_LOGW(TAG, "%s: Failed to open NVS namespace '%s': %s", __func__, TAS5805M_NVS_NAMESPACE, esp_err_to_name(err)); - xSemaphoreGive(tas5805m_settings_mutex); - return err; - } - - // Save each coefficient as a 32-bit blob (float) - snprintf(key, sizeof(key), "%s%d_b0", prefix, band); - err |= nvs_set_blob(h, key, &b0, sizeof(float)); - - snprintf(key, sizeof(key), "%s%d_b1", prefix, band); - err |= nvs_set_blob(h, key, &b1, sizeof(float)); - - snprintf(key, sizeof(key), "%s%d_b2", prefix, band); - err |= nvs_set_blob(h, key, &b2, sizeof(float)); - - snprintf(key, sizeof(key), "%s%d_a1", prefix, band); - err |= nvs_set_blob(h, key, &a1, sizeof(float)); - - snprintf(key, sizeof(key), "%s%d_a2", prefix, band); - err |= nvs_set_blob(h, key, &a2, sizeof(float)); - - if (err == ESP_OK) { - err = nvs_commit(h); - } - nvs_close(h); - - xSemaphoreGive(tas5805m_settings_mutex); - return err; -#endif -} - -/** Load manual biquad coefficients for a specific channel and band from NVS */ -esp_err_t tas5805m_settings_load_biquad_coefficients(TAS5805M_EQ_CHANNELS ch, int band, - float *b0, float *b1, float *b2, - float *a1, float *a2) { -#if !defined(CONFIG_DAC_TAS5805M_EQ_SUPPORT) - return ESP_ERR_NOT_SUPPORTED; -#else - if (!b0 || !b1 || !b2 || !a1 || !a2) return ESP_ERR_INVALID_ARG; - - if (band < 0 || band >= TAS5805M_EQ_BANDS) { - ESP_LOGE(TAG, "%s: Invalid band %d", __func__, band); - return ESP_ERR_INVALID_ARG; - } - - if (!tas5805m_settings_mutex) return ESP_ERR_INVALID_STATE; - - if (xSemaphoreTake(tas5805m_settings_mutex, pdMS_TO_TICKS(5000)) != pdTRUE) { - return ESP_ERR_TIMEOUT; - } - - const char *prefix = (ch == TAS5805M_EQ_CHANNELS_LEFT) ? TAS5805M_NVS_KEY_BQ_L_PREFIX : TAS5805M_NVS_KEY_BQ_R_PREFIX; - char key[32]; - - nvs_handle_t h; - esp_err_t err = nvs_open(TAS5805M_NVS_NAMESPACE, NVS_READONLY, &h); - if (err != ESP_OK) { - ESP_LOGW(TAG, "%s: Failed to open NVS namespace '%s': %s", __func__, TAS5805M_NVS_NAMESPACE, esp_err_to_name(err)); - xSemaphoreGive(tas5805m_settings_mutex); - return err; - } - - // Load each coefficient as a 32-bit blob (float) - size_t sz = sizeof(float); - - snprintf(key, sizeof(key), "%s%d_b0", prefix, band); - err = nvs_get_blob(h, key, b0, &sz); - if (err != ESP_OK) goto cleanup; - - sz = sizeof(float); - snprintf(key, sizeof(key), "%s%d_b1", prefix, band); - err = nvs_get_blob(h, key, b1, &sz); - if (err != ESP_OK) goto cleanup; - - sz = sizeof(float); - snprintf(key, sizeof(key), "%s%d_b2", prefix, band); - err = nvs_get_blob(h, key, b2, &sz); - if (err != ESP_OK) goto cleanup; - - sz = sizeof(float); - snprintf(key, sizeof(key), "%s%d_a1", prefix, band); - err = nvs_get_blob(h, key, a1, &sz); - if (err != ESP_OK) goto cleanup; - - sz = sizeof(float); - snprintf(key, sizeof(key), "%s%d_a2", prefix, band); - err = nvs_get_blob(h, key, a2, &sz); - if (err != ESP_OK) goto cleanup; - - ESP_LOGD(TAG, "%s: Loaded ch=%d band=%d: b0=%f b1=%f b2=%f a1=%f a2=%f", - __func__, (int)ch, band, *b0, *b1, *b2, *a1, *a2); - -cleanup: - if (err != ESP_OK && err != ESP_ERR_NVS_NOT_FOUND) { - ESP_LOGW(TAG, "%s: Failed to read biquad coefficients for ch=%d band=%d: %s", - __func__, (int)ch, band, esp_err_to_name(err)); - } - nvs_close(h); - xSemaphoreGive(tas5805m_settings_mutex); - return err; -#endif -} - /** Load EQ mode from NVS */ esp_err_t tas5805m_settings_load_eq_mode(TAS5805M_EQ_MODE *mode) { if (!mode) return ESP_ERR_INVALID_ARG; @@ -1236,7 +1103,6 @@ esp_err_t tas5805m_settings_set_from_json(const char *json_in) { case TAS5805M_EQ_UI_MODE_15_BAND: drv = TAS5805M_EQ_MODE_ON; break; case TAS5805M_EQ_UI_MODE_15_BAND_BIAMP: drv = TAS5805M_EQ_MODE_BIAMP; break; case TAS5805M_EQ_UI_MODE_PRESETS: drv = TAS5805M_EQ_MODE_BIAMP; break; - case TAS5805M_EQ_UI_MODE_MANUAL: drv = TAS5805M_EQ_MODE_BIAMP; break; default: drv = TAS5805M_EQ_MODE_OFF; break; } @@ -1405,106 +1271,6 @@ esp_err_t tas5805m_settings_set_from_json(const char *json_in) { } } - // Handle manual biquad coefficients (keys like "bq_l_0_b0", "bq_l_0_b1", etc.) - // Parse and save to NVS only. Application to hardware happens only when user clicks Apply. - for (int band = 0; band < TAS5805M_EQ_BANDS; ++band) { - float b0_l = 1, b1_l = 0, b2_l = 0, a1_l = 0, a2_l = 0; - float b0_r = 1, b1_r = 0, b2_r = 0, a1_r = 0, a2_r = 0; - bool has_l = true, has_r = true; - - // Parse left channel coefficients - char key[32]; - snprintf(key, sizeof(key), "bq_l_%d_b0", band); - cJSON *item = cJSON_GetObjectItem(root, key); - if (cJSON_IsNumber(item)) b0_l = (float)item->valuedouble; else has_l = false; - - snprintf(key, sizeof(key), "bq_l_%d_b1", band); - item = cJSON_GetObjectItem(root, key); - if (cJSON_IsNumber(item)) b1_l = (float)item->valuedouble; else has_l = false; - - snprintf(key, sizeof(key), "bq_l_%d_b2", band); - item = cJSON_GetObjectItem(root, key); - if (cJSON_IsNumber(item)) b2_l = (float)item->valuedouble; else has_l = false; - - snprintf(key, sizeof(key), "bq_l_%d_a1", band); - item = cJSON_GetObjectItem(root, key); - if (cJSON_IsNumber(item)) a1_l = (float)item->valuedouble; else has_l = false; - - snprintf(key, sizeof(key), "bq_l_%d_a2", band); - item = cJSON_GetObjectItem(root, key); - if (cJSON_IsNumber(item)) a2_l = (float)item->valuedouble; else has_l = false; - - // Parse right channel coefficients - snprintf(key, sizeof(key), "bq_r_%d_b0", band); - item = cJSON_GetObjectItem(root, key); - if (cJSON_IsNumber(item)) b0_r = (float)item->valuedouble; else has_r = false; - - snprintf(key, sizeof(key), "bq_r_%d_b1", band); - item = cJSON_GetObjectItem(root, key); - if (cJSON_IsNumber(item)) b1_r = (float)item->valuedouble; else has_r = false; - - snprintf(key, sizeof(key), "bq_r_%d_b2", band); - item = cJSON_GetObjectItem(root, key); - if (cJSON_IsNumber(item)) b2_r = (float)item->valuedouble; else has_r = false; - - snprintf(key, sizeof(key), "bq_r_%d_a1", band); - item = cJSON_GetObjectItem(root, key); - if (cJSON_IsNumber(item)) a1_r = (float)item->valuedouble; else has_r = false; - - snprintf(key, sizeof(key), "bq_r_%d_a2", band); - item = cJSON_GetObjectItem(root, key); - if (cJSON_IsNumber(item)) a2_r = (float)item->valuedouble; else has_r = false; - - // Save to NVS if all coefficients were provided - if (has_l) { - esp_err_t perr = tas5805m_settings_save_biquad_coefficients(TAS5805M_EQ_CHANNELS_LEFT, band, - b0_l, b1_l, b2_l, a1_l, a2_l); - if (perr == ESP_OK) { - ESP_LOGI(TAG, "%s: Saved manual BQ L band %d to NVS", __func__, band); - } else { - ESP_LOGW(TAG, "%s: Failed to save manual BQ L band %d: %s", __func__, band, esp_err_to_name(perr)); - } - } - - if (has_r) { - esp_err_t perr = tas5805m_settings_save_biquad_coefficients(TAS5805M_EQ_CHANNELS_RIGHT, band, - b0_r, b1_r, b2_r, a1_r, a2_r); - if (perr == ESP_OK) { - ESP_LOGI(TAG, "%s: Saved manual BQ R band %d to NVS", __func__, band); - } else { - ESP_LOGW(TAG, "%s: Failed to save manual BQ R band %d: %s", __func__, band, esp_err_to_name(perr)); - } - } - } - - // Check if user requested to apply manual coefficients (special "apply_manual_bq" flag) - cJSON *apply_item = cJSON_GetObjectItem(root, "apply_manual_bq"); - if (cJSON_IsTrue(apply_item)) { - ESP_LOGI(TAG, "%s: Applying manual biquad coefficients to hardware", __func__); - for (int band = 0; band < TAS5805M_EQ_BANDS; ++band) { - float b0, b1, b2, a1, a2; - // Left channel - if (tas5805m_settings_load_biquad_coefficients(TAS5805M_EQ_CHANNELS_LEFT, band, - &b0, &b1, &b2, &a1, &a2) == ESP_OK) { - esp_err_t werr = tas5805m_write_biquad_coefficients(TAS5805M_EQ_CHANNELS_LEFT, band, - b0, b1, b2, a1, a2); - if (werr != ESP_OK) { - ESP_LOGW(TAG, "%s: Failed to write manual BQ L band %d: %s", - __func__, band, esp_err_to_name(werr)); - } - } - // Right channel - if (tas5805m_settings_load_biquad_coefficients(TAS5805M_EQ_CHANNELS_RIGHT, band, - &b0, &b1, &b2, &a1, &a2) == ESP_OK) { - esp_err_t werr = tas5805m_write_biquad_coefficients(TAS5805M_EQ_CHANNELS_RIGHT, band, - b0, b1, b2, a1, a2); - if (werr != ESP_OK) { - ESP_LOGW(TAG, "%s: Failed to write manual BQ R band %d: %s", - __func__, band, esp_err_to_name(werr)); - } - } - } - } #else (void)root; // keep compiler happy when EQ support disabled #endif @@ -1863,11 +1629,6 @@ esp_err_t tas5805m_settings_get_schema_json(char *json_out, size_t max_len) { cJSON_AddNumberToObject(v_preset, "value", (int)TAS5805M_EQ_UI_MODE_PRESETS); cJSON_AddStringToObject(v_preset, "name", "EQ Presets"); cJSON_AddItemToArray(eq_ui_values, v_preset); - - cJSON *v_manual = cJSON_CreateObject(); - cJSON_AddNumberToObject(v_manual, "value", (int)TAS5805M_EQ_UI_MODE_MANUAL); - cJSON_AddStringToObject(v_manual, "name", "Manual"); - cJSON_AddItemToArray(eq_ui_values, v_manual); #else /* When EQ support is disabled expose only OFF and mark the control readonly * so the UI shows the section but doesn't allow changing it. @@ -2057,88 +1818,6 @@ esp_err_t tas5805m_settings_get_schema_json(char *json_out, size_t max_len) { // Add EQ band sub-groups to main groups array (after EQ group) cJSON_AddItemToArray(groups, eq_bands_left); cJSON_AddItemToArray(groups, eq_bands_right); - - /* Add manual biquad coefficient groups for left and right channels */ - cJSON *bq_left_group = cJSON_CreateObject(); - cJSON_AddStringToObject(bq_left_group, "name", "Manual Biquad Coefficients (Left)"); - cJSON_AddStringToObject(bq_left_group, "layout", "biquad-manual"); - cJSON_AddStringToObject(bq_left_group, "channel", "left"); - cJSON *bq_left_params = cJSON_CreateArray(); - - cJSON *bq_right_group = cJSON_CreateObject(); - cJSON_AddStringToObject(bq_right_group, "name", "Manual Biquad Coefficients (Right)"); - cJSON_AddStringToObject(bq_right_group, "layout", "biquad-manual"); - cJSON_AddStringToObject(bq_right_group, "channel", "right"); - cJSON *bq_right_params = cJSON_CreateArray(); - - // For each band, create 5 float inputs (B0, B1, B2, A1, A2) for both channels - for (int band = 0; band < TAS5805M_EQ_BANDS; ++band) { - char freq_label[32]; - snprintf(freq_label, sizeof(freq_label), "Band %d (%d Hz)", band, tas5805m_eq_bands[band]); - - const char *coef_names[] = {"B0", "B1", "B2", "A1", "A2"}; - const char *coef_keys[] = {"b0", "b1", "b2", "a1", "a2"}; - - for (int c = 0; c < 5; ++c) { - // Left channel - char key_l[32]; - snprintf(key_l, sizeof(key_l), "bq_l_%d_%s", band, coef_keys[c]); - - cJSON *coef_l = cJSON_CreateObject(); - cJSON_AddStringToObject(coef_l, "key", key_l); - cJSON_AddStringToObject(coef_l, "name", coef_names[c]); - cJSON_AddStringToObject(coef_l, "type", "float"); - cJSON_AddStringToObject(coef_l, "band_label", freq_label); - cJSON_AddNumberToObject(coef_l, "band", band); - cJSON_AddNumberToObject(coef_l, "coef_index", c); - cJSON_AddNumberToObject(coef_l, "min", -16.0); - cJSON_AddNumberToObject(coef_l, "max", 15.999999); - cJSON_AddNumberToObject(coef_l, "step", 0.000001); - cJSON_AddNumberToObject(coef_l, "default", (c == 0) ? 1.0 : 0.0); // B0 defaults to 1.0, others to 0.0 - - // Try to load current value from NVS - float b0=1.0, b1=0.0, b2=0.0, a1=0.0, a2=0.0; - if (tas5805m_settings_load_biquad_coefficients(TAS5805M_EQ_CHANNELS_LEFT, band, &b0, &b1, &b2, &a1, &a2) == ESP_OK) { - float vals[] = {b0, b1, b2, a1, a2}; - cJSON_AddNumberToObject(coef_l, "current", vals[c]); - } else { - cJSON_AddNumberToObject(coef_l, "current", (c == 0) ? 1.0 : 0.0); - } - cJSON_AddItemToArray(bq_left_params, coef_l); - - // Right channel - char key_r[32]; - snprintf(key_r, sizeof(key_r), "bq_r_%d_%s", band, coef_keys[c]); - - cJSON *coef_r = cJSON_CreateObject(); - cJSON_AddStringToObject(coef_r, "key", key_r); - cJSON_AddStringToObject(coef_r, "name", coef_names[c]); - cJSON_AddStringToObject(coef_r, "type", "float"); - cJSON_AddStringToObject(coef_r, "band_label", freq_label); - cJSON_AddNumberToObject(coef_r, "band", band); - cJSON_AddNumberToObject(coef_r, "coef_index", c); - cJSON_AddNumberToObject(coef_r, "min", -16.0); - cJSON_AddNumberToObject(coef_r, "max", 15.999999); - cJSON_AddNumberToObject(coef_r, "step", 0.000001); - cJSON_AddNumberToObject(coef_r, "default", (c == 0) ? 1.0 : 0.0); - - // Try to load current value from NVS - b0=1.0; b1=0.0; b2=0.0; a1=0.0; a2=0.0; - if (tas5805m_settings_load_biquad_coefficients(TAS5805M_EQ_CHANNELS_RIGHT, band, &b0, &b1, &b2, &a1, &a2) == ESP_OK) { - float vals[] = {b0, b1, b2, a1, a2}; - cJSON_AddNumberToObject(coef_r, "current", vals[c]); - } else { - cJSON_AddNumberToObject(coef_r, "current", (c == 0) ? 1.0 : 0.0); - } - cJSON_AddItemToArray(bq_right_params, coef_r); - } - } - - cJSON_AddItemToObject(bq_left_group, "parameters", bq_left_params); - cJSON_AddItemToObject(bq_right_group, "parameters", bq_right_params); - - cJSON_AddItemToArray(groups, bq_left_group); - cJSON_AddItemToArray(groups, bq_right_group); #endif // End groups @@ -2548,8 +2227,8 @@ esp_err_t tas5805m_settings_get_eq_schema_json(char *json_out, size_t max_len) { cJSON_AddNumberToObject(eq_ui_mode_param, "current", (int)ui_mode); cJSON *eq_ui_mode_values = cJSON_CreateArray(); - const char *ui_mode_names[] = {"Off", "15-Band", "15-Band Bi-Amp", "Presets", "Manual"}; - for (int i = 0; i <= TAS5805M_EQ_UI_MODE_MANUAL; ++i) { + const char *ui_mode_names[] = {"Off", "15-Band", "15-Band Bi-Amp", "Presets"}; + for (int i = 0; i <= TAS5805M_EQ_UI_MODE_PRESETS; ++i) { cJSON *val = cJSON_CreateObject(); cJSON_AddNumberToObject(val, "value", i); cJSON_AddStringToObject(val, "name", ui_mode_names[i]); @@ -2754,129 +2433,6 @@ esp_err_t tas5805m_settings_get_eq_schema_json(char *json_out, size_t max_len) { } cJSON_AddItemToObject(eq_bands_right, "parameters", eq_bands_right_params); cJSON_AddItemToArray(groups, eq_bands_right); - - // Biquad Coefficients (Left) - always visible, collapsible, editable only in manual mode - // Read actual coefficients from device to show current DSP state - cJSON *bq_manual_left = cJSON_CreateObject(); - cJSON_AddStringToObject(bq_manual_left, "name", "Biquad Coefficients (Left)"); - - const char *left_description; - if (ui_mode == TAS5805M_EQ_UI_MODE_MANUAL) { - left_description = "Direct biquad coefficient control for left channel. Use 'Sync' to read from DAC, 'Apply' to write to DAC"; - } else { - left_description = "Stored manual biquad coefficients (read-only). Use 'Sync' to read current values from DAC"; - } - cJSON_AddStringToObject(bq_manual_left, "description", left_description); - - cJSON_AddStringToObject(bq_manual_left, "layout", "biquad-manual"); - cJSON_AddStringToObject(bq_manual_left, "channel", "left"); - cJSON_AddBoolToObject(bq_manual_left, "collapsible", true); - cJSON_AddBoolToObject(bq_manual_left, "collapsed", ui_mode != TAS5805M_EQ_UI_MODE_MANUAL); - - cJSON *bq_manual_left_params = cJSON_CreateArray(); - for (int band = 0; band < TAS5805M_EQ_BANDS; ++band) { - float b0 = 1.0f, b1 = 0.0f, b2 = 0.0f, a1 = 0.0f, a2 = 0.0f; - - // Load from NVS (stored manual coefficients) - tas5805m_settings_load_biquad_coefficients(TAS5805M_EQ_CHANNELS_LEFT, band, &b0, &b1, &b2, &a1, &a2); - - char band_label[32]; - snprintf(band_label, sizeof(band_label), "BQ %d", band); - - const char *coeff_names[] = {"b0", "b1", "b2", "a0", "a1", "a2"}; - float coeff_values[6]; - coeff_values[0] = b0; coeff_values[1] = b1; coeff_values[2] = b2; - coeff_values[3] = 1.0f; /* a0 is always 1.0 */ - coeff_values[4] = a1; coeff_values[5] = a2; - - bool is_manual_mode = (ui_mode == TAS5805M_EQ_UI_MODE_MANUAL); - - for (int c = 0; c < 6; ++c) { - cJSON *coeff_param = cJSON_CreateObject(); - char key[32]; - snprintf(key, sizeof(key), "bq_l_%d_%s", band, coeff_names[c]); - - cJSON_AddStringToObject(coeff_param, "key", key); - cJSON_AddStringToObject(coeff_param, "name", coeff_names[c]); - cJSON_AddStringToObject(coeff_param, "type", "float"); - cJSON_AddNumberToObject(coeff_param, "min", -16.0); - cJSON_AddNumberToObject(coeff_param, "max", 15.999999); - cJSON_AddNumberToObject(coeff_param, "step", 0.000001); - cJSON_AddNumberToObject(coeff_param, "current", coeff_values[c]); - - // a0 is always readonly (fixed at 1.0) - // Other coefficients are readonly unless in manual mode - if (c == 3 || !is_manual_mode) { - cJSON_AddBoolToObject(coeff_param, "readonly", true); - } - - cJSON_AddNumberToObject(coeff_param, "band", band); - cJSON_AddStringToObject(coeff_param, "band_label", band_label); - cJSON_AddStringToObject(coeff_param, "layout", "biquad-manual"); - - cJSON_AddItemToArray(bq_manual_left_params, coeff_param); - } - } - cJSON_AddItemToObject(bq_manual_left, "parameters", bq_manual_left_params); - cJSON_AddItemToArray(groups, bq_manual_left); - - // Biquad Coefficients (Right) - always visible, collapsible, editable only in manual mode - cJSON *bq_manual_right = cJSON_CreateObject(); - cJSON_AddStringToObject(bq_manual_right, "name", "Biquad Coefficients (Right)"); - - const char *right_description; - if (ui_mode == TAS5805M_EQ_UI_MODE_MANUAL) { - right_description = "Direct biquad coefficient control for right channel. Use 'Sync' to read from DAC, 'Apply' to write to DAC"; - } else { - right_description = "Stored manual biquad coefficients (read-only). Use 'Sync' to read current values from DAC"; - } - cJSON_AddStringToObject(bq_manual_right, "description", right_description); - - cJSON_AddStringToObject(bq_manual_right, "layout", "biquad-manual"); - cJSON_AddStringToObject(bq_manual_right, "channel", "right"); - cJSON_AddBoolToObject(bq_manual_right, "collapsible", true); - cJSON_AddBoolToObject(bq_manual_right, "collapsed", ui_mode != TAS5805M_EQ_UI_MODE_MANUAL); - - cJSON *bq_manual_right_params = cJSON_CreateArray(); - for (int band = 0; band < TAS5805M_EQ_BANDS; ++band) { - float b0 = 1.0f, b1 = 0.0f, b2 = 0.0f, a1 = 0.0f, a2 = 0.0f; - - // Load from NVS (stored manual coefficients) - tas5805m_settings_load_biquad_coefficients(TAS5805M_EQ_CHANNELS_RIGHT, band, &b0, &b1, &b2, &a1, &a2); - - char band_label[32]; - snprintf(band_label, sizeof(band_label), "BQ %d", band); - - const char *coeff_names[] = {"b0", "b1", "b2", "a0", "a1", "a2"}; - float coeff_values[6]; - coeff_values[0] = b0; coeff_values[1] = b1; coeff_values[2] = b2; - coeff_values[3] = 1.0f; /* a0 */ - coeff_values[4] = a1; coeff_values[5] = a2; - - bool is_manual_mode = (ui_mode == TAS5805M_EQ_UI_MODE_MANUAL); - - for (int c = 0; c < 6; ++c) { - cJSON *coeff_param = cJSON_CreateObject(); - char key[32]; - snprintf(key, sizeof(key), "bq_r_%d_%s", band, coeff_names[c]); - - cJSON_AddStringToObject(coeff_param, "key", key); - cJSON_AddStringToObject(coeff_param, "name", coeff_names[c]); - cJSON_AddStringToObject(coeff_param, "type", "float"); - cJSON_AddNumberToObject(coeff_param, "min", -16.0); - cJSON_AddNumberToObject(coeff_param, "max", 15.999999); - cJSON_AddNumberToObject(coeff_param, "step", 0.000001); - cJSON_AddNumberToObject(coeff_param, "current", coeff_values[c]); - - // a0 is always readonly (fixed at 1.0)and", band); - cJSON_AddStringToObject(coeff_param, "band_label", band_label); - cJSON_AddStringToObject(coeff_param, "layout", "biquad-manual"); - - cJSON_AddItemToArray(bq_manual_right_params, coeff_param); - } - } - cJSON_AddItemToObject(bq_manual_right, "parameters", bq_manual_right_params); - cJSON_AddItemToArray(groups, bq_manual_right); #endif cJSON_AddItemToObject(root, "groups", groups); @@ -3056,32 +2612,6 @@ esp_err_t tas5805m_settings_apply_delayed(void) { ESP_LOGI(TAG, "%s: Restored Channel Gain R = %d dB", __func__, ch_gain); } } - } else if (ui_mode == TAS5805M_EQ_UI_MODE_MANUAL) { - // Apply persisted manual biquad coefficients for both channels - ESP_LOGI(TAG, "%s: Restoring manual biquad coefficients", __func__); - for (int band = 0; band < TAS5805M_EQ_BANDS; ++band) { - float b0, b1, b2, a1, a2; - // Left channel - if (tas5805m_settings_load_biquad_coefficients(TAS5805M_EQ_CHANNELS_LEFT, band, - &b0, &b1, &b2, &a1, &a2) == ESP_OK) { - if (tas5805m_write_biquad_coefficients(TAS5805M_EQ_CHANNELS_LEFT, band, - b0, b1, b2, a1, a2) != ESP_OK) { - ESP_LOGW(TAG, "%s: Failed to apply saved manual BQ L band %d", __func__, band); - } else { - ESP_LOGD(TAG, "%s: Restored manual BQ L band %d", __func__, band); - } - } - // Right channel - if (tas5805m_settings_load_biquad_coefficients(TAS5805M_EQ_CHANNELS_RIGHT, band, - &b0, &b1, &b2, &a1, &a2) == ESP_OK) { - if (tas5805m_write_biquad_coefficients(TAS5805M_EQ_CHANNELS_RIGHT, band, - b0, b1, b2, a1, a2) != ESP_OK) { - ESP_LOGW(TAG, "%s: Failed to apply saved manual BQ R band %d", __func__, band); - } else { - ESP_LOGD(TAG, "%s: Restored manual BQ R band %d", __func__, band); - } - } - } } #endif @@ -3231,44 +2761,6 @@ esp_err_t tas5805m_settings_get_eq_json(char *json_out, size_t max_len) { snprintf(key, sizeof(key), "eq_gain_r_%d", band); cJSON_AddNumberToObject(root, key, gain_r); } - - // Get manual biquad coefficients if in manual mode - if (ui_mode == TAS5805M_EQ_UI_MODE_MANUAL) { - for (int band = 0; band < TAS5805M_EQ_BANDS; ++band) { - float b0, b1, b2, a1, a2; - char key[32]; - - // Left channel - if (tas5805m_settings_load_biquad_coefficients(TAS5805M_EQ_CHANNELS_LEFT, band, - &b0, &b1, &b2, &a1, &a2) == ESP_OK) { - snprintf(key, sizeof(key), "bq_l_%d_b0", band); - cJSON_AddNumberToObject(root, key, b0); - snprintf(key, sizeof(key), "bq_l_%d_b1", band); - cJSON_AddNumberToObject(root, key, b1); - snprintf(key, sizeof(key), "bq_l_%d_b2", band); - cJSON_AddNumberToObject(root, key, b2); - snprintf(key, sizeof(key), "bq_l_%d_a1", band); - cJSON_AddNumberToObject(root, key, a1); - snprintf(key, sizeof(key), "bq_l_%d_a2", band); - cJSON_AddNumberToObject(root, key, a2); - } - - // Right channel - if (tas5805m_settings_load_biquad_coefficients(TAS5805M_EQ_CHANNELS_RIGHT, band, - &b0, &b1, &b2, &a1, &a2) == ESP_OK) { - snprintf(key, sizeof(key), "bq_r_%d_b0", band); - cJSON_AddNumberToObject(root, key, b0); - snprintf(key, sizeof(key), "bq_r_%d_b1", band); - cJSON_AddNumberToObject(root, key, b1); - snprintf(key, sizeof(key), "bq_r_%d_b2", band); - cJSON_AddNumberToObject(root, key, b2); - snprintf(key, sizeof(key), "bq_r_%d_a1", band); - cJSON_AddNumberToObject(root, key, a1); - snprintf(key, sizeof(key), "bq_r_%d_a2", band); - cJSON_AddNumberToObject(root, key, a2); - } - } - } #else // EQ support disabled cJSON_AddNumberToObject(root, "eq_mode", 0); @@ -3524,36 +3016,7 @@ esp_err_t tas5805m_settings_set_eq_from_json(const char *json_in) { ESP_LOGI(TAG, "%s: Applying saved preset right=%d", __func__, (int)prof_r); tas5805m_set_eq_profile_channel(TAS5805M_EQ_CHANNELS_RIGHT, prof_r); } - } else if (ui_mode == TAS5805M_EQ_UI_MODE_MANUAL) { - // Apply saved manual biquad coefficients - ESP_LOGI(TAG, "%s: Applying saved manual biquad coefficients", __func__); - for (int band = 0; band < TAS5805M_EQ_BANDS; ++band) { - float b0, b1, b2, a1, a2; - if (tas5805m_settings_load_biquad_coefficients(TAS5805M_EQ_CHANNELS_LEFT, band, - &b0, &b1, &b2, &a1, &a2) == ESP_OK) { - tas5805m_write_biquad_coefficients(TAS5805M_EQ_CHANNELS_LEFT, band, b0, b1, b2, a1, a2); - } - if (tas5805m_settings_load_biquad_coefficients(TAS5805M_EQ_CHANNELS_RIGHT, band, - &b0, &b1, &b2, &a1, &a2) == ESP_OK) { - tas5805m_write_biquad_coefficients(TAS5805M_EQ_CHANNELS_RIGHT, band, b0, b1, b2, a1, a2); - } - } - - // Sync from device to NVS when switching to manual mode - // This captures the current DAC state as the starting point for manual editing - ESP_LOGI(TAG, "%s: Syncing current DAC coefficients to NVS for manual mode", __func__); - for (int band = 0; band < TAS5805M_EQ_BANDS; ++band) { - float b0, b1, b2, a1, a2; - if (tas5805m_read_biquad_coefficients(TAS5805M_EQ_CHANNELS_LEFT, band, - &b0, &b1, &b2, &a1, &a2) == ESP_OK) { - tas5805m_settings_save_biquad_coefficients(TAS5805M_EQ_CHANNELS_LEFT, band, b0, b1, b2, a1, a2); - } - if (tas5805m_read_biquad_coefficients(TAS5805M_EQ_CHANNELS_RIGHT, band, - &b0, &b1, &b2, &a1, &a2) == ESP_OK) { - tas5805m_settings_save_biquad_coefficients(TAS5805M_EQ_CHANNELS_RIGHT, band, b0, b1, b2, a1, a2); - } - } - } + } } else if (strcmp(key, "eq_profile_l") == 0 && cJSON_IsNumber(item)) { TAS5805M_EQ_PROFILE prof = (TAS5805M_EQ_PROFILE)item->valueint; @@ -3597,78 +3060,6 @@ esp_err_t tas5805m_settings_set_eq_from_json(const char *json_in) { tas5805m_settings_save_eq_gain(TAS5805M_EQ_CHANNELS_RIGHT, band, gain); } } - else if (strncmp(key, "bq_", 3) == 0 && cJSON_IsNumber(item)) { - // Biquad coefficient - save to NVS but don't apply yet - // Format: bq___ - char ch = key[3]; - int band = atoi(key + 5); - const char *coeff = strrchr(key, '_') + 1; - - if ((ch == 'l' || ch == 'r') && band >= 0 && band < TAS5805M_EQ_BANDS) { - TAS5805M_EQ_CHANNELS channel = (ch == 'l') ? TAS5805M_EQ_CHANNELS_LEFT : TAS5805M_EQ_CHANNELS_RIGHT; - float value = (float)item->valuedouble; - - // Load existing coefficients - float b0 = 1.0f, b1 = 0.0f, b2 = 0.0f, a1 = 0.0f, a2 = 0.0f; - tas5805m_settings_load_biquad_coefficients(channel, band, &b0, &b1, &b2, &a1, &a2); - - // Update specific coefficient - if (strcmp(coeff, "b0") == 0) b0 = value; - else if (strcmp(coeff, "b1") == 0) b1 = value; - else if (strcmp(coeff, "b2") == 0) b2 = value; - else if (strcmp(coeff, "a1") == 0) a1 = value; - else if (strcmp(coeff, "a2") == 0) a2 = value; - - // Save back to NVS - tas5805m_settings_save_biquad_coefficients(channel, band, b0, b1, b2, a1, a2); - ESP_LOGD(TAG, "%s: Saved biquad %s band %d %s = %.6f", __func__, - ch == 'l' ? "left" : "right", band, coeff, value); - } - } - } - - // Apply manual biquad coefficients if requested - if (apply_manual_bq) { - ESP_LOGI(TAG, "%s: Applying manual biquad coefficients to hardware", __func__); - for (int band = 0; band < TAS5805M_EQ_BANDS; ++band) { - float b0, b1, b2, a1, a2; - - // Left channel - if (tas5805m_settings_load_biquad_coefficients(TAS5805M_EQ_CHANNELS_LEFT, band, - &b0, &b1, &b2, &a1, &a2) == ESP_OK) { - tas5805m_write_biquad_coefficients(TAS5805M_EQ_CHANNELS_LEFT, band, b0, b1, b2, a1, a2); - } - - // Right channel - if (tas5805m_settings_load_biquad_coefficients(TAS5805M_EQ_CHANNELS_RIGHT, band, - &b0, &b1, &b2, &a1, &a2) == ESP_OK) { - tas5805m_write_biquad_coefficients(TAS5805M_EQ_CHANNELS_RIGHT, band, b0, b1, b2, a1, a2); - } - } - } - - // Sync manual biquad coefficients from hardware if requested - if (sync_manual_bq) { - ESP_LOGI(TAG, "%s: Syncing biquad coefficients from hardware to NVS", __func__); - for (int band = 0; band < TAS5805M_EQ_BANDS; ++band) { - float b0, b1, b2, a1, a2; - - // Left channel - if (tas5805m_read_biquad_coefficients(TAS5805M_EQ_CHANNELS_LEFT, band, - &b0, &b1, &b2, &a1, &a2) == ESP_OK) { - tas5805m_settings_save_biquad_coefficients(TAS5805M_EQ_CHANNELS_LEFT, band, b0, b1, b2, a1, a2); - ESP_LOGD(TAG, "%s: Synced L band %d: b0=%.6f b1=%.6f b2=%.6f a1=%.6f a2=%.6f", - __func__, band, b0, b1, b2, a1, a2); - } - - // Right channel - if (tas5805m_read_biquad_coefficients(TAS5805M_EQ_CHANNELS_RIGHT, band, - &b0, &b1, &b2, &a1, &a2) == ESP_OK) { - tas5805m_settings_save_biquad_coefficients(TAS5805M_EQ_CHANNELS_RIGHT, band, b0, b1, b2, a1, a2); - ESP_LOGD(TAG, "%s: Synced R band %d: b0=%.6f b1=%.6f b2=%.6f a1=%.6f a2=%.6f", - __func__, band, b0, b1, b2, a1, a2); - } - } } #endif diff --git a/components/ui_http_server/html/dac-settings.html b/components/ui_http_server/html/dac-settings.html index 28fc7475..9ff5ab17 100644 --- a/components/ui_http_server/html/dac-settings.html +++ b/components/ui_http_server/html/dac-settings.html @@ -695,7 +695,23 @@

    TAS5805M DAC Settings

    console.log(`Successfully updated ${paramKey} to ${value}`); - // Reload current settings and update UI + // Update local currentSettings immediately to prevent race condition + // where device hasn't committed to NVS yet or driver hasn't updated + if (currentSettings) { + currentSettings[paramKey] = parseInt(value); + } + + // Re-render immediately with optimistic update + renderUI(); + + // For modulation parameters, add a delay before fetching to allow + // the driver to update (modulation mode is read from hardware, not cached) + if (paramKey === 'modulation_mode' || paramKey === 'sw_freq' || paramKey === 'bd_freq') { + await new Promise(resolve => setTimeout(resolve, 100)); + } + + // Reload current settings from device to sync any merged updates + // (e.g., modulation mode updates all three related parameters) await loadCurrentSettings(); renderUI(); diff --git a/components/ui_http_server/html/eq-settings.html b/components/ui_http_server/html/eq-settings.html index f405647c..9f3c0aec 100644 --- a/components/ui_http_server/html/eq-settings.html +++ b/components/ui_http_server/html/eq-settings.html @@ -377,74 +377,6 @@ margin-bottom: 5px; } - /* Biquad Manual Layout */ - .biquad-manual-container { - display: grid; - gap: 20px; - } - - .biquad-band { - background-color: #f9f9f9; - padding: 15px; - border-radius: 4px; - border-left: 4px solid #007bff; - } - - .biquad-band h3 { - margin-top: 0; - margin-bottom: 10px; - font-size: 16px; - color: #333; - } - - .biquad-coefficients { - display: grid; - grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); - gap: 10px; - } - - .apply-button { - background-color: #28a745; - color: white; - border: none; - padding: 15px 30px; - font-size: 16px; - border-radius: 4px; - cursor: pointer; - height: 50px; - } - - .apply-button:hover:not(:disabled) { - background-color: #218838; - } - - .apply-button:disabled { - background-color: #ccc; - cursor: not-allowed; - opacity: 0.6; - } - - .sync-button { - background-color: #007bff; - color: white; - border: none; - padding: 15px 30px; - font-size: 16px; - border-radius: 4px; - cursor: pointer; - height: 50px; - } - - .sync-button:hover:not(:disabled) { - background-color: #0056b3; - } - - .sync-button:disabled { - background-color: #ccc; - cursor: not-allowed; - opacity: 0.6; - } - .button-group { display: flex; gap: 10px; @@ -584,71 +516,6 @@

    EQ Settings

    return groupDiv; } - // Handle biquad manual layout - if (group.layout === 'biquad-manual' && group.parameters) { - const bqContainer = document.createElement('div'); - bqContainer.className = 'biquad-manual-container'; - - // Group parameters by band - const bandGroups = {}; - group.parameters.forEach(param => { - const band = param.band !== undefined ? param.band : 0; - if (!bandGroups[band]) { - bandGroups[band] = []; - } - bandGroups[band].push(param); - }); - - // Render each band - Object.keys(bandGroups).sort((a, b) => parseInt(a) - parseInt(b)).forEach(band => { - const bandDiv = document.createElement('div'); - bandDiv.className = 'biquad-band'; - - const bandLabel = bandGroups[band][0].band_label || `Band ${band}`; - const bandTitle = document.createElement('h3'); - bandTitle.textContent = bandLabel; - bandDiv.appendChild(bandTitle); - - const coeffsDiv = document.createElement('div'); - coeffsDiv.className = 'biquad-coefficients'; - - bandGroups[band].forEach(param => { - const controlDiv = settingsUI.renderParameter(param, currentSettings, async (k, v) => { await updateSetting(k, v); }); - coeffsDiv.appendChild(controlDiv); - }); - - bandDiv.appendChild(coeffsDiv); - bqContainer.appendChild(bandDiv); - }); - - // Add Sync and Apply buttons (visible in all modes, Apply disabled in non-manual) - const currentMode = currentSettings.eq_ui_mode; - const isManualMode = (currentMode === 4); // TAS5805M_EQ_UI_MODE_MANUAL - - const buttonGroup = document.createElement('div'); - buttonGroup.className = 'button-group'; - - const syncButton = document.createElement('button'); - syncButton.className = 'sync-button'; - syncButton.textContent = 'Sync from DAC'; - syncButton.onclick = () => syncManualCoefficients(); - buttonGroup.appendChild(syncButton); - - const applyButton = document.createElement('button'); - applyButton.className = 'apply-button'; - applyButton.textContent = 'Apply to DAC'; - applyButton.onclick = () => applyManualCoefficients(); - applyButton.disabled = !isManualMode; - buttonGroup.appendChild(applyButton); - - bqContainer.appendChild(buttonGroup); - - contentWrapper.appendChild(bqContainer); - groupDiv.appendChild(contentWrapper); - updateGroupVisibility(groupDiv); - return groupDiv; - } - // Normal parameters if (group.parameters) { group.parameters.forEach(param => { @@ -734,43 +601,6 @@

    EQ Settings

    } } - // Apply manual biquad coefficients - async function applyManualCoefficients() { - try { - const update = { apply_manual_bq: true }; - console.log('Applying manual biquad coefficients to DAC'); - await postRequest('/api/eq/settings', update); - alert('Manual biquad coefficients applied to DAC successfully!'); - } catch (error) { - console.error('Error applying coefficients:', error); - alert(`Error applying coefficients: ${error.message}`); - } - } - - // Sync manual biquad coefficients from DAC - async function syncManualCoefficients() { - try { - const update = { sync_manual_bq: true }; - console.log('Syncing biquad coefficients from DAC to NVS'); - await postRequest('/api/eq/settings', update); - - // Reload schema to show the synced values - console.log('Reloading schema to display synced coefficients...'); - const backendUrl = getBackendUrl(); - const schemaResponse = await fetch(`${backendUrl}/api/eq/schema`); - if (schemaResponse.ok) { - schema = await schemaResponse.json(); - renderUI(); - alert('Coefficients synced from DAC successfully!'); - } else { - alert('Coefficients synced, but failed to reload UI'); - } - } catch (error) { - console.error('Error syncing coefficients:', error); - alert(`Error syncing coefficients: ${error.message}`); - } - } - // Load settings on page load document.addEventListener('DOMContentLoaded', loadSettings); diff --git a/components/ui_http_server/ui_http_server.c b/components/ui_http_server/ui_http_server.c index 59b3f35d..0e6c00cc 100644 --- a/components/ui_http_server/ui_http_server.c +++ b/components/ui_http_server/ui_http_server.c @@ -1,201 +1,131 @@ /* HTTP Server Example - This example code is in the Public Domain (or CC0 licensed, at your + This example code is in the Public Domain (or CC0 licensed, at your option.) - Unless required by applicable law or agreed to in writing, this - software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR - CONDITIONS OF ANY KIND, either express or implied. + Unless required by applicable law or agreed to in writing, this + software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + CONDITIONS OF ANY KIND, either express or implied. */ #include "ui_http_server.h" #include -#include "dsp_processor.h" +#include "dsp_processor_settings.h" #include "esp_err.h" #include "esp_http_server.h" #include "esp_log.h" -#include "esp_spiffs.h" -#include "esp_vfs.h" -#include "nvs_flash.h" #include "freertos/FreeRTOS.h" #include "freertos/queue.h" -#include "freertos/task.h" #include "freertos/semphr.h" -#include "hostname_manager.h" +#include "freertos/task.h" +#include "settings_manager.h" + +#if CONFIG_DAC_TAS5805M +#include "tas5805m_settings.h" +#endif static const char *TAG = "UI_HTTP"; static QueueHandle_t xQueueHttp = NULL; static TaskHandle_t taskHandle = NULL; static httpd_handle_t server = NULL; -static SemaphoreHandle_t nvs_mutex = NULL; - -/** - * List files in SPIFFS directory - */ -static void SPIFFS_Directory(char *path) { - ESP_LOGD(TAG, "%s: path=%s", __func__, path); - DIR *dir = opendir(path); - assert(dir != NULL); - while (true) { - struct dirent *pe = readdir(dir); - if (!pe) break; - ESP_LOGI(TAG, "%s: d_name=%s/%s d_ino=%d d_type=%x", __func__, path, pe->d_name, - pe->d_ino, pe->d_type); - } - closedir(dir); -} - -/** - * Helper: Generate flow-specific NVS key - * Format: "flow__" (e.g., "flow_5_fc_1" for dspfEQBassTreble bass freq) - * This prevents parameter collisions between different DSP flows - */ -static void make_flow_key(char *out_key, size_t out_size, dspFlows_t flow, const char *param) { - snprintf(out_key, out_size, "flow_%d_%s", (int)flow, param); -} - -/** - * Mount SPIFFS filesystem - */ -static esp_err_t SPIFFS_Mount(char *path, char *label, int max_files) { - ESP_LOGD(TAG, "%s: path=%s label=%s max_files=%d", __func__, path, label, max_files); - esp_err_t ret; - - if (!esp_spiffs_mounted(label)) { - esp_vfs_spiffs_conf_t conf = {.base_path = path, - .partition_label = label, - .max_files = max_files, - .format_if_mount_failed = true}; - - // Use settings defined above to initialize and mount SPIFFS file system. - // Note: esp_vfs_spiffs_register is an all-in-one convenience function. - ret = esp_vfs_spiffs_register(&conf); - - if (ret != ESP_OK) { - if (ret == ESP_FAIL) { - ESP_LOGE(TAG, "%s: Failed to mount or format filesystem", __func__); - } else if (ret == ESP_ERR_NOT_FOUND) { - ESP_LOGE(TAG, "%s: Failed to find SPIFFS partition", __func__); - } else { - ESP_LOGE(TAG, "%s: Failed to initialize SPIFFS (%s)", __func__, esp_err_to_name(ret)); - } - return ret; - } - } - size_t total = 0, used = 0; - ret = esp_spiffs_info(label, &total, &used); - if (ret != ESP_OK) { - ESP_LOGE(TAG, "%s: Failed to get SPIFFS partition information (%s)", __func__, - esp_err_to_name(ret)); - } else { - ESP_LOGI(TAG, "%s: Partition size: total: %d, used: %d", __func__, total, used); - } - - if (ret == ESP_OK) { - ESP_LOGI(TAG, "%s: Mount %s to %s success", __func__, path, label); - SPIFFS_Directory(path); - } - - return ret; -} - -/** - * Convert text file to HTML response - */ -static esp_err_t Text2Html(httpd_req_t *req, char *filename) { - ESP_LOGD(TAG, "%s: filename=%s", __func__, filename); - // ESP_LOGI(TAG, "Reading %s", filename); - FILE *fhtml = fopen(filename, "r"); - if (fhtml == NULL) { - ESP_LOGE(TAG, "%s: fopen fail. [%s]", __func__, filename); - return ESP_FAIL; - } else { - char line[128]; - while (fgets(line, sizeof(line), fhtml) != NULL) { - size_t linelen = strlen(line); - // Remove EOL (CR or LF) but add back \n for proper line breaks - for (int i = linelen; i > 0; i--) { - if (line[i - 1] == 0x0a) { - line[i - 1] = 0; - } else if (line[i - 1] == 0x0d) { - line[i - 1] = 0; - } else { - break; - } - } - ESP_LOGV(TAG, "line=[%s]", line); - if (strlen(line) == 0) { - // Send empty line as newline to preserve structure - httpd_resp_sendstr_chunk(req, "\n"); - continue; - } - // Send line content - esp_err_t ret = httpd_resp_sendstr_chunk(req, line); - if (ret != ESP_OK) { - ESP_LOGE(TAG, "%s: httpd_resp_sendstr_chunk fail %d", __func__, ret); - } - // Add newline after each line to preserve line breaks - httpd_resp_sendstr_chunk(req, "\n"); - } - fclose(fhtml); - } - return ESP_OK; -} +// External references to embedded files +extern const uint8_t index_html_start[] asm("_binary_index_html_start"); +extern const uint8_t index_html_end[] asm("_binary_index_html_end"); +extern const uint8_t index_js_start[] asm("_binary_index_js_start"); +extern const uint8_t index_js_end[] asm("_binary_index_js_end"); +extern const uint8_t settings_ui_js_start[] asm("_binary_settings_ui_js_start"); +extern const uint8_t settings_ui_js_end[] asm("_binary_settings_ui_js_end"); +extern const uint8_t styles_css_start[] asm("_binary_styles_css_start"); +extern const uint8_t styles_css_end[] asm("_binary_styles_css_end"); +extern const uint8_t general_settings_html_start[] asm("_binary_general_settings_html_start"); +extern const uint8_t general_settings_html_end[] asm("_binary_general_settings_html_end"); +extern const uint8_t dsp_settings_html_start[] asm("_binary_dsp_settings_html_start"); +extern const uint8_t dsp_settings_html_end[] asm("_binary_dsp_settings_html_end"); +extern const uint8_t dac_settings_html_start[] asm("_binary_dac_settings_html_start"); +extern const uint8_t dac_settings_html_end[] asm("_binary_dac_settings_html_end"); +extern const uint8_t eq_settings_html_start[] asm("_binary_eq_settings_html_start"); +extern const uint8_t eq_settings_html_end[] asm("_binary_eq_settings_html_end"); +extern const uint8_t favicon_ico_start[] asm("_binary_favicon_ico_start"); +extern const uint8_t favicon_ico_end[] asm("_binary_favicon_ico_end"); + +// Structure to map URI paths to embedded files +typedef struct { + const char *uri; + const uint8_t *data_start; + const uint8_t *data_end; + const char *content_type; +} embedded_file_t; + +static const embedded_file_t embedded_files[] = { + {"/", index_html_start, index_html_end, "text/html; charset=utf-8"}, + {"/index.html", index_html_start, index_html_end, "text/html; charset=utf-8"}, + {"/index.js", index_js_start, index_js_end, "application/javascript; charset=utf-8"}, + {"/settings-ui.js", settings_ui_js_start, settings_ui_js_end, "application/javascript; charset=utf-8"}, + {"/styles.css", styles_css_start, styles_css_end, "text/css; charset=utf-8"}, + {"/general-settings.html", general_settings_html_start, general_settings_html_end, "text/html; charset=utf-8"}, + {"/dsp-settings.html", dsp_settings_html_start, dsp_settings_html_end, "text/html; charset=utf-8"}, + {"/dac-settings.html", dac_settings_html_start, dac_settings_html_end, "text/html; charset=utf-8"}, + {"/eq-settings.html", eq_settings_html_start, eq_settings_html_end, "text/html; charset=utf-8"}, + {"/favicon.ico", favicon_ico_start, favicon_ico_end, "image/x-icon"}, +}; /** * Simple URL decode function * Decodes %XX hex sequences and + as space */ static void url_decode(char *dst, const char *src, size_t dst_size) { - size_t dst_idx = 0; - size_t src_idx = 0; - - while (src[src_idx] != '\0' && dst_idx < dst_size - 1) { - if (src[src_idx] == '%' && src[src_idx + 1] != '\0' && src[src_idx + 2] != '\0') { - // Decode %XX - char hex[3] = {src[src_idx + 1], src[src_idx + 2], '\0'}; - dst[dst_idx++] = (char)strtol(hex, NULL, 16); - src_idx += 3; - } else if (src[src_idx] == '+') { - // Convert + to space - dst[dst_idx++] = ' '; - src_idx++; - } else { - dst[dst_idx++] = src[src_idx++]; - } - } - dst[dst_idx] = '\0'; + size_t dst_idx = 0; + size_t src_idx = 0; + + while (src[src_idx] != '\0' && dst_idx < dst_size - 1) { + if (src[src_idx] == '%' && src[src_idx + 1] != '\0' && + src[src_idx + 2] != '\0') { + // Decode %XX + char hex[3] = {src[src_idx + 1], src[src_idx + 2], '\0'}; + dst[dst_idx++] = (char)strtol(hex, NULL, 16); + src_idx += 3; + } else if (src[src_idx] == '+') { + // Convert + to space + dst[dst_idx++] = ' '; + src_idx++; + } else { + dst[dst_idx++] = src[src_idx++]; + } + } + dst[dst_idx] = '\0'; } /** * Find key value in parameter string */ static int find_key_value(char *key, char *parameter, char *value) { - ESP_LOGD(TAG, "%s: key=%s", __func__, key); - // char * addr1; - char *addr1 = strstr(parameter, key); - if (addr1 == NULL) return 0; - ESP_LOGD(TAG, "%s: addr1=%s", __func__, addr1); - - char *addr2 = addr1 + strlen(key); - ESP_LOGD(TAG, "%s: addr2=[%s]", __func__, addr2); - - char *addr3 = strstr(addr2, "&"); - ESP_LOGD(TAG, "%s: addr3=%p", __func__, addr3); - if (addr3 == NULL) { - strcpy(value, addr2); - } else { - int length = addr3 - addr2; - ESP_LOGD(TAG, "%s: addr2=%p addr3=%p length=%d", __func__, addr2, addr3, length); - strncpy(value, addr2, length); - value[length] = 0; - } - ESP_LOGD(TAG, "%s: key=[%s] value=[%s]", __func__, key, value); - return strlen(value); + ESP_LOGD(TAG, "%s: key=%s", __func__, key); + // char * addr1; + char *addr1 = strstr(parameter, key); + if (addr1 == NULL) + return 0; + ESP_LOGD(TAG, "%s: addr1=%s", __func__, addr1); + + char *addr2 = addr1 + strlen(key); + ESP_LOGD(TAG, "%s: addr2=[%s]", __func__, addr2); + + char *addr3 = strstr(addr2, "&"); + ESP_LOGD(TAG, "%s: addr3=%p", __func__, addr3); + if (addr3 == NULL) { + strcpy(value, addr2); + } else { + int length = addr3 - addr2; + ESP_LOGD(TAG, "%s: addr2=%p addr3=%p length=%d", __func__, addr2, addr3, + length); + strncpy(value, addr2, length); + value[length] = 0; + } + ESP_LOGD(TAG, "%s: key=[%s] value=[%s]", __func__, key, value); + return strlen(value); } /** @@ -203,684 +133,1163 @@ static int find_key_value(char *key, char *parameter, char *value) { * This enables local development with ?backend parameter */ static void set_cors_headers(httpd_req_t *req) { - httpd_resp_set_hdr(req, "Access-Control-Allow-Origin", "*"); - httpd_resp_set_hdr(req, "Access-Control-Allow-Methods", "GET, POST, OPTIONS"); - httpd_resp_set_hdr(req, "Access-Control-Allow-Headers", "Content-Type"); - httpd_resp_set_hdr(req, "Access-Control-Max-Age", "86400"); + httpd_resp_set_hdr(req, "Access-Control-Allow-Origin", "*"); + httpd_resp_set_hdr(req, "Access-Control-Allow-Methods", + "GET, POST, DELETE, OPTIONS"); + httpd_resp_set_hdr(req, "Access-Control-Allow-Headers", "Content-Type"); + httpd_resp_set_hdr(req, "Access-Control-Max-Age", "86400"); } /** - * HTTP get handler + * HTTP get handler - serves index.html from embedded files */ static esp_err_t root_get_handler(httpd_req_t *req) { - ESP_LOGD(TAG, "%s: uri=%s", __func__, req->uri); + ESP_LOGD(TAG, "%s: uri=%s", __func__, req->uri); - set_cors_headers(req); + set_cors_headers(req); + httpd_resp_set_type(req, "text/html; charset=utf-8"); - /* Send index.html */ - Text2Html(req, "/html/index.html"); + /* Send index.html from embedded data (subtract 1 for null terminator) */ + size_t index_size = index_html_end - index_html_start - 1; + httpd_resp_send(req, (const char *)index_html_start, index_size); - /* Send empty chunk to signal HTTP response completion */ - httpd_resp_sendstr_chunk(req, NULL); - - return ESP_OK; + return ESP_OK; } /* * HTTP post handler - * Expects a single parameter change in the query string: /post?param=NAME&value=INT + * Expects a single parameter change in the query string: + * /post?param=NAME&value=INT */ static esp_err_t root_post_handler(httpd_req_t *req) { - ESP_LOGD(TAG, "%s: uri=%s", __func__, req->uri); - URL_t urlBuf; - int ret = -1; - char param[16] = {0}; - char valstr[64] = {0}; // Increased size for hostname - - set_cors_headers(req); - - memset(&urlBuf, 0, sizeof(URL_t)); - - if (find_key_value("param=", (char *)req->uri, param) && - find_key_value("value=", (char *)req->uri, valstr)) { - - // Special handling for hostname (string parameter) - if (strcmp(param, "hostname") == 0) { - // URL decode the hostname value - char decoded_hostname[64] = {0}; - url_decode(decoded_hostname, valstr, sizeof(decoded_hostname)); - - ESP_LOGI(TAG, "%s: Setting hostname to: %s", __func__, decoded_hostname); - - if (hostname_set(decoded_hostname) == ESP_OK) { - httpd_resp_set_status(req, "200 OK"); - httpd_resp_sendstr(req, "ok"); - } else { - httpd_resp_set_status(req, "400 Bad Request"); - httpd_resp_sendstr(req, "Invalid hostname"); - } - return ESP_OK; - } - - // Parse integer value; strtol skips leading whitespace - long v = strtol(valstr, NULL, 10); - urlBuf.int_value = (int32_t)v; - strncpy(urlBuf.key, param, sizeof(urlBuf.key) - 1); - ret = 0; - ESP_LOGD(TAG, "%s: Received param=%s value=%d", __func__, urlBuf.key, urlBuf.int_value); - } else { - ESP_LOGD(TAG, "%s: Invalid post: expected param=NAME&value=INT in URI", __func__); - } - - if (ret >= 0) { - // Send to http_server_task with timeout to prevent handler from blocking indefinitely - if (xQueueSend(xQueueHttp, &urlBuf, pdMS_TO_TICKS(1000)) != pdPASS) { - ESP_LOGE(TAG, "%s: xQueueSend Fail (queue full or timeout)", __func__); - httpd_resp_set_status(req, "503 Service Unavailable"); - httpd_resp_sendstr(req, "Queue full, try again"); - return ESP_OK; - } - } + ESP_LOGD(TAG, "%s: uri=%s", __func__, req->uri); + URL_t urlBuf; + int ret = -1; + char param[16] = {0}; + char valstr[64] = {0}; // Increased size for hostname + + set_cors_headers(req); + + memset(&urlBuf, 0, sizeof(URL_t)); + + if (find_key_value("param=", (char *)req->uri, param) && + find_key_value("value=", (char *)req->uri, valstr)) { + + // Special handling for hostname (string parameter) + if (strcmp(param, "hostname") == 0) { + // URL decode the hostname value + char decoded_hostname[64] = {0}; + url_decode(decoded_hostname, valstr, sizeof(decoded_hostname)); + + ESP_LOGI(TAG, "%s: Setting hostname to: %s", __func__, + decoded_hostname); + + if (settings_set_hostname(decoded_hostname) == ESP_OK) { + httpd_resp_set_status(req, "200 OK"); + httpd_resp_sendstr(req, "ok"); + } else { + httpd_resp_set_status(req, "400 Bad Request"); + httpd_resp_sendstr(req, "Invalid hostname"); + } + return ESP_OK; + } + + // Special handling for snapserver host (string parameter) + if (strcmp(param, "snapserver_host") == 0) { + char decoded_host[128] = {0}; + url_decode(decoded_host, valstr, sizeof(decoded_host)); + ESP_LOGI(TAG, "%s: Setting snapserver_host to: %s", __func__, + decoded_host); + if (settings_set_server_host(decoded_host) == ESP_OK) { + httpd_resp_set_status(req, "200 OK"); + httpd_resp_sendstr(req, "ok"); + } else { + httpd_resp_set_status(req, "500 Internal Server Error"); + httpd_resp_sendstr(req, "error"); + } + return ESP_OK; + } + + // Special handling for snapserver_use_mdns (boolean/integer) + if (strcmp(param, "snapserver_use_mdns") == 0) { + long v = strtol(valstr, NULL, 10); + ESP_LOGI(TAG, "%s: Setting snapserver_use_mdns to: %ld", __func__, + v); + + if (settings_set_mdns_enabled(v != 0) == ESP_OK) { + httpd_resp_set_status(req, "200 OK"); + httpd_resp_sendstr(req, "ok"); + } else { + httpd_resp_set_status(req, "500 Internal Server Error"); + httpd_resp_sendstr(req, "error"); + } + return ESP_OK; + } + + // Special handling for snapserver_port (integer) + if (strcmp(param, "snapserver_port") == 0) { + long v = strtol(valstr, NULL, 10); + ESP_LOGI(TAG, "%s: Setting snapserver_port to: %ld", __func__, v); + if (settings_set_server_port((int32_t)v) == ESP_OK) { + httpd_resp_set_status(req, "200 OK"); + httpd_resp_sendstr(req, "ok"); + } else { + httpd_resp_set_status(req, "500 Internal Server Error"); + httpd_resp_sendstr(req, "error"); + } + return ESP_OK; + } + + // Parse integer value; strtol skips leading whitespace + long v = strtol(valstr, NULL, 10); + urlBuf.int_value = (int32_t)v; + strncpy(urlBuf.key, param, sizeof(urlBuf.key) - 1); + ret = 0; + ESP_LOGD(TAG, "%s: Received param=%s value=%d", __func__, urlBuf.key, + urlBuf.int_value); + } else { + ESP_LOGD(TAG, "%s: Invalid post: expected param=NAME&value=INT in URI", + __func__); + } + + if (ret >= 0) { + // Send to http_server_task with timeout to prevent handler from + // blocking indefinitely + if (xQueueSend(xQueueHttp, &urlBuf, pdMS_TO_TICKS(1000)) != pdPASS) { + ESP_LOGE(TAG, "%s: xQueueSend Fail (queue full or timeout)", + __func__); + httpd_resp_set_status(req, "503 Service Unavailable"); + httpd_resp_sendstr(req, "Queue full, try again"); + return ESP_OK; + } + } + + httpd_resp_set_status(req, "200 OK"); + httpd_resp_sendstr(req, "ok"); + return ESP_OK; +} - httpd_resp_set_status(req, "200 OK"); - httpd_resp_sendstr(req, "ok"); - return ESP_OK; +/* + * HTTP DELETE handler + * Clears a parameter from NVS: /delete?param=NAME + */ +static esp_err_t root_delete_handler(httpd_req_t *req) { + ESP_LOGD(TAG, "%s: uri=%s", __func__, req->uri); + char param[32] = {0}; + + set_cors_headers(req); + + if (!find_key_value("param=", (char *)req->uri, param)) { + ESP_LOGD(TAG, "%s: Invalid delete: expected param=NAME in URI", + __func__); + httpd_resp_set_status(req, "400 Bad Request"); + httpd_resp_sendstr(req, "Missing param"); + return ESP_OK; + } + + // Handle hostname clear + if (strcmp(param, "hostname") == 0) { + ESP_LOGI(TAG, "%s: Clearing hostname from NVS", __func__); + if (settings_clear_hostname() == ESP_OK) { + httpd_resp_set_status(req, "200 OK"); + httpd_resp_sendstr(req, "ok"); + } else { + httpd_resp_set_status(req, "500 Internal Server Error"); + httpd_resp_sendstr(req, "error"); + } + return ESP_OK; + } + + // Handle snapserver_use_mdns clear + if (strcmp(param, "snapserver_use_mdns") == 0) { + ESP_LOGI(TAG, "%s: Clearing snapserver_use_mdns from NVS", __func__); + if (settings_clear_mdns_enabled() == ESP_OK) { + httpd_resp_set_status(req, "200 OK"); + httpd_resp_sendstr(req, "ok"); + } else { + httpd_resp_set_status(req, "500 Internal Server Error"); + httpd_resp_sendstr(req, "error"); + } + return ESP_OK; + } + + // Handle snapserver_host clear + if (strcmp(param, "snapserver_host") == 0) { + ESP_LOGI(TAG, "%s: Clearing snapserver_host from NVS", __func__); + if (settings_clear_server_host() == ESP_OK) { + httpd_resp_set_status(req, "200 OK"); + httpd_resp_sendstr(req, "ok"); + } else { + httpd_resp_set_status(req, "500 Internal Server Error"); + httpd_resp_sendstr(req, "error"); + } + return ESP_OK; + } + + // Handle snapserver_port clear + if (strcmp(param, "snapserver_port") == 0) { + ESP_LOGI(TAG, "%s: Clearing snapserver_port from NVS", __func__); + if (settings_clear_server_port() == ESP_OK) { + httpd_resp_set_status(req, "200 OK"); + httpd_resp_sendstr(req, "ok"); + } else { + httpd_resp_set_status(req, "500 Internal Server Error"); + httpd_resp_sendstr(req, "error"); + } + return ESP_OK; + } + + // Unknown parameter + httpd_resp_set_status(req, "400 Bad Request"); + httpd_resp_sendstr(req, "Unknown parameter"); + return ESP_OK; } /* * GET parameter handler * Returns current parameter value: /get?param=NAME * Response format: plain text integer value - * + * * This reads from the DSP processor's centralized storage for the active flow */ static esp_err_t get_param_handler(httpd_req_t *req) { - ESP_LOGD(TAG, "%s: uri=%s", __func__, req->uri); - char param[16] = {0}; - - set_cors_headers(req); - - if (find_key_value("param=", (char *)req->uri, param)) { - // Special handling for hostname (string parameter) - if (strcmp(param, "hostname") == 0) { - char hostname[64] = {0}; - if (hostname_get(hostname, sizeof(hostname)) == ESP_OK) { - httpd_resp_set_status(req, "200 OK"); - httpd_resp_set_type(req, "text/plain"); - httpd_resp_sendstr(req, hostname); - ESP_LOGD(TAG, "%s: hostname=%s", __func__, hostname); - } else { - httpd_resp_set_status(req, "500 Internal Server Error"); - httpd_resp_sendstr(req, "error"); - } - return ESP_OK; - } - + ESP_LOGD(TAG, "%s: uri=%s", __func__, req->uri); + char param[16] = {0}; + + set_cors_headers(req); + + if (find_key_value("param=", (char *)req->uri, param)) { + // Special handling for hostname (string parameter) + if (strcmp(param, "hostname") == 0) { + char hostname[64] = {0}; + if (settings_get_hostname(hostname, sizeof(hostname)) == ESP_OK) { + httpd_resp_set_status(req, "200 OK"); + httpd_resp_set_type(req, "text/plain"); + httpd_resp_sendstr(req, hostname); + ESP_LOGD(TAG, "%s: hostname=%s", __func__, hostname); + } else { + httpd_resp_set_status(req, "500 Internal Server Error"); + httpd_resp_sendstr(req, "error"); + } + return ESP_OK; + } + + if (strcmp(param, "snapserver_use_mdns") == 0) { + bool enabled = true; + if (settings_get_mdns_enabled(&enabled) == ESP_OK) { + char resp[8]; + snprintf(resp, sizeof(resp), "%d", enabled ? 1 : 0); + httpd_resp_set_status(req, "200 OK"); + httpd_resp_set_type(req, "text/plain"); + httpd_resp_sendstr(req, resp); + ESP_LOGD(TAG, "%s: snapserver_use_mdns=%d", __func__, + enabled ? 1 : 0); + } else { + httpd_resp_set_status(req, "200 OK"); + httpd_resp_set_type(req, "text/plain"); + httpd_resp_sendstr(req, "1"); + ESP_LOGD( + TAG, + "%s: snapserver_use_mdns not found, returning default 1", + __func__); + } + return ESP_OK; + } + + if (strcmp(param, "snapserver_host") == 0) { + char host[128] = {0}; + if (settings_get_server_host(host, sizeof(host)) == ESP_OK) { + httpd_resp_set_status(req, "200 OK"); + httpd_resp_set_type(req, "text/plain"); + httpd_resp_sendstr(req, host); + ESP_LOGD(TAG, "%s: snapserver_host=%s", __func__, host); + } else { + httpd_resp_set_status(req, "200 OK"); + httpd_resp_set_type(req, "text/plain"); + httpd_resp_sendstr(req, ""); + ESP_LOGD(TAG, "%s: snapserver_host not found, returning empty", + __func__); + } + return ESP_OK; + } + + if (strcmp(param, "snapserver_port") == 0) { + int32_t port = 0; + if (settings_get_server_port(&port) == ESP_OK && port != 0) { + char resp[16]; + snprintf(resp, sizeof(resp), "%d", (int)port); + httpd_resp_set_status(req, "200 OK"); + httpd_resp_set_type(req, "text/plain"); + httpd_resp_sendstr(req, resp); + ESP_LOGD(TAG, "%s: snapserver_port=%d", __func__, (int)port); + } else { + httpd_resp_set_status(req, "200 OK"); + httpd_resp_set_type(req, "text/plain"); + httpd_resp_sendstr(req, ""); + ESP_LOGD(TAG, "%s: snapserver_port not found, returning empty", + __func__); + } + return ESP_OK; + } + #if CONFIG_USE_DSP_PROCESSOR - // Get current flow from DSP processor - dspFlows_t current_flow = dsp_processor_get_current_flow(); - - // Get parameters for current flow - filterParams_t params; - if (dsp_processor_get_params_for_flow(current_flow, ¶ms) == ESP_OK) { - int32_t value = 0; - - // Map parameter name to value - if (strcmp(param, "fc_1") == 0) { - value = (int32_t)params.fc_1; - } else if (strcmp(param, "gain_1") == 0) { - value = (int32_t)params.gain_1; - } else if (strcmp(param, "fc_2") == 0) { - value = (int32_t)params.fc_2; - } else if (strcmp(param, "gain_2") == 0) { - value = (int32_t)params.gain_2; - } else if (strcmp(param, "fc_3") == 0) { - value = (int32_t)params.fc_3; - } else if (strcmp(param, "gain_3") == 0) { - value = (int32_t)params.gain_3; - } else { - httpd_resp_set_status(req, "400 Bad Request"); - httpd_resp_sendstr(req, "Unknown parameter"); - return ESP_OK; - } - - char response[32]; - snprintf(response, sizeof(response), "%d", (int)value); - httpd_resp_set_status(req, "200 OK"); - httpd_resp_set_type(req, "text/plain"); - httpd_resp_sendstr(req, response); - ESP_LOGD(TAG, "%s: flow=%d %s=%d", __func__, current_flow, param, (int)value); - } else { - httpd_resp_set_status(req, "500 Internal Server Error"); - httpd_resp_sendstr(req, "0"); - } + // Get current flow from settings + dspFlows_t current_flow = dsp_settings_get_active_flow(); + + // Get parameters for current flow + filterParams_t params; + if (dsp_settings_get_flow_params(current_flow, ¶ms) == ESP_OK) { + int32_t value = 0; // Map parameter name to value + if (strcmp(param, "fc_1") == 0) { + value = (int32_t)params.fc_1; + } else if (strcmp(param, "gain_1") == 0) { + value = (int32_t)params.gain_1; + } else if (strcmp(param, "fc_2") == 0) { + value = (int32_t)params.fc_2; + } else if (strcmp(param, "gain_2") == 0) { + value = (int32_t)params.gain_2; + } else if (strcmp(param, "fc_3") == 0) { + value = (int32_t)params.fc_3; + } else if (strcmp(param, "gain_3") == 0) { + value = (int32_t)params.gain_3; + } else { + httpd_resp_set_status(req, "400 Bad Request"); + httpd_resp_sendstr(req, "Unknown parameter"); + return ESP_OK; + } + + char response[32]; + snprintf(response, sizeof(response), "%d", (int)value); + httpd_resp_set_status(req, "200 OK"); + httpd_resp_set_type(req, "text/plain"); + httpd_resp_sendstr(req, response); + ESP_LOGD(TAG, "%s: flow=%d %s=%d", __func__, current_flow, param, + (int)value); + } else { + httpd_resp_set_status(req, "500 Internal Server Error"); + httpd_resp_sendstr(req, "0"); + } #else - // Fallback: load from NVS with flow-specific key - int32_t active_flow_val = 0; - dspFlows_t current_flow = dspfEQBassTreble; - if (ui_http_load_param("active_flow", &active_flow_val) == ESP_OK) { - current_flow = (dspFlows_t)active_flow_val; - } - - char flow_key[32]; - make_flow_key(flow_key, sizeof(flow_key), current_flow, param); - - int32_t value = 0; - if (ui_http_load_param(flow_key, &value) == ESP_OK) { - char response[32]; - snprintf(response, sizeof(response), "%d", (int)value); - httpd_resp_set_status(req, "200 OK"); - httpd_resp_set_type(req, "text/plain"); - httpd_resp_sendstr(req, response); - ESP_LOGD(TAG, "%s: %s=%d", __func__, flow_key, (int)value); - } else { - httpd_resp_set_status(req, "404 Not Found"); - httpd_resp_sendstr(req, "0"); - ESP_LOGD(TAG, "%s: %s not found, returning 0", __func__, flow_key); - } + // Fallback: load from NVS using dsp_settings + dspFlows_t current_flow = dspfEQBassTreble; + if (dsp_settings_load_active_flow(¤t_flow) != ESP_OK) { + current_flow = dspfEQBassTreble; // default + } + + int32_t value = 0; + if (dsp_settings_load_flow_param(current_flow, param, &value) == + ESP_OK) { + char response[32]; + snprintf(response, sizeof(response), "%d", (int)value); + httpd_resp_set_status(req, "200 OK"); + httpd_resp_set_type(req, "text/plain"); + httpd_resp_sendstr(req, response); + ESP_LOGD(TAG, "%s: flow=%d %s=%d", __func__, current_flow, param, + (int)value); + } else { + httpd_resp_set_status(req, "404 Not Found"); + httpd_resp_sendstr(req, "0"); + ESP_LOGD(TAG, "%s: flow=%d %s not found, returning 0", __func__, + current_flow, param); + } #endif - } else { - httpd_resp_set_status(req, "400 Bad Request"); - httpd_resp_sendstr(req, "error"); - } - return ESP_OK; + } else { + httpd_resp_set_status(req, "400 Bad Request"); + httpd_resp_sendstr(req, "error"); + } + return ESP_OK; } /* * GET capabilities handler - * Returns DSP capabilities as JSON: /capabilities + * Returns settings based on the 'tab' parameter: /capabilities?tab=general or + * /capabilities?tab=dsp + * + * Response for tab=general: + * - hostname, mdns_enabled, server_host, server_port + * + * Response for tab=dsp (if DSP enabled): + * - active_flow and all flow parameters */ static esp_err_t get_capabilities_handler(httpd_req_t *req) { + ESP_LOGD(TAG, "%s: uri=%s", __func__, req->uri); + + set_cors_headers(req); + + // Parse tab parameter + char tab[16] = {0}; + if (!find_key_value("tab=", (char *)req->uri, tab)) { + // No tab specified, return error + ESP_LOGW(TAG, "%s: Missing 'tab' parameter", __func__); + httpd_resp_set_status(req, "400 Bad Request"); + httpd_resp_sendstr(req, "{\"error\": \"Missing 'tab' parameter. Use " + "?tab=general or ?tab=dsp\"}"); + return ESP_OK; + } + + ESP_LOGI(TAG, "%s: Requested tab: %s", __func__, tab); + + if (strcmp(tab, "general") == 0) { + // Return general settings + char general_json[512] = {0}; + esp_err_t ret = settings_get_json(general_json, sizeof(general_json)); + + if (ret != ESP_OK) { + ESP_LOGE(TAG, "%s: Failed to get general settings JSON: %s", + __func__, esp_err_to_name(ret)); + httpd_resp_set_status(req, "500 Internal Server Error"); + httpd_resp_sendstr( + req, "{\"error\": \"Failed to retrieve general settings\"}"); + return ESP_OK; + } + + httpd_resp_set_status(req, "200 OK"); + httpd_resp_set_type(req, "application/json"); + httpd_resp_sendstr(req, general_json); + + } else if (strcmp(tab, "dsp") == 0) { +#if CONFIG_USE_DSP_PROCESSOR + // Return DSP settings - allocate larger buffer for schema + values + char *dsp_json = (char *)malloc(4096); + if (!dsp_json) { + ESP_LOGE(TAG, "%s: Failed to allocate memory for DSP JSON", + __func__); + httpd_resp_set_status(req, "500 Internal Server Error"); + httpd_resp_sendstr(req, + "{\"error\": \"Memory allocation failed\"}"); + return ESP_OK; + } + + esp_err_t ret = dsp_settings_get_json(dsp_json, 4096); + + if (ret != ESP_OK) { + ESP_LOGE(TAG, "%s: Failed to get DSP settings JSON: %s", __func__, + esp_err_to_name(ret)); + free(dsp_json); + httpd_resp_set_status(req, "500 Internal Server Error"); + httpd_resp_sendstr( + req, "{\"error\": \"Failed to retrieve DSP settings\"}"); + return ESP_OK; + } + + httpd_resp_set_status(req, "200 OK"); + httpd_resp_set_type(req, "application/json"); + httpd_resp_sendstr(req, dsp_json); + free(dsp_json); +#else + // DSP not enabled + httpd_resp_set_status(req, "200 OK"); + httpd_resp_set_type(req, "application/json"); + httpd_resp_sendstr(req, "{\"dsp_enabled\": false}"); +#endif + + } else { + // Unknown tab + ESP_LOGW(TAG, "%s: Unknown tab: %s", __func__, tab); + httpd_resp_set_status(req, "400 Bad Request"); + httpd_resp_sendstr( + req, "{\"error\": \"Unknown tab. Use ?tab=general or ?tab=dsp\"}"); + } + + return ESP_OK; +} + +/* + * favicon get handler + * Returns 404 since we don't have a favicon + */ +static esp_err_t favicon_get_handler(httpd_req_t *req) { + ESP_LOGD(TAG, "%s: uri=%s", __func__, req->uri); + set_cors_headers(req); + httpd_resp_set_status(req, "404 Not Found"); + httpd_resp_set_type(req, "text/plain"); + httpd_resp_sendstr(req, "No favicon available"); + return ESP_OK; +} + +/* + * GET /api/dac/settings handler + * Returns current TAS5805M DAC settings as JSON + */ +static esp_err_t get_dac_settings_handler(httpd_req_t *req) { ESP_LOGD(TAG, "%s: uri=%s", __func__, req->uri); set_cors_headers(req); -#if CONFIG_USE_DSP_PROCESSOR - char* capabilities_json = dsp_processor_get_capabilities_json(); - if (capabilities_json) { - httpd_resp_set_status(req, "200 OK"); - httpd_resp_set_type(req, "application/json"); - httpd_resp_sendstr(req, capabilities_json); - free(capabilities_json); - } else { +#if CONFIG_DAC_TAS5805M + char *dac_json = (char *)malloc(1024); + if (!dac_json) { + ESP_LOGE(TAG, "%s: Failed to allocate memory for DAC JSON", __func__); httpd_resp_set_status(req, "500 Internal Server Error"); - httpd_resp_sendstr(req, "{\"error\": \"Failed to generate capabilities\"}"); + httpd_resp_sendstr(req, "{\"error\": \"Memory allocation failed\"}"); + return ESP_OK; } -#else + + esp_err_t ret = tas5805m_settings_get_dac_json(dac_json, 1024); + + if (ret != ESP_OK) { + ESP_LOGE(TAG, "%s: Failed to get DAC settings JSON: %s", __func__, esp_err_to_name(ret)); + free(dac_json); + httpd_resp_set_status(req, "500 Internal Server Error"); + httpd_resp_sendstr(req, "{\"error\": \"Failed to retrieve DAC settings\"}"); + return ESP_OK; + } + httpd_resp_set_status(req, "200 OK"); httpd_resp_set_type(req, "application/json"); - httpd_resp_sendstr(req, "{\"version\": \"1.0\", \"flows\": [], \"current_flow\": \"none\"}"); -#endif + httpd_resp_sendstr(req, dac_json); + free(dac_json); return ESP_OK; +#else + httpd_resp_set_status(req, "404 Not Found"); + httpd_resp_sendstr(req, "{\"error\": \"TAS5805M not configured\"}"); + return ESP_OK; +#endif } /* - * favicon get handler - * Returns 404 since we don't have a favicon + * GET /api/dac/schema handler + * Returns TAS5805M DAC settings schema as JSON */ -static esp_err_t favicon_get_handler(httpd_req_t *req) { +static esp_err_t get_dac_schema_handler(httpd_req_t *req) { ESP_LOGD(TAG, "%s: uri=%s", __func__, req->uri); + set_cors_headers(req); + +#if CONFIG_DAC_TAS5805M + /* Allocate schema buffer size conditionally: large buffer only if EQ support enabled */ + #if defined(CONFIG_DAC_TAS5805M_EQ_SUPPORT) + /* EQ adds many parameters to the schema; increase buffer slightly to avoid overflow */ + const size_t schema_buf_size = 36 * 1024; /* 12 KiB */ + #else + const size_t schema_buf_size = 3 * 1024; /* 3 KiB */ + #endif + + char *schema_json = (char *)malloc(schema_buf_size); + if (!schema_json) { + ESP_LOGE(TAG, "%s: Failed to allocate memory for DAC schema JSON (size=%zu)", __func__, schema_buf_size); + httpd_resp_set_status(req, "500 Internal Server Error"); + httpd_resp_sendstr(req, "{\"error\": \"Memory allocation failed\"}"); + return ESP_OK; + } + + /* Use DAC-only schema generator to avoid including EQ parameters */ + esp_err_t ret = tas5805m_settings_get_dac_schema_json(schema_json, schema_buf_size); + + if (ret != ESP_OK) { + ESP_LOGE(TAG, "%s: Failed to get DAC schema JSON: %s", __func__, esp_err_to_name(ret)); + free(schema_json); + httpd_resp_set_status(req, "500 Internal Server Error"); + httpd_resp_sendstr(req, "{\"error\": \"Failed to retrieve DAC schema\"}"); + return ESP_OK; + } + + httpd_resp_set_status(req, "200 OK"); + httpd_resp_set_type(req, "application/json"); + httpd_resp_sendstr(req, schema_json); + free(schema_json); + + return ESP_OK; +#else httpd_resp_set_status(req, "404 Not Found"); - httpd_resp_set_type(req, "text/plain"); - httpd_resp_sendstr(req, "No favicon available"); + httpd_resp_sendstr(req, "{\"error\": \"TAS5805M not configured\"}"); return ESP_OK; +#endif } /* - * Static file handler - * Serves files from SPIFFS /html directory + * POST /api/dac/settings handler + * Updates TAS5805M DAC settings from JSON */ -static esp_err_t static_file_handler(httpd_req_t *req) { +static esp_err_t post_dac_settings_handler(httpd_req_t *req) { ESP_LOGD(TAG, "%s: uri=%s", __func__, req->uri); set_cors_headers(req); - // Build file path - use smaller buffer to save stack space - char filepath[128]; - // Check URI length to prevent truncation - if (strlen(req->uri) > sizeof(filepath) - 6) { // 6 = strlen("/html") + 1 - ESP_LOGW(TAG, "%s: URI too long: %s", __func__, req->uri); - httpd_resp_set_status(req, "414 URI Too Long"); - httpd_resp_sendstr(req, "URI too long"); +#if CONFIG_DAC_TAS5805M + // Allocate buffer for request body + char *buf = (char *)malloc(req->content_len + 1); + if (!buf) { + ESP_LOGE(TAG, "%s: Failed to allocate buffer for request body", __func__); + httpd_resp_set_status(req, "500 Internal Server Error"); + httpd_resp_sendstr(req, "{\"error\": \"Memory allocation failed\"}"); return ESP_OK; } - snprintf(filepath, sizeof(filepath), "/html%s", req->uri); - - // Determine content type based on file extension - const char *content_type = "text/plain"; - if (strstr(req->uri, ".html")) { - content_type = "text/html"; - } else if (strstr(req->uri, ".css")) { - content_type = "text/css"; - } else if (strstr(req->uri, ".js")) { - content_type = "application/javascript"; - } else if (strstr(req->uri, ".json")) { - content_type = "application/json"; - } else if (strstr(req->uri, ".png")) { - content_type = "image/png"; - } else if (strstr(req->uri, ".jpg") || strstr(req->uri, ".jpeg")) { - content_type = "image/jpeg"; - } else if (strstr(req->uri, ".ico")) { - content_type = "image/x-icon"; - } - // Try to open the file - FILE *file = fopen(filepath, "r"); - if (!file) { - ESP_LOGW(TAG, "%s: Failed to open file: %s", __func__, filepath); - httpd_resp_set_status(req, "404 Not Found"); - httpd_resp_sendstr(req, "File not found"); + // Read request body + int ret = httpd_req_recv(req, buf, req->content_len); + if (ret <= 0) { + free(buf); + if (ret == HTTPD_SOCK_ERR_TIMEOUT) { + httpd_resp_set_status(req, "408 Request Timeout"); + httpd_resp_sendstr(req, "{\"error\": \"Request timeout\"}"); + } else { + httpd_resp_set_status(req, "500 Internal Server Error"); + httpd_resp_sendstr(req, "{\"error\": \"Failed to read request body\"}"); + } return ESP_OK; } + buf[ret] = '\0'; - // Set content type - httpd_resp_set_type(req, content_type); - - // Send file contents in chunks - use smaller buffer to save stack space - char buffer[256]; - size_t read_bytes; - while ((read_bytes = fread(buffer, 1, sizeof(buffer), file)) > 0) { - if (httpd_resp_send_chunk(req, buffer, read_bytes) != ESP_OK) { - fclose(file); - ESP_LOGE(TAG, "%s: Failed to send file chunk", __func__); - return ESP_FAIL; - } - } + ESP_LOGI(TAG, "%s: Received JSON: %s", __func__, buf); - fclose(file); + // Update DAC-only settings + esp_err_t err = tas5805m_settings_set_dac_from_json(buf); + free(buf); - // Send empty chunk to signal completion - httpd_resp_send_chunk(req, NULL, 0); + if (err != ESP_OK) { + ESP_LOGE(TAG, "%s: Failed to update DAC settings: %s", __func__, esp_err_to_name(err)); + httpd_resp_set_status(req, "500 Internal Server Error"); + httpd_resp_sendstr(req, "{\"error\": \"Failed to update DAC settings\"}"); + return ESP_OK; + } + + httpd_resp_set_status(req, "200 OK"); + httpd_resp_set_type(req, "application/json"); + httpd_resp_sendstr(req, "{\"success\": true}"); - ESP_LOGD(TAG, "%s: Successfully sent file: %s", __func__, filepath); return ESP_OK; +#else + httpd_resp_set_status(req, "404 Not Found"); + httpd_resp_sendstr(req, "{\"error\": \"TAS5805M not configured\"}"); + return ESP_OK; +#endif } /* - * OPTIONS handler for CORS preflight requests + * GET /api/eq/settings handler + * Returns current TAS5805M EQ settings as JSON */ -static esp_err_t options_handler(httpd_req_t *req) { +static esp_err_t get_eq_settings_handler(httpd_req_t *req) { ESP_LOGD(TAG, "%s: uri=%s", __func__, req->uri); + set_cors_headers(req); - httpd_resp_set_status(req, "204 No Content"); - httpd_resp_send(req, NULL, 0); + +#if CONFIG_DAC_TAS5805M + char *eq_json = (char *)malloc(16 * 1024); // 16KB for EQ settings + if (!eq_json) { + ESP_LOGE(TAG, "%s: Failed to allocate memory for EQ JSON", __func__); + httpd_resp_set_status(req, "500 Internal Server Error"); + httpd_resp_sendstr(req, "{\"error\": \"Memory allocation failed\"}"); + return ESP_OK; + } + + esp_err_t ret = tas5805m_settings_get_eq_json(eq_json, 16 * 1024); + + if (ret != ESP_OK) { + ESP_LOGE(TAG, "%s: Failed to get EQ settings JSON: %s", __func__, esp_err_to_name(ret)); + free(eq_json); + httpd_resp_set_status(req, "500 Internal Server Error"); + httpd_resp_sendstr(req, "{\"error\": \"Failed to retrieve EQ settings\"}"); + return ESP_OK; + } + + httpd_resp_set_status(req, "200 OK"); + httpd_resp_set_type(req, "application/json"); + httpd_resp_sendstr(req, eq_json); + free(eq_json); + + return ESP_OK; +#else + httpd_resp_set_status(req, "404 Not Found"); + httpd_resp_sendstr(req, "{\"error\": \"TAS5805M not configured\"}"); return ESP_OK; +#endif } -/** +/* + * GET /api/eq/schema handler + * Returns TAS5805M EQ settings schema as JSON */ -esp_err_t stop_server(void) { - ESP_LOGD(TAG, "%s", __func__); - if (server) { - httpd_stop(server); - server = NULL; +static esp_err_t get_eq_schema_handler(httpd_req_t *req) { + ESP_LOGD(TAG, "%s: uri=%s", __func__, req->uri); + + set_cors_headers(req); + +#if CONFIG_DAC_TAS5805M + const size_t schema_buf_size = 64 * 1024; // 64KB for EQ schema + + char *schema_json = (char *)malloc(schema_buf_size); + if (!schema_json) { + ESP_LOGE(TAG, "%s: Failed to allocate memory for EQ schema JSON (size=%zu)", __func__, schema_buf_size); + httpd_resp_set_status(req, "500 Internal Server Error"); + httpd_resp_sendstr(req, "{\"error\": \"Memory allocation failed\"}"); + return ESP_OK; } + esp_err_t ret = tas5805m_settings_get_eq_schema_json(schema_json, schema_buf_size); + + if (ret != ESP_OK) { + ESP_LOGE(TAG, "%s: Failed to get EQ schema JSON: %s", __func__, esp_err_to_name(ret)); + free(schema_json); + httpd_resp_set_status(req, "500 Internal Server Error"); + httpd_resp_sendstr(req, "{\"error\": \"Failed to retrieve EQ schema\"}"); + return ESP_OK; + } + + httpd_resp_set_status(req, "200 OK"); + httpd_resp_set_type(req, "application/json"); + httpd_resp_sendstr(req, schema_json); + free(schema_json); + return ESP_OK; +#else + httpd_resp_set_status(req, "404 Not Found"); + httpd_resp_sendstr(req, "{\"error\": \"TAS5805M not configured\"}"); + return ESP_OK; +#endif } -/** - * Save a single integer parameter to NVS under namespace "ui_http". - * Thread-safe with mutex protection. +/* + * POST /api/eq/settings handler + * Updates TAS5805M EQ settings from JSON */ -esp_err_t ui_http_save_param(const char *name, int32_t value) { - ESP_LOGD(TAG, "%s: name=%s value=%d", __func__, name, (int)value); +static esp_err_t post_eq_settings_handler(httpd_req_t *req) { + ESP_LOGD(TAG, "%s: uri=%s", __func__, req->uri); - if (!nvs_mutex) { - ESP_LOGE(TAG, "%s: NVS mutex not initialized", __func__); - return ESP_ERR_INVALID_STATE; - } - - // Acquire mutex with timeout to prevent deadlock - if (xSemaphoreTake(nvs_mutex, pdMS_TO_TICKS(5000)) != pdTRUE) { - ESP_LOGE(TAG, "%s: Failed to acquire NVS mutex (timeout)", __func__); - return ESP_ERR_TIMEOUT; - } - - nvs_handle_t h; - esp_err_t err = nvs_open("ui_http", NVS_READWRITE, &h); - if (err != ESP_OK) { - ESP_LOGE(TAG, "%s: nvs_open failed: %s", __func__, esp_err_to_name(err)); - xSemaphoreGive(nvs_mutex); - return err; + set_cors_headers(req); + +#if CONFIG_DAC_TAS5805M + // Allocate buffer for request body + char *buf = (char *)malloc(req->content_len + 1); + if (!buf) { + ESP_LOGE(TAG, "%s: Failed to allocate buffer for request body", __func__); + httpd_resp_set_status(req, "500 Internal Server Error"); + httpd_resp_sendstr(req, "{\"error\": \"Memory allocation failed\"}"); + return ESP_OK; } - - err = nvs_set_i32(h, name, value); - if (err == ESP_OK) { - err = nvs_commit(h); + + // Read request body + int ret = httpd_req_recv(req, buf, req->content_len); + if (ret <= 0) { + free(buf); + if (ret == HTTPD_SOCK_ERR_TIMEOUT) { + httpd_resp_set_status(req, "408 Request Timeout"); + httpd_resp_sendstr(req, "{\"error\": \"Request timeout\"}"); + } else { + httpd_resp_set_status(req, "500 Internal Server Error"); + httpd_resp_sendstr(req, "{\"error\": \"Failed to read request body\"}"); + } + return ESP_OK; } - nvs_close(h); + buf[ret] = '\0'; - xSemaphoreGive(nvs_mutex); + ESP_LOGI(TAG, "%s: Received JSON: %s", __func__, buf); + + // Update EQ settings + esp_err_t err = tas5805m_settings_set_eq_from_json(buf); + free(buf); if (err != ESP_OK) { - ESP_LOGE(TAG, "%s: Failed to save param '%s': %s", __func__, name, esp_err_to_name(err)); + ESP_LOGE(TAG, "%s: Failed to update EQ settings: %s", __func__, esp_err_to_name(err)); + httpd_resp_set_status(req, "500 Internal Server Error"); + httpd_resp_sendstr(req, "{\"error\": \"Failed to update EQ settings\"}"); + return ESP_OK; } - return err; + + httpd_resp_set_status(req, "200 OK"); + httpd_resp_set_type(req, "application/json"); + httpd_resp_sendstr(req, "{\"success\": true}"); + + return ESP_OK; +#else + httpd_resp_set_status(req, "404 Not Found"); + httpd_resp_sendstr(req, "{\"error\": \"TAS5805M not configured\"}"); + return ESP_OK; +#endif } -/** - * Load a single integer parameter from NVS. Returns ESP_OK on success or - * ESP_ERR_NVS_NOT_FOUND if not present. - * Thread-safe with mutex protection. +/* + * Static file handler + * Serves files from embedded flash memory */ -esp_err_t ui_http_load_param(const char *name, int32_t *value) { - ESP_LOGD(TAG, "%s: name=%s", __func__, name); - - if (!nvs_mutex) { - ESP_LOGE(TAG, "%s: NVS mutex not initialized", __func__); - return ESP_ERR_INVALID_STATE; - } +static esp_err_t static_file_handler(httpd_req_t *req) { + ESP_LOGD(TAG, "%s: uri=%s", __func__, req->uri); + + set_cors_headers(req); + + // Search for the requested file in embedded files + for (size_t i = 0; i < sizeof(embedded_files) / sizeof(embedded_file_t); i++) { + if (strcmp(req->uri, embedded_files[i].uri) == 0) { + // Found the file + size_t file_size = embedded_files[i].data_end - embedded_files[i].data_start; + + // EMBED_TXTFILES adds a null terminator, but we shouldn't send it + // Only subtract for text files (not binary like favicon) + if (strstr(embedded_files[i].content_type, "text/") != NULL || + strstr(embedded_files[i].content_type, "application/javascript") != NULL) { + file_size--; + } + + ESP_LOGD(TAG, "%s: Serving %s (%d bytes)", __func__, req->uri, file_size); + + httpd_resp_set_type(req, embedded_files[i].content_type); + httpd_resp_send(req, (const char *)embedded_files[i].data_start, file_size); + + return ESP_OK; + } + } + + // File not found + ESP_LOGW(TAG, "%s: File not found: %s", __func__, req->uri); + httpd_resp_set_status(req, "404 Not Found"); + httpd_resp_sendstr(req, "File not found"); + return ESP_OK; +} - // Acquire mutex with timeout to prevent deadlock - if (xSemaphoreTake(nvs_mutex, pdMS_TO_TICKS(5000)) != pdTRUE) { - ESP_LOGE(TAG, "%s: Failed to acquire NVS mutex (timeout)", __func__); - return ESP_ERR_TIMEOUT; - } +/* + * OPTIONS handler for CORS preflight requests + */ +static esp_err_t options_handler(httpd_req_t *req) { + ESP_LOGD(TAG, "%s: uri=%s", __func__, req->uri); + set_cors_headers(req); + httpd_resp_set_status(req, "204 No Content"); + httpd_resp_send(req, NULL, 0); + return ESP_OK; +} - nvs_handle_t h; - esp_err_t err = nvs_open("ui_http", NVS_READWRITE, &h); - if (err != ESP_OK) { - ESP_LOGW(TAG, "%s: nvs_open failed: %s", __func__, esp_err_to_name(err)); - xSemaphoreGive(nvs_mutex); - return err; - } +/** + */ +esp_err_t stop_server(void) { + ESP_LOGD(TAG, "%s", __func__); + if (server) { + httpd_stop(server); + server = NULL; + } - int32_t tmp = 0; - err = nvs_get_i32(h, name, &tmp); - nvs_close(h); - - xSemaphoreGive(nvs_mutex); - - if (err == ESP_OK) { - *value = tmp; - } else { - ESP_LOGD(TAG, "%s: nvs_get_i32('%s') -> %s", __func__, name, esp_err_to_name(err)); - } - return err; + return ESP_OK; } /* * Function to start the web server */ esp_err_t start_server(const char *base_path, int port) { - ESP_LOGD(TAG, "%s: base_path=%s port=%d", __func__, base_path, port); - httpd_config_t config = HTTPD_DEFAULT_CONFIG(); - config.server_port = port; - config.max_open_sockets = 7; // Increased from 2 to handle concurrent requests better - config.max_uri_handlers = 16; // Increased from default (8) to accommodate all handlers - config.lru_purge_enable = true; // Enable LRU socket purging - - /* Enable wildcard URI matching for static file handler */ - config.uri_match_fn = httpd_uri_match_wildcard; - - ESP_LOGI(TAG, "%s: Starting HTTP Server on port: '%d'", __func__, config.server_port); - if (httpd_start(&server, &config) != ESP_OK) { - ESP_LOGE(TAG, "%s: Failed to start file server!", __func__); - return ESP_FAIL; - } - - /* URI handler for get */ - httpd_uri_t _root_get_handler = { - .uri = "/", .method = HTTP_GET, .handler = root_get_handler, - //.user_ctx = server_data // Pass server data as context - }; - httpd_register_uri_handler(server, &_root_get_handler); - - /* URI handler for post */ - httpd_uri_t _root_post_handler = { - .uri = "/post", .method = HTTP_POST, .handler = root_post_handler, - //.user_ctx = server_data // Pass server data as context - }; - httpd_register_uri_handler(server, &_root_post_handler); - - /* URI handler for get parameter */ - httpd_uri_t _get_param_handler = { - .uri = "/get", .method = HTTP_GET, .handler = get_param_handler, - }; - httpd_register_uri_handler(server, &_get_param_handler); - - /* URI handler for capabilities */ - httpd_uri_t _get_capabilities_handler = { - .uri = "/capabilities", .method = HTTP_GET, .handler = get_capabilities_handler, - }; - httpd_register_uri_handler(server, &_get_capabilities_handler); - - /* URI handler for favicon.ico */ - httpd_uri_t _favicon_get_handler = { - .uri = "/favicon.ico", .method = HTTP_GET, .handler = favicon_get_handler, - //.user_ctx = server_data // Pass server data as context - }; - httpd_register_uri_handler(server, &_favicon_get_handler); - - /* URI handler for OPTIONS (CORS preflight) - specific endpoints */ - httpd_uri_t _options_post_handler = { - .uri = "/post", .method = HTTP_OPTIONS, .handler = options_handler, - }; - httpd_register_uri_handler(server, &_options_post_handler); - - httpd_uri_t _options_get_handler = { - .uri = "/get", .method = HTTP_OPTIONS, .handler = options_handler, - }; - httpd_register_uri_handler(server, &_options_get_handler); - - httpd_uri_t _options_capabilities_handler = { - .uri = "/capabilities", .method = HTTP_OPTIONS, .handler = options_handler, - }; - httpd_register_uri_handler(server, &_options_capabilities_handler); - - /* URI handler for static files (catch-all, must be last) */ - httpd_uri_t _static_file_handler = { - .uri = "/*", .method = HTTP_GET, .handler = static_file_handler, - }; - esp_err_t ret = httpd_register_uri_handler(server, &_static_file_handler); - if (ret != ESP_OK) { - ESP_LOGE(TAG, "%s: Failed to register static file handler: %s", __func__, esp_err_to_name(ret)); - } else { - ESP_LOGI(TAG, "%s: Static file handler registered for /*", __func__); - } - - return ESP_OK; + ESP_LOGD(TAG, "%s: base_path=%s port=%d", __func__, base_path, port); + httpd_config_t config = HTTPD_DEFAULT_CONFIG(); + config.server_port = port; + config.max_open_sockets = 7; + config.max_uri_handlers = 64; + config.lru_purge_enable = true; // Enable LRU socket purging + + /* Enable wildcard URI matching for static file handler */ + config.uri_match_fn = httpd_uri_match_wildcard; + + ESP_LOGI(TAG, "%s: Starting HTTP Server on port: '%d'", __func__, + config.server_port); + if (httpd_start(&server, &config) != ESP_OK) { + ESP_LOGE(TAG, "%s: Failed to start file server!", __func__); + return ESP_FAIL; + } + + /* URI handler for get */ + httpd_uri_t _root_get_handler = { + .uri = "/", + .method = HTTP_GET, + .handler = root_get_handler, + //.user_ctx = server_data // Pass server data as context + }; + httpd_register_uri_handler(server, &_root_get_handler); + + /* URI handler for post */ + httpd_uri_t _root_post_handler = { + .uri = "/post", + .method = HTTP_POST, + .handler = root_post_handler, + //.user_ctx = server_data // Pass server data as context + }; + httpd_register_uri_handler(server, &_root_post_handler); + + /* URI handler for delete */ + httpd_uri_t _root_delete_handler = { + .uri = "/delete", + .method = HTTP_DELETE, + .handler = root_delete_handler, + }; + httpd_register_uri_handler(server, &_root_delete_handler); + + /* URI handler for get parameter */ + httpd_uri_t _get_param_handler = { + .uri = "/get", + .method = HTTP_GET, + .handler = get_param_handler, + }; + httpd_register_uri_handler(server, &_get_param_handler); + + /* URI handler for capabilities */ + httpd_uri_t _get_capabilities_handler = { + .uri = "/capabilities", + .method = HTTP_GET, + .handler = get_capabilities_handler, + }; + httpd_register_uri_handler(server, &_get_capabilities_handler); + + /* URI handler for favicon.ico */ + httpd_uri_t _favicon_get_handler = { + .uri = "/favicon.ico", + .method = HTTP_GET, + .handler = favicon_get_handler, + //.user_ctx = server_data // Pass server data as context + }; + httpd_register_uri_handler(server, &_favicon_get_handler); + + /* URI handler for OPTIONS (CORS preflight) - specific endpoints */ + httpd_uri_t _options_post_handler = { + .uri = "/post", + .method = HTTP_OPTIONS, + .handler = options_handler, + }; + httpd_register_uri_handler(server, &_options_post_handler); + + httpd_uri_t _options_get_handler = { + .uri = "/get", + .method = HTTP_OPTIONS, + .handler = options_handler, + }; + httpd_register_uri_handler(server, &_options_get_handler); + + httpd_uri_t _options_delete_handler = { + .uri = "/delete", + .method = HTTP_OPTIONS, + .handler = options_handler, + }; + httpd_register_uri_handler(server, &_options_delete_handler); + + httpd_uri_t _options_capabilities_handler = { + .uri = "/capabilities", + .method = HTTP_OPTIONS, + .handler = options_handler, + }; + httpd_register_uri_handler(server, &_options_capabilities_handler); + +#if CONFIG_DAC_TAS5805M + /* URI handlers for DAC settings API */ + httpd_uri_t _get_dac_settings_handler = { + .uri = "/api/dac/settings", + .method = HTTP_GET, + .handler = get_dac_settings_handler, + }; + httpd_register_uri_handler(server, &_get_dac_settings_handler); + + httpd_uri_t _get_dac_schema_handler = { + .uri = "/api/dac/schema", + .method = HTTP_GET, + .handler = get_dac_schema_handler, + }; + httpd_register_uri_handler(server, &_get_dac_schema_handler); + + httpd_uri_t _post_dac_settings_handler = { + .uri = "/api/dac/settings", + .method = HTTP_POST, + .handler = post_dac_settings_handler, + }; + httpd_register_uri_handler(server, &_post_dac_settings_handler); + + /* OPTIONS handlers for CORS preflight - DAC endpoints */ + httpd_uri_t _options_dac_settings_handler = { + .uri = "/api/dac/settings", + .method = HTTP_OPTIONS, + .handler = options_handler, + }; + httpd_register_uri_handler(server, &_options_dac_settings_handler); + + httpd_uri_t _options_dac_schema_handler = { + .uri = "/api/dac/schema", + .method = HTTP_OPTIONS, + .handler = options_handler, + }; + httpd_register_uri_handler(server, &_options_dac_schema_handler); + + /* URI handlers for EQ settings API */ + httpd_uri_t _get_eq_settings_handler = { + .uri = "/api/eq/settings", + .method = HTTP_GET, + .handler = get_eq_settings_handler, + }; + httpd_register_uri_handler(server, &_get_eq_settings_handler); + + httpd_uri_t _get_eq_schema_handler = { + .uri = "/api/eq/schema", + .method = HTTP_GET, + .handler = get_eq_schema_handler, + }; + httpd_register_uri_handler(server, &_get_eq_schema_handler); + + httpd_uri_t _post_eq_settings_handler = { + .uri = "/api/eq/settings", + .method = HTTP_POST, + .handler = post_eq_settings_handler, + }; + httpd_register_uri_handler(server, &_post_eq_settings_handler); + + /* OPTIONS handlers for CORS preflight - EQ endpoints */ + httpd_uri_t _options_eq_settings_handler = { + .uri = "/api/eq/settings", + .method = HTTP_OPTIONS, + .handler = options_handler, + }; + httpd_register_uri_handler(server, &_options_eq_settings_handler); + + httpd_uri_t _options_eq_schema_handler = { + .uri = "/api/eq/schema", + .method = HTTP_OPTIONS, + .handler = options_handler, + }; + httpd_register_uri_handler(server, &_options_eq_schema_handler); +#endif /* CONFIG_DAC_TAS5805M */ + + /* URI handler for static files (catch-all, must be last) */ + httpd_uri_t _static_file_handler = { + .uri = "/*", + .method = HTTP_GET, + .handler = static_file_handler, + }; + esp_err_t ret = httpd_register_uri_handler(server, &_static_file_handler); + if (ret != ESP_OK) { + ESP_LOGE(TAG, "%s: Failed to register static file handler: %s", + __func__, esp_err_to_name(ret)); + } else { + ESP_LOGI(TAG, "%s: Static file handler registered for /*", __func__); + + /* Diagnostic: list all embedded files available at runtime */ + ESP_LOGI(TAG, "%s: Embedded files: count=%zu", __func__, sizeof(embedded_files) / sizeof(embedded_file_t)); + for (size_t i = 0; i < sizeof(embedded_files) / sizeof(embedded_file_t); ++i) { + size_t file_size = embedded_files[i].data_end - embedded_files[i].data_start; + ESP_LOGI(TAG, "%s: [%zu] uri=%s type=%s size=%zu", __func__, i, embedded_files[i].uri, embedded_files[i].content_type, file_size); + } + } + + return ESP_OK; } /** * HTTP Server task - manages DSP parameters with flow-specific storage */ static void http_server_task(void *pvParameters) { - ESP_LOGD(TAG, "%s: started", __func__); - // Start Server - ESP_ERROR_CHECK(start_server("/html", CONFIG_WEB_PORT)); - - // Load last active flow from NVS - int32_t tmpv = 0; - dspFlows_t active_flow = dspfEQBassTreble; // default - if (ui_http_load_param("active_flow", &tmpv) == ESP_OK) { - active_flow = (dspFlows_t)tmpv; - ESP_LOGI(TAG, "%s: Loaded active flow: %d", __func__, active_flow); - } + ESP_LOGD(TAG, "%s: started", __func__); + // Start Server + ESP_ERROR_CHECK(start_server("/html", CONFIG_WEB_PORT)); + + // Ensure mdns setting has a default (true) on first boot - handled by + // settings_manager + bool tmp_mdns = true; + if (settings_get_mdns_enabled(&tmp_mdns) == ESP_OK) { + ESP_LOGD(TAG, "%s: mdns setting loaded: %d", __func__, + tmp_mdns ? 1 : 0); + } + + // DSP processor already loads parameters from NVS in dsp_processor_init() + // Just get the current active flow and parameters from DSP processor + dspFlows_t active_flow = dspfEQBassTreble; // default + filterParams_t current_params; + memset(¤t_params, 0, sizeof(filterParams_t)); - // Load persisted parameters for all flows from NVS - char key[32]; - for (int flow = 0; flow < 6; flow++) { - filterParams_t params; - // Initialize all fields to zero - memset(¶ms, 0, sizeof(filterParams_t)); - params.dspFlow = (dspFlows_t)flow; - - // Initialize with defaults from DSP processor #if CONFIG_USE_DSP_PROCESSOR - dsp_processor_get_params_for_flow((dspFlows_t)flow, ¶ms); -#endif - - // Try to load persisted values (flow-specific keys) - make_flow_key(key, sizeof(key), (dspFlows_t)flow, "fc_1"); - if (ui_http_load_param(key, &tmpv) == ESP_OK) { - params.fc_1 = (float)tmpv; - } - - make_flow_key(key, sizeof(key), (dspFlows_t)flow, "gain_1"); - if (ui_http_load_param(key, &tmpv) == ESP_OK) { - params.gain_1 = (float)tmpv; - } - - make_flow_key(key, sizeof(key), (dspFlows_t)flow, "fc_2"); - if (ui_http_load_param(key, &tmpv) == ESP_OK) { - params.fc_2 = (float)tmpv; - } - - make_flow_key(key, sizeof(key), (dspFlows_t)flow, "gain_2"); - if (ui_http_load_param(key, &tmpv) == ESP_OK) { - params.gain_2 = (float)tmpv; - } - - make_flow_key(key, sizeof(key), (dspFlows_t)flow, "fc_3"); - if (ui_http_load_param(key, &tmpv) == ESP_OK) { - params.fc_3 = (float)tmpv; - } - - make_flow_key(key, sizeof(key), (dspFlows_t)flow, "gain_3"); - if (ui_http_load_param(key, &tmpv) == ESP_OK) { - params.gain_3 = (float)tmpv; - } - - // Store in DSP processor's centralized storage -#if CONFIG_USE_DSP_PROCESSOR - dsp_processor_set_params_for_flow((dspFlows_t)flow, ¶ms); + active_flow = dsp_settings_get_active_flow(); + dsp_settings_get_flow_params(active_flow, ¤t_params); + ESP_LOGI(TAG, "%s: Current flow %d with fc_1=%.1f gain_1=%.1f", __func__, + active_flow, current_params.fc_1, current_params.gain_1); +#else + current_params.dspFlow = active_flow; #endif - - ESP_LOGI(TAG, "%s: Loaded flow %d: fc_1=%.1f gain_1=%.1f fc_3=%.1f gain_3=%.1f", - __func__, flow, params.fc_1, params.gain_1, params.fc_3, params.gain_3); - } -#if CONFIG_USE_DSP_PROCESSOR - // Switch to the active flow (this applies its parameters) - dsp_processor_switch_flow(active_flow); - ESP_LOGI(TAG, "%s: Switched to flow %d", __func__, active_flow); -#endif + URL_t urlBuf; + while (1) { + // Waiting for post + if (xQueueReceive(xQueueHttp, &urlBuf, portMAX_DELAY) == pdTRUE) { + ESP_LOGI(TAG, "%s: received update: %s = %d", __func__, urlBuf.key, + urlBuf.int_value); - // Get current active parameters - filterParams_t current_params; -#if CONFIG_USE_DSP_PROCESSOR - dsp_processor_get_params_for_flow(active_flow, ¤t_params); -#else - memset(¤t_params, 0, sizeof(filterParams_t)); - current_params.dspFlow = active_flow; -#endif + // Handle flow change specially + if (strcmp(urlBuf.key, "dspFlow") == 0) { + dspFlows_t new_flow = (dspFlows_t)urlBuf.int_value; - URL_t urlBuf; - while (1) { - // Waiting for post - if (xQueueReceive(xQueueHttp, &urlBuf, portMAX_DELAY) == pdTRUE) { - ESP_LOGI(TAG, "%s: received update: %s = %d", __func__, urlBuf.key, urlBuf.int_value); - - // Handle flow change specially - if (strcmp(urlBuf.key, "dspFlow") == 0) { - dspFlows_t new_flow = (dspFlows_t)urlBuf.int_value; - - // Save current flow ID to NVS - if (ui_http_save_param("active_flow", (int32_t)new_flow) != ESP_OK) { - ESP_LOGW(TAG, "%s: Failed to persist active_flow to NVS", __func__); - } - #if CONFIG_USE_DSP_PROCESSOR - // Switch to new flow (loads its stored parameters) - dsp_processor_switch_flow(new_flow); - // Get the parameters for the new flow - dsp_processor_get_params_for_flow(new_flow, ¤t_params); + // Switch to new flow (loads its stored parameters and notifies subscribers) + dsp_settings_switch_active_flow(new_flow); + // Get the parameters for the new flow + dsp_settings_get_flow_params(new_flow, ¤t_params); + ESP_LOGI(TAG, "%s: Switched to flow %d", __func__, new_flow); #else - current_params.dspFlow = new_flow; + current_params.dspFlow = new_flow; #endif - - ESP_LOGI(TAG, "%s: Switched to flow %d", __func__, new_flow); - continue; - } - - // Handle parameter updates for current flow - bool param_recognized = false; - dspFlows_t current_flow = current_params.dspFlow; - - if (strcmp(urlBuf.key, "fc_1") == 0) { - current_params.fc_1 = (float)urlBuf.int_value; - param_recognized = true; - } else if (strcmp(urlBuf.key, "gain_1") == 0) { - current_params.gain_1 = (float)urlBuf.int_value; - param_recognized = true; - } else if (strcmp(urlBuf.key, "fc_2") == 0) { - current_params.fc_2 = (float)urlBuf.int_value; - param_recognized = true; - } else if (strcmp(urlBuf.key, "gain_2") == 0) { - current_params.gain_2 = (float)urlBuf.int_value; - param_recognized = true; - } else if (strcmp(urlBuf.key, "fc_3") == 0) { - current_params.fc_3 = (float)urlBuf.int_value; - param_recognized = true; - } else if (strcmp(urlBuf.key, "gain_3") == 0) { - current_params.gain_3 = (float)urlBuf.int_value; - param_recognized = true; - } - - if (!param_recognized) { - ESP_LOGW(TAG, "%s: Unknown param '%s' received, ignoring", __func__, urlBuf.key); - continue; - } + + continue; + } // Handle parameter updates for current flow + bool param_recognized = false; + dspFlows_t current_flow = current_params.dspFlow; + + if (strcmp(urlBuf.key, "fc_1") == 0) { + current_params.fc_1 = (float)urlBuf.int_value; + param_recognized = true; + } else if (strcmp(urlBuf.key, "gain_1") == 0) { + current_params.gain_1 = (float)urlBuf.int_value; + param_recognized = true; + } else if (strcmp(urlBuf.key, "fc_2") == 0) { + current_params.fc_2 = (float)urlBuf.int_value; + param_recognized = true; + } else if (strcmp(urlBuf.key, "gain_2") == 0) { + current_params.gain_2 = (float)urlBuf.int_value; + param_recognized = true; + } else if (strcmp(urlBuf.key, "fc_3") == 0) { + current_params.fc_3 = (float)urlBuf.int_value; + param_recognized = true; + } else if (strcmp(urlBuf.key, "gain_3") == 0) { + current_params.gain_3 = (float)urlBuf.int_value; + param_recognized = true; + } + + + if (!param_recognized) { + ESP_LOGW(TAG, "%s: Unknown param '%s' received, ignoring", + __func__, urlBuf.key); + continue; + } #if CONFIG_USE_DSP_PROCESSOR - // Apply updated params to DSP - dsp_processor_set_params_for_flow(current_flow, ¤t_params); + // Update settings and notify subscribers (includes NVS persistence) + dsp_settings_set_flow_params(current_flow, ¤t_params); + ESP_LOGD(TAG, "%s: Updated %s = %d", __func__, urlBuf.key, + urlBuf.int_value); +#else + // Persist parameter using dsp_settings (values are stored as + // int32_t) + if (dsp_settings_save_flow_param(current_flow, urlBuf.key, + urlBuf.int_value) != ESP_OK) { + ESP_LOGW(TAG, "%s: Failed to persist param '%s' to NVS", + __func__, urlBuf.key); + } else { + ESP_LOGD(TAG, "%s: Saved %s = %d to NVS", __func__, urlBuf.key, + urlBuf.int_value); + } #endif - - // Persist with flow-specific key - make_flow_key(key, sizeof(key), current_flow, urlBuf.key); - if (ui_http_save_param(key, urlBuf.int_value) != ESP_OK) { - ESP_LOGW(TAG, "%s: Failed to persist param '%s' to NVS", __func__, key); - } else { - ESP_LOGD(TAG, "%s: Saved %s = %d to NVS", __func__, key, urlBuf.int_value); - } - } - } - - // Never reach here - ESP_LOGI(TAG, "%s: finish", __func__); - vTaskDelete(NULL); + } +} // Never reach here + ESP_LOGI(TAG, "%s: finish", __func__); + vTaskDelete(NULL); } /** * */ void init_http_server_task(void) { - ESP_LOGD(TAG, "%s: initializing", __func__); - - // Create NVS mutex if not already created - if (!nvs_mutex) { - nvs_mutex = xSemaphoreCreateMutex(); - if (!nvs_mutex) { - ESP_LOGE(TAG, "%s: Failed to create NVS mutex", __func__); - return; - } - } - - // Initialize SPIFFS - ESP_LOGI(TAG, "%s: Initializing SPIFFS", __func__); - if (SPIFFS_Mount("/html", "storage", 6) != ESP_OK) { - ESP_LOGE(TAG, "%s: SPIFFS mount failed", __func__); - return; - } - - // Create Queue - if (!xQueueHttp) { - xQueueHttp = xQueueCreate(10, sizeof(URL_t)); - configASSERT(xQueueHttp); - } - - if (taskHandle) { - stop_server(); - vTaskDelete(taskHandle); - taskHandle = NULL; - } - - // Increased stack size from 512*5 to 512*8 (4KB) to accommodate static file handler - xTaskCreatePinnedToCore(http_server_task, "HTTP", 512 * 8, NULL, 2, - &taskHandle, tskNO_AFFINITY); -} + ESP_LOGD(TAG, "%s: initializing", __func__); + + // No SPIFFS mounting needed - files are embedded in flash + + // Create Queue + if (!xQueueHttp) { + xQueueHttp = xQueueCreate(10, sizeof(URL_t)); + configASSERT(xQueueHttp); + } + + if (taskHandle) { + stop_server(); + vTaskDelete(taskHandle); + taskHandle = NULL; + } + + // Stack size can be reduced from 512*8 since we're not using file I/O + xTaskCreatePinnedToCore(http_server_task, "HTTP", 512 * 6, NULL, 2, + &taskHandle, tskNO_AFFINITY); +} \ No newline at end of file diff --git a/partitions.csv b/partitions.csv index b97f6b51..04073e0a 100644 --- a/partitions.csv +++ b/partitions.csv @@ -1,6 +1,6 @@ # Name, Type, SubType, Offset, Size, Flags -nvs, data, nvs, 0x9000, 16K, -otadata, data, ota, 0xd000, 8K, -phy_init, data, phy, 0xf000, 4K, -ota_0, app, ota_0, 0x10000, 1728K, -ota_1, app, ota_1, 0x1C0000, 1728K, +nvs, data, nvs, 0x9000, 32K, +otadata, data, ota, 0x11000, 8K, +phy_init, data, phy, 0x13000, 4K, +ota_0, app, ota_0, 0x20000, 1664K, +ota_1, app, ota_1, 0x1C0000, 1664K, From 5672d9396d6460fc520dd11a2acd2676fab4f3d6 Mon Sep 17 00:00:00 2001 From: Andriy Malyshenko Date: Thu, 8 Jan 2026 12:29:33 +0100 Subject: [PATCH 29/58] merge cleanup --- components/audio_hal/CMakeLists.txt | 4 +- components/custom_board/CMakeLists.txt | 4 +- .../settings_manager/settings_manager.c | 15 ++-- components/ui_http_server/ui_http_server.c | 88 ++++++++++++------- 4 files changed, 68 insertions(+), 43 deletions(-) diff --git a/components/audio_hal/CMakeLists.txt b/components/audio_hal/CMakeLists.txt index b55162b2..17c26127 100644 --- a/components/audio_hal/CMakeLists.txt +++ b/components/audio_hal/CMakeLists.txt @@ -18,8 +18,8 @@ IF (NOT ((CONFIG_IDF_TARGET STREQUAL "esp32c3") OR (CONFIG_IDF_TARGET STREQUAL " endif() # Edit following two lines to set component requirements (see docs) -set(COMPONENT_REQUIRES audio_sal) -set(COMPONENT_PRIV_REQUIRES audio_board mbedtls esp_peripherals custom_board) +set(COMPONENT_REQUIRES ) +set(COMPONENT_PRIV_REQUIRES audio_sal audio_board mbedtls esp_peripherals custom_board) set(COMPONENT_SRCS ./audio_hal.c ./audio_volume.c diff --git a/components/custom_board/CMakeLists.txt b/components/custom_board/CMakeLists.txt index 2139c097..82e0c3db 100644 --- a/components/custom_board/CMakeLists.txt +++ b/components/custom_board/CMakeLists.txt @@ -1,6 +1,6 @@ # Edit following two lines to set component requirements (see docs) -set(COMPONENT_REQUIRES audio_hal audio_board) -set(COMPONENT_PRIV_REQUIRES esp_peripherals) +set(COMPONENT_REQUIRES) +set(COMPONENT_PRIV_REQUIRES audio_hal esp_peripherals) if(CONFIG_AUDIO_BOARD_CUSTOM) message(STATUS "Current board name is " CONFIG_AUDIO_BOARD_CUSTOM) diff --git a/components/settings_manager/settings_manager.c b/components/settings_manager/settings_manager.c index 4aec7ce1..e5384d5d 100644 --- a/components/settings_manager/settings_manager.c +++ b/components/settings_manager/settings_manager.c @@ -235,13 +235,12 @@ esp_err_t settings_get_mdns_enabled(bool *enabled) { } } // Not present in NVS. Check sdkconfig if available, otherwise default true -#ifdef CONFIG_SNAPSERVER_USE_MDNS - *enabled = (CONFIG_SNAPSERVER_USE_MDNS != 0); - ESP_LOGD(TAG, "%s: mdns from CONFIG_SNAPSERVER_USE_MDNS: %d", __func__, *enabled ? 1 : 0); +#ifndef CONFIG_SNAPSERVER_USE_MDNS + *enabled = false; #else *enabled = true; - ESP_LOGD(TAG, "%s: mdns default: true", __func__); #endif + ESP_LOGD(TAG, "%s: mdns from CONFIG_SNAPSERVER_USE_MDNS: %d", __func__, *enabled ? 1 : 0); xSemaphoreGive(hostname_mutex); return ESP_OK; } @@ -403,7 +402,7 @@ esp_err_t settings_get_server_port(int32_t *port) { // not present in NVS -> check sdkconfig fallbacks or default 0 #ifdef CONFIG_SNAPSERVER_PORT *port = CONFIG_SNAPSERVER_PORT; - ESP_LOGD(TAG, "%s: server_port from CONFIG_SNAPSERVER_PORT: %d", __func__, *port); + ESP_LOGD(TAG, "%s: server_port from CONFIG_SNAPSERVER_PORT: %ld", __func__, (long)*port); #else *port = 0; ESP_LOGD(TAG, "%s: server_port not set (default 0)", __func__); @@ -413,7 +412,7 @@ esp_err_t settings_get_server_port(int32_t *port) { } esp_err_t settings_set_server_port(int32_t port) { - ESP_LOGD(TAG, "%s: port=%d", __func__, port); + ESP_LOGD(TAG, "%s: port=%ld", __func__, (long)port); if (!hostname_mutex) return ESP_ERR_INVALID_STATE; if (xSemaphoreTake(hostname_mutex, pdMS_TO_TICKS(5000)) != pdTRUE) return ESP_ERR_TIMEOUT; @@ -430,7 +429,7 @@ esp_err_t settings_set_server_port(int32_t port) { nvs_close(h); xSemaphoreGive(hostname_mutex); if (err == ESP_OK) { - ESP_LOGI(TAG, "%s: server_port saved: %d", __func__, port); + ESP_LOGI(TAG, "%s: server_port saved: %ld", __func__, (long)port); } else { ESP_LOGE(TAG, "%s: Failed to save server_port: %s", __func__, esp_err_to_name(err)); } @@ -545,7 +544,7 @@ esp_err_t settings_get_json(char *json_out, size_t max_len) { json_out[max_len - 1] = '\0'; cJSON_free(json_str); - ESP_LOGD(TAG, "%s: JSON generated: %s", __func__, json_out); + ESP_LOGV(TAG, "%s: JSON generated: %s", __func__, json_out); return ESP_OK; } diff --git a/components/ui_http_server/ui_http_server.c b/components/ui_http_server/ui_http_server.c index 0e6c00cc..d6015626 100644 --- a/components/ui_http_server/ui_http_server.c +++ b/components/ui_http_server/ui_http_server.c @@ -11,11 +11,13 @@ #include "ui_http_server.h" #include +#include #include "dsp_processor_settings.h" #include "esp_err.h" #include "esp_http_server.h" #include "esp_log.h" +#include "esp_system.h" #include "freertos/FreeRTOS.h" #include "freertos/queue.h" #include "freertos/semphr.h" @@ -243,10 +245,10 @@ static esp_err_t root_post_handler(httpd_req_t *req) { // Parse integer value; strtol skips leading whitespace long v = strtol(valstr, NULL, 10); urlBuf.int_value = (int32_t)v; - strncpy(urlBuf.key, param, sizeof(urlBuf.key) - 1); + snprintf(urlBuf.key, sizeof(urlBuf.key), "%s", param); ret = 0; - ESP_LOGD(TAG, "%s: Received param=%s value=%d", __func__, urlBuf.key, - urlBuf.int_value); + ESP_LOGD(TAG, "%s: Received param=%s value=%ld", __func__, urlBuf.key, + (long)urlBuf.int_value); } else { ESP_LOGD(TAG, "%s: Invalid post: expected param=NAME&value=INT in URI", __func__); @@ -444,10 +446,6 @@ static esp_err_t get_param_handler(httpd_req_t *req) { value = (int32_t)params.fc_1; } else if (strcmp(param, "gain_1") == 0) { value = (int32_t)params.gain_1; - } else if (strcmp(param, "fc_2") == 0) { - value = (int32_t)params.fc_2; - } else if (strcmp(param, "gain_2") == 0) { - value = (int32_t)params.gain_2; } else if (strcmp(param, "fc_3") == 0) { value = (int32_t)params.fc_3; } else if (strcmp(param, "gain_3") == 0) { @@ -471,9 +469,9 @@ static esp_err_t get_param_handler(httpd_req_t *req) { } #else // Fallback: load from NVS using dsp_settings - dspFlows_t current_flow = dspfEQBassTreble; + dspFlows_t current_flow = dspfStereo; if (dsp_settings_load_active_flow(¤t_flow) != ESP_OK) { - current_flow = dspfEQBassTreble; // default + current_flow = dspfStereo; // default } int32_t value = 0; @@ -607,6 +605,32 @@ static esp_err_t favicon_get_handler(httpd_req_t *req) { return ESP_OK; } +/* Restart handler: responds OK and schedules a restart shortly after */ +static void restart_task(void *pv) { + // give HTTP stack time to finish sending response + vTaskDelay(pdMS_TO_TICKS(200)); + ESP_LOGI(TAG, "restart_task: calling esp_restart()"); + esp_restart(); + vTaskDelete(NULL); +} + +static esp_err_t restart_post_handler(httpd_req_t *req) { + ESP_LOGD(TAG, "%s: uri=%s", __func__, req->uri); + set_cors_headers(req); + + // Send immediate response before restarting + httpd_resp_set_status(req, "200 OK"); + httpd_resp_sendstr(req, "restarting"); + + // Spawn a task that will restart the chip after a short delay + BaseType_t ok = xTaskCreate(restart_task, "restart_task", 2048, NULL, 5, NULL); + if (ok != pdPASS) { + ESP_LOGW(TAG, "%s: Failed to create restart task", __func__); + } + + return ESP_OK; +} + /* * GET /api/dac/settings handler * Returns current TAS5805M DAC settings as JSON @@ -1033,6 +1057,14 @@ esp_err_t start_server(const char *base_path, int port) { }; httpd_register_uri_handler(server, &_favicon_get_handler); + /* URI handler for restart (POST) */ + httpd_uri_t _restart_post_handler = { + .uri = "/restart", + .method = HTTP_POST, + .handler = restart_post_handler, + }; + httpd_register_uri_handler(server, &_restart_post_handler); + /* URI handler for OPTIONS (CORS preflight) - specific endpoints */ httpd_uri_t _options_post_handler = { .uri = "/post", @@ -1062,6 +1094,13 @@ esp_err_t start_server(const char *base_path, int port) { }; httpd_register_uri_handler(server, &_options_capabilities_handler); + httpd_uri_t _options_restart_handler = { + .uri = "/restart", + .method = HTTP_OPTIONS, + .handler = options_handler, + }; + httpd_register_uri_handler(server, &_options_restart_handler); + #if CONFIG_DAC_TAS5805M /* URI handlers for DAC settings API */ httpd_uri_t _get_dac_settings_handler = { @@ -1150,13 +1189,6 @@ esp_err_t start_server(const char *base_path, int port) { __func__, esp_err_to_name(ret)); } else { ESP_LOGI(TAG, "%s: Static file handler registered for /*", __func__); - - /* Diagnostic: list all embedded files available at runtime */ - ESP_LOGI(TAG, "%s: Embedded files: count=%zu", __func__, sizeof(embedded_files) / sizeof(embedded_file_t)); - for (size_t i = 0; i < sizeof(embedded_files) / sizeof(embedded_file_t); ++i) { - size_t file_size = embedded_files[i].data_end - embedded_files[i].data_start; - ESP_LOGI(TAG, "%s: [%zu] uri=%s type=%s size=%zu", __func__, i, embedded_files[i].uri, embedded_files[i].content_type, file_size); - } } return ESP_OK; @@ -1180,7 +1212,7 @@ static void http_server_task(void *pvParameters) { // DSP processor already loads parameters from NVS in dsp_processor_init() // Just get the current active flow and parameters from DSP processor - dspFlows_t active_flow = dspfEQBassTreble; // default + dspFlows_t active_flow = dspfStereo; // default filterParams_t current_params; memset(¤t_params, 0, sizeof(filterParams_t)); @@ -1197,8 +1229,8 @@ static void http_server_task(void *pvParameters) { while (1) { // Waiting for post if (xQueueReceive(xQueueHttp, &urlBuf, portMAX_DELAY) == pdTRUE) { - ESP_LOGI(TAG, "%s: received update: %s = %d", __func__, urlBuf.key, - urlBuf.int_value); + ESP_LOGI(TAG, "%s: received update: %s = %ld", __func__, urlBuf.key, + (long)urlBuf.int_value); // Handle flow change specially if (strcmp(urlBuf.key, "dspFlow") == 0) { @@ -1225,12 +1257,6 @@ static void http_server_task(void *pvParameters) { } else if (strcmp(urlBuf.key, "gain_1") == 0) { current_params.gain_1 = (float)urlBuf.int_value; param_recognized = true; - } else if (strcmp(urlBuf.key, "fc_2") == 0) { - current_params.fc_2 = (float)urlBuf.int_value; - param_recognized = true; - } else if (strcmp(urlBuf.key, "gain_2") == 0) { - current_params.gain_2 = (float)urlBuf.int_value; - param_recognized = true; } else if (strcmp(urlBuf.key, "fc_3") == 0) { current_params.fc_3 = (float)urlBuf.int_value; param_recognized = true; @@ -1247,10 +1273,10 @@ static void http_server_task(void *pvParameters) { } #if CONFIG_USE_DSP_PROCESSOR - // Update settings and notify subscribers (includes NVS persistence) - dsp_settings_set_flow_params(current_flow, ¤t_params); - ESP_LOGD(TAG, "%s: Updated %s = %d", __func__, urlBuf.key, - urlBuf.int_value); + // Update settings and notify subscribers (includes NVS persistence) + dsp_settings_set_flow_params(current_flow, ¤t_params); + ESP_LOGD(TAG, "%s: Updated %s = %ld", __func__, urlBuf.key, + (long)urlBuf.int_value); #else // Persist parameter using dsp_settings (values are stored as // int32_t) @@ -1259,8 +1285,8 @@ static void http_server_task(void *pvParameters) { ESP_LOGW(TAG, "%s: Failed to persist param '%s' to NVS", __func__, urlBuf.key); } else { - ESP_LOGD(TAG, "%s: Saved %s = %d to NVS", __func__, urlBuf.key, - urlBuf.int_value); + ESP_LOGD(TAG, "%s: Saved %s = %ld to NVS", __func__, urlBuf.key, + (long)urlBuf.int_value); } #endif } From f7ecade7a5f9c6ddcfbdb5a1d6a73bb9053a6f88 Mon Sep 17 00:00:00 2001 From: Andriy Malyshenko Date: Thu, 8 Jan 2026 12:39:18 +0100 Subject: [PATCH 30/58] Post merge cleanup --- .../driver/tas5805m/tas5805m_reg_cfg.h | 4 - .../custom_board/tas5805m/include/tas5805m.h | 24 +- main/main.c | 5 +- sdkconfig.hifi-esp32-plus | 2506 --------------- sdkconfig.louder-esp32 | 2513 --------------- sdkconfig.louder-esp32s3 | 2681 ----------------- 6 files changed, 24 insertions(+), 7709 deletions(-) delete mode 100644 sdkconfig.hifi-esp32-plus delete mode 100644 sdkconfig.louder-esp32 delete mode 100644 sdkconfig.louder-esp32s3 diff --git a/components/audio_hal/driver/tas5805m/tas5805m_reg_cfg.h b/components/audio_hal/driver/tas5805m/tas5805m_reg_cfg.h index dc8235c0..344c6cc0 100644 --- a/components/audio_hal/driver/tas5805m/tas5805m_reg_cfg.h +++ b/components/audio_hal/driver/tas5805m/tas5805m_reg_cfg.h @@ -43,10 +43,6 @@ typedef struct { uint8_t value; } tas5805m_cfg_reg_t; -static const uint8_t tas5805m_volume[] = { - 0xff, 0x9f, 0x8f, 0x7f, 0x6f, 0x5f, 0x5c, 0x5a, 0x58, 0x54, 0x50, - 0x4c, 0x4a, 0x48, 0x44, 0x40, 0x3d, 0x3b, 0x39, 0x37, 0x35}; - static const tas5805m_cfg_reg_t tas5805m_registers[] = { // RESET {0x00, 0x00}, diff --git a/components/custom_board/tas5805m/include/tas5805m.h b/components/custom_board/tas5805m/include/tas5805m.h index 76458174..f7ae071e 100644 --- a/components/custom_board/tas5805m/include/tas5805m.h +++ b/components/custom_board/tas5805m/include/tas5805m.h @@ -49,6 +49,24 @@ extern "C" { #define I2C_MASTER_RX_BUF_DISABLE 0 /*!< I2C master doesn't need buffer */ #define I2C_MASTER_TIMEOUT_MS 1000 +#define TAS5805M_VOLUME_MUTE 0xff // (-103.5 dB - actual mute) +#define TAS5805M_VOLUME_MIN 0xa8 // ( -60 dB - save value representing barely hearable volume) +#define TAS5805M_VOLUME_MAX 0x30 // ( 0 dB - maximum volume that guarantees no distortion ) +/* +// TODO: make it available for user configuration +#define TAS5805M_REG_VOLUME_MAX 0x00 // (+24 dB - maximum volume that DAC can do) +*/ + +typedef enum { + TAS5805M_CTRL_DEEP_SLEEP = 0x00, // Deep Sleep + TAS5805M_CTRL_SLEEP = 0x01, // Sleep + TAS5805M_CTRL_HI_Z = 0x02, // Hi-Z + TAS5805M_CTRL_PLAY = 0x03, // Play + TAS5805M_CTRL_MUTE = 0x08, // Mute Flag + // Mute, but driver in PLAY state + TAS5805M_CTRL_PLAY_MUTE = TAS5805M_CTRL_MUTE | TAS5805M_CTRL_PLAY +} TAS5805M_CTRL_STATE; + /* Cached state structure */ typedef struct { int8_t volume; @@ -174,18 +192,18 @@ esp_err_t tas5805m_set_state(TAS5805M_CTRL_STATE state); * @return * - ESP_OK * - ESP_FAIL - */ + */ esp_err_t tas5805m_ctrl(audio_hal_codec_mode_t mode, audio_hal_ctrl_t ctrl_state); /** * @brief Configure the I2S interface of TAS5805 codec chip * @param mode: codec mode - * @param iface: I2S interface configuration + * @param iface: I2S interface configuration * @return * - ESP_OK * - ESP_FAIL - */ + */ esp_err_t tas5805m_config_iface(audio_hal_codec_mode_t mode, audio_hal_codec_i2s_iface_t *iface); diff --git a/main/main.c b/main/main.c index 79727501..cedf51af 100644 --- a/main/main.c +++ b/main/main.c @@ -2626,9 +2626,10 @@ void app_main(void) { esp_log_level_set("wifi", ESP_LOG_WARN); esp_log_level_set("wifi_init", ESP_LOG_WARN); esp_log_level_set("httpd_uri", ESP_LOG_WARN); + esp_log_level_set("settings", ESP_LOG_DEBUG); + esp_log_level_set("dsp_settings", ESP_LOG_DEBUG); esp_log_level_set("UI_HTTP", ESP_LOG_WARN); - esp_log_level_set("TAS5805M", ESP_LOG_DEBUG); - esp_log_level_set("tas5805m_settings", ESP_LOG_INFO); + esp_log_level_set("dspProc", ESP_LOG_DEBUG); #if CONFIG_SNAPCLIENT_USE_INTERNAL_ETHERNET || \ CONFIG_SNAPCLIENT_USE_SPI_ETHERNET diff --git a/sdkconfig.hifi-esp32-plus b/sdkconfig.hifi-esp32-plus deleted file mode 100644 index 826e1d16..00000000 --- a/sdkconfig.hifi-esp32-plus +++ /dev/null @@ -1,2506 +0,0 @@ -# -# Automatically generated file. DO NOT EDIT. -# Espressif IoT Development Framework (ESP-IDF) 5.5.1 Project Configuration -# -CONFIG_SOC_CAPS_ECO_VER_MAX=301 -CONFIG_SOC_ADC_SUPPORTED=y -CONFIG_SOC_DAC_SUPPORTED=y -CONFIG_SOC_UART_SUPPORTED=y -CONFIG_SOC_MCPWM_SUPPORTED=y -CONFIG_SOC_GPTIMER_SUPPORTED=y -CONFIG_SOC_SDMMC_HOST_SUPPORTED=y -CONFIG_SOC_BT_SUPPORTED=y -CONFIG_SOC_PCNT_SUPPORTED=y -CONFIG_SOC_PHY_SUPPORTED=y -CONFIG_SOC_WIFI_SUPPORTED=y -CONFIG_SOC_SDIO_SLAVE_SUPPORTED=y -CONFIG_SOC_TWAI_SUPPORTED=y -CONFIG_SOC_EFUSE_SUPPORTED=y -CONFIG_SOC_EMAC_SUPPORTED=y -CONFIG_SOC_ULP_SUPPORTED=y -CONFIG_SOC_CCOMP_TIMER_SUPPORTED=y -CONFIG_SOC_RTC_FAST_MEM_SUPPORTED=y -CONFIG_SOC_RTC_SLOW_MEM_SUPPORTED=y -CONFIG_SOC_RTC_MEM_SUPPORTED=y -CONFIG_SOC_I2S_SUPPORTED=y -CONFIG_SOC_RMT_SUPPORTED=y -CONFIG_SOC_SDM_SUPPORTED=y -CONFIG_SOC_GPSPI_SUPPORTED=y -CONFIG_SOC_LEDC_SUPPORTED=y -CONFIG_SOC_I2C_SUPPORTED=y -CONFIG_SOC_SUPPORT_COEXISTENCE=y -CONFIG_SOC_AES_SUPPORTED=y -CONFIG_SOC_MPI_SUPPORTED=y -CONFIG_SOC_SHA_SUPPORTED=y -CONFIG_SOC_FLASH_ENC_SUPPORTED=y -CONFIG_SOC_SECURE_BOOT_SUPPORTED=y -CONFIG_SOC_TOUCH_SENSOR_SUPPORTED=y -CONFIG_SOC_BOD_SUPPORTED=y -CONFIG_SOC_ULP_FSM_SUPPORTED=y -CONFIG_SOC_CLK_TREE_SUPPORTED=y -CONFIG_SOC_MPU_SUPPORTED=y -CONFIG_SOC_WDT_SUPPORTED=y -CONFIG_SOC_SPI_FLASH_SUPPORTED=y -CONFIG_SOC_RNG_SUPPORTED=y -CONFIG_SOC_LIGHT_SLEEP_SUPPORTED=y -CONFIG_SOC_DEEP_SLEEP_SUPPORTED=y -CONFIG_SOC_LP_PERIPH_SHARE_INTERRUPT=y -CONFIG_SOC_PM_SUPPORTED=y -CONFIG_SOC_DPORT_WORKAROUND_DIS_INTERRUPT_LVL=5 -CONFIG_SOC_XTAL_SUPPORT_26M=y -CONFIG_SOC_XTAL_SUPPORT_40M=y -CONFIG_SOC_XTAL_SUPPORT_AUTO_DETECT=y -CONFIG_SOC_ADC_RTC_CTRL_SUPPORTED=y -CONFIG_SOC_ADC_DIG_CTRL_SUPPORTED=y -CONFIG_SOC_ADC_DMA_SUPPORTED=y -CONFIG_SOC_ADC_PERIPH_NUM=2 -CONFIG_SOC_ADC_MAX_CHANNEL_NUM=10 -CONFIG_SOC_ADC_ATTEN_NUM=4 -CONFIG_SOC_ADC_DIGI_CONTROLLER_NUM=2 -CONFIG_SOC_ADC_PATT_LEN_MAX=16 -CONFIG_SOC_ADC_DIGI_MIN_BITWIDTH=9 -CONFIG_SOC_ADC_DIGI_MAX_BITWIDTH=12 -CONFIG_SOC_ADC_DIGI_RESULT_BYTES=2 -CONFIG_SOC_ADC_DIGI_DATA_BYTES_PER_CONV=4 -CONFIG_SOC_ADC_DIGI_MONITOR_NUM=0 -CONFIG_SOC_ADC_SAMPLE_FREQ_THRES_HIGH=2 -CONFIG_SOC_ADC_SAMPLE_FREQ_THRES_LOW=20 -CONFIG_SOC_ADC_RTC_MIN_BITWIDTH=9 -CONFIG_SOC_ADC_RTC_MAX_BITWIDTH=12 -CONFIG_SOC_ADC_SHARED_POWER=y -CONFIG_SOC_BROWNOUT_RESET_SUPPORTED=y -CONFIG_SOC_SHARED_IDCACHE_SUPPORTED=y -CONFIG_SOC_IDCACHE_PER_CORE=y -CONFIG_SOC_CPU_CORES_NUM=2 -CONFIG_SOC_CPU_INTR_NUM=32 -CONFIG_SOC_CPU_HAS_FPU=y -CONFIG_SOC_HP_CPU_HAS_MULTIPLE_CORES=y -CONFIG_SOC_CPU_BREAKPOINTS_NUM=2 -CONFIG_SOC_CPU_WATCHPOINTS_NUM=2 -CONFIG_SOC_CPU_WATCHPOINT_MAX_REGION_SIZE=0x40 -CONFIG_SOC_DAC_CHAN_NUM=2 -CONFIG_SOC_DAC_RESOLUTION=8 -CONFIG_SOC_DAC_DMA_16BIT_ALIGN=y -CONFIG_SOC_GPIO_PORT=1 -CONFIG_SOC_GPIO_PIN_COUNT=40 -CONFIG_SOC_GPIO_VALID_GPIO_MASK=0xFFFFFFFFFF -CONFIG_SOC_GPIO_IN_RANGE_MAX=39 -CONFIG_SOC_GPIO_OUT_RANGE_MAX=33 -CONFIG_SOC_GPIO_VALID_DIGITAL_IO_PAD_MASK=0xEF0FEA -CONFIG_SOC_GPIO_CLOCKOUT_BY_IO_MUX=y -CONFIG_SOC_GPIO_CLOCKOUT_CHANNEL_NUM=3 -CONFIG_SOC_GPIO_SUPPORT_HOLD_IO_IN_DSLP=y -CONFIG_SOC_I2C_NUM=2 -CONFIG_SOC_HP_I2C_NUM=2 -CONFIG_SOC_I2C_FIFO_LEN=32 -CONFIG_SOC_I2C_CMD_REG_NUM=16 -CONFIG_SOC_I2C_SUPPORT_SLAVE=y -CONFIG_SOC_I2C_SUPPORT_APB=y -CONFIG_SOC_I2C_SUPPORT_10BIT_ADDR=y -CONFIG_SOC_I2C_STOP_INDEPENDENT=y -CONFIG_SOC_I2S_NUM=2 -CONFIG_SOC_I2S_HW_VERSION_1=y -CONFIG_SOC_I2S_SUPPORTS_APLL=y -CONFIG_SOC_I2S_SUPPORTS_PLL_F160M=y -CONFIG_SOC_I2S_SUPPORTS_PDM=y -CONFIG_SOC_I2S_SUPPORTS_PDM_TX=y -CONFIG_SOC_I2S_SUPPORTS_PCM2PDM=y -CONFIG_SOC_I2S_SUPPORTS_PDM_RX=y -CONFIG_SOC_I2S_SUPPORTS_PDM2PCM=y -CONFIG_SOC_I2S_PDM_MAX_TX_LINES=1 -CONFIG_SOC_I2S_PDM_MAX_RX_LINES=1 -CONFIG_SOC_I2S_SUPPORTS_ADC_DAC=y -CONFIG_SOC_I2S_SUPPORTS_ADC=y -CONFIG_SOC_I2S_SUPPORTS_DAC=y -CONFIG_SOC_I2S_SUPPORTS_LCD_CAMERA=y -CONFIG_SOC_I2S_MAX_DATA_WIDTH=24 -CONFIG_SOC_I2S_TRANS_SIZE_ALIGN_WORD=y -CONFIG_SOC_I2S_LCD_I80_VARIANT=y -CONFIG_SOC_LCD_I80_SUPPORTED=y -CONFIG_SOC_LCD_I80_BUSES=2 -CONFIG_SOC_LCD_I80_BUS_WIDTH=24 -CONFIG_SOC_LEDC_HAS_TIMER_SPECIFIC_MUX=y -CONFIG_SOC_LEDC_SUPPORT_APB_CLOCK=y -CONFIG_SOC_LEDC_SUPPORT_REF_TICK=y -CONFIG_SOC_LEDC_SUPPORT_HS_MODE=y -CONFIG_SOC_LEDC_TIMER_NUM=4 -CONFIG_SOC_LEDC_CHANNEL_NUM=8 -CONFIG_SOC_LEDC_TIMER_BIT_WIDTH=20 -CONFIG_SOC_MCPWM_GROUPS=2 -CONFIG_SOC_MCPWM_TIMERS_PER_GROUP=3 -CONFIG_SOC_MCPWM_OPERATORS_PER_GROUP=3 -CONFIG_SOC_MCPWM_COMPARATORS_PER_OPERATOR=2 -CONFIG_SOC_MCPWM_GENERATORS_PER_OPERATOR=2 -CONFIG_SOC_MCPWM_TRIGGERS_PER_OPERATOR=2 -CONFIG_SOC_MCPWM_GPIO_FAULTS_PER_GROUP=3 -CONFIG_SOC_MCPWM_CAPTURE_TIMERS_PER_GROUP=y -CONFIG_SOC_MCPWM_CAPTURE_CHANNELS_PER_TIMER=3 -CONFIG_SOC_MCPWM_GPIO_SYNCHROS_PER_GROUP=3 -CONFIG_SOC_MMU_PERIPH_NUM=2 -CONFIG_SOC_MMU_LINEAR_ADDRESS_REGION_NUM=3 -CONFIG_SOC_MPU_MIN_REGION_SIZE=0x20000000 -CONFIG_SOC_MPU_REGIONS_MAX_NUM=8 -CONFIG_SOC_PCNT_GROUPS=1 -CONFIG_SOC_PCNT_UNITS_PER_GROUP=8 -CONFIG_SOC_PCNT_CHANNELS_PER_UNIT=2 -CONFIG_SOC_PCNT_THRES_POINT_PER_UNIT=2 -CONFIG_SOC_RMT_GROUPS=1 -CONFIG_SOC_RMT_TX_CANDIDATES_PER_GROUP=8 -CONFIG_SOC_RMT_RX_CANDIDATES_PER_GROUP=8 -CONFIG_SOC_RMT_CHANNELS_PER_GROUP=8 -CONFIG_SOC_RMT_MEM_WORDS_PER_CHANNEL=64 -CONFIG_SOC_RMT_SUPPORT_REF_TICK=y -CONFIG_SOC_RMT_SUPPORT_APB=y -CONFIG_SOC_RMT_CHANNEL_CLK_INDEPENDENT=y -CONFIG_SOC_RTCIO_PIN_COUNT=18 -CONFIG_SOC_RTCIO_INPUT_OUTPUT_SUPPORTED=y -CONFIG_SOC_RTCIO_HOLD_SUPPORTED=y -CONFIG_SOC_RTCIO_WAKE_SUPPORTED=y -CONFIG_SOC_SDM_GROUPS=1 -CONFIG_SOC_SDM_CHANNELS_PER_GROUP=8 -CONFIG_SOC_SDM_CLK_SUPPORT_APB=y -CONFIG_SOC_SPI_HD_BOTH_INOUT_SUPPORTED=y -CONFIG_SOC_SPI_AS_CS_SUPPORTED=y -CONFIG_SOC_SPI_PERIPH_NUM=3 -CONFIG_SOC_SPI_DMA_CHAN_NUM=2 -CONFIG_SOC_SPI_MAX_CS_NUM=3 -CONFIG_SOC_SPI_SUPPORT_CLK_APB=y -CONFIG_SOC_SPI_MAXIMUM_BUFFER_SIZE=64 -CONFIG_SOC_SPI_MAX_PRE_DIVIDER=8192 -CONFIG_SOC_MEMSPI_SRC_FREQ_80M_SUPPORTED=y -CONFIG_SOC_MEMSPI_SRC_FREQ_40M_SUPPORTED=y -CONFIG_SOC_MEMSPI_SRC_FREQ_26M_SUPPORTED=y -CONFIG_SOC_MEMSPI_SRC_FREQ_20M_SUPPORTED=y -CONFIG_SOC_TIMER_GROUPS=2 -CONFIG_SOC_TIMER_GROUP_TIMERS_PER_GROUP=2 -CONFIG_SOC_TIMER_GROUP_COUNTER_BIT_WIDTH=64 -CONFIG_SOC_TIMER_GROUP_TOTAL_TIMERS=4 -CONFIG_SOC_TIMER_GROUP_SUPPORT_APB=y -CONFIG_SOC_LP_TIMER_BIT_WIDTH_LO=32 -CONFIG_SOC_LP_TIMER_BIT_WIDTH_HI=16 -CONFIG_SOC_TOUCH_SENSOR_VERSION=1 -CONFIG_SOC_TOUCH_SENSOR_NUM=10 -CONFIG_SOC_TOUCH_MIN_CHAN_ID=0 -CONFIG_SOC_TOUCH_MAX_CHAN_ID=9 -CONFIG_SOC_TOUCH_SUPPORT_SLEEP_WAKEUP=y -CONFIG_SOC_TOUCH_SAMPLE_CFG_NUM=1 -CONFIG_SOC_TWAI_CONTROLLER_NUM=1 -CONFIG_SOC_TWAI_MASK_FILTER_NUM=1 -CONFIG_SOC_TWAI_BRP_MIN=2 -CONFIG_SOC_TWAI_CLK_SUPPORT_APB=y -CONFIG_SOC_TWAI_SUPPORT_MULTI_ADDRESS_LAYOUT=y -CONFIG_SOC_UART_NUM=3 -CONFIG_SOC_UART_HP_NUM=3 -CONFIG_SOC_UART_SUPPORT_APB_CLK=y -CONFIG_SOC_UART_SUPPORT_REF_TICK=y -CONFIG_SOC_UART_FIFO_LEN=128 -CONFIG_SOC_UART_BITRATE_MAX=5000000 -CONFIG_SOC_UART_WAKEUP_SUPPORT_ACTIVE_THRESH_MODE=y -CONFIG_SOC_SPIRAM_SUPPORTED=y -CONFIG_SOC_SPI_MEM_SUPPORT_CONFIG_GPIO_BY_EFUSE=y -CONFIG_SOC_SHA_SUPPORT_PARALLEL_ENG=y -CONFIG_SOC_SHA_ENDIANNESS_BE=y -CONFIG_SOC_SHA_SUPPORT_SHA1=y -CONFIG_SOC_SHA_SUPPORT_SHA256=y -CONFIG_SOC_SHA_SUPPORT_SHA384=y -CONFIG_SOC_SHA_SUPPORT_SHA512=y -CONFIG_SOC_MPI_MEM_BLOCKS_NUM=4 -CONFIG_SOC_MPI_OPERATIONS_NUM=1 -CONFIG_SOC_RSA_MAX_BIT_LEN=4096 -CONFIG_SOC_AES_SUPPORT_AES_128=y -CONFIG_SOC_AES_SUPPORT_AES_192=y -CONFIG_SOC_AES_SUPPORT_AES_256=y -CONFIG_SOC_SECURE_BOOT_V1=y -CONFIG_SOC_EFUSE_SECURE_BOOT_KEY_DIGESTS=1 -CONFIG_SOC_FLASH_ENCRYPTED_XTS_AES_BLOCK_MAX=32 -CONFIG_SOC_PHY_DIG_REGS_MEM_SIZE=21 -CONFIG_SOC_PM_SUPPORT_EXT0_WAKEUP=y -CONFIG_SOC_PM_SUPPORT_EXT1_WAKEUP=y -CONFIG_SOC_PM_SUPPORT_EXT_WAKEUP=y -CONFIG_SOC_PM_SUPPORT_TOUCH_SENSOR_WAKEUP=y -CONFIG_SOC_PM_SUPPORT_RTC_PERIPH_PD=y -CONFIG_SOC_PM_SUPPORT_RTC_FAST_MEM_PD=y -CONFIG_SOC_PM_SUPPORT_RTC_SLOW_MEM_PD=y -CONFIG_SOC_PM_SUPPORT_RC_FAST_PD=y -CONFIG_SOC_PM_SUPPORT_VDDSDIO_PD=y -CONFIG_SOC_PM_SUPPORT_MODEM_PD=y -CONFIG_SOC_CONFIGURABLE_VDDSDIO_SUPPORTED=y -CONFIG_SOC_PM_MODEM_PD_BY_SW=y -CONFIG_SOC_CLK_APLL_SUPPORTED=y -CONFIG_SOC_CLK_RC_FAST_D256_SUPPORTED=y -CONFIG_SOC_RTC_SLOW_CLK_SUPPORT_RC_FAST_D256=y -CONFIG_SOC_CLK_RC_FAST_SUPPORT_CALIBRATION=y -CONFIG_SOC_CLK_XTAL32K_SUPPORTED=y -CONFIG_SOC_CLK_LP_FAST_SUPPORT_XTAL_D4=y -CONFIG_SOC_SDMMC_USE_IOMUX=y -CONFIG_SOC_SDMMC_NUM_SLOTS=2 -CONFIG_SOC_WIFI_WAPI_SUPPORT=y -CONFIG_SOC_WIFI_CSI_SUPPORT=y -CONFIG_SOC_WIFI_MESH_SUPPORT=y -CONFIG_SOC_WIFI_SUPPORT_VARIABLE_BEACON_WINDOW=y -CONFIG_SOC_WIFI_NAN_SUPPORT=y -CONFIG_SOC_BLE_SUPPORTED=y -CONFIG_SOC_BLE_MESH_SUPPORTED=y -CONFIG_SOC_BT_CLASSIC_SUPPORTED=y -CONFIG_SOC_BLUFI_SUPPORTED=y -CONFIG_SOC_BT_H2C_ENC_KEY_CTRL_ENH_VSC_SUPPORTED=y -CONFIG_SOC_BLE_MULTI_CONN_OPTIMIZATION=y -CONFIG_SOC_ULP_HAS_ADC=y -CONFIG_SOC_PHY_COMBO_MODULE=y -CONFIG_SOC_EMAC_RMII_CLK_OUT_INTERNAL_LOOPBACK=y -CONFIG_IDF_CMAKE=y -CONFIG_IDF_TOOLCHAIN="gcc" -CONFIG_IDF_TOOLCHAIN_GCC=y -CONFIG_IDF_TARGET_ARCH_XTENSA=y -CONFIG_IDF_TARGET_ARCH="xtensa" -CONFIG_IDF_TARGET="esp32" -CONFIG_IDF_INIT_VERSION="5.5.1" -CONFIG_IDF_TARGET_ESP32=y -CONFIG_IDF_FIRMWARE_CHIP_ID=0x0000 - -# -# Build type -# -CONFIG_APP_BUILD_TYPE_APP_2NDBOOT=y -# CONFIG_APP_BUILD_TYPE_RAM is not set -CONFIG_APP_BUILD_GENERATE_BINARIES=y -CONFIG_APP_BUILD_BOOTLOADER=y -CONFIG_APP_BUILD_USE_FLASH_SECTIONS=y -# CONFIG_APP_REPRODUCIBLE_BUILD is not set -# CONFIG_APP_NO_BLOBS is not set -# CONFIG_APP_COMPATIBLE_PRE_V2_1_BOOTLOADERS is not set -# CONFIG_APP_COMPATIBLE_PRE_V3_1_BOOTLOADERS is not set -# end of Build type - -# -# Bootloader config -# - -# -# Bootloader manager -# -CONFIG_BOOTLOADER_COMPILE_TIME_DATE=y -CONFIG_BOOTLOADER_PROJECT_VER=1 -# end of Bootloader manager - -# -# Application Rollback -# -CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE=y -# CONFIG_BOOTLOADER_APP_ANTI_ROLLBACK is not set -# end of Application Rollback - -# -# Recovery Bootloader and Rollback -# -# end of Recovery Bootloader and Rollback - -CONFIG_BOOTLOADER_OFFSET_IN_FLASH=0x1000 -CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE=y -# CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_DEBUG is not set -# CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_PERF is not set -# CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_NONE is not set - -# -# Log -# -CONFIG_BOOTLOADER_LOG_VERSION_1=y -CONFIG_BOOTLOADER_LOG_VERSION=1 -# CONFIG_BOOTLOADER_LOG_LEVEL_NONE is not set -CONFIG_BOOTLOADER_LOG_LEVEL_ERROR=y -# CONFIG_BOOTLOADER_LOG_LEVEL_WARN is not set -# CONFIG_BOOTLOADER_LOG_LEVEL_INFO is not set -# CONFIG_BOOTLOADER_LOG_LEVEL_DEBUG is not set -# CONFIG_BOOTLOADER_LOG_LEVEL_VERBOSE is not set -CONFIG_BOOTLOADER_LOG_LEVEL=1 - -# -# Format -# -# CONFIG_BOOTLOADER_LOG_COLORS is not set -CONFIG_BOOTLOADER_LOG_TIMESTAMP_SOURCE_CPU_TICKS=y -# end of Format - -# -# Settings -# -CONFIG_BOOTLOADER_LOG_MODE_TEXT_EN=y -CONFIG_BOOTLOADER_LOG_MODE_TEXT=y -# end of Settings -# end of Log - -# -# Serial Flash Configurations -# -# CONFIG_BOOTLOADER_SPI_CUSTOM_WP_PIN is not set -CONFIG_BOOTLOADER_SPI_WP_PIN=7 -# CONFIG_BOOTLOADER_FLASH_DC_AWARE is not set -CONFIG_BOOTLOADER_FLASH_XMC_SUPPORT=y -# end of Serial Flash Configurations - -CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_9V=y -# CONFIG_BOOTLOADER_FACTORY_RESET is not set -# CONFIG_BOOTLOADER_APP_TEST is not set -CONFIG_BOOTLOADER_REGION_PROTECTION_ENABLE=y -CONFIG_BOOTLOADER_WDT_ENABLE=y -# CONFIG_BOOTLOADER_WDT_DISABLE_IN_USER_CODE is not set -CONFIG_BOOTLOADER_WDT_TIME_MS=9000 -# CONFIG_BOOTLOADER_SKIP_VALIDATE_IN_DEEP_SLEEP is not set -# CONFIG_BOOTLOADER_SKIP_VALIDATE_ON_POWER_ON is not set -# CONFIG_BOOTLOADER_SKIP_VALIDATE_ALWAYS is not set -CONFIG_BOOTLOADER_RESERVE_RTC_SIZE=0 -# CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC is not set -# end of Bootloader config - -# -# Security features -# -CONFIG_SECURE_BOOT_V1_SUPPORTED=y -# CONFIG_SECURE_SIGNED_APPS_NO_SECURE_BOOT is not set -# CONFIG_SECURE_BOOT is not set -# CONFIG_SECURE_FLASH_ENC_ENABLED is not set -# end of Security features - -# -# Application manager -# -CONFIG_APP_COMPILE_TIME_DATE=y -# CONFIG_APP_EXCLUDE_PROJECT_VER_VAR is not set -# CONFIG_APP_EXCLUDE_PROJECT_NAME_VAR is not set -# CONFIG_APP_PROJECT_VER_FROM_CONFIG is not set -CONFIG_APP_RETRIEVE_LEN_ELF_SHA=16 -# end of Application manager - -CONFIG_ESP_ROM_HAS_CRC_LE=y -CONFIG_ESP_ROM_HAS_CRC_BE=y -CONFIG_ESP_ROM_HAS_MZ_CRC32=y -CONFIG_ESP_ROM_HAS_JPEG_DECODE=y -CONFIG_ESP_ROM_HAS_UART_BUF_SWITCH=y -CONFIG_ESP_ROM_NEEDS_SWSETUP_WORKAROUND=y -CONFIG_ESP_ROM_HAS_NEWLIB=y -CONFIG_ESP_ROM_HAS_NEWLIB_NANO_FORMAT=y -CONFIG_ESP_ROM_HAS_NEWLIB_32BIT_TIME=y -CONFIG_ESP_ROM_HAS_SW_FLOAT=y -CONFIG_ESP_ROM_USB_OTG_NUM=-1 -CONFIG_ESP_ROM_USB_SERIAL_DEVICE_NUM=-1 -CONFIG_ESP_ROM_SUPPORT_DEEP_SLEEP_WAKEUP_STUB=y -CONFIG_ESP_ROM_HAS_OUTPUT_PUTC_FUNC=y - -# -# Serial flasher config -# -# CONFIG_ESPTOOLPY_NO_STUB is not set -CONFIG_ESPTOOLPY_FLASHMODE_QIO=y -# CONFIG_ESPTOOLPY_FLASHMODE_QOUT is not set -# CONFIG_ESPTOOLPY_FLASHMODE_DIO is not set -# CONFIG_ESPTOOLPY_FLASHMODE_DOUT is not set -CONFIG_ESPTOOLPY_FLASH_SAMPLE_MODE_STR=y -CONFIG_ESPTOOLPY_FLASHMODE="dio" -CONFIG_ESPTOOLPY_FLASHFREQ_80M=y -# CONFIG_ESPTOOLPY_FLASHFREQ_40M is not set -# CONFIG_ESPTOOLPY_FLASHFREQ_26M is not set -# CONFIG_ESPTOOLPY_FLASHFREQ_20M is not set -CONFIG_ESPTOOLPY_FLASHFREQ="80m" -# CONFIG_ESPTOOLPY_FLASHSIZE_1MB is not set -# CONFIG_ESPTOOLPY_FLASHSIZE_2MB is not set -CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y -# CONFIG_ESPTOOLPY_FLASHSIZE_8MB is not set -# CONFIG_ESPTOOLPY_FLASHSIZE_16MB is not set -# CONFIG_ESPTOOLPY_FLASHSIZE_32MB is not set -# CONFIG_ESPTOOLPY_FLASHSIZE_64MB is not set -# CONFIG_ESPTOOLPY_FLASHSIZE_128MB is not set -CONFIG_ESPTOOLPY_FLASHSIZE="4MB" -# CONFIG_ESPTOOLPY_HEADER_FLASHSIZE_UPDATE is not set -CONFIG_ESPTOOLPY_BEFORE_RESET=y -# CONFIG_ESPTOOLPY_BEFORE_NORESET is not set -CONFIG_ESPTOOLPY_BEFORE="default_reset" -CONFIG_ESPTOOLPY_AFTER_RESET=y -# CONFIG_ESPTOOLPY_AFTER_NORESET is not set -CONFIG_ESPTOOLPY_AFTER="hard_reset" -CONFIG_ESPTOOLPY_MONITOR_BAUD=115200 -# end of Serial flasher config - -# -# Partition Table -# -# CONFIG_PARTITION_TABLE_SINGLE_APP is not set -# CONFIG_PARTITION_TABLE_SINGLE_APP_LARGE is not set -# CONFIG_PARTITION_TABLE_TWO_OTA is not set -# CONFIG_PARTITION_TABLE_TWO_OTA_LARGE is not set -CONFIG_PARTITION_TABLE_CUSTOM=y -CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv" -CONFIG_PARTITION_TABLE_FILENAME="partitions.csv" -CONFIG_PARTITION_TABLE_OFFSET=0x8000 -CONFIG_PARTITION_TABLE_MD5=y -# end of Partition Table - -# -# Snapclient Configuration -# -CONFIG_SNAPSERVER_USE_MDNS=y -# CONFIG_SNAPCLIENT_CONNECT_IPV6 is not set -CONFIG_SNAPCLIENT_NAME="hifi-esp32" - -# -# HTTP Server Setting -# -CONFIG_WEB_PORT=80 -# end of HTTP Server Setting - -CONFIG_USE_SAMPLE_INSERTION=y -# end of Snapclient Configuration - -# -# Audio Board -# -CONFIG_AUDIO_BOARD_CUSTOM=y -# CONFIG_ESP_LYRAT_V4_3_BOARD is not set -# CONFIG_ESP_LYRAT_V4_2_BOARD is not set -# CONFIG_ESP_LYRATD_MSC_V2_1_BOARD is not set -# CONFIG_ESP_LYRATD_MSC_V2_2_BOARD is not set -# CONFIG_ESP_LYRAT_MINI_V1_1_BOARD is not set -# CONFIG_ESP32_KORVO_DU1906_BOARD is not set -# CONFIG_ESP32_S2_KALUGA_1_V1_2_BOARD is not set -# CONFIG_ESP_AI_THINKER_ES8388_BOARD is not set - -# -# Custom Audio Board -# -CONFIG_DAC_PCM51XX=y -# CONFIG_DAC_PCM5102A is not set -# CONFIG_DAC_MA120 is not set -# CONFIG_DAC_MA120X0 is not set -# CONFIG_DAC_ADAU1961 is not set -# CONFIG_DAC_MAX98357 is not set -# CONFIG_DAC_TAS5805M is not set -# CONFIG_DAC_PT8211 is not set - -# -# DAC I2C control interface -# -CONFIG_DAC_I2C_SDA=27 -CONFIG_DAC_I2C_SCL=21 -CONFIG_DAC_I2C_ADDR=0x4D -# end of DAC I2C control interface - -# -# I2S master interface -# -CONFIG_MASTER_I2S_MCLK_PIN=0 -CONFIG_MASTER_I2S_BCK_PIN=26 -CONFIG_MASTER_I2S_LRCK_PIN=25 -CONFIG_MASTER_I2S_DATAOUT_PIN=22 -# end of I2S master interface - -# -# Logic-Level-Settings -# -# CONFIG_INVERT_MCLK_LEVEL is not set -# CONFIG_INVERT_WORD_SELECT_LEVEL is not set -# CONFIG_INVERT_BCLK_LEVEL is not set -# end of Logic-Level-Settings -# end of Custom Audio Board -# end of Audio Board - -# -# ESP32 DSP processor config -# -CONFIG_USE_DSP_PROCESSOR=y -# CONFIG_SNAPCLIENT_MIX_LR_TO_MONO is not set -CONFIG_SNAPCLIENT_DSP_FLOW_STEREO=y -# CONFIG_SNAPCLIENT_DSP_FLOW_BASSBOOST is not set -# CONFIG_SNAPCLIENT_DSP_FLOW_BIAMP is not set -# CONFIG_SNAPCLIENT_DSP_FLOW_BASS_TREBLE_EQ is not set -CONFIG_USE_BIQUAD_ASM=y -# CONFIG_SNAPCLIENT_USE_SOFT_VOL is not set -# end of ESP32 DSP processor config - -# -# SNTP Configuration -# -CONFIG_SNTP_TIMEZONE="UTC" -CONFIG_SNTP_SERVER="pool.ntp.org" -# end of SNTP Configuration - -# -# Snapclient Ethernet Configuration -# -CONFIG_ENV_GPIO_RANGE_MIN=0 -CONFIG_ENV_GPIO_RANGE_MAX=39 -CONFIG_ENV_GPIO_IN_RANGE_MAX=39 -CONFIG_ENV_GPIO_OUT_RANGE_MAX=33 -# CONFIG_SNAPCLIENT_USE_INTERNAL_ETHERNET is not set -# CONFIG_SNAPCLIENT_USE_SPI_ETHERNET is not set -# end of Snapclient Ethernet Configuration - -# -# Wifi Configuration -# -CONFIG_ENABLE_WIFI_PROVISIONING=y -# CONFIG_WIFI_AUTH_WEP is not set -# CONFIG_WIFI_AUTH_WPA_PSK is not set -# CONFIG_WIFI_AUTH_WPA2_PSK is not set -# CONFIG_WIFI_AUTH_WPA_WPA2_PSK is not set -CONFIG_WIFI_AUTH_WPA2_WPA3_PSK=y -# CONFIG_WIFI_AUTH_ENTERPRISE is not set -# CONFIG_WIFI_AUTH_WPA2_ENTERPRISE is not set -# CONFIG_WIFI_AUTH_WPA3_PSK is not set -# CONFIG_WIFI_AUTH_WPA3_ENT_192 is not set -# CONFIG_WIFI_AUTH_WAPI_PSK is not set -# CONFIG_WIFI_AUTH_OWE is not set -CONFIG_WIFI_MAXIMUM_RETRY=0 -# end of Wifi Configuration - -# -# Compiler options -# -# CONFIG_COMPILER_OPTIMIZATION_DEBUG is not set -# CONFIG_COMPILER_OPTIMIZATION_SIZE is not set -CONFIG_COMPILER_OPTIMIZATION_PERF=y -# CONFIG_COMPILER_OPTIMIZATION_NONE is not set -CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE=y -# CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT is not set -# CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE is not set -CONFIG_COMPILER_ASSERT_NDEBUG_EVALUATE=y -CONFIG_COMPILER_FLOAT_LIB_FROM_GCCLIB=y -CONFIG_COMPILER_OPTIMIZATION_ASSERTION_LEVEL=2 -# CONFIG_COMPILER_OPTIMIZATION_CHECKS_SILENT is not set -CONFIG_COMPILER_HIDE_PATHS_MACROS=y -# CONFIG_COMPILER_CXX_EXCEPTIONS is not set -# CONFIG_COMPILER_CXX_RTTI is not set -CONFIG_COMPILER_STACK_CHECK_MODE_NONE=y -# CONFIG_COMPILER_STACK_CHECK_MODE_NORM is not set -# CONFIG_COMPILER_STACK_CHECK_MODE_STRONG is not set -# CONFIG_COMPILER_STACK_CHECK_MODE_ALL is not set -# CONFIG_COMPILER_NO_MERGE_CONSTANTS is not set -# CONFIG_COMPILER_WARN_WRITE_STRINGS is not set -CONFIG_COMPILER_DISABLE_DEFAULT_ERRORS=y -# CONFIG_COMPILER_DISABLE_GCC12_WARNINGS is not set -# CONFIG_COMPILER_DISABLE_GCC13_WARNINGS is not set -# CONFIG_COMPILER_DISABLE_GCC14_WARNINGS is not set -# CONFIG_COMPILER_DUMP_RTL_FILES is not set -CONFIG_COMPILER_RT_LIB_GCCLIB=y -CONFIG_COMPILER_RT_LIB_NAME="gcc" -CONFIG_COMPILER_ORPHAN_SECTIONS_WARNING=y -# CONFIG_COMPILER_ORPHAN_SECTIONS_PLACE is not set -# CONFIG_COMPILER_STATIC_ANALYZER is not set -# end of Compiler options - -# -# Component config -# - -# -# Application Level Tracing -# -# CONFIG_APPTRACE_DEST_JTAG is not set -CONFIG_APPTRACE_DEST_NONE=y -# CONFIG_APPTRACE_DEST_UART1 is not set -# CONFIG_APPTRACE_DEST_UART2 is not set -CONFIG_APPTRACE_DEST_UART_NONE=y -CONFIG_APPTRACE_UART_TASK_PRIO=1 -CONFIG_APPTRACE_LOCK_ENABLE=y -# end of Application Level Tracing - -# -# Bluetooth -# -# CONFIG_BT_ENABLED is not set - -# -# Common Options -# -# CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED is not set -# CONFIG_BT_BLE_LOG_UHCI_OUT_ENABLED is not set -# end of Common Options -# end of Bluetooth - -# -# Console Library -# -# CONFIG_CONSOLE_SORTED_HELP is not set -# end of Console Library - -# -# Driver Configurations -# - -# -# Legacy TWAI Driver Configurations -# -# CONFIG_TWAI_SKIP_LEGACY_CONFLICT_CHECK is not set -# CONFIG_TWAI_ERRATA_FIX_BUS_OFF_REC is not set -# CONFIG_TWAI_ERRATA_FIX_TX_INTR_LOST is not set -# CONFIG_TWAI_ERRATA_FIX_RX_FRAME_INVALID is not set -# CONFIG_TWAI_ERRATA_FIX_RX_FIFO_CORRUPT is not set -# CONFIG_TWAI_ERRATA_FIX_LISTEN_ONLY_DOM is not set -# end of Legacy TWAI Driver Configurations - -# -# Legacy ADC Driver Configuration -# -CONFIG_ADC_DISABLE_DAC=y -# CONFIG_ADC_SUPPRESS_DEPRECATE_WARN is not set -# CONFIG_ADC_SKIP_LEGACY_CONFLICT_CHECK is not set - -# -# Legacy ADC Calibration Configuration -# -CONFIG_ADC_CAL_EFUSE_TP_ENABLE=y -CONFIG_ADC_CAL_EFUSE_VREF_ENABLE=y -CONFIG_ADC_CAL_LUT_ENABLE=y -# CONFIG_ADC_CALI_SUPPRESS_DEPRECATE_WARN is not set -# end of Legacy ADC Calibration Configuration -# end of Legacy ADC Driver Configuration - -# -# Legacy DAC Driver Configurations -# -# CONFIG_DAC_SUPPRESS_DEPRECATE_WARN is not set -# CONFIG_DAC_SKIP_LEGACY_CONFLICT_CHECK is not set -# end of Legacy DAC Driver Configurations - -# -# Legacy MCPWM Driver Configurations -# -# CONFIG_MCPWM_SUPPRESS_DEPRECATE_WARN is not set -# CONFIG_MCPWM_SKIP_LEGACY_CONFLICT_CHECK is not set -# end of Legacy MCPWM Driver Configurations - -# -# Legacy Timer Group Driver Configurations -# -# CONFIG_GPTIMER_SUPPRESS_DEPRECATE_WARN is not set -# CONFIG_GPTIMER_SKIP_LEGACY_CONFLICT_CHECK is not set -# end of Legacy Timer Group Driver Configurations - -# -# Legacy RMT Driver Configurations -# -# CONFIG_RMT_SUPPRESS_DEPRECATE_WARN is not set -# CONFIG_RMT_SKIP_LEGACY_CONFLICT_CHECK is not set -# end of Legacy RMT Driver Configurations - -# -# Legacy I2S Driver Configurations -# -# CONFIG_I2S_SUPPRESS_DEPRECATE_WARN is not set -# CONFIG_I2S_SKIP_LEGACY_CONFLICT_CHECK is not set -# end of Legacy I2S Driver Configurations - -# -# Legacy I2C Driver Configurations -# -# CONFIG_I2C_SKIP_LEGACY_CONFLICT_CHECK is not set -# end of Legacy I2C Driver Configurations - -# -# Legacy PCNT Driver Configurations -# -# CONFIG_PCNT_SUPPRESS_DEPRECATE_WARN is not set -# CONFIG_PCNT_SKIP_LEGACY_CONFLICT_CHECK is not set -# end of Legacy PCNT Driver Configurations - -# -# Legacy SDM Driver Configurations -# -# CONFIG_SDM_SUPPRESS_DEPRECATE_WARN is not set -# CONFIG_SDM_SKIP_LEGACY_CONFLICT_CHECK is not set -# end of Legacy SDM Driver Configurations - -# -# Legacy Touch Sensor Driver Configurations -# -# CONFIG_TOUCH_SUPPRESS_DEPRECATE_WARN is not set -# CONFIG_TOUCH_SKIP_LEGACY_CONFLICT_CHECK is not set -# end of Legacy Touch Sensor Driver Configurations -# end of Driver Configurations - -# -# eFuse Bit Manager -# -# CONFIG_EFUSE_CUSTOM_TABLE is not set -# CONFIG_EFUSE_VIRTUAL is not set -# CONFIG_EFUSE_CODE_SCHEME_COMPAT_NONE is not set -CONFIG_EFUSE_CODE_SCHEME_COMPAT_3_4=y -# CONFIG_EFUSE_CODE_SCHEME_COMPAT_REPEAT is not set -CONFIG_EFUSE_MAX_BLK_LEN=192 -# end of eFuse Bit Manager - -# -# ESP-TLS -# -CONFIG_ESP_TLS_USING_MBEDTLS=y -# CONFIG_ESP_TLS_USE_SECURE_ELEMENT is not set -# CONFIG_ESP_TLS_CLIENT_SESSION_TICKETS is not set -# CONFIG_ESP_TLS_SERVER_SESSION_TICKETS is not set -# CONFIG_ESP_TLS_SERVER_CERT_SELECT_HOOK is not set -# CONFIG_ESP_TLS_SERVER_MIN_AUTH_MODE_OPTIONAL is not set -# CONFIG_ESP_TLS_PSK_VERIFICATION is not set -# CONFIG_ESP_TLS_INSECURE is not set -CONFIG_ESP_TLS_DYN_BUF_STRATEGY_SUPPORTED=y -# end of ESP-TLS - -# -# ADC and ADC Calibration -# -# CONFIG_ADC_ONESHOT_CTRL_FUNC_IN_IRAM is not set -# CONFIG_ADC_CONTINUOUS_ISR_IRAM_SAFE is not set - -# -# ADC Calibration Configurations -# -CONFIG_ADC_CALI_EFUSE_TP_ENABLE=y -CONFIG_ADC_CALI_EFUSE_VREF_ENABLE=y -CONFIG_ADC_CALI_LUT_ENABLE=y -# end of ADC Calibration Configurations - -CONFIG_ADC_DISABLE_DAC_OUTPUT=y -# CONFIG_ADC_ENABLE_DEBUG_LOG is not set -# end of ADC and ADC Calibration - -# -# Wireless Coexistence -# -CONFIG_ESP_COEX_ENABLED=y -# CONFIG_ESP_COEX_GPIO_DEBUG is not set -# end of Wireless Coexistence - -# -# Common ESP-related -# -CONFIG_ESP_ERR_TO_NAME_LOOKUP=y -# end of Common ESP-related - -# -# ESP-Driver:DAC Configurations -# -# CONFIG_DAC_CTRL_FUNC_IN_IRAM is not set -# CONFIG_DAC_ISR_IRAM_SAFE is not set -# CONFIG_DAC_ENABLE_DEBUG_LOG is not set -CONFIG_DAC_DMA_AUTO_16BIT_ALIGN=y -# end of ESP-Driver:DAC Configurations - -# -# ESP-Driver:GPIO Configurations -# -# CONFIG_GPIO_ESP32_SUPPORT_SWITCH_SLP_PULL is not set -# CONFIG_GPIO_CTRL_FUNC_IN_IRAM is not set -# end of ESP-Driver:GPIO Configurations - -# -# ESP-Driver:GPTimer Configurations -# -CONFIG_GPTIMER_ISR_HANDLER_IN_IRAM=y -# CONFIG_GPTIMER_CTRL_FUNC_IN_IRAM is not set -# CONFIG_GPTIMER_ISR_CACHE_SAFE is not set -CONFIG_GPTIMER_OBJ_CACHE_SAFE=y -# CONFIG_GPTIMER_ENABLE_DEBUG_LOG is not set -# end of ESP-Driver:GPTimer Configurations - -# -# ESP-Driver:I2C Configurations -# -# CONFIG_I2C_ISR_IRAM_SAFE is not set -# CONFIG_I2C_ENABLE_DEBUG_LOG is not set -# CONFIG_I2C_ENABLE_SLAVE_DRIVER_VERSION_2 is not set -CONFIG_I2C_MASTER_ISR_HANDLER_IN_IRAM=y -# end of ESP-Driver:I2C Configurations - -# -# ESP-Driver:I2S Configurations -# -# CONFIG_I2S_ISR_IRAM_SAFE is not set -# CONFIG_I2S_ENABLE_DEBUG_LOG is not set -# end of ESP-Driver:I2S Configurations - -# -# ESP-Driver:LEDC Configurations -# -# CONFIG_LEDC_CTRL_FUNC_IN_IRAM is not set -# end of ESP-Driver:LEDC Configurations - -# -# ESP-Driver:MCPWM Configurations -# -CONFIG_MCPWM_ISR_HANDLER_IN_IRAM=y -# CONFIG_MCPWM_ISR_CACHE_SAFE is not set -# CONFIG_MCPWM_CTRL_FUNC_IN_IRAM is not set -CONFIG_MCPWM_OBJ_CACHE_SAFE=y -# CONFIG_MCPWM_ENABLE_DEBUG_LOG is not set -# end of ESP-Driver:MCPWM Configurations - -# -# ESP-Driver:PCNT Configurations -# -# CONFIG_PCNT_CTRL_FUNC_IN_IRAM is not set -# CONFIG_PCNT_ISR_IRAM_SAFE is not set -# CONFIG_PCNT_ENABLE_DEBUG_LOG is not set -# end of ESP-Driver:PCNT Configurations - -# -# ESP-Driver:RMT Configurations -# -CONFIG_RMT_ENCODER_FUNC_IN_IRAM=y -CONFIG_RMT_TX_ISR_HANDLER_IN_IRAM=y -CONFIG_RMT_RX_ISR_HANDLER_IN_IRAM=y -# CONFIG_RMT_RECV_FUNC_IN_IRAM is not set -# CONFIG_RMT_TX_ISR_CACHE_SAFE is not set -# CONFIG_RMT_RX_ISR_CACHE_SAFE is not set -CONFIG_RMT_OBJ_CACHE_SAFE=y -# CONFIG_RMT_ENABLE_DEBUG_LOG is not set -# CONFIG_RMT_ISR_IRAM_SAFE is not set -# end of ESP-Driver:RMT Configurations - -# -# ESP-Driver:Sigma Delta Modulator Configurations -# -# CONFIG_SDM_CTRL_FUNC_IN_IRAM is not set -# CONFIG_SDM_ENABLE_DEBUG_LOG is not set -# end of ESP-Driver:Sigma Delta Modulator Configurations - -# -# ESP-Driver:SPI Configurations -# -CONFIG_SPI_MASTER_ISR_IN_IRAM=y -# CONFIG_SPI_SLAVE_IN_IRAM is not set -# CONFIG_SPI_SLAVE_ISR_IN_IRAM is not set -# end of ESP-Driver:SPI Configurations - -# -# ESP-Driver:Touch Sensor Configurations -# -# CONFIG_TOUCH_CTRL_FUNC_IN_IRAM is not set -# CONFIG_TOUCH_ISR_IRAM_SAFE is not set -# CONFIG_TOUCH_ENABLE_DEBUG_LOG is not set -# CONFIG_TOUCH_SKIP_FSM_CHECK is not set -# end of ESP-Driver:Touch Sensor Configurations - -# -# ESP-Driver:TWAI Configurations -# -# CONFIG_TWAI_ISR_IN_IRAM is not set -# CONFIG_TWAI_ISR_CACHE_SAFE is not set -# CONFIG_TWAI_ENABLE_DEBUG_LOG is not set -# end of ESP-Driver:TWAI Configurations - -# -# ESP-Driver:UART Configurations -# -# CONFIG_UART_ISR_IN_IRAM is not set -# end of ESP-Driver:UART Configurations - -# -# ESP-Driver:UHCI Configurations -# -# CONFIG_UHCI_ISR_HANDLER_IN_IRAM is not set -# CONFIG_UHCI_ISR_CACHE_SAFE is not set -# CONFIG_UHCI_ENABLE_DEBUG_LOG is not set -# end of ESP-Driver:UHCI Configurations - -# -# Ethernet -# -CONFIG_ETH_ENABLED=y -CONFIG_ETH_USE_ESP32_EMAC=y -CONFIG_ETH_PHY_INTERFACE_RMII=y -CONFIG_ETH_RMII_CLK_INPUT=y -# CONFIG_ETH_RMII_CLK_OUTPUT is not set -CONFIG_ETH_RMII_CLK_IN_GPIO=0 -CONFIG_ETH_DMA_BUFFER_SIZE=1024 -CONFIG_ETH_DMA_RX_BUFFER_NUM=30 -CONFIG_ETH_DMA_TX_BUFFER_NUM=5 -# CONFIG_ETH_SOFT_FLOW_CONTROL is not set -# CONFIG_ETH_IRAM_OPTIMIZATION is not set -# CONFIG_ETH_USE_SPI_ETHERNET is not set -# CONFIG_ETH_USE_OPENETH is not set -# CONFIG_ETH_TRANSMIT_MUTEX is not set -# end of Ethernet - -# -# Event Loop Library -# -# CONFIG_ESP_EVENT_LOOP_PROFILING is not set -CONFIG_ESP_EVENT_POST_FROM_ISR=y -# CONFIG_ESP_EVENT_POST_FROM_IRAM_ISR is not set -# end of Event Loop Library - -# -# GDB Stub -# -CONFIG_ESP_GDBSTUB_ENABLED=y -# CONFIG_ESP_SYSTEM_GDBSTUB_RUNTIME is not set -CONFIG_ESP_GDBSTUB_SUPPORT_TASKS=y -CONFIG_ESP_GDBSTUB_MAX_TASKS=32 -# end of GDB Stub - -# -# ESP HID -# -CONFIG_ESPHID_TASK_SIZE_BT=2048 -CONFIG_ESPHID_TASK_SIZE_BLE=4096 -# end of ESP HID - -# -# ESP HTTP client -# -CONFIG_ESP_HTTP_CLIENT_ENABLE_HTTPS=y -# CONFIG_ESP_HTTP_CLIENT_ENABLE_BASIC_AUTH is not set -# CONFIG_ESP_HTTP_CLIENT_ENABLE_DIGEST_AUTH is not set -# CONFIG_ESP_HTTP_CLIENT_ENABLE_CUSTOM_TRANSPORT is not set -CONFIG_ESP_HTTP_CLIENT_EVENT_POST_TIMEOUT=2000 -# end of ESP HTTP client - -# -# HTTP Server -# -CONFIG_HTTPD_MAX_REQ_HDR_LEN=1024 -CONFIG_HTTPD_MAX_URI_LEN=512 -CONFIG_HTTPD_ERR_RESP_NO_DELAY=y -CONFIG_HTTPD_PURGE_BUF_LEN=32 -# CONFIG_HTTPD_LOG_PURGE_DATA is not set -# CONFIG_HTTPD_WS_SUPPORT is not set -# CONFIG_HTTPD_QUEUE_WORK_BLOCKING is not set -CONFIG_HTTPD_SERVER_EVENT_POST_TIMEOUT=2000 -# end of HTTP Server - -# -# ESP HTTPS OTA -# -# CONFIG_ESP_HTTPS_OTA_DECRYPT_CB is not set -# CONFIG_ESP_HTTPS_OTA_ALLOW_HTTP is not set -CONFIG_ESP_HTTPS_OTA_EVENT_POST_TIMEOUT=2000 -# end of ESP HTTPS OTA - -# -# ESP HTTPS server -# -# CONFIG_ESP_HTTPS_SERVER_ENABLE is not set -CONFIG_ESP_HTTPS_SERVER_EVENT_POST_TIMEOUT=2000 -# CONFIG_ESP_HTTPS_SERVER_CERT_SELECT_HOOK is not set -# end of ESP HTTPS server - -# -# Hardware Settings -# - -# -# Chip revision -# -CONFIG_ESP32_REV_MIN_0=y -# CONFIG_ESP32_REV_MIN_1 is not set -# CONFIG_ESP32_REV_MIN_1_1 is not set -# CONFIG_ESP32_REV_MIN_2 is not set -# CONFIG_ESP32_REV_MIN_3 is not set -# CONFIG_ESP32_REV_MIN_3_1 is not set -CONFIG_ESP32_REV_MIN=0 -CONFIG_ESP32_REV_MIN_FULL=0 -CONFIG_ESP_REV_MIN_FULL=0 - -# -# Maximum Supported ESP32 Revision (Rev v3.99) -# -CONFIG_ESP32_REV_MAX_FULL=399 -CONFIG_ESP_REV_MAX_FULL=399 -CONFIG_ESP_EFUSE_BLOCK_REV_MIN_FULL=0 -CONFIG_ESP_EFUSE_BLOCK_REV_MAX_FULL=99 - -# -# Maximum Supported ESP32 eFuse Block Revision (eFuse Block Rev v0.99) -# -# end of Chip revision - -# -# MAC Config -# -CONFIG_ESP_MAC_ADDR_UNIVERSE_WIFI_STA=y -CONFIG_ESP_MAC_ADDR_UNIVERSE_WIFI_AP=y -CONFIG_ESP_MAC_ADDR_UNIVERSE_BT=y -CONFIG_ESP_MAC_ADDR_UNIVERSE_ETH=y -CONFIG_ESP_MAC_UNIVERSAL_MAC_ADDRESSES_FOUR=y -CONFIG_ESP_MAC_UNIVERSAL_MAC_ADDRESSES=4 -# CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES_TWO is not set -CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES_FOUR=y -CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES=4 -# CONFIG_ESP_MAC_IGNORE_MAC_CRC_ERROR is not set -# CONFIG_ESP_MAC_USE_CUSTOM_MAC_AS_BASE_MAC is not set -# end of MAC Config - -# -# Sleep Config -# -CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND=y -CONFIG_ESP_SLEEP_PSRAM_LEAKAGE_WORKAROUND=y -# CONFIG_ESP_SLEEP_MSPI_NEED_ALL_IO_PU is not set -CONFIG_ESP_SLEEP_RTC_BUS_ISO_WORKAROUND=y -# CONFIG_ESP_SLEEP_GPIO_RESET_WORKAROUND is not set -CONFIG_ESP_SLEEP_WAIT_FLASH_READY_EXTRA_DELAY=2000 -# CONFIG_ESP_SLEEP_CACHE_SAFE_ASSERTION is not set -# CONFIG_ESP_SLEEP_DEBUG is not set -CONFIG_ESP_SLEEP_GPIO_ENABLE_INTERNAL_RESISTORS=y -# end of Sleep Config - -# -# RTC Clock Config -# -CONFIG_RTC_CLK_SRC_INT_RC=y -# CONFIG_RTC_CLK_SRC_EXT_CRYS is not set -# CONFIG_RTC_CLK_SRC_EXT_OSC is not set -# CONFIG_RTC_CLK_SRC_INT_8MD256 is not set -CONFIG_RTC_CLK_CAL_CYCLES=1024 -# end of RTC Clock Config - -# -# Peripheral Control -# -CONFIG_ESP_PERIPH_CTRL_FUNC_IN_IRAM=y -CONFIG_ESP_REGI2C_CTRL_FUNC_IN_IRAM=y -# end of Peripheral Control - -# -# Main XTAL Config -# -# CONFIG_XTAL_FREQ_26 is not set -# CONFIG_XTAL_FREQ_32 is not set -CONFIG_XTAL_FREQ_40=y -# CONFIG_XTAL_FREQ_AUTO is not set -CONFIG_XTAL_FREQ=40 -# end of Main XTAL Config - -# -# Power Supplier -# - -# -# Brownout Detector -# -CONFIG_ESP_BROWNOUT_DET=y -# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_0 is not set -# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_1 is not set -# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_2 is not set -# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_3 is not set -CONFIG_ESP_BROWNOUT_DET_LVL_SEL_4=y -# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_5 is not set -# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_6 is not set -# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_7 is not set -CONFIG_ESP_BROWNOUT_DET_LVL=4 -CONFIG_ESP_BROWNOUT_USE_INTR=y -# end of Brownout Detector -# end of Power Supplier - -CONFIG_ESP_SPI_BUS_LOCK_ISR_FUNCS_IN_IRAM=y -CONFIG_ESP_INTR_IN_IRAM=y -# end of Hardware Settings - -# -# ESP-Driver:LCD Controller Configurations -# -# CONFIG_LCD_ENABLE_DEBUG_LOG is not set -# end of ESP-Driver:LCD Controller Configurations - -# -# ESP-MM: Memory Management Configurations -# -# end of ESP-MM: Memory Management Configurations - -# -# ESP NETIF Adapter -# -CONFIG_ESP_NETIF_IP_LOST_TIMER_INTERVAL=120 -# CONFIG_ESP_NETIF_PROVIDE_CUSTOM_IMPLEMENTATION is not set -CONFIG_ESP_NETIF_TCPIP_LWIP=y -# CONFIG_ESP_NETIF_LOOPBACK is not set -CONFIG_ESP_NETIF_USES_TCPIP_WITH_BSD_API=y -CONFIG_ESP_NETIF_REPORT_DATA_TRAFFIC=y -# CONFIG_ESP_NETIF_RECEIVE_REPORT_ERRORS is not set -# CONFIG_ESP_NETIF_L2_TAP is not set -# CONFIG_ESP_NETIF_BRIDGE_EN is not set -# CONFIG_ESP_NETIF_SET_DNS_PER_DEFAULT_NETIF is not set -# end of ESP NETIF Adapter - -# -# Partition API Configuration -# -# end of Partition API Configuration - -# -# PHY -# -CONFIG_ESP_PHY_ENABLED=y -CONFIG_ESP_PHY_CALIBRATION_AND_DATA_STORAGE=y -# CONFIG_ESP_PHY_INIT_DATA_IN_PARTITION is not set -CONFIG_ESP_PHY_MAX_WIFI_TX_POWER=20 -CONFIG_ESP_PHY_MAX_TX_POWER=20 -CONFIG_ESP_PHY_REDUCE_TX_POWER=y -# CONFIG_ESP_PHY_ENABLE_CERT_TEST is not set -CONFIG_ESP_PHY_RF_CAL_PARTIAL=y -# CONFIG_ESP_PHY_RF_CAL_NONE is not set -# CONFIG_ESP_PHY_RF_CAL_FULL is not set -CONFIG_ESP_PHY_CALIBRATION_MODE=0 -CONFIG_ESP_PHY_PLL_TRACK_PERIOD_MS=1000 -# CONFIG_ESP_PHY_PLL_TRACK_DEBUG is not set -# CONFIG_ESP_PHY_RECORD_USED_TIME is not set -CONFIG_ESP_PHY_IRAM_OPT=y -# CONFIG_ESP_PHY_DEBUG is not set -# end of PHY - -# -# Power Management -# -CONFIG_PM_SLEEP_FUNC_IN_IRAM=y -# CONFIG_PM_ENABLE is not set -CONFIG_PM_SLP_IRAM_OPT=y -# end of Power Management - -# -# ESP PSRAM -# -CONFIG_SPIRAM=y - -# -# SPI RAM config -# -CONFIG_SPIRAM_MODE_QUAD=y -CONFIG_SPIRAM_TYPE_AUTO=y -# CONFIG_SPIRAM_TYPE_ESPPSRAM16 is not set -# CONFIG_SPIRAM_TYPE_ESPPSRAM32 is not set -# CONFIG_SPIRAM_TYPE_ESPPSRAM64 is not set -# CONFIG_SPIRAM_SPEED_40M is not set -CONFIG_SPIRAM_SPEED_80M=y -CONFIG_SPIRAM_SPEED=80 -CONFIG_SPIRAM_BOOT_HW_INIT=y -CONFIG_SPIRAM_BOOT_INIT=y -CONFIG_SPIRAM_PRE_CONFIGURE_MEMORY_PROTECTION=y -# CONFIG_SPIRAM_IGNORE_NOTFOUND is not set -# CONFIG_SPIRAM_USE_MEMMAP is not set -# CONFIG_SPIRAM_USE_CAPS_ALLOC is not set -CONFIG_SPIRAM_USE_MALLOC=y -CONFIG_SPIRAM_MEMTEST=y -CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=16384 -# CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP is not set -CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=32768 -# CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set -# CONFIG_SPIRAM_ALLOW_NOINIT_SEG_EXTERNAL_MEMORY is not set -CONFIG_SPIRAM_CACHE_WORKAROUND=y - -# -# SPIRAM cache workaround debugging -# -CONFIG_SPIRAM_CACHE_WORKAROUND_STRATEGY_MEMW=y -# CONFIG_SPIRAM_CACHE_WORKAROUND_STRATEGY_DUPLDST is not set -# CONFIG_SPIRAM_CACHE_WORKAROUND_STRATEGY_NOPS is not set -# end of SPIRAM cache workaround debugging - -# -# SPIRAM workaround libraries placement -# -CONFIG_SPIRAM_CACHE_LIBJMP_IN_IRAM=y -CONFIG_SPIRAM_CACHE_LIBMATH_IN_IRAM=y -CONFIG_SPIRAM_CACHE_LIBNUMPARSER_IN_IRAM=y -CONFIG_SPIRAM_CACHE_LIBIO_IN_IRAM=y -CONFIG_SPIRAM_CACHE_LIBTIME_IN_IRAM=y -CONFIG_SPIRAM_CACHE_LIBCHAR_IN_IRAM=y -CONFIG_SPIRAM_CACHE_LIBMEM_IN_IRAM=y -CONFIG_SPIRAM_CACHE_LIBSTR_IN_IRAM=y -CONFIG_SPIRAM_CACHE_LIBRAND_IN_IRAM=y -CONFIG_SPIRAM_CACHE_LIBENV_IN_IRAM=y -CONFIG_SPIRAM_CACHE_LIBFILE_IN_IRAM=y -CONFIG_SPIRAM_CACHE_LIBMISC_IN_IRAM=y -# end of SPIRAM workaround libraries placement - -CONFIG_SPIRAM_BANKSWITCH_ENABLE=y -CONFIG_SPIRAM_BANKSWITCH_RESERVE=8 -# CONFIG_SPIRAM_OCCUPY_HSPI_HOST is not set -CONFIG_SPIRAM_OCCUPY_VSPI_HOST=y -# CONFIG_SPIRAM_OCCUPY_NO_HOST is not set - -# -# PSRAM clock and cs IO for ESP32-DOWD -# -CONFIG_D0WD_PSRAM_CLK_IO=17 -CONFIG_D0WD_PSRAM_CS_IO=16 -# end of PSRAM clock and cs IO for ESP32-DOWD - -# -# PSRAM clock and cs IO for ESP32-D2WD -# -CONFIG_D2WD_PSRAM_CLK_IO=9 -CONFIG_D2WD_PSRAM_CS_IO=10 -# end of PSRAM clock and cs IO for ESP32-D2WD - -# -# PSRAM clock and cs IO for ESP32-PICO-D4 -# -CONFIG_PICO_PSRAM_CS_IO=10 -# end of PSRAM clock and cs IO for ESP32-PICO-D4 - -# CONFIG_SPIRAM_2T_MODE is not set -# end of SPI RAM config -# end of ESP PSRAM - -# -# ESP Ringbuf -# -# CONFIG_RINGBUF_PLACE_FUNCTIONS_INTO_FLASH is not set -# end of ESP Ringbuf - -# -# ESP-ROM -# -CONFIG_ESP_ROM_PRINT_IN_IRAM=y -# end of ESP-ROM - -# -# ESP Security Specific -# -# end of ESP Security Specific - -# -# ESP System Settings -# -# CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_80 is not set -# CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_160 is not set -CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y -CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ=240 - -# -# Memory -# -# CONFIG_ESP32_USE_FIXED_STATIC_RAM_SIZE is not set - -# -# Non-backward compatible options -# -# CONFIG_ESP_SYSTEM_ESP32_SRAM1_REGION_AS_IRAM is not set -# end of Non-backward compatible options -# end of Memory - -# -# Trace memory -# -# CONFIG_ESP32_TRAX is not set -CONFIG_ESP32_TRACEMEM_RESERVE_DRAM=0x0 -# end of Trace memory - -CONFIG_ESP_SYSTEM_IN_IRAM=y -# CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT is not set -CONFIG_ESP_SYSTEM_PANIC_PRINT_REBOOT=y -# CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT is not set -# CONFIG_ESP_SYSTEM_PANIC_GDBSTUB is not set -CONFIG_ESP_SYSTEM_PANIC_REBOOT_DELAY_SECONDS=0 - -# -# Memory protection -# -# end of Memory protection - -CONFIG_ESP_SYSTEM_EVENT_QUEUE_SIZE=32 -CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=2304 -CONFIG_ESP_MAIN_TASK_STACK_SIZE=3072 -CONFIG_ESP_MAIN_TASK_AFFINITY_CPU0=y -# CONFIG_ESP_MAIN_TASK_AFFINITY_CPU1 is not set -# CONFIG_ESP_MAIN_TASK_AFFINITY_NO_AFFINITY is not set -CONFIG_ESP_MAIN_TASK_AFFINITY=0x0 -CONFIG_ESP_MINIMAL_SHARED_STACK_SIZE=2048 -CONFIG_ESP_CONSOLE_UART_DEFAULT=y -# CONFIG_ESP_CONSOLE_UART_CUSTOM is not set -# CONFIG_ESP_CONSOLE_NONE is not set -CONFIG_ESP_CONSOLE_UART=y -CONFIG_ESP_CONSOLE_UART_NUM=0 -CONFIG_ESP_CONSOLE_ROM_SERIAL_PORT_NUM=0 -CONFIG_ESP_CONSOLE_UART_BAUDRATE=115200 -CONFIG_ESP_INT_WDT=y -CONFIG_ESP_INT_WDT_TIMEOUT_MS=300 -CONFIG_ESP_INT_WDT_CHECK_CPU1=y -CONFIG_ESP_TASK_WDT_EN=y -CONFIG_ESP_TASK_WDT_INIT=y -# CONFIG_ESP_TASK_WDT_PANIC is not set -CONFIG_ESP_TASK_WDT_TIMEOUT_S=5 -CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0=y -CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU1=y -# CONFIG_ESP_PANIC_HANDLER_IRAM is not set -# CONFIG_ESP_DEBUG_STUBS_ENABLE is not set -CONFIG_ESP_DEBUG_OCDAWARE=y -# CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_5 is not set -CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_4=y -# CONFIG_ESP32_DISABLE_BASIC_ROM_CONSOLE is not set -CONFIG_ESP32_ECO3_CACHE_LOCK_FIX=y -# end of ESP System Settings - -# -# IPC (Inter-Processor Call) -# -CONFIG_ESP_IPC_ENABLE=y -CONFIG_ESP_IPC_TASK_STACK_SIZE=1024 -CONFIG_ESP_IPC_USES_CALLERS_PRIORITY=y -CONFIG_ESP_IPC_ISR_ENABLE=y -# end of IPC (Inter-Processor Call) - -# -# ESP Timer (High Resolution Timer) -# -CONFIG_ESP_TIMER_IN_IRAM=y -# CONFIG_ESP_TIMER_PROFILING is not set -CONFIG_ESP_TIME_FUNCS_USE_RTC_TIMER=y -CONFIG_ESP_TIME_FUNCS_USE_ESP_TIMER=y -CONFIG_ESP_TIMER_TASK_STACK_SIZE=2048 -CONFIG_ESP_TIMER_INTERRUPT_LEVEL=1 -# CONFIG_ESP_TIMER_SHOW_EXPERIMENTAL is not set -CONFIG_ESP_TIMER_TASK_AFFINITY=0x0 -CONFIG_ESP_TIMER_TASK_AFFINITY_CPU0=y -CONFIG_ESP_TIMER_ISR_AFFINITY_CPU0=y -# CONFIG_ESP_TIMER_SUPPORTS_ISR_DISPATCH_METHOD is not set -CONFIG_ESP_TIMER_IMPL_TG0_LAC=y -# end of ESP Timer (High Resolution Timer) - -# -# Wi-Fi -# -CONFIG_ESP_WIFI_ENABLED=y -CONFIG_ESP_WIFI_STATIC_RX_BUFFER_NUM=8 -CONFIG_ESP_WIFI_DYNAMIC_RX_BUFFER_NUM=64 -CONFIG_ESP_WIFI_STATIC_TX_BUFFER=y -# CONFIG_ESP_WIFI_DYNAMIC_TX_BUFFER is not set -CONFIG_ESP_WIFI_TX_BUFFER_TYPE=0 -CONFIG_ESP_WIFI_STATIC_TX_BUFFER_NUM=8 -CONFIG_ESP_WIFI_STATIC_RX_MGMT_BUFFER=y -# CONFIG_ESP_WIFI_DYNAMIC_RX_MGMT_BUFFER is not set -CONFIG_ESP_WIFI_DYNAMIC_RX_MGMT_BUF=0 -CONFIG_ESP_WIFI_RX_MGMT_BUF_NUM_DEF=5 -# CONFIG_ESP_WIFI_CSI_ENABLED is not set -CONFIG_ESP_WIFI_AMPDU_TX_ENABLED=y -CONFIG_ESP_WIFI_TX_BA_WIN=8 -CONFIG_ESP_WIFI_AMPDU_RX_ENABLED=y -CONFIG_ESP_WIFI_RX_BA_WIN=16 -CONFIG_ESP_WIFI_NVS_ENABLED=y -CONFIG_ESP_WIFI_TASK_PINNED_TO_CORE_0=y -# CONFIG_ESP_WIFI_TASK_PINNED_TO_CORE_1 is not set -CONFIG_ESP_WIFI_SOFTAP_BEACON_MAX_LEN=752 -CONFIG_ESP_WIFI_MGMT_SBUF_NUM=32 -# CONFIG_ESP_WIFI_IRAM_OPT is not set -# CONFIG_ESP_WIFI_EXTRA_IRAM_OPT is not set -CONFIG_ESP_WIFI_RX_IRAM_OPT=y -CONFIG_ESP_WIFI_ENABLE_WPA3_SAE=y -CONFIG_ESP_WIFI_ENABLE_SAE_PK=y -CONFIG_ESP_WIFI_ENABLE_SAE_H2E=y -CONFIG_ESP_WIFI_SOFTAP_SAE_SUPPORT=y -CONFIG_ESP_WIFI_ENABLE_WPA3_OWE_STA=y -# CONFIG_ESP_WIFI_SLP_IRAM_OPT is not set -CONFIG_ESP_WIFI_SLP_DEFAULT_MIN_ACTIVE_TIME=50 -# CONFIG_ESP_WIFI_BSS_MAX_IDLE_SUPPORT is not set -CONFIG_ESP_WIFI_SLP_DEFAULT_MAX_ACTIVE_TIME=10 -CONFIG_ESP_WIFI_SLP_DEFAULT_WAIT_BROADCAST_DATA_TIME=15 -# CONFIG_ESP_WIFI_STA_DISCONNECTED_PM_ENABLE is not set -# CONFIG_ESP_WIFI_GMAC_SUPPORT is not set -CONFIG_ESP_WIFI_SOFTAP_SUPPORT=y -# CONFIG_ESP_WIFI_SLP_BEACON_LOST_OPT is not set -CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM=7 -# CONFIG_ESP_WIFI_NAN_ENABLE is not set -CONFIG_ESP_WIFI_MBEDTLS_CRYPTO=y -CONFIG_ESP_WIFI_MBEDTLS_TLS_CLIENT=y -# CONFIG_ESP_WIFI_WAPI_PSK is not set -# CONFIG_ESP_WIFI_11KV_SUPPORT is not set -# CONFIG_ESP_WIFI_MBO_SUPPORT is not set -# CONFIG_ESP_WIFI_DPP_SUPPORT is not set -# CONFIG_ESP_WIFI_11R_SUPPORT is not set -# CONFIG_ESP_WIFI_WPS_SOFTAP_REGISTRAR is not set - -# -# WPS Configuration Options -# -# CONFIG_ESP_WIFI_WPS_STRICT is not set -# CONFIG_ESP_WIFI_WPS_PASSPHRASE is not set -# end of WPS Configuration Options - -# CONFIG_ESP_WIFI_DEBUG_PRINT is not set -# CONFIG_ESP_WIFI_TESTING_OPTIONS is not set -CONFIG_ESP_WIFI_ENTERPRISE_SUPPORT=y -# CONFIG_ESP_WIFI_ENT_FREE_DYNAMIC_BUFFER is not set -# end of Wi-Fi - -# -# Core dump -# -# CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH is not set -# CONFIG_ESP_COREDUMP_ENABLE_TO_UART is not set -CONFIG_ESP_COREDUMP_ENABLE_TO_NONE=y -# end of Core dump - -# -# FAT Filesystem support -# -CONFIG_FATFS_VOLUME_COUNT=2 -CONFIG_FATFS_LFN_NONE=y -# CONFIG_FATFS_LFN_HEAP is not set -# CONFIG_FATFS_LFN_STACK is not set -# CONFIG_FATFS_SECTOR_512 is not set -CONFIG_FATFS_SECTOR_4096=y -# CONFIG_FATFS_CODEPAGE_DYNAMIC is not set -CONFIG_FATFS_CODEPAGE_437=y -# CONFIG_FATFS_CODEPAGE_720 is not set -# CONFIG_FATFS_CODEPAGE_737 is not set -# CONFIG_FATFS_CODEPAGE_771 is not set -# CONFIG_FATFS_CODEPAGE_775 is not set -# CONFIG_FATFS_CODEPAGE_850 is not set -# CONFIG_FATFS_CODEPAGE_852 is not set -# CONFIG_FATFS_CODEPAGE_855 is not set -# CONFIG_FATFS_CODEPAGE_857 is not set -# CONFIG_FATFS_CODEPAGE_860 is not set -# CONFIG_FATFS_CODEPAGE_861 is not set -# CONFIG_FATFS_CODEPAGE_862 is not set -# CONFIG_FATFS_CODEPAGE_863 is not set -# CONFIG_FATFS_CODEPAGE_864 is not set -# CONFIG_FATFS_CODEPAGE_865 is not set -# CONFIG_FATFS_CODEPAGE_866 is not set -# CONFIG_FATFS_CODEPAGE_869 is not set -# CONFIG_FATFS_CODEPAGE_932 is not set -# CONFIG_FATFS_CODEPAGE_936 is not set -# CONFIG_FATFS_CODEPAGE_949 is not set -# CONFIG_FATFS_CODEPAGE_950 is not set -CONFIG_FATFS_CODEPAGE=437 -CONFIG_FATFS_FS_LOCK=0 -CONFIG_FATFS_TIMEOUT_MS=10000 -CONFIG_FATFS_PER_FILE_CACHE=y -CONFIG_FATFS_ALLOC_PREFER_EXTRAM=y -# CONFIG_FATFS_USE_FASTSEEK is not set -CONFIG_FATFS_USE_STRFUNC_NONE=y -# CONFIG_FATFS_USE_STRFUNC_WITHOUT_CRLF_CONV is not set -# CONFIG_FATFS_USE_STRFUNC_WITH_CRLF_CONV is not set -CONFIG_FATFS_VFS_FSTAT_BLKSIZE=0 -# CONFIG_FATFS_IMMEDIATE_FSYNC is not set -# CONFIG_FATFS_USE_LABEL is not set -CONFIG_FATFS_LINK_LOCK=y -# CONFIG_FATFS_USE_DYN_BUFFERS is not set - -# -# File system free space calculation behavior -# -CONFIG_FATFS_DONT_TRUST_FREE_CLUSTER_CNT=0 -CONFIG_FATFS_DONT_TRUST_LAST_ALLOC=0 -# end of File system free space calculation behavior -# end of FAT Filesystem support - -# -# FreeRTOS -# - -# -# Kernel -# -# CONFIG_FREERTOS_SMP is not set -# CONFIG_FREERTOS_UNICORE is not set -CONFIG_FREERTOS_HZ=1000 -# CONFIG_FREERTOS_CHECK_STACKOVERFLOW_NONE is not set -# CONFIG_FREERTOS_CHECK_STACKOVERFLOW_PTRVAL is not set -CONFIG_FREERTOS_CHECK_STACKOVERFLOW_CANARY=y -CONFIG_FREERTOS_THREAD_LOCAL_STORAGE_POINTERS=1 -CONFIG_FREERTOS_IDLE_TASK_STACKSIZE=768 -# CONFIG_FREERTOS_USE_IDLE_HOOK is not set -# CONFIG_FREERTOS_USE_TICK_HOOK is not set -CONFIG_FREERTOS_MAX_TASK_NAME_LEN=10 -CONFIG_FREERTOS_ENABLE_BACKWARD_COMPATIBILITY=y -CONFIG_FREERTOS_USE_TIMERS=y -CONFIG_FREERTOS_TIMER_SERVICE_TASK_NAME="Tmr Svc" -# CONFIG_FREERTOS_TIMER_TASK_AFFINITY_CPU0 is not set -# CONFIG_FREERTOS_TIMER_TASK_AFFINITY_CPU1 is not set -CONFIG_FREERTOS_TIMER_TASK_NO_AFFINITY=y -CONFIG_FREERTOS_TIMER_SERVICE_TASK_CORE_AFFINITY=0x7FFFFFFF -CONFIG_FREERTOS_TIMER_TASK_PRIORITY=1 -CONFIG_FREERTOS_TIMER_TASK_STACK_DEPTH=1536 -CONFIG_FREERTOS_TIMER_QUEUE_LENGTH=5 -CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE=0 -CONFIG_FREERTOS_TASK_NOTIFICATION_ARRAY_ENTRIES=1 -# CONFIG_FREERTOS_USE_TRACE_FACILITY is not set -# CONFIG_FREERTOS_USE_LIST_DATA_INTEGRITY_CHECK_BYTES is not set -# CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS is not set -# CONFIG_FREERTOS_USE_APPLICATION_TASK_TAG is not set -# end of Kernel - -# -# Port -# -# CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK is not set -CONFIG_FREERTOS_TLSP_DELETION_CALLBACKS=y -# CONFIG_FREERTOS_TASK_PRE_DELETION_HOOK is not set -# CONFIG_FREERTOS_ENABLE_STATIC_TASK_CLEAN_UP is not set -CONFIG_FREERTOS_CHECK_MUTEX_GIVEN_BY_OWNER=y -CONFIG_FREERTOS_ISR_STACKSIZE=1536 -CONFIG_FREERTOS_INTERRUPT_BACKTRACE=y -# CONFIG_FREERTOS_FPU_IN_ISR is not set -CONFIG_FREERTOS_TICK_SUPPORT_CORETIMER=y -CONFIG_FREERTOS_CORETIMER_0=y -# CONFIG_FREERTOS_CORETIMER_1 is not set -CONFIG_FREERTOS_SYSTICK_USES_CCOUNT=y -CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH=y -# CONFIG_FREERTOS_CHECK_PORT_CRITICAL_COMPLIANCE is not set -# end of Port - -# -# Extra -# -# CONFIG_FREERTOS_TASK_CREATE_ALLOW_EXT_MEM is not set -# end of Extra - -CONFIG_FREERTOS_PORT=y -CONFIG_FREERTOS_NO_AFFINITY=0x7FFFFFFF -CONFIG_FREERTOS_SUPPORT_STATIC_ALLOCATION=y -CONFIG_FREERTOS_DEBUG_OCDAWARE=y -CONFIG_FREERTOS_ENABLE_TASK_SNAPSHOT=y -CONFIG_FREERTOS_PLACE_SNAPSHOT_FUNS_INTO_FLASH=y -CONFIG_FREERTOS_NUMBER_OF_CORES=2 -CONFIG_FREERTOS_IN_IRAM=y -# end of FreeRTOS - -# -# Hardware Abstraction Layer (HAL) and Low Level (LL) -# -CONFIG_HAL_ASSERTION_EQUALS_SYSTEM=y -# CONFIG_HAL_ASSERTION_DISABLE is not set -# CONFIG_HAL_ASSERTION_SILENT is not set -# CONFIG_HAL_ASSERTION_ENABLE is not set -CONFIG_HAL_DEFAULT_ASSERTION_LEVEL=2 -# end of Hardware Abstraction Layer (HAL) and Low Level (LL) - -# -# Heap memory debugging -# -CONFIG_HEAP_POISONING_DISABLED=y -# CONFIG_HEAP_POISONING_LIGHT is not set -# CONFIG_HEAP_POISONING_COMPREHENSIVE is not set -CONFIG_HEAP_TRACING_OFF=y -# CONFIG_HEAP_TRACING_STANDALONE is not set -# CONFIG_HEAP_TRACING_TOHOST is not set -# CONFIG_HEAP_USE_HOOKS is not set -# CONFIG_HEAP_TASK_TRACKING is not set -# CONFIG_HEAP_ABORT_WHEN_ALLOCATION_FAILS is not set -# CONFIG_HEAP_PLACE_FUNCTION_INTO_FLASH is not set -# end of Heap memory debugging - -# -# Log -# -CONFIG_LOG_VERSION_1=y -# CONFIG_LOG_VERSION_2 is not set -CONFIG_LOG_VERSION=1 - -# -# Log Level -# -# CONFIG_LOG_DEFAULT_LEVEL_NONE is not set -# CONFIG_LOG_DEFAULT_LEVEL_ERROR is not set -# CONFIG_LOG_DEFAULT_LEVEL_WARN is not set -# CONFIG_LOG_DEFAULT_LEVEL_INFO is not set -CONFIG_LOG_DEFAULT_LEVEL_DEBUG=y -# CONFIG_LOG_DEFAULT_LEVEL_VERBOSE is not set -CONFIG_LOG_DEFAULT_LEVEL=4 -CONFIG_LOG_MAXIMUM_EQUALS_DEFAULT=y -# CONFIG_LOG_MAXIMUM_LEVEL_VERBOSE is not set -CONFIG_LOG_MAXIMUM_LEVEL=4 - -# -# Level Settings -# -# CONFIG_LOG_MASTER_LEVEL is not set -CONFIG_LOG_DYNAMIC_LEVEL_CONTROL=y -# CONFIG_LOG_TAG_LEVEL_IMPL_NONE is not set -# CONFIG_LOG_TAG_LEVEL_IMPL_LINKED_LIST is not set -CONFIG_LOG_TAG_LEVEL_IMPL_CACHE_AND_LINKED_LIST=y -# CONFIG_LOG_TAG_LEVEL_CACHE_ARRAY is not set -CONFIG_LOG_TAG_LEVEL_CACHE_BINARY_MIN_HEAP=y -CONFIG_LOG_TAG_LEVEL_IMPL_CACHE_SIZE=31 -# end of Level Settings -# end of Log Level - -# -# Format -# -CONFIG_LOG_COLORS=y -CONFIG_LOG_TIMESTAMP_SOURCE_RTOS=y -# CONFIG_LOG_TIMESTAMP_SOURCE_SYSTEM is not set -# end of Format - -# -# Settings -# -CONFIG_LOG_MODE_TEXT_EN=y -CONFIG_LOG_MODE_TEXT=y -# end of Settings - -CONFIG_LOG_IN_IRAM=y -# end of Log - -# -# LWIP -# -CONFIG_LWIP_ENABLE=y -CONFIG_LWIP_LOCAL_HOSTNAME="espressif" -CONFIG_LWIP_TCPIP_TASK_PRIO=18 -# CONFIG_LWIP_TCPIP_CORE_LOCKING is not set -# CONFIG_LWIP_CHECK_THREAD_SAFETY is not set -CONFIG_LWIP_DNS_SUPPORT_MDNS_QUERIES=y -# CONFIG_LWIP_L2_TO_L3_COPY is not set -# CONFIG_LWIP_IRAM_OPTIMIZATION is not set -# CONFIG_LWIP_EXTRA_IRAM_OPTIMIZATION is not set -CONFIG_LWIP_TIMERS_ONDEMAND=y -CONFIG_LWIP_ND6=y -# CONFIG_LWIP_FORCE_ROUTER_FORWARDING is not set -CONFIG_LWIP_MAX_SOCKETS=6 -# CONFIG_LWIP_USE_ONLY_LWIP_SELECT is not set -# CONFIG_LWIP_SO_LINGER is not set -CONFIG_LWIP_SO_REUSE=y -# CONFIG_LWIP_SO_REUSE_RXTOALL is not set -# CONFIG_LWIP_SO_RCVBUF is not set -# CONFIG_LWIP_NETBUF_RECVINFO is not set -CONFIG_LWIP_IP_DEFAULT_TTL=64 -CONFIG_LWIP_IP4_FRAG=y -CONFIG_LWIP_IP6_FRAG=y -# CONFIG_LWIP_IP4_REASSEMBLY is not set -# CONFIG_LWIP_IP6_REASSEMBLY is not set -CONFIG_LWIP_IP_REASS_MAX_PBUFS=10 -# CONFIG_LWIP_IP_FORWARD is not set -# CONFIG_LWIP_STATS is not set -CONFIG_LWIP_ESP_GRATUITOUS_ARP=y -CONFIG_LWIP_GARP_TMR_INTERVAL=60 -CONFIG_LWIP_ESP_MLDV6_REPORT=y -CONFIG_LWIP_MLDV6_TMR_INTERVAL=40 -CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=32 -CONFIG_LWIP_DHCP_DOES_ARP_CHECK=y -# CONFIG_LWIP_DHCP_DOES_ACD_CHECK is not set -# CONFIG_LWIP_DHCP_DOES_NOT_CHECK_OFFERED_IP is not set -# CONFIG_LWIP_DHCP_DISABLE_CLIENT_ID is not set -CONFIG_LWIP_DHCP_DISABLE_VENDOR_CLASS_ID=y -# CONFIG_LWIP_DHCP_RESTORE_LAST_IP is not set -CONFIG_LWIP_DHCP_OPTIONS_LEN=69 -CONFIG_LWIP_NUM_NETIF_CLIENT_DATA=0 -CONFIG_LWIP_DHCP_COARSE_TIMER_SECS=1 - -# -# DHCP server -# -CONFIG_LWIP_DHCPS=y -CONFIG_LWIP_DHCPS_LEASE_UNIT=60 -CONFIG_LWIP_DHCPS_MAX_STATION_NUM=8 -CONFIG_LWIP_DHCPS_STATIC_ENTRIES=y -CONFIG_LWIP_DHCPS_ADD_DNS=y -# end of DHCP server - -# CONFIG_LWIP_AUTOIP is not set -CONFIG_LWIP_IPV4=y -CONFIG_LWIP_IPV6=y -# CONFIG_LWIP_IPV6_AUTOCONFIG is not set -CONFIG_LWIP_IPV6_NUM_ADDRESSES=3 -# CONFIG_LWIP_IPV6_FORWARD is not set -# CONFIG_LWIP_NETIF_STATUS_CALLBACK is not set -CONFIG_LWIP_NETIF_LOOPBACK=y -CONFIG_LWIP_LOOPBACK_MAX_PBUFS=8 - -# -# TCP -# -CONFIG_LWIP_MAX_ACTIVE_TCP=6 -CONFIG_LWIP_MAX_LISTENING_TCP=6 -CONFIG_LWIP_TCP_HIGH_SPEED_RETRANSMISSION=y -CONFIG_LWIP_TCP_MAXRTX=12 -CONFIG_LWIP_TCP_SYNMAXRTX=12 -CONFIG_LWIP_TCP_MSS=1460 -CONFIG_LWIP_TCP_TMR_INTERVAL=250 -CONFIG_LWIP_TCP_MSL=60000 -CONFIG_LWIP_TCP_FIN_WAIT_TIMEOUT=20000 -CONFIG_LWIP_TCP_SND_BUF_DEFAULT=11680 -CONFIG_LWIP_TCP_WND_DEFAULT=11680 -CONFIG_LWIP_TCP_RECVMBOX_SIZE=10 -CONFIG_LWIP_TCP_ACCEPTMBOX_SIZE=6 -CONFIG_LWIP_TCP_QUEUE_OOSEQ=y -CONFIG_LWIP_TCP_OOSEQ_TIMEOUT=6 -CONFIG_LWIP_TCP_OOSEQ_MAX_PBUFS=4 -CONFIG_LWIP_TCP_SACK_OUT=y -CONFIG_LWIP_TCP_OVERSIZE_MSS=y -# CONFIG_LWIP_TCP_OVERSIZE_QUARTER_MSS is not set -# CONFIG_LWIP_TCP_OVERSIZE_DISABLE is not set -CONFIG_LWIP_TCP_RTO_TIME=1500 -# end of TCP - -# -# UDP -# -CONFIG_LWIP_MAX_UDP_PCBS=1 -CONFIG_LWIP_UDP_RECVMBOX_SIZE=6 -# end of UDP - -# -# Checksums -# -# CONFIG_LWIP_CHECKSUM_CHECK_IP is not set -# CONFIG_LWIP_CHECKSUM_CHECK_UDP is not set -CONFIG_LWIP_CHECKSUM_CHECK_ICMP=y -# end of Checksums - -CONFIG_LWIP_TCPIP_TASK_STACK_SIZE=3072 -# CONFIG_LWIP_TCPIP_TASK_AFFINITY_NO_AFFINITY is not set -CONFIG_LWIP_TCPIP_TASK_AFFINITY_CPU0=y -# CONFIG_LWIP_TCPIP_TASK_AFFINITY_CPU1 is not set -CONFIG_LWIP_TCPIP_TASK_AFFINITY=0x0 -CONFIG_LWIP_IPV6_MEMP_NUM_ND6_QUEUE=3 -CONFIG_LWIP_IPV6_ND6_NUM_NEIGHBORS=5 -CONFIG_LWIP_IPV6_ND6_NUM_PREFIXES=5 -CONFIG_LWIP_IPV6_ND6_NUM_ROUTERS=3 -CONFIG_LWIP_IPV6_ND6_NUM_DESTINATIONS=10 -# CONFIG_LWIP_PPP_SUPPORT is not set -# CONFIG_LWIP_SLIP_SUPPORT is not set - -# -# ICMP -# -CONFIG_LWIP_ICMP=y -# CONFIG_LWIP_MULTICAST_PING is not set -# CONFIG_LWIP_BROADCAST_PING is not set -# end of ICMP - -# -# LWIP RAW API -# -CONFIG_LWIP_MAX_RAW_PCBS=16 -# end of LWIP RAW API - -# -# SNTP -# -CONFIG_LWIP_SNTP_MAX_SERVERS=1 -# CONFIG_LWIP_DHCP_GET_NTP_SRV is not set -CONFIG_LWIP_SNTP_UPDATE_DELAY=3600000 -CONFIG_LWIP_SNTP_STARTUP_DELAY=y -CONFIG_LWIP_SNTP_MAXIMUM_STARTUP_DELAY=5000 -# end of SNTP - -# -# DNS -# -CONFIG_LWIP_DNS_MAX_HOST_IP=1 -CONFIG_LWIP_DNS_MAX_SERVERS=3 -# CONFIG_LWIP_FALLBACK_DNS_SERVER_SUPPORT is not set -# CONFIG_LWIP_DNS_SETSERVER_WITH_NETIF is not set -# CONFIG_LWIP_USE_ESP_GETADDRINFO is not set -# end of DNS - -CONFIG_LWIP_BRIDGEIF_MAX_PORTS=7 -CONFIG_LWIP_ESP_LWIP_ASSERT=y - -# -# Hooks -# -# CONFIG_LWIP_HOOK_TCP_ISN_NONE is not set -CONFIG_LWIP_HOOK_TCP_ISN_DEFAULT=y -# CONFIG_LWIP_HOOK_TCP_ISN_CUSTOM is not set -CONFIG_LWIP_HOOK_IP6_ROUTE_NONE=y -# CONFIG_LWIP_HOOK_IP6_ROUTE_DEFAULT is not set -# CONFIG_LWIP_HOOK_IP6_ROUTE_CUSTOM is not set -CONFIG_LWIP_HOOK_ND6_GET_GW_NONE=y -# CONFIG_LWIP_HOOK_ND6_GET_GW_DEFAULT is not set -# CONFIG_LWIP_HOOK_ND6_GET_GW_CUSTOM is not set -CONFIG_LWIP_HOOK_IP6_SELECT_SRC_ADDR_NONE=y -# CONFIG_LWIP_HOOK_IP6_SELECT_SRC_ADDR_DEFAULT is not set -# CONFIG_LWIP_HOOK_IP6_SELECT_SRC_ADDR_CUSTOM is not set -CONFIG_LWIP_HOOK_DHCP_EXTRA_OPTION_NONE=y -# CONFIG_LWIP_HOOK_DHCP_EXTRA_OPTION_DEFAULT is not set -# CONFIG_LWIP_HOOK_DHCP_EXTRA_OPTION_CUSTOM is not set -CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_NONE=y -# CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_DEFAULT is not set -# CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_CUSTOM is not set -CONFIG_LWIP_HOOK_DNS_EXT_RESOLVE_NONE=y -# CONFIG_LWIP_HOOK_DNS_EXT_RESOLVE_CUSTOM is not set -CONFIG_LWIP_HOOK_IP6_INPUT_NONE=y -# CONFIG_LWIP_HOOK_IP6_INPUT_DEFAULT is not set -# CONFIG_LWIP_HOOK_IP6_INPUT_CUSTOM is not set -# end of Hooks - -# CONFIG_LWIP_DEBUG is not set -# end of LWIP - -# -# mbedTLS -# -CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC=y -# CONFIG_MBEDTLS_EXTERNAL_MEM_ALLOC is not set -# CONFIG_MBEDTLS_DEFAULT_MEM_ALLOC is not set -# CONFIG_MBEDTLS_CUSTOM_MEM_ALLOC is not set -CONFIG_MBEDTLS_ASYMMETRIC_CONTENT_LEN=y -CONFIG_MBEDTLS_SSL_IN_CONTENT_LEN=16384 -CONFIG_MBEDTLS_SSL_OUT_CONTENT_LEN=4096 -# CONFIG_MBEDTLS_DYNAMIC_BUFFER is not set -# CONFIG_MBEDTLS_DEBUG is not set - -# -# mbedTLS v3.x related -# -# CONFIG_MBEDTLS_SSL_PROTO_TLS1_3 is not set -# CONFIG_MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH is not set -# CONFIG_MBEDTLS_X509_TRUSTED_CERT_CALLBACK is not set -# CONFIG_MBEDTLS_SSL_CONTEXT_SERIALIZATION is not set -CONFIG_MBEDTLS_SSL_KEEP_PEER_CERTIFICATE=y -# CONFIG_MBEDTLS_SSL_KEYING_MATERIAL_EXPORT is not set -CONFIG_MBEDTLS_PKCS7_C=y -# end of mbedTLS v3.x related - -# -# Certificate Bundle -# -# CONFIG_MBEDTLS_CERTIFICATE_BUNDLE is not set -# end of Certificate Bundle - -# CONFIG_MBEDTLS_ECP_RESTARTABLE is not set -CONFIG_MBEDTLS_CMAC_C=y -CONFIG_MBEDTLS_HARDWARE_AES=y -# CONFIG_MBEDTLS_GCM_SUPPORT_NON_AES_CIPHER is not set -CONFIG_MBEDTLS_HARDWARE_MPI=y -# CONFIG_MBEDTLS_LARGE_KEY_SOFTWARE_MPI is not set -CONFIG_MBEDTLS_HARDWARE_SHA=y -CONFIG_MBEDTLS_ROM_MD5=y -# CONFIG_MBEDTLS_ATCA_HW_ECDSA_SIGN is not set -# CONFIG_MBEDTLS_ATCA_HW_ECDSA_VERIFY is not set -CONFIG_MBEDTLS_HAVE_TIME=y -# CONFIG_MBEDTLS_PLATFORM_TIME_ALT is not set -# CONFIG_MBEDTLS_HAVE_TIME_DATE is not set -CONFIG_MBEDTLS_ECDSA_DETERMINISTIC=y -CONFIG_MBEDTLS_SHA1_C=y -CONFIG_MBEDTLS_SHA512_C=y -# CONFIG_MBEDTLS_SHA3_C is not set -CONFIG_MBEDTLS_TLS_SERVER_AND_CLIENT=y -# CONFIG_MBEDTLS_TLS_SERVER_ONLY is not set -# CONFIG_MBEDTLS_TLS_CLIENT_ONLY is not set -# CONFIG_MBEDTLS_TLS_DISABLED is not set -CONFIG_MBEDTLS_TLS_SERVER=y -CONFIG_MBEDTLS_TLS_CLIENT=y -CONFIG_MBEDTLS_TLS_ENABLED=y - -# -# TLS Key Exchange Methods -# -# CONFIG_MBEDTLS_PSK_MODES is not set -CONFIG_MBEDTLS_KEY_EXCHANGE_RSA=y -CONFIG_MBEDTLS_KEY_EXCHANGE_ELLIPTIC_CURVE=y -CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_RSA=y -CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA=y -CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA=y -CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_RSA=y -# end of TLS Key Exchange Methods - -CONFIG_MBEDTLS_SSL_RENEGOTIATION=y -CONFIG_MBEDTLS_SSL_PROTO_TLS1_2=y -# CONFIG_MBEDTLS_SSL_PROTO_GMTSSL1_1 is not set -# CONFIG_MBEDTLS_SSL_PROTO_DTLS is not set -CONFIG_MBEDTLS_SSL_ALPN=y -CONFIG_MBEDTLS_CLIENT_SSL_SESSION_TICKETS=y -CONFIG_MBEDTLS_SERVER_SSL_SESSION_TICKETS=y - -# -# Symmetric Ciphers -# -CONFIG_MBEDTLS_AES_C=y -# CONFIG_MBEDTLS_CAMELLIA_C is not set -# CONFIG_MBEDTLS_DES_C is not set -# CONFIG_MBEDTLS_BLOWFISH_C is not set -# CONFIG_MBEDTLS_XTEA_C is not set -CONFIG_MBEDTLS_CCM_C=y -CONFIG_MBEDTLS_GCM_C=y -# CONFIG_MBEDTLS_NIST_KW_C is not set -# end of Symmetric Ciphers - -# CONFIG_MBEDTLS_RIPEMD160_C is not set - -# -# Certificates -# -CONFIG_MBEDTLS_PEM_PARSE_C=y -CONFIG_MBEDTLS_PEM_WRITE_C=y -CONFIG_MBEDTLS_X509_CRL_PARSE_C=y -CONFIG_MBEDTLS_X509_CSR_PARSE_C=y -# end of Certificates - -CONFIG_MBEDTLS_ECP_C=y -CONFIG_MBEDTLS_PK_PARSE_EC_EXTENDED=y -CONFIG_MBEDTLS_PK_PARSE_EC_COMPRESSED=y -# CONFIG_MBEDTLS_DHM_C is not set -CONFIG_MBEDTLS_ECDH_C=y -CONFIG_MBEDTLS_ECDSA_C=y -# CONFIG_MBEDTLS_ECJPAKE_C is not set -CONFIG_MBEDTLS_ECP_DP_SECP192R1_ENABLED=y -CONFIG_MBEDTLS_ECP_DP_SECP224R1_ENABLED=y -CONFIG_MBEDTLS_ECP_DP_SECP256R1_ENABLED=y -CONFIG_MBEDTLS_ECP_DP_SECP384R1_ENABLED=y -CONFIG_MBEDTLS_ECP_DP_SECP521R1_ENABLED=y -CONFIG_MBEDTLS_ECP_DP_SECP192K1_ENABLED=y -CONFIG_MBEDTLS_ECP_DP_SECP224K1_ENABLED=y -CONFIG_MBEDTLS_ECP_DP_SECP256K1_ENABLED=y -CONFIG_MBEDTLS_ECP_DP_BP256R1_ENABLED=y -CONFIG_MBEDTLS_ECP_DP_BP384R1_ENABLED=y -CONFIG_MBEDTLS_ECP_DP_BP512R1_ENABLED=y -CONFIG_MBEDTLS_ECP_DP_CURVE25519_ENABLED=y -CONFIG_MBEDTLS_ECP_NIST_OPTIM=y -CONFIG_MBEDTLS_ECP_FIXED_POINT_OPTIM=y -# CONFIG_MBEDTLS_POLY1305_C is not set -# CONFIG_MBEDTLS_CHACHA20_C is not set -# CONFIG_MBEDTLS_HKDF_C is not set -# CONFIG_MBEDTLS_THREADING_C is not set -CONFIG_MBEDTLS_ERROR_STRINGS=y -CONFIG_MBEDTLS_FS_IO=y -# CONFIG_MBEDTLS_ALLOW_WEAK_CERTIFICATE_VERIFICATION is not set -# end of mbedTLS - -# -# ESP-MQTT Configurations -# -CONFIG_MQTT_PROTOCOL_311=y -# CONFIG_MQTT_PROTOCOL_5 is not set -CONFIG_MQTT_TRANSPORT_SSL=y -CONFIG_MQTT_TRANSPORT_WEBSOCKET=y -CONFIG_MQTT_TRANSPORT_WEBSOCKET_SECURE=y -# CONFIG_MQTT_MSG_ID_INCREMENTAL is not set -# CONFIG_MQTT_SKIP_PUBLISH_IF_DISCONNECTED is not set -# CONFIG_MQTT_REPORT_DELETED_MESSAGES is not set -# CONFIG_MQTT_USE_CUSTOM_CONFIG is not set -# CONFIG_MQTT_TASK_CORE_SELECTION_ENABLED is not set -# CONFIG_MQTT_CUSTOM_OUTBOX is not set -# end of ESP-MQTT Configurations - -# -# LibC -# -CONFIG_LIBC_NEWLIB=y -CONFIG_LIBC_MISC_IN_IRAM=y -CONFIG_LIBC_LOCKS_PLACE_IN_IRAM=y -CONFIG_LIBC_STDOUT_LINE_ENDING_CRLF=y -# CONFIG_LIBC_STDOUT_LINE_ENDING_LF is not set -# CONFIG_LIBC_STDOUT_LINE_ENDING_CR is not set -# CONFIG_LIBC_STDIN_LINE_ENDING_CRLF is not set -# CONFIG_LIBC_STDIN_LINE_ENDING_LF is not set -CONFIG_LIBC_STDIN_LINE_ENDING_CR=y -# CONFIG_LIBC_NEWLIB_NANO_FORMAT is not set -CONFIG_LIBC_TIME_SYSCALL_USE_RTC_HRT=y -# CONFIG_LIBC_TIME_SYSCALL_USE_RTC is not set -# CONFIG_LIBC_TIME_SYSCALL_USE_HRT is not set -# CONFIG_LIBC_TIME_SYSCALL_USE_NONE is not set -# end of LibC - -CONFIG_STDATOMIC_S32C1I_SPIRAM_WORKAROUND=y - -# -# NVS -# -# CONFIG_NVS_ASSERT_ERROR_CHECK is not set -# CONFIG_NVS_LEGACY_DUP_KEYS_COMPATIBILITY is not set -# CONFIG_NVS_ALLOCATE_CACHE_IN_SPIRAM is not set -# end of NVS - -# -# OpenThread -# -# CONFIG_OPENTHREAD_ENABLED is not set - -# -# OpenThread Spinel -# -# CONFIG_OPENTHREAD_SPINEL_ONLY is not set -# end of OpenThread Spinel -# end of OpenThread - -# -# Protocomm -# -CONFIG_ESP_PROTOCOMM_SUPPORT_SECURITY_VERSION_0=y -CONFIG_ESP_PROTOCOMM_SUPPORT_SECURITY_VERSION_1=y -CONFIG_ESP_PROTOCOMM_SUPPORT_SECURITY_VERSION_2=y -CONFIG_ESP_PROTOCOMM_SUPPORT_SECURITY_PATCH_VERSION=y -# end of Protocomm - -# -# PThreads -# -CONFIG_PTHREAD_TASK_PRIO_DEFAULT=5 -CONFIG_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072 -CONFIG_PTHREAD_STACK_MIN=768 -CONFIG_PTHREAD_DEFAULT_CORE_NO_AFFINITY=y -# CONFIG_PTHREAD_DEFAULT_CORE_0 is not set -# CONFIG_PTHREAD_DEFAULT_CORE_1 is not set -CONFIG_PTHREAD_TASK_CORE_DEFAULT=-1 -CONFIG_PTHREAD_TASK_NAME_DEFAULT="pthread" -# end of PThreads - -# -# MMU Config -# -CONFIG_MMU_PAGE_SIZE_64KB=y -CONFIG_MMU_PAGE_MODE="64KB" -CONFIG_MMU_PAGE_SIZE=0x10000 -# end of MMU Config - -# -# Main Flash configuration -# - -# -# SPI Flash behavior when brownout -# -CONFIG_SPI_FLASH_BROWNOUT_RESET_XMC=y -CONFIG_SPI_FLASH_BROWNOUT_RESET=y -# end of SPI Flash behavior when brownout - -# -# Optional and Experimental Features (READ DOCS FIRST) -# - -# -# Features here require specific hardware (READ DOCS FIRST!) -# -CONFIG_SPI_FLASH_SUSPEND_TSUS_VAL_US=50 -# CONFIG_SPI_FLASH_FORCE_ENABLE_XMC_C_SUSPEND is not set -# CONFIG_SPI_FLASH_FORCE_ENABLE_C6_H2_SUSPEND is not set -CONFIG_SPI_FLASH_PLACE_FUNCTIONS_IN_IRAM=y -# end of Optional and Experimental Features (READ DOCS FIRST) -# end of Main Flash configuration - -# -# SPI Flash driver -# -# CONFIG_SPI_FLASH_VERIFY_WRITE is not set -# CONFIG_SPI_FLASH_ENABLE_COUNTERS is not set -CONFIG_SPI_FLASH_ROM_DRIVER_PATCH=y -CONFIG_SPI_FLASH_DANGEROUS_WRITE_ABORTS=y -# CONFIG_SPI_FLASH_DANGEROUS_WRITE_FAILS is not set -# CONFIG_SPI_FLASH_DANGEROUS_WRITE_ALLOWED is not set -# CONFIG_SPI_FLASH_SHARE_SPI1_BUS is not set -# CONFIG_SPI_FLASH_BYPASS_BLOCK_ERASE is not set -CONFIG_SPI_FLASH_YIELD_DURING_ERASE=y -CONFIG_SPI_FLASH_ERASE_YIELD_DURATION_MS=20 -CONFIG_SPI_FLASH_ERASE_YIELD_TICKS=1 -CONFIG_SPI_FLASH_WRITE_CHUNK_SIZE=8192 -# CONFIG_SPI_FLASH_SIZE_OVERRIDE is not set -# CONFIG_SPI_FLASH_CHECK_ERASE_TIMEOUT_DISABLED is not set -# CONFIG_SPI_FLASH_OVERRIDE_CHIP_DRIVER_LIST is not set - -# -# Auto-detect flash chips -# -CONFIG_SPI_FLASH_VENDOR_XMC_SUPPORT_ENABLED=y -CONFIG_SPI_FLASH_VENDOR_GD_SUPPORT_ENABLED=y -CONFIG_SPI_FLASH_VENDOR_ISSI_SUPPORT_ENABLED=y -CONFIG_SPI_FLASH_VENDOR_MXIC_SUPPORT_ENABLED=y -CONFIG_SPI_FLASH_VENDOR_WINBOND_SUPPORT_ENABLED=y -CONFIG_SPI_FLASH_SUPPORT_ISSI_CHIP=y -CONFIG_SPI_FLASH_SUPPORT_MXIC_CHIP=y -CONFIG_SPI_FLASH_SUPPORT_GD_CHIP=y -CONFIG_SPI_FLASH_SUPPORT_WINBOND_CHIP=y -# CONFIG_SPI_FLASH_SUPPORT_BOYA_CHIP is not set -# CONFIG_SPI_FLASH_SUPPORT_TH_CHIP is not set -# end of Auto-detect flash chips - -CONFIG_SPI_FLASH_ENABLE_ENCRYPTED_READ_WRITE=y -# end of SPI Flash driver - -# -# SPIFFS Configuration -# -CONFIG_SPIFFS_MAX_PARTITIONS=3 - -# -# SPIFFS Cache Configuration -# -CONFIG_SPIFFS_CACHE=y -CONFIG_SPIFFS_CACHE_WR=y -# CONFIG_SPIFFS_CACHE_STATS is not set -# end of SPIFFS Cache Configuration - -CONFIG_SPIFFS_PAGE_CHECK=y -CONFIG_SPIFFS_GC_MAX_RUNS=10 -# CONFIG_SPIFFS_GC_STATS is not set -CONFIG_SPIFFS_PAGE_SIZE=256 -CONFIG_SPIFFS_OBJ_NAME_LEN=32 -# CONFIG_SPIFFS_FOLLOW_SYMLINKS is not set -CONFIG_SPIFFS_USE_MAGIC=y -CONFIG_SPIFFS_USE_MAGIC_LENGTH=y -CONFIG_SPIFFS_META_LENGTH=4 -CONFIG_SPIFFS_USE_MTIME=y - -# -# Debug Configuration -# -# CONFIG_SPIFFS_DBG is not set -# CONFIG_SPIFFS_API_DBG is not set -# CONFIG_SPIFFS_GC_DBG is not set -# CONFIG_SPIFFS_CACHE_DBG is not set -# CONFIG_SPIFFS_CHECK_DBG is not set -# CONFIG_SPIFFS_TEST_VISUALISATION is not set -# end of Debug Configuration -# end of SPIFFS Configuration - -# -# TCP Transport -# - -# -# Websocket -# -CONFIG_WS_TRANSPORT=y -CONFIG_WS_BUFFER_SIZE=1024 -# CONFIG_WS_DYNAMIC_BUFFER is not set -# end of Websocket -# end of TCP Transport - -# -# Ultra Low Power (ULP) Co-processor -# -# CONFIG_ULP_COPROC_ENABLED is not set - -# -# ULP Debugging Options -# -# end of ULP Debugging Options -# end of Ultra Low Power (ULP) Co-processor - -# -# Unity unit testing library -# -CONFIG_UNITY_ENABLE_FLOAT=y -CONFIG_UNITY_ENABLE_DOUBLE=y -# CONFIG_UNITY_ENABLE_64BIT is not set -# CONFIG_UNITY_ENABLE_COLOR is not set -CONFIG_UNITY_ENABLE_IDF_TEST_RUNNER=y -# CONFIG_UNITY_ENABLE_FIXTURE is not set -# CONFIG_UNITY_ENABLE_BACKTRACE_ON_FAIL is not set -# CONFIG_UNITY_TEST_ORDER_BY_FILE_PATH_AND_LINE is not set -# end of Unity unit testing library - -# -# Virtual file system -# -CONFIG_VFS_SUPPORT_IO=y -CONFIG_VFS_SUPPORT_DIR=y -CONFIG_VFS_SUPPORT_SELECT=y -CONFIG_VFS_SUPPRESS_SELECT_DEBUG_OUTPUT=y -# CONFIG_VFS_SELECT_IN_RAM is not set -CONFIG_VFS_SUPPORT_TERMIOS=y -CONFIG_VFS_MAX_COUNT=8 - -# -# Host File System I/O (Semihosting) -# -CONFIG_VFS_SEMIHOSTFS_MAX_MOUNT_POINTS=1 -# end of Host File System I/O (Semihosting) - -CONFIG_VFS_INITIALIZE_DEV_NULL=y -# end of Virtual file system - -# -# Wear Levelling -# -# CONFIG_WL_SECTOR_SIZE_512 is not set -CONFIG_WL_SECTOR_SIZE_4096=y -CONFIG_WL_SECTOR_SIZE=4096 -# end of Wear Levelling - -# -# Wi-Fi Provisioning Manager -# -CONFIG_WIFI_PROV_SCAN_MAX_ENTRIES=16 -CONFIG_WIFI_PROV_AUTOSTOP_TIMEOUT=30 -CONFIG_WIFI_PROV_STA_ALL_CHANNEL_SCAN=y -# CONFIG_WIFI_PROV_STA_FAST_SCAN is not set -# end of Wi-Fi Provisioning Manager - -# -# WebSocket Server -# -CONFIG_WEBSOCKET_SERVER_MAX_CLIENTS=1 -CONFIG_WEBSOCKET_SERVER_QUEUE_SIZE=2 -CONFIG_WEBSOCKET_SERVER_QUEUE_TIMEOUT=30 -CONFIG_WEBSOCKET_SERVER_TASK_STACK_DEPTH=3000 -CONFIG_WEBSOCKET_SERVER_TASK_PRIORITY=5 -# CONFIG_WEBSOCKET_SERVER_PINNED is not set -# end of WebSocket Server - -# -# DSP Library -# -CONFIG_DSP_OPTIMIZATIONS_SUPPORTED=y -# CONFIG_DSP_ANSI is not set -CONFIG_DSP_OPTIMIZED=y -CONFIG_DSP_OPTIMIZATION=1 -# CONFIG_DSP_MAX_FFT_SIZE_512 is not set -# CONFIG_DSP_MAX_FFT_SIZE_1024 is not set -# CONFIG_DSP_MAX_FFT_SIZE_2048 is not set -CONFIG_DSP_MAX_FFT_SIZE_4096=y -# CONFIG_DSP_MAX_FFT_SIZE_8192 is not set -# CONFIG_DSP_MAX_FFT_SIZE_16384 is not set -# CONFIG_DSP_MAX_FFT_SIZE_32768 is not set -CONFIG_DSP_MAX_FFT_SIZE=4096 -# end of DSP Library - -# -# mDNS -# -CONFIG_MDNS_MAX_INTERFACES=3 -CONFIG_MDNS_MAX_SERVICES=10 -CONFIG_MDNS_TASK_PRIORITY=1 -CONFIG_MDNS_ACTION_QUEUE_LEN=16 -CONFIG_MDNS_TASK_STACK_SIZE=2816 -CONFIG_MDNS_TASK_AFFINITY_NO_AFFINITY=y -# CONFIG_MDNS_TASK_AFFINITY_CPU0 is not set -# CONFIG_MDNS_TASK_AFFINITY_CPU1 is not set -CONFIG_MDNS_TASK_AFFINITY=0x7FFFFFFF - -# -# MDNS Memory Configuration -# -# CONFIG_MDNS_TASK_CREATE_FROM_SPIRAM is not set -CONFIG_MDNS_TASK_CREATE_FROM_INTERNAL=y -# CONFIG_MDNS_MEMORY_ALLOC_SPIRAM is not set -CONFIG_MDNS_MEMORY_ALLOC_INTERNAL=y -# CONFIG_MDNS_MEMORY_CUSTOM_IMPL is not set -# end of MDNS Memory Configuration - -CONFIG_MDNS_SERVICE_ADD_TIMEOUT_MS=2000 -CONFIG_MDNS_TIMER_PERIOD_MS=100 -# CONFIG_MDNS_NETWORKING_SOCKET is not set -# CONFIG_MDNS_SKIP_SUPPRESSING_OWN_QUERIES is not set -# CONFIG_MDNS_ENABLE_DEBUG_PRINTS is not set -CONFIG_MDNS_ENABLE_CONSOLE_CLI=y -# CONFIG_MDNS_RESPOND_REVERSE_QUERIES is not set -CONFIG_MDNS_MULTIPLE_INSTANCE=y - -# -# MDNS Predefined interfaces -# -CONFIG_MDNS_PREDEF_NETIF_STA=y -CONFIG_MDNS_PREDEF_NETIF_AP=y -CONFIG_MDNS_PREDEF_NETIF_ETH=y -# end of MDNS Predefined interfaces -# end of mDNS -# end of Component config - -# CONFIG_IDF_EXPERIMENTAL_FEATURES is not set - -# Deprecated options for backward compatibility -# CONFIG_APP_BUILD_TYPE_ELF_RAM is not set -# CONFIG_NO_BLOBS is not set -# CONFIG_ESP32_NO_BLOBS is not set -# CONFIG_ESP32_COMPATIBLE_PRE_V2_1_BOOTLOADERS is not set -# CONFIG_ESP32_COMPATIBLE_PRE_V3_1_BOOTLOADERS is not set -CONFIG_APP_ROLLBACK_ENABLE=y -# CONFIG_APP_ANTI_ROLLBACK is not set -# CONFIG_LOG_BOOTLOADER_LEVEL_NONE is not set -CONFIG_LOG_BOOTLOADER_LEVEL_ERROR=y -# CONFIG_LOG_BOOTLOADER_LEVEL_WARN is not set -# CONFIG_LOG_BOOTLOADER_LEVEL_INFO is not set -# CONFIG_LOG_BOOTLOADER_LEVEL_DEBUG is not set -# CONFIG_LOG_BOOTLOADER_LEVEL_VERBOSE is not set -CONFIG_LOG_BOOTLOADER_LEVEL=1 -# CONFIG_FLASH_ENCRYPTION_ENABLED is not set -CONFIG_FLASHMODE_QIO=y -# CONFIG_FLASHMODE_QOUT is not set -# CONFIG_FLASHMODE_DIO is not set -# CONFIG_FLASHMODE_DOUT is not set -CONFIG_MONITOR_BAUD=115200 -# CONFIG_OPTIMIZATION_LEVEL_DEBUG is not set -# CONFIG_COMPILER_OPTIMIZATION_LEVEL_DEBUG is not set -# CONFIG_COMPILER_OPTIMIZATION_DEFAULT is not set -# CONFIG_OPTIMIZATION_LEVEL_RELEASE is not set -# CONFIG_COMPILER_OPTIMIZATION_LEVEL_RELEASE is not set -CONFIG_OPTIMIZATION_ASSERTIONS_ENABLED=y -# CONFIG_OPTIMIZATION_ASSERTIONS_SILENT is not set -# CONFIG_OPTIMIZATION_ASSERTIONS_DISABLED is not set -CONFIG_OPTIMIZATION_ASSERTION_LEVEL=2 -# CONFIG_CXX_EXCEPTIONS is not set -CONFIG_STACK_CHECK_NONE=y -# CONFIG_STACK_CHECK_NORM is not set -# CONFIG_STACK_CHECK_STRONG is not set -# CONFIG_STACK_CHECK_ALL is not set -# CONFIG_WARN_WRITE_STRINGS is not set -# CONFIG_ESP32_APPTRACE_DEST_TRAX is not set -CONFIG_ESP32_APPTRACE_DEST_NONE=y -CONFIG_ESP32_APPTRACE_LOCK_ENABLE=y -CONFIG_ADC2_DISABLE_DAC=y -# CONFIG_GPTIMER_ISR_IRAM_SAFE is not set -# CONFIG_MCPWM_ISR_IRAM_SAFE is not set -# CONFIG_EVENT_LOOP_PROFILING is not set -CONFIG_POST_EVENTS_FROM_ISR=y -# CONFIG_POST_EVENTS_FROM_IRAM_ISR is not set -CONFIG_GDBSTUB_SUPPORT_TASKS=y -CONFIG_GDBSTUB_MAX_TASKS=32 -# CONFIG_OTA_ALLOW_HTTP is not set -# CONFIG_TWO_UNIVERSAL_MAC_ADDRESS is not set -CONFIG_FOUR_UNIVERSAL_MAC_ADDRESS=y -CONFIG_NUMBER_OF_UNIVERSAL_MAC_ADDRESS=4 -CONFIG_ESP32_DEEP_SLEEP_WAKEUP_DELAY=2000 -CONFIG_ESP_SLEEP_DEEP_SLEEP_WAKEUP_DELAY=2000 -CONFIG_ESP32_RTC_CLK_SRC_INT_RC=y -CONFIG_ESP32_RTC_CLOCK_SOURCE_INTERNAL_RC=y -# CONFIG_ESP32_RTC_CLK_SRC_EXT_CRYS is not set -# CONFIG_ESP32_RTC_CLOCK_SOURCE_EXTERNAL_CRYSTAL is not set -# CONFIG_ESP32_RTC_CLK_SRC_EXT_OSC is not set -# CONFIG_ESP32_RTC_CLOCK_SOURCE_EXTERNAL_OSC is not set -# CONFIG_ESP32_RTC_CLK_SRC_INT_8MD256 is not set -# CONFIG_ESP32_RTC_CLOCK_SOURCE_INTERNAL_8MD256 is not set -CONFIG_ESP32_RTC_CLK_CAL_CYCLES=1024 -CONFIG_PERIPH_CTRL_FUNC_IN_IRAM=y -# CONFIG_ESP32_XTAL_FREQ_26 is not set -CONFIG_ESP32_XTAL_FREQ_40=y -# CONFIG_ESP32_XTAL_FREQ_AUTO is not set -CONFIG_ESP32_XTAL_FREQ=40 -CONFIG_BROWNOUT_DET=y -CONFIG_ESP32_BROWNOUT_DET=y -# CONFIG_BROWNOUT_DET_LVL_SEL_0 is not set -# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_0 is not set -# CONFIG_BROWNOUT_DET_LVL_SEL_1 is not set -# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_1 is not set -# CONFIG_BROWNOUT_DET_LVL_SEL_2 is not set -# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_2 is not set -# CONFIG_BROWNOUT_DET_LVL_SEL_3 is not set -# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_3 is not set -CONFIG_BROWNOUT_DET_LVL_SEL_4=y -CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_4=y -# CONFIG_BROWNOUT_DET_LVL_SEL_5 is not set -# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_5 is not set -# CONFIG_BROWNOUT_DET_LVL_SEL_6 is not set -# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_6 is not set -# CONFIG_BROWNOUT_DET_LVL_SEL_7 is not set -# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_7 is not set -CONFIG_BROWNOUT_DET_LVL=4 -CONFIG_ESP32_BROWNOUT_DET_LVL=4 -CONFIG_ESP_SYSTEM_BROWNOUT_INTR=y -CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE=y -# CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION is not set -CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER=20 -CONFIG_ESP32_PHY_MAX_TX_POWER=20 -CONFIG_REDUCE_PHY_TX_POWER=y -CONFIG_ESP32_REDUCE_PHY_TX_POWER=y -CONFIG_SPIRAM_SUPPORT=y -CONFIG_ESP32_SPIRAM_SUPPORT=y -# CONFIG_WIFI_LWIP_ALLOCATION_FROM_SPIRAM_FIRST is not set -# CONFIG_ESP32_DEFAULT_CPU_FREQ_80 is not set -# CONFIG_ESP32_DEFAULT_CPU_FREQ_160 is not set -CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y -CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=240 -CONFIG_TRACEMEM_RESERVE_DRAM=0x0 -# CONFIG_ESP32_PANIC_PRINT_HALT is not set -CONFIG_ESP32_PANIC_PRINT_REBOOT=y -# CONFIG_ESP32_PANIC_SILENT_REBOOT is not set -# CONFIG_ESP32_PANIC_GDBSTUB is not set -CONFIG_SYSTEM_EVENT_QUEUE_SIZE=32 -CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=2304 -CONFIG_MAIN_TASK_STACK_SIZE=3072 -CONFIG_CONSOLE_UART_DEFAULT=y -# CONFIG_CONSOLE_UART_CUSTOM is not set -# CONFIG_CONSOLE_UART_NONE is not set -# CONFIG_ESP_CONSOLE_UART_NONE is not set -CONFIG_CONSOLE_UART=y -CONFIG_CONSOLE_UART_NUM=0 -CONFIG_CONSOLE_UART_BAUDRATE=115200 -CONFIG_INT_WDT=y -CONFIG_INT_WDT_TIMEOUT_MS=300 -CONFIG_INT_WDT_CHECK_CPU1=y -CONFIG_TASK_WDT=y -CONFIG_ESP_TASK_WDT=y -# CONFIG_TASK_WDT_PANIC is not set -CONFIG_TASK_WDT_TIMEOUT_S=5 -CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU0=y -CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU1=y -# CONFIG_ESP32_DEBUG_STUBS_ENABLE is not set -CONFIG_ESP32_DEBUG_OCDAWARE=y -# CONFIG_DISABLE_BASIC_ROM_CONSOLE is not set -CONFIG_IPC_TASK_STACK_SIZE=1024 -CONFIG_TIMER_TASK_STACK_SIZE=2048 -CONFIG_ESP32_WIFI_ENABLED=y -CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=8 -CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=64 -CONFIG_ESP32_WIFI_STATIC_TX_BUFFER=y -# CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER is not set -CONFIG_ESP32_WIFI_TX_BUFFER_TYPE=0 -CONFIG_ESP32_WIFI_STATIC_TX_BUFFER_NUM=8 -# CONFIG_ESP32_WIFI_CSI_ENABLED is not set -CONFIG_ESP32_WIFI_AMPDU_TX_ENABLED=y -CONFIG_ESP32_WIFI_TX_BA_WIN=8 -CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED=y -CONFIG_ESP32_WIFI_RX_BA_WIN=16 -CONFIG_ESP32_WIFI_NVS_ENABLED=y -CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_0=y -# CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_1 is not set -CONFIG_ESP32_WIFI_SOFTAP_BEACON_MAX_LEN=752 -CONFIG_ESP32_WIFI_MGMT_SBUF_NUM=32 -# CONFIG_ESP32_WIFI_IRAM_OPT is not set -CONFIG_ESP32_WIFI_RX_IRAM_OPT=y -CONFIG_ESP32_WIFI_ENABLE_WPA3_SAE=y -CONFIG_ESP32_WIFI_ENABLE_WPA3_OWE_STA=y -CONFIG_WPA_MBEDTLS_CRYPTO=y -CONFIG_WPA_MBEDTLS_TLS_CLIENT=y -# CONFIG_WPA_WAPI_PSK is not set -# CONFIG_WPA_11KV_SUPPORT is not set -# CONFIG_WPA_MBO_SUPPORT is not set -# CONFIG_WPA_DPP_SUPPORT is not set -# CONFIG_WPA_11R_SUPPORT is not set -# CONFIG_WPA_WPS_SOFTAP_REGISTRAR is not set -# CONFIG_WPA_WPS_STRICT is not set -# CONFIG_WPA_DEBUG_PRINT is not set -# CONFIG_WPA_TESTING_OPTIONS is not set -# CONFIG_ESP32_ENABLE_COREDUMP_TO_FLASH is not set -# CONFIG_ESP32_ENABLE_COREDUMP_TO_UART is not set -CONFIG_ESP32_ENABLE_COREDUMP_TO_NONE=y -CONFIG_TIMER_TASK_PRIORITY=1 -CONFIG_TIMER_TASK_STACK_DEPTH=1536 -CONFIG_TIMER_QUEUE_LENGTH=5 -# CONFIG_ENABLE_STATIC_TASK_CLEAN_UP_HOOK is not set -# CONFIG_SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY is not set -# CONFIG_HAL_ASSERTION_SILIENT is not set -# CONFIG_L2_TO_L3_COPY is not set -CONFIG_ESP_GRATUITOUS_ARP=y -CONFIG_GARP_TMR_INTERVAL=60 -CONFIG_TCPIP_RECVMBOX_SIZE=32 -CONFIG_TCP_MAXRTX=12 -CONFIG_TCP_SYNMAXRTX=12 -CONFIG_TCP_MSS=1460 -CONFIG_TCP_MSL=60000 -CONFIG_TCP_SND_BUF_DEFAULT=11680 -CONFIG_TCP_WND_DEFAULT=11680 -CONFIG_TCP_RECVMBOX_SIZE=10 -CONFIG_TCP_QUEUE_OOSEQ=y -CONFIG_TCP_OVERSIZE_MSS=y -# CONFIG_TCP_OVERSIZE_QUARTER_MSS is not set -# CONFIG_TCP_OVERSIZE_DISABLE is not set -CONFIG_UDP_RECVMBOX_SIZE=6 -CONFIG_TCPIP_TASK_STACK_SIZE=3072 -# CONFIG_TCPIP_TASK_AFFINITY_NO_AFFINITY is not set -CONFIG_TCPIP_TASK_AFFINITY_CPU0=y -# CONFIG_TCPIP_TASK_AFFINITY_CPU1 is not set -CONFIG_TCPIP_TASK_AFFINITY=0x0 -# CONFIG_PPP_SUPPORT is not set -CONFIG_NEWLIB_STDOUT_LINE_ENDING_CRLF=y -# CONFIG_NEWLIB_STDOUT_LINE_ENDING_LF is not set -# CONFIG_NEWLIB_STDOUT_LINE_ENDING_CR is not set -# CONFIG_NEWLIB_STDIN_LINE_ENDING_CRLF is not set -# CONFIG_NEWLIB_STDIN_LINE_ENDING_LF is not set -CONFIG_NEWLIB_STDIN_LINE_ENDING_CR=y -# CONFIG_NEWLIB_NANO_FORMAT is not set -CONFIG_NEWLIB_TIME_SYSCALL_USE_RTC_HRT=y -CONFIG_ESP32_TIME_SYSCALL_USE_RTC_HRT=y -CONFIG_ESP32_TIME_SYSCALL_USE_RTC_FRC1=y -# CONFIG_NEWLIB_TIME_SYSCALL_USE_RTC is not set -# CONFIG_ESP32_TIME_SYSCALL_USE_RTC is not set -# CONFIG_NEWLIB_TIME_SYSCALL_USE_HRT is not set -# CONFIG_ESP32_TIME_SYSCALL_USE_HRT is not set -# CONFIG_ESP32_TIME_SYSCALL_USE_FRC1 is not set -# CONFIG_NEWLIB_TIME_SYSCALL_USE_NONE is not set -# CONFIG_ESP32_TIME_SYSCALL_USE_NONE is not set -CONFIG_ESP32_PTHREAD_TASK_PRIO_DEFAULT=5 -CONFIG_ESP32_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072 -CONFIG_ESP32_PTHREAD_STACK_MIN=768 -CONFIG_ESP32_DEFAULT_PTHREAD_CORE_NO_AFFINITY=y -# CONFIG_ESP32_DEFAULT_PTHREAD_CORE_0 is not set -# CONFIG_ESP32_DEFAULT_PTHREAD_CORE_1 is not set -CONFIG_ESP32_PTHREAD_TASK_CORE_DEFAULT=-1 -CONFIG_ESP32_PTHREAD_TASK_NAME_DEFAULT="pthread" -CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ABORTS=y -# CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_FAILS is not set -# CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ALLOWED is not set -# CONFIG_ESP32_ULP_COPROC_ENABLED is not set -CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT=y -CONFIG_SUPPORT_TERMIOS=y -CONFIG_SEMIHOSTFS_MAX_MOUNT_POINTS=1 -# End of deprecated options diff --git a/sdkconfig.louder-esp32 b/sdkconfig.louder-esp32 deleted file mode 100644 index 12508af3..00000000 --- a/sdkconfig.louder-esp32 +++ /dev/null @@ -1,2513 +0,0 @@ -# -# Automatically generated file. DO NOT EDIT. -# Espressif IoT Development Framework (ESP-IDF) 5.5.1 Project Configuration -# -CONFIG_SOC_CAPS_ECO_VER_MAX=301 -CONFIG_SOC_ADC_SUPPORTED=y -CONFIG_SOC_DAC_SUPPORTED=y -CONFIG_SOC_UART_SUPPORTED=y -CONFIG_SOC_MCPWM_SUPPORTED=y -CONFIG_SOC_GPTIMER_SUPPORTED=y -CONFIG_SOC_SDMMC_HOST_SUPPORTED=y -CONFIG_SOC_BT_SUPPORTED=y -CONFIG_SOC_PCNT_SUPPORTED=y -CONFIG_SOC_PHY_SUPPORTED=y -CONFIG_SOC_WIFI_SUPPORTED=y -CONFIG_SOC_SDIO_SLAVE_SUPPORTED=y -CONFIG_SOC_TWAI_SUPPORTED=y -CONFIG_SOC_EFUSE_SUPPORTED=y -CONFIG_SOC_EMAC_SUPPORTED=y -CONFIG_SOC_ULP_SUPPORTED=y -CONFIG_SOC_CCOMP_TIMER_SUPPORTED=y -CONFIG_SOC_RTC_FAST_MEM_SUPPORTED=y -CONFIG_SOC_RTC_SLOW_MEM_SUPPORTED=y -CONFIG_SOC_RTC_MEM_SUPPORTED=y -CONFIG_SOC_I2S_SUPPORTED=y -CONFIG_SOC_RMT_SUPPORTED=y -CONFIG_SOC_SDM_SUPPORTED=y -CONFIG_SOC_GPSPI_SUPPORTED=y -CONFIG_SOC_LEDC_SUPPORTED=y -CONFIG_SOC_I2C_SUPPORTED=y -CONFIG_SOC_SUPPORT_COEXISTENCE=y -CONFIG_SOC_AES_SUPPORTED=y -CONFIG_SOC_MPI_SUPPORTED=y -CONFIG_SOC_SHA_SUPPORTED=y -CONFIG_SOC_FLASH_ENC_SUPPORTED=y -CONFIG_SOC_SECURE_BOOT_SUPPORTED=y -CONFIG_SOC_TOUCH_SENSOR_SUPPORTED=y -CONFIG_SOC_BOD_SUPPORTED=y -CONFIG_SOC_ULP_FSM_SUPPORTED=y -CONFIG_SOC_CLK_TREE_SUPPORTED=y -CONFIG_SOC_MPU_SUPPORTED=y -CONFIG_SOC_WDT_SUPPORTED=y -CONFIG_SOC_SPI_FLASH_SUPPORTED=y -CONFIG_SOC_RNG_SUPPORTED=y -CONFIG_SOC_LIGHT_SLEEP_SUPPORTED=y -CONFIG_SOC_DEEP_SLEEP_SUPPORTED=y -CONFIG_SOC_LP_PERIPH_SHARE_INTERRUPT=y -CONFIG_SOC_PM_SUPPORTED=y -CONFIG_SOC_DPORT_WORKAROUND_DIS_INTERRUPT_LVL=5 -CONFIG_SOC_XTAL_SUPPORT_26M=y -CONFIG_SOC_XTAL_SUPPORT_40M=y -CONFIG_SOC_XTAL_SUPPORT_AUTO_DETECT=y -CONFIG_SOC_ADC_RTC_CTRL_SUPPORTED=y -CONFIG_SOC_ADC_DIG_CTRL_SUPPORTED=y -CONFIG_SOC_ADC_DMA_SUPPORTED=y -CONFIG_SOC_ADC_PERIPH_NUM=2 -CONFIG_SOC_ADC_MAX_CHANNEL_NUM=10 -CONFIG_SOC_ADC_ATTEN_NUM=4 -CONFIG_SOC_ADC_DIGI_CONTROLLER_NUM=2 -CONFIG_SOC_ADC_PATT_LEN_MAX=16 -CONFIG_SOC_ADC_DIGI_MIN_BITWIDTH=9 -CONFIG_SOC_ADC_DIGI_MAX_BITWIDTH=12 -CONFIG_SOC_ADC_DIGI_RESULT_BYTES=2 -CONFIG_SOC_ADC_DIGI_DATA_BYTES_PER_CONV=4 -CONFIG_SOC_ADC_DIGI_MONITOR_NUM=0 -CONFIG_SOC_ADC_SAMPLE_FREQ_THRES_HIGH=2 -CONFIG_SOC_ADC_SAMPLE_FREQ_THRES_LOW=20 -CONFIG_SOC_ADC_RTC_MIN_BITWIDTH=9 -CONFIG_SOC_ADC_RTC_MAX_BITWIDTH=12 -CONFIG_SOC_ADC_SHARED_POWER=y -CONFIG_SOC_BROWNOUT_RESET_SUPPORTED=y -CONFIG_SOC_SHARED_IDCACHE_SUPPORTED=y -CONFIG_SOC_IDCACHE_PER_CORE=y -CONFIG_SOC_CPU_CORES_NUM=2 -CONFIG_SOC_CPU_INTR_NUM=32 -CONFIG_SOC_CPU_HAS_FPU=y -CONFIG_SOC_HP_CPU_HAS_MULTIPLE_CORES=y -CONFIG_SOC_CPU_BREAKPOINTS_NUM=2 -CONFIG_SOC_CPU_WATCHPOINTS_NUM=2 -CONFIG_SOC_CPU_WATCHPOINT_MAX_REGION_SIZE=0x40 -CONFIG_SOC_DAC_CHAN_NUM=2 -CONFIG_SOC_DAC_RESOLUTION=8 -CONFIG_SOC_DAC_DMA_16BIT_ALIGN=y -CONFIG_SOC_GPIO_PORT=1 -CONFIG_SOC_GPIO_PIN_COUNT=40 -CONFIG_SOC_GPIO_VALID_GPIO_MASK=0xFFFFFFFFFF -CONFIG_SOC_GPIO_IN_RANGE_MAX=39 -CONFIG_SOC_GPIO_OUT_RANGE_MAX=33 -CONFIG_SOC_GPIO_VALID_DIGITAL_IO_PAD_MASK=0xEF0FEA -CONFIG_SOC_GPIO_CLOCKOUT_BY_IO_MUX=y -CONFIG_SOC_GPIO_CLOCKOUT_CHANNEL_NUM=3 -CONFIG_SOC_GPIO_SUPPORT_HOLD_IO_IN_DSLP=y -CONFIG_SOC_I2C_NUM=2 -CONFIG_SOC_HP_I2C_NUM=2 -CONFIG_SOC_I2C_FIFO_LEN=32 -CONFIG_SOC_I2C_CMD_REG_NUM=16 -CONFIG_SOC_I2C_SUPPORT_SLAVE=y -CONFIG_SOC_I2C_SUPPORT_APB=y -CONFIG_SOC_I2C_SUPPORT_10BIT_ADDR=y -CONFIG_SOC_I2C_STOP_INDEPENDENT=y -CONFIG_SOC_I2S_NUM=2 -CONFIG_SOC_I2S_HW_VERSION_1=y -CONFIG_SOC_I2S_SUPPORTS_APLL=y -CONFIG_SOC_I2S_SUPPORTS_PLL_F160M=y -CONFIG_SOC_I2S_SUPPORTS_PDM=y -CONFIG_SOC_I2S_SUPPORTS_PDM_TX=y -CONFIG_SOC_I2S_SUPPORTS_PCM2PDM=y -CONFIG_SOC_I2S_SUPPORTS_PDM_RX=y -CONFIG_SOC_I2S_SUPPORTS_PDM2PCM=y -CONFIG_SOC_I2S_PDM_MAX_TX_LINES=1 -CONFIG_SOC_I2S_PDM_MAX_RX_LINES=1 -CONFIG_SOC_I2S_SUPPORTS_ADC_DAC=y -CONFIG_SOC_I2S_SUPPORTS_ADC=y -CONFIG_SOC_I2S_SUPPORTS_DAC=y -CONFIG_SOC_I2S_SUPPORTS_LCD_CAMERA=y -CONFIG_SOC_I2S_MAX_DATA_WIDTH=24 -CONFIG_SOC_I2S_TRANS_SIZE_ALIGN_WORD=y -CONFIG_SOC_I2S_LCD_I80_VARIANT=y -CONFIG_SOC_LCD_I80_SUPPORTED=y -CONFIG_SOC_LCD_I80_BUSES=2 -CONFIG_SOC_LCD_I80_BUS_WIDTH=24 -CONFIG_SOC_LEDC_HAS_TIMER_SPECIFIC_MUX=y -CONFIG_SOC_LEDC_SUPPORT_APB_CLOCK=y -CONFIG_SOC_LEDC_SUPPORT_REF_TICK=y -CONFIG_SOC_LEDC_SUPPORT_HS_MODE=y -CONFIG_SOC_LEDC_TIMER_NUM=4 -CONFIG_SOC_LEDC_CHANNEL_NUM=8 -CONFIG_SOC_LEDC_TIMER_BIT_WIDTH=20 -CONFIG_SOC_MCPWM_GROUPS=2 -CONFIG_SOC_MCPWM_TIMERS_PER_GROUP=3 -CONFIG_SOC_MCPWM_OPERATORS_PER_GROUP=3 -CONFIG_SOC_MCPWM_COMPARATORS_PER_OPERATOR=2 -CONFIG_SOC_MCPWM_GENERATORS_PER_OPERATOR=2 -CONFIG_SOC_MCPWM_TRIGGERS_PER_OPERATOR=2 -CONFIG_SOC_MCPWM_GPIO_FAULTS_PER_GROUP=3 -CONFIG_SOC_MCPWM_CAPTURE_TIMERS_PER_GROUP=y -CONFIG_SOC_MCPWM_CAPTURE_CHANNELS_PER_TIMER=3 -CONFIG_SOC_MCPWM_GPIO_SYNCHROS_PER_GROUP=3 -CONFIG_SOC_MMU_PERIPH_NUM=2 -CONFIG_SOC_MMU_LINEAR_ADDRESS_REGION_NUM=3 -CONFIG_SOC_MPU_MIN_REGION_SIZE=0x20000000 -CONFIG_SOC_MPU_REGIONS_MAX_NUM=8 -CONFIG_SOC_PCNT_GROUPS=1 -CONFIG_SOC_PCNT_UNITS_PER_GROUP=8 -CONFIG_SOC_PCNT_CHANNELS_PER_UNIT=2 -CONFIG_SOC_PCNT_THRES_POINT_PER_UNIT=2 -CONFIG_SOC_RMT_GROUPS=1 -CONFIG_SOC_RMT_TX_CANDIDATES_PER_GROUP=8 -CONFIG_SOC_RMT_RX_CANDIDATES_PER_GROUP=8 -CONFIG_SOC_RMT_CHANNELS_PER_GROUP=8 -CONFIG_SOC_RMT_MEM_WORDS_PER_CHANNEL=64 -CONFIG_SOC_RMT_SUPPORT_REF_TICK=y -CONFIG_SOC_RMT_SUPPORT_APB=y -CONFIG_SOC_RMT_CHANNEL_CLK_INDEPENDENT=y -CONFIG_SOC_RTCIO_PIN_COUNT=18 -CONFIG_SOC_RTCIO_INPUT_OUTPUT_SUPPORTED=y -CONFIG_SOC_RTCIO_HOLD_SUPPORTED=y -CONFIG_SOC_RTCIO_WAKE_SUPPORTED=y -CONFIG_SOC_SDM_GROUPS=1 -CONFIG_SOC_SDM_CHANNELS_PER_GROUP=8 -CONFIG_SOC_SDM_CLK_SUPPORT_APB=y -CONFIG_SOC_SPI_HD_BOTH_INOUT_SUPPORTED=y -CONFIG_SOC_SPI_AS_CS_SUPPORTED=y -CONFIG_SOC_SPI_PERIPH_NUM=3 -CONFIG_SOC_SPI_DMA_CHAN_NUM=2 -CONFIG_SOC_SPI_MAX_CS_NUM=3 -CONFIG_SOC_SPI_SUPPORT_CLK_APB=y -CONFIG_SOC_SPI_MAXIMUM_BUFFER_SIZE=64 -CONFIG_SOC_SPI_MAX_PRE_DIVIDER=8192 -CONFIG_SOC_MEMSPI_SRC_FREQ_80M_SUPPORTED=y -CONFIG_SOC_MEMSPI_SRC_FREQ_40M_SUPPORTED=y -CONFIG_SOC_MEMSPI_SRC_FREQ_26M_SUPPORTED=y -CONFIG_SOC_MEMSPI_SRC_FREQ_20M_SUPPORTED=y -CONFIG_SOC_TIMER_GROUPS=2 -CONFIG_SOC_TIMER_GROUP_TIMERS_PER_GROUP=2 -CONFIG_SOC_TIMER_GROUP_COUNTER_BIT_WIDTH=64 -CONFIG_SOC_TIMER_GROUP_TOTAL_TIMERS=4 -CONFIG_SOC_TIMER_GROUP_SUPPORT_APB=y -CONFIG_SOC_LP_TIMER_BIT_WIDTH_LO=32 -CONFIG_SOC_LP_TIMER_BIT_WIDTH_HI=16 -CONFIG_SOC_TOUCH_SENSOR_VERSION=1 -CONFIG_SOC_TOUCH_SENSOR_NUM=10 -CONFIG_SOC_TOUCH_MIN_CHAN_ID=0 -CONFIG_SOC_TOUCH_MAX_CHAN_ID=9 -CONFIG_SOC_TOUCH_SUPPORT_SLEEP_WAKEUP=y -CONFIG_SOC_TOUCH_SAMPLE_CFG_NUM=1 -CONFIG_SOC_TWAI_CONTROLLER_NUM=1 -CONFIG_SOC_TWAI_MASK_FILTER_NUM=1 -CONFIG_SOC_TWAI_BRP_MIN=2 -CONFIG_SOC_TWAI_CLK_SUPPORT_APB=y -CONFIG_SOC_TWAI_SUPPORT_MULTI_ADDRESS_LAYOUT=y -CONFIG_SOC_UART_NUM=3 -CONFIG_SOC_UART_HP_NUM=3 -CONFIG_SOC_UART_SUPPORT_APB_CLK=y -CONFIG_SOC_UART_SUPPORT_REF_TICK=y -CONFIG_SOC_UART_FIFO_LEN=128 -CONFIG_SOC_UART_BITRATE_MAX=5000000 -CONFIG_SOC_UART_WAKEUP_SUPPORT_ACTIVE_THRESH_MODE=y -CONFIG_SOC_SPIRAM_SUPPORTED=y -CONFIG_SOC_SPI_MEM_SUPPORT_CONFIG_GPIO_BY_EFUSE=y -CONFIG_SOC_SHA_SUPPORT_PARALLEL_ENG=y -CONFIG_SOC_SHA_ENDIANNESS_BE=y -CONFIG_SOC_SHA_SUPPORT_SHA1=y -CONFIG_SOC_SHA_SUPPORT_SHA256=y -CONFIG_SOC_SHA_SUPPORT_SHA384=y -CONFIG_SOC_SHA_SUPPORT_SHA512=y -CONFIG_SOC_MPI_MEM_BLOCKS_NUM=4 -CONFIG_SOC_MPI_OPERATIONS_NUM=1 -CONFIG_SOC_RSA_MAX_BIT_LEN=4096 -CONFIG_SOC_AES_SUPPORT_AES_128=y -CONFIG_SOC_AES_SUPPORT_AES_192=y -CONFIG_SOC_AES_SUPPORT_AES_256=y -CONFIG_SOC_SECURE_BOOT_V1=y -CONFIG_SOC_EFUSE_SECURE_BOOT_KEY_DIGESTS=1 -CONFIG_SOC_FLASH_ENCRYPTED_XTS_AES_BLOCK_MAX=32 -CONFIG_SOC_PHY_DIG_REGS_MEM_SIZE=21 -CONFIG_SOC_PM_SUPPORT_EXT0_WAKEUP=y -CONFIG_SOC_PM_SUPPORT_EXT1_WAKEUP=y -CONFIG_SOC_PM_SUPPORT_EXT_WAKEUP=y -CONFIG_SOC_PM_SUPPORT_TOUCH_SENSOR_WAKEUP=y -CONFIG_SOC_PM_SUPPORT_RTC_PERIPH_PD=y -CONFIG_SOC_PM_SUPPORT_RTC_FAST_MEM_PD=y -CONFIG_SOC_PM_SUPPORT_RTC_SLOW_MEM_PD=y -CONFIG_SOC_PM_SUPPORT_RC_FAST_PD=y -CONFIG_SOC_PM_SUPPORT_VDDSDIO_PD=y -CONFIG_SOC_PM_SUPPORT_MODEM_PD=y -CONFIG_SOC_CONFIGURABLE_VDDSDIO_SUPPORTED=y -CONFIG_SOC_PM_MODEM_PD_BY_SW=y -CONFIG_SOC_CLK_APLL_SUPPORTED=y -CONFIG_SOC_CLK_RC_FAST_D256_SUPPORTED=y -CONFIG_SOC_RTC_SLOW_CLK_SUPPORT_RC_FAST_D256=y -CONFIG_SOC_CLK_RC_FAST_SUPPORT_CALIBRATION=y -CONFIG_SOC_CLK_XTAL32K_SUPPORTED=y -CONFIG_SOC_CLK_LP_FAST_SUPPORT_XTAL_D4=y -CONFIG_SOC_SDMMC_USE_IOMUX=y -CONFIG_SOC_SDMMC_NUM_SLOTS=2 -CONFIG_SOC_WIFI_WAPI_SUPPORT=y -CONFIG_SOC_WIFI_CSI_SUPPORT=y -CONFIG_SOC_WIFI_MESH_SUPPORT=y -CONFIG_SOC_WIFI_SUPPORT_VARIABLE_BEACON_WINDOW=y -CONFIG_SOC_WIFI_NAN_SUPPORT=y -CONFIG_SOC_BLE_SUPPORTED=y -CONFIG_SOC_BLE_MESH_SUPPORTED=y -CONFIG_SOC_BT_CLASSIC_SUPPORTED=y -CONFIG_SOC_BLUFI_SUPPORTED=y -CONFIG_SOC_BT_H2C_ENC_KEY_CTRL_ENH_VSC_SUPPORTED=y -CONFIG_SOC_BLE_MULTI_CONN_OPTIMIZATION=y -CONFIG_SOC_ULP_HAS_ADC=y -CONFIG_SOC_PHY_COMBO_MODULE=y -CONFIG_SOC_EMAC_RMII_CLK_OUT_INTERNAL_LOOPBACK=y -CONFIG_IDF_CMAKE=y -CONFIG_IDF_TOOLCHAIN="gcc" -CONFIG_IDF_TOOLCHAIN_GCC=y -CONFIG_IDF_TARGET_ARCH_XTENSA=y -CONFIG_IDF_TARGET_ARCH="xtensa" -CONFIG_IDF_TARGET="esp32" -CONFIG_IDF_INIT_VERSION="5.5.1" -CONFIG_IDF_TARGET_ESP32=y -CONFIG_IDF_FIRMWARE_CHIP_ID=0x0000 - -# -# Build type -# -CONFIG_APP_BUILD_TYPE_APP_2NDBOOT=y -# CONFIG_APP_BUILD_TYPE_RAM is not set -CONFIG_APP_BUILD_GENERATE_BINARIES=y -CONFIG_APP_BUILD_BOOTLOADER=y -CONFIG_APP_BUILD_USE_FLASH_SECTIONS=y -# CONFIG_APP_REPRODUCIBLE_BUILD is not set -# CONFIG_APP_NO_BLOBS is not set -# CONFIG_APP_COMPATIBLE_PRE_V2_1_BOOTLOADERS is not set -# CONFIG_APP_COMPATIBLE_PRE_V3_1_BOOTLOADERS is not set -# end of Build type - -# -# Bootloader config -# - -# -# Bootloader manager -# -CONFIG_BOOTLOADER_COMPILE_TIME_DATE=y -CONFIG_BOOTLOADER_PROJECT_VER=1 -# end of Bootloader manager - -# -# Application Rollback -# -CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE=y -# CONFIG_BOOTLOADER_APP_ANTI_ROLLBACK is not set -# end of Application Rollback - -# -# Recovery Bootloader and Rollback -# -# end of Recovery Bootloader and Rollback - -CONFIG_BOOTLOADER_OFFSET_IN_FLASH=0x1000 -CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE=y -# CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_DEBUG is not set -# CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_PERF is not set -# CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_NONE is not set - -# -# Log -# -CONFIG_BOOTLOADER_LOG_VERSION_1=y -CONFIG_BOOTLOADER_LOG_VERSION=1 -# CONFIG_BOOTLOADER_LOG_LEVEL_NONE is not set -# CONFIG_BOOTLOADER_LOG_LEVEL_ERROR is not set -# CONFIG_BOOTLOADER_LOG_LEVEL_WARN is not set -CONFIG_BOOTLOADER_LOG_LEVEL_INFO=y -# CONFIG_BOOTLOADER_LOG_LEVEL_DEBUG is not set -# CONFIG_BOOTLOADER_LOG_LEVEL_VERBOSE is not set -CONFIG_BOOTLOADER_LOG_LEVEL=3 - -# -# Format -# -# CONFIG_BOOTLOADER_LOG_COLORS is not set -CONFIG_BOOTLOADER_LOG_TIMESTAMP_SOURCE_CPU_TICKS=y -# end of Format - -# -# Settings -# -CONFIG_BOOTLOADER_LOG_MODE_TEXT_EN=y -CONFIG_BOOTLOADER_LOG_MODE_TEXT=y -# end of Settings -# end of Log - -# -# Serial Flash Configurations -# -# CONFIG_BOOTLOADER_SPI_CUSTOM_WP_PIN is not set -CONFIG_BOOTLOADER_SPI_WP_PIN=7 -# CONFIG_BOOTLOADER_FLASH_DC_AWARE is not set -CONFIG_BOOTLOADER_FLASH_XMC_SUPPORT=y -# end of Serial Flash Configurations - -CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_9V=y -# CONFIG_BOOTLOADER_FACTORY_RESET is not set -# CONFIG_BOOTLOADER_APP_TEST is not set -CONFIG_BOOTLOADER_REGION_PROTECTION_ENABLE=y -CONFIG_BOOTLOADER_WDT_ENABLE=y -# CONFIG_BOOTLOADER_WDT_DISABLE_IN_USER_CODE is not set -CONFIG_BOOTLOADER_WDT_TIME_MS=9000 -# CONFIG_BOOTLOADER_SKIP_VALIDATE_IN_DEEP_SLEEP is not set -# CONFIG_BOOTLOADER_SKIP_VALIDATE_ON_POWER_ON is not set -# CONFIG_BOOTLOADER_SKIP_VALIDATE_ALWAYS is not set -CONFIG_BOOTLOADER_RESERVE_RTC_SIZE=0 -# CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC is not set -# end of Bootloader config - -# -# Security features -# -CONFIG_SECURE_BOOT_V1_SUPPORTED=y -# CONFIG_SECURE_SIGNED_APPS_NO_SECURE_BOOT is not set -# CONFIG_SECURE_BOOT is not set -# CONFIG_SECURE_FLASH_ENC_ENABLED is not set -# end of Security features - -# -# Application manager -# -CONFIG_APP_COMPILE_TIME_DATE=y -# CONFIG_APP_EXCLUDE_PROJECT_VER_VAR is not set -# CONFIG_APP_EXCLUDE_PROJECT_NAME_VAR is not set -# CONFIG_APP_PROJECT_VER_FROM_CONFIG is not set -CONFIG_APP_RETRIEVE_LEN_ELF_SHA=16 -# end of Application manager - -CONFIG_ESP_ROM_HAS_CRC_LE=y -CONFIG_ESP_ROM_HAS_CRC_BE=y -CONFIG_ESP_ROM_HAS_MZ_CRC32=y -CONFIG_ESP_ROM_HAS_JPEG_DECODE=y -CONFIG_ESP_ROM_HAS_UART_BUF_SWITCH=y -CONFIG_ESP_ROM_NEEDS_SWSETUP_WORKAROUND=y -CONFIG_ESP_ROM_HAS_NEWLIB=y -CONFIG_ESP_ROM_HAS_NEWLIB_NANO_FORMAT=y -CONFIG_ESP_ROM_HAS_NEWLIB_32BIT_TIME=y -CONFIG_ESP_ROM_HAS_SW_FLOAT=y -CONFIG_ESP_ROM_USB_OTG_NUM=-1 -CONFIG_ESP_ROM_USB_SERIAL_DEVICE_NUM=-1 -CONFIG_ESP_ROM_SUPPORT_DEEP_SLEEP_WAKEUP_STUB=y -CONFIG_ESP_ROM_HAS_OUTPUT_PUTC_FUNC=y - -# -# Serial flasher config -# -# CONFIG_ESPTOOLPY_NO_STUB is not set -CONFIG_ESPTOOLPY_FLASHMODE_QIO=y -# CONFIG_ESPTOOLPY_FLASHMODE_QOUT is not set -# CONFIG_ESPTOOLPY_FLASHMODE_DIO is not set -# CONFIG_ESPTOOLPY_FLASHMODE_DOUT is not set -CONFIG_ESPTOOLPY_FLASH_SAMPLE_MODE_STR=y -CONFIG_ESPTOOLPY_FLASHMODE="dio" -CONFIG_ESPTOOLPY_FLASHFREQ_80M=y -# CONFIG_ESPTOOLPY_FLASHFREQ_40M is not set -# CONFIG_ESPTOOLPY_FLASHFREQ_26M is not set -# CONFIG_ESPTOOLPY_FLASHFREQ_20M is not set -CONFIG_ESPTOOLPY_FLASHFREQ="80m" -# CONFIG_ESPTOOLPY_FLASHSIZE_1MB is not set -# CONFIG_ESPTOOLPY_FLASHSIZE_2MB is not set -CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y -# CONFIG_ESPTOOLPY_FLASHSIZE_8MB is not set -# CONFIG_ESPTOOLPY_FLASHSIZE_16MB is not set -# CONFIG_ESPTOOLPY_FLASHSIZE_32MB is not set -# CONFIG_ESPTOOLPY_FLASHSIZE_64MB is not set -# CONFIG_ESPTOOLPY_FLASHSIZE_128MB is not set -CONFIG_ESPTOOLPY_FLASHSIZE="4MB" -# CONFIG_ESPTOOLPY_HEADER_FLASHSIZE_UPDATE is not set -CONFIG_ESPTOOLPY_BEFORE_RESET=y -# CONFIG_ESPTOOLPY_BEFORE_NORESET is not set -CONFIG_ESPTOOLPY_BEFORE="default_reset" -CONFIG_ESPTOOLPY_AFTER_RESET=y -# CONFIG_ESPTOOLPY_AFTER_NORESET is not set -CONFIG_ESPTOOLPY_AFTER="hard_reset" -CONFIG_ESPTOOLPY_MONITOR_BAUD=115200 -# end of Serial flasher config - -# -# Partition Table -# -# CONFIG_PARTITION_TABLE_SINGLE_APP is not set -# CONFIG_PARTITION_TABLE_SINGLE_APP_LARGE is not set -# CONFIG_PARTITION_TABLE_TWO_OTA is not set -# CONFIG_PARTITION_TABLE_TWO_OTA_LARGE is not set -CONFIG_PARTITION_TABLE_CUSTOM=y -CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv" -CONFIG_PARTITION_TABLE_FILENAME="partitions.csv" -CONFIG_PARTITION_TABLE_OFFSET=0x8000 -CONFIG_PARTITION_TABLE_MD5=y -# end of Partition Table - -# -# Snapclient Configuration -# -# CONFIG_SNAPSERVER_USE_MDNS is not set -# CONFIG_SNAPCLIENT_CONNECT_IPV6 is not set -CONFIG_SNAPSERVER_HOST="192.168.1.49" -CONFIG_SNAPSERVER_PORT=1704 -CONFIG_SNAPCLIENT_NAME="louder-esp32" - -# -# HTTP Server Setting -# -CONFIG_WEB_PORT=80 -# end of HTTP Server Setting - -CONFIG_USE_SAMPLE_INSERTION=y -# end of Snapclient Configuration - -# -# Audio Board -# -CONFIG_AUDIO_BOARD_CUSTOM=y -# CONFIG_ESP_LYRAT_V4_3_BOARD is not set -# CONFIG_ESP_LYRAT_V4_2_BOARD is not set -# CONFIG_ESP_LYRATD_MSC_V2_1_BOARD is not set -# CONFIG_ESP_LYRATD_MSC_V2_2_BOARD is not set -# CONFIG_ESP_LYRAT_MINI_V1_1_BOARD is not set -# CONFIG_ESP32_KORVO_DU1906_BOARD is not set -# CONFIG_ESP32_S2_KALUGA_1_V1_2_BOARD is not set -# CONFIG_ESP_AI_THINKER_ES8388_BOARD is not set - -# -# Custom Audio Board -# -# CONFIG_DAC_PCM51XX is not set -# CONFIG_DAC_PCM5102A is not set -# CONFIG_DAC_MA120 is not set -# CONFIG_DAC_MA120X0 is not set -# CONFIG_DAC_ADAU1961 is not set -# CONFIG_DAC_MAX98357 is not set -CONFIG_DAC_TAS5805M=y -# CONFIG_DAC_PT8211 is not set - -# -# DAC I2C control interface -# -CONFIG_DAC_I2C_SDA=21 -CONFIG_DAC_I2C_SCL=27 -CONFIG_DAC_I2C_ADDR=0x2d -# end of DAC I2C control interface - -# -# I2S master interface -# -CONFIG_MASTER_I2S_MCLK_PIN=0 -CONFIG_MASTER_I2S_BCK_PIN=26 -CONFIG_MASTER_I2S_LRCK_PIN=25 -CONFIG_MASTER_I2S_DATAOUT_PIN=22 -# end of I2S master interface - -# -# TAS5805M interface configuration -# -CONFIG_PIN_DAC_PWDN=33 -# end of TAS5805M interface configuration - -# -# TAS5805M DSP Support -# -# CONFIG_DAC_TAS5805M_EQ_SUPPORT is not set -# end of TAS5805M DSP Support - -# -# Logic-Level-Settings -# -# CONFIG_INVERT_MCLK_LEVEL is not set -# CONFIG_INVERT_WORD_SELECT_LEVEL is not set -# CONFIG_INVERT_BCLK_LEVEL is not set -# end of Logic-Level-Settings -# end of Custom Audio Board -# end of Audio Board - -# -# ESP32 DSP processor config -# -# CONFIG_USE_DSP_PROCESSOR is not set -# end of ESP32 DSP processor config - -# -# SNTP Configuration -# -CONFIG_SNTP_TIMEZONE="UTC" -CONFIG_SNTP_SERVER="pool.ntp.org" -# end of SNTP Configuration - -# -# Snapclient Ethernet Configuration -# -CONFIG_ENV_GPIO_RANGE_MIN=0 -CONFIG_ENV_GPIO_RANGE_MAX=39 -CONFIG_ENV_GPIO_IN_RANGE_MAX=39 -CONFIG_ENV_GPIO_OUT_RANGE_MAX=33 -# CONFIG_SNAPCLIENT_USE_INTERNAL_ETHERNET is not set -# CONFIG_SNAPCLIENT_USE_SPI_ETHERNET is not set -# end of Snapclient Ethernet Configuration - -# -# Wifi Configuration -# -CONFIG_ENABLE_WIFI_PROVISIONING=y -# CONFIG_WIFI_AUTH_WEP is not set -# CONFIG_WIFI_AUTH_WPA_PSK is not set -# CONFIG_WIFI_AUTH_WPA2_PSK is not set -# CONFIG_WIFI_AUTH_WPA_WPA2_PSK is not set -CONFIG_WIFI_AUTH_WPA2_WPA3_PSK=y -# CONFIG_WIFI_AUTH_ENTERPRISE is not set -# CONFIG_WIFI_AUTH_WPA2_ENTERPRISE is not set -# CONFIG_WIFI_AUTH_WPA3_PSK is not set -# CONFIG_WIFI_AUTH_WPA3_ENT_192 is not set -# CONFIG_WIFI_AUTH_WAPI_PSK is not set -# CONFIG_WIFI_AUTH_OWE is not set -CONFIG_WIFI_MAXIMUM_RETRY=0 -# end of Wifi Configuration - -# -# Compiler options -# -# CONFIG_COMPILER_OPTIMIZATION_DEBUG is not set -# CONFIG_COMPILER_OPTIMIZATION_SIZE is not set -CONFIG_COMPILER_OPTIMIZATION_PERF=y -# CONFIG_COMPILER_OPTIMIZATION_NONE is not set -CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE=y -# CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT is not set -# CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE is not set -CONFIG_COMPILER_ASSERT_NDEBUG_EVALUATE=y -CONFIG_COMPILER_FLOAT_LIB_FROM_GCCLIB=y -CONFIG_COMPILER_OPTIMIZATION_ASSERTION_LEVEL=2 -# CONFIG_COMPILER_OPTIMIZATION_CHECKS_SILENT is not set -CONFIG_COMPILER_HIDE_PATHS_MACROS=y -# CONFIG_COMPILER_CXX_EXCEPTIONS is not set -# CONFIG_COMPILER_CXX_RTTI is not set -CONFIG_COMPILER_STACK_CHECK_MODE_NONE=y -# CONFIG_COMPILER_STACK_CHECK_MODE_NORM is not set -# CONFIG_COMPILER_STACK_CHECK_MODE_STRONG is not set -# CONFIG_COMPILER_STACK_CHECK_MODE_ALL is not set -# CONFIG_COMPILER_NO_MERGE_CONSTANTS is not set -# CONFIG_COMPILER_WARN_WRITE_STRINGS is not set -CONFIG_COMPILER_DISABLE_DEFAULT_ERRORS=y -# CONFIG_COMPILER_DISABLE_GCC12_WARNINGS is not set -# CONFIG_COMPILER_DISABLE_GCC13_WARNINGS is not set -# CONFIG_COMPILER_DISABLE_GCC14_WARNINGS is not set -# CONFIG_COMPILER_DUMP_RTL_FILES is not set -CONFIG_COMPILER_RT_LIB_GCCLIB=y -CONFIG_COMPILER_RT_LIB_NAME="gcc" -CONFIG_COMPILER_ORPHAN_SECTIONS_WARNING=y -# CONFIG_COMPILER_ORPHAN_SECTIONS_PLACE is not set -# CONFIG_COMPILER_STATIC_ANALYZER is not set -# end of Compiler options - -# -# Component config -# - -# -# Application Level Tracing -# -# CONFIG_APPTRACE_DEST_JTAG is not set -CONFIG_APPTRACE_DEST_NONE=y -# CONFIG_APPTRACE_DEST_UART1 is not set -# CONFIG_APPTRACE_DEST_UART2 is not set -CONFIG_APPTRACE_DEST_UART_NONE=y -CONFIG_APPTRACE_UART_TASK_PRIO=1 -CONFIG_APPTRACE_LOCK_ENABLE=y -# end of Application Level Tracing - -# -# Bluetooth -# -# CONFIG_BT_ENABLED is not set - -# -# Common Options -# -# CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED is not set -# CONFIG_BT_BLE_LOG_UHCI_OUT_ENABLED is not set -# end of Common Options -# end of Bluetooth - -# -# Console Library -# -# CONFIG_CONSOLE_SORTED_HELP is not set -# end of Console Library - -# -# Driver Configurations -# - -# -# Legacy TWAI Driver Configurations -# -# CONFIG_TWAI_SKIP_LEGACY_CONFLICT_CHECK is not set -# CONFIG_TWAI_ERRATA_FIX_BUS_OFF_REC is not set -# CONFIG_TWAI_ERRATA_FIX_TX_INTR_LOST is not set -# CONFIG_TWAI_ERRATA_FIX_RX_FRAME_INVALID is not set -# CONFIG_TWAI_ERRATA_FIX_RX_FIFO_CORRUPT is not set -# CONFIG_TWAI_ERRATA_FIX_LISTEN_ONLY_DOM is not set -# end of Legacy TWAI Driver Configurations - -# -# Legacy ADC Driver Configuration -# -CONFIG_ADC_DISABLE_DAC=y -# CONFIG_ADC_SUPPRESS_DEPRECATE_WARN is not set -# CONFIG_ADC_SKIP_LEGACY_CONFLICT_CHECK is not set - -# -# Legacy ADC Calibration Configuration -# -CONFIG_ADC_CAL_EFUSE_TP_ENABLE=y -CONFIG_ADC_CAL_EFUSE_VREF_ENABLE=y -CONFIG_ADC_CAL_LUT_ENABLE=y -# CONFIG_ADC_CALI_SUPPRESS_DEPRECATE_WARN is not set -# end of Legacy ADC Calibration Configuration -# end of Legacy ADC Driver Configuration - -# -# Legacy DAC Driver Configurations -# -# CONFIG_DAC_SUPPRESS_DEPRECATE_WARN is not set -# CONFIG_DAC_SKIP_LEGACY_CONFLICT_CHECK is not set -# end of Legacy DAC Driver Configurations - -# -# Legacy MCPWM Driver Configurations -# -# CONFIG_MCPWM_SUPPRESS_DEPRECATE_WARN is not set -# CONFIG_MCPWM_SKIP_LEGACY_CONFLICT_CHECK is not set -# end of Legacy MCPWM Driver Configurations - -# -# Legacy Timer Group Driver Configurations -# -# CONFIG_GPTIMER_SUPPRESS_DEPRECATE_WARN is not set -# CONFIG_GPTIMER_SKIP_LEGACY_CONFLICT_CHECK is not set -# end of Legacy Timer Group Driver Configurations - -# -# Legacy RMT Driver Configurations -# -# CONFIG_RMT_SUPPRESS_DEPRECATE_WARN is not set -# CONFIG_RMT_SKIP_LEGACY_CONFLICT_CHECK is not set -# end of Legacy RMT Driver Configurations - -# -# Legacy I2S Driver Configurations -# -# CONFIG_I2S_SUPPRESS_DEPRECATE_WARN is not set -# CONFIG_I2S_SKIP_LEGACY_CONFLICT_CHECK is not set -# end of Legacy I2S Driver Configurations - -# -# Legacy I2C Driver Configurations -# -# CONFIG_I2C_SKIP_LEGACY_CONFLICT_CHECK is not set -# end of Legacy I2C Driver Configurations - -# -# Legacy PCNT Driver Configurations -# -# CONFIG_PCNT_SUPPRESS_DEPRECATE_WARN is not set -# CONFIG_PCNT_SKIP_LEGACY_CONFLICT_CHECK is not set -# end of Legacy PCNT Driver Configurations - -# -# Legacy SDM Driver Configurations -# -# CONFIG_SDM_SUPPRESS_DEPRECATE_WARN is not set -# CONFIG_SDM_SKIP_LEGACY_CONFLICT_CHECK is not set -# end of Legacy SDM Driver Configurations - -# -# Legacy Touch Sensor Driver Configurations -# -# CONFIG_TOUCH_SUPPRESS_DEPRECATE_WARN is not set -# CONFIG_TOUCH_SKIP_LEGACY_CONFLICT_CHECK is not set -# end of Legacy Touch Sensor Driver Configurations -# end of Driver Configurations - -# -# eFuse Bit Manager -# -# CONFIG_EFUSE_CUSTOM_TABLE is not set -# CONFIG_EFUSE_VIRTUAL is not set -# CONFIG_EFUSE_CODE_SCHEME_COMPAT_NONE is not set -CONFIG_EFUSE_CODE_SCHEME_COMPAT_3_4=y -# CONFIG_EFUSE_CODE_SCHEME_COMPAT_REPEAT is not set -CONFIG_EFUSE_MAX_BLK_LEN=192 -# end of eFuse Bit Manager - -# -# ESP-TLS -# -CONFIG_ESP_TLS_USING_MBEDTLS=y -# CONFIG_ESP_TLS_USE_SECURE_ELEMENT is not set -# CONFIG_ESP_TLS_CLIENT_SESSION_TICKETS is not set -# CONFIG_ESP_TLS_SERVER_SESSION_TICKETS is not set -# CONFIG_ESP_TLS_SERVER_CERT_SELECT_HOOK is not set -# CONFIG_ESP_TLS_SERVER_MIN_AUTH_MODE_OPTIONAL is not set -# CONFIG_ESP_TLS_PSK_VERIFICATION is not set -# CONFIG_ESP_TLS_INSECURE is not set -CONFIG_ESP_TLS_DYN_BUF_STRATEGY_SUPPORTED=y -# end of ESP-TLS - -# -# ADC and ADC Calibration -# -# CONFIG_ADC_ONESHOT_CTRL_FUNC_IN_IRAM is not set -# CONFIG_ADC_CONTINUOUS_ISR_IRAM_SAFE is not set - -# -# ADC Calibration Configurations -# -CONFIG_ADC_CALI_EFUSE_TP_ENABLE=y -CONFIG_ADC_CALI_EFUSE_VREF_ENABLE=y -CONFIG_ADC_CALI_LUT_ENABLE=y -# end of ADC Calibration Configurations - -CONFIG_ADC_DISABLE_DAC_OUTPUT=y -# CONFIG_ADC_ENABLE_DEBUG_LOG is not set -# end of ADC and ADC Calibration - -# -# Wireless Coexistence -# -CONFIG_ESP_COEX_ENABLED=y -# CONFIG_ESP_COEX_GPIO_DEBUG is not set -# end of Wireless Coexistence - -# -# Common ESP-related -# -CONFIG_ESP_ERR_TO_NAME_LOOKUP=y -# end of Common ESP-related - -# -# ESP-Driver:DAC Configurations -# -# CONFIG_DAC_CTRL_FUNC_IN_IRAM is not set -# CONFIG_DAC_ISR_IRAM_SAFE is not set -# CONFIG_DAC_ENABLE_DEBUG_LOG is not set -CONFIG_DAC_DMA_AUTO_16BIT_ALIGN=y -# end of ESP-Driver:DAC Configurations - -# -# ESP-Driver:GPIO Configurations -# -# CONFIG_GPIO_ESP32_SUPPORT_SWITCH_SLP_PULL is not set -# CONFIG_GPIO_CTRL_FUNC_IN_IRAM is not set -# end of ESP-Driver:GPIO Configurations - -# -# ESP-Driver:GPTimer Configurations -# -CONFIG_GPTIMER_ISR_HANDLER_IN_IRAM=y -# CONFIG_GPTIMER_CTRL_FUNC_IN_IRAM is not set -# CONFIG_GPTIMER_ISR_CACHE_SAFE is not set -CONFIG_GPTIMER_OBJ_CACHE_SAFE=y -# CONFIG_GPTIMER_ENABLE_DEBUG_LOG is not set -# end of ESP-Driver:GPTimer Configurations - -# -# ESP-Driver:I2C Configurations -# -# CONFIG_I2C_ISR_IRAM_SAFE is not set -# CONFIG_I2C_ENABLE_DEBUG_LOG is not set -# CONFIG_I2C_ENABLE_SLAVE_DRIVER_VERSION_2 is not set -CONFIG_I2C_MASTER_ISR_HANDLER_IN_IRAM=y -# end of ESP-Driver:I2C Configurations - -# -# ESP-Driver:I2S Configurations -# -# CONFIG_I2S_ISR_IRAM_SAFE is not set -# CONFIG_I2S_ENABLE_DEBUG_LOG is not set -# end of ESP-Driver:I2S Configurations - -# -# ESP-Driver:LEDC Configurations -# -# CONFIG_LEDC_CTRL_FUNC_IN_IRAM is not set -# end of ESP-Driver:LEDC Configurations - -# -# ESP-Driver:MCPWM Configurations -# -CONFIG_MCPWM_ISR_HANDLER_IN_IRAM=y -# CONFIG_MCPWM_ISR_CACHE_SAFE is not set -# CONFIG_MCPWM_CTRL_FUNC_IN_IRAM is not set -CONFIG_MCPWM_OBJ_CACHE_SAFE=y -# CONFIG_MCPWM_ENABLE_DEBUG_LOG is not set -# end of ESP-Driver:MCPWM Configurations - -# -# ESP-Driver:PCNT Configurations -# -# CONFIG_PCNT_CTRL_FUNC_IN_IRAM is not set -# CONFIG_PCNT_ISR_IRAM_SAFE is not set -# CONFIG_PCNT_ENABLE_DEBUG_LOG is not set -# end of ESP-Driver:PCNT Configurations - -# -# ESP-Driver:RMT Configurations -# -CONFIG_RMT_ENCODER_FUNC_IN_IRAM=y -CONFIG_RMT_TX_ISR_HANDLER_IN_IRAM=y -CONFIG_RMT_RX_ISR_HANDLER_IN_IRAM=y -# CONFIG_RMT_RECV_FUNC_IN_IRAM is not set -# CONFIG_RMT_TX_ISR_CACHE_SAFE is not set -# CONFIG_RMT_RX_ISR_CACHE_SAFE is not set -CONFIG_RMT_OBJ_CACHE_SAFE=y -# CONFIG_RMT_ENABLE_DEBUG_LOG is not set -# CONFIG_RMT_ISR_IRAM_SAFE is not set -# end of ESP-Driver:RMT Configurations - -# -# ESP-Driver:Sigma Delta Modulator Configurations -# -# CONFIG_SDM_CTRL_FUNC_IN_IRAM is not set -# CONFIG_SDM_ENABLE_DEBUG_LOG is not set -# end of ESP-Driver:Sigma Delta Modulator Configurations - -# -# ESP-Driver:SPI Configurations -# -CONFIG_SPI_MASTER_ISR_IN_IRAM=y -# CONFIG_SPI_SLAVE_IN_IRAM is not set -# CONFIG_SPI_SLAVE_ISR_IN_IRAM is not set -# end of ESP-Driver:SPI Configurations - -# -# ESP-Driver:Touch Sensor Configurations -# -# CONFIG_TOUCH_CTRL_FUNC_IN_IRAM is not set -# CONFIG_TOUCH_ISR_IRAM_SAFE is not set -# CONFIG_TOUCH_ENABLE_DEBUG_LOG is not set -# CONFIG_TOUCH_SKIP_FSM_CHECK is not set -# end of ESP-Driver:Touch Sensor Configurations - -# -# ESP-Driver:TWAI Configurations -# -# CONFIG_TWAI_ISR_IN_IRAM is not set -# CONFIG_TWAI_ISR_CACHE_SAFE is not set -# CONFIG_TWAI_ENABLE_DEBUG_LOG is not set -# end of ESP-Driver:TWAI Configurations - -# -# ESP-Driver:UART Configurations -# -# CONFIG_UART_ISR_IN_IRAM is not set -# end of ESP-Driver:UART Configurations - -# -# ESP-Driver:UHCI Configurations -# -# CONFIG_UHCI_ISR_HANDLER_IN_IRAM is not set -# CONFIG_UHCI_ISR_CACHE_SAFE is not set -# CONFIG_UHCI_ENABLE_DEBUG_LOG is not set -# end of ESP-Driver:UHCI Configurations - -# -# Ethernet -# -CONFIG_ETH_ENABLED=y -CONFIG_ETH_USE_ESP32_EMAC=y -CONFIG_ETH_PHY_INTERFACE_RMII=y -CONFIG_ETH_RMII_CLK_INPUT=y -# CONFIG_ETH_RMII_CLK_OUTPUT is not set -CONFIG_ETH_RMII_CLK_IN_GPIO=0 -CONFIG_ETH_DMA_BUFFER_SIZE=1024 -CONFIG_ETH_DMA_RX_BUFFER_NUM=30 -CONFIG_ETH_DMA_TX_BUFFER_NUM=5 -# CONFIG_ETH_SOFT_FLOW_CONTROL is not set -# CONFIG_ETH_IRAM_OPTIMIZATION is not set -# CONFIG_ETH_USE_SPI_ETHERNET is not set -# CONFIG_ETH_USE_OPENETH is not set -# CONFIG_ETH_TRANSMIT_MUTEX is not set -# end of Ethernet - -# -# Event Loop Library -# -# CONFIG_ESP_EVENT_LOOP_PROFILING is not set -CONFIG_ESP_EVENT_POST_FROM_ISR=y -# CONFIG_ESP_EVENT_POST_FROM_IRAM_ISR is not set -# end of Event Loop Library - -# -# GDB Stub -# -CONFIG_ESP_GDBSTUB_ENABLED=y -# CONFIG_ESP_SYSTEM_GDBSTUB_RUNTIME is not set -CONFIG_ESP_GDBSTUB_SUPPORT_TASKS=y -CONFIG_ESP_GDBSTUB_MAX_TASKS=32 -# end of GDB Stub - -# -# ESP HID -# -CONFIG_ESPHID_TASK_SIZE_BT=2048 -CONFIG_ESPHID_TASK_SIZE_BLE=4096 -# end of ESP HID - -# -# ESP HTTP client -# -CONFIG_ESP_HTTP_CLIENT_ENABLE_HTTPS=y -# CONFIG_ESP_HTTP_CLIENT_ENABLE_BASIC_AUTH is not set -# CONFIG_ESP_HTTP_CLIENT_ENABLE_DIGEST_AUTH is not set -# CONFIG_ESP_HTTP_CLIENT_ENABLE_CUSTOM_TRANSPORT is not set -CONFIG_ESP_HTTP_CLIENT_EVENT_POST_TIMEOUT=2000 -# end of ESP HTTP client - -# -# HTTP Server -# -CONFIG_HTTPD_MAX_REQ_HDR_LEN=1024 -CONFIG_HTTPD_MAX_URI_LEN=512 -CONFIG_HTTPD_ERR_RESP_NO_DELAY=y -CONFIG_HTTPD_PURGE_BUF_LEN=32 -# CONFIG_HTTPD_LOG_PURGE_DATA is not set -# CONFIG_HTTPD_WS_SUPPORT is not set -# CONFIG_HTTPD_QUEUE_WORK_BLOCKING is not set -CONFIG_HTTPD_SERVER_EVENT_POST_TIMEOUT=2000 -# end of HTTP Server - -# -# ESP HTTPS OTA -# -# CONFIG_ESP_HTTPS_OTA_DECRYPT_CB is not set -# CONFIG_ESP_HTTPS_OTA_ALLOW_HTTP is not set -CONFIG_ESP_HTTPS_OTA_EVENT_POST_TIMEOUT=2000 -# end of ESP HTTPS OTA - -# -# ESP HTTPS server -# -# CONFIG_ESP_HTTPS_SERVER_ENABLE is not set -CONFIG_ESP_HTTPS_SERVER_EVENT_POST_TIMEOUT=2000 -# CONFIG_ESP_HTTPS_SERVER_CERT_SELECT_HOOK is not set -# end of ESP HTTPS server - -# -# Hardware Settings -# - -# -# Chip revision -# -CONFIG_ESP32_REV_MIN_0=y -# CONFIG_ESP32_REV_MIN_1 is not set -# CONFIG_ESP32_REV_MIN_1_1 is not set -# CONFIG_ESP32_REV_MIN_2 is not set -# CONFIG_ESP32_REV_MIN_3 is not set -# CONFIG_ESP32_REV_MIN_3_1 is not set -CONFIG_ESP32_REV_MIN=0 -CONFIG_ESP32_REV_MIN_FULL=0 -CONFIG_ESP_REV_MIN_FULL=0 - -# -# Maximum Supported ESP32 Revision (Rev v3.99) -# -CONFIG_ESP32_REV_MAX_FULL=399 -CONFIG_ESP_REV_MAX_FULL=399 -CONFIG_ESP_EFUSE_BLOCK_REV_MIN_FULL=0 -CONFIG_ESP_EFUSE_BLOCK_REV_MAX_FULL=99 - -# -# Maximum Supported ESP32 eFuse Block Revision (eFuse Block Rev v0.99) -# -# end of Chip revision - -# -# MAC Config -# -CONFIG_ESP_MAC_ADDR_UNIVERSE_WIFI_STA=y -CONFIG_ESP_MAC_ADDR_UNIVERSE_WIFI_AP=y -CONFIG_ESP_MAC_ADDR_UNIVERSE_BT=y -CONFIG_ESP_MAC_ADDR_UNIVERSE_ETH=y -CONFIG_ESP_MAC_UNIVERSAL_MAC_ADDRESSES_FOUR=y -CONFIG_ESP_MAC_UNIVERSAL_MAC_ADDRESSES=4 -# CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES_TWO is not set -CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES_FOUR=y -CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES=4 -# CONFIG_ESP_MAC_IGNORE_MAC_CRC_ERROR is not set -# CONFIG_ESP_MAC_USE_CUSTOM_MAC_AS_BASE_MAC is not set -# end of MAC Config - -# -# Sleep Config -# -CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND=y -CONFIG_ESP_SLEEP_PSRAM_LEAKAGE_WORKAROUND=y -# CONFIG_ESP_SLEEP_MSPI_NEED_ALL_IO_PU is not set -CONFIG_ESP_SLEEP_RTC_BUS_ISO_WORKAROUND=y -# CONFIG_ESP_SLEEP_GPIO_RESET_WORKAROUND is not set -CONFIG_ESP_SLEEP_WAIT_FLASH_READY_EXTRA_DELAY=2000 -# CONFIG_ESP_SLEEP_CACHE_SAFE_ASSERTION is not set -# CONFIG_ESP_SLEEP_DEBUG is not set -CONFIG_ESP_SLEEP_GPIO_ENABLE_INTERNAL_RESISTORS=y -# end of Sleep Config - -# -# RTC Clock Config -# -CONFIG_RTC_CLK_SRC_INT_RC=y -# CONFIG_RTC_CLK_SRC_EXT_CRYS is not set -# CONFIG_RTC_CLK_SRC_EXT_OSC is not set -# CONFIG_RTC_CLK_SRC_INT_8MD256 is not set -CONFIG_RTC_CLK_CAL_CYCLES=1024 -# end of RTC Clock Config - -# -# Peripheral Control -# -CONFIG_ESP_PERIPH_CTRL_FUNC_IN_IRAM=y -CONFIG_ESP_REGI2C_CTRL_FUNC_IN_IRAM=y -# end of Peripheral Control - -# -# Main XTAL Config -# -# CONFIG_XTAL_FREQ_26 is not set -# CONFIG_XTAL_FREQ_32 is not set -CONFIG_XTAL_FREQ_40=y -# CONFIG_XTAL_FREQ_AUTO is not set -CONFIG_XTAL_FREQ=40 -# end of Main XTAL Config - -# -# Power Supplier -# - -# -# Brownout Detector -# -CONFIG_ESP_BROWNOUT_DET=y -# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_0 is not set -# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_1 is not set -# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_2 is not set -# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_3 is not set -CONFIG_ESP_BROWNOUT_DET_LVL_SEL_4=y -# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_5 is not set -# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_6 is not set -# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_7 is not set -CONFIG_ESP_BROWNOUT_DET_LVL=4 -CONFIG_ESP_BROWNOUT_USE_INTR=y -# end of Brownout Detector -# end of Power Supplier - -CONFIG_ESP_SPI_BUS_LOCK_ISR_FUNCS_IN_IRAM=y -CONFIG_ESP_INTR_IN_IRAM=y -# end of Hardware Settings - -# -# ESP-Driver:LCD Controller Configurations -# -# CONFIG_LCD_ENABLE_DEBUG_LOG is not set -# end of ESP-Driver:LCD Controller Configurations - -# -# ESP-MM: Memory Management Configurations -# -# end of ESP-MM: Memory Management Configurations - -# -# ESP NETIF Adapter -# -CONFIG_ESP_NETIF_IP_LOST_TIMER_INTERVAL=120 -# CONFIG_ESP_NETIF_PROVIDE_CUSTOM_IMPLEMENTATION is not set -CONFIG_ESP_NETIF_TCPIP_LWIP=y -# CONFIG_ESP_NETIF_LOOPBACK is not set -CONFIG_ESP_NETIF_USES_TCPIP_WITH_BSD_API=y -CONFIG_ESP_NETIF_REPORT_DATA_TRAFFIC=y -# CONFIG_ESP_NETIF_RECEIVE_REPORT_ERRORS is not set -# CONFIG_ESP_NETIF_L2_TAP is not set -# CONFIG_ESP_NETIF_BRIDGE_EN is not set -# CONFIG_ESP_NETIF_SET_DNS_PER_DEFAULT_NETIF is not set -# end of ESP NETIF Adapter - -# -# Partition API Configuration -# -# end of Partition API Configuration - -# -# PHY -# -CONFIG_ESP_PHY_ENABLED=y -CONFIG_ESP_PHY_CALIBRATION_AND_DATA_STORAGE=y -# CONFIG_ESP_PHY_INIT_DATA_IN_PARTITION is not set -CONFIG_ESP_PHY_MAX_WIFI_TX_POWER=20 -CONFIG_ESP_PHY_MAX_TX_POWER=20 -CONFIG_ESP_PHY_REDUCE_TX_POWER=y -# CONFIG_ESP_PHY_ENABLE_CERT_TEST is not set -CONFIG_ESP_PHY_RF_CAL_PARTIAL=y -# CONFIG_ESP_PHY_RF_CAL_NONE is not set -# CONFIG_ESP_PHY_RF_CAL_FULL is not set -CONFIG_ESP_PHY_CALIBRATION_MODE=0 -CONFIG_ESP_PHY_PLL_TRACK_PERIOD_MS=1000 -# CONFIG_ESP_PHY_PLL_TRACK_DEBUG is not set -# CONFIG_ESP_PHY_RECORD_USED_TIME is not set -CONFIG_ESP_PHY_IRAM_OPT=y -# CONFIG_ESP_PHY_DEBUG is not set -# end of PHY - -# -# Power Management -# -CONFIG_PM_SLEEP_FUNC_IN_IRAM=y -# CONFIG_PM_ENABLE is not set -CONFIG_PM_SLP_IRAM_OPT=y -# end of Power Management - -# -# ESP PSRAM -# -CONFIG_SPIRAM=y - -# -# SPI RAM config -# -CONFIG_SPIRAM_MODE_QUAD=y -CONFIG_SPIRAM_TYPE_AUTO=y -# CONFIG_SPIRAM_TYPE_ESPPSRAM16 is not set -# CONFIG_SPIRAM_TYPE_ESPPSRAM32 is not set -# CONFIG_SPIRAM_TYPE_ESPPSRAM64 is not set -# CONFIG_SPIRAM_SPEED_40M is not set -CONFIG_SPIRAM_SPEED_80M=y -CONFIG_SPIRAM_SPEED=80 -CONFIG_SPIRAM_BOOT_HW_INIT=y -CONFIG_SPIRAM_BOOT_INIT=y -CONFIG_SPIRAM_PRE_CONFIGURE_MEMORY_PROTECTION=y -# CONFIG_SPIRAM_IGNORE_NOTFOUND is not set -# CONFIG_SPIRAM_USE_MEMMAP is not set -# CONFIG_SPIRAM_USE_CAPS_ALLOC is not set -CONFIG_SPIRAM_USE_MALLOC=y -CONFIG_SPIRAM_MEMTEST=y -CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=16384 -# CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP is not set -CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=32768 -# CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set -# CONFIG_SPIRAM_ALLOW_NOINIT_SEG_EXTERNAL_MEMORY is not set -CONFIG_SPIRAM_CACHE_WORKAROUND=y - -# -# SPIRAM cache workaround debugging -# -CONFIG_SPIRAM_CACHE_WORKAROUND_STRATEGY_MEMW=y -# CONFIG_SPIRAM_CACHE_WORKAROUND_STRATEGY_DUPLDST is not set -# CONFIG_SPIRAM_CACHE_WORKAROUND_STRATEGY_NOPS is not set -# end of SPIRAM cache workaround debugging - -# -# SPIRAM workaround libraries placement -# -CONFIG_SPIRAM_CACHE_LIBJMP_IN_IRAM=y -CONFIG_SPIRAM_CACHE_LIBMATH_IN_IRAM=y -CONFIG_SPIRAM_CACHE_LIBNUMPARSER_IN_IRAM=y -CONFIG_SPIRAM_CACHE_LIBIO_IN_IRAM=y -CONFIG_SPIRAM_CACHE_LIBTIME_IN_IRAM=y -CONFIG_SPIRAM_CACHE_LIBCHAR_IN_IRAM=y -CONFIG_SPIRAM_CACHE_LIBMEM_IN_IRAM=y -CONFIG_SPIRAM_CACHE_LIBSTR_IN_IRAM=y -CONFIG_SPIRAM_CACHE_LIBRAND_IN_IRAM=y -CONFIG_SPIRAM_CACHE_LIBENV_IN_IRAM=y -CONFIG_SPIRAM_CACHE_LIBFILE_IN_IRAM=y -CONFIG_SPIRAM_CACHE_LIBMISC_IN_IRAM=y -# end of SPIRAM workaround libraries placement - -CONFIG_SPIRAM_BANKSWITCH_ENABLE=y -CONFIG_SPIRAM_BANKSWITCH_RESERVE=8 -# CONFIG_SPIRAM_OCCUPY_HSPI_HOST is not set -CONFIG_SPIRAM_OCCUPY_VSPI_HOST=y -# CONFIG_SPIRAM_OCCUPY_NO_HOST is not set - -# -# PSRAM clock and cs IO for ESP32-DOWD -# -CONFIG_D0WD_PSRAM_CLK_IO=17 -CONFIG_D0WD_PSRAM_CS_IO=16 -# end of PSRAM clock and cs IO for ESP32-DOWD - -# -# PSRAM clock and cs IO for ESP32-D2WD -# -CONFIG_D2WD_PSRAM_CLK_IO=9 -CONFIG_D2WD_PSRAM_CS_IO=10 -# end of PSRAM clock and cs IO for ESP32-D2WD - -# -# PSRAM clock and cs IO for ESP32-PICO-D4 -# -CONFIG_PICO_PSRAM_CS_IO=10 -# end of PSRAM clock and cs IO for ESP32-PICO-D4 - -# CONFIG_SPIRAM_2T_MODE is not set -# end of SPI RAM config -# end of ESP PSRAM - -# -# ESP Ringbuf -# -# CONFIG_RINGBUF_PLACE_FUNCTIONS_INTO_FLASH is not set -# end of ESP Ringbuf - -# -# ESP-ROM -# -CONFIG_ESP_ROM_PRINT_IN_IRAM=y -# end of ESP-ROM - -# -# ESP Security Specific -# -# end of ESP Security Specific - -# -# ESP System Settings -# -# CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_80 is not set -# CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_160 is not set -CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y -CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ=240 - -# -# Memory -# -# CONFIG_ESP32_USE_FIXED_STATIC_RAM_SIZE is not set - -# -# Non-backward compatible options -# -# CONFIG_ESP_SYSTEM_ESP32_SRAM1_REGION_AS_IRAM is not set -# end of Non-backward compatible options -# end of Memory - -# -# Trace memory -# -# CONFIG_ESP32_TRAX is not set -CONFIG_ESP32_TRACEMEM_RESERVE_DRAM=0x0 -# end of Trace memory - -CONFIG_ESP_SYSTEM_IN_IRAM=y -# CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT is not set -CONFIG_ESP_SYSTEM_PANIC_PRINT_REBOOT=y -# CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT is not set -# CONFIG_ESP_SYSTEM_PANIC_GDBSTUB is not set -CONFIG_ESP_SYSTEM_PANIC_REBOOT_DELAY_SECONDS=0 - -# -# Memory protection -# -# end of Memory protection - -CONFIG_ESP_SYSTEM_EVENT_QUEUE_SIZE=32 -CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=2304 -CONFIG_ESP_MAIN_TASK_STACK_SIZE=2560 -CONFIG_ESP_MAIN_TASK_AFFINITY_CPU0=y -# CONFIG_ESP_MAIN_TASK_AFFINITY_CPU1 is not set -# CONFIG_ESP_MAIN_TASK_AFFINITY_NO_AFFINITY is not set -CONFIG_ESP_MAIN_TASK_AFFINITY=0x0 -CONFIG_ESP_MINIMAL_SHARED_STACK_SIZE=2048 -CONFIG_ESP_CONSOLE_UART_DEFAULT=y -# CONFIG_ESP_CONSOLE_UART_CUSTOM is not set -# CONFIG_ESP_CONSOLE_NONE is not set -CONFIG_ESP_CONSOLE_UART=y -CONFIG_ESP_CONSOLE_UART_NUM=0 -CONFIG_ESP_CONSOLE_ROM_SERIAL_PORT_NUM=0 -CONFIG_ESP_CONSOLE_UART_BAUDRATE=115200 -CONFIG_ESP_INT_WDT=y -CONFIG_ESP_INT_WDT_TIMEOUT_MS=300 -CONFIG_ESP_INT_WDT_CHECK_CPU1=y -CONFIG_ESP_TASK_WDT_EN=y -CONFIG_ESP_TASK_WDT_INIT=y -# CONFIG_ESP_TASK_WDT_PANIC is not set -CONFIG_ESP_TASK_WDT_TIMEOUT_S=5 -CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0=y -CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU1=y -# CONFIG_ESP_PANIC_HANDLER_IRAM is not set -# CONFIG_ESP_DEBUG_STUBS_ENABLE is not set -CONFIG_ESP_DEBUG_OCDAWARE=y -# CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_5 is not set -CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_4=y -# CONFIG_ESP32_DISABLE_BASIC_ROM_CONSOLE is not set -CONFIG_ESP32_ECO3_CACHE_LOCK_FIX=y -# end of ESP System Settings - -# -# IPC (Inter-Processor Call) -# -CONFIG_ESP_IPC_ENABLE=y -CONFIG_ESP_IPC_TASK_STACK_SIZE=1024 -CONFIG_ESP_IPC_USES_CALLERS_PRIORITY=y -CONFIG_ESP_IPC_ISR_ENABLE=y -# end of IPC (Inter-Processor Call) - -# -# ESP Timer (High Resolution Timer) -# -CONFIG_ESP_TIMER_IN_IRAM=y -# CONFIG_ESP_TIMER_PROFILING is not set -CONFIG_ESP_TIME_FUNCS_USE_RTC_TIMER=y -CONFIG_ESP_TIME_FUNCS_USE_ESP_TIMER=y -CONFIG_ESP_TIMER_TASK_STACK_SIZE=2048 -CONFIG_ESP_TIMER_INTERRUPT_LEVEL=1 -# CONFIG_ESP_TIMER_SHOW_EXPERIMENTAL is not set -CONFIG_ESP_TIMER_TASK_AFFINITY=0x0 -CONFIG_ESP_TIMER_TASK_AFFINITY_CPU0=y -CONFIG_ESP_TIMER_ISR_AFFINITY_CPU0=y -# CONFIG_ESP_TIMER_SUPPORTS_ISR_DISPATCH_METHOD is not set -CONFIG_ESP_TIMER_IMPL_TG0_LAC=y -# end of ESP Timer (High Resolution Timer) - -# -# Wi-Fi -# -CONFIG_ESP_WIFI_ENABLED=y -CONFIG_ESP_WIFI_STATIC_RX_BUFFER_NUM=8 -CONFIG_ESP_WIFI_DYNAMIC_RX_BUFFER_NUM=64 -CONFIG_ESP_WIFI_STATIC_TX_BUFFER=y -# CONFIG_ESP_WIFI_DYNAMIC_TX_BUFFER is not set -CONFIG_ESP_WIFI_TX_BUFFER_TYPE=0 -CONFIG_ESP_WIFI_STATIC_TX_BUFFER_NUM=8 -CONFIG_ESP_WIFI_STATIC_RX_MGMT_BUFFER=y -# CONFIG_ESP_WIFI_DYNAMIC_RX_MGMT_BUFFER is not set -CONFIG_ESP_WIFI_DYNAMIC_RX_MGMT_BUF=0 -CONFIG_ESP_WIFI_RX_MGMT_BUF_NUM_DEF=5 -# CONFIG_ESP_WIFI_CSI_ENABLED is not set -CONFIG_ESP_WIFI_AMPDU_TX_ENABLED=y -CONFIG_ESP_WIFI_TX_BA_WIN=8 -CONFIG_ESP_WIFI_AMPDU_RX_ENABLED=y -CONFIG_ESP_WIFI_RX_BA_WIN=16 -CONFIG_ESP_WIFI_NVS_ENABLED=y -CONFIG_ESP_WIFI_TASK_PINNED_TO_CORE_0=y -# CONFIG_ESP_WIFI_TASK_PINNED_TO_CORE_1 is not set -CONFIG_ESP_WIFI_SOFTAP_BEACON_MAX_LEN=752 -CONFIG_ESP_WIFI_MGMT_SBUF_NUM=32 -# CONFIG_ESP_WIFI_IRAM_OPT is not set -# CONFIG_ESP_WIFI_EXTRA_IRAM_OPT is not set -CONFIG_ESP_WIFI_RX_IRAM_OPT=y -CONFIG_ESP_WIFI_ENABLE_WPA3_SAE=y -CONFIG_ESP_WIFI_ENABLE_SAE_PK=y -CONFIG_ESP_WIFI_ENABLE_SAE_H2E=y -CONFIG_ESP_WIFI_SOFTAP_SAE_SUPPORT=y -CONFIG_ESP_WIFI_ENABLE_WPA3_OWE_STA=y -# CONFIG_ESP_WIFI_SLP_IRAM_OPT is not set -CONFIG_ESP_WIFI_SLP_DEFAULT_MIN_ACTIVE_TIME=50 -# CONFIG_ESP_WIFI_BSS_MAX_IDLE_SUPPORT is not set -CONFIG_ESP_WIFI_SLP_DEFAULT_MAX_ACTIVE_TIME=10 -CONFIG_ESP_WIFI_SLP_DEFAULT_WAIT_BROADCAST_DATA_TIME=15 -# CONFIG_ESP_WIFI_STA_DISCONNECTED_PM_ENABLE is not set -# CONFIG_ESP_WIFI_GMAC_SUPPORT is not set -CONFIG_ESP_WIFI_SOFTAP_SUPPORT=y -# CONFIG_ESP_WIFI_SLP_BEACON_LOST_OPT is not set -CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM=7 -# CONFIG_ESP_WIFI_NAN_ENABLE is not set -CONFIG_ESP_WIFI_MBEDTLS_CRYPTO=y -CONFIG_ESP_WIFI_MBEDTLS_TLS_CLIENT=y -# CONFIG_ESP_WIFI_WAPI_PSK is not set -# CONFIG_ESP_WIFI_11KV_SUPPORT is not set -# CONFIG_ESP_WIFI_MBO_SUPPORT is not set -# CONFIG_ESP_WIFI_DPP_SUPPORT is not set -# CONFIG_ESP_WIFI_11R_SUPPORT is not set -# CONFIG_ESP_WIFI_WPS_SOFTAP_REGISTRAR is not set - -# -# WPS Configuration Options -# -# CONFIG_ESP_WIFI_WPS_STRICT is not set -# CONFIG_ESP_WIFI_WPS_PASSPHRASE is not set -# end of WPS Configuration Options - -# CONFIG_ESP_WIFI_DEBUG_PRINT is not set -# CONFIG_ESP_WIFI_TESTING_OPTIONS is not set -CONFIG_ESP_WIFI_ENTERPRISE_SUPPORT=y -# CONFIG_ESP_WIFI_ENT_FREE_DYNAMIC_BUFFER is not set -# end of Wi-Fi - -# -# Core dump -# -# CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH is not set -# CONFIG_ESP_COREDUMP_ENABLE_TO_UART is not set -CONFIG_ESP_COREDUMP_ENABLE_TO_NONE=y -# end of Core dump - -# -# FAT Filesystem support -# -CONFIG_FATFS_VOLUME_COUNT=2 -CONFIG_FATFS_LFN_NONE=y -# CONFIG_FATFS_LFN_HEAP is not set -# CONFIG_FATFS_LFN_STACK is not set -# CONFIG_FATFS_SECTOR_512 is not set -CONFIG_FATFS_SECTOR_4096=y -# CONFIG_FATFS_CODEPAGE_DYNAMIC is not set -CONFIG_FATFS_CODEPAGE_437=y -# CONFIG_FATFS_CODEPAGE_720 is not set -# CONFIG_FATFS_CODEPAGE_737 is not set -# CONFIG_FATFS_CODEPAGE_771 is not set -# CONFIG_FATFS_CODEPAGE_775 is not set -# CONFIG_FATFS_CODEPAGE_850 is not set -# CONFIG_FATFS_CODEPAGE_852 is not set -# CONFIG_FATFS_CODEPAGE_855 is not set -# CONFIG_FATFS_CODEPAGE_857 is not set -# CONFIG_FATFS_CODEPAGE_860 is not set -# CONFIG_FATFS_CODEPAGE_861 is not set -# CONFIG_FATFS_CODEPAGE_862 is not set -# CONFIG_FATFS_CODEPAGE_863 is not set -# CONFIG_FATFS_CODEPAGE_864 is not set -# CONFIG_FATFS_CODEPAGE_865 is not set -# CONFIG_FATFS_CODEPAGE_866 is not set -# CONFIG_FATFS_CODEPAGE_869 is not set -# CONFIG_FATFS_CODEPAGE_932 is not set -# CONFIG_FATFS_CODEPAGE_936 is not set -# CONFIG_FATFS_CODEPAGE_949 is not set -# CONFIG_FATFS_CODEPAGE_950 is not set -CONFIG_FATFS_CODEPAGE=437 -CONFIG_FATFS_FS_LOCK=0 -CONFIG_FATFS_TIMEOUT_MS=10000 -CONFIG_FATFS_PER_FILE_CACHE=y -CONFIG_FATFS_ALLOC_PREFER_EXTRAM=y -# CONFIG_FATFS_USE_FASTSEEK is not set -CONFIG_FATFS_USE_STRFUNC_NONE=y -# CONFIG_FATFS_USE_STRFUNC_WITHOUT_CRLF_CONV is not set -# CONFIG_FATFS_USE_STRFUNC_WITH_CRLF_CONV is not set -CONFIG_FATFS_VFS_FSTAT_BLKSIZE=0 -# CONFIG_FATFS_IMMEDIATE_FSYNC is not set -# CONFIG_FATFS_USE_LABEL is not set -CONFIG_FATFS_LINK_LOCK=y -# CONFIG_FATFS_USE_DYN_BUFFERS is not set - -# -# File system free space calculation behavior -# -CONFIG_FATFS_DONT_TRUST_FREE_CLUSTER_CNT=0 -CONFIG_FATFS_DONT_TRUST_LAST_ALLOC=0 -# end of File system free space calculation behavior -# end of FAT Filesystem support - -# -# FreeRTOS -# - -# -# Kernel -# -# CONFIG_FREERTOS_SMP is not set -# CONFIG_FREERTOS_UNICORE is not set -CONFIG_FREERTOS_HZ=1000 -# CONFIG_FREERTOS_CHECK_STACKOVERFLOW_NONE is not set -# CONFIG_FREERTOS_CHECK_STACKOVERFLOW_PTRVAL is not set -CONFIG_FREERTOS_CHECK_STACKOVERFLOW_CANARY=y -CONFIG_FREERTOS_THREAD_LOCAL_STORAGE_POINTERS=1 -CONFIG_FREERTOS_IDLE_TASK_STACKSIZE=768 -# CONFIG_FREERTOS_USE_IDLE_HOOK is not set -# CONFIG_FREERTOS_USE_TICK_HOOK is not set -CONFIG_FREERTOS_MAX_TASK_NAME_LEN=10 -CONFIG_FREERTOS_ENABLE_BACKWARD_COMPATIBILITY=y -CONFIG_FREERTOS_USE_TIMERS=y -CONFIG_FREERTOS_TIMER_SERVICE_TASK_NAME="Tmr Svc" -# CONFIG_FREERTOS_TIMER_TASK_AFFINITY_CPU0 is not set -# CONFIG_FREERTOS_TIMER_TASK_AFFINITY_CPU1 is not set -CONFIG_FREERTOS_TIMER_TASK_NO_AFFINITY=y -CONFIG_FREERTOS_TIMER_SERVICE_TASK_CORE_AFFINITY=0x7FFFFFFF -CONFIG_FREERTOS_TIMER_TASK_PRIORITY=1 -CONFIG_FREERTOS_TIMER_TASK_STACK_DEPTH=1536 -CONFIG_FREERTOS_TIMER_QUEUE_LENGTH=5 -CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE=0 -CONFIG_FREERTOS_TASK_NOTIFICATION_ARRAY_ENTRIES=1 -# CONFIG_FREERTOS_USE_TRACE_FACILITY is not set -# CONFIG_FREERTOS_USE_LIST_DATA_INTEGRITY_CHECK_BYTES is not set -# CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS is not set -# CONFIG_FREERTOS_USE_APPLICATION_TASK_TAG is not set -# end of Kernel - -# -# Port -# -# CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK is not set -CONFIG_FREERTOS_TLSP_DELETION_CALLBACKS=y -# CONFIG_FREERTOS_TASK_PRE_DELETION_HOOK is not set -# CONFIG_FREERTOS_ENABLE_STATIC_TASK_CLEAN_UP is not set -CONFIG_FREERTOS_CHECK_MUTEX_GIVEN_BY_OWNER=y -CONFIG_FREERTOS_ISR_STACKSIZE=1536 -CONFIG_FREERTOS_INTERRUPT_BACKTRACE=y -# CONFIG_FREERTOS_FPU_IN_ISR is not set -CONFIG_FREERTOS_TICK_SUPPORT_CORETIMER=y -CONFIG_FREERTOS_CORETIMER_0=y -# CONFIG_FREERTOS_CORETIMER_1 is not set -CONFIG_FREERTOS_SYSTICK_USES_CCOUNT=y -CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH=y -# CONFIG_FREERTOS_CHECK_PORT_CRITICAL_COMPLIANCE is not set -# end of Port - -# -# Extra -# -# CONFIG_FREERTOS_TASK_CREATE_ALLOW_EXT_MEM is not set -# end of Extra - -CONFIG_FREERTOS_PORT=y -CONFIG_FREERTOS_NO_AFFINITY=0x7FFFFFFF -CONFIG_FREERTOS_SUPPORT_STATIC_ALLOCATION=y -CONFIG_FREERTOS_DEBUG_OCDAWARE=y -CONFIG_FREERTOS_ENABLE_TASK_SNAPSHOT=y -CONFIG_FREERTOS_PLACE_SNAPSHOT_FUNS_INTO_FLASH=y -CONFIG_FREERTOS_NUMBER_OF_CORES=2 -CONFIG_FREERTOS_IN_IRAM=y -# end of FreeRTOS - -# -# Hardware Abstraction Layer (HAL) and Low Level (LL) -# -CONFIG_HAL_ASSERTION_EQUALS_SYSTEM=y -# CONFIG_HAL_ASSERTION_DISABLE is not set -# CONFIG_HAL_ASSERTION_SILENT is not set -# CONFIG_HAL_ASSERTION_ENABLE is not set -CONFIG_HAL_DEFAULT_ASSERTION_LEVEL=2 -# end of Hardware Abstraction Layer (HAL) and Low Level (LL) - -# -# Heap memory debugging -# -CONFIG_HEAP_POISONING_DISABLED=y -# CONFIG_HEAP_POISONING_LIGHT is not set -# CONFIG_HEAP_POISONING_COMPREHENSIVE is not set -CONFIG_HEAP_TRACING_OFF=y -# CONFIG_HEAP_TRACING_STANDALONE is not set -# CONFIG_HEAP_TRACING_TOHOST is not set -# CONFIG_HEAP_USE_HOOKS is not set -# CONFIG_HEAP_TASK_TRACKING is not set -# CONFIG_HEAP_ABORT_WHEN_ALLOCATION_FAILS is not set -# CONFIG_HEAP_PLACE_FUNCTION_INTO_FLASH is not set -# end of Heap memory debugging - -# -# Log -# -CONFIG_LOG_VERSION_1=y -# CONFIG_LOG_VERSION_2 is not set -CONFIG_LOG_VERSION=1 - -# -# Log Level -# -# CONFIG_LOG_DEFAULT_LEVEL_NONE is not set -# CONFIG_LOG_DEFAULT_LEVEL_ERROR is not set -# CONFIG_LOG_DEFAULT_LEVEL_WARN is not set -# CONFIG_LOG_DEFAULT_LEVEL_INFO is not set -CONFIG_LOG_DEFAULT_LEVEL_DEBUG=y -# CONFIG_LOG_DEFAULT_LEVEL_VERBOSE is not set -CONFIG_LOG_DEFAULT_LEVEL=4 -CONFIG_LOG_MAXIMUM_EQUALS_DEFAULT=y -# CONFIG_LOG_MAXIMUM_LEVEL_VERBOSE is not set -CONFIG_LOG_MAXIMUM_LEVEL=4 - -# -# Level Settings -# -# CONFIG_LOG_MASTER_LEVEL is not set -CONFIG_LOG_DYNAMIC_LEVEL_CONTROL=y -# CONFIG_LOG_TAG_LEVEL_IMPL_NONE is not set -# CONFIG_LOG_TAG_LEVEL_IMPL_LINKED_LIST is not set -CONFIG_LOG_TAG_LEVEL_IMPL_CACHE_AND_LINKED_LIST=y -# CONFIG_LOG_TAG_LEVEL_CACHE_ARRAY is not set -CONFIG_LOG_TAG_LEVEL_CACHE_BINARY_MIN_HEAP=y -CONFIG_LOG_TAG_LEVEL_IMPL_CACHE_SIZE=31 -# end of Level Settings -# end of Log Level - -# -# Format -# -CONFIG_LOG_COLORS=y -CONFIG_LOG_TIMESTAMP_SOURCE_RTOS=y -# CONFIG_LOG_TIMESTAMP_SOURCE_SYSTEM is not set -# end of Format - -# -# Settings -# -CONFIG_LOG_MODE_TEXT_EN=y -CONFIG_LOG_MODE_TEXT=y -# end of Settings - -CONFIG_LOG_IN_IRAM=y -# end of Log - -# -# LWIP -# -CONFIG_LWIP_ENABLE=y -CONFIG_LWIP_LOCAL_HOSTNAME="espressif" -CONFIG_LWIP_TCPIP_TASK_PRIO=18 -# CONFIG_LWIP_TCPIP_CORE_LOCKING is not set -# CONFIG_LWIP_CHECK_THREAD_SAFETY is not set -CONFIG_LWIP_DNS_SUPPORT_MDNS_QUERIES=y -# CONFIG_LWIP_L2_TO_L3_COPY is not set -# CONFIG_LWIP_IRAM_OPTIMIZATION is not set -# CONFIG_LWIP_EXTRA_IRAM_OPTIMIZATION is not set -CONFIG_LWIP_TIMERS_ONDEMAND=y -CONFIG_LWIP_ND6=y -# CONFIG_LWIP_FORCE_ROUTER_FORWARDING is not set -CONFIG_LWIP_MAX_SOCKETS=10 -# CONFIG_LWIP_USE_ONLY_LWIP_SELECT is not set -# CONFIG_LWIP_SO_LINGER is not set -CONFIG_LWIP_SO_REUSE=y -# CONFIG_LWIP_SO_REUSE_RXTOALL is not set -# CONFIG_LWIP_SO_RCVBUF is not set -# CONFIG_LWIP_NETBUF_RECVINFO is not set -CONFIG_LWIP_IP_DEFAULT_TTL=64 -CONFIG_LWIP_IP4_FRAG=y -CONFIG_LWIP_IP6_FRAG=y -# CONFIG_LWIP_IP4_REASSEMBLY is not set -# CONFIG_LWIP_IP6_REASSEMBLY is not set -CONFIG_LWIP_IP_REASS_MAX_PBUFS=10 -# CONFIG_LWIP_IP_FORWARD is not set -# CONFIG_LWIP_STATS is not set -CONFIG_LWIP_ESP_GRATUITOUS_ARP=y -CONFIG_LWIP_GARP_TMR_INTERVAL=60 -CONFIG_LWIP_ESP_MLDV6_REPORT=y -CONFIG_LWIP_MLDV6_TMR_INTERVAL=40 -CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=32 -CONFIG_LWIP_DHCP_DOES_ARP_CHECK=y -# CONFIG_LWIP_DHCP_DOES_ACD_CHECK is not set -# CONFIG_LWIP_DHCP_DOES_NOT_CHECK_OFFERED_IP is not set -# CONFIG_LWIP_DHCP_DISABLE_CLIENT_ID is not set -CONFIG_LWIP_DHCP_DISABLE_VENDOR_CLASS_ID=y -# CONFIG_LWIP_DHCP_RESTORE_LAST_IP is not set -CONFIG_LWIP_DHCP_OPTIONS_LEN=69 -CONFIG_LWIP_NUM_NETIF_CLIENT_DATA=0 -CONFIG_LWIP_DHCP_COARSE_TIMER_SECS=1 - -# -# DHCP server -# -CONFIG_LWIP_DHCPS=y -CONFIG_LWIP_DHCPS_LEASE_UNIT=60 -CONFIG_LWIP_DHCPS_MAX_STATION_NUM=8 -CONFIG_LWIP_DHCPS_STATIC_ENTRIES=y -CONFIG_LWIP_DHCPS_ADD_DNS=y -# end of DHCP server - -# CONFIG_LWIP_AUTOIP is not set -CONFIG_LWIP_IPV4=y -CONFIG_LWIP_IPV6=y -# CONFIG_LWIP_IPV6_AUTOCONFIG is not set -CONFIG_LWIP_IPV6_NUM_ADDRESSES=3 -# CONFIG_LWIP_IPV6_FORWARD is not set -# CONFIG_LWIP_NETIF_STATUS_CALLBACK is not set -CONFIG_LWIP_NETIF_LOOPBACK=y -CONFIG_LWIP_LOOPBACK_MAX_PBUFS=8 - -# -# TCP -# -CONFIG_LWIP_MAX_ACTIVE_TCP=6 -CONFIG_LWIP_MAX_LISTENING_TCP=6 -CONFIG_LWIP_TCP_HIGH_SPEED_RETRANSMISSION=y -CONFIG_LWIP_TCP_MAXRTX=12 -CONFIG_LWIP_TCP_SYNMAXRTX=12 -CONFIG_LWIP_TCP_MSS=1460 -CONFIG_LWIP_TCP_TMR_INTERVAL=250 -CONFIG_LWIP_TCP_MSL=60000 -CONFIG_LWIP_TCP_FIN_WAIT_TIMEOUT=20000 -CONFIG_LWIP_TCP_SND_BUF_DEFAULT=11680 -CONFIG_LWIP_TCP_WND_DEFAULT=11680 -CONFIG_LWIP_TCP_RECVMBOX_SIZE=10 -CONFIG_LWIP_TCP_ACCEPTMBOX_SIZE=6 -CONFIG_LWIP_TCP_QUEUE_OOSEQ=y -CONFIG_LWIP_TCP_OOSEQ_TIMEOUT=6 -CONFIG_LWIP_TCP_OOSEQ_MAX_PBUFS=4 -CONFIG_LWIP_TCP_SACK_OUT=y -CONFIG_LWIP_TCP_OVERSIZE_MSS=y -# CONFIG_LWIP_TCP_OVERSIZE_QUARTER_MSS is not set -# CONFIG_LWIP_TCP_OVERSIZE_DISABLE is not set -CONFIG_LWIP_TCP_RTO_TIME=1500 -# end of TCP - -# -# UDP -# -CONFIG_LWIP_MAX_UDP_PCBS=1 -CONFIG_LWIP_UDP_RECVMBOX_SIZE=6 -# end of UDP - -# -# Checksums -# -# CONFIG_LWIP_CHECKSUM_CHECK_IP is not set -# CONFIG_LWIP_CHECKSUM_CHECK_UDP is not set -CONFIG_LWIP_CHECKSUM_CHECK_ICMP=y -# end of Checksums - -CONFIG_LWIP_TCPIP_TASK_STACK_SIZE=3072 -# CONFIG_LWIP_TCPIP_TASK_AFFINITY_NO_AFFINITY is not set -CONFIG_LWIP_TCPIP_TASK_AFFINITY_CPU0=y -# CONFIG_LWIP_TCPIP_TASK_AFFINITY_CPU1 is not set -CONFIG_LWIP_TCPIP_TASK_AFFINITY=0x0 -CONFIG_LWIP_IPV6_MEMP_NUM_ND6_QUEUE=3 -CONFIG_LWIP_IPV6_ND6_NUM_NEIGHBORS=5 -CONFIG_LWIP_IPV6_ND6_NUM_PREFIXES=5 -CONFIG_LWIP_IPV6_ND6_NUM_ROUTERS=3 -CONFIG_LWIP_IPV6_ND6_NUM_DESTINATIONS=10 -# CONFIG_LWIP_PPP_SUPPORT is not set -# CONFIG_LWIP_SLIP_SUPPORT is not set - -# -# ICMP -# -CONFIG_LWIP_ICMP=y -# CONFIG_LWIP_MULTICAST_PING is not set -# CONFIG_LWIP_BROADCAST_PING is not set -# end of ICMP - -# -# LWIP RAW API -# -CONFIG_LWIP_MAX_RAW_PCBS=16 -# end of LWIP RAW API - -# -# SNTP -# -CONFIG_LWIP_SNTP_MAX_SERVERS=1 -# CONFIG_LWIP_DHCP_GET_NTP_SRV is not set -CONFIG_LWIP_SNTP_UPDATE_DELAY=3600000 -CONFIG_LWIP_SNTP_STARTUP_DELAY=y -CONFIG_LWIP_SNTP_MAXIMUM_STARTUP_DELAY=5000 -# end of SNTP - -# -# DNS -# -CONFIG_LWIP_DNS_MAX_HOST_IP=1 -CONFIG_LWIP_DNS_MAX_SERVERS=3 -# CONFIG_LWIP_FALLBACK_DNS_SERVER_SUPPORT is not set -# CONFIG_LWIP_DNS_SETSERVER_WITH_NETIF is not set -# CONFIG_LWIP_USE_ESP_GETADDRINFO is not set -# end of DNS - -CONFIG_LWIP_BRIDGEIF_MAX_PORTS=7 -CONFIG_LWIP_ESP_LWIP_ASSERT=y - -# -# Hooks -# -# CONFIG_LWIP_HOOK_TCP_ISN_NONE is not set -CONFIG_LWIP_HOOK_TCP_ISN_DEFAULT=y -# CONFIG_LWIP_HOOK_TCP_ISN_CUSTOM is not set -CONFIG_LWIP_HOOK_IP6_ROUTE_NONE=y -# CONFIG_LWIP_HOOK_IP6_ROUTE_DEFAULT is not set -# CONFIG_LWIP_HOOK_IP6_ROUTE_CUSTOM is not set -CONFIG_LWIP_HOOK_ND6_GET_GW_NONE=y -# CONFIG_LWIP_HOOK_ND6_GET_GW_DEFAULT is not set -# CONFIG_LWIP_HOOK_ND6_GET_GW_CUSTOM is not set -CONFIG_LWIP_HOOK_IP6_SELECT_SRC_ADDR_NONE=y -# CONFIG_LWIP_HOOK_IP6_SELECT_SRC_ADDR_DEFAULT is not set -# CONFIG_LWIP_HOOK_IP6_SELECT_SRC_ADDR_CUSTOM is not set -CONFIG_LWIP_HOOK_DHCP_EXTRA_OPTION_NONE=y -# CONFIG_LWIP_HOOK_DHCP_EXTRA_OPTION_DEFAULT is not set -# CONFIG_LWIP_HOOK_DHCP_EXTRA_OPTION_CUSTOM is not set -CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_NONE=y -# CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_DEFAULT is not set -# CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_CUSTOM is not set -CONFIG_LWIP_HOOK_DNS_EXT_RESOLVE_NONE=y -# CONFIG_LWIP_HOOK_DNS_EXT_RESOLVE_CUSTOM is not set -CONFIG_LWIP_HOOK_IP6_INPUT_NONE=y -# CONFIG_LWIP_HOOK_IP6_INPUT_DEFAULT is not set -# CONFIG_LWIP_HOOK_IP6_INPUT_CUSTOM is not set -# end of Hooks - -# CONFIG_LWIP_DEBUG is not set -# end of LWIP - -# -# mbedTLS -# -CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC=y -# CONFIG_MBEDTLS_EXTERNAL_MEM_ALLOC is not set -# CONFIG_MBEDTLS_DEFAULT_MEM_ALLOC is not set -# CONFIG_MBEDTLS_CUSTOM_MEM_ALLOC is not set -CONFIG_MBEDTLS_ASYMMETRIC_CONTENT_LEN=y -CONFIG_MBEDTLS_SSL_IN_CONTENT_LEN=16384 -CONFIG_MBEDTLS_SSL_OUT_CONTENT_LEN=4096 -# CONFIG_MBEDTLS_DYNAMIC_BUFFER is not set -# CONFIG_MBEDTLS_DEBUG is not set - -# -# mbedTLS v3.x related -# -# CONFIG_MBEDTLS_SSL_PROTO_TLS1_3 is not set -# CONFIG_MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH is not set -# CONFIG_MBEDTLS_X509_TRUSTED_CERT_CALLBACK is not set -# CONFIG_MBEDTLS_SSL_CONTEXT_SERIALIZATION is not set -CONFIG_MBEDTLS_SSL_KEEP_PEER_CERTIFICATE=y -# CONFIG_MBEDTLS_SSL_KEYING_MATERIAL_EXPORT is not set -CONFIG_MBEDTLS_PKCS7_C=y -# end of mbedTLS v3.x related - -# -# Certificate Bundle -# -# CONFIG_MBEDTLS_CERTIFICATE_BUNDLE is not set -# end of Certificate Bundle - -# CONFIG_MBEDTLS_ECP_RESTARTABLE is not set -CONFIG_MBEDTLS_CMAC_C=y -CONFIG_MBEDTLS_HARDWARE_AES=y -# CONFIG_MBEDTLS_GCM_SUPPORT_NON_AES_CIPHER is not set -CONFIG_MBEDTLS_HARDWARE_MPI=y -# CONFIG_MBEDTLS_LARGE_KEY_SOFTWARE_MPI is not set -CONFIG_MBEDTLS_HARDWARE_SHA=y -CONFIG_MBEDTLS_ROM_MD5=y -# CONFIG_MBEDTLS_ATCA_HW_ECDSA_SIGN is not set -# CONFIG_MBEDTLS_ATCA_HW_ECDSA_VERIFY is not set -CONFIG_MBEDTLS_HAVE_TIME=y -# CONFIG_MBEDTLS_PLATFORM_TIME_ALT is not set -# CONFIG_MBEDTLS_HAVE_TIME_DATE is not set -CONFIG_MBEDTLS_ECDSA_DETERMINISTIC=y -CONFIG_MBEDTLS_SHA1_C=y -CONFIG_MBEDTLS_SHA512_C=y -# CONFIG_MBEDTLS_SHA3_C is not set -CONFIG_MBEDTLS_TLS_SERVER_AND_CLIENT=y -# CONFIG_MBEDTLS_TLS_SERVER_ONLY is not set -# CONFIG_MBEDTLS_TLS_CLIENT_ONLY is not set -# CONFIG_MBEDTLS_TLS_DISABLED is not set -CONFIG_MBEDTLS_TLS_SERVER=y -CONFIG_MBEDTLS_TLS_CLIENT=y -CONFIG_MBEDTLS_TLS_ENABLED=y - -# -# TLS Key Exchange Methods -# -# CONFIG_MBEDTLS_PSK_MODES is not set -CONFIG_MBEDTLS_KEY_EXCHANGE_RSA=y -CONFIG_MBEDTLS_KEY_EXCHANGE_ELLIPTIC_CURVE=y -CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_RSA=y -CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA=y -CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA=y -CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_RSA=y -# end of TLS Key Exchange Methods - -CONFIG_MBEDTLS_SSL_RENEGOTIATION=y -CONFIG_MBEDTLS_SSL_PROTO_TLS1_2=y -# CONFIG_MBEDTLS_SSL_PROTO_GMTSSL1_1 is not set -# CONFIG_MBEDTLS_SSL_PROTO_DTLS is not set -CONFIG_MBEDTLS_SSL_ALPN=y -CONFIG_MBEDTLS_CLIENT_SSL_SESSION_TICKETS=y -CONFIG_MBEDTLS_SERVER_SSL_SESSION_TICKETS=y - -# -# Symmetric Ciphers -# -CONFIG_MBEDTLS_AES_C=y -# CONFIG_MBEDTLS_CAMELLIA_C is not set -# CONFIG_MBEDTLS_DES_C is not set -# CONFIG_MBEDTLS_BLOWFISH_C is not set -# CONFIG_MBEDTLS_XTEA_C is not set -CONFIG_MBEDTLS_CCM_C=y -CONFIG_MBEDTLS_GCM_C=y -# CONFIG_MBEDTLS_NIST_KW_C is not set -# end of Symmetric Ciphers - -# CONFIG_MBEDTLS_RIPEMD160_C is not set - -# -# Certificates -# -CONFIG_MBEDTLS_PEM_PARSE_C=y -CONFIG_MBEDTLS_PEM_WRITE_C=y -CONFIG_MBEDTLS_X509_CRL_PARSE_C=y -CONFIG_MBEDTLS_X509_CSR_PARSE_C=y -# end of Certificates - -CONFIG_MBEDTLS_ECP_C=y -CONFIG_MBEDTLS_PK_PARSE_EC_EXTENDED=y -CONFIG_MBEDTLS_PK_PARSE_EC_COMPRESSED=y -# CONFIG_MBEDTLS_DHM_C is not set -CONFIG_MBEDTLS_ECDH_C=y -CONFIG_MBEDTLS_ECDSA_C=y -# CONFIG_MBEDTLS_ECJPAKE_C is not set -CONFIG_MBEDTLS_ECP_DP_SECP192R1_ENABLED=y -CONFIG_MBEDTLS_ECP_DP_SECP224R1_ENABLED=y -CONFIG_MBEDTLS_ECP_DP_SECP256R1_ENABLED=y -CONFIG_MBEDTLS_ECP_DP_SECP384R1_ENABLED=y -CONFIG_MBEDTLS_ECP_DP_SECP521R1_ENABLED=y -CONFIG_MBEDTLS_ECP_DP_SECP192K1_ENABLED=y -CONFIG_MBEDTLS_ECP_DP_SECP224K1_ENABLED=y -CONFIG_MBEDTLS_ECP_DP_SECP256K1_ENABLED=y -CONFIG_MBEDTLS_ECP_DP_BP256R1_ENABLED=y -CONFIG_MBEDTLS_ECP_DP_BP384R1_ENABLED=y -CONFIG_MBEDTLS_ECP_DP_BP512R1_ENABLED=y -CONFIG_MBEDTLS_ECP_DP_CURVE25519_ENABLED=y -CONFIG_MBEDTLS_ECP_NIST_OPTIM=y -CONFIG_MBEDTLS_ECP_FIXED_POINT_OPTIM=y -# CONFIG_MBEDTLS_POLY1305_C is not set -# CONFIG_MBEDTLS_CHACHA20_C is not set -# CONFIG_MBEDTLS_HKDF_C is not set -# CONFIG_MBEDTLS_THREADING_C is not set -CONFIG_MBEDTLS_ERROR_STRINGS=y -CONFIG_MBEDTLS_FS_IO=y -# CONFIG_MBEDTLS_ALLOW_WEAK_CERTIFICATE_VERIFICATION is not set -# end of mbedTLS - -# -# ESP-MQTT Configurations -# -CONFIG_MQTT_PROTOCOL_311=y -# CONFIG_MQTT_PROTOCOL_5 is not set -CONFIG_MQTT_TRANSPORT_SSL=y -CONFIG_MQTT_TRANSPORT_WEBSOCKET=y -CONFIG_MQTT_TRANSPORT_WEBSOCKET_SECURE=y -# CONFIG_MQTT_MSG_ID_INCREMENTAL is not set -# CONFIG_MQTT_SKIP_PUBLISH_IF_DISCONNECTED is not set -# CONFIG_MQTT_REPORT_DELETED_MESSAGES is not set -# CONFIG_MQTT_USE_CUSTOM_CONFIG is not set -# CONFIG_MQTT_TASK_CORE_SELECTION_ENABLED is not set -# CONFIG_MQTT_CUSTOM_OUTBOX is not set -# end of ESP-MQTT Configurations - -# -# LibC -# -CONFIG_LIBC_NEWLIB=y -CONFIG_LIBC_MISC_IN_IRAM=y -CONFIG_LIBC_LOCKS_PLACE_IN_IRAM=y -CONFIG_LIBC_STDOUT_LINE_ENDING_CRLF=y -# CONFIG_LIBC_STDOUT_LINE_ENDING_LF is not set -# CONFIG_LIBC_STDOUT_LINE_ENDING_CR is not set -# CONFIG_LIBC_STDIN_LINE_ENDING_CRLF is not set -# CONFIG_LIBC_STDIN_LINE_ENDING_LF is not set -CONFIG_LIBC_STDIN_LINE_ENDING_CR=y -# CONFIG_LIBC_NEWLIB_NANO_FORMAT is not set -CONFIG_LIBC_TIME_SYSCALL_USE_RTC_HRT=y -# CONFIG_LIBC_TIME_SYSCALL_USE_RTC is not set -# CONFIG_LIBC_TIME_SYSCALL_USE_HRT is not set -# CONFIG_LIBC_TIME_SYSCALL_USE_NONE is not set -# end of LibC - -CONFIG_STDATOMIC_S32C1I_SPIRAM_WORKAROUND=y - -# -# NVS -# -# CONFIG_NVS_ASSERT_ERROR_CHECK is not set -# CONFIG_NVS_LEGACY_DUP_KEYS_COMPATIBILITY is not set -# CONFIG_NVS_ALLOCATE_CACHE_IN_SPIRAM is not set -# end of NVS - -# -# OpenThread -# -# CONFIG_OPENTHREAD_ENABLED is not set - -# -# OpenThread Spinel -# -# CONFIG_OPENTHREAD_SPINEL_ONLY is not set -# end of OpenThread Spinel -# end of OpenThread - -# -# Protocomm -# -CONFIG_ESP_PROTOCOMM_SUPPORT_SECURITY_VERSION_0=y -CONFIG_ESP_PROTOCOMM_SUPPORT_SECURITY_VERSION_1=y -CONFIG_ESP_PROTOCOMM_SUPPORT_SECURITY_VERSION_2=y -CONFIG_ESP_PROTOCOMM_SUPPORT_SECURITY_PATCH_VERSION=y -# end of Protocomm - -# -# PThreads -# -CONFIG_PTHREAD_TASK_PRIO_DEFAULT=5 -CONFIG_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072 -CONFIG_PTHREAD_STACK_MIN=768 -CONFIG_PTHREAD_DEFAULT_CORE_NO_AFFINITY=y -# CONFIG_PTHREAD_DEFAULT_CORE_0 is not set -# CONFIG_PTHREAD_DEFAULT_CORE_1 is not set -CONFIG_PTHREAD_TASK_CORE_DEFAULT=-1 -CONFIG_PTHREAD_TASK_NAME_DEFAULT="pthread" -# end of PThreads - -# -# MMU Config -# -CONFIG_MMU_PAGE_SIZE_64KB=y -CONFIG_MMU_PAGE_MODE="64KB" -CONFIG_MMU_PAGE_SIZE=0x10000 -# end of MMU Config - -# -# Main Flash configuration -# - -# -# SPI Flash behavior when brownout -# -CONFIG_SPI_FLASH_BROWNOUT_RESET_XMC=y -CONFIG_SPI_FLASH_BROWNOUT_RESET=y -# end of SPI Flash behavior when brownout - -# -# Optional and Experimental Features (READ DOCS FIRST) -# - -# -# Features here require specific hardware (READ DOCS FIRST!) -# -CONFIG_SPI_FLASH_SUSPEND_TSUS_VAL_US=50 -# CONFIG_SPI_FLASH_FORCE_ENABLE_XMC_C_SUSPEND is not set -# CONFIG_SPI_FLASH_FORCE_ENABLE_C6_H2_SUSPEND is not set -CONFIG_SPI_FLASH_PLACE_FUNCTIONS_IN_IRAM=y -# end of Optional and Experimental Features (READ DOCS FIRST) -# end of Main Flash configuration - -# -# SPI Flash driver -# -# CONFIG_SPI_FLASH_VERIFY_WRITE is not set -# CONFIG_SPI_FLASH_ENABLE_COUNTERS is not set -CONFIG_SPI_FLASH_ROM_DRIVER_PATCH=y -CONFIG_SPI_FLASH_DANGEROUS_WRITE_ABORTS=y -# CONFIG_SPI_FLASH_DANGEROUS_WRITE_FAILS is not set -# CONFIG_SPI_FLASH_DANGEROUS_WRITE_ALLOWED is not set -# CONFIG_SPI_FLASH_SHARE_SPI1_BUS is not set -# CONFIG_SPI_FLASH_BYPASS_BLOCK_ERASE is not set -CONFIG_SPI_FLASH_YIELD_DURING_ERASE=y -CONFIG_SPI_FLASH_ERASE_YIELD_DURATION_MS=20 -CONFIG_SPI_FLASH_ERASE_YIELD_TICKS=1 -CONFIG_SPI_FLASH_WRITE_CHUNK_SIZE=8192 -# CONFIG_SPI_FLASH_SIZE_OVERRIDE is not set -# CONFIG_SPI_FLASH_CHECK_ERASE_TIMEOUT_DISABLED is not set -# CONFIG_SPI_FLASH_OVERRIDE_CHIP_DRIVER_LIST is not set - -# -# Auto-detect flash chips -# -CONFIG_SPI_FLASH_VENDOR_XMC_SUPPORT_ENABLED=y -CONFIG_SPI_FLASH_VENDOR_GD_SUPPORT_ENABLED=y -CONFIG_SPI_FLASH_VENDOR_ISSI_SUPPORT_ENABLED=y -CONFIG_SPI_FLASH_VENDOR_MXIC_SUPPORT_ENABLED=y -CONFIG_SPI_FLASH_VENDOR_WINBOND_SUPPORT_ENABLED=y -CONFIG_SPI_FLASH_SUPPORT_ISSI_CHIP=y -CONFIG_SPI_FLASH_SUPPORT_MXIC_CHIP=y -CONFIG_SPI_FLASH_SUPPORT_GD_CHIP=y -CONFIG_SPI_FLASH_SUPPORT_WINBOND_CHIP=y -# CONFIG_SPI_FLASH_SUPPORT_BOYA_CHIP is not set -# CONFIG_SPI_FLASH_SUPPORT_TH_CHIP is not set -# end of Auto-detect flash chips - -CONFIG_SPI_FLASH_ENABLE_ENCRYPTED_READ_WRITE=y -# end of SPI Flash driver - -# -# SPIFFS Configuration -# -CONFIG_SPIFFS_MAX_PARTITIONS=3 - -# -# SPIFFS Cache Configuration -# -CONFIG_SPIFFS_CACHE=y -CONFIG_SPIFFS_CACHE_WR=y -# CONFIG_SPIFFS_CACHE_STATS is not set -# end of SPIFFS Cache Configuration - -CONFIG_SPIFFS_PAGE_CHECK=y -CONFIG_SPIFFS_GC_MAX_RUNS=10 -# CONFIG_SPIFFS_GC_STATS is not set -CONFIG_SPIFFS_PAGE_SIZE=256 -CONFIG_SPIFFS_OBJ_NAME_LEN=32 -# CONFIG_SPIFFS_FOLLOW_SYMLINKS is not set -CONFIG_SPIFFS_USE_MAGIC=y -CONFIG_SPIFFS_USE_MAGIC_LENGTH=y -CONFIG_SPIFFS_META_LENGTH=4 -CONFIG_SPIFFS_USE_MTIME=y - -# -# Debug Configuration -# -# CONFIG_SPIFFS_DBG is not set -# CONFIG_SPIFFS_API_DBG is not set -# CONFIG_SPIFFS_GC_DBG is not set -# CONFIG_SPIFFS_CACHE_DBG is not set -# CONFIG_SPIFFS_CHECK_DBG is not set -# CONFIG_SPIFFS_TEST_VISUALISATION is not set -# end of Debug Configuration -# end of SPIFFS Configuration - -# -# TCP Transport -# - -# -# Websocket -# -CONFIG_WS_TRANSPORT=y -CONFIG_WS_BUFFER_SIZE=1024 -# CONFIG_WS_DYNAMIC_BUFFER is not set -# end of Websocket -# end of TCP Transport - -# -# Ultra Low Power (ULP) Co-processor -# -# CONFIG_ULP_COPROC_ENABLED is not set - -# -# ULP Debugging Options -# -# end of ULP Debugging Options -# end of Ultra Low Power (ULP) Co-processor - -# -# Unity unit testing library -# -CONFIG_UNITY_ENABLE_FLOAT=y -CONFIG_UNITY_ENABLE_DOUBLE=y -# CONFIG_UNITY_ENABLE_64BIT is not set -# CONFIG_UNITY_ENABLE_COLOR is not set -CONFIG_UNITY_ENABLE_IDF_TEST_RUNNER=y -# CONFIG_UNITY_ENABLE_FIXTURE is not set -# CONFIG_UNITY_ENABLE_BACKTRACE_ON_FAIL is not set -# CONFIG_UNITY_TEST_ORDER_BY_FILE_PATH_AND_LINE is not set -# end of Unity unit testing library - -# -# Virtual file system -# -CONFIG_VFS_SUPPORT_IO=y -CONFIG_VFS_SUPPORT_DIR=y -CONFIG_VFS_SUPPORT_SELECT=y -CONFIG_VFS_SUPPRESS_SELECT_DEBUG_OUTPUT=y -# CONFIG_VFS_SELECT_IN_RAM is not set -CONFIG_VFS_SUPPORT_TERMIOS=y -CONFIG_VFS_MAX_COUNT=8 - -# -# Host File System I/O (Semihosting) -# -CONFIG_VFS_SEMIHOSTFS_MAX_MOUNT_POINTS=1 -# end of Host File System I/O (Semihosting) - -CONFIG_VFS_INITIALIZE_DEV_NULL=y -# end of Virtual file system - -# -# Wear Levelling -# -# CONFIG_WL_SECTOR_SIZE_512 is not set -CONFIG_WL_SECTOR_SIZE_4096=y -CONFIG_WL_SECTOR_SIZE=4096 -# end of Wear Levelling - -# -# Wi-Fi Provisioning Manager -# -CONFIG_WIFI_PROV_SCAN_MAX_ENTRIES=16 -CONFIG_WIFI_PROV_AUTOSTOP_TIMEOUT=30 -CONFIG_WIFI_PROV_STA_ALL_CHANNEL_SCAN=y -# CONFIG_WIFI_PROV_STA_FAST_SCAN is not set -# end of Wi-Fi Provisioning Manager - -# -# WebSocket Server -# -CONFIG_WEBSOCKET_SERVER_MAX_CLIENTS=1 -CONFIG_WEBSOCKET_SERVER_QUEUE_SIZE=2 -CONFIG_WEBSOCKET_SERVER_QUEUE_TIMEOUT=30 -CONFIG_WEBSOCKET_SERVER_TASK_STACK_DEPTH=3000 -CONFIG_WEBSOCKET_SERVER_TASK_PRIORITY=5 -# CONFIG_WEBSOCKET_SERVER_PINNED is not set -# end of WebSocket Server - -# -# DSP Library -# -CONFIG_DSP_OPTIMIZATIONS_SUPPORTED=y -# CONFIG_DSP_ANSI is not set -CONFIG_DSP_OPTIMIZED=y -CONFIG_DSP_OPTIMIZATION=1 -# CONFIG_DSP_MAX_FFT_SIZE_512 is not set -# CONFIG_DSP_MAX_FFT_SIZE_1024 is not set -# CONFIG_DSP_MAX_FFT_SIZE_2048 is not set -CONFIG_DSP_MAX_FFT_SIZE_4096=y -# CONFIG_DSP_MAX_FFT_SIZE_8192 is not set -# CONFIG_DSP_MAX_FFT_SIZE_16384 is not set -# CONFIG_DSP_MAX_FFT_SIZE_32768 is not set -CONFIG_DSP_MAX_FFT_SIZE=4096 -# end of DSP Library - -# -# mDNS -# -CONFIG_MDNS_MAX_INTERFACES=3 -CONFIG_MDNS_MAX_SERVICES=10 -CONFIG_MDNS_TASK_PRIORITY=1 -CONFIG_MDNS_ACTION_QUEUE_LEN=16 -CONFIG_MDNS_TASK_STACK_SIZE=2816 -CONFIG_MDNS_TASK_AFFINITY_NO_AFFINITY=y -# CONFIG_MDNS_TASK_AFFINITY_CPU0 is not set -# CONFIG_MDNS_TASK_AFFINITY_CPU1 is not set -CONFIG_MDNS_TASK_AFFINITY=0x7FFFFFFF - -# -# MDNS Memory Configuration -# -# CONFIG_MDNS_TASK_CREATE_FROM_SPIRAM is not set -CONFIG_MDNS_TASK_CREATE_FROM_INTERNAL=y -# CONFIG_MDNS_MEMORY_ALLOC_SPIRAM is not set -CONFIG_MDNS_MEMORY_ALLOC_INTERNAL=y -# CONFIG_MDNS_MEMORY_CUSTOM_IMPL is not set -# end of MDNS Memory Configuration - -CONFIG_MDNS_SERVICE_ADD_TIMEOUT_MS=2000 -CONFIG_MDNS_TIMER_PERIOD_MS=100 -# CONFIG_MDNS_NETWORKING_SOCKET is not set -# CONFIG_MDNS_SKIP_SUPPRESSING_OWN_QUERIES is not set -# CONFIG_MDNS_ENABLE_DEBUG_PRINTS is not set -CONFIG_MDNS_ENABLE_CONSOLE_CLI=y -# CONFIG_MDNS_RESPOND_REVERSE_QUERIES is not set -CONFIG_MDNS_MULTIPLE_INSTANCE=y - -# -# MDNS Predefined interfaces -# -CONFIG_MDNS_PREDEF_NETIF_STA=y -CONFIG_MDNS_PREDEF_NETIF_AP=y -CONFIG_MDNS_PREDEF_NETIF_ETH=y -# end of MDNS Predefined interfaces -# end of mDNS -# end of Component config - -# CONFIG_IDF_EXPERIMENTAL_FEATURES is not set - -# Deprecated options for backward compatibility -# CONFIG_APP_BUILD_TYPE_ELF_RAM is not set -# CONFIG_NO_BLOBS is not set -# CONFIG_ESP32_NO_BLOBS is not set -# CONFIG_ESP32_COMPATIBLE_PRE_V2_1_BOOTLOADERS is not set -# CONFIG_ESP32_COMPATIBLE_PRE_V3_1_BOOTLOADERS is not set -CONFIG_APP_ROLLBACK_ENABLE=y -# CONFIG_APP_ANTI_ROLLBACK is not set -# CONFIG_LOG_BOOTLOADER_LEVEL_NONE is not set -# CONFIG_LOG_BOOTLOADER_LEVEL_ERROR is not set -# CONFIG_LOG_BOOTLOADER_LEVEL_WARN is not set -CONFIG_LOG_BOOTLOADER_LEVEL_INFO=y -# CONFIG_LOG_BOOTLOADER_LEVEL_DEBUG is not set -# CONFIG_LOG_BOOTLOADER_LEVEL_VERBOSE is not set -CONFIG_LOG_BOOTLOADER_LEVEL=3 -# CONFIG_FLASH_ENCRYPTION_ENABLED is not set -CONFIG_FLASHMODE_QIO=y -# CONFIG_FLASHMODE_QOUT is not set -# CONFIG_FLASHMODE_DIO is not set -# CONFIG_FLASHMODE_DOUT is not set -CONFIG_MONITOR_BAUD=115200 -# CONFIG_OPTIMIZATION_LEVEL_DEBUG is not set -# CONFIG_COMPILER_OPTIMIZATION_LEVEL_DEBUG is not set -# CONFIG_COMPILER_OPTIMIZATION_DEFAULT is not set -# CONFIG_OPTIMIZATION_LEVEL_RELEASE is not set -# CONFIG_COMPILER_OPTIMIZATION_LEVEL_RELEASE is not set -CONFIG_OPTIMIZATION_ASSERTIONS_ENABLED=y -# CONFIG_OPTIMIZATION_ASSERTIONS_SILENT is not set -# CONFIG_OPTIMIZATION_ASSERTIONS_DISABLED is not set -CONFIG_OPTIMIZATION_ASSERTION_LEVEL=2 -# CONFIG_CXX_EXCEPTIONS is not set -CONFIG_STACK_CHECK_NONE=y -# CONFIG_STACK_CHECK_NORM is not set -# CONFIG_STACK_CHECK_STRONG is not set -# CONFIG_STACK_CHECK_ALL is not set -# CONFIG_WARN_WRITE_STRINGS is not set -# CONFIG_ESP32_APPTRACE_DEST_TRAX is not set -CONFIG_ESP32_APPTRACE_DEST_NONE=y -CONFIG_ESP32_APPTRACE_LOCK_ENABLE=y -CONFIG_ADC2_DISABLE_DAC=y -# CONFIG_GPTIMER_ISR_IRAM_SAFE is not set -# CONFIG_MCPWM_ISR_IRAM_SAFE is not set -# CONFIG_EVENT_LOOP_PROFILING is not set -CONFIG_POST_EVENTS_FROM_ISR=y -# CONFIG_POST_EVENTS_FROM_IRAM_ISR is not set -CONFIG_GDBSTUB_SUPPORT_TASKS=y -CONFIG_GDBSTUB_MAX_TASKS=32 -# CONFIG_OTA_ALLOW_HTTP is not set -# CONFIG_TWO_UNIVERSAL_MAC_ADDRESS is not set -CONFIG_FOUR_UNIVERSAL_MAC_ADDRESS=y -CONFIG_NUMBER_OF_UNIVERSAL_MAC_ADDRESS=4 -CONFIG_ESP32_DEEP_SLEEP_WAKEUP_DELAY=2000 -CONFIG_ESP_SLEEP_DEEP_SLEEP_WAKEUP_DELAY=2000 -CONFIG_ESP32_RTC_CLK_SRC_INT_RC=y -CONFIG_ESP32_RTC_CLOCK_SOURCE_INTERNAL_RC=y -# CONFIG_ESP32_RTC_CLK_SRC_EXT_CRYS is not set -# CONFIG_ESP32_RTC_CLOCK_SOURCE_EXTERNAL_CRYSTAL is not set -# CONFIG_ESP32_RTC_CLK_SRC_EXT_OSC is not set -# CONFIG_ESP32_RTC_CLOCK_SOURCE_EXTERNAL_OSC is not set -# CONFIG_ESP32_RTC_CLK_SRC_INT_8MD256 is not set -# CONFIG_ESP32_RTC_CLOCK_SOURCE_INTERNAL_8MD256 is not set -CONFIG_ESP32_RTC_CLK_CAL_CYCLES=1024 -CONFIG_PERIPH_CTRL_FUNC_IN_IRAM=y -# CONFIG_ESP32_XTAL_FREQ_26 is not set -CONFIG_ESP32_XTAL_FREQ_40=y -# CONFIG_ESP32_XTAL_FREQ_AUTO is not set -CONFIG_ESP32_XTAL_FREQ=40 -CONFIG_BROWNOUT_DET=y -CONFIG_ESP32_BROWNOUT_DET=y -# CONFIG_BROWNOUT_DET_LVL_SEL_0 is not set -# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_0 is not set -# CONFIG_BROWNOUT_DET_LVL_SEL_1 is not set -# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_1 is not set -# CONFIG_BROWNOUT_DET_LVL_SEL_2 is not set -# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_2 is not set -# CONFIG_BROWNOUT_DET_LVL_SEL_3 is not set -# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_3 is not set -CONFIG_BROWNOUT_DET_LVL_SEL_4=y -CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_4=y -# CONFIG_BROWNOUT_DET_LVL_SEL_5 is not set -# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_5 is not set -# CONFIG_BROWNOUT_DET_LVL_SEL_6 is not set -# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_6 is not set -# CONFIG_BROWNOUT_DET_LVL_SEL_7 is not set -# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_7 is not set -CONFIG_BROWNOUT_DET_LVL=4 -CONFIG_ESP32_BROWNOUT_DET_LVL=4 -CONFIG_ESP_SYSTEM_BROWNOUT_INTR=y -CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE=y -# CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION is not set -CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER=20 -CONFIG_ESP32_PHY_MAX_TX_POWER=20 -CONFIG_REDUCE_PHY_TX_POWER=y -CONFIG_ESP32_REDUCE_PHY_TX_POWER=y -CONFIG_SPIRAM_SUPPORT=y -CONFIG_ESP32_SPIRAM_SUPPORT=y -# CONFIG_WIFI_LWIP_ALLOCATION_FROM_SPIRAM_FIRST is not set -# CONFIG_ESP32_DEFAULT_CPU_FREQ_80 is not set -# CONFIG_ESP32_DEFAULT_CPU_FREQ_160 is not set -CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y -CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=240 -CONFIG_TRACEMEM_RESERVE_DRAM=0x0 -# CONFIG_ESP32_PANIC_PRINT_HALT is not set -CONFIG_ESP32_PANIC_PRINT_REBOOT=y -# CONFIG_ESP32_PANIC_SILENT_REBOOT is not set -# CONFIG_ESP32_PANIC_GDBSTUB is not set -CONFIG_SYSTEM_EVENT_QUEUE_SIZE=32 -CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=2304 -CONFIG_MAIN_TASK_STACK_SIZE=2560 -CONFIG_CONSOLE_UART_DEFAULT=y -# CONFIG_CONSOLE_UART_CUSTOM is not set -# CONFIG_CONSOLE_UART_NONE is not set -# CONFIG_ESP_CONSOLE_UART_NONE is not set -CONFIG_CONSOLE_UART=y -CONFIG_CONSOLE_UART_NUM=0 -CONFIG_CONSOLE_UART_BAUDRATE=115200 -CONFIG_INT_WDT=y -CONFIG_INT_WDT_TIMEOUT_MS=300 -CONFIG_INT_WDT_CHECK_CPU1=y -CONFIG_TASK_WDT=y -CONFIG_ESP_TASK_WDT=y -# CONFIG_TASK_WDT_PANIC is not set -CONFIG_TASK_WDT_TIMEOUT_S=5 -CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU0=y -CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU1=y -# CONFIG_ESP32_DEBUG_STUBS_ENABLE is not set -CONFIG_ESP32_DEBUG_OCDAWARE=y -# CONFIG_DISABLE_BASIC_ROM_CONSOLE is not set -CONFIG_IPC_TASK_STACK_SIZE=1024 -CONFIG_TIMER_TASK_STACK_SIZE=2048 -CONFIG_ESP32_WIFI_ENABLED=y -CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=8 -CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=64 -CONFIG_ESP32_WIFI_STATIC_TX_BUFFER=y -# CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER is not set -CONFIG_ESP32_WIFI_TX_BUFFER_TYPE=0 -CONFIG_ESP32_WIFI_STATIC_TX_BUFFER_NUM=8 -# CONFIG_ESP32_WIFI_CSI_ENABLED is not set -CONFIG_ESP32_WIFI_AMPDU_TX_ENABLED=y -CONFIG_ESP32_WIFI_TX_BA_WIN=8 -CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED=y -CONFIG_ESP32_WIFI_RX_BA_WIN=16 -CONFIG_ESP32_WIFI_NVS_ENABLED=y -CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_0=y -# CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_1 is not set -CONFIG_ESP32_WIFI_SOFTAP_BEACON_MAX_LEN=752 -CONFIG_ESP32_WIFI_MGMT_SBUF_NUM=32 -# CONFIG_ESP32_WIFI_IRAM_OPT is not set -CONFIG_ESP32_WIFI_RX_IRAM_OPT=y -CONFIG_ESP32_WIFI_ENABLE_WPA3_SAE=y -CONFIG_ESP32_WIFI_ENABLE_WPA3_OWE_STA=y -CONFIG_WPA_MBEDTLS_CRYPTO=y -CONFIG_WPA_MBEDTLS_TLS_CLIENT=y -# CONFIG_WPA_WAPI_PSK is not set -# CONFIG_WPA_11KV_SUPPORT is not set -# CONFIG_WPA_MBO_SUPPORT is not set -# CONFIG_WPA_DPP_SUPPORT is not set -# CONFIG_WPA_11R_SUPPORT is not set -# CONFIG_WPA_WPS_SOFTAP_REGISTRAR is not set -# CONFIG_WPA_WPS_STRICT is not set -# CONFIG_WPA_DEBUG_PRINT is not set -# CONFIG_WPA_TESTING_OPTIONS is not set -# CONFIG_ESP32_ENABLE_COREDUMP_TO_FLASH is not set -# CONFIG_ESP32_ENABLE_COREDUMP_TO_UART is not set -CONFIG_ESP32_ENABLE_COREDUMP_TO_NONE=y -CONFIG_TIMER_TASK_PRIORITY=1 -CONFIG_TIMER_TASK_STACK_DEPTH=1536 -CONFIG_TIMER_QUEUE_LENGTH=5 -# CONFIG_ENABLE_STATIC_TASK_CLEAN_UP_HOOK is not set -# CONFIG_SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY is not set -# CONFIG_HAL_ASSERTION_SILIENT is not set -# CONFIG_L2_TO_L3_COPY is not set -CONFIG_ESP_GRATUITOUS_ARP=y -CONFIG_GARP_TMR_INTERVAL=60 -CONFIG_TCPIP_RECVMBOX_SIZE=32 -CONFIG_TCP_MAXRTX=12 -CONFIG_TCP_SYNMAXRTX=12 -CONFIG_TCP_MSS=1460 -CONFIG_TCP_MSL=60000 -CONFIG_TCP_SND_BUF_DEFAULT=11680 -CONFIG_TCP_WND_DEFAULT=11680 -CONFIG_TCP_RECVMBOX_SIZE=10 -CONFIG_TCP_QUEUE_OOSEQ=y -CONFIG_TCP_OVERSIZE_MSS=y -# CONFIG_TCP_OVERSIZE_QUARTER_MSS is not set -# CONFIG_TCP_OVERSIZE_DISABLE is not set -CONFIG_UDP_RECVMBOX_SIZE=6 -CONFIG_TCPIP_TASK_STACK_SIZE=3072 -# CONFIG_TCPIP_TASK_AFFINITY_NO_AFFINITY is not set -CONFIG_TCPIP_TASK_AFFINITY_CPU0=y -# CONFIG_TCPIP_TASK_AFFINITY_CPU1 is not set -CONFIG_TCPIP_TASK_AFFINITY=0x0 -# CONFIG_PPP_SUPPORT is not set -CONFIG_NEWLIB_STDOUT_LINE_ENDING_CRLF=y -# CONFIG_NEWLIB_STDOUT_LINE_ENDING_LF is not set -# CONFIG_NEWLIB_STDOUT_LINE_ENDING_CR is not set -# CONFIG_NEWLIB_STDIN_LINE_ENDING_CRLF is not set -# CONFIG_NEWLIB_STDIN_LINE_ENDING_LF is not set -CONFIG_NEWLIB_STDIN_LINE_ENDING_CR=y -# CONFIG_NEWLIB_NANO_FORMAT is not set -CONFIG_NEWLIB_TIME_SYSCALL_USE_RTC_HRT=y -CONFIG_ESP32_TIME_SYSCALL_USE_RTC_HRT=y -CONFIG_ESP32_TIME_SYSCALL_USE_RTC_FRC1=y -# CONFIG_NEWLIB_TIME_SYSCALL_USE_RTC is not set -# CONFIG_ESP32_TIME_SYSCALL_USE_RTC is not set -# CONFIG_NEWLIB_TIME_SYSCALL_USE_HRT is not set -# CONFIG_ESP32_TIME_SYSCALL_USE_HRT is not set -# CONFIG_ESP32_TIME_SYSCALL_USE_FRC1 is not set -# CONFIG_NEWLIB_TIME_SYSCALL_USE_NONE is not set -# CONFIG_ESP32_TIME_SYSCALL_USE_NONE is not set -CONFIG_ESP32_PTHREAD_TASK_PRIO_DEFAULT=5 -CONFIG_ESP32_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072 -CONFIG_ESP32_PTHREAD_STACK_MIN=768 -CONFIG_ESP32_DEFAULT_PTHREAD_CORE_NO_AFFINITY=y -# CONFIG_ESP32_DEFAULT_PTHREAD_CORE_0 is not set -# CONFIG_ESP32_DEFAULT_PTHREAD_CORE_1 is not set -CONFIG_ESP32_PTHREAD_TASK_CORE_DEFAULT=-1 -CONFIG_ESP32_PTHREAD_TASK_NAME_DEFAULT="pthread" -CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ABORTS=y -# CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_FAILS is not set -# CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ALLOWED is not set -# CONFIG_ESP32_ULP_COPROC_ENABLED is not set -CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT=y -CONFIG_SUPPORT_TERMIOS=y -CONFIG_SEMIHOSTFS_MAX_MOUNT_POINTS=1 -# End of deprecated options diff --git a/sdkconfig.louder-esp32s3 b/sdkconfig.louder-esp32s3 deleted file mode 100644 index 3932be28..00000000 --- a/sdkconfig.louder-esp32s3 +++ /dev/null @@ -1,2681 +0,0 @@ -# -# Automatically generated file. DO NOT EDIT. -# Espressif IoT Development Framework (ESP-IDF) 5.5.1 Project Configuration -# -CONFIG_SOC_ADC_SUPPORTED=y -CONFIG_SOC_UART_SUPPORTED=y -CONFIG_SOC_PCNT_SUPPORTED=y -CONFIG_SOC_PHY_SUPPORTED=y -CONFIG_SOC_WIFI_SUPPORTED=y -CONFIG_SOC_TWAI_SUPPORTED=y -CONFIG_SOC_GDMA_SUPPORTED=y -CONFIG_SOC_UHCI_SUPPORTED=y -CONFIG_SOC_AHB_GDMA_SUPPORTED=y -CONFIG_SOC_GPTIMER_SUPPORTED=y -CONFIG_SOC_LCDCAM_SUPPORTED=y -CONFIG_SOC_LCDCAM_CAM_SUPPORTED=y -CONFIG_SOC_LCDCAM_I80_LCD_SUPPORTED=y -CONFIG_SOC_LCDCAM_RGB_LCD_SUPPORTED=y -CONFIG_SOC_MCPWM_SUPPORTED=y -CONFIG_SOC_DEDICATED_GPIO_SUPPORTED=y -CONFIG_SOC_CACHE_SUPPORT_WRAP=y -CONFIG_SOC_ULP_SUPPORTED=y -CONFIG_SOC_ULP_FSM_SUPPORTED=y -CONFIG_SOC_RISCV_COPROC_SUPPORTED=y -CONFIG_SOC_BT_SUPPORTED=y -CONFIG_SOC_USB_OTG_SUPPORTED=y -CONFIG_SOC_USB_SERIAL_JTAG_SUPPORTED=y -CONFIG_SOC_CCOMP_TIMER_SUPPORTED=y -CONFIG_SOC_ASYNC_MEMCPY_SUPPORTED=y -CONFIG_SOC_SUPPORTS_SECURE_DL_MODE=y -CONFIG_SOC_EFUSE_KEY_PURPOSE_FIELD=y -CONFIG_SOC_EFUSE_SUPPORTED=y -CONFIG_SOC_SDMMC_HOST_SUPPORTED=y -CONFIG_SOC_RTC_FAST_MEM_SUPPORTED=y -CONFIG_SOC_RTC_SLOW_MEM_SUPPORTED=y -CONFIG_SOC_RTC_MEM_SUPPORTED=y -CONFIG_SOC_PSRAM_DMA_CAPABLE=y -CONFIG_SOC_XT_WDT_SUPPORTED=y -CONFIG_SOC_I2S_SUPPORTED=y -CONFIG_SOC_RMT_SUPPORTED=y -CONFIG_SOC_SDM_SUPPORTED=y -CONFIG_SOC_GPSPI_SUPPORTED=y -CONFIG_SOC_LEDC_SUPPORTED=y -CONFIG_SOC_I2C_SUPPORTED=y -CONFIG_SOC_SYSTIMER_SUPPORTED=y -CONFIG_SOC_SUPPORT_COEXISTENCE=y -CONFIG_SOC_TEMP_SENSOR_SUPPORTED=y -CONFIG_SOC_AES_SUPPORTED=y -CONFIG_SOC_MPI_SUPPORTED=y -CONFIG_SOC_SHA_SUPPORTED=y -CONFIG_SOC_HMAC_SUPPORTED=y -CONFIG_SOC_DIG_SIGN_SUPPORTED=y -CONFIG_SOC_FLASH_ENC_SUPPORTED=y -CONFIG_SOC_SECURE_BOOT_SUPPORTED=y -CONFIG_SOC_MEMPROT_SUPPORTED=y -CONFIG_SOC_TOUCH_SENSOR_SUPPORTED=y -CONFIG_SOC_BOD_SUPPORTED=y -CONFIG_SOC_CLK_TREE_SUPPORTED=y -CONFIG_SOC_MPU_SUPPORTED=y -CONFIG_SOC_WDT_SUPPORTED=y -CONFIG_SOC_SPI_FLASH_SUPPORTED=y -CONFIG_SOC_RNG_SUPPORTED=y -CONFIG_SOC_LIGHT_SLEEP_SUPPORTED=y -CONFIG_SOC_DEEP_SLEEP_SUPPORTED=y -CONFIG_SOC_LP_PERIPH_SHARE_INTERRUPT=y -CONFIG_SOC_PM_SUPPORTED=y -CONFIG_SOC_SIMD_INSTRUCTION_SUPPORTED=y -CONFIG_SOC_XTAL_SUPPORT_40M=y -CONFIG_SOC_APPCPU_HAS_CLOCK_GATING_BUG=y -CONFIG_SOC_ADC_RTC_CTRL_SUPPORTED=y -CONFIG_SOC_ADC_DIG_CTRL_SUPPORTED=y -CONFIG_SOC_ADC_ARBITER_SUPPORTED=y -CONFIG_SOC_ADC_DIG_IIR_FILTER_SUPPORTED=y -CONFIG_SOC_ADC_MONITOR_SUPPORTED=y -CONFIG_SOC_ADC_DMA_SUPPORTED=y -CONFIG_SOC_ADC_PERIPH_NUM=2 -CONFIG_SOC_ADC_MAX_CHANNEL_NUM=10 -CONFIG_SOC_ADC_ATTEN_NUM=4 -CONFIG_SOC_ADC_DIGI_CONTROLLER_NUM=2 -CONFIG_SOC_ADC_PATT_LEN_MAX=24 -CONFIG_SOC_ADC_DIGI_MIN_BITWIDTH=12 -CONFIG_SOC_ADC_DIGI_MAX_BITWIDTH=12 -CONFIG_SOC_ADC_DIGI_RESULT_BYTES=4 -CONFIG_SOC_ADC_DIGI_DATA_BYTES_PER_CONV=4 -CONFIG_SOC_ADC_DIGI_IIR_FILTER_NUM=2 -CONFIG_SOC_ADC_DIGI_MONITOR_NUM=2 -CONFIG_SOC_ADC_SAMPLE_FREQ_THRES_HIGH=83333 -CONFIG_SOC_ADC_SAMPLE_FREQ_THRES_LOW=611 -CONFIG_SOC_ADC_RTC_MIN_BITWIDTH=12 -CONFIG_SOC_ADC_RTC_MAX_BITWIDTH=12 -CONFIG_SOC_ADC_CALIBRATION_V1_SUPPORTED=y -CONFIG_SOC_ADC_SELF_HW_CALI_SUPPORTED=y -CONFIG_SOC_ADC_SHARED_POWER=y -CONFIG_SOC_APB_BACKUP_DMA=y -CONFIG_SOC_BROWNOUT_RESET_SUPPORTED=y -CONFIG_SOC_CACHE_WRITEBACK_SUPPORTED=y -CONFIG_SOC_CACHE_FREEZE_SUPPORTED=y -CONFIG_SOC_CACHE_ACS_INVALID_STATE_ON_PANIC=y -CONFIG_SOC_CPU_CORES_NUM=2 -CONFIG_SOC_CPU_INTR_NUM=32 -CONFIG_SOC_CPU_HAS_FPU=y -CONFIG_SOC_HP_CPU_HAS_MULTIPLE_CORES=y -CONFIG_SOC_CPU_BREAKPOINTS_NUM=2 -CONFIG_SOC_CPU_WATCHPOINTS_NUM=2 -CONFIG_SOC_CPU_WATCHPOINT_MAX_REGION_SIZE=0x40 -CONFIG_SOC_SIMD_PREFERRED_DATA_ALIGNMENT=16 -CONFIG_SOC_DS_SIGNATURE_MAX_BIT_LEN=4096 -CONFIG_SOC_DS_KEY_PARAM_MD_IV_LENGTH=16 -CONFIG_SOC_DS_KEY_CHECK_MAX_WAIT_US=1100 -CONFIG_SOC_AHB_GDMA_VERSION=1 -CONFIG_SOC_GDMA_NUM_GROUPS_MAX=1 -CONFIG_SOC_GDMA_PAIRS_PER_GROUP=5 -CONFIG_SOC_GDMA_PAIRS_PER_GROUP_MAX=5 -CONFIG_SOC_AHB_GDMA_SUPPORT_PSRAM=y -CONFIG_SOC_GPIO_PORT=1 -CONFIG_SOC_GPIO_PIN_COUNT=49 -CONFIG_SOC_GPIO_SUPPORT_PIN_GLITCH_FILTER=y -CONFIG_SOC_GPIO_FILTER_CLK_SUPPORT_APB=y -CONFIG_SOC_GPIO_SUPPORT_RTC_INDEPENDENT=y -CONFIG_SOC_GPIO_SUPPORT_FORCE_HOLD=y -CONFIG_SOC_GPIO_VALID_GPIO_MASK=0x1FFFFFFFFFFFF -CONFIG_SOC_GPIO_IN_RANGE_MAX=48 -CONFIG_SOC_GPIO_OUT_RANGE_MAX=48 -CONFIG_SOC_GPIO_VALID_DIGITAL_IO_PAD_MASK=0x0001FFFFFC000000 -CONFIG_SOC_GPIO_CLOCKOUT_BY_IO_MUX=y -CONFIG_SOC_GPIO_CLOCKOUT_CHANNEL_NUM=3 -CONFIG_SOC_GPIO_SUPPORT_HOLD_IO_IN_DSLP=y -CONFIG_SOC_DEDIC_GPIO_OUT_CHANNELS_NUM=8 -CONFIG_SOC_DEDIC_GPIO_IN_CHANNELS_NUM=8 -CONFIG_SOC_DEDIC_GPIO_OUT_AUTO_ENABLE=y -CONFIG_SOC_I2C_NUM=2 -CONFIG_SOC_HP_I2C_NUM=2 -CONFIG_SOC_I2C_FIFO_LEN=32 -CONFIG_SOC_I2C_CMD_REG_NUM=8 -CONFIG_SOC_I2C_SUPPORT_SLAVE=y -CONFIG_SOC_I2C_SUPPORT_HW_CLR_BUS=y -CONFIG_SOC_I2C_SUPPORT_XTAL=y -CONFIG_SOC_I2C_SUPPORT_RTC=y -CONFIG_SOC_I2C_SUPPORT_10BIT_ADDR=y -CONFIG_SOC_I2C_SLAVE_SUPPORT_BROADCAST=y -CONFIG_SOC_I2C_SLAVE_SUPPORT_I2CRAM_ACCESS=y -CONFIG_SOC_I2C_SLAVE_CAN_GET_STRETCH_CAUSE=y -CONFIG_SOC_I2S_NUM=2 -CONFIG_SOC_I2S_HW_VERSION_2=y -CONFIG_SOC_I2S_SUPPORTS_XTAL=y -CONFIG_SOC_I2S_SUPPORTS_PLL_F160M=y -CONFIG_SOC_I2S_SUPPORTS_PCM=y -CONFIG_SOC_I2S_SUPPORTS_PDM=y -CONFIG_SOC_I2S_SUPPORTS_PDM_TX=y -CONFIG_SOC_I2S_SUPPORTS_PCM2PDM=y -CONFIG_SOC_I2S_SUPPORTS_PDM_RX=y -CONFIG_SOC_I2S_SUPPORTS_PDM2PCM=y -CONFIG_SOC_I2S_PDM_MAX_TX_LINES=2 -CONFIG_SOC_I2S_PDM_MAX_RX_LINES=4 -CONFIG_SOC_I2S_SUPPORTS_TDM=y -CONFIG_SOC_LEDC_SUPPORT_APB_CLOCK=y -CONFIG_SOC_LEDC_SUPPORT_XTAL_CLOCK=y -CONFIG_SOC_LEDC_TIMER_NUM=4 -CONFIG_SOC_LEDC_CHANNEL_NUM=8 -CONFIG_SOC_LEDC_TIMER_BIT_WIDTH=14 -CONFIG_SOC_LEDC_SUPPORT_FADE_STOP=y -CONFIG_SOC_MCPWM_GROUPS=2 -CONFIG_SOC_MCPWM_TIMERS_PER_GROUP=3 -CONFIG_SOC_MCPWM_OPERATORS_PER_GROUP=3 -CONFIG_SOC_MCPWM_COMPARATORS_PER_OPERATOR=2 -CONFIG_SOC_MCPWM_GENERATORS_PER_OPERATOR=2 -CONFIG_SOC_MCPWM_TRIGGERS_PER_OPERATOR=2 -CONFIG_SOC_MCPWM_GPIO_FAULTS_PER_GROUP=3 -CONFIG_SOC_MCPWM_CAPTURE_TIMERS_PER_GROUP=y -CONFIG_SOC_MCPWM_CAPTURE_CHANNELS_PER_TIMER=3 -CONFIG_SOC_MCPWM_GPIO_SYNCHROS_PER_GROUP=3 -CONFIG_SOC_MCPWM_SWSYNC_CAN_PROPAGATE=y -CONFIG_SOC_MMU_LINEAR_ADDRESS_REGION_NUM=1 -CONFIG_SOC_MMU_PERIPH_NUM=1 -CONFIG_SOC_MPU_MIN_REGION_SIZE=0x20000000 -CONFIG_SOC_MPU_REGIONS_MAX_NUM=8 -CONFIG_SOC_PCNT_GROUPS=1 -CONFIG_SOC_PCNT_UNITS_PER_GROUP=4 -CONFIG_SOC_PCNT_CHANNELS_PER_UNIT=2 -CONFIG_SOC_PCNT_THRES_POINT_PER_UNIT=2 -CONFIG_SOC_RMT_GROUPS=1 -CONFIG_SOC_RMT_TX_CANDIDATES_PER_GROUP=4 -CONFIG_SOC_RMT_RX_CANDIDATES_PER_GROUP=4 -CONFIG_SOC_RMT_CHANNELS_PER_GROUP=8 -CONFIG_SOC_RMT_MEM_WORDS_PER_CHANNEL=48 -CONFIG_SOC_RMT_SUPPORT_RX_PINGPONG=y -CONFIG_SOC_RMT_SUPPORT_RX_DEMODULATION=y -CONFIG_SOC_RMT_SUPPORT_TX_ASYNC_STOP=y -CONFIG_SOC_RMT_SUPPORT_TX_LOOP_COUNT=y -CONFIG_SOC_RMT_SUPPORT_TX_LOOP_AUTO_STOP=y -CONFIG_SOC_RMT_SUPPORT_TX_SYNCHRO=y -CONFIG_SOC_RMT_SUPPORT_TX_CARRIER_DATA_ONLY=y -CONFIG_SOC_RMT_SUPPORT_XTAL=y -CONFIG_SOC_RMT_SUPPORT_RC_FAST=y -CONFIG_SOC_RMT_SUPPORT_APB=y -CONFIG_SOC_RMT_SUPPORT_DMA=y -CONFIG_SOC_LCD_I80_SUPPORTED=y -CONFIG_SOC_LCD_RGB_SUPPORTED=y -CONFIG_SOC_LCD_I80_BUSES=1 -CONFIG_SOC_LCD_RGB_PANELS=1 -CONFIG_SOC_LCD_I80_BUS_WIDTH=16 -CONFIG_SOC_LCD_RGB_DATA_WIDTH=16 -CONFIG_SOC_LCD_SUPPORT_RGB_YUV_CONV=y -CONFIG_SOC_LCDCAM_I80_NUM_BUSES=1 -CONFIG_SOC_LCDCAM_I80_BUS_WIDTH=16 -CONFIG_SOC_LCDCAM_RGB_NUM_PANELS=1 -CONFIG_SOC_LCDCAM_RGB_DATA_WIDTH=16 -CONFIG_SOC_RTC_CNTL_CPU_PD_DMA_BUS_WIDTH=128 -CONFIG_SOC_RTC_CNTL_CPU_PD_REG_FILE_NUM=549 -CONFIG_SOC_RTC_CNTL_TAGMEM_PD_DMA_BUS_WIDTH=128 -CONFIG_SOC_RTCIO_PIN_COUNT=22 -CONFIG_SOC_RTCIO_INPUT_OUTPUT_SUPPORTED=y -CONFIG_SOC_RTCIO_HOLD_SUPPORTED=y -CONFIG_SOC_RTCIO_WAKE_SUPPORTED=y -CONFIG_SOC_LP_IO_CLOCK_IS_INDEPENDENT=y -CONFIG_SOC_SDM_GROUPS=1 -CONFIG_SOC_SDM_CHANNELS_PER_GROUP=8 -CONFIG_SOC_SDM_CLK_SUPPORT_APB=y -CONFIG_SOC_SPI_PERIPH_NUM=3 -CONFIG_SOC_SPI_MAX_CS_NUM=6 -CONFIG_SOC_SPI_MAXIMUM_BUFFER_SIZE=64 -CONFIG_SOC_SPI_SUPPORT_DDRCLK=y -CONFIG_SOC_SPI_SLAVE_SUPPORT_SEG_TRANS=y -CONFIG_SOC_SPI_SUPPORT_CD_SIG=y -CONFIG_SOC_SPI_SUPPORT_CONTINUOUS_TRANS=y -CONFIG_SOC_SPI_SUPPORT_SLAVE_HD_VER2=y -CONFIG_SOC_SPI_SUPPORT_CLK_APB=y -CONFIG_SOC_SPI_SUPPORT_CLK_XTAL=y -CONFIG_SOC_SPI_PERIPH_SUPPORT_CONTROL_DUMMY_OUT=y -CONFIG_SOC_MEMSPI_IS_INDEPENDENT=y -CONFIG_SOC_SPI_MAX_PRE_DIVIDER=16 -CONFIG_SOC_SPI_SUPPORT_OCT=y -CONFIG_SOC_SPI_SCT_SUPPORTED=y -CONFIG_SOC_SPI_SCT_REG_NUM=14 -CONFIG_SOC_SPI_SCT_BUFFER_NUM_MAX=y -CONFIG_SOC_SPI_SCT_CONF_BITLEN_MAX=0x3FFFA -CONFIG_SOC_MEMSPI_SRC_FREQ_120M_SUPPORTED=y -CONFIG_SOC_MEMSPI_SRC_FREQ_80M_SUPPORTED=y -CONFIG_SOC_MEMSPI_SRC_FREQ_40M_SUPPORTED=y -CONFIG_SOC_MEMSPI_SRC_FREQ_20M_SUPPORTED=y -CONFIG_SOC_SPIRAM_SUPPORTED=y -CONFIG_SOC_SPIRAM_XIP_SUPPORTED=y -CONFIG_SOC_SYSTIMER_COUNTER_NUM=2 -CONFIG_SOC_SYSTIMER_ALARM_NUM=3 -CONFIG_SOC_SYSTIMER_BIT_WIDTH_LO=32 -CONFIG_SOC_SYSTIMER_BIT_WIDTH_HI=20 -CONFIG_SOC_SYSTIMER_FIXED_DIVIDER=y -CONFIG_SOC_SYSTIMER_INT_LEVEL=y -CONFIG_SOC_SYSTIMER_ALARM_MISS_COMPENSATE=y -CONFIG_SOC_TIMER_GROUPS=2 -CONFIG_SOC_TIMER_GROUP_TIMERS_PER_GROUP=2 -CONFIG_SOC_TIMER_GROUP_COUNTER_BIT_WIDTH=54 -CONFIG_SOC_TIMER_GROUP_SUPPORT_XTAL=y -CONFIG_SOC_TIMER_GROUP_SUPPORT_APB=y -CONFIG_SOC_TIMER_GROUP_TOTAL_TIMERS=4 -CONFIG_SOC_LP_TIMER_BIT_WIDTH_LO=32 -CONFIG_SOC_LP_TIMER_BIT_WIDTH_HI=16 -CONFIG_SOC_TOUCH_SENSOR_VERSION=2 -CONFIG_SOC_TOUCH_SENSOR_NUM=15 -CONFIG_SOC_TOUCH_MIN_CHAN_ID=1 -CONFIG_SOC_TOUCH_MAX_CHAN_ID=14 -CONFIG_SOC_TOUCH_SUPPORT_BENCHMARK=y -CONFIG_SOC_TOUCH_SUPPORT_SLEEP_WAKEUP=y -CONFIG_SOC_TOUCH_SUPPORT_WATERPROOF=y -CONFIG_SOC_TOUCH_SUPPORT_PROX_SENSING=y -CONFIG_SOC_TOUCH_SUPPORT_DENOISE_CHAN=y -CONFIG_SOC_TOUCH_PROXIMITY_CHANNEL_NUM=3 -CONFIG_SOC_TOUCH_PROXIMITY_MEAS_DONE_SUPPORTED=y -CONFIG_SOC_TOUCH_SAMPLE_CFG_NUM=1 -CONFIG_SOC_TWAI_CONTROLLER_NUM=1 -CONFIG_SOC_TWAI_MASK_FILTER_NUM=1 -CONFIG_SOC_TWAI_CLK_SUPPORT_APB=y -CONFIG_SOC_TWAI_BRP_MIN=2 -CONFIG_SOC_TWAI_BRP_MAX=16384 -CONFIG_SOC_TWAI_SUPPORTS_RX_STATUS=y -CONFIG_SOC_UART_NUM=3 -CONFIG_SOC_UART_HP_NUM=3 -CONFIG_SOC_UART_FIFO_LEN=128 -CONFIG_SOC_UART_BITRATE_MAX=5000000 -CONFIG_SOC_UART_SUPPORT_FSM_TX_WAIT_SEND=y -CONFIG_SOC_UART_SUPPORT_WAKEUP_INT=y -CONFIG_SOC_UART_SUPPORT_APB_CLK=y -CONFIG_SOC_UART_SUPPORT_RTC_CLK=y -CONFIG_SOC_UART_SUPPORT_XTAL_CLK=y -CONFIG_SOC_UART_WAKEUP_SUPPORT_ACTIVE_THRESH_MODE=y -CONFIG_SOC_UHCI_NUM=1 -CONFIG_SOC_USB_OTG_PERIPH_NUM=1 -CONFIG_SOC_SHA_DMA_MAX_BUFFER_SIZE=3968 -CONFIG_SOC_SHA_SUPPORT_DMA=y -CONFIG_SOC_SHA_SUPPORT_RESUME=y -CONFIG_SOC_SHA_GDMA=y -CONFIG_SOC_SHA_SUPPORT_SHA1=y -CONFIG_SOC_SHA_SUPPORT_SHA224=y -CONFIG_SOC_SHA_SUPPORT_SHA256=y -CONFIG_SOC_SHA_SUPPORT_SHA384=y -CONFIG_SOC_SHA_SUPPORT_SHA512=y -CONFIG_SOC_SHA_SUPPORT_SHA512_224=y -CONFIG_SOC_SHA_SUPPORT_SHA512_256=y -CONFIG_SOC_SHA_SUPPORT_SHA512_T=y -CONFIG_SOC_MPI_MEM_BLOCKS_NUM=4 -CONFIG_SOC_MPI_OPERATIONS_NUM=3 -CONFIG_SOC_RSA_MAX_BIT_LEN=4096 -CONFIG_SOC_AES_SUPPORT_DMA=y -CONFIG_SOC_AES_GDMA=y -CONFIG_SOC_AES_SUPPORT_AES_128=y -CONFIG_SOC_AES_SUPPORT_AES_256=y -CONFIG_SOC_PM_SUPPORT_EXT0_WAKEUP=y -CONFIG_SOC_PM_SUPPORT_EXT1_WAKEUP=y -CONFIG_SOC_PM_SUPPORT_EXT_WAKEUP=y -CONFIG_SOC_PM_SUPPORT_WIFI_WAKEUP=y -CONFIG_SOC_PM_SUPPORT_BT_WAKEUP=y -CONFIG_SOC_PM_SUPPORT_TOUCH_SENSOR_WAKEUP=y -CONFIG_SOC_PM_SUPPORT_CPU_PD=y -CONFIG_SOC_PM_SUPPORT_TAGMEM_PD=y -CONFIG_SOC_PM_SUPPORT_RTC_PERIPH_PD=y -CONFIG_SOC_PM_SUPPORT_RC_FAST_PD=y -CONFIG_SOC_PM_SUPPORT_VDDSDIO_PD=y -CONFIG_SOC_PM_SUPPORT_MAC_BB_PD=y -CONFIG_SOC_PM_SUPPORT_MODEM_PD=y -CONFIG_SOC_CONFIGURABLE_VDDSDIO_SUPPORTED=y -CONFIG_SOC_PM_SUPPORT_DEEPSLEEP_CHECK_STUB_ONLY=y -CONFIG_SOC_PM_CPU_RETENTION_BY_RTCCNTL=y -CONFIG_SOC_PM_MODEM_RETENTION_BY_BACKUPDMA=y -CONFIG_SOC_PM_MODEM_PD_BY_SW=y -CONFIG_SOC_CLK_RC_FAST_D256_SUPPORTED=y -CONFIG_SOC_RTC_SLOW_CLK_SUPPORT_RC_FAST_D256=y -CONFIG_SOC_CLK_RC_FAST_SUPPORT_CALIBRATION=y -CONFIG_SOC_CLK_XTAL32K_SUPPORTED=y -CONFIG_SOC_CLK_LP_FAST_SUPPORT_XTAL_D2=y -CONFIG_SOC_EFUSE_DIS_DOWNLOAD_ICACHE=y -CONFIG_SOC_EFUSE_DIS_DOWNLOAD_DCACHE=y -CONFIG_SOC_EFUSE_HARD_DIS_JTAG=y -CONFIG_SOC_EFUSE_DIS_USB_JTAG=y -CONFIG_SOC_EFUSE_SOFT_DIS_JTAG=y -CONFIG_SOC_EFUSE_DIS_DIRECT_BOOT=y -CONFIG_SOC_EFUSE_DIS_ICACHE=y -CONFIG_SOC_EFUSE_BLOCK9_KEY_PURPOSE_QUIRK=y -CONFIG_SOC_SECURE_BOOT_V2_RSA=y -CONFIG_SOC_EFUSE_SECURE_BOOT_KEY_DIGESTS=3 -CONFIG_SOC_EFUSE_REVOKE_BOOT_KEY_DIGESTS=y -CONFIG_SOC_SUPPORT_SECURE_BOOT_REVOKE_KEY=y -CONFIG_SOC_FLASH_ENCRYPTED_XTS_AES_BLOCK_MAX=64 -CONFIG_SOC_FLASH_ENCRYPTION_XTS_AES=y -CONFIG_SOC_FLASH_ENCRYPTION_XTS_AES_OPTIONS=y -CONFIG_SOC_FLASH_ENCRYPTION_XTS_AES_128=y -CONFIG_SOC_FLASH_ENCRYPTION_XTS_AES_256=y -CONFIG_SOC_MEMPROT_CPU_PREFETCH_PAD_SIZE=16 -CONFIG_SOC_MEMPROT_MEM_ALIGN_SIZE=256 -CONFIG_SOC_PHY_DIG_REGS_MEM_SIZE=21 -CONFIG_SOC_MAC_BB_PD_MEM_SIZE=192 -CONFIG_SOC_WIFI_LIGHT_SLEEP_CLK_WIDTH=12 -CONFIG_SOC_SPI_MEM_SUPPORT_AUTO_WAIT_IDLE=y -CONFIG_SOC_SPI_MEM_SUPPORT_AUTO_SUSPEND=y -CONFIG_SOC_SPI_MEM_SUPPORT_AUTO_RESUME=y -CONFIG_SOC_SPI_MEM_SUPPORT_SW_SUSPEND=y -CONFIG_SOC_SPI_MEM_SUPPORT_FLASH_OPI_MODE=y -CONFIG_SOC_SPI_MEM_SUPPORT_TIMING_TUNING=y -CONFIG_SOC_SPI_MEM_SUPPORT_CONFIG_GPIO_BY_EFUSE=y -CONFIG_SOC_SPI_MEM_SUPPORT_WRAP=y -CONFIG_SOC_MEMSPI_TIMING_TUNING_BY_MSPI_DELAY=y -CONFIG_SOC_MEMSPI_CORE_CLK_SHARED_WITH_PSRAM=y -CONFIG_SOC_SPI_MEM_SUPPORT_CACHE_32BIT_ADDR_MAP=y -CONFIG_SOC_COEX_HW_PTI=y -CONFIG_SOC_EXTERNAL_COEX_LEADER_TX_LINE=y -CONFIG_SOC_SDMMC_USE_GPIO_MATRIX=y -CONFIG_SOC_SDMMC_NUM_SLOTS=2 -CONFIG_SOC_SDMMC_SUPPORT_XTAL_CLOCK=y -CONFIG_SOC_SDMMC_DELAY_PHASE_NUM=4 -CONFIG_SOC_TEMPERATURE_SENSOR_SUPPORT_FAST_RC=y -CONFIG_SOC_WIFI_HW_TSF=y -CONFIG_SOC_WIFI_FTM_SUPPORT=y -CONFIG_SOC_WIFI_GCMP_SUPPORT=y -CONFIG_SOC_WIFI_WAPI_SUPPORT=y -CONFIG_SOC_WIFI_CSI_SUPPORT=y -CONFIG_SOC_WIFI_MESH_SUPPORT=y -CONFIG_SOC_WIFI_SUPPORT_VARIABLE_BEACON_WINDOW=y -CONFIG_SOC_WIFI_PHY_NEEDS_USB_WORKAROUND=y -CONFIG_SOC_BLE_SUPPORTED=y -CONFIG_SOC_BLE_MESH_SUPPORTED=y -CONFIG_SOC_BLE_50_SUPPORTED=y -CONFIG_SOC_BLE_DEVICE_PRIVACY_SUPPORTED=y -CONFIG_SOC_BLUFI_SUPPORTED=y -CONFIG_SOC_ULP_HAS_ADC=y -CONFIG_SOC_PHY_COMBO_MODULE=y -CONFIG_SOC_LCDCAM_CAM_SUPPORT_RGB_YUV_CONV=y -CONFIG_SOC_LCDCAM_CAM_PERIPH_NUM=1 -CONFIG_SOC_LCDCAM_CAM_DATA_WIDTH_MAX=16 -CONFIG_IDF_CMAKE=y -CONFIG_IDF_TOOLCHAIN="gcc" -CONFIG_IDF_TOOLCHAIN_GCC=y -CONFIG_IDF_TARGET_ARCH_XTENSA=y -CONFIG_IDF_TARGET_ARCH="xtensa" -CONFIG_IDF_TARGET="esp32s3" -CONFIG_IDF_INIT_VERSION="5.5.1" -CONFIG_IDF_TARGET_ESP32S3=y -CONFIG_IDF_FIRMWARE_CHIP_ID=0x0009 - -# -# Build type -# -CONFIG_APP_BUILD_TYPE_APP_2NDBOOT=y -# CONFIG_APP_BUILD_TYPE_RAM is not set -CONFIG_APP_BUILD_GENERATE_BINARIES=y -CONFIG_APP_BUILD_BOOTLOADER=y -CONFIG_APP_BUILD_USE_FLASH_SECTIONS=y -# CONFIG_APP_REPRODUCIBLE_BUILD is not set -# CONFIG_APP_NO_BLOBS is not set -# end of Build type - -# -# Bootloader config -# - -# -# Bootloader manager -# -CONFIG_BOOTLOADER_COMPILE_TIME_DATE=y -CONFIG_BOOTLOADER_PROJECT_VER=1 -# end of Bootloader manager - -# -# Application Rollback -# -CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE=y -# CONFIG_BOOTLOADER_APP_ANTI_ROLLBACK is not set -# end of Application Rollback - -# -# Recovery Bootloader and Rollback -# -# end of Recovery Bootloader and Rollback - -CONFIG_BOOTLOADER_OFFSET_IN_FLASH=0x0 -CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE=y -# CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_DEBUG is not set -# CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_PERF is not set -# CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_NONE is not set - -# -# Log -# -CONFIG_BOOTLOADER_LOG_VERSION_1=y -CONFIG_BOOTLOADER_LOG_VERSION=1 -# CONFIG_BOOTLOADER_LOG_LEVEL_NONE is not set -# CONFIG_BOOTLOADER_LOG_LEVEL_ERROR is not set -# CONFIG_BOOTLOADER_LOG_LEVEL_WARN is not set -CONFIG_BOOTLOADER_LOG_LEVEL_INFO=y -# CONFIG_BOOTLOADER_LOG_LEVEL_DEBUG is not set -# CONFIG_BOOTLOADER_LOG_LEVEL_VERBOSE is not set -CONFIG_BOOTLOADER_LOG_LEVEL=3 - -# -# Format -# -# CONFIG_BOOTLOADER_LOG_COLORS is not set -CONFIG_BOOTLOADER_LOG_TIMESTAMP_SOURCE_CPU_TICKS=y -# end of Format - -# -# Settings -# -CONFIG_BOOTLOADER_LOG_MODE_TEXT_EN=y -CONFIG_BOOTLOADER_LOG_MODE_TEXT=y -# end of Settings -# end of Log - -# -# Serial Flash Configurations -# -# CONFIG_BOOTLOADER_FLASH_DC_AWARE is not set -CONFIG_BOOTLOADER_FLASH_XMC_SUPPORT=y -# end of Serial Flash Configurations - -CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_9V=y -# CONFIG_BOOTLOADER_FACTORY_RESET is not set -# CONFIG_BOOTLOADER_APP_TEST is not set -CONFIG_BOOTLOADER_REGION_PROTECTION_ENABLE=y -CONFIG_BOOTLOADER_WDT_ENABLE=y -# CONFIG_BOOTLOADER_WDT_DISABLE_IN_USER_CODE is not set -CONFIG_BOOTLOADER_WDT_TIME_MS=9000 -# CONFIG_BOOTLOADER_SKIP_VALIDATE_IN_DEEP_SLEEP is not set -# CONFIG_BOOTLOADER_SKIP_VALIDATE_ON_POWER_ON is not set -# CONFIG_BOOTLOADER_SKIP_VALIDATE_ALWAYS is not set -CONFIG_BOOTLOADER_RESERVE_RTC_SIZE=0 -# CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC is not set -# end of Bootloader config - -# -# Security features -# -CONFIG_SECURE_BOOT_V2_RSA_SUPPORTED=y -CONFIG_SECURE_BOOT_V2_PREFERRED=y -# CONFIG_SECURE_SIGNED_APPS_NO_SECURE_BOOT is not set -# CONFIG_SECURE_BOOT is not set -# CONFIG_SECURE_FLASH_ENC_ENABLED is not set -CONFIG_SECURE_ROM_DL_MODE_ENABLED=y -# end of Security features - -# -# Application manager -# -CONFIG_APP_COMPILE_TIME_DATE=y -# CONFIG_APP_EXCLUDE_PROJECT_VER_VAR is not set -# CONFIG_APP_EXCLUDE_PROJECT_NAME_VAR is not set -# CONFIG_APP_PROJECT_VER_FROM_CONFIG is not set -CONFIG_APP_RETRIEVE_LEN_ELF_SHA=16 -# end of Application manager - -CONFIG_ESP_ROM_HAS_CRC_LE=y -CONFIG_ESP_ROM_HAS_CRC_BE=y -CONFIG_ESP_ROM_HAS_MZ_CRC32=y -CONFIG_ESP_ROM_HAS_JPEG_DECODE=y -CONFIG_ESP_ROM_UART_CLK_IS_XTAL=y -CONFIG_ESP_ROM_HAS_RETARGETABLE_LOCKING=y -CONFIG_ESP_ROM_USB_OTG_NUM=3 -CONFIG_ESP_ROM_USB_SERIAL_DEVICE_NUM=4 -CONFIG_ESP_ROM_HAS_ERASE_0_REGION_BUG=y -CONFIG_ESP_ROM_HAS_ENCRYPTED_WRITES_USING_LEGACY_DRV=y -CONFIG_ESP_ROM_GET_CLK_FREQ=y -CONFIG_ESP_ROM_HAS_HAL_WDT=y -CONFIG_ESP_ROM_NEEDS_SWSETUP_WORKAROUND=y -CONFIG_ESP_ROM_HAS_LAYOUT_TABLE=y -CONFIG_ESP_ROM_HAS_SPI_FLASH=y -CONFIG_ESP_ROM_HAS_SPI_FLASH_MMAP=y -CONFIG_ESP_ROM_HAS_ETS_PRINTF_BUG=y -CONFIG_ESP_ROM_HAS_NEWLIB=y -CONFIG_ESP_ROM_HAS_NEWLIB_NANO_FORMAT=y -CONFIG_ESP_ROM_HAS_NEWLIB_32BIT_TIME=y -CONFIG_ESP_ROM_NEEDS_SET_CACHE_MMU_SIZE=y -CONFIG_ESP_ROM_RAM_APP_NEEDS_MMU_INIT=y -CONFIG_ESP_ROM_HAS_FLASH_COUNT_PAGES_BUG=y -CONFIG_ESP_ROM_HAS_CACHE_SUSPEND_WAITI_BUG=y -CONFIG_ESP_ROM_HAS_CACHE_WRITEBACK_BUG=y -CONFIG_ESP_ROM_HAS_SW_FLOAT=y -CONFIG_ESP_ROM_HAS_VERSION=y -CONFIG_ESP_ROM_SUPPORT_DEEP_SLEEP_WAKEUP_STUB=y -CONFIG_ESP_ROM_HAS_OUTPUT_PUTC_FUNC=y -CONFIG_ESP_ROM_CONSOLE_OUTPUT_SECONDARY=y - -# -# Boot ROM Behavior -# -CONFIG_BOOT_ROM_LOG_ALWAYS_ON=y -# CONFIG_BOOT_ROM_LOG_ALWAYS_OFF is not set -# CONFIG_BOOT_ROM_LOG_ON_GPIO_HIGH is not set -# CONFIG_BOOT_ROM_LOG_ON_GPIO_LOW is not set -# end of Boot ROM Behavior - -# -# Serial flasher config -# -# CONFIG_ESPTOOLPY_NO_STUB is not set -# CONFIG_ESPTOOLPY_OCT_FLASH is not set -CONFIG_ESPTOOLPY_FLASH_MODE_AUTO_DETECT=y -# CONFIG_ESPTOOLPY_FLASHMODE_QIO is not set -# CONFIG_ESPTOOLPY_FLASHMODE_QOUT is not set -CONFIG_ESPTOOLPY_FLASHMODE_DIO=y -# CONFIG_ESPTOOLPY_FLASHMODE_DOUT is not set -CONFIG_ESPTOOLPY_FLASH_SAMPLE_MODE_STR=y -CONFIG_ESPTOOLPY_FLASHMODE="dio" -# CONFIG_ESPTOOLPY_FLASHFREQ_120M is not set -CONFIG_ESPTOOLPY_FLASHFREQ_80M=y -# CONFIG_ESPTOOLPY_FLASHFREQ_40M is not set -# CONFIG_ESPTOOLPY_FLASHFREQ_20M is not set -CONFIG_ESPTOOLPY_FLASHFREQ="80m" -# CONFIG_ESPTOOLPY_FLASHSIZE_1MB is not set -# CONFIG_ESPTOOLPY_FLASHSIZE_2MB is not set -CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y -# CONFIG_ESPTOOLPY_FLASHSIZE_8MB is not set -# CONFIG_ESPTOOLPY_FLASHSIZE_16MB is not set -# CONFIG_ESPTOOLPY_FLASHSIZE_32MB is not set -# CONFIG_ESPTOOLPY_FLASHSIZE_64MB is not set -# CONFIG_ESPTOOLPY_FLASHSIZE_128MB is not set -CONFIG_ESPTOOLPY_FLASHSIZE="4MB" -# CONFIG_ESPTOOLPY_HEADER_FLASHSIZE_UPDATE is not set -CONFIG_ESPTOOLPY_BEFORE_RESET=y -# CONFIG_ESPTOOLPY_BEFORE_NORESET is not set -CONFIG_ESPTOOLPY_BEFORE="default_reset" -CONFIG_ESPTOOLPY_AFTER_RESET=y -# CONFIG_ESPTOOLPY_AFTER_NORESET is not set -CONFIG_ESPTOOLPY_AFTER="hard_reset" -CONFIG_ESPTOOLPY_MONITOR_BAUD=115200 -# end of Serial flasher config - -# -# Partition Table -# -# CONFIG_PARTITION_TABLE_SINGLE_APP is not set -# CONFIG_PARTITION_TABLE_SINGLE_APP_LARGE is not set -# CONFIG_PARTITION_TABLE_TWO_OTA is not set -# CONFIG_PARTITION_TABLE_TWO_OTA_LARGE is not set -CONFIG_PARTITION_TABLE_CUSTOM=y -CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv" -CONFIG_PARTITION_TABLE_FILENAME="partitions.csv" -CONFIG_PARTITION_TABLE_OFFSET=0x8000 -CONFIG_PARTITION_TABLE_MD5=y -# end of Partition Table - -# -# Snapclient Configuration -# -CONFIG_SNAPSERVER_USE_MDNS=y -# CONFIG_SNAPCLIENT_CONNECT_IPV6 is not set -CONFIG_SNAPCLIENT_NAME="louder-esp32s3" - -# -# HTTP Server Setting -# -CONFIG_WEB_PORT=80 -# end of HTTP Server Setting - -CONFIG_USE_SAMPLE_INSERTION=y -# end of Snapclient Configuration - -# -# Audio Board -# -CONFIG_AUDIO_BOARD_CUSTOM=y -# CONFIG_ESP_LYRAT_V4_3_BOARD is not set -# CONFIG_ESP_LYRAT_V4_2_BOARD is not set -# CONFIG_ESP_LYRATD_MSC_V2_1_BOARD is not set -# CONFIG_ESP_LYRATD_MSC_V2_2_BOARD is not set -# CONFIG_ESP_LYRAT_MINI_V1_1_BOARD is not set -# CONFIG_ESP32_KORVO_DU1906_BOARD is not set -# CONFIG_ESP32_S2_KALUGA_1_V1_2_BOARD is not set -# CONFIG_ESP_AI_THINKER_ES8388_BOARD is not set - -# -# Custom Audio Board -# -# CONFIG_DAC_PCM51XX is not set -# CONFIG_DAC_PCM5102A is not set -# CONFIG_DAC_MA120 is not set -# CONFIG_DAC_MA120X0 is not set -# CONFIG_DAC_ADAU1961 is not set -# CONFIG_DAC_MAX98357 is not set -CONFIG_DAC_TAS5805M=y -# CONFIG_DAC_PT8211 is not set - -# -# DAC I2C control interface -# -CONFIG_DAC_I2C_SDA=8 -CONFIG_DAC_I2C_SCL=9 -CONFIG_DAC_I2C_ADDR=0x2D -# end of DAC I2C control interface - -# -# I2S master interface -# -CONFIG_MASTER_I2S_MCLK_PIN=0 -CONFIG_MASTER_I2S_BCK_PIN=14 -CONFIG_MASTER_I2S_LRCK_PIN=15 -CONFIG_MASTER_I2S_DATAOUT_PIN=16 -# end of I2S master interface - -# -# TAS5805M interface Configuration -# -CONFIG_PIN_DAC_PWDN=17 -# end of TAS5805M interface Configuration - -# -# DAC-Operation-Mode -# -CONFIG_DAC_BRIDGE_MODE_DISABLED=y -# CONFIG_DAC_BRIDGE_MODE_MONO is not set -# CONFIG_DAC_BRIDGE_MODE_LEFT is not set -# CONFIG_DAC_BRIDGE_MODE_RIGHT is not set -# end of DAC-Operation-Mode - -# -# Logic-Level-Settings -# -# CONFIG_INVERT_MCLK_LEVEL is not set -# CONFIG_INVERT_WORD_SELECT_LEVEL is not set -# CONFIG_INVERT_BCLK_LEVEL is not set -# end of Logic-Level-Settings -# end of Custom Audio Board -# end of Audio Board - -# -# ESP32 DSP processor config -# -CONFIG_USE_DSP_PROCESSOR=y -# CONFIG_SNAPCLIENT_MIX_LR_TO_MONO is not set -# CONFIG_USE_BIQUAD_ASM is not set -# CONFIG_SNAPCLIENT_USE_SOFT_VOL is not set -# end of ESP32 DSP processor config - -# -# SNTP Configuration -# -CONFIG_SNTP_TIMEZONE="UTC" -CONFIG_SNTP_SERVER="pool.ntp.org" -# end of SNTP Configuration - -# -# Snapclient Ethernet Configuration -# -CONFIG_ENV_GPIO_RANGE_MIN=0 -CONFIG_ENV_GPIO_RANGE_MAX=48 -CONFIG_ENV_GPIO_IN_RANGE_MAX=48 -CONFIG_ENV_GPIO_OUT_RANGE_MAX=48 -# CONFIG_SNAPCLIENT_USE_SPI_ETHERNET is not set -# end of Snapclient Ethernet Configuration - -# -# Wifi Configuration -# -CONFIG_ENABLE_WIFI_PROVISIONING=y -# CONFIG_WIFI_AUTH_WEP is not set -# CONFIG_WIFI_AUTH_WPA_PSK is not set -# CONFIG_WIFI_AUTH_WPA2_PSK is not set -# CONFIG_WIFI_AUTH_WPA_WPA2_PSK is not set -CONFIG_WIFI_AUTH_WPA2_WPA3_PSK=y -# CONFIG_WIFI_AUTH_ENTERPRISE is not set -# CONFIG_WIFI_AUTH_WPA2_ENTERPRISE is not set -# CONFIG_WIFI_AUTH_WPA3_PSK is not set -# CONFIG_WIFI_AUTH_WPA3_ENT_192 is not set -# CONFIG_WIFI_AUTH_WAPI_PSK is not set -# CONFIG_WIFI_AUTH_OWE is not set -CONFIG_WIFI_MAXIMUM_RETRY=0 -# end of Wifi Configuration - -# -# Compiler options -# -# CONFIG_COMPILER_OPTIMIZATION_DEBUG is not set -# CONFIG_COMPILER_OPTIMIZATION_SIZE is not set -CONFIG_COMPILER_OPTIMIZATION_PERF=y -# CONFIG_COMPILER_OPTIMIZATION_NONE is not set -CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE=y -# CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT is not set -# CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE is not set -CONFIG_COMPILER_ASSERT_NDEBUG_EVALUATE=y -CONFIG_COMPILER_FLOAT_LIB_FROM_GCCLIB=y -CONFIG_COMPILER_OPTIMIZATION_ASSERTION_LEVEL=2 -# CONFIG_COMPILER_OPTIMIZATION_CHECKS_SILENT is not set -CONFIG_COMPILER_HIDE_PATHS_MACROS=y -# CONFIG_COMPILER_CXX_EXCEPTIONS is not set -# CONFIG_COMPILER_CXX_RTTI is not set -CONFIG_COMPILER_STACK_CHECK_MODE_NONE=y -# CONFIG_COMPILER_STACK_CHECK_MODE_NORM is not set -# CONFIG_COMPILER_STACK_CHECK_MODE_STRONG is not set -# CONFIG_COMPILER_STACK_CHECK_MODE_ALL is not set -# CONFIG_COMPILER_NO_MERGE_CONSTANTS is not set -# CONFIG_COMPILER_WARN_WRITE_STRINGS is not set -CONFIG_COMPILER_DISABLE_DEFAULT_ERRORS=y -# CONFIG_COMPILER_DISABLE_GCC12_WARNINGS is not set -# CONFIG_COMPILER_DISABLE_GCC13_WARNINGS is not set -# CONFIG_COMPILER_DISABLE_GCC14_WARNINGS is not set -# CONFIG_COMPILER_DUMP_RTL_FILES is not set -CONFIG_COMPILER_RT_LIB_GCCLIB=y -CONFIG_COMPILER_RT_LIB_NAME="gcc" -CONFIG_COMPILER_ORPHAN_SECTIONS_WARNING=y -# CONFIG_COMPILER_ORPHAN_SECTIONS_PLACE is not set -# CONFIG_COMPILER_STATIC_ANALYZER is not set -# end of Compiler options - -# -# Component config -# - -# -# Application Level Tracing -# -# CONFIG_APPTRACE_DEST_JTAG is not set -CONFIG_APPTRACE_DEST_NONE=y -# CONFIG_APPTRACE_DEST_UART1 is not set -# CONFIG_APPTRACE_DEST_UART2 is not set -# CONFIG_APPTRACE_DEST_USB_CDC is not set -CONFIG_APPTRACE_DEST_UART_NONE=y -CONFIG_APPTRACE_UART_TASK_PRIO=1 -CONFIG_APPTRACE_LOCK_ENABLE=y -# end of Application Level Tracing - -# -# Bluetooth -# -# CONFIG_BT_ENABLED is not set - -# -# Common Options -# -# CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED is not set -# CONFIG_BT_BLE_LOG_UHCI_OUT_ENABLED is not set -# end of Common Options -# end of Bluetooth - -# -# Console Library -# -# CONFIG_CONSOLE_SORTED_HELP is not set -# end of Console Library - -# -# Driver Configurations -# - -# -# Legacy TWAI Driver Configurations -# -# CONFIG_TWAI_SKIP_LEGACY_CONFLICT_CHECK is not set -CONFIG_TWAI_ERRATA_FIX_LISTEN_ONLY_DOM=y -# end of Legacy TWAI Driver Configurations - -# -# Legacy ADC Driver Configuration -# -# CONFIG_ADC_SUPPRESS_DEPRECATE_WARN is not set -# CONFIG_ADC_SKIP_LEGACY_CONFLICT_CHECK is not set - -# -# Legacy ADC Calibration Configuration -# -# CONFIG_ADC_CALI_SUPPRESS_DEPRECATE_WARN is not set -# end of Legacy ADC Calibration Configuration -# end of Legacy ADC Driver Configuration - -# -# Legacy MCPWM Driver Configurations -# -# CONFIG_MCPWM_SUPPRESS_DEPRECATE_WARN is not set -# CONFIG_MCPWM_SKIP_LEGACY_CONFLICT_CHECK is not set -# end of Legacy MCPWM Driver Configurations - -# -# Legacy Timer Group Driver Configurations -# -# CONFIG_GPTIMER_SUPPRESS_DEPRECATE_WARN is not set -# CONFIG_GPTIMER_SKIP_LEGACY_CONFLICT_CHECK is not set -# end of Legacy Timer Group Driver Configurations - -# -# Legacy RMT Driver Configurations -# -# CONFIG_RMT_SUPPRESS_DEPRECATE_WARN is not set -# CONFIG_RMT_SKIP_LEGACY_CONFLICT_CHECK is not set -# end of Legacy RMT Driver Configurations - -# -# Legacy I2S Driver Configurations -# -# CONFIG_I2S_SUPPRESS_DEPRECATE_WARN is not set -# CONFIG_I2S_SKIP_LEGACY_CONFLICT_CHECK is not set -# end of Legacy I2S Driver Configurations - -# -# Legacy I2C Driver Configurations -# -# CONFIG_I2C_SKIP_LEGACY_CONFLICT_CHECK is not set -# end of Legacy I2C Driver Configurations - -# -# Legacy PCNT Driver Configurations -# -# CONFIG_PCNT_SUPPRESS_DEPRECATE_WARN is not set -# CONFIG_PCNT_SKIP_LEGACY_CONFLICT_CHECK is not set -# end of Legacy PCNT Driver Configurations - -# -# Legacy SDM Driver Configurations -# -# CONFIG_SDM_SUPPRESS_DEPRECATE_WARN is not set -# CONFIG_SDM_SKIP_LEGACY_CONFLICT_CHECK is not set -# end of Legacy SDM Driver Configurations - -# -# Legacy Temperature Sensor Driver Configurations -# -# CONFIG_TEMP_SENSOR_SUPPRESS_DEPRECATE_WARN is not set -# CONFIG_TEMP_SENSOR_SKIP_LEGACY_CONFLICT_CHECK is not set -# end of Legacy Temperature Sensor Driver Configurations - -# -# Legacy Touch Sensor Driver Configurations -# -# CONFIG_TOUCH_SUPPRESS_DEPRECATE_WARN is not set -# CONFIG_TOUCH_SKIP_LEGACY_CONFLICT_CHECK is not set -# end of Legacy Touch Sensor Driver Configurations -# end of Driver Configurations - -# -# eFuse Bit Manager -# -# CONFIG_EFUSE_CUSTOM_TABLE is not set -# CONFIG_EFUSE_VIRTUAL is not set -CONFIG_EFUSE_MAX_BLK_LEN=256 -# end of eFuse Bit Manager - -# -# ESP-TLS -# -CONFIG_ESP_TLS_USING_MBEDTLS=y -# CONFIG_ESP_TLS_USE_SECURE_ELEMENT is not set -CONFIG_ESP_TLS_USE_DS_PERIPHERAL=y -# CONFIG_ESP_TLS_CLIENT_SESSION_TICKETS is not set -# CONFIG_ESP_TLS_SERVER_SESSION_TICKETS is not set -# CONFIG_ESP_TLS_SERVER_CERT_SELECT_HOOK is not set -# CONFIG_ESP_TLS_SERVER_MIN_AUTH_MODE_OPTIONAL is not set -# CONFIG_ESP_TLS_PSK_VERIFICATION is not set -# CONFIG_ESP_TLS_INSECURE is not set -CONFIG_ESP_TLS_DYN_BUF_STRATEGY_SUPPORTED=y -# end of ESP-TLS - -# -# ADC and ADC Calibration -# -# CONFIG_ADC_ONESHOT_CTRL_FUNC_IN_IRAM is not set -# CONFIG_ADC_CONTINUOUS_ISR_IRAM_SAFE is not set -# CONFIG_ADC_CONTINUOUS_FORCE_USE_ADC2_ON_C3_S3 is not set -# CONFIG_ADC_ENABLE_DEBUG_LOG is not set -# end of ADC and ADC Calibration - -# -# Wireless Coexistence -# -CONFIG_ESP_COEX_ENABLED=y -# CONFIG_ESP_COEX_EXTERNAL_COEXIST_ENABLE is not set -# CONFIG_ESP_COEX_GPIO_DEBUG is not set -# end of Wireless Coexistence - -# -# Common ESP-related -# -CONFIG_ESP_ERR_TO_NAME_LOOKUP=y -# end of Common ESP-related - -# -# ESP-Driver:Camera Controller Configurations -# -# CONFIG_CAM_CTLR_DVP_CAM_ISR_CACHE_SAFE is not set -# end of ESP-Driver:Camera Controller Configurations - -# -# ESP-Driver:GPIO Configurations -# -# CONFIG_GPIO_CTRL_FUNC_IN_IRAM is not set -# end of ESP-Driver:GPIO Configurations - -# -# ESP-Driver:GPTimer Configurations -# -CONFIG_GPTIMER_ISR_HANDLER_IN_IRAM=y -# CONFIG_GPTIMER_CTRL_FUNC_IN_IRAM is not set -# CONFIG_GPTIMER_ISR_CACHE_SAFE is not set -CONFIG_GPTIMER_OBJ_CACHE_SAFE=y -# CONFIG_GPTIMER_ENABLE_DEBUG_LOG is not set -# end of ESP-Driver:GPTimer Configurations - -# -# ESP-Driver:I2C Configurations -# -# CONFIG_I2C_ISR_IRAM_SAFE is not set -# CONFIG_I2C_ENABLE_DEBUG_LOG is not set -# CONFIG_I2C_ENABLE_SLAVE_DRIVER_VERSION_2 is not set -CONFIG_I2C_MASTER_ISR_HANDLER_IN_IRAM=y -# end of ESP-Driver:I2C Configurations - -# -# ESP-Driver:I2S Configurations -# -# CONFIG_I2S_ISR_IRAM_SAFE is not set -# CONFIG_I2S_ENABLE_DEBUG_LOG is not set -# end of ESP-Driver:I2S Configurations - -# -# ESP-Driver:LEDC Configurations -# -# CONFIG_LEDC_CTRL_FUNC_IN_IRAM is not set -# end of ESP-Driver:LEDC Configurations - -# -# ESP-Driver:MCPWM Configurations -# -CONFIG_MCPWM_ISR_HANDLER_IN_IRAM=y -# CONFIG_MCPWM_ISR_CACHE_SAFE is not set -# CONFIG_MCPWM_CTRL_FUNC_IN_IRAM is not set -CONFIG_MCPWM_OBJ_CACHE_SAFE=y -# CONFIG_MCPWM_ENABLE_DEBUG_LOG is not set -# end of ESP-Driver:MCPWM Configurations - -# -# ESP-Driver:PCNT Configurations -# -# CONFIG_PCNT_CTRL_FUNC_IN_IRAM is not set -# CONFIG_PCNT_ISR_IRAM_SAFE is not set -# CONFIG_PCNT_ENABLE_DEBUG_LOG is not set -# end of ESP-Driver:PCNT Configurations - -# -# ESP-Driver:RMT Configurations -# -CONFIG_RMT_ENCODER_FUNC_IN_IRAM=y -CONFIG_RMT_TX_ISR_HANDLER_IN_IRAM=y -CONFIG_RMT_RX_ISR_HANDLER_IN_IRAM=y -# CONFIG_RMT_RECV_FUNC_IN_IRAM is not set -# CONFIG_RMT_TX_ISR_CACHE_SAFE is not set -# CONFIG_RMT_RX_ISR_CACHE_SAFE is not set -CONFIG_RMT_OBJ_CACHE_SAFE=y -# CONFIG_RMT_ENABLE_DEBUG_LOG is not set -# CONFIG_RMT_ISR_IRAM_SAFE is not set -# end of ESP-Driver:RMT Configurations - -# -# ESP-Driver:Sigma Delta Modulator Configurations -# -# CONFIG_SDM_CTRL_FUNC_IN_IRAM is not set -# CONFIG_SDM_ENABLE_DEBUG_LOG is not set -# end of ESP-Driver:Sigma Delta Modulator Configurations - -# -# ESP-Driver:SPI Configurations -# -# CONFIG_SPI_MASTER_IN_IRAM is not set -CONFIG_SPI_MASTER_ISR_IN_IRAM=y -# CONFIG_SPI_SLAVE_IN_IRAM is not set -CONFIG_SPI_SLAVE_ISR_IN_IRAM=y -# end of ESP-Driver:SPI Configurations - -# -# ESP-Driver:Touch Sensor Configurations -# -# CONFIG_TOUCH_CTRL_FUNC_IN_IRAM is not set -# CONFIG_TOUCH_ISR_IRAM_SAFE is not set -# CONFIG_TOUCH_ENABLE_DEBUG_LOG is not set -# CONFIG_TOUCH_SKIP_FSM_CHECK is not set -# end of ESP-Driver:Touch Sensor Configurations - -# -# ESP-Driver:Temperature Sensor Configurations -# -# CONFIG_TEMP_SENSOR_ENABLE_DEBUG_LOG is not set -# end of ESP-Driver:Temperature Sensor Configurations - -# -# ESP-Driver:TWAI Configurations -# -# CONFIG_TWAI_ISR_IN_IRAM is not set -# CONFIG_TWAI_ISR_CACHE_SAFE is not set -# CONFIG_TWAI_ENABLE_DEBUG_LOG is not set -# end of ESP-Driver:TWAI Configurations - -# -# ESP-Driver:UART Configurations -# -# CONFIG_UART_ISR_IN_IRAM is not set -# end of ESP-Driver:UART Configurations - -# -# ESP-Driver:UHCI Configurations -# -# CONFIG_UHCI_ISR_HANDLER_IN_IRAM is not set -# CONFIG_UHCI_ISR_CACHE_SAFE is not set -# CONFIG_UHCI_ENABLE_DEBUG_LOG is not set -# end of ESP-Driver:UHCI Configurations - -# -# ESP-Driver:USB Serial/JTAG Configuration -# -CONFIG_USJ_ENABLE_USB_SERIAL_JTAG=y -# end of ESP-Driver:USB Serial/JTAG Configuration - -# -# Ethernet -# -CONFIG_ETH_ENABLED=y -CONFIG_ETH_USE_SPI_ETHERNET=y -# CONFIG_ETH_SPI_ETHERNET_DM9051 is not set -# CONFIG_ETH_SPI_ETHERNET_W5500 is not set -# CONFIG_ETH_SPI_ETHERNET_KSZ8851SNL is not set -# CONFIG_ETH_USE_OPENETH is not set -# CONFIG_ETH_TRANSMIT_MUTEX is not set -# end of Ethernet - -# -# Event Loop Library -# -# CONFIG_ESP_EVENT_LOOP_PROFILING is not set -CONFIG_ESP_EVENT_POST_FROM_ISR=y -CONFIG_ESP_EVENT_POST_FROM_IRAM_ISR=y -# end of Event Loop Library - -# -# GDB Stub -# -CONFIG_ESP_GDBSTUB_ENABLED=y -# CONFIG_ESP_SYSTEM_GDBSTUB_RUNTIME is not set -CONFIG_ESP_GDBSTUB_SUPPORT_TASKS=y -CONFIG_ESP_GDBSTUB_MAX_TASKS=32 -# end of GDB Stub - -# -# ESP HID -# -CONFIG_ESPHID_TASK_SIZE_BT=2048 -CONFIG_ESPHID_TASK_SIZE_BLE=4096 -# end of ESP HID - -# -# ESP HTTP client -# -CONFIG_ESP_HTTP_CLIENT_ENABLE_HTTPS=y -# CONFIG_ESP_HTTP_CLIENT_ENABLE_BASIC_AUTH is not set -# CONFIG_ESP_HTTP_CLIENT_ENABLE_DIGEST_AUTH is not set -# CONFIG_ESP_HTTP_CLIENT_ENABLE_CUSTOM_TRANSPORT is not set -CONFIG_ESP_HTTP_CLIENT_EVENT_POST_TIMEOUT=2000 -# end of ESP HTTP client - -# -# HTTP Server -# -CONFIG_HTTPD_MAX_REQ_HDR_LEN=512 -CONFIG_HTTPD_MAX_URI_LEN=512 -CONFIG_HTTPD_ERR_RESP_NO_DELAY=y -CONFIG_HTTPD_PURGE_BUF_LEN=32 -# CONFIG_HTTPD_LOG_PURGE_DATA is not set -# CONFIG_HTTPD_WS_SUPPORT is not set -# CONFIG_HTTPD_QUEUE_WORK_BLOCKING is not set -CONFIG_HTTPD_SERVER_EVENT_POST_TIMEOUT=2000 -# end of HTTP Server - -# -# ESP HTTPS OTA -# -# CONFIG_ESP_HTTPS_OTA_DECRYPT_CB is not set -# CONFIG_ESP_HTTPS_OTA_ALLOW_HTTP is not set -CONFIG_ESP_HTTPS_OTA_EVENT_POST_TIMEOUT=2000 -# end of ESP HTTPS OTA - -# -# ESP HTTPS server -# -# CONFIG_ESP_HTTPS_SERVER_ENABLE is not set -CONFIG_ESP_HTTPS_SERVER_EVENT_POST_TIMEOUT=2000 -# CONFIG_ESP_HTTPS_SERVER_CERT_SELECT_HOOK is not set -# end of ESP HTTPS server - -# -# Hardware Settings -# - -# -# Chip revision -# -CONFIG_ESP32S3_REV_MIN_0=y -# CONFIG_ESP32S3_REV_MIN_1 is not set -# CONFIG_ESP32S3_REV_MIN_2 is not set -CONFIG_ESP32S3_REV_MIN_FULL=0 -CONFIG_ESP_REV_MIN_FULL=0 - -# -# Maximum Supported ESP32-S3 Revision (Rev v0.99) -# -CONFIG_ESP32S3_REV_MAX_FULL=99 -CONFIG_ESP_REV_MAX_FULL=99 -CONFIG_ESP_EFUSE_BLOCK_REV_MIN_FULL=0 -CONFIG_ESP_EFUSE_BLOCK_REV_MAX_FULL=199 - -# -# Maximum Supported ESP32-S3 eFuse Block Revision (eFuse Block Rev v1.99) -# -# end of Chip revision - -# -# MAC Config -# -CONFIG_ESP_MAC_ADDR_UNIVERSE_WIFI_STA=y -CONFIG_ESP_MAC_ADDR_UNIVERSE_WIFI_AP=y -CONFIG_ESP_MAC_ADDR_UNIVERSE_BT=y -CONFIG_ESP_MAC_ADDR_UNIVERSE_ETH=y -CONFIG_ESP_MAC_UNIVERSAL_MAC_ADDRESSES_FOUR=y -CONFIG_ESP_MAC_UNIVERSAL_MAC_ADDRESSES=4 -# CONFIG_ESP32S3_UNIVERSAL_MAC_ADDRESSES_TWO is not set -CONFIG_ESP32S3_UNIVERSAL_MAC_ADDRESSES_FOUR=y -CONFIG_ESP32S3_UNIVERSAL_MAC_ADDRESSES=4 -# CONFIG_ESP_MAC_USE_CUSTOM_MAC_AS_BASE_MAC is not set -# end of MAC Config - -# -# Sleep Config -# -CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND=y -CONFIG_ESP_SLEEP_PSRAM_LEAKAGE_WORKAROUND=y -CONFIG_ESP_SLEEP_MSPI_NEED_ALL_IO_PU=y -CONFIG_ESP_SLEEP_RTC_BUS_ISO_WORKAROUND=y -CONFIG_ESP_SLEEP_GPIO_RESET_WORKAROUND=y -CONFIG_ESP_SLEEP_WAIT_FLASH_READY_EXTRA_DELAY=2000 -# CONFIG_ESP_SLEEP_CACHE_SAFE_ASSERTION is not set -# CONFIG_ESP_SLEEP_DEBUG is not set -CONFIG_ESP_SLEEP_GPIO_ENABLE_INTERNAL_RESISTORS=y -# end of Sleep Config - -# -# RTC Clock Config -# -CONFIG_RTC_CLK_SRC_INT_RC=y -# CONFIG_RTC_CLK_SRC_EXT_CRYS is not set -# CONFIG_RTC_CLK_SRC_EXT_OSC is not set -# CONFIG_RTC_CLK_SRC_INT_8MD256 is not set -CONFIG_RTC_CLK_CAL_CYCLES=1024 -# end of RTC Clock Config - -# -# Peripheral Control -# -CONFIG_ESP_PERIPH_CTRL_FUNC_IN_IRAM=y -CONFIG_ESP_REGI2C_CTRL_FUNC_IN_IRAM=y -# end of Peripheral Control - -# -# GDMA Configurations -# -CONFIG_GDMA_CTRL_FUNC_IN_IRAM=y -CONFIG_GDMA_ISR_HANDLER_IN_IRAM=y -CONFIG_GDMA_OBJ_DRAM_SAFE=y -# CONFIG_GDMA_ENABLE_DEBUG_LOG is not set -# CONFIG_GDMA_ISR_IRAM_SAFE is not set -# end of GDMA Configurations - -# -# Main XTAL Config -# -CONFIG_XTAL_FREQ_40=y -CONFIG_XTAL_FREQ=40 -# end of Main XTAL Config - -# -# Power Supplier -# - -# -# Brownout Detector -# -CONFIG_ESP_BROWNOUT_DET=y -CONFIG_ESP_BROWNOUT_DET_LVL_SEL_7=y -# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_6 is not set -# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_5 is not set -# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_4 is not set -# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_3 is not set -# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_2 is not set -# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_1 is not set -CONFIG_ESP_BROWNOUT_DET_LVL=7 -CONFIG_ESP_BROWNOUT_USE_INTR=y -# end of Brownout Detector -# end of Power Supplier - -CONFIG_ESP_SPI_BUS_LOCK_ISR_FUNCS_IN_IRAM=y -CONFIG_ESP_INTR_IN_IRAM=y -# end of Hardware Settings - -# -# ESP-Driver:LCD Controller Configurations -# -# CONFIG_LCD_ENABLE_DEBUG_LOG is not set -# CONFIG_LCD_RGB_ISR_IRAM_SAFE is not set -# CONFIG_LCD_RGB_RESTART_IN_VSYNC is not set -# end of ESP-Driver:LCD Controller Configurations - -# -# ESP-MM: Memory Management Configurations -# -# CONFIG_ESP_MM_CACHE_MSYNC_C2M_CHUNKED_OPS is not set -# end of ESP-MM: Memory Management Configurations - -# -# ESP NETIF Adapter -# -CONFIG_ESP_NETIF_IP_LOST_TIMER_INTERVAL=120 -# CONFIG_ESP_NETIF_PROVIDE_CUSTOM_IMPLEMENTATION is not set -CONFIG_ESP_NETIF_TCPIP_LWIP=y -# CONFIG_ESP_NETIF_LOOPBACK is not set -CONFIG_ESP_NETIF_USES_TCPIP_WITH_BSD_API=y -CONFIG_ESP_NETIF_REPORT_DATA_TRAFFIC=y -# CONFIG_ESP_NETIF_RECEIVE_REPORT_ERRORS is not set -# CONFIG_ESP_NETIF_L2_TAP is not set -# CONFIG_ESP_NETIF_BRIDGE_EN is not set -# CONFIG_ESP_NETIF_SET_DNS_PER_DEFAULT_NETIF is not set -# end of ESP NETIF Adapter - -# -# Partition API Configuration -# -# end of Partition API Configuration - -# -# PHY -# -CONFIG_ESP_PHY_ENABLED=y -CONFIG_ESP_PHY_CALIBRATION_AND_DATA_STORAGE=y -# CONFIG_ESP_PHY_INIT_DATA_IN_PARTITION is not set -CONFIG_ESP_PHY_MAX_WIFI_TX_POWER=20 -CONFIG_ESP_PHY_MAX_TX_POWER=20 -# CONFIG_ESP_PHY_REDUCE_TX_POWER is not set -CONFIG_ESP_PHY_ENABLE_USB=y -# CONFIG_ESP_PHY_ENABLE_CERT_TEST is not set -CONFIG_ESP_PHY_RF_CAL_PARTIAL=y -# CONFIG_ESP_PHY_RF_CAL_NONE is not set -# CONFIG_ESP_PHY_RF_CAL_FULL is not set -CONFIG_ESP_PHY_CALIBRATION_MODE=0 -CONFIG_ESP_PHY_PLL_TRACK_PERIOD_MS=1000 -# CONFIG_ESP_PHY_PLL_TRACK_DEBUG is not set -# CONFIG_ESP_PHY_RECORD_USED_TIME is not set -CONFIG_ESP_PHY_IRAM_OPT=y -# CONFIG_ESP_PHY_DEBUG is not set -# end of PHY - -# -# Power Management -# -CONFIG_PM_SLEEP_FUNC_IN_IRAM=y -# CONFIG_PM_ENABLE is not set -CONFIG_PM_SLP_IRAM_OPT=y -CONFIG_PM_POWER_DOWN_CPU_IN_LIGHT_SLEEP=y -CONFIG_PM_RESTORE_CACHE_TAGMEM_AFTER_LIGHT_SLEEP=y -# end of Power Management - -# -# ESP PSRAM -# -CONFIG_SPIRAM=y - -# -# SPI RAM config -# -# CONFIG_SPIRAM_MODE_QUAD is not set -CONFIG_SPIRAM_MODE_OCT=y -CONFIG_SPIRAM_TYPE_AUTO=y -# CONFIG_SPIRAM_TYPE_ESPPSRAM64 is not set -CONFIG_SPIRAM_CLK_IO=30 -CONFIG_SPIRAM_CS_IO=26 -# CONFIG_SPIRAM_XIP_FROM_PSRAM is not set -# CONFIG_SPIRAM_FETCH_INSTRUCTIONS is not set -# CONFIG_SPIRAM_RODATA is not set -CONFIG_SPIRAM_SPEED_80M=y -# CONFIG_SPIRAM_SPEED_40M is not set -CONFIG_SPIRAM_SPEED=80 -# CONFIG_SPIRAM_ECC_ENABLE is not set -CONFIG_SPIRAM_BOOT_HW_INIT=y -CONFIG_SPIRAM_BOOT_INIT=y -CONFIG_SPIRAM_PRE_CONFIGURE_MEMORY_PROTECTION=y -# CONFIG_SPIRAM_IGNORE_NOTFOUND is not set -# CONFIG_SPIRAM_USE_CAPS_ALLOC is not set -CONFIG_SPIRAM_USE_MALLOC=y -CONFIG_SPIRAM_MEMTEST=y -CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=16384 -# CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP is not set -CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=32768 -# CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set -# CONFIG_SPIRAM_ALLOW_NOINIT_SEG_EXTERNAL_MEMORY is not set -# end of SPI RAM config -# end of ESP PSRAM - -# -# ESP Ringbuf -# -# CONFIG_RINGBUF_PLACE_FUNCTIONS_INTO_FLASH is not set -# end of ESP Ringbuf - -# -# ESP-ROM -# -CONFIG_ESP_ROM_PRINT_IN_IRAM=y -# end of ESP-ROM - -# -# ESP Security Specific -# -# end of ESP Security Specific - -# -# ESP System Settings -# -# CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_80 is not set -# CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_160 is not set -CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y -CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ=240 - -# -# Cache config -# -CONFIG_ESP32S3_INSTRUCTION_CACHE_16KB=y -# CONFIG_ESP32S3_INSTRUCTION_CACHE_32KB is not set -CONFIG_ESP32S3_INSTRUCTION_CACHE_SIZE=0x4000 -# CONFIG_ESP32S3_INSTRUCTION_CACHE_4WAYS is not set -CONFIG_ESP32S3_INSTRUCTION_CACHE_8WAYS=y -CONFIG_ESP32S3_ICACHE_ASSOCIATED_WAYS=8 -# CONFIG_ESP32S3_INSTRUCTION_CACHE_LINE_16B is not set -CONFIG_ESP32S3_INSTRUCTION_CACHE_LINE_32B=y -CONFIG_ESP32S3_INSTRUCTION_CACHE_LINE_SIZE=32 -# CONFIG_ESP32S3_DATA_CACHE_16KB is not set -CONFIG_ESP32S3_DATA_CACHE_32KB=y -# CONFIG_ESP32S3_DATA_CACHE_64KB is not set -CONFIG_ESP32S3_DATA_CACHE_SIZE=0x8000 -# CONFIG_ESP32S3_DATA_CACHE_4WAYS is not set -CONFIG_ESP32S3_DATA_CACHE_8WAYS=y -CONFIG_ESP32S3_DCACHE_ASSOCIATED_WAYS=8 -# CONFIG_ESP32S3_DATA_CACHE_LINE_16B is not set -CONFIG_ESP32S3_DATA_CACHE_LINE_32B=y -# CONFIG_ESP32S3_DATA_CACHE_LINE_64B is not set -CONFIG_ESP32S3_DATA_CACHE_LINE_SIZE=32 -# end of Cache config - -# -# Memory -# -# CONFIG_ESP32S3_RTCDATA_IN_FAST_MEM is not set -# CONFIG_ESP32S3_USE_FIXED_STATIC_RAM_SIZE is not set -# end of Memory - -# -# Trace memory -# -# CONFIG_ESP32S3_TRAX is not set -CONFIG_ESP32S3_TRACEMEM_RESERVE_DRAM=0x0 -# end of Trace memory - -CONFIG_ESP_SYSTEM_IN_IRAM=y -# CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT is not set -CONFIG_ESP_SYSTEM_PANIC_PRINT_REBOOT=y -# CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT is not set -# CONFIG_ESP_SYSTEM_PANIC_GDBSTUB is not set -CONFIG_ESP_SYSTEM_PANIC_REBOOT_DELAY_SECONDS=0 -CONFIG_ESP_SYSTEM_RTC_FAST_MEM_AS_HEAP_DEPCHECK=y -CONFIG_ESP_SYSTEM_ALLOW_RTC_FAST_MEM_AS_HEAP=y - -# -# Memory protection -# -CONFIG_ESP_SYSTEM_MEMPROT_FEATURE=y -CONFIG_ESP_SYSTEM_MEMPROT_FEATURE_LOCK=y -# end of Memory protection - -CONFIG_ESP_SYSTEM_EVENT_QUEUE_SIZE=32 -CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=2304 -CONFIG_ESP_MAIN_TASK_STACK_SIZE=3584 -CONFIG_ESP_MAIN_TASK_AFFINITY_CPU0=y -# CONFIG_ESP_MAIN_TASK_AFFINITY_CPU1 is not set -# CONFIG_ESP_MAIN_TASK_AFFINITY_NO_AFFINITY is not set -CONFIG_ESP_MAIN_TASK_AFFINITY=0x0 -CONFIG_ESP_MINIMAL_SHARED_STACK_SIZE=2048 -CONFIG_ESP_CONSOLE_UART_DEFAULT=y -# CONFIG_ESP_CONSOLE_USB_CDC is not set -# CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG is not set -# CONFIG_ESP_CONSOLE_UART_CUSTOM is not set -# CONFIG_ESP_CONSOLE_NONE is not set -# CONFIG_ESP_CONSOLE_SECONDARY_NONE is not set -CONFIG_ESP_CONSOLE_SECONDARY_USB_SERIAL_JTAG=y -CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG_ENABLED=y -CONFIG_ESP_CONSOLE_UART=y -CONFIG_ESP_CONSOLE_UART_NUM=0 -CONFIG_ESP_CONSOLE_ROM_SERIAL_PORT_NUM=0 -CONFIG_ESP_CONSOLE_UART_BAUDRATE=115200 -CONFIG_ESP_INT_WDT=y -CONFIG_ESP_INT_WDT_TIMEOUT_MS=300 -CONFIG_ESP_INT_WDT_CHECK_CPU1=y -CONFIG_ESP_TASK_WDT_EN=y -CONFIG_ESP_TASK_WDT_INIT=y -# CONFIG_ESP_TASK_WDT_PANIC is not set -CONFIG_ESP_TASK_WDT_TIMEOUT_S=5 -CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0=y -CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU1=y -# CONFIG_ESP_PANIC_HANDLER_IRAM is not set -# CONFIG_ESP_DEBUG_STUBS_ENABLE is not set -CONFIG_ESP_DEBUG_OCDAWARE=y -CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_4=y -CONFIG_ESP_SYSTEM_BBPLL_RECALIB=y -# end of ESP System Settings - -# -# IPC (Inter-Processor Call) -# -CONFIG_ESP_IPC_ENABLE=y -CONFIG_ESP_IPC_TASK_STACK_SIZE=1280 -CONFIG_ESP_IPC_USES_CALLERS_PRIORITY=y -CONFIG_ESP_IPC_ISR_ENABLE=y -# end of IPC (Inter-Processor Call) - -# -# ESP Timer (High Resolution Timer) -# -CONFIG_ESP_TIMER_IN_IRAM=y -# CONFIG_ESP_TIMER_PROFILING is not set -CONFIG_ESP_TIME_FUNCS_USE_RTC_TIMER=y -CONFIG_ESP_TIME_FUNCS_USE_ESP_TIMER=y -CONFIG_ESP_TIMER_TASK_STACK_SIZE=3584 -CONFIG_ESP_TIMER_INTERRUPT_LEVEL=1 -# CONFIG_ESP_TIMER_SHOW_EXPERIMENTAL is not set -CONFIG_ESP_TIMER_TASK_AFFINITY=0x0 -CONFIG_ESP_TIMER_TASK_AFFINITY_CPU0=y -CONFIG_ESP_TIMER_ISR_AFFINITY_CPU0=y -# CONFIG_ESP_TIMER_SUPPORTS_ISR_DISPATCH_METHOD is not set -CONFIG_ESP_TIMER_IMPL_SYSTIMER=y -# end of ESP Timer (High Resolution Timer) - -# -# Wi-Fi -# -CONFIG_ESP_WIFI_ENABLED=y -CONFIG_ESP_WIFI_STATIC_RX_BUFFER_NUM=10 -CONFIG_ESP_WIFI_DYNAMIC_RX_BUFFER_NUM=32 -CONFIG_ESP_WIFI_STATIC_TX_BUFFER=y -# CONFIG_ESP_WIFI_DYNAMIC_TX_BUFFER is not set -CONFIG_ESP_WIFI_TX_BUFFER_TYPE=0 -CONFIG_ESP_WIFI_STATIC_TX_BUFFER_NUM=16 -CONFIG_ESP_WIFI_STATIC_RX_MGMT_BUFFER=y -# CONFIG_ESP_WIFI_DYNAMIC_RX_MGMT_BUFFER is not set -CONFIG_ESP_WIFI_DYNAMIC_RX_MGMT_BUF=0 -CONFIG_ESP_WIFI_RX_MGMT_BUF_NUM_DEF=5 -# CONFIG_ESP_WIFI_CSI_ENABLED is not set -CONFIG_ESP_WIFI_AMPDU_TX_ENABLED=y -CONFIG_ESP_WIFI_TX_BA_WIN=6 -CONFIG_ESP_WIFI_AMPDU_RX_ENABLED=y -CONFIG_ESP_WIFI_RX_BA_WIN=6 -CONFIG_ESP_WIFI_NVS_ENABLED=y -CONFIG_ESP_WIFI_TASK_PINNED_TO_CORE_0=y -# CONFIG_ESP_WIFI_TASK_PINNED_TO_CORE_1 is not set -CONFIG_ESP_WIFI_SOFTAP_BEACON_MAX_LEN=752 -CONFIG_ESP_WIFI_MGMT_SBUF_NUM=32 -CONFIG_ESP_WIFI_IRAM_OPT=y -# CONFIG_ESP_WIFI_EXTRA_IRAM_OPT is not set -CONFIG_ESP_WIFI_RX_IRAM_OPT=y -CONFIG_ESP_WIFI_ENABLE_WPA3_SAE=y -CONFIG_ESP_WIFI_ENABLE_SAE_PK=y -CONFIG_ESP_WIFI_ENABLE_SAE_H2E=y -CONFIG_ESP_WIFI_SOFTAP_SAE_SUPPORT=y -CONFIG_ESP_WIFI_ENABLE_WPA3_OWE_STA=y -# CONFIG_ESP_WIFI_SLP_IRAM_OPT is not set -CONFIG_ESP_WIFI_SLP_DEFAULT_MIN_ACTIVE_TIME=50 -# CONFIG_ESP_WIFI_BSS_MAX_IDLE_SUPPORT is not set -CONFIG_ESP_WIFI_SLP_DEFAULT_MAX_ACTIVE_TIME=10 -CONFIG_ESP_WIFI_SLP_DEFAULT_WAIT_BROADCAST_DATA_TIME=15 -# CONFIG_ESP_WIFI_FTM_ENABLE is not set -CONFIG_ESP_WIFI_STA_DISCONNECTED_PM_ENABLE=y -# CONFIG_ESP_WIFI_GCMP_SUPPORT is not set -# CONFIG_ESP_WIFI_GMAC_SUPPORT is not set -CONFIG_ESP_WIFI_SOFTAP_SUPPORT=y -# CONFIG_ESP_WIFI_SLP_BEACON_LOST_OPT is not set -CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM=7 -CONFIG_ESP_WIFI_MBEDTLS_CRYPTO=y -CONFIG_ESP_WIFI_MBEDTLS_TLS_CLIENT=y -# CONFIG_ESP_WIFI_WAPI_PSK is not set -# CONFIG_ESP_WIFI_SUITE_B_192 is not set -# CONFIG_ESP_WIFI_11KV_SUPPORT is not set -# CONFIG_ESP_WIFI_MBO_SUPPORT is not set -# CONFIG_ESP_WIFI_DPP_SUPPORT is not set -# CONFIG_ESP_WIFI_11R_SUPPORT is not set -# CONFIG_ESP_WIFI_WPS_SOFTAP_REGISTRAR is not set - -# -# WPS Configuration Options -# -# CONFIG_ESP_WIFI_WPS_STRICT is not set -# CONFIG_ESP_WIFI_WPS_PASSPHRASE is not set -# end of WPS Configuration Options - -# CONFIG_ESP_WIFI_DEBUG_PRINT is not set -# CONFIG_ESP_WIFI_TESTING_OPTIONS is not set -CONFIG_ESP_WIFI_ENTERPRISE_SUPPORT=y -# CONFIG_ESP_WIFI_ENT_FREE_DYNAMIC_BUFFER is not set -# end of Wi-Fi - -# -# Core dump -# -# CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH is not set -# CONFIG_ESP_COREDUMP_ENABLE_TO_UART is not set -CONFIG_ESP_COREDUMP_ENABLE_TO_NONE=y -# end of Core dump - -# -# FAT Filesystem support -# -CONFIG_FATFS_VOLUME_COUNT=2 -CONFIG_FATFS_LFN_NONE=y -# CONFIG_FATFS_LFN_HEAP is not set -# CONFIG_FATFS_LFN_STACK is not set -# CONFIG_FATFS_SECTOR_512 is not set -CONFIG_FATFS_SECTOR_4096=y -# CONFIG_FATFS_CODEPAGE_DYNAMIC is not set -CONFIG_FATFS_CODEPAGE_437=y -# CONFIG_FATFS_CODEPAGE_720 is not set -# CONFIG_FATFS_CODEPAGE_737 is not set -# CONFIG_FATFS_CODEPAGE_771 is not set -# CONFIG_FATFS_CODEPAGE_775 is not set -# CONFIG_FATFS_CODEPAGE_850 is not set -# CONFIG_FATFS_CODEPAGE_852 is not set -# CONFIG_FATFS_CODEPAGE_855 is not set -# CONFIG_FATFS_CODEPAGE_857 is not set -# CONFIG_FATFS_CODEPAGE_860 is not set -# CONFIG_FATFS_CODEPAGE_861 is not set -# CONFIG_FATFS_CODEPAGE_862 is not set -# CONFIG_FATFS_CODEPAGE_863 is not set -# CONFIG_FATFS_CODEPAGE_864 is not set -# CONFIG_FATFS_CODEPAGE_865 is not set -# CONFIG_FATFS_CODEPAGE_866 is not set -# CONFIG_FATFS_CODEPAGE_869 is not set -# CONFIG_FATFS_CODEPAGE_932 is not set -# CONFIG_FATFS_CODEPAGE_936 is not set -# CONFIG_FATFS_CODEPAGE_949 is not set -# CONFIG_FATFS_CODEPAGE_950 is not set -CONFIG_FATFS_CODEPAGE=437 -CONFIG_FATFS_FS_LOCK=0 -CONFIG_FATFS_TIMEOUT_MS=10000 -CONFIG_FATFS_PER_FILE_CACHE=y -CONFIG_FATFS_ALLOC_PREFER_EXTRAM=y -# CONFIG_FATFS_USE_FASTSEEK is not set -CONFIG_FATFS_USE_STRFUNC_NONE=y -# CONFIG_FATFS_USE_STRFUNC_WITHOUT_CRLF_CONV is not set -# CONFIG_FATFS_USE_STRFUNC_WITH_CRLF_CONV is not set -CONFIG_FATFS_VFS_FSTAT_BLKSIZE=0 -# CONFIG_FATFS_IMMEDIATE_FSYNC is not set -# CONFIG_FATFS_USE_LABEL is not set -CONFIG_FATFS_LINK_LOCK=y -# CONFIG_FATFS_USE_DYN_BUFFERS is not set - -# -# File system free space calculation behavior -# -CONFIG_FATFS_DONT_TRUST_FREE_CLUSTER_CNT=0 -CONFIG_FATFS_DONT_TRUST_LAST_ALLOC=0 -# end of File system free space calculation behavior -# end of FAT Filesystem support - -# -# FreeRTOS -# - -# -# Kernel -# -# CONFIG_FREERTOS_SMP is not set -# CONFIG_FREERTOS_UNICORE is not set -CONFIG_FREERTOS_HZ=1000 -# CONFIG_FREERTOS_CHECK_STACKOVERFLOW_NONE is not set -# CONFIG_FREERTOS_CHECK_STACKOVERFLOW_PTRVAL is not set -CONFIG_FREERTOS_CHECK_STACKOVERFLOW_CANARY=y -CONFIG_FREERTOS_THREAD_LOCAL_STORAGE_POINTERS=1 -CONFIG_FREERTOS_IDLE_TASK_STACKSIZE=1536 -# CONFIG_FREERTOS_USE_IDLE_HOOK is not set -# CONFIG_FREERTOS_USE_TICK_HOOK is not set -CONFIG_FREERTOS_MAX_TASK_NAME_LEN=16 -CONFIG_FREERTOS_ENABLE_BACKWARD_COMPATIBILITY=y -CONFIG_FREERTOS_USE_TIMERS=y -CONFIG_FREERTOS_TIMER_SERVICE_TASK_NAME="Tmr Svc" -# CONFIG_FREERTOS_TIMER_TASK_AFFINITY_CPU0 is not set -# CONFIG_FREERTOS_TIMER_TASK_AFFINITY_CPU1 is not set -CONFIG_FREERTOS_TIMER_TASK_NO_AFFINITY=y -CONFIG_FREERTOS_TIMER_SERVICE_TASK_CORE_AFFINITY=0x7FFFFFFF -CONFIG_FREERTOS_TIMER_TASK_PRIORITY=1 -CONFIG_FREERTOS_TIMER_TASK_STACK_DEPTH=2048 -CONFIG_FREERTOS_TIMER_QUEUE_LENGTH=10 -CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE=0 -CONFIG_FREERTOS_TASK_NOTIFICATION_ARRAY_ENTRIES=1 -# CONFIG_FREERTOS_USE_TRACE_FACILITY is not set -# CONFIG_FREERTOS_USE_LIST_DATA_INTEGRITY_CHECK_BYTES is not set -# CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS is not set -# CONFIG_FREERTOS_USE_APPLICATION_TASK_TAG is not set -# end of Kernel - -# -# Port -# -# CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK is not set -CONFIG_FREERTOS_TLSP_DELETION_CALLBACKS=y -# CONFIG_FREERTOS_TASK_PRE_DELETION_HOOK is not set -# CONFIG_FREERTOS_ENABLE_STATIC_TASK_CLEAN_UP is not set -CONFIG_FREERTOS_CHECK_MUTEX_GIVEN_BY_OWNER=y -CONFIG_FREERTOS_ISR_STACKSIZE=1536 -CONFIG_FREERTOS_INTERRUPT_BACKTRACE=y -# CONFIG_FREERTOS_FPU_IN_ISR is not set -CONFIG_FREERTOS_TICK_SUPPORT_SYSTIMER=y -CONFIG_FREERTOS_CORETIMER_SYSTIMER_LVL1=y -# CONFIG_FREERTOS_CORETIMER_SYSTIMER_LVL3 is not set -CONFIG_FREERTOS_SYSTICK_USES_SYSTIMER=y -# CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH is not set -# CONFIG_FREERTOS_CHECK_PORT_CRITICAL_COMPLIANCE is not set -# end of Port - -# -# Extra -# -CONFIG_FREERTOS_TASK_CREATE_ALLOW_EXT_MEM=y -# end of Extra - -CONFIG_FREERTOS_PORT=y -CONFIG_FREERTOS_NO_AFFINITY=0x7FFFFFFF -CONFIG_FREERTOS_SUPPORT_STATIC_ALLOCATION=y -CONFIG_FREERTOS_DEBUG_OCDAWARE=y -CONFIG_FREERTOS_ENABLE_TASK_SNAPSHOT=y -CONFIG_FREERTOS_PLACE_SNAPSHOT_FUNS_INTO_FLASH=y -CONFIG_FREERTOS_NUMBER_OF_CORES=2 -CONFIG_FREERTOS_IN_IRAM=y -# end of FreeRTOS - -# -# Hardware Abstraction Layer (HAL) and Low Level (LL) -# -CONFIG_HAL_ASSERTION_EQUALS_SYSTEM=y -# CONFIG_HAL_ASSERTION_DISABLE is not set -# CONFIG_HAL_ASSERTION_SILENT is not set -# CONFIG_HAL_ASSERTION_ENABLE is not set -CONFIG_HAL_DEFAULT_ASSERTION_LEVEL=2 -CONFIG_HAL_WDT_USE_ROM_IMPL=y -# end of Hardware Abstraction Layer (HAL) and Low Level (LL) - -# -# Heap memory debugging -# -CONFIG_HEAP_POISONING_DISABLED=y -# CONFIG_HEAP_POISONING_LIGHT is not set -# CONFIG_HEAP_POISONING_COMPREHENSIVE is not set -CONFIG_HEAP_TRACING_OFF=y -# CONFIG_HEAP_TRACING_STANDALONE is not set -# CONFIG_HEAP_TRACING_TOHOST is not set -# CONFIG_HEAP_USE_HOOKS is not set -# CONFIG_HEAP_TASK_TRACKING is not set -# CONFIG_HEAP_ABORT_WHEN_ALLOCATION_FAILS is not set -# CONFIG_HEAP_PLACE_FUNCTION_INTO_FLASH is not set -# end of Heap memory debugging - -# -# Log -# -CONFIG_LOG_VERSION_1=y -# CONFIG_LOG_VERSION_2 is not set -CONFIG_LOG_VERSION=1 - -# -# Log Level -# -# CONFIG_LOG_DEFAULT_LEVEL_NONE is not set -# CONFIG_LOG_DEFAULT_LEVEL_ERROR is not set -# CONFIG_LOG_DEFAULT_LEVEL_WARN is not set -# CONFIG_LOG_DEFAULT_LEVEL_INFO is not set -CONFIG_LOG_DEFAULT_LEVEL_DEBUG=y -# CONFIG_LOG_DEFAULT_LEVEL_VERBOSE is not set -CONFIG_LOG_DEFAULT_LEVEL=4 -CONFIG_LOG_MAXIMUM_EQUALS_DEFAULT=y -# CONFIG_LOG_MAXIMUM_LEVEL_VERBOSE is not set -CONFIG_LOG_MAXIMUM_LEVEL=4 - -# -# Level Settings -# -# CONFIG_LOG_MASTER_LEVEL is not set -CONFIG_LOG_DYNAMIC_LEVEL_CONTROL=y -# CONFIG_LOG_TAG_LEVEL_IMPL_NONE is not set -# CONFIG_LOG_TAG_LEVEL_IMPL_LINKED_LIST is not set -CONFIG_LOG_TAG_LEVEL_IMPL_CACHE_AND_LINKED_LIST=y -# CONFIG_LOG_TAG_LEVEL_CACHE_ARRAY is not set -CONFIG_LOG_TAG_LEVEL_CACHE_BINARY_MIN_HEAP=y -CONFIG_LOG_TAG_LEVEL_IMPL_CACHE_SIZE=31 -# end of Level Settings -# end of Log Level - -# -# Format -# -CONFIG_LOG_COLORS=y -CONFIG_LOG_TIMESTAMP_SOURCE_RTOS=y -# CONFIG_LOG_TIMESTAMP_SOURCE_SYSTEM is not set -# end of Format - -# -# Settings -# -CONFIG_LOG_MODE_TEXT_EN=y -CONFIG_LOG_MODE_TEXT=y -# end of Settings - -CONFIG_LOG_IN_IRAM=y -# end of Log - -# -# LWIP -# -CONFIG_LWIP_ENABLE=y -CONFIG_LWIP_LOCAL_HOSTNAME="espressif" -CONFIG_LWIP_TCPIP_TASK_PRIO=18 -# CONFIG_LWIP_TCPIP_CORE_LOCKING is not set -# CONFIG_LWIP_CHECK_THREAD_SAFETY is not set -CONFIG_LWIP_DNS_SUPPORT_MDNS_QUERIES=y -# CONFIG_LWIP_L2_TO_L3_COPY is not set -# CONFIG_LWIP_IRAM_OPTIMIZATION is not set -# CONFIG_LWIP_EXTRA_IRAM_OPTIMIZATION is not set -CONFIG_LWIP_TIMERS_ONDEMAND=y -CONFIG_LWIP_ND6=y -# CONFIG_LWIP_FORCE_ROUTER_FORWARDING is not set -CONFIG_LWIP_MAX_SOCKETS=10 -# CONFIG_LWIP_USE_ONLY_LWIP_SELECT is not set -# CONFIG_LWIP_SO_LINGER is not set -CONFIG_LWIP_SO_REUSE=y -CONFIG_LWIP_SO_REUSE_RXTOALL=y -# CONFIG_LWIP_SO_RCVBUF is not set -# CONFIG_LWIP_NETBUF_RECVINFO is not set -CONFIG_LWIP_IP_DEFAULT_TTL=64 -CONFIG_LWIP_IP4_FRAG=y -CONFIG_LWIP_IP6_FRAG=y -# CONFIG_LWIP_IP4_REASSEMBLY is not set -# CONFIG_LWIP_IP6_REASSEMBLY is not set -CONFIG_LWIP_IP_REASS_MAX_PBUFS=10 -# CONFIG_LWIP_IP_FORWARD is not set -# CONFIG_LWIP_STATS is not set -CONFIG_LWIP_ESP_GRATUITOUS_ARP=y -CONFIG_LWIP_GARP_TMR_INTERVAL=60 -CONFIG_LWIP_ESP_MLDV6_REPORT=y -CONFIG_LWIP_MLDV6_TMR_INTERVAL=40 -CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=32 -CONFIG_LWIP_DHCP_DOES_ARP_CHECK=y -# CONFIG_LWIP_DHCP_DOES_ACD_CHECK is not set -# CONFIG_LWIP_DHCP_DOES_NOT_CHECK_OFFERED_IP is not set -# CONFIG_LWIP_DHCP_DISABLE_CLIENT_ID is not set -CONFIG_LWIP_DHCP_DISABLE_VENDOR_CLASS_ID=y -# CONFIG_LWIP_DHCP_RESTORE_LAST_IP is not set -CONFIG_LWIP_DHCP_OPTIONS_LEN=69 -CONFIG_LWIP_NUM_NETIF_CLIENT_DATA=0 -CONFIG_LWIP_DHCP_COARSE_TIMER_SECS=1 - -# -# DHCP server -# -CONFIG_LWIP_DHCPS=y -CONFIG_LWIP_DHCPS_LEASE_UNIT=60 -CONFIG_LWIP_DHCPS_MAX_STATION_NUM=8 -CONFIG_LWIP_DHCPS_STATIC_ENTRIES=y -CONFIG_LWIP_DHCPS_ADD_DNS=y -# end of DHCP server - -# CONFIG_LWIP_AUTOIP is not set -CONFIG_LWIP_IPV4=y -CONFIG_LWIP_IPV6=y -# CONFIG_LWIP_IPV6_AUTOCONFIG is not set -CONFIG_LWIP_IPV6_NUM_ADDRESSES=3 -# CONFIG_LWIP_IPV6_FORWARD is not set -# CONFIG_LWIP_NETIF_STATUS_CALLBACK is not set -CONFIG_LWIP_NETIF_LOOPBACK=y -CONFIG_LWIP_LOOPBACK_MAX_PBUFS=8 - -# -# TCP -# -CONFIG_LWIP_MAX_ACTIVE_TCP=16 -CONFIG_LWIP_MAX_LISTENING_TCP=16 -CONFIG_LWIP_TCP_HIGH_SPEED_RETRANSMISSION=y -CONFIG_LWIP_TCP_MAXRTX=12 -CONFIG_LWIP_TCP_SYNMAXRTX=12 -CONFIG_LWIP_TCP_MSS=1440 -CONFIG_LWIP_TCP_TMR_INTERVAL=250 -CONFIG_LWIP_TCP_MSL=60000 -CONFIG_LWIP_TCP_FIN_WAIT_TIMEOUT=20000 -CONFIG_LWIP_TCP_SND_BUF_DEFAULT=5744 -CONFIG_LWIP_TCP_WND_DEFAULT=5744 -CONFIG_LWIP_TCP_RECVMBOX_SIZE=6 -CONFIG_LWIP_TCP_ACCEPTMBOX_SIZE=6 -CONFIG_LWIP_TCP_QUEUE_OOSEQ=y -CONFIG_LWIP_TCP_OOSEQ_TIMEOUT=6 -CONFIG_LWIP_TCP_OOSEQ_MAX_PBUFS=4 -# CONFIG_LWIP_TCP_SACK_OUT is not set -CONFIG_LWIP_TCP_OVERSIZE_MSS=y -# CONFIG_LWIP_TCP_OVERSIZE_QUARTER_MSS is not set -# CONFIG_LWIP_TCP_OVERSIZE_DISABLE is not set -CONFIG_LWIP_TCP_RTO_TIME=1500 -# end of TCP - -# -# UDP -# -CONFIG_LWIP_MAX_UDP_PCBS=16 -CONFIG_LWIP_UDP_RECVMBOX_SIZE=6 -# end of UDP - -# -# Checksums -# -# CONFIG_LWIP_CHECKSUM_CHECK_IP is not set -# CONFIG_LWIP_CHECKSUM_CHECK_UDP is not set -CONFIG_LWIP_CHECKSUM_CHECK_ICMP=y -# end of Checksums - -CONFIG_LWIP_TCPIP_TASK_STACK_SIZE=3072 -CONFIG_LWIP_TCPIP_TASK_AFFINITY_NO_AFFINITY=y -# CONFIG_LWIP_TCPIP_TASK_AFFINITY_CPU0 is not set -# CONFIG_LWIP_TCPIP_TASK_AFFINITY_CPU1 is not set -CONFIG_LWIP_TCPIP_TASK_AFFINITY=0x7FFFFFFF -CONFIG_LWIP_IPV6_MEMP_NUM_ND6_QUEUE=3 -CONFIG_LWIP_IPV6_ND6_NUM_NEIGHBORS=5 -CONFIG_LWIP_IPV6_ND6_NUM_PREFIXES=5 -CONFIG_LWIP_IPV6_ND6_NUM_ROUTERS=3 -CONFIG_LWIP_IPV6_ND6_NUM_DESTINATIONS=10 -# CONFIG_LWIP_PPP_SUPPORT is not set -# CONFIG_LWIP_SLIP_SUPPORT is not set - -# -# ICMP -# -CONFIG_LWIP_ICMP=y -# CONFIG_LWIP_MULTICAST_PING is not set -# CONFIG_LWIP_BROADCAST_PING is not set -# end of ICMP - -# -# LWIP RAW API -# -CONFIG_LWIP_MAX_RAW_PCBS=16 -# end of LWIP RAW API - -# -# SNTP -# -CONFIG_LWIP_SNTP_MAX_SERVERS=1 -# CONFIG_LWIP_DHCP_GET_NTP_SRV is not set -CONFIG_LWIP_SNTP_UPDATE_DELAY=3600000 -CONFIG_LWIP_SNTP_STARTUP_DELAY=y -CONFIG_LWIP_SNTP_MAXIMUM_STARTUP_DELAY=5000 -# end of SNTP - -# -# DNS -# -CONFIG_LWIP_DNS_MAX_HOST_IP=1 -CONFIG_LWIP_DNS_MAX_SERVERS=3 -# CONFIG_LWIP_FALLBACK_DNS_SERVER_SUPPORT is not set -# CONFIG_LWIP_DNS_SETSERVER_WITH_NETIF is not set -# CONFIG_LWIP_USE_ESP_GETADDRINFO is not set -# end of DNS - -CONFIG_LWIP_BRIDGEIF_MAX_PORTS=7 -CONFIG_LWIP_ESP_LWIP_ASSERT=y - -# -# Hooks -# -# CONFIG_LWIP_HOOK_TCP_ISN_NONE is not set -CONFIG_LWIP_HOOK_TCP_ISN_DEFAULT=y -# CONFIG_LWIP_HOOK_TCP_ISN_CUSTOM is not set -CONFIG_LWIP_HOOK_IP6_ROUTE_NONE=y -# CONFIG_LWIP_HOOK_IP6_ROUTE_DEFAULT is not set -# CONFIG_LWIP_HOOK_IP6_ROUTE_CUSTOM is not set -CONFIG_LWIP_HOOK_ND6_GET_GW_NONE=y -# CONFIG_LWIP_HOOK_ND6_GET_GW_DEFAULT is not set -# CONFIG_LWIP_HOOK_ND6_GET_GW_CUSTOM is not set -CONFIG_LWIP_HOOK_IP6_SELECT_SRC_ADDR_NONE=y -# CONFIG_LWIP_HOOK_IP6_SELECT_SRC_ADDR_DEFAULT is not set -# CONFIG_LWIP_HOOK_IP6_SELECT_SRC_ADDR_CUSTOM is not set -CONFIG_LWIP_HOOK_DHCP_EXTRA_OPTION_NONE=y -# CONFIG_LWIP_HOOK_DHCP_EXTRA_OPTION_DEFAULT is not set -# CONFIG_LWIP_HOOK_DHCP_EXTRA_OPTION_CUSTOM is not set -CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_NONE=y -# CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_DEFAULT is not set -# CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_CUSTOM is not set -CONFIG_LWIP_HOOK_DNS_EXT_RESOLVE_NONE=y -# CONFIG_LWIP_HOOK_DNS_EXT_RESOLVE_CUSTOM is not set -CONFIG_LWIP_HOOK_IP6_INPUT_NONE=y -# CONFIG_LWIP_HOOK_IP6_INPUT_DEFAULT is not set -# CONFIG_LWIP_HOOK_IP6_INPUT_CUSTOM is not set -# end of Hooks - -# CONFIG_LWIP_DEBUG is not set -# end of LWIP - -# -# mbedTLS -# -CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC=y -# CONFIG_MBEDTLS_EXTERNAL_MEM_ALLOC is not set -# CONFIG_MBEDTLS_DEFAULT_MEM_ALLOC is not set -# CONFIG_MBEDTLS_CUSTOM_MEM_ALLOC is not set -CONFIG_MBEDTLS_ASYMMETRIC_CONTENT_LEN=y -CONFIG_MBEDTLS_SSL_IN_CONTENT_LEN=16384 -CONFIG_MBEDTLS_SSL_OUT_CONTENT_LEN=4096 -# CONFIG_MBEDTLS_DYNAMIC_BUFFER is not set -# CONFIG_MBEDTLS_DEBUG is not set - -# -# mbedTLS v3.x related -# -# CONFIG_MBEDTLS_SSL_PROTO_TLS1_3 is not set -# CONFIG_MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH is not set -# CONFIG_MBEDTLS_X509_TRUSTED_CERT_CALLBACK is not set -# CONFIG_MBEDTLS_SSL_CONTEXT_SERIALIZATION is not set -CONFIG_MBEDTLS_SSL_KEEP_PEER_CERTIFICATE=y -# CONFIG_MBEDTLS_SSL_KEYING_MATERIAL_EXPORT is not set -CONFIG_MBEDTLS_PKCS7_C=y -# end of mbedTLS v3.x related - -# -# Certificate Bundle -# -CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=y -CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_FULL=y -# CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_CMN is not set -# CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_NONE is not set -# CONFIG_MBEDTLS_CUSTOM_CERTIFICATE_BUNDLE is not set -# CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEPRECATED_LIST is not set -CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_MAX_CERTS=200 -# end of Certificate Bundle - -# CONFIG_MBEDTLS_ECP_RESTARTABLE is not set -CONFIG_MBEDTLS_CMAC_C=y -CONFIG_MBEDTLS_HARDWARE_AES=y -CONFIG_MBEDTLS_AES_USE_INTERRUPT=y -CONFIG_MBEDTLS_AES_INTERRUPT_LEVEL=0 -# CONFIG_MBEDTLS_GCM_SUPPORT_NON_AES_CIPHER is not set -CONFIG_MBEDTLS_HARDWARE_MPI=y -# CONFIG_MBEDTLS_LARGE_KEY_SOFTWARE_MPI is not set -CONFIG_MBEDTLS_MPI_USE_INTERRUPT=y -CONFIG_MBEDTLS_MPI_INTERRUPT_LEVEL=0 -CONFIG_MBEDTLS_HARDWARE_SHA=y -CONFIG_MBEDTLS_ROM_MD5=y -# CONFIG_MBEDTLS_ATCA_HW_ECDSA_SIGN is not set -# CONFIG_MBEDTLS_ATCA_HW_ECDSA_VERIFY is not set -CONFIG_MBEDTLS_HAVE_TIME=y -# CONFIG_MBEDTLS_PLATFORM_TIME_ALT is not set -# CONFIG_MBEDTLS_HAVE_TIME_DATE is not set -CONFIG_MBEDTLS_ECDSA_DETERMINISTIC=y -CONFIG_MBEDTLS_SHA1_C=y -CONFIG_MBEDTLS_SHA512_C=y -# CONFIG_MBEDTLS_SHA3_C is not set -CONFIG_MBEDTLS_TLS_SERVER_AND_CLIENT=y -# CONFIG_MBEDTLS_TLS_SERVER_ONLY is not set -# CONFIG_MBEDTLS_TLS_CLIENT_ONLY is not set -# CONFIG_MBEDTLS_TLS_DISABLED is not set -CONFIG_MBEDTLS_TLS_SERVER=y -CONFIG_MBEDTLS_TLS_CLIENT=y -CONFIG_MBEDTLS_TLS_ENABLED=y - -# -# TLS Key Exchange Methods -# -# CONFIG_MBEDTLS_PSK_MODES is not set -CONFIG_MBEDTLS_KEY_EXCHANGE_RSA=y -CONFIG_MBEDTLS_KEY_EXCHANGE_ELLIPTIC_CURVE=y -CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_RSA=y -CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA=y -CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA=y -CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_RSA=y -# end of TLS Key Exchange Methods - -CONFIG_MBEDTLS_SSL_RENEGOTIATION=y -CONFIG_MBEDTLS_SSL_PROTO_TLS1_2=y -# CONFIG_MBEDTLS_SSL_PROTO_GMTSSL1_1 is not set -# CONFIG_MBEDTLS_SSL_PROTO_DTLS is not set -CONFIG_MBEDTLS_SSL_ALPN=y -CONFIG_MBEDTLS_CLIENT_SSL_SESSION_TICKETS=y -CONFIG_MBEDTLS_SERVER_SSL_SESSION_TICKETS=y - -# -# Symmetric Ciphers -# -CONFIG_MBEDTLS_AES_C=y -# CONFIG_MBEDTLS_CAMELLIA_C is not set -# CONFIG_MBEDTLS_DES_C is not set -# CONFIG_MBEDTLS_BLOWFISH_C is not set -# CONFIG_MBEDTLS_XTEA_C is not set -CONFIG_MBEDTLS_CCM_C=y -CONFIG_MBEDTLS_GCM_C=y -# CONFIG_MBEDTLS_NIST_KW_C is not set -# end of Symmetric Ciphers - -# CONFIG_MBEDTLS_RIPEMD160_C is not set - -# -# Certificates -# -CONFIG_MBEDTLS_PEM_PARSE_C=y -CONFIG_MBEDTLS_PEM_WRITE_C=y -CONFIG_MBEDTLS_X509_CRL_PARSE_C=y -CONFIG_MBEDTLS_X509_CSR_PARSE_C=y -# end of Certificates - -CONFIG_MBEDTLS_ECP_C=y -CONFIG_MBEDTLS_PK_PARSE_EC_EXTENDED=y -CONFIG_MBEDTLS_PK_PARSE_EC_COMPRESSED=y -# CONFIG_MBEDTLS_DHM_C is not set -CONFIG_MBEDTLS_ECDH_C=y -CONFIG_MBEDTLS_ECDSA_C=y -# CONFIG_MBEDTLS_ECJPAKE_C is not set -CONFIG_MBEDTLS_ECP_DP_SECP192R1_ENABLED=y -CONFIG_MBEDTLS_ECP_DP_SECP224R1_ENABLED=y -CONFIG_MBEDTLS_ECP_DP_SECP256R1_ENABLED=y -CONFIG_MBEDTLS_ECP_DP_SECP384R1_ENABLED=y -CONFIG_MBEDTLS_ECP_DP_SECP521R1_ENABLED=y -CONFIG_MBEDTLS_ECP_DP_SECP192K1_ENABLED=y -CONFIG_MBEDTLS_ECP_DP_SECP224K1_ENABLED=y -CONFIG_MBEDTLS_ECP_DP_SECP256K1_ENABLED=y -CONFIG_MBEDTLS_ECP_DP_BP256R1_ENABLED=y -CONFIG_MBEDTLS_ECP_DP_BP384R1_ENABLED=y -CONFIG_MBEDTLS_ECP_DP_BP512R1_ENABLED=y -CONFIG_MBEDTLS_ECP_DP_CURVE25519_ENABLED=y -CONFIG_MBEDTLS_ECP_NIST_OPTIM=y -CONFIG_MBEDTLS_ECP_FIXED_POINT_OPTIM=y -# CONFIG_MBEDTLS_POLY1305_C is not set -# CONFIG_MBEDTLS_CHACHA20_C is not set -# CONFIG_MBEDTLS_HKDF_C is not set -# CONFIG_MBEDTLS_THREADING_C is not set -CONFIG_MBEDTLS_ERROR_STRINGS=y -CONFIG_MBEDTLS_FS_IO=y -# CONFIG_MBEDTLS_ALLOW_WEAK_CERTIFICATE_VERIFICATION is not set -# end of mbedTLS - -# -# ESP-MQTT Configurations -# -CONFIG_MQTT_PROTOCOL_311=y -# CONFIG_MQTT_PROTOCOL_5 is not set -CONFIG_MQTT_TRANSPORT_SSL=y -CONFIG_MQTT_TRANSPORT_WEBSOCKET=y -CONFIG_MQTT_TRANSPORT_WEBSOCKET_SECURE=y -# CONFIG_MQTT_MSG_ID_INCREMENTAL is not set -# CONFIG_MQTT_SKIP_PUBLISH_IF_DISCONNECTED is not set -# CONFIG_MQTT_REPORT_DELETED_MESSAGES is not set -# CONFIG_MQTT_USE_CUSTOM_CONFIG is not set -# CONFIG_MQTT_TASK_CORE_SELECTION_ENABLED is not set -# CONFIG_MQTT_CUSTOM_OUTBOX is not set -# end of ESP-MQTT Configurations - -# -# LibC -# -CONFIG_LIBC_NEWLIB=y -CONFIG_LIBC_MISC_IN_IRAM=y -CONFIG_LIBC_LOCKS_PLACE_IN_IRAM=y -CONFIG_LIBC_STDOUT_LINE_ENDING_CRLF=y -# CONFIG_LIBC_STDOUT_LINE_ENDING_LF is not set -# CONFIG_LIBC_STDOUT_LINE_ENDING_CR is not set -# CONFIG_LIBC_STDIN_LINE_ENDING_CRLF is not set -# CONFIG_LIBC_STDIN_LINE_ENDING_LF is not set -CONFIG_LIBC_STDIN_LINE_ENDING_CR=y -# CONFIG_LIBC_NEWLIB_NANO_FORMAT is not set -CONFIG_LIBC_TIME_SYSCALL_USE_RTC_HRT=y -# CONFIG_LIBC_TIME_SYSCALL_USE_RTC is not set -# CONFIG_LIBC_TIME_SYSCALL_USE_HRT is not set -# CONFIG_LIBC_TIME_SYSCALL_USE_NONE is not set -# end of LibC - -CONFIG_STDATOMIC_S32C1I_SPIRAM_WORKAROUND=y - -# -# NVS -# -# CONFIG_NVS_ENCRYPTION is not set -# CONFIG_NVS_ASSERT_ERROR_CHECK is not set -# CONFIG_NVS_LEGACY_DUP_KEYS_COMPATIBILITY is not set -# CONFIG_NVS_ALLOCATE_CACHE_IN_SPIRAM is not set -# end of NVS - -# -# OpenThread -# -# CONFIG_OPENTHREAD_ENABLED is not set - -# -# OpenThread Spinel -# -# CONFIG_OPENTHREAD_SPINEL_ONLY is not set -# end of OpenThread Spinel -# end of OpenThread - -# -# Protocomm -# -CONFIG_ESP_PROTOCOMM_SUPPORT_SECURITY_VERSION_0=y -CONFIG_ESP_PROTOCOMM_SUPPORT_SECURITY_VERSION_1=y -CONFIG_ESP_PROTOCOMM_SUPPORT_SECURITY_VERSION_2=y -CONFIG_ESP_PROTOCOMM_SUPPORT_SECURITY_PATCH_VERSION=y -# end of Protocomm - -# -# PThreads -# -CONFIG_PTHREAD_TASK_PRIO_DEFAULT=5 -CONFIG_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072 -CONFIG_PTHREAD_STACK_MIN=768 -CONFIG_PTHREAD_DEFAULT_CORE_NO_AFFINITY=y -# CONFIG_PTHREAD_DEFAULT_CORE_0 is not set -# CONFIG_PTHREAD_DEFAULT_CORE_1 is not set -CONFIG_PTHREAD_TASK_CORE_DEFAULT=-1 -CONFIG_PTHREAD_TASK_NAME_DEFAULT="pthread" -# end of PThreads - -# -# MMU Config -# -CONFIG_MMU_PAGE_SIZE_64KB=y -CONFIG_MMU_PAGE_MODE="64KB" -CONFIG_MMU_PAGE_SIZE=0x10000 -# end of MMU Config - -# -# Main Flash configuration -# - -# -# SPI Flash behavior when brownout -# -CONFIG_SPI_FLASH_BROWNOUT_RESET_XMC=y -CONFIG_SPI_FLASH_BROWNOUT_RESET=y -# end of SPI Flash behavior when brownout - -# -# Optional and Experimental Features (READ DOCS FIRST) -# - -# -# Features here require specific hardware (READ DOCS FIRST!) -# -# CONFIG_SPI_FLASH_HPM_ENA is not set -CONFIG_SPI_FLASH_HPM_AUTO=y -# CONFIG_SPI_FLASH_HPM_DIS is not set -CONFIG_SPI_FLASH_HPM_ON=y -CONFIG_SPI_FLASH_HPM_DC_AUTO=y -# CONFIG_SPI_FLASH_HPM_DC_DISABLE is not set -# CONFIG_SPI_FLASH_AUTO_SUSPEND is not set -CONFIG_SPI_FLASH_SUSPEND_TSUS_VAL_US=50 -# CONFIG_SPI_FLASH_FORCE_ENABLE_XMC_C_SUSPEND is not set -# CONFIG_SPI_FLASH_FORCE_ENABLE_C6_H2_SUSPEND is not set -CONFIG_SPI_FLASH_PLACE_FUNCTIONS_IN_IRAM=y -# end of Optional and Experimental Features (READ DOCS FIRST) -# end of Main Flash configuration - -# -# SPI Flash driver -# -# CONFIG_SPI_FLASH_VERIFY_WRITE is not set -# CONFIG_SPI_FLASH_ENABLE_COUNTERS is not set -CONFIG_SPI_FLASH_ROM_DRIVER_PATCH=y -# CONFIG_SPI_FLASH_ROM_IMPL is not set -CONFIG_SPI_FLASH_DANGEROUS_WRITE_ABORTS=y -# CONFIG_SPI_FLASH_DANGEROUS_WRITE_FAILS is not set -# CONFIG_SPI_FLASH_DANGEROUS_WRITE_ALLOWED is not set -# CONFIG_SPI_FLASH_BYPASS_BLOCK_ERASE is not set -CONFIG_SPI_FLASH_YIELD_DURING_ERASE=y -CONFIG_SPI_FLASH_ERASE_YIELD_DURATION_MS=20 -CONFIG_SPI_FLASH_ERASE_YIELD_TICKS=1 -CONFIG_SPI_FLASH_WRITE_CHUNK_SIZE=8192 -# CONFIG_SPI_FLASH_SIZE_OVERRIDE is not set -# CONFIG_SPI_FLASH_CHECK_ERASE_TIMEOUT_DISABLED is not set -# CONFIG_SPI_FLASH_OVERRIDE_CHIP_DRIVER_LIST is not set - -# -# Auto-detect flash chips -# -CONFIG_SPI_FLASH_VENDOR_XMC_SUPPORT_ENABLED=y -CONFIG_SPI_FLASH_VENDOR_GD_SUPPORT_ENABLED=y -CONFIG_SPI_FLASH_VENDOR_ISSI_SUPPORT_ENABLED=y -CONFIG_SPI_FLASH_VENDOR_MXIC_SUPPORT_ENABLED=y -CONFIG_SPI_FLASH_VENDOR_WINBOND_SUPPORT_ENABLED=y -CONFIG_SPI_FLASH_VENDOR_BOYA_SUPPORT_ENABLED=y -CONFIG_SPI_FLASH_VENDOR_TH_SUPPORT_ENABLED=y -CONFIG_SPI_FLASH_SUPPORT_ISSI_CHIP=y -CONFIG_SPI_FLASH_SUPPORT_MXIC_CHIP=y -CONFIG_SPI_FLASH_SUPPORT_GD_CHIP=y -CONFIG_SPI_FLASH_SUPPORT_WINBOND_CHIP=y -CONFIG_SPI_FLASH_SUPPORT_BOYA_CHIP=y -CONFIG_SPI_FLASH_SUPPORT_TH_CHIP=y -CONFIG_SPI_FLASH_SUPPORT_MXIC_OPI_CHIP=y -# end of Auto-detect flash chips - -CONFIG_SPI_FLASH_ENABLE_ENCRYPTED_READ_WRITE=y -# end of SPI Flash driver - -# -# SPIFFS Configuration -# -CONFIG_SPIFFS_MAX_PARTITIONS=3 - -# -# SPIFFS Cache Configuration -# -CONFIG_SPIFFS_CACHE=y -CONFIG_SPIFFS_CACHE_WR=y -# CONFIG_SPIFFS_CACHE_STATS is not set -# end of SPIFFS Cache Configuration - -CONFIG_SPIFFS_PAGE_CHECK=y -CONFIG_SPIFFS_GC_MAX_RUNS=10 -# CONFIG_SPIFFS_GC_STATS is not set -CONFIG_SPIFFS_PAGE_SIZE=256 -CONFIG_SPIFFS_OBJ_NAME_LEN=32 -# CONFIG_SPIFFS_FOLLOW_SYMLINKS is not set -CONFIG_SPIFFS_USE_MAGIC=y -CONFIG_SPIFFS_USE_MAGIC_LENGTH=y -CONFIG_SPIFFS_META_LENGTH=4 -CONFIG_SPIFFS_USE_MTIME=y - -# -# Debug Configuration -# -# CONFIG_SPIFFS_DBG is not set -# CONFIG_SPIFFS_API_DBG is not set -# CONFIG_SPIFFS_GC_DBG is not set -# CONFIG_SPIFFS_CACHE_DBG is not set -# CONFIG_SPIFFS_CHECK_DBG is not set -# CONFIG_SPIFFS_TEST_VISUALISATION is not set -# end of Debug Configuration -# end of SPIFFS Configuration - -# -# TCP Transport -# - -# -# Websocket -# -CONFIG_WS_TRANSPORT=y -CONFIG_WS_BUFFER_SIZE=1024 -# CONFIG_WS_DYNAMIC_BUFFER is not set -# end of Websocket -# end of TCP Transport - -# -# Ultra Low Power (ULP) Co-processor -# -# CONFIG_ULP_COPROC_ENABLED is not set - -# -# ULP Debugging Options -# -# end of ULP Debugging Options -# end of Ultra Low Power (ULP) Co-processor - -# -# Unity unit testing library -# -CONFIG_UNITY_ENABLE_FLOAT=y -CONFIG_UNITY_ENABLE_DOUBLE=y -# CONFIG_UNITY_ENABLE_64BIT is not set -# CONFIG_UNITY_ENABLE_COLOR is not set -CONFIG_UNITY_ENABLE_IDF_TEST_RUNNER=y -# CONFIG_UNITY_ENABLE_FIXTURE is not set -# CONFIG_UNITY_ENABLE_BACKTRACE_ON_FAIL is not set -# CONFIG_UNITY_TEST_ORDER_BY_FILE_PATH_AND_LINE is not set -# end of Unity unit testing library - -# -# USB-OTG -# -CONFIG_USB_HOST_CONTROL_TRANSFER_MAX_SIZE=256 -CONFIG_USB_HOST_HW_BUFFER_BIAS_BALANCED=y -# CONFIG_USB_HOST_HW_BUFFER_BIAS_IN is not set -# CONFIG_USB_HOST_HW_BUFFER_BIAS_PERIODIC_OUT is not set - -# -# Hub Driver Configuration -# - -# -# Root Port configuration -# -CONFIG_USB_HOST_DEBOUNCE_DELAY_MS=250 -CONFIG_USB_HOST_RESET_HOLD_MS=30 -CONFIG_USB_HOST_RESET_RECOVERY_MS=30 -CONFIG_USB_HOST_SET_ADDR_RECOVERY_MS=10 -# end of Root Port configuration - -# CONFIG_USB_HOST_HUBS_SUPPORTED is not set -# end of Hub Driver Configuration - -# CONFIG_USB_HOST_ENABLE_ENUM_FILTER_CALLBACK is not set -CONFIG_USB_OTG_SUPPORTED=y -# end of USB-OTG - -# -# Virtual file system -# -CONFIG_VFS_SUPPORT_IO=y -CONFIG_VFS_SUPPORT_DIR=y -CONFIG_VFS_SUPPORT_SELECT=y -CONFIG_VFS_SUPPRESS_SELECT_DEBUG_OUTPUT=y -# CONFIG_VFS_SELECT_IN_RAM is not set -CONFIG_VFS_SUPPORT_TERMIOS=y -CONFIG_VFS_MAX_COUNT=8 - -# -# Host File System I/O (Semihosting) -# -CONFIG_VFS_SEMIHOSTFS_MAX_MOUNT_POINTS=1 -# end of Host File System I/O (Semihosting) - -CONFIG_VFS_INITIALIZE_DEV_NULL=y -# end of Virtual file system - -# -# Wear Levelling -# -# CONFIG_WL_SECTOR_SIZE_512 is not set -CONFIG_WL_SECTOR_SIZE_4096=y -CONFIG_WL_SECTOR_SIZE=4096 -# end of Wear Levelling - -# -# Wi-Fi Provisioning Manager -# -CONFIG_WIFI_PROV_SCAN_MAX_ENTRIES=16 -CONFIG_WIFI_PROV_AUTOSTOP_TIMEOUT=30 -CONFIG_WIFI_PROV_STA_ALL_CHANNEL_SCAN=y -# CONFIG_WIFI_PROV_STA_FAST_SCAN is not set -# end of Wi-Fi Provisioning Manager - -# -# WebSocket Server -# -CONFIG_WEBSOCKET_SERVER_MAX_CLIENTS=20 -CONFIG_WEBSOCKET_SERVER_QUEUE_SIZE=10 -CONFIG_WEBSOCKET_SERVER_QUEUE_TIMEOUT=30 -CONFIG_WEBSOCKET_SERVER_TASK_STACK_DEPTH=6000 -CONFIG_WEBSOCKET_SERVER_TASK_PRIORITY=5 -# CONFIG_WEBSOCKET_SERVER_PINNED is not set -# end of WebSocket Server - -# -# DSP Library -# -CONFIG_DSP_OPTIMIZATIONS_SUPPORTED=y -# CONFIG_DSP_ANSI is not set -CONFIG_DSP_OPTIMIZED=y -CONFIG_DSP_OPTIMIZATION=1 -# CONFIG_DSP_MAX_FFT_SIZE_512 is not set -# CONFIG_DSP_MAX_FFT_SIZE_1024 is not set -# CONFIG_DSP_MAX_FFT_SIZE_2048 is not set -CONFIG_DSP_MAX_FFT_SIZE_4096=y -# CONFIG_DSP_MAX_FFT_SIZE_8192 is not set -# CONFIG_DSP_MAX_FFT_SIZE_16384 is not set -# CONFIG_DSP_MAX_FFT_SIZE_32768 is not set -CONFIG_DSP_MAX_FFT_SIZE=4096 -# end of DSP Library - -# -# mDNS -# -CONFIG_MDNS_MAX_INTERFACES=3 -CONFIG_MDNS_MAX_SERVICES=10 -CONFIG_MDNS_TASK_PRIORITY=1 -CONFIG_MDNS_ACTION_QUEUE_LEN=16 -CONFIG_MDNS_TASK_STACK_SIZE=2816 -CONFIG_MDNS_TASK_AFFINITY_NO_AFFINITY=y -# CONFIG_MDNS_TASK_AFFINITY_CPU0 is not set -# CONFIG_MDNS_TASK_AFFINITY_CPU1 is not set -CONFIG_MDNS_TASK_AFFINITY=0x7FFFFFFF - -# -# MDNS Memory Configuration -# -# CONFIG_MDNS_TASK_CREATE_FROM_SPIRAM is not set -CONFIG_MDNS_TASK_CREATE_FROM_INTERNAL=y -# CONFIG_MDNS_MEMORY_ALLOC_SPIRAM is not set -CONFIG_MDNS_MEMORY_ALLOC_INTERNAL=y -# CONFIG_MDNS_MEMORY_CUSTOM_IMPL is not set -# end of MDNS Memory Configuration - -CONFIG_MDNS_SERVICE_ADD_TIMEOUT_MS=2000 -CONFIG_MDNS_TIMER_PERIOD_MS=100 -# CONFIG_MDNS_NETWORKING_SOCKET is not set -# CONFIG_MDNS_SKIP_SUPPRESSING_OWN_QUERIES is not set -# CONFIG_MDNS_ENABLE_DEBUG_PRINTS is not set -CONFIG_MDNS_ENABLE_CONSOLE_CLI=y -# CONFIG_MDNS_RESPOND_REVERSE_QUERIES is not set -CONFIG_MDNS_MULTIPLE_INSTANCE=y - -# -# MDNS Predefined interfaces -# -CONFIG_MDNS_PREDEF_NETIF_STA=y -CONFIG_MDNS_PREDEF_NETIF_AP=y -CONFIG_MDNS_PREDEF_NETIF_ETH=y -# end of MDNS Predefined interfaces -# end of mDNS -# end of Component config - -# CONFIG_IDF_EXPERIMENTAL_FEATURES is not set - -# Deprecated options for backward compatibility -# CONFIG_APP_BUILD_TYPE_ELF_RAM is not set -# CONFIG_NO_BLOBS is not set -CONFIG_APP_ROLLBACK_ENABLE=y -# CONFIG_APP_ANTI_ROLLBACK is not set -# CONFIG_LOG_BOOTLOADER_LEVEL_NONE is not set -# CONFIG_LOG_BOOTLOADER_LEVEL_ERROR is not set -# CONFIG_LOG_BOOTLOADER_LEVEL_WARN is not set -CONFIG_LOG_BOOTLOADER_LEVEL_INFO=y -# CONFIG_LOG_BOOTLOADER_LEVEL_DEBUG is not set -# CONFIG_LOG_BOOTLOADER_LEVEL_VERBOSE is not set -CONFIG_LOG_BOOTLOADER_LEVEL=3 -# CONFIG_FLASH_ENCRYPTION_ENABLED is not set -# CONFIG_FLASHMODE_QIO is not set -# CONFIG_FLASHMODE_QOUT is not set -CONFIG_FLASHMODE_DIO=y -# CONFIG_FLASHMODE_DOUT is not set -CONFIG_MONITOR_BAUD=115200 -# CONFIG_OPTIMIZATION_LEVEL_DEBUG is not set -# CONFIG_COMPILER_OPTIMIZATION_LEVEL_DEBUG is not set -# CONFIG_COMPILER_OPTIMIZATION_DEFAULT is not set -# CONFIG_OPTIMIZATION_LEVEL_RELEASE is not set -# CONFIG_COMPILER_OPTIMIZATION_LEVEL_RELEASE is not set -CONFIG_OPTIMIZATION_ASSERTIONS_ENABLED=y -# CONFIG_OPTIMIZATION_ASSERTIONS_SILENT is not set -# CONFIG_OPTIMIZATION_ASSERTIONS_DISABLED is not set -CONFIG_OPTIMIZATION_ASSERTION_LEVEL=2 -# CONFIG_CXX_EXCEPTIONS is not set -CONFIG_STACK_CHECK_NONE=y -# CONFIG_STACK_CHECK_NORM is not set -# CONFIG_STACK_CHECK_STRONG is not set -# CONFIG_STACK_CHECK_ALL is not set -# CONFIG_WARN_WRITE_STRINGS is not set -# CONFIG_ESP32_APPTRACE_DEST_TRAX is not set -CONFIG_ESP32_APPTRACE_DEST_NONE=y -CONFIG_ESP32_APPTRACE_LOCK_ENABLE=y -# CONFIG_EXTERNAL_COEX_ENABLE is not set -# CONFIG_ESP_WIFI_EXTERNAL_COEXIST_ENABLE is not set -# CONFIG_CAM_CTLR_DVP_CAM_ISR_IRAM_SAFE is not set -# CONFIG_GPTIMER_ISR_IRAM_SAFE is not set -# CONFIG_MCPWM_ISR_IRAM_SAFE is not set -# CONFIG_EVENT_LOOP_PROFILING is not set -CONFIG_POST_EVENTS_FROM_ISR=y -CONFIG_POST_EVENTS_FROM_IRAM_ISR=y -CONFIG_GDBSTUB_SUPPORT_TASKS=y -CONFIG_GDBSTUB_MAX_TASKS=32 -# CONFIG_OTA_ALLOW_HTTP is not set -CONFIG_ESP32S3_DEEP_SLEEP_WAKEUP_DELAY=2000 -CONFIG_ESP_SLEEP_DEEP_SLEEP_WAKEUP_DELAY=2000 -CONFIG_ESP32S3_RTC_CLK_SRC_INT_RC=y -# CONFIG_ESP32S3_RTC_CLK_SRC_EXT_CRYS is not set -# CONFIG_ESP32S3_RTC_CLK_SRC_EXT_OSC is not set -# CONFIG_ESP32S3_RTC_CLK_SRC_INT_8MD256 is not set -CONFIG_ESP32S3_RTC_CLK_CAL_CYCLES=1024 -CONFIG_PERIPH_CTRL_FUNC_IN_IRAM=y -CONFIG_BROWNOUT_DET=y -CONFIG_ESP32S3_BROWNOUT_DET=y -CONFIG_BROWNOUT_DET_LVL_SEL_7=y -CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_7=y -# CONFIG_BROWNOUT_DET_LVL_SEL_6 is not set -# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_6 is not set -# CONFIG_BROWNOUT_DET_LVL_SEL_5 is not set -# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_5 is not set -# CONFIG_BROWNOUT_DET_LVL_SEL_4 is not set -# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_4 is not set -# CONFIG_BROWNOUT_DET_LVL_SEL_3 is not set -# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_3 is not set -# CONFIG_BROWNOUT_DET_LVL_SEL_2 is not set -# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_2 is not set -# CONFIG_BROWNOUT_DET_LVL_SEL_1 is not set -# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_1 is not set -CONFIG_BROWNOUT_DET_LVL=7 -CONFIG_ESP32S3_BROWNOUT_DET_LVL=7 -CONFIG_ESP_SYSTEM_BROWNOUT_INTR=y -CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE=y -# CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION is not set -CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER=20 -CONFIG_ESP32_PHY_MAX_TX_POWER=20 -# CONFIG_REDUCE_PHY_TX_POWER is not set -# CONFIG_ESP32_REDUCE_PHY_TX_POWER is not set -CONFIG_ESP_SYSTEM_PM_POWER_DOWN_CPU=y -CONFIG_PM_POWER_DOWN_TAGMEM_IN_LIGHT_SLEEP=y -CONFIG_ESP32S3_SPIRAM_SUPPORT=y -CONFIG_DEFAULT_PSRAM_CLK_IO=30 -CONFIG_DEFAULT_PSRAM_CS_IO=26 -# CONFIG_ESP32S3_DEFAULT_CPU_FREQ_80 is not set -# CONFIG_ESP32S3_DEFAULT_CPU_FREQ_160 is not set -CONFIG_ESP32S3_DEFAULT_CPU_FREQ_240=y -CONFIG_ESP32S3_DEFAULT_CPU_FREQ_MHZ=240 -CONFIG_SYSTEM_EVENT_QUEUE_SIZE=32 -CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=2304 -CONFIG_MAIN_TASK_STACK_SIZE=3584 -CONFIG_CONSOLE_UART_DEFAULT=y -# CONFIG_CONSOLE_UART_CUSTOM is not set -# CONFIG_CONSOLE_UART_NONE is not set -# CONFIG_ESP_CONSOLE_UART_NONE is not set -CONFIG_CONSOLE_UART=y -CONFIG_CONSOLE_UART_NUM=0 -CONFIG_CONSOLE_UART_BAUDRATE=115200 -CONFIG_INT_WDT=y -CONFIG_INT_WDT_TIMEOUT_MS=300 -CONFIG_INT_WDT_CHECK_CPU1=y -CONFIG_TASK_WDT=y -CONFIG_ESP_TASK_WDT=y -# CONFIG_TASK_WDT_PANIC is not set -CONFIG_TASK_WDT_TIMEOUT_S=5 -CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU0=y -CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU1=y -# CONFIG_ESP32_DEBUG_STUBS_ENABLE is not set -CONFIG_ESP32S3_DEBUG_OCDAWARE=y -CONFIG_IPC_TASK_STACK_SIZE=1280 -CONFIG_TIMER_TASK_STACK_SIZE=3584 -CONFIG_ESP32_WIFI_ENABLED=y -CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=10 -CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=32 -CONFIG_ESP32_WIFI_STATIC_TX_BUFFER=y -# CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER is not set -CONFIG_ESP32_WIFI_TX_BUFFER_TYPE=0 -CONFIG_ESP32_WIFI_STATIC_TX_BUFFER_NUM=16 -# CONFIG_ESP32_WIFI_CSI_ENABLED is not set -CONFIG_ESP32_WIFI_AMPDU_TX_ENABLED=y -CONFIG_ESP32_WIFI_TX_BA_WIN=6 -CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED=y -CONFIG_ESP32_WIFI_RX_BA_WIN=6 -CONFIG_ESP32_WIFI_NVS_ENABLED=y -CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_0=y -# CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_1 is not set -CONFIG_ESP32_WIFI_SOFTAP_BEACON_MAX_LEN=752 -CONFIG_ESP32_WIFI_MGMT_SBUF_NUM=32 -CONFIG_ESP32_WIFI_IRAM_OPT=y -CONFIG_ESP32_WIFI_RX_IRAM_OPT=y -CONFIG_ESP32_WIFI_ENABLE_WPA3_SAE=y -CONFIG_ESP32_WIFI_ENABLE_WPA3_OWE_STA=y -CONFIG_WPA_MBEDTLS_CRYPTO=y -CONFIG_WPA_MBEDTLS_TLS_CLIENT=y -# CONFIG_WPA_WAPI_PSK is not set -# CONFIG_WPA_SUITE_B_192 is not set -# CONFIG_WPA_11KV_SUPPORT is not set -# CONFIG_WPA_MBO_SUPPORT is not set -# CONFIG_WPA_DPP_SUPPORT is not set -# CONFIG_WPA_11R_SUPPORT is not set -# CONFIG_WPA_WPS_SOFTAP_REGISTRAR is not set -# CONFIG_WPA_WPS_STRICT is not set -# CONFIG_WPA_DEBUG_PRINT is not set -# CONFIG_WPA_TESTING_OPTIONS is not set -# CONFIG_ESP32_ENABLE_COREDUMP_TO_FLASH is not set -# CONFIG_ESP32_ENABLE_COREDUMP_TO_UART is not set -CONFIG_ESP32_ENABLE_COREDUMP_TO_NONE=y -CONFIG_TIMER_TASK_PRIORITY=1 -CONFIG_TIMER_TASK_STACK_DEPTH=2048 -CONFIG_TIMER_QUEUE_LENGTH=10 -# CONFIG_ENABLE_STATIC_TASK_CLEAN_UP_HOOK is not set -CONFIG_SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY=y -# CONFIG_HAL_ASSERTION_SILIENT is not set -# CONFIG_L2_TO_L3_COPY is not set -CONFIG_ESP_GRATUITOUS_ARP=y -CONFIG_GARP_TMR_INTERVAL=60 -CONFIG_TCPIP_RECVMBOX_SIZE=32 -CONFIG_TCP_MAXRTX=12 -CONFIG_TCP_SYNMAXRTX=12 -CONFIG_TCP_MSS=1440 -CONFIG_TCP_MSL=60000 -CONFIG_TCP_SND_BUF_DEFAULT=5744 -CONFIG_TCP_WND_DEFAULT=5744 -CONFIG_TCP_RECVMBOX_SIZE=6 -CONFIG_TCP_QUEUE_OOSEQ=y -CONFIG_TCP_OVERSIZE_MSS=y -# CONFIG_TCP_OVERSIZE_QUARTER_MSS is not set -# CONFIG_TCP_OVERSIZE_DISABLE is not set -CONFIG_UDP_RECVMBOX_SIZE=6 -CONFIG_TCPIP_TASK_STACK_SIZE=3072 -CONFIG_TCPIP_TASK_AFFINITY_NO_AFFINITY=y -# CONFIG_TCPIP_TASK_AFFINITY_CPU0 is not set -# CONFIG_TCPIP_TASK_AFFINITY_CPU1 is not set -CONFIG_TCPIP_TASK_AFFINITY=0x7FFFFFFF -# CONFIG_PPP_SUPPORT is not set -CONFIG_NEWLIB_STDOUT_LINE_ENDING_CRLF=y -# CONFIG_NEWLIB_STDOUT_LINE_ENDING_LF is not set -# CONFIG_NEWLIB_STDOUT_LINE_ENDING_CR is not set -# CONFIG_NEWLIB_STDIN_LINE_ENDING_CRLF is not set -# CONFIG_NEWLIB_STDIN_LINE_ENDING_LF is not set -CONFIG_NEWLIB_STDIN_LINE_ENDING_CR=y -# CONFIG_NEWLIB_NANO_FORMAT is not set -CONFIG_NEWLIB_TIME_SYSCALL_USE_RTC_HRT=y -CONFIG_ESP32S3_TIME_SYSCALL_USE_RTC_SYSTIMER=y -CONFIG_ESP32S3_TIME_SYSCALL_USE_RTC_FRC1=y -# CONFIG_NEWLIB_TIME_SYSCALL_USE_RTC is not set -# CONFIG_ESP32S3_TIME_SYSCALL_USE_RTC is not set -# CONFIG_NEWLIB_TIME_SYSCALL_USE_HRT is not set -# CONFIG_ESP32S3_TIME_SYSCALL_USE_SYSTIMER is not set -# CONFIG_ESP32S3_TIME_SYSCALL_USE_FRC1 is not set -# CONFIG_NEWLIB_TIME_SYSCALL_USE_NONE is not set -# CONFIG_ESP32S3_TIME_SYSCALL_USE_NONE is not set -CONFIG_ESP32_PTHREAD_TASK_PRIO_DEFAULT=5 -CONFIG_ESP32_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072 -CONFIG_ESP32_PTHREAD_STACK_MIN=768 -CONFIG_ESP32_DEFAULT_PTHREAD_CORE_NO_AFFINITY=y -# CONFIG_ESP32_DEFAULT_PTHREAD_CORE_0 is not set -# CONFIG_ESP32_DEFAULT_PTHREAD_CORE_1 is not set -CONFIG_ESP32_PTHREAD_TASK_CORE_DEFAULT=-1 -CONFIG_ESP32_PTHREAD_TASK_NAME_DEFAULT="pthread" -CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ABORTS=y -# CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_FAILS is not set -# CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ALLOWED is not set -CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT=y -CONFIG_SUPPORT_TERMIOS=y -CONFIG_SEMIHOSTFS_MAX_MOUNT_POINTS=1 -# End of deprecated options From e594659639ec4e6d2a1c7d8a716512dba42efa2e Mon Sep 17 00:00:00 2001 From: Andriy Malyshenko Date: Thu, 8 Jan 2026 14:22:08 +0100 Subject: [PATCH 31/58] Build and warnings fix --- components/audio_hal/CMakeLists.txt | 4 +-- components/custom_board/CMakeLists.txt | 4 +-- .../custom_board/tas5805m/include/tas5805m.h | 20 ------------- components/custom_board/tas5805m/tas5805m.c | 28 +++++++++---------- 4 files changed, 18 insertions(+), 38 deletions(-) diff --git a/components/audio_hal/CMakeLists.txt b/components/audio_hal/CMakeLists.txt index 17c26127..b55162b2 100644 --- a/components/audio_hal/CMakeLists.txt +++ b/components/audio_hal/CMakeLists.txt @@ -18,8 +18,8 @@ IF (NOT ((CONFIG_IDF_TARGET STREQUAL "esp32c3") OR (CONFIG_IDF_TARGET STREQUAL " endif() # Edit following two lines to set component requirements (see docs) -set(COMPONENT_REQUIRES ) -set(COMPONENT_PRIV_REQUIRES audio_sal audio_board mbedtls esp_peripherals custom_board) +set(COMPONENT_REQUIRES audio_sal) +set(COMPONENT_PRIV_REQUIRES audio_board mbedtls esp_peripherals custom_board) set(COMPONENT_SRCS ./audio_hal.c ./audio_volume.c diff --git a/components/custom_board/CMakeLists.txt b/components/custom_board/CMakeLists.txt index 82e0c3db..2139c097 100644 --- a/components/custom_board/CMakeLists.txt +++ b/components/custom_board/CMakeLists.txt @@ -1,6 +1,6 @@ # Edit following two lines to set component requirements (see docs) -set(COMPONENT_REQUIRES) -set(COMPONENT_PRIV_REQUIRES audio_hal esp_peripherals) +set(COMPONENT_REQUIRES audio_hal audio_board) +set(COMPONENT_PRIV_REQUIRES esp_peripherals) if(CONFIG_AUDIO_BOARD_CUSTOM) message(STATUS "Current board name is " CONFIG_AUDIO_BOARD_CUSTOM) diff --git a/components/custom_board/tas5805m/include/tas5805m.h b/components/custom_board/tas5805m/include/tas5805m.h index f7ae071e..a5709b7d 100644 --- a/components/custom_board/tas5805m/include/tas5805m.h +++ b/components/custom_board/tas5805m/include/tas5805m.h @@ -27,8 +27,6 @@ #ifndef _TAS5805M_H_ #define _TAS5805M_H_ -#include "audio_hal.h" - #include "board.h" #include "esp_err.h" #include "esp_log.h" @@ -49,24 +47,6 @@ extern "C" { #define I2C_MASTER_RX_BUF_DISABLE 0 /*!< I2C master doesn't need buffer */ #define I2C_MASTER_TIMEOUT_MS 1000 -#define TAS5805M_VOLUME_MUTE 0xff // (-103.5 dB - actual mute) -#define TAS5805M_VOLUME_MIN 0xa8 // ( -60 dB - save value representing barely hearable volume) -#define TAS5805M_VOLUME_MAX 0x30 // ( 0 dB - maximum volume that guarantees no distortion ) -/* -// TODO: make it available for user configuration -#define TAS5805M_REG_VOLUME_MAX 0x00 // (+24 dB - maximum volume that DAC can do) -*/ - -typedef enum { - TAS5805M_CTRL_DEEP_SLEEP = 0x00, // Deep Sleep - TAS5805M_CTRL_SLEEP = 0x01, // Sleep - TAS5805M_CTRL_HI_Z = 0x02, // Hi-Z - TAS5805M_CTRL_PLAY = 0x03, // Play - TAS5805M_CTRL_MUTE = 0x08, // Mute Flag - // Mute, but driver in PLAY state - TAS5805M_CTRL_PLAY_MUTE = TAS5805M_CTRL_MUTE | TAS5805M_CTRL_PLAY -} TAS5805M_CTRL_STATE; - /* Cached state structure */ typedef struct { int8_t volume; diff --git a/components/custom_board/tas5805m/tas5805m.c b/components/custom_board/tas5805m/tas5805m.c index 4a505f22..81750308 100644 --- a/components/custom_board/tas5805m/tas5805m.c +++ b/components/custom_board/tas5805m/tas5805m.c @@ -631,7 +631,7 @@ esp_err_t tas5805m_set_mixer_mode(TAS5805M_MIXER_MODE mode) esp_err_t tas5805m_set_mixer_gain(TAS5805M_MIXER_CHANNELS channel, uint32_t gain) { - ESP_LOGD(TAG, "%s: Setting mixer gain for channel %d to 0x%08x", __func__, channel, gain); + ESP_LOGD(TAG, "%s: Setting mixer gain for channel %d to 0x%08x", __func__, channel, (unsigned int)gain); uint8_t reg; switch (channel) @@ -691,7 +691,7 @@ esp_err_t tas5805m_set_channel_gain(TAS5805M_EQ_CHANNELS channel, int8_t gain_db if (ret != ESP_OK) { ESP_LOGE(TAG, "%s: Failed to write volume register 0x%02x: %s", __func__, reg, esp_err_to_name(ret)); } else { - ESP_LOGD(TAG, "%s: Wrote volume register 0x%02x with value 0x%08x", __func__, reg, reg_value); + ESP_LOGD(TAG, "%s: Wrote volume register 0x%02x with value 0x%08x", __func__, reg, (unsigned int)reg_value); } TAS5805M_SET_BOOK_AND_PAGE(TAS5805M_REG_BOOK_CONTROL_PORT, TAS5805M_REG_PAGE_ZERO); @@ -914,7 +914,7 @@ esp_err_t tas5805m_set_eq_gain_channel(TAS5805M_EQ_CHANNELS channel, int band, i ESP_LOGV(TAG, "%s: + %d: w 0x%x 0x%x 0x%x 0x%x 0x%x -> 0x%x", __func__, i, reg_value0->offset, reg_value0->value, - reg_value1->value, reg_value2->value, reg_value3->value, value); + reg_value1->value, reg_value2->value, reg_value3->value, (unsigned int)value); ret = ret | tas5805m_write_bytes(&address, 1, (uint8_t *)&value, sizeof(value)); if (ret != ESP_OK) { ESP_LOGE(TAG, "%s: Error writing to register 0x%x", __func__, address); @@ -981,7 +981,7 @@ esp_err_t tas5805m_set_eq_profile_channel(TAS5805M_EQ_CHANNELS channel, TAS5805M // ESP_LOGV(TAG, "%s: + %d: w 0x%x 0x%x 0x%x 0x%x 0x%x -> 0x%x", __func__, i, // reg_value0->offset, reg_value0->value, - // reg_value1->value, reg_value2->value, reg_value3->value, value); + // reg_value1->value, reg_value2->value, reg_value3->value, (unsigned int)value); ret = ret | tas5805m_write_bytes(&address, 1, (uint8_t *)&value, sizeof(value)); // ret = ret | tas5805m_write_byte(reg_value->offset, reg_value->value); if (ret != ESP_OK) { @@ -1080,7 +1080,7 @@ esp_err_t tas5805m_read_biquad_coefficients(TAS5805M_EQ_CHANNELS channel, int ba } *coeffs[i] = tas5805m_q5_27_to_float(raw_value); - ESP_LOGD(TAG, "%s: %s = %f (raw: 0x%08X)", __func__, names[i], *coeffs[i], raw_value); + ESP_LOGD(TAG, "%s: %s = %f (raw: 0x%08X)", __func__, names[i], *coeffs[i], (unsigned int)raw_value); } TAS5805M_SET_BOOK_AND_PAGE(TAS5805M_REG_BOOK_CONTROL_PORT, TAS5805M_REG_PAGE_ZERO); @@ -1117,7 +1117,7 @@ esp_err_t tas5805m_write_biquad_coefficients(TAS5805M_EQ_CHANNELS channel, int b raw_value = tas5805m_float_to_q5_27(coeffs[i]); ESP_LOGD(TAG, "%s: Writing %s = %f -> 0x%08X to offset 0x%02X", - __func__, names[i], coeffs[i], raw_value, offset); + __func__, names[i], coeffs[i], (unsigned int)raw_value, offset); ret = tas5805m_write_bytes(&offset, 1, (uint8_t *)&raw_value, sizeof(raw_value)); if (ret != ESP_OK) { @@ -1142,8 +1142,8 @@ float tas5805m_q9_23_to_float(uint32_t raw) uint32_t val = tas5805m_swap_endian_32(raw); int32_t signed_val = (int32_t)val; float result = (float)signed_val / 8388608.0f; // 2^23 - ESP_LOGD(TAG, "%s: raw=0x%08X, signed_val=%d -> result=%f", - __func__, raw, signed_val, result); + // ESP_LOGD(TAG, "%s: raw=0x%08X, signed_val=%d -> result=%f", + // __func__, (unsigned int)raw, signed_val, result); return result; } @@ -1155,8 +1155,8 @@ uint32_t tas5805m_float_to_q9_23(float value) int32_t fixed_val = (int32_t)(value * (1 << 23)); uint32_t le_val = tas5805m_swap_endian_32((uint32_t)fixed_val); - ESP_LOGD(TAG, "%s: value=%f -> fixed_val=%d, le_val=0x%08X", - __func__, value, fixed_val, le_val); + // ESP_LOGD(TAG, "%s: value=%f -> fixed_val=%d, le_val=0x%08X", + // __func__, value, fixed_val, (unsigned int)le_val); return le_val; } @@ -1166,8 +1166,8 @@ float tas5805m_q5_27_to_float(uint32_t raw) uint32_t val = tas5805m_swap_endian_32(raw); int32_t signed_val = (int32_t)val; float result = (float)signed_val / 134217728.0f; // 2^27 - ESP_LOGD(TAG, "%s: raw=0x%08X, signed_val=%d -> result=%f", - __func__, raw, signed_val, result); + // ESP_LOGD(TAG, "%s: raw=0x%08X, signed_val=%d -> result=%f", + // __func__, (unsigned int)raw, signed_val, result); return result; } @@ -1179,8 +1179,8 @@ uint32_t tas5805m_float_to_q5_27(float value) int32_t fixed_val = (int32_t)(value * (1 << 27)); uint32_t le_val = tas5805m_swap_endian_32((uint32_t)fixed_val); - ESP_LOGD(TAG, "%s: value=%f -> fixed_val=%d, le_val=0x%08X", - __func__, value, fixed_val, le_val); + // ESP_LOGD(TAG, "%s: value=%f -> fixed_val=%d, le_val=0x%08X", + // __func__, value, fixed_val, (unsigned int)le_val); return le_val; } From d544ea3791153074a59e191d87658323838c5fbb Mon Sep 17 00:00:00 2001 From: Andriy Malyshenko Date: Sat, 10 Jan 2026 23:14:11 +0100 Subject: [PATCH 32/58] Added Faults read and reset every 5 seconds driver logic, and faults read in the UI --- components/custom_board/tas5805m/tas5805m.c | 61 ++++++++++ .../tas5805m_settings/tas5805m_settings.c | 111 +++++++++++++++++ .../ui_http_server/html/dac-settings.html | 113 ++++++++++++++++++ 3 files changed, 285 insertions(+) diff --git a/components/custom_board/tas5805m/tas5805m.c b/components/custom_board/tas5805m/tas5805m.c index 81750308..e1615867 100644 --- a/components/custom_board/tas5805m/tas5805m.c +++ b/components/custom_board/tas5805m/tas5805m.c @@ -49,6 +49,9 @@ static TAS5805_STATE tas5805m_state = { .channel_gain_r = 0, }; +/* Task handle for fault monitoring */ +static TaskHandle_t tas5805m_fault_monitor_task_handle = NULL; + /* Default I2C config */ static i2c_config_t i2c_cfg = { .mode = I2C_MODE_MASTER, @@ -72,6 +75,40 @@ audio_hal_func_t AUDIO_CODEC_TAS5805M_DEFAULT_HANDLE = { .handle = NULL, }; +/* Fault monitoring task */ +static void tas5805m_fault_monitor_task(void *pvParameters) { + TAS5805M_FAULT fault; + ESP_LOGI(TAG, "Fault monitoring task started"); + + while (1) { + // Read fault registers + esp_err_t ret = tas5805m_get_faults(&fault); + if (ret == ESP_OK) { + // Check if any faults are present + if (fault.err0 || fault.err1 || fault.err2 || fault.ot_warn) { + ESP_LOGW(TAG, "Faults detected: err0=0x%02x, err1=0x%02x, err2=0x%02x, ot_warn=0x%02x", + fault.err0, fault.err1, fault.err2, fault.ot_warn); + + // Decode and log the faults + tas5805m_decode_faults(fault); + + // Clear the faults + ret = tas5805m_clear_faults(); + if (ret == ESP_OK) { + ESP_LOGI(TAG, "Faults cleared"); + } else { + ESP_LOGE(TAG, "Failed to clear faults: %s", esp_err_to_name(ret)); + } + } + } else { + ESP_LOGE(TAG, "Failed to read faults: %s", esp_err_to_name(ret)); + } + + // Wait for 1 second + vTaskDelay(pdMS_TO_TICKS(5000)); + } +} + /* Init the I2C Driver */ void i2c_master_init() { int i2c_master_port = I2C_MASTER_NUM; @@ -263,6 +300,23 @@ esp_err_t tas5805m_init() { compile-time bridge-mode options, re-add the Kconfig choice and the corresponding conditional code here. */ + /* Start fault monitoring task */ + BaseType_t task_ret = xTaskCreate( + tas5805m_fault_monitor_task, + "tas5805m_faults", + 2048, + NULL, + 5, + &tas5805m_fault_monitor_task_handle + ); + + if (task_ret != pdPASS) { + ESP_LOGE(TAG, "%s: Failed to create fault monitoring task", __func__); + return ESP_FAIL; + } + + ESP_LOGI(TAG, "%s: Fault monitoring task created", __func__); + return ret; } @@ -372,6 +426,13 @@ esp_err_t tas5805m_get_digital_volume(uint8_t *vol) // Deinit the TAS5805M esp_err_t tas5805m_deinit(void) { + /* Stop fault monitoring task */ + if (tas5805m_fault_monitor_task_handle != NULL) { + vTaskDelete(tas5805m_fault_monitor_task_handle); + tas5805m_fault_monitor_task_handle = NULL; + ESP_LOGI(TAG, "%s: Fault monitoring task deleted", __func__); + } + ESP_ERROR_CHECK(tas5805m_set_state(TAS5805M_CTRL_HI_Z)); gpio_set_level(TAS5805M_GPIO_PDN, 0); vTaskDelay(6 / portTICK_PERIOD_MS); diff --git a/components/tas5805m_settings/tas5805m_settings.c b/components/tas5805m_settings/tas5805m_settings.c index 78725da8..edb678a4 100644 --- a/components/tas5805m_settings/tas5805m_settings.c +++ b/components/tas5805m_settings/tas5805m_settings.c @@ -69,6 +69,79 @@ static void tas5805m_poll_for_play_task(void *arg) vTaskDelete(NULL); } +/** + * Create JSON array with all fault status indicators + */ +static cJSON* tas5805m_create_faults_array(TAS5805M_FAULT fault) { + cJSON *faults = cJSON_CreateArray(); + if (!faults) { + return NULL; + } + + // err0 faults + cJSON *fault_obj; + + fault_obj = cJSON_CreateObject(); + cJSON_AddStringToObject(fault_obj, "name", "Right channel over current"); + cJSON_AddBoolToObject(fault_obj, "active", (fault.err0 & (1 << 0)) != 0); + cJSON_AddItemToArray(faults, fault_obj); + + fault_obj = cJSON_CreateObject(); + cJSON_AddStringToObject(fault_obj, "name", "Left channel over current"); + cJSON_AddBoolToObject(fault_obj, "active", (fault.err0 & (1 << 1)) != 0); + cJSON_AddItemToArray(faults, fault_obj); + + fault_obj = cJSON_CreateObject(); + cJSON_AddStringToObject(fault_obj, "name", "Right channel DC fault"); + cJSON_AddBoolToObject(fault_obj, "active", (fault.err0 & (1 << 2)) != 0); + cJSON_AddItemToArray(faults, fault_obj); + + fault_obj = cJSON_CreateObject(); + cJSON_AddStringToObject(fault_obj, "name", "Left channel DC fault"); + cJSON_AddBoolToObject(fault_obj, "active", (fault.err0 & (1 << 3)) != 0); + cJSON_AddItemToArray(faults, fault_obj); + + // err1 faults + fault_obj = cJSON_CreateObject(); + cJSON_AddStringToObject(fault_obj, "name", "PVDD undervoltage"); + cJSON_AddBoolToObject(fault_obj, "active", (fault.err1 & (1 << 0)) != 0); + cJSON_AddItemToArray(faults, fault_obj); + + fault_obj = cJSON_CreateObject(); + cJSON_AddStringToObject(fault_obj, "name", "PVDD overvoltage"); + cJSON_AddBoolToObject(fault_obj, "active", (fault.err1 & (1 << 1)) != 0); + cJSON_AddItemToArray(faults, fault_obj); + + fault_obj = cJSON_CreateObject(); + cJSON_AddStringToObject(fault_obj, "name", "Clock fault"); + cJSON_AddBoolToObject(fault_obj, "active", (fault.err1 & (1 << 2)) != 0); + cJSON_AddItemToArray(faults, fault_obj); + + fault_obj = cJSON_CreateObject(); + cJSON_AddStringToObject(fault_obj, "name", "BQ write failed"); + cJSON_AddBoolToObject(fault_obj, "active", (fault.err1 & (1 << 6)) != 0); + cJSON_AddItemToArray(faults, fault_obj); + + fault_obj = cJSON_CreateObject(); + cJSON_AddStringToObject(fault_obj, "name", "OTP CRC error"); + cJSON_AddBoolToObject(fault_obj, "active", (fault.err1 & (1 << 7)) != 0); + cJSON_AddItemToArray(faults, fault_obj); + + // err2 faults + fault_obj = cJSON_CreateObject(); + cJSON_AddStringToObject(fault_obj, "name", "Over temperature shutdown"); + cJSON_AddBoolToObject(fault_obj, "active", (fault.err2 & (1 << 0)) != 0); + cJSON_AddItemToArray(faults, fault_obj); + + // ot_warn + fault_obj = cJSON_CreateObject(); + cJSON_AddStringToObject(fault_obj, "name", "Over temperature warning"); + cJSON_AddBoolToObject(fault_obj, "active", (fault.ot_warn & (1 << 2)) != 0); + cJSON_AddItemToArray(faults, fault_obj); + + return faults; +} + /** * Convert TAS5805M_CTRL_STATE enum to human-readable string */ @@ -1983,6 +2056,35 @@ esp_err_t tas5805m_settings_get_dac_schema_json(char *json_out, size_t max_len) cJSON_AddItemToObject(state_group, "parameters", state_params); cJSON_AddItemToArray(groups, state_group); + // Faults Group + cJSON *faults_group = cJSON_CreateObject(); + cJSON_AddStringToObject(faults_group, "name", "Faults"); + cJSON_AddStringToObject(faults_group, "description", "Current fault status indicators"); + cJSON_AddStringToObject(faults_group, "layout", "faults"); + + cJSON *faults_params = cJSON_CreateArray(); + + // Get current faults to populate schema + TAS5805M_FAULT current_fault = {0}; + tas5805m_get_faults(¤t_fault); + + // Create fault status parameter (readonly, displayed as list) + cJSON *faults_param = cJSON_CreateObject(); + cJSON_AddStringToObject(faults_param, "key", "faults"); + cJSON_AddStringToObject(faults_param, "name", "Fault Status"); + cJSON_AddStringToObject(faults_param, "type", "faults-list"); + cJSON_AddBoolToObject(faults_param, "readonly", true); + + // Add current fault data + cJSON *faults_array = tas5805m_create_faults_array(current_fault); + if (faults_array) { + cJSON_AddItemToObject(faults_param, "current", faults_array); + } + + cJSON_AddItemToArray(faults_params, faults_param); + cJSON_AddItemToObject(faults_group, "parameters", faults_params); + cJSON_AddItemToArray(groups, faults_group); + // DAC Configuration Group - simplified cJSON *dac_config_group = cJSON_CreateObject(); cJSON_AddStringToObject(dac_config_group, "name", "DAC Configuration"); @@ -2682,6 +2784,15 @@ esp_err_t tas5805m_settings_get_dac_json(char *json_out, size_t max_len) { cJSON_AddNumberToObject(root, "bd_freq", (int)bd_freq); cJSON_AddNumberToObject(root, "mixer_mode", (int)dac_state.mixer_mode); + // Get and add faults + TAS5805M_FAULT fault; + if (tas5805m_get_faults(&fault) == ESP_OK) { + cJSON *faults_array = tas5805m_create_faults_array(fault); + if (faults_array) { + cJSON_AddItemToObject(root, "faults", faults_array); + } + } + // Render to string char *json_str = cJSON_PrintUnformatted(root); cJSON_Delete(root); diff --git a/components/ui_http_server/html/dac-settings.html b/components/ui_http_server/html/dac-settings.html index 9ff5ab17..8618c8dc 100644 --- a/components/ui_http_server/html/dac-settings.html +++ b/components/ui_http_server/html/dac-settings.html @@ -256,6 +256,87 @@ } } + /* Faults list styles */ + .faults-list { + display: flex; + flex-direction: column; + gap: 8px; + margin-top: 10px; + } + + .fault-item { + display: flex; + align-items: center; + gap: 12px; + padding: 10px 15px; + border-radius: 6px; + background-color: #f8f9fa; + border-left: 3px solid #6c757d; + transition: all 0.2s ease; + } + + .fault-item.active { + background-color: #fff3cd; + border-left-color: #ff9800; + } + + .fault-item.critical { + background-color: #f8d7da; + border-left-color: #dc3545; + } + + .fault-indicator { + width: 12px; + height: 12px; + border-radius: 50%; + background-color: #6c757d; + flex-shrink: 0; + } + + .fault-item.active .fault-indicator { + background-color: #ff9800; + box-shadow: 0 0 8px rgba(255, 152, 0, 0.5); + animation: fault-pulse 1.5s ease-in-out infinite; + } + + .fault-item.critical .fault-indicator { + background-color: #dc3545; + box-shadow: 0 0 8px rgba(220, 53, 69, 0.5); + animation: fault-pulse 1s ease-in-out infinite; + } + + @keyframes fault-pulse { + 0%, 100% { + opacity: 1; + transform: scale(1); + } + 50% { + opacity: 0.7; + transform: scale(1.1); + } + } + + .fault-name { + flex-grow: 1; + font-size: 14px; + color: #333; + } + + .fault-status { + font-size: 12px; + font-weight: 600; + text-transform: uppercase; + color: #6c757d; + } + + .fault-item.active .fault-status { + color: #ff9800; + } + + .fault-item.critical .fault-status { + color: #dc3545; + } + /* EQ Bands Layout - Vertical Sliders */ .eq-bands-container { display: flex; @@ -363,6 +444,14 @@

    TAS5805M DAC Settings

    return Number.isInteger(v) ? v : 2; })(); + // Helper function to determine if a fault is critical + function isCriticalFault(faultName) { + const criticalFaults = [ + 'Over temperature shutdown' + ]; + return criticalFaults.some(cf => faultName.includes(cf)); + } + // Fetch DAC schema from the device async function loadSchema() { try { @@ -633,6 +722,30 @@

    TAS5805M DAC Settings

    html += '
    '; html += `${displayMin} ${param.unit}`; html += `${displayMax} ${param.unit}`; + html += '
    '; + } else if (param.type === 'faults-list') { + // Create list of faults with status indicators + html += '
    '; + + if (param.current && Array.isArray(param.current)) { + for (const fault of param.current) { + const isActive = fault.active; + const isCritical = isCriticalFault(fault.name); + let itemClass = 'fault-item'; + if (isActive) { + itemClass += isCritical ? ' critical' : ' active'; + } + + html += `
    `; + html += ''; + html += `${fault.name}`; + html += `${isActive ? 'ACTIVE' : 'OK'}`; + html += '
    '; + } + } else { + html += '
    No fault data available
    '; + } + html += '
    '; } else { html += `

    Parameter type '${param.type}' not yet implemented

    `; From c96e664a71125a0b11cc3e6e11f3e24d9b39e7ee Mon Sep 17 00:00:00 2001 From: craigmillard86 Date: Sat, 10 Jan 2026 22:08:16 +0000 Subject: [PATCH 33/58] Fixes for: DSP init ordering (main.c) - Fixed dsp_processor_init() being called after dsp_settings_init(), which caused NULL semaphore access NULL semaphore safety (dsp_processor.c) - Added NULL checks before xSemaphoreGive(paramsChangedSemaphoreHandle) mDNS NULL address (main.c:611) - Added NULL check for re->addr before dereferencing in the mDNS result loop Player NULL chunk (player.c:1436) - Added NULL check for chnk after xQueueReceive timeout before accessing chnk->fragment --- components/dsp_processor/dsp_processor.c | 9 +++++++-- components/lightsnapcast/player.c | 13 ++++++++++--- main/main.c | 12 ++++++++---- 3 files changed, 25 insertions(+), 9 deletions(-) diff --git a/components/dsp_processor/dsp_processor.c b/components/dsp_processor/dsp_processor.c index 96490c80..9aaaf582 100644 --- a/components/dsp_processor/dsp_processor.c +++ b/components/dsp_processor/dsp_processor.c @@ -172,16 +172,21 @@ esp_err_t dsp_processor_update_filter_params(filterParams_t *params) { all_params.flow_params[flow].gain_1 = params->gain_1; all_params.flow_params[flow].fc_3 = params->fc_3; all_params.flow_params[flow].gain_3 = params->gain_3; - xSemaphoreGive(paramsChangedSemaphoreHandle); + if (paramsChangedSemaphoreHandle) { + xSemaphoreGive(paramsChangedSemaphoreHandle); + } xSemaphoreGive(params_mutex); } else { // No mutex available: best-effort update + ESP_LOGW(TAG, "%s: params mutex not available, proceeding without mutex", __func__); all_params.active_flow = flow; all_params.flow_params[flow].fc_1 = params->fc_1; all_params.flow_params[flow].gain_1 = params->gain_1; all_params.flow_params[flow].fc_3 = params->fc_3; all_params.flow_params[flow].gain_3 = params->gain_3; - xSemaphoreGive(paramsChangedSemaphoreHandle); + if (paramsChangedSemaphoreHandle) { + xSemaphoreGive(paramsChangedSemaphoreHandle); + } } } diff --git a/components/lightsnapcast/player.c b/components/lightsnapcast/player.c index 4b72ec13..cfdd5a98 100644 --- a/components/lightsnapcast/player.c +++ b/components/lightsnapcast/player.c @@ -1433,6 +1433,11 @@ static void player_task(void *pvParameters) { // chnk->fragment->size); } + // If we still don't have a chunk, wait and retry + if (chnk == NULL) { + continue; + } + fragment = chnk->fragment; p_payload = fragment->payload; size = fragment->size; @@ -1696,10 +1701,12 @@ static void player_task(void *pvParameters) { // resync hard if we are getting very late / early. // rest gets tuned in through apll speed control or sample insertion - if ((msgWaiting == 0) || - (MEDIANFILTER_isFull(&shortMedianFilter, 0) && + // Note: Don't resync immediately on empty queue - wait for data to arrive + // Only resync on empty queue if we're also significantly out of sync + if ((MEDIANFILTER_isFull(&shortMedianFilter, 0) && ((shortMedian > hardResyncThreshold) || - (shortMedian < -hardResyncThreshold)))) + (shortMedian < -hardResyncThreshold))) || + (msgWaiting == 0 && (age > 50000 || age < -50000))) // 50ms threshold for empty queue { if (chnk != NULL) { free_pcm_chunk(chnk); diff --git a/main/main.c b/main/main.c index cedf51af..ac0ab93f 100644 --- a/main/main.c +++ b/main/main.c @@ -609,6 +609,11 @@ static void http_get_task(void *pvParameters) { mdns_result_t *re = r; while (re) { mdns_ip_addr_t *a = re->addr; + if (a == NULL) { + // No address in this result, skip to next + re = re->next; + continue; + } #if CONFIG_SNAPCLIENT_CONNECT_IPV6 if (a->addr.type == IPADDR_TYPE_V6) { netif = re->esp_netif; @@ -626,7 +631,7 @@ static void http_get_task(void *pvParameters) { re = re->next; } - if (!re) { + if (!re || !re->addr) { mdns_query_results_free(r); ESP_LOGW(TAG, "didn't find any valid IP in MDNS query"); @@ -2831,9 +2836,8 @@ void app_main(void) { #endif #if CONFIG_USE_DSP_PROCESSOR - dsp_settings_init(); - dsp_processor_init(); - dsp_settings_init(); + dsp_processor_init(); // Must init processor first (creates mutexes/semaphores) + dsp_settings_init(); // Then settings can restore params into the processor #endif xTaskCreatePinnedToCore(&ota_server_task, "ota", 14 * 256, NULL, From 8e0772173ec3d3eab9fc0ffff2f8c0568e742bb7 Mon Sep 17 00:00:00 2001 From: craigmillard86 Date: Sat, 10 Jan 2026 23:55:42 +0000 Subject: [PATCH 34/58] Fixes for Wifi Power Save disabling low latency audio, DSP UI settings persistence and logging. --- .../dsp_processor_settings.c | 4 +- components/esp_peripherals/periph_wifi.c | 3 +- components/network_interface/wifi_interface.c | 4 +- .../ui_http_server/html/dsp-settings.html | 34 ++++++++++- components/ui_http_server/ui_http_server.c | 59 ++++++++++--------- 5 files changed, 70 insertions(+), 34 deletions(-) diff --git a/components/dsp_processor_settings/dsp_processor_settings.c b/components/dsp_processor_settings/dsp_processor_settings.c index 6685aae6..f83738bb 100644 --- a/components/dsp_processor_settings/dsp_processor_settings.c +++ b/components/dsp_processor_settings/dsp_processor_settings.c @@ -585,8 +585,8 @@ esp_err_t dsp_settings_set_flow_params(dspFlows_t flow, return ESP_ERR_INVALID_ARG; } - ESP_LOGI(TAG, "Setting params for flow %d: fc_1=%.1f gain_1=%.1f", flow, - params->fc_1, params->gain_1); + ESP_LOGI(TAG, "Setting params for flow %d: fc_1=%.1f gain_1=%.1f fc_3=%.1f gain_3=%.1f", + flow, params->fc_1, params->gain_1, params->fc_3, params->gain_3); // Save to NVS esp_err_t err = ESP_OK; diff --git a/components/esp_peripherals/periph_wifi.c b/components/esp_peripherals/periph_wifi.c index a73b9166..69ca53c2 100644 --- a/components/esp_peripherals/periph_wifi.c +++ b/components/esp_peripherals/periph_wifi.c @@ -464,7 +464,8 @@ static esp_err_t _wifi_init(esp_periph_handle_t self) { ESP_ERROR_CHECK(esp_wifi_set_storage(WIFI_STORAGE_RAM)); ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA)); ESP_ERROR_CHECK(esp_wifi_set_config(WIFI_IF_STA, &wifi_config)); - ESP_ERROR_CHECK(esp_wifi_set_ps(WIFI_PS_MIN_MODEM)); + // Disable power save for lower latency audio streaming + ESP_ERROR_CHECK(esp_wifi_set_ps(WIFI_PS_NONE)); } if (periph_wifi->wpa2_e_cfg->diasble_wpa2_e) { unsigned int ca_pem_bytes = periph_wifi->wpa2_e_cfg->ca_pem_end - diff --git a/components/network_interface/wifi_interface.c b/components/network_interface/wifi_interface.c index 37d75d83..efc74a64 100644 --- a/components/network_interface/wifi_interface.c +++ b/components/network_interface/wifi_interface.c @@ -195,8 +195,8 @@ void wifi_start(void) { esp_wifi_netif = esp_netif_create_wifi(WIFI_IF_STA, &esp_netif_config); esp_wifi_set_default_wifi_sta_handlers(); - // esp_wifi_set_ps(WIFI_PS_MIN_MODEM); - // esp_wifi_set_ps(WIFI_PS_NONE); + // Disable WiFi power save for lower latency audio streaming + esp_wifi_set_ps(WIFI_PS_NONE); #if ENABLE_WIFI_PROVISIONING /* Start Wi-Fi station */ diff --git a/components/ui_http_server/html/dsp-settings.html b/components/ui_http_server/html/dsp-settings.html index a403597a..898f108b 100644 --- a/components/ui_http_server/html/dsp-settings.html +++ b/components/ui_http_server/html/dsp-settings.html @@ -252,13 +252,26 @@

    DSP Settings

    } } - // Handle parameter value changes + // Handle parameter value changes with debouncing + // Debounce timers stored per parameter to avoid flooding the device + const debounceTimers = {}; + function handleParameterChange(paramKey, value, unit) { const valueSpan = document.getElementById(`${paramKey}-value`); if (valueSpan) { valueSpan.textContent = `${parseFloat(value).toFixed(1)} ${unit}`; } - setParameter(paramKey, Math.round(value)); + + // Debounce: clear any pending update for this parameter + if (debounceTimers[paramKey]) { + clearTimeout(debounceTimers[paramKey]); + } + + // Send the update after 300ms of no changes + debounceTimers[paramKey] = setTimeout(() => { + setParameter(paramKey, Math.round(value)); + delete debounceTimers[paramKey]; + }, 300); } // Handle DSP flow changes @@ -290,8 +303,25 @@

    DSP Settings

    renderParameters(); } + // Flush any pending debounced parameter updates before navigating away + function flushPendingUpdates() { + for (const paramKey of Object.keys(debounceTimers)) { + clearTimeout(debounceTimers[paramKey]); + // Get current slider value and send it immediately + const slider = document.getElementById(paramKey); + if (slider) { + setParameter(paramKey, Math.round(parseFloat(slider.value))); + } + delete debounceTimers[paramKey]; + } + } + // Initialize on page load document.addEventListener('DOMContentLoaded', loadCapabilities); + + // Ensure pending updates are sent if user navigates away + window.addEventListener('beforeunload', flushPendingUpdates); + window.addEventListener('pagehide', flushPendingUpdates); \ No newline at end of file diff --git a/components/ui_http_server/ui_http_server.c b/components/ui_http_server/ui_http_server.c index d6015626..a46890ee 100644 --- a/components/ui_http_server/ui_http_server.c +++ b/components/ui_http_server/ui_http_server.c @@ -1239,32 +1239,34 @@ static void http_server_task(void *pvParameters) { #if CONFIG_USE_DSP_PROCESSOR // Switch to new flow (loads its stored parameters and notifies subscribers) dsp_settings_switch_active_flow(new_flow); + // Update our tracked active flow + active_flow = new_flow; // Get the parameters for the new flow dsp_settings_get_flow_params(new_flow, ¤t_params); - ESP_LOGI(TAG, "%s: Switched to flow %d", __func__, new_flow); + ESP_LOGI(TAG, "%s: Switched to flow %d", __func__, new_flow); #else + active_flow = new_flow; current_params.dspFlow = new_flow; #endif - continue; - } // Handle parameter updates for current flow - bool param_recognized = false; - dspFlows_t current_flow = current_params.dspFlow; - - if (strcmp(urlBuf.key, "fc_1") == 0) { - current_params.fc_1 = (float)urlBuf.int_value; - param_recognized = true; - } else if (strcmp(urlBuf.key, "gain_1") == 0) { - current_params.gain_1 = (float)urlBuf.int_value; - param_recognized = true; - } else if (strcmp(urlBuf.key, "fc_3") == 0) { - current_params.fc_3 = (float)urlBuf.int_value; - param_recognized = true; - } else if (strcmp(urlBuf.key, "gain_3") == 0) { - current_params.gain_3 = (float)urlBuf.int_value; - param_recognized = true; - } + } + // Handle parameter updates for current flow + bool param_recognized = false; + + if (strcmp(urlBuf.key, "fc_1") == 0) { + current_params.fc_1 = (float)urlBuf.int_value; + param_recognized = true; + } else if (strcmp(urlBuf.key, "gain_1") == 0) { + current_params.gain_1 = (float)urlBuf.int_value; + param_recognized = true; + } else if (strcmp(urlBuf.key, "fc_3") == 0) { + current_params.fc_3 = (float)urlBuf.int_value; + param_recognized = true; + } else if (strcmp(urlBuf.key, "gain_3") == 0) { + current_params.gain_3 = (float)urlBuf.int_value; + param_recognized = true; + } if (!param_recognized) { ESP_LOGW(TAG, "%s: Unknown param '%s' received, ignoring", @@ -1273,14 +1275,16 @@ static void http_server_task(void *pvParameters) { } #if CONFIG_USE_DSP_PROCESSOR - // Update settings and notify subscribers (includes NVS persistence) - dsp_settings_set_flow_params(current_flow, ¤t_params); - ESP_LOGD(TAG, "%s: Updated %s = %ld", __func__, urlBuf.key, - (long)urlBuf.int_value); + // Always read active flow fresh from NVS to ensure we save to the correct flow + // (the UI may have changed the flow before this task's cached value was updated) + dspFlows_t save_flow = dsp_settings_get_active_flow(); + dsp_settings_set_flow_params(save_flow, ¤t_params); + ESP_LOGI(TAG, "%s: Saved %s = %ld to flow %d", __func__, urlBuf.key, + (long)urlBuf.int_value, save_flow); #else - // Persist parameter using dsp_settings (values are stored as - // int32_t) - if (dsp_settings_save_flow_param(current_flow, urlBuf.key, + // Persist parameter using dsp_settings (values are stored as int32_t) + dspFlows_t save_flow = dsp_settings_get_active_flow(); + if (dsp_settings_save_flow_param(save_flow, urlBuf.key, urlBuf.int_value) != ESP_OK) { ESP_LOGW(TAG, "%s: Failed to persist param '%s' to NVS", __func__, urlBuf.key); @@ -1289,8 +1293,9 @@ static void http_server_task(void *pvParameters) { (long)urlBuf.int_value); } #endif + } } -} // Never reach here + // Never reach here ESP_LOGI(TAG, "%s: finish", __func__); vTaskDelete(NULL); } From 3505b143b12c648b9ab4181ad1d4b934f4b86a98 Mon Sep 17 00:00:00 2001 From: craigmillard86 Date: Sun, 11 Jan 2026 00:15:53 +0000 Subject: [PATCH 35/58] reverting Player.c --- components/lightsnapcast/player.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/components/lightsnapcast/player.c b/components/lightsnapcast/player.c index cfdd5a98..afcdabfe 100644 --- a/components/lightsnapcast/player.c +++ b/components/lightsnapcast/player.c @@ -1701,12 +1701,10 @@ static void player_task(void *pvParameters) { // resync hard if we are getting very late / early. // rest gets tuned in through apll speed control or sample insertion - // Note: Don't resync immediately on empty queue - wait for data to arrive - // Only resync on empty queue if we're also significantly out of sync - if ((MEDIANFILTER_isFull(&shortMedianFilter, 0) && + if ((msgWaiting == 0) || + (MEDIANFILTER_isFull(&shortMedianFilter, 0) && ((shortMedian > hardResyncThreshold) || - (shortMedian < -hardResyncThreshold))) || - (msgWaiting == 0 && (age > 50000 || age < -50000))) // 50ms threshold for empty queue + (shortMedian < -hardResyncThreshold)))) { if (chnk != NULL) { free_pcm_chunk(chnk); From a46df4a0f17c18072ca416ddb4026c518858bc57 Mon Sep 17 00:00:00 2001 From: craigmillard86 Date: Sun, 11 Jan 2026 16:57:42 +0000 Subject: [PATCH 36/58] additional fix for sliders not updating correctly after initial page load --- components/ui_http_server/ui_http_server.c | 24 +++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/components/ui_http_server/ui_http_server.c b/components/ui_http_server/ui_http_server.c index a46890ee..b616a700 100644 --- a/components/ui_http_server/ui_http_server.c +++ b/components/ui_http_server/ui_http_server.c @@ -1278,7 +1278,29 @@ static void http_server_task(void *pvParameters) { // Always read active flow fresh from NVS to ensure we save to the correct flow // (the UI may have changed the flow before this task's cached value was updated) dspFlows_t save_flow = dsp_settings_get_active_flow(); - dsp_settings_set_flow_params(save_flow, ¤t_params); + + // Fetch the current params for THIS flow fresh from NVS + // This prevents overwriting other params with stale cached values + filterParams_t save_params; + dsp_settings_get_flow_params(save_flow, &save_params); + + // Update only the changed parameter + if (strcmp(urlBuf.key, "fc_1") == 0) { + save_params.fc_1 = (float)urlBuf.int_value; + } else if (strcmp(urlBuf.key, "gain_1") == 0) { + save_params.gain_1 = (float)urlBuf.int_value; + } else if (strcmp(urlBuf.key, "fc_3") == 0) { + save_params.fc_3 = (float)urlBuf.int_value; + } else if (strcmp(urlBuf.key, "gain_3") == 0) { + save_params.gain_3 = (float)urlBuf.int_value; + } + + // Update our cached params if this is the current flow + if (save_flow == active_flow) { + current_params = save_params; + } + + dsp_settings_set_flow_params(save_flow, &save_params); ESP_LOGI(TAG, "%s: Saved %s = %ld to flow %d", __func__, urlBuf.key, (long)urlBuf.int_value, save_flow); #else From 01077fdc207c8456e8f8fdaf905d197e4daa7ca4 Mon Sep 17 00:00:00 2001 From: craigmillard86 Date: Sun, 11 Jan 2026 16:58:19 +0000 Subject: [PATCH 37/58] Removing the wifi power setting change from none back to min_modem. --- components/esp_peripherals/periph_wifi.c | 3 +-- components/network_interface/wifi_interface.c | 3 --- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/components/esp_peripherals/periph_wifi.c b/components/esp_peripherals/periph_wifi.c index 69ca53c2..a73b9166 100644 --- a/components/esp_peripherals/periph_wifi.c +++ b/components/esp_peripherals/periph_wifi.c @@ -464,8 +464,7 @@ static esp_err_t _wifi_init(esp_periph_handle_t self) { ESP_ERROR_CHECK(esp_wifi_set_storage(WIFI_STORAGE_RAM)); ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA)); ESP_ERROR_CHECK(esp_wifi_set_config(WIFI_IF_STA, &wifi_config)); - // Disable power save for lower latency audio streaming - ESP_ERROR_CHECK(esp_wifi_set_ps(WIFI_PS_NONE)); + ESP_ERROR_CHECK(esp_wifi_set_ps(WIFI_PS_MIN_MODEM)); } if (periph_wifi->wpa2_e_cfg->diasble_wpa2_e) { unsigned int ca_pem_bytes = periph_wifi->wpa2_e_cfg->ca_pem_end - diff --git a/components/network_interface/wifi_interface.c b/components/network_interface/wifi_interface.c index efc74a64..1b9d95eb 100644 --- a/components/network_interface/wifi_interface.c +++ b/components/network_interface/wifi_interface.c @@ -195,9 +195,6 @@ void wifi_start(void) { esp_wifi_netif = esp_netif_create_wifi(WIFI_IF_STA, &esp_netif_config); esp_wifi_set_default_wifi_sta_handlers(); - // Disable WiFi power save for lower latency audio streaming - esp_wifi_set_ps(WIFI_PS_NONE); - #if ENABLE_WIFI_PROVISIONING /* Start Wi-Fi station */ ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA)); From 9df8db9fc5ba99e204cf4dfbd3da7fdcb04f51af Mon Sep 17 00:00:00 2001 From: craigmillard86 Date: Sun, 11 Jan 2026 17:03:30 +0000 Subject: [PATCH 38/58] Added back removed wifi power lines in wifi_interface.c --- components/network_interface/wifi_interface.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/network_interface/wifi_interface.c b/components/network_interface/wifi_interface.c index 1b9d95eb..37d75d83 100644 --- a/components/network_interface/wifi_interface.c +++ b/components/network_interface/wifi_interface.c @@ -195,6 +195,9 @@ void wifi_start(void) { esp_wifi_netif = esp_netif_create_wifi(WIFI_IF_STA, &esp_netif_config); esp_wifi_set_default_wifi_sta_handlers(); + // esp_wifi_set_ps(WIFI_PS_MIN_MODEM); + // esp_wifi_set_ps(WIFI_PS_NONE); + #if ENABLE_WIFI_PROVISIONING /* Start Wi-Fi station */ ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA)); From 2a2a83f761c83f5f8ec9b478536769b467cc9065 Mon Sep 17 00:00:00 2001 From: craigmillard86 Date: Sun, 11 Jan 2026 17:45:35 +0000 Subject: [PATCH 39/58] Fix for the following crash that was happening because: Multiple RESYNCING HARD events triggered a player restart During player restart, the DSP worker function was called paramsChangedSemaphoreHandle was NULL (either not yet created or already deleted) Calling xSemaphoreTake(NULL, ...) caused the LoadProhibited crash The fix ensures we check if the semaphore handle exists before trying to take it. --- components/dsp_processor/dsp_processor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/dsp_processor/dsp_processor.c b/components/dsp_processor/dsp_processor.c index 9aaaf582..7b088e0b 100644 --- a/components/dsp_processor/dsp_processor.c +++ b/components/dsp_processor/dsp_processor.c @@ -284,7 +284,7 @@ int dsp_processor_worker(void *p_pcmChnk, const void *p_scSet) { } // If parameters were changed by API, copy them from centralized storage - if (xSemaphoreTake(paramsChangedSemaphoreHandle, 0) == pdTRUE) { + if (paramsChangedSemaphoreHandle && xSemaphoreTake(paramsChangedSemaphoreHandle, 0) == pdTRUE) { // Copy under mutex to avoid torn reads if (params_mutex) { xSemaphoreTake(params_mutex, portMAX_DELAY); From 31065882cd1ca6ebb9ab3d2c300d95e474e09eff Mon Sep 17 00:00:00 2001 From: craigmillard86 Date: Mon, 12 Jan 2026 13:42:27 +0000 Subject: [PATCH 40/58] Fix to enable channel gains to be restored and applied to all dsp types on reboot of device. --- .../tas5805m_settings/tas5805m_settings.c | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/components/tas5805m_settings/tas5805m_settings.c b/components/tas5805m_settings/tas5805m_settings.c index edb678a4..053e860f 100644 --- a/components/tas5805m_settings/tas5805m_settings.c +++ b/components/tas5805m_settings/tas5805m_settings.c @@ -2715,6 +2715,26 @@ esp_err_t tas5805m_settings_apply_delayed(void) { } } } + + // Restore channel gain for all EQ modes (not just presets) + // Channel gain is independent of EQ band settings + if (ui_mode != TAS5805M_EQ_UI_MODE_OFF && ui_mode != TAS5805M_EQ_UI_MODE_PRESETS) { + int ch_gain = 0; + if (tas5805m_settings_load_channel_gain(TAS5805M_EQ_CHANNELS_LEFT, &ch_gain) == ESP_OK) { + if (tas5805m_set_channel_gain(TAS5805M_EQ_CHANNELS_LEFT, (int8_t)ch_gain) != ESP_OK) { + ESP_LOGW(TAG, "%s: Failed to apply saved Channel Gain L", __func__); + } else { + ESP_LOGI(TAG, "%s: Restored Channel Gain L = %d dB", __func__, ch_gain); + } + } + if (tas5805m_settings_load_channel_gain(TAS5805M_EQ_CHANNELS_RIGHT, &ch_gain) == ESP_OK) { + if (tas5805m_set_channel_gain(TAS5805M_EQ_CHANNELS_RIGHT, (int8_t)ch_gain) != ESP_OK) { + ESP_LOGW(TAG, "%s: Failed to apply saved Channel Gain R", __func__); + } else { + ESP_LOGI(TAG, "%s: Restored Channel Gain R = %d dB", __func__, ch_gain); + } + } + } #endif ESP_LOGI(TAG, "%s: Delayed persisted settings application complete", __func__); From 17f412efe99bfe11c8abf2d90a9de9c01bade181 Mon Sep 17 00:00:00 2001 From: craigmillard86 Date: Wed, 14 Jan 2026 13:51:52 +0000 Subject: [PATCH 41/58] Fix EQ UI gains showing 0 on page load before music starts The EQ schema and settings JSON were only reading from the driver state, which is uninitialized (all 0s) before tas5805m_settings_apply_delayed() runs when music starts. Now falls back to NVS to show persisted values. Fixed locations: - Channel gains in EQ schema (cur_ch_l/cur_ch_r) - Per-band EQ gains in EQ schema (left and right channels) - Channel gains in settings JSON - Per-band EQ gains in settings JSON --- .../tas5805m_settings/tas5805m_settings.c | 90 ++++++++++++++++--- 1 file changed, 79 insertions(+), 11 deletions(-) diff --git a/components/tas5805m_settings/tas5805m_settings.c b/components/tas5805m_settings/tas5805m_settings.c index 053e860f..5be980ab 100644 --- a/components/tas5805m_settings/tas5805m_settings.c +++ b/components/tas5805m_settings/tas5805m_settings.c @@ -2275,9 +2275,30 @@ esp_err_t tas5805m_settings_get_eq_schema_json(char *json_out, size_t max_len) { cJSON *ch_params = cJSON_CreateArray(); + // Prefer reading current driver state; fall back to NVS for persisted values int8_t cur_ch_l = 0, cur_ch_r = 0; - if (tas5805m_get_channel_gain(TAS5805M_EQ_CHANNELS_LEFT, &cur_ch_l) != ESP_OK) cur_ch_l = 0; - if (tas5805m_get_channel_gain(TAS5805M_EQ_CHANNELS_RIGHT, &cur_ch_r) != ESP_OK) cur_ch_r = 0; + if (tas5805m_settings_restored) { + if (tas5805m_get_channel_gain(TAS5805M_EQ_CHANNELS_LEFT, &cur_ch_l) != ESP_OK) { + int tmp = 0; + if (tas5805m_settings_load_channel_gain(TAS5805M_EQ_CHANNELS_LEFT, &tmp) == ESP_OK) { + cur_ch_l = (int8_t)tmp; + } + } + if (tas5805m_get_channel_gain(TAS5805M_EQ_CHANNELS_RIGHT, &cur_ch_r) != ESP_OK) { + int tmp = 0; + if (tas5805m_settings_load_channel_gain(TAS5805M_EQ_CHANNELS_RIGHT, &tmp) == ESP_OK) { + cur_ch_r = (int8_t)tmp; + } + } + } else { + int tmp = 0; + if (tas5805m_settings_load_channel_gain(TAS5805M_EQ_CHANNELS_LEFT, &tmp) == ESP_OK) { + cur_ch_l = (int8_t)tmp; + } + if (tas5805m_settings_load_channel_gain(TAS5805M_EQ_CHANNELS_RIGHT, &tmp) == ESP_OK) { + cur_ch_r = (int8_t)tmp; + } + } cJSON *ch_l_param = cJSON_CreateObject(); cJSON_AddStringToObject(ch_l_param, "key", TAS5805M_NVS_KEY_CHANNEL_GAIN_L); @@ -2474,8 +2495,15 @@ esp_err_t tas5805m_settings_get_eq_schema_json(char *json_out, size_t max_len) { cJSON *eq_bands_left_params = cJSON_CreateArray(); for (int band = 0; band < TAS5805M_EQ_BANDS; ++band) { int gain = 0; - tas5805m_settings_load_eq_gain(TAS5805M_EQ_CHANNELS_LEFT, band, &gain); - + // Prefer reading current driver state; fall back to NVS + if (tas5805m_settings_restored) { + if (tas5805m_get_eq_gain_channel(TAS5805M_EQ_CHANNELS_LEFT, band, &gain) != ESP_OK) { + tas5805m_settings_load_eq_gain(TAS5805M_EQ_CHANNELS_LEFT, band, &gain); + } + } else { + tas5805m_settings_load_eq_gain(TAS5805M_EQ_CHANNELS_LEFT, band, &gain); + } + cJSON *band_param = cJSON_CreateObject(); char key[32]; char freq_label[32]; @@ -2510,8 +2538,15 @@ esp_err_t tas5805m_settings_get_eq_schema_json(char *json_out, size_t max_len) { cJSON *eq_bands_right_params = cJSON_CreateArray(); for (int band = 0; band < TAS5805M_EQ_BANDS; ++band) { int gain = 0; - tas5805m_settings_load_eq_gain(TAS5805M_EQ_CHANNELS_RIGHT, band, &gain); - + // Prefer reading current driver state; fall back to NVS + if (tas5805m_settings_restored) { + if (tas5805m_get_eq_gain_channel(TAS5805M_EQ_CHANNELS_RIGHT, band, &gain) != ESP_OK) { + tas5805m_settings_load_eq_gain(TAS5805M_EQ_CHANNELS_RIGHT, band, &gain); + } + } else { + tas5805m_settings_load_eq_gain(TAS5805M_EQ_CHANNELS_RIGHT, band, &gain); + } + cJSON *band_param = cJSON_CreateObject(); char key[32]; char freq_label[32]; @@ -2874,21 +2909,54 @@ esp_err_t tas5805m_settings_get_eq_json(char *json_out, size_t max_len) { cJSON_AddNumberToObject(root, "eq_profile_right", (int)prof_r); // Get channel gains + // Prefer reading current driver state; if driver isn't ready or returns an error + // fall back to persisted values from NVS so the UI reflects saved settings. int ch_gain_l = 0, ch_gain_r = 0; - tas5805m_settings_load_channel_gain(TAS5805M_EQ_CHANNELS_LEFT, &ch_gain_l); - tas5805m_settings_load_channel_gain(TAS5805M_EQ_CHANNELS_RIGHT, &ch_gain_r); + int8_t chg = 0; + if (tas5805m_settings_restored) { + if (tas5805m_get_channel_gain(TAS5805M_EQ_CHANNELS_LEFT, &chg) == ESP_OK) { + ch_gain_l = (int)chg; + } else { + tas5805m_settings_load_channel_gain(TAS5805M_EQ_CHANNELS_LEFT, &ch_gain_l); + } + if (tas5805m_get_channel_gain(TAS5805M_EQ_CHANNELS_RIGHT, &chg) == ESP_OK) { + ch_gain_r = (int)chg; + } else { + tas5805m_settings_load_channel_gain(TAS5805M_EQ_CHANNELS_RIGHT, &ch_gain_r); + } + } else { + tas5805m_settings_load_channel_gain(TAS5805M_EQ_CHANNELS_LEFT, &ch_gain_l); + tas5805m_settings_load_channel_gain(TAS5805M_EQ_CHANNELS_RIGHT, &ch_gain_r); + } cJSON_AddNumberToObject(root, "channel_gain_left", ch_gain_l); cJSON_AddNumberToObject(root, "channel_gain_right", ch_gain_r); // Get per-band gains + // Prefer reading current driver state; if driver isn't ready or returns an error + // fall back to persisted values from NVS so the UI reflects saved settings. for (int band = 0; band < TAS5805M_EQ_BANDS; ++band) { int gain_l = 0, gain_r = 0; - tas5805m_settings_load_eq_gain(TAS5805M_EQ_CHANNELS_LEFT, band, &gain_l); - tas5805m_settings_load_eq_gain(TAS5805M_EQ_CHANNELS_RIGHT, band, &gain_r); - char key[32]; + + // Left channel: prefer driver value, otherwise load persisted NVS value + if (tas5805m_settings_restored) { + if (tas5805m_get_eq_gain_channel(TAS5805M_EQ_CHANNELS_LEFT, band, &gain_l) != ESP_OK) { + tas5805m_settings_load_eq_gain(TAS5805M_EQ_CHANNELS_LEFT, band, &gain_l); + } + } else { + tas5805m_settings_load_eq_gain(TAS5805M_EQ_CHANNELS_LEFT, band, &gain_l); + } snprintf(key, sizeof(key), "eq_gain_l_%d", band); cJSON_AddNumberToObject(root, key, gain_l); + + // Right channel: prefer driver value, otherwise load persisted NVS value + if (tas5805m_settings_restored) { + if (tas5805m_get_eq_gain_channel(TAS5805M_EQ_CHANNELS_RIGHT, band, &gain_r) != ESP_OK) { + tas5805m_settings_load_eq_gain(TAS5805M_EQ_CHANNELS_RIGHT, band, &gain_r); + } + } else { + tas5805m_settings_load_eq_gain(TAS5805M_EQ_CHANNELS_RIGHT, band, &gain_r); + } snprintf(key, sizeof(key), "eq_gain_r_%d", band); cJSON_AddNumberToObject(root, key, gain_r); } From c4b76d976c77bd1041f61608c26179dad18496b6 Mon Sep 17 00:00:00 2001 From: craigmillard86 Date: Thu, 15 Jan 2026 00:36:21 +0000 Subject: [PATCH 42/58] Add Advanced Bi-Amp Crossover with PEQ, loudness compensation, and UI improvements - Add bi-amp crossover module with Butterworth/Linkwitz-Riley filters (12/24/48 dB/oct) - Implement per-output gain, phase invert, subsonic HPF, and 3-band PEQ - Add loudness compensation with bass/treble shelf filters optimized for bi-amp mode - Restructure EQ settings UI with output-channel layout and PEQ subgroups - Add radio button support for binary phase controls - Hide Channel Gain group in Advanced Bi-Amp mode (uses per-output gains instead) - Support NVS persistence for all bi-amp settings Co-Authored-By: Claude Opus 4.5 --- components/custom_board/CMakeLists.txt | 6 + components/custom_board/tas5805m/tas5805m.c | 8 + components/tas5805m_settings/CMakeLists.txt | 2 +- .../include/tas5805m_biamp.h | 190 ++++ .../include/tas5805m_settings.h | 114 +++ components/tas5805m_settings/tas5805m_biamp.c | 504 +++++++++ .../tas5805m_settings/tas5805m_settings.c | 962 +++++++++++++++++- .../ui_http_server/html/eq-settings.html | 255 ++++- components/ui_http_server/html/settings-ui.js | 201 +++- 9 files changed, 2193 insertions(+), 49 deletions(-) create mode 100644 components/tas5805m_settings/include/tas5805m_biamp.h create mode 100644 components/tas5805m_settings/tas5805m_biamp.c diff --git a/components/custom_board/CMakeLists.txt b/components/custom_board/CMakeLists.txt index 2139c097..12925b4a 100644 --- a/components/custom_board/CMakeLists.txt +++ b/components/custom_board/CMakeLists.txt @@ -2,6 +2,11 @@ set(COMPONENT_REQUIRES audio_hal audio_board) set(COMPONENT_PRIV_REQUIRES esp_peripherals) +# Add tas5805m_settings dependency when TAS5805M DAC is enabled +if(CONFIG_DAC_TAS5805M) + list(APPEND COMPONENT_PRIV_REQUIRES tas5805m_settings) +endif() + if(CONFIG_AUDIO_BOARD_CUSTOM) message(STATUS "Current board name is " CONFIG_AUDIO_BOARD_CUSTOM) set(COMPONENT_ADD_INCLUDEDIRS ./generic_board/include) @@ -49,6 +54,7 @@ if(CONFIG_AUDIO_BOARD_CUSTOM) if(CONFIG_DAC_TAS5805M) message(STATUS "Selected DAC is " CONFIG_DAC_TAS5805M) list(APPEND COMPONENT_ADD_INCLUDEDIRS ./tas5805m/include) + list(APPEND COMPONENT_ADD_INCLUDEDIRS ../tas5805m_settings/include) list(APPEND COMPONENT_SRCS ./tas5805m/tas5805m.c) endif() diff --git a/components/custom_board/tas5805m/tas5805m.c b/components/custom_board/tas5805m/tas5805m.c index e1615867..4251da95 100644 --- a/components/custom_board/tas5805m/tas5805m.c +++ b/components/custom_board/tas5805m/tas5805m.c @@ -31,6 +31,10 @@ #include "tas5805m_reg_cfg.h" #include +#if CONFIG_DAC_TAS5805M +#include "tas5805m_settings.h" +#endif + static const char *TAG = "TAS5805M"; #define TAS5805M_SET_BOOK_AND_PAGE(BOOK, PAGE) \ @@ -372,6 +376,10 @@ esp_err_t tas5805m_set_volume(int vol) { esp_err_t ret = tas5805m_write_byte(TAS5805M_DIG_VOL_CTRL_REGISTER, reg_val); if (ret == ESP_OK) { tas5805m_state.volume = vol; +#if CONFIG_DAC_TAS5805M + /* Apply loudness compensation based on new volume level */ + tas5805m_loudness_apply(vol); +#endif } else { ESP_LOGW(TAG, "%s: Failed to write volume (reg 0x%02x): %s", __func__, reg_val, esp_err_to_name(ret)); } diff --git a/components/tas5805m_settings/CMakeLists.txt b/components/tas5805m_settings/CMakeLists.txt index 99c431bd..9000de74 100644 --- a/components/tas5805m_settings/CMakeLists.txt +++ b/components/tas5805m_settings/CMakeLists.txt @@ -1,5 +1,5 @@ idf_component_register( - SRCS "tas5805m_settings.c" + SRCS "tas5805m_settings.c" "tas5805m_biamp.c" INCLUDE_DIRS "include" REQUIRES nvs_flash custom_board json ) diff --git a/components/tas5805m_settings/include/tas5805m_biamp.h b/components/tas5805m_settings/include/tas5805m_biamp.h new file mode 100644 index 00000000..4a6b96e5 --- /dev/null +++ b/components/tas5805m_settings/include/tas5805m_biamp.h @@ -0,0 +1,190 @@ +/* + * tas5805m_biamp.h + * Advanced Bi-Amp Crossover coefficient calculations for TAS5805M + * + * This module provides functions to calculate and apply biquad filter + * coefficients for active crossover configurations on the TAS5805M DAC. + * + * In bi-amp mode: + * - Left channel output -> Low-pass filter -> Woofer + * - Right channel output -> High-pass filter -> Tweeter + * + * Supported crossover types: + * - Butterworth: -3dB at crossover frequency + * - Linkwitz-Riley: -6dB at crossover frequency, flat summed response + * + * Supported slopes: + * - 12 dB/octave (1 biquad stage) + * - 24 dB/octave (2 biquad stages, standard Linkwitz-Riley) + * - 48 dB/octave (4 biquad stages) + */ + +#ifndef __TAS5805M_BIAMP_H__ +#define __TAS5805M_BIAMP_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include +#include + +#if CONFIG_DAC_TAS5805M + +#include "tas5805m_settings.h" +#include "tas5805m_types.h" + +/* Biquad filter coefficient structure */ +typedef struct { + float b0; + float b1; + float b2; + float a1; + float a2; +} tas5805m_biquad_coeffs_t; + +/* Supported sample rates for coefficient calculations */ +typedef enum { + BIAMP_SAMPLE_RATE_44100 = 44100, + BIAMP_SAMPLE_RATE_48000 = 48000, + BIAMP_SAMPLE_RATE_88200 = 88200, + BIAMP_SAMPLE_RATE_96000 = 96000, +} tas5805m_biamp_sample_rate_t; + +#define TAS5805M_BIAMP_DEFAULT_SAMPLE_RATE BIAMP_SAMPLE_RATE_48000 + +/* Biquad allocation for bi-amp mode (optimal order for headroom): + * + * LEFT (Woofer): RIGHT (Tweeter): + * - Band 0: Gain/phase - Band 0: Gain/phase + * - Band 1: Subsonic HPF - Band 1: Passthrough + * - Bands 2-5: Lowpass crossover - Bands 2-5: Highpass crossover + * - Bands 6-8: PEQ (3 bands) - Bands 6-8: PEQ (3 bands) + * - Bands 9-12: Passthrough - Bands 9-12: Passthrough + * - Band 13: Bass shelf (loudness) - Band 13: Passthrough + * - Band 14: Passthrough - Band 14: Treble shelf (loudness) + */ +#define BIAMP_GAIN_BAND 0 +#define BIAMP_SUBSONIC_BAND 1 /* Subsonic HPF (woofer only) */ +#define BIAMP_CROSSOVER_START_BAND 2 +#define BIAMP_CROSSOVER_MAX_BANDS 4 /* Max 4 filter stages (48dB slope) */ +#define BIAMP_PEQ_START_BAND 6 +#define BIAMP_PEQ_BANDS 3 + +/** + * @brief Calculate 2nd-order Butterworth lowpass filter coefficients + * + * @param fc Cutoff frequency in Hz + * @param fs Sample rate in Hz + * @param coeffs Output coefficients + * @return ESP_OK on success + */ +esp_err_t tas5805m_calc_butterworth_lpf(float fc, float fs, tas5805m_biquad_coeffs_t *coeffs); + +/** + * @brief Calculate 2nd-order Butterworth highpass filter coefficients + * + * @param fc Cutoff frequency in Hz + * @param fs Sample rate in Hz + * @param coeffs Output coefficients + * @return ESP_OK on success + */ +esp_err_t tas5805m_calc_butterworth_hpf(float fc, float fs, tas5805m_biquad_coeffs_t *coeffs); + +/** + * @brief Calculate parametric EQ (peaking) filter coefficients + * + * @param fc Center frequency in Hz + * @param gain_db Gain in dB (-15 to +15) + * @param q Q factor (0.5 to 10.0) + * @param fs Sample rate in Hz + * @param coeffs Output coefficients + * @return ESP_OK on success + */ +esp_err_t tas5805m_calc_peq(float fc, float gain_db, float q, float fs, tas5805m_biquad_coeffs_t *coeffs); + +/** + * @brief Calculate gain stage coefficients (simple scalar) + * + * @param gain_db Gain in dB + * @param coeffs Output coefficients (passthrough with gain) + * @return ESP_OK on success + */ +esp_err_t tas5805m_calc_gain(float gain_db, tas5805m_biquad_coeffs_t *coeffs); + +/** + * @brief Calculate passthrough (unity) coefficients + * + * @param coeffs Output coefficients + * @return ESP_OK on success + */ +esp_err_t tas5805m_calc_passthrough(tas5805m_biquad_coeffs_t *coeffs); + +/** + * @brief Calculate phase inversion coefficients + * + * @param coeffs Output coefficients + * @return ESP_OK on success + */ +esp_err_t tas5805m_calc_phase_invert(tas5805m_biquad_coeffs_t *coeffs); + +/** + * @brief Calculate low shelf filter coefficients + * + * @param fc Shelf frequency in Hz (typically 100-400 Hz for bass) + * @param gain_db Gain in dB (-12 to +12) + * @param fs Sample rate in Hz + * @param coeffs Output coefficients + * @return ESP_OK on success + */ +esp_err_t tas5805m_calc_low_shelf(float fc, float gain_db, float fs, tas5805m_biquad_coeffs_t *coeffs); + +/** + * @brief Calculate high shelf filter coefficients + * + * @param fc Shelf frequency in Hz (typically 2-8 kHz for treble) + * @param gain_db Gain in dB (-12 to +12) + * @param fs Sample rate in Hz + * @param coeffs Output coefficients + * @return ESP_OK on success + */ +esp_err_t tas5805m_calc_high_shelf(float fc, float gain_db, float fs, tas5805m_biquad_coeffs_t *coeffs); + +/** + * @brief Get the number of biquad stages needed for a crossover slope + * + * @param slope The crossover slope setting + * @return Number of biquad stages (1, 2, or 4) + */ +int tas5805m_biamp_get_biquad_count(tas5805m_biamp_slope_t slope); + +/** + * @brief Apply bi-amp crossover configuration to TAS5805M + * + * This function calculates all necessary filter coefficients and writes + * them to the TAS5805M biquad registers. It handles: + * - Crossover LP/HP filters with specified slope and type + * - Per-output gain adjustments + * - Per-output phase inversion + * - Per-output PEQ bands + * + * @param settings Bi-amp configuration settings + * @return ESP_OK on success, error code otherwise + */ +esp_err_t tas5805m_biamp_apply(const tas5805m_biamp_settings_t *settings); + +/** + * @brief Initialize bi-amp settings to defaults + * + * @param settings Settings structure to initialize + */ +void tas5805m_biamp_init_defaults(tas5805m_biamp_settings_t *settings); + +#endif /* CONFIG_DAC_TAS5805M */ + +#ifdef __cplusplus +} +#endif + +#endif /* __TAS5805M_BIAMP_H__ */ diff --git a/components/tas5805m_settings/include/tas5805m_settings.h b/components/tas5805m_settings/include/tas5805m_settings.h index c6f692ce..a0b07947 100644 --- a/components/tas5805m_settings/include/tas5805m_settings.h +++ b/components/tas5805m_settings/include/tas5805m_settings.h @@ -46,6 +46,27 @@ extern "C" { #define TAS5805M_NVS_KEY_CHANNEL_GAIN_L "channel_gain_l" #define TAS5805M_NVS_KEY_CHANNEL_GAIN_R "channel_gain_r" +// Advanced Bi-Amp crossover NVS keys +#define TAS5805M_NVS_KEY_BIAMP_XOVER_FREQ "biamp_xfreq" +#define TAS5805M_NVS_KEY_BIAMP_SLOPE "biamp_slope" +#define TAS5805M_NVS_KEY_BIAMP_TYPE "biamp_type" +#define TAS5805M_NVS_KEY_BIAMP_LOW_GAIN "biamp_lo_g" +#define TAS5805M_NVS_KEY_BIAMP_LOW_PHASE "biamp_lo_ph" +#define TAS5805M_NVS_KEY_BIAMP_HIGH_GAIN "biamp_hi_g" +#define TAS5805M_NVS_KEY_BIAMP_HIGH_PHASE "biamp_hi_ph" +#define TAS5805M_NVS_KEY_BIAMP_SAMPLE_RATE "biamp_sr" +// Subsonic filter (high-pass) for speaker protection +#define TAS5805M_NVS_KEY_BIAMP_SUBSONIC_FREQ "biamp_sub_f" +// Per-output PEQ keys (format: biamp_lo_peqN_f, biamp_lo_peqN_g, biamp_lo_peqN_q) +#define TAS5805M_NVS_KEY_BIAMP_PEQ_PREFIX_L "biamp_lo_peq" +#define TAS5805M_NVS_KEY_BIAMP_PEQ_PREFIX_H "biamp_hi_peq" + +// Loudness compensation (volume-dependent EQ overlay) +#define TAS5805M_NVS_KEY_LOUDNESS_ENABLED "loud_en" +#define TAS5805M_NVS_KEY_LOUDNESS_THRESH "loud_thr" // 4 bytes for thresholds +#define TAS5805M_NVS_KEY_LOUDNESS_BASS "loud_bass" // 5 bytes for bass boost +#define TAS5805M_NVS_KEY_LOUDNESS_TREBLE "loud_treb" // 5 bytes for treble boost + /** EQ UI modes exposed to the settings UI. These control visibility and apply behavior. * Defined here so the settings module owns the UI contract. Values are persisted to NVS. */ @@ -54,6 +75,7 @@ typedef enum { TAS5805M_EQ_UI_MODE_15_BAND = 1, TAS5805M_EQ_UI_MODE_15_BAND_BIAMP = 2, TAS5805M_EQ_UI_MODE_PRESETS = 3, + TAS5805M_EQ_UI_MODE_ADVANCED_BIAMP = 4, } TAS5805M_EQ_UI_MODE; /** Convert an EQ UI mode to human-readable name (for schema name fields) */ @@ -124,6 +146,98 @@ esp_err_t tas5805m_settings_save_channel_gain(TAS5805M_EQ_CHANNELS ch, int gain_ /** Load per-output channel gain (single value per channel, in dB) */ esp_err_t tas5805m_settings_load_channel_gain(TAS5805M_EQ_CHANNELS ch, int *gain_db); +/* ============ Advanced Bi-Amp Crossover Types ============ */ + +/** Crossover filter slope (number of cascaded biquads) */ +typedef enum { + BIAMP_SLOPE_12DB = 1, // 12 dB/octave (1 biquad) + BIAMP_SLOPE_24DB = 2, // 24 dB/octave (2 biquads, Linkwitz-Riley) + BIAMP_SLOPE_48DB = 4, // 48 dB/octave (4 biquads) +} tas5805m_biamp_slope_t; + +/** Crossover filter type */ +typedef enum { + BIAMP_TYPE_BUTTERWORTH = 0, + BIAMP_TYPE_LINKWITZ_RILEY = 1, +} tas5805m_biamp_type_t; + +/** Per-output PEQ band settings */ +typedef struct { + uint16_t freq; // Center frequency (20-20000 Hz), 0 = disabled + int8_t gain; // Gain in dB (-15 to +15) + uint8_t q_x10; // Q factor * 10 (5-100 representing 0.5-10.0) +} tas5805m_biamp_peq_band_t; + +#define TAS5805M_BIAMP_PEQ_BANDS 3 // PEQ bands per output + +/** Advanced bi-amp crossover settings */ +typedef struct { + // Crossover settings + uint16_t crossover_freq; // 20-20000 Hz + tas5805m_biamp_slope_t slope; // 12/24/48 dB/oct + tas5805m_biamp_type_t type; // Butterworth/Linkwitz-Riley + uint32_t sample_rate; // Sample rate in Hz (44100, 48000, 88200, 96000) + + // Speaker protection + uint16_t subsonic_freq; // Subsonic HPF frequency (0=off, 20-80 Hz typical) + + // Low output (woofer) settings + int8_t low_gain; // -24 to +24 dB + uint8_t low_phase_invert; // 0=normal, 1=invert + tas5805m_biamp_peq_band_t low_peq[TAS5805M_BIAMP_PEQ_BANDS]; + + // High output (tweeter) settings + int8_t high_gain; // -24 to +24 dB + uint8_t high_phase_invert; // 0=normal, 1=invert + tas5805m_biamp_peq_band_t high_peq[TAS5805M_BIAMP_PEQ_BANDS]; +} tas5805m_biamp_settings_t; + +/** Default bi-amp settings */ +#define TAS5805M_BIAMP_DEFAULT_XOVER_FREQ 2000 +#define TAS5805M_BIAMP_DEFAULT_SLOPE BIAMP_SLOPE_24DB +#define TAS5805M_BIAMP_DEFAULT_TYPE BIAMP_TYPE_LINKWITZ_RILEY + +/** Save advanced bi-amp settings to NVS */ +esp_err_t tas5805m_settings_save_biamp(const tas5805m_biamp_settings_t *settings); +/** Load advanced bi-amp settings from NVS */ +esp_err_t tas5805m_settings_load_biamp(tas5805m_biamp_settings_t *settings); +/** Apply advanced bi-amp settings to the DAC */ +esp_err_t tas5805m_settings_apply_biamp(const tas5805m_biamp_settings_t *settings); + +/* ============ Loudness Compensation (Volume-Dependent EQ) ============ */ + +#define TAS5805M_LOUDNESS_ZONES 5 /** Number of volume zones */ + +/** Loudness compensation settings - applies bass/treble boost based on volume */ +typedef struct { + uint8_t enabled; // 0=off, 1=on + uint8_t thresholds[TAS5805M_LOUDNESS_ZONES-1]; // 4 thresholds (0-100), e.g. {20,40,60,80} + int8_t bass_boost[TAS5805M_LOUDNESS_ZONES]; // Bass boost per zone in dB (-12 to +12) + int8_t treble_boost[TAS5805M_LOUDNESS_ZONES]; // Treble boost per zone in dB (-12 to +12) +} tas5805m_loudness_settings_t; + +/** Default loudness thresholds (volume %) */ +#define TAS5805M_LOUDNESS_DEFAULT_THRESH {20, 40, 60, 80} +/** Default bass boost per zone (dB) - more boost at lower volumes */ +#define TAS5805M_LOUDNESS_DEFAULT_BASS {6, 4, 2, 1, 0} +/** Default treble boost per zone (dB) */ +#define TAS5805M_LOUDNESS_DEFAULT_TREBLE {4, 3, 2, 1, 0} + +/** Biquad bands used for loudness shelving filters */ +#define TAS5805M_LOUDNESS_BASS_BAND 13 // Low shelf filter band +#define TAS5805M_LOUDNESS_TREBLE_BAND 14 // High shelf filter band + +/** Save loudness settings to NVS */ +esp_err_t tas5805m_settings_save_loudness(const tas5805m_loudness_settings_t *settings); +/** Load loudness settings from NVS */ +esp_err_t tas5805m_settings_load_loudness(tas5805m_loudness_settings_t *settings); +/** Initialize loudness settings to defaults */ +void tas5805m_loudness_init_defaults(tas5805m_loudness_settings_t *settings); +/** Apply loudness compensation based on current volume (0-100) */ +esp_err_t tas5805m_loudness_apply(int volume); +/** Get current loudness zone (0-4) for a given volume */ +int tas5805m_loudness_get_zone(int volume); + /** Get current TAS5805M settings as a JSON string */ //esp_err_t tas5805m_settings_get_json(char *json_out, size_t max_len); diff --git a/components/tas5805m_settings/tas5805m_biamp.c b/components/tas5805m_settings/tas5805m_biamp.c new file mode 100644 index 00000000..fcd78066 --- /dev/null +++ b/components/tas5805m_settings/tas5805m_biamp.c @@ -0,0 +1,504 @@ +/* + * tas5805m_biamp.c + * Advanced Bi-Amp Crossover coefficient calculations for TAS5805M + */ + +#include "tas5805m_biamp.h" + +#if CONFIG_DAC_TAS5805M + +#include +#include +#include "esp_log.h" +#include "tas5805m.h" + +static const char *TAG = "tas5805m_biamp"; + +#ifndef M_PI +#define M_PI 3.14159265358979323846 +#endif + +#ifndef M_SQRT2 +#define M_SQRT2 1.41421356237309504880 +#endif + +/* + * Calculate 2nd-order Butterworth lowpass filter coefficients + * Using bilinear transform from analog prototype H(s) = 1/(s² + √2·s + 1) + */ +esp_err_t tas5805m_calc_butterworth_lpf(float fc, float fs, tas5805m_biquad_coeffs_t *coeffs) +{ + if (coeffs == NULL || fc <= 0 || fs <= 0 || fc >= fs / 2) { + return ESP_ERR_INVALID_ARG; + } + + /* Pre-warp the cutoff frequency */ + float w0 = 2.0f * M_PI * fc / fs; + float K = tanf(w0 / 2.0f); + float K2 = K * K; + float sqrt2_K = M_SQRT2 * K; + + /* Calculate coefficients */ + float norm = 1.0f / (1.0f + sqrt2_K + K2); + + coeffs->b0 = K2 * norm; + coeffs->b1 = 2.0f * coeffs->b0; + coeffs->b2 = coeffs->b0; + coeffs->a1 = 2.0f * (K2 - 1.0f) * norm; + coeffs->a2 = (1.0f - sqrt2_K + K2) * norm; + + return ESP_OK; +} + +/* + * Calculate 2nd-order Butterworth highpass filter coefficients + * Using bilinear transform from analog prototype H(s) = s²/(s² + √2·s + 1) + */ +esp_err_t tas5805m_calc_butterworth_hpf(float fc, float fs, tas5805m_biquad_coeffs_t *coeffs) +{ + if (coeffs == NULL || fc <= 0 || fs <= 0 || fc >= fs / 2) { + return ESP_ERR_INVALID_ARG; + } + + /* Pre-warp the cutoff frequency */ + float w0 = 2.0f * M_PI * fc / fs; + float K = tanf(w0 / 2.0f); + float K2 = K * K; + float sqrt2_K = M_SQRT2 * K; + + /* Calculate coefficients */ + float norm = 1.0f / (1.0f + sqrt2_K + K2); + + coeffs->b0 = norm; + coeffs->b1 = -2.0f * norm; + coeffs->b2 = norm; + coeffs->a1 = 2.0f * (K2 - 1.0f) * norm; + coeffs->a2 = (1.0f - sqrt2_K + K2) * norm; + + return ESP_OK; +} + +/* + * Calculate parametric EQ (peaking) filter coefficients + * Based on Audio EQ Cookbook by Robert Bristow-Johnson + */ +esp_err_t tas5805m_calc_peq(float fc, float gain_db, float q, float fs, tas5805m_biquad_coeffs_t *coeffs) +{ + if (coeffs == NULL || fc <= 0 || fs <= 0 || fc >= fs / 2 || q <= 0) { + return ESP_ERR_INVALID_ARG; + } + + /* If gain is essentially zero, return passthrough */ + if (fabsf(gain_db) < 0.01f) { + return tas5805m_calc_passthrough(coeffs); + } + + float A = powf(10.0f, gain_db / 40.0f); /* sqrt of linear gain */ + float w0 = 2.0f * M_PI * fc / fs; + float sin_w0 = sinf(w0); + float cos_w0 = cosf(w0); + float alpha = sin_w0 / (2.0f * q); + + float b0 = 1.0f + alpha * A; + float b1 = -2.0f * cos_w0; + float b2 = 1.0f - alpha * A; + float a0 = 1.0f + alpha / A; + float a1 = -2.0f * cos_w0; + float a2 = 1.0f - alpha / A; + + /* Normalize by a0 */ + coeffs->b0 = b0 / a0; + coeffs->b1 = b1 / a0; + coeffs->b2 = b2 / a0; + coeffs->a1 = a1 / a0; + coeffs->a2 = a2 / a0; + + return ESP_OK; +} + +/* + * Calculate simple gain stage (passthrough with gain) + */ +esp_err_t tas5805m_calc_gain(float gain_db, tas5805m_biquad_coeffs_t *coeffs) +{ + if (coeffs == NULL) { + return ESP_ERR_INVALID_ARG; + } + + float linear_gain = powf(10.0f, gain_db / 20.0f); + + coeffs->b0 = linear_gain; + coeffs->b1 = 0.0f; + coeffs->b2 = 0.0f; + coeffs->a1 = 0.0f; + coeffs->a2 = 0.0f; + + return ESP_OK; +} + +/* + * Calculate passthrough (unity) coefficients + */ +esp_err_t tas5805m_calc_passthrough(tas5805m_biquad_coeffs_t *coeffs) +{ + if (coeffs == NULL) { + return ESP_ERR_INVALID_ARG; + } + + coeffs->b0 = 1.0f; + coeffs->b1 = 0.0f; + coeffs->b2 = 0.0f; + coeffs->a1 = 0.0f; + coeffs->a2 = 0.0f; + + return ESP_OK; +} + +/* + * Calculate phase inversion coefficients + */ +esp_err_t tas5805m_calc_phase_invert(tas5805m_biquad_coeffs_t *coeffs) +{ + if (coeffs == NULL) { + return ESP_ERR_INVALID_ARG; + } + + coeffs->b0 = -1.0f; + coeffs->b1 = 0.0f; + coeffs->b2 = 0.0f; + coeffs->a1 = 0.0f; + coeffs->a2 = 0.0f; + + return ESP_OK; +} + +/* + * Calculate low shelf filter coefficients + * Based on Audio EQ Cookbook by Robert Bristow-Johnson + */ +esp_err_t tas5805m_calc_low_shelf(float fc, float gain_db, float fs, tas5805m_biquad_coeffs_t *coeffs) +{ + if (coeffs == NULL || fc <= 0 || fs <= 0 || fc >= fs / 2) { + return ESP_ERR_INVALID_ARG; + } + + /* If gain is essentially zero, return passthrough */ + if (fabsf(gain_db) < 0.01f) { + return tas5805m_calc_passthrough(coeffs); + } + + float A = powf(10.0f, gain_db / 40.0f); /* sqrt of linear gain */ + float w0 = 2.0f * M_PI * fc / fs; + float sin_w0 = sinf(w0); + float cos_w0 = cosf(w0); + /* S = 1 gives a steep shelf, commonly used value */ + float alpha = sin_w0 / 2.0f * sqrtf((A + 1.0f/A) * (1.0f/1.0f - 1.0f) + 2.0f); + /* Simplified: alpha = sin_w0 / 2 * sqrt(2) for S=1 */ + alpha = sin_w0 / 2.0f * M_SQRT2; + float two_sqrt_A_alpha = 2.0f * sqrtf(A) * alpha; + + float b0 = A * ((A + 1.0f) - (A - 1.0f) * cos_w0 + two_sqrt_A_alpha); + float b1 = 2.0f * A * ((A - 1.0f) - (A + 1.0f) * cos_w0); + float b2 = A * ((A + 1.0f) - (A - 1.0f) * cos_w0 - two_sqrt_A_alpha); + float a0 = (A + 1.0f) + (A - 1.0f) * cos_w0 + two_sqrt_A_alpha; + float a1 = -2.0f * ((A - 1.0f) + (A + 1.0f) * cos_w0); + float a2 = (A + 1.0f) + (A - 1.0f) * cos_w0 - two_sqrt_A_alpha; + + /* Normalize by a0 */ + coeffs->b0 = b0 / a0; + coeffs->b1 = b1 / a0; + coeffs->b2 = b2 / a0; + coeffs->a1 = a1 / a0; + coeffs->a2 = a2 / a0; + + return ESP_OK; +} + +/* + * Calculate high shelf filter coefficients + * Based on Audio EQ Cookbook by Robert Bristow-Johnson + */ +esp_err_t tas5805m_calc_high_shelf(float fc, float gain_db, float fs, tas5805m_biquad_coeffs_t *coeffs) +{ + if (coeffs == NULL || fc <= 0 || fs <= 0 || fc >= fs / 2) { + return ESP_ERR_INVALID_ARG; + } + + /* If gain is essentially zero, return passthrough */ + if (fabsf(gain_db) < 0.01f) { + return tas5805m_calc_passthrough(coeffs); + } + + float A = powf(10.0f, gain_db / 40.0f); /* sqrt of linear gain */ + float w0 = 2.0f * M_PI * fc / fs; + float sin_w0 = sinf(w0); + float cos_w0 = cosf(w0); + /* S = 1 gives a steep shelf */ + float alpha = sin_w0 / 2.0f * M_SQRT2; + float two_sqrt_A_alpha = 2.0f * sqrtf(A) * alpha; + + float b0 = A * ((A + 1.0f) + (A - 1.0f) * cos_w0 + two_sqrt_A_alpha); + float b1 = -2.0f * A * ((A - 1.0f) + (A + 1.0f) * cos_w0); + float b2 = A * ((A + 1.0f) + (A - 1.0f) * cos_w0 - two_sqrt_A_alpha); + float a0 = (A + 1.0f) - (A - 1.0f) * cos_w0 + two_sqrt_A_alpha; + float a1 = 2.0f * ((A - 1.0f) - (A + 1.0f) * cos_w0); + float a2 = (A + 1.0f) - (A - 1.0f) * cos_w0 - two_sqrt_A_alpha; + + /* Normalize by a0 */ + coeffs->b0 = b0 / a0; + coeffs->b1 = b1 / a0; + coeffs->b2 = b2 / a0; + coeffs->a1 = a1 / a0; + coeffs->a2 = a2 / a0; + + return ESP_OK; +} + +/* + * Get the number of biquad stages needed for a crossover slope + */ +int tas5805m_biamp_get_biquad_count(tas5805m_biamp_slope_t slope) +{ + switch (slope) { + case BIAMP_SLOPE_12DB: return 1; + case BIAMP_SLOPE_24DB: return 2; + case BIAMP_SLOPE_48DB: return 4; + default: return 2; /* Default to 24dB/octave */ + } +} + +/* + * Write biquad coefficients to a specific band + */ +static esp_err_t write_biquad_band(TAS5805M_EQ_CHANNELS channel, int band, + const tas5805m_biquad_coeffs_t *coeffs) +{ + ESP_LOGD(TAG, "Writing biquad ch=%d band=%d: b0=%.6f b1=%.6f b2=%.6f a1=%.6f a2=%.6f", + channel, band, coeffs->b0, coeffs->b1, coeffs->b2, coeffs->a1, coeffs->a2); + + return tas5805m_write_biquad_coefficients(channel, band, + coeffs->b0, coeffs->b1, coeffs->b2, + coeffs->a1, coeffs->a2); +} + +/* + * Validate and normalize sample rate to a supported value + */ +static uint32_t validate_sample_rate(uint32_t sample_rate) +{ + switch (sample_rate) { + case BIAMP_SAMPLE_RATE_44100: + case BIAMP_SAMPLE_RATE_48000: + case BIAMP_SAMPLE_RATE_88200: + case BIAMP_SAMPLE_RATE_96000: + return sample_rate; + default: + ESP_LOGW(TAG, "Invalid sample rate %lu, using default %d", + (unsigned long)sample_rate, TAS5805M_BIAMP_DEFAULT_SAMPLE_RATE); + return TAS5805M_BIAMP_DEFAULT_SAMPLE_RATE; + } +} + +/* + * Apply bi-amp crossover configuration to TAS5805M + */ +esp_err_t tas5805m_biamp_apply(const tas5805m_biamp_settings_t *settings) +{ + if (settings == NULL) { + return ESP_ERR_INVALID_ARG; + } + + esp_err_t ret; + tas5805m_biquad_coeffs_t coeffs; + int num_stages = tas5805m_biamp_get_biquad_count(settings->slope); + float fc = (float)settings->crossover_freq; + float fs = (float)validate_sample_rate(settings->sample_rate); + int band; + + ESP_LOGI(TAG, "Applying bi-amp crossover: fc=%dHz, slope=%ddB/oct, type=%s, fs=%.0fHz", + settings->crossover_freq, + num_stages * 12, + settings->type == BIAMP_TYPE_LINKWITZ_RILEY ? "LR" : "BW", + fs); + + /* === LEFT CHANNEL (LOW/WOOFER OUTPUT) === */ + + /* Band 0: Gain + optional phase invert for low output */ + float low_total_gain = (float)settings->low_gain; + if (settings->low_phase_invert) { + low_total_gain = -powf(10.0f, low_total_gain / 20.0f); + coeffs.b0 = low_total_gain; + coeffs.b1 = 0.0f; + coeffs.b2 = 0.0f; + coeffs.a1 = 0.0f; + coeffs.a2 = 0.0f; + } else { + ret = tas5805m_calc_gain(low_total_gain, &coeffs); + if (ret != ESP_OK) return ret; + } + ret = write_biquad_band(TAS5805M_EQ_CHANNELS_LEFT, BIAMP_GAIN_BAND, &coeffs); + if (ret != ESP_OK) return ret; + + /* Band 1: Subsonic HPF (early in chain for optimal headroom) */ + if (settings->subsonic_freq > 0 && settings->subsonic_freq < fs / 2) { + ret = tas5805m_calc_butterworth_hpf((float)settings->subsonic_freq, fs, &coeffs); + if (ret != ESP_OK) return ret; + ESP_LOGI(TAG, "Applying subsonic HPF at %d Hz (band %d)", settings->subsonic_freq, BIAMP_SUBSONIC_BAND); + } else { + ret = tas5805m_calc_passthrough(&coeffs); + if (ret != ESP_OK) return ret; + } + ret = write_biquad_band(TAS5805M_EQ_CHANNELS_LEFT, BIAMP_SUBSONIC_BAND, &coeffs); + if (ret != ESP_OK) return ret; + + /* Bands 2-5: Lowpass filter stages (Butterworth for both BW and LR) */ + ret = tas5805m_calc_butterworth_lpf(fc, fs, &coeffs); + if (ret != ESP_OK) return ret; + + for (int i = 0; i < num_stages; i++) { + band = BIAMP_CROSSOVER_START_BAND + i; + ret = write_biquad_band(TAS5805M_EQ_CHANNELS_LEFT, band, &coeffs); + if (ret != ESP_OK) return ret; + } + + /* Fill remaining crossover bands with passthrough */ + ret = tas5805m_calc_passthrough(&coeffs); + if (ret != ESP_OK) return ret; + for (int i = num_stages; i < BIAMP_CROSSOVER_MAX_BANDS; i++) { + band = BIAMP_CROSSOVER_START_BAND + i; + ret = write_biquad_band(TAS5805M_EQ_CHANNELS_LEFT, band, &coeffs); + if (ret != ESP_OK) return ret; + } + + /* Bands 6-8: PEQ for low output */ + for (int i = 0; i < BIAMP_PEQ_BANDS; i++) { + band = BIAMP_PEQ_START_BAND + i; + const tas5805m_biamp_peq_band_t *peq = &settings->low_peq[i]; + + if (peq->freq > 0 && peq->freq < fs / 2 && peq->gain != 0) { + float q = (float)peq->q_x10 / 10.0f; + ret = tas5805m_calc_peq((float)peq->freq, (float)peq->gain, q, fs, &coeffs); + } else { + ret = tas5805m_calc_passthrough(&coeffs); + } + if (ret != ESP_OK) return ret; + ret = write_biquad_band(TAS5805M_EQ_CHANNELS_LEFT, band, &coeffs); + if (ret != ESP_OK) return ret; + } + + /* Fill remaining bands with passthrough (leave band 13 for loudness bass) */ + ret = tas5805m_calc_passthrough(&coeffs); + if (ret != ESP_OK) return ret; + for (band = BIAMP_PEQ_START_BAND + BIAMP_PEQ_BANDS; band < TAS5805M_LOUDNESS_BASS_BAND; band++) { + ret = write_biquad_band(TAS5805M_EQ_CHANNELS_LEFT, band, &coeffs); + if (ret != ESP_OK) return ret; + } + /* Band 14: passthrough (loudness treble not used on woofer) */ + ret = write_biquad_band(TAS5805M_EQ_CHANNELS_LEFT, TAS5805M_LOUDNESS_TREBLE_BAND, &coeffs); + if (ret != ESP_OK) return ret; + + /* === RIGHT CHANNEL (HIGH/TWEETER OUTPUT) === */ + + /* Band 0: Gain + optional phase invert for high output */ + float high_total_gain = (float)settings->high_gain; + if (settings->high_phase_invert) { + high_total_gain = -powf(10.0f, high_total_gain / 20.0f); + coeffs.b0 = high_total_gain; + coeffs.b1 = 0.0f; + coeffs.b2 = 0.0f; + coeffs.a1 = 0.0f; + coeffs.a2 = 0.0f; + } else { + ret = tas5805m_calc_gain(high_total_gain, &coeffs); + if (ret != ESP_OK) return ret; + } + ret = write_biquad_band(TAS5805M_EQ_CHANNELS_RIGHT, BIAMP_GAIN_BAND, &coeffs); + if (ret != ESP_OK) return ret; + + /* Band 1: Passthrough (no subsonic needed for tweeter) */ + ret = tas5805m_calc_passthrough(&coeffs); + if (ret != ESP_OK) return ret; + ret = write_biquad_band(TAS5805M_EQ_CHANNELS_RIGHT, BIAMP_SUBSONIC_BAND, &coeffs); + if (ret != ESP_OK) return ret; + + /* Bands 2-5: Highpass filter stages */ + ret = tas5805m_calc_butterworth_hpf(fc, fs, &coeffs); + if (ret != ESP_OK) return ret; + + for (int i = 0; i < num_stages; i++) { + band = BIAMP_CROSSOVER_START_BAND + i; + ret = write_biquad_band(TAS5805M_EQ_CHANNELS_RIGHT, band, &coeffs); + if (ret != ESP_OK) return ret; + } + + /* Fill remaining crossover bands with passthrough */ + ret = tas5805m_calc_passthrough(&coeffs); + if (ret != ESP_OK) return ret; + for (int i = num_stages; i < BIAMP_CROSSOVER_MAX_BANDS; i++) { + band = BIAMP_CROSSOVER_START_BAND + i; + ret = write_biquad_band(TAS5805M_EQ_CHANNELS_RIGHT, band, &coeffs); + if (ret != ESP_OK) return ret; + } + + /* Bands 6-8: PEQ for high output */ + for (int i = 0; i < BIAMP_PEQ_BANDS; i++) { + band = BIAMP_PEQ_START_BAND + i; + const tas5805m_biamp_peq_band_t *peq = &settings->high_peq[i]; + + if (peq->freq > 0 && peq->freq < fs / 2 && peq->gain != 0) { + float q = (float)peq->q_x10 / 10.0f; + ret = tas5805m_calc_peq((float)peq->freq, (float)peq->gain, q, fs, &coeffs); + } else { + ret = tas5805m_calc_passthrough(&coeffs); + } + if (ret != ESP_OK) return ret; + ret = write_biquad_band(TAS5805M_EQ_CHANNELS_RIGHT, band, &coeffs); + if (ret != ESP_OK) return ret; + } + + /* Fill remaining bands with passthrough (leave band 14 for loudness treble) */ + ret = tas5805m_calc_passthrough(&coeffs); + if (ret != ESP_OK) return ret; + for (band = BIAMP_PEQ_START_BAND + BIAMP_PEQ_BANDS; band < TAS5805M_LOUDNESS_TREBLE_BAND; band++) { + ret = write_biquad_band(TAS5805M_EQ_CHANNELS_RIGHT, band, &coeffs); + if (ret != ESP_OK) return ret; + } + + ESP_LOGI(TAG, "Bi-amp crossover applied successfully (subsonic=%dHz)", settings->subsonic_freq); + return ESP_OK; +} + +/* + * Initialize bi-amp settings to defaults + */ +void tas5805m_biamp_init_defaults(tas5805m_biamp_settings_t *settings) +{ + if (settings == NULL) return; + + memset(settings, 0, sizeof(tas5805m_biamp_settings_t)); + + settings->crossover_freq = TAS5805M_BIAMP_DEFAULT_XOVER_FREQ; + settings->slope = TAS5805M_BIAMP_DEFAULT_SLOPE; + settings->type = TAS5805M_BIAMP_DEFAULT_TYPE; + settings->sample_rate = TAS5805M_BIAMP_DEFAULT_SAMPLE_RATE; + settings->subsonic_freq = 0; /* Disabled by default */ + + settings->low_gain = 0; + settings->low_phase_invert = 0; + + settings->high_gain = 0; + settings->high_phase_invert = 0; + + /* Initialize PEQ bands to disabled (freq=0) */ + for (int i = 0; i < TAS5805M_BIAMP_PEQ_BANDS; i++) { + settings->low_peq[i].freq = 0; + settings->low_peq[i].gain = 0; + settings->low_peq[i].q_x10 = 14; /* Default Q = 1.4 */ + + settings->high_peq[i].freq = 0; + settings->high_peq[i].gain = 0; + settings->high_peq[i].q_x10 = 14; + } +} + +#endif /* CONFIG_DAC_TAS5805M */ diff --git a/components/tas5805m_settings/tas5805m_settings.c b/components/tas5805m_settings/tas5805m_settings.c index 5be980ab..8ea256dd 100644 --- a/components/tas5805m_settings/tas5805m_settings.c +++ b/components/tas5805m_settings/tas5805m_settings.c @@ -4,6 +4,7 @@ */ #include "tas5805m_settings.h" +#include "tas5805m_biamp.h" #if CONFIG_DAC_TAS5805M @@ -193,6 +194,7 @@ const char *tas5805m_eq_ui_mode_to_string(TAS5805M_EQ_UI_MODE m) { case TAS5805M_EQ_UI_MODE_15_BAND: return "15-band"; case TAS5805M_EQ_UI_MODE_15_BAND_BIAMP: return "15-band (bi-amp)"; case TAS5805M_EQ_UI_MODE_PRESETS: return "EQ Presets"; + case TAS5805M_EQ_UI_MODE_ADVANCED_BIAMP: return "Advanced Bi-Amp"; default: return "Unknown"; } } @@ -767,6 +769,357 @@ esp_err_t tas5805m_settings_load_channel_gain(TAS5805M_EQ_CHANNELS ch, int *gain return err; } +/* ============ Advanced Bi-Amp Settings NVS Functions ============ */ + +/** Save advanced bi-amp settings to NVS */ +esp_err_t tas5805m_settings_save_biamp(const tas5805m_biamp_settings_t *settings) { + ESP_LOGD(TAG, "%s", __func__); + + if (!settings) return ESP_ERR_INVALID_ARG; + if (!tas5805m_settings_mutex) return ESP_ERR_INVALID_STATE; + + if (xSemaphoreTake(tas5805m_settings_mutex, pdMS_TO_TICKS(5000)) != pdTRUE) { + return ESP_ERR_TIMEOUT; + } + + nvs_handle_t h; + esp_err_t err = nvs_open(TAS5805M_NVS_NAMESPACE, NVS_READWRITE, &h); + if (err == ESP_OK) { + /* Crossover settings */ + err = nvs_set_u16(h, TAS5805M_NVS_KEY_BIAMP_XOVER_FREQ, settings->crossover_freq); + if (err == ESP_OK) err = nvs_set_u8(h, TAS5805M_NVS_KEY_BIAMP_SLOPE, (uint8_t)settings->slope); + if (err == ESP_OK) err = nvs_set_u8(h, TAS5805M_NVS_KEY_BIAMP_TYPE, (uint8_t)settings->type); + if (err == ESP_OK) err = nvs_set_u32(h, TAS5805M_NVS_KEY_BIAMP_SAMPLE_RATE, settings->sample_rate); + + /* Speaker protection */ + if (err == ESP_OK) err = nvs_set_u16(h, TAS5805M_NVS_KEY_BIAMP_SUBSONIC_FREQ, settings->subsonic_freq); + + /* Low output settings */ + if (err == ESP_OK) err = nvs_set_i8(h, TAS5805M_NVS_KEY_BIAMP_LOW_GAIN, settings->low_gain); + if (err == ESP_OK) err = nvs_set_u8(h, TAS5805M_NVS_KEY_BIAMP_LOW_PHASE, settings->low_phase_invert); + + /* High output settings */ + if (err == ESP_OK) err = nvs_set_i8(h, TAS5805M_NVS_KEY_BIAMP_HIGH_GAIN, settings->high_gain); + if (err == ESP_OK) err = nvs_set_u8(h, TAS5805M_NVS_KEY_BIAMP_HIGH_PHASE, settings->high_phase_invert); + + /* Per-output PEQ bands */ + for (int i = 0; i < TAS5805M_BIAMP_PEQ_BANDS && err == ESP_OK; i++) { + char key[20]; + snprintf(key, sizeof(key), "%s%d_f", TAS5805M_NVS_KEY_BIAMP_PEQ_PREFIX_L, i); + err = nvs_set_u16(h, key, settings->low_peq[i].freq); + if (err == ESP_OK) { + snprintf(key, sizeof(key), "%s%d_g", TAS5805M_NVS_KEY_BIAMP_PEQ_PREFIX_L, i); + err = nvs_set_i8(h, key, settings->low_peq[i].gain); + } + if (err == ESP_OK) { + snprintf(key, sizeof(key), "%s%d_q", TAS5805M_NVS_KEY_BIAMP_PEQ_PREFIX_L, i); + err = nvs_set_u8(h, key, settings->low_peq[i].q_x10); + } + + if (err == ESP_OK) { + snprintf(key, sizeof(key), "%s%d_f", TAS5805M_NVS_KEY_BIAMP_PEQ_PREFIX_H, i); + err = nvs_set_u16(h, key, settings->high_peq[i].freq); + } + if (err == ESP_OK) { + snprintf(key, sizeof(key), "%s%d_g", TAS5805M_NVS_KEY_BIAMP_PEQ_PREFIX_H, i); + err = nvs_set_i8(h, key, settings->high_peq[i].gain); + } + if (err == ESP_OK) { + snprintf(key, sizeof(key), "%s%d_q", TAS5805M_NVS_KEY_BIAMP_PEQ_PREFIX_H, i); + err = nvs_set_u8(h, key, settings->high_peq[i].q_x10); + } + } + + if (err == ESP_OK) err = nvs_commit(h); + nvs_close(h); + + if (err == ESP_OK) { + ESP_LOGI(TAG, "%s: Saved bi-amp settings: xover=%dHz slope=%d type=%d sr=%lu", + __func__, settings->crossover_freq, settings->slope, settings->type, (unsigned long)settings->sample_rate); + } + } else { + ESP_LOGW(TAG, "%s: Failed to open NVS namespace '%s': %s", __func__, TAS5805M_NVS_NAMESPACE, esp_err_to_name(err)); + } + + xSemaphoreGive(tas5805m_settings_mutex); + return err; +} + +/** Load advanced bi-amp settings from NVS */ +esp_err_t tas5805m_settings_load_biamp(tas5805m_biamp_settings_t *settings) { + if (!settings) return ESP_ERR_INVALID_ARG; + if (!tas5805m_settings_mutex) return ESP_ERR_INVALID_STATE; + + /* Initialize to defaults first */ + tas5805m_biamp_init_defaults(settings); + + if (xSemaphoreTake(tas5805m_settings_mutex, pdMS_TO_TICKS(5000)) != pdTRUE) { + return ESP_ERR_TIMEOUT; + } + + nvs_handle_t h; + esp_err_t err = nvs_open(TAS5805M_NVS_NAMESPACE, NVS_READONLY, &h); + if (err == ESP_OK) { + uint16_t u16val; + uint8_t u8val; + int8_t i8val; + + /* Crossover settings */ + if (nvs_get_u16(h, TAS5805M_NVS_KEY_BIAMP_XOVER_FREQ, &u16val) == ESP_OK) { + settings->crossover_freq = u16val; + } + if (nvs_get_u8(h, TAS5805M_NVS_KEY_BIAMP_SLOPE, &u8val) == ESP_OK) { + settings->slope = (tas5805m_biamp_slope_t)u8val; + } + if (nvs_get_u8(h, TAS5805M_NVS_KEY_BIAMP_TYPE, &u8val) == ESP_OK) { + settings->type = (tas5805m_biamp_type_t)u8val; + } + uint32_t u32val; + if (nvs_get_u32(h, TAS5805M_NVS_KEY_BIAMP_SAMPLE_RATE, &u32val) == ESP_OK) { + settings->sample_rate = u32val; + } + + /* Speaker protection */ + if (nvs_get_u16(h, TAS5805M_NVS_KEY_BIAMP_SUBSONIC_FREQ, &u16val) == ESP_OK) { + settings->subsonic_freq = u16val; + } + + /* Low output settings */ + if (nvs_get_i8(h, TAS5805M_NVS_KEY_BIAMP_LOW_GAIN, &i8val) == ESP_OK) { + settings->low_gain = i8val; + } + if (nvs_get_u8(h, TAS5805M_NVS_KEY_BIAMP_LOW_PHASE, &u8val) == ESP_OK) { + settings->low_phase_invert = u8val; + } + + /* High output settings */ + if (nvs_get_i8(h, TAS5805M_NVS_KEY_BIAMP_HIGH_GAIN, &i8val) == ESP_OK) { + settings->high_gain = i8val; + } + if (nvs_get_u8(h, TAS5805M_NVS_KEY_BIAMP_HIGH_PHASE, &u8val) == ESP_OK) { + settings->high_phase_invert = u8val; + } + + /* Per-output PEQ bands */ + for (int i = 0; i < TAS5805M_BIAMP_PEQ_BANDS; i++) { + char key[20]; + snprintf(key, sizeof(key), "%s%d_f", TAS5805M_NVS_KEY_BIAMP_PEQ_PREFIX_L, i); + if (nvs_get_u16(h, key, &u16val) == ESP_OK) settings->low_peq[i].freq = u16val; + snprintf(key, sizeof(key), "%s%d_g", TAS5805M_NVS_KEY_BIAMP_PEQ_PREFIX_L, i); + if (nvs_get_i8(h, key, &i8val) == ESP_OK) settings->low_peq[i].gain = i8val; + snprintf(key, sizeof(key), "%s%d_q", TAS5805M_NVS_KEY_BIAMP_PEQ_PREFIX_L, i); + if (nvs_get_u8(h, key, &u8val) == ESP_OK) settings->low_peq[i].q_x10 = u8val; + + snprintf(key, sizeof(key), "%s%d_f", TAS5805M_NVS_KEY_BIAMP_PEQ_PREFIX_H, i); + if (nvs_get_u16(h, key, &u16val) == ESP_OK) settings->high_peq[i].freq = u16val; + snprintf(key, sizeof(key), "%s%d_g", TAS5805M_NVS_KEY_BIAMP_PEQ_PREFIX_H, i); + if (nvs_get_i8(h, key, &i8val) == ESP_OK) settings->high_peq[i].gain = i8val; + snprintf(key, sizeof(key), "%s%d_q", TAS5805M_NVS_KEY_BIAMP_PEQ_PREFIX_H, i); + if (nvs_get_u8(h, key, &u8val) == ESP_OK) settings->high_peq[i].q_x10 = u8val; + } + + nvs_close(h); + ESP_LOGD(TAG, "%s: Loaded bi-amp settings: xover=%dHz slope=%d type=%d sr=%lu", + __func__, settings->crossover_freq, settings->slope, settings->type, (unsigned long)settings->sample_rate); + err = ESP_OK; + } else if (err == ESP_ERR_NVS_NOT_FOUND) { + ESP_LOGD(TAG, "%s: No bi-amp settings in NVS, using defaults", __func__); + err = ESP_OK; + } else { + ESP_LOGW(TAG, "%s: Failed to open NVS namespace '%s': %s", __func__, TAS5805M_NVS_NAMESPACE, esp_err_to_name(err)); + } + + xSemaphoreGive(tas5805m_settings_mutex); + return err; +} + +/** Apply advanced bi-amp settings to the DAC */ +esp_err_t tas5805m_settings_apply_biamp(const tas5805m_biamp_settings_t *settings) { + if (!settings) return ESP_ERR_INVALID_ARG; + + ESP_LOGI(TAG, "%s: Applying bi-amp settings", __func__); + return tas5805m_biamp_apply(settings); +} + +/* ============ Loudness Compensation Functions ============ */ + +/** Cached loudness settings (loaded at init) */ +static tas5805m_loudness_settings_t s_loudness_settings; +static int s_current_volume = 50; /* Track current volume for zone detection */ + +/** Initialize loudness settings to defaults */ +void tas5805m_loudness_init_defaults(tas5805m_loudness_settings_t *settings) { + if (!settings) return; + + settings->enabled = 0; /* Disabled by default */ + + /* Default thresholds: 20%, 40%, 60%, 80% */ + settings->thresholds[0] = 20; + settings->thresholds[1] = 40; + settings->thresholds[2] = 60; + settings->thresholds[3] = 80; + + /* Default bass boost: more at lower volumes */ + settings->bass_boost[0] = 6; /* Zone 0: 0-20% volume */ + settings->bass_boost[1] = 4; /* Zone 1: 20-40% */ + settings->bass_boost[2] = 2; /* Zone 2: 40-60% */ + settings->bass_boost[3] = 1; /* Zone 3: 60-80% */ + settings->bass_boost[4] = 0; /* Zone 4: 80-100% */ + + /* Default treble boost */ + settings->treble_boost[0] = 4; + settings->treble_boost[1] = 3; + settings->treble_boost[2] = 2; + settings->treble_boost[3] = 1; + settings->treble_boost[4] = 0; +} + +/** Save loudness settings to NVS */ +esp_err_t tas5805m_settings_save_loudness(const tas5805m_loudness_settings_t *settings) { + if (!settings) return ESP_ERR_INVALID_ARG; + if (!tas5805m_settings_mutex) return ESP_ERR_INVALID_STATE; + + if (xSemaphoreTake(tas5805m_settings_mutex, pdMS_TO_TICKS(5000)) != pdTRUE) { + return ESP_ERR_TIMEOUT; + } + + nvs_handle_t h; + esp_err_t err = nvs_open(TAS5805M_NVS_NAMESPACE, NVS_READWRITE, &h); + if (err == ESP_OK) { + err = nvs_set_u8(h, TAS5805M_NVS_KEY_LOUDNESS_ENABLED, settings->enabled); + if (err == ESP_OK) { + err = nvs_set_blob(h, TAS5805M_NVS_KEY_LOUDNESS_THRESH, + settings->thresholds, sizeof(settings->thresholds)); + } + if (err == ESP_OK) { + err = nvs_set_blob(h, TAS5805M_NVS_KEY_LOUDNESS_BASS, + settings->bass_boost, sizeof(settings->bass_boost)); + } + if (err == ESP_OK) { + err = nvs_set_blob(h, TAS5805M_NVS_KEY_LOUDNESS_TREBLE, + settings->treble_boost, sizeof(settings->treble_boost)); + } + if (err == ESP_OK) err = nvs_commit(h); + nvs_close(h); + + if (err == ESP_OK) { + /* Update cached settings */ + memcpy(&s_loudness_settings, settings, sizeof(s_loudness_settings)); + ESP_LOGI(TAG, "%s: Saved loudness settings (enabled=%d)", __func__, settings->enabled); + } + } + + xSemaphoreGive(tas5805m_settings_mutex); + return err; +} + +/** Load loudness settings from NVS */ +esp_err_t tas5805m_settings_load_loudness(tas5805m_loudness_settings_t *settings) { + if (!settings) return ESP_ERR_INVALID_ARG; + if (!tas5805m_settings_mutex) return ESP_ERR_INVALID_STATE; + + /* Initialize to defaults first */ + tas5805m_loudness_init_defaults(settings); + + if (xSemaphoreTake(tas5805m_settings_mutex, pdMS_TO_TICKS(5000)) != pdTRUE) { + return ESP_ERR_TIMEOUT; + } + + nvs_handle_t h; + esp_err_t err = nvs_open(TAS5805M_NVS_NAMESPACE, NVS_READONLY, &h); + if (err == ESP_OK) { + uint8_t enabled = 0; + if (nvs_get_u8(h, TAS5805M_NVS_KEY_LOUDNESS_ENABLED, &enabled) == ESP_OK) { + settings->enabled = enabled; + } + + size_t len = sizeof(settings->thresholds); + nvs_get_blob(h, TAS5805M_NVS_KEY_LOUDNESS_THRESH, settings->thresholds, &len); + + len = sizeof(settings->bass_boost); + nvs_get_blob(h, TAS5805M_NVS_KEY_LOUDNESS_BASS, settings->bass_boost, &len); + + len = sizeof(settings->treble_boost); + nvs_get_blob(h, TAS5805M_NVS_KEY_LOUDNESS_TREBLE, settings->treble_boost, &len); + + nvs_close(h); + ESP_LOGD(TAG, "%s: Loaded loudness settings (enabled=%d)", __func__, settings->enabled); + } else if (err == ESP_ERR_NVS_NOT_FOUND) { + ESP_LOGD(TAG, "%s: No loudness settings in NVS, using defaults", __func__); + err = ESP_OK; + } + + /* Update cached settings */ + memcpy(&s_loudness_settings, settings, sizeof(s_loudness_settings)); + + xSemaphoreGive(tas5805m_settings_mutex); + return err; +} + +/** Get current loudness zone (0-4) for a given volume (0-100) */ +int tas5805m_loudness_get_zone(int volume) { + if (volume < 0) volume = 0; + if (volume > 100) volume = 100; + + for (int i = 0; i < TAS5805M_LOUDNESS_ZONES - 1; i++) { + if (volume < s_loudness_settings.thresholds[i]) { + return i; + } + } + return TAS5805M_LOUDNESS_ZONES - 1; /* Highest zone */ +} + +/** Apply loudness compensation based on current volume */ +esp_err_t tas5805m_loudness_apply(int volume) { + if (!s_loudness_settings.enabled) { + return ESP_OK; /* Loudness disabled, nothing to do */ + } + + s_current_volume = volume; + int zone = tas5805m_loudness_get_zone(volume); + int8_t bass_db = s_loudness_settings.bass_boost[zone]; + int8_t treble_db = s_loudness_settings.treble_boost[zone]; + + ESP_LOGI(TAG, "%s: Volume=%d%% Zone=%d Bass=%+ddB Treble=%+ddB", + __func__, volume, zone, bass_db, treble_db); + + /* Get current sample rate from bi-amp settings or use default */ + float fs = 48000.0f; /* Default sample rate */ + tas5805m_biamp_settings_t biamp; + if (tas5805m_settings_load_biamp(&biamp) == ESP_OK && biamp.sample_rate > 0) { + fs = (float)biamp.sample_rate; + } + + tas5805m_biquad_coeffs_t coeffs; + esp_err_t ret; + + /* Apply low shelf for bass boost (200 Hz) - LEFT channel only (woofer in bi-amp) */ + ret = tas5805m_calc_low_shelf(200.0f, (float)bass_db, fs, &coeffs); + if (ret == ESP_OK) { + ret = tas5805m_write_biquad_coefficients(TAS5805M_EQ_CHANNELS_LEFT, + TAS5805M_LOUDNESS_BASS_BAND, + coeffs.b0, coeffs.b1, coeffs.b2, + coeffs.a1, coeffs.a2); + } + if (ret != ESP_OK) { + ESP_LOGW(TAG, "%s: Failed to apply bass shelf to woofer", __func__); + } + + /* Apply high shelf for treble boost (4000 Hz) - RIGHT channel only (tweeter in bi-amp) */ + ret = tas5805m_calc_high_shelf(4000.0f, (float)treble_db, fs, &coeffs); + if (ret == ESP_OK) { + ret = tas5805m_write_biquad_coefficients(TAS5805M_EQ_CHANNELS_RIGHT, + TAS5805M_LOUDNESS_TREBLE_BAND, + coeffs.b0, coeffs.b1, coeffs.b2, + coeffs.a1, coeffs.a2); + } + if (ret != ESP_OK) { + ESP_LOGW(TAG, "%s: Failed to apply treble shelf to tweeter", __func__); + } + + return ESP_OK; +} + /** Load EQ mode from NVS */ esp_err_t tas5805m_settings_load_eq_mode(TAS5805M_EQ_MODE *mode) { if (!mode) return ESP_ERR_INVALID_ARG; @@ -2267,8 +2620,47 @@ esp_err_t tas5805m_settings_get_eq_schema_json(char *json_out, size_t max_len) { cJSON *groups = cJSON_CreateArray(); - // ===== Channel Gain Group (always visible, first in EQ schema) ===== + /* Load UI mode early so it can be used to conditionally include groups */ + TAS5805M_EQ_UI_MODE ui_mode = TAS5805M_EQ_UI_MODE_OFF; + tas5805m_settings_load_eq_ui_mode(&ui_mode); + +#if defined(CONFIG_DAC_TAS5805M_EQ_SUPPORT) + // ===== EQ Mode Group (first in schema as requested) ===== { + TAS5805M_EQ_MODE eq_mode_val = TAS5805M_EQ_MODE_OFF; + tas5805m_get_eq_mode(&eq_mode_val); + + cJSON *eq_mode_group = cJSON_CreateObject(); + cJSON_AddStringToObject(eq_mode_group, "name", "EQ Mode"); + cJSON_AddStringToObject(eq_mode_group, "description", "Equalizer operation mode"); + + cJSON *eq_mode_params = cJSON_CreateArray(); + + cJSON *eq_ui_mode_param = cJSON_CreateObject(); + cJSON_AddStringToObject(eq_ui_mode_param, "key", "eq_ui_mode"); + cJSON_AddStringToObject(eq_ui_mode_param, "name", "EQ Mode"); + cJSON_AddStringToObject(eq_ui_mode_param, "type", "enum"); + + cJSON_AddNumberToObject(eq_ui_mode_param, "current", (int)ui_mode); + + cJSON *eq_ui_mode_values = cJSON_CreateArray(); + const char *ui_mode_names[] = {"Off", "15-Band", "15-Band Bi-Amp", "Presets", "Advanced Bi-Amp"}; + for (int i = 0; i <= TAS5805M_EQ_UI_MODE_ADVANCED_BIAMP; ++i) { + cJSON *val = cJSON_CreateObject(); + cJSON_AddNumberToObject(val, "value", i); + cJSON_AddStringToObject(val, "name", ui_mode_names[i]); + cJSON_AddItemToArray(eq_ui_mode_values, val); + } + cJSON_AddItemToObject(eq_ui_mode_param, "values", eq_ui_mode_values); + cJSON_AddItemToArray(eq_mode_params, eq_ui_mode_param); + + cJSON_AddItemToObject(eq_mode_group, "parameters", eq_mode_params); + cJSON_AddItemToArray(groups, eq_mode_group); + } +#endif + + // ===== Channel Gain Group (hidden in Advanced Bi-Amp mode - uses Low/High gains instead) ===== + if (ui_mode != TAS5805M_EQ_UI_MODE_ADVANCED_BIAMP) { cJSON *ch_group = cJSON_CreateObject(); cJSON_AddStringToObject(ch_group, "name", "Channel Gain"); cJSON_AddStringToObject(ch_group, "description", "Per-channel mixer gain control"); @@ -2329,40 +2721,6 @@ esp_err_t tas5805m_settings_get_eq_schema_json(char *json_out, size_t max_len) { } #if defined(CONFIG_DAC_TAS5805M_EQ_SUPPORT) - // Get current EQ mode - TAS5805M_EQ_MODE eq_mode_val = TAS5805M_EQ_MODE_OFF; - tas5805m_get_eq_mode(&eq_mode_val); - - // EQ Mode Group - cJSON *eq_mode_group = cJSON_CreateObject(); - cJSON_AddStringToObject(eq_mode_group, "name", "EQ Mode"); - cJSON_AddStringToObject(eq_mode_group, "description", "Equalizer operation mode"); - - cJSON *eq_mode_params = cJSON_CreateArray(); - - cJSON *eq_ui_mode_param = cJSON_CreateObject(); - cJSON_AddStringToObject(eq_ui_mode_param, "key", "eq_ui_mode"); - cJSON_AddStringToObject(eq_ui_mode_param, "name", "EQ UI Mode"); - cJSON_AddStringToObject(eq_ui_mode_param, "type", "enum"); - - TAS5805M_EQ_UI_MODE ui_mode = TAS5805M_EQ_UI_MODE_OFF; - tas5805m_settings_load_eq_ui_mode(&ui_mode); - cJSON_AddNumberToObject(eq_ui_mode_param, "current", (int)ui_mode); - - cJSON *eq_ui_mode_values = cJSON_CreateArray(); - const char *ui_mode_names[] = {"Off", "15-Band", "15-Band Bi-Amp", "Presets"}; - for (int i = 0; i <= TAS5805M_EQ_UI_MODE_PRESETS; ++i) { - cJSON *val = cJSON_CreateObject(); - cJSON_AddNumberToObject(val, "value", i); - cJSON_AddStringToObject(val, "name", ui_mode_names[i]); - cJSON_AddItemToArray(eq_ui_mode_values, val); - } - cJSON_AddItemToObject(eq_ui_mode_param, "values", eq_ui_mode_values); - cJSON_AddItemToArray(eq_mode_params, eq_ui_mode_param); - - cJSON_AddItemToObject(eq_mode_group, "parameters", eq_mode_params); - cJSON_AddItemToArray(groups, eq_mode_group); - /* Create main EQ group and parameters array so subsequent blocks can * append parameters (presets, profiles, etc.). This mirrors the DAC * schema layout and ensures `eq_params` is defined before use. */ @@ -2572,6 +2930,366 @@ esp_err_t tas5805m_settings_get_eq_schema_json(char *json_out, size_t max_len) { cJSON_AddItemToArray(groups, eq_bands_right); #endif + /* ===== Advanced Bi-Amp Crossover Group (only shown in Advanced Bi-Amp mode) ===== */ + if (ui_mode == TAS5805M_EQ_UI_MODE_ADVANCED_BIAMP) { + tas5805m_biamp_settings_t biamp; + tas5805m_settings_load_biamp(&biamp); + tas5805m_loudness_settings_t loudness; + tas5805m_settings_load_loudness(&loudness); + + cJSON *biamp_group = cJSON_CreateObject(); + cJSON_AddStringToObject(biamp_group, "name", "Advanced Bi-Amp Crossover"); + cJSON_AddStringToObject(biamp_group, "description", "Configure active crossover with per-output PEQ and gain"); + cJSON_AddStringToObject(biamp_group, "layout", "biamp-crossover"); + + cJSON *sections = cJSON_CreateArray(); + + /* === Section 1: Crossover Settings === */ + { + cJSON *xover_section = cJSON_CreateObject(); + cJSON_AddStringToObject(xover_section, "name", "Crossover Settings"); + cJSON_AddStringToObject(xover_section, "layout", "form"); + cJSON *xover_params = cJSON_CreateArray(); + + cJSON *xover_freq = cJSON_CreateObject(); + cJSON_AddStringToObject(xover_freq, "key", "biamp_xover_freq"); + cJSON_AddStringToObject(xover_freq, "name", "Frequency"); + cJSON_AddStringToObject(xover_freq, "type", "range"); + cJSON_AddStringToObject(xover_freq, "unit", "Hz"); + cJSON_AddNumberToObject(xover_freq, "min", 20); + cJSON_AddNumberToObject(xover_freq, "max", 20000); + cJSON_AddNumberToObject(xover_freq, "step", 10); + cJSON_AddNumberToObject(xover_freq, "current", biamp.crossover_freq); + cJSON_AddItemToArray(xover_params, xover_freq); + + cJSON *slope = cJSON_CreateObject(); + cJSON_AddStringToObject(slope, "key", "biamp_slope"); + cJSON_AddStringToObject(slope, "name", "Slope"); + cJSON_AddStringToObject(slope, "type", "enum"); + cJSON_AddNumberToObject(slope, "current", (int)biamp.slope); + cJSON *slope_vals = cJSON_CreateArray(); + cJSON *sv; + sv = cJSON_CreateObject(); cJSON_AddNumberToObject(sv, "value", BIAMP_SLOPE_12DB); cJSON_AddStringToObject(sv, "name", "12 dB/oct"); cJSON_AddItemToArray(slope_vals, sv); + sv = cJSON_CreateObject(); cJSON_AddNumberToObject(sv, "value", BIAMP_SLOPE_24DB); cJSON_AddStringToObject(sv, "name", "24 dB/oct (LR)"); cJSON_AddItemToArray(slope_vals, sv); + sv = cJSON_CreateObject(); cJSON_AddNumberToObject(sv, "value", BIAMP_SLOPE_48DB); cJSON_AddStringToObject(sv, "name", "48 dB/oct"); cJSON_AddItemToArray(slope_vals, sv); + cJSON_AddItemToObject(slope, "values", slope_vals); + cJSON_AddItemToArray(xover_params, slope); + + cJSON *xtype = cJSON_CreateObject(); + cJSON_AddStringToObject(xtype, "key", "biamp_type"); + cJSON_AddStringToObject(xtype, "name", "Type"); + cJSON_AddStringToObject(xtype, "type", "enum"); + cJSON_AddNumberToObject(xtype, "current", (int)biamp.type); + cJSON *type_vals = cJSON_CreateArray(); + cJSON *tv; + tv = cJSON_CreateObject(); cJSON_AddNumberToObject(tv, "value", BIAMP_TYPE_BUTTERWORTH); cJSON_AddStringToObject(tv, "name", "Butterworth"); cJSON_AddItemToArray(type_vals, tv); + tv = cJSON_CreateObject(); cJSON_AddNumberToObject(tv, "value", BIAMP_TYPE_LINKWITZ_RILEY); cJSON_AddStringToObject(tv, "name", "Linkwitz-Riley"); cJSON_AddItemToArray(type_vals, tv); + cJSON_AddItemToObject(xtype, "values", type_vals); + cJSON_AddItemToArray(xover_params, xtype); + + cJSON *sr = cJSON_CreateObject(); + cJSON_AddStringToObject(sr, "key", "biamp_sample_rate"); + cJSON_AddStringToObject(sr, "name", "Sample Rate"); + cJSON_AddStringToObject(sr, "type", "enum"); + cJSON_AddNumberToObject(sr, "current", (int)biamp.sample_rate); + cJSON *sr_vals = cJSON_CreateArray(); + cJSON *srv; + srv = cJSON_CreateObject(); cJSON_AddNumberToObject(srv, "value", BIAMP_SAMPLE_RATE_44100); cJSON_AddStringToObject(srv, "name", "44.1 kHz"); cJSON_AddItemToArray(sr_vals, srv); + srv = cJSON_CreateObject(); cJSON_AddNumberToObject(srv, "value", BIAMP_SAMPLE_RATE_48000); cJSON_AddStringToObject(srv, "name", "48 kHz"); cJSON_AddItemToArray(sr_vals, srv); + srv = cJSON_CreateObject(); cJSON_AddNumberToObject(srv, "value", BIAMP_SAMPLE_RATE_88200); cJSON_AddStringToObject(srv, "name", "88.2 kHz"); cJSON_AddItemToArray(sr_vals, srv); + srv = cJSON_CreateObject(); cJSON_AddNumberToObject(srv, "value", BIAMP_SAMPLE_RATE_96000); cJSON_AddStringToObject(srv, "name", "96 kHz"); cJSON_AddItemToArray(sr_vals, srv); + cJSON_AddItemToObject(sr, "values", sr_vals); + cJSON_AddItemToArray(xover_params, sr); + + cJSON_AddItemToObject(xover_section, "parameters", xover_params); + cJSON_AddItemToArray(sections, xover_section); + } + + /* === Section 2: Low/High Output Columns === */ + { + cJSON *columns_section = cJSON_CreateObject(); + cJSON *columns = cJSON_CreateArray(); + + /* Low Output (Woofer) Column */ + cJSON *low_col = cJSON_CreateObject(); + cJSON_AddStringToObject(low_col, "name", "Low Output (Woofer)"); + cJSON_AddStringToObject(low_col, "layout", "output-channel"); + cJSON *low_params = cJSON_CreateArray(); + + /* Gain slider */ + cJSON *low_gain = cJSON_CreateObject(); + cJSON_AddStringToObject(low_gain, "key", "biamp_low_gain"); + cJSON_AddStringToObject(low_gain, "label", "Gain"); + cJSON_AddStringToObject(low_gain, "name", "Output Gain"); + cJSON_AddStringToObject(low_gain, "type", "range"); + cJSON_AddStringToObject(low_gain, "unit", "dB"); + cJSON_AddNumberToObject(low_gain, "min", -24); + cJSON_AddNumberToObject(low_gain, "max", 24); + cJSON_AddNumberToObject(low_gain, "step", 1); + cJSON_AddNumberToObject(low_gain, "current", biamp.low_gain); + cJSON_AddItemToArray(low_params, low_gain); + + /* Subsonic HPF slider (woofer only) */ + cJSON *subsonic = cJSON_CreateObject(); + cJSON_AddStringToObject(subsonic, "key", "biamp_subsonic_freq"); + cJSON_AddStringToObject(subsonic, "label", "Subsonic"); + cJSON_AddStringToObject(subsonic, "name", "Subsonic HPF"); + cJSON_AddStringToObject(subsonic, "type", "range"); + cJSON_AddStringToObject(subsonic, "unit", "Hz"); + cJSON_AddNumberToObject(subsonic, "min", 0); + cJSON_AddNumberToObject(subsonic, "max", 80); + cJSON_AddNumberToObject(subsonic, "step", 5); + cJSON_AddNumberToObject(subsonic, "current", biamp.subsonic_freq); + cJSON_AddItemToArray(low_params, subsonic); + + /* PEQ bands as subgroups */ + for (int i = 0; i < TAS5805M_BIAMP_PEQ_BANDS; i++) { + char key[32], label[32]; + cJSON *peq_group = cJSON_CreateObject(); + snprintf(label, sizeof(label), "PEQ %d", i + 1); + cJSON_AddStringToObject(peq_group, "name", label); + cJSON_AddStringToObject(peq_group, "type", "peq-subgroup"); + cJSON *peq_params = cJSON_CreateArray(); + + /* Frequency */ + snprintf(key, sizeof(key), "biamp_low_peq%d_freq", i); + cJSON *freq = cJSON_CreateObject(); + cJSON_AddStringToObject(freq, "key", key); + cJSON_AddStringToObject(freq, "name", "Freq"); + cJSON_AddStringToObject(freq, "type", "range"); + cJSON_AddStringToObject(freq, "unit", "Hz"); + cJSON_AddNumberToObject(freq, "min", 20); + cJSON_AddNumberToObject(freq, "max", 20000); + cJSON_AddNumberToObject(freq, "step", 10); + cJSON_AddNumberToObject(freq, "current", biamp.low_peq[i].freq); + cJSON_AddItemToArray(peq_params, freq); + + /* Gain */ + snprintf(key, sizeof(key), "biamp_low_peq%d_gain", i); + cJSON *gain = cJSON_CreateObject(); + cJSON_AddStringToObject(gain, "key", key); + cJSON_AddStringToObject(gain, "name", "Gain"); + cJSON_AddStringToObject(gain, "type", "range"); + cJSON_AddStringToObject(gain, "unit", "dB"); + cJSON_AddNumberToObject(gain, "min", -15); + cJSON_AddNumberToObject(gain, "max", 15); + cJSON_AddNumberToObject(gain, "step", 1); + cJSON_AddNumberToObject(gain, "current", biamp.low_peq[i].gain); + cJSON_AddItemToArray(peq_params, gain); + + /* Q factor (stored as q_x10, display as float) */ + snprintf(key, sizeof(key), "biamp_low_peq%d_q", i); + cJSON *q = cJSON_CreateObject(); + cJSON_AddStringToObject(q, "key", key); + cJSON_AddStringToObject(q, "name", "Q"); + cJSON_AddStringToObject(q, "type", "range"); + cJSON_AddNumberToObject(q, "min", 0.5); + cJSON_AddNumberToObject(q, "max", 10.0); + cJSON_AddNumberToObject(q, "step", 0.1); + cJSON_AddNumberToObject(q, "decimals", 1); + cJSON_AddNumberToObject(q, "current", biamp.low_peq[i].q_x10 / 10.0); + cJSON_AddItemToArray(peq_params, q); + + cJSON_AddItemToObject(peq_group, "parameters", peq_params); + cJSON_AddItemToArray(low_params, peq_group); + } + + /* Phase at the end */ + cJSON *low_phase = cJSON_CreateObject(); + cJSON_AddStringToObject(low_phase, "key", "biamp_low_phase"); + cJSON_AddStringToObject(low_phase, "name", "Phase"); + cJSON_AddStringToObject(low_phase, "type", "radio"); + cJSON_AddNumberToObject(low_phase, "current", biamp.low_phase_invert); + cJSON *lp_vals = cJSON_CreateArray(); + cJSON *lpv; + lpv = cJSON_CreateObject(); cJSON_AddNumberToObject(lpv, "value", 0); cJSON_AddStringToObject(lpv, "name", "Normal"); cJSON_AddItemToArray(lp_vals, lpv); + lpv = cJSON_CreateObject(); cJSON_AddNumberToObject(lpv, "value", 1); cJSON_AddStringToObject(lpv, "name", "Invert"); cJSON_AddItemToArray(lp_vals, lpv); + cJSON_AddItemToObject(low_phase, "values", lp_vals); + cJSON_AddItemToArray(low_params, low_phase); + + cJSON_AddItemToObject(low_col, "parameters", low_params); + cJSON_AddItemToArray(columns, low_col); + + /* High Output (Tweeter) Column */ + cJSON *high_col = cJSON_CreateObject(); + cJSON_AddStringToObject(high_col, "name", "High Output (Tweeter)"); + cJSON_AddStringToObject(high_col, "layout", "output-channel"); + cJSON *high_params = cJSON_CreateArray(); + + /* Gain slider */ + cJSON *high_gain = cJSON_CreateObject(); + cJSON_AddStringToObject(high_gain, "key", "biamp_high_gain"); + cJSON_AddStringToObject(high_gain, "label", "Gain"); + cJSON_AddStringToObject(high_gain, "name", "Output Gain"); + cJSON_AddStringToObject(high_gain, "type", "range"); + cJSON_AddStringToObject(high_gain, "unit", "dB"); + cJSON_AddNumberToObject(high_gain, "min", -24); + cJSON_AddNumberToObject(high_gain, "max", 24); + cJSON_AddNumberToObject(high_gain, "step", 1); + cJSON_AddNumberToObject(high_gain, "current", biamp.high_gain); + cJSON_AddItemToArray(high_params, high_gain); + + /* PEQ bands as subgroups */ + for (int i = 0; i < TAS5805M_BIAMP_PEQ_BANDS; i++) { + char key[32], label[32]; + cJSON *peq_group = cJSON_CreateObject(); + snprintf(label, sizeof(label), "PEQ %d", i + 1); + cJSON_AddStringToObject(peq_group, "name", label); + cJSON_AddStringToObject(peq_group, "type", "peq-subgroup"); + cJSON *peq_params = cJSON_CreateArray(); + + /* Frequency */ + snprintf(key, sizeof(key), "biamp_high_peq%d_freq", i); + cJSON *freq = cJSON_CreateObject(); + cJSON_AddStringToObject(freq, "key", key); + cJSON_AddStringToObject(freq, "name", "Freq"); + cJSON_AddStringToObject(freq, "type", "range"); + cJSON_AddStringToObject(freq, "unit", "Hz"); + cJSON_AddNumberToObject(freq, "min", 20); + cJSON_AddNumberToObject(freq, "max", 20000); + cJSON_AddNumberToObject(freq, "step", 10); + cJSON_AddNumberToObject(freq, "current", biamp.high_peq[i].freq); + cJSON_AddItemToArray(peq_params, freq); + + /* Gain */ + snprintf(key, sizeof(key), "biamp_high_peq%d_gain", i); + cJSON *gain = cJSON_CreateObject(); + cJSON_AddStringToObject(gain, "key", key); + cJSON_AddStringToObject(gain, "name", "Gain"); + cJSON_AddStringToObject(gain, "type", "range"); + cJSON_AddStringToObject(gain, "unit", "dB"); + cJSON_AddNumberToObject(gain, "min", -15); + cJSON_AddNumberToObject(gain, "max", 15); + cJSON_AddNumberToObject(gain, "step", 1); + cJSON_AddNumberToObject(gain, "current", biamp.high_peq[i].gain); + cJSON_AddItemToArray(peq_params, gain); + + /* Q factor (stored as q_x10, display as float) */ + snprintf(key, sizeof(key), "biamp_high_peq%d_q", i); + cJSON *q = cJSON_CreateObject(); + cJSON_AddStringToObject(q, "key", key); + cJSON_AddStringToObject(q, "name", "Q"); + cJSON_AddStringToObject(q, "type", "range"); + cJSON_AddNumberToObject(q, "min", 0.5); + cJSON_AddNumberToObject(q, "max", 10.0); + cJSON_AddNumberToObject(q, "step", 0.1); + cJSON_AddNumberToObject(q, "decimals", 1); + cJSON_AddNumberToObject(q, "current", biamp.high_peq[i].q_x10 / 10.0); + cJSON_AddItemToArray(peq_params, q); + + cJSON_AddItemToObject(peq_group, "parameters", peq_params); + cJSON_AddItemToArray(high_params, peq_group); + } + + /* Phase at the end */ + cJSON *high_phase = cJSON_CreateObject(); + cJSON_AddStringToObject(high_phase, "key", "biamp_high_phase"); + cJSON_AddStringToObject(high_phase, "name", "Phase"); + cJSON_AddStringToObject(high_phase, "type", "radio"); + cJSON_AddNumberToObject(high_phase, "current", biamp.high_phase_invert); + cJSON *hp_vals = cJSON_CreateArray(); + cJSON *hpv; + hpv = cJSON_CreateObject(); cJSON_AddNumberToObject(hpv, "value", 0); cJSON_AddStringToObject(hpv, "name", "Normal"); cJSON_AddItemToArray(hp_vals, hpv); + hpv = cJSON_CreateObject(); cJSON_AddNumberToObject(hpv, "value", 1); cJSON_AddStringToObject(hpv, "name", "Invert"); cJSON_AddItemToArray(hp_vals, hpv); + cJSON_AddItemToObject(high_phase, "values", hp_vals); + cJSON_AddItemToArray(high_params, high_phase); + + cJSON_AddItemToObject(high_col, "parameters", high_params); + cJSON_AddItemToArray(columns, high_col); + + cJSON_AddItemToObject(columns_section, "columns", columns); + cJSON_AddItemToArray(sections, columns_section); + } + + /* === Section 3: Loudness Compensation === */ + { + cJSON *loud_section = cJSON_CreateObject(); + cJSON_AddStringToObject(loud_section, "name", "Loudness Compensation"); + cJSON_AddStringToObject(loud_section, "layout", "loudness"); + cJSON *loud_params = cJSON_CreateArray(); + + /* Enabled toggle (always visible) */ + cJSON *loud_en = cJSON_CreateObject(); + cJSON_AddStringToObject(loud_en, "key", "loudness_enabled"); + cJSON_AddStringToObject(loud_en, "name", "Enable"); + cJSON_AddStringToObject(loud_en, "type", "enum"); + cJSON_AddNumberToObject(loud_en, "current", loudness.enabled); + cJSON *loud_en_vals = cJSON_CreateArray(); + cJSON *lev; + lev = cJSON_CreateObject(); cJSON_AddNumberToObject(lev, "value", 0); cJSON_AddStringToObject(lev, "name", "Off"); cJSON_AddItemToArray(loud_en_vals, lev); + lev = cJSON_CreateObject(); cJSON_AddNumberToObject(lev, "value", 1); cJSON_AddStringToObject(lev, "name", "On"); cJSON_AddItemToArray(loud_en_vals, lev); + cJSON_AddItemToObject(loud_en, "values", loud_en_vals); + cJSON_AddItemToArray(loud_params, loud_en); + + /* visibleWhen object for conditional params */ + cJSON *visibleWhen = cJSON_CreateObject(); + cJSON_AddNumberToObject(visibleWhen, "loudness_enabled", 1); + + /* Volume thresholds (hidden when off) */ + for (int i = 0; i < TAS5805M_LOUDNESS_ZONES - 1; i++) { + char lkey[24], lname[32]; + snprintf(lkey, sizeof(lkey), "loudness_thresh_%d", i); + snprintf(lname, sizeof(lname), "Zone %d Thresh", i + 1); + cJSON *thresh = cJSON_CreateObject(); + cJSON_AddStringToObject(thresh, "key", lkey); + cJSON_AddStringToObject(thresh, "name", lname); + cJSON_AddStringToObject(thresh, "type", "range"); + cJSON_AddStringToObject(thresh, "unit", "%"); + cJSON_AddNumberToObject(thresh, "min", 0); + cJSON_AddNumberToObject(thresh, "max", 100); + cJSON_AddNumberToObject(thresh, "step", 5); + cJSON_AddNumberToObject(thresh, "current", loudness.thresholds[i]); + cJSON_AddItemToObject(thresh, "visibleWhen", cJSON_Duplicate(visibleWhen, 1)); + cJSON_AddItemToArray(loud_params, thresh); + } + + /* Bass boost per zone (hidden when off) */ + for (int i = 0; i < TAS5805M_LOUDNESS_ZONES; i++) { + char lkey[24], lname[32]; + snprintf(lkey, sizeof(lkey), "loudness_bass_%d", i); + snprintf(lname, sizeof(lname), "Z%d Bass", i + 1); + cJSON *bass = cJSON_CreateObject(); + cJSON_AddStringToObject(bass, "key", lkey); + cJSON_AddStringToObject(bass, "label", lname); + cJSON_AddStringToObject(bass, "name", lname); + cJSON_AddStringToObject(bass, "type", "range"); + cJSON_AddStringToObject(bass, "unit", "dB"); + cJSON_AddNumberToObject(bass, "min", -12); + cJSON_AddNumberToObject(bass, "max", 12); + cJSON_AddNumberToObject(bass, "step", 1); + cJSON_AddNumberToObject(bass, "current", loudness.bass_boost[i]); + cJSON_AddItemToObject(bass, "visibleWhen", cJSON_Duplicate(visibleWhen, 1)); + cJSON_AddItemToArray(loud_params, bass); + } + + /* Treble boost per zone (hidden when off) */ + for (int i = 0; i < TAS5805M_LOUDNESS_ZONES; i++) { + char lkey[24], lname[32]; + snprintf(lkey, sizeof(lkey), "loudness_treble_%d", i); + snprintf(lname, sizeof(lname), "Z%d Treble", i + 1); + cJSON *treble = cJSON_CreateObject(); + cJSON_AddStringToObject(treble, "key", lkey); + cJSON_AddStringToObject(treble, "label", lname); + cJSON_AddStringToObject(treble, "name", lname); + cJSON_AddStringToObject(treble, "type", "range"); + cJSON_AddStringToObject(treble, "unit", "dB"); + cJSON_AddNumberToObject(treble, "min", -12); + cJSON_AddNumberToObject(treble, "max", 12); + cJSON_AddNumberToObject(treble, "step", 1); + cJSON_AddNumberToObject(treble, "current", loudness.treble_boost[i]); + cJSON_AddItemToObject(treble, "visibleWhen", cJSON_Duplicate(visibleWhen, 1)); + cJSON_AddItemToArray(loud_params, treble); + } + + cJSON_Delete(visibleWhen); + cJSON_AddItemToObject(loud_section, "parameters", loud_params); + cJSON_AddItemToArray(sections, loud_section); + } + + cJSON_AddItemToObject(biamp_group, "sections", sections); + cJSON_AddItemToArray(groups, biamp_group); + } + cJSON_AddItemToObject(root, "groups", groups); // Render to string @@ -2749,11 +3467,25 @@ esp_err_t tas5805m_settings_apply_delayed(void) { ESP_LOGI(TAG, "%s: Restored Channel Gain R = %d dB", __func__, ch_gain); } } + } else if (ui_mode == TAS5805M_EQ_UI_MODE_ADVANCED_BIAMP) { + // Apply persisted advanced bi-amp crossover settings + tas5805m_biamp_settings_t biamp; + if (tas5805m_settings_load_biamp(&biamp) == ESP_OK) { + ESP_LOGI(TAG, "%s: Restoring advanced bi-amp settings: xover=%dHz slope=%d", + __func__, biamp.crossover_freq, biamp.slope); + if (tas5805m_settings_apply_biamp(&biamp) != ESP_OK) { + ESP_LOGW(TAG, "%s: Failed to apply saved bi-amp settings", __func__); + } else { + ESP_LOGI(TAG, "%s: Restored advanced bi-amp crossover", __func__); + } + } } - - // Restore channel gain for all EQ modes (not just presets) + + // Restore channel gain for all EQ modes (not just presets and advanced biamp) // Channel gain is independent of EQ band settings - if (ui_mode != TAS5805M_EQ_UI_MODE_OFF && ui_mode != TAS5805M_EQ_UI_MODE_PRESETS) { + // Note: Advanced Bi-Amp handles its own gains internally via crossover filters + if (ui_mode != TAS5805M_EQ_UI_MODE_OFF && ui_mode != TAS5805M_EQ_UI_MODE_PRESETS && + ui_mode != TAS5805M_EQ_UI_MODE_ADVANCED_BIAMP) { int ch_gain = 0; if (tas5805m_settings_load_channel_gain(TAS5805M_EQ_CHANNELS_LEFT, &ch_gain) == ESP_OK) { if (tas5805m_set_channel_gain(TAS5805M_EQ_CHANNELS_LEFT, (int8_t)ch_gain) != ESP_OK) { @@ -2770,6 +3502,15 @@ esp_err_t tas5805m_settings_apply_delayed(void) { } } } + + /* Load and apply loudness compensation settings */ + tas5805m_loudness_settings_t loudness; + if (tas5805m_settings_load_loudness(&loudness) == ESP_OK && loudness.enabled) { + int vol = 50; + tas5805m_get_volume(&vol); + ESP_LOGI(TAG, "%s: Restoring loudness compensation (enabled=%d, vol=%d%%)", __func__, loudness.enabled, vol); + tas5805m_loudness_apply(vol); + } #endif ESP_LOGI(TAG, "%s: Delayed persisted settings application complete", __func__); @@ -3215,7 +3956,14 @@ esp_err_t tas5805m_settings_set_eq_from_json(const char *json_in) { ESP_LOGI(TAG, "%s: Applying saved preset right=%d", __func__, (int)prof_r); tas5805m_set_eq_profile_channel(TAS5805M_EQ_CHANNELS_RIGHT, prof_r); } - } + } else if (ui_mode == TAS5805M_EQ_UI_MODE_ADVANCED_BIAMP) { + // Apply saved advanced bi-amp crossover settings + tas5805m_biamp_settings_t biamp; + if (tas5805m_settings_load_biamp(&biamp) == ESP_OK) { + ESP_LOGI(TAG, "%s: Applying saved advanced bi-amp settings", __func__); + tas5805m_settings_apply_biamp(&biamp); + } + } } else if (strcmp(key, "eq_profile_l") == 0 && cJSON_IsNumber(item)) { TAS5805M_EQ_PROFILE prof = (TAS5805M_EQ_PROFILE)item->valueint; @@ -3259,6 +4007,142 @@ esp_err_t tas5805m_settings_set_eq_from_json(const char *json_in) { tas5805m_settings_save_eq_gain(TAS5805M_EQ_CHANNELS_RIGHT, band, gain); } } + /* Advanced Bi-Amp parameter handling */ + else if (strncmp(key, "biamp_", 6) == 0 && cJSON_IsNumber(item)) { + /* Load current settings, modify, save, and apply */ + tas5805m_biamp_settings_t biamp; + tas5805m_settings_load_biamp(&biamp); + bool modified = false; + + if (strcmp(key, "biamp_xover_freq") == 0) { + biamp.crossover_freq = (uint16_t)item->valueint; + modified = true; + ESP_LOGI(TAG, "%s: Setting bi-amp crossover freq to %d Hz", __func__, biamp.crossover_freq); + } else if (strcmp(key, "biamp_slope") == 0) { + biamp.slope = (tas5805m_biamp_slope_t)item->valueint; + modified = true; + ESP_LOGI(TAG, "%s: Setting bi-amp slope to %d", __func__, biamp.slope); + } else if (strcmp(key, "biamp_type") == 0) { + biamp.type = (tas5805m_biamp_type_t)item->valueint; + modified = true; + ESP_LOGI(TAG, "%s: Setting bi-amp type to %d", __func__, biamp.type); + } else if (strcmp(key, "biamp_sample_rate") == 0) { + biamp.sample_rate = (uint32_t)item->valueint; + modified = true; + ESP_LOGI(TAG, "%s: Setting bi-amp sample rate to %lu Hz", __func__, (unsigned long)biamp.sample_rate); + } else if (strcmp(key, "biamp_subsonic_freq") == 0) { + biamp.subsonic_freq = (uint16_t)item->valueint; + modified = true; + ESP_LOGI(TAG, "%s: Setting bi-amp subsonic filter to %d Hz", __func__, biamp.subsonic_freq); + } else if (strcmp(key, "biamp_low_gain") == 0) { + biamp.low_gain = (int8_t)item->valueint; + modified = true; + ESP_LOGI(TAG, "%s: Setting bi-amp low gain to %d dB", __func__, biamp.low_gain); + } else if (strcmp(key, "biamp_low_phase") == 0) { + biamp.low_phase_invert = (uint8_t)item->valueint; + modified = true; + ESP_LOGI(TAG, "%s: Setting bi-amp low phase to %d", __func__, biamp.low_phase_invert); + } else if (strcmp(key, "biamp_high_gain") == 0) { + biamp.high_gain = (int8_t)item->valueint; + modified = true; + ESP_LOGI(TAG, "%s: Setting bi-amp high gain to %d dB", __func__, biamp.high_gain); + } else if (strcmp(key, "biamp_high_phase") == 0) { + biamp.high_phase_invert = (uint8_t)item->valueint; + modified = true; + ESP_LOGI(TAG, "%s: Setting bi-amp high phase to %d", __func__, biamp.high_phase_invert); + } + /* Low output PEQ bands */ + else if (strncmp(key, "biamp_low_peq", 13) == 0) { + int peq_idx = key[13] - '0'; + if (peq_idx >= 0 && peq_idx < TAS5805M_BIAMP_PEQ_BANDS) { + if (strstr(key, "_freq") != NULL) { + biamp.low_peq[peq_idx].freq = (uint16_t)item->valueint; + modified = true; + ESP_LOGI(TAG, "%s: Setting bi-amp low PEQ %d freq to %d Hz", __func__, peq_idx, biamp.low_peq[peq_idx].freq); + } else if (strstr(key, "_gain") != NULL) { + biamp.low_peq[peq_idx].gain = (int8_t)item->valueint; + modified = true; + ESP_LOGI(TAG, "%s: Setting bi-amp low PEQ %d gain to %d dB", __func__, peq_idx, biamp.low_peq[peq_idx].gain); + } else if (strstr(key, "_q") != NULL) { + /* Q value comes as float (0.5-10.0), convert to q_x10 (5-100) */ + biamp.low_peq[peq_idx].q_x10 = (uint8_t)(item->valuedouble * 10.0 + 0.5); + modified = true; + ESP_LOGI(TAG, "%s: Setting bi-amp low PEQ %d Q to %.1f (q_x10=%d)", __func__, peq_idx, item->valuedouble, biamp.low_peq[peq_idx].q_x10); + } + } + } + /* High output PEQ bands */ + else if (strncmp(key, "biamp_high_peq", 14) == 0) { + int peq_idx = key[14] - '0'; + if (peq_idx >= 0 && peq_idx < TAS5805M_BIAMP_PEQ_BANDS) { + if (strstr(key, "_freq") != NULL) { + biamp.high_peq[peq_idx].freq = (uint16_t)item->valueint; + modified = true; + ESP_LOGI(TAG, "%s: Setting bi-amp high PEQ %d freq to %d Hz", __func__, peq_idx, biamp.high_peq[peq_idx].freq); + } else if (strstr(key, "_gain") != NULL) { + biamp.high_peq[peq_idx].gain = (int8_t)item->valueint; + modified = true; + ESP_LOGI(TAG, "%s: Setting bi-amp high PEQ %d gain to %d dB", __func__, peq_idx, biamp.high_peq[peq_idx].gain); + } else if (strstr(key, "_q") != NULL) { + /* Q value comes as float (0.5-10.0), convert to q_x10 (5-100) */ + biamp.high_peq[peq_idx].q_x10 = (uint8_t)(item->valuedouble * 10.0 + 0.5); + modified = true; + ESP_LOGI(TAG, "%s: Setting bi-amp high PEQ %d Q to %.1f (q_x10=%d)", __func__, peq_idx, item->valuedouble, biamp.high_peq[peq_idx].q_x10); + } + } + } + + if (modified) { + tas5805m_settings_save_biamp(&biamp); + /* Apply if we're in advanced bi-amp mode */ + TAS5805M_EQ_UI_MODE ui_mode = TAS5805M_EQ_UI_MODE_OFF; + tas5805m_settings_load_eq_ui_mode(&ui_mode); + if (ui_mode == TAS5805M_EQ_UI_MODE_ADVANCED_BIAMP) { + tas5805m_settings_apply_biamp(&biamp); + } + } + } + /* Loudness compensation parameter handling */ + else if (strncmp(key, "loudness_", 9) == 0 && cJSON_IsNumber(item)) { + tas5805m_loudness_settings_t loudness; + tas5805m_settings_load_loudness(&loudness); + bool modified = false; + + if (strcmp(key, "loudness_enabled") == 0) { + loudness.enabled = (uint8_t)item->valueint; + modified = true; + ESP_LOGI(TAG, "%s: Setting loudness enabled to %d", __func__, loudness.enabled); + } else if (strncmp(key, "loudness_thresh_", 16) == 0) { + int idx = key[16] - '0'; + if (idx >= 0 && idx < TAS5805M_LOUDNESS_ZONES - 1) { + loudness.thresholds[idx] = (uint8_t)item->valueint; + modified = true; + ESP_LOGI(TAG, "%s: Setting loudness threshold %d to %d%%", __func__, idx, loudness.thresholds[idx]); + } + } else if (strncmp(key, "loudness_bass_", 14) == 0) { + int idx = key[14] - '0'; + if (idx >= 0 && idx < TAS5805M_LOUDNESS_ZONES) { + loudness.bass_boost[idx] = (int8_t)item->valueint; + modified = true; + ESP_LOGI(TAG, "%s: Setting loudness bass zone %d to %d dB", __func__, idx, loudness.bass_boost[idx]); + } + } else if (strncmp(key, "loudness_treble_", 16) == 0) { + int idx = key[16] - '0'; + if (idx >= 0 && idx < TAS5805M_LOUDNESS_ZONES) { + loudness.treble_boost[idx] = (int8_t)item->valueint; + modified = true; + ESP_LOGI(TAG, "%s: Setting loudness treble zone %d to %d dB", __func__, idx, loudness.treble_boost[idx]); + } + } + + if (modified) { + tas5805m_settings_save_loudness(&loudness); + /* Re-apply loudness with current volume */ + int vol = 50; + tas5805m_get_volume(&vol); + tas5805m_loudness_apply(vol); + } + } } #endif diff --git a/components/ui_http_server/html/eq-settings.html b/components/ui_http_server/html/eq-settings.html index 9f3c0aec..dfe2bf7d 100644 --- a/components/ui_http_server/html/eq-settings.html +++ b/components/ui_http_server/html/eq-settings.html @@ -279,6 +279,122 @@ box-sizing: border-box; } + /* Radio button group styles */ + .radio-group-label { + display: block; + font-weight: bold; + margin-bottom: 8px; + color: #333; + } + + .radio-group { + display: flex; + gap: 15px; + flex-wrap: wrap; + } + + .radio-option { + display: inline-flex; + align-items: center; + cursor: pointer; + padding: 8px 16px; + border: 2px solid #ddd; + border-radius: 20px; + background-color: #f8f9fa; + transition: all 0.2s ease; + font-weight: normal; + } + + .radio-option:hover { + border-color: #007bff; + background-color: #e7f3ff; + } + + .radio-option input[type="radio"] { + margin-right: 6px; + accent-color: #007bff; + } + + .radio-option:has(input[type="radio"]:checked) { + border-color: #007bff; + background-color: #007bff; + color: white; + } + + .radio-option input[type="radio"]:checked + span { + color: white; + } + + .radio-option input[type="radio"]:disabled { + cursor: not-allowed; + } + + .radio-option:has(input[type="radio"]:disabled) { + cursor: not-allowed; + opacity: 0.6; + } + + /* PEQ Subgroup styles */ + .peq-subgroup { + background-color: #f8f9fa; + border: 1px solid #e0e0e0; + border-radius: 6px; + padding: 10px; + margin-bottom: 10px; + } + + .peq-subgroup-header { + font-weight: bold; + font-size: 14px; + color: #555; + margin-bottom: 8px; + padding-bottom: 5px; + border-bottom: 1px solid #ddd; + } + + .peq-subgroup-params { + display: grid; + grid-template-columns: repeat(3, 1fr); + gap: 10px; + } + + .peq-param { + display: flex; + flex-direction: column; + align-items: center; + } + + .peq-param label { + font-size: 11px; + color: #666; + margin-bottom: 4px; + font-weight: normal; + } + + .peq-param input[type="range"] { + width: 100%; + height: 6px; + margin: 0; + } + + .peq-param-value { + font-size: 12px; + color: #007bff; + font-weight: bold; + margin-top: 4px; + } + + /* Output channel section styles */ + .section-output-channel .section-params { + display: flex; + flex-direction: column; + gap: 12px; + } + + .section-output-channel .parameter-control { + margin-bottom: 0; + } + .info-box { background-color: #d1ecf1; color: #0c5460; @@ -382,10 +498,101 @@ gap: 10px; margin-top: 20px; } - + .button-group button { flex: 1; } + + /* Bi-Amp Crossover Sections Layout */ + .biamp-sections-container { + display: flex; + flex-direction: column; + gap: 20px; + } + + .biamp-columns { + display: grid; + grid-template-columns: 1fr 1fr; + gap: 20px; + } + + @media (max-width: 768px) { + .biamp-columns { + grid-template-columns: 1fr; + } + } + + .biamp-section { + background-color: #f8f9fa; + border-radius: 8px; + padding: 15px; + } + + .biamp-section .section-title { + margin: 0 0 15px 0; + font-size: 16px; + font-weight: bold; + color: #495057; + border-bottom: 1px solid #dee2e6; + padding-bottom: 8px; + } + + .biamp-section.section-vertical-sliders .section-params { + display: flex; + flex-wrap: wrap; + gap: 15px; + justify-content: center; + } + + .biamp-section.section-vertical-sliders .eq-band-slider { + min-width: 50px; + } + + .biamp-section.section-vertical-sliders .eq-band-slider input[type="range"] { + height: 150px; + } + + .biamp-section.section-loudness .section-params { + display: flex; + flex-direction: column; + gap: 10px; + } + + .loudness-zones-container { + display: grid; + grid-template-columns: repeat(5, 1fr); + gap: 10px; + } + + @media (max-width: 600px) { + .loudness-zones-container { + grid-template-columns: repeat(3, 1fr); + } + } + + .loudness-zone { + display: flex; + flex-direction: column; + align-items: center; + background-color: #e9ecef; + border-radius: 6px; + padding: 10px; + } + + .loudness-zone .zone-label { + font-size: 12px; + font-weight: bold; + color: #495057; + margin-bottom: 8px; + } + + .loudness-zone .eq-band-slider { + min-width: 40px; + } + + .loudness-zone .eq-band-slider input[type="range"] { + height: 100px; + } @@ -504,22 +711,64 @@

    EQ Settings

    if (group.layout === 'eq-bands' && group.parameters) { const bandsContainer = document.createElement('div'); bandsContainer.className = 'eq-bands-container'; - + group.parameters.forEach(param => { const sliderDiv = settingsUI.renderVerticalSlider(param, currentSettings, async (k, v) => { await updateSetting(k, v); }); bandsContainer.appendChild(sliderDiv); }); - + contentWrapper.appendChild(bandsContainer); groupDiv.appendChild(contentWrapper); updateGroupVisibility(groupDiv); return groupDiv; } + // Handle biamp-crossover layout with sections + if (group.layout === 'biamp-crossover' && group.sections) { + const sectionsContainer = document.createElement('div'); + sectionsContainer.className = 'biamp-sections-container'; + + group.sections.forEach(section => { + if (section.columns) { + // Handle columned sections (Low/High side by side) + const columnsDiv = document.createElement('div'); + columnsDiv.className = 'biamp-columns'; + section.columns.forEach(col => { + const colSection = settingsUI.renderSection(col, currentSettings, async (k, v) => { + await updateSetting(k, v); + // Update conditional visibility after setting change + settingsUI.updateConditionalVisibility(groupDiv, currentSettings); + }); + columnsDiv.appendChild(colSection); + }); + sectionsContainer.appendChild(columnsDiv); + } else { + // Regular section + const sectionDiv = settingsUI.renderSection(section, currentSettings, async (k, v) => { + await updateSetting(k, v); + // Update conditional visibility after setting change + settingsUI.updateConditionalVisibility(groupDiv, currentSettings); + }); + sectionsContainer.appendChild(sectionDiv); + } + }); + + contentWrapper.appendChild(sectionsContainer); + groupDiv.appendChild(contentWrapper); + updateGroupVisibility(groupDiv); + return groupDiv; + } + // Normal parameters if (group.parameters) { group.parameters.forEach(param => { const controlDiv = settingsUI.renderParameter(param, currentSettings, async (k, v) => { await updateSetting(k, v); }); + if (param.visibleWhen) { + controlDiv.setAttribute('data-visible-when', JSON.stringify(param.visibleWhen)); + if (!settingsUI.isParameterVisible(param, currentSettings)) { + controlDiv.style.display = 'none'; + } + } contentWrapper.appendChild(controlDiv); }); } diff --git a/components/ui_http_server/html/settings-ui.js b/components/ui_http_server/html/settings-ui.js index a09fc0c0..e2df4bd4 100644 --- a/components/ui_http_server/html/settings-ui.js +++ b/components/ui_http_server/html/settings-ui.js @@ -52,6 +52,39 @@ return controlDiv; } + if (param.type === 'radio') { + const label = document.createElement('label'); + label.className = 'radio-group-label'; + label.textContent = param.name; + controlDiv.appendChild(label); + + const radioGroup = document.createElement('div'); + radioGroup.className = 'radio-group'; + param.values.forEach(option => { + const radioLabel = document.createElement('label'); + radioLabel.className = 'radio-option'; + + const radio = document.createElement('input'); + radio.type = 'radio'; + radio.name = param.key; + radio.value = option.value; + if (value == option.value) radio.checked = true; + if (param.readonly) radio.disabled = true; + radio.onchange = function () { + if (onChange) onChange(param.key, parseInt(this.value)); + }; + + const span = document.createElement('span'); + span.textContent = option.name; + + radioLabel.appendChild(radio); + radioLabel.appendChild(span); + radioGroup.appendChild(radioLabel); + }); + controlDiv.appendChild(radioGroup); + return controlDiv; + } + if (param.type === 'range') { const info = document.createElement('div'); info.className = 'param-info'; @@ -171,13 +204,158 @@ return sliderDiv; } + // Check if a parameter should be visible based on visibleWhen condition + function isParameterVisible(param, currentSettings) { + if (!param.visibleWhen) return true; + for (const [key, expectedValue] of Object.entries(param.visibleWhen)) { + const actualValue = currentSettings[key]; + if (actualValue !== expectedValue) return false; + } + return true; + } + + // Update visibility of parameters with visibleWhen conditions + function updateConditionalVisibility(container, currentSettings) { + container.querySelectorAll('[data-visible-when]').forEach(el => { + try { + const condition = JSON.parse(el.getAttribute('data-visible-when')); + let visible = true; + for (const [key, expectedValue] of Object.entries(condition)) { + if (currentSettings[key] !== expectedValue) { + visible = false; + break; + } + } + el.style.display = visible ? '' : 'none'; + } catch (e) { + console.error('Error parsing visibleWhen:', e); + } + }); + } + + // Render a PEQ subgroup (freq, gain, Q grouped together) + function renderPeqSubgroup(subgroup, currentSettings, onChange) { + const groupDiv = document.createElement('div'); + groupDiv.className = 'peq-subgroup'; + + const header = document.createElement('div'); + header.className = 'peq-subgroup-header'; + header.textContent = subgroup.name; + groupDiv.appendChild(header); + + const paramsRow = document.createElement('div'); + paramsRow.className = 'peq-subgroup-params'; + + subgroup.parameters.forEach(param => { + const controlDiv = document.createElement('div'); + controlDiv.className = 'peq-param'; + + const label = document.createElement('label'); + label.textContent = param.name; + controlDiv.appendChild(label); + + const input = document.createElement('input'); + input.type = 'range'; + input.min = param.min; + input.max = param.max; + input.step = param.step || 1; + input.value = param.current !== undefined ? param.current : param.default || param.min; + + const valueSpan = document.createElement('span'); + valueSpan.className = 'peq-param-value'; + const decimals = param.decimals !== undefined ? param.decimals : 0; + valueSpan.textContent = Number(input.value).toFixed(decimals) + (param.unit || ''); + + input.oninput = function () { + valueSpan.textContent = Number(this.value).toFixed(decimals) + (param.unit || ''); + }; + input.onchange = function () { + if (onChange) onChange(param.key, parseFloat(this.value)); + }; + + controlDiv.appendChild(input); + controlDiv.appendChild(valueSpan); + paramsRow.appendChild(controlDiv); + }); + + groupDiv.appendChild(paramsRow); + return groupDiv; + } + + // Render a section within a group (for biamp Low/High columns) + function renderSection(section, currentSettings, onChange) { + const sectionDiv = document.createElement('div'); + sectionDiv.className = 'biamp-section'; + if (section.layout) { + sectionDiv.classList.add('section-' + section.layout); + } + + if (section.name) { + const title = document.createElement('h3'); + title.className = 'section-title'; + title.textContent = section.name; + sectionDiv.appendChild(title); + } + + const paramsContainer = document.createElement('div'); + paramsContainer.className = 'section-params'; + + if (section.layout === 'vertical-sliders') { + paramsContainer.classList.add('vertical-sliders-container'); + section.parameters.forEach(param => { + // Use vertical slider only for range type, otherwise use standard renderer + const controlDiv = (param.type === 'range') + ? renderVerticalSlider(param, currentSettings, onChange) + : renderParameter(param, currentSettings, onChange); + if (param.visibleWhen) { + controlDiv.setAttribute('data-visible-when', JSON.stringify(param.visibleWhen)); + if (!isParameterVisible(param, currentSettings)) { + controlDiv.style.display = 'none'; + } + } + paramsContainer.appendChild(controlDiv); + }); + } else if (section.layout === 'output-channel') { + // Output channel layout: regular params + PEQ subgroups + phase radio + section.parameters.forEach(param => { + let controlDiv; + if (param.type === 'peq-subgroup') { + controlDiv = renderPeqSubgroup(param, currentSettings, onChange); + } else { + controlDiv = renderParameter(param, currentSettings, onChange); + } + if (param.visibleWhen) { + controlDiv.setAttribute('data-visible-when', JSON.stringify(param.visibleWhen)); + if (!isParameterVisible(param, currentSettings)) { + controlDiv.style.display = 'none'; + } + } + paramsContainer.appendChild(controlDiv); + }); + } else { + section.parameters.forEach(param => { + const controlDiv = renderParameter(param, currentSettings, onChange); + if (param.visibleWhen) { + controlDiv.setAttribute('data-visible-when', JSON.stringify(param.visibleWhen)); + if (!isParameterVisible(param, currentSettings)) { + controlDiv.style.display = 'none'; + } + } + paramsContainer.appendChild(controlDiv); + }); + } + + sectionDiv.appendChild(paramsContainer); + return sectionDiv; + } + // Visibility helpers for EQ groups function updateGroupVisibility(groupDiv, currentSettings) { const layout = groupDiv.getAttribute('data-layout'); const channel = groupDiv.getAttribute('data-channel'); if (!layout) return; const uiMode = (currentSettings && currentSettings.eq_ui_mode !== undefined) ? currentSettings.eq_ui_mode : 0; - + if (layout === 'eq-bands') { if (uiMode === 1) { groupDiv.style.display = (channel === 'left') ? 'block' : 'none'; @@ -187,18 +365,18 @@ groupDiv.style.display = 'none'; } } - + if (layout === 'biquad-manual') { // Always show biquad section, but expand/collapse based on mode groupDiv.style.display = 'block'; const isManualMode = (uiMode === 4); - + if (isManualMode) { groupDiv.classList.remove('collapsed'); } else { groupDiv.classList.add('collapsed'); } - + // Update readonly state of inputs when mode changes const inputs = groupDiv.querySelectorAll('input[type="number"]'); inputs.forEach(input => { @@ -209,7 +387,7 @@ input.disabled = !isManualMode; } }); - + // Update button group: always visible, but Apply button only enabled in manual mode const buttonGroup = groupDiv.querySelector('.button-group'); if (buttonGroup) { @@ -220,10 +398,17 @@ } } } - + if (layout === 'eq-presets') { groupDiv.style.display = (uiMode === 3) ? 'block' : 'none'; } + + if (layout === 'biamp-crossover') { + groupDiv.style.display = (uiMode === 4) ? 'block' : 'none'; + } + + // Update conditional visibility within the group + updateConditionalVisibility(groupDiv, currentSettings); } function updateAllGroupVisibility(currentSettings) { @@ -238,6 +423,10 @@ debounce, renderParameter, renderVerticalSlider, + renderPeqSubgroup, + renderSection, + isParameterVisible, + updateConditionalVisibility, updateGroupVisibility, updateAllGroupVisibility, }; From 1f8d7f5c239fb6315f870bf35ab0c234c59762f3 Mon Sep 17 00:00:00 2001 From: craigmillard86 Date: Thu, 15 Jan 2026 09:08:18 +0000 Subject: [PATCH 43/58] Add bi-amp preset export/import for shareable speaker configurations - Add tas5805m_biamp_preset_export() and tas5805m_biamp_preset_import() functions - Add GET/POST /api/biamp/preset HTTP endpoints for download/upload - Add Export Preset and Import Preset buttons to Advanced Bi-Amp UI - JSON preset includes crossover, gains, phase, PEQ, and loudness settings - Enables distributing speaker-specific settings with 3D speaker models --- .../include/tas5805m_settings.h | 27 ++ .../tas5805m_settings/tas5805m_settings.c | 277 ++++++++++++++++++ .../ui_http_server/html/eq-settings.html | 94 ++++++ components/ui_http_server/ui_http_server.c | 124 ++++++++ 4 files changed, 522 insertions(+) diff --git a/components/tas5805m_settings/include/tas5805m_settings.h b/components/tas5805m_settings/include/tas5805m_settings.h index a0b07947..3a125d07 100644 --- a/components/tas5805m_settings/include/tas5805m_settings.h +++ b/components/tas5805m_settings/include/tas5805m_settings.h @@ -276,6 +276,33 @@ esp_err_t tas5805m_settings_apply_early(void); */ esp_err_t tas5805m_settings_apply_delayed(void); +/* ============ Bi-Amp Preset Export/Import ============ */ + +/** Preset version for compatibility checking */ +#define TAS5805M_BIAMP_PRESET_VERSION 1 + +/** + * @brief Export current bi-amp settings to JSON preset format + * + * Creates a portable JSON preset that can be shared with 3D speaker models. + * Includes crossover, per-output gains/PEQ, phase, and loudness settings. + * + * @param json_out Buffer to write JSON string + * @param max_len Maximum buffer size + * @return ESP_OK on success, error code otherwise + */ +esp_err_t tas5805m_biamp_preset_export(char *json_out, size_t max_len); + +/** + * @brief Import bi-amp settings from JSON preset + * + * Parses and validates a preset JSON, then applies and saves the settings. + * + * @param json_in JSON preset string + * @return ESP_OK on success, ESP_ERR_INVALID_ARG if preset is invalid + */ +esp_err_t tas5805m_biamp_preset_import(const char *json_in); + #endif /* CONFIG_DAC_TAS5805M */ #ifdef __cplusplus diff --git a/components/tas5805m_settings/tas5805m_settings.c b/components/tas5805m_settings/tas5805m_settings.c index 8ea256dd..91a9ee22 100644 --- a/components/tas5805m_settings/tas5805m_settings.c +++ b/components/tas5805m_settings/tas5805m_settings.c @@ -4150,4 +4150,281 @@ esp_err_t tas5805m_settings_set_eq_from_json(const char *json_in) { return ESP_OK; } +/* ============ Bi-Amp Preset Export/Import ============ */ + +esp_err_t tas5805m_biamp_preset_export(char *json_out, size_t max_len) +{ + if (!json_out || max_len == 0) { + return ESP_ERR_INVALID_ARG; + } + + /* Load current settings */ + tas5805m_biamp_settings_t biamp; + tas5805m_settings_load_biamp(&biamp); + + tas5805m_loudness_settings_t loudness; + tas5805m_settings_load_loudness(&loudness); + + /* Build JSON preset */ + cJSON *root = cJSON_CreateObject(); + if (!root) { + return ESP_ERR_NO_MEM; + } + + /* Preset metadata */ + cJSON_AddNumberToObject(root, "version", TAS5805M_BIAMP_PRESET_VERSION); + cJSON_AddStringToObject(root, "type", "biamp_preset"); + + /* Crossover settings */ + cJSON *crossover = cJSON_CreateObject(); + cJSON_AddNumberToObject(crossover, "frequency", biamp.crossover_freq); + cJSON_AddNumberToObject(crossover, "slope", biamp.slope); + cJSON_AddNumberToObject(crossover, "filter_type", biamp.type); + cJSON_AddItemToObject(root, "crossover", crossover); + + /* Subsonic filter */ + cJSON_AddNumberToObject(root, "subsonic_freq", biamp.subsonic_freq); + + /* Low output (woofer) */ + cJSON *low = cJSON_CreateObject(); + cJSON_AddNumberToObject(low, "gain", biamp.low_gain); + cJSON_AddNumberToObject(low, "phase_invert", biamp.low_phase_invert); + cJSON *low_peq = cJSON_CreateArray(); + for (int i = 0; i < TAS5805M_BIAMP_PEQ_BANDS; i++) { + cJSON *band = cJSON_CreateObject(); + cJSON_AddNumberToObject(band, "freq", biamp.low_peq[i].freq); + cJSON_AddNumberToObject(band, "gain", biamp.low_peq[i].gain); + cJSON_AddNumberToObject(band, "q", biamp.low_peq[i].q_x10 / 10.0); + cJSON_AddItemToArray(low_peq, band); + } + cJSON_AddItemToObject(low, "peq", low_peq); + cJSON_AddItemToObject(root, "low_output", low); + + /* High output (tweeter) */ + cJSON *high = cJSON_CreateObject(); + cJSON_AddNumberToObject(high, "gain", biamp.high_gain); + cJSON_AddNumberToObject(high, "phase_invert", biamp.high_phase_invert); + cJSON *high_peq = cJSON_CreateArray(); + for (int i = 0; i < TAS5805M_BIAMP_PEQ_BANDS; i++) { + cJSON *band = cJSON_CreateObject(); + cJSON_AddNumberToObject(band, "freq", biamp.high_peq[i].freq); + cJSON_AddNumberToObject(band, "gain", biamp.high_peq[i].gain); + cJSON_AddNumberToObject(band, "q", biamp.high_peq[i].q_x10 / 10.0); + cJSON_AddItemToArray(high_peq, band); + } + cJSON_AddItemToObject(high, "peq", high_peq); + cJSON_AddItemToObject(root, "high_output", high); + + /* Loudness compensation */ + cJSON *loud = cJSON_CreateObject(); + cJSON_AddNumberToObject(loud, "enabled", loudness.enabled); + cJSON *thresholds = cJSON_CreateArray(); + for (int i = 0; i < TAS5805M_LOUDNESS_ZONES - 1; i++) { + cJSON_AddItemToArray(thresholds, cJSON_CreateNumber(loudness.thresholds[i])); + } + cJSON_AddItemToObject(loud, "thresholds", thresholds); + cJSON *bass = cJSON_CreateArray(); + cJSON *treble = cJSON_CreateArray(); + for (int i = 0; i < TAS5805M_LOUDNESS_ZONES; i++) { + cJSON_AddItemToArray(bass, cJSON_CreateNumber(loudness.bass_boost[i])); + cJSON_AddItemToArray(treble, cJSON_CreateNumber(loudness.treble_boost[i])); + } + cJSON_AddItemToObject(loud, "bass_boost", bass); + cJSON_AddItemToObject(loud, "treble_boost", treble); + cJSON_AddItemToObject(root, "loudness", loud); + + /* Serialize to string */ + char *json_str = cJSON_PrintUnformatted(root); + cJSON_Delete(root); + + if (!json_str) { + return ESP_ERR_NO_MEM; + } + + size_t len = strlen(json_str); + if (len >= max_len) { + free(json_str); + return ESP_ERR_INVALID_SIZE; + } + + strcpy(json_out, json_str); + free(json_str); + + ESP_LOGI(TAG, "%s: Exported bi-amp preset (%d bytes)", __func__, len); + return ESP_OK; +} + +esp_err_t tas5805m_biamp_preset_import(const char *json_in) +{ + if (!json_in) { + return ESP_ERR_INVALID_ARG; + } + + cJSON *root = cJSON_Parse(json_in); + if (!root) { + ESP_LOGE(TAG, "%s: Failed to parse JSON", __func__); + return ESP_ERR_INVALID_ARG; + } + + /* Verify preset type and version */ + cJSON *type = cJSON_GetObjectItem(root, "type"); + if (!type || !cJSON_IsString(type) || strcmp(type->valuestring, "biamp_preset") != 0) { + ESP_LOGE(TAG, "%s: Invalid preset type", __func__); + cJSON_Delete(root); + return ESP_ERR_INVALID_ARG; + } + + cJSON *version = cJSON_GetObjectItem(root, "version"); + if (!version || !cJSON_IsNumber(version) || version->valueint > TAS5805M_BIAMP_PRESET_VERSION) { + ESP_LOGE(TAG, "%s: Unsupported preset version", __func__); + cJSON_Delete(root); + return ESP_ERR_INVALID_ARG; + } + + /* Load current settings as defaults */ + tas5805m_biamp_settings_t biamp; + tas5805m_biamp_init_defaults(&biamp); + + tas5805m_loudness_settings_t loudness; + tas5805m_loudness_init_defaults(&loudness); + + /* Parse crossover settings */ + cJSON *crossover = cJSON_GetObjectItem(root, "crossover"); + if (crossover) { + cJSON *freq = cJSON_GetObjectItem(crossover, "frequency"); + if (freq && cJSON_IsNumber(freq)) biamp.crossover_freq = (uint16_t)freq->valueint; + + cJSON *slope = cJSON_GetObjectItem(crossover, "slope"); + if (slope && cJSON_IsNumber(slope)) biamp.slope = (tas5805m_biamp_slope_t)slope->valueint; + + cJSON *ftype = cJSON_GetObjectItem(crossover, "filter_type"); + if (ftype && cJSON_IsNumber(ftype)) biamp.type = (tas5805m_biamp_type_t)ftype->valueint; + } + + /* Parse subsonic filter */ + cJSON *subsonic = cJSON_GetObjectItem(root, "subsonic_freq"); + if (subsonic && cJSON_IsNumber(subsonic)) biamp.subsonic_freq = (uint16_t)subsonic->valueint; + + /* Parse low output */ + cJSON *low = cJSON_GetObjectItem(root, "low_output"); + if (low) { + cJSON *gain = cJSON_GetObjectItem(low, "gain"); + if (gain && cJSON_IsNumber(gain)) biamp.low_gain = (int8_t)gain->valueint; + + cJSON *phase = cJSON_GetObjectItem(low, "phase_invert"); + if (phase && cJSON_IsNumber(phase)) biamp.low_phase_invert = (uint8_t)phase->valueint; + + cJSON *peq = cJSON_GetObjectItem(low, "peq"); + if (peq && cJSON_IsArray(peq)) { + int idx = 0; + cJSON *band; + cJSON_ArrayForEach(band, peq) { + if (idx >= TAS5805M_BIAMP_PEQ_BANDS) break; + cJSON *f = cJSON_GetObjectItem(band, "freq"); + cJSON *g = cJSON_GetObjectItem(band, "gain"); + cJSON *q = cJSON_GetObjectItem(band, "q"); + if (f && cJSON_IsNumber(f)) biamp.low_peq[idx].freq = (uint16_t)f->valueint; + if (g && cJSON_IsNumber(g)) biamp.low_peq[idx].gain = (int8_t)g->valueint; + if (q && cJSON_IsNumber(q)) biamp.low_peq[idx].q_x10 = (uint8_t)(q->valuedouble * 10.0 + 0.5); + idx++; + } + } + } + + /* Parse high output */ + cJSON *high = cJSON_GetObjectItem(root, "high_output"); + if (high) { + cJSON *gain = cJSON_GetObjectItem(high, "gain"); + if (gain && cJSON_IsNumber(gain)) biamp.high_gain = (int8_t)gain->valueint; + + cJSON *phase = cJSON_GetObjectItem(high, "phase_invert"); + if (phase && cJSON_IsNumber(phase)) biamp.high_phase_invert = (uint8_t)phase->valueint; + + cJSON *peq = cJSON_GetObjectItem(high, "peq"); + if (peq && cJSON_IsArray(peq)) { + int idx = 0; + cJSON *band; + cJSON_ArrayForEach(band, peq) { + if (idx >= TAS5805M_BIAMP_PEQ_BANDS) break; + cJSON *f = cJSON_GetObjectItem(band, "freq"); + cJSON *g = cJSON_GetObjectItem(band, "gain"); + cJSON *q = cJSON_GetObjectItem(band, "q"); + if (f && cJSON_IsNumber(f)) biamp.high_peq[idx].freq = (uint16_t)f->valueint; + if (g && cJSON_IsNumber(g)) biamp.high_peq[idx].gain = (int8_t)g->valueint; + if (q && cJSON_IsNumber(q)) biamp.high_peq[idx].q_x10 = (uint8_t)(q->valuedouble * 10.0 + 0.5); + idx++; + } + } + } + + /* Parse loudness settings */ + cJSON *loud = cJSON_GetObjectItem(root, "loudness"); + if (loud) { + cJSON *enabled = cJSON_GetObjectItem(loud, "enabled"); + if (enabled && cJSON_IsNumber(enabled)) loudness.enabled = (uint8_t)enabled->valueint; + + cJSON *thresholds = cJSON_GetObjectItem(loud, "thresholds"); + if (thresholds && cJSON_IsArray(thresholds)) { + int idx = 0; + cJSON *val; + cJSON_ArrayForEach(val, thresholds) { + if (idx >= TAS5805M_LOUDNESS_ZONES - 1) break; + if (cJSON_IsNumber(val)) loudness.thresholds[idx] = (uint8_t)val->valueint; + idx++; + } + } + + cJSON *bass = cJSON_GetObjectItem(loud, "bass_boost"); + if (bass && cJSON_IsArray(bass)) { + int idx = 0; + cJSON *val; + cJSON_ArrayForEach(val, bass) { + if (idx >= TAS5805M_LOUDNESS_ZONES) break; + if (cJSON_IsNumber(val)) loudness.bass_boost[idx] = (int8_t)val->valueint; + idx++; + } + } + + cJSON *treble = cJSON_GetObjectItem(loud, "treble_boost"); + if (treble && cJSON_IsArray(treble)) { + int idx = 0; + cJSON *val; + cJSON_ArrayForEach(val, treble) { + if (idx >= TAS5805M_LOUDNESS_ZONES) break; + if (cJSON_IsNumber(val)) loudness.treble_boost[idx] = (int8_t)val->valueint; + idx++; + } + } + } + + cJSON_Delete(root); + + /* Save and apply settings */ + esp_err_t ret = tas5805m_settings_save_biamp(&biamp); + if (ret != ESP_OK) { + ESP_LOGE(TAG, "%s: Failed to save bi-amp settings", __func__); + return ret; + } + + ret = tas5805m_settings_save_loudness(&loudness); + if (ret != ESP_OK) { + ESP_LOGE(TAG, "%s: Failed to save loudness settings", __func__); + return ret; + } + + /* Apply the settings */ + ret = tas5805m_biamp_apply(&biamp); + if (ret != ESP_OK) { + ESP_LOGW(TAG, "%s: Failed to apply bi-amp settings (codec may not be ready)", __func__); + } + + /* Re-apply loudness with current volume */ + int vol = 50; + tas5805m_get_volume(&vol); + tas5805m_loudness_apply(vol); + + ESP_LOGI(TAG, "%s: Imported bi-amp preset successfully", __func__); + return ESP_OK; +} + #endif /* CONFIG_DAC_TAS5805M */ diff --git a/components/ui_http_server/html/eq-settings.html b/components/ui_http_server/html/eq-settings.html index dfe2bf7d..20d54265 100644 --- a/components/ui_http_server/html/eq-settings.html +++ b/components/ui_http_server/html/eq-settings.html @@ -395,6 +395,44 @@ margin-bottom: 0; } + /* Preset buttons */ + .preset-buttons { + display: flex; + gap: 12px; + justify-content: center; + margin-top: 20px; + padding-top: 15px; + border-top: 1px solid #e0e0e0; + } + + .preset-btn { + padding: 10px 20px; + font-size: 14px; + font-weight: bold; + border: none; + border-radius: 6px; + cursor: pointer; + transition: all 0.2s ease; + } + + .preset-btn.export-btn { + background-color: #28a745; + color: white; + } + + .preset-btn.export-btn:hover { + background-color: #218838; + } + + .preset-btn.import-btn { + background-color: #007bff; + color: white; + } + + .preset-btn.import-btn:hover { + background-color: #0056b3; + } + .info-box { background-color: #d1ecf1; color: #0c5460; @@ -753,6 +791,62 @@

    EQ Settings

    } }); + // Add preset export/import buttons + const presetButtonsDiv = document.createElement('div'); + presetButtonsDiv.className = 'preset-buttons'; + + const exportBtn = document.createElement('button'); + exportBtn.className = 'preset-btn export-btn'; + exportBtn.textContent = 'Export Preset'; + exportBtn.onclick = async () => { + try { + const response = await fetch('/api/biamp/preset'); + if (!response.ok) throw new Error('Export failed'); + const blob = await response.blob(); + const url = URL.createObjectURL(blob); + const a = document.createElement('a'); + a.href = url; + a.download = 'biamp_preset.json'; + document.body.appendChild(a); + a.click(); + document.body.removeChild(a); + URL.revokeObjectURL(url); + } catch (err) { + alert('Failed to export preset: ' + err.message); + } + }; + presetButtonsDiv.appendChild(exportBtn); + + const importBtn = document.createElement('button'); + importBtn.className = 'preset-btn import-btn'; + importBtn.textContent = 'Import Preset'; + importBtn.onclick = () => { + const input = document.createElement('input'); + input.type = 'file'; + input.accept = '.json'; + input.onchange = async (e) => { + const file = e.target.files[0]; + if (!file) return; + try { + const text = await file.text(); + const response = await fetch('/api/biamp/preset', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: text + }); + if (!response.ok) throw new Error('Import failed'); + alert('Preset imported successfully! Refreshing...'); + location.reload(); + } catch (err) { + alert('Failed to import preset: ' + err.message); + } + }; + input.click(); + }; + presetButtonsDiv.appendChild(importBtn); + + sectionsContainer.appendChild(presetButtonsDiv); + contentWrapper.appendChild(sectionsContainer); groupDiv.appendChild(contentWrapper); updateGroupVisibility(groupDiv); diff --git a/components/ui_http_server/ui_http_server.c b/components/ui_http_server/ui_http_server.c index b616a700..f6d022a7 100644 --- a/components/ui_http_server/ui_http_server.c +++ b/components/ui_http_server/ui_http_server.c @@ -924,6 +924,107 @@ static esp_err_t post_eq_settings_handler(httpd_req_t *req) { #endif } +/* + * GET /api/biamp/preset handler + * Exports current bi-amp settings as a downloadable JSON preset + */ +static esp_err_t get_biamp_preset_handler(httpd_req_t *req) { + ESP_LOGD(TAG, "%s: uri=%s", __func__, req->uri); + + set_cors_headers(req); + +#if CONFIG_DAC_TAS5805M + // Allocate buffer for JSON output + char *json_buf = (char *)malloc(4096); + if (!json_buf) { + ESP_LOGE(TAG, "%s: Failed to allocate buffer", __func__); + httpd_resp_set_status(req, "500 Internal Server Error"); + httpd_resp_sendstr(req, "{\"error\": \"Memory allocation failed\"}"); + return ESP_OK; + } + + esp_err_t err = tas5805m_biamp_preset_export(json_buf, 4096); + if (err != ESP_OK) { + free(json_buf); + ESP_LOGE(TAG, "%s: Failed to export preset: %s", __func__, esp_err_to_name(err)); + httpd_resp_set_status(req, "500 Internal Server Error"); + httpd_resp_sendstr(req, "{\"error\": \"Failed to export preset\"}"); + return ESP_OK; + } + + httpd_resp_set_status(req, "200 OK"); + httpd_resp_set_type(req, "application/json"); + httpd_resp_set_hdr(req, "Content-Disposition", "attachment; filename=\"biamp_preset.json\""); + httpd_resp_sendstr(req, json_buf); + free(json_buf); + + return ESP_OK; +#else + httpd_resp_set_status(req, "404 Not Found"); + httpd_resp_sendstr(req, "{\"error\": \"TAS5805M not configured\"}"); + return ESP_OK; +#endif +} + +/* + * POST /api/biamp/preset handler + * Imports a bi-amp preset from JSON + */ +static esp_err_t post_biamp_preset_handler(httpd_req_t *req) { + ESP_LOGD(TAG, "%s: uri=%s", __func__, req->uri); + + set_cors_headers(req); + +#if CONFIG_DAC_TAS5805M + // Allocate buffer for request body + char *buf = (char *)malloc(req->content_len + 1); + if (!buf) { + ESP_LOGE(TAG, "%s: Failed to allocate buffer for request body", __func__); + httpd_resp_set_status(req, "500 Internal Server Error"); + httpd_resp_sendstr(req, "{\"error\": \"Memory allocation failed\"}"); + return ESP_OK; + } + + // Read request body + int ret = httpd_req_recv(req, buf, req->content_len); + if (ret <= 0) { + free(buf); + if (ret == HTTPD_SOCK_ERR_TIMEOUT) { + httpd_resp_set_status(req, "408 Request Timeout"); + httpd_resp_sendstr(req, "{\"error\": \"Request timeout\"}"); + } else { + httpd_resp_set_status(req, "500 Internal Server Error"); + httpd_resp_sendstr(req, "{\"error\": \"Failed to read request body\"}"); + } + return ESP_OK; + } + buf[ret] = '\0'; + + ESP_LOGI(TAG, "%s: Received preset JSON (%d bytes)", __func__, ret); + + // Import the preset + esp_err_t err = tas5805m_biamp_preset_import(buf); + free(buf); + + if (err != ESP_OK) { + ESP_LOGE(TAG, "%s: Failed to import preset: %s", __func__, esp_err_to_name(err)); + httpd_resp_set_status(req, "400 Bad Request"); + httpd_resp_sendstr(req, "{\"error\": \"Invalid preset format\"}"); + return ESP_OK; + } + + httpd_resp_set_status(req, "200 OK"); + httpd_resp_set_type(req, "application/json"); + httpd_resp_sendstr(req, "{\"success\": true}"); + + return ESP_OK; +#else + httpd_resp_set_status(req, "404 Not Found"); + httpd_resp_sendstr(req, "{\"error\": \"TAS5805M not configured\"}"); + return ESP_OK; +#endif +} + /* * Static file handler * Serves files from embedded flash memory @@ -1175,6 +1276,29 @@ esp_err_t start_server(const char *base_path, int port) { .handler = options_handler, }; httpd_register_uri_handler(server, &_options_eq_schema_handler); + + /* URI handlers for Bi-Amp Preset API */ + httpd_uri_t _get_biamp_preset_handler = { + .uri = "/api/biamp/preset", + .method = HTTP_GET, + .handler = get_biamp_preset_handler, + }; + httpd_register_uri_handler(server, &_get_biamp_preset_handler); + + httpd_uri_t _post_biamp_preset_handler = { + .uri = "/api/biamp/preset", + .method = HTTP_POST, + .handler = post_biamp_preset_handler, + }; + httpd_register_uri_handler(server, &_post_biamp_preset_handler); + + /* OPTIONS handler for CORS preflight - Bi-Amp preset endpoint */ + httpd_uri_t _options_biamp_preset_handler = { + .uri = "/api/biamp/preset", + .method = HTTP_OPTIONS, + .handler = options_handler, + }; + httpd_register_uri_handler(server, &_options_biamp_preset_handler); #endif /* CONFIG_DAC_TAS5805M */ /* URI handler for static files (catch-all, must be last) */ From d54c0f617af87c6988b2a7337784217709c04399 Mon Sep 17 00:00:00 2001 From: craigmillard86 Date: Fri, 16 Jan 2026 00:31:16 +0000 Subject: [PATCH 44/58] Fix player reconnection crash and improve bi-amp UI controls - Fix division by zero crash in player.c when reconnecting (chkInFrames=0) - Add 300ms debouncing to EQ settings sliders to prevent flooding device - Change frequency sliders to 1 Hz increments (crossover, PEQ) - Change gain sliders to 0.5 dB increments using x2 fixed-point storage - Remove debug biquad logging from tas5805m.c and tas5805m_biamp.c - Update preset export/import to handle new gain format - Increase HTTP server stack size for bi-amp schema generation --- components/custom_board/tas5805m/tas5805m.c | 9 +- components/lightsnapcast/player.c | 9 +- .../include/tas5805m_settings.h | 6 +- components/tas5805m_settings/tas5805m_biamp.c | 38 +++-- .../tas5805m_settings/tas5805m_settings.c | 82 ++++++----- .../ui_http_server/html/eq-settings.html | 134 ++++++++++++------ components/ui_http_server/ui_http_server.c | 1 + 7 files changed, 177 insertions(+), 102 deletions(-) diff --git a/components/custom_board/tas5805m/tas5805m.c b/components/custom_board/tas5805m/tas5805m.c index 4251da95..f3207679 100644 --- a/components/custom_board/tas5805m/tas5805m.c +++ b/components/custom_board/tas5805m/tas5805m.c @@ -1170,7 +1170,10 @@ esp_err_t tas5805m_write_biquad_coefficients(TAS5805M_EQ_CHANNELS channel, int b uint8_t page, offset; uint32_t raw_value; - float coeffs[] = {b0, b1, b2, a1, a2}; + // TAS5805M uses addition convention for feedback: y = b0*x + b1*x1 + b2*x2 + a1*y1 + a2*y2 + // Standard DSP uses subtraction: y = b0*x + b1*x1 + b2*x2 - a1*y1 - a2*y2 + // So we negate a1 and a2 to convert from standard DSP convention to TAS5805M convention + float coeffs[] = {b0, b1, b2, -a1, -a2}; const char *names[] = {"B0", "B1", "B2", "A1", "A2"}; for (int i = 0; i < TAS5805M_EQ_KOEF_PER_BAND; i++) { @@ -1185,9 +1188,7 @@ esp_err_t tas5805m_write_biquad_coefficients(TAS5805M_EQ_CHANNELS channel, int b } raw_value = tas5805m_float_to_q5_27(coeffs[i]); - ESP_LOGD(TAG, "%s: Writing %s = %f -> 0x%08X to offset 0x%02X", - __func__, names[i], coeffs[i], (unsigned int)raw_value, offset); - + ret = tas5805m_write_bytes(&offset, 1, (uint8_t *)&raw_value, sizeof(raw_value)); if (ret != ESP_OK) { ESP_LOGE(TAG, "%s: Failed to write coefficient %s: %s", diff --git a/components/lightsnapcast/player.c b/components/lightsnapcast/player.c index 0d16d7eb..ad9fd0fe 100644 --- a/components/lightsnapcast/player.c +++ b/components/lightsnapcast/player.c @@ -462,12 +462,17 @@ int start_player(snapcastSetting_t *setting) { // create message queue to inform task of changed settings snapcastSettingQueueHandle = xQueueCreate(1, sizeof(uint8_t)); - if (pcmChkQHdl == NULL) + if (pcmChkQHdl == NULL) { snapcastSetting_t scSet; memset(&scSet, 0, sizeof(snapcastSetting_t)); player_get_snapcast_settings(&scSet); - + + // Validate chkInFrames to prevent division by zero during reconnection + if (scSet.chkInFrames == 0) { + scSet.chkInFrames = 1152; // Default value + } + int entries = ceil(((float)scSet.sr / (float)scSet.chkInFrames) * ((float)scSet.buf_ms / 1000)); diff --git a/components/tas5805m_settings/include/tas5805m_settings.h b/components/tas5805m_settings/include/tas5805m_settings.h index 3a125d07..ac4297cb 100644 --- a/components/tas5805m_settings/include/tas5805m_settings.h +++ b/components/tas5805m_settings/include/tas5805m_settings.h @@ -164,7 +164,7 @@ typedef enum { /** Per-output PEQ band settings */ typedef struct { uint16_t freq; // Center frequency (20-20000 Hz), 0 = disabled - int8_t gain; // Gain in dB (-15 to +15) + int8_t gain; // Gain * 2 for 0.5 dB resolution (-30 to +30 representing -15 to +15 dB) uint8_t q_x10; // Q factor * 10 (5-100 representing 0.5-10.0) } tas5805m_biamp_peq_band_t; @@ -182,12 +182,12 @@ typedef struct { uint16_t subsonic_freq; // Subsonic HPF frequency (0=off, 20-80 Hz typical) // Low output (woofer) settings - int8_t low_gain; // -24 to +24 dB + int8_t low_gain; // Gain * 2 for 0.5 dB resolution (-48 to +48 representing -24 to +24 dB) uint8_t low_phase_invert; // 0=normal, 1=invert tas5805m_biamp_peq_band_t low_peq[TAS5805M_BIAMP_PEQ_BANDS]; // High output (tweeter) settings - int8_t high_gain; // -24 to +24 dB + int8_t high_gain; // Gain * 2 for 0.5 dB resolution (-48 to +48 representing -24 to +24 dB) uint8_t high_phase_invert; // 0=normal, 1=invert tas5805m_biamp_peq_band_t high_peq[TAS5805M_BIAMP_PEQ_BANDS]; } tas5805m_biamp_settings_t; diff --git a/components/tas5805m_settings/tas5805m_biamp.c b/components/tas5805m_settings/tas5805m_biamp.c index fcd78066..b542d516 100644 --- a/components/tas5805m_settings/tas5805m_biamp.c +++ b/components/tas5805m_settings/tas5805m_biamp.c @@ -269,13 +269,12 @@ int tas5805m_biamp_get_biquad_count(tas5805m_biamp_slope_t slope) /* * Write biquad coefficients to a specific band + * Note: No delay needed between writes - the 15-band EQ writes + * coefficients consecutively without delays and works reliably */ static esp_err_t write_biquad_band(TAS5805M_EQ_CHANNELS channel, int band, const tas5805m_biquad_coeffs_t *coeffs) { - ESP_LOGD(TAG, "Writing biquad ch=%d band=%d: b0=%.6f b1=%.6f b2=%.6f a1=%.6f a2=%.6f", - channel, band, coeffs->b0, coeffs->b1, coeffs->b2, coeffs->a1, coeffs->a2); - return tas5805m_write_biquad_coefficients(channel, band, coeffs->b0, coeffs->b1, coeffs->b2, coeffs->a1, coeffs->a2); @@ -308,7 +307,7 @@ esp_err_t tas5805m_biamp_apply(const tas5805m_biamp_settings_t *settings) return ESP_ERR_INVALID_ARG; } - esp_err_t ret; + esp_err_t ret = ESP_OK; tas5805m_biquad_coeffs_t coeffs; int num_stages = tas5805m_biamp_get_biquad_count(settings->slope); float fc = (float)settings->crossover_freq; @@ -324,7 +323,8 @@ esp_err_t tas5805m_biamp_apply(const tas5805m_biamp_settings_t *settings) /* === LEFT CHANNEL (LOW/WOOFER OUTPUT) === */ /* Band 0: Gain + optional phase invert for low output */ - float low_total_gain = (float)settings->low_gain; + /* Gain is stored as x2 for 0.5 dB resolution, convert back to dB */ + float low_total_gain = (float)settings->low_gain / 2.0f; if (settings->low_phase_invert) { low_total_gain = -powf(10.0f, low_total_gain / 20.0f); coeffs.b0 = low_total_gain; @@ -377,7 +377,9 @@ esp_err_t tas5805m_biamp_apply(const tas5805m_biamp_settings_t *settings) if (peq->freq > 0 && peq->freq < fs / 2 && peq->gain != 0) { float q = (float)peq->q_x10 / 10.0f; - ret = tas5805m_calc_peq((float)peq->freq, (float)peq->gain, q, fs, &coeffs); + /* Gain is stored as x2 for 0.5 dB resolution */ + float gain_db = (float)peq->gain / 2.0f; + ret = tas5805m_calc_peq((float)peq->freq, gain_db, q, fs, &coeffs); } else { ret = tas5805m_calc_passthrough(&coeffs); } @@ -386,21 +388,22 @@ esp_err_t tas5805m_biamp_apply(const tas5805m_biamp_settings_t *settings) if (ret != ESP_OK) return ret; } - /* Fill remaining bands with passthrough (leave band 13 for loudness bass) */ + /* Fill remaining bands 9-14 with passthrough + * Note: Bands 13 (bass) and 14 (treble) may be overwritten by loudness compensation + * if enabled, but we must initialize them to passthrough to avoid garbage values + * causing DSP instability when loudness is disabled */ ret = tas5805m_calc_passthrough(&coeffs); if (ret != ESP_OK) return ret; - for (band = BIAMP_PEQ_START_BAND + BIAMP_PEQ_BANDS; band < TAS5805M_LOUDNESS_BASS_BAND; band++) { + for (band = BIAMP_PEQ_START_BAND + BIAMP_PEQ_BANDS; band <= TAS5805M_LOUDNESS_TREBLE_BAND; band++) { ret = write_biquad_band(TAS5805M_EQ_CHANNELS_LEFT, band, &coeffs); if (ret != ESP_OK) return ret; } - /* Band 14: passthrough (loudness treble not used on woofer) */ - ret = write_biquad_band(TAS5805M_EQ_CHANNELS_LEFT, TAS5805M_LOUDNESS_TREBLE_BAND, &coeffs); - if (ret != ESP_OK) return ret; /* === RIGHT CHANNEL (HIGH/TWEETER OUTPUT) === */ /* Band 0: Gain + optional phase invert for high output */ - float high_total_gain = (float)settings->high_gain; + /* Gain is stored as x2 for 0.5 dB resolution, convert back to dB */ + float high_total_gain = (float)settings->high_gain / 2.0f; if (settings->high_phase_invert) { high_total_gain = -powf(10.0f, high_total_gain / 20.0f); coeffs.b0 = high_total_gain; @@ -447,7 +450,9 @@ esp_err_t tas5805m_biamp_apply(const tas5805m_biamp_settings_t *settings) if (peq->freq > 0 && peq->freq < fs / 2 && peq->gain != 0) { float q = (float)peq->q_x10 / 10.0f; - ret = tas5805m_calc_peq((float)peq->freq, (float)peq->gain, q, fs, &coeffs); + /* Gain is stored as x2 for 0.5 dB resolution */ + float gain_db = (float)peq->gain / 2.0f; + ret = tas5805m_calc_peq((float)peq->freq, gain_db, q, fs, &coeffs); } else { ret = tas5805m_calc_passthrough(&coeffs); } @@ -456,10 +461,13 @@ esp_err_t tas5805m_biamp_apply(const tas5805m_biamp_settings_t *settings) if (ret != ESP_OK) return ret; } - /* Fill remaining bands with passthrough (leave band 14 for loudness treble) */ + /* Fill remaining bands 9-14 with passthrough + * Note: Bands 13 (bass) and 14 (treble) may be overwritten by loudness compensation + * if enabled, but we must initialize them to passthrough to avoid garbage values + * causing DSP instability when loudness is disabled */ ret = tas5805m_calc_passthrough(&coeffs); if (ret != ESP_OK) return ret; - for (band = BIAMP_PEQ_START_BAND + BIAMP_PEQ_BANDS; band < TAS5805M_LOUDNESS_TREBLE_BAND; band++) { + for (band = BIAMP_PEQ_START_BAND + BIAMP_PEQ_BANDS; band <= TAS5805M_LOUDNESS_TREBLE_BAND; band++) { ret = write_biquad_band(TAS5805M_EQ_CHANNELS_RIGHT, band, &coeffs); if (ret != ESP_OK) return ret; } diff --git a/components/tas5805m_settings/tas5805m_settings.c b/components/tas5805m_settings/tas5805m_settings.c index 91a9ee22..5e40b033 100644 --- a/components/tas5805m_settings/tas5805m_settings.c +++ b/components/tas5805m_settings/tas5805m_settings.c @@ -2958,7 +2958,7 @@ esp_err_t tas5805m_settings_get_eq_schema_json(char *json_out, size_t max_len) { cJSON_AddStringToObject(xover_freq, "unit", "Hz"); cJSON_AddNumberToObject(xover_freq, "min", 20); cJSON_AddNumberToObject(xover_freq, "max", 20000); - cJSON_AddNumberToObject(xover_freq, "step", 10); + cJSON_AddNumberToObject(xover_freq, "step", 1); cJSON_AddNumberToObject(xover_freq, "current", biamp.crossover_freq); cJSON_AddItemToArray(xover_params, xover_freq); @@ -3025,8 +3025,9 @@ esp_err_t tas5805m_settings_get_eq_schema_json(char *json_out, size_t max_len) { cJSON_AddStringToObject(low_gain, "unit", "dB"); cJSON_AddNumberToObject(low_gain, "min", -24); cJSON_AddNumberToObject(low_gain, "max", 24); - cJSON_AddNumberToObject(low_gain, "step", 1); - cJSON_AddNumberToObject(low_gain, "current", biamp.low_gain); + cJSON_AddNumberToObject(low_gain, "step", 0.5); + cJSON_AddNumberToObject(low_gain, "decimals", 1); + cJSON_AddNumberToObject(low_gain, "current", biamp.low_gain / 2.0); cJSON_AddItemToArray(low_params, low_gain); /* Subsonic HPF slider (woofer only) */ @@ -3060,11 +3061,11 @@ esp_err_t tas5805m_settings_get_eq_schema_json(char *json_out, size_t max_len) { cJSON_AddStringToObject(freq, "unit", "Hz"); cJSON_AddNumberToObject(freq, "min", 20); cJSON_AddNumberToObject(freq, "max", 20000); - cJSON_AddNumberToObject(freq, "step", 10); + cJSON_AddNumberToObject(freq, "step", 1); cJSON_AddNumberToObject(freq, "current", biamp.low_peq[i].freq); cJSON_AddItemToArray(peq_params, freq); - /* Gain */ + /* Gain (stored as x2 for 0.5 dB resolution) */ snprintf(key, sizeof(key), "biamp_low_peq%d_gain", i); cJSON *gain = cJSON_CreateObject(); cJSON_AddStringToObject(gain, "key", key); @@ -3073,8 +3074,9 @@ esp_err_t tas5805m_settings_get_eq_schema_json(char *json_out, size_t max_len) { cJSON_AddStringToObject(gain, "unit", "dB"); cJSON_AddNumberToObject(gain, "min", -15); cJSON_AddNumberToObject(gain, "max", 15); - cJSON_AddNumberToObject(gain, "step", 1); - cJSON_AddNumberToObject(gain, "current", biamp.low_peq[i].gain); + cJSON_AddNumberToObject(gain, "step", 0.5); + cJSON_AddNumberToObject(gain, "decimals", 1); + cJSON_AddNumberToObject(gain, "current", biamp.low_peq[i].gain / 2.0); cJSON_AddItemToArray(peq_params, gain); /* Q factor (stored as q_x10, display as float) */ @@ -3125,8 +3127,9 @@ esp_err_t tas5805m_settings_get_eq_schema_json(char *json_out, size_t max_len) { cJSON_AddStringToObject(high_gain, "unit", "dB"); cJSON_AddNumberToObject(high_gain, "min", -24); cJSON_AddNumberToObject(high_gain, "max", 24); - cJSON_AddNumberToObject(high_gain, "step", 1); - cJSON_AddNumberToObject(high_gain, "current", biamp.high_gain); + cJSON_AddNumberToObject(high_gain, "step", 0.5); + cJSON_AddNumberToObject(high_gain, "decimals", 1); + cJSON_AddNumberToObject(high_gain, "current", biamp.high_gain / 2.0); cJSON_AddItemToArray(high_params, high_gain); /* PEQ bands as subgroups */ @@ -3147,11 +3150,11 @@ esp_err_t tas5805m_settings_get_eq_schema_json(char *json_out, size_t max_len) { cJSON_AddStringToObject(freq, "unit", "Hz"); cJSON_AddNumberToObject(freq, "min", 20); cJSON_AddNumberToObject(freq, "max", 20000); - cJSON_AddNumberToObject(freq, "step", 10); + cJSON_AddNumberToObject(freq, "step", 1); cJSON_AddNumberToObject(freq, "current", biamp.high_peq[i].freq); cJSON_AddItemToArray(peq_params, freq); - /* Gain */ + /* Gain (stored as x2 for 0.5 dB resolution) */ snprintf(key, sizeof(key), "biamp_high_peq%d_gain", i); cJSON *gain = cJSON_CreateObject(); cJSON_AddStringToObject(gain, "key", key); @@ -3160,8 +3163,9 @@ esp_err_t tas5805m_settings_get_eq_schema_json(char *json_out, size_t max_len) { cJSON_AddStringToObject(gain, "unit", "dB"); cJSON_AddNumberToObject(gain, "min", -15); cJSON_AddNumberToObject(gain, "max", 15); - cJSON_AddNumberToObject(gain, "step", 1); - cJSON_AddNumberToObject(gain, "current", biamp.high_peq[i].gain); + cJSON_AddNumberToObject(gain, "step", 0.5); + cJSON_AddNumberToObject(gain, "decimals", 1); + cJSON_AddNumberToObject(gain, "current", biamp.high_peq[i].gain / 2.0); cJSON_AddItemToArray(peq_params, gain); /* Q factor (stored as q_x10, display as float) */ @@ -4035,17 +4039,19 @@ esp_err_t tas5805m_settings_set_eq_from_json(const char *json_in) { modified = true; ESP_LOGI(TAG, "%s: Setting bi-amp subsonic filter to %d Hz", __func__, biamp.subsonic_freq); } else if (strcmp(key, "biamp_low_gain") == 0) { - biamp.low_gain = (int8_t)item->valueint; + /* Gain comes as float in dB, store as x2 for 0.5 dB resolution */ + biamp.low_gain = (int8_t)(item->valuedouble * 2.0 + (item->valuedouble >= 0 ? 0.5 : -0.5)); modified = true; - ESP_LOGI(TAG, "%s: Setting bi-amp low gain to %d dB", __func__, biamp.low_gain); + ESP_LOGI(TAG, "%s: Setting bi-amp low gain to %.1f dB (x2=%d)", __func__, item->valuedouble, biamp.low_gain); } else if (strcmp(key, "biamp_low_phase") == 0) { biamp.low_phase_invert = (uint8_t)item->valueint; modified = true; ESP_LOGI(TAG, "%s: Setting bi-amp low phase to %d", __func__, biamp.low_phase_invert); } else if (strcmp(key, "biamp_high_gain") == 0) { - biamp.high_gain = (int8_t)item->valueint; + /* Gain comes as float in dB, store as x2 for 0.5 dB resolution */ + biamp.high_gain = (int8_t)(item->valuedouble * 2.0 + (item->valuedouble >= 0 ? 0.5 : -0.5)); modified = true; - ESP_LOGI(TAG, "%s: Setting bi-amp high gain to %d dB", __func__, biamp.high_gain); + ESP_LOGI(TAG, "%s: Setting bi-amp high gain to %.1f dB (x2=%d)", __func__, item->valuedouble, biamp.high_gain); } else if (strcmp(key, "biamp_high_phase") == 0) { biamp.high_phase_invert = (uint8_t)item->valueint; modified = true; @@ -4060,9 +4066,10 @@ esp_err_t tas5805m_settings_set_eq_from_json(const char *json_in) { modified = true; ESP_LOGI(TAG, "%s: Setting bi-amp low PEQ %d freq to %d Hz", __func__, peq_idx, biamp.low_peq[peq_idx].freq); } else if (strstr(key, "_gain") != NULL) { - biamp.low_peq[peq_idx].gain = (int8_t)item->valueint; + /* Gain comes as float in dB, store as x2 for 0.5 dB resolution */ + biamp.low_peq[peq_idx].gain = (int8_t)(item->valuedouble * 2.0 + (item->valuedouble >= 0 ? 0.5 : -0.5)); modified = true; - ESP_LOGI(TAG, "%s: Setting bi-amp low PEQ %d gain to %d dB", __func__, peq_idx, biamp.low_peq[peq_idx].gain); + ESP_LOGI(TAG, "%s: Setting bi-amp low PEQ %d gain to %.1f dB (x2=%d)", __func__, peq_idx, item->valuedouble, biamp.low_peq[peq_idx].gain); } else if (strstr(key, "_q") != NULL) { /* Q value comes as float (0.5-10.0), convert to q_x10 (5-100) */ biamp.low_peq[peq_idx].q_x10 = (uint8_t)(item->valuedouble * 10.0 + 0.5); @@ -4080,9 +4087,10 @@ esp_err_t tas5805m_settings_set_eq_from_json(const char *json_in) { modified = true; ESP_LOGI(TAG, "%s: Setting bi-amp high PEQ %d freq to %d Hz", __func__, peq_idx, biamp.high_peq[peq_idx].freq); } else if (strstr(key, "_gain") != NULL) { - biamp.high_peq[peq_idx].gain = (int8_t)item->valueint; + /* Gain comes as float in dB, store as x2 for 0.5 dB resolution */ + biamp.high_peq[peq_idx].gain = (int8_t)(item->valuedouble * 2.0 + (item->valuedouble >= 0 ? 0.5 : -0.5)); modified = true; - ESP_LOGI(TAG, "%s: Setting bi-amp high PEQ %d gain to %d dB", __func__, peq_idx, biamp.high_peq[peq_idx].gain); + ESP_LOGI(TAG, "%s: Setting bi-amp high PEQ %d gain to %.1f dB (x2=%d)", __func__, peq_idx, item->valuedouble, biamp.high_peq[peq_idx].gain); } else if (strstr(key, "_q") != NULL) { /* Q value comes as float (0.5-10.0), convert to q_x10 (5-100) */ biamp.high_peq[peq_idx].q_x10 = (uint8_t)(item->valuedouble * 10.0 + 0.5); @@ -4185,30 +4193,30 @@ esp_err_t tas5805m_biamp_preset_export(char *json_out, size_t max_len) /* Subsonic filter */ cJSON_AddNumberToObject(root, "subsonic_freq", biamp.subsonic_freq); - /* Low output (woofer) */ + /* Low output (woofer) - gains stored as x2, export as actual dB */ cJSON *low = cJSON_CreateObject(); - cJSON_AddNumberToObject(low, "gain", biamp.low_gain); + cJSON_AddNumberToObject(low, "gain", biamp.low_gain / 2.0); cJSON_AddNumberToObject(low, "phase_invert", biamp.low_phase_invert); cJSON *low_peq = cJSON_CreateArray(); for (int i = 0; i < TAS5805M_BIAMP_PEQ_BANDS; i++) { cJSON *band = cJSON_CreateObject(); cJSON_AddNumberToObject(band, "freq", biamp.low_peq[i].freq); - cJSON_AddNumberToObject(band, "gain", biamp.low_peq[i].gain); + cJSON_AddNumberToObject(band, "gain", biamp.low_peq[i].gain / 2.0); cJSON_AddNumberToObject(band, "q", biamp.low_peq[i].q_x10 / 10.0); cJSON_AddItemToArray(low_peq, band); } cJSON_AddItemToObject(low, "peq", low_peq); cJSON_AddItemToObject(root, "low_output", low); - /* High output (tweeter) */ + /* High output (tweeter) - gains stored as x2, export as actual dB */ cJSON *high = cJSON_CreateObject(); - cJSON_AddNumberToObject(high, "gain", biamp.high_gain); + cJSON_AddNumberToObject(high, "gain", biamp.high_gain / 2.0); cJSON_AddNumberToObject(high, "phase_invert", biamp.high_phase_invert); cJSON *high_peq = cJSON_CreateArray(); for (int i = 0; i < TAS5805M_BIAMP_PEQ_BANDS; i++) { cJSON *band = cJSON_CreateObject(); cJSON_AddNumberToObject(band, "freq", biamp.high_peq[i].freq); - cJSON_AddNumberToObject(band, "gain", biamp.high_peq[i].gain); + cJSON_AddNumberToObject(band, "gain", biamp.high_peq[i].gain / 2.0); cJSON_AddNumberToObject(band, "q", biamp.high_peq[i].q_x10 / 10.0); cJSON_AddItemToArray(high_peq, band); } @@ -4305,11 +4313,13 @@ esp_err_t tas5805m_biamp_preset_import(const char *json_in) cJSON *subsonic = cJSON_GetObjectItem(root, "subsonic_freq"); if (subsonic && cJSON_IsNumber(subsonic)) biamp.subsonic_freq = (uint16_t)subsonic->valueint; - /* Parse low output */ + /* Parse low output - gains in preset are actual dB, store as x2 */ cJSON *low = cJSON_GetObjectItem(root, "low_output"); if (low) { cJSON *gain = cJSON_GetObjectItem(low, "gain"); - if (gain && cJSON_IsNumber(gain)) biamp.low_gain = (int8_t)gain->valueint; + if (gain && cJSON_IsNumber(gain)) { + biamp.low_gain = (int8_t)(gain->valuedouble * 2.0 + (gain->valuedouble >= 0 ? 0.5 : -0.5)); + } cJSON *phase = cJSON_GetObjectItem(low, "phase_invert"); if (phase && cJSON_IsNumber(phase)) biamp.low_phase_invert = (uint8_t)phase->valueint; @@ -4324,18 +4334,22 @@ esp_err_t tas5805m_biamp_preset_import(const char *json_in) cJSON *g = cJSON_GetObjectItem(band, "gain"); cJSON *q = cJSON_GetObjectItem(band, "q"); if (f && cJSON_IsNumber(f)) biamp.low_peq[idx].freq = (uint16_t)f->valueint; - if (g && cJSON_IsNumber(g)) biamp.low_peq[idx].gain = (int8_t)g->valueint; + if (g && cJSON_IsNumber(g)) { + biamp.low_peq[idx].gain = (int8_t)(g->valuedouble * 2.0 + (g->valuedouble >= 0 ? 0.5 : -0.5)); + } if (q && cJSON_IsNumber(q)) biamp.low_peq[idx].q_x10 = (uint8_t)(q->valuedouble * 10.0 + 0.5); idx++; } } } - /* Parse high output */ + /* Parse high output - gains in preset are actual dB, store as x2 */ cJSON *high = cJSON_GetObjectItem(root, "high_output"); if (high) { cJSON *gain = cJSON_GetObjectItem(high, "gain"); - if (gain && cJSON_IsNumber(gain)) biamp.high_gain = (int8_t)gain->valueint; + if (gain && cJSON_IsNumber(gain)) { + biamp.high_gain = (int8_t)(gain->valuedouble * 2.0 + (gain->valuedouble >= 0 ? 0.5 : -0.5)); + } cJSON *phase = cJSON_GetObjectItem(high, "phase_invert"); if (phase && cJSON_IsNumber(phase)) biamp.high_phase_invert = (uint8_t)phase->valueint; @@ -4350,7 +4364,9 @@ esp_err_t tas5805m_biamp_preset_import(const char *json_in) cJSON *g = cJSON_GetObjectItem(band, "gain"); cJSON *q = cJSON_GetObjectItem(band, "q"); if (f && cJSON_IsNumber(f)) biamp.high_peq[idx].freq = (uint16_t)f->valueint; - if (g && cJSON_IsNumber(g)) biamp.high_peq[idx].gain = (int8_t)g->valueint; + if (g && cJSON_IsNumber(g)) { + biamp.high_peq[idx].gain = (int8_t)(g->valuedouble * 2.0 + (g->valuedouble >= 0 ? 0.5 : -0.5)); + } if (q && cJSON_IsNumber(q)) biamp.high_peq[idx].q_x10 = (uint8_t)(q->valuedouble * 10.0 + 0.5); idx++; } diff --git a/components/ui_http_server/html/eq-settings.html b/components/ui_http_server/html/eq-settings.html index 20d54265..9c0b754b 100644 --- a/components/ui_http_server/html/eq-settings.html +++ b/components/ui_http_server/html/eq-settings.html @@ -644,6 +644,7 @@

    EQ Settings

    let currentSettings = {}; let schema = {}; + const debounceTimers = {}; // Get backend URL from query parameter or default to current origin function getBackendUrl() { @@ -892,56 +893,99 @@

    EQ Settings

    settingsUI.updateAllGroupVisibility(currentSettings); } - // Update a setting + // Flush any pending debounced updates (called on page unload) + function flushPendingUpdates() { + Object.keys(debounceTimers).forEach(key => { + if (debounceTimers[key]) { + clearTimeout(debounceTimers[key].timerId); + // Send the pending update synchronously + const { value } = debounceTimers[key]; + navigator.sendBeacon('/api/eq/settings', JSON.stringify({ [key]: value })); + delete debounceTimers[key]; + } + }); + } + + // Flush pending updates before page unload + window.addEventListener('beforeunload', flushPendingUpdates); + window.addEventListener('pagehide', flushPendingUpdates); + + // Update a setting with debouncing (300ms delay to match DSP/DAC pages) async function updateSetting(key, value) { - try { + // Update local state immediately for responsive UI + currentSettings[key] = value; + + // Check if this is a mode change - these should happen immediately + const isModeChange = (key === 'eq_ui_mode'); + + if (isModeChange) { + // Mode changes happen immediately without debounce + try { const update = { [key]: value }; - console.log(`Updating ${key} = ${value}`); + console.log(`Updating ${key} = ${value} (immediate)`); await postRequest('/api/eq/settings', update); - - // Check if this is a mode change or gain/preset change BEFORE updating local state - const isModeChange = (key === 'eq_ui_mode'); - const currentMode = currentSettings.eq_ui_mode; - const isAutoMode = (currentMode === 1 || currentMode === 2 || currentMode === 3); // 15-band, 15-band biamp, or preset - const isGainOrPresetChange = key.startsWith('eq_gain_') || key.startsWith('eq_profile_'); - - // Update local state after checking - currentSettings[key] = value; - - if (isModeChange) { - // Mode change - always reload schema and settings - console.log('Mode changed, reloading schema and settings...'); - const backendUrl = getBackendUrl(); - const [schemaResponse, settingsResponse] = await Promise.all([ - fetch(`${backendUrl}/api/eq/schema`), - fetch(`${backendUrl}/api/eq/settings`) - ]); - if (schemaResponse.ok && settingsResponse.ok) { - schema = await schemaResponse.json(); - currentSettings = await settingsResponse.json(); - renderUI(); - } else { - updateAllGroupVisibility(); - } - } else if (isAutoMode && isGainOrPresetChange) { - // In auto modes, when gains or presets change, the DAC calculates new BQ coefficients - // Reload both schema and settings to get the actual coefficients that were applied to the DAC - console.log('Reloading schema and settings to fetch actual DAC coefficients...'); - const backendUrl = getBackendUrl(); - const [schemaResponse, settingsResponse] = await Promise.all([ - fetch(`${backendUrl}/api/eq/schema`), - fetch(`${backendUrl}/api/eq/settings`) - ]); - if (schemaResponse.ok && settingsResponse.ok) { - schema = await schemaResponse.json(); - currentSettings = await settingsResponse.json(); - renderUI(); // Re-render to show updated coefficients - } + + // Mode change - reload schema and settings + console.log('Mode changed, reloading schema and settings...'); + const backendUrl = getBackendUrl(); + const [schemaResponse, settingsResponse] = await Promise.all([ + fetch(`${backendUrl}/api/eq/schema`), + fetch(`${backendUrl}/api/eq/settings`) + ]); + if (schemaResponse.ok && settingsResponse.ok) { + schema = await schemaResponse.json(); + currentSettings = await settingsResponse.json(); + renderUI(); + } else { + updateAllGroupVisibility(); } - } catch (error) { - console.error('Error updating setting:', error); - alert(`Error updating setting: ${error.message}`); + } catch (error) { + console.error('Error updating setting:', error); + alert(`Error updating setting: ${error.message}`); + } + return; + } + + // Debounce: clear any pending update for this parameter + if (debounceTimers[key]) { + clearTimeout(debounceTimers[key].timerId); } + + // Store the pending value and set a new timer + debounceTimers[key] = { + value: value, + timerId: setTimeout(async () => { + try { + const update = { [key]: value }; + console.log(`Updating ${key} = ${value} (debounced)`); + await postRequest('/api/eq/settings', update); + + // Check if we need to reload for coefficient updates + const currentMode = currentSettings.eq_ui_mode; + const isAutoMode = (currentMode === 1 || currentMode === 2 || currentMode === 3); + const isGainOrPresetChange = key.startsWith('eq_gain_') || key.startsWith('eq_profile_'); + + if (isAutoMode && isGainOrPresetChange) { + // In auto modes, reload to get actual DAC coefficients + console.log('Reloading schema and settings to fetch actual DAC coefficients...'); + const backendUrl = getBackendUrl(); + const [schemaResponse, settingsResponse] = await Promise.all([ + fetch(`${backendUrl}/api/eq/schema`), + fetch(`${backendUrl}/api/eq/settings`) + ]); + if (schemaResponse.ok && settingsResponse.ok) { + schema = await schemaResponse.json(); + currentSettings = await settingsResponse.json(); + renderUI(); + } + } + } catch (error) { + console.error('Error updating setting:', error); + alert(`Error updating setting: ${error.message}`); + } + delete debounceTimers[key]; + }, 300) // 300ms debounce delay + }; } // Load settings on page load diff --git a/components/ui_http_server/ui_http_server.c b/components/ui_http_server/ui_http_server.c index f6d022a7..504ed7b0 100644 --- a/components/ui_http_server/ui_http_server.c +++ b/components/ui_http_server/ui_http_server.c @@ -1096,6 +1096,7 @@ esp_err_t start_server(const char *base_path, int port) { config.max_open_sockets = 7; config.max_uri_handlers = 64; config.lru_purge_enable = true; // Enable LRU socket purging + config.stack_size = 8192; // Increased for bi-amp schema generation /* Enable wildcard URI matching for static file handler */ config.uri_match_fn = httpd_uri_match_wildcard; From 55ae3850eaef483c411e6c9a56243c3f247ab8af Mon Sep 17 00:00:00 2001 From: craigmillard86 Date: Fri, 16 Jan 2026 20:09:00 +0000 Subject: [PATCH 45/58] Expand PEQ to 6 bands and group loudness zones in UI - Increase PEQ bands from 3 to 6 per channel (12 total) - Update biquad allocation: bands 6-11 for PEQ, band 12 spare - Reorganize loudness UI to group parameters by zone - Each zone shows volume range, threshold, bass, and treble together - Add renderLoudnessZone() function and CSS for grouped layout --- .../include/tas5805m_biamp.h | 6 +- .../include/tas5805m_settings.h | 2 +- .../tas5805m_settings/tas5805m_settings.c | 85 ++++++++++--------- .../ui_http_server/html/eq-settings.html | 61 ++++++++----- components/ui_http_server/html/settings-ui.js | 67 +++++++++++++++ 5 files changed, 159 insertions(+), 62 deletions(-) diff --git a/components/tas5805m_settings/include/tas5805m_biamp.h b/components/tas5805m_settings/include/tas5805m_biamp.h index 4a6b96e5..7402e47f 100644 --- a/components/tas5805m_settings/include/tas5805m_biamp.h +++ b/components/tas5805m_settings/include/tas5805m_biamp.h @@ -60,8 +60,8 @@ typedef enum { * - Band 0: Gain/phase - Band 0: Gain/phase * - Band 1: Subsonic HPF - Band 1: Passthrough * - Bands 2-5: Lowpass crossover - Bands 2-5: Highpass crossover - * - Bands 6-8: PEQ (3 bands) - Bands 6-8: PEQ (3 bands) - * - Bands 9-12: Passthrough - Bands 9-12: Passthrough + * - Bands 6-11: PEQ (6 bands) - Bands 6-11: PEQ (6 bands) + * - Band 12: Passthrough (spare) - Band 12: Passthrough (spare) * - Band 13: Bass shelf (loudness) - Band 13: Passthrough * - Band 14: Passthrough - Band 14: Treble shelf (loudness) */ @@ -70,7 +70,7 @@ typedef enum { #define BIAMP_CROSSOVER_START_BAND 2 #define BIAMP_CROSSOVER_MAX_BANDS 4 /* Max 4 filter stages (48dB slope) */ #define BIAMP_PEQ_START_BAND 6 -#define BIAMP_PEQ_BANDS 3 +#define BIAMP_PEQ_BANDS 6 /** * @brief Calculate 2nd-order Butterworth lowpass filter coefficients diff --git a/components/tas5805m_settings/include/tas5805m_settings.h b/components/tas5805m_settings/include/tas5805m_settings.h index ac4297cb..e8572c59 100644 --- a/components/tas5805m_settings/include/tas5805m_settings.h +++ b/components/tas5805m_settings/include/tas5805m_settings.h @@ -168,7 +168,7 @@ typedef struct { uint8_t q_x10; // Q factor * 10 (5-100 representing 0.5-10.0) } tas5805m_biamp_peq_band_t; -#define TAS5805M_BIAMP_PEQ_BANDS 3 // PEQ bands per output +#define TAS5805M_BIAMP_PEQ_BANDS 6 // PEQ bands per output /** Advanced bi-amp crossover settings */ typedef struct { diff --git a/components/tas5805m_settings/tas5805m_settings.c b/components/tas5805m_settings/tas5805m_settings.c index 5e40b033..d024b1af 100644 --- a/components/tas5805m_settings/tas5805m_settings.c +++ b/components/tas5805m_settings/tas5805m_settings.c @@ -3229,60 +3229,69 @@ esp_err_t tas5805m_settings_get_eq_schema_json(char *json_out, size_t max_len) { cJSON *visibleWhen = cJSON_CreateObject(); cJSON_AddNumberToObject(visibleWhen, "loudness_enabled", 1); - /* Volume thresholds (hidden when off) */ - for (int i = 0; i < TAS5805M_LOUDNESS_ZONES - 1; i++) { - char lkey[24], lname[32]; - snprintf(lkey, sizeof(lkey), "loudness_thresh_%d", i); - snprintf(lname, sizeof(lname), "Zone %d Thresh", i + 1); - cJSON *thresh = cJSON_CreateObject(); - cJSON_AddStringToObject(thresh, "key", lkey); - cJSON_AddStringToObject(thresh, "name", lname); - cJSON_AddStringToObject(thresh, "type", "range"); - cJSON_AddStringToObject(thresh, "unit", "%"); - cJSON_AddNumberToObject(thresh, "min", 0); - cJSON_AddNumberToObject(thresh, "max", 100); - cJSON_AddNumberToObject(thresh, "step", 5); - cJSON_AddNumberToObject(thresh, "current", loudness.thresholds[i]); - cJSON_AddItemToObject(thresh, "visibleWhen", cJSON_Duplicate(visibleWhen, 1)); - cJSON_AddItemToArray(loud_params, thresh); - } - - /* Bass boost per zone (hidden when off) */ + /* Create grouped zones - each zone has threshold (except last), bass, treble */ for (int i = 0; i < TAS5805M_LOUDNESS_ZONES; i++) { - char lkey[24], lname[32]; - snprintf(lkey, sizeof(lkey), "loudness_bass_%d", i); - snprintf(lname, sizeof(lname), "Z%d Bass", i + 1); + cJSON *zone_group = cJSON_CreateObject(); + char zone_name[48]; + + /* Calculate volume range for this zone */ + int vol_start = (i == 0) ? 0 : loudness.thresholds[i - 1]; + int vol_end = (i < TAS5805M_LOUDNESS_ZONES - 1) ? loudness.thresholds[i] : 100; + snprintf(zone_name, sizeof(zone_name), "Zone %d (%d%% - %d%%)", i + 1, vol_start, vol_end); + + cJSON_AddStringToObject(zone_group, "name", zone_name); + cJSON_AddStringToObject(zone_group, "type", "loudness-zone"); + cJSON_AddNumberToObject(zone_group, "zone_index", i); + cJSON_AddItemToObject(zone_group, "visibleWhen", cJSON_Duplicate(visibleWhen, 1)); + + cJSON *zone_params = cJSON_CreateArray(); + + /* Threshold slider (zones 0-3 have thresholds, zone 4 ends at 100%) */ + if (i < TAS5805M_LOUDNESS_ZONES - 1) { + char tkey[24]; + snprintf(tkey, sizeof(tkey), "loudness_thresh_%d", i); + cJSON *thresh = cJSON_CreateObject(); + cJSON_AddStringToObject(thresh, "key", tkey); + cJSON_AddStringToObject(thresh, "name", "Upper Limit"); + cJSON_AddStringToObject(thresh, "type", "range"); + cJSON_AddStringToObject(thresh, "unit", "%"); + cJSON_AddNumberToObject(thresh, "min", 0); + cJSON_AddNumberToObject(thresh, "max", 100); + cJSON_AddNumberToObject(thresh, "step", 5); + cJSON_AddNumberToObject(thresh, "current", loudness.thresholds[i]); + cJSON_AddItemToArray(zone_params, thresh); + } + + /* Bass boost */ + char bkey[24]; + snprintf(bkey, sizeof(bkey), "loudness_bass_%d", i); cJSON *bass = cJSON_CreateObject(); - cJSON_AddStringToObject(bass, "key", lkey); - cJSON_AddStringToObject(bass, "label", lname); - cJSON_AddStringToObject(bass, "name", lname); + cJSON_AddStringToObject(bass, "key", bkey); + cJSON_AddStringToObject(bass, "name", "Bass"); cJSON_AddStringToObject(bass, "type", "range"); cJSON_AddStringToObject(bass, "unit", "dB"); cJSON_AddNumberToObject(bass, "min", -12); cJSON_AddNumberToObject(bass, "max", 12); cJSON_AddNumberToObject(bass, "step", 1); cJSON_AddNumberToObject(bass, "current", loudness.bass_boost[i]); - cJSON_AddItemToObject(bass, "visibleWhen", cJSON_Duplicate(visibleWhen, 1)); - cJSON_AddItemToArray(loud_params, bass); - } + cJSON_AddItemToArray(zone_params, bass); - /* Treble boost per zone (hidden when off) */ - for (int i = 0; i < TAS5805M_LOUDNESS_ZONES; i++) { - char lkey[24], lname[32]; - snprintf(lkey, sizeof(lkey), "loudness_treble_%d", i); - snprintf(lname, sizeof(lname), "Z%d Treble", i + 1); + /* Treble boost */ + char trkey[24]; + snprintf(trkey, sizeof(trkey), "loudness_treble_%d", i); cJSON *treble = cJSON_CreateObject(); - cJSON_AddStringToObject(treble, "key", lkey); - cJSON_AddStringToObject(treble, "label", lname); - cJSON_AddStringToObject(treble, "name", lname); + cJSON_AddStringToObject(treble, "key", trkey); + cJSON_AddStringToObject(treble, "name", "Treble"); cJSON_AddStringToObject(treble, "type", "range"); cJSON_AddStringToObject(treble, "unit", "dB"); cJSON_AddNumberToObject(treble, "min", -12); cJSON_AddNumberToObject(treble, "max", 12); cJSON_AddNumberToObject(treble, "step", 1); cJSON_AddNumberToObject(treble, "current", loudness.treble_boost[i]); - cJSON_AddItemToObject(treble, "visibleWhen", cJSON_Duplicate(visibleWhen, 1)); - cJSON_AddItemToArray(loud_params, treble); + cJSON_AddItemToArray(zone_params, treble); + + cJSON_AddItemToObject(zone_group, "parameters", zone_params); + cJSON_AddItemToArray(loud_params, zone_group); } cJSON_Delete(visibleWhen); diff --git a/components/ui_http_server/html/eq-settings.html b/components/ui_http_server/html/eq-settings.html index 9c0b754b..12885b14 100644 --- a/components/ui_http_server/html/eq-settings.html +++ b/components/ui_http_server/html/eq-settings.html @@ -596,40 +596,61 @@ gap: 10px; } - .loudness-zones-container { - display: grid; - grid-template-columns: repeat(5, 1fr); - gap: 10px; + /* Loudness Zone grouped layout */ + .loudness-zone { + background-color: #f8f9fa; + border: 1px solid #e0e0e0; + border-radius: 8px; + padding: 12px; + margin-bottom: 12px; } - @media (max-width: 600px) { - .loudness-zones-container { - grid-template-columns: repeat(3, 1fr); - } + .loudness-zone-header { + font-weight: bold; + font-size: 14px; + color: #495057; + margin-bottom: 10px; + padding-bottom: 6px; + border-bottom: 1px solid #dee2e6; } - .loudness-zone { + .loudness-zone-params { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); + gap: 12px; + } + + .loudness-zone-param { display: flex; flex-direction: column; align-items: center; - background-color: #e9ecef; - border-radius: 6px; - padding: 10px; } - .loudness-zone .zone-label { + .loudness-zone-param label { font-size: 12px; - font-weight: bold; - color: #495057; - margin-bottom: 8px; + color: #666; + margin-bottom: 4px; + font-weight: 500; } - .loudness-zone .eq-band-slider { - min-width: 40px; + .loudness-zone-param input[type="range"] { + width: 100%; + height: 6px; + margin: 4px 0; } - .loudness-zone .eq-band-slider input[type="range"] { - height: 100px; + .loudness-zone-value { + font-size: 13px; + color: #007bff; + font-weight: bold; + margin-top: 4px; + } + + /* Section-specific layout for loudness */ + .section-loudness .section-params { + display: flex; + flex-direction: column; + gap: 8px; } diff --git a/components/ui_http_server/html/settings-ui.js b/components/ui_http_server/html/settings-ui.js index e2df4bd4..36b7baa2 100644 --- a/components/ui_http_server/html/settings-ui.js +++ b/components/ui_http_server/html/settings-ui.js @@ -282,6 +282,55 @@ return groupDiv; } + // Render a loudness zone subgroup (threshold, bass, treble grouped together) + function renderLoudnessZone(subgroup, currentSettings, onChange) { + const groupDiv = document.createElement('div'); + groupDiv.className = 'loudness-zone'; + + const header = document.createElement('div'); + header.className = 'loudness-zone-header'; + header.textContent = subgroup.name; + groupDiv.appendChild(header); + + const paramsRow = document.createElement('div'); + paramsRow.className = 'loudness-zone-params'; + + subgroup.parameters.forEach(param => { + const controlDiv = document.createElement('div'); + controlDiv.className = 'loudness-zone-param'; + + const label = document.createElement('label'); + label.textContent = param.name; + controlDiv.appendChild(label); + + const input = document.createElement('input'); + input.type = 'range'; + input.min = param.min; + input.max = param.max; + input.step = param.step || 1; + input.value = param.current !== undefined ? param.current : param.default || param.min; + + const valueSpan = document.createElement('span'); + valueSpan.className = 'loudness-zone-value'; + const decimals = param.decimals !== undefined ? param.decimals : 0; + valueSpan.textContent = Number(input.value).toFixed(decimals) + (param.unit || ''); + + input.oninput = function () { + valueSpan.textContent = Number(this.value).toFixed(decimals) + (param.unit || ''); + }; + input.onchange = function () { + if (onChange) onChange(param.key, parseFloat(this.value)); + }; + + controlDiv.appendChild(input); + controlDiv.appendChild(valueSpan); + paramsRow.appendChild(controlDiv); + }); + + groupDiv.appendChild(paramsRow); + return groupDiv; + } + // Render a section within a group (for biamp Low/High columns) function renderSection(section, currentSettings, onChange) { const sectionDiv = document.createElement('div'); @@ -332,6 +381,23 @@ } paramsContainer.appendChild(controlDiv); }); + } else if (section.layout === 'loudness') { + // Loudness layout: enable toggle + loudness-zone subgroups + section.parameters.forEach(param => { + let controlDiv; + if (param.type === 'loudness-zone') { + controlDiv = renderLoudnessZone(param, currentSettings, onChange); + } else { + controlDiv = renderParameter(param, currentSettings, onChange); + } + if (param.visibleWhen) { + controlDiv.setAttribute('data-visible-when', JSON.stringify(param.visibleWhen)); + if (!isParameterVisible(param, currentSettings)) { + controlDiv.style.display = 'none'; + } + } + paramsContainer.appendChild(controlDiv); + }); } else { section.parameters.forEach(param => { const controlDiv = renderParameter(param, currentSettings, onChange); @@ -424,6 +490,7 @@ renderParameter, renderVerticalSlider, renderPeqSubgroup, + renderLoudnessZone, renderSection, isParameterVisible, updateConditionalVisibility, From 3dd8da67f6f60638532b653d696045aece4dbdbd Mon Sep 17 00:00:00 2001 From: craigmillard86 Date: Sat, 17 Jan 2026 13:02:38 +0000 Subject: [PATCH 46/58] Fix bi-amp bugs, add security hardening, and improve documentation Bug fixes: - Fix loudness not applying (static cache never initialized from NVS) - Fix loudness always on when disabled (now resets bands to passthrough) - Fix phase/crossover not working (missing ADVANCED_BIAMP case in EQ mode switch) - Fix I2C mutex race condition with spinlock for initialization - Fix baffle placement showing as slider instead of dropdown Security hardening: - Fix buffer overflow in find_key_value() with size parameter - Add URL decode hex digit validation - Restrict CORS to localhost and private IP ranges - Add gain overflow validation and Q5.27 range clamping - Add crossover frequency bounds validation (20-20000 Hz) Documentation: - Add comprehensive doxygen-style documentation to tas5805m_biamp.h - Add comprehensive doxygen-style documentation to tas5805m_biamp.c - Add ADVANCED_BIAMP_USER_GUIDE.md with full feature documentation --- components/custom_board/tas5805m/tas5805m.c | 53 +- .../include/tas5805m_biamp.h | 382 ++++++-- .../include/tas5805m_settings.h | 52 + components/tas5805m_settings/tas5805m_biamp.c | 910 ++++++++++++++++-- .../tas5805m_settings/tas5805m_settings.c | 555 +++++++++-- .../ui_http_server/html/eq-settings.html | 25 + components/ui_http_server/html/settings-ui.js | 61 +- components/ui_http_server/ui_http_server.c | 125 ++- docs/ADVANCED_BIAMP_USER_GUIDE.md | 385 ++++++++ 9 files changed, 2262 insertions(+), 286 deletions(-) create mode 100644 docs/ADVANCED_BIAMP_USER_GUIDE.md diff --git a/components/custom_board/tas5805m/tas5805m.c b/components/custom_board/tas5805m/tas5805m.c index f3207679..61cc9b63 100644 --- a/components/custom_board/tas5805m/tas5805m.c +++ b/components/custom_board/tas5805m/tas5805m.c @@ -30,6 +30,8 @@ #include "i2c_bus.h" #include "tas5805m_reg_cfg.h" #include +#include "freertos/semphr.h" +#include "freertos/portmacro.h" #if CONFIG_DAC_TAS5805M #include "tas5805m_settings.h" @@ -37,6 +39,11 @@ static const char *TAG = "TAS5805M"; +/* Mutex for thread-safe I2C access */ +static SemaphoreHandle_t tas5805m_i2c_mutex = NULL; +/* Spinlock to protect mutex initialization (prevents TOCTOU race) */ +static portMUX_TYPE tas5805m_init_lock = portMUX_INITIALIZER_UNLOCKED; + #define TAS5805M_SET_BOOK_AND_PAGE(BOOK, PAGE) \ do { \ tas5805m_write_byte(TAS5805M_REG_PAGE_SET, TAS5805M_REG_PAGE_ZERO); \ @@ -130,6 +137,11 @@ void i2c_master_init() { // Reading of TAS5805M-Register esp_err_t tas5805m_read_byte(uint8_t register_name, uint8_t *data) { + if (tas5805m_i2c_mutex && xSemaphoreTakeRecursive(tas5805m_i2c_mutex, pdMS_TO_TICKS(1000)) != pdTRUE) { + ESP_LOGE(TAG, "%s: Failed to acquire I2C mutex", __func__); + return ESP_ERR_TIMEOUT; + } + int ret; i2c_cmd_handle_t cmd = i2c_cmd_link_create(); i2c_master_start(cmd); @@ -154,11 +166,18 @@ esp_err_t tas5805m_read_byte(uint8_t register_name, uint8_t *data) { 1000 / portTICK_PERIOD_MS); i2c_cmd_link_delete(cmd); ESP_LOGV(TAG, "%s: Read 0x%02x from register 0x%02x", __func__, *data, register_name); + + if (tas5805m_i2c_mutex) xSemaphoreGiveRecursive(tas5805m_i2c_mutex); return ret; } // Writing of TAS5805M-Register esp_err_t tas5805m_write_byte(uint8_t register_name, uint8_t value) { + if (tas5805m_i2c_mutex && xSemaphoreTakeRecursive(tas5805m_i2c_mutex, pdMS_TO_TICKS(1000)) != pdTRUE) { + ESP_LOGE(TAG, "%s: Failed to acquire I2C mutex", __func__); + return ESP_ERR_TIMEOUT; + } + int ret = 0; ESP_LOGV(TAG, "%s: Writing 0x%02x to register 0x%02x", __func__, value, register_name); @@ -179,12 +198,18 @@ esp_err_t tas5805m_write_byte(uint8_t register_name, uint8_t value) { i2c_cmd_link_delete(cmd); + if (tas5805m_i2c_mutex) xSemaphoreGiveRecursive(tas5805m_i2c_mutex); return ret; } esp_err_t tas5805m_write_bytes(uint8_t *reg, int regLen, uint8_t *data, int datalen) { + if (tas5805m_i2c_mutex && xSemaphoreTakeRecursive(tas5805m_i2c_mutex, pdMS_TO_TICKS(1000)) != pdTRUE) { + ESP_LOGE(TAG, "%s: Failed to acquire I2C mutex", __func__); + return ESP_ERR_TIMEOUT; + } + int ret = ESP_OK; ESP_LOGV(TAG, "%s: 0x%02x <- [%d] bytes", __func__, *reg, datalen); for (int i = 0; i < datalen; i++) @@ -208,11 +233,17 @@ esp_err_t tas5805m_write_bytes(uint8_t *reg, i2c_cmd_link_delete(cmd); + if (tas5805m_i2c_mutex) xSemaphoreGiveRecursive(tas5805m_i2c_mutex); return ret; } esp_err_t tas5805m_read_bytes(uint8_t *reg, int regLen, uint8_t *data, int datalen) { + if (tas5805m_i2c_mutex && xSemaphoreTakeRecursive(tas5805m_i2c_mutex, pdMS_TO_TICKS(1000)) != pdTRUE) { + ESP_LOGE(TAG, "%s: Failed to acquire I2C mutex", __func__); + return ESP_ERR_TIMEOUT; + } + int ret = ESP_OK; ESP_LOGV(TAG, "%s: 0x%02x -> [%d] bytes", __func__, *reg, datalen); @@ -226,11 +257,12 @@ esp_err_t tas5805m_read_bytes(uint8_t *reg, int regLen, uint8_t *data, int datal if (ret != ESP_OK) { ESP_LOGE(TAG, "%s: Error during I2C write phase: %s", __func__, esp_err_to_name(ret)); + if (tas5805m_i2c_mutex) xSemaphoreGiveRecursive(tas5805m_i2c_mutex); return ret; } vTaskDelay(1 / portTICK_PERIOD_MS); - + cmd = i2c_cmd_link_create(); ret |= i2c_master_start(cmd); ret |= i2c_master_write_byte(cmd, TAS5805M_ADDRESS << 1 | READ_BIT, ACK_CHECK_EN); @@ -251,6 +283,7 @@ esp_err_t tas5805m_read_bytes(uint8_t *reg, int regLen, uint8_t *data, int datal i2c_cmd_link_delete(cmd); + if (tas5805m_i2c_mutex) xSemaphoreGiveRecursive(tas5805m_i2c_mutex); return ret; } @@ -258,6 +291,20 @@ esp_err_t tas5805m_read_bytes(uint8_t *reg, int regLen, uint8_t *data, int datal esp_err_t tas5805m_init() { ESP_LOGD(TAG, "%s: Initializing TAS5805M", __func__); int ret = 0; + + /* Create I2C mutex if not already created (recursive to allow nested calls) */ + /* Use spinlock to prevent TOCTOU race if init is called concurrently */ + portENTER_CRITICAL(&tas5805m_init_lock); + if (tas5805m_i2c_mutex == NULL) { + tas5805m_i2c_mutex = xSemaphoreCreateRecursiveMutex(); + if (tas5805m_i2c_mutex == NULL) { + portEXIT_CRITICAL(&tas5805m_init_lock); + ESP_LOGE(TAG, "%s: Failed to create I2C mutex", __func__); + return ESP_ERR_NO_MEM; + } + } + portEXIT_CRITICAL(&tas5805m_init_lock); + // Init the I2C-Driver i2c_master_init(); /* Register the PDN pin as output and write 1 to enable the TAS chip */ @@ -1249,8 +1296,8 @@ uint32_t tas5805m_float_to_q5_27(float value) int32_t fixed_val = (int32_t)(value * (1 << 27)); uint32_t le_val = tas5805m_swap_endian_32((uint32_t)fixed_val); - // ESP_LOGD(TAG, "%s: value=%f -> fixed_val=%d, le_val=0x%08X", - // __func__, value, fixed_val, (unsigned int)le_val); + ESP_LOGD(TAG, "%s: value=%f -> fixed_val=%ld, le_val=0x%08lX", + __func__, value, (long)fixed_val, (unsigned long)le_val); return le_val; } diff --git a/components/tas5805m_settings/include/tas5805m_biamp.h b/components/tas5805m_settings/include/tas5805m_biamp.h index 7402e47f..d284ab2f 100644 --- a/components/tas5805m_settings/include/tas5805m_biamp.h +++ b/components/tas5805m_settings/include/tas5805m_biamp.h @@ -1,22 +1,46 @@ -/* - * tas5805m_biamp.h - * Advanced Bi-Amp Crossover coefficient calculations for TAS5805M +/** + * @file tas5805m_biamp.h + * @brief Advanced Bi-Amp Crossover DSP for TAS5805M + * + * This module provides biquad filter coefficient calculations and hardware + * programming for active crossover configurations on the TAS5805M DAC. + * + * @section biamp_overview Overview + * + * In bi-amp mode, the TAS5805M's stereo outputs are repurposed: + * - Left channel -> Lowpass filter -> Woofer amplifier + * - Right channel -> Highpass filter -> Tweeter amplifier + * + * @section biamp_filters Crossover Filter Types + * + * Butterworth: + * - -3dB at crossover frequency + * - Maximally flat passband + * - 180° phase shift at crossover (12dB/oct), 360° (24dB/oct) + * + * Linkwitz-Riley: + * - -6dB at crossover frequency + * - Flat summed amplitude response when drivers are in-phase + * - Created by cascading two Butterworth filters * - * This module provides functions to calculate and apply biquad filter - * coefficients for active crossover configurations on the TAS5805M DAC. + * @section biamp_slopes Supported Slopes * - * In bi-amp mode: - * - Left channel output -> Low-pass filter -> Woofer - * - Right channel output -> High-pass filter -> Tweeter + * - 12 dB/octave: 1 biquad stage (2nd order) + * - 24 dB/octave: 2 biquad stages (4th order, standard LR) + * - 48 dB/octave: 4 biquad stages (8th order) * - * Supported crossover types: - * - Butterworth: -3dB at crossover frequency - * - Linkwitz-Riley: -6dB at crossover frequency, flat summed response + * @section biamp_bands Biquad Band Allocation * - * Supported slopes: - * - 12 dB/octave (1 biquad stage) - * - 24 dB/octave (2 biquad stages, standard Linkwitz-Riley) - * - 48 dB/octave (4 biquad stages) + * Each channel has 15 biquad bands (0-14). Bi-amp mode allocates them as: + * + * LEFT (Woofer): RIGHT (Tweeter): + * - Band 0: Gain + phase - Band 0: Gain + phase + * - Band 1: Subsonic HPF - Band 1: Time alignment delay + * - Bands 2-5: Lowpass crossover - Bands 2-5: Highpass crossover + * - Bands 6-11: Parametric EQ - Bands 6-11: Parametric EQ + * - Band 12: Baffle step compensation - Band 12: Breakup notch filter + * - Band 13: Bass shelf (loudness) - Band 13: Air/brilliance shelf + * - Band 14: Spare (loudness treble) - Band 14: Treble shelf (loudness) */ #ifndef __TAS5805M_BIAMP_H__ @@ -35,16 +59,25 @@ extern "C" { #include "tas5805m_settings.h" #include "tas5805m_types.h" -/* Biquad filter coefficient structure */ +/** + * @brief Biquad filter coefficient structure + * + * Standard direct form I biquad transfer function: + * H(z) = (b0 + b1*z^-1 + b2*z^-2) / (1 + a1*z^-1 + a2*z^-2) + * + * Note: a0 is normalized to 1.0 and not stored. + */ typedef struct { - float b0; - float b1; - float b2; - float a1; - float a2; + float b0; /**< Feedforward coefficient 0 (input gain) */ + float b1; /**< Feedforward coefficient 1 */ + float b2; /**< Feedforward coefficient 2 */ + float a1; /**< Feedback coefficient 1 */ + float a2; /**< Feedback coefficient 2 */ } tas5805m_biquad_coeffs_t; -/* Supported sample rates for coefficient calculations */ +/** + * @brief Supported sample rates for coefficient calculations + */ typedef enum { BIAMP_SAMPLE_RATE_44100 = 44100, BIAMP_SAMPLE_RATE_48000 = 48000, @@ -52,135 +85,314 @@ typedef enum { BIAMP_SAMPLE_RATE_96000 = 96000, } tas5805m_biamp_sample_rate_t; +/** Default sample rate used when none specified */ #define TAS5805M_BIAMP_DEFAULT_SAMPLE_RATE BIAMP_SAMPLE_RATE_48000 -/* Biquad allocation for bi-amp mode (optimal order for headroom): - * - * LEFT (Woofer): RIGHT (Tweeter): - * - Band 0: Gain/phase - Band 0: Gain/phase - * - Band 1: Subsonic HPF - Band 1: Passthrough - * - Bands 2-5: Lowpass crossover - Bands 2-5: Highpass crossover - * - Bands 6-11: PEQ (6 bands) - Bands 6-11: PEQ (6 bands) - * - Band 12: Passthrough (spare) - Band 12: Passthrough (spare) - * - Band 13: Bass shelf (loudness) - Band 13: Passthrough - * - Band 14: Passthrough - Band 14: Treble shelf (loudness) - */ -#define BIAMP_GAIN_BAND 0 -#define BIAMP_SUBSONIC_BAND 1 /* Subsonic HPF (woofer only) */ -#define BIAMP_CROSSOVER_START_BAND 2 -#define BIAMP_CROSSOVER_MAX_BANDS 4 /* Max 4 filter stages (48dB slope) */ -#define BIAMP_PEQ_START_BAND 6 -#define BIAMP_PEQ_BANDS 6 +/* ============ Biquad Band Assignments ============ */ + +#define BIAMP_GAIN_BAND 0 /**< Gain and phase control */ +#define BIAMP_SUBSONIC_BAND 1 /**< Subsonic HPF (woofer channel) */ +#define BIAMP_TWEETER_DELAY_BAND 1 /**< Time alignment all-pass (tweeter channel) */ +#define BIAMP_CROSSOVER_START_BAND 2 /**< First crossover filter band */ +#define BIAMP_CROSSOVER_MAX_BANDS 4 /**< Maximum crossover stages (48dB/oct) */ +#define BIAMP_PEQ_START_BAND 6 /**< First parametric EQ band */ +#define BIAMP_PEQ_BANDS 6 /**< Number of PEQ bands per channel */ +#define BIAMP_BAFFLE_STEP_BAND 12 /**< Baffle step compensation (woofer) */ +#define BIAMP_NOTCH_BAND 12 /**< Breakup notch filter (tweeter) */ +#define BIAMP_AIR_SHELF_BAND 13 /**< Air/brilliance shelf (tweeter) */ + +/* ============ Filter Coefficient Calculators ============ */ /** * @brief Calculate 2nd-order Butterworth lowpass filter coefficients * - * @param fc Cutoff frequency in Hz - * @param fs Sample rate in Hz - * @param coeffs Output coefficients - * @return ESP_OK on success + * Butterworth filters have maximally flat passband response. + * Uses bilinear transform with frequency pre-warping. + * + * @param fc Cutoff frequency in Hz (-3dB point) + * @param fs Sample rate in Hz + * @param coeffs Output coefficient structure + * @return ESP_OK on success, ESP_ERR_INVALID_ARG if parameters invalid */ esp_err_t tas5805m_calc_butterworth_lpf(float fc, float fs, tas5805m_biquad_coeffs_t *coeffs); /** * @brief Calculate 2nd-order Butterworth highpass filter coefficients * - * @param fc Cutoff frequency in Hz - * @param fs Sample rate in Hz - * @param coeffs Output coefficients - * @return ESP_OK on success + * @param fc Cutoff frequency in Hz (-3dB point) + * @param fs Sample rate in Hz + * @param coeffs Output coefficient structure + * @return ESP_OK on success, ESP_ERR_INVALID_ARG if parameters invalid */ esp_err_t tas5805m_calc_butterworth_hpf(float fc, float fs, tas5805m_biquad_coeffs_t *coeffs); /** * @brief Calculate parametric EQ (peaking) filter coefficients * - * @param fc Center frequency in Hz - * @param gain_db Gain in dB (-15 to +15) - * @param q Q factor (0.5 to 10.0) - * @param fs Sample rate in Hz - * @param coeffs Output coefficients - * @return ESP_OK on success + * Creates a bell-shaped boost or cut centered at the specified frequency. + * Based on the Audio EQ Cookbook by Robert Bristow-Johnson. + * + * @param fc Center frequency in Hz + * @param gain_db Gain in dB (negative for cut, positive for boost) + * @param q Q factor controlling bandwidth (higher = narrower) + * @param fs Sample rate in Hz + * @param coeffs Output coefficient structure + * @return ESP_OK on success, ESP_ERR_INVALID_ARG if parameters invalid */ esp_err_t tas5805m_calc_peq(float fc, float gain_db, float q, float fs, tas5805m_biquad_coeffs_t *coeffs); /** - * @brief Calculate gain stage coefficients (simple scalar) + * @brief Calculate gain stage coefficients + * + * Creates a simple gain/attenuation with no frequency shaping. + * Implemented as b0 = linear_gain, all other coefficients zero. * * @param gain_db Gain in dB - * @param coeffs Output coefficients (passthrough with gain) - * @return ESP_OK on success + * @param coeffs Output coefficient structure + * @return ESP_OK on success, ESP_ERR_INVALID_ARG if coeffs is NULL */ esp_err_t tas5805m_calc_gain(float gain_db, tas5805m_biquad_coeffs_t *coeffs); /** - * @brief Calculate passthrough (unity) coefficients + * @brief Calculate unity passthrough coefficients * - * @param coeffs Output coefficients - * @return ESP_OK on success + * Creates coefficients that pass the signal unchanged (b0=1, all others=0). + * Use this to disable a biquad band without affecting the signal. + * + * @param coeffs Output coefficient structure + * @return ESP_OK on success, ESP_ERR_INVALID_ARG if coeffs is NULL */ esp_err_t tas5805m_calc_passthrough(tas5805m_biquad_coeffs_t *coeffs); /** * @brief Calculate phase inversion coefficients * - * @param coeffs Output coefficients - * @return ESP_OK on success + * Creates coefficients that invert the signal polarity (b0=-1). + * Equivalent to 180° phase shift at all frequencies. + * + * @param coeffs Output coefficient structure + * @return ESP_OK on success, ESP_ERR_INVALID_ARG if coeffs is NULL */ esp_err_t tas5805m_calc_phase_invert(tas5805m_biquad_coeffs_t *coeffs); /** * @brief Calculate low shelf filter coefficients * - * @param fc Shelf frequency in Hz (typically 100-400 Hz for bass) - * @param gain_db Gain in dB (-12 to +12) - * @param fs Sample rate in Hz - * @param coeffs Output coefficients - * @return ESP_OK on success + * Boosts or cuts frequencies below the shelf frequency. + * Based on the Audio EQ Cookbook by Robert Bristow-Johnson. + * + * @param fc Shelf transition frequency in Hz + * @param gain_db Gain in dB for frequencies below fc + * @param fs Sample rate in Hz + * @param coeffs Output coefficient structure + * @return ESP_OK on success, ESP_ERR_INVALID_ARG if parameters invalid */ esp_err_t tas5805m_calc_low_shelf(float fc, float gain_db, float fs, tas5805m_biquad_coeffs_t *coeffs); /** * @brief Calculate high shelf filter coefficients * - * @param fc Shelf frequency in Hz (typically 2-8 kHz for treble) - * @param gain_db Gain in dB (-12 to +12) - * @param fs Sample rate in Hz - * @param coeffs Output coefficients - * @return ESP_OK on success + * Boosts or cuts frequencies above the shelf frequency. + * Based on the Audio EQ Cookbook by Robert Bristow-Johnson. + * + * @param fc Shelf transition frequency in Hz + * @param gain_db Gain in dB for frequencies above fc + * @param fs Sample rate in Hz + * @param coeffs Output coefficient structure + * @return ESP_OK on success, ESP_ERR_INVALID_ARG if parameters invalid */ esp_err_t tas5805m_calc_high_shelf(float fc, float gain_db, float fs, tas5805m_biquad_coeffs_t *coeffs); /** - * @brief Get the number of biquad stages needed for a crossover slope + * @brief Get the number of biquad stages required for a crossover slope * - * @param slope The crossover slope setting - * @return Number of biquad stages (1, 2, or 4) + * @param slope Crossover slope setting (12/24/48 dB/octave) + * @return Number of cascaded biquad stages (1, 2, or 4) */ int tas5805m_biamp_get_biquad_count(tas5805m_biamp_slope_t slope); /** - * @brief Apply bi-amp crossover configuration to TAS5805M + * @brief Calculate baffle step compensation parameters * - * This function calculates all necessary filter coefficients and writes - * them to the TAS5805M biquad registers. It handles: - * - Crossover LP/HP filters with specified slope and type - * - Per-output gain adjustments - * - Per-output phase inversion - * - Per-output PEQ bands + * Baffle step is the acoustic phenomenon where low frequencies diffract + * around the speaker cabinet while high frequencies beam forward. This + * causes a 6dB level difference between low and high frequencies. * - * @param settings Bi-amp configuration settings - * @return ESP_OK on success, error code otherwise + * The transition frequency depends on baffle width: + * f_step = speed_of_sound / (π × baffle_width) + * + * Compensation amount depends on room placement: + * - Freestanding: +6dB bass boost (no boundary reinforcement) + * - Near wall: +3dB bass boost (partial reinforcement) + * - Corner: 0dB (full boundary reinforcement) + * + * @param baffle_width_cm Width of speaker baffle in centimeters + * @param placement Room placement affecting compensation amount + * @param step_freq_hz Output: calculated shelf frequency + * @param gain_db Output: calculated bass boost amount + */ +void tas5805m_calc_baffle_step(uint8_t baffle_width_cm, + tas5805m_baffle_placement_t placement, + float *step_freq_hz, float *gain_db); + +/** + * @brief Calculate first-order all-pass filter for time alignment + * + * All-pass filters pass all frequencies at unity gain but introduce + * frequency-dependent phase shift (group delay). This delays the tweeter + * signal to align with the woofer's acoustic center. + * + * The delay is approximate and most accurate near the crossover frequency + * where driver alignment matters most. + * + * @param delay_mm Physical distance to delay in millimeters + * @param fs Sample rate in Hz + * @param coeffs Output coefficient structure + * @return ESP_OK on success, ESP_ERR_INVALID_ARG if parameters invalid + */ +esp_err_t tas5805m_calc_allpass_delay(uint8_t delay_mm, float fs, tas5805m_biquad_coeffs_t *coeffs); + +/* ============ Full Configuration Apply ============ */ + +/** + * @brief Apply complete bi-amp crossover configuration + * + * Programs all biquad bands on both channels with the crossover filters, + * gain stages, PEQ, and speaker compensation filters. This is the main + * entry point for configuring bi-amp mode. + * + * @param settings Complete bi-amp configuration structure + * @return ESP_OK on success, error code on failure */ esp_err_t tas5805m_biamp_apply(const tas5805m_biamp_settings_t *settings); /** - * @brief Initialize bi-amp settings to defaults + * @brief Initialize bi-amp settings structure to defaults + * + * Sets sensible defaults: + * - 2000 Hz crossover, 24dB/oct Linkwitz-Riley + * - 0dB gain, no phase invert on both outputs + * - All PEQ bands disabled + * - No speaker compensation filters * - * @param settings Settings structure to initialize + * @param settings Structure to initialize */ void tas5805m_biamp_init_defaults(tas5805m_biamp_settings_t *settings); +/* ============ Individual Band Apply Functions ============ */ + +/** + * @brief Apply woofer (low output) gain and phase + * + * Updates only band 0 on the left channel. Use this for efficient + * single-parameter updates instead of full re-apply. + * + * @param gain_x2 Gain × 2 for 0.5dB resolution (-48 to +48 = -24dB to +24dB) + * @param phase_invert 0 = normal polarity, 1 = inverted (180° phase) + * @param sample_rate Current sample rate in Hz + * @return ESP_OK on success + */ +esp_err_t tas5805m_biamp_apply_low_gain_phase(int8_t gain_x2, uint8_t phase_invert, uint32_t sample_rate); + +/** + * @brief Apply tweeter (high output) gain and phase + * + * Updates only band 0 on the right channel. + * + * @param gain_x2 Gain × 2 for 0.5dB resolution + * @param phase_invert 0 = normal polarity, 1 = inverted + * @param sample_rate Current sample rate in Hz + * @return ESP_OK on success + */ +esp_err_t tas5805m_biamp_apply_high_gain_phase(int8_t gain_x2, uint8_t phase_invert, uint32_t sample_rate); + +/** + * @brief Apply subsonic highpass filter + * + * Protects the woofer from excessive excursion at very low frequencies. + * Updates band 1 on the left channel. + * + * @param freq Cutoff frequency in Hz (0 = disabled/passthrough) + * @param sample_rate Current sample rate in Hz + * @return ESP_OK on success + */ +esp_err_t tas5805m_biamp_apply_subsonic(uint16_t freq, uint32_t sample_rate); + +/** + * @brief Apply tweeter time alignment delay + * + * Uses an all-pass filter to delay the tweeter and align it with the + * woofer's acoustic center. Updates band 1 on the right channel. + * + * @param delay_mm Delay distance in millimeters (0 = disabled) + * @param sample_rate Current sample rate in Hz + * @return ESP_OK on success + */ +esp_err_t tas5805m_biamp_apply_tweeter_delay(uint8_t delay_mm, uint32_t sample_rate); + +/** + * @brief Apply a single parametric EQ band for the woofer + * + * Updates one of the 6 PEQ bands (6-11) on the left channel. + * + * @param band_index PEQ band index (0-5, maps to hardware bands 6-11) + * @param peq PEQ band settings (freq, gain, Q) + * @param sample_rate Current sample rate in Hz + * @return ESP_OK on success, ESP_ERR_INVALID_ARG if band_index out of range + */ +esp_err_t tas5805m_biamp_apply_low_peq(int band_index, const tas5805m_biamp_peq_band_t *peq, uint32_t sample_rate); + +/** + * @brief Apply a single parametric EQ band for the tweeter + * + * Updates one of the 6 PEQ bands (6-11) on the right channel. + * + * @param band_index PEQ band index (0-5, maps to hardware bands 6-11) + * @param peq PEQ band settings (freq, gain, Q) + * @param sample_rate Current sample rate in Hz + * @return ESP_OK on success, ESP_ERR_INVALID_ARG if band_index out of range + */ +esp_err_t tas5805m_biamp_apply_high_peq(int band_index, const tas5805m_biamp_peq_band_t *peq, uint32_t sample_rate); + +/** + * @brief Apply baffle step compensation + * + * Low shelf boost to compensate for baffle step diffraction loss. + * Updates band 12 on the left channel. + * + * @param width_cm Baffle width in centimeters (0 = disabled) + * @param placement Room placement affecting compensation amount + * @param sample_rate Current sample rate in Hz + * @return ESP_OK on success + */ +esp_err_t tas5805m_biamp_apply_baffle_step(uint8_t width_cm, tas5805m_baffle_placement_t placement, uint32_t sample_rate); + +/** + * @brief Apply tweeter breakup notch filter + * + * Narrow-band cut to suppress the tweeter's breakup resonance peak. + * Updates band 12 on the right channel. + * + * @param freq Notch center frequency in Hz (0 = disabled) + * @param gain_x2 Gain × 2 (should be negative for cut) + * @param q_x10 Q factor × 10 (e.g., 50 = Q of 5.0) + * @param sample_rate Current sample rate in Hz + * @return ESP_OK on success + */ +esp_err_t tas5805m_biamp_apply_notch(uint16_t freq, int8_t gain_x2, uint8_t q_x10, uint32_t sample_rate); + +/** + * @brief Apply air/brilliance high shelf + * + * High frequency shelf at 10kHz for treble presence adjustment. + * Updates band 13 on the right channel. + * + * @param gain_x2 Gain × 2 for 0.5dB resolution (0 = disabled) + * @param sample_rate Current sample rate in Hz + * @return ESP_OK on success + */ +esp_err_t tas5805m_biamp_apply_air_shelf(int8_t gain_x2, uint32_t sample_rate); + #endif /* CONFIG_DAC_TAS5805M */ #ifdef __cplusplus diff --git a/components/tas5805m_settings/include/tas5805m_settings.h b/components/tas5805m_settings/include/tas5805m_settings.h index e8572c59..bfac1d4d 100644 --- a/components/tas5805m_settings/include/tas5805m_settings.h +++ b/components/tas5805m_settings/include/tas5805m_settings.h @@ -67,6 +67,21 @@ extern "C" { #define TAS5805M_NVS_KEY_LOUDNESS_BASS "loud_bass" // 5 bytes for bass boost #define TAS5805M_NVS_KEY_LOUDNESS_TREBLE "loud_treb" // 5 bytes for treble boost +// Baffle step compensation (woofer low shelf) +#define TAS5805M_NVS_KEY_BAFFLE_WIDTH "baffle_w" // Baffle width in cm +#define TAS5805M_NVS_KEY_BAFFLE_PLACEMENT "baffle_p" // Speaker placement type + +// Time alignment (tweeter delay) +#define TAS5805M_NVS_KEY_TWEETER_DELAY "twt_delay" // Tweeter delay in mm + +// Tweeter breakup notch filter +#define TAS5805M_NVS_KEY_NOTCH_FREQ "twt_notch_f" // Notch frequency in Hz +#define TAS5805M_NVS_KEY_NOTCH_GAIN "twt_notch_g" // Notch depth (negative dB) +#define TAS5805M_NVS_KEY_NOTCH_Q "twt_notch_q" // Notch Q factor x10 + +// Air/Brilliance shelf (tweeter high shelf) +#define TAS5805M_NVS_KEY_AIR_GAIN "twt_air_g" // Air shelf gain in dB x2 + /** EQ UI modes exposed to the settings UI. These control visibility and apply behavior. * Defined here so the settings module owns the UI contract. Values are persisted to NVS. */ @@ -161,6 +176,13 @@ typedef enum { BIAMP_TYPE_LINKWITZ_RILEY = 1, } tas5805m_biamp_type_t; +/** Baffle step speaker placement - affects compensation amount */ +typedef enum { + BAFFLE_PLACEMENT_FREESTANDING = 0, // Full 6dB compensation + BAFFLE_PLACEMENT_NEAR_WALL = 1, // ~3dB compensation (wall reflection helps) + BAFFLE_PLACEMENT_CORNER = 2, // No compensation needed (room gain) +} tas5805m_baffle_placement_t; + /** Per-output PEQ band settings */ typedef struct { uint16_t freq; // Center frequency (20-20000 Hz), 0 = disabled @@ -190,6 +212,21 @@ typedef struct { int8_t high_gain; // Gain * 2 for 0.5 dB resolution (-48 to +48 representing -24 to +24 dB) uint8_t high_phase_invert; // 0=normal, 1=invert tas5805m_biamp_peq_band_t high_peq[TAS5805M_BIAMP_PEQ_BANDS]; + + // Baffle step compensation (low shelf boost for woofer) + uint8_t baffle_width_cm; // 0=disabled, 5-50cm typical + tas5805m_baffle_placement_t baffle_placement; // Affects compensation amount + + // Time alignment (delays tweeter to align with woofer) + uint8_t tweeter_delay_mm; // 0=disabled, 1-50mm typical + + // Tweeter breakup notch (tames resonance peak at tweeter's upper limit) + uint16_t notch_freq; // 0=disabled, 10000-25000 Hz typical + int8_t notch_gain; // Gain * 2 for 0.5 dB resolution (0 to -24 representing 0 to -12 dB) + uint8_t notch_q_x10; // Q factor * 10 (20-100 representing 2.0-10.0) + + // Air/Brilliance shelf (high shelf for treble sparkle) + int8_t air_gain; // Gain * 2 for 0.5 dB resolution (-12 to +12 representing -6 to +6 dB) } tas5805m_biamp_settings_t; /** Default bi-amp settings */ @@ -197,6 +234,10 @@ typedef struct { #define TAS5805M_BIAMP_DEFAULT_SLOPE BIAMP_SLOPE_24DB #define TAS5805M_BIAMP_DEFAULT_TYPE BIAMP_TYPE_LINKWITZ_RILEY +/** Baffle step compensation - uses woofer band 12 (spare) */ +#define TAS5805M_BAFFLE_STEP_BAND 12 +#define TAS5805M_BAFFLE_DEFAULT_WIDTH 0 // Disabled by default + /** Save advanced bi-amp settings to NVS */ esp_err_t tas5805m_settings_save_biamp(const tas5805m_biamp_settings_t *settings); /** Load advanced bi-amp settings from NVS */ @@ -303,6 +344,17 @@ esp_err_t tas5805m_biamp_preset_export(char *json_out, size_t max_len); */ esp_err_t tas5805m_biamp_preset_import(const char *json_in); +/** + * @brief Reset bi-amp settings to factory defaults + * + * Clears all bi-amp related NVS keys and re-initializes settings to defaults. + * This includes crossover, gains, PEQ, phase, loudness, and all other bi-amp + * parameters. + * + * @return ESP_OK on success + */ +esp_err_t tas5805m_biamp_reset_defaults(void); + #endif /* CONFIG_DAC_TAS5805M */ #ifdef __cplusplus diff --git a/components/tas5805m_settings/tas5805m_biamp.c b/components/tas5805m_settings/tas5805m_biamp.c index b542d516..c2bea6f7 100644 --- a/components/tas5805m_settings/tas5805m_biamp.c +++ b/components/tas5805m_settings/tas5805m_biamp.c @@ -1,6 +1,33 @@ -/* - * tas5805m_biamp.c - * Advanced Bi-Amp Crossover coefficient calculations for TAS5805M +/** + * @file tas5805m_biamp.c + * @brief Advanced Bi-Amp Active Crossover Implementation for TAS5805M + * + * This module implements digital biquad filter coefficient calculations for + * active bi-amplification using the TAS5805M DAC's 15-band parametric EQ. + * Each channel (left=woofer, right=tweeter) receives independent filter + * processing computed using the bilinear transform method. + * + * @section filter_algorithms Filter Algorithms + * + * All filters use the bilinear transform to convert analog filter prototypes + * to digital IIR filters. The general biquad transfer function is: + * + * b0 + b1*z^-1 + b2*z^-2 + * H(z) = ------------------------- + * 1 + a1*z^-1 + a2*z^-2 + * + * Filter coefficient formulas are based on: + * - "Cookbook formulae for audio EQ biquad filter coefficients" by Robert Bristow-Johnson + * - Butterworth and Linkwitz-Riley crossover design theory + * + * @section coefficient_format Coefficient Format + * + * The TAS5805M uses Q5.27 fixed-point format for biquad coefficients: + * - Range: -16.0 to +15.9999999925 + * - Resolution: ~7.45e-9 + * - Conversion: coefficient_fixed = (int32_t)(coefficient_float * 134217728.0) + * + * @copyright Copyright (c) 2024 */ #include "tas5805m_biamp.h" @@ -22,9 +49,28 @@ static const char *TAG = "tas5805m_biamp"; #define M_SQRT2 1.41421356237309504880 #endif -/* - * Calculate 2nd-order Butterworth lowpass filter coefficients - * Using bilinear transform from analog prototype H(s) = 1/(s² + √2·s + 1) +/* ============================================================================ + * Core Filter Coefficient Calculations + * ============================================================================ */ + +/** + * @brief Calculate 2nd-order Butterworth lowpass filter coefficients + * + * Implements the bilinear transform of the analog Butterworth prototype: + * + * 1 + * H(s) = ───────────────── + * s² + √2·s + 1 + * + * The bilinear transform uses frequency pre-warping to maintain accurate + * cutoff frequency mapping from analog to digital domain: + * + * K = tan(π·fc/fs) where fc is cutoff frequency, fs is sample rate + * + * @param fc Cutoff frequency in Hz (must be < fs/2) + * @param fs Sample rate in Hz + * @param coeffs Output coefficient structure + * @return ESP_OK on success, ESP_ERR_INVALID_ARG if parameters invalid */ esp_err_t tas5805m_calc_butterworth_lpf(float fc, float fs, tas5805m_biquad_coeffs_t *coeffs) { @@ -32,13 +78,13 @@ esp_err_t tas5805m_calc_butterworth_lpf(float fc, float fs, tas5805m_biquad_coef return ESP_ERR_INVALID_ARG; } - /* Pre-warp the cutoff frequency */ + /* Pre-warp the cutoff frequency for bilinear transform */ float w0 = 2.0f * M_PI * fc / fs; float K = tanf(w0 / 2.0f); float K2 = K * K; float sqrt2_K = M_SQRT2 * K; - /* Calculate coefficients */ + /* Calculate normalized coefficients (a0 = 1) */ float norm = 1.0f / (1.0f + sqrt2_K + K2); coeffs->b0 = K2 * norm; @@ -50,9 +96,22 @@ esp_err_t tas5805m_calc_butterworth_lpf(float fc, float fs, tas5805m_biquad_coef return ESP_OK; } -/* - * Calculate 2nd-order Butterworth highpass filter coefficients - * Using bilinear transform from analog prototype H(s) = s²/(s² + √2·s + 1) +/** + * @brief Calculate 2nd-order Butterworth highpass filter coefficients + * + * Implements the bilinear transform of the analog Butterworth HPF prototype: + * + * s² + * H(s) = ───────────────── + * s² + √2·s + 1 + * + * Uses the same pre-warping technique as the lowpass variant. The highpass + * response is obtained by transforming s → 1/s in the lowpass prototype. + * + * @param fc Cutoff frequency in Hz (must be < fs/2) + * @param fs Sample rate in Hz + * @param coeffs Output coefficient structure + * @return ESP_OK on success, ESP_ERR_INVALID_ARG if parameters invalid */ esp_err_t tas5805m_calc_butterworth_hpf(float fc, float fs, tas5805m_biquad_coeffs_t *coeffs) { @@ -60,13 +119,13 @@ esp_err_t tas5805m_calc_butterworth_hpf(float fc, float fs, tas5805m_biquad_coef return ESP_ERR_INVALID_ARG; } - /* Pre-warp the cutoff frequency */ + /* Pre-warp the cutoff frequency for bilinear transform */ float w0 = 2.0f * M_PI * fc / fs; float K = tanf(w0 / 2.0f); float K2 = K * K; float sqrt2_K = M_SQRT2 * K; - /* Calculate coefficients */ + /* Calculate normalized coefficients (a0 = 1) */ float norm = 1.0f / (1.0f + sqrt2_K + K2); coeffs->b0 = norm; @@ -78,9 +137,26 @@ esp_err_t tas5805m_calc_butterworth_hpf(float fc, float fs, tas5805m_biquad_coef return ESP_OK; } -/* - * Calculate parametric EQ (peaking) filter coefficients - * Based on Audio EQ Cookbook by Robert Bristow-Johnson +/** + * @brief Calculate parametric EQ (peaking) filter coefficients + * + * Implements a 2nd-order parametric equalizer using the Audio EQ Cookbook + * formula. This filter provides symmetric boost/cut around a center frequency. + * + * The Q parameter controls bandwidth: BW = fc/Q (in octaves: ~1.4/Q) + * + * Common Q values: + * - Q = 0.5: Very wide (2.8 octaves) + * - Q = 1.0: Moderate (1.4 octaves) + * - Q = 2.0: Narrow (0.7 octaves) + * - Q = 5.0: Very narrow (0.3 octaves) + * + * @param fc Center frequency in Hz (must be < fs/2) + * @param gain_db Gain in dB (positive = boost, negative = cut) + * @param q Quality factor (bandwidth control, must be > 0) + * @param fs Sample rate in Hz + * @param coeffs Output coefficient structure + * @return ESP_OK on success, ESP_ERR_INVALID_ARG if parameters invalid */ esp_err_t tas5805m_calc_peq(float fc, float gain_db, float q, float fs, tas5805m_biquad_coeffs_t *coeffs) { @@ -88,17 +164,19 @@ esp_err_t tas5805m_calc_peq(float fc, float gain_db, float q, float fs, tas5805m return ESP_ERR_INVALID_ARG; } - /* If gain is essentially zero, return passthrough */ + /* Zero gain means passthrough - avoid unnecessary computation */ if (fabsf(gain_db) < 0.01f) { return tas5805m_calc_passthrough(coeffs); } - float A = powf(10.0f, gain_db / 40.0f); /* sqrt of linear gain */ + /* A = sqrt(10^(dB/20)) = 10^(dB/40) */ + float A = powf(10.0f, gain_db / 40.0f); float w0 = 2.0f * M_PI * fc / fs; float sin_w0 = sinf(w0); float cos_w0 = cosf(w0); float alpha = sin_w0 / (2.0f * q); + /* Peaking EQ coefficients from Audio EQ Cookbook */ float b0 = 1.0f + alpha * A; float b1 = -2.0f * cos_w0; float b2 = 1.0f - alpha * A; @@ -106,7 +184,7 @@ esp_err_t tas5805m_calc_peq(float fc, float gain_db, float q, float fs, tas5805m float a1 = -2.0f * cos_w0; float a2 = 1.0f - alpha / A; - /* Normalize by a0 */ + /* Normalize by a0 to get standard biquad form */ coeffs->b0 = b0 / a0; coeffs->b1 = b1 / a0; coeffs->b2 = b2 / a0; @@ -116,8 +194,17 @@ esp_err_t tas5805m_calc_peq(float fc, float gain_db, float q, float fs, tas5805m return ESP_OK; } -/* - * Calculate simple gain stage (passthrough with gain) +/** + * @brief Calculate simple gain stage coefficients + * + * Creates a first-order gain element that applies uniform gain across all + * frequencies. Uses only b0 coefficient with all others set to zero. + * + * The transfer function is simply: H(z) = 10^(dB/20) + * + * @param gain_db Gain in dB (positive = boost, negative = cut) + * @param coeffs Output coefficient structure + * @return ESP_OK on success, ESP_ERR_INVALID_ARG if coeffs is NULL */ esp_err_t tas5805m_calc_gain(float gain_db, tas5805m_biquad_coeffs_t *coeffs) { @@ -136,8 +223,16 @@ esp_err_t tas5805m_calc_gain(float gain_db, tas5805m_biquad_coeffs_t *coeffs) return ESP_OK; } -/* - * Calculate passthrough (unity) coefficients +/** + * @brief Calculate unity passthrough coefficients + * + * Sets coefficients for a transparent passthrough (unity gain, no filtering). + * H(z) = 1 (b0=1, all other coefficients = 0) + * + * Used to disable filter bands while maintaining DSP chain integrity. + * + * @param coeffs Output coefficient structure + * @return ESP_OK on success, ESP_ERR_INVALID_ARG if coeffs is NULL */ esp_err_t tas5805m_calc_passthrough(tas5805m_biquad_coeffs_t *coeffs) { @@ -154,8 +249,17 @@ esp_err_t tas5805m_calc_passthrough(tas5805m_biquad_coeffs_t *coeffs) return ESP_OK; } -/* - * Calculate phase inversion coefficients +/** + * @brief Calculate phase inversion coefficients + * + * Creates a 180-degree phase shift (polarity inversion) by setting b0 = -1. + * H(z) = -1 + * + * Used for driver polarity correction when physical wiring cannot be changed, + * or to achieve acoustic phase alignment at the crossover point. + * + * @param coeffs Output coefficient structure + * @return ESP_OK on success, ESP_ERR_INVALID_ARG if coeffs is NULL */ esp_err_t tas5805m_calc_phase_invert(tas5805m_biquad_coeffs_t *coeffs) { @@ -172,9 +276,23 @@ esp_err_t tas5805m_calc_phase_invert(tas5805m_biquad_coeffs_t *coeffs) return ESP_OK; } -/* - * Calculate low shelf filter coefficients - * Based on Audio EQ Cookbook by Robert Bristow-Johnson +/** + * @brief Calculate low shelf filter coefficients + * + * Implements a 2nd-order low shelf filter using the Audio EQ Cookbook formula. + * Boosts or cuts frequencies below the corner frequency while leaving higher + * frequencies unaffected. + * + * The shelf slope parameter S is fixed at 1.0, providing a moderate transition. + * At the corner frequency, gain is half the specified value (in dB). + * + * Used for baffle step compensation and bass adjustments. + * + * @param fc Corner frequency in Hz (must be < fs/2) + * @param gain_db Gain in dB (positive = boost, negative = cut) + * @param fs Sample rate in Hz + * @param coeffs Output coefficient structure + * @return ESP_OK on success, ESP_ERR_INVALID_ARG if parameters invalid */ esp_err_t tas5805m_calc_low_shelf(float fc, float gain_db, float fs, tas5805m_biquad_coeffs_t *coeffs) { @@ -182,21 +300,22 @@ esp_err_t tas5805m_calc_low_shelf(float fc, float gain_db, float fs, tas5805m_bi return ESP_ERR_INVALID_ARG; } - /* If gain is essentially zero, return passthrough */ + /* Zero gain means passthrough - avoid unnecessary computation */ if (fabsf(gain_db) < 0.01f) { return tas5805m_calc_passthrough(coeffs); } - float A = powf(10.0f, gain_db / 40.0f); /* sqrt of linear gain */ + /* A = sqrt(10^(dB/20)) = 10^(dB/40) */ + float A = powf(10.0f, gain_db / 40.0f); float w0 = 2.0f * M_PI * fc / fs; float sin_w0 = sinf(w0); float cos_w0 = cosf(w0); - /* S = 1 gives a steep shelf, commonly used value */ - float alpha = sin_w0 / 2.0f * sqrtf((A + 1.0f/A) * (1.0f/1.0f - 1.0f) + 2.0f); - /* Simplified: alpha = sin_w0 / 2 * sqrt(2) for S=1 */ - alpha = sin_w0 / 2.0f * M_SQRT2; + + /* Shelf slope S=1 simplifies to: alpha = sin(w0)/2 * sqrt(2) */ + float alpha = sin_w0 / 2.0f * M_SQRT2; float two_sqrt_A_alpha = 2.0f * sqrtf(A) * alpha; + /* Low shelf coefficients from Audio EQ Cookbook */ float b0 = A * ((A + 1.0f) - (A - 1.0f) * cos_w0 + two_sqrt_A_alpha); float b1 = 2.0f * A * ((A - 1.0f) - (A + 1.0f) * cos_w0); float b2 = A * ((A + 1.0f) - (A - 1.0f) * cos_w0 - two_sqrt_A_alpha); @@ -214,9 +333,23 @@ esp_err_t tas5805m_calc_low_shelf(float fc, float gain_db, float fs, tas5805m_bi return ESP_OK; } -/* - * Calculate high shelf filter coefficients - * Based on Audio EQ Cookbook by Robert Bristow-Johnson +/** + * @brief Calculate high shelf filter coefficients + * + * Implements a 2nd-order high shelf filter using the Audio EQ Cookbook formula. + * Boosts or cuts frequencies above the corner frequency while leaving lower + * frequencies unaffected. + * + * The shelf slope parameter S is fixed at 1.0, providing a moderate transition. + * At the corner frequency, gain is half the specified value (in dB). + * + * Used for air/brilliance adjustments and loudness compensation treble boost. + * + * @param fc Corner frequency in Hz (must be < fs/2) + * @param gain_db Gain in dB (positive = boost, negative = cut) + * @param fs Sample rate in Hz + * @param coeffs Output coefficient structure + * @return ESP_OK on success, ESP_ERR_INVALID_ARG if parameters invalid */ esp_err_t tas5805m_calc_high_shelf(float fc, float gain_db, float fs, tas5805m_biquad_coeffs_t *coeffs) { @@ -224,19 +357,22 @@ esp_err_t tas5805m_calc_high_shelf(float fc, float gain_db, float fs, tas5805m_b return ESP_ERR_INVALID_ARG; } - /* If gain is essentially zero, return passthrough */ + /* Zero gain means passthrough - avoid unnecessary computation */ if (fabsf(gain_db) < 0.01f) { return tas5805m_calc_passthrough(coeffs); } - float A = powf(10.0f, gain_db / 40.0f); /* sqrt of linear gain */ + /* A = sqrt(10^(dB/20)) = 10^(dB/40) */ + float A = powf(10.0f, gain_db / 40.0f); float w0 = 2.0f * M_PI * fc / fs; float sin_w0 = sinf(w0); float cos_w0 = cosf(w0); - /* S = 1 gives a steep shelf */ + + /* Shelf slope S=1 simplifies to: alpha = sin(w0)/2 * sqrt(2) */ float alpha = sin_w0 / 2.0f * M_SQRT2; float two_sqrt_A_alpha = 2.0f * sqrtf(A) * alpha; + /* High shelf coefficients from Audio EQ Cookbook */ float b0 = A * ((A + 1.0f) + (A - 1.0f) * cos_w0 + two_sqrt_A_alpha); float b1 = -2.0f * A * ((A - 1.0f) + (A + 1.0f) * cos_w0); float b2 = A * ((A + 1.0f) + (A - 1.0f) * cos_w0 - two_sqrt_A_alpha); @@ -254,8 +390,161 @@ esp_err_t tas5805m_calc_high_shelf(float fc, float gain_db, float fs, tas5805m_b return ESP_OK; } -/* - * Get the number of biquad stages needed for a crossover slope +/* ============================================================================ + * Specialized Filter Calculations + * ============================================================================ */ + +/** + * @brief Calculate baffle step compensation parameters + * + * Baffle step is an acoustic phenomenon where low frequencies radiate + * omnidirectionally (wrapping around the speaker baffle) while high + * frequencies beam forward. This causes a 3-6dB step in SPL response. + * + * The transition frequency depends on baffle width: + * f_step = c / (π × w) + * where c = 343 m/s (speed of sound at ~20°C) and w = baffle width in meters. + * + * Example frequencies for common baffle widths: + * - 15cm baffle: ~728 Hz + * - 20cm baffle: ~546 Hz + * - 30cm baffle: ~364 Hz + * + * Room placement affects the required compensation: + * - Freestanding: Full 6dB boost (no boundary reinforcement) + * - Near wall: 3dB boost (single boundary adds ~3dB at low frequencies) + * - Corner: 0dB boost (two boundaries provide full reinforcement) + * + * @param baffle_width_cm Baffle width in centimeters (0 = disabled, 5-50cm valid) + * @param placement Speaker placement relative to room boundaries + * @param step_freq_hz Output: calculated step frequency in Hz (may be NULL) + * @param gain_db Output: recommended compensation gain in dB (may be NULL) + */ +void tas5805m_calc_baffle_step(uint8_t baffle_width_cm, + tas5805m_baffle_placement_t placement, + float *step_freq_hz, float *gain_db) +{ + /* Initialize outputs to disabled state */ + if (step_freq_hz) *step_freq_hz = 0.0f; + if (gain_db) *gain_db = 0.0f; + + /* Width of 0 means disabled */ + if (baffle_width_cm == 0) { + return; + } + + /* Convert cm to meters and clamp to reasonable range */ + float width_m = (float)baffle_width_cm / 100.0f; + if (width_m < 0.05f) width_m = 0.05f; /* Minimum 5cm */ + if (width_m > 0.50f) width_m = 0.50f; /* Maximum 50cm */ + + /* Calculate step frequency: f = c / (π × w) */ + float freq = 343.0f / (M_PI * width_m); + + /* Determine compensation gain based on room placement */ + float gain; + switch (placement) { + case BAFFLE_PLACEMENT_FREESTANDING: + gain = 6.0f; /* Full compensation needed */ + break; + case BAFFLE_PLACEMENT_NEAR_WALL: + gain = 3.0f; /* Wall provides partial bass reinforcement */ + break; + case BAFFLE_PLACEMENT_CORNER: + default: + gain = 0.0f; /* Corner placement provides full reinforcement */ + break; + } + + if (step_freq_hz) *step_freq_hz = freq; + if (gain_db) *gain_db = gain; + + ESP_LOGD(TAG, "Baffle step: width=%dcm placement=%d -> freq=%.1fHz gain=%.1fdB", + baffle_width_cm, placement, freq, gain); +} + +/** + * @brief Calculate first-order all-pass filter for time alignment + * + * Creates frequency-dependent phase shift (group delay) to compensate for + * physical driver offset. This is an approximation suitable for small delays + * where pure sample delay would require fractional samples. + * + * Transfer function: H(z) = (a + z^-1) / (1 + a·z^-1) + * where a = (1 - tan(π·fc/fs)) / (1 + tan(π·fc/fs)) + * + * The group delay at DC approaches 1/(π·fc), so for a desired delay T: + * fc = 1 / (π × T) + * + * Physical offset to time conversion: + * T = d / c where d = offset distance, c = 343000 mm/s + * + * Typical tweeter offset values: + * - 10mm: ~29 µs delay + * - 25mm: ~73 µs delay + * - 50mm: ~146 µs delay + * + * @note This is a first-order approximation. For precise alignment, physical + * driver positioning or dedicated delay DSP blocks are preferable. + * + * @param delay_mm Physical offset to compensate in millimeters (0 = passthrough) + * @param fs Sample rate in Hz + * @param coeffs Output coefficient structure + * @return ESP_OK on success, ESP_ERR_INVALID_ARG if parameters invalid + */ +esp_err_t tas5805m_calc_allpass_delay(uint8_t delay_mm, float fs, tas5805m_biquad_coeffs_t *coeffs) +{ + if (coeffs == NULL || fs <= 0) { + return ESP_ERR_INVALID_ARG; + } + + /* No delay requested - return passthrough */ + if (delay_mm == 0) { + return tas5805m_calc_passthrough(coeffs); + } + + /* Convert millimeters to seconds: t = d / (343000 mm/s) */ + float delay_sec = (float)delay_mm / 343000.0f; + + /* Calculate corner frequency for desired delay: fc = 1 / (π × t) */ + float fc = 1.0f / (M_PI * delay_sec); + + /* Clamp corner frequency to valid digital filter range */ + if (fc < 20.0f) fc = 20.0f; + if (fc >= fs / 2.0f) fc = fs / 2.0f - 1.0f; + + /* First-order all-pass coefficient calculation */ + float w0 = 2.0f * M_PI * fc / fs; + float tan_w0_2 = tanf(w0 / 2.0f); + float a = (1.0f - tan_w0_2) / (1.0f + tan_w0_2); + + /* Express as biquad with b2=0, a2=0 (first-order in biquad structure) */ + coeffs->b0 = a; + coeffs->b1 = 1.0f; + coeffs->b2 = 0.0f; + coeffs->a1 = a; + coeffs->a2 = 0.0f; + + ESP_LOGD(TAG, "Tweeter delay: %dmm -> %.1fus, fc=%.0fHz, a=%.6f", + delay_mm, delay_sec * 1000000.0f, fc, a); + + return ESP_OK; +} + +/* ============================================================================ + * Utility Functions + * ============================================================================ */ + +/** + * @brief Get number of biquad stages required for a crossover slope + * + * Crossover slopes are achieved by cascading multiple 2nd-order filter sections: + * - 12 dB/octave: 1 biquad (2nd order) + * - 24 dB/octave: 2 biquads (4th order) - Linkwitz-Riley alignment + * - 48 dB/octave: 4 biquads (8th order) - Steep, brick-wall rolloff + * + * @param slope Desired crossover slope + * @return Number of biquad stages (1, 2, or 4) */ int tas5805m_biamp_get_biquad_count(tas5805m_biamp_slope_t slope) { @@ -263,14 +552,20 @@ int tas5805m_biamp_get_biquad_count(tas5805m_biamp_slope_t slope) case BIAMP_SLOPE_12DB: return 1; case BIAMP_SLOPE_24DB: return 2; case BIAMP_SLOPE_48DB: return 4; - default: return 2; /* Default to 24dB/octave */ + default: return 2; /* Default to 24 dB/octave */ } } -/* - * Write biquad coefficients to a specific band - * Note: No delay needed between writes - the 15-band EQ writes - * coefficients consecutively without delays and works reliably +/** + * @brief Write biquad coefficients to a specific DSP band + * + * Internal helper that wraps the low-level coefficient write function. + * The TAS5805M accepts coefficient writes without inter-write delays. + * + * @param channel Target channel (LEFT or RIGHT) + * @param band Band index (0-14) + * @param coeffs Coefficient structure to write + * @return ESP_OK on success, error code on I2C failure */ static esp_err_t write_biquad_band(TAS5805M_EQ_CHANNELS channel, int band, const tas5805m_biquad_coeffs_t *coeffs) @@ -280,8 +575,14 @@ static esp_err_t write_biquad_band(TAS5805M_EQ_CHANNELS channel, int band, coeffs->a1, coeffs->a2); } -/* - * Validate and normalize sample rate to a supported value +/** + * @brief Validate and normalize sample rate to supported value + * + * Ensures the sample rate is one of the supported values for coefficient + * calculations. Invalid rates default to 48000 Hz with a warning log. + * + * @param sample_rate Input sample rate to validate + * @return Validated sample rate (one of 44100, 48000, 88200, 96000) */ static uint32_t validate_sample_rate(uint32_t sample_rate) { @@ -298,8 +599,38 @@ static uint32_t validate_sample_rate(uint32_t sample_rate) } } -/* - * Apply bi-amp crossover configuration to TAS5805M +/* ============================================================================ + * Full Configuration Application + * ============================================================================ */ + +/** + * @brief Apply complete bi-amp crossover configuration to TAS5805M + * + * Configures all 15 biquad bands on both channels for active bi-amplification. + * This is the main entry point for applying a complete crossover setup. + * + * Band allocation per channel: + * + * LEFT (Woofer/Low output): + * - Band 0: Gain + optional phase inversion + * - Band 1: Subsonic highpass filter (rumble protection) + * - Bands 2-5: Lowpass crossover filter stages + * - Bands 6-8: Parametric EQ (3 bands for driver correction) + * - Band 12: Baffle step compensation (low shelf boost) + * - Bands 13-14: Reserved for loudness compensation + * + * RIGHT (Tweeter/High output): + * - Band 0: Gain + optional phase inversion + * - Band 1: Time alignment (all-pass delay approximation) + * - Bands 2-5: Highpass crossover filter stages + * - Bands 6-8: Parametric EQ (3 bands for driver correction) + * - Band 12: Tweeter breakup notch filter + * - Band 13: Air/brilliance high shelf + * - Band 14: Reserved for loudness compensation + * + * @param settings Pointer to complete bi-amp settings structure + * @return ESP_OK on success, ESP_ERR_INVALID_ARG if settings is NULL, + * or I2C error code on hardware communication failure */ esp_err_t tas5805m_biamp_apply(const tas5805m_biamp_settings_t *settings) { @@ -320,12 +651,12 @@ esp_err_t tas5805m_biamp_apply(const tas5805m_biamp_settings_t *settings) settings->type == BIAMP_TYPE_LINKWITZ_RILEY ? "LR" : "BW", fs); - /* === LEFT CHANNEL (LOW/WOOFER OUTPUT) === */ + /* ========== LEFT CHANNEL (WOOFER/LOW OUTPUT) ========== */ - /* Band 0: Gain + optional phase invert for low output */ - /* Gain is stored as x2 for 0.5 dB resolution, convert back to dB */ - float low_total_gain = (float)settings->low_gain / 2.0f; + /* Band 0: Gain + optional phase inversion */ + float low_total_gain = (float)settings->low_gain / 2.0f; /* Convert from x2 format */ if (settings->low_phase_invert) { + /* Combine gain and phase invert into single coefficient */ low_total_gain = -powf(10.0f, low_total_gain / 20.0f); coeffs.b0 = low_total_gain; coeffs.b1 = 0.0f; @@ -339,7 +670,7 @@ esp_err_t tas5805m_biamp_apply(const tas5805m_biamp_settings_t *settings) ret = write_biquad_band(TAS5805M_EQ_CHANNELS_LEFT, BIAMP_GAIN_BAND, &coeffs); if (ret != ESP_OK) return ret; - /* Band 1: Subsonic HPF (early in chain for optimal headroom) */ + /* Band 1: Subsonic highpass filter (placed early for optimal headroom) */ if (settings->subsonic_freq > 0 && settings->subsonic_freq < fs / 2) { ret = tas5805m_calc_butterworth_hpf((float)settings->subsonic_freq, fs, &coeffs); if (ret != ESP_OK) return ret; @@ -351,7 +682,7 @@ esp_err_t tas5805m_biamp_apply(const tas5805m_biamp_settings_t *settings) ret = write_biquad_band(TAS5805M_EQ_CHANNELS_LEFT, BIAMP_SUBSONIC_BAND, &coeffs); if (ret != ESP_OK) return ret; - /* Bands 2-5: Lowpass filter stages (Butterworth for both BW and LR) */ + /* Bands 2-5: Lowpass crossover filter stages */ ret = tas5805m_calc_butterworth_lpf(fc, fs, &coeffs); if (ret != ESP_OK) return ret; @@ -361,7 +692,7 @@ esp_err_t tas5805m_biamp_apply(const tas5805m_biamp_settings_t *settings) if (ret != ESP_OK) return ret; } - /* Fill remaining crossover bands with passthrough */ + /* Fill unused crossover bands with passthrough */ ret = tas5805m_calc_passthrough(&coeffs); if (ret != ESP_OK) return ret; for (int i = num_stages; i < BIAMP_CROSSOVER_MAX_BANDS; i++) { @@ -370,14 +701,13 @@ esp_err_t tas5805m_biamp_apply(const tas5805m_biamp_settings_t *settings) if (ret != ESP_OK) return ret; } - /* Bands 6-8: PEQ for low output */ + /* Bands 6-8: Parametric EQ for woofer correction */ for (int i = 0; i < BIAMP_PEQ_BANDS; i++) { band = BIAMP_PEQ_START_BAND + i; const tas5805m_biamp_peq_band_t *peq = &settings->low_peq[i]; if (peq->freq > 0 && peq->freq < fs / 2 && peq->gain != 0) { float q = (float)peq->q_x10 / 10.0f; - /* Gain is stored as x2 for 0.5 dB resolution */ float gain_db = (float)peq->gain / 2.0f; ret = tas5805m_calc_peq((float)peq->freq, gain_db, q, fs, &coeffs); } else { @@ -388,23 +718,41 @@ esp_err_t tas5805m_biamp_apply(const tas5805m_biamp_settings_t *settings) if (ret != ESP_OK) return ret; } - /* Fill remaining bands 9-14 with passthrough - * Note: Bands 13 (bass) and 14 (treble) may be overwritten by loudness compensation - * if enabled, but we must initialize them to passthrough to avoid garbage values - * causing DSP instability when loudness is disabled */ + /* Band 12: Baffle step compensation (low shelf boost) */ + if (settings->baffle_width_cm > 0) { + float step_freq, step_gain; + tas5805m_calc_baffle_step(settings->baffle_width_cm, settings->baffle_placement, + &step_freq, &step_gain); + if (step_gain > 0.1f && step_freq > 0.0f && step_freq < fs / 2) { + ret = tas5805m_calc_low_shelf(step_freq, step_gain, fs, &coeffs); + if (ret != ESP_OK) return ret; + ESP_LOGI(TAG, "Applying baffle step: width=%dcm freq=%.0fHz gain=+%.1fdB (band %d)", + settings->baffle_width_cm, step_freq, step_gain, BIAMP_BAFFLE_STEP_BAND); + } else { + ret = tas5805m_calc_passthrough(&coeffs); + if (ret != ESP_OK) return ret; + } + } else { + ret = tas5805m_calc_passthrough(&coeffs); + if (ret != ESP_OK) return ret; + } + ret = write_biquad_band(TAS5805M_EQ_CHANNELS_LEFT, BIAMP_BAFFLE_STEP_BAND, &coeffs); + if (ret != ESP_OK) return ret; + + /* Bands 13-14: Initialize to passthrough (may be overwritten by loudness) */ ret = tas5805m_calc_passthrough(&coeffs); if (ret != ESP_OK) return ret; - for (band = BIAMP_PEQ_START_BAND + BIAMP_PEQ_BANDS; band <= TAS5805M_LOUDNESS_TREBLE_BAND; band++) { + for (band = TAS5805M_LOUDNESS_BASS_BAND; band <= TAS5805M_LOUDNESS_TREBLE_BAND; band++) { ret = write_biquad_band(TAS5805M_EQ_CHANNELS_LEFT, band, &coeffs); if (ret != ESP_OK) return ret; } - /* === RIGHT CHANNEL (HIGH/TWEETER OUTPUT) === */ + /* ========== RIGHT CHANNEL (TWEETER/HIGH OUTPUT) ========== */ - /* Band 0: Gain + optional phase invert for high output */ - /* Gain is stored as x2 for 0.5 dB resolution, convert back to dB */ - float high_total_gain = (float)settings->high_gain / 2.0f; + /* Band 0: Gain + optional phase inversion */ + float high_total_gain = (float)settings->high_gain / 2.0f; /* Convert from x2 format */ if (settings->high_phase_invert) { + /* Combine gain and phase invert into single coefficient */ high_total_gain = -powf(10.0f, high_total_gain / 20.0f); coeffs.b0 = high_total_gain; coeffs.b1 = 0.0f; @@ -418,13 +766,20 @@ esp_err_t tas5805m_biamp_apply(const tas5805m_biamp_settings_t *settings) ret = write_biquad_band(TAS5805M_EQ_CHANNELS_RIGHT, BIAMP_GAIN_BAND, &coeffs); if (ret != ESP_OK) return ret; - /* Band 1: Passthrough (no subsonic needed for tweeter) */ - ret = tas5805m_calc_passthrough(&coeffs); - if (ret != ESP_OK) return ret; - ret = write_biquad_band(TAS5805M_EQ_CHANNELS_RIGHT, BIAMP_SUBSONIC_BAND, &coeffs); + /* Band 1: Time alignment (all-pass delay approximation) */ + if (settings->tweeter_delay_mm > 0) { + ret = tas5805m_calc_allpass_delay(settings->tweeter_delay_mm, fs, &coeffs); + if (ret != ESP_OK) return ret; + ESP_LOGI(TAG, "Applying tweeter delay: %d mm (band %d)", + settings->tweeter_delay_mm, BIAMP_TWEETER_DELAY_BAND); + } else { + ret = tas5805m_calc_passthrough(&coeffs); + if (ret != ESP_OK) return ret; + } + ret = write_biquad_band(TAS5805M_EQ_CHANNELS_RIGHT, BIAMP_TWEETER_DELAY_BAND, &coeffs); if (ret != ESP_OK) return ret; - /* Bands 2-5: Highpass filter stages */ + /* Bands 2-5: Highpass crossover filter stages */ ret = tas5805m_calc_butterworth_hpf(fc, fs, &coeffs); if (ret != ESP_OK) return ret; @@ -434,7 +789,7 @@ esp_err_t tas5805m_biamp_apply(const tas5805m_biamp_settings_t *settings) if (ret != ESP_OK) return ret; } - /* Fill remaining crossover bands with passthrough */ + /* Fill unused crossover bands with passthrough */ ret = tas5805m_calc_passthrough(&coeffs); if (ret != ESP_OK) return ret; for (int i = num_stages; i < BIAMP_CROSSOVER_MAX_BANDS; i++) { @@ -443,14 +798,13 @@ esp_err_t tas5805m_biamp_apply(const tas5805m_biamp_settings_t *settings) if (ret != ESP_OK) return ret; } - /* Bands 6-8: PEQ for high output */ + /* Bands 6-8: Parametric EQ for tweeter correction */ for (int i = 0; i < BIAMP_PEQ_BANDS; i++) { band = BIAMP_PEQ_START_BAND + i; const tas5805m_biamp_peq_band_t *peq = &settings->high_peq[i]; if (peq->freq > 0 && peq->freq < fs / 2 && peq->gain != 0) { float q = (float)peq->q_x10 / 10.0f; - /* Gain is stored as x2 for 0.5 dB resolution */ float gain_db = (float)peq->gain / 2.0f; ret = tas5805m_calc_peq((float)peq->freq, gain_db, q, fs, &coeffs); } else { @@ -461,23 +815,377 @@ esp_err_t tas5805m_biamp_apply(const tas5805m_biamp_settings_t *settings) if (ret != ESP_OK) return ret; } - /* Fill remaining bands 9-14 with passthrough - * Note: Bands 13 (bass) and 14 (treble) may be overwritten by loudness compensation - * if enabled, but we must initialize them to passthrough to avoid garbage values - * causing DSP instability when loudness is disabled */ - ret = tas5805m_calc_passthrough(&coeffs); + /* Band 12: Tweeter breakup notch (narrow cut at resonance) */ + if (settings->notch_freq > 0 && settings->notch_gain < 0) { + float q = (float)settings->notch_q_x10 / 10.0f; + float gain_db = (float)settings->notch_gain / 2.0f; + ret = tas5805m_calc_peq((float)settings->notch_freq, gain_db, q, fs, &coeffs); + if (ret != ESP_OK) return ret; + ESP_LOGI(TAG, "Applying tweeter breakup notch: %dHz %.1fdB Q=%.1f (band %d)", + settings->notch_freq, gain_db, q, BIAMP_NOTCH_BAND); + } else { + ret = tas5805m_calc_passthrough(&coeffs); + if (ret != ESP_OK) return ret; + } + ret = write_biquad_band(TAS5805M_EQ_CHANNELS_RIGHT, BIAMP_NOTCH_BAND, &coeffs); if (ret != ESP_OK) return ret; - for (band = BIAMP_PEQ_START_BAND + BIAMP_PEQ_BANDS; band <= TAS5805M_LOUDNESS_TREBLE_BAND; band++) { - ret = write_biquad_band(TAS5805M_EQ_CHANNELS_RIGHT, band, &coeffs); + + /* Band 13: Air/brilliance high shelf (fixed 10kHz corner) */ + if (settings->air_gain != 0) { + float gain_db = (float)settings->air_gain / 2.0f; + ret = tas5805m_calc_high_shelf(10000.0f, gain_db, fs, &coeffs); + if (ret != ESP_OK) return ret; + ESP_LOGI(TAG, "Applying air/brilliance shelf: %.1fdB @ 10kHz (band %d)", + gain_db, BIAMP_AIR_SHELF_BAND); + } else { + ret = tas5805m_calc_passthrough(&coeffs); if (ret != ESP_OK) return ret; } + ret = write_biquad_band(TAS5805M_EQ_CHANNELS_RIGHT, BIAMP_AIR_SHELF_BAND, &coeffs); + if (ret != ESP_OK) return ret; + + /* Band 14: Initialize to passthrough (may be overwritten by loudness) */ + ret = tas5805m_calc_passthrough(&coeffs); + if (ret != ESP_OK) return ret; + ret = write_biquad_band(TAS5805M_EQ_CHANNELS_RIGHT, TAS5805M_LOUDNESS_TREBLE_BAND, &coeffs); + if (ret != ESP_OK) return ret; ESP_LOGI(TAG, "Bi-amp crossover applied successfully (subsonic=%dHz)", settings->subsonic_freq); return ESP_OK; } -/* - * Initialize bi-amp settings to defaults +/* ============================================================================ + * Individual Band Application Functions + * + * These functions allow updating single parameters without re-applying the + * entire crossover configuration. Useful for real-time adjustment of gain, + * phase, or EQ settings without audible glitches. + * ============================================================================ */ + +/** + * @brief Apply woofer gain and phase settings to Band 0 (left channel) + * + * Updates only the gain/phase band without affecting crossover or EQ settings. + * Phase inversion is combined with gain into a single coefficient. + * + * @param gain_x2 Gain in 0.5dB steps (-48 to +48 = -24dB to +24dB) + * @param phase_invert Non-zero to invert polarity (180° phase shift) + * @param sample_rate Current sample rate (used for validation only) + * @return ESP_OK on success, error code on failure + */ +esp_err_t tas5805m_biamp_apply_low_gain_phase(int8_t gain_x2, uint8_t phase_invert, uint32_t sample_rate) +{ + tas5805m_biquad_coeffs_t coeffs; + + /* Clamp gain to valid range: -24dB to +24dB */ + if (gain_x2 < -48) gain_x2 = -48; + if (gain_x2 > 48) gain_x2 = 48; + + float gain_db = (float)gain_x2 / 2.0f; + esp_err_t ret; + + if (phase_invert) { + /* Combine negative gain with phase inversion */ + float linear_gain = -powf(10.0f, gain_db / 20.0f); + /* Clamp to Q5.27 representable range */ + if (linear_gain < -16.0f) linear_gain = -16.0f; + if (linear_gain > 15.999f) linear_gain = 15.999f; + coeffs.b0 = linear_gain; + coeffs.b1 = 0.0f; + coeffs.b2 = 0.0f; + coeffs.a1 = 0.0f; + coeffs.a2 = 0.0f; + } else { + ret = tas5805m_calc_gain(gain_db, &coeffs); + if (ret != ESP_OK) return ret; + } + + return write_biquad_band(TAS5805M_EQ_CHANNELS_LEFT, BIAMP_GAIN_BAND, &coeffs); +} + +/** + * @brief Apply tweeter gain and phase settings to Band 0 (right channel) + * + * Updates only the gain/phase band without affecting crossover or EQ settings. + * Phase inversion is combined with gain into a single coefficient. + * + * @param gain_x2 Gain in 0.5dB steps (-48 to +48 = -24dB to +24dB) + * @param phase_invert Non-zero to invert polarity (180° phase shift) + * @param sample_rate Current sample rate (used for validation only) + * @return ESP_OK on success, error code on failure + */ +esp_err_t tas5805m_biamp_apply_high_gain_phase(int8_t gain_x2, uint8_t phase_invert, uint32_t sample_rate) +{ + tas5805m_biquad_coeffs_t coeffs; + + /* Clamp gain to valid range: -24dB to +24dB */ + if (gain_x2 < -48) gain_x2 = -48; + if (gain_x2 > 48) gain_x2 = 48; + + float gain_db = (float)gain_x2 / 2.0f; + esp_err_t ret; + + if (phase_invert) { + /* Combine negative gain with phase inversion */ + float linear_gain = -powf(10.0f, gain_db / 20.0f); + /* Clamp to Q5.27 representable range */ + if (linear_gain < -16.0f) linear_gain = -16.0f; + if (linear_gain > 15.999f) linear_gain = 15.999f; + coeffs.b0 = linear_gain; + coeffs.b1 = 0.0f; + coeffs.b2 = 0.0f; + coeffs.a1 = 0.0f; + coeffs.a2 = 0.0f; + } else { + ret = tas5805m_calc_gain(gain_db, &coeffs); + if (ret != ESP_OK) return ret; + } + + return write_biquad_band(TAS5805M_EQ_CHANNELS_RIGHT, BIAMP_GAIN_BAND, &coeffs); +} + +/** + * @brief Apply subsonic highpass filter to Band 1 (left channel only) + * + * Protects woofer from infrasonic content that causes cone excursion without + * producing audible sound. Uses 2nd-order Butterworth response. + * + * Common subsonic frequencies: + * - 20 Hz: Minimal filtering, preserves deep bass + * - 30 Hz: Good protection for ported designs + * - 40 Hz: Aggressive protection for small woofers + * + * @param freq Cutoff frequency in Hz (0 = disabled/passthrough) + * @param sample_rate Current sample rate + * @return ESP_OK on success, error code on failure + */ +esp_err_t tas5805m_biamp_apply_subsonic(uint16_t freq, uint32_t sample_rate) +{ + tas5805m_biquad_coeffs_t coeffs; + float fs = (float)validate_sample_rate(sample_rate); + esp_err_t ret; + + if (freq > 0 && freq < fs / 2) { + ret = tas5805m_calc_butterworth_hpf((float)freq, fs, &coeffs); + } else { + ret = tas5805m_calc_passthrough(&coeffs); + } + if (ret != ESP_OK) return ret; + + return write_biquad_band(TAS5805M_EQ_CHANNELS_LEFT, BIAMP_SUBSONIC_BAND, &coeffs); +} + +/** + * @brief Apply tweeter time alignment delay to Band 1 (right channel only) + * + * Compensates for physical driver offset using all-pass filter approximation. + * This provides frequency-dependent phase shift that approximates a pure delay + * near the crossover region. + * + * @param delay_mm Physical offset in millimeters (0 = disabled/passthrough) + * @param sample_rate Current sample rate + * @return ESP_OK on success, error code on failure + */ +esp_err_t tas5805m_biamp_apply_tweeter_delay(uint8_t delay_mm, uint32_t sample_rate) +{ + tas5805m_biquad_coeffs_t coeffs; + float fs = (float)validate_sample_rate(sample_rate); + esp_err_t ret; + + if (delay_mm > 0) { + ret = tas5805m_calc_allpass_delay(delay_mm, fs, &coeffs); + } else { + ret = tas5805m_calc_passthrough(&coeffs); + } + if (ret != ESP_OK) return ret; + + return write_biquad_band(TAS5805M_EQ_CHANNELS_RIGHT, BIAMP_TWEETER_DELAY_BAND, &coeffs); +} + +/** + * @brief Apply single parametric EQ band for woofer (Bands 6-8, left channel) + * + * Allows individual PEQ band updates without affecting other bands. + * Useful for driver-specific corrections like cone breakup modes. + * + * @param band_index PEQ band index (0-2, maps to hardware bands 6-8) + * @param peq Pointer to PEQ band settings + * @param sample_rate Current sample rate + * @return ESP_OK on success, ESP_ERR_INVALID_ARG if band_index invalid + */ +esp_err_t tas5805m_biamp_apply_low_peq(int band_index, const tas5805m_biamp_peq_band_t *peq, uint32_t sample_rate) +{ + if (band_index < 0 || band_index >= BIAMP_PEQ_BANDS || !peq) { + return ESP_ERR_INVALID_ARG; + } + + tas5805m_biquad_coeffs_t coeffs; + float fs = (float)validate_sample_rate(sample_rate); + esp_err_t ret; + int band = BIAMP_PEQ_START_BAND + band_index; + + if (peq->freq > 0 && peq->freq < fs / 2 && peq->gain != 0) { + float q = (float)peq->q_x10 / 10.0f; + float gain_db = (float)peq->gain / 2.0f; + ret = tas5805m_calc_peq((float)peq->freq, gain_db, q, fs, &coeffs); + } else { + ret = tas5805m_calc_passthrough(&coeffs); + } + if (ret != ESP_OK) return ret; + + return write_biquad_band(TAS5805M_EQ_CHANNELS_LEFT, band, &coeffs); +} + +/** + * @brief Apply single parametric EQ band for tweeter (Bands 6-8, right channel) + * + * Allows individual PEQ band updates without affecting other bands. + * Useful for driver-specific corrections like dome resonances. + * + * @param band_index PEQ band index (0-2, maps to hardware bands 6-8) + * @param peq Pointer to PEQ band settings + * @param sample_rate Current sample rate + * @return ESP_OK on success, ESP_ERR_INVALID_ARG if band_index invalid + */ +esp_err_t tas5805m_biamp_apply_high_peq(int band_index, const tas5805m_biamp_peq_band_t *peq, uint32_t sample_rate) +{ + if (band_index < 0 || band_index >= BIAMP_PEQ_BANDS || !peq) { + return ESP_ERR_INVALID_ARG; + } + + tas5805m_biquad_coeffs_t coeffs; + float fs = (float)validate_sample_rate(sample_rate); + esp_err_t ret; + int band = BIAMP_PEQ_START_BAND + band_index; + + if (peq->freq > 0 && peq->freq < fs / 2 && peq->gain != 0) { + float q = (float)peq->q_x10 / 10.0f; + float gain_db = (float)peq->gain / 2.0f; + ret = tas5805m_calc_peq((float)peq->freq, gain_db, q, fs, &coeffs); + } else { + ret = tas5805m_calc_passthrough(&coeffs); + } + if (ret != ESP_OK) return ret; + + return write_biquad_band(TAS5805M_EQ_CHANNELS_RIGHT, band, &coeffs); +} + +/** + * @brief Apply baffle step compensation to Band 12 (left channel only) + * + * Applies low shelf boost to compensate for acoustic baffle diffraction step. + * The step frequency and gain are calculated based on baffle dimensions and + * speaker placement relative to room boundaries. + * + * @param width_cm Baffle width in centimeters (0 = disabled) + * @param placement Speaker placement (freestanding, near wall, corner) + * @param sample_rate Current sample rate + * @return ESP_OK on success, error code on failure + */ +esp_err_t tas5805m_biamp_apply_baffle_step(uint8_t width_cm, tas5805m_baffle_placement_t placement, uint32_t sample_rate) +{ + tas5805m_biquad_coeffs_t coeffs; + float fs = (float)validate_sample_rate(sample_rate); + esp_err_t ret; + + if (width_cm > 0) { + float step_freq, step_gain; + tas5805m_calc_baffle_step(width_cm, placement, &step_freq, &step_gain); + if (step_gain > 0.1f && step_freq > 0.0f && step_freq < fs / 2) { + ret = tas5805m_calc_low_shelf(step_freq, step_gain, fs, &coeffs); + } else { + ret = tas5805m_calc_passthrough(&coeffs); + } + } else { + ret = tas5805m_calc_passthrough(&coeffs); + } + if (ret != ESP_OK) return ret; + + return write_biquad_band(TAS5805M_EQ_CHANNELS_LEFT, BIAMP_BAFFLE_STEP_BAND, &coeffs); +} + +/** + * @brief Apply tweeter breakup notch filter to Band 12 (right channel only) + * + * Attenuates the tweeter's breakup resonance, typically found between + * 15-25 kHz depending on dome material and size. Uses a narrow peaking + * filter with negative gain. + * + * Typical notch parameters: + * - Aluminum dome: ~20-25 kHz, Q=5-10 + * - Silk dome: ~15-18 kHz, Q=3-5 + * + * @param freq Center frequency in Hz (0 = disabled) + * @param gain_x2 Gain in 0.5dB steps (must be negative for notch effect) + * @param q_x10 Q factor x10 (e.g., 50 = Q of 5.0) + * @param sample_rate Current sample rate + * @return ESP_OK on success, error code on failure + */ +esp_err_t tas5805m_biamp_apply_notch(uint16_t freq, int8_t gain_x2, uint8_t q_x10, uint32_t sample_rate) +{ + tas5805m_biquad_coeffs_t coeffs; + float fs = (float)validate_sample_rate(sample_rate); + esp_err_t ret; + + if (freq > 0 && gain_x2 < 0) { + float q = (float)q_x10 / 10.0f; + float gain_db = (float)gain_x2 / 2.0f; + ret = tas5805m_calc_peq((float)freq, gain_db, q, fs, &coeffs); + } else { + ret = tas5805m_calc_passthrough(&coeffs); + } + if (ret != ESP_OK) return ret; + + return write_biquad_band(TAS5805M_EQ_CHANNELS_RIGHT, BIAMP_NOTCH_BAND, &coeffs); +} + +/** + * @brief Apply air/brilliance high shelf to Band 13 (right channel only) + * + * Adjusts high frequency "air" or "brilliance" using a high shelf filter + * with fixed 10 kHz corner frequency. Positive gain adds sparkle/detail, + * negative gain softens the top end. + * + * @param gain_x2 Gain in 0.5dB steps (0 = disabled) + * @param sample_rate Current sample rate + * @return ESP_OK on success, error code on failure + */ +esp_err_t tas5805m_biamp_apply_air_shelf(int8_t gain_x2, uint32_t sample_rate) +{ + tas5805m_biquad_coeffs_t coeffs; + float fs = (float)validate_sample_rate(sample_rate); + esp_err_t ret; + + if (gain_x2 != 0) { + float gain_db = (float)gain_x2 / 2.0f; + ret = tas5805m_calc_high_shelf(10000.0f, gain_db, fs, &coeffs); + } else { + ret = tas5805m_calc_passthrough(&coeffs); + } + if (ret != ESP_OK) return ret; + + return write_biquad_band(TAS5805M_EQ_CHANNELS_RIGHT, BIAMP_AIR_SHELF_BAND, &coeffs); +} + +/* ============================================================================ + * Initialization + * ============================================================================ */ + +/** + * @brief Initialize bi-amp settings structure to safe defaults + * + * Sets all parameters to reasonable starting values: + * - Crossover: 2000 Hz, 24 dB/octave Linkwitz-Riley + * - Gains: 0 dB on both outputs + * - Phase: Normal (non-inverted) on both outputs + * - Subsonic filter: Disabled + * - PEQ bands: All disabled (freq=0) + * - Baffle step: Disabled + * - Time alignment: Disabled + * - Tweeter notch: Disabled + * - Air shelf: Disabled + * + * @param settings Pointer to settings structure to initialize */ void tas5805m_biamp_init_defaults(tas5805m_biamp_settings_t *settings) { @@ -485,28 +1193,44 @@ void tas5805m_biamp_init_defaults(tas5805m_biamp_settings_t *settings) memset(settings, 0, sizeof(tas5805m_biamp_settings_t)); + /* Crossover configuration */ settings->crossover_freq = TAS5805M_BIAMP_DEFAULT_XOVER_FREQ; settings->slope = TAS5805M_BIAMP_DEFAULT_SLOPE; settings->type = TAS5805M_BIAMP_DEFAULT_TYPE; settings->sample_rate = TAS5805M_BIAMP_DEFAULT_SAMPLE_RATE; - settings->subsonic_freq = 0; /* Disabled by default */ + settings->subsonic_freq = 0; /* Disabled */ + /* Output levels */ settings->low_gain = 0; settings->low_phase_invert = 0; - settings->high_gain = 0; settings->high_phase_invert = 0; - /* Initialize PEQ bands to disabled (freq=0) */ + /* Initialize PEQ bands to disabled with sensible Q defaults */ for (int i = 0; i < TAS5805M_BIAMP_PEQ_BANDS; i++) { - settings->low_peq[i].freq = 0; + settings->low_peq[i].freq = 0; /* Disabled */ settings->low_peq[i].gain = 0; - settings->low_peq[i].q_x10 = 14; /* Default Q = 1.4 */ + settings->low_peq[i].q_x10 = 14; /* Q = 1.4 (moderate bandwidth) */ - settings->high_peq[i].freq = 0; + settings->high_peq[i].freq = 0; /* Disabled */ settings->high_peq[i].gain = 0; - settings->high_peq[i].q_x10 = 14; + settings->high_peq[i].q_x10 = 14; /* Q = 1.4 */ } + + /* Baffle step compensation */ + settings->baffle_width_cm = 0; /* Disabled */ + settings->baffle_placement = BAFFLE_PLACEMENT_FREESTANDING; + + /* Time alignment */ + settings->tweeter_delay_mm = 0; /* Disabled */ + + /* Tweeter breakup notch */ + settings->notch_freq = 0; /* Disabled */ + settings->notch_gain = 0; + settings->notch_q_x10 = 50; /* Q = 5.0 (narrow notch) */ + + /* Air/brilliance shelf */ + settings->air_gain = 0; /* Disabled */ } #endif /* CONFIG_DAC_TAS5805M */ diff --git a/components/tas5805m_settings/tas5805m_settings.c b/components/tas5805m_settings/tas5805m_settings.c index d024b1af..222d2431 100644 --- a/components/tas5805m_settings/tas5805m_settings.c +++ b/components/tas5805m_settings/tas5805m_settings.c @@ -830,12 +830,28 @@ esp_err_t tas5805m_settings_save_biamp(const tas5805m_biamp_settings_t *settings } } + /* Baffle step compensation */ + if (err == ESP_OK) err = nvs_set_u8(h, TAS5805M_NVS_KEY_BAFFLE_WIDTH, settings->baffle_width_cm); + if (err == ESP_OK) err = nvs_set_u8(h, TAS5805M_NVS_KEY_BAFFLE_PLACEMENT, (uint8_t)settings->baffle_placement); + + /* Time alignment (tweeter delay) */ + if (err == ESP_OK) err = nvs_set_u8(h, TAS5805M_NVS_KEY_TWEETER_DELAY, settings->tweeter_delay_mm); + + /* Tweeter breakup notch */ + if (err == ESP_OK) err = nvs_set_u16(h, TAS5805M_NVS_KEY_NOTCH_FREQ, settings->notch_freq); + if (err == ESP_OK) err = nvs_set_i8(h, TAS5805M_NVS_KEY_NOTCH_GAIN, settings->notch_gain); + if (err == ESP_OK) err = nvs_set_u8(h, TAS5805M_NVS_KEY_NOTCH_Q, settings->notch_q_x10); + + /* Air/Brilliance shelf */ + if (err == ESP_OK) err = nvs_set_i8(h, TAS5805M_NVS_KEY_AIR_GAIN, settings->air_gain); + if (err == ESP_OK) err = nvs_commit(h); nvs_close(h); if (err == ESP_OK) { - ESP_LOGI(TAG, "%s: Saved bi-amp settings: xover=%dHz slope=%d type=%d sr=%lu", - __func__, settings->crossover_freq, settings->slope, settings->type, (unsigned long)settings->sample_rate); + ESP_LOGI(TAG, "%s: Saved bi-amp settings: xover=%dHz slope=%d sr=%lu notch=%dHz air=%.1fdB", + __func__, settings->crossover_freq, settings->slope, + (unsigned long)settings->sample_rate, settings->notch_freq, settings->air_gain / 2.0); } } else { ESP_LOGW(TAG, "%s: Failed to open NVS namespace '%s': %s", __func__, TAS5805M_NVS_NAMESPACE, esp_err_to_name(err)); @@ -918,9 +934,39 @@ esp_err_t tas5805m_settings_load_biamp(tas5805m_biamp_settings_t *settings) { if (nvs_get_u8(h, key, &u8val) == ESP_OK) settings->high_peq[i].q_x10 = u8val; } + /* Baffle step compensation */ + if (nvs_get_u8(h, TAS5805M_NVS_KEY_BAFFLE_WIDTH, &u8val) == ESP_OK) { + settings->baffle_width_cm = u8val; + } + if (nvs_get_u8(h, TAS5805M_NVS_KEY_BAFFLE_PLACEMENT, &u8val) == ESP_OK) { + settings->baffle_placement = (tas5805m_baffle_placement_t)u8val; + } + + /* Time alignment (tweeter delay) */ + if (nvs_get_u8(h, TAS5805M_NVS_KEY_TWEETER_DELAY, &u8val) == ESP_OK) { + settings->tweeter_delay_mm = u8val; + } + + /* Tweeter breakup notch */ + if (nvs_get_u16(h, TAS5805M_NVS_KEY_NOTCH_FREQ, &u16val) == ESP_OK) { + settings->notch_freq = u16val; + } + if (nvs_get_i8(h, TAS5805M_NVS_KEY_NOTCH_GAIN, &i8val) == ESP_OK) { + settings->notch_gain = i8val; + } + if (nvs_get_u8(h, TAS5805M_NVS_KEY_NOTCH_Q, &u8val) == ESP_OK) { + settings->notch_q_x10 = u8val; + } + + /* Air/Brilliance shelf */ + if (nvs_get_i8(h, TAS5805M_NVS_KEY_AIR_GAIN, &i8val) == ESP_OK) { + settings->air_gain = i8val; + } + nvs_close(h); - ESP_LOGD(TAG, "%s: Loaded bi-amp settings: xover=%dHz slope=%d type=%d sr=%lu", - __func__, settings->crossover_freq, settings->slope, settings->type, (unsigned long)settings->sample_rate); + ESP_LOGD(TAG, "%s: Loaded bi-amp settings: xover=%dHz slope=%d sr=%lu notch=%dHz air=%.1fdB", + __func__, settings->crossover_freq, settings->slope, + (unsigned long)settings->sample_rate, settings->notch_freq, settings->air_gain / 2.0); err = ESP_OK; } else if (err == ESP_ERR_NVS_NOT_FOUND) { ESP_LOGD(TAG, "%s: No bi-amp settings in NVS, using defaults", __func__); @@ -1071,10 +1117,48 @@ int tas5805m_loudness_get_zone(int volume) { /** Apply loudness compensation based on current volume */ esp_err_t tas5805m_loudness_apply(int volume) { + /* Get current sample rate from bi-amp settings or use default */ + float fs = 48000.0f; /* Default sample rate */ + tas5805m_biamp_settings_t biamp; + if (tas5805m_settings_load_biamp(&biamp) == ESP_OK && biamp.sample_rate > 0) { + fs = (float)biamp.sample_rate; + } + + tas5805m_biquad_coeffs_t coeffs; + esp_err_t ret; + if (!s_loudness_settings.enabled) { - return ESP_OK; /* Loudness disabled, nothing to do */ + /* Loudness disabled: reset bands 13 and 14 to passthrough (0dB, flat response) */ + ESP_LOGI(TAG, "%s: Loudness disabled, resetting bands to passthrough", __func__); + + /* Reset bass band (13) to passthrough on LEFT channel */ + ret = tas5805m_calc_low_shelf(200.0f, 0.0f, fs, &coeffs); + if (ret == ESP_OK) { + ret = tas5805m_write_biquad_coefficients(TAS5805M_EQ_CHANNELS_LEFT, + TAS5805M_LOUDNESS_BASS_BAND, + coeffs.b0, coeffs.b1, coeffs.b2, + coeffs.a1, coeffs.a2); + } + if (ret != ESP_OK) { + ESP_LOGW(TAG, "%s: Failed to reset bass band to passthrough", __func__); + } + + /* Reset treble band (14) to passthrough on RIGHT channel */ + ret = tas5805m_calc_high_shelf(4000.0f, 0.0f, fs, &coeffs); + if (ret == ESP_OK) { + ret = tas5805m_write_biquad_coefficients(TAS5805M_EQ_CHANNELS_RIGHT, + TAS5805M_LOUDNESS_TREBLE_BAND, + coeffs.b0, coeffs.b1, coeffs.b2, + coeffs.a1, coeffs.a2); + } + if (ret != ESP_OK) { + ESP_LOGW(TAG, "%s: Failed to reset treble band to passthrough", __func__); + } + + return ESP_OK; } + /* Loudness enabled: apply boost based on volume zone */ s_current_volume = volume; int zone = tas5805m_loudness_get_zone(volume); int8_t bass_db = s_loudness_settings.bass_boost[zone]; @@ -1083,16 +1167,6 @@ esp_err_t tas5805m_loudness_apply(int volume) { ESP_LOGI(TAG, "%s: Volume=%d%% Zone=%d Bass=%+ddB Treble=%+ddB", __func__, volume, zone, bass_db, treble_db); - /* Get current sample rate from bi-amp settings or use default */ - float fs = 48000.0f; /* Default sample rate */ - tas5805m_biamp_settings_t biamp; - if (tas5805m_settings_load_biamp(&biamp) == ESP_OK && biamp.sample_rate > 0) { - fs = (float)biamp.sample_rate; - } - - tas5805m_biquad_coeffs_t coeffs; - esp_err_t ret; - /* Apply low shelf for bass boost (200 Hz) - LEFT channel only (woofer in bi-amp) */ ret = tas5805m_calc_low_shelf(200.0f, (float)bass_db, fs, &coeffs); if (ret == ESP_OK) { @@ -1529,6 +1603,7 @@ esp_err_t tas5805m_settings_set_from_json(const char *json_in) { case TAS5805M_EQ_UI_MODE_15_BAND: drv = TAS5805M_EQ_MODE_ON; break; case TAS5805M_EQ_UI_MODE_15_BAND_BIAMP: drv = TAS5805M_EQ_MODE_BIAMP; break; case TAS5805M_EQ_UI_MODE_PRESETS: drv = TAS5805M_EQ_MODE_BIAMP; break; + case TAS5805M_EQ_UI_MODE_ADVANCED_BIAMP: drv = TAS5805M_EQ_MODE_BIAMP; break; default: drv = TAS5805M_EQ_MODE_OFF; break; } @@ -3043,6 +3118,43 @@ esp_err_t tas5805m_settings_get_eq_schema_json(char *json_out, size_t max_len) { cJSON_AddNumberToObject(subsonic, "current", biamp.subsonic_freq); cJSON_AddItemToArray(low_params, subsonic); + /* Baffle Step Compensation subgroup (woofer only) */ + { + cJSON *baffle_group = cJSON_CreateObject(); + cJSON_AddStringToObject(baffle_group, "name", "Baffle Step"); + cJSON_AddStringToObject(baffle_group, "type", "subgroup"); + cJSON *baffle_params = cJSON_CreateArray(); + + /* Baffle width (0=disabled, 5-50cm) */ + cJSON *baffle_width = cJSON_CreateObject(); + cJSON_AddStringToObject(baffle_width, "key", "biamp_baffle_width"); + cJSON_AddStringToObject(baffle_width, "name", "Baffle Width"); + cJSON_AddStringToObject(baffle_width, "type", "range"); + cJSON_AddStringToObject(baffle_width, "unit", "cm"); + cJSON_AddNumberToObject(baffle_width, "min", 0); + cJSON_AddNumberToObject(baffle_width, "max", 50); + cJSON_AddNumberToObject(baffle_width, "step", 1); + cJSON_AddNumberToObject(baffle_width, "current", biamp.baffle_width_cm); + cJSON_AddItemToArray(baffle_params, baffle_width); + + /* Placement type */ + cJSON *placement = cJSON_CreateObject(); + cJSON_AddStringToObject(placement, "key", "biamp_baffle_placement"); + cJSON_AddStringToObject(placement, "name", "Placement"); + cJSON_AddStringToObject(placement, "type", "enum"); + cJSON_AddNumberToObject(placement, "current", (int)biamp.baffle_placement); + cJSON *place_vals = cJSON_CreateArray(); + cJSON *pv; + pv = cJSON_CreateObject(); cJSON_AddNumberToObject(pv, "value", BAFFLE_PLACEMENT_FREESTANDING); cJSON_AddStringToObject(pv, "name", "Freestanding (+6dB)"); cJSON_AddItemToArray(place_vals, pv); + pv = cJSON_CreateObject(); cJSON_AddNumberToObject(pv, "value", BAFFLE_PLACEMENT_NEAR_WALL); cJSON_AddStringToObject(pv, "name", "Near Wall (+3dB)"); cJSON_AddItemToArray(place_vals, pv); + pv = cJSON_CreateObject(); cJSON_AddNumberToObject(pv, "value", BAFFLE_PLACEMENT_CORNER); cJSON_AddStringToObject(pv, "name", "Corner (0dB)"); cJSON_AddItemToArray(place_vals, pv); + cJSON_AddItemToObject(placement, "values", place_vals); + cJSON_AddItemToArray(baffle_params, placement); + + cJSON_AddItemToObject(baffle_group, "parameters", baffle_params); + cJSON_AddItemToArray(low_params, baffle_group); + } + /* PEQ bands as subgroups */ for (int i = 0; i < TAS5805M_BIAMP_PEQ_BANDS; i++) { char key[32], label[32]; @@ -3132,6 +3244,69 @@ esp_err_t tas5805m_settings_get_eq_schema_json(char *json_out, size_t max_len) { cJSON_AddNumberToObject(high_gain, "current", biamp.high_gain / 2.0); cJSON_AddItemToArray(high_params, high_gain); + /* Tweeter delay slider for time alignment */ + cJSON *twt_delay = cJSON_CreateObject(); + cJSON_AddStringToObject(twt_delay, "key", "biamp_tweeter_delay"); + cJSON_AddStringToObject(twt_delay, "label", "Delay"); + cJSON_AddStringToObject(twt_delay, "name", "Tweeter Delay"); + cJSON_AddStringToObject(twt_delay, "description", "Delays the tweeter to align with the woofer acoustic center. Set to the physical offset between drivers."); + cJSON_AddStringToObject(twt_delay, "type", "range"); + cJSON_AddStringToObject(twt_delay, "unit", "mm"); + cJSON_AddNumberToObject(twt_delay, "min", 0); + cJSON_AddNumberToObject(twt_delay, "max", 50); + cJSON_AddNumberToObject(twt_delay, "step", 1); + cJSON_AddNumberToObject(twt_delay, "current", biamp.tweeter_delay_mm); + cJSON_AddItemToArray(high_params, twt_delay); + + /* Breakup Notch subgroup */ + { + cJSON *notch_group = cJSON_CreateObject(); + cJSON_AddStringToObject(notch_group, "name", "Breakup Notch"); + cJSON_AddStringToObject(notch_group, "type", "subgroup"); + cJSON_AddStringToObject(notch_group, "description", "Tames the resonance peak at the tweeter's upper frequency limit"); + cJSON *notch_params = cJSON_CreateArray(); + + /* Notch frequency */ + cJSON *notch_freq = cJSON_CreateObject(); + cJSON_AddStringToObject(notch_freq, "key", "biamp_notch_freq"); + cJSON_AddStringToObject(notch_freq, "name", "Frequency"); + cJSON_AddStringToObject(notch_freq, "type", "range"); + cJSON_AddStringToObject(notch_freq, "unit", "Hz"); + cJSON_AddNumberToObject(notch_freq, "min", 0); + cJSON_AddNumberToObject(notch_freq, "max", 25000); + cJSON_AddNumberToObject(notch_freq, "step", 100); + cJSON_AddNumberToObject(notch_freq, "current", biamp.notch_freq); + cJSON_AddItemToArray(notch_params, notch_freq); + + /* Notch depth (gain, negative only) */ + cJSON *notch_gain = cJSON_CreateObject(); + cJSON_AddStringToObject(notch_gain, "key", "biamp_notch_gain"); + cJSON_AddStringToObject(notch_gain, "name", "Depth"); + cJSON_AddStringToObject(notch_gain, "type", "range"); + cJSON_AddStringToObject(notch_gain, "unit", "dB"); + cJSON_AddNumberToObject(notch_gain, "min", -12); + cJSON_AddNumberToObject(notch_gain, "max", 0); + cJSON_AddNumberToObject(notch_gain, "step", 0.5); + cJSON_AddNumberToObject(notch_gain, "decimals", 1); + cJSON_AddNumberToObject(notch_gain, "current", biamp.notch_gain / 2.0); + cJSON_AddItemToArray(notch_params, notch_gain); + + /* Notch Q */ + cJSON *notch_q = cJSON_CreateObject(); + cJSON_AddStringToObject(notch_q, "key", "biamp_notch_q"); + cJSON_AddStringToObject(notch_q, "name", "Q"); + cJSON_AddStringToObject(notch_q, "type", "range"); + cJSON_AddNumberToObject(notch_q, "min", 2.0); + cJSON_AddNumberToObject(notch_q, "max", 10.0); + cJSON_AddNumberToObject(notch_q, "step", 0.1); + cJSON_AddNumberToObject(notch_q, "decimals", 1); + cJSON_AddNumberToObject(notch_q, "current", biamp.notch_q_x10 / 10.0); + cJSON_AddItemToArray(notch_params, notch_q); + + cJSON_AddItemToObject(notch_group, "parameters", notch_params); + cJSON_AddItemToArray(high_params, notch_group); + } + /* PEQ bands as subgroups */ for (int i = 0; i < TAS5805M_BIAMP_PEQ_BANDS; i++) { char key[32], label[32]; @@ -3198,6 +3373,21 @@ esp_err_t tas5805m_settings_get_eq_schema_json(char *json_out, size_t max_len) { cJSON_AddItemToObject(high_phase, "values", hp_vals); cJSON_AddItemToArray(high_params, high_phase); + /* Air/Brilliance shelf slider (after phase) */ + cJSON *air_gain = cJSON_CreateObject(); + cJSON_AddStringToObject(air_gain, "key", "biamp_air_gain"); + cJSON_AddStringToObject(air_gain, "label", "Air"); + cJSON_AddStringToObject(air_gain, "name", "Air / Brilliance"); + cJSON_AddStringToObject(air_gain, "description", "High shelf at 10kHz for treble sparkle and air"); + cJSON_AddStringToObject(air_gain, "type", "range"); + cJSON_AddStringToObject(air_gain, "unit", "dB"); + cJSON_AddNumberToObject(air_gain, "min", -6); + cJSON_AddNumberToObject(air_gain, "max", 6); + cJSON_AddNumberToObject(air_gain, "step", 0.5); + cJSON_AddNumberToObject(air_gain, "decimals", 1); + cJSON_AddNumberToObject(air_gain, "current", biamp.air_gain / 2.0); + cJSON_AddItemToArray(high_params, air_gain); + cJSON_AddItemToObject(high_col, "parameters", high_params); cJSON_AddItemToArray(columns, high_col); @@ -3516,12 +3706,11 @@ esp_err_t tas5805m_settings_apply_delayed(void) { } } - /* Load and apply loudness compensation settings */ - tas5805m_loudness_settings_t loudness; - if (tas5805m_settings_load_loudness(&loudness) == ESP_OK && loudness.enabled) { + /* Load loudness settings into the static cache and apply if enabled */ + if (tas5805m_settings_load_loudness(&s_loudness_settings) == ESP_OK && s_loudness_settings.enabled) { int vol = 50; tas5805m_get_volume(&vol); - ESP_LOGI(TAG, "%s: Restoring loudness compensation (enabled=%d, vol=%d%%)", __func__, loudness.enabled, vol); + ESP_LOGI(TAG, "%s: Restoring loudness compensation (enabled=%d, vol=%d%%)", __func__, s_loudness_settings.enabled, vol); tas5805m_loudness_apply(vol); } #endif @@ -3714,6 +3903,11 @@ esp_err_t tas5805m_settings_get_eq_json(char *json_out, size_t max_len) { snprintf(key, sizeof(key), "eq_gain_r_%d", band); cJSON_AddNumberToObject(root, key, gain_r); } + + // Get loudness enabled state (needed for UI visibility) + tas5805m_loudness_settings_t loudness; + tas5805m_settings_load_loudness(&loudness); + cJSON_AddNumberToObject(root, "loudness_enabled", loudness.enabled); #else // EQ support disabled cJSON_AddNumberToObject(root, "eq_mode", 0); @@ -4022,68 +4216,112 @@ esp_err_t tas5805m_settings_set_eq_from_json(const char *json_in) { } /* Advanced Bi-Amp parameter handling */ else if (strncmp(key, "biamp_", 6) == 0 && cJSON_IsNumber(item)) { - /* Load current settings, modify, save, and apply */ + /* Load current settings, modify, save, and apply only affected band */ tas5805m_biamp_settings_t biamp; tas5805m_settings_load_biamp(&biamp); - bool modified = false; + + /* Track what type of change for targeted apply */ + enum { + BIAMP_CHANGE_NONE = 0, + BIAMP_CHANGE_CROSSOVER, /* Requires full apply */ + BIAMP_CHANGE_LOW_GAIN_PHASE, + BIAMP_CHANGE_HIGH_GAIN_PHASE, + BIAMP_CHANGE_SUBSONIC, + BIAMP_CHANGE_TWEETER_DELAY, + BIAMP_CHANGE_BAFFLE_STEP, + BIAMP_CHANGE_NOTCH, + BIAMP_CHANGE_AIR, + BIAMP_CHANGE_LOW_PEQ, + BIAMP_CHANGE_HIGH_PEQ + } change_type = BIAMP_CHANGE_NONE; + int peq_band_changed = -1; if (strcmp(key, "biamp_xover_freq") == 0) { - biamp.crossover_freq = (uint16_t)item->valueint; - modified = true; + /* Clamp crossover frequency to valid range (20Hz - 20000Hz) */ + int freq = item->valueint; + if (freq < 20) freq = 20; + if (freq > 20000) freq = 20000; + biamp.crossover_freq = (uint16_t)freq; + change_type = BIAMP_CHANGE_CROSSOVER; ESP_LOGI(TAG, "%s: Setting bi-amp crossover freq to %d Hz", __func__, biamp.crossover_freq); } else if (strcmp(key, "biamp_slope") == 0) { biamp.slope = (tas5805m_biamp_slope_t)item->valueint; - modified = true; + change_type = BIAMP_CHANGE_CROSSOVER; ESP_LOGI(TAG, "%s: Setting bi-amp slope to %d", __func__, biamp.slope); } else if (strcmp(key, "biamp_type") == 0) { biamp.type = (tas5805m_biamp_type_t)item->valueint; - modified = true; + change_type = BIAMP_CHANGE_CROSSOVER; ESP_LOGI(TAG, "%s: Setting bi-amp type to %d", __func__, biamp.type); } else if (strcmp(key, "biamp_sample_rate") == 0) { biamp.sample_rate = (uint32_t)item->valueint; - modified = true; + change_type = BIAMP_CHANGE_CROSSOVER; ESP_LOGI(TAG, "%s: Setting bi-amp sample rate to %lu Hz", __func__, (unsigned long)biamp.sample_rate); } else if (strcmp(key, "biamp_subsonic_freq") == 0) { biamp.subsonic_freq = (uint16_t)item->valueint; - modified = true; + change_type = BIAMP_CHANGE_SUBSONIC; ESP_LOGI(TAG, "%s: Setting bi-amp subsonic filter to %d Hz", __func__, biamp.subsonic_freq); } else if (strcmp(key, "biamp_low_gain") == 0) { - /* Gain comes as float in dB, store as x2 for 0.5 dB resolution */ biamp.low_gain = (int8_t)(item->valuedouble * 2.0 + (item->valuedouble >= 0 ? 0.5 : -0.5)); - modified = true; - ESP_LOGI(TAG, "%s: Setting bi-amp low gain to %.1f dB (x2=%d)", __func__, item->valuedouble, biamp.low_gain); + change_type = BIAMP_CHANGE_LOW_GAIN_PHASE; + ESP_LOGI(TAG, "%s: Setting bi-amp low gain to %.1f dB", __func__, item->valuedouble); } else if (strcmp(key, "biamp_low_phase") == 0) { biamp.low_phase_invert = (uint8_t)item->valueint; - modified = true; - ESP_LOGI(TAG, "%s: Setting bi-amp low phase to %d", __func__, biamp.low_phase_invert); + change_type = BIAMP_CHANGE_LOW_GAIN_PHASE; + ESP_LOGI(TAG, "%s: Setting bi-amp low phase to %s", __func__, biamp.low_phase_invert ? "inverted" : "normal"); } else if (strcmp(key, "biamp_high_gain") == 0) { - /* Gain comes as float in dB, store as x2 for 0.5 dB resolution */ biamp.high_gain = (int8_t)(item->valuedouble * 2.0 + (item->valuedouble >= 0 ? 0.5 : -0.5)); - modified = true; - ESP_LOGI(TAG, "%s: Setting bi-amp high gain to %.1f dB (x2=%d)", __func__, item->valuedouble, biamp.high_gain); + change_type = BIAMP_CHANGE_HIGH_GAIN_PHASE; + ESP_LOGI(TAG, "%s: Setting bi-amp high gain to %.1f dB", __func__, item->valuedouble); } else if (strcmp(key, "biamp_high_phase") == 0) { biamp.high_phase_invert = (uint8_t)item->valueint; - modified = true; - ESP_LOGI(TAG, "%s: Setting bi-amp high phase to %d", __func__, biamp.high_phase_invert); + change_type = BIAMP_CHANGE_HIGH_GAIN_PHASE; + ESP_LOGI(TAG, "%s: Setting bi-amp high phase to %s", __func__, biamp.high_phase_invert ? "inverted" : "normal"); + } else if (strcmp(key, "biamp_baffle_width") == 0) { + biamp.baffle_width_cm = (uint8_t)item->valueint; + change_type = BIAMP_CHANGE_BAFFLE_STEP; + ESP_LOGI(TAG, "%s: Setting bi-amp baffle width to %d cm", __func__, biamp.baffle_width_cm); + } else if (strcmp(key, "biamp_baffle_placement") == 0) { + biamp.baffle_placement = (tas5805m_baffle_placement_t)item->valueint; + change_type = BIAMP_CHANGE_BAFFLE_STEP; + ESP_LOGI(TAG, "%s: Setting bi-amp baffle placement to %d", __func__, biamp.baffle_placement); + } else if (strcmp(key, "biamp_tweeter_delay") == 0) { + biamp.tweeter_delay_mm = (uint8_t)item->valueint; + change_type = BIAMP_CHANGE_TWEETER_DELAY; + ESP_LOGI(TAG, "%s: Setting bi-amp tweeter delay to %d mm", __func__, biamp.tweeter_delay_mm); + } else if (strcmp(key, "biamp_notch_freq") == 0) { + biamp.notch_freq = (uint16_t)item->valueint; + change_type = BIAMP_CHANGE_NOTCH; + ESP_LOGI(TAG, "%s: Setting bi-amp notch freq to %d Hz", __func__, biamp.notch_freq); + } else if (strcmp(key, "biamp_notch_gain") == 0) { + biamp.notch_gain = (int8_t)(item->valuedouble * 2.0 + (item->valuedouble >= 0 ? 0.5 : -0.5)); + change_type = BIAMP_CHANGE_NOTCH; + ESP_LOGI(TAG, "%s: Setting bi-amp notch gain to %.1f dB", __func__, item->valuedouble); + } else if (strcmp(key, "biamp_notch_q") == 0) { + biamp.notch_q_x10 = (uint8_t)(item->valuedouble * 10.0 + 0.5); + change_type = BIAMP_CHANGE_NOTCH; + ESP_LOGI(TAG, "%s: Setting bi-amp notch Q to %.1f", __func__, item->valuedouble); + } else if (strcmp(key, "biamp_air_gain") == 0) { + biamp.air_gain = (int8_t)(item->valuedouble * 2.0 + (item->valuedouble >= 0 ? 0.5 : -0.5)); + change_type = BIAMP_CHANGE_AIR; + ESP_LOGI(TAG, "%s: Setting bi-amp air gain to %.1f dB", __func__, item->valuedouble); } /* Low output PEQ bands */ else if (strncmp(key, "biamp_low_peq", 13) == 0) { int peq_idx = key[13] - '0'; if (peq_idx >= 0 && peq_idx < TAS5805M_BIAMP_PEQ_BANDS) { + peq_band_changed = peq_idx; if (strstr(key, "_freq") != NULL) { biamp.low_peq[peq_idx].freq = (uint16_t)item->valueint; - modified = true; + change_type = BIAMP_CHANGE_LOW_PEQ; ESP_LOGI(TAG, "%s: Setting bi-amp low PEQ %d freq to %d Hz", __func__, peq_idx, biamp.low_peq[peq_idx].freq); } else if (strstr(key, "_gain") != NULL) { - /* Gain comes as float in dB, store as x2 for 0.5 dB resolution */ biamp.low_peq[peq_idx].gain = (int8_t)(item->valuedouble * 2.0 + (item->valuedouble >= 0 ? 0.5 : -0.5)); - modified = true; - ESP_LOGI(TAG, "%s: Setting bi-amp low PEQ %d gain to %.1f dB (x2=%d)", __func__, peq_idx, item->valuedouble, biamp.low_peq[peq_idx].gain); + change_type = BIAMP_CHANGE_LOW_PEQ; + ESP_LOGI(TAG, "%s: Setting bi-amp low PEQ %d gain to %.1f dB", __func__, peq_idx, item->valuedouble); } else if (strstr(key, "_q") != NULL) { - /* Q value comes as float (0.5-10.0), convert to q_x10 (5-100) */ biamp.low_peq[peq_idx].q_x10 = (uint8_t)(item->valuedouble * 10.0 + 0.5); - modified = true; - ESP_LOGI(TAG, "%s: Setting bi-amp low PEQ %d Q to %.1f (q_x10=%d)", __func__, peq_idx, item->valuedouble, biamp.low_peq[peq_idx].q_x10); + change_type = BIAMP_CHANGE_LOW_PEQ; + ESP_LOGI(TAG, "%s: Setting bi-amp low PEQ %d Q to %.1f", __func__, peq_idx, item->valuedouble); } } } @@ -4091,69 +4329,108 @@ esp_err_t tas5805m_settings_set_eq_from_json(const char *json_in) { else if (strncmp(key, "biamp_high_peq", 14) == 0) { int peq_idx = key[14] - '0'; if (peq_idx >= 0 && peq_idx < TAS5805M_BIAMP_PEQ_BANDS) { + peq_band_changed = peq_idx; if (strstr(key, "_freq") != NULL) { biamp.high_peq[peq_idx].freq = (uint16_t)item->valueint; - modified = true; + change_type = BIAMP_CHANGE_HIGH_PEQ; ESP_LOGI(TAG, "%s: Setting bi-amp high PEQ %d freq to %d Hz", __func__, peq_idx, biamp.high_peq[peq_idx].freq); } else if (strstr(key, "_gain") != NULL) { - /* Gain comes as float in dB, store as x2 for 0.5 dB resolution */ biamp.high_peq[peq_idx].gain = (int8_t)(item->valuedouble * 2.0 + (item->valuedouble >= 0 ? 0.5 : -0.5)); - modified = true; - ESP_LOGI(TAG, "%s: Setting bi-amp high PEQ %d gain to %.1f dB (x2=%d)", __func__, peq_idx, item->valuedouble, biamp.high_peq[peq_idx].gain); + change_type = BIAMP_CHANGE_HIGH_PEQ; + ESP_LOGI(TAG, "%s: Setting bi-amp high PEQ %d gain to %.1f dB", __func__, peq_idx, item->valuedouble); } else if (strstr(key, "_q") != NULL) { - /* Q value comes as float (0.5-10.0), convert to q_x10 (5-100) */ biamp.high_peq[peq_idx].q_x10 = (uint8_t)(item->valuedouble * 10.0 + 0.5); - modified = true; - ESP_LOGI(TAG, "%s: Setting bi-amp high PEQ %d Q to %.1f (q_x10=%d)", __func__, peq_idx, item->valuedouble, biamp.high_peq[peq_idx].q_x10); + change_type = BIAMP_CHANGE_HIGH_PEQ; + ESP_LOGI(TAG, "%s: Setting bi-amp high PEQ %d Q to %.1f", __func__, peq_idx, item->valuedouble); } } } - if (modified) { + if (change_type != BIAMP_CHANGE_NONE) { tas5805m_settings_save_biamp(&biamp); - /* Apply if we're in advanced bi-amp mode */ + + /* Apply only if we're in advanced bi-amp mode */ TAS5805M_EQ_UI_MODE ui_mode = TAS5805M_EQ_UI_MODE_OFF; tas5805m_settings_load_eq_ui_mode(&ui_mode); if (ui_mode == TAS5805M_EQ_UI_MODE_ADVANCED_BIAMP) { - tas5805m_settings_apply_biamp(&biamp); + /* Apply only the affected band(s) */ + switch (change_type) { + case BIAMP_CHANGE_CROSSOVER: + /* Crossover changes affect multiple bands - do full apply */ + tas5805m_settings_apply_biamp(&biamp); + break; + case BIAMP_CHANGE_LOW_GAIN_PHASE: + tas5805m_biamp_apply_low_gain_phase(biamp.low_gain, biamp.low_phase_invert, biamp.sample_rate); + break; + case BIAMP_CHANGE_HIGH_GAIN_PHASE: + tas5805m_biamp_apply_high_gain_phase(biamp.high_gain, biamp.high_phase_invert, biamp.sample_rate); + break; + case BIAMP_CHANGE_SUBSONIC: + tas5805m_biamp_apply_subsonic(biamp.subsonic_freq, biamp.sample_rate); + break; + case BIAMP_CHANGE_TWEETER_DELAY: + tas5805m_biamp_apply_tweeter_delay(biamp.tweeter_delay_mm, biamp.sample_rate); + break; + case BIAMP_CHANGE_BAFFLE_STEP: + tas5805m_biamp_apply_baffle_step(biamp.baffle_width_cm, biamp.baffle_placement, biamp.sample_rate); + break; + case BIAMP_CHANGE_NOTCH: + tas5805m_biamp_apply_notch(biamp.notch_freq, biamp.notch_gain, biamp.notch_q_x10, biamp.sample_rate); + break; + case BIAMP_CHANGE_AIR: + tas5805m_biamp_apply_air_shelf(biamp.air_gain, biamp.sample_rate); + break; + case BIAMP_CHANGE_LOW_PEQ: + if (peq_band_changed >= 0) { + tas5805m_biamp_apply_low_peq(peq_band_changed, &biamp.low_peq[peq_band_changed], biamp.sample_rate); + } + break; + case BIAMP_CHANGE_HIGH_PEQ: + if (peq_band_changed >= 0) { + tas5805m_biamp_apply_high_peq(peq_band_changed, &biamp.high_peq[peq_band_changed], biamp.sample_rate); + } + break; + default: + break; + } } } } - /* Loudness compensation parameter handling */ + /* Loudness compensation parameter handling - update static cache directly */ else if (strncmp(key, "loudness_", 9) == 0 && cJSON_IsNumber(item)) { - tas5805m_loudness_settings_t loudness; - tas5805m_settings_load_loudness(&loudness); + /* Ensure cache is loaded from NVS before modifying */ + tas5805m_settings_load_loudness(&s_loudness_settings); bool modified = false; if (strcmp(key, "loudness_enabled") == 0) { - loudness.enabled = (uint8_t)item->valueint; + s_loudness_settings.enabled = (uint8_t)item->valueint; modified = true; - ESP_LOGI(TAG, "%s: Setting loudness enabled to %d", __func__, loudness.enabled); + ESP_LOGI(TAG, "%s: Setting loudness enabled to %d", __func__, s_loudness_settings.enabled); } else if (strncmp(key, "loudness_thresh_", 16) == 0) { int idx = key[16] - '0'; if (idx >= 0 && idx < TAS5805M_LOUDNESS_ZONES - 1) { - loudness.thresholds[idx] = (uint8_t)item->valueint; + s_loudness_settings.thresholds[idx] = (uint8_t)item->valueint; modified = true; - ESP_LOGI(TAG, "%s: Setting loudness threshold %d to %d%%", __func__, idx, loudness.thresholds[idx]); + ESP_LOGI(TAG, "%s: Setting loudness threshold %d to %d%%", __func__, idx, s_loudness_settings.thresholds[idx]); } } else if (strncmp(key, "loudness_bass_", 14) == 0) { int idx = key[14] - '0'; if (idx >= 0 && idx < TAS5805M_LOUDNESS_ZONES) { - loudness.bass_boost[idx] = (int8_t)item->valueint; + s_loudness_settings.bass_boost[idx] = (int8_t)item->valueint; modified = true; - ESP_LOGI(TAG, "%s: Setting loudness bass zone %d to %d dB", __func__, idx, loudness.bass_boost[idx]); + ESP_LOGI(TAG, "%s: Setting loudness bass zone %d to %d dB", __func__, idx, s_loudness_settings.bass_boost[idx]); } } else if (strncmp(key, "loudness_treble_", 16) == 0) { int idx = key[16] - '0'; if (idx >= 0 && idx < TAS5805M_LOUDNESS_ZONES) { - loudness.treble_boost[idx] = (int8_t)item->valueint; + s_loudness_settings.treble_boost[idx] = (int8_t)item->valueint; modified = true; - ESP_LOGI(TAG, "%s: Setting loudness treble zone %d to %d dB", __func__, idx, loudness.treble_boost[idx]); + ESP_LOGI(TAG, "%s: Setting loudness treble zone %d to %d dB", __func__, idx, s_loudness_settings.treble_boost[idx]); } } if (modified) { - tas5805m_settings_save_loudness(&loudness); + tas5805m_settings_save_loudness(&s_loudness_settings); /* Re-apply loudness with current volume */ int vol = 50; tas5805m_get_volume(&vol); @@ -4202,6 +4479,12 @@ esp_err_t tas5805m_biamp_preset_export(char *json_out, size_t max_len) /* Subsonic filter */ cJSON_AddNumberToObject(root, "subsonic_freq", biamp.subsonic_freq); + /* Baffle step compensation */ + cJSON *baffle = cJSON_CreateObject(); + cJSON_AddNumberToObject(baffle, "width_cm", biamp.baffle_width_cm); + cJSON_AddNumberToObject(baffle, "placement", biamp.baffle_placement); + cJSON_AddItemToObject(root, "baffle_step", baffle); + /* Low output (woofer) - gains stored as x2, export as actual dB */ cJSON *low = cJSON_CreateObject(); cJSON_AddNumberToObject(low, "gain", biamp.low_gain / 2.0); @@ -4221,6 +4504,11 @@ esp_err_t tas5805m_biamp_preset_export(char *json_out, size_t max_len) cJSON *high = cJSON_CreateObject(); cJSON_AddNumberToObject(high, "gain", biamp.high_gain / 2.0); cJSON_AddNumberToObject(high, "phase_invert", biamp.high_phase_invert); + cJSON_AddNumberToObject(high, "delay_mm", biamp.tweeter_delay_mm); + cJSON_AddNumberToObject(high, "notch_freq", biamp.notch_freq); + cJSON_AddNumberToObject(high, "notch_gain", biamp.notch_gain / 2.0); + cJSON_AddNumberToObject(high, "notch_q", biamp.notch_q_x10 / 10.0); + cJSON_AddNumberToObject(high, "air_gain", biamp.air_gain / 2.0); cJSON *high_peq = cJSON_CreateArray(); for (int i = 0; i < TAS5805M_BIAMP_PEQ_BANDS; i++) { cJSON *band = cJSON_CreateObject(); @@ -4309,7 +4597,13 @@ esp_err_t tas5805m_biamp_preset_import(const char *json_in) cJSON *crossover = cJSON_GetObjectItem(root, "crossover"); if (crossover) { cJSON *freq = cJSON_GetObjectItem(crossover, "frequency"); - if (freq && cJSON_IsNumber(freq)) biamp.crossover_freq = (uint16_t)freq->valueint; + if (freq && cJSON_IsNumber(freq)) { + /* Clamp crossover frequency to valid range (20Hz - 20000Hz) */ + int f = freq->valueint; + if (f < 20) f = 20; + if (f > 20000) f = 20000; + biamp.crossover_freq = (uint16_t)f; + } cJSON *slope = cJSON_GetObjectItem(crossover, "slope"); if (slope && cJSON_IsNumber(slope)) biamp.slope = (tas5805m_biamp_slope_t)slope->valueint; @@ -4322,6 +4616,16 @@ esp_err_t tas5805m_biamp_preset_import(const char *json_in) cJSON *subsonic = cJSON_GetObjectItem(root, "subsonic_freq"); if (subsonic && cJSON_IsNumber(subsonic)) biamp.subsonic_freq = (uint16_t)subsonic->valueint; + /* Parse baffle step compensation */ + cJSON *baffle = cJSON_GetObjectItem(root, "baffle_step"); + if (baffle) { + cJSON *width = cJSON_GetObjectItem(baffle, "width_cm"); + if (width && cJSON_IsNumber(width)) biamp.baffle_width_cm = (uint8_t)width->valueint; + + cJSON *placement = cJSON_GetObjectItem(baffle, "placement"); + if (placement && cJSON_IsNumber(placement)) biamp.baffle_placement = (tas5805m_baffle_placement_t)placement->valueint; + } + /* Parse low output - gains in preset are actual dB, store as x2 */ cJSON *low = cJSON_GetObjectItem(root, "low_output"); if (low) { @@ -4363,6 +4667,25 @@ esp_err_t tas5805m_biamp_preset_import(const char *json_in) cJSON *phase = cJSON_GetObjectItem(high, "phase_invert"); if (phase && cJSON_IsNumber(phase)) biamp.high_phase_invert = (uint8_t)phase->valueint; + cJSON *delay = cJSON_GetObjectItem(high, "delay_mm"); + if (delay && cJSON_IsNumber(delay)) biamp.tweeter_delay_mm = (uint8_t)delay->valueint; + + cJSON *notch_freq = cJSON_GetObjectItem(high, "notch_freq"); + if (notch_freq && cJSON_IsNumber(notch_freq)) biamp.notch_freq = (uint16_t)notch_freq->valueint; + + cJSON *notch_gain = cJSON_GetObjectItem(high, "notch_gain"); + if (notch_gain && cJSON_IsNumber(notch_gain)) { + biamp.notch_gain = (int8_t)(notch_gain->valuedouble * 2.0 + (notch_gain->valuedouble >= 0 ? 0.5 : -0.5)); + } + + cJSON *notch_q = cJSON_GetObjectItem(high, "notch_q"); + if (notch_q && cJSON_IsNumber(notch_q)) biamp.notch_q_x10 = (uint8_t)(notch_q->valuedouble * 10.0 + 0.5); + + cJSON *air_gain_val = cJSON_GetObjectItem(high, "air_gain"); + if (air_gain_val && cJSON_IsNumber(air_gain_val)) { + biamp.air_gain = (int8_t)(air_gain_val->valuedouble * 2.0 + (air_gain_val->valuedouble >= 0 ? 0.5 : -0.5)); + } + cJSON *peq = cJSON_GetObjectItem(high, "peq"); if (peq && cJSON_IsArray(peq)) { int idx = 0; @@ -4452,4 +4775,102 @@ esp_err_t tas5805m_biamp_preset_import(const char *json_in) return ESP_OK; } +/* ============ Bi-Amp Reset to Defaults ============ */ + +esp_err_t tas5805m_biamp_reset_defaults(void) +{ + ESP_LOGI(TAG, "%s: Resetting bi-amp settings to defaults", __func__); + + nvs_handle_t nvs; + esp_err_t ret = nvs_open(TAS5805M_NVS_NAMESPACE, NVS_READWRITE, &nvs); + if (ret != ESP_OK) { + ESP_LOGE(TAG, "%s: Failed to open NVS: %s", __func__, esp_err_to_name(ret)); + return ret; + } + + /* Erase all bi-amp related NVS keys */ + nvs_erase_key(nvs, TAS5805M_NVS_KEY_BIAMP_XOVER_FREQ); + nvs_erase_key(nvs, TAS5805M_NVS_KEY_BIAMP_SLOPE); + nvs_erase_key(nvs, TAS5805M_NVS_KEY_BIAMP_TYPE); + nvs_erase_key(nvs, TAS5805M_NVS_KEY_BIAMP_LOW_GAIN); + nvs_erase_key(nvs, TAS5805M_NVS_KEY_BIAMP_LOW_PHASE); + nvs_erase_key(nvs, TAS5805M_NVS_KEY_BIAMP_HIGH_GAIN); + nvs_erase_key(nvs, TAS5805M_NVS_KEY_BIAMP_HIGH_PHASE); + nvs_erase_key(nvs, TAS5805M_NVS_KEY_BIAMP_SAMPLE_RATE); + nvs_erase_key(nvs, TAS5805M_NVS_KEY_BIAMP_SUBSONIC_FREQ); + + /* Erase baffle step keys */ + nvs_erase_key(nvs, TAS5805M_NVS_KEY_BAFFLE_WIDTH); + nvs_erase_key(nvs, TAS5805M_NVS_KEY_BAFFLE_PLACEMENT); + + /* Erase tweeter-specific keys */ + nvs_erase_key(nvs, TAS5805M_NVS_KEY_TWEETER_DELAY); + nvs_erase_key(nvs, TAS5805M_NVS_KEY_NOTCH_FREQ); + nvs_erase_key(nvs, TAS5805M_NVS_KEY_NOTCH_GAIN); + nvs_erase_key(nvs, TAS5805M_NVS_KEY_NOTCH_Q); + nvs_erase_key(nvs, TAS5805M_NVS_KEY_AIR_GAIN); + + /* Erase PEQ keys for both channels */ + char key[32]; + for (int i = 0; i < TAS5805M_BIAMP_PEQ_BANDS; i++) { + snprintf(key, sizeof(key), "%s%d_f", TAS5805M_NVS_KEY_BIAMP_PEQ_PREFIX_L, i); + nvs_erase_key(nvs, key); + snprintf(key, sizeof(key), "%s%d_g", TAS5805M_NVS_KEY_BIAMP_PEQ_PREFIX_L, i); + nvs_erase_key(nvs, key); + snprintf(key, sizeof(key), "%s%d_q", TAS5805M_NVS_KEY_BIAMP_PEQ_PREFIX_L, i); + nvs_erase_key(nvs, key); + + snprintf(key, sizeof(key), "%s%d_f", TAS5805M_NVS_KEY_BIAMP_PEQ_PREFIX_H, i); + nvs_erase_key(nvs, key); + snprintf(key, sizeof(key), "%s%d_g", TAS5805M_NVS_KEY_BIAMP_PEQ_PREFIX_H, i); + nvs_erase_key(nvs, key); + snprintf(key, sizeof(key), "%s%d_q", TAS5805M_NVS_KEY_BIAMP_PEQ_PREFIX_H, i); + nvs_erase_key(nvs, key); + } + + /* Erase loudness keys */ + nvs_erase_key(nvs, TAS5805M_NVS_KEY_LOUDNESS_ENABLED); + nvs_erase_key(nvs, TAS5805M_NVS_KEY_LOUDNESS_THRESH); + nvs_erase_key(nvs, TAS5805M_NVS_KEY_LOUDNESS_BASS); + nvs_erase_key(nvs, TAS5805M_NVS_KEY_LOUDNESS_TREBLE); + + nvs_commit(nvs); + nvs_close(nvs); + + /* Initialize bi-amp settings to defaults */ + tas5805m_biamp_settings_t biamp; + tas5805m_biamp_init_defaults(&biamp); + + /* Initialize loudness settings to defaults */ + tas5805m_loudness_settings_t loudness; + tas5805m_loudness_init_defaults(&loudness); + + /* Save the default settings */ + ret = tas5805m_settings_save_biamp(&biamp); + if (ret != ESP_OK) { + ESP_LOGE(TAG, "%s: Failed to save default bi-amp settings", __func__); + return ret; + } + + ret = tas5805m_settings_save_loudness(&loudness); + if (ret != ESP_OK) { + ESP_LOGE(TAG, "%s: Failed to save default loudness settings", __func__); + return ret; + } + + /* Apply the default settings */ + ret = tas5805m_biamp_apply(&biamp); + if (ret != ESP_OK) { + ESP_LOGW(TAG, "%s: Failed to apply bi-amp settings (codec may not be ready)", __func__); + } + + /* Re-apply loudness with current volume */ + int vol = 50; + tas5805m_get_volume(&vol); + tas5805m_loudness_apply(vol); + + ESP_LOGI(TAG, "%s: Bi-amp settings reset to defaults successfully", __func__); + return ESP_OK; +} + #endif /* CONFIG_DAC_TAS5805M */ diff --git a/components/ui_http_server/html/eq-settings.html b/components/ui_http_server/html/eq-settings.html index 12885b14..6e2cc1f6 100644 --- a/components/ui_http_server/html/eq-settings.html +++ b/components/ui_http_server/html/eq-settings.html @@ -433,6 +433,15 @@ background-color: #0056b3; } + .preset-btn.reset-btn { + background-color: #dc3545; + color: white; + } + + .preset-btn.reset-btn:hover { + background-color: #c82333; + } + .info-box { background-color: #d1ecf1; color: #0c5460; @@ -867,6 +876,22 @@

    EQ Settings

    }; presetButtonsDiv.appendChild(importBtn); + const resetBtn = document.createElement('button'); + resetBtn.className = 'preset-btn reset-btn'; + resetBtn.textContent = 'Reset to Defaults'; + resetBtn.onclick = async () => { + if (!confirm('Reset all Advanced Bi-Amp settings to defaults?\n\nThis will clear all crossover, PEQ, and loudness settings.')) return; + try { + const response = await fetch('/api/biamp/reset', { method: 'POST' }); + if (!response.ok) throw new Error('Reset failed'); + alert('Settings reset to defaults! Refreshing...'); + location.reload(); + } catch (err) { + alert('Failed to reset settings: ' + err.message); + } + }; + presetButtonsDiv.appendChild(resetBtn); + sectionsContainer.appendChild(presetButtonsDiv); contentWrapper.appendChild(sectionsContainer); diff --git a/components/ui_http_server/html/settings-ui.js b/components/ui_http_server/html/settings-ui.js index 36b7baa2..062d794a 100644 --- a/components/ui_http_server/html/settings-ui.js +++ b/components/ui_http_server/html/settings-ui.js @@ -254,27 +254,44 @@ label.textContent = param.name; controlDiv.appendChild(label); - const input = document.createElement('input'); - input.type = 'range'; - input.min = param.min; - input.max = param.max; - input.step = param.step || 1; - input.value = param.current !== undefined ? param.current : param.default || param.min; - - const valueSpan = document.createElement('span'); - valueSpan.className = 'peq-param-value'; - const decimals = param.decimals !== undefined ? param.decimals : 0; - valueSpan.textContent = Number(input.value).toFixed(decimals) + (param.unit || ''); - - input.oninput = function () { - valueSpan.textContent = Number(this.value).toFixed(decimals) + (param.unit || ''); - }; - input.onchange = function () { - if (onChange) onChange(param.key, parseFloat(this.value)); - }; + if (param.type === 'enum') { + // Render enum as dropdown + const select = document.createElement('select'); + param.values.forEach(option => { + const opt = document.createElement('option'); + opt.value = option.value; + opt.textContent = option.name; + if (param.current == option.value) opt.selected = true; + select.appendChild(opt); + }); + select.onchange = function () { + if (onChange) onChange(param.key, parseInt(this.value)); + }; + controlDiv.appendChild(select); + } else { + // Render as range slider (default) + const input = document.createElement('input'); + input.type = 'range'; + input.min = param.min; + input.max = param.max; + input.step = param.step || 1; + input.value = param.current !== undefined ? param.current : param.default || param.min; + + const valueSpan = document.createElement('span'); + valueSpan.className = 'peq-param-value'; + const decimals = param.decimals !== undefined ? param.decimals : 0; + valueSpan.textContent = Number(input.value).toFixed(decimals) + (param.unit || ''); + + input.oninput = function () { + valueSpan.textContent = Number(this.value).toFixed(decimals) + (param.unit || ''); + }; + input.onchange = function () { + if (onChange) onChange(param.key, parseFloat(this.value)); + }; - controlDiv.appendChild(input); - controlDiv.appendChild(valueSpan); + controlDiv.appendChild(input); + controlDiv.appendChild(valueSpan); + } paramsRow.appendChild(controlDiv); }); @@ -365,10 +382,10 @@ paramsContainer.appendChild(controlDiv); }); } else if (section.layout === 'output-channel') { - // Output channel layout: regular params + PEQ subgroups + phase radio + // Output channel layout: regular params + PEQ subgroups + generic subgroups + phase radio section.parameters.forEach(param => { let controlDiv; - if (param.type === 'peq-subgroup') { + if (param.type === 'peq-subgroup' || param.type === 'subgroup') { controlDiv = renderPeqSubgroup(param, currentSettings, onChange); } else { controlDiv = renderParameter(param, currentSettings, onChange); diff --git a/components/ui_http_server/ui_http_server.c b/components/ui_http_server/ui_http_server.c index 504ed7b0..146c99b0 100644 --- a/components/ui_http_server/ui_http_server.c +++ b/components/ui_http_server/ui_http_server.c @@ -75,6 +75,13 @@ static const embedded_file_t embedded_files[] = { {"/favicon.ico", favicon_ico_start, favicon_ico_end, "image/x-icon"}, }; +/** + * Check if a character is a valid hexadecimal digit + */ +static inline int is_hex_digit(char c) { + return (c >= '0' && c <= '9') || (c >= 'A' && c <= 'F') || (c >= 'a' && c <= 'f'); +} + /** * Simple URL decode function * Decodes %XX hex sequences and + as space @@ -85,8 +92,9 @@ static void url_decode(char *dst, const char *src, size_t dst_size) { while (src[src_idx] != '\0' && dst_idx < dst_size - 1) { if (src[src_idx] == '%' && src[src_idx + 1] != '\0' && - src[src_idx + 2] != '\0') { - // Decode %XX + src[src_idx + 2] != '\0' && + is_hex_digit(src[src_idx + 1]) && is_hex_digit(src[src_idx + 2])) { + // Decode %XX (only if both chars are valid hex digits) char hex[3] = {src[src_idx + 1], src[src_idx + 2], '\0'}; dst[dst_idx++] = (char)strtol(hex, NULL, 16); src_idx += 3; @@ -94,6 +102,9 @@ static void url_decode(char *dst, const char *src, size_t dst_size) { // Convert + to space dst[dst_idx++] = ' '; src_idx++; + } else if (src[src_idx] == '%') { + // Invalid %XX sequence - skip the % and continue + src_idx++; } else { dst[dst_idx++] = src[src_idx++]; } @@ -103,10 +114,17 @@ static void url_decode(char *dst, const char *src, size_t dst_size) { /** * Find key value in parameter string + * @param key Key to search for (including '=' suffix) + * @param parameter Parameter string to search in + * @param value Output buffer for the value + * @param value_size Size of the output buffer + * @return Length of value found, 0 if not found */ -static int find_key_value(char *key, char *parameter, char *value) { +static int find_key_value(char *key, char *parameter, char *value, size_t value_size) { + if (value_size == 0) return 0; + value[0] = '\0'; + ESP_LOGD(TAG, "%s: key=%s", __func__, key); - // char * addr1; char *addr1 = strstr(parameter, key); if (addr1 == NULL) return 0; @@ -117,15 +135,24 @@ static int find_key_value(char *key, char *parameter, char *value) { char *addr3 = strstr(addr2, "&"); ESP_LOGD(TAG, "%s: addr3=%p", __func__, addr3); + + size_t length; if (addr3 == NULL) { - strcpy(value, addr2); + length = strlen(addr2); } else { - int length = addr3 - addr2; - ESP_LOGD(TAG, "%s: addr2=%p addr3=%p length=%d", __func__, addr2, addr3, - length); - strncpy(value, addr2, length); - value[length] = 0; + length = addr3 - addr2; + } + + /* Bound the copy to the buffer size (leave room for null terminator) */ + if (length >= value_size) { + length = value_size - 1; + ESP_LOGW(TAG, "%s: value truncated to %zu chars", __func__, length); } + + ESP_LOGD(TAG, "%s: addr2=%p addr3=%p length=%zu", __func__, addr2, addr3, length); + memcpy(value, addr2, length); + value[length] = '\0'; + ESP_LOGD(TAG, "%s: key=[%s] value=[%s]", __func__, key, value); return strlen(value); } @@ -133,9 +160,27 @@ static int find_key_value(char *key, char *parameter, char *value) { /** * Set CORS headers to allow cross-origin requests * This enables local development with ?backend parameter + * + * Security note: Instead of wildcard (*), we reflect the request's Origin header. + * This prevents arbitrary websites from making cross-origin requests while still + * allowing legitimate local development scenarios (localhost, local IPs). + * The device has no authentication, so CORS is the main CSRF protection. */ static void set_cors_headers(httpd_req_t *req) { - httpd_resp_set_hdr(req, "Access-Control-Allow-Origin", "*"); + /* Get the Origin header from the request */ + char origin[128] = {0}; + if (httpd_req_get_hdr_value_str(req, "Origin", origin, sizeof(origin)) == ESP_OK && origin[0] != '\0') { + /* Validate origin: only allow http/https from localhost or local IPs */ + if (strncmp(origin, "http://localhost", 16) == 0 || + strncmp(origin, "https://localhost", 17) == 0 || + strncmp(origin, "http://127.", 11) == 0 || + strncmp(origin, "http://192.168.", 15) == 0 || + strncmp(origin, "http://10.", 10) == 0 || + strncmp(origin, "http://172.", 11) == 0) { + httpd_resp_set_hdr(req, "Access-Control-Allow-Origin", origin); + } + /* If origin doesn't match allowed patterns, don't set CORS header (browser will block) */ + } httpd_resp_set_hdr(req, "Access-Control-Allow-Methods", "GET, POST, DELETE, OPTIONS"); httpd_resp_set_hdr(req, "Access-Control-Allow-Headers", "Content-Type"); @@ -174,8 +219,8 @@ static esp_err_t root_post_handler(httpd_req_t *req) { memset(&urlBuf, 0, sizeof(URL_t)); - if (find_key_value("param=", (char *)req->uri, param) && - find_key_value("value=", (char *)req->uri, valstr)) { + if (find_key_value("param=", (char *)req->uri, param, sizeof(param)) && + find_key_value("value=", (char *)req->uri, valstr, sizeof(valstr))) { // Special handling for hostname (string parameter) if (strcmp(param, "hostname") == 0) { @@ -281,7 +326,7 @@ static esp_err_t root_delete_handler(httpd_req_t *req) { set_cors_headers(req); - if (!find_key_value("param=", (char *)req->uri, param)) { + if (!find_key_value("param=", (char *)req->uri, param, sizeof(param))) { ESP_LOGD(TAG, "%s: Invalid delete: expected param=NAME in URI", __func__); httpd_resp_set_status(req, "400 Bad Request"); @@ -360,7 +405,7 @@ static esp_err_t get_param_handler(httpd_req_t *req) { set_cors_headers(req); - if (find_key_value("param=", (char *)req->uri, param)) { + if (find_key_value("param=", (char *)req->uri, param, sizeof(param))) { // Special handling for hostname (string parameter) if (strcmp(param, "hostname") == 0) { char hostname[64] = {0}; @@ -516,7 +561,7 @@ static esp_err_t get_capabilities_handler(httpd_req_t *req) { // Parse tab parameter char tab[16] = {0}; - if (!find_key_value("tab=", (char *)req->uri, tab)) { + if (!find_key_value("tab=", (char *)req->uri, tab, sizeof(tab))) { // No tab specified, return error ESP_LOGW(TAG, "%s: Missing 'tab' parameter", __func__); httpd_resp_set_status(req, "400 Bad Request"); @@ -1025,6 +1070,38 @@ static esp_err_t post_biamp_preset_handler(httpd_req_t *req) { #endif } +/* + * POST /api/biamp/reset handler + * Resets bi-amp settings to defaults (clears NVS) + */ +static esp_err_t post_biamp_reset_handler(httpd_req_t *req) { + set_cors_headers(req); + +#if defined(CONFIG_DAC_TAS5805M) + ESP_LOGI(TAG, "%s: Resetting bi-amp settings to defaults", __func__); + + esp_err_t err = tas5805m_biamp_reset_defaults(); + + if (err != ESP_OK) { + ESP_LOGE(TAG, "%s: Failed to reset settings: %s", __func__, esp_err_to_name(err)); + httpd_resp_set_status(req, "500 Internal Server Error"); + httpd_resp_set_type(req, "application/json"); + httpd_resp_sendstr(req, "{\"error\": \"Failed to reset settings\"}"); + return ESP_OK; + } + + httpd_resp_set_status(req, "200 OK"); + httpd_resp_set_type(req, "application/json"); + httpd_resp_sendstr(req, "{\"success\": true}"); + + return ESP_OK; +#else + httpd_resp_set_status(req, "404 Not Found"); + httpd_resp_sendstr(req, "{\"error\": \"TAS5805M not configured\"}"); + return ESP_OK; +#endif +} + /* * Static file handler * Serves files from embedded flash memory @@ -1300,6 +1377,22 @@ esp_err_t start_server(const char *base_path, int port) { .handler = options_handler, }; httpd_register_uri_handler(server, &_options_biamp_preset_handler); + + /* URI handler for Bi-Amp Reset to Defaults */ + httpd_uri_t _post_biamp_reset_handler = { + .uri = "/api/biamp/reset", + .method = HTTP_POST, + .handler = post_biamp_reset_handler, + }; + httpd_register_uri_handler(server, &_post_biamp_reset_handler); + + /* OPTIONS handler for CORS preflight - Bi-Amp reset endpoint */ + httpd_uri_t _options_biamp_reset_handler = { + .uri = "/api/biamp/reset", + .method = HTTP_OPTIONS, + .handler = options_handler, + }; + httpd_register_uri_handler(server, &_options_biamp_reset_handler); #endif /* CONFIG_DAC_TAS5805M */ /* URI handler for static files (catch-all, must be last) */ diff --git a/docs/ADVANCED_BIAMP_USER_GUIDE.md b/docs/ADVANCED_BIAMP_USER_GUIDE.md new file mode 100644 index 00000000..61f1546e --- /dev/null +++ b/docs/ADVANCED_BIAMP_USER_GUIDE.md @@ -0,0 +1,385 @@ +# Advanced Bi-Amp Crossover User Guide + +This guide covers all configuration options available in the Advanced Bi-Amp mode for the TAS5805M DAC. This mode enables active crossover functionality, allowing a single stereo amplifier to drive a 2-way speaker with separate woofer and tweeter outputs. + +## Overview + +In Advanced Bi-Amp mode: +- **Left channel** → Low-pass filtered → **Woofer** +- **Right channel** → High-pass filtered → **Tweeter** + +The system provides 15 biquad filter stages per channel, allocated as follows: + +| Band | Woofer (Left) | Tweeter (Right) | +|------|---------------|-----------------| +| 0 | Gain/Phase | Gain/Phase | +| 1 | Subsonic HPF | Time Alignment | +| 2-5 | Lowpass Crossover | Highpass Crossover | +| 6-11 | PEQ (6 bands) | PEQ (6 bands) | +| 12 | Baffle Step | Breakup Notch | +| 13 | Bass Loudness | Air/Brilliance | +| 14 | (Spare) | Treble Loudness | + +--- + +## Crossover Settings + +### Frequency +- **Range:** 20 - 20,000 Hz +- **Default:** 2000 Hz +- **Purpose:** Sets the crossover point where the woofer and tweeter frequency ranges meet. + +**Guidelines:** +- Check your speaker/driver specifications for recommended crossover frequency +- Typical 2-way speakers: 1500-3500 Hz +- Small woofers (3-4"): 3000-4000 Hz +- Larger woofers (5-6.5"): 1800-2500 Hz +- Always cross over above the tweeter's resonance frequency (Fs) + +### Slope +- **Options:** 12 dB/oct, 24 dB/oct (LR), 48 dB/oct +- **Default:** 24 dB/oct + +| Slope | Biquads Used | Characteristics | +|-------|--------------|-----------------| +| 12 dB/oct | 1 | Gentle rolloff, wide overlap between drivers | +| 24 dB/oct | 2 | Standard Linkwitz-Riley, flat summed response | +| 48 dB/oct | 4 | Steep rolloff, minimal driver overlap | + +**Recommendation:** 24 dB/oct (Linkwitz-Riley) is the most commonly used and provides excellent phase coherence at the crossover point. + +### Type +- **Options:** Butterworth, Linkwitz-Riley +- **Default:** Linkwitz-Riley + +| Type | Characteristics | +|------|-----------------| +| Butterworth | -3dB at crossover frequency, +3dB summed response bump | +| Linkwitz-Riley | -6dB at crossover frequency, flat summed response | + +**Recommendation:** Linkwitz-Riley is preferred for most applications as it provides a flat combined response. + +### Sample Rate +- **Options:** 44.1 kHz, 48 kHz, 88.2 kHz, 96 kHz +- **Default:** 48 kHz +- **Purpose:** Must match the audio source sample rate for accurate filter calculations. + +**Note:** Mismatched sample rates will cause incorrect crossover frequencies. + +--- + +## Low Output (Woofer) Settings + +### Output Gain +- **Range:** -24 to +24 dB (0.5 dB steps) +- **Default:** 0 dB +- **Purpose:** Adjusts the woofer output level relative to the tweeter. + +**Usage:** +- Use to balance woofer and tweeter levels +- Negative values reduce woofer output +- Typically adjusted by ear or with measurement microphone + +### Subsonic HPF (High-Pass Filter) +- **Range:** 0 - 80 Hz (5 Hz steps) +- **Default:** 0 (disabled) +- **Purpose:** Protects the woofer from ultra-low frequencies that cause excessive excursion. + +**Guidelines:** +- Set to just below the woofer's usable low-frequency limit +- Sealed boxes: typically 30-50 Hz +- Ported boxes: set at or slightly below port tuning frequency +- Prevents wasted amplifier power on inaudible frequencies + +### Baffle Step Compensation + +Baffle step is an acoustic phenomenon where low frequencies diffract around the speaker cabinet while high frequencies beam forward, causing a 6dB level difference. + +#### Baffle Width +- **Range:** 0 - 50 cm (0 = disabled) +- **Purpose:** Enter the width of your speaker's front baffle. + +The system calculates the step frequency using: +``` +Step Frequency = 343 / (π × width_in_meters) +``` + +| Baffle Width | Step Frequency | +|--------------|----------------| +| 15 cm | ~728 Hz | +| 20 cm | ~546 Hz | +| 25 cm | ~437 Hz | +| 30 cm | ~364 Hz | + +#### Placement +- **Options:** Freestanding (+6dB), Near Wall (+3dB), Corner (0dB) +- **Purpose:** Room boundaries provide natural bass reinforcement, reducing the compensation needed. + +| Placement | Compensation | When to Use | +|-----------|--------------|-------------| +| Freestanding | +6 dB | Speaker >1m from any wall | +| Near Wall | +3 dB | Speaker within 0.5m of back wall | +| Corner | 0 dB | Speaker in or near a corner | + +### Parametric EQ (PEQ) - 6 Bands + +Each PEQ band allows precise frequency response correction. + +#### Frequency +- **Range:** 20 - 20,000 Hz (0 = band disabled) +- **Purpose:** Center frequency of the filter. + +#### Gain +- **Range:** -15 to +15 dB (0.5 dB steps) +- **Purpose:** Boost or cut at the center frequency. + +#### Q (Quality Factor) +- **Range:** 0.5 - 10.0 +- **Purpose:** Controls the width of the filter. + +| Q Value | Bandwidth | Use Case | +|---------|-----------|----------| +| 0.5-1.0 | Very wide | Broad tonal shaping | +| 1.0-2.0 | Wide | General EQ adjustments | +| 2.0-5.0 | Medium | Room mode correction | +| 5.0-10.0 | Narrow | Notching specific resonances | + +**Typical Uses:** +- Room mode correction (narrow cuts at problematic frequencies) +- Driver response smoothing +- Voicing adjustments + +### Phase +- **Options:** Normal, Invert +- **Default:** Normal +- **Purpose:** Inverts the polarity of the woofer output. + +**When to Use:** +- If woofer and tweeter are acoustically out of phase at crossover +- Test by ear: correct phase typically gives fuller sound with better imaging +- Some crossover slopes require phase inversion for proper summing + +--- + +## High Output (Tweeter) Settings + +### Output Gain +- **Range:** -24 to +24 dB (0.5 dB steps) +- **Default:** 0 dB +- **Purpose:** Adjusts the tweeter output level relative to the woofer. + +### Tweeter Delay (Time Alignment) +- **Range:** 0 - 50 mm +- **Default:** 0 (disabled) +- **Purpose:** Delays the tweeter signal to align acoustically with the woofer. + +**Why It's Needed:** +The acoustic center of a woofer is typically 15-25mm behind the cone surface, while a tweeter's acoustic center is only 5-10mm behind the dome. If both drivers are flush-mounted, the tweeter's sound arrives first, causing phase issues at the crossover frequency. + +**How to Set:** +1. **Physical Measurement:** Measure the difference between driver acoustic centers +2. **Listening Test:** Adjust until transients sound tight and focused +3. **With Measurement:** Align impulse response peaks in measurement software + +**Conversion:** +- 10mm delay ≈ 29 microseconds +- 20mm delay ≈ 58 microseconds +- 30mm delay ≈ 87 microseconds + +### Breakup Notch + +Most tweeters exhibit a resonance peak at their upper frequency limit (breakup mode). This notch filter tames that peak for smoother response. + +#### Frequency +- **Range:** 0 - 25,000 Hz (0 = disabled) +- **Purpose:** Set to the tweeter's breakup frequency. + +**Finding the Breakup Frequency:** +- Check the tweeter's datasheet/frequency response graph +- Look for a sharp peak near the upper limit +- Typical dome tweeters: 20-28 kHz +- Lower quality tweeters: may be 15-20 kHz + +#### Depth +- **Range:** 0 to -12 dB (0.5 dB steps) +- **Purpose:** Amount of cut at the breakup frequency. + +**Guidelines:** +- Start with -3 to -6 dB +- Match the height of the breakup peak in the frequency response +- Excessive notching can dull the high frequencies + +#### Q (Quality Factor) +- **Range:** 2.0 - 10.0 +- **Default:** 5.0 +- **Purpose:** Width of the notch filter. + +**Guidelines:** +- Higher Q = narrower notch (more surgical) +- Match the width of the breakup peak +- Typical values: 4-8 + +### Air / Brilliance Shelf +- **Range:** -6 to +6 dB (0.5 dB steps) +- **Default:** 0 dB +- **Corner Frequency:** Fixed at 10 kHz +- **Purpose:** Adjusts the overall "air" and sparkle in the treble. + +**Usage:** +| Setting | Effect | +|---------|--------| +| +1 to +3 dB | Adds openness, detail, "air" | +| 0 dB | Neutral | +| -1 to -3 dB | Reduces brightness, less fatigue | + +**When to Adjust:** +- Recording sounds dull → slight boost +- Recording sounds harsh/fatiguing → slight cut +- Personal preference for treble presentation + +### Parametric EQ (PEQ) - 6 Bands + +Same functionality as woofer PEQ. Common tweeter uses: +- Presence adjustment (2-5 kHz) +- Sibilance reduction (5-8 kHz) +- Response smoothing + +### Phase +- **Options:** Normal, Invert +- **Default:** Normal +- **Purpose:** Inverts the polarity of the tweeter output. + +--- + +## Loudness Compensation + +Volume-dependent EQ that boosts bass and treble at lower listening levels, compensating for the ear's reduced sensitivity to frequency extremes at low volumes (Fletcher-Munson curves). + +### Enable/Disable +- **Options:** On, Off +- **Default:** Off + +### Zone Configuration + +The volume range (0-100%) is divided into 5 zones, each with independent bass and treble boost settings. + +#### Thresholds +Define the volume percentage boundaries between zones: +- **Zone 1:** 0% to Threshold 1 +- **Zone 2:** Threshold 1 to Threshold 2 +- **Zone 3:** Threshold 2 to Threshold 3 +- **Zone 4:** Threshold 3 to Threshold 4 +- **Zone 5:** Threshold 4 to 100% + +**Default Thresholds:** 20%, 40%, 60%, 80% + +#### Bass Boost (per zone) +- **Range:** -12 to +12 dB +- **Frequency:** Low shelf at ~200 Hz (woofer channel) + +**Default Values:** +| Zone | Volume Range | Bass Boost | +|------|--------------|------------| +| 1 | 0-20% | +6 dB | +| 2 | 20-40% | +4 dB | +| 3 | 40-60% | +2 dB | +| 4 | 60-80% | +1 dB | +| 5 | 80-100% | 0 dB | + +#### Treble Boost (per zone) +- **Range:** -12 to +12 dB +- **Frequency:** High shelf at ~5 kHz (tweeter channel) + +**Default Values:** +| Zone | Volume Range | Treble Boost | +|------|--------------|--------------| +| 1 | 0-20% | +4 dB | +| 2 | 20-40% | +3 dB | +| 3 | 40-60% | +2 dB | +| 4 | 60-80% | +1 dB | +| 5 | 80-100% | 0 dB | + +--- + +## Preset Export/Import + +Save and share your bi-amp configurations. + +### Export +Creates a JSON file containing all bi-amp settings: +- Crossover configuration +- All woofer settings (gain, subsonic, baffle step, PEQ, phase) +- All tweeter settings (gain, delay, notch, air, PEQ, phase) +- Loudness compensation settings + +### Import +Load a previously exported preset. All settings are validated before applying. + +**Use Cases:** +- Backup your configuration +- Share settings with others using the same speaker design +- Quickly switch between configurations for different speakers + +--- + +## Quick Setup Guide + +### Basic Setup +1. Set **Crossover Frequency** to your speaker's specified crossover point +2. Set **Slope** to 24 dB/oct (Linkwitz-Riley) +3. Set **Sample Rate** to match your audio source +4. Adjust **Woofer Gain** and **Tweeter Gain** to balance levels + +### Adding Protection +1. Set **Subsonic HPF** to protect your woofer (typically 30-50 Hz) +2. If using breakup notch, set frequency from tweeter datasheet + +### Fine-Tuning +1. Add **Baffle Step Compensation** if needed for your cabinet +2. Set **Tweeter Delay** based on physical driver offset +3. Adjust **Phase** if needed for proper driver summing +4. Use **PEQ** bands for room correction or response smoothing +5. Set up **Loudness Compensation** for low-volume listening + +### Final Adjustments +1. Use **Air/Brilliance** shelf for overall treble character +2. Fine-tune gains by ear with music +3. **Export** your preset for backup + +--- + +## Troubleshooting + +### Sound is thin/lacks bass +- Check Subsonic HPF isn't set too high +- Verify Baffle Step Compensation settings +- Check woofer gain and phase settings + +### Harsh or fatiguing treble +- Reduce Air/Brilliance shelf +- Check for and apply Breakup Notch +- Reduce tweeter gain + +### Poor imaging or "hollow" sound at crossover +- Adjust Tweeter Delay for time alignment +- Try inverting phase on one driver +- Verify crossover frequency is appropriate + +### Loudness compensation too aggressive +- Reduce bass/treble boost values in each zone +- Adjust thresholds for smoother transitions + +--- + +## Technical Specifications + +| Parameter | Specification | +|-----------|---------------| +| Filter Type | IIR Biquad (Direct Form I) | +| Coefficient Format | 32-bit floating point (converted to Q5.27) | +| Biquads per Channel | 15 | +| Crossover Slopes | 12/24/48 dB/octave | +| PEQ Bands | 6 per output | +| Gain Resolution | 0.5 dB | +| Frequency Range | 20 Hz - 20 kHz | +| Q Range | 0.5 - 10.0 | From 4bcce57eb3bc010a598d3d672843aec3b1cf8820 Mon Sep 17 00:00:00 2001 From: craigmillard86 Date: Sat, 17 Jan 2026 13:23:41 +0000 Subject: [PATCH 47/58] Improve mobile responsive UI and fix script loading race condition Mobile UI improvements: - Add responsive navigation that stacks vertically on mobile - Add responsive styles for EQ settings (PEQ, radio buttons, presets) - Enhance shared styles.css with mobile breakpoints - Improve touch targets and prevent iOS zoom on input focus Bug fix: - Add defer attribute to all script tags to prevent "settingsUI is not defined" race condition on fast page loads --- .../ui_http_server/html/dac-settings.html | 2 +- .../ui_http_server/html/dsp-settings.html | 2 +- .../ui_http_server/html/eq-settings.html | 121 +++++++++++++++++- .../ui_http_server/html/general-settings.html | 2 +- components/ui_http_server/html/index.html | 59 ++++++++- components/ui_http_server/html/styles.css | 57 ++++++++- 6 files changed, 236 insertions(+), 7 deletions(-) diff --git a/components/ui_http_server/html/dac-settings.html b/components/ui_http_server/html/dac-settings.html index 8618c8dc..a71673f0 100644 --- a/components/ui_http_server/html/dac-settings.html +++ b/components/ui_http_server/html/dac-settings.html @@ -5,7 +5,7 @@ ESP32 Snapclient DAC Control - + diff --git a/components/ui_http_server/html/general-settings.html b/components/ui_http_server/html/general-settings.html index ad72ae70..7f9f4bea 100644 --- a/components/ui_http_server/html/general-settings.html +++ b/components/ui_http_server/html/general-settings.html @@ -5,7 +5,7 @@ General Settings - + diff --git a/components/ui_http_server/html/styles.css b/components/ui_http_server/html/styles.css index 0f32552e..95cb78f3 100644 --- a/components/ui_http_server/html/styles.css +++ b/components/ui_http_server/html/styles.css @@ -121,10 +121,65 @@ textarea:focus { @media (max-width: 768px) { body { padding: 10px; + margin: 10px auto; } - + .btn { padding: 8px 16px; font-size: 13px; } + + h1 { + font-size: 22px; + } + + h2 { + font-size: 18px; + } + + /* Make button groups stack on mobile */ + .button-group { + flex-direction: column; + } + + .button-group .btn { + width: 100%; + } + + /* Better touch targets */ + input[type="text"], + input[type="number"], + select { + font-size: 16px; /* Prevents iOS zoom on focus */ + padding: 12px; + } +} + +@media (max-width: 480px) { + body { + padding: 8px; + margin: 5px; + } + + h1 { + font-size: 18px; + } + + h2 { + font-size: 16px; + } + + .btn { + padding: 10px 12px; + font-size: 14px; + } + + .loading, + .error, + .success, + .warning, + .info { + padding: 10px; + font-size: 14px; + } } \ No newline at end of file From d9b6d5e9ae77103fca012d8607077ef97329c47a Mon Sep 17 00:00:00 2001 From: craigmillard86 Date: Sat, 17 Jan 2026 18:54:20 +0000 Subject: [PATCH 48/58] fix: Guard tas5805m_loudness_apply with CONFIG_DAC_TAS5805M_EQ_SUPPORT The function uses tas5805m_write_biquad_coefficients which is only available when EQ support is enabled. Wrap the implementation in a preprocessor conditional to avoid implicit declaration errors when building without EQ support. --- components/tas5805m_settings/tas5805m_settings.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/components/tas5805m_settings/tas5805m_settings.c b/components/tas5805m_settings/tas5805m_settings.c index 222d2431..f455c9bd 100644 --- a/components/tas5805m_settings/tas5805m_settings.c +++ b/components/tas5805m_settings/tas5805m_settings.c @@ -1117,6 +1117,7 @@ int tas5805m_loudness_get_zone(int volume) { /** Apply loudness compensation based on current volume */ esp_err_t tas5805m_loudness_apply(int volume) { +#if CONFIG_DAC_TAS5805M_EQ_SUPPORT /* Get current sample rate from bi-amp settings or use default */ float fs = 48000.0f; /* Default sample rate */ tas5805m_biamp_settings_t biamp; @@ -1192,6 +1193,12 @@ esp_err_t tas5805m_loudness_apply(int volume) { } return ESP_OK; +#else + /* EQ support not enabled - loudness compensation unavailable */ + (void)volume; + ESP_LOGD(TAG, "%s: EQ support disabled, loudness compensation not available", __func__); + return ESP_OK; +#endif /* CONFIG_DAC_TAS5805M_EQ_SUPPORT */ } /** Load EQ mode from NVS */ From 684157fe755a16b067ef74b581bccdf0e50db469 Mon Sep 17 00:00:00 2001 From: craigmillard86 Date: Sat, 17 Jan 2026 19:30:17 +0000 Subject: [PATCH 49/58] fix: Improve mobile UI loading reliability for DAC/EQ pages - Remove defer from script tags to ensure scripts load before DOMContentLoaded - Add automatic retry with 500ms delay for transient failures - Add 100ms delay between EQ schema/settings requests to reduce ESP32 memory pressure - Show actual error messages and add Retry button for user recovery - Add check for getRequest function availability on DAC page --- .../ui_http_server/html/dac-settings.html | 29 +++++++++++++----- .../ui_http_server/html/dsp-settings.html | 2 +- .../ui_http_server/html/eq-settings.html | 30 +++++++++++++------ .../ui_http_server/html/general-settings.html | 2 +- components/ui_http_server/html/index.html | 2 +- 5 files changed, 45 insertions(+), 20 deletions(-) diff --git a/components/ui_http_server/html/dac-settings.html b/components/ui_http_server/html/dac-settings.html index a71673f0..0c603a6f 100644 --- a/components/ui_http_server/html/dac-settings.html +++ b/components/ui_http_server/html/dac-settings.html @@ -5,7 +5,7 @@ ESP32 Snapclient DAC Control - +