CARME-M4 BSP  V1.5

ADC driver modules. More...

+ Collaboration diagram for ADC:

Modules

 ADC_Exported_Constants
 
 ADC_Private_Functions
 

Data Structures

struct  ADC_InitTypeDef
 ADC Init structure definition. More...
 
struct  ADC_CommonInitTypeDef
 ADC Common Init structure definition. More...
 

Macros

#define CR1_DISCNUM_RESET   ((uint32_t)0xFFFF1FFF)
 
#define CR1_AWDCH_RESET   ((uint32_t)0xFFFFFFE0)
 
#define CR1_AWDMode_RESET   ((uint32_t)0xFF3FFDFF)
 
#define CR1_CLEAR_MASK   ((uint32_t)0xFCFFFEFF)
 
#define CR2_EXTEN_RESET   ((uint32_t)0xCFFFFFFF)
 
#define CR2_JEXTEN_RESET   ((uint32_t)0xFFCFFFFF)
 
#define CR2_JEXTSEL_RESET   ((uint32_t)0xFFF0FFFF)
 
#define CR2_CLEAR_MASK   ((uint32_t)0xC0FFF7FD)
 
#define SQR3_SQ_SET   ((uint32_t)0x0000001F)
 
#define SQR2_SQ_SET   ((uint32_t)0x0000001F)
 
#define SQR1_SQ_SET   ((uint32_t)0x0000001F)
 
#define SQR1_L_RESET   ((uint32_t)0xFF0FFFFF)
 
#define JSQR_JSQ_SET   ((uint32_t)0x0000001F)
 
#define JSQR_JL_SET   ((uint32_t)0x00300000)
 
#define JSQR_JL_RESET   ((uint32_t)0xFFCFFFFF)
 
#define SMPR1_SMP_SET   ((uint32_t)0x00000007)
 
#define SMPR2_SMP_SET   ((uint32_t)0x00000007)
 
#define JDR_OFFSET   ((uint8_t)0x28)
 
#define CDR_ADDRESS   ((uint32_t)0x40012308)
 
#define CR_CLEAR_MASK   ((uint32_t)0xFFFC30E0)
 

Functions

void ADC_DeInit (void)
 Deinitializes all ADCs peripherals registers to their default reset values. More...
 
void ADC_Init (ADC_TypeDef *ADCx, ADC_InitTypeDef *ADC_InitStruct)
 Initializes the ADCx peripheral according to the specified parameters in the ADC_InitStruct. More...
 
void ADC_StructInit (ADC_InitTypeDef *ADC_InitStruct)
 Fills each ADC_InitStruct member with its default value. More...
 
void ADC_CommonInit (ADC_CommonInitTypeDef *ADC_CommonInitStruct)
 Initializes the ADCs peripherals according to the specified parameters in the ADC_CommonInitStruct. More...
 
void ADC_CommonStructInit (ADC_CommonInitTypeDef *ADC_CommonInitStruct)
 Fills each ADC_CommonInitStruct member with its default value. More...
 
void ADC_Cmd (ADC_TypeDef *ADCx, FunctionalState NewState)
 Enables or disables the specified ADC peripheral. More...
 
void ADC_AnalogWatchdogCmd (ADC_TypeDef *ADCx, uint32_t ADC_AnalogWatchdog)
 Enables or disables the analog watchdog on single/all regular or injected channels. More...
 
void ADC_AnalogWatchdogThresholdsConfig (ADC_TypeDef *ADCx, uint16_t HighThreshold, uint16_t LowThreshold)
 Configures the high and low thresholds of the analog watchdog. More...
 
void ADC_AnalogWatchdogSingleChannelConfig (ADC_TypeDef *ADCx, uint8_t ADC_Channel)
 Configures the analog watchdog guarded single channel. More...
 
void ADC_TempSensorVrefintCmd (FunctionalState NewState)
 Enables or disables the temperature sensor and Vrefint channels. More...
 
