STM8S/A Standard Peripherals Drivers: ADC2_Public_Functions

STM8S/A

STM8S/A Standard Peripherals Drivers
ADC2_Public_Functions

Functions

void ADC2_ClearFlag (void)
 Clear the ADC2 EOC Flag.
void ADC2_ClearITPendingBit (void)
 Clear the ADC2 End of Conversion pending bit.
void ADC2_Cmd (FunctionalState NewState)
 Enables or Disables the ADC2 peripheral.
void ADC2_ConversionConfig (ADC2_ConvMode_TypeDef ADC2_ConversionMode, ADC2_Channel_TypeDef ADC2_Channel, ADC2_Align_TypeDef ADC2_Align)
 Configure the ADC2 conversion on selected channel.
void ADC2_DeInit (void)
 Deinitializes the ADC2 peripheral registers to their default reset values.
void ADC2_ExternalTriggerConfig (ADC2_ExtTrig_TypeDef ADC2_ExtTrigger, FunctionalState NewState)
 Configure the ADC2 conversion on external trigger event.
uint16_t ADC2_GetConversionValue (void)
 Get one sample of measured signal.
FlagStatus ADC2_GetFlagStatus (void)
 Checks the ADC2 EOC flag status.
ITStatus ADC2_GetITStatus (void)
 Returns the EOC pending bit status.
void ADC2_Init (ADC2_ConvMode_TypeDef ADC2_ConversionMode, ADC2_Channel_TypeDef ADC2_Channel, ADC2_PresSel_TypeDef ADC2_PrescalerSelection, ADC2_ExtTrig_TypeDef ADC2_ExtTrigger, FunctionalState ADC2_ExtTriggerState, ADC2_Align_TypeDef ADC2_Align, ADC2_SchmittTrigg_TypeDef ADC2_SchmittTriggerChannel, FunctionalState ADC2_SchmittTriggerState)
 Initializes the ADC2 peripheral according to the specified parameters.
void ADC2_ITConfig (FunctionalState NewState)
 Enables or disables the ADC2 interrupt.
void ADC2_PrescalerConfig (ADC2_PresSel_TypeDef ADC2_Prescaler)
 Configure the ADC2 prescaler division factor.
void ADC2_SchmittTriggerConfig (ADC2_SchmittTrigg_TypeDef ADC2_SchmittTriggerChannel, FunctionalState NewState)
 Enables or disables the ADC2 Schmitt Trigger on a selected channel.
void ADC2_StartConversion (void)
 Start ADC2 conversion.

Function Documentation

void ADC2_ClearFlag ( void  )

Clear the ADC2 EOC Flag.

Parameters:
None
Return values:
None

Definition at line 363 of file stm8s_adc2.c.

void ADC2_ClearITPendingBit ( void  )

Clear the ADC2 End of Conversion pending bit.

Parameters:
None
Return values:
None

Definition at line 384 of file stm8s_adc2.c.

void ADC2_Cmd ( FunctionalState  NewState)

Enables or Disables the ADC2 peripheral.

Parameters:
NewState,:specifies the peripheral enabled or disabled state.
Return values:
None

Definition at line 121 of file stm8s_adc2.c.

References DISABLE, and IS_FUNCTIONALSTATE_OK.

void ADC2_ConversionConfig ( ADC2_ConvMode_TypeDef  ADC2_ConversionMode,
ADC2_Channel_TypeDef  ADC2_Channel,
ADC2_Align_TypeDef  ADC2_Align 
)

Configure the ADC2 conversion on selected channel.

Parameters:
ADC2_ConversionModeSpecifies the conversion type. It can be set of the values of ADC2_ConvMode_TypeDef
ADC2_Channelspecifies the ADC2 Channel. It can be set of the values of ADC2_Channel_TypeDef
ADC2_Alignspecifies the converted data alignment. It can be set of the values of ADC2_Align_TypeDef
Return values:
None

Definition at line 236 of file stm8s_adc2.c.

References ADC2_CONVERSIONMODE_CONTINUOUS, IS_ADC2_ALIGN_OK, IS_ADC2_CHANNEL_OK, and IS_ADC2_CONVERSIONMODE_OK.

Referenced by ADC2_Init().

void ADC2_DeInit ( void  )

Deinitializes the ADC2 peripheral registers to their default reset values.

Parameters:
None
Return values:
None

Definition at line 54 of file stm8s_adc2.c.

void ADC2_ExternalTriggerConfig ( ADC2_ExtTrig_TypeDef  ADC2_ExtTrigger,
FunctionalState  NewState 
)

Configure the ADC2 conversion on external trigger event.

Full description:
The selected external trigger event can be enabled or disabled.
Parameters:
ADC2_ExtTriggerto select the External trigger event. can have one of the values of ADC2_ExtTrig_TypeDef.
NewStateto enable/disable the selected external trigger can have one of the values of FunctionalState.
Return values:
None

Definition at line 275 of file stm8s_adc2.c.

References DISABLE, IS_ADC2_EXTTRIG_OK, and IS_FUNCTIONALSTATE_OK.

