Mbed for VNG board

Fork of mbed-src by mbed official

Committer:
mbed_official
Date:
Fri Nov 07 15:45:07 2014 +0000
Revision:
394:83f921546702
Parent:
targets/cmsis/TARGET_STM/TARGET_NUCLEO_L152RE/stm32l1xx_hal_adc_ex.h@354:e67efb2aab0e
Synchronized with git revision aab52cb7ec5a665869e507dd988bbfd55b7e087e

Full URL: https://github.com/mbedmicro/mbed/commit/aab52cb7ec5a665869e507dd988bbfd55b7e087e/

Tests: Fix cpputest testrunner

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 354:e67efb2aab0e 1 /**
mbed_official 354:e67efb2aab0e 2 ******************************************************************************
mbed_official 354:e67efb2aab0e 3 * @file stm32l1xx_hal_adc_ex.h
mbed_official 354:e67efb2aab0e 4 * @author MCD Application Team
mbed_official 354:e67efb2aab0e 5 * @version V1.0.0
mbed_official 354:e67efb2aab0e 6 * @date 5-September-2014
mbed_official 354:e67efb2aab0e 7 * @brief Header file of ADC HAL Extension module.
mbed_official 354:e67efb2aab0e 8 ******************************************************************************
mbed_official 354:e67efb2aab0e 9 * @attention
mbed_official 354:e67efb2aab0e 10 *
mbed_official 354:e67efb2aab0e 11 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
mbed_official 354:e67efb2aab0e 12 *
mbed_official 354:e67efb2aab0e 13 * Redistribution and use in source and binary forms, with or without modification,
mbed_official 354:e67efb2aab0e 14 * are permitted provided that the following conditions are met:
mbed_official 354:e67efb2aab0e 15 * 1. Redistributions of source code must retain the above copyright notice,
mbed_official 354:e67efb2aab0e 16 * this list of conditions and the following disclaimer.
mbed_official 354:e67efb2aab0e 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
mbed_official 354:e67efb2aab0e 18 * this list of conditions and the following disclaimer in the documentation
mbed_official 354:e67efb2aab0e 19 * and/or other materials provided with the distribution.
mbed_official 354:e67efb2aab0e 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
mbed_official 354:e67efb2aab0e 21 * may be used to endorse or promote products derived from this software
mbed_official 354:e67efb2aab0e 22 * without specific prior written permission.
mbed_official 354:e67efb2aab0e 23 *
mbed_official 354:e67efb2aab0e 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
mbed_official 354:e67efb2aab0e 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
mbed_official 354:e67efb2aab0e 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
mbed_official 354:e67efb2aab0e 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
mbed_official 354:e67efb2aab0e 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
mbed_official 354:e67efb2aab0e 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
mbed_official 354:e67efb2aab0e 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
mbed_official 354:e67efb2aab0e 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
mbed_official 354:e67efb2aab0e 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
mbed_official 354:e67efb2aab0e 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
mbed_official 354:e67efb2aab0e 34 *
mbed_official 354:e67efb2aab0e 35 ******************************************************************************
mbed_official 354:e67efb2aab0e 36 */
mbed_official 354:e67efb2aab0e 37
mbed_official 354:e67efb2aab0e 38 /* Define to prevent recursive inclusion -------------------------------------*/
mbed_official 354:e67efb2aab0e 39 #ifndef __STM32L1xx_HAL_ADC_EX_H
mbed_official 354:e67efb2aab0e 40 #define __STM32L1xx_HAL_ADC_EX_H
mbed_official 354:e67efb2aab0e 41
mbed_official 354:e67efb2aab0e 42 #ifdef __cplusplus
mbed_official 354:e67efb2aab0e 43 extern "C" {
mbed_official 354:e67efb2aab0e 44 #endif
mbed_official 354:e67efb2aab0e 45
mbed_official 354:e67efb2aab0e 46 /* Includes ------------------------------------------------------------------*/
mbed_official 354:e67efb2aab0e 47 #include "stm32l1xx_hal_def.h"
mbed_official 354:e67efb2aab0e 48
mbed_official 354:e67efb2aab0e 49 /** @addtogroup STM32L1xx_HAL_Driver
mbed_official 354:e67efb2aab0e 50 * @{
mbed_official 354:e67efb2aab0e 51 */
mbed_official 354:e67efb2aab0e 52
mbed_official 354:e67efb2aab0e 53 /** @addtogroup ADCEx
mbed_official 354:e67efb2aab0e 54 * @{
mbed_official 354:e67efb2aab0e 55 */
mbed_official 354:e67efb2aab0e 56
mbed_official 354:e67efb2aab0e 57 /* Exported types ------------------------------------------------------------*/
mbed_official 354:e67efb2aab0e 58 /** @defgroup ADCEx_Exported_Types ADCEx Exported Types
mbed_official 354:e67efb2aab0e 59 * @{
mbed_official 354:e67efb2aab0e 60 */
mbed_official 354:e67efb2aab0e 61
mbed_official 354:e67efb2aab0e 62 /**
mbed_official 354:e67efb2aab0e 63 * @brief ADC Configuration injected Channel structure definition
mbed_official 354:e67efb2aab0e 64 * @note Parameters of this structure are shared within 2 scopes:
mbed_official 354:e67efb2aab0e 65 * - Scope channel: InjectedChannel, InjectedRank, InjectedSamplingTime, InjectedOffset
mbed_official 354:e67efb2aab0e 66 * - Scope injected group (affects all channels of injected group): InjectedNbrOfConversion, InjectedDiscontinuousConvMode,
mbed_official 354:e67efb2aab0e 67 * AutoInjectedConv, ExternalTrigInjecConvEdge, ExternalTrigInjecConv.
mbed_official 354:e67efb2aab0e 68 * @note The setting of these parameters with function HAL_ADCEx_InjectedConfigChannel() is conditioned to ADC state.
mbed_official 354:e67efb2aab0e 69 * ADC state can be either:
mbed_official 354:e67efb2aab0e 70 * - For all parameters: ADC disabled
mbed_official 354:e67efb2aab0e 71 * - For all except parameters 'InjectedDiscontinuousConvMode' and 'AutoInjectedConv': ADC enabled without conversion on going on injected group.
mbed_official 354:e67efb2aab0e 72 * - For parameters 'ExternalTrigInjecConv' and 'ExternalTrigInjecConvEdge': ADC enabled, even with conversion on going on injected group.
mbed_official 354:e67efb2aab0e 73 */
mbed_official 354:e67efb2aab0e 74 typedef struct
mbed_official 354:e67efb2aab0e 75 {
mbed_official 354:e67efb2aab0e 76 uint32_t InjectedChannel; /*!< Selection of ADC channel to configure
mbed_official 354:e67efb2aab0e 77 This parameter can be a value of @ref ADC_channels
mbed_official 354:e67efb2aab0e 78 Note: Depending on devices, some channels may not be available on package pins. Refer to device datasheet for channels availability. */
mbed_official 354:e67efb2aab0e 79 uint32_t InjectedRank; /*!< Rank in the injected group sequencer
mbed_official 354:e67efb2aab0e 80 This parameter must be a value of @ref ADCEx_injected_rank
mbed_official 354:e67efb2aab0e 81 Note: In case of need to disable a channel or change order of conversion sequencer, rank containing a previous channel setting can be overwritten by the new channel setting (or parameter number of conversions can be adjusted) */
mbed_official 354:e67efb2aab0e 82 uint32_t InjectedSamplingTime; /*!< Sampling time value to be set for the selected channel.
mbed_official 354:e67efb2aab0e 83 Unit: ADC clock cycles
mbed_official 354:e67efb2aab0e 84 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).
mbed_official 354:e67efb2aab0e 85 This parameter can be a value of @ref ADC_sampling_times
mbed_official 354:e67efb2aab0e 86 Caution: This parameter updates the parameter property of the channel, that can be used into regular and/or injected groups.
mbed_official 354:e67efb2aab0e 87 If this same channel has been previously configured in the other group (regular/injected), it will be updated to last setting.
mbed_official 354:e67efb2aab0e 88 Note: In case of usage of internal measurement channels (VrefInt/Vbat/TempSensor),
mbed_official 354:e67efb2aab0e 89 sampling time constraints must be respected (sampling time can be adjusted in function of ADC clock frequency and sampling time setting)
mbed_official 354:e67efb2aab0e 90 Refer to device datasheet for timings values, parameters TS_vrefint, TS_temp (values rough order: 4us min). */
mbed_official 354:e67efb2aab0e 91 uint32_t InjectedOffset; /*!< Defines the offset to be subtracted from the raw converted data (for channels set on injected group only).
mbed_official 354:e67efb2aab0e 92 Offset value must be a positive number.
mbed_official 354:e67efb2aab0e 93 Depending of ADC resolution selected (12, 10, 8 or 6 bits),
mbed_official 354:e67efb2aab0e 94 this parameter must be a number between Min_Data = 0x000 and Max_Data = 0xFFF, 0x3FF, 0xFF or 0x3F respectively. */
mbed_official 354:e67efb2aab0e 95 uint32_t InjectedNbrOfConversion; /*!< Specifies the number of ranks that will be converted within the injected group sequencer.
mbed_official 354:e67efb2aab0e 96 To use the injected group sequencer and convert several ranks, parameter 'ScanConvMode' must be enabled.
mbed_official 354:e67efb2aab0e 97 This parameter must be a number between Min_Data = 1 and Max_Data = 4.
mbed_official 354:e67efb2aab0e 98 Caution: this setting impacts the entire injected group. Therefore, call of HAL_ADCEx_InjectedConfigChannel() to
mbed_official 354:e67efb2aab0e 99 configure a channel on injected group can impact the configuration of other channels previously set. */
mbed_official 354:e67efb2aab0e 100 uint32_t InjectedDiscontinuousConvMode; /*!< Specifies whether the conversions sequence of injected group is performed in Complete-sequence/Discontinuous-sequence (main sequence subdivided in successive parts).
mbed_official 354:e67efb2aab0e 101 Discontinuous mode is used only if sequencer is enabled (parameter 'ScanConvMode'). If sequencer is disabled, this parameter is discarded.
mbed_official 354:e67efb2aab0e 102 Discontinuous mode can be enabled only if continuous mode is disabled. If continuous mode is enabled, this parameter setting is discarded.
mbed_official 354:e67efb2aab0e 103 This parameter can be set to ENABLE or DISABLE.
mbed_official 354:e67efb2aab0e 104 Note: For injected group, number of discontinuous ranks increment is fixed to one-by-one.
mbed_official 354:e67efb2aab0e 105 Caution: this setting impacts the entire injected group. Therefore, call of HAL_ADCEx_InjectedConfigChannel() to
mbed_official 354:e67efb2aab0e 106 configure a channel on injected group can impact the configuration of other channels previously set. */
mbed_official 354:e67efb2aab0e 107 uint32_t AutoInjectedConv; /*!< Enables or disables the selected ADC automatic injected group conversion after regular one
mbed_official 354:e67efb2aab0e 108 This parameter can be set to ENABLE or DISABLE.
mbed_official 354:e67efb2aab0e 109 Note: To use Automatic injected conversion, discontinuous mode must be disabled ('DiscontinuousConvMode' and 'InjectedDiscontinuousConvMode' set to DISABLE)
mbed_official 354:e67efb2aab0e 110 Note: To use Automatic injected conversion, injected group external triggers must be disabled ('ExternalTrigInjecConv' set to ADC_SOFTWARE_START)
mbed_official 354:e67efb2aab0e 111 Note: In case of DMA used with regular group: if DMA configured in normal mode (single shot) JAUTO will be stopped upon DMA transfer complete.
mbed_official 354:e67efb2aab0e 112 To maintain JAUTO always enabled, DMA must be configured in circular mode.
mbed_official 354:e67efb2aab0e 113 Caution: this setting impacts the entire injected group. Therefore, call of HAL_ADCEx_InjectedConfigChannel() to
mbed_official 354:e67efb2aab0e 114 configure a channel on injected group can impact the configuration of other channels previously set. */
mbed_official 354:e67efb2aab0e 115 uint32_t ExternalTrigInjecConv; /*!< Selects the external event used to trigger the conversion start of injected group.
mbed_official 354:e67efb2aab0e 116 If set to ADC_INJECTED_SOFTWARE_START, external triggers are disabled.
mbed_official 354:e67efb2aab0e 117 If set to external trigger source, triggering is on event rising edge.
mbed_official 354:e67efb2aab0e 118 This parameter can be a value of @ref ADCEx_External_trigger_source_Injected
mbed_official 354:e67efb2aab0e 119 Note: This parameter must be modified when ADC is disabled (before ADC start conversion or after ADC stop conversion).
mbed_official 354:e67efb2aab0e 120 If ADC is enabled, this parameter setting is bypassed without error reporting (as it can be the expected behaviour in case of another parameter update on the fly)
mbed_official 354:e67efb2aab0e 121 Caution: this setting impacts the entire injected group. Therefore, call of HAL_ADCEx_InjectedConfigChannel() to
mbed_official 354:e67efb2aab0e 122 configure a channel on injected group can impact the configuration of other channels previously set. */
mbed_official 354:e67efb2aab0e 123 uint32_t ExternalTrigInjecConvEdge; /*!< Selects the external trigger edge of injected group.
mbed_official 354:e67efb2aab0e 124 This parameter can be a value of @ref ADCEx_External_trigger_edge_Injected.
mbed_official 354:e67efb2aab0e 125 If trigger is set to ADC_INJECTED_SOFTWARE_START, this parameter is discarded.
mbed_official 354:e67efb2aab0e 126 Caution: this setting impacts the entire injected group. Therefore, call of HAL_ADCEx_InjectedConfigChannel() to
mbed_official 354:e67efb2aab0e 127 configure a channel on injected group can impact the configuration of other channels previously set. */
mbed_official 354:e67efb2aab0e 128 }ADC_InjectionConfTypeDef;
mbed_official 354:e67efb2aab0e 129 /**
mbed_official 354:e67efb2aab0e 130 * @}
mbed_official 354:e67efb2aab0e 131 */
mbed_official 354:e67efb2aab0e 132
mbed_official 354:e67efb2aab0e 133
mbed_official 354:e67efb2aab0e 134 /* Exported constants --------------------------------------------------------*/
mbed_official 354:e67efb2aab0e 135
mbed_official 354:e67efb2aab0e 136 /** @defgroup ADCEx_Exported_Constants ADCEx Exported Constants
mbed_official 354:e67efb2aab0e 137 * @{
mbed_official 354:e67efb2aab0e 138 */
mbed_official 354:e67efb2aab0e 139
mbed_official 354:e67efb2aab0e 140 /** @defgroup ADCEx_injected_rank ADCEx injected rank
mbed_official 354:e67efb2aab0e 141 * @{
mbed_official 354:e67efb2aab0e 142 */
mbed_official 354:e67efb2aab0e 143 #define ADC_INJECTED_RANK_1 ((uint32_t)0x00000001)
mbed_official 354:e67efb2aab0e 144 #define ADC_INJECTED_RANK_2 ((uint32_t)0x00000002)
mbed_official 354:e67efb2aab0e 145 #define ADC_INJECTED_RANK_3 ((uint32_t)0x00000003)
mbed_official 354:e67efb2aab0e 146 #define ADC_INJECTED_RANK_4 ((uint32_t)0x00000004)
mbed_official 354:e67efb2aab0e 147
mbed_official 354:e67efb2aab0e 148 #define IS_ADC_INJECTED_RANK(CHANNEL) (((CHANNEL) == ADC_INJECTED_RANK_1) || \
mbed_official 354:e67efb2aab0e 149 ((CHANNEL) == ADC_INJECTED_RANK_2) || \
mbed_official 354:e67efb2aab0e 150 ((CHANNEL) == ADC_INJECTED_RANK_3) || \
mbed_official 354:e67efb2aab0e 151 ((CHANNEL) == ADC_INJECTED_RANK_4) )
mbed_official 354:e67efb2aab0e 152 /**
mbed_official 354:e67efb2aab0e 153 * @}
mbed_official 354:e67efb2aab0e 154 */
mbed_official 354:e67efb2aab0e 155
mbed_official 354:e67efb2aab0e 156 /** @defgroup ADCEx_External_trigger_edge_Injected ADCEx External trigger edge Injected
mbed_official 354:e67efb2aab0e 157 * @{
mbed_official 354:e67efb2aab0e 158 */
mbed_official 354:e67efb2aab0e 159 #define ADC_EXTERNALTRIGINJECCONV_EDGE_NONE ((uint32_t)0x00000000)
mbed_official 354:e67efb2aab0e 160 #define ADC_EXTERNALTRIGINJECCONV_EDGE_RISING ((uint32_t)ADC_CR2_JEXTEN_0)
mbed_official 354:e67efb2aab0e 161 #define ADC_EXTERNALTRIGINJECCONV_EDGE_FALLING ((uint32_t)ADC_CR2_JEXTEN_1)
mbed_official 354:e67efb2aab0e 162 #define ADC_EXTERNALTRIGINJECCONV_EDGE_RISINGFALLING ((uint32_t)ADC_CR2_JEXTEN)
mbed_official 354:e67efb2aab0e 163
mbed_official 354:e67efb2aab0e 164 #define IS_ADC_EXTTRIGINJEC_EDGE(EDGE) (((EDGE) == ADC_EXTERNALTRIGINJECCONV_EDGE_NONE) || \
mbed_official 354:e67efb2aab0e 165 ((EDGE) == ADC_EXTERNALTRIGINJECCONV_EDGE_RISING) || \
mbed_official 354:e67efb2aab0e 166 ((EDGE) == ADC_EXTERNALTRIGINJECCONV_EDGE_FALLING) || \
mbed_official 354:e67efb2aab0e 167 ((EDGE) == ADC_EXTERNALTRIGINJECCONV_EDGE_RISINGFALLING) )
mbed_official 354:e67efb2aab0e 168 /**
mbed_official 354:e67efb2aab0e 169 * @}
mbed_official 354:e67efb2aab0e 170 */
mbed_official 354:e67efb2aab0e 171
mbed_official 354:e67efb2aab0e 172 /** @defgroup ADCEx_External_trigger_source_Injected ADCEx External trigger source Injected
mbed_official 354:e67efb2aab0e 173 * @{
mbed_official 354:e67efb2aab0e 174 */
mbed_official 354:e67efb2aab0e 175 /* External triggers for injected groups of ADC1 */
mbed_official 354:e67efb2aab0e 176 #define ADC_EXTERNALTRIGINJECCONV_T2_CC1 ADC_EXTERNALTRIGINJEC_T2_CC1
mbed_official 354:e67efb2aab0e 177 #define ADC_EXTERNALTRIGINJECCONV_T2_TRGO ADC_EXTERNALTRIGINJEC_T2_TRGO
mbed_official 354:e67efb2aab0e 178 #define ADC_EXTERNALTRIGINJECCONV_T3_CC4 ADC_EXTERNALTRIGINJEC_T3_CC4
mbed_official 354:e67efb2aab0e 179 #define ADC_EXTERNALTRIGINJECCONV_T4_TRGO ADC_EXTERNALTRIGINJEC_T4_TRGO
mbed_official 354:e67efb2aab0e 180 #define ADC_EXTERNALTRIGINJECCONV_T4_CC1 ADC_EXTERNALTRIGINJEC_T4_CC1
mbed_official 354:e67efb2aab0e 181 #define ADC_EXTERNALTRIGINJECCONV_T4_CC2 ADC_EXTERNALTRIGINJEC_T4_CC2
mbed_official 354:e67efb2aab0e 182 #define ADC_EXTERNALTRIGINJECCONV_T4_CC3 ADC_EXTERNALTRIGINJEC_T4_CC3
mbed_official 354:e67efb2aab0e 183 #define ADC_EXTERNALTRIGINJECCONV_T7_TRGO ADC_EXTERNALTRIGINJEC_T7_TRGO
mbed_official 354:e67efb2aab0e 184 #define ADC_EXTERNALTRIGINJECCONV_T9_CC1 ADC_EXTERNALTRIGINJEC_T9_CC1
mbed_official 354:e67efb2aab0e 185 #define ADC_EXTERNALTRIGINJECCONV_T9_TRGO ADC_EXTERNALTRIGINJEC_T9_TRGO
mbed_official 354:e67efb2aab0e 186 #define ADC_EXTERNALTRIGINJECCONV_T10_CC1 ADC_EXTERNALTRIGINJEC_T10_CC1
mbed_official 354:e67efb2aab0e 187 #define ADC_EXTERNALTRIGINJECCONV_EXT_IT15 ADC_EXTERNALTRIGINJEC_EXT_IT15
mbed_official 354:e67efb2aab0e 188
mbed_official 354:e67efb2aab0e 189 #define ADC_INJECTED_SOFTWARE_START ((uint32_t)0x00000010)
mbed_official 354:e67efb2aab0e 190
mbed_official 354:e67efb2aab0e 191 #define IS_ADC_EXTTRIGINJEC(REGTRIG) (((REGTRIG) == ADC_EXTERNALTRIGINJECCONV_T2_CC1) || \
mbed_official 354:e67efb2aab0e 192 ((REGTRIG) == ADC_EXTERNALTRIGINJECCONV_T2_TRGO) || \
mbed_official 354:e67efb2aab0e 193 ((REGTRIG) == ADC_EXTERNALTRIGINJECCONV_T3_CC4) || \
mbed_official 354:e67efb2aab0e 194 ((REGTRIG) == ADC_EXTERNALTRIGINJECCONV_T4_TRGO) || \
mbed_official 354:e67efb2aab0e 195 ((REGTRIG) == ADC_EXTERNALTRIGINJECCONV_T4_CC1) || \
mbed_official 354:e67efb2aab0e 196 ((REGTRIG) == ADC_EXTERNALTRIGINJECCONV_T4_CC2) || \
mbed_official 354:e67efb2aab0e 197 ((REGTRIG) == ADC_EXTERNALTRIGINJECCONV_T4_CC3) || \
mbed_official 354:e67efb2aab0e 198 ((REGTRIG) == ADC_EXTERNALTRIGINJECCONV_T7_TRGO) || \
mbed_official 354:e67efb2aab0e 199 ((REGTRIG) == ADC_EXTERNALTRIGINJECCONV_T9_CC1) || \
mbed_official 354:e67efb2aab0e 200 ((REGTRIG) == ADC_EXTERNALTRIGINJECCONV_T9_TRGO) || \
mbed_official 354:e67efb2aab0e 201 ((REGTRIG) == ADC_EXTERNALTRIGINJECCONV_T10_CC1) || \
mbed_official 354:e67efb2aab0e 202 ((REGTRIG) == ADC_EXTERNALTRIGINJECCONV_EXT_IT15) || \
mbed_official 354:e67efb2aab0e 203 ((REGTRIG) == ADC_SOFTWARE_START) )
mbed_official 354:e67efb2aab0e 204 /**
mbed_official 354:e67efb2aab0e 205 * @}
mbed_official 354:e67efb2aab0e 206 */
mbed_official 354:e67efb2aab0e 207
mbed_official 354:e67efb2aab0e 208 /** @defgroup ADCEx_Internal_HAL_driver_Ext_trig_src_Injected ADCEx Internal HAL driver Ext trig src Injected
mbed_official 354:e67efb2aab0e 209 * @{
mbed_official 354:e67efb2aab0e 210 */
mbed_official 354:e67efb2aab0e 211
mbed_official 354:e67efb2aab0e 212 /* List of external triggers of injected group for ADC1: */
mbed_official 354:e67efb2aab0e 213 /* (used internally by HAL driver. To not use into HAL structure parameters) */
mbed_official 354:e67efb2aab0e 214 #define ADC_EXTERNALTRIGINJEC_T9_CC1 ((uint32_t) 0x00000000)
mbed_official 354:e67efb2aab0e 215 #define ADC_EXTERNALTRIGINJEC_T9_TRGO ((uint32_t)( ADC_CR2_JEXTSEL_0))
mbed_official 354:e67efb2aab0e 216 #define ADC_EXTERNALTRIGINJEC_T2_TRGO ((uint32_t)( ADC_CR2_JEXTSEL_1 ))
mbed_official 354:e67efb2aab0e 217 #define ADC_EXTERNALTRIGINJEC_T2_CC1 ((uint32_t)( ADC_CR2_JEXTSEL_1 | ADC_CR2_JEXTSEL_0))
mbed_official 354:e67efb2aab0e 218 #define ADC_EXTERNALTRIGINJEC_T3_CC4 ((uint32_t)( ADC_CR2_JEXTSEL_2 ))
mbed_official 354:e67efb2aab0e 219 #define ADC_EXTERNALTRIGINJEC_T4_TRGO ((uint32_t)( ADC_CR2_JEXTSEL_2 | ADC_CR2_JEXTSEL_0))
mbed_official 354:e67efb2aab0e 220 #define ADC_EXTERNALTRIGINJEC_T4_CC1 ((uint32_t)( ADC_CR2_JEXTSEL_2 | ADC_CR2_JEXTSEL_1 ))
mbed_official 354:e67efb2aab0e 221 #define ADC_EXTERNALTRIGINJEC_T4_CC2 ((uint32_t)( ADC_CR2_JEXTSEL_2 | ADC_CR2_JEXTSEL_1 | ADC_CR2_JEXTSEL_0))
mbed_official 354:e67efb2aab0e 222 #define ADC_EXTERNALTRIGINJEC_T4_CC3 ((uint32_t)(ADC_CR2_JEXTSEL_3 ))
mbed_official 354:e67efb2aab0e 223 #define ADC_EXTERNALTRIGINJEC_T10_CC1 ((uint32_t)(ADC_CR2_JEXTSEL_3 | ADC_CR2_JEXTSEL_0))
mbed_official 354:e67efb2aab0e 224 #define ADC_EXTERNALTRIGINJEC_T7_TRGO ((uint32_t)(ADC_CR2_JEXTSEL_3 | ADC_CR2_JEXTSEL_1 ))
mbed_official 354:e67efb2aab0e 225 #define ADC_EXTERNALTRIGINJEC_EXT_IT15 ((uint32_t)(ADC_CR2_JEXTSEL_3 | ADC_CR2_JEXTSEL_2 | ADC_CR2_JEXTSEL_1 | ADC_CR2_JEXTSEL_0))
mbed_official 354:e67efb2aab0e 226
mbed_official 354:e67efb2aab0e 227 /**
mbed_official 354:e67efb2aab0e 228 * @}
mbed_official 354:e67efb2aab0e 229 */
mbed_official 354:e67efb2aab0e 230
mbed_official 354:e67efb2aab0e 231
mbed_official 354:e67efb2aab0e 232 /** @defgroup ADCEx_injected_nb_conv_verification ADCEx injected nb conv verification
mbed_official 354:e67efb2aab0e 233 * @{
mbed_official 354:e67efb2aab0e 234 */
mbed_official 354:e67efb2aab0e 235 #define IS_ADC_INJECTED_NB_CONV(LENGTH) (((LENGTH) >= ((uint32_t)1)) && ((LENGTH) <= ((uint32_t)4)))
mbed_official 354:e67efb2aab0e 236 /**
mbed_official 354:e67efb2aab0e 237 * @}
mbed_official 354:e67efb2aab0e 238 */
mbed_official 354:e67efb2aab0e 239
mbed_official 354:e67efb2aab0e 240 /**
mbed_official 354:e67efb2aab0e 241 * @}
mbed_official 354:e67efb2aab0e 242 */
mbed_official 354:e67efb2aab0e 243
mbed_official 354:e67efb2aab0e 244
mbed_official 354:e67efb2aab0e 245 /* Exported macro ------------------------------------------------------------*/
mbed_official 354:e67efb2aab0e 246
mbed_official 354:e67efb2aab0e 247 /** @defgroup ADCEx_Exported_Macros ADCEx Exported Macros
mbed_official 354:e67efb2aab0e 248 * @{
mbed_official 354:e67efb2aab0e 249 */
mbed_official 354:e67efb2aab0e 250 /* Macro for internal HAL driver usage, and possibly can be used into code of */
mbed_official 354:e67efb2aab0e 251 /* final user. */
mbed_official 354:e67efb2aab0e 252
mbed_official 354:e67efb2aab0e 253 /**
mbed_official 354:e67efb2aab0e 254 * @brief Selection of channels bank.
mbed_official 354:e67efb2aab0e 255 * Note: Banks availability depends on devices categories.
mbed_official 354:e67efb2aab0e 256 * This macro is intended to change bank selection quickly on the fly,
mbed_official 354:e67efb2aab0e 257 * without going through ADC init structure update and execution of function
mbed_official 354:e67efb2aab0e 258 * 'HAL_ADC_Init()'.
mbed_official 354:e67efb2aab0e 259 * @param __HANDLE__: ADC handle
mbed_official 354:e67efb2aab0e 260 * @param __BANK__: Bank selection. This parameter can be a value of @ref ADC_ChannelsBank.
mbed_official 354:e67efb2aab0e 261 * @retval None
mbed_official 354:e67efb2aab0e 262 */
mbed_official 354:e67efb2aab0e 263 #define __HAL_ADC_CHANNELS_BANK(__HANDLE__, __BANK__) \
mbed_official 354:e67efb2aab0e 264 MODIFY_REG((__HANDLE__)->Instance->CR2, ADC_CR2_CFG, (__BANK__))
mbed_official 354:e67efb2aab0e 265
mbed_official 354:e67efb2aab0e 266 #if defined(STM32L100xC) || defined (STM32L151xC) || defined (STM32L152xC) || defined (STM32L162xC) || defined(STM32L151xCA) || defined (STM32L151xD) || defined (STM32L152xCA) || defined (STM32L152xD) || defined (STM32L162xCA) || defined (STM32L162xD) || defined(STM32L151xE) || defined (STM32L152xE) || defined (STM32L162xE)
mbed_official 354:e67efb2aab0e 267 /**
mbed_official 354:e67efb2aab0e 268 * @brief Configures the ADC channels speed.
mbed_official 354:e67efb2aab0e 269 * Limited to channels 3, 8, 13 and to devices category Cat.3, Cat.4, Cat.5.
mbed_official 354:e67efb2aab0e 270 * - For ADC_CHANNEL_3: Used as ADC direct channel (fast channel) if OPAMP1 is
mbed_official 354:e67efb2aab0e 271 * in power down mode.
mbed_official 354:e67efb2aab0e 272 * - For ADC_CHANNEL_8: Used as ADC direct channel (fast channel) if OPAMP2 is
mbed_official 354:e67efb2aab0e 273 * in power down mode.
mbed_official 354:e67efb2aab0e 274 * - For ADC_CHANNEL_13: Used as ADC re-routed channel if OPAMP3 is in
mbed_official 354:e67efb2aab0e 275 * power down mode. Otherwise, channel 13 is connected to OPAMP3 output and
mbed_official 354:e67efb2aab0e 276 * routed through switches COMP1_SW1 and VCOMP to ADC switch matrix.
mbed_official 354:e67efb2aab0e 277 * (Note: OPAMP3 is available on STM32L1 Cat.4 only).
mbed_official 354:e67efb2aab0e 278 * @param __CHANNEL__: ADC channel
mbed_official 354:e67efb2aab0e 279 * This parameter can be one of the following values:
mbed_official 354:e67efb2aab0e 280 * @arg ADC_CHANNEL_3: Channel 3 is selected.
mbed_official 354:e67efb2aab0e 281 * @arg ADC_CHANNEL_8: Channel 8 is selected.
mbed_official 354:e67efb2aab0e 282 * @arg ADC_CHANNEL_13: Channel 13 is selected.
mbed_official 354:e67efb2aab0e 283 * @retval None
mbed_official 354:e67efb2aab0e 284 */
mbed_official 354:e67efb2aab0e 285 #define __HAL_ADC_CHANNEL_SPEED_FAST(__CHANNEL__) \
mbed_official 354:e67efb2aab0e 286 ( ( ((__CHANNEL__) == ADC_CHANNEL_3) \
mbed_official 354:e67efb2aab0e 287 )? \
mbed_official 354:e67efb2aab0e 288 (SET_BIT(COMP->CSR, COMP_CSR_FCH3)) \
mbed_official 354:e67efb2aab0e 289 : \
mbed_official 354:e67efb2aab0e 290 ( ( ((__CHANNEL__) == ADC_CHANNEL_8) \
mbed_official 354:e67efb2aab0e 291 )? \
mbed_official 354:e67efb2aab0e 292 (SET_BIT(COMP->CSR, COMP_CSR_FCH8)) \
mbed_official 354:e67efb2aab0e 293 : \
mbed_official 354:e67efb2aab0e 294 ( ( ((__CHANNEL__) == ADC_CHANNEL_13) \
mbed_official 354:e67efb2aab0e 295 )? \
mbed_official 354:e67efb2aab0e 296 (SET_BIT(COMP->CSR, COMP_CSR_RCH13)) \
mbed_official 354:e67efb2aab0e 297 : \
mbed_official 354:e67efb2aab0e 298 (SET_BIT(COMP->CSR, 0x00000000)) \
mbed_official 354:e67efb2aab0e 299 ) \
mbed_official 354:e67efb2aab0e 300 ) \
mbed_official 354:e67efb2aab0e 301 )
mbed_official 354:e67efb2aab0e 302
mbed_official 354:e67efb2aab0e 303 #define __HAL_ADC_CHANNEL_SPEED_SLOW(__CHANNEL__) \
mbed_official 354:e67efb2aab0e 304 ( ( ((__CHANNEL__) == ADC_CHANNEL_3) \
mbed_official 354:e67efb2aab0e 305 )? \
mbed_official 354:e67efb2aab0e 306 (CLEAR_BIT(COMP->CSR, COMP_CSR_FCH3)) \
mbed_official 354:e67efb2aab0e 307 : \
mbed_official 354:e67efb2aab0e 308 ( ( ((__CHANNEL__) == ADC_CHANNEL_8) \
mbed_official 354:e67efb2aab0e 309 )? \
mbed_official 354:e67efb2aab0e 310 (CLEAR_BIT(COMP->CSR, COMP_CSR_FCH8)) \
mbed_official 354:e67efb2aab0e 311 : \
mbed_official 354:e67efb2aab0e 312 ( ( ((__CHANNEL__) == ADC_CHANNEL_13) \
mbed_official 354:e67efb2aab0e 313 )? \
mbed_official 354:e67efb2aab0e 314 (CLEAR_BIT(COMP->CSR, COMP_CSR_RCH13)) \
mbed_official 354:e67efb2aab0e 315 : \
mbed_official 354:e67efb2aab0e 316 (SET_BIT(COMP->CSR, 0x00000000)) \
mbed_official 354:e67efb2aab0e 317 ) \
mbed_official 354:e67efb2aab0e 318 ) \
mbed_official 354:e67efb2aab0e 319 )
mbed_official 354:e67efb2aab0e 320 #endif /* STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L152xE || STM32L162xE */
mbed_official 354:e67efb2aab0e 321
mbed_official 354:e67efb2aab0e 322 /**
mbed_official 354:e67efb2aab0e 323 * @}
mbed_official 354:e67efb2aab0e 324 */
mbed_official 354:e67efb2aab0e 325
mbed_official 354:e67efb2aab0e 326 /* Private macro ------------------------------------------------------------*/
mbed_official 354:e67efb2aab0e 327
mbed_official 354:e67efb2aab0e 328 /** @defgroup ADCEx_Private_Macro ADCEx Private Macro
mbed_official 354:e67efb2aab0e 329 * @{
mbed_official 354:e67efb2aab0e 330 */
mbed_official 354:e67efb2aab0e 331 /* Macro reserved for internal HAL driver usage, not intended to be used in */
mbed_official 354:e67efb2aab0e 332 /* code of final user. */
mbed_official 354:e67efb2aab0e 333
mbed_official 354:e67efb2aab0e 334 /**
mbed_official 354:e67efb2aab0e 335 * @brief Set ADC number of ranks into regular channel sequence length.
mbed_official 354:e67efb2aab0e 336 * @param _NbrOfConversion_: Regular channel sequence length
mbed_official 354:e67efb2aab0e 337 * @retval None
mbed_official 354:e67efb2aab0e 338 */
mbed_official 354:e67efb2aab0e 339 #define __ADC_SQR1_L(_NbrOfConversion_) (((_NbrOfConversion_) - (uint8_t)1) << POSITION_VAL(ADC_SQR1_L))
mbed_official 354:e67efb2aab0e 340
mbed_official 354:e67efb2aab0e 341 /**
mbed_official 354:e67efb2aab0e 342 * @brief Set ADC ranks available in register SQR1.
mbed_official 354:e67efb2aab0e 343 * Register SQR1 bits availability depends on device category.
mbed_official 354:e67efb2aab0e 344 * @param _NbrOfConversion_: Regular channel sequence length
mbed_official 354:e67efb2aab0e 345 * @retval None
mbed_official 354:e67efb2aab0e 346 */
mbed_official 354:e67efb2aab0e 347 #if defined(STM32L100xC) || defined (STM32L151xC) || defined (STM32L152xC) || defined (STM32L162xC) || defined(STM32L151xCA) || defined (STM32L151xD) || defined (STM32L152xCA) || defined (STM32L152xD) || defined (STM32L162xCA) || defined (STM32L162xD) || defined(STM32L151xE) || defined (STM32L152xE) || defined (STM32L162xE)
mbed_official 354:e67efb2aab0e 348 #define __ADC_SQR1_SQXX ADC_SQR1_SQ28 | ADC_SQR1_SQ27 | ADC_SQR1_SQ26 | ADC_SQR1_SQ25
mbed_official 354:e67efb2aab0e 349 #else
mbed_official 354:e67efb2aab0e 350 #define __ADC_SQR1_SQXX ADC_SQR1_SQ27 | ADC_SQR1_SQ26 | ADC_SQR1_SQ25
mbed_official 354:e67efb2aab0e 351 #endif /* STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L152xE || STM32L162xE */
mbed_official 354:e67efb2aab0e 352
mbed_official 354:e67efb2aab0e 353 /**
mbed_official 354:e67efb2aab0e 354 * @brief Set the ADC's sample time for channel numbers between 30 and 31.
mbed_official 354:e67efb2aab0e 355 * Register SMPR0 availability depends on device category. If register is not
mbed_official 354:e67efb2aab0e 356 * available on the current device, this macro does nothing.
mbed_official 354:e67efb2aab0e 357 * @retval None
mbed_official 354:e67efb2aab0e 358 * @param _SAMPLETIME_: Sample time parameter.
mbed_official 354:e67efb2aab0e 359 * @param _CHANNELNB_: Channel number.
mbed_official 354:e67efb2aab0e 360 * @retval None
mbed_official 354:e67efb2aab0e 361 */
mbed_official 354:e67efb2aab0e 362 #if defined(STM32L151xCA) || defined (STM32L151xD) || defined (STM32L152xCA) || defined (STM32L152xD) || defined (STM32L162xCA) || defined (STM32L162xD) || defined(STM32L151xE) || defined (STM32L152xE) || defined (STM32L162xE)
mbed_official 354:e67efb2aab0e 363 #define __ADC_SMPR0(_SAMPLETIME_, _CHANNELNB_) ((_SAMPLETIME_) << (3 * ((_CHANNELNB_) - 30)))
mbed_official 354:e67efb2aab0e 364 #else
mbed_official 354:e67efb2aab0e 365 #define __ADC_SMPR0(_SAMPLETIME_, _CHANNELNB_) ((uint32_t)0x00000000)
mbed_official 354:e67efb2aab0e 366 #endif /* STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L152xE || STM32L162xE */
mbed_official 354:e67efb2aab0e 367
mbed_official 354:e67efb2aab0e 368 #if defined(STM32L151xCA) || defined (STM32L151xD) || defined (STM32L152xCA) || defined (STM32L152xD) || defined (STM32L162xCA) || defined (STM32L162xD) || defined(STM32L151xE) || defined (STM32L152xE) || defined (STM32L162xE)
mbed_official 354:e67efb2aab0e 369 /**
mbed_official 354:e67efb2aab0e 370 * @brief Set the ADC's sample time for channel numbers between 20 and 29.
mbed_official 354:e67efb2aab0e 371 * @param _SAMPLETIME_: Sample time parameter.
mbed_official 354:e67efb2aab0e 372 * @param _CHANNELNB_: Channel number.
mbed_official 354:e67efb2aab0e 373 * @retval None
mbed_official 354:e67efb2aab0e 374 */
mbed_official 354:e67efb2aab0e 375 #define __ADC_SMPR1(_SAMPLETIME_, _CHANNELNB_) ((_SAMPLETIME_) << (3 * ((_CHANNELNB_) - 20)))
mbed_official 354:e67efb2aab0e 376 #else
mbed_official 354:e67efb2aab0e 377 /**
mbed_official 354:e67efb2aab0e 378 * @brief Set the ADC's sample time for channel numbers between 20 and 26.
mbed_official 354:e67efb2aab0e 379 * @param _SAMPLETIME_: Sample time parameter.
mbed_official 354:e67efb2aab0e 380 * @param _CHANNELNB_: Channel number.
mbed_official 354:e67efb2aab0e 381 * @retval None
mbed_official 354:e67efb2aab0e 382 */
mbed_official 354:e67efb2aab0e 383 #define __ADC_SMPR1(_SAMPLETIME_, _CHANNELNB_) ((_SAMPLETIME_) << (3 * ((_CHANNELNB_) - 20)))
mbed_official 354:e67efb2aab0e 384 #endif /* STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L152xE || STM32L162xE */
mbed_official 354:e67efb2aab0e 385
mbed_official 354:e67efb2aab0e 386 /**
mbed_official 354:e67efb2aab0e 387 * @brief Defines the highest channel available in register SMPR1. Channels
mbed_official 354:e67efb2aab0e 388 * availability depends on device category:
mbed_official 354:e67efb2aab0e 389 * Highest channel in register SMPR1 is channel 26 for devices Cat.1, Cat.2, Cat.3
mbed_official 354:e67efb2aab0e 390 * Highest channel in register SMPR1 is channel 29 for devices Cat.4, Cat.5
mbed_official 354:e67efb2aab0e 391 * @param None
mbed_official 354:e67efb2aab0e 392 * @retval None
mbed_official 354:e67efb2aab0e 393 */
mbed_official 354:e67efb2aab0e 394 #if defined(STM32L151xCA) || defined (STM32L151xD) || defined (STM32L152xCA) || defined (STM32L152xD) || defined (STM32L162xCA) || defined (STM32L162xD) || defined(STM32L151xE) || defined (STM32L152xE) || defined (STM32L162xE)
mbed_official 354:e67efb2aab0e 395 #define ADC_SMPR1_CHANNEL_MAX ADC_CHANNEL_29
mbed_official 354:e67efb2aab0e 396 #else
mbed_official 354:e67efb2aab0e 397 #define ADC_SMPR1_CHANNEL_MAX ADC_CHANNEL_26
mbed_official 354:e67efb2aab0e 398 #endif /* STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L152xE || STM32L162xE */
mbed_official 354:e67efb2aab0e 399
mbed_official 354:e67efb2aab0e 400 /**
mbed_official 354:e67efb2aab0e 401 * @brief Set the ADC's sample time for channel numbers between 10 and 18.
mbed_official 354:e67efb2aab0e 402 * @param _SAMPLETIME_: Sample time parameter.
mbed_official 354:e67efb2aab0e 403 * @param _CHANNELNB_: Channel number.
mbed_official 354:e67efb2aab0e 404 * @retval None
mbed_official 354:e67efb2aab0e 405 */
mbed_official 354:e67efb2aab0e 406 #define __ADC_SMPR2(_SAMPLETIME_, _CHANNELNB_) ((_SAMPLETIME_) << (3 * ((_CHANNELNB_) - 10)))
mbed_official 354:e67efb2aab0e 407
mbed_official 354:e67efb2aab0e 408 /**
mbed_official 354:e67efb2aab0e 409 * @brief Set the ADC's sample time for channel numbers between 0 and 9.
mbed_official 354:e67efb2aab0e 410 * @param _SAMPLETIME_: Sample time parameter.
mbed_official 354:e67efb2aab0e 411 * @param _CHANNELNB_: Channel number.
mbed_official 354:e67efb2aab0e 412 * @retval None
mbed_official 354:e67efb2aab0e 413 */
mbed_official 354:e67efb2aab0e 414 #define __ADC_SMPR3(_SAMPLETIME_, _CHANNELNB_) ((_SAMPLETIME_) << (3 * (_CHANNELNB_)))
mbed_official 354:e67efb2aab0e 415
mbed_official 354:e67efb2aab0e 416 /**
mbed_official 354:e67efb2aab0e 417 * @brief Set the selected regular channel rank for rank between 1 and 6.
mbed_official 354:e67efb2aab0e 418 * @param _CHANNELNB_: Channel number.
mbed_official 354:e67efb2aab0e 419 * @param _RANKNB_: Rank number.
mbed_official 354:e67efb2aab0e 420 * @retval None
mbed_official 354:e67efb2aab0e 421 */
mbed_official 354:e67efb2aab0e 422 #define __ADC_SQR5_RK(_CHANNELNB_, _RANKNB_) ((_CHANNELNB_) << (5 * ((_RANKNB_) - 1)))
mbed_official 354:e67efb2aab0e 423
mbed_official 354:e67efb2aab0e 424 /**
mbed_official 354:e67efb2aab0e 425 * @brief Set the selected regular channel rank for rank between 7 and 12.
mbed_official 354:e67efb2aab0e 426 * @param _CHANNELNB_: Channel number.
mbed_official 354:e67efb2aab0e 427 * @param _RANKNB_: Rank number.
mbed_official 354:e67efb2aab0e 428 * @retval None
mbed_official 354:e67efb2aab0e 429 */
mbed_official 354:e67efb2aab0e 430 #define __ADC_SQR4_RK(_CHANNELNB_, _RANKNB_) ((_CHANNELNB_) << (5 * ((_RANKNB_) - 7)))
mbed_official 354:e67efb2aab0e 431
mbed_official 354:e67efb2aab0e 432 /**
mbed_official 354:e67efb2aab0e 433 * @brief Set the selected regular channel rank for rank between 13 and 18.
mbed_official 354:e67efb2aab0e 434 * @param _CHANNELNB_: Channel number.
mbed_official 354:e67efb2aab0e 435 * @param _RANKNB_: Rank number.
mbed_official 354:e67efb2aab0e 436 * @retval None
mbed_official 354:e67efb2aab0e 437 */
mbed_official 354:e67efb2aab0e 438 #define __ADC_SQR3_RK(_CHANNELNB_, _RANKNB_) ((_CHANNELNB_) << (5 * ((_RANKNB_) - 13)))
mbed_official 354:e67efb2aab0e 439
mbed_official 354:e67efb2aab0e 440 /**
mbed_official 354:e67efb2aab0e 441 * @brief Set the selected regular channel rank for rank between 19 and 24.
mbed_official 354:e67efb2aab0e 442 * @param _CHANNELNB_: Channel number.
mbed_official 354:e67efb2aab0e 443 * @param _RANKNB_: Rank number.
mbed_official 354:e67efb2aab0e 444 * @retval None
mbed_official 354:e67efb2aab0e 445 */
mbed_official 354:e67efb2aab0e 446 #define __ADC_SQR2_RK(_CHANNELNB_, _RANKNB_) ((_CHANNELNB_) << (5 * ((_RANKNB_) - 19)))
mbed_official 354:e67efb2aab0e 447
mbed_official 354:e67efb2aab0e 448 /**
mbed_official 354:e67efb2aab0e 449 * @brief Set the selected regular channel rank for rank between 25 and 28.
mbed_official 354:e67efb2aab0e 450 * @param _CHANNELNB_: Channel number.
mbed_official 354:e67efb2aab0e 451 * @param _RANKNB_: Rank number.
mbed_official 354:e67efb2aab0e 452 * @retval None
mbed_official 354:e67efb2aab0e 453 */
mbed_official 354:e67efb2aab0e 454 #define __ADC_SQR1_RK(_CHANNELNB_, _RANKNB_) ((_CHANNELNB_) << (5 * ((_RANKNB_) - 25)))
mbed_official 354:e67efb2aab0e 455
mbed_official 354:e67efb2aab0e 456 /**
mbed_official 354:e67efb2aab0e 457 * @brief Set the injected sequence length.
mbed_official 354:e67efb2aab0e 458 * @param _JSQR_JL_: Sequence length.
mbed_official 354:e67efb2aab0e 459 * @retval None
mbed_official 354:e67efb2aab0e 460 */
mbed_official 354:e67efb2aab0e 461 #define __ADC_JSQR_JL(_JSQR_JL_) (((_JSQR_JL_) -1) << 20)
mbed_official 354:e67efb2aab0e 462
mbed_official 354:e67efb2aab0e 463 /**
mbed_official 354:e67efb2aab0e 464 * @brief Set the selected injected Channel rank (channels sequence starting from 4-JL)
mbed_official 354:e67efb2aab0e 465 * @param _CHANNELNB_: Channel number.
mbed_official 354:e67efb2aab0e 466 * @param _RANKNB_: Rank number.
mbed_official 354:e67efb2aab0e 467 * @param _JSQR_JL_: Sequence length.
mbed_official 354:e67efb2aab0e 468 * @retval None
mbed_official 354:e67efb2aab0e 469 */
mbed_official 354:e67efb2aab0e 470 #define __ADC_JSQR_RK(_CHANNELNB_, _RANKNB_, _JSQR_JL_) \
mbed_official 354:e67efb2aab0e 471 ((_CHANNELNB_) << (5 * ((4 - ((_JSQR_JL_) - (_RANKNB_))) - 1)))
mbed_official 354:e67efb2aab0e 472
mbed_official 354:e67efb2aab0e 473
mbed_official 354:e67efb2aab0e 474 /**
mbed_official 354:e67efb2aab0e 475 * @brief Enable the ADC DMA continuous request.
mbed_official 354:e67efb2aab0e 476 * @param _DMACONTREQ_MODE_: DMA continuous request mode.
mbed_official 354:e67efb2aab0e 477 * @retval None
mbed_official 354:e67efb2aab0e 478 */
mbed_official 354:e67efb2aab0e 479 #define __ADC_CR2_DMACONTREQ(_DMACONTREQ_MODE_) ((_DMACONTREQ_MODE_) << POSITION_VAL(ADC_CR2_DDS))
mbed_official 354:e67efb2aab0e 480
mbed_official 354:e67efb2aab0e 481 /**
mbed_official 354:e67efb2aab0e 482 * @brief Enable ADC continuous conversion mode.
mbed_official 354:e67efb2aab0e 483 * @param _CONTINUOUS_MODE_: Continuous mode.
mbed_official 354:e67efb2aab0e 484 * @retval None
mbed_official 354:e67efb2aab0e 485 */
mbed_official 354:e67efb2aab0e 486 #define __ADC_CR2_CONTINUOUS(_CONTINUOUS_MODE_) ((_CONTINUOUS_MODE_) << POSITION_VAL(ADC_CR2_CONT))
mbed_official 354:e67efb2aab0e 487
mbed_official 354:e67efb2aab0e 488 /**
mbed_official 354:e67efb2aab0e 489 * @brief Define mask of configuration bits of ADC and regular group in
mbed_official 354:e67efb2aab0e 490 * register CR2 (bits of ADC enable, conversion start and injected group are
mbed_official 354:e67efb2aab0e 491 * excluded of this mask).
mbed_official 354:e67efb2aab0e 492 * @retval None
mbed_official 354:e67efb2aab0e 493 */
mbed_official 354:e67efb2aab0e 494 #if defined (STM32L100xC) || defined (STM32L151xC) || defined (STM32L152xC) || defined (STM32L162xC) || defined (STM32L151xCA) || defined (STM32L151xD) || defined (STM32L152xCA) || defined (STM32L152xD) || defined (STM32L162xCA) || defined (STM32L162xD) || defined (STM32L151xE) || defined (STM32L152xE) || defined (STM32L162xE)
mbed_official 354:e67efb2aab0e 495 #define __ADC_CR2_MASK_ADCINIT() \
mbed_official 354:e67efb2aab0e 496 (ADC_CR2_EXTEN | ADC_CR2_EXTSEL | ADC_CR2_ALIGN | ADC_CR2_EOCS | ADC_CR2_DDS | ADC_CR2_DELS | ADC_CR2_CFG | ADC_CR2_CONT)
mbed_official 354:e67efb2aab0e 497 #else
mbed_official 354:e67efb2aab0e 498 #define __ADC_CR2_MASK_ADCINIT() \
mbed_official 354:e67efb2aab0e 499 (ADC_CR2_EXTEN | ADC_CR2_EXTSEL | ADC_CR2_ALIGN | ADC_CR2_EOCS | ADC_CR2_DDS | ADC_CR2_DELS | ADC_CR2_CONT)
mbed_official 354:e67efb2aab0e 500 #endif
mbed_official 354:e67efb2aab0e 501
mbed_official 354:e67efb2aab0e 502 /**
mbed_official 354:e67efb2aab0e 503 * @brief Configures the number of discontinuous conversions for the regular group channels.
mbed_official 354:e67efb2aab0e 504 * @param _NBR_DISCONTINUOUS_CONV_: Number of discontinuous conversions.
mbed_official 354:e67efb2aab0e 505 * @retval None
mbed_official 354:e67efb2aab0e 506 */
mbed_official 354:e67efb2aab0e 507 #define __ADC_CR1_DISCONTINUOUS_NUM(_NBR_DISCONTINUOUS_CONV_) (((_NBR_DISCONTINUOUS_CONV_) - 1) << POSITION_VAL(ADC_CR1_DISCNUM))
mbed_official 354:e67efb2aab0e 508
mbed_official 354:e67efb2aab0e 509 /**
mbed_official 354:e67efb2aab0e 510 * @brief Enable ADC scan mode to convert multiple ranks with sequencer.
mbed_official 354:e67efb2aab0e 511 * @param _SCAN_MODE_: Scan conversion mode.
mbed_official 354:e67efb2aab0e 512 * @retval None
mbed_official 354:e67efb2aab0e 513 */
mbed_official 354:e67efb2aab0e 514 #define __ADC_CR1_SCAN(_SCAN_MODE_) \
mbed_official 354:e67efb2aab0e 515 ( ( (_SCAN_MODE_) == (ADC_SCAN_ENABLE) \
mbed_official 354:e67efb2aab0e 516 )? (ADC_CR1_SCAN) : (0x00000000) \
mbed_official 354:e67efb2aab0e 517 )
mbed_official 354:e67efb2aab0e 518
mbed_official 354:e67efb2aab0e 519 /**
mbed_official 354:e67efb2aab0e 520 * @brief Get the maximum ADC conversion cycles on all channels.
mbed_official 354:e67efb2aab0e 521 * Returns the selected sampling time + conversion time (12.5 ADC clock cycles)
mbed_official 354:e67efb2aab0e 522 * Approximation of sampling time within 2 ranges, returns the higher value:
mbed_official 354:e67efb2aab0e 523 * below 24 cycles {4 cycles; 9 cycles; 16 cycles; 24 cycles}
mbed_official 354:e67efb2aab0e 524 * between 48 cycles and 384 cycles {48 cycles; 96 cycles; 192 cycles; 384 cycles}
mbed_official 354:e67efb2aab0e 525 * Unit: ADC clock cycles
mbed_official 354:e67efb2aab0e 526 * @param __HANDLE__: ADC handle
mbed_official 354:e67efb2aab0e 527 * @retval ADC conversion cycles on all channels
mbed_official 354:e67efb2aab0e 528 */
mbed_official 354:e67efb2aab0e 529 #if defined(STM32L151xCA) || defined (STM32L151xD) || defined (STM32L152xCA) || defined (STM32L152xD) || defined (STM32L162xCA) || defined (STM32L162xD) || defined(STM32L151xE) || defined (STM32L152xE) || defined (STM32L162xE)
mbed_official 354:e67efb2aab0e 530 #define __ADC_CONVCYCLES_MAX_RANGE(__HANDLE__) \
mbed_official 354:e67efb2aab0e 531 (( (((__HANDLE__)->Instance->SMPR3 & ADC_SAMPLETIME_ALLCHANNELS_SMPR3BIT2) == RESET) && \
mbed_official 354:e67efb2aab0e 532 (((__HANDLE__)->Instance->SMPR2 & ADC_SAMPLETIME_ALLCHANNELS_SMPR2BIT2) == RESET) && \
mbed_official 354:e67efb2aab0e 533 (((__HANDLE__)->Instance->SMPR1 & ADC_SAMPLETIME_ALLCHANNELS_SMPR1BIT2) == RESET) && \
mbed_official 354:e67efb2aab0e 534 (((__HANDLE__)->Instance->SMPR0 & ADC_SAMPLETIME_ALLCHANNELS_SMPR0BIT2) == RESET) ) ? \
mbed_official 354:e67efb2aab0e 535 \
mbed_official 354:e67efb2aab0e 536 ADC_CONVERSIONCLOCKCYCLES_SAMPLETIME_24CYCLES : ADC_CONVERSIONCLOCKCYCLES_SAMPLETIME_384CYCLES \
mbed_official 354:e67efb2aab0e 537 )
mbed_official 354:e67efb2aab0e 538 #else
mbed_official 354:e67efb2aab0e 539 #define __ADC_CONVCYCLES_MAX_RANGE(__HANDLE__) \
mbed_official 354:e67efb2aab0e 540 (( (((__HANDLE__)->Instance->SMPR3 & ADC_SAMPLETIME_ALLCHANNELS_SMPR3BIT2) == RESET) && \
mbed_official 354:e67efb2aab0e 541 (((__HANDLE__)->Instance->SMPR2 & ADC_SAMPLETIME_ALLCHANNELS_SMPR2BIT2) == RESET) && \
mbed_official 354:e67efb2aab0e 542 (((__HANDLE__)->Instance->SMPR1 & ADC_SAMPLETIME_ALLCHANNELS_SMPR1BIT2) == RESET) ) ? \
mbed_official 354:e67efb2aab0e 543 \
mbed_official 354:e67efb2aab0e 544 ADC_CONVERSIONCLOCKCYCLES_SAMPLETIME_24CYCLES : ADC_CONVERSIONCLOCKCYCLES_SAMPLETIME_384CYCLES \
mbed_official 354:e67efb2aab0e 545 )
mbed_official 354:e67efb2aab0e 546 #endif /* STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L152xE || STM32L162xE */
mbed_official 354:e67efb2aab0e 547
mbed_official 354:e67efb2aab0e 548 /**
mbed_official 354:e67efb2aab0e 549 * @brief Get the ADC clock prescaler from ADC common control register
mbed_official 354:e67efb2aab0e 550 * and convert it to its decimal number setting (refer to reference manual)
mbed_official 354:e67efb2aab0e 551 * @retval None
mbed_official 354:e67efb2aab0e 552 */
mbed_official 354:e67efb2aab0e 553 #define __ADC_GET_CLOCK_PRESCALER_DECIMAL(__HANDLE__) \
mbed_official 354:e67efb2aab0e 554 ((0x01) << ((ADC->CCR & ADC_CCR_ADCPRE) >> POSITION_VAL(ADC_CCR_ADCPRE)))
mbed_official 354:e67efb2aab0e 555
mbed_official 354:e67efb2aab0e 556 /**
mbed_official 354:e67efb2aab0e 557 * @brief Clear register SMPR0.
mbed_official 354:e67efb2aab0e 558 * Register SMPR0 availability depends on device category. If register is not
mbed_official 354:e67efb2aab0e 559 * available on the current device, this macro performs no action.
mbed_official 354:e67efb2aab0e 560 * @param __HANDLE__: ADC handle
mbed_official 354:e67efb2aab0e 561 * @retval None
mbed_official 354:e67efb2aab0e 562 */
mbed_official 354:e67efb2aab0e 563 #if defined(STM32L151xCA) || defined (STM32L151xD) || defined (STM32L152xCA) || defined (STM32L152xD) || defined (STM32L162xCA) || defined (STM32L162xD) || defined(STM32L151xE) || defined (STM32L152xE) || defined (STM32L162xE)
mbed_official 354:e67efb2aab0e 564 #define __ADC_SMPR0_CLEAR(__HANDLE__) \
mbed_official 354:e67efb2aab0e 565 (CLEAR_BIT((__HANDLE__)->Instance->SMPR0, (ADC_SMPR0_SMP31 | ADC_SMPR0_SMP30)))
mbed_official 354:e67efb2aab0e 566 #else
mbed_official 354:e67efb2aab0e 567 #define __ADC_SMPR0_CLEAR(__HANDLE__) __NOP()
mbed_official 354:e67efb2aab0e 568 #endif /* STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L152xE || STM32L162xE */
mbed_official 354:e67efb2aab0e 569
mbed_official 354:e67efb2aab0e 570 /**
mbed_official 354:e67efb2aab0e 571 * @brief Clear register CR2.
mbed_official 354:e67efb2aab0e 572 * @param __HANDLE__: ADC handle
mbed_official 354:e67efb2aab0e 573 * @retval None
mbed_official 354:e67efb2aab0e 574 */
mbed_official 354:e67efb2aab0e 575 #if defined(STM32L151xCA) || defined (STM32L151xD) || defined (STM32L152xCA) || defined (STM32L152xD) || defined (STM32L162xCA) || defined (STM32L162xD) || defined(STM32L151xE) || defined (STM32L152xE) || defined (STM32L162xE)
mbed_official 354:e67efb2aab0e 576 #define __ADC_CR2_CLEAR(__HANDLE__) \
mbed_official 354:e67efb2aab0e 577 (CLEAR_BIT((__HANDLE__)->Instance->CR2, (ADC_CR2_SWSTART | ADC_CR2_EXTEN | ADC_CR2_EXTSEL | \
mbed_official 354:e67efb2aab0e 578 ADC_CR2_JSWSTART | ADC_CR2_JEXTEN | ADC_CR2_JEXTSEL | \
mbed_official 354:e67efb2aab0e 579 ADC_CR2_ALIGN | ADC_CR2_EOCS | ADC_CR2_DDS | \
mbed_official 354:e67efb2aab0e 580 ADC_CR2_DMA | ADC_CR2_DELS | ADC_CR2_CFG | \
mbed_official 354:e67efb2aab0e 581 ADC_CR2_CONT | ADC_CR2_ADON )) \
mbed_official 354:e67efb2aab0e 582 )
mbed_official 354:e67efb2aab0e 583 #else
mbed_official 354:e67efb2aab0e 584 #define __ADC_CR2_CLEAR(__HANDLE__) \
mbed_official 354:e67efb2aab0e 585 (CLEAR_BIT((__HANDLE__)->Instance->CR2, (ADC_CR2_SWSTART | ADC_CR2_EXTEN | ADC_CR2_EXTSEL | \
mbed_official 354:e67efb2aab0e 586 ADC_CR2_JSWSTART | ADC_CR2_JEXTEN | ADC_CR2_JEXTSEL | \
mbed_official 354:e67efb2aab0e 587 ADC_CR2_ALIGN | ADC_CR2_EOCS | ADC_CR2_DDS | \
mbed_official 354:e67efb2aab0e 588 ADC_CR2_DMA | ADC_CR2_DELS | \
mbed_official 354:e67efb2aab0e 589 ADC_CR2_CONT | ADC_CR2_ADON )) \
mbed_official 354:e67efb2aab0e 590 )
mbed_official 354:e67efb2aab0e 591 #endif /* STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L152xE || STM32L162xE */
mbed_official 354:e67efb2aab0e 592
mbed_official 354:e67efb2aab0e 593 /**
mbed_official 354:e67efb2aab0e 594 * @brief Set the sampling time of selected channel on register SMPR0
mbed_official 354:e67efb2aab0e 595 * Register SMPR0 availability depends on device category. If register is not
mbed_official 354:e67efb2aab0e 596 * available on the current device, this macro performs no action.
mbed_official 354:e67efb2aab0e 597 * @param __HANDLE__: ADC handle
mbed_official 354:e67efb2aab0e 598 * @param _SAMPLETIME_: Sample time parameter.
mbed_official 354:e67efb2aab0e 599 * @param __CHANNEL__: Channel number.
mbed_official 354:e67efb2aab0e 600 * @retval None
mbed_official 354:e67efb2aab0e 601 */
mbed_official 354:e67efb2aab0e 602 #if defined(STM32L151xCA) || defined (STM32L151xD) || defined (STM32L152xCA) || defined (STM32L152xD) || defined (STM32L162xCA) || defined (STM32L162xD) || defined(STM32L151xE) || defined (STM32L152xE) || defined (STM32L162xE)
mbed_official 354:e67efb2aab0e 603 #define __ADC_SMPR0_CHANNEL_SET(__HANDLE__, _SAMPLETIME_, __CHANNEL__) \
mbed_official 354:e67efb2aab0e 604 MODIFY_REG((__HANDLE__)->Instance->SMPR0, \
mbed_official 354:e67efb2aab0e 605 __ADC_SMPR0(ADC_SMPR0_SMP30, (__CHANNEL__)), \
mbed_official 354:e67efb2aab0e 606 __ADC_SMPR0((_SAMPLETIME_), (__CHANNEL__)) )
mbed_official 354:e67efb2aab0e 607 #else
mbed_official 354:e67efb2aab0e 608 #define __ADC_SMPR0_CHANNEL_SET(__HANDLE__, _SAMPLETIME_, __CHANNEL__) __NOP()
mbed_official 354:e67efb2aab0e 609 #endif /* STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L152xE || STM32L162xE */
mbed_official 354:e67efb2aab0e 610
mbed_official 354:e67efb2aab0e 611
mbed_official 354:e67efb2aab0e 612 /**
mbed_official 354:e67efb2aab0e 613 * @brief Enable the ADC peripheral
mbed_official 354:e67efb2aab0e 614 * @param __HANDLE__: ADC handle
mbed_official 354:e67efb2aab0e 615 * @retval None
mbed_official 354:e67efb2aab0e 616 */
mbed_official 354:e67efb2aab0e 617 #define __ADC_ENABLE(__HANDLE__) \
mbed_official 354:e67efb2aab0e 618 (__HANDLE__)->Instance->CR2 |= ADC_CR2_ADON
mbed_official 354:e67efb2aab0e 619
mbed_official 354:e67efb2aab0e 620 /**
mbed_official 354:e67efb2aab0e 621 * @brief Disable the ADC peripheral
mbed_official 354:e67efb2aab0e 622 * @param __HANDLE__: ADC handle
mbed_official 354:e67efb2aab0e 623 * @retval None
mbed_official 354:e67efb2aab0e 624 */
mbed_official 354:e67efb2aab0e 625 #define __ADC_DISABLE(__HANDLE__) \
mbed_official 354:e67efb2aab0e 626 (__HANDLE__)->Instance->CR2 &= ~ADC_CR2_ADON
mbed_official 354:e67efb2aab0e 627
mbed_official 354:e67efb2aab0e 628 /**
mbed_official 354:e67efb2aab0e 629 * @}
mbed_official 354:e67efb2aab0e 630 */
mbed_official 354:e67efb2aab0e 631
mbed_official 354:e67efb2aab0e 632
mbed_official 354:e67efb2aab0e 633 /* Exported functions --------------------------------------------------------*/
mbed_official 354:e67efb2aab0e 634 /** @addtogroup ADCEx_Exported_Functions
mbed_official 354:e67efb2aab0e 635 * @{
mbed_official 354:e67efb2aab0e 636 */
mbed_official 354:e67efb2aab0e 637
mbed_official 354:e67efb2aab0e 638 /* IO operation functions *****************************************************/
mbed_official 354:e67efb2aab0e 639 /** @addtogroup ADCEx_Exported_Functions_Group1
mbed_official 354:e67efb2aab0e 640 * @{
mbed_official 354:e67efb2aab0e 641 */
mbed_official 354:e67efb2aab0e 642
mbed_official 354:e67efb2aab0e 643 /* Blocking mode: Polling */
mbed_official 354:e67efb2aab0e 644 HAL_StatusTypeDef HAL_ADCEx_InjectedStart(ADC_HandleTypeDef* hadc);
mbed_official 354:e67efb2aab0e 645 HAL_StatusTypeDef HAL_ADCEx_InjectedStop(ADC_HandleTypeDef* hadc);
mbed_official 354:e67efb2aab0e 646 HAL_StatusTypeDef HAL_ADCEx_InjectedPollForConversion(ADC_HandleTypeDef* hadc, uint32_t Timeout);
mbed_official 354:e67efb2aab0e 647
mbed_official 354:e67efb2aab0e 648 /* Non-blocking mode: Interruption */
mbed_official 354:e67efb2aab0e 649 HAL_StatusTypeDef HAL_ADCEx_InjectedStart_IT(ADC_HandleTypeDef* hadc);
mbed_official 354:e67efb2aab0e 650 HAL_StatusTypeDef HAL_ADCEx_InjectedStop_IT(ADC_HandleTypeDef* hadc);
mbed_official 354:e67efb2aab0e 651
mbed_official 354:e67efb2aab0e 652 /* ADC retrieve conversion value intended to be used with polling or interruption */
mbed_official 354:e67efb2aab0e 653 uint32_t HAL_ADCEx_InjectedGetValue(ADC_HandleTypeDef* hadc, uint32_t InjectedRank);
mbed_official 354:e67efb2aab0e 654
mbed_official 354:e67efb2aab0e 655 /* ADC IRQHandler and Callbacks used in non-blocking modes (Interruption) */
mbed_official 354:e67efb2aab0e 656 void HAL_ADCEx_InjectedConvCpltCallback(ADC_HandleTypeDef* hadc);
mbed_official 354:e67efb2aab0e 657 /**
mbed_official 354:e67efb2aab0e 658 * @}
mbed_official 354:e67efb2aab0e 659 */
mbed_official 354:e67efb2aab0e 660
mbed_official 354:e67efb2aab0e 661
mbed_official 354:e67efb2aab0e 662 /* Peripheral Control functions ***********************************************/
mbed_official 354:e67efb2aab0e 663 /** @addtogroup ADCEx_Exported_Functions_Group2
mbed_official 354:e67efb2aab0e 664 * @{
mbed_official 354:e67efb2aab0e 665 */
mbed_official 354:e67efb2aab0e 666
mbed_official 354:e67efb2aab0e 667 HAL_StatusTypeDef HAL_ADCEx_InjectedConfigChannel(ADC_HandleTypeDef* hadc,ADC_InjectionConfTypeDef* sConfigInjected);
mbed_official 354:e67efb2aab0e 668 /**
mbed_official 354:e67efb2aab0e 669 * @}
mbed_official 354:e67efb2aab0e 670 */
mbed_official 354:e67efb2aab0e 671
mbed_official 354:e67efb2aab0e 672
mbed_official 354:e67efb2aab0e 673 /**
mbed_official 354:e67efb2aab0e 674 * @}
mbed_official 354:e67efb2aab0e 675 */
mbed_official 354:e67efb2aab0e 676
mbed_official 354:e67efb2aab0e 677
mbed_official 354:e67efb2aab0e 678 /**
mbed_official 354:e67efb2aab0e 679 * @}
mbed_official 354:e67efb2aab0e 680 */
mbed_official 354:e67efb2aab0e 681
mbed_official 354:e67efb2aab0e 682 /**
mbed_official 354:e67efb2aab0e 683 * @}
mbed_official 354:e67efb2aab0e 684 */
mbed_official 354:e67efb2aab0e 685
mbed_official 354:e67efb2aab0e 686 #ifdef __cplusplus
mbed_official 354:e67efb2aab0e 687 }
mbed_official 354:e67efb2aab0e 688 #endif
mbed_official 354:e67efb2aab0e 689
mbed_official 354:e67efb2aab0e 690 #endif /* __STM32L1xx_HAL_ADC_EX_H */
mbed_official 354:e67efb2aab0e 691
mbed_official 354:e67efb2aab0e 692
mbed_official 354:e67efb2aab0e 693 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/