void ADC_VBATCmd (FunctionalState NewState)
 Enables or disables the VBAT (Voltage Battery) channel. More...
 
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_SoftwareStartConv (ADC_TypeDef *ADCx)
 Enables the selected ADC software start conversion of the regular channels. More...
 
FlagStatus ADC_GetSoftwareStartConvStatus (ADC_TypeDef *ADCx)
 Gets the selected ADC Software start regular conversion Status. More...
 
void ADC_EOCOnEachRegularChannelCmd (ADC_TypeDef *ADCx, FunctionalState NewState)
 Enables or disables the EOC on each regular channel conversion. 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...
 
uint32_t ADC_GetMultiModeConversionValue (void)
 Returns the last ADC1, ADC2 and ADC3 regular conversions results data in the selected multi mode. More...
 
void ADC_DMACmd (ADC_TypeDef *ADCx, FunctionalState NewState)
 Enables or disables the specified ADC DMA request. More...
 
void ADC_DMARequestAfterLastTransferCmd (ADC_TypeDef *ADCx, FunctionalState NewState)
 Enables or disables the ADC DMA request after last transfer (Single-ADC mode) More...
 
void ADC_MultiModeDMARequestAfterLastTransferCmd (FunctionalState NewState)
 Enables or disables the ADC DMA request after last transfer in multi ADC mode. More...
 
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. More...
 
void ADC_InjectedSequencerLengthConfig (ADC_TypeDef *ADCx, uint8_t Length)
 Configures the sequencer length for injected channels. More...
 
void ADC_SetInjectedOffset (ADC_TypeDef *ADCx, uint8_t ADC_InjectedChannel, uint16_t Offset)
 Set the injected channels conversion value offset. More...
 
void ADC_ExternalTrigInjectedConvConfig (ADC_TypeDef *ADCx, uint32_t ADC_ExternalTrigInjecConv)
 Configures the ADCx external trigger for injected channels conversion. More...
 
void ADC_ExternalTrigInjectedConvEdgeConfig (ADC_TypeDef *ADCx, uint32_t ADC_ExternalTrigInjecConvEdge)
 Configures the ADCx external trigger edge for injected channels conversion. More...
 
void ADC_SoftwareStartInjectedConv (ADC_TypeDef *ADCx)
 Enables the selected ADC software start conversion of the injected channels. More...
 
FlagStatus ADC_GetSoftwareStartInjectedConvCmdStatus (ADC_TypeDef *ADCx)
 Gets the selected ADC Software start injected conversion Status. More...
 
void ADC_AutoInjectedConvCmd (ADC_TypeDef *ADCx, FunctionalState NewState)
 Enables or disables the selected ADC automatic injected group conversion after regular one. More...
 
void ADC_InjectedDiscModeCmd (ADC_TypeDef *ADCx, FunctionalState NewState)
 Enables or disables the discontinuous mode for injected group channel for the specified ADC. More...
 
uint16_t ADC_GetInjectedConversionValue (ADC_TypeDef *ADCx, uint8_t ADC_InjectedChannel)
 Returns the ADC injected channel conversion result. More...
 
void ADC_ITConfig (ADC_TypeDef *ADCx, uint16_t ADC_IT, FunctionalState NewState)
 Enables or disables the specified ADC interrupts. More...
 
FlagStatus ADC_GetFlagStatus (ADC_TypeDef *ADCx, uint8_t ADC_FLAG)
 Checks whether the specified ADC flag is set or not. More...
 
void ADC_ClearFlag (ADC_TypeDef *ADCx, uint8_t ADC_FLAG)
 Clears the ADCx's pending flags. More...
 
ITStatus ADC_GetITStatus (ADC_TypeDef *ADCx, uint16_t ADC_IT)
 Checks whether the specified ADC interrupt has occurred or not. More...
 
