ADC_Private_Functions
[ADC]

Functions

void ADC_AnalogWatchdogCmd (ADC_TypeDef *ADCx, uint32_t ADC_AnalogWatchdog)
 Enables or disables the analog watchdog on single/all regular or injected channels.
void ADC_AnalogWatchdogSingleChannelConfig (ADC_TypeDef *ADCx, uint8_t ADC_Channel)
 Configures the analog watchdog guarded single channel.
void ADC_AnalogWatchdogThresholdsConfig (ADC_TypeDef *ADCx, uint16_t HighThreshold, uint16_t LowThreshold)
 Configures the high and low thresholds of the analog watchdog.
void ADC_AutoInjectedConvCmd (ADC_TypeDef *ADCx, FunctionalState NewState)
 Enables or disables the selected ADC automatic injected group conversion after regular one.
void ADC_ClearFlag (ADC_TypeDef *ADCx, uint8_t ADC_FLAG)
 Clears the ADCx's pending flags.
void ADC_ClearITPendingBit (ADC_TypeDef *ADCx, uint16_t ADC_IT)
 Clears the ADCx’s interrupt pending bits.
void ADC_Cmd (ADC_TypeDef *ADCx, FunctionalState NewState)
 Enables or disables the specified ADC peripheral.
void ADC_DeInit (ADC_TypeDef *ADCx)
 Deinitializes the ADCx peripheral registers to their default reset values.
void ADC_DiscModeChannelCountConfig (ADC_TypeDef *ADCx, uint8_t Number)
 Configures the discontinuous mode for the selected ADC regular group channel.
void ADC_DiscModeCmd (ADC_TypeDef *ADCx, FunctionalState NewState)
 Enables or disables the discontinuous mode on regular group channel for the specified ADC.
void ADC_DMACmd (ADC_TypeDef *ADCx, FunctionalState NewState)
 Enables or disables the specified ADC DMA request.
void ADC_ExternalTrigConvCmd (ADC_TypeDef *ADCx, FunctionalState NewState)
 Enables or disables the ADCx conversion through external trigger.
void ADC_ExternalTrigInjectedConvCmd (ADC_TypeDef *ADCx, FunctionalState NewState)
 Enables or disables the ADCx injected channels conversion through external trigger.
void ADC_ExternalTrigInjectedConvConfig (ADC_TypeDef *ADCx, uint32_t ADC_ExternalTrigInjecConv)
 Configures the ADCx external trigger for injected channels conversion.
FlagStatus ADC_GetCalibrationStatus (ADC_TypeDef *ADCx)
 Gets the selected ADC calibration status.
uint16_t ADC_GetConversionValue (ADC_TypeDef *ADCx)
 Returns the last ADCx conversion result data for regular channel.
uint32_t ADC_GetDualModeConversionValue (void)
 Returns the last ADC1 and ADC2 conversion result data in dual mode.
FlagStatus ADC_GetFlagStatus (ADC_TypeDef *ADCx, uint8_t ADC_FLAG)
 Checks whether the specified ADC flag is set or not.
uint16_t ADC_GetInjectedConversionValue (ADC_TypeDef *ADCx, uint8_t ADC_InjectedChannel)
 Returns the ADC injected channel conversion result.
ITStatus ADC_GetITStatus (ADC_TypeDef *ADCx, uint16_t ADC_IT)
 Checks whether the specified ADC interrupt has occurred or not.
FlagStatus ADC_GetResetCalibrationStatus (ADC_TypeDef *ADCx)
 Gets the selected ADC reset calibration registers status.
FlagStatus ADC_GetSoftwareStartConvStatus (ADC_TypeDef *ADCx)
 Gets the selected ADC Software start conversion Status.
FlagStatus ADC_GetSoftwareStartInjectedConvCmdStatus (ADC_TypeDef *ADCx)
 Gets the selected ADC Software start injected conversion Status.
void ADC_Init (ADC_TypeDef *ADCx, ADC_InitTypeDef *ADC_InitStruct)
 Initializes the ADCx peripheral according to the specified parameters in the ADC_InitStruct.
void ADC_InjectedChannelConfig (ADC_TypeDef *ADCx, uint8_t ADC_Channel, uint8_t Rank, uint8_t ADC_SampleTime)
 Configures for the selected ADC injected channel its corresponding rank in the sequencer and its sample time.
void ADC_InjectedDiscModeCmd (ADC_TypeDef *ADCx, FunctionalState NewState)
 Enables or disables the discontinuous mode for injected group channel for the specified ADC.
void ADC_InjectedSequencerLengthConfig (ADC_TypeDef *ADCx, uint8_t Length)
 Configures the sequencer length for injected channels.
void ADC_ITConfig (ADC_TypeDef *ADCx, uint16_t ADC_IT, FunctionalState NewState)
 Enables or disables the specified ADC interrupts.
