|
STM8L15x Standard Peripherals Drivers
|
Channels Configuration functions. More...
Functions | |
| void | ADC_ChannelCmd (ADC_TypeDef *ADCx, ADC_Channel_TypeDef ADC_Channels, FunctionalState NewState) |
| Enables or disables the selected ADC channel(s). | |
| uint16_t | ADC_GetConversionValue (ADC_TypeDef *ADCx) |
| Returns the last ADC converted data. | |
| void | ADC_SamplingTimeConfig (ADC_TypeDef *ADCx, ADC_Group_TypeDef ADC_GroupChannels, ADC_SamplingTime_TypeDef ADC_SamplingTime) |
| Configures the sampling time for the selected ADC channel group. | |
| void | ADC_SchmittTriggerConfig (ADC_TypeDef *ADCx, ADC_Channel_TypeDef ADC_Channels, FunctionalState NewState) |
| Configures the status of the Schmitt Trigger for the selected ADC channel(s). | |
Detailed Description
Channels Configuration functions.
===============================================================================
Channels Configuration functions
===============================================================================
This section provides functions allowing to:
- Enable or disable the ADC channel using ADC_ChannelCmd() function,
- Configure the channels sampling times using ADC_SamplingTimeConfig()
function.
Note: there are 2 sampling times configuration values :
- 1st Group value : for channels 0..23
- 2nd Group value : for channels 24..27 (depending on the MCU
package density) and Temperature Sensor and Vrefint channels.
- Configure the channels Schmitt Trigger for each channel using
ADC_SchmittTriggerConfig() function.
- Get the current ADC conversion value.
Function Documentation
| void ADC_ChannelCmd | ( | ADC_TypeDef * | ADCx, |
| ADC_Channel_TypeDef | ADC_Channels, | ||
| FunctionalState | NewState | ||
| ) |
Enables or disables the selected ADC channel(s).
Definition at line 577 of file stm8l15x_adc.c.
References DISABLE, IS_FUNCTIONAL_STATE, and ADC_struct::SQR.
| uint16_t ADC_GetConversionValue | ( | ADC_TypeDef * | ADCx | ) |
Returns the last ADC converted data.
Definition at line 711 of file stm8l15x_adc.c.
References ADC_struct::DRH, and ADC_struct::DRL.
| void ADC_SamplingTimeConfig | ( | ADC_TypeDef * | ADCx, |
| ADC_Group_TypeDef | ADC_GroupChannels, | ||
| ADC_SamplingTime_TypeDef | ADC_SamplingTime | ||
| ) |
Configures the sampling time for the selected ADC channel group.
- Note:
- The channels of 1st ADC Group can be channels 0..23
- The channels of 2nd ADC Group can be channels 24..27 (depending on the MCU package density) and Temperature Sensor and Vrefint channels.
Definition at line 619 of file stm8l15x_adc.c.
References ADC_CR2_SMPT1, ADC_CR3_SMPT2, ADC_Group_SlowChannels, ADC_struct::CR2, ADC_struct::CR3, IS_ADC_GROUP, and IS_ADC_SAMPLING_TIME_CYCLES.
| void ADC_SchmittTriggerConfig | ( | ADC_TypeDef * | ADCx, |
| ADC_Channel_TypeDef | ADC_Channels, | ||
| FunctionalState | NewState | ||
| ) |
Configures the status of the Schmitt Trigger for the selected ADC channel(s).
Definition at line 685 of file stm8l15x_adc.c.
References DISABLE, IS_FUNCTIONAL_STATE, and ADC_struct::TRIGR.