feat(lp_i2s): lp_i2s driver
This commit is contained in:
@@ -101,7 +101,7 @@ extern portMUX_TYPE rtc_spinlock; //TODO: Will be placed in the appropriate posi
|
||||
#define adc_dma_disable_intr(adc_dma) i2s_ll_enable_intr(s_adc_digi_ctx->adc_i2s_dev, ADC_DMA_INTR_MASK, false);
|
||||
#define adc_dma_deinit(adc_dma) do { \
|
||||
esp_intr_free(s_adc_digi_ctx->intr_hdl); \
|
||||
i2s_platform_release_occupation(ADC_DMA_I2S_HOST); \
|
||||
i2s_platform_release_occupation(I2S_CTLR_HP, ADC_DMA_I2S_HOST); \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
@@ -328,7 +328,7 @@ esp_err_t adc_digi_initialize(const adc_digi_init_config_t *init_config)
|
||||
s_adc_digi_ctx->adc_spi_dev = SPI_LL_GET_HW(ADC_DMA_SPI_HOST);
|
||||
#elif CONFIG_IDF_TARGET_ESP32
|
||||
//ADC utilises I2S0 DMA on ESP32
|
||||
ret = i2s_platform_acquire_occupation(ADC_DMA_I2S_HOST, "adc");
|
||||
ret = i2s_platform_acquire_occupation(I2S_CTLR_HP, ADC_DMA_I2S_HOST, "adc");
|
||||
if (ret != ESP_OK) {
|
||||
ret = ESP_ERR_NOT_FOUND;
|
||||
goto cleanup;
|
||||
|
||||
@@ -1637,7 +1637,7 @@ esp_err_t i2s_driver_uninstall(i2s_port_t i2s_num)
|
||||
}
|
||||
#endif
|
||||
/* Disable module clock */
|
||||
i2s_platform_release_occupation(i2s_num);
|
||||
i2s_platform_release_occupation(I2S_CTLR_HP, i2s_num);
|
||||
free(obj);
|
||||
p_i2s[i2s_num] = NULL;
|
||||
return ESP_OK;
|
||||
@@ -1656,7 +1656,7 @@ esp_err_t i2s_driver_install(i2s_port_t i2s_num, const i2s_config_t *i2s_config,
|
||||
/* Step 2: Allocate driver object and register to platform */
|
||||
i2s_obj_t *i2s_obj = calloc(1, sizeof(i2s_obj_t));
|
||||
ESP_RETURN_ON_FALSE(i2s_obj, ESP_ERR_NO_MEM, TAG, "no mem for I2S driver");
|
||||
if (i2s_platform_acquire_occupation(i2s_num, "i2s_legacy") != ESP_OK) {
|
||||
if (i2s_platform_acquire_occupation(I2S_CTLR_HP, i2s_num, "i2s_legacy") != ESP_OK) {
|
||||
free(i2s_obj);
|
||||
ESP_LOGE(TAG, "register I2S object to platform failed");
|
||||
return ESP_ERR_INVALID_STATE;
|
||||
|
||||
Reference in New Issue
Block a user