void ADC_RegularChannelConfig (ADC_TypeDef *ADCx, uint8_t ADC_Channel, uint8_t Rank, uint8_t ADC_SampleTime)
 Configures for the selected ADC regular channel its corresponding rank in the sequencer and its sample time.
void ADC_ResetCalibration (ADC_TypeDef *ADCx)
 Resets the selected ADC calibration registers.
void ADC_SetInjectedOffset (ADC_TypeDef *ADCx, uint8_t ADC_InjectedChannel, uint16_t Offset)
 Set the injected channels conversion value offset.
void ADC_SoftwareStartConvCmd (ADC_TypeDef *ADCx, FunctionalState NewState)
 Enables or disables the selected ADC software start conversion .
void ADC_SoftwareStartInjectedConvCmd (ADC_TypeDef *ADCx, FunctionalState NewState)
 Enables or disables the selected ADC start of the injected channels conversion.
void ADC_StartCalibration (ADC_TypeDef *ADCx)
 Starts the selected ADC calibration process.
void ADC_StructInit (ADC_InitTypeDef *ADC_InitStruct)
 Fills each ADC_InitStruct member with its default value.
void ADC_TempSensorVrefintCmd (FunctionalState NewState)
 Enables or disables the temperature sensor and Vrefint channel.

Function Documentation

void ADC_AnalogWatchdogCmd ( ADC_TypeDef ADCx,
uint32_t  ADC_AnalogWatchdog 
)

Enables or disables the analog watchdog on single/all regular or injected channels.

Parameters:
ADCx,: where x can be 1, 2 or 3 to select the ADC peripheral.
ADC_AnalogWatchdog,: the ADC analog watchdog configuration. This parameter can be one of the following values:

  • ADC_AnalogWatchdog_SingleRegEnable: Analog watchdog on a single regular channel
  • ADC_AnalogWatchdog_SingleInjecEnable: Analog watchdog on a single injected channel
  • ADC_AnalogWatchdog_SingleRegOrInjecEnable: Analog watchdog on a single regular or injected channel
  • ADC_AnalogWatchdog_AllRegEnable: Analog watchdog on all regular channel
  • ADC_AnalogWatchdog_AllInjecEnable: Analog watchdog on all injected channel
  • ADC_AnalogWatchdog_AllRegAllInjecEnable: Analog watchdog on all regular and injected channels
  • ADC_AnalogWatchdog_None: No channel guarded by the analog watchdog
Return values:
None 

Definition at line 1081 of file stm32f10x_adc.c.

References assert_param, ADC_TypeDef::CR1, CR1_AWDMode_Reset, IS_ADC_ALL_PERIPH, and IS_ADC_ANALOG_WATCHDOG.

Referenced by main().

void ADC_AnalogWatchdogSingleChannelConfig ( ADC_TypeDef ADCx,
uint8_t  ADC_Channel 
)

Configures the analog watchdog guarded single channel.

Parameters:
ADCx,: where x can be 1, 2 or 3 to select the ADC peripheral.
ADC_Channel,: the ADC channel to configure for the analog watchdog. This parameter can be one of the following values:

  • ADC_Channel_0: ADC Channel0 selected
  • ADC_Channel_1: ADC Channel1 selected
  • ADC_Channel_2: ADC Channel2 selected
  • ADC_Channel_3: ADC Channel3 selected
  • ADC_Channel_4: ADC Channel4 selected
  • ADC_Channel_5: ADC Channel5 selected
  • ADC_Channel_6: ADC Channel6 selected
  • ADC_Channel_7: ADC Channel7 selected
  • ADC_Channel_8: ADC Channel8 selected
  • ADC_Channel_9: ADC Channel9 selected
  • ADC_Channel_10: ADC Channel10 selected
  • ADC_Channel_11: ADC Channel11 selected
  • ADC_Channel_12: ADC Channel12 selected
  • ADC_Channel_13: ADC Channel13 selected
  • ADC_Channel_14: ADC Channel14 selected
  • ADC_Channel_15: ADC Channel15 selected
  • ADC_Channel_16: ADC Channel16 selected
  • ADC_Channel_17: ADC Channel17 selected
Return values:
None 

Definition at line 1144 of file stm32f10x_adc.c.

References assert_param, ADC_TypeDef::CR1, CR1_AWDCH_Reset, IS_ADC_ALL_PERIPH, and IS_ADC_CHANNEL.

Referenced by main().

void ADC_AnalogWatchdogThresholdsConfig ( ADC_TypeDef ADCx,
uint16_t  HighThreshold,
uint16_t  LowThreshold 
)

Configures the high and low thresholds of the analog watchdog.

Parameters:
ADCx,: where x can be 1, 2 or 3 to select the ADC peripheral.
HighThreshold,: the ADC analog watchdog High threshold value. This parameter must be a 12bit value.
LowThreshold,: the ADC analog watchdog Low threshold value. This parameter must be a 12bit value.
Return values:
None 

Definition at line 1106 of file stm32f10x_adc.c.

