Rajath Ravi / Mbed 2 deprecated ADC_DMA_POST_LEC12

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

stm32f4xx_adc_mort.c File Reference

stm32f4xx_adc_mort.c File Reference

This file provides firmware functions to manage the following functionalities of the Analog to Digital Convertor (ADC) peripheral: + Initialization and Configuration (in addition to ADC multi mode selection) + Analog Watchdog configuration + Temperature Sensor & Vrefint (Voltage Reference internal) & VBAT management + Regular Channels Configuration + Regular Channels DMA Configuration + Injected channels Configuration + Interrupts and flags management. More...

Go to the source code of this file.

Functions

void ADC_DeInit_mort (void)
 Deinitializes all ADCs peripherals registers to their default reset values.
void ADC_Init_mort (ADC_TypeDef_mort *ADCx, ADC_InitTypeDef_mort *ADC_InitStruct)
 Initializes the ADCx peripheral according to the specified parameters in the ADC_InitStruct.
void ADC_StructInit_mort (ADC_InitTypeDef_mort *ADC_InitStruct)
 Fills each ADC_InitStruct member with its default value.
void ADC_CommonInit_mort (ADC_CommonInitTypeDef_mort *ADC_CommonInitStruct)
 Initializes the ADCs peripherals according to the specified parameters in the ADC_CommonInitStruct.
void ADC_CommonStructInit_mort (ADC_CommonInitTypeDef_mort *ADC_CommonInitStruct)
 Fills each ADC_CommonInitStruct member with its default value.
void ADC_Cmd_mort (ADC_TypeDef_mort *ADCx, FunctionalState NewState)
 Enables or disables the specified ADC peripheral.
void ADC_AnalogWatchdogCmd_mort (ADC_TypeDef_mort *ADCx, uint32_t ADC_AnalogWatchdog)
 Enables or disables the analog watchdog on single/all regular or injected channels.
void ADC_AnalogWatchdogThresholdsConfig_mort (ADC_TypeDef_mort *ADCx, uint16_t HighThreshold, uint16_t LowThreshold)
 Configures the high and low thresholds of the analog watchdog.
void ADC_AnalogWatchdogSingleChannelConfig_mort (ADC_TypeDef_mort *ADCx, uint8_t ADC_Channel)
 Configures the analog watchdog guarded single channel.
void ADC_TempSensorVrefintCmd_mort (FunctionalState NewState)
 Enables or disables the temperature sensor and Vrefint channels.
void ADC_VBATCmd_mort (FunctionalState NewState)
 Enables or disables the VBAT (Voltage Battery) channel.