Referenced by ADC2_Init().

uint16_t ADC2_GetConversionValue ( void  )

Get one sample of measured signal.

Parameters:
None
Return values:
ConversionValue,:value of the measured signal.
Required preconditions:
ADC2 conversion finished.

Definition at line 320 of file stm8s_adc2.c.

FlagStatus ADC2_GetFlagStatus ( void  )

Checks the ADC2 EOC flag status.

Parameters:
None
Return values:
FlagStatusStatus of the ADC2 EOC flag.

Definition at line 352 of file stm8s_adc2.c.

ITStatus ADC2_GetITStatus ( void  )

Returns the EOC pending bit status.

Parameters:
None
Return values:
FlagStatus,:status of the EOC pending bit.

Definition at line 374 of file stm8s_adc2.c.

void ADC2_Init ( ADC2_ConvMode_TypeDef  ADC2_ConversionMode,
ADC2_Channel_TypeDef  ADC2_Channel,
ADC2_PresSel_TypeDef  ADC2_PrescalerSelection,
ADC2_ExtTrig_TypeDef  ADC2_ExtTrigger,
FunctionalState  ADC2_ExtTriggerState,
ADC2_Align_TypeDef  ADC2_Align,
ADC2_SchmittTrigg_TypeDef  ADC2_SchmittTriggerChannel,
FunctionalState  ADC2_SchmittTriggerState 
)

Initializes the ADC2 peripheral according to the specified parameters.

Parameters:
ADC2_ConversionMode,:specifies the conversion mode can be one of the values of ADC2_ConvMode_TypeDef.
ADC2_Channel,:specifies the channel to convert can be one of the values of ADC2_Channel_TypeDef.
ADC2_PrescalerSelection,:specifies the ADC2 prescaler can be one of the values of ADC2_PresSel_TypeDef.
ADC2_ExtTrigger,:specifies the external trigger can be one of the values of ADC2_ExtTrig_TypeDef.
ADC2_ExtTriggerState,:specifies the external trigger new state can be one of the values of FunctionalState.
ADC2_Align,:specifies the converted data alignment can be one of the values of ADC2_Align_TypeDef.
ADC2_SchmittTriggerChannel,:specifies the schmitt trigger channel can be one of the values of ADC2_SchmittTrigg_TypeDef.
ADC2_SchmittTriggerState,:specifies the schmitt trigger state can be one of the values of FunctionalState.
Return values:
None

Definition at line 83 of file stm8s_adc2.c.

References ADC2_ConversionConfig(), ADC2_ExternalTriggerConfig(), ADC2_PrescalerConfig(), ADC2_SchmittTriggerConfig(), IS_ADC2_ALIGN_OK, IS_ADC2_CHANNEL_OK, IS_ADC2_CONVERSIONMODE_OK, IS_ADC2_EXTTRIG_OK, IS_ADC2_PRESSEL_OK, IS_ADC2_SCHMITTTRIG_OK, and IS_FUNCTIONALSTATE_OK.

void ADC2_ITConfig ( FunctionalState  NewState)

Enables or disables the ADC2 interrupt.

Parameters:
NewStatespecifies the state of ADC2 interrupt.
Return values:
None

Definition at line 141 of file stm8s_adc2.c.

References DISABLE, and IS_FUNCTIONALSTATE_OK.

void ADC2_PrescalerConfig ( ADC2_PresSel_TypeDef  ADC2_Prescaler)

Configure the ADC2 prescaler division factor.

Parameters:
ADC2_Prescaler,:the selected prescaler. It can be one of the values of ADC2_PresSel_TypeDef.
Return values:
None

Definition at line 164 of file stm8s_adc2.c.

References IS_ADC2_PRESSEL_OK.

Referenced by ADC2_Init().

void ADC2_SchmittTriggerConfig ( ADC2_SchmittTrigg_TypeDef  ADC2_SchmittTriggerChannel,
FunctionalState  NewState 
)

Enables or disables the ADC2 Schmitt Trigger on a selected channel.

Parameters:
ADC2_SchmittTriggerChannelspecifies the desired Channel. It can be set of the values of ADC2_SchmittTrigg_TypeDef.
NewStatespecifies the Channel ADC2 Schmitt Trigger new status. can have one of the values of FunctionalState.
Return values:
None

Definition at line 183 of file stm8s_adc2.c.

References ADC2_SCHMITTTRIG_ALL, ADC2_SCHMITTTRIG_CHANNEL8, DISABLE, IS_ADC2_SCHMITTTRIG_OK, and IS_FUNCTIONALSTATE_OK.

Referenced by ADC2_Init().

void ADC2_StartConversion ( void  )

Start ADC2 conversion.

Full description:
This function triggers the start of conversion, after ADC2 configuration.
Parameters:
None
Return values:
None
Required preconditions:
Enable the ADC2 peripheral before calling this function

Definition at line 308 of file stm8s_adc2.c.

STM8 Standard Peripherals Library: Footer

 

 

 

      For complete documentation on STM8 8-bit Microcontrollers platform visit www.st.com