STM8L15x Standard Peripherals Drivers: ADC

STM8L15x/16x Standard Peripherals Drivers

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.

Parameters:
ADCxwhere x can be 1 to select the specified ADC peripheral.
ADC_AnalogWatchdogSelection: Specifies the channel to be checked by the Analog watchdog. This parameter can be one of the following values:
  • ADC_AnalogWatchdogSelection_Channel0: AWD affected to Channel 0
  • ADC_AnalogWatchdogSelection_Channel1: AWD affected to Channel 1
  • ADC_AnalogWatchdogSelection_Channel2: AWD affected to Channel 2
  • ADC_AnalogWatchdogSelection_Channel3: AWD affected to Channel 3
  • ADC_AnalogWatchdogSelection_Channel4: AWD affected to Channel 4
  • ADC_AnalogWatchdogSelection_Channel5: AWD affected to Channel 5
  • ADC_AnalogWatchdogSelection_Channel6: AWD affected to Channel 6
  • ADC_AnalogWatchdogSelection_Channel7: AWD affected to Channel 7
  • ADC_AnalogWatchdogSelection_Channel8: AWD affected to Channel 8
  • ADC_AnalogWatchdogSelection_Channel9: AWD affected to Channel 9
  • ADC_AnalogWatchdogSelection_Channel10: AWD affected to Channel 10
  • ADC_AnalogWatchdogSelection_Channel11: AWD affected to Channel 11
  • ADC_AnalogWatchdogSelection_Channel12: AWD affected to Channel 12
  • ADC_AnalogWatchdogSelection_Channel13: AWD affected to Channel 13
  • ADC_AnalogWatchdogSelection_Channel14: AWD affected to Channel 14
  • ADC_AnalogWatchdogSelection_Channel15: AWD affected to Channel 15
  • ADC_AnalogWatchdogSelection_Channel16: AWD affected to Channel 16
  • ADC_AnalogWatchdogSelection_Channel17: AWD affected to Channel 17
  • ADC_AnalogWatchdogSelection_Channel18: AWD affected to Channel 18
  • ADC_AnalogWatchdogSelection_Channel19: AWD affected to Channel 19
  • ADC_AnalogWatchdogSelection_Channel20: AWD affected to Channel 20
  • ADC_AnalogWatchdogSelection_Channel21: AWD affected to Channel 21
  • ADC_AnalogWatchdogSelection_Channel22: AWD affected to Channel 22
  • ADC_AnalogWatchdogSelection_Channel23: AWD affected to Channel 23 ADC_AnalogWatchdogSelection_TypeDef enumeration.
Return values:
None

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.

Parameters:
ADCxwhere x can be 1 to select the specified ADC peripheral.
ADC_AnalogWatchdogSelection: Specifies the channel to be checked by the Analog watchdog. This parameter can be one of the following values:
  • ADC_AnalogWatchdogSelection_Channel0: AWD affected to Channel 0
  • ADC_AnalogWatchdogSelection_Channel1: AWD affected to Channel 1
  • ADC_AnalogWatchdogSelection_Channel2: AWD affected to Channel 2
  • ADC_AnalogWatchdogSelection_Channel3: AWD affected to Channel 3
  • ADC_AnalogWatchdogSelection_Channel4: AWD affected to Channel 4
  • ADC_AnalogWatchdogSelection_Channel5: AWD affected to Channel 5
  • ADC_AnalogWatchdogSelection_Channel6: AWD affected to Channel 6
  • ADC_AnalogWatchdogSelection_Channel7: AWD affected to Channel 7
  • ADC_AnalogWatchdogSelection_Channel8: AWD affected to Channel 8
  • ADC_AnalogWatchdogSelection_Channel9: AWD affected to Channel 9
  • ADC_AnalogWatchdogSelection_Channel10: AWD affected to Channel 10
  • ADC_AnalogWatchdogSelection_Channel11: AWD affected to Channel 11
  • ADC_AnalogWatchdogSelection_Channel12: AWD affected to Channel 12
  • ADC_AnalogWatchdogSelection_Channel13: AWD affected to Channel 13
  • ADC_AnalogWatchdogSelection_Channel14: AWD affected to Channel 14
  • ADC_AnalogWatchdogSelection_Channel15: AWD affected to Channel 15
  • ADC_AnalogWatchdogSelection_Channel16: AWD affected to Channel 16
  • ADC_AnalogWatchdogSelection_Channel17: AWD affected to Channel 17
  • ADC_AnalogWatchdogSelection_Channel18: AWD affected to Channel 18
  • ADC_AnalogWatchdogSelection_Channel19: AWD affected to Channel 19
  • ADC_AnalogWatchdogSelection_Channel20: AWD affected to Channel 20
  • ADC_AnalogWatchdogSelection_Channel21: AWD affected to Channel 21
  • ADC_AnalogWatchdogSelection_Channel22: AWD affected to Channel 22
  • ADC_AnalogWatchdogSelection_Channel23: AWD affected to Channel 23
