137 ADC_CR1(adc) &= ~ADC_CR1_AWDEN;
163 ADC_CR1(adc) &= ~ADC_CR1_JAWDEN;
184 if ((length-1) > 7) {
199 ADC_CR1(adc) &= ~ADC_CR1_DISCEN;
225 ADC_CR1(adc) &= ~ADC_CR1_JDISCEN;
253 ADC_CR1(adc) &= ~ADC_CR1_JAUTO;
274 ADC_CR1(adc) &= ~ADC_CR1_AWDSGL;
299 reg32 = (
ADC_CR1(adc) & ~ADC_CR1_AWDCH_MASK);
352 ADC_CR1(adc) &= ~ADC_CR1_JEOCIE;
374 ADC_CR1(adc) &= ~ADC_CR1_AWDIE;
397 ADC_CR1(adc) &= ~ADC_CR1_EOCIE;
422 ADC_CR2(adc) &= ~ADC_CR2_ALIGN;
539 reg32 = (uint32_t)threshold;
555 reg32 = (uint32_t)threshold;
577 uint32_t fourth6 = 0;
579 uint32_t second6 = 0;
587 for (i = 1; i <= length; i++) {
589 first6 |= (channel[i - 1] << ((i - 1) * 5));
591 if ((i > 6) && (i <= 12)) {
592 second6 |= (channel[i - 1] << ((i - 6 - 1) * 5));
594 if ((i > 12) && (i <= 18)) {
595 third6 |= (channel[i - 1] << ((i - 12 - 1) * 5));
597 if ((i > 18) && (i <= 24)) {
598 fourth6 |= (channel[i - 1] << ((i - 18 - 1) * 5));
600 if ((i > 24) && (i <= 28)) {
601 fifth6 |= (channel[i - 1] << ((i - 24 - 1) * 5));
636 if ((length - 1) > 3) {
640 for (i = 0; i < length; i++) {
761 return ADC_SR(adc) & flag;
#define ADC_CR1_DISCNUM_SHIFT
#define ADC_JSQR_JL_VAL(val)
#define ADC_JSQR_JSQ_VAL(n, val)
#define ADC_CR1_JEOCIE
Interrupt enable for injected channels.
#define ADC_CR1_AWDSGL
Enable the watchdog on a single channel in scan mode.
#define ADC_CR1_JAUTO
Automatic Injection Group conversion.
void adc_disable_external_trigger_injected(uint32_t adc)
ADC Disable an External Trigger for Injected Channels.
#define ADC_CR1_EOCIE
Interrupt enable EOC.
#define ADC_CR1_SCAN
Scan mode.
#define ADC_CR1_DISCEN
Discontinuous mode on regular channels.
#define ADC_CR1_JDISCEN
Discontinuous mode on injected channels.
#define ADC_CR1_AWDIE
Analog watchdog interrupt enable.
void adc_disable_awd_interrupt(uint32_t adc)
ADC Disable Analog Watchdog Interrupt.
void adc_start_conversion_regular(uint32_t adc)
ADC Software Triggered Conversion on Regular Channels.
void adc_enable_awd_interrupt(uint32_t adc)
ADC Enable Analog Watchdog Interrupt.
bool adc_get_flag(uint32_t adc, uint32_t flag)
Read a Status Flag.
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_power_off(uint32_t adc)
ADC Off.
void adc_enable_discontinuous_mode_injected(uint32_t adc)
ADC Enable Discontinuous Mode for Injected Conversions.
void adc_set_continuous_conversion_mode(uint32_t adc)
ADC Enable Continuous Conversion Mode.
void adc_set_single_conversion_mode(uint32_t adc)
ADC Enable Single Conversion Mode.
void adc_disable_discontinuous_mode_regular(uint32_t adc)
ADC Disable Discontinuous Mode for Regular Conversions.
void adc_start_conversion_injected(uint32_t adc)
ADC Software Triggered Conversion on Injected Channels.
uint32_t adc_read_regular(uint32_t adc)
ADC Read from the Regular Conversion Result Register.
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_eoc_interrupt(uint32_t adc)
ADC Enable Regular End-Of-Conversion Interrupt.
void adc_disable_eoc_interrupt(uint32_t adc)
ADC Disable Regular End-Of-Conversion Interrupt.
void adc_enable_analog_watchdog_on_all_channels(uint32_t adc)
ADC Enable Analog Watchdog for All Regular and/or Injected Channels.
void adc_disable_scan_mode(uint32_t adc)
ADC Disable Scan Mode.
void adc_disable_dma(uint32_t adc)
ADC Disable DMA Transfers.
void adc_set_left_aligned(uint32_t adc)
ADC Set the Data as Left Aligned.
void adc_set_right_aligned(uint32_t adc)
ADC Set the Data as Right Aligned.
void adc_clear_flag(uint32_t adc, uint32_t flag)
Clear a Status Flag.
void adc_enable_automatic_injected_group_conversion(uint32_t adc)
ADC Enable Automatic Injected Conversions.
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_enable_dma(uint32_t adc)
ADC Enable DMA Transfers.
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_set_regular_sequence(uint32_t adc, uint8_t length, uint8_t channel[])
ADC Set a Regular Channel Conversion Sequence.
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_eoc(uint32_t adc)
ADC Read the End-of-Conversion Flag.
void adc_enable_scan_mode(uint32_t adc)
ADC Set Scan Mode.
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 Disable Analog Watchdog for Regular Conversions.
#define ADC_SR_EOC
End of conversion.
#define ADC_SR_JEOC
Injected channel end of conversion.
#define ADC_CR1_AWDCH_MAX
#define ADC_SQR_MAX_CHANNELS_REGULAR