i2s: add support apll clock

using apll_param to setup APLL

new apll calculation method, much faster

validate freq calculation

Ensure that the i2s frequency is greater than the hardware limit

Add description of how to calculate apll clock, support apll for other 16-bits audio, check rev0 chip

correct space
This commit is contained in:
Tuan PM
2017-08-16 16:31:11 +08:00
parent de750e9921
commit 9d39881981
4 changed files with 183 additions and 15 deletions

View File

@@ -122,6 +122,8 @@ typedef enum {
I2S_MODE_PDM = 64,
} i2s_mode_t;
/**
* @brief I2S configuration parameters for i2s_param_config function
*
@@ -135,6 +137,7 @@ typedef struct {
int intr_alloc_flags; /*!< Flags used to allocate the interrupt. One or multiple (ORred) ESP_INTR_FLAG_* values. See esp_intr_alloc.h for more info */
int dma_buf_count; /*!< I2S DMA Buffer Count */
int dma_buf_len; /*!< I2S DMA Buffer Length */
int use_apll; /*!< I2S using APLL as main I2S clock, enable it to get accurate clock */
} i2s_config_t;
/**