HighThreshold,:Analog watchdog High threshold value. This parameter must be a 12bit value.
LowThreshold,:Analog watchdog Low threshold value. This parameter must be a 12bit value.
Return values:
None

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.

Parameters:
ADCxwhere x can be 1 to select the specified ADC peripheral.
HighThreshold,:Analog watchdog High threshold value. This parameter must be a 12bit value.
LowThreshold,:Analog watchdog Low threshold value. This parameter must be a 12bit value.
Return values:
None

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).

Parameters:
ADCxwhere x can be 1 to select the specified ADC peripheral.
ADC_Channels,:specifies the ADC channels to be initialized This parameter can be one of the following values:
  • ADC_Channel_0: Channel 0
  • ADC_Channel_1: Channel 1
  • ADC_Channel_2: Channel 2
  • ADC_Channel_3: Channel 3
  • ADC_Channel_4: Channel 4
  • ADC_Channel_5: Channel 5
  • ADC_Channel_6: Channel 6
  • ADC_Channel_7: Channel 7
  • ADC_Channel_8: Channel 8
  • ADC_Channel_9: Channel 9
  • ADC_Channel_10: Channel 10
  • ADC_Channel_11: Channel 11
  • ADC_Channel_12: Channel 12
  • ADC_Channel_13: Channel 13
  • ADC_Channel_14: Channel 14
  • ADC_Channel_15: Channel 15
  • ADC_Channel_16: Channel 16
  • ADC_Channel_17: Channel 17
  • ADC_Channel_18: Channel 18
  • ADC_Channel_19: Channel 19
  • ADC_Channel_20: Channel 20
  • ADC_Channel_21: Channel 21
  • ADC_Channel_22: Channel 22
  • ADC_Channel_23: Channel 23
  • ADC_Channel_24: Channel 24
  • ADC_Channel_25: Channel 25
  • ADC_Channel_26: Channel 26
  • ADC_Channel_27: Channel 27
  • ADC_Channel_Vrefint: Vrefint Channel
  • ADC_Channel_TempSensor: Temperature sensor Channel
  • ADC_Channel_00To07: select from channel00 to channel07
  • ADC_Channel_08To15: select from channel08 to channel15
  • ADC_Channel_16To23: select from channel16 to channel23
  • ADC_Channel_24To27: select from channel24 to channel27
NewState: new state of the specified ADC channel(s). This parameter can be: ENABLE or DISABLE.
Return values:
None

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.

Parameters:
ADCxwhere x can be 1 to select the specified ADC peripheral.
ADC_FLAG,:specifies the flag to clear. This parameter can be one of the following values:
  • ADC_FLAG_EOC: End of Conversion flag
  • ADC_FLAG_AWD: Analog WatchDog flag
  • ADC_FLAG_OVER: Over Run flag
Return values:
None

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.

Parameters:
ADCxwhere x can be 1 to select the specified ADC peripheral.
ADC_IT,:specifies the ADC interrupt pending bit to clear. This parameter can be one of the following values:
  • ADC_IT_EOC: End of Conversion Interrupt
  • ADC_IT_AWD: Analog WatchDog Interrupt
  • ADC_IT_OVER: Over Run Interrupt