References assert_param, ADC_TypeDef::HTR, IS_ADC_ALL_PERIPH, IS_ADC_THRESHOLD, and ADC_TypeDef::LTR.

Referenced by main().

void ADC_AutoInjectedConvCmd ( ADC_TypeDef ADCx,
FunctionalState  NewState 
)

Enables or disables the selected ADC automatic injected group conversion after regular one.

Parameters:
ADCx,: where x can be 1, 2 or 3 to select the ADC peripheral.
NewState,: new state of the selected ADC auto injected conversion This parameter can be: ENABLE or DISABLE.
Return values:
None 

Definition at line 733 of file stm32f10x_adc.c.

References assert_param, ADC_TypeDef::CR1, CR1_JAUTO_Reset, CR1_JAUTO_Set, DISABLE, IS_ADC_ALL_PERIPH, and IS_FUNCTIONAL_STATE.

Referenced by main().

void ADC_ClearFlag ( ADC_TypeDef ADCx,
uint8_t  ADC_FLAG 
)

Clears the ADCx's pending flags.

Parameters:
ADCx,: where x can be 1, 2 or 3 to select the ADC peripheral.
ADC_FLAG,: specifies the flag to clear. This parameter can be any combination of the following values:

  • ADC_FLAG_AWD: Analog watchdog flag
  • ADC_FLAG_EOC: End of conversion flag
  • ADC_FLAG_JEOC: End of injected group conversion flag
  • ADC_FLAG_JSTRT: Start of injected group conversion flag
  • ADC_FLAG_STRT: Start of regular group conversion flag
Return values:
None 

Definition at line 1227 of file stm32f10x_adc.c.

References assert_param, IS_ADC_ALL_PERIPH, IS_ADC_CLEAR_FLAG, and ADC_TypeDef::SR.

void ADC_ClearITPendingBit ( ADC_TypeDef ADCx,
uint16_t  ADC_IT 
)

Clears the ADCx’s interrupt pending bits.

Parameters:
ADCx,: where x can be 1, 2 or 3 to select the ADC peripheral.
ADC_IT,: specifies the ADC interrupt pending bit to clear. This parameter can be any combination of the following values:

  • ADC_IT_EOC: End of conversion interrupt mask
  • ADC_IT_AWD: Analog watchdog interrupt mask
  • ADC_IT_JEOC: End of injected conversion interrupt mask
Return values:
None 

Definition at line 1282 of file stm32f10x_adc.c.

References assert_param, IS_ADC_ALL_PERIPH, IS_ADC_IT, and ADC_TypeDef::SR.

Referenced by ADC1_2_IRQHandler().

void ADC_Cmd ( ADC_TypeDef ADCx,
FunctionalState  NewState 
)

Enables or disables the specified ADC peripheral.

Parameters:
ADCx,: where x can be 1, 2 or 3 to select the ADC peripheral.
NewState,: new state of the ADCx peripheral. This parameter can be: ENABLE or DISABLE.
Return values:
None 

Definition at line 298 of file stm32f10x_adc.c.

References assert_param, ADC_TypeDef::CR2, CR2_ADON_Reset, CR2_ADON_Set, DISABLE, IS_ADC_ALL_PERIPH, and IS_FUNCTIONAL_STATE.

Referenced by main().

void ADC_DeInit ( ADC_TypeDef ADCx  ) 

Deinitializes the ADCx peripheral registers to their default reset values.

Parameters:
ADCx,: where x can be 1, 2 or 3 to select the ADC peripheral.
Return values:
None 

Definition at line 178 of file stm32f10x_adc.c.

References ADC1, ADC2, ADC3, assert_param, DISABLE, ENABLE, IS_ADC_ALL_PERIPH, RCC_APB2Periph_ADC1, RCC_APB2Periph_ADC2, RCC_APB2Periph_ADC3, and RCC_APB2PeriphResetCmd().

void ADC_DiscModeChannelCountConfig ( ADC_TypeDef ADCx,
uint8_t  Number 
)

Configures the discontinuous mode for the selected ADC regular group channel.

Parameters:
ADCx,: where x can be 1, 2 or 3 to select the ADC peripheral.
Number,: specifies the discontinuous mode regular channel count value. This number must be between 1 and 8.
Return values:
None 

Definition at line 508 of file stm32f10x_adc.c.

References assert_param, ADC_TypeDef::CR1, CR1_DISCNUM_Reset, IS_ADC_ALL_PERIPH, and IS_ADC_REGULAR_DISC_NUMBER.

Referenced by main().

void ADC_DiscModeCmd ( ADC_TypeDef ADCx,
FunctionalState  NewState 
)

Enables or disables the discontinuous mode on regular group channel for the specified ADC.

Parameters:
ADCx,: where x can be 1, 2 or 3 to select the ADC peripheral.
NewState,: new state of the selected ADC discontinuous mode on regular group channel. This parameter can be: ENABLE or DISABLE.
Return values:
None 

Definition at line 535 of file stm32f10x_adc.c.

