mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
i2s_std: fixed mclk check for 24-bit data and enable left alignment as default
This commit is contained in:
parent
f00c78b020
commit
f0c13fc7a8
@ -62,7 +62,9 @@ static esp_err_t i2s_std_set_clock(i2s_chan_handle_t handle, const i2s_std_clk_c
|
|||||||
{
|
{
|
||||||
esp_err_t ret = ESP_OK;
|
esp_err_t ret = ESP_OK;
|
||||||
i2s_std_config_t *std_cfg = (i2s_std_config_t *)(handle->mode_info);
|
i2s_std_config_t *std_cfg = (i2s_std_config_t *)(handle->mode_info);
|
||||||
ESP_RETURN_ON_FALSE(std_cfg->slot_cfg.data_bit_width != I2S_DATA_BIT_WIDTH_24BIT ||
|
i2s_data_bit_width_t real_slot_bit = (int)std_cfg->slot_cfg.slot_bit_width < (int)std_cfg->slot_cfg.data_bit_width ?
|
||||||
|
std_cfg->slot_cfg.data_bit_width : std_cfg->slot_cfg.slot_bit_width;
|
||||||
|
ESP_RETURN_ON_FALSE(real_slot_bit != I2S_DATA_BIT_WIDTH_24BIT ||
|
||||||
(clk_cfg->mclk_multiple % 3 == 0), ESP_ERR_INVALID_ARG, TAG,
|
(clk_cfg->mclk_multiple % 3 == 0), ESP_ERR_INVALID_ARG, TAG,
|
||||||
"The 'mclk_multiple' should be the multiple of 3 while using 24-bit data width");
|
"The 'mclk_multiple' should be the multiple of 3 while using 24-bit data width");
|
||||||
|
|
||||||
|
@ -145,7 +145,7 @@ extern "C" {
|
|||||||
.ws_width = bits_per_sample, \
|
.ws_width = bits_per_sample, \
|
||||||
.ws_pol = false, \
|
.ws_pol = false, \
|
||||||
.bit_shift = true, \
|
.bit_shift = true, \
|
||||||
.left_align = false, \
|
.left_align = true, \
|
||||||
.big_endian = false, \
|
.big_endian = false, \
|
||||||
.bit_order_lsb = false \
|
.bit_order_lsb = false \
|
||||||
}
|
}
|
||||||
@ -164,7 +164,7 @@ extern "C" {
|
|||||||
.ws_width = 1, \
|
.ws_width = 1, \
|
||||||
.ws_pol = true, \
|
.ws_pol = true, \
|
||||||
.bit_shift = true, \
|
.bit_shift = true, \
|
||||||
.left_align = false, \
|
.left_align = true, \
|
||||||
.big_endian = false, \
|
.big_endian = false, \
|
||||||
.bit_order_lsb = false \
|
.bit_order_lsb = false \
|
||||||
}
|
}
|
||||||
@ -182,7 +182,7 @@ extern "C" {
|
|||||||
.ws_width = bits_per_sample, \
|
.ws_width = bits_per_sample, \
|
||||||
.ws_pol = false, \
|
.ws_pol = false, \
|
||||||
.bit_shift = false, \
|
.bit_shift = false, \
|
||||||
.left_align = false, \
|
.left_align = true, \
|
||||||
.big_endian = false, \
|
.big_endian = false, \
|
||||||
.bit_order_lsb = false \
|
.bit_order_lsb = false \
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user