163 if ((length-1) > 7) {
311 ADC_IER(adc) &= ~ADC_IER_JEOCIE;
335 ADC_IER(adc) &= ~ADC_IER_JEOSIE;
362 ADC_IER(adc) &= ~ADC_IER_AWD1IE;
363 ADC_IER(adc) &= ~ADC_IER_AWD2IE;
364 ADC_IER(adc) &= ~ADC_IER_AWD3IE;
388 ADC_IER(adc) &= ~ADC_IER_EOSIE;
419 uint32_t mask = 0xf000ffff;
421 reg32 |= (threshold << 16);
437 uint32_t mask = 0xfffff000;
438 reg32 = (uint32_t)threshold;
467 if ((length - 1) > 3) {
471 for (i = 0; i < length; i++) {
587 uint32_t reg32 = ((
ADC_CCR(adc) & ~ADC_CCR_CKMODE_MASK) | prescale);
632 reg32 |= (trigger | polarity);
668 reg32 |= (trigger | polarity);
681 ADC_JSQR(adc) &= ~ADC_JSQR_JEXTEN_MASK;
713 ADC_CR(adc) &= ~ADC_CR_ADVREGEN_MASK;
725 ADC_CR(adc) &= ~ADC_CR_ADVREGEN_MASK;
#define ADC_CFGR1_AWD1CH_VAL(x)
AWD1CH: Analog watchdog 1 channel selection.
#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_JSQR_JL_VAL(val)
#define ADC_JSQR_JSQ_VAL(n, val)
#define ADC_CFGR1_JAWD1EN
#define ADC_OFR4_OFFSET4_EN
#define ADC_OFR1_OFFSET1_EN
#define ADC_CFGR1_DISCNUM_SHIFT
#define ADC_CCR_DUAL_MASK
#define ADC_CCR_DUAL_SHIFT
#define ADC_CFGR1_JDISCEN
#define ADC_JSQR_JEXTSEL_MASK
#define ADC_CR_ADVREGEN_ENABLE
ADVREGEN: ADC voltage regulator enable.
#define ADC_OFR2_OFFSET2_EN
#define ADC_OFR3_OFFSET3_EN
#define ADC_CFGR1_EXTSEL_MASK
#define ADC_JSQR_JEXTEN_MASK
#define ADC_CR_ADVREGEN_DISABLE
void adc_disable_automatic_injected_group_conversion(uint32_t adc)
ADC Disable Automatic Injected Conversions.
void adc_set_watchdog_high_threshold(uint32_t adc, uint16_t threshold)
ADC Set Analog Watchdog Upper Threshold.
void adc_enable_discontinuous_mode_injected(uint32_t adc)
ADC Enable Discontinuous Mode for Injected Conversions.
void adc_disable_eos_interrupt(uint32_t adc)
ADC Disable Regular End-Of-Sequence Interrupt.
void adc_disable_regulator(uint32_t adc)
Disable the ADC Voltage regulator You can disable the adc vreg when not in use to save power.
void adc_disable_discontinuous_mode_regular(uint32_t adc)
ADC Disable Discontinuous Mode for Regular Conversions.
void adc_enable_all_awd_interrupt(uint32_t adc)
ADC Enable Analog Watchdog Interrupt.
void adc_enable_eos_interrupt(uint32_t adc)
ADC Enable Regular End-Of-Sequence Interrupt.
void adc_start_conversion_injected(uint32_t adc)
ADC Software Triggered Conversion on Injected Channels.
void adc_enable_discontinuous_mode_regular(uint32_t adc, uint8_t length)
ADC Enable Discontinuous Mode for Regular Conversions.
void adc_disable_eoc_interrupt_injected(uint32_t adc)
ADC Disable Injected End-Of-Conversion Interrupt.
void adc_set_injected_sequence(uint32_t adc, uint8_t length, uint8_t channel[])
ADC Set an Injected Channel Conversion Sequence.
void adc_enable_analog_watchdog_on_all_channels(uint32_t adc)
ADC Enable Analog Watchdog for All Regular and/or Injected Channels.
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_all_awd_interrupt(uint32_t adc)
ADC Disable Analog Watchdog Interrupt.
void adc_enable_external_trigger_injected(uint32_t adc, uint32_t trigger, uint32_t polarity)
ADC Enable an External Trigger for Injected Channels.
void adc_disable_external_trigger_injected(uint32_t adc)
ADC Disable an External Trigger for Injected Channels.
void adc_enable_eos_interrupt_injected(uint32_t adc)
ADC Enable Injected End-Of-Sequence Interrupt.
void adc_enable_automatic_injected_group_conversion(uint32_t adc)
ADC Enable Automatic Injected Conversions.
void adc_set_clk_prescale(uint32_t adc, uint32_t prescale)
ADC Set Clock Prescale.
void adc_set_multi_mode(uint32_t adc, uint32_t mode)
ADC set multi mode.
void adc_enable_regulator(uint32_t adc)
Enable the ADC Voltage regulator Before any use of the ADC, the ADC Voltage regulator must be enabled...
bool adc_awd(uint32_t adc)
ADC Read the Analog Watchdog Flag.
void adc_enable_eoc_interrupt_injected(uint32_t adc)
ADC Enable Injected End-Of-Conversion Interrupt.
void adc_enable_analog_watchdog_injected(uint32_t adc)
ADC Enable Analog Watchdog for Injected Conversions.
uint32_t adc_read_injected(uint32_t adc, uint8_t reg)
ADC Read from an Injected Conversion Result Register.
void adc_disable_eos_interrupt_injected(uint32_t adc)
ADC Disable Injected End-Of-Sequence Interrupt.
void adc_set_injected_offset(uint32_t adc, uint8_t reg, uint32_t offset)
ADC Set the Injected Channel Data Offset.
void adc_enable_analog_watchdog_on_selected_channel(uint32_t adc, uint8_t channel)
ADC Enable Analog Watchdog for a Selected Channel.
void adc_disable_analog_watchdog_injected(uint32_t adc)
ADC Disable Analog Watchdog for Injected Conversions.
void adc_enable_analog_watchdog_regular(uint32_t adc)
ADC Enable Analog Watchdog for Regular Conversions.
bool adc_eoc_injected(uint32_t adc)
ADC Read the End-of-Conversion Flag for Injected Conversion.
void adc_set_watchdog_low_threshold(uint32_t adc, uint16_t threshold)
ADC Set Analog Watchdog Lower Threshold.
bool adc_eos_injected(uint32_t adc)
ADC Read the End-of-Sequence Flag for Injected Conversions.
void adc_disable_external_trigger_regular(uint32_t adc)
ADC Disable an External Trigger for Regular Channels.
void adc_disable_discontinuous_mode_injected(uint32_t adc)
ADC Disable Discontinuous Mode for Injected Conversions.
void adc_disable_analog_watchdog_regular(uint32_t adc)
ADC Enable Analog Watchdog for Regular Conversions.
#define ADC_IER_AWD1IE
AWD1IE: Analog watchdog 1 interrupt enable.
#define ADC_IER_EOSIE
EOSIE: End of regular sequence of conversions 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_IER(adc)
Interrupt Enable Register.
#define ADC_CFGR1(adc)
Configuration Register 1.
#define ADC_TR1(adc)
Watchdog Threshold Register 1.