libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
|
ADC analog watchdog API definitions. More...
Functions | |
void | adc_enable_analog_watchdog_on_all_channels (uint32_t adc) |
ADC Enable Analog Watchdog for All Channels. More... | |
void | adc_enable_analog_watchdog_on_selected_channel (uint32_t adc, uint8_t chan) |
ADC Enable Analog Watchdog for a Selected Channel. More... | |
void | adc_disable_analog_watchdog (uint32_t adc) |
ADC Disable Analog Watchdog. More... | |
void | adc_set_watchdog_high_threshold (uint32_t adc, uint16_t threshold) |
ADC Set Analog Watchdog Upper Threshold. More... | |
void | adc_set_watchdog_low_threshold (uint32_t adc, uint16_t threshold) |
ADC Set Analog Watchdog Lower Threshold. More... | |
ADC analog watchdog API definitions.
The analog watchdog allows the monitoring of an analog signal between two threshold levels. The thresholds must be preset. Analog watchdog is disabled by default.
Example 1: Enable watchdog checking on all channels
Example 2: Enable watchdog checking on channel 5
void adc_disable_analog_watchdog | ( | uint32_t | adc | ) |
ADC Disable Analog Watchdog.
[in] | adc | Unsigned int32. ADC base address (ADC register base addresses) |
Definition at line 507 of file adc.c.
References ADC_CFGR1.
void adc_enable_analog_watchdog_on_all_channels | ( | uint32_t | adc | ) |
ADC Enable Analog Watchdog for All Channels.
[in] | adc | Unsigned int32. ADC base address (ADC register base addresses) |
Definition at line 481 of file adc.c.
References ADC_CFGR1, and ADC_CFGR1_AWD1EN.
void adc_enable_analog_watchdog_on_selected_channel | ( | uint32_t | adc, |
uint8_t | chan | ||
) |
ADC Enable Analog Watchdog for a Selected Channel.
[in] | adc | Unsigned int32. ADC base address (ADC register base addresses) |
[in] | chan | Unsigned int8. ADC channel number adc_api_channel |
Definition at line 494 of file adc.c.
References ADC_CFGR1, ADC_CFGR1_AWD1CH_VAL, ADC_CFGR1_AWD1EN, and ADC_CFGR1_AWD1SGL.
void adc_set_watchdog_high_threshold | ( | uint32_t | adc, |
uint16_t | threshold | ||
) |
ADC Set Analog Watchdog Upper Threshold.
[in] | adc | Unsigned int32. ADC base address (ADC register base addresses) |
[in] | threshold | Upper threshold value |
Definition at line 519 of file adc.c.
References ADC_TR1, and ADC_TR1_HT_VAL.
void adc_set_watchdog_low_threshold | ( | uint32_t | adc, |
uint16_t | threshold | ||
) |
ADC Set Analog Watchdog Lower Threshold.
[in] | adc | Unsigned int32. ADC base address (ADC register base addresses) |
[in] | threshold | Lower threshold value |
Definition at line 531 of file adc.c.
References ADC_TR1, and ADC_TR1_LT_VAL.