STM32F37 Standard Peripheral bibliotheek  1.0
ST Microelectronics bibliotheek documentatie voor de STM32F37 Standard Peripheral Library
 All Data Structures Files Functions Variables Enumerations Enumerator Groups
Regular Channels Configuration functions

Regular Channels Configuration functions. More...

Functions

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. More...
 
void ADC_ExternalTrigConvCmd (ADC_TypeDef *ADCx, FunctionalState NewState)
 Enables or disables the ADCx conversion through external trigger. More...
 
void ADC_SoftwareStartConv (ADC_TypeDef *ADCx)
 Enables or disables the selected ADC software start conversion . More...
 
FlagStatus ADC_GetSoftwareStartConvStatus (ADC_TypeDef *ADCx)
 Gets the selected ADC Software start conversion Status. More...
 
void ADC_ContinuousModeCmd (ADC_TypeDef *ADCx, FunctionalState NewState)
 Enables or disables the ADC continuous conversion mode. More...
 
void ADC_DiscModeChannelCountConfig (ADC_TypeDef *ADCx, uint8_t Number)
 Configures the discontinuous mode for the selected ADC regular group channel. More...
 
void ADC_DiscModeCmd (ADC_TypeDef *ADCx, FunctionalState NewState)
 Enables or disables the discontinuous mode on regular group channel for the specified ADC. More...
 
uint16_t ADC_GetConversionValue (ADC_TypeDef *ADCx)
 Returns the last ADCx conversion result data for regular channel. More...
 

Detailed Description

Regular Channels Configuration functions.

 ===============================================================================
            ##### Regular Channels Configuration functions  #####
 ===============================================================================  

    [..] This section provides functions allowing to manage the ADC regular channels,
         it is composed of 2 sub sections : 
  
         (#) Configuration and management functions for regular channels: This subsection 
             provides functions allowing to configure the ADC regular channels :    
             (++) Configure the rank in the regular group sequencer for each channel
             (++) Configure the sampling time for each channel
             (++) select the conversion Trigger for regular channels
             (++) select the desired EOC event behavior configuration
             (++) Activate the continuous Mode  (*)
             (++) Activate the Discontinuous Mode 
             -@@- Please Note that the following features for regular channels
                  are configured using the ADC_Init() function :
                  (+@@) scan mode activation 
                  (+@@) continuous mode activation (**) 
                  (+@@) External trigger source  
                  (+@@) External trigger edge 
                  (+@@) number of conversion in the regular channels group sequencer.
     
             -@@- (*) and (**) are performing the same configuration
     
         (#) Get the conversion data: This subsection provides an important function in 
             the ADC peripheral since it returns the converted data of the current 
             regular channel. When the Conversion value is read, the EOC Flag is 
             automatically cleared.

Function Documentation

void ADC_ContinuousModeCmd ( ADC_TypeDef *  ADCx,
FunctionalState  NewState 
)

Enables or disables the ADC continuous conversion mode.

Parameters
ADCx,:where x can be 1 to select the ADC peripheral.
NewState,:new state of the selected ADC continuous conversion mode This parameter can be: ENABLE or DISABLE.
Return values
None
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 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
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 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
void ADC_ExternalTrigConvCmd ( ADC_TypeDef *  ADCx,
FunctionalState  NewState 
)

Enables or disables the ADCx conversion through external trigger.

Parameters
ADCx,:where x can be 1 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
uint16_t ADC_GetConversionValue ( ADC_TypeDef *  ADCx)

Returns the last ADCx conversion result data for regular channel.

Parameters
ADCx,:where x can be 1 to select the ADC peripheral.
Return values
TheData conversion value.
FlagStatus ADC_GetSoftwareStartConvStatus ( ADC_TypeDef *  ADCx)

Gets the selected ADC Software start conversion Status.

Parameters
ADCx,:where x can be 1 to select the ADC peripheral.
Return values
Thenew state of ADC software start conversion (SET or RESET).
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 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
void ADC_SoftwareStartConv ( ADC_TypeDef *  ADCx)

Enables or disables the selected ADC software start conversion .

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