References assert_param, ADC_TypeDef::CR1, CR1_DISCEN_Reset, CR1_DISCEN_Set, DISABLE, IS_ADC_ALL_PERIPH, and IS_FUNCTIONAL_STATE.

Referenced by main().

void ADC_DMACmd ( ADC_TypeDef ADCx,
FunctionalState  NewState 
)

Enables or disables the specified ADC DMA request.

Parameters:
ADCx,: where x can be 1 or 3 to select the ADC peripheral. Note: ADC2 hasn't a DMA capability.
NewState,: new state of the selected ADC DMA transfer. This parameter can be: ENABLE or DISABLE.
Return values:
None 

Definition at line 323 of file stm32f10x_adc.c.

References assert_param, ADC_TypeDef::CR2, CR2_DMA_Reset, CR2_DMA_Set, DISABLE, IS_ADC_DMA_PERIPH, and IS_FUNCTIONAL_STATE.

Referenced by main().

void ADC_ExternalTrigConvCmd ( ADC_TypeDef ADCx,
FunctionalState  NewState 
)

Enables or disables the ADCx conversion through external trigger.

Parameters:
ADCx,: where x can be 1, 2 or 3 to select the ADC peripheral.
NewState,: new state of the selected ADC external trigger start of conversion. This parameter can be: ENABLE or DISABLE.
Return values:
None 

Definition at line 685 of file stm32f10x_adc.c.

References assert_param, ADC_TypeDef::CR2, CR2_EXTTRIG_Reset, CR2_EXTTRIG_Set, DISABLE, IS_ADC_ALL_PERIPH, and IS_FUNCTIONAL_STATE.

Referenced by main().

void ADC_ExternalTrigInjectedConvCmd ( ADC_TypeDef ADCx,
FunctionalState  NewState 
)

Enables or disables the ADCx injected channels conversion through external trigger.

Parameters:
ADCx,: where x can be 1, 2 or 3 to select the ADC peripheral.
NewState,: new state of the selected ADC external trigger start of injected conversion. This parameter can be: ENABLE or DISABLE.
Return values:
None 

Definition at line 823 of file stm32f10x_adc.c.

References assert_param, ADC_TypeDef::CR2, CR2_JEXTTRIG_Reset, CR2_JEXTTRIG_Set, DISABLE, IS_ADC_ALL_PERIPH, and IS_FUNCTIONAL_STATE.

Referenced by main().

void ADC_ExternalTrigInjectedConvConfig ( ADC_TypeDef ADCx,
uint32_t  ADC_ExternalTrigInjecConv 
)

Configures the ADCx external trigger for injected channels conversion.

Parameters:
ADCx,: where x can be 1, 2 or 3 to select the ADC peripheral.
ADC_ExternalTrigInjecConv,: specifies the ADC trigger to start injected conversion. This parameter can be one of the following values:

  • ADC_ExternalTrigInjecConv_T1_TRGO: Timer1 TRGO event selected (for ADC1, ADC2 and ADC3)
  • ADC_ExternalTrigInjecConv_T1_CC4: Timer1 capture compare4 selected (for ADC1, ADC2 and ADC3)
  • ADC_ExternalTrigInjecConv_T2_TRGO: Timer2 TRGO event selected (for ADC1 and ADC2)
  • ADC_ExternalTrigInjecConv_T2_CC1: Timer2 capture compare1 selected (for ADC1 and ADC2)
  • ADC_ExternalTrigInjecConv_T3_CC4: Timer3 capture compare4 selected (for ADC1 and ADC2)
  • ADC_ExternalTrigInjecConv_T4_TRGO: Timer4 TRGO event selected (for ADC1 and ADC2)
  • ADC_ExternalTrigInjecConv_Ext_IT15_TIM8_CC4: External interrupt line 15 or Timer8 capture compare4 event selected (for ADC1 and ADC2)
  • ADC_ExternalTrigInjecConv_T4_CC3: Timer4 capture compare3 selected (for ADC3 only)
  • ADC_ExternalTrigInjecConv_T8_CC2: Timer8 capture compare2 selected (for ADC3 only)
  • ADC_ExternalTrigInjecConv_T8_CC4: Timer8 capture compare4 selected (for ADC3 only)
  • ADC_ExternalTrigInjecConv_T5_TRGO: Timer5 TRGO event selected (for ADC3 only)
  • ADC_ExternalTrigInjecConv_T5_CC4: Timer5 capture compare4 selected (for ADC3 only)
  • ADC_ExternalTrigInjecConv_None: Injected conversion started by software and not by external trigger (for ADC1, ADC2 and ADC3)
Return values:
None 

Definition at line 798 of file stm32f10x_adc.c.

References assert_param, ADC_TypeDef::CR2, CR2_JEXTSEL_Reset, IS_ADC_ALL_PERIPH, and IS_ADC_EXT_INJEC_TRIG.

Referenced by main().

FlagStatus ADC_GetCalibrationStatus ( ADC_TypeDef ADCx  ) 

