130 bool stepup =
false, stepdn =
false;
141 reg32 |= (1 << channel[0]);
143 for (uint8_t i = 1; i < length; i++) {
145 stepup |= channel[i-1] < channel[i];
146 stepdn |= channel[i-1] > channel[i];
150 if (stepup && stepdn) {
203 ADC_CR(adc) &= ~ADC_CR_ADVREGEN;
#define ADC_CCR_PRESC_SHIFT
#define ADC_CCR_PRESC_MASK
#define ADC_CFGR1_SCANDIR
SCANDIR: Scan Sequence Direction: Upwards Scan (0), Downwards(1)
#define ADC_CFGR1_CHSELRMOD
CHSELRMOD: Mode Selection of the ADC_CHSELR register.
#define ADC_CFGR2_CKMODE_MASK
#define ADC_CFGR2_CKMODE_SHIFT
#define ADC_CHSELR_MAX_CHANNELS
ADC_CHSELR_MAX_CHANNELS Maximum number of channel in regular sequence.
#define ADC_CHSELR_CHSEL(x)
#define ADC_CR_ADVREGEN
ADVREGEN: Voltage regulator enable bit.
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_regulator(uint32_t adc)
Disable the ADC Voltage regulator.
void adc_set_clk_prescale(uint32_t adc, uint32_t prescale)
ADC Set Clock Prescale.
void adc_set_selection_sample_time(uint32_t adc, uint8_t selection, uint8_t time)
ADC Set the Sample Time for Given Selection.
void adc_enable_regulator(uint32_t adc)
Enable the ADC Voltage regulator.
void adc_set_channel_sample_time_selection(uint32_t adc, uint8_t channel, uint8_t selection)
ADC Set the Sample Time Selection for a Single Channel.
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.
#define ADC_ISR_CCRDY
CCRDY: Channel Configuration Ready flag.
#define ADC_CR(adc)
Control Register.
#define ADC_SMPR1(adc)
Sample Time Register 1.
#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_CFGR2(adc)
Configuration Register 2.
#define ADC_CFGR1(adc)
Configuration Register 1.
#define ADC_SMPR_SMPSEL_SMP1
#define ADC_SMPR_SMPSEL_SMP2
#define ADC_SMPR_SMPSEL_CHANNEL_SHIFT(channel)
#define ADC_SMPR_SMPSEL_MASK
#define ADC_SMPR_SMP1_MASK
#define ADC_SMPR_SMP1_SHIFT
SMP1 ADC Sample Time #1 selection.
#define ADC_SMPR_SMPSEL_CHANNEL_MASK
#define ADC_SMPR_SMPSEL_SHIFT
#define ADC_SMPR_SMP2_MASK
#define ADC_SMPR_SMP2_SHIFT
SMP1 ADC Sample Time #2 selection.
#define cm3_assert_not_reached()
Check if unreachable code is reached.