void ADC_ClearITPendingBit (ADC_TypeDef *ADCx, uint16_t ADC_IT)
 Clears the ADCx's interrupt pending bits. More...
 

Detailed Description

ADC driver modules.

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
ADCxwhere x can be 1, 2 or 3 to select the ADC peripheral.
ADC_AnalogWatchdogthe 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 455 of file stm32f4xx_adc.c.

void ADC_AnalogWatchdogSingleChannelConfig ( ADC_TypeDef *  ADCx,
uint8_t  ADC_Channel 
)

Configures the analog watchdog guarded single channel.

Parameters
ADCxwhere x can be 1, 2 or 3 to select the ADC peripheral.
ADC_Channelthe 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
  • ADC_Channel_18: ADC Channel18 selected
Return values
None

Definition at line 525 of file stm32f4xx_adc.c.

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, 2 or 3 to select the ADC peripheral.
HighThresholdthe ADC analog watchdog High threshold value. This parameter must be a 12-bit value.
LowThresholdthe ADC analog watchdog Low threshold value. This parameter must be a 12-bit value.
Return values
None

Definition at line 484 of file stm32f4xx_adc.c.

void ADC_AutoInjectedConvCmd ( ADC_TypeDef *  ADCx,
FunctionalState  NewState 
)

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

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

Definition at line 1423 of file stm32f4xx_adc.c.

void ADC_ClearFlag ( ADC_TypeDef *  ADCx,
uint8_t  ADC_FLAG 
)

Clears the ADCx's pending flags.

Parameters
ADCxwhere x can be 1, 2 or 3 to select the ADC peripheral.
ADC_FLAGspecifies 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
  • ADC_FLAG_OVR: Overrun flag
Return values
None

Definition at line 1656 of file stm32f4xx_adc.c.

void ADC_ClearITPendingBit ( ADC_TypeDef *  ADCx,
uint16_t  ADC_IT 
)

Clears the ADCx's interrupt pending bits.

Parameters
ADCxwhere x can be 1, 2 or 3 to select the ADC peripheral.
ADC_ITspecifies the ADC interrupt pending bit to clear. 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
  • ADC_IT_OVR: Overrun interrupt mask
Return values
None

Definition at line 1718 of file stm32f4xx_adc.c.

void ADC_Cmd ( ADC_TypeDef *  ADCx,
FunctionalState  NewState 
)

Enables or disables the specified ADC peripheral.

Parameters
ADCxwhere x can be 1, 2 or 3 to select the ADC peripheral.
NewStatenew state of the ADCx peripheral. This parameter can be: ENABLE or DISABLE.
Return values
None
Examples:
dma.c.

Definition at line 399 of file stm32f4xx_adc.c.

+ Here is the caller graph for this function:

void ADC_CommonInit ( ADC_CommonInitTypeDef ADC_CommonInitStruct)

Initializes the ADCs peripherals according to the specified parameters in the ADC_CommonInitStruct.

Parameters
ADC_CommonInitStructpointer to an ADC_CommonInitTypeDef structure that contains the configuration information for All ADCs peripherals.
Return values
None

Definition at line 341 of file stm32f4xx_adc.c.

+ Here is the caller graph for this function:

void ADC_CommonStructInit ( ADC_CommonInitTypeDef ADC_CommonInitStruct)

Fills each ADC_CommonInitStruct member with its default value.

Parameters
ADC_CommonInitStructpointer to an ADC_CommonInitTypeDef structure which will be initialized.
Return values
None

Definition at line 377 of file stm32f4xx_adc.c.

void ADC_ContinuousModeCmd ( ADC_TypeDef *  ADCx,
FunctionalState  NewState 
)

Enables or disables the ADC continuous conversion mode.

Parameters
ADCxwhere x can be 1, 2 or 3 to select the ADC peripheral.
NewStatenew state of the selected ADC continuous conversion mode This parameter can be: ENABLE or DISABLE.
Return values
None