Gets the selected ADC calibration status.

Parameters:
ADCx,: where x can be 1, 2 or 3 to select the ADC peripheral.
Return values:
The new state of ADC calibration (SET or RESET).

Definition at line 429 of file stm32f10x_adc.c.

References assert_param, ADC_TypeDef::CR2, CR2_CAL_Set, IS_ADC_ALL_PERIPH, RESET, and SET.

Referenced by main().

uint16_t ADC_GetConversionValue ( ADC_TypeDef ADCx  ) 

Returns the last ADCx conversion result data for regular channel.

Parameters:
ADCx,: where x can be 1, 2 or 3 to select the ADC peripheral.
Return values:
The Data conversion value.

Definition at line 707 of file stm32f10x_adc.c.

References assert_param, ADC_TypeDef::DR, and IS_ADC_ALL_PERIPH.

Referenced by ADC1_2_IRQHandler().

uint32_t ADC_GetDualModeConversionValue ( void   ) 

Returns the last ADC1 and ADC2 conversion result data in dual mode.

Return values:
The Data conversion value.

Definition at line 719 of file stm32f10x_adc.c.

References DR_ADDRESS.

FlagStatus ADC_GetFlagStatus ( ADC_TypeDef ADCx,
uint8_t  ADC_FLAG 
)

Checks whether the specified ADC flag is set or not.

Parameters:
ADCx,: where x can be 1, 2 or 3 to select the ADC peripheral.
ADC_FLAG,: specifies the flag to check. This parameter can be one of the following values:

  • ADC_FLAG_AWD: Analog watchdog flag
  • ADC_FLAG_EOC: End of conversion flag
  • ADC_FLAG_JEOC: End of injected group conversion flag
  • ADC_FLAG_JSTRT: Start of injected group conversion flag
  • ADC_FLAG_STRT: Start of regular group conversion flag
Return values:
The new state of ADC_FLAG (SET or RESET).

Definition at line 1194 of file stm32f10x_adc.c.

References assert_param, IS_ADC_ALL_PERIPH, IS_ADC_GET_FLAG, RESET, SET, and ADC_TypeDef::SR.

uint16_t ADC_GetInjectedConversionValue ( ADC_TypeDef ADCx,
uint8_t  ADC_InjectedChannel 
)

Returns the ADC injected channel conversion result.

Parameters:
ADCx,: where x can be 1, 2 or 3 to select the ADC peripheral.
ADC_InjectedChannel,: the converted ADC injected channel. This parameter can be one of the following values:

  • ADC_InjectedChannel_1: Injected Channel1 selected
  • ADC_InjectedChannel_2: Injected Channel2 selected
  • ADC_InjectedChannel_3: Injected Channel3 selected
  • ADC_InjectedChannel_4: Injected Channel4 selected
Return values:
The Data conversion value.

Definition at line 1051 of file stm32f10x_adc.c.

References assert_param, IS_ADC_ALL_PERIPH, IS_ADC_INJECTED_CHANNEL, and JDR_Offset.

Referenced by ADC1_2_IRQHandler().

ITStatus ADC_GetITStatus ( ADC_TypeDef ADCx,
uint16_t  ADC_IT 
)

Checks whether the specified ADC interrupt has occurred or not.

Parameters:
ADCx,: where x can be 1, 2 or 3 to select the 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 mask
  • ADC_IT_AWD: Analog watchdog interrupt mask
  • ADC_IT_JEOC: End of injected conversion interrupt mask
Return values:
The new state of ADC_IT (SET or RESET).

Definition at line 1246 of file stm32f10x_adc.c.

References assert_param, ADC_TypeDef::CR1, IS_ADC_ALL_PERIPH, IS_ADC_GET_IT, RESET, SET, and ADC_TypeDef::SR.

FlagStatus ADC_GetResetCalibrationStatus ( ADC_TypeDef ADCx  ) 

Gets the selected ADC reset calibration registers status.

Parameters:
ADCx,: where x can be 1, 2 or 3 to select the ADC peripheral.
Return values:
The new state of ADC reset calibration registers (SET or RESET).

Definition at line 391 of file stm32f10x_adc.c.

References assert_param, ADC_TypeDef::CR2, CR2_RSTCAL_Set, IS_ADC_ALL_PERIPH, RESET, and SET.

Referenced by main().

FlagStatus ADC_GetSoftwareStartConvStatus ( ADC_TypeDef ADCx  ) 

Gets the selected ADC Software start conversion Status.

Parameters:
ADCx,: where x can be 1, 2 or 3 to select the ADC peripheral.
Return values:
The new state of ADC software start conversion (SET or RESET).

Definition at line 480 of file stm32f10x_adc.c.

References assert_param, ADC_TypeDef::CR2, CR2_SWSTART_Set, IS_ADC_ALL_PERIPH, RESET, and SET.

FlagStatus ADC_GetSoftwareStartInjectedConvCmdStatus ( ADC_TypeDef ADCx  ) 

