i2s_pdm: fix tx frequency limitation

Closes: https://github.com/espressif/esp-idf/issues/10420
This commit is contained in:
laokaiyao
2022-12-22 15:28:28 +08:00
parent f95c2274b8
commit 943dcd2cd1
8 changed files with 66 additions and 11 deletions

View File

@@ -877,6 +877,17 @@ static inline void i2s_ll_tx_set_pdm_sd_dither2(i2s_dev_t *hw, uint32_t dither2)
hw->tx_pcm2pdm_conf.tx_pdm_sigmadelta_dither2 = dither2;
}
/**
* @brief Set the PDM TX over sampling ratio
*
* @param hw Peripheral I2S hardware instance address.
* @param ovr Over sampling ratio
*/
static inline void i2s_ll_tx_set_pdm_over_sample_ratio(i2s_dev_t *hw, uint32_t ovr)
{
hw->tx_pcm2pdm_conf.tx_pdm_sinc_osr2 = ovr;
}
/**
* @brief Configure I2S TX PDM sample rate
* Fpdm = 64*Fpcm*fp/fs
@@ -889,7 +900,6 @@ static inline void i2s_ll_tx_set_pdm_fpfs(i2s_dev_t *hw, uint32_t fp, uint32_t f
{
hw->tx_pcm2pdm_conf1.tx_pdm_fp = fp;
hw->tx_pcm2pdm_conf1.tx_pdm_fs = fs;
hw->tx_pcm2pdm_conf.tx_pdm_sinc_osr2 = fp / fs;
}
/**