Analog-to-digital converter (ADC)
3.2.4 Temperature Sensor - Vrefint (Internal Reference Voltage) and VBAT
management functions
This section provides a function allowing to enable/ disable the internal connections
between the ADC and the Vbat/2, Temperature Sensor and the Vrefint source.
A typical configuration to get the Temperature sensor and Vrefint channels voltages is
done following these steps :
1. Enable the internal connection of Vbat/2, Temperature sensor and Vrefint sources
with the ADC channels using:
ï€ ADC_TempSensorCmd()
ï€ ADC_VrefintCmd()
ï€ ADC_VbatCmd()
2. select the ADC_Channel_TempSensor and/or ADC_Channel_Vrefint and/or
ADC_Channel_Vbat using
ï€ ADC_RegularChannelConfig() or
ï€ ADC_InjectedChannelConfig() functions
3. Get the voltage values, using:
ï€ ADC_GetConversionValue() or
ï€ ADC_GetInjectedConversionValue().
ï‚· ADC_TempSensorCmd()
ï‚· ADC_VrefintCmd()
ï‚· ADC_VbatCmd()
3.2.5 Regular Channels Configuration functions
This section provides functions allowing to manage the ADC regular channels.
To configure a regular sequence of channels use:
1. ADC_RegularChannelConfig() this fuction allows:
ï€ Configure the rank in the regular group sequencer for each channel
ï€ Configure the sampling time for each channel
2. ADC_RegularChannelSequencerLengthConfig() to set the length of the regular
sequencer
The regular trigger is configured using the following functions:
1. ADC_SelectExternalTrigger()
2. ADC_ExternalTriggerPolarityConfig()
The start and the stop conversion are controlled by:
1. ADC_StartConversion()
2. ADC_StopConversion()
Please Note that the following features for regular channels are configurated
using the ADC_Init() function : (++) continuous mode activation (++) Resolution
(++) Data Alignement (++) Overrun Mode.
Get the conversion data: This subsection provides an important function in the ADC
peripheral since it returns the converted data of the current regular channel. When the
Conversion value is read, the EOC Flag is automatically cleared.
To configure the discontinous mode, the following functions should be used: