mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-22 01:02:57 +00:00
i2s: update documents for driver-NG
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
#include "soc/i2s_periph.h"
|
||||
#include "soc/i2s_struct.h"
|
||||
#include "hal/i2s_types.h"
|
||||
#include "hal/i2s_types_priv.h"
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -200,7 +200,7 @@ static inline void i2s_ll_tx_clk_set_src(i2s_dev_t *hw, i2s_clock_src_t src)
|
||||
* @brief Set RX source clock
|
||||
*
|
||||
* @param hw Peripheral I2S hardware instance address.
|
||||
* @param src I2S source clock, ESP32-C3 only support `I2S_CLK_PLL_160M`
|
||||
* @param src I2S source clock, ESP32-C3 only support `I2S_CLK_SRC_PLL_160M`
|
||||
*/
|
||||
static inline void i2s_ll_rx_clk_set_src(i2s_dev_t *hw, i2s_clock_src_t src)
|
||||
{
|
||||
@@ -555,21 +555,21 @@ static inline void i2s_ll_rx_set_active_chan_mask(i2s_dev_t *hw, uint32_t chan_m
|
||||
* @brief Set I2S tx chan mode
|
||||
*
|
||||
* @param hw Peripheral I2S hardware instance address.
|
||||
* @param slot_sel select slot to send data
|
||||
* @param slot_mask select slot to send data
|
||||
*/
|
||||
static inline void i2s_ll_tx_select_slot(i2s_dev_t *hw, i2s_std_slot_sel_t slot_sel)
|
||||
static inline void i2s_ll_tx_select_slot(i2s_dev_t *hw, i2s_std_slot_mask_t slot_mask)
|
||||
{
|
||||
/* In mono mode, there only should be one slot enabled, another inactive slot will transmit same data as enabled slot
|
||||
* Otherwise always enable the first two slots */
|
||||
hw->tx_tdm_ctrl.tx_tdm_tot_chan_num = 1; // tx_tdm_tot_chan_num = 2 slots - 1 = 1
|
||||
hw->tx_tdm_ctrl.val &= ~I2S_LL_TDM_CH_MASK;
|
||||
switch (slot_sel)
|
||||
switch (slot_mask)
|
||||
{
|
||||
case I2S_STD_SLOT_ONLY_LEFT:
|
||||
hw->tx_tdm_ctrl.val |= 0x02;
|
||||
hw->tx_tdm_ctrl.val |= 0x01;
|
||||
break;
|
||||
case I2S_STD_SLOT_ONLY_RIGHT:
|
||||
hw->tx_tdm_ctrl.val |= 0x01;
|
||||
hw->tx_tdm_ctrl.val |= 0x02;
|
||||
break;
|
||||
case I2S_STD_SLOT_LEFT_RIGHT:
|
||||
hw->tx_tdm_ctrl.val |= 0x03;
|
||||
@@ -583,21 +583,21 @@ static inline void i2s_ll_tx_select_slot(i2s_dev_t *hw, i2s_std_slot_sel_t slot_
|
||||
* @brief Set I2S rx chan mode
|
||||
*
|
||||
* @param hw Peripheral I2S hardware instance address.
|
||||
* @param slot_sel select slot to receive data
|
||||
* @param slot_mask select slot to receive data
|
||||
*/
|
||||
static inline void i2s_ll_rx_select_slot(i2s_dev_t *hw, i2s_std_slot_sel_t slot_sel)
|
||||
static inline void i2s_ll_rx_select_slot(i2s_dev_t *hw, i2s_std_slot_mask_t slot_mask)
|
||||
{
|
||||
/* In mono mode, there only should be one slot enabled, another inactive slot will transmit same data as enabled slot
|
||||
* Otherwise always enable the first two slots */
|
||||
hw->rx_tdm_ctrl.rx_tdm_tot_chan_num = 1; // rx_tdm_tot_chan_num = 2 slots - 1 = 1
|
||||
hw->rx_tdm_ctrl.val &= ~I2S_LL_TDM_CH_MASK;
|
||||
switch (slot_sel)
|
||||
switch (slot_mask)
|
||||
{
|
||||
case I2S_STD_SLOT_ONLY_LEFT:
|
||||
hw->rx_tdm_ctrl.val |= 0x02;
|
||||
hw->rx_tdm_ctrl.val |= 0x01;
|
||||
break;
|
||||
case I2S_STD_SLOT_ONLY_RIGHT:
|
||||
hw->rx_tdm_ctrl.val |= 0x01;
|
||||
hw->rx_tdm_ctrl.val |= 0x02;
|
||||
break;
|
||||
case I2S_STD_SLOT_LEFT_RIGHT:
|
||||
hw->rx_tdm_ctrl.val |= 0x03;
|
||||
|
Reference in New Issue
Block a user