Definition at line 904 of file stm32f4xx_adc.c.

void ADC_DeInit ( void  )

Deinitializes all ADCs peripherals registers to their default reset values.

Parameters
None
Return values
None

Definition at line 213 of file stm32f4xx_adc.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ADC_DiscModeChannelCountConfig ( ADC_TypeDef *  ADCx,
uint8_t  Number 
)

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

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

Definition at line 930 of file stm32f4xx_adc.c.

void ADC_DiscModeCmd ( ADC_TypeDef *  ADCx,
FunctionalState  NewState 
)

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

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

Definition at line 962 of file stm32f4xx_adc.c.

void ADC_DMACmd ( ADC_TypeDef *  ADCx,
FunctionalState  NewState 
)

Enables or disables the specified ADC DMA request.

Parameters
ADCxwhere x can be 1, 2 or 3 to select the ADC peripheral.
NewStatenew state of the selected ADC DMA transfer. This parameter can be: ENABLE or DISABLE.
Return values
None
Examples:
dma.c.

Definition at line 1052 of file stm32f4xx_adc.c.

void ADC_DMARequestAfterLastTransferCmd ( ADC_TypeDef *  ADCx,
FunctionalState  NewState 
)

Enables or disables the ADC DMA request after last transfer (Single-ADC mode)

Parameters
ADCxwhere x can be 1, 2 or 3 to select the ADC peripheral.
NewStatenew state of the selected ADC DMA request after last transfer. This parameter can be: ENABLE or DISABLE.
Return values
None
Examples:
dma.c.

Definition at line 1076 of file stm32f4xx_adc.c.

void ADC_EOCOnEachRegularChannelCmd ( ADC_TypeDef *  ADCx,
FunctionalState  NewState 
)

Enables or disables the EOC on each regular channel conversion.

Parameters
ADCxwhere x can be 1, 2 or 3 to select the ADC peripheral.
NewStatenew state of the selected ADC EOC flag rising This parameter can be: ENABLE or DISABLE.
Return values
None

Definition at line 879 of file stm32f4xx_adc.c.

void ADC_ExternalTrigInjectedConvConfig ( ADC_TypeDef *  ADCx,
uint32_t  ADC_ExternalTrigInjecConv 
)

Configures the ADCx external trigger for injected channels conversion.

Parameters
ADCxwhere x can be 1, 2 or 3 to select the ADC peripheral.
ADC_ExternalTrigInjecConvspecifies the ADC trigger to start injected conversion. This parameter can be one of the following values:
  • ADC_ExternalTrigInjecConv_T1_CC4: Timer1 capture compare4 selected
  • ADC_ExternalTrigInjecConv_T1_TRGO: Timer1 TRGO event selected
  • ADC_ExternalTrigInjecConv_T2_CC1: Timer2 capture compare1 selected
  • ADC_ExternalTrigInjecConv_T2_TRGO: Timer2 TRGO event selected
  • ADC_ExternalTrigInjecConv_T3_CC2: Timer3 capture compare2 selected
  • ADC_ExternalTrigInjecConv_T3_CC4: Timer3 capture compare4 selected
  • ADC_ExternalTrigInjecConv_T4_CC1: Timer4 capture compare1 selected
  • ADC_ExternalTrigInjecConv_T4_CC2: Timer4 capture compare2 selected
  • ADC_ExternalTrigInjecConv_T4_CC3: Timer4 capture compare3 selected
  • ADC_ExternalTrigInjecConv_T4_TRGO: Timer4 TRGO event selected
  • ADC_ExternalTrigInjecConv_T5_CC4: Timer5 capture compare4 selected
  • ADC_ExternalTrigInjecConv_T5_TRGO: Timer5 TRGO event selected
  • ADC_ExternalTrigInjecConv_T8_CC2: Timer8 capture compare2 selected
  • ADC_ExternalTrigInjecConv_T8_CC3: Timer8 capture compare3 selected
  • ADC_ExternalTrigInjecConv_T8_CC4: Timer8 capture compare4 selected
  • ADC_ExternalTrigInjecConv_Ext_IT15: External interrupt line 15 event selected