Gets the selected ADC Software start injected conversion Status.

Parameters:
ADCx,: where x can be 1, 2 or 3 to select the ADC peripheral.
Return values:
The new state of ADC software start injected conversion (SET or RESET).

Definition at line 872 of file stm32f10x_adc.c.

References assert_param, ADC_TypeDef::CR2, CR2_JSWSTART_Set, IS_ADC_ALL_PERIPH, RESET, and SET.

void ADC_Init ( ADC_TypeDef ADCx,
ADC_InitTypeDef ADC_InitStruct 
)

Initializes the ADCx peripheral according to the specified parameters in the ADC_InitStruct.

Parameters:
ADCx,: where x can be 1, 2 or 3 to select the ADC peripheral.
ADC_InitStruct,: pointer to an ADC_InitTypeDef structure that contains the configuration information for the specified ADC peripheral.
Return values:
None 

Definition at line 217 of file stm32f10x_adc.c.

References ADC_InitTypeDef::ADC_ContinuousConvMode, ADC_InitTypeDef::ADC_DataAlign, ADC_InitTypeDef::ADC_ExternalTrigConv, ADC_InitTypeDef::ADC_Mode, ADC_InitTypeDef::ADC_NbrOfChannel, ADC_InitTypeDef::ADC_ScanConvMode, assert_param, ADC_TypeDef::CR1, CR1_CLEAR_Mask, ADC_TypeDef::CR2, CR2_CLEAR_Mask, IS_ADC_ALL_PERIPH, IS_ADC_DATA_ALIGN, IS_ADC_EXT_TRIG, IS_ADC_MODE, IS_ADC_REGULAR_LENGTH, IS_FUNCTIONAL_STATE, ADC_TypeDef::SQR1, and SQR1_CLEAR_Mask.

Referenced by main().

void ADC_InjectedChannelConfig ( ADC_TypeDef ADCx,
uint8_t  ADC_Channel,
uint8_t  Rank,
uint8_t  ADC_SampleTime 
)

Configures for the selected ADC injected channel its corresponding rank in the sequencer and its sample time.

Parameters:
ADCx,: where x can be 1, 2 or 3 to select the ADC peripheral.
ADC_Channel,: the ADC channel to configure. This parameter can be one of the following values:

  • ADC_Channel_0: ADC Channel0 selected
  • ADC_Channel_1: ADC Channel1 selected
  • ADC_Channel_2: ADC Channel2 selected
  • ADC_Channel_3: ADC Channel3 selected
  • ADC_Channel_4: ADC Channel4 selected
  • ADC_Channel_5: ADC Channel5 selected
  • ADC_Channel_6: ADC Channel6 selected
  • ADC_Channel_7: ADC Channel7 selected
  • ADC_Channel_8: ADC Channel8 selected
  • ADC_Channel_9: ADC Channel9 selected
  • ADC_Channel_10: ADC Channel10 selected
  • ADC_Channel_11: ADC Channel11 selected
  • ADC_Channel_12: ADC Channel12 selected
  • ADC_Channel_13: ADC Channel13 selected
  • ADC_Channel_14: ADC Channel14 selected
  • ADC_Channel_15: ADC Channel15 selected
  • ADC_Channel_16: ADC Channel16 selected
  • ADC_Channel_17: ADC Channel17 selected
Rank,: The rank in the injected group sequencer. This parameter must be between 1 and 4.
ADC_SampleTime,: The sample time value to be set for the selected channel. This parameter can be one of the following values:

  • ADC_SampleTime_1Cycles5: Sample time equal to 1.5 cycles
  • ADC_SampleTime_7Cycles5: Sample time equal to 7.5 cycles
  • ADC_SampleTime_13Cycles5: Sample time equal to 13.5 cycles
  • ADC_SampleTime_28Cycles5: Sample time equal to 28.5 cycles
  • ADC_SampleTime_41Cycles5: Sample time equal to 41.5 cycles
  • ADC_SampleTime_55Cycles5: Sample time equal to 55.5 cycles
  • ADC_SampleTime_71Cycles5: Sample time equal to 71.5 cycles
  • ADC_SampleTime_239Cycles5: Sample time equal to 239.5 cycles
Return values:
None 

Definition at line 929 of file stm32f10x_adc.c.

References ADC_Channel_9, assert_param, IS_ADC_ALL_PERIPH, IS_ADC_CHANNEL, IS_ADC_INJECTED_RANK, IS_ADC_SAMPLE_TIME, ADC_TypeDef::JSQR, JSQR_JL_Set, JSQR_JSQ_Set, ADC_TypeDef::SMPR1, SMPR1_SMP_Set, ADC_TypeDef::SMPR2, and SMPR2_SMP_Set.

Referenced by main().

void ADC_InjectedDiscModeCmd ( ADC_TypeDef ADCx,
FunctionalState  NewState 
)

Enables or disables the discontinuous mode for injected group channel for the specified ADC.

