Skip to content

Commit a0b92ec

Browse files
committed
esp32s3: i2s: add PLL_D2 clock source
Add the option to add PLL_D2 clock source for tx/rx clk of the i2s periphery of the esp32s3. Signed-off-by: Armin Kessler <[email protected]>
1 parent 883b9e8 commit a0b92ec

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

components/hal/esp32s3/include/hal/i2s_ll.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,9 @@ static inline void i2s_ll_tx_clk_set_src(i2s_dev_t *hw, i2s_clock_src_t src)
208208
case I2S_CLK_SRC_XTAL:
209209
hw->tx_clkm_conf.tx_clk_sel = 0;
210210
break;
211+
case I2S_CLK_SRC_PLL_D2:
212+
hw->tx_clkm_conf.tx_clk_sel = 1;
213+
break;
211214
case I2S_CLK_SRC_PLL_160M:
212215
hw->tx_clkm_conf.tx_clk_sel = 2;
213216
break;
@@ -230,6 +233,9 @@ static inline void i2s_ll_rx_clk_set_src(i2s_dev_t *hw, i2s_clock_src_t src)
230233
case I2S_CLK_SRC_XTAL:
231234
hw->rx_clkm_conf.rx_clk_sel = 0;
232235
break;
236+
case I2S_CLK_SRC_PLL_D2:
237+
hw->rx_clkm_conf.rx_clk_sel = 1;
238+
break;
233239
case I2S_CLK_SRC_PLL_160M:
234240
hw->rx_clkm_conf.rx_clk_sel = 2;
235241
break;

components/soc/esp32s3/include/soc/clk_tree_defs.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,14 +291,15 @@ typedef enum {
291291
/**
292292
* @brief Array initializer for all supported clock sources of I2S
293293
*/
294-
#define SOC_I2S_CLKS {SOC_MOD_CLK_PLL_F160M, SOC_MOD_CLK_XTAL, I2S_CLK_SRC_EXTERNAL}
294+
#define SOC_I2S_CLKS {SOC_MOD_CLK_PLL_F160M, SOC_MOD_CLK_PLL_D2, SOC_MOD_CLK_XTAL, I2S_CLK_SRC_EXTERNAL}
295295

296296
/**
297297
* @brief I2S clock source enum
298298
*/
299299
typedef enum {
300300
I2S_CLK_SRC_DEFAULT = SOC_MOD_CLK_PLL_F160M, /*!< Select PLL_F160M as the default source clock */
301301
I2S_CLK_SRC_PLL_160M = SOC_MOD_CLK_PLL_F160M, /*!< Select PLL_F160M as the source clock */
302+
I2S_CLK_SRC_PLL_D2 = SOC_MOD_CLK_PLL_D2, /*!< Select PLL_D2 as the source clock */
302303
I2S_CLK_SRC_XTAL = SOC_MOD_CLK_XTAL, /*!< Select XTAL as the source clock */
303304
I2S_CLK_SRC_EXTERNAL = -1, /*!< Select external clock as source clock */
304305
} soc_periph_i2s_clk_src_t;

0 commit comments

Comments
 (0)