void ADC_RegularChannelConfig_mort (ADC_TypeDef_mort *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_SoftwareStartConv_mort (ADC_TypeDef_mort *ADCx)
 Enables the selected ADC software start conversion of the regular channels.
FlagStatus ADC_GetSoftwareStartConvStatus_mort (ADC_TypeDef_mort *ADCx)
 Gets the selected ADC Software start regular conversion Status.
void ADC_EOCOnEachRegularChannelCmd_mort (ADC_TypeDef_mort *ADCx, FunctionalState NewState)
 Enables or disables the EOC on each regular channel conversion.
void ADC_ContinuousModeCmd_mort (ADC_TypeDef_mort *ADCx, FunctionalState NewState)
 Enables or disables the ADC continuous conversion mode.
void ADC_DiscModeChannelCountConfig_mort (ADC_TypeDef_mort *ADCx, uint8_t Number)
 Configures the discontinuous mode for the selected ADC regular group channel.
void ADC_DiscModeCmd_mort (ADC_TypeDef_mort *ADCx, FunctionalState NewState)
 Enables or disables the discontinuous mode on regular group channel for the specified ADC.
uint16_t ADC_GetConversionValue_mort (ADC_TypeDef_mort *ADCx)
 Returns the last ADCx conversion result data for regular channel.
uint32_t ADC_GetMultiModeConversionValue_mort (void)
 Returns the last ADC1, ADC2 and ADC3 regular conversions results data in the selected multi mode.
void ADC_DMACmd_mort (ADC_TypeDef_mort *ADCx, FunctionalState NewState)
 Enables or disables the specified ADC DMA request.
void ADC_DMARequestAfterLastTransferCmd_mort (ADC_TypeDef_mort *ADCx, FunctionalState NewState)
 Enables or disables the ADC DMA request after last transfer (Single-ADC mode)
void ADC_MultiModeDMARequestAfterLastTransferCmd_mort (FunctionalState NewState)
 Enables or disables the ADC DMA request after last transfer in multi ADC mode.
void ADC_InjectedChannelConfig_mort (ADC_TypeDef_mort *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_InjectedSequencerLengthConfig_mort (ADC_TypeDef_mort *ADCx, uint8_t Length)
 Configures the sequencer length for injected channels.
void ADC_SetInjectedOffset_mort (ADC_TypeDef_mort *ADCx, uint8_t ADC_InjectedChannel, uint16_t Offset)
 Set the injected channels conversion value offset.
void ADC_ExternalTrigInjectedConvConfig_mort (ADC_TypeDef_mort *ADCx, uint32_t ADC_ExternalTrigInjecConv)
 Configures the ADCx external trigger for injected channels conversion.
void ADC_ExternalTrigInjectedConvEdgeConfig_mort (ADC_TypeDef_mort *ADCx, uint32_t ADC_ExternalTrigInjecConvEdge)
 Configures the ADCx external trigger edge for injected channels conversion.
void ADC_SoftwareStartInjectedConv_mort (ADC_TypeDef_mort *ADCx)
 Enables the selected ADC software start conversion of the injected channels.
FlagStatus ADC_GetSoftwareStartInjectedConvCmdStatus_mort (ADC_TypeDef_mort *ADCx)
 Gets the selected ADC Software start injected conversion Status.
void ADC_AutoInjectedConvCmd_mort (ADC_TypeDef_mort *ADCx, FunctionalState NewState)
 Enables or disables the selected ADC automatic injected group conversion after regular one.
void ADC_InjectedDiscModeCmd_mort (ADC_TypeDef_mort *ADCx, FunctionalState NewState)
 Enables or disables the discontinuous mode for injected group channel for the specified ADC.
uint16_t ADC_GetInjectedConversionValue_mort (ADC_TypeDef_mort *ADCx, uint8_t ADC_InjectedChannel)
 Returns the ADC injected channel conversion result.
void ADC_ITConfig_mort (ADC_TypeDef_mort *ADCx, uint16_t ADC_IT, FunctionalState NewState)
 Enables or disables the specified ADC interrupts.
FlagStatus ADC_GetFlagStatus_mort (ADC_TypeDef_mort *ADCx, uint8_t ADC_FLAG)
 Checks whether the specified ADC flag is set or not.
void ADC_ClearFlag_mort (ADC_TypeDef_mort *ADCx, uint8_t ADC_FLAG)
 Clears the ADCx's pending flags.
ITStatus ADC_GetITStatus_mort (ADC_TypeDef_mort *ADCx, uint16_t ADC_IT)
 Checks whether the specified ADC interrupt has occurred or not.
void ADC_ClearITPendingBit_mort (ADC_TypeDef_mort *ADCx, uint16_t ADC_IT)
 Clears the ADCx's interrupt pending bits.

Detailed Description

This file provides firmware functions to manage the following functionalities of the Analog to Digital Convertor (ADC) peripheral: + Initialization and Configuration (in addition to ADC multi mode selection) + Analog Watchdog configuration + Temperature Sensor & Vrefint (Voltage Reference internal) & VBAT management + Regular Channels Configuration + Regular Channels DMA Configuration + Injected channels Configuration + Interrupts and flags management.

Author:
MCD Application Team (with some modifications by melisao@stanford.edu)
Version:
V1.8.0
Date:
04-November-2016
 ===============================================================================
                     ##### How to use this driver #####
 ===============================================================================
    [..]
    (#) Enable the ADC interface clock using 
        RCC_APB2PeriphClockCmd(RCC_APB2Periph_ADCx, ENABLE); 
       
    (#) ADC pins configuration
         (++) Enable the clock for the ADC GPIOs using the following function:
             RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOx, ENABLE);   
         (++) Configure these ADC pins in analog mode using GPIO_Init();  
  
     (#) Configure the ADC Prescaler, conversion resolution and data 
         alignment using the ADC_Init() function.
     (#) Activate the ADC peripheral using ADC_Cmd() function.
  
     *** Regular channels group configuration ***
     ============================================
     [..]    
       (+) To configure the ADC regular channels group features, use 
           ADC_Init() and ADC_RegularChannelConfig() functions.
       (+) To activate the continuous mode, use the ADC_continuousModeCmd()
           function.
       (+) To configurate and activate the Discontinuous mode, use the 
           ADC_DiscModeChannelCountConfig() and ADC_DiscModeCmd() functions.
       (+) To read the ADC converted values, use the ADC_GetConversionValue()
           function.
  
     *** Multi mode ADCs Regular channels configuration ***
     ======================================================
     [..]
       (+) Refer to "Regular channels group configuration" description to
           configure the ADC1, ADC2 and ADC3 regular channels.        
       (+) Select the Multi mode ADC regular channels features (dual or 
           triple mode) using ADC_CommonInit() function and configure 
           the DMA mode using ADC_MultiModeDMARequestAfterLastTransferCmd() 
           functions.        
       (+) Read the ADCs converted values using the 
           ADC_GetMultiModeConversionValue() function.
  
     *** DMA for Regular channels group features configuration ***
     ============================================================= 
     [..]
       (+) To enable the DMA mode for regular channels group, use the 
           ADC_DMACmd() function.
       (+) To enable the generation of DMA requests continuously at the end
           of the last DMA transfer, use the ADC_DMARequestAfterLastTransferCmd() 
           function.
  
     *** Injected channels group configuration ***
     =============================================    
     [..]
       (+) To configure the ADC Injected channels group features, use 
           ADC_InjectedChannelConfig() and  ADC_InjectedSequencerLengthConfig()
           functions.
       (+) To activate the continuous mode, use the ADC_continuousModeCmd()
           function.
       (+) To activate the Injected Discontinuous mode, use the 
           ADC_InjectedDiscModeCmd() function.  
       (+) To activate the AutoInjected mode, use the ADC_AutoInjectedConvCmd() 
           function.        
       (+) To read the ADC converted values, use the ADC_GetInjectedConversionValue() 
           function.
  
    
Attention:

© COPYRIGHT 2016 STMicroelectronics

Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); You may not use this file except in compliance with the License. You may obtain a copy of the License at:

http://www.st.com/software_license_agreement_liberty_v2

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Definition in file stm32f4xx_adc_mort.c.