Return values:
None

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.

Parameters:
ADCxwhere x can be 1 to select the specified ADC peripheral.
NewState: new state of the specified ADC peripheral. This parameter can be: ENABLE or DISABLE.
Return values:
None

Definition at line 210 of file stm8l15x_adc.c.

References ADC_CR1_ADON, ADC_struct::CR1, DISABLE, and IS_FUNCTIONAL_STATE.

void ADC_DMACmd ( ADC_TypeDef ADCx,
FunctionalState  NewState 
)

Enables or disables the specified ADC DMA request.

Parameters:
ADCxwhere x can be 1 to select the specified ADC peripheral.
NewState: new state of the specified ADC DMA transfer. This parameter can be: ENABLE or DISABLE.
Return values:
None

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.

Parameters:
ADCxwhere x can be 1 to select the specified ADC peripheral.
ADC_ExtEventSelection: Specifies the external trigger. This parameter can be one of the following values:
  • ADC_ExtEventSelection_None: Conversion starts only by software start
  • ADC_ExtEventSelection_Trigger1: Trigger 1 Enables conversion
  • ADC_ExtEventSelection_Trigger2: Trigger 2 Enables conversion
  • ADC_ExtEventSelection_Trigger3: Trigger 3 Enables conversion
ADC_ExtTRGSensitivity: Specifies the external trigger sensitivity. This parameter can be one of the following values:
  • ADC_ExtTRGSensitivity_Rising: External Trigger Sensitivity is Rising Edge
  • ADC_ExtTRGSensitivity_Falling: External Trigger Sensitivity is Falling Edge
  • ADC_ExtTRGSensitivity_All: External Trigger Sensitivity is Falling and Rising Edge
Return values:
None

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.

Parameters:
ADCxwhere x can be 1 to select the specified ADC peripheral.
Return values:
TheData conversion value.

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.

Parameters:
ADCxwhere x can be 1 to select the specified ADC peripheral.
ADC_FLAG,:specifies the flag to check. This parameter can be one of the following values:
  • ADC_FLAG_EOC: End of Conversion flag
  • ADC_FLAG_AWD: Analog WatchDog flag
  • ADC_FLAG_OVER: Over Run flag
Return values:
Thenew state of ADC_FLAG (SET or RESET).

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.

Parameters:
ADCxwhere x can be 1 to select the specified ADC peripheral.
ADC_IT,:specifies the ADC interrupt source to check. This parameter can be one of the following values:
  • ADC_IT_EOC: End of Conversion Interrupt
  • ADC_IT_AWD: Analog WatchDog Interrupt
  • ADC_IT_OVER: Over Run Interrupt
Return values:
Statusof ADC_IT (SET or RESET).

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.

Parameters:
ADCxwhere x can be 1 to select the specified ADC peripheral.
ADC_ConversionMode: specifies the ADC conversion mode, This parameter can be one of the following values:
  • ADC_ConversionMode_Single: Single Conversion Mode
  • ADC_ConversionMode_Continuous: Continuous Conversion Mode
ADC_Resolution: specifies the ADC Data resolution, This parameter can be one of the following values:
  • ADC_Resolution_12Bit: 12 bit resolution
  • ADC_Resolution_10Bit: 10 bit resolution
  • ADC_Resolution_8Bit: 8 bit resolution
  • ADC_Resolution_6Bit: 6 bit resolution
ADC_Prescaler: specifies the ADC Prescaler, This parameter can be one of the following values:
  • ADC_Prescaler_1: ADC Clock frequency is divided by 1
  • ADC_Prescaler_2: ADC Clock frequency is divided by 2
Return values:
None

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.

Parameters:
ADCxwhere x can be 1 to select the specified ADC peripheral.
ADC_IT: specifies the ADC interrupt sources to be enabled or disabled. This parameter can be one of the following values:
  • ADC_IT_EOC: End of Conversion Interrupt
  • ADC_IT_AWD: Analog WatchDog Interrupt
  • ADC_IT_OVER: Over Run Interrupt
