STM8L15x Standard Peripherals Drivers
|
ADC driver modules. More...
Modules | |
ADC_Exported_Types | |
ADC_Exported_Macros | |
ADC_Private_Functions | |
Functions | |
void | ADC_AnalogWatchdogChannelSelect (ADC_TypeDef *ADCx, ADC_AnalogWatchdogSelection_TypeDef ADC_AnalogWatchdogSelection) |
Configures the channel to be checked by the Analog watchdog. | |
void | ADC_AnalogWatchdogConfig (ADC_TypeDef *ADCx, ADC_AnalogWatchdogSelection_TypeDef ADC_AnalogWatchdogSelection, uint16_t HighThreshold, uint16_t LowThreshold) |
Configures the Analog watchdog. | |
void | ADC_AnalogWatchdogThresholdsConfig (ADC_TypeDef *ADCx, uint16_t HighThreshold, uint16_t LowThreshold) |
Configures the high and low thresholds of the Analog watchdog. | |
void | ADC_ChannelCmd (ADC_TypeDef *ADCx, ADC_Channel_TypeDef ADC_Channels, FunctionalState NewState) |
Enables or disables the selected ADC channel(s). | |
void | ADC_ClearFlag (ADC_TypeDef *ADCx, ADC_FLAG_TypeDef ADC_FLAG) |
Clears the ADC's pending flags. | |
void | ADC_ClearITPendingBit (ADC_TypeDef *ADCx, ADC_IT_TypeDef ADC_IT) |
Clears the ADC�s interrupt pending bits. | |
void | ADC_Cmd (ADC_TypeDef *ADCx, FunctionalState NewState) |
Enables or disables the selected ADC peripheral. | |
void | ADC_DeInit (ADC_TypeDef *ADCx) |
Deinitializes the ADC peripheral registers to their default reset values. | |
void | ADC_DMACmd (ADC_TypeDef *ADCx, FunctionalState NewState) |
Enables or disables the specified ADC DMA request. | |
void | ADC_ExternalTrigConfig (ADC_TypeDef *ADCx, ADC_ExtEventSelection_TypeDef ADC_ExtEventSelection, ADC_ExtTRGSensitivity_TypeDef ADC_ExtTRGSensitivity) |
Configures the ADC conversion through external trigger. | |
uint16_t | ADC_GetConversionValue (ADC_TypeDef *ADCx) |
Returns the last ADC converted data. | |
FlagStatus | ADC_GetFlagStatus (ADC_TypeDef *ADCx, ADC_FLAG_TypeDef ADC_FLAG) |
Checks whether the specified ADC flag is set or not. | |
ITStatus | ADC_GetITStatus (ADC_TypeDef *ADCx, ADC_IT_TypeDef ADC_IT) |
Checks whether the specified ADC interrupt has occurred or not. | |
void | ADC_Init (ADC_TypeDef *ADCx, ADC_ConversionMode_TypeDef ADC_ConversionMode, ADC_Resolution_TypeDef ADC_Resolution, ADC_Prescaler_TypeDef ADC_Prescaler) |
Initializes the specified ADC peripheral according to the specified parameters. | |
void | ADC_ITConfig (ADC_TypeDef *ADCx, ADC_IT_TypeDef ADC_IT, FunctionalState NewState) |
Enables or disables the specified ADC interrupts. | |
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). | |
void | ADC_SoftwareStartConv (ADC_TypeDef *ADCx) |
Starts ADC conversion, by software trigger. | |
void | ADC_TempSensorCmd (FunctionalState NewState) |
Enables or disables the Temperature sensor internal reference. | |
void | ADC_VrefintCmd (FunctionalState NewState) |
Enables or disables the Internal Voltage reference. |
Detailed Description
ADC driver modules.
Function Documentation
void ADC_AnalogWatchdogChannelSelect | ( | ADC_TypeDef * | ADCx, |
ADC_AnalogWatchdogSelection_TypeDef | ADC_AnalogWatchdogSelection | ||
) |
Configures the channel to be checked by the Analog watchdog.
Definition at line 333 of file stm8l15x_adc.c.
References ADC_CR3_CHSEL, ADC_struct::CR3, and IS_ADC_ANALOGWATCHDOG_SELECTION.
void ADC_AnalogWatchdogConfig | ( | ADC_TypeDef * | ADCx, |
ADC_AnalogWatchdogSelection_TypeDef | ADC_AnalogWatchdogSelection, | ||
uint16_t | HighThreshold, | ||
uint16_t | LowThreshold | ||
) |
Configures the Analog watchdog.
Definition at line 406 of file stm8l15x_adc.c.
References ADC_CR3_CHSEL, ADC_struct::CR3, ADC_struct::HTRH, ADC_struct::HTRL, IS_ADC_ANALOGWATCHDOG_SELECTION, IS_ADC_THRESHOLD, ADC_struct::LTRH, and ADC_struct::LTRL.
void ADC_AnalogWatchdogThresholdsConfig | ( | ADC_TypeDef * | ADCx, |
uint16_t | HighThreshold, | ||
uint16_t | LowThreshold | ||
) |
Configures the high and low thresholds of the Analog watchdog.
Definition at line 355 of file stm8l15x_adc.c.
References ADC_struct::HTRH, ADC_struct::HTRL, IS_ADC_THRESHOLD, ADC_struct::LTRH, and ADC_struct::LTRL.
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.
void ADC_ClearFlag | ( | ADC_TypeDef * | ADCx, |
ADC_FLAG_TypeDef | ADC_FLAG | ||
) |
Clears the ADC's pending flags.
Definition at line 886 of file stm8l15x_adc.c.
References IS_ADC_CLEAR_FLAG, and ADC_struct::SR.
void ADC_ClearITPendingBit | ( | ADC_TypeDef * | ADCx, |
ADC_IT_TypeDef | ADC_IT | ||
) |
Clears the ADC�s interrupt pending bits.
Definition at line 949 of file stm8l15x_adc.c.
References IS_ADC_IT, and ADC_struct::SR.
void ADC_Cmd | ( | ADC_TypeDef * | ADCx, |
FunctionalState | NewState | ||
) |
Enables or disables the selected ADC peripheral.
Definition at line 210 of file stm8l15x_adc.c.
References ADC_CR1_ADON, ADC_struct::CR1, DISABLE, and IS_FUNCTIONAL_STATE.
void ADC_DeInit | ( | ADC_TypeDef * | ADCx | ) |
Deinitializes the ADC peripheral registers to their default reset values.
Definition at line 129 of file stm8l15x_adc.c.
References ADC_CR1_RESET_VALUE, ADC_CR2_RESET_VALUE, ADC_CR3_RESET_VALUE, ADC_HTRH_RESET_VALUE, ADC_HTRL_RESET_VALUE, ADC_LTRH_RESET_VALUE, ADC_LTRL_RESET_VALUE, ADC_SQR1_RESET_VALUE, ADC_SQR2_RESET_VALUE, ADC_SQR3_RESET_VALUE, ADC_SQR4_RESET_VALUE, ADC_SR_RESET_VALUE, ADC_TRIGR1_RESET_VALUE, ADC_TRIGR2_RESET_VALUE, ADC_TRIGR3_RESET_VALUE, ADC_TRIGR4_RESET_VALUE, ADC_struct::CR1, ADC_struct::CR2, ADC_struct::CR3, ADC_struct::HTRH, ADC_struct::HTRL, ADC_struct::LTRH, ADC_struct::LTRL, ADC_struct::SQR, ADC_struct::SR, and ADC_struct::TRIGR.
void ADC_DMACmd | ( | ADC_TypeDef * | ADCx, |
FunctionalState | NewState | ||
) |
Enables or disables the specified ADC DMA request.
Definition at line 754 of file stm8l15x_adc.c.
References ADC_SQR1_DMAOFF, DISABLE, IS_FUNCTIONAL_STATE, and ADC_struct::SQR.
void ADC_ExternalTrigConfig | ( | ADC_TypeDef * | ADCx, |
ADC_ExtEventSelection_TypeDef | ADC_ExtEventSelection, | ||
ADC_ExtTRGSensitivity_TypeDef | ADC_ExtTRGSensitivity | ||
) |
Configures the ADC conversion through external trigger.
Definition at line 255 of file stm8l15x_adc.c.
References ADC_CR2_EXTSEL, ADC_CR2_TRIGEDGE, ADC_struct::CR2, IS_ADC_EXT_EVENT_SELECTION, and IS_ADC_EXT_TRG_SENSITIVITY.
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.
FlagStatus ADC_GetFlagStatus | ( | ADC_TypeDef * | ADCx, |
ADC_FLAG_TypeDef | ADC_FLAG | ||
) |
Checks whether the specified ADC flag is set or not.
Definition at line 853 of file stm8l15x_adc.c.
References IS_ADC_GET_FLAG, RESET, SET, and ADC_struct::SR.
ITStatus ADC_GetITStatus | ( | ADC_TypeDef * | ADCx, |
ADC_IT_TypeDef | ADC_IT | ||
) |
Checks whether the specified ADC interrupt has occurred or not.
Definition at line 906 of file stm8l15x_adc.c.
References ADC_struct::CR1, IS_ADC_GET_IT, RESET, SET, and ADC_struct::SR.
void ADC_Init | ( | ADC_TypeDef * | ADCx, |
ADC_ConversionMode_TypeDef | ADC_ConversionMode, | ||
ADC_Resolution_TypeDef | ADC_Resolution, | ||
ADC_Prescaler_TypeDef | ADC_Prescaler | ||
) |
Initializes the specified ADC peripheral according to the specified parameters.
Definition at line 180 of file stm8l15x_adc.c.
References ADC_CR1_CONT, ADC_CR1_RES, ADC_CR2_PRESC, ADC_struct::CR1, ADC_struct::CR2, IS_ADC_CONVERSION_MODE, IS_ADC_PRESCALER, and IS_ADC_RESOLUTION.
void ADC_ITConfig | ( | ADC_TypeDef * | ADCx, |
ADC_IT_TypeDef | ADC_IT, | ||
FunctionalState | NewState | ||
) |
Enables or disables the specified ADC interrupts.
Definition at line 825 of file stm8l15x_adc.c.
References ADC_struct::CR1, DISABLE, IS_ADC_IT, and IS_FUNCTIONAL_STATE.
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.
void ADC_SoftwareStartConv | ( | ADC_TypeDef * | ADCx | ) |
Starts ADC conversion, by software trigger.
Definition at line 233 of file stm8l15x_adc.c.
References ADC_CR1_START, and ADC_struct::CR1.
void ADC_TempSensorCmd | ( | FunctionalState | NewState | ) |
Enables or disables the Temperature sensor internal reference.
Definition at line 468 of file stm8l15x_adc.c.
References ADC1, ADC_TRIGR1_TSON, DISABLE, and IS_FUNCTIONAL_STATE.
void ADC_VrefintCmd | ( | FunctionalState | NewState | ) |
Enables or disables the Internal Voltage reference.
Definition at line 491 of file stm8l15x_adc.c.
References ADC1, ADC_TRIGR1_VREFINTON, DISABLE, and IS_FUNCTIONAL_STATE.