libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
|
ADC Basic configuration API. More...
Functions | |
void | adc_set_clk_source (uint32_t adc, uint32_t source) |
ADC Set Clock Source. More... | |
void | adc_set_regular_sequence (uint32_t adc, uint8_t length, uint8_t channel[]) |
ADC Set a Regular Channel Conversion Sequence. More... | |
void | adc_set_sample_time_on_all_channels (uint32_t adc, uint8_t time) |
ADC Set the Sample Time for All Channels. More... | |
void | adc_enable_vbat_sensor (void) |
ADC Enable The VBat Sensor. More... | |
void | adc_disable_vbat_sensor (void) |
ADC Disable The VBat Sensor. More... | |
void | adc_calibrate_start (uint32_t adc) |
ADC Start the calibration procedure. More... | |
void | adc_calibrate_wait_finish (uint32_t adc) |
ADC Wait to finish the ADC calibration procedure. More... | |
ADC Basic configuration API.
void adc_calibrate_start | ( | uint32_t | adc | ) |
ADC Start the calibration procedure.
[in] | adc | Unsigned int32. ADC base address (ADC register base addresses) |
Definition at line 410 of file adc.c.
References ADC_CR, and ADC_CR_ADCAL.
void adc_calibrate_wait_finish | ( | uint32_t | adc | ) |
ADC Wait to finish the ADC calibration procedure.
[in] | adc | Unsigned int32. ADC base address (ADC register base addresses) |
Definition at line 422 of file adc.c.
References ADC_CR, and ADC_CR_ADCAL.
void adc_disable_vbat_sensor | ( | void | ) |
void adc_enable_vbat_sensor | ( | void | ) |
ADC Enable The VBat Sensor.
This enables the battery voltage measurements on channel 17.
Definition at line 386 of file adc.c.
References ADC1, ADC_CCR, and ADC_CCR_VBATEN.
void adc_set_clk_source | ( | uint32_t | adc, |
uint32_t | source | ||
) |
ADC Set Clock Source.
The ADC clock taken from the many sources.
[in] | adc | Unsigned int32. ADC base address (ADC register base addresses) |
[in] | source | Unsigned int32. Source (ADC clock source) |
Definition at line 309 of file adc.c.
References ADC_CFGR2.
void adc_set_regular_sequence | ( | uint32_t | adc, |
uint8_t | length, | ||
uint8_t | channel[] | ||
) |
ADC Set a Regular Channel Conversion Sequence.
Define a sequence of channels to be converted as a regular group with a length from 1 to 18 channels. If this is called during conversion, the current conversion is reset and conversion begins again with the newly defined group.
[in] | adc | Unsigned int32. ADC base address (ADC register base addresses) |
[in] | length | Unsigned int8. Number of channels in the group. |
[in] | channel | Unsigned int8[]. Set of channels to convert, integers 0..18. |
Definition at line 331 of file adc.c.
References ADC_CFGR1, ADC_CFGR1_SCANDIR, ADC_CHSELR, and cm3_assert_not_reached.
void adc_set_sample_time_on_all_channels | ( | uint32_t | adc, |
uint8_t | time | ||
) |
ADC Set the Sample Time for All Channels.
The sampling time can be selected in ADC clock cycles from 1.5 to 239.5, same for all channels.
[in] | adc | Unsigned int32. ADC base address (ADC register base addresses) |
[in] | time | Unsigned int8. Sampling time selection (ADC sampling time) |
Definition at line 375 of file adc.c.
References ADC_SMPR, and ADC_SMPR_SMP.