Parameters:
ADCx,: where x can be 1, 2 or 3 to select the ADC peripheral.
NewState,: new state of the selected ADC discontinuous mode on injected group channel. This parameter can be: ENABLE or DISABLE.
Return values:
None 

Definition at line 759 of file stm32f10x_adc.c.

References assert_param, ADC_TypeDef::CR1, CR1_JDISCEN_Reset, CR1_JDISCEN_Set, DISABLE, IS_ADC_ALL_PERIPH, and IS_FUNCTIONAL_STATE.

void ADC_InjectedSequencerLengthConfig ( ADC_TypeDef ADCx,
uint8_t  Length 
)

Configures the sequencer length for injected channels.

Parameters:
ADCx,: where x can be 1, 2 or 3 to select the ADC peripheral.
Length,: The sequencer length. This parameter must be a number between 1 to 4.
Return values:
None 

Definition at line 992 of file stm32f10x_adc.c.

References assert_param, IS_ADC_ALL_PERIPH, IS_ADC_INJECTED_LENGTH, ADC_TypeDef::JSQR, and JSQR_JL_Reset.

Referenced by main().

void ADC_ITConfig ( ADC_TypeDef ADCx,
uint16_t  ADC_IT,
FunctionalState  NewState 
)

Enables or disables the specified ADC interrupts.

Parameters:
ADCx,: where x can be 1, 2 or 3 to select the ADC peripheral.
ADC_IT,: specifies the ADC interrupt sources to be enabled or disabled. This parameter can be any combination of the following values:

  • ADC_IT_EOC: End of conversion interrupt mask
  • ADC_IT_AWD: Analog watchdog interrupt mask
  • ADC_IT_JEOC: End of injected conversion interrupt mask
NewState,: new state of the specified ADC interrupts. This parameter can be: ENABLE or DISABLE.
Return values:
None 

Definition at line 352 of file stm32f10x_adc.c.

References assert_param, ADC_TypeDef::CR1, DISABLE, IS_ADC_ALL_PERIPH, IS_ADC_IT, and IS_FUNCTIONAL_STATE.

Referenced by main().

void ADC_RegularChannelConfig ( ADC_TypeDef ADCx,
uint8_t  ADC_Channel,
uint8_t  Rank,
uint8_t  ADC_SampleTime 
)

Configures for the selected ADC regular channel its corresponding rank in the sequencer and its sample time.

Parameters:
ADCx,: where x can be 1, 2 or 3 to select the ADC peripheral.
ADC_Channel,: the ADC channel to configure. This parameter can be one of the following values:

  • ADC_Channel_0: ADC Channel0 selected
  • ADC_Channel_1: ADC Channel1 selected
  • ADC_Channel_2: ADC Channel2 selected
  • ADC_Channel_3: ADC Channel3 selected
  • ADC_Channel_4: ADC Channel4 selected
  • ADC_Channel_5: ADC Channel5 selected
  • ADC_Channel_6: ADC Channel6 selected
  • ADC_Channel_7: ADC Channel7 selected
  • ADC_Channel_8: ADC Channel8 selected
  • ADC_Channel_9: ADC Channel9 selected
  • ADC_Channel_10: ADC Channel10 selected
  • ADC_Channel_11: ADC Channel11 selected
  • ADC_Channel_12: ADC Channel12 selected
  • ADC_Channel_13: ADC Channel13 selected
  • ADC_Channel_14: ADC Channel14 selected
  • ADC_Channel_15: ADC Channel15 selected
  • ADC_Channel_16: ADC Channel16 selected
  • ADC_Channel_17: ADC Channel17 selected
Rank,: The rank in the regular group sequencer. This parameter must be between 1 to 16.
ADC_SampleTime,: The sample time value to be set for the selected channel. This parameter can be one of the following values:

  • ADC_SampleTime_1Cycles5: Sample time equal to 1.5 cycles
  • ADC_SampleTime_7Cycles5: Sample time equal to 7.5 cycles
  • ADC_SampleTime_13Cycles5: Sample time equal to 13.5 cycles
  • ADC_SampleTime_28Cycles5: Sample time equal to 28.5 cycles
  • ADC_SampleTime_41Cycles5: Sample time equal to 41.5 cycles
  • ADC_SampleTime_55Cycles5: Sample time equal to 55.5 cycles
  • ADC_SampleTime_71Cycles5: Sample time equal to 71.5 cycles
  • ADC_SampleTime_239Cycles5: Sample time equal to 239.5 cycles
Return values:
None 

Definition at line 589 of file stm32f10x_adc.c.

References ADC_Channel_9, assert_param, IS_ADC_ALL_PERIPH, IS_ADC_CHANNEL, IS_ADC_REGULAR_RANK, IS_ADC_SAMPLE_TIME, ADC_TypeDef::SMPR1, SMPR1_SMP_Set, ADC_TypeDef::SMPR2, SMPR2_SMP_Set, ADC_TypeDef::SQR1, SQR1_SQ_Set, ADC_TypeDef::SQR2, SQR2_SQ_Set, ADC_TypeDef::SQR3, and SQR3_SQ_Set.

