mirror of
https://github.com/espressif/esp-idf.git
synced 2025-09-03 15:04:39 +00:00
adc: update the monitor and filter in the HAL on C3
On C3 ADC has no enable bit for monitor and filter. However we can use context variables to implement one
This commit is contained in:

committed by
bot

parent
19fb11549b
commit
90fc3e7030
@@ -84,34 +84,53 @@ void adc_hal_digi_clk_config(const adc_digi_clk_t *clk);
|
||||
/**
|
||||
* Reset adc digital controller filter.
|
||||
*
|
||||
* @param adc_n ADC unit.
|
||||
* @param filter_idx ADC filter unit.
|
||||
*/
|
||||
#define adc_hal_digi_filter_reset(adc_n) adc_ll_digi_filter_reset(adc_n)
|
||||
#define adc_hal_digi_filter_reset(filter_idx) adc_ll_digi_filter_reset(filter_idx)
|
||||
|
||||
/**
|
||||
* Set adc digital controller filter factor.
|
||||
*
|
||||
* @param idx ADC filter unit.
|
||||
* @param filter_idx ADC filter unit.
|
||||
* @param filter Filter config. Expression: filter_data = (k-1)/k * last_data + new_data / k. Set values: (2, 4, 8, 16, 64).
|
||||
*/
|
||||
void adc_hal_digi_filter_set_factor(adc_digi_filter_idx_t idx, adc_digi_filter_t *filter);
|
||||
void adc_hal_digi_filter_set_factor(adc_digi_filter_idx_t filter_idx, adc_digi_filter_t *filter);
|
||||
|
||||
/**
|
||||
* Get adc digital controller filter factor.
|
||||
*
|
||||
* @param adc_n ADC unit.
|
||||
* @param filter_idx ADC filter unit.
|
||||
* @param factor Expression: filter_data = (k-1)/k * last_data + new_data / k. Set values: (2, 4, 8, 16, 64).
|
||||
*/
|
||||
void adc_hal_digi_filter_get_factor(adc_digi_filter_idx_t idx, adc_digi_filter_t *filter);
|
||||
void adc_hal_digi_filter_get_factor(adc_digi_filter_idx_t filter_idx, adc_digi_filter_t *filter);
|
||||
|
||||
/**
|
||||
* Enable/disable adc digital controller filter.
|
||||
* Filtering the ADC data to obtain smooth data at higher sampling rates.
|
||||
*
|
||||
* @note The filter will filter all the enabled channel data of the each ADC unit at the same time.
|
||||
* @param filter_idx ADC filter unit.
|
||||
* @param enable True to enable the filter, otherwise disable.
|
||||
*/
|
||||
void adc_hal_digi_filter_enable(adc_digi_filter_idx_t filter_idx, bool enable);
|
||||
|
||||
/**
|
||||
* Config monitor of adc digital controller.
|
||||
*
|
||||
* @note If the channel info is not supported, the monitor function will not be enabled.
|
||||
* @param idx ADC monitor index.
|
||||
* @param mon_idx ADC monitor index.
|
||||
* @param config Refer to `adc_digi_monitor_t`.
|
||||
*/
|
||||
void adc_hal_digi_monitor_config(adc_digi_monitor_idx_t idx, adc_digi_monitor_t *config);
|
||||
void adc_hal_digi_monitor_config(adc_digi_monitor_idx_t mon_idx, adc_digi_monitor_t *config);
|
||||
|
||||
/**
|
||||
* Enable/disable monitor of adc digital controller.
|
||||
*
|
||||
* @note The monitor will monitor all the enabled channel data of the each ADC unit at the same time.
|
||||
* @param mon_idx ADC monitor index.
|
||||
* @param enable True to enable the monitor, otherwise disable.
|
||||
*/
|
||||
void adc_hal_digi_monitor_enable(adc_digi_monitor_idx_t mon_idx, bool enable);
|
||||
|
||||
/**
|
||||
* Enable interrupt of adc digital controller by bitmask.
|
||||
|
@@ -338,7 +338,7 @@ static inline void adc_ll_digi_filter_get_factor(adc_digi_filter_idx_t idx, adc_
|
||||
/**
|
||||
* Disable adc digital controller filter.
|
||||
* Filtering the ADC data to obtain smooth data at higher sampling rates.
|
||||
*
|
||||
*
|
||||
* @note If the channel info is not supported, the filter function will not be enabled.
|
||||
* @param adc_n ADC unit.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user