Skip to content

Commit 48a1274

Browse files
epc-akesylvioalves
authored andcommitted
esp32c6: i2s: add PLL_F240M clock source
Add the option to add PLL_F240M clock source for tx/rx clk of the i2s periphery of the esp32c6. Signed-off-by: Armin Kessler [email protected]
1 parent 8431a4e commit 48a1274

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

components/hal/esp32c6/include/hal/i2s_ll.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,9 @@ static inline void i2s_ll_tx_clk_set_src(i2s_dev_t *hw, i2s_clock_src_t src)
217217
case I2S_CLK_SRC_XTAL:
218218
PCR.i2s_tx_clkm_conf.i2s_tx_clkm_sel = 0;
219219
break;
220+
case I2S_CLK_SRC_PLL_240M:
221+
PCR.i2s_tx_clkm_conf.i2s_tx_clkm_sel = 1;
222+
break;
220223
case I2S_CLK_SRC_PLL_160M:
221224
PCR.i2s_tx_clkm_conf.i2s_tx_clkm_sel = 2;
222225
break;
@@ -240,6 +243,9 @@ static inline void i2s_ll_rx_clk_set_src(i2s_dev_t *hw, i2s_clock_src_t src)
240243
case I2S_CLK_SRC_XTAL:
241244
PCR.i2s_rx_clkm_conf.i2s_rx_clkm_sel = 0;
242245
break;
246+
case I2S_CLK_SRC_PLL_240M:
247+
PCR.i2s_rx_clkm_conf.i2s_rx_clkm_sel = 1;
248+
break;
243249
case I2S_CLK_SRC_PLL_160M:
244250
PCR.i2s_rx_clkm_conf.i2s_rx_clkm_sel = 2;
245251
break;

components/soc/esp32c6/include/soc/clk_tree_defs.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,13 +285,14 @@ typedef enum {
285285
/**
286286
* @brief Array initializer for all supported clock sources of I2S
287287
*/
288-
#define SOC_I2S_CLKS {SOC_MOD_CLK_PLL_F160M, SOC_MOD_CLK_XTAL, I2S_CLK_SRC_EXTERNAL}
288+
#define SOC_I2S_CLKS {SOC_MOD_CLK_PLL_F240M, SOC_MOD_CLK_PLL_F160M, SOC_MOD_CLK_XTAL, I2S_CLK_SRC_EXTERNAL}
289289

290290
/**
291291
* @brief I2S clock source enum
292292
*/
293293
typedef enum {
294294
I2S_CLK_SRC_DEFAULT = SOC_MOD_CLK_PLL_F160M, /*!< Select PLL_F160M as the default source clock */
295+
I2S_CLK_SRC_PLL_F240M = SOC_MOD_CLK_PLL_F240M, /*!< Select PLL_F240M as the source clock */
295296
I2S_CLK_SRC_PLL_160M = SOC_MOD_CLK_PLL_F160M, /*!< Select PLL_F160M as the source clock */
296297
I2S_CLK_SRC_XTAL = SOC_MOD_CLK_XTAL, /*!< Select XTAL as the source clock */
297298
I2S_CLK_SRC_EXTERNAL = -1, /*!< Select external clock as source clock */

0 commit comments

Comments
 (0)