Referenced by main().

void ADC_ResetCalibration ( ADC_TypeDef ADCx  ) 

Resets the selected ADC calibration registers.

Parameters:
ADCx,: where x can be 1, 2 or 3 to select the ADC peripheral.
Return values:
None 

Definition at line 378 of file stm32f10x_adc.c.

References assert_param, ADC_TypeDef::CR2, CR2_RSTCAL_Set, and IS_ADC_ALL_PERIPH.

Referenced by main().

void ADC_SetInjectedOffset ( ADC_TypeDef ADCx,
uint8_t  ADC_InjectedChannel,
uint16_t  Offset 
)

Set the injected channels conversion value offset.

Parameters:
ADCx,: where x can be 1, 2 or 3 to select the ADC peripheral.
ADC_InjectedChannel,: the ADC injected channel to set its offset. This parameter can be one of the following values:

  • ADC_InjectedChannel_1: Injected Channel1 selected
  • ADC_InjectedChannel_2: Injected Channel2 selected
  • ADC_InjectedChannel_3: Injected Channel3 selected
  • ADC_InjectedChannel_4: Injected Channel4 selected
Offset,: the offset value for the selected ADC injected channel This parameter must be a 12bit value.
Return values:
None 

Definition at line 1024 of file stm32f10x_adc.c.

References assert_param, IS_ADC_ALL_PERIPH, IS_ADC_INJECTED_CHANNEL, and IS_ADC_OFFSET.

void ADC_SoftwareStartConvCmd ( ADC_TypeDef ADCx,
FunctionalState  NewState 
)

Enables or disables the selected ADC software start conversion .

Parameters:
ADCx,: where x can be 1, 2 or 3 to select the ADC peripheral.
NewState,: new state of the selected ADC software start conversion. This parameter can be: ENABLE or DISABLE.
Return values:
None 

Definition at line 456 of file stm32f10x_adc.c.

References assert_param, ADC_TypeDef::CR2, CR2_EXTTRIG_SWSTART_Reset, CR2_EXTTRIG_SWSTART_Set, DISABLE, IS_ADC_ALL_PERIPH, and IS_FUNCTIONAL_STATE.

Referenced by main().

void ADC_SoftwareStartInjectedConvCmd ( ADC_TypeDef ADCx,
FunctionalState  NewState 
)

Enables or disables the selected ADC start of the injected channels conversion.

Parameters:
ADCx,: where x can be 1, 2 or 3 to select the ADC peripheral.
NewState,: new state of the selected ADC software start injected conversion. This parameter can be: ENABLE or DISABLE.
Return values:
None 

Definition at line 848 of file stm32f10x_adc.c.

References assert_param, ADC_TypeDef::CR2, CR2_JEXTTRIG_JSWSTART_Reset, CR2_JEXTTRIG_JSWSTART_Set, DISABLE, IS_ADC_ALL_PERIPH, and IS_FUNCTIONAL_STATE.

void ADC_StartCalibration ( ADC_TypeDef ADCx  ) 

Starts the selected ADC calibration process.

Parameters:
ADCx,: where x can be 1, 2 or 3 to select the ADC peripheral.
Return values:
None 

Definition at line 416 of file stm32f10x_adc.c.

References assert_param, ADC_TypeDef::CR2, CR2_CAL_Set, and IS_ADC_ALL_PERIPH.

Referenced by main().

void ADC_StructInit ( ADC_InitTypeDef ADC_InitStruct  ) 

Fills each ADC_InitStruct member with its default value.

Parameters:
ADC_InitStruct : pointer to an ADC_InitTypeDef structure which will be initialized.
Return values:
None 

Definition at line 274 of file stm32f10x_adc.c.

References ADC_InitTypeDef::ADC_ContinuousConvMode, ADC_InitTypeDef::ADC_DataAlign, ADC_DataAlign_Right, ADC_InitTypeDef::ADC_ExternalTrigConv, ADC_ExternalTrigConv_T1_CC1, ADC_InitTypeDef::ADC_Mode, ADC_Mode_Independent, ADC_InitTypeDef::ADC_NbrOfChannel, ADC_InitTypeDef::ADC_ScanConvMode, and DISABLE.

void ADC_TempSensorVrefintCmd ( FunctionalState  NewState  ) 

Enables or disables the temperature sensor and Vrefint channel.

Parameters:
NewState,: new state of the temperature sensor. This parameter can be: ENABLE or DISABLE.
Return values:
None 

Definition at line 1166 of file stm32f10x_adc.c.

References ADC1, assert_param, CR2_TSVREFE_Reset, CR2_TSVREFE_Set, DISABLE, and IS_FUNCTIONAL_STATE.

Referenced by main().

STM32F10x Standard Peripherals Library: Footer

 

 

 

      For complete documentation on STM32(CORTEX M3) 32-bit Microcontrollers platform visit  www.st.com/STM32