Return values
None

Definition at line 1326 of file stm32f4xx_adc.c.

void ADC_ExternalTrigInjectedConvEdgeConfig ( ADC_TypeDef *  ADCx,
uint32_t  ADC_ExternalTrigInjecConvEdge 
)

Configures the ADCx external trigger edge for injected channels conversion.

Parameters
ADCxwhere x can be 1, 2 or 3 to select the ADC peripheral.
ADC_ExternalTrigInjecConvEdgespecifies the ADC external trigger edge to start injected conversion. This parameter can be one of the following values:
  • ADC_ExternalTrigInjecConvEdge_None: external trigger disabled for injected conversion
  • ADC_ExternalTrigInjecConvEdge_Rising: detection on rising edge
  • ADC_ExternalTrigInjecConvEdge_Falling: detection on falling edge
  • ADC_ExternalTrigInjecConvEdge_RisingFalling: detection on both rising and falling edge
Return values
None

Definition at line 1360 of file stm32f4xx_adc.c.

uint16_t ADC_GetConversionValue ( ADC_TypeDef *  ADCx)

Returns the last ADCx conversion result data for regular channel.

Parameters
ADCxwhere x can be 1, 2 or 3 to select the ADC peripheral.
Return values
TheData conversion value.

Definition at line 985 of file stm32f4xx_adc.c.

+ Here is the caller graph for this function:

FlagStatus ADC_GetFlagStatus ( ADC_TypeDef *  ADCx,
uint8_t  ADC_FLAG 
)

Checks whether the specified ADC flag is set or not.

Parameters
ADCxwhere x can be 1, 2 or 3 to select the ADC peripheral.
ADC_FLAGspecifies 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
  • ADC_FLAG_OVR: Overrun flag
Return values
Thenew state of ADC_FLAG (SET or RESET).

Definition at line 1621 of file stm32f4xx_adc.c.

+ Here is the caller graph for this function:

uint16_t ADC_GetInjectedConversionValue ( ADC_TypeDef *  ADCx,
uint8_t  ADC_InjectedChannel 
)

Returns the ADC injected channel conversion result.

Parameters
ADCxwhere x can be 1, 2 or 3 to select the ADC peripheral.
ADC_InjectedChannelthe 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
TheData conversion value.

Definition at line 1477 of file stm32f4xx_adc.c.

ITStatus ADC_GetITStatus ( ADC_TypeDef *  ADCx,
uint16_t  ADC_IT 
)

Checks whether the specified ADC interrupt has occurred or not.

Parameters
ADCxwhere x can be 1, 2 or 3 to select the ADC peripheral.
ADC_ITspecifies 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
  • ADC_IT_OVR: Overrun interrupt mask
Return values
Thenew state of ADC_IT (SET or RESET).

Definition at line 1677 of file stm32f4xx_adc.c.

uint32_t ADC_GetMultiModeConversionValue ( void  )

Returns the last ADC1, ADC2 and ADC3 regular conversions results data in the selected multi mode.

Parameters
None
Return values
TheData conversion value.
Note
In dual mode, the value returned by this function is as following Data[15:0] : these bits contain the regular data of ADC1. Data[31:16]: these bits contain the regular data of ADC2.
In triple mode, the value returned by this function is as following Data[15:0] : these bits contain alternatively the regular data of ADC1, ADC3 and ADC2. Data[31:16]: these bits contain alternatively the regular data of ADC2, ADC1 and ADC3.

Definition at line 1006 of file stm32f4xx_adc.c.

FlagStatus ADC_GetSoftwareStartConvStatus ( ADC_TypeDef *  ADCx)

Gets the selected ADC Software start regular conversion Status.

