STM32F4 Standard Peripheral bibliotheek
1.0
ST Microelectronics bibliotheek documentatie voor de STM32F4 Standard Peripheral Library
|
ADC driver modules. More...
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... | |
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... | |
ADC driver modules.
void ADC_AnalogWatchdogCmd | ( | ADC_TypeDef * | ADCx, |
uint32_t | ADC_AnalogWatchdog | ||
) |
Enables or disables the analog watchdog on single/all regular or injected channels.
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:
|
None |
void ADC_AnalogWatchdogSingleChannelConfig | ( | ADC_TypeDef * | ADCx, |
uint8_t | ADC_Channel | ||
) |
Configures the analog watchdog guarded single channel.
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:
|
None |
void ADC_AnalogWatchdogThresholdsConfig | ( | ADC_TypeDef * | ADCx, |
uint16_t | HighThreshold, | ||
uint16_t | LowThreshold | ||
) |
Configures the high and low thresholds of the analog watchdog.
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 12-bit value. |
LowThreshold,: | the ADC analog watchdog Low threshold value. This parameter must be a 12-bit value. |
None |
void ADC_AutoInjectedConvCmd | ( | ADC_TypeDef * | ADCx, |
FunctionalState | NewState | ||
) |
Enables or disables the selected ADC automatic injected group conversion after regular one.
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. |
None |
void ADC_ClearFlag | ( | ADC_TypeDef * | ADCx, |
uint8_t | ADC_FLAG | ||
) |
Clears the ADCx's pending flags.
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:
|
None |
void ADC_ClearITPendingBit | ( | ADC_TypeDef * | ADCx, |
uint16_t | ADC_IT | ||
) |
Clears the ADCx's interrupt pending bits.
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 one of the following values:
|
None |
void ADC_Cmd | ( | ADC_TypeDef * | ADCx, |
FunctionalState | NewState | ||
) |
Enables or disables the specified ADC peripheral.
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. |
None |
void ADC_CommonInit | ( | ADC_CommonInitTypeDef * | ADC_CommonInitStruct | ) |
Initializes the ADCs peripherals according to the specified parameters in the ADC_CommonInitStruct.
ADC_CommonInitStruct,: | pointer to an ADC_CommonInitTypeDef structure that contains the configuration information for All ADCs peripherals. |
None |
void ADC_CommonStructInit | ( | ADC_CommonInitTypeDef * | ADC_CommonInitStruct | ) |
Fills each ADC_CommonInitStruct member with its default value.
ADC_CommonInitStruct,: | pointer to an ADC_CommonInitTypeDef structure which will be initialized. |
None |
void ADC_ContinuousModeCmd | ( | ADC_TypeDef * | ADCx, |
FunctionalState | NewState | ||
) |
Enables or disables the ADC continuous conversion mode.
ADCx,: | where x can be 1, 2 or 3 to select the ADC peripheral. |
NewState,: | new state of the selected ADC continuous conversion mode This parameter can be: ENABLE or DISABLE. |
None |
void ADC_DeInit | ( | void | ) |
Deinitializes all ADCs peripherals registers to their default reset values.
None |
None |
void ADC_DiscModeChannelCountConfig | ( | ADC_TypeDef * | ADCx, |
uint8_t | Number | ||
) |
Configures the discontinuous mode for the selected ADC regular group channel.
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. |
None |
void ADC_DiscModeCmd | ( | ADC_TypeDef * | ADCx, |
FunctionalState | NewState | ||
) |
Enables or disables the discontinuous mode on regular group channel for the specified ADC.
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. |
None |
void ADC_DMACmd | ( | ADC_TypeDef * | ADCx, |
FunctionalState | NewState | ||
) |
Enables or disables the specified ADC DMA request.
ADCx,: | where x can be 1, 2 or 3 to select the ADC peripheral. |
NewState,: | new state of the selected ADC DMA transfer. This parameter can be: ENABLE or DISABLE. |
None |
void ADC_DMARequestAfterLastTransferCmd | ( | ADC_TypeDef * | ADCx, |
FunctionalState | NewState | ||
) |
Enables or disables the ADC DMA request after last transfer (Single-ADC mode)
ADCx,: | where x can be 1, 2 or 3 to select the ADC peripheral. |
NewState,: | new state of the selected ADC DMA request after last transfer. This parameter can be: ENABLE or DISABLE. |
None |
void ADC_EOCOnEachRegularChannelCmd | ( | ADC_TypeDef * | ADCx, |
FunctionalState | NewState | ||
) |
Enables or disables the EOC on each regular channel conversion.
ADCx,: | where x can be 1, 2 or 3 to select the ADC peripheral. |
NewState,: | new state of the selected ADC EOC flag rising This parameter can be: ENABLE or DISABLE. |
None |
void ADC_ExternalTrigInjectedConvConfig | ( | ADC_TypeDef * | ADCx, |
uint32_t | ADC_ExternalTrigInjecConv | ||
) |
Configures the ADCx external trigger for injected channels conversion.
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:
|
None |
void ADC_ExternalTrigInjectedConvEdgeConfig | ( | ADC_TypeDef * | ADCx, |
uint32_t | ADC_ExternalTrigInjecConvEdge | ||
) |
Configures the ADCx external trigger edge for injected channels conversion.
ADCx,: | where x can be 1, 2 or 3 to select the ADC peripheral. |
ADC_ExternalTrigInjecConvEdge,: | specifies the ADC external trigger edge to start injected conversion. This parameter can be one of the following values:
|
None |
uint16_t ADC_GetConversionValue | ( | ADC_TypeDef * | ADCx | ) |
Returns the last ADCx conversion result data for regular channel.
ADCx,: | where x can be 1, 2 or 3 to select the ADC peripheral. |
The | Data conversion value. |
FlagStatus ADC_GetFlagStatus | ( | ADC_TypeDef * | ADCx, |
uint8_t | ADC_FLAG | ||
) |
Checks whether the specified ADC flag is set or not.
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:
|
The | new state of ADC_FLAG (SET or RESET). |
uint16_t ADC_GetInjectedConversionValue | ( | ADC_TypeDef * | ADCx, |
uint8_t | ADC_InjectedChannel | ||
) |
Returns the ADC injected channel conversion result.
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:
|
The | Data conversion value. |
ITStatus ADC_GetITStatus | ( | ADC_TypeDef * | ADCx, |
uint16_t | ADC_IT | ||
) |
Checks whether the specified ADC interrupt has occurred or not.
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:
|
The | new state of ADC_IT (SET or RESET). |
uint32_t ADC_GetMultiModeConversionValue | ( | void | ) |
Returns the last ADC1, ADC2 and ADC3 regular conversions results data in the selected multi mode.
None |
The | Data conversion value. |
FlagStatus ADC_GetSoftwareStartConvStatus | ( | ADC_TypeDef * | ADCx | ) |
Gets the selected ADC Software start regular conversion Status.
ADCx,: | where x can be 1, 2 or 3 to select the ADC peripheral. |
The | new state of ADC software start conversion (SET or RESET). |
FlagStatus ADC_GetSoftwareStartInjectedConvCmdStatus | ( | ADC_TypeDef * | ADCx | ) |
Gets the selected ADC Software start injected conversion Status.
ADCx,: | where x can be 1, 2 or 3 to select the ADC peripheral. |
The | new state of ADC software start injected conversion (SET or RESET). |
void ADC_Init | ( | ADC_TypeDef * | ADCx, |
ADC_InitTypeDef * | ADC_InitStruct | ||
) |
Initializes the ADCx peripheral according to the specified parameters in the ADC_InitStruct.
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. |
None |
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.
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:
|
Rank,: | The rank in the injected group sequencer. This parameter must be between 1 to 4. |
ADC_SampleTime,: | The sample time value to be set for the selected channel. This parameter can be one of the following values:
|
None |
void ADC_InjectedDiscModeCmd | ( | ADC_TypeDef * | ADCx, |
FunctionalState | NewState | ||
) |
Enables or disables the discontinuous mode for injected group channel for the specified ADC.
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. |
None |
void ADC_InjectedSequencerLengthConfig | ( | ADC_TypeDef * | ADCx, |
uint8_t | Length | ||
) |
Configures the sequencer length for injected channels.
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. |
None |
void ADC_ITConfig | ( | ADC_TypeDef * | ADCx, |
uint16_t | ADC_IT, | ||
FunctionalState | NewState | ||
) |
Enables or disables the specified ADC interrupts.
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 one of the following values:
|
NewState,: | new state of the specified ADC interrupts. This parameter can be: ENABLE or DISABLE. |
None |
void ADC_MultiModeDMARequestAfterLastTransferCmd | ( | FunctionalState | NewState | ) |
Enables or disables the ADC DMA request after last transfer in multi ADC mode.
NewState,: | new state of the selected ADC DMA request after last transfer. This parameter can be: ENABLE or DISABLE. |
None |
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.
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:
|
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:
|
None |
void ADC_SetInjectedOffset | ( | ADC_TypeDef * | ADCx, |
uint8_t | ADC_InjectedChannel, | ||
uint16_t | Offset | ||
) |
Set the injected channels conversion value offset.
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:
|
Offset,: | the offset value for the selected ADC injected channel This parameter must be a 12bit value. |
None |
void ADC_SoftwareStartConv | ( | ADC_TypeDef * | ADCx | ) |
Enables the selected ADC software start conversion of the regular channels.
ADCx,: | where x can be 1, 2 or 3 to select the ADC peripheral. |
None |
void ADC_SoftwareStartInjectedConv | ( | ADC_TypeDef * | ADCx | ) |
Enables the selected ADC software start conversion of the injected channels.
ADCx,: | where x can be 1, 2 or 3 to select the ADC peripheral. |
None |
void ADC_StructInit | ( | ADC_InitTypeDef * | ADC_InitStruct | ) |
Fills each ADC_InitStruct member with its default value.
ADC_InitStruct,: | pointer to an ADC_InitTypeDef structure which will be initialized. |
None |
void ADC_TempSensorVrefintCmd | ( | FunctionalState | NewState | ) |
Enables or disables the temperature sensor and Vrefint channels.
NewState,: | new state of the temperature sensor and Vrefint channels. This parameter can be: ENABLE or DISABLE. |
None |
void ADC_VBATCmd | ( | FunctionalState | NewState | ) |
Enables or disables the VBAT (Voltage Battery) channel.
NewState,: | new state of the VBAT channel. This parameter can be: ENABLE or DISABLE. |
None |