You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/* Check if the configuration is correct. Use float for check in case the mclk division might be carried up in the fine division calculation */
63
-
ESP_RETURN_ON_FALSE(clk_info->sclk / (float)clk_info->mclk>min_mclk_div, ESP_ERR_INVALID_ARG, TAG, "sample rate or mclk_multiple is too large for the current clock source");
67
+
ESP_RETURN_ON_FALSE((float)clk_info->sclk>clk_info->mclk*min_mclk_div, ESP_ERR_INVALID_ARG, TAG, "sample rate is too large");
68
+
ESP_RETURN_ON_FALSE(clk_info->mclk_div<I2S_LL_CLK_FRAC_DIV_N_MAX, ESP_ERR_INVALID_ARG, TAG, "sample rate is too small");
/* Check if the configuration is correct. Use float for check in case the mclk division might be carried up in the fine division calculation */
69
-
ESP_RETURN_ON_FALSE(clk_info->sclk / (float)clk_info->mclk>min_mclk_div, ESP_ERR_INVALID_ARG, TAG, "sample rate or mclk_multiple is too large for the current clock source");
69
+
ESP_RETURN_ON_FALSE((float)clk_info->sclk>clk_info->mclk*min_mclk_div, ESP_ERR_INVALID_ARG, TAG, "sample rate is too large");
70
+
ESP_RETURN_ON_FALSE(clk_info->mclk_div<I2S_LL_CLK_FRAC_DIV_N_MAX, ESP_ERR_INVALID_ARG, TAG, "sample rate is too small");
Copy file name to clipboardExpand all lines: components/esp_driver_i2s/include/driver/i2s_std.h
+3Lines changed: 3 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -204,6 +204,7 @@ extern "C" {
204
204
.sample_rate_hz = rate, \
205
205
.clk_src = I2S_CLK_SRC_DEFAULT, \
206
206
.mclk_multiple = I2S_MCLK_MULTIPLE_256, \
207
+
.bclk_div = 8, \
207
208
}
208
209
#else
209
210
/**
@@ -217,6 +218,7 @@ extern "C" {
217
218
.clk_src = I2S_CLK_SRC_DEFAULT, \
218
219
.ext_clk_freq_hz = 0, \
219
220
.mclk_multiple = I2S_MCLK_MULTIPLE_256, \
221
+
.bclk_div = 8, \
220
222
}
221
223
#endif
222
224
@@ -265,6 +267,7 @@ typedef struct {
265
267
* but please set this field a multiple of `3` (like 384) when using 24-bit data width,
266
268
* otherwise the sample rate might be inaccurate
267
269
*/
270
+
uint32_tbclk_div; /*!< The division from MCLK to BCLK, only take effect for slave role, it shouldn't be smaller than 8. Increase this field when data sent by slave lag behind */
0 commit comments