Parameters
ADCxwhere x can be 1, 2 or 3 to select the ADC peripheral.
Return values
Thenew state of ADC software start conversion (SET or RESET).

Definition at line 849 of file stm32f4xx_adc.c.

FlagStatus ADC_GetSoftwareStartInjectedConvCmdStatus ( ADC_TypeDef *  ADCx)

Gets the selected ADC Software start injected conversion Status.

Parameters
ADCxwhere x can be 1, 2 or 3 to select the ADC peripheral.
Return values
Thenew state of ADC software start injected conversion (SET or RESET).

Definition at line 1394 of file stm32f4xx_adc.c.

void ADC_Init ( ADC_TypeDef *  ADCx,
ADC_InitTypeDef ADC_InitStruct 
)

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

Note
This function is used to configure the global features of the ADC ( Resolution and Data Alignment), however, the rest of the configuration parameters are specific to the regular channels group (scan mode activation, continuous mode activation, External trigger source and edge, number of conversion in the regular channels group sequencer).
Parameters
ADCxwhere x can be 1, 2 or 3 to select the ADC peripheral.
ADC_InitStructpointer to an ADC_InitTypeDef structure that contains the configuration information for the specified ADC peripheral.
Return values
None
Examples:
dma.c.

Definition at line 235 of file stm32f4xx_adc.c.

+ Here is the caller graph for this function:

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
ADCxwhere x can be 1, 2 or 3 to select the ADC peripheral.
ADC_Channelthe 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
  • ADC_Channel_18: ADC Channel18 selected
RankThe rank in the injected group sequencer. This parameter must be between 1 to 4.
ADC_SampleTimeThe sample time value to be set for the selected channel. This parameter can be one of the following values:
  • ADC_SampleTime_3Cycles: Sample time equal to 3 cycles
  • ADC_SampleTime_15Cycles: Sample time equal to 15 cycles
  • ADC_SampleTime_28Cycles: Sample time equal to 28 cycles
  • ADC_SampleTime_56Cycles: Sample time equal to 56 cycles
  • ADC_SampleTime_84Cycles: Sample time equal to 84 cycles
  • ADC_SampleTime_112Cycles: Sample time equal to 112 cycles
  • ADC_SampleTime_144Cycles: Sample time equal to 144 cycles
  • ADC_SampleTime_480Cycles: Sample time equal to 480 cycles
Return values
None

Definition at line 1190 of file stm32f4xx_adc.c.

void ADC_InjectedDiscModeCmd ( ADC_TypeDef *  ADCx,
FunctionalState  NewState 
)

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

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

Definition at line 1449 of file stm32f4xx_adc.c.

void ADC_InjectedSequencerLengthConfig ( ADC_TypeDef *  ADCx,
uint8_t  Length 
)

Configures the sequencer length for injected channels.

Parameters
ADCxwhere x can be 1, 2 or 3 to select the ADC peripheral.
LengthThe sequencer length. This parameter must be a number between 1 to 4.
Return values
None

Definition at line 1253 of file stm32f4xx_adc.c.

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

Enables or disables the specified ADC interrupts.

Parameters
ADCxwhere x can be 1, 2 or 3 to select the ADC peripheral.
ADC_ITspecifies 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 mask
  • ADC_IT_AWD: Analog watchdog interrupt mask
  • ADC_IT_JEOC: End of injected conversion interrupt mask
  • ADC_IT_OVR: Overrun interrupt enable
NewStatenew state of the specified ADC interrupts. This parameter can be: ENABLE or DISABLE.
Return values
None

Definition at line 1584 of file stm32f4xx_adc.c.

void ADC_MultiModeDMARequestAfterLastTransferCmd ( FunctionalState  NewState)

Enables or disables the ADC DMA request after last transfer in multi ADC mode.