NewState: new state of the specified ADC interrupts. This parameter can be: ENABLE or DISABLE.
Return values:
None

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.

Parameters:
ADCxwhere x can be 1 to select the specified ADC peripheral.
ADC_GroupChannels: ADC channel group to configure. This parameter can be one of the following values:
  • ADC_Group_SlowChannels: Slow Channels group
  • ADC_Group_FastChannels: Fast Channels 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.
Parameters:
ADC_SamplingTime: Specifies the sample time value This parameter can be one of the following values:
  • ADC_SamplingTime_4Cycles: Sampling Time Cycles is 4
  • ADC_SamplingTime_9Cycles: Sampling Time Cycles is 9
  • ADC_SamplingTime_16Cycles: Sampling Time Cycles is 16
  • ADC_SamplingTime_24Cycles: Sampling Time Cycles is 24
  • ADC_SamplingTime_48Cycles: Sampling Time Cycles is 48
  • ADC_SamplingTime_96Cycles: Sampling Time Cycles is 96
  • ADC_SamplingTime_192Cycles: Sampling Time Cycles is 192
  • ADC_SamplingTime_384Cycles: Sampling Time Cycles is 384
Return values:
None

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).

Parameters:
ADCxwhere x can be 1 to select the specified ADC peripheral.
ADC_Channels,:specifies the ADC channels to be initialized, This parameter can be one of the following values:
  • ADC_Channel_0: Channel 0
  • ADC_Channel_1: Channel 1
  • ADC_Channel_2: Channel 2
  • ADC_Channel_3: Channel 3
  • ADC_Channel_4: Channel 4
  • ADC_Channel_5: Channel 5
  • ADC_Channel_6: Channel 6
  • ADC_Channel_7: Channel 7
  • ADC_Channel_8: Channel 8
  • ADC_Channel_9: Channel 9
  • ADC_Channel_10: Channel 10
  • ADC_Channel_11: Channel 11
  • ADC_Channel_12: Channel 12
  • ADC_Channel_13: Channel 13
  • ADC_Channel_14: Channel 14
  • ADC_Channel_15: Channel 15
  • ADC_Channel_16: Channel 16
  • ADC_Channel_17: Channel 17
  • ADC_Channel_18: Channel 18
  • ADC_Channel_19: Channel 19
  • ADC_Channel_20: Channel 20
  • ADC_Channel_21: Channel 21
  • ADC_Channel_22: Channel 22
  • ADC_Channel_23: Channel 23
  • ADC_Channel_24: Channel 24
  • ADC_Channel_25: Channel 25
  • ADC_Channel_26: Channel 26
  • ADC_Channel_27: Channel 27
  • ADC_Channel_Vrefint: Vrefint Channel
  • ADC_Channel_TempSensor: Temperature sensor Channel
  • ADC_Channel_00To07: select from channel00 to channel07
  • ADC_Channel_08To15: select from channel08 to channel15
  • ADC_Channel_16To23: select from channel16 to channel23
  • ADC_Channel_24To27: select from channel24 to channel27
NewState: new state of the Schmitt Trigger This parameter can be: ENABLE or DISABLE.
Return values:
None

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.

Parameters:
ADCxwhere x can be 1 to select the specified ADC peripheral.
Return values:
None

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.

Parameters:
NewState: new state of the Temperature sensor internal reference. This parameter can be: ENABLE or DISABLE.
Return values:
None

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.

Parameters:
NewState: new state of the Internal Voltage reference. This parameter can be: ENABLE or DISABLE.
Return values:
None

Definition at line 491 of file stm8l15x_adc.c.

References ADC1, ADC_TRIGR1_VREFINTON, DISABLE, and IS_FUNCTIONAL_STATE.

STM8S Firmware Library: Overview

 

 

 

For complete documentation on STM8L15x 8-bit microcontrollers platform visit www.st.com