/** ****************************************************************************** * @file stm32f4xx_hal_adc.h * @author MCD Application Team * @brief Header file containing functions prototypes of ADC HAL library. ****************************************************************************** * @attention * * Copyright (c) 2017 STMicroelectronics. * All rights reserved. * * This software is licensed under terms that can be found in the LICENSE file * in the root directory of this software component. * If no LICENSE file comes with this software, it is provided AS-IS. * ****************************************************************************** *//* ... *//* Define to prevent recursive inclusion -------------------------------------*/#ifndef__STM32F4xx_ADC_H#define__STM32F4xx_ADC_H#ifdef__cplusplusextern"C"{#endif/* Includes ------------------------------------------------------------------*/#include"stm32f4xx_hal_def.h"/* Include low level driver */#include"stm32f4xx_ll_adc.h"/** @addtogroup STM32F4xx_HAL_Driver * @{ *//* ... *//** @addtogroup ADC * @{ *//* ... */Includes/* Exported types ------------------------------------------------------------*//** @defgroup ADC_Exported_Types ADC Exported Types * @{ *//* ... *//** * @brief Structure definition of ADC and regular group initialization * @note Parameters of this structure are shared within 2 scopes: * - Scope entire ADC (affects regular and injected groups): ClockPrescaler, Resolution, ScanConvMode, DataAlign, ScanConvMode, EOCSelection, LowPowerAutoWait, LowPowerAutoPowerOff, ChannelsBank. * - Scope regular group: ContinuousConvMode, NbrOfConversion, DiscontinuousConvMode, NbrOfDiscConversion, ExternalTrigConvEdge, ExternalTrigConv. * @note The setting of these parameters with function HAL_ADC_Init() is conditioned to ADC state. * ADC state can be either: * - For all parameters: ADC disabled * - For all parameters except 'Resolution', 'ScanConvMode', 'DiscontinuousConvMode', 'NbrOfDiscConversion' : ADC enabled without conversion on going on regular group. * - For parameters 'ExternalTrigConv' and 'ExternalTrigConvEdge': ADC enabled, even with conversion on going. * If ADC is not in the appropriate state to modify some parameters, these parameters setting is bypassed * without error reporting (as it can be the expected behaviour in case of intended action to update another parameter (which fulfills the ADC state condition) on the fly). *//* ... */typedefstruct{uint32_tClockPrescaler;/*!< Select ADC clock prescaler. The clock is common for all the ADCs. This parameter can be a value of @ref ADC_ClockPrescaler *//* ... */uint32_tResolution;/*!< Configures the ADC resolution. This parameter can be a value of @ref ADC_Resolution *//* ... */uint32_tDataAlign;/*!< Specifies ADC data alignment to right (MSB on register bit 11 and LSB on register bit 0) (default setting) or to left (if regular group: MSB on register bit 15 and LSB on register bit 4, if injected group (MSB kept as signed value due to potential negative value after offset application): MSB on register bit 14 and LSB on register bit 3). This parameter can be a value of @ref ADC_Data_align *//* ... */uint32_tScanConvMode;/*!< Configures the sequencer of regular and injected groups. This parameter can be associated to parameter 'DiscontinuousConvMode' to have main sequence subdivided in successive parts. If disabled: Conversion is performed in single mode (one channel converted, the one defined in rank 1). Parameters 'NbrOfConversion' and 'InjectedNbrOfConversion' are discarded (equivalent to set to 1). If enabled: Conversions are performed in sequence mode (multiple ranks defined by 'NbrOfConversion'/'InjectedNbrOfConversion' and each channel rank). Scan direction is upward: from rank1 to rank 'n'. This parameter can be set to ENABLE or DISABLE *//* ... */uint32_tEOCSelection;/*!< Specifies what EOC (End Of Conversion) flag is used for conversion by polling and interruption: end of conversion of each rank or complete sequence. This parameter can be a value of @ref ADC_EOCSelection. Note: For injected group, end of conversion (flag&IT) is raised only at the end of the sequence. Therefore, if end of conversion is set to end of each conversion, injected group should not be used with interruption (HAL_ADCEx_InjectedStart_IT) or polling (HAL_ADCEx_InjectedStart and HAL_ADCEx_InjectedPollForConversion). By the way, polling is still possible since driver will use an estimated timing for end of injected conversion. Note: If overrun feature is intended to be used, use ADC in mode 'interruption' (function HAL_ADC_Start_IT() ) with parameter EOCSelection set to end of each conversion or in mode 'transfer by DMA' (function HAL_ADC_Start_DMA()). If overrun feature is intended to be bypassed, use ADC in mode 'polling' or 'interruption' with parameter EOCSelection must be set to end of sequence *//* ... */FunctionalStateContinuousConvMode;/*!< Specifies whether the conversion is performed in single mode (one conversion) or continuous mode for regular group, after the selected trigger occurred (software start or external trigger). This parameter can be set to ENABLE or DISABLE. *//* ... */uint32_tNbrOfConversion;/*!< Specifies the number of ranks that will be converted within the regular group sequencer. To use regular group sequencer and convert several ranks, parameter 'ScanConvMode' must be enabled. This parameter must be a number between Min_Data = 1 and Max_Data = 16. *//* ... */FunctionalStateDiscontinuousConvMode;/*!< Specifies whether the conversions sequence of regular group is performed in Complete-sequence/Discontinuous-sequence (main sequence subdivided in successive parts). Discontinuous mode is used only if sequencer is enabled (parameter 'ScanConvMode'). If sequencer is disabled, this parameter is discarded. Discontinuous mode can be enabled only if continuous mode is disabled. If continuous mode is enabled, this parameter setting is discarded. This parameter can be set to ENABLE or DISABLE. *//* ... */uint32_tNbrOfDiscConversion;/*!< Specifies the number of discontinuous conversions in which the main sequence of regular group (parameter NbrOfConversion) will be subdivided. If parameter 'DiscontinuousConvMode' is disabled, this parameter is discarded. This parameter must be a number between Min_Data = 1 and Max_Data = 8. *//* ... */uint32_tExternalTrigConv;/*!< Selects the external event used to trigger the conversion start of regular group. If set to ADC_SOFTWARE_START, external triggers are disabled. If set to external trigger source, triggering is on event rising edge by default. This parameter can be a value of @ref ADC_External_trigger_Source_Regular *//* ... */uint32_tExternalTrigConvEdge;/*!< Selects the external trigger edge of regular group. If trigger is set to ADC_SOFTWARE_START, this parameter is discarded. This parameter can be a value of @ref ADC_External_trigger_edge_Regular *//* ... */FunctionalStateDMAContinuousRequests;/*!< Specifies whether the DMA requests are performed in one shot mode (DMA transfer stop when number of conversions is reached) or in Continuous mode (DMA transfer unlimited, whatever number of conversions). Note: In continuous mode, DMA must be configured in circular mode. Otherwise an overrun will be triggered when DMA buffer maximum pointer is reached. Note: This parameter must be modified when no conversion is on going on both regular and injected groups (ADC disabled, or ADC enabled without continuous mode or external trigger that could launch a conversion). This parameter can be set to ENABLE or DISABLE. *//* ... */...}ADC_InitTypeDef;/** * @brief Structure definition of ADC channel for regular group * @note The setting of these parameters with function HAL_ADC_ConfigChannel() is conditioned to ADC state. * ADC can be either disabled or enabled without conversion on going on regular group. *//* ... */typedefstruct{uint32_tChannel;/*!< Specifies the channel to configure into ADC regular group. This parameter can be a value of @ref ADC_channels *//* ... */uint32_tRank;/*!< Specifies the rank in the regular group sequencer. This parameter must be a number between Min_Data = 1 and Max_Data = 16 *//* ... */uint32_tSamplingTime;/*!< Sampling time value to be set for the selected channel. Unit: ADC clock cycles Conversion time is the addition of sampling time and processing time (12 ADC clock cycles at ADC resolution 12 bits, 11 cycles at 10 bits, 9 cycles at 8 bits, 7 cycles at 6 bits). This parameter can be a value of @ref ADC_sampling_times Caution: This parameter updates the parameter property of the channel, that can be used into regular and/or injected groups. If this same channel has been previously configured in the other group (regular/injected), it will be updated to last setting. Note: In case of usage of internal measurement channels (VrefInt/Vbat/TempSensor), sampling time constraints must be respected (sampling time can be adjusted in function of ADC clock frequency and sampling time setting) Refer to device datasheet for timings values, parameters TS_vrefint, TS_temp (values rough order: 4us min). *//* ... */uint32_tOffset;/*!< Reserved for future use, can be set to 0 */...}ADC_ChannelConfTypeDef;/** * @brief ADC Configuration multi-mode structure definition *//* ... */typedefstruct{uint32_tWatchdogMode;/*!< Configures the ADC analog watchdog mode. This parameter can be a value of @ref ADC_analog_watchdog_selection *//* ... */uint32_tHighThreshold;/*!< Configures the ADC analog watchdog High threshold value. This parameter must be a 12-bit value. *//* ... */uint32_tLowThreshold;/*!< Configures the ADC analog watchdog High threshold value. This parameter must be a 12-bit value. *//* ... */uint32_tChannel;/*!< Configures ADC channel for the analog watchdog. This parameter has an effect only if watchdog mode is configured on single channel This parameter can be a value of @ref ADC_channels *//* ... */FunctionalStateITMode;/*!< Specifies whether the analog watchdog is configured is interrupt mode or in polling mode. This parameter can be set to ENABLE or DISABLE *//* ... */uint32_tWatchdogNumber;/*!< Reserved for future use, can be set to 0 */...}ADC_AnalogWDGConfTypeDef;/** * @brief HAL ADC state machine: ADC states definition (bitfields) *//* ... *//* States of ADC global scope */#defineHAL_ADC_STATE_RESET0x00000000U/*!< ADC not yet initialized or disabled */#defineHAL_ADC_STATE_READY0x00000001U/*!< ADC peripheral ready for use */#defineHAL_ADC_STATE_BUSY_INTERNAL0x00000002U/*!< ADC is busy to internal process (initialization, calibration) */#defineHAL_ADC_STATE_TIMEOUT0x00000004U/*!< TimeOut occurrence *//* States of ADC errors */#defineHAL_ADC_STATE_ERROR_INTERNAL0x00000010U/*!< Internal error occurrence */#defineHAL_ADC_STATE_ERROR_CONFIG0x00000020U/*!< Configuration error occurrence */#defineHAL_ADC_STATE_ERROR_DMA0x00000040U/*!< DMA error occurrence *//* States of ADC group regular */#defineHAL_ADC_STATE_REG_BUSY0x00000100U/*!< A conversion on group regular is ongoing or can occur (either by continuous mode, external trigger, low power auto power-on (if feature available), multimode ADC master control (if feature available)) *//* ... */#defineHAL_ADC_STATE_REG_EOC0x00000200U/*!< Conversion data available on group regular */#defineHAL_ADC_STATE_REG_OVR0x00000400U/*!< Overrun occurrence *//* States of ADC group injected */#defineHAL_ADC_STATE_INJ_BUSY0x00001000U/*!< A conversion on group injected is ongoing or can occur (either by auto-injection mode, external trigger, low power auto power-on (if feature available), multimode ADC master control (if feature available)) *//* ... */#defineHAL_ADC_STATE_INJ_EOC0x00002000U/*!< Conversion data available on group injected *//* States of ADC analog watchdogs */#defineHAL_ADC_STATE_AWD10x00010000U/*!< Out-of-window occurrence of analog watchdog 1 */#defineHAL_ADC_STATE_AWD20x00020000U/*!< Not available on STM32F4 device: Out-of-window occurrence of analog watchdog 2 */#defineHAL_ADC_STATE_AWD30x00040000U/*!< Not available on STM32F4 device: Out-of-window occurrence of analog watchdog 3 *//* States of ADC multi-mode */#defineHAL_ADC_STATE_MULTIMODE_SLAVE0x00100000U/*!< Not available on STM32F4 device: ADC in multimode slave state, controlled by another ADC master ( */16 defines/** * @brief ADC handle Structure definition *//* ... */#if(USE_HAL_ADC_REGISTER_CALLBACKS==1)typedefstruct__ADC_HandleTypeDef#elsetypedefstruct#endif{ADC_TypeDef*Instance;/*!< Register base address */ADC_InitTypeDefInit;/*!< ADC required parameters */__IOuint32_tNbrOfCurrentConversionRank;/*!< ADC number of current conversion rank */DMA_HandleTypeDef*DMA_Handle;/*!< Pointer DMA Handler */HAL_LockTypeDefLock;/*!< ADC locking object */__IOuint32_tState;/*!< ADC communication state */__IOuint32_tErrorCode;/*!< ADC Error code */#if(USE_HAL_ADC_REGISTER_CALLBACKS==1)void(*ConvCpltCallback)(struct__ADC_HandleTypeDef*hadc);/*!< ADC conversion complete callback */void(*ConvHalfCpltCallback)(struct__ADC_HandleTypeDef*hadc);/*!< ADC conversion DMA half-transfer callback */void(*LevelOutOfWindowCallback)(struct__ADC_HandleTypeDef*hadc);/*!< ADC analog watchdog 1 callback */void(*ErrorCallback)(struct__ADC_HandleTypeDef*hadc);/*!< ADC error callback */void(*InjectedConvCpltCallback)(struct__ADC_HandleTypeDef*hadc);/*!< ADC group injected conversion complete callback */void(*MspInitCallback)(struct__ADC_HandleTypeDef*hadc);/*!< ADC Msp Init callback */void(*MspDeInitCallback)(struct__ADC_HandleTypeDef*hadc);/*!< ADC Msp DeInit callback *//* ... */#endif/* USE_HAL_ADC_REGISTER_CALLBACKS */...}ADC_HandleTypeDef;#if(USE_HAL_ADC_REGISTER_CALLBACKS==1)/** * @brief HAL ADC Callback ID enumeration definition *//* ... */typedefenum{HAL_ADC_CONVERSION_COMPLETE_CB_ID=0x00U,/*!< ADC conversion complete callback ID */HAL_ADC_CONVERSION_HALF_CB_ID=0x01U,/*!< ADC conversion DMA half-transfer callback ID */HAL_ADC_LEVEL_OUT_OF_WINDOW_1_CB_ID=0x02U,/*!< ADC analog watchdog 1 callback ID */HAL_ADC_ERROR_CB_ID=0x03U,/*!< ADC error callback ID */HAL_ADC_INJ_CONVERSION_COMPLETE_CB_ID=0x04U,/*!< ADC group injected conversion complete callback ID */HAL_ADC_MSPINIT_CB_ID=0x05U,/*!< ADC Msp Init callback ID */HAL_ADC_MSPDEINIT_CB_ID=0x06U/*!< ADC Msp DeInit callback ID */...}HAL_ADC_CallbackIDTypeDef;/** * @brief HAL ADC Callback pointer definition *//* ... */typedefvoid(*pADC_CallbackTypeDef)(ADC_HandleTypeDef*hadc);/*!< pointer to a ADC callback function *//* ... */#endif/* USE_HAL_ADC_REGISTER_CALLBACKS *//** * @} *//* ... */Exported types/* Exported constants --------------------------------------------------------*//** @defgroup ADC_Exported_Constants ADC Exported Constants * @{ *//* ... *//** @defgroup ADC_Error_Code ADC Error Code * @{ *//* ... */#defineHAL_ADC_ERROR_NONE0x00U/*!< No error */#defineHAL_ADC_ERROR_INTERNAL0x01U/*!< ADC IP internal error: if problem of clocking, enable/disable, erroneous state *//* ... */#defineHAL_ADC_ERROR_OVR0x02U/*!< Overrun error */#defineHAL_ADC_ERROR_DMA0x04U/*!< DMA transfer error */#if(USE_HAL_ADC_REGISTER_CALLBACKS==1)#defineHAL_ADC_ERROR_INVALID_CALLBACK(0x10U)/*!< Invalid Callback error */#endif/* USE_HAL_ADC_REGISTER_CALLBACKS *//** * @} *//* ... *//** @defgroup ADC_ClockPrescaler ADC Clock Prescaler * @{ *//* ... */#defineADC_CLOCK_SYNC_PCLK_DIV20x00000000U#defineADC_CLOCK_SYNC_PCLK_DIV4((uint32_t)ADC_CCR_ADCPRE_0)#defineADC_CLOCK_SYNC_PCLK_DIV6((uint32_t)ADC_CCR_ADCPRE_1)#defineADC_CLOCK_SYNC_PCLK_DIV8((uint32_t)ADC_CCR_ADCPRE)/** * @} *//* ... *//** @defgroup ADC_delay_between_2_sampling_phases ADC Delay Between 2 Sampling Phases * @{ *//* ... */#defineADC_TWOSAMPLINGDELAY_5CYCLES0x00000000U#defineADC_TWOSAMPLINGDELAY_6CYCLES((uint32_t)ADC_CCR_DELAY_0)#defineADC_TWOSAMPLINGDELAY_7CYCLES((uint32_t)ADC_CCR_DELAY_1)#defineADC_TWOSAMPLINGDELAY_8CYCLES((uint32_t)(ADC_CCR_DELAY_1|ADC_CCR_DELAY_0))#defineADC_TWOSAMPLINGDELAY_9CYCLES((uint32_t)ADC_CCR_DELAY_2)#defineADC_TWOSAMPLINGDELAY_10CYCLES((uint32_t)(ADC_CCR_DELAY_2|ADC_CCR_DELAY_0))#defineADC_TWOSAMPLINGDELAY_11CYCLES((uint32_t)(ADC_CCR_DELAY_2|ADC_CCR_DELAY_1))#defineADC_TWOSAMPLINGDELAY_12CYCLES((uint32_t)(ADC_CCR_DELAY_2|ADC_CCR_DELAY_1|ADC_CCR_DELAY_0))#defineADC_TWOSAMPLINGDELAY_13CYCLES((uint32_t)ADC_CCR_DELAY_3)#defineADC_TWOSAMPLINGDELAY_14CYCLES((uint32_t)(ADC_CCR_DELAY_3|ADC_CCR_DELAY_0))#defineADC_TWOSAMPLINGDELAY_15CYCLES((uint32_t)(ADC_CCR_DELAY_3|ADC_CCR_DELAY_1))#defineADC_TWOSAMPLINGDELAY_16CYCLES((uint32_t)(ADC_CCR_DELAY_3|ADC_CCR_DELAY_1|ADC_CCR_DELAY_0))#defineADC_TWOSAMPLINGDELAY_17CYCLES((uint32_t)(ADC_CCR_DELAY_3|ADC_CCR_DELAY_2))#defineADC_TWOSAMPLINGDELAY_18CYCLES((uint32_t)(ADC_CCR_DELAY_3|ADC_CCR_DELAY_2|ADC_CCR_DELAY_0))#defineADC_TWOSAMPLINGDELAY_19CYCLES((uint32_t)(ADC_CCR_DELAY_3|ADC_CCR_DELAY_2|ADC_CCR_DELAY_1))#defineADC_TWOSAMPLINGDELAY_20CYCLES((uint32_t)ADC_CCR_DELAY)/** * @} *//* ... *//** @defgroup ADC_Resolution ADC Resolution * @{ *//* ... */#defineADC_RESOLUTION_12B0x00000000U#defineADC_RESOLUTION_10B((uint32_t)ADC_CR1_RES_0)#defineADC_RESOLUTION_8B((uint32_t)ADC_CR1_RES_1)#defineADC_RESOLUTION_6B((uint32_t)ADC_CR1_RES)/** * @} *//* ... *//** @defgroup ADC_External_trigger_edge_Regular ADC External Trigger Edge Regular * @{ *//* ... */#defineADC_EXTERNALTRIGCONVEDGE_NONE0x00000000U#defineADC_EXTERNALTRIGCONVEDGE_RISING((uint32_t)ADC_CR2_EXTEN_0)#defineADC_EXTERNALTRIGCONVEDGE_FALLING((uint32_t)ADC_CR2_EXTEN_1)#defineADC_EXTERNALTRIGCONVEDGE_RISINGFALLING((uint32_t)ADC_CR2_EXTEN)/** * @} *//* ... *//** @defgroup ADC_External_trigger_Source_Regular ADC External Trigger Source Regular * @{ *//* ... *//* Note: Parameter ADC_SOFTWARE_START is a software parameter used for *//* compatibility with other STM32 devices. */#defineADC_EXTERNALTRIGCONV_T1_CC10x00000000U#defineADC_EXTERNALTRIGCONV_T1_CC2((uint32_t)ADC_CR2_EXTSEL_0)#defineADC_EXTERNALTRIGCONV_T1_CC3((uint32_t)ADC_CR2_EXTSEL_1)#defineADC_EXTERNALTRIGCONV_T2_CC2((uint32_t)(ADC_CR2_EXTSEL_1|ADC_CR2_EXTSEL_0))#defineADC_EXTERNALTRIGCONV_T2_CC3((uint32_t)ADC_CR2_EXTSEL_2)#defineADC_EXTERNALTRIGCONV_T2_CC4((uint32_t)(ADC_CR2_EXTSEL_2|ADC_CR2_EXTSEL_0))#defineADC_EXTERNALTRIGCONV_T2_TRGO((uint32_t)(ADC_CR2_EXTSEL_2|ADC_CR2_EXTSEL_1))#defineADC_EXTERNALTRIGCONV_T3_CC1((uint32_t)(ADC_CR2_EXTSEL_2|ADC_CR2_EXTSEL_1|ADC_CR2_EXTSEL_0))#defineADC_EXTERNALTRIGCONV_T3_TRGO((uint32_t)ADC_CR2_EXTSEL_3)#defineADC_EXTERNALTRIGCONV_T4_CC4((uint32_t)(ADC_CR2_EXTSEL_3|ADC_CR2_EXTSEL_0))#defineADC_EXTERNALTRIGCONV_T5_CC1((uint32_t)(ADC_CR2_EXTSEL_3|ADC_CR2_EXTSEL_1))#defineADC_EXTERNALTRIGCONV_T5_CC2((uint32_t)(ADC_CR2_EXTSEL_3|ADC_CR2_EXTSEL_1|ADC_CR2_EXTSEL_0))#defineADC_EXTERNALTRIGCONV_T5_CC3((uint32_t)(ADC_CR2_EXTSEL_3|ADC_CR2_EXTSEL_2))#defineADC_EXTERNALTRIGCONV_T8_CC1((uint32_t)(ADC_CR2_EXTSEL_3|ADC_CR2_EXTSEL_2|ADC_CR2_EXTSEL_0))#defineADC_EXTERNALTRIGCONV_T8_TRGO((uint32_t)(ADC_CR2_EXTSEL_3|ADC_CR2_EXTSEL_2|ADC_CR2_EXTSEL_1))#defineADC_EXTERNALTRIGCONV_Ext_IT11((uint32_t)ADC_CR2_EXTSEL)#defineADC_SOFTWARE_START((uint32_t)ADC_CR2_EXTSEL+1U)/** * @} *//* ... *//** @defgroup ADC_Data_align ADC Data Align * @{ *//* ... */#defineADC_DATAALIGN_RIGHT0x00000000U#defineADC_DATAALIGN_LEFT((uint32_t)ADC_CR2_ALIGN)/** * @} *//* ... *//** @defgroup ADC_channels ADC Common Channels * @{ *//* ... */#defineADC_CHANNEL_00x00000000U#defineADC_CHANNEL_1((uint32_t)ADC_CR1_AWDCH_0)#defineADC_CHANNEL_2((uint32_t)ADC_CR1_AWDCH_1)#defineADC_CHANNEL_3((uint32_t)(ADC_CR1_AWDCH_1|ADC_CR1_AWDCH_0))#defineADC_CHANNEL_4((uint32_t)ADC_CR1_AWDCH_2)#defineADC_CHANNEL_5((uint32_t)(ADC_CR1_AWDCH_2|ADC_CR1_AWDCH_0))#defineADC_CHANNEL_6((uint32_t)(ADC_CR1_AWDCH_2|ADC_CR1_AWDCH_1))#defineADC_CHANNEL_7((uint32_t)(ADC_CR1_AWDCH_2|ADC_CR1_AWDCH_1|ADC_CR1_AWDCH_0))#defineADC_CHANNEL_8((uint32_t)ADC_CR1_AWDCH_3)#defineADC_CHANNEL_9((uint32_t)(ADC_CR1_AWDCH_3|ADC_CR1_AWDCH_0))#defineADC_CHANNEL_10((uint32_t)(ADC_CR1_AWDCH_3|ADC_CR1_AWDCH_1))#defineADC_CHANNEL_11((uint32_t)(ADC_CR1_AWDCH_3|ADC_CR1_AWDCH_1|ADC_CR1_AWDCH_0))#defineADC_CHANNEL_12((uint32_t)(ADC_CR1_AWDCH_3|ADC_CR1_AWDCH_2))#defineADC_CHANNEL_13((uint32_t)(ADC_CR1_AWDCH_3|ADC_CR1_AWDCH_2|ADC_CR1_AWDCH_0))#defineADC_CHANNEL_14((uint32_t)(ADC_CR1_AWDCH_3|ADC_CR1_AWDCH_2|ADC_CR1_AWDCH_1))#defineADC_CHANNEL_15((uint32_t)(ADC_CR1_AWDCH_3|ADC_CR1_AWDCH_2|ADC_CR1_AWDCH_1|ADC_CR1_AWDCH_0))#defineADC_CHANNEL_16((uint32_t)ADC_CR1_AWDCH_4)#defineADC_CHANNEL_17((uint32_t)(ADC_CR1_AWDCH_4|ADC_CR1_AWDCH_0))#defineADC_CHANNEL_18((uint32_t)(ADC_CR1_AWDCH_4|ADC_CR1_AWDCH_1))#defineADC_CHANNEL_VREFINT((uint32_t)ADC_CHANNEL_17)#defineADC_CHANNEL_VBAT((uint32_t)ADC_CHANNEL_18)/** * @} *//* ... *//** @defgroup ADC_sampling_times ADC Sampling Times * @{ *//* ... */#defineADC_SAMPLETIME_3CYCLES0x00000000U#defineADC_SAMPLETIME_15CYCLES((uint32_t)ADC_SMPR1_SMP10_0)#defineADC_SAMPLETIME_28CYCLES((uint32_t)ADC_SMPR1_SMP10_1)#defineADC_SAMPLETIME_56CYCLES((uint32_t)(ADC_SMPR1_SMP10_1|ADC_SMPR1_SMP10_0))#defineADC_SAMPLETIME_84CYCLES((uint32_t)ADC_SMPR1_SMP10_2)#defineADC_SAMPLETIME_112CYCLES((uint32_t)(ADC_SMPR1_SMP10_2|ADC_SMPR1_SMP10_0))#defineADC_SAMPLETIME_144CYCLES((uint32_t)(ADC_SMPR1_SMP10_2|ADC_SMPR1_SMP10_1))#defineADC_SAMPLETIME_480CYCLES((uint32_t)ADC_SMPR1_SMP10)/** * @} *//* ... *//** @defgroup ADC_EOCSelection ADC EOC Selection * @{ *//* ... */#defineADC_EOC_SEQ_CONV0x00000000U#defineADC_EOC_SINGLE_CONV0x00000001U#defineADC_EOC_SINGLE_SEQ_CONV0x00000002U/*!< reserved for future use *//** * @} *//* ... *//** @defgroup ADC_Event_type ADC Event Type * @{ *//* ... */#defineADC_AWD_EVENT((uint32_t)ADC_FLAG_AWD)#defineADC_OVR_EVENT((uint32_t)ADC_FLAG_OVR)/** * @} *//* ... *//** @defgroup ADC_analog_watchdog_selection ADC Analog Watchdog Selection * @{ *//* ... */#defineADC_ANALOGWATCHDOG_SINGLE_REG((uint32_t)(ADC_CR1_AWDSGL|ADC_CR1_AWDEN))#defineADC_ANALOGWATCHDOG_SINGLE_INJEC((uint32_t)(ADC_CR1_AWDSGL|ADC_CR1_JAWDEN))#defineADC_ANALOGWATCHDOG_SINGLE_REGINJEC((uint32_t)(ADC_CR1_AWDSGL|ADC_CR1_AWDEN|ADC_CR1_JAWDEN))#defineADC_ANALOGWATCHDOG_ALL_REG((uint32_t)ADC_CR1_AWDEN)#defineADC_ANALOGWATCHDOG_ALL_INJEC((uint32_t)ADC_CR1_JAWDEN)#defineADC_ANALOGWATCHDOG_ALL_REGINJEC((uint32_t)(ADC_CR1_AWDEN|ADC_CR1_JAWDEN))#defineADC_ANALOGWATCHDOG_NONE0x00000000U/** * @} *//* ... *//** @defgroup ADC_interrupts_definition ADC Interrupts Definition * @{ *//* ... */#defineADC_IT_EOC((uint32_t)ADC_CR1_EOCIE)#defineADC_IT_AWD((uint32_t)ADC_CR1_AWDIE)#defineADC_IT_JEOC((uint32_t)ADC_CR1_JEOCIE)#defineADC_IT_OVR((uint32_t)ADC_CR1_OVRIE)/** * @} *//* ... *//** @defgroup ADC_flags_definition ADC Flags Definition * @{ *//* ... */#defineADC_FLAG_AWD((uint32_t)ADC_SR_AWD)#defineADC_FLAG_EOC((uint32_t)ADC_SR_EOC)#defineADC_FLAG_JEOC((uint32_t)ADC_SR_JEOC)#defineADC_FLAG_JSTRT((uint32_t)ADC_SR_JSTRT)#defineADC_FLAG_STRT((uint32_t)ADC_SR_STRT)#defineADC_FLAG_OVR((uint32_t)ADC_SR_OVR)/** * @} *//* ... *//** @defgroup ADC_channels_type ADC Channels Type * @{ *//* ... */#defineADC_ALL_CHANNELS0x00000001U#defineADC_REGULAR_CHANNELS0x00000002U/*!< reserved for future use */#defineADC_INJECTED_CHANNELS0x00000003U/*!< reserved for future use */101 defines/** * @} *//* ... *//** * @} *//* ... */Exported constants/* Exported macro ------------------------------------------------------------*//** @defgroup ADC_Exported_Macros ADC Exported Macros * @{ *//* ... *//** @brief Reset ADC handle state * @param __HANDLE__ ADC handle * @retval None *//* ... */#if(USE_HAL_ADC_REGISTER_CALLBACKS==1)#define__HAL_ADC_RESET_HANDLE_STATE(__HANDLE__)\do{\(__HANDLE__)->State=HAL_ADC_STATE_RESET;\(__HANDLE__)->MspInitCallback=NULL;\(__HANDLE__)->MspDeInitCallback=NULL;\...}while(0).../* ... */#else#define__HAL_ADC_RESET_HANDLE_STATE(__HANDLE__)\((__HANDLE__)->State=HAL_ADC_STATE_RESET).../* ... */#endif/** * @brief Enable the ADC peripheral. * @param __HANDLE__ ADC handle * @retval None *//* ... */#define__HAL_ADC_ENABLE(__HANDLE__)((__HANDLE__)->Instance->CR2|=ADC_CR2_ADON)/** * @brief Disable the ADC peripheral. * @param __HANDLE__ ADC handle * @retval None *//* ... */#define__HAL_ADC_DISABLE(__HANDLE__)((__HANDLE__)->Instance->CR2&=~ADC_CR2_ADON)/** * @brief Enable the ADC end of conversion interrupt. * @param __HANDLE__ specifies the ADC Handle. * @param __INTERRUPT__ ADC Interrupt. * @retval None *//* ... */#define__HAL_ADC_ENABLE_IT(__HANDLE__,__INTERRUPT__)(((__HANDLE__)->Instance->CR1)|=(__INTERRUPT__))/** * @brief Disable the ADC end of conversion interrupt. * @param __HANDLE__ specifies the ADC Handle. * @param __INTERRUPT__ ADC interrupt. * @retval None *//* ... */#define__HAL_ADC_DISABLE_IT(__HANDLE__,__INTERRUPT__)(((__HANDLE__)->Instance->CR1)&=~(__INTERRUPT__))/** @brief Check if the specified ADC interrupt source is enabled or disabled. * @param __HANDLE__ specifies the ADC Handle. * @param __INTERRUPT__ specifies the ADC interrupt source to check. * @retval The new state of __IT__ (TRUE or FALSE). *//* ... */#define__HAL_ADC_GET_IT_SOURCE(__HANDLE__,__INTERRUPT__)(((__HANDLE__)->Instance->CR1&(__INTERRUPT__))==(__INTERRUPT__))/** * @brief Clear the ADC's pending flags. * @param __HANDLE__ specifies the ADC Handle. * @param __FLAG__ ADC flag. * @retval None *//* ... */#define__HAL_ADC_CLEAR_FLAG(__HANDLE__,__FLAG__)(((__HANDLE__)->Instance->SR)=~(__FLAG__))/** * @brief Get the selected ADC's flag status. * @param __HANDLE__ specifies the ADC Handle. * @param __FLAG__ ADC flag. * @retval None *//* ... */#define__HAL_ADC_GET_FLAG(__HANDLE__,__FLAG__)((((__HANDLE__)->Instance->SR)&(__FLAG__))==(__FLAG__))7 defines/** * @} *//* ... *//* Include ADC HAL Extension module */#include"stm32f4xx_hal_adc_ex.h"Exported macro/* Exported functions --------------------------------------------------------*//** @addtogroup ADC_Exported_Functions * @{ *//* ... *//** @addtogroup ADC_Exported_Functions_Group1 * @{ *//* ... *//* Initialization/de-initialization functions ***********************************/HAL_StatusTypeDefHAL_ADC_Init(ADC_HandleTypeDef*hadc);HAL_StatusTypeDefHAL_ADC_DeInit(ADC_HandleTypeDef*hadc);voidHAL_ADC_MspInit(ADC_HandleTypeDef*hadc);voidHAL_ADC_MspDeInit(ADC_HandleTypeDef*hadc);#if(USE_HAL_ADC_REGISTER_CALLBACKS==1)/* Callbacks Register/UnRegister functions ***********************************/HAL_StatusTypeDefHAL_ADC_RegisterCallback(ADC_HandleTypeDef*hadc,HAL_ADC_CallbackIDTypeDefCallbackID,pADC_CallbackTypeDefpCallback);HAL_StatusTypeDefHAL_ADC_UnRegisterCallback(ADC_HandleTypeDef*hadc,HAL_ADC_CallbackIDTypeDefCallbackID);/* ... */#endif/* USE_HAL_ADC_REGISTER_CALLBACKS *//** * @} *//* ... *//** @addtogroup ADC_Exported_Functions_Group2 * @{ *//* ... *//* I/O operation functions ******************************************************/HAL_StatusTypeDefHAL_ADC_Start(ADC_HandleTypeDef*hadc);HAL_StatusTypeDefHAL_ADC_Stop(ADC_HandleTypeDef*hadc);HAL_StatusTypeDefHAL_ADC_PollForConversion(ADC_HandleTypeDef*hadc,uint32_tTimeout);HAL_StatusTypeDefHAL_ADC_PollForEvent(ADC_HandleTypeDef*hadc,uint32_tEventType,uint32_tTimeout);HAL_StatusTypeDefHAL_ADC_Start_IT(ADC_HandleTypeDef*hadc);HAL_StatusTypeDefHAL_ADC_Stop_IT(ADC_HandleTypeDef*hadc);voidHAL_ADC_IRQHandler(ADC_HandleTypeDef*hadc);HAL_StatusTypeDefHAL_ADC_Start_DMA(ADC_HandleTypeDef*hadc,uint32_t*pData,uint32_tLength);HAL_StatusTypeDefHAL_ADC_Stop_DMA(ADC_HandleTypeDef*hadc);uint32_tHAL_ADC_GetValue(ADC_HandleTypeDef*hadc);voidHAL_ADC_ConvCpltCallback(ADC_HandleTypeDef*hadc);voidHAL_ADC_ConvHalfCpltCallback(ADC_HandleTypeDef*hadc);voidHAL_ADC_LevelOutOfWindowCallback(ADC_HandleTypeDef*hadc);voidHAL_ADC_ErrorCallback(ADC_HandleTypeDef*hadc);/** * @} *//* ... *//** @addtogroup ADC_Exported_Functions_Group3 * @{ *//* ... *//* Peripheral Control functions *************************************************/HAL_StatusTypeDefHAL_ADC_ConfigChannel(ADC_HandleTypeDef*hadc,ADC_ChannelConfTypeDef*sConfig);HAL_StatusTypeDefHAL_ADC_AnalogWDGConfig(ADC_HandleTypeDef*hadc,ADC_AnalogWDGConfTypeDef*AnalogWDGConfig);/** * @} *//* ... *//** @addtogroup ADC_Exported_Functions_Group4 * @{ *//* ... *//* Peripheral State functions ***************************************************/uint32_tHAL_ADC_GetState(ADC_HandleTypeDef*hadc);uint32_tHAL_ADC_GetError(ADC_HandleTypeDef*hadc);/** * @} *//* ... *//** * @} *//* ... */Exported functions/* Private types -------------------------------------------------------------*//* Private variables ---------------------------------------------------------*//* Private constants ---------------------------------------------------------*//** @defgroup ADC_Private_Constants ADC Private Constants * @{ *//* ... *//* Delay for ADC stabilization time. *//* Maximum delay is 1us (refer to device datasheet, parameter tSTAB). *//* Unit: us */#defineADC_STAB_DELAY_US3U/* Delay for temperature sensor stabilization time. *//* Maximum delay is 10us (refer to device datasheet, parameter tSTART). *//* Unit: us */#defineADC_TEMPSENSOR_DELAY_US10U/** * @} *//* ... *//* Private macro ------------------------------------------------------------*//** @defgroup ADC_Private_Macros ADC Private Macros * @{ *//* ... *//* Macro reserved for internal HAL driver usage, not intended to be used in code of final user *//* ... *//** * @brief Verification of ADC state: enabled or disabled * @param __HANDLE__ ADC handle * @retval SET (ADC enabled) or RESET (ADC disabled) *//* ... */#defineADC_IS_ENABLE(__HANDLE__)\(((((__HANDLE__)->Instance->SR&ADC_SR_ADONS)==ADC_SR_ADONS)\)?SET:RESET).../** * @brief Test if conversion trigger of regular group is software start * or external trigger. * @param __HANDLE__ ADC handle * @retval SET (software start) or RESET (external trigger) *//* ... */#defineADC_IS_SOFTWARE_START_REGULAR(__HANDLE__)\(((__HANDLE__)->Instance->CR2&ADC_CR2_EXTEN)==RESET).../** * @brief Test if conversion trigger of injected group is software start * or external trigger. * @param __HANDLE__ ADC handle * @retval SET (software start) or RESET (external trigger) *//* ... */#defineADC_IS_SOFTWARE_START_INJECTED(__HANDLE__)\(((__HANDLE__)->Instance->CR2&ADC_CR2_JEXTEN)==RESET).../** * @brief Simultaneously clears and sets specific bits of the handle State * @note: ADC_STATE_CLR_SET() macro is merely aliased to generic macro MODIFY_REG(), * the first parameter is the ADC handle State, the second parameter is the * bit field to clear, the third and last parameter is the bit field to set. * @retval None *//* ... */#defineADC_STATE_CLR_SETMODIFY_REG/** * @brief Clear ADC error code (set it to error code: "no error") * @param __HANDLE__ ADC handle * @retval None *//* ... */#defineADC_CLEAR_ERRORCODE(__HANDLE__)\((__HANDLE__)->ErrorCode=HAL_ADC_ERROR_NONE)...#defineIS_ADC_CLOCKPRESCALER(ADC_CLOCK)(((ADC_CLOCK)==ADC_CLOCK_SYNC_PCLK_DIV2)||\((ADC_CLOCK)==ADC_CLOCK_SYNC_PCLK_DIV4)||\((ADC_CLOCK)==ADC_CLOCK_SYNC_PCLK_DIV6)||\((ADC_CLOCK)==ADC_CLOCK_SYNC_PCLK_DIV8))...#defineIS_ADC_SAMPLING_DELAY(DELAY)(((DELAY)==ADC_TWOSAMPLINGDELAY_5CYCLES)||\((DELAY)==ADC_TWOSAMPLINGDELAY_6CYCLES)||\((DELAY)==ADC_TWOSAMPLINGDELAY_7CYCLES)||\((DELAY)==ADC_TWOSAMPLINGDELAY_8CYCLES)||\((DELAY)==ADC_TWOSAMPLINGDELAY_9CYCLES)||\((DELAY)==ADC_TWOSAMPLINGDELAY_10CYCLES)||\((DELAY)==ADC_TWOSAMPLINGDELAY_11CYCLES)||\((DELAY)==ADC_TWOSAMPLINGDELAY_12CYCLES)||\((DELAY)==ADC_TWOSAMPLINGDELAY_13CYCLES)||\((DELAY)==ADC_TWOSAMPLINGDELAY_14CYCLES)||\((DELAY)==ADC_TWOSAMPLINGDELAY_15CYCLES)||\((DELAY)==ADC_TWOSAMPLINGDELAY_16CYCLES)||\((DELAY)==ADC_TWOSAMPLINGDELAY_17CYCLES)||\((DELAY)==ADC_TWOSAMPLINGDELAY_18CYCLES)||\((DELAY)==ADC_TWOSAMPLINGDELAY_19CYCLES)||\((DELAY)==ADC_TWOSAMPLINGDELAY_20CYCLES))...#defineIS_ADC_RESOLUTION(RESOLUTION)(((RESOLUTION)==ADC_RESOLUTION_12B)||\((RESOLUTION)==ADC_RESOLUTION_10B)||\((RESOLUTION)==ADC_RESOLUTION_8B)||\((RESOLUTION)==ADC_RESOLUTION_6B))...#defineIS_ADC_EXT_TRIG_EDGE(EDGE)(((EDGE)==ADC_EXTERNALTRIGCONVEDGE_NONE)||\((EDGE)==ADC_EXTERNALTRIGCONVEDGE_RISING)||\((EDGE)==ADC_EXTERNALTRIGCONVEDGE_FALLING)||\((EDGE)==ADC_EXTERNALTRIGCONVEDGE_RISINGFALLING))...#defineIS_ADC_EXT_TRIG(REGTRIG)(((REGTRIG)==ADC_EXTERNALTRIGCONV_T1_CC1)||\((REGTRIG)==ADC_EXTERNALTRIGCONV_T1_CC2)||\((REGTRIG)==ADC_EXTERNALTRIGCONV_T1_CC3)||\((REGTRIG)==ADC_EXTERNALTRIGCONV_T2_CC2)||\((REGTRIG)==ADC_EXTERNALTRIGCONV_T2_CC3)||\((REGTRIG)==ADC_EXTERNALTRIGCONV_T2_CC4)||\((REGTRIG)==ADC_EXTERNALTRIGCONV_T2_TRGO)||\((REGTRIG)==ADC_EXTERNALTRIGCONV_T3_CC1)||\((REGTRIG)==ADC_EXTERNALTRIGCONV_T3_TRGO)||\((REGTRIG)==ADC_EXTERNALTRIGCONV_T4_CC4)||\((REGTRIG)==ADC_EXTERNALTRIGCONV_T5_CC1)||\((REGTRIG)==ADC_EXTERNALTRIGCONV_T5_CC2)||\((REGTRIG)==ADC_EXTERNALTRIGCONV_T5_CC3)||\((REGTRIG)==ADC_EXTERNALTRIGCONV_T8_CC1)||\((REGTRIG)==ADC_EXTERNALTRIGCONV_T8_TRGO)||\((REGTRIG)==ADC_EXTERNALTRIGCONV_Ext_IT11)||\((REGTRIG)==ADC_SOFTWARE_START))...#defineIS_ADC_DATA_ALIGN(ALIGN)(((ALIGN)==ADC_DATAALIGN_RIGHT)||\((ALIGN)==ADC_DATAALIGN_LEFT))...#defineIS_ADC_SAMPLE_TIME(TIME)(((TIME)==ADC_SAMPLETIME_3CYCLES)||\((TIME)==ADC_SAMPLETIME_15CYCLES)||\((TIME)==ADC_SAMPLETIME_28CYCLES)||\((TIME)==ADC_SAMPLETIME_56CYCLES)||\((TIME)==ADC_SAMPLETIME_84CYCLES)||\((TIME)==ADC_SAMPLETIME_112CYCLES)||\((TIME)==ADC_SAMPLETIME_144CYCLES)||\((TIME)==ADC_SAMPLETIME_480CYCLES))...#defineIS_ADC_EOCSelection(EOCSelection)(((EOCSelection)==ADC_EOC_SINGLE_CONV)||\((EOCSelection)==ADC_EOC_SEQ_CONV)||\((EOCSelection)==ADC_EOC_SINGLE_SEQ_CONV))...#defineIS_ADC_EVENT_TYPE(EVENT)(((EVENT)==ADC_AWD_EVENT)||\((EVENT)==ADC_OVR_EVENT))...#defineIS_ADC_ANALOG_WATCHDOG(WATCHDOG)(((WATCHDOG)==ADC_ANALOGWATCHDOG_SINGLE_REG)||\((WATCHDOG)==ADC_ANALOGWATCHDOG_SINGLE_INJEC)||\((WATCHDOG)==ADC_ANALOGWATCHDOG_SINGLE_REGINJEC)||\((WATCHDOG)==ADC_ANALOGWATCHDOG_ALL_REG)||\((WATCHDOG)==ADC_ANALOGWATCHDOG_ALL_INJEC)||\((WATCHDOG)==ADC_ANALOGWATCHDOG_ALL_REGINJEC)||\((WATCHDOG)==ADC_ANALOGWATCHDOG_NONE))...#defineIS_ADC_CHANNELS_TYPE(CHANNEL_TYPE)(((CHANNEL_TYPE)==ADC_ALL_CHANNELS)||\((CHANNEL_TYPE)==ADC_REGULAR_CHANNELS)||\((CHANNEL_TYPE)==ADC_INJECTED_CHANNELS))...#defineIS_ADC_THRESHOLD(THRESHOLD)((THRESHOLD)<=0xFFFU)#defineIS_ADC_REGULAR_LENGTH(LENGTH)(((LENGTH)>=1U)&&((LENGTH)<=16U))#defineIS_ADC_REGULAR_RANK(RANK)(((RANK)>=1U)&&((RANK)<=(16U)))#defineIS_ADC_REGULAR_DISC_NUMBER(NUMBER)(((NUMBER)>=1U)&&((NUMBER)<=8U))#defineIS_ADC_RANGE(RESOLUTION,ADC_VALUE)\((((RESOLUTION)==ADC_RESOLUTION_12B)&&((ADC_VALUE)<=0x0FFFU))||\(((RESOLUTION)==ADC_RESOLUTION_10B)&&((ADC_VALUE)<=0x03FFU))||\(((RESOLUTION)==ADC_RESOLUTION_8B)&&((ADC_VALUE)<=0x00FFU))||\(((RESOLUTION)==ADC_RESOLUTION_6B)&&((ADC_VALUE)<=0x003FU))).../** * @brief Set ADC Regular channel sequence length. * @param _NbrOfConversion_ Regular channel sequence length. * @retval None *//* ... */#defineADC_SQR1(_NbrOfConversion_)(((_NbrOfConversion_)-(uint8_t)1U)<<20U)/** * @brief Set the ADC's sample time for channel numbers between 10 and 18. * @param _SAMPLETIME_ Sample time parameter. * @param _CHANNELNB_ Channel number. * @retval None *//* ... */#defineADC_SMPR1(_SAMPLETIME_,_CHANNELNB_)((_SAMPLETIME_)<<(3U*(((uint32_t)((uint16_t)(_CHANNELNB_)))-10U)))/** * @brief Set the ADC's sample time for channel numbers between 0 and 9. * @param _SAMPLETIME_ Sample time parameter. * @param _CHANNELNB_ Channel number. * @retval None *//* ... */#defineADC_SMPR2(_SAMPLETIME_,_CHANNELNB_)((_SAMPLETIME_)<<(3U*((uint32_t)((uint16_t)(_CHANNELNB_)))))/** * @brief Set the selected regular channel rank for rank between 1 and 6. * @param _CHANNELNB_ Channel number. * @param _RANKNB_ Rank number. * @retval None *//* ... */#defineADC_SQR3_RK(_CHANNELNB_,_RANKNB_)(((uint32_t)((uint16_t)(_CHANNELNB_)))<<(5U*((_RANKNB_)-1U)))/** * @brief Set the selected regular channel rank for rank between 7 and 12. * @param _CHANNELNB_ Channel number. * @param _RANKNB_ Rank number. * @retval None *//* ... */#defineADC_SQR2_RK(_CHANNELNB_,_RANKNB_)(((uint32_t)((uint16_t)(_CHANNELNB_)))<<(5U*((_RANKNB_)-7U)))/** * @brief Set the selected regular channel rank for rank between 13 and 16. * @param _CHANNELNB_ Channel number. * @param _RANKNB_ Rank number. * @retval None *//* ... */#defineADC_SQR1_RK(_CHANNELNB_,_RANKNB_)(((uint32_t)((uint16_t)(_CHANNELNB_)))<<(5U*((_RANKNB_)-13U)))/** * @brief Enable ADC continuous conversion mode. * @param _CONTINUOUS_MODE_ Continuous mode. * @retval None *//* ... */#defineADC_CR2_CONTINUOUS(_CONTINUOUS_MODE_)((_CONTINUOUS_MODE_)<<1U)/** * @brief Configures the number of discontinuous conversions for the regular group channels. * @param _NBR_DISCONTINUOUSCONV_ Number of discontinuous conversions. * @retval None *//* ... */#defineADC_CR1_DISCONTINUOUS(_NBR_DISCONTINUOUSCONV_)(((_NBR_DISCONTINUOUSCONV_)-1U)<<ADC_CR1_DISCNUM_Pos)/** * @brief Enable ADC scan mode. * @param _SCANCONV_MODE_ Scan conversion mode. * @retval None *//* ... */#defineADC_CR1_SCANCONV(_SCANCONV_MODE_)((_SCANCONV_MODE_)<<8U)/** * @brief Enable the ADC end of conversion selection. * @param _EOCSelection_MODE_ End of conversion selection mode. * @retval None *//* ... */#defineADC_CR2_EOCSelection(_EOCSelection_MODE_)((_EOCSelection_MODE_)<<10U)/** * @brief Enable the ADC DMA continuous request. * @param _DMAContReq_MODE_ DMA continuous request mode. * @retval None *//* ... */#defineADC_CR2_DMAContReq(_DMAContReq_MODE_)((_DMAContReq_MODE_)<<9U)/** * @brief Return resolution bits in CR1 register. * @param __HANDLE__ ADC handle * @retval None *//* ... */#defineADC_GET_RESOLUTION(__HANDLE__)(((__HANDLE__)->Instance->CR1)&ADC_CR1_RES)35 defines/** * @} *//* ... *//* Private functions ---------------------------------------------------------*//** @defgroup ADC_Private_Functions ADC Private Functions * @{ *//* ... *//** * @} *//* ... *//** * @} *//* ... *//** * @} *//* ... */#ifdef__cplusplus}extern "C" { ... }#endif/* ... */#endif/*__STM32F4xx_ADC_H */
Details
Show: from
Types: Columns:
All items filtered out
All items filtered out
This file uses the notable symbols shown below. Click anywhere in the file to view more details.