Parameters
NewStatenew state of the selected ADC DMA request after last transfer. This parameter can be: ENABLE or DISABLE.
Note
if Enabled, DMA requests are issued as long as data are converted and DMA mode for multi ADC mode (selected using ADC_CommonInit() function by ADC_CommonInitStruct.ADC_DMAAccessMode structure member) is ADC_DMAAccessMode_1, ADC_DMAAccessMode_2 or ADC_DMAAccessMode_3.
Return values
None

Definition at line 1103 of file stm32f4xx_adc.c.

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
ADCxwhere x can be 1, 2 or 3 to select the ADC peripheral.
ADC_Channelthe 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
  • ADC_Channel_18: ADC Channel18 selected
RankThe rank in the regular group sequencer. This parameter must be between 1 to 16.
ADC_SampleTimeThe sample time value to be set for the selected channel. This parameter can be one of the following values:
  • ADC_SampleTime_3Cycles: Sample time equal to 3 cycles
  • ADC_SampleTime_15Cycles: Sample time equal to 15 cycles
  • ADC_SampleTime_28Cycles: Sample time equal to 28 cycles
  • ADC_SampleTime_56Cycles: Sample time equal to 56 cycles
  • ADC_SampleTime_84Cycles: Sample time equal to 84 cycles
  • ADC_SampleTime_112Cycles: Sample time equal to 112 cycles
  • ADC_SampleTime_144Cycles: Sample time equal to 144 cycles
  • ADC_SampleTime_480Cycles: Sample time equal to 480 cycles
Return values
None
Examples:
dma.c.

Definition at line 715 of file stm32f4xx_adc.c.

+ Here is the caller graph for this function:

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

Set the injected channels conversion value offset.

Parameters
ADCxwhere x can be 1, 2 or 3 to select the ADC peripheral.
ADC_InjectedChannelthe 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
Offsetthe offset value for the selected ADC injected channel This parameter must be a 12bit value.
Return values
None

Definition at line 1288 of file stm32f4xx_adc.c.

void ADC_SoftwareStartConv ( ADC_TypeDef *  ADCx)

Enables the selected ADC software start conversion of the regular channels.

Parameters
ADCxwhere x can be 1, 2 or 3 to select the ADC peripheral.
Return values
None
Examples:
dma.c.

Definition at line 835 of file stm32f4xx_adc.c.

+ Here is the caller graph for this function:

void ADC_SoftwareStartInjectedConv ( ADC_TypeDef *  ADCx)

Enables the selected ADC software start conversion of the injected channels.

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

Definition at line 1381 of file stm32f4xx_adc.c.

void ADC_StructInit ( ADC_InitTypeDef ADC_InitStruct)

Fills each ADC_InitStruct member with its default value.

Note
This function is used to initialize the global features of the ADC ( Resolution and Data Alignment), however, the rest of the configuration parameters are specific to the regular channels group (scan mode activation, continuous mode activation, External trigger source and edge, number of conversion in the regular channels group sequencer).
Parameters
ADC_InitStructpointer to an ADC_InitTypeDef structure which will be initialized.
Return values
None
Examples:
dma.c.

Definition at line 310 of file stm32f4xx_adc.c.

+ Here is the caller graph for this function:

void ADC_TempSensorVrefintCmd ( FunctionalState  NewState)

Enables or disables the temperature sensor and Vrefint channels.

Parameters
NewStatenew state of the temperature sensor and Vrefint channels. This parameter can be: ENABLE or DISABLE.
Return values
None

Definition at line 589 of file stm32f4xx_adc.c.

void ADC_VBATCmd ( FunctionalState  NewState)

Enables or disables the VBAT (Voltage Battery) channel.

Note
the Battery voltage measured is equal to VBAT/2 on STM32F40xx and STM32F41xx devices and equal to VBAT/4 on STM32F42xx and STM32F43xx devices
Parameters
NewStatenew state of the VBAT channel. This parameter can be: ENABLE or DISABLE.
Return values
None

Definition at line 615 of file stm32f4xx_adc.c.