So I'm essentially looking to create adc_continuous_pause/resume() functions .. something like:
- esp_err_t adc_continuous_pause(adc_continuous_handle_t handle) {
- // Stop ADC hardware without deinitializing
- adc_hal_digi_stop(&handle->hal);
- // Disable ADC end of conversion interrupt
- adc_hal_digi_dis_intr(&handle->hal, ADC_HAL_DMA_INTR_MASK);
- return ESP_OK;
- }
And then:
- esp_err_t adc_continuous_resume(adc_continuous_handle_t handle) {
- if (handle == NULL || handle->fsm != ADC_FSM_PAUSED) { // Assuming FSM_PAUSED state is added
- return ESP_ERR_INVALID_STATE;
- }
- // Re-enable ADC end of conversion interrupt
- adc_hal_digi_en_intr(&handle->hal, ADC_HAL_DMA_INTR_MASK);
- // Start ADC hardware without reinitializing
- adc_hal_digi_start(&handle->hal);
- return ESP_OK;
- }
thanks!