components/driver/i2s.c
/**
 * @brief   I2S disable ADC
 *
 * @param   i2s_num         I2S device number
 * @return
 *      - ESP_OK        I2S ADC mode successfully disabled
 *      - ESP_ERR_INVALID_ARG   Invalid argument
 *      - ESP_ERR_INVALID_STATE Current I2S mode is not built-in ADC
 */
@brief   I2S disable ADC
@param   i2s_num         I2S device number
@return
- ESP_OK        I2S ADC mode successfully disabled
- ESP_ERR_INVALID_ARG   Invalid argument
- ESP_ERR_INVALID_STATE Current I2S mode is not built-in ADC
@brief I2S disable ADC @param i2s_num I2S device number @return - ESP_OK I2S ADC mode successfully disabled - ESP_ERR_INVALID_ARG Invalid argument - ESP_ERR_INVALID_STATE Current I2S mode is not built - in ADC
esp_err_t i2s_adc_disable(i2s_port_t i2s_num)
{
    ESP_RETURN_ON_FALSE((i2s_num < I2S_NUM_MAX), ESP_ERR_INVALID_ARG, TAG, "i2s_num error");
    ESP_RETURN_ON_FALSE((p_i2s[i2s_num] != NULL), ESP_ERR_INVALID_STATE, TAG, "Not initialized yet");
    ESP_RETURN_ON_FALSE((p_i2s[i2s_num]->hal_cfg.mode & I2S_MODE_ADC_BUILT_IN), ESP_ERR_INVALID_STATE, TAG, "i2s built-in adc not enabled");
    i2s_hal_stop_rx(&(p_i2s[i2s_num]->hal));
    adc1_lock_release();
    return ESP_OK;
}
esp_err_t i2s_adc_disable ( i2s_port_t i2s_num ) { ESP_RETURN_ON_FALSE ( ( i2s_num < I2S_NUM_MAX ) , ESP_ERR_INVALID_ARG , TAG , " " ) ; ESP_RETURN_ON_FALSE ( ( p_i2s [ i2s_num ] != NULL ) , ESP_ERR_INVALID_STATE , TAG , " " ) ; ESP_RETURN_ON_FALSE ( ( p_i2s [ i2s_num ] -> hal_cfg . mode & I2S_MODE_ADC_BUILT_IN ) , ESP_ERR_INVALID_STATE , TAG , " " ) ; i2s_hal_stop_rx ( & ( p_i2s [ i2s_num ] -> hal ) ) ; adc1_lock_release ( ) ; return ESP_OK ; }
@brief   I2S disable ADC
 @param   i2s_num         I2S device number
 @return
      - ESP_OK        I2S ADC mode successfully disabled
      - ESP_ERR_INVALID_ARG   Invalid argument
      - ESP_ERR_INVALID_STATE Current I2S mode is not built-in ADC
@brief I2S disable ADC @param i2s_num I2S device number @return - ESP_OK I2S ADC mode successfully disabled - ESP_ERR_INVALID_ARG Invalid argument - ESP_ERR_INVALID_STATE Current I2S mode is not built - in ADC