215 ADC_IER(adc) &= ~ADC_IER_AWD1IE;
263 ADC_IER(adc) &= ~ADC_IER_EOSEQIE;
335 bool stepup =
false, stepdn =
false;
342 reg32 |= (1 << channel[0]);
344 for (i = 1; i < length; i++) {
345 reg32 |= (1 << channel[i]);
346 stepup |= channel[i-1] < channel[i];
347 stepdn |= channel[i-1] > channel[i];
351 if (stepup && stepdn) {
#define ADC_CFGR1_EXTSEL_MASK
#define ADC_CFGR1_EXTSEL_SHIFT
void adc_set_sample_time_on_all_channels(uint32_t adc, uint8_t time)
ADC Set the Sample Time for All Channels.
void adc_disable_vbat_sensor(void)
ADC Disable The VBat Sensor.
void adc_calibrate_wait_finish(uint32_t adc)
ADC Wait to finish the ADC calibration procedure.
void adc_calibrate_start(uint32_t adc)
ADC Start the calibration procedure.
void adc_enable_vbat_sensor(void)
ADC Enable The VBat Sensor.
void adc_set_regular_sequence(uint32_t adc, uint8_t length, uint8_t channel[])
ADC Set a Regular Channel Conversion Sequence.
void adc_set_clk_source(uint32_t adc, uint32_t source)
ADC Set Clock Source.
void adc_clear_watchdog_flag(uint32_t adc)
ADC Clear Analog Watchdog Flag.
void adc_disable_eoc_sequence_interrupt(uint32_t adc)
ADC Disable Regular End-Of-Conversion Sequence Interrupt.
void adc_disable_watchdog_interrupt(uint32_t adc)
ADC Disable Regular End-Of-Conversion Interrupt.
void adc_clear_eoc_sequence_flag(uint32_t adc)
ADC Clear Regular End-Of-Conversion Sequence Flag.
void adc_enable_watchdog_interrupt(uint32_t adc)
ADC Enable Analog Watchdog Interrupt.
bool adc_get_eoc_sequence_flag(uint32_t adc)
ADC Read the Regular End-Of-Conversion Sequence Flag.
bool adc_get_watchdog_flag(uint32_t adc)
ADC Read the Analog Watchdog Flag.
void adc_enable_eoc_sequence_interrupt(uint32_t adc)
ADC Enable Regular End-Of-Conversion Sequence Interrupt.
void adc_set_operation_mode(uint32_t adc, enum adc_opmode opmode)
ADC Set operation mode.
void adc_disable_discontinuous_mode(uint32_t adc)
ADC Disable Discontinuous Mode for Regular Conversions.
void adc_enable_discontinuous_mode(uint32_t adc)
ADC Enable Discontinuous Mode for Regular Conversions.
void adc_enable_external_trigger_regular(uint32_t adc, uint32_t trigger, uint32_t polarity)
ADC Enable an External Trigger for Regular Channels.
void adc_disable_external_trigger_regular(uint32_t adc)
ADC Disable an External Trigger for Regular Channels.
void adc_set_watchdog_high_threshold(uint32_t adc, uint16_t threshold)
ADC Set Analog Watchdog Upper Threshold.
void adc_enable_analog_watchdog_on_all_channels(uint32_t adc)
ADC Enable Analog Watchdog for All Channels.
void adc_enable_analog_watchdog_on_selected_channel(uint32_t adc, uint8_t chan)
ADC Enable Analog Watchdog for a Selected Channel.
void adc_disable_analog_watchdog(uint32_t adc)
ADC Disable Analog Watchdog.
void adc_set_watchdog_low_threshold(uint32_t adc, uint16_t threshold)
ADC Set Analog Watchdog Lower Threshold.
#define ADC_CCR_VBATEN
VBATEN: Enable VBAT Channel.
#define ADC_CFGR1_SCANDIR
SCANDIR: Scan Sequence Direction: Upwards Scan (0), Downwards(1)
#define ADC_CFGR1_AWD1CH_VAL(x)
AWD1CH: Analog watchdog 1 channel selection.
#define ADC_CFGR1_CONT
CONT: Single / continuous conversion mode for regular conversions.
#define ADC_CFGR1_AWD1SGL
AWD1SGL: Enable the watchdog 1 on a single channel or on all channels.
#define ADC_CFGR1_EXTEN_MASK
#define ADC_CFGR1_AWD1EN
AWD1EN: Analog watchdog 1 enable on regular channels.
#define ADC_CFGR1_DISCEN
DISCEN: Discontinuous mode for regular channels.
#define ADC_CR_ADCAL
ADCAL: ADC calibration.
#define ADC_IER_AWD1IE
AWD1IE: Analog watchdog 1 interrupt enable.
#define ADC_ISR_AWD1
AWD1: Analog watchdog 1 flag.
#define ADC_CR(adc)
Control Register.
#define ADC_ISR(adc)
ADC interrupt and status register.
#define ADC_CCR(adc)
Common Configuration register.
#define ADC_CHSELR(adc)
Channel Select Register.
#define ADC_IER(adc)
Interrupt Enable Register.
#define ADC_CFGR2(adc)
Configuration Register 2.
#define ADC_CFGR1(adc)
Configuration Register 1.
#define ADC_TR1(adc)
Watchdog Threshold Register 1.
#define ADC_TR1_HT_VAL(x)
TR1_HT: analog watchdog 1 threshold high.
#define ADC_TR1_LT_VAL(x)
TR1_LT: analog watchdog 1 threshold low.
#define cm3_assert_not_reached()
Check if unreachable code is reached.