mbed library sources

Dependents:   Encrypted my_mbed lklk CyaSSL_DTLS_Cellular ... more

Superseded

This library was superseded by mbed-dev - https://os.mbed.com/users/mbed_official/code/mbed-dev/.

Development branch of the mbed library sources. This library is kept in synch with the latest changes from the mbed SDK and it is not guaranteed to work.

If you are looking for a stable and tested release, please import one of the official mbed library releases:

Import librarymbed

The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Committer:
mbed_official
Date:
Wed Jul 01 09:45:11 2015 +0100
Revision:
579:53297373a894
Parent:
489:119543c9f674
Synchronized with git revision d5b4d2ab9c47edb4dc5776e7177b0c2263459081

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

Initial version of drivers for SAMR21

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 376:cb4d9db17537 1 /**
mbed_official 376:cb4d9db17537 2 ******************************************************************************
mbed_official 376:cb4d9db17537 3 * @file stm32l0xx_hal_adc_ex.c
mbed_official 376:cb4d9db17537 4 * @author MCD Application Team
mbed_official 489:119543c9f674 5 * @version V1.2.0
mbed_official 489:119543c9f674 6 * @date 06-February-2015
mbed_official 376:cb4d9db17537 7 * @brief This file provides firmware functions to manage the following
mbed_official 376:cb4d9db17537 8 * functionalities of the Analog to Digital Convertor (ADC)
mbed_official 376:cb4d9db17537 9 * peripheral:
mbed_official 376:cb4d9db17537 10 * + Start calibration.
mbed_official 376:cb4d9db17537 11 * + Read the calibration factor.
mbed_official 376:cb4d9db17537 12 * + Set a calibration factor.
mbed_official 376:cb4d9db17537 13 *
mbed_official 376:cb4d9db17537 14 @verbatim
mbed_official 376:cb4d9db17537 15 ==============================================================================
mbed_official 376:cb4d9db17537 16 ##### ADC specific features #####
mbed_official 376:cb4d9db17537 17 ==============================================================================
mbed_official 376:cb4d9db17537 18 [..]
mbed_official 376:cb4d9db17537 19 (#) Self calibration.
mbed_official 376:cb4d9db17537 20
mbed_official 376:cb4d9db17537 21
mbed_official 376:cb4d9db17537 22 ##### How to use this driver #####
mbed_official 376:cb4d9db17537 23 ==============================================================================
mbed_official 376:cb4d9db17537 24 [..]
mbed_official 376:cb4d9db17537 25
mbed_official 376:cb4d9db17537 26 (#) Call HAL_ADCEx_Calibration_Start() to start calibration
mbed_official 376:cb4d9db17537 27
mbed_official 376:cb4d9db17537 28 (#) Read the calibration factor using HAL_ADCEx_Calibration_GetValue()
mbed_official 376:cb4d9db17537 29
mbed_official 376:cb4d9db17537 30 (#) User can set a his calibration factor using HAL_ADCEx_Calibration_SetValue()
mbed_official 376:cb4d9db17537 31
mbed_official 376:cb4d9db17537 32 @endverbatim
mbed_official 376:cb4d9db17537 33 ******************************************************************************
mbed_official 376:cb4d9db17537 34 * @attention
mbed_official 376:cb4d9db17537 35 *
mbed_official 489:119543c9f674 36 * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
mbed_official 376:cb4d9db17537 37 *
mbed_official 376:cb4d9db17537 38 * Redistribution and use in source and binary forms, with or without modification,
mbed_official 376:cb4d9db17537 39 * are permitted provided that the following conditions are met:
mbed_official 376:cb4d9db17537 40 * 1. Redistributions of source code must retain the above copyright notice,
mbed_official 376:cb4d9db17537 41 * this list of conditions and the following disclaimer.
mbed_official 376:cb4d9db17537 42 * 2. Redistributions in binary form must reproduce the above copyright notice,
mbed_official 376:cb4d9db17537 43 * this list of conditions and the following disclaimer in the documentation
mbed_official 376:cb4d9db17537 44 * and/or other materials provided with the distribution.
mbed_official 376:cb4d9db17537 45 * 3. Neither the name of STMicroelectronics nor the names of its contributors
mbed_official 376:cb4d9db17537 46 * may be used to endorse or promote products derived from this software
mbed_official 376:cb4d9db17537 47 * without specific prior written permission.
mbed_official 376:cb4d9db17537 48 *
mbed_official 376:cb4d9db17537 49 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
mbed_official 376:cb4d9db17537 50 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
mbed_official 376:cb4d9db17537 51 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
mbed_official 376:cb4d9db17537 52 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
mbed_official 376:cb4d9db17537 53 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
mbed_official 376:cb4d9db17537 54 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
mbed_official 376:cb4d9db17537 55 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
mbed_official 376:cb4d9db17537 56 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
mbed_official 376:cb4d9db17537 57 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
mbed_official 376:cb4d9db17537 58 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
mbed_official 376:cb4d9db17537 59 *
mbed_official 376:cb4d9db17537 60 ******************************************************************************
mbed_official 376:cb4d9db17537 61 */
mbed_official 376:cb4d9db17537 62
mbed_official 376:cb4d9db17537 63 /* Includes ------------------------------------------------------------------*/
mbed_official 376:cb4d9db17537 64 #include "stm32l0xx_hal.h"
mbed_official 376:cb4d9db17537 65
mbed_official 376:cb4d9db17537 66 /** @addtogroup STM32L0xx_HAL_Driver
mbed_official 376:cb4d9db17537 67 * @{
mbed_official 376:cb4d9db17537 68 */
mbed_official 376:cb4d9db17537 69
mbed_official 376:cb4d9db17537 70 /** @addtogroup ADCEx
mbed_official 376:cb4d9db17537 71 * @brief ADC driver modules
mbed_official 376:cb4d9db17537 72 * @{
mbed_official 376:cb4d9db17537 73 */
mbed_official 376:cb4d9db17537 74
mbed_official 376:cb4d9db17537 75 #ifdef HAL_ADC_MODULE_ENABLED
mbed_official 376:cb4d9db17537 76
mbed_official 376:cb4d9db17537 77 /* Private typedef -----------------------------------------------------------*/
mbed_official 376:cb4d9db17537 78 /* Private define ------------------------------------------------------------*/
mbed_official 376:cb4d9db17537 79 /* Private macro -------------------------------------------------------------*/
mbed_official 376:cb4d9db17537 80 /* Private variables ---------------------------------------------------------*/
mbed_official 376:cb4d9db17537 81 /* Private function prototypes -----------------------------------------------*/
mbed_official 376:cb4d9db17537 82 /* Private functions ---------------------------------------------------------*/
mbed_official 376:cb4d9db17537 83
mbed_official 376:cb4d9db17537 84
mbed_official 489:119543c9f674 85 /** @addtgroup ADCEx_Group ADC Extended features functions
mbed_official 376:cb4d9db17537 86 * @brief ADC Extended features functions
mbed_official 376:cb4d9db17537 87 *
mbed_official 376:cb4d9db17537 88 @verbatim
mbed_official 376:cb4d9db17537 89 ===============================================================================
mbed_official 376:cb4d9db17537 90 ##### ADC Extended features functions #####
mbed_official 376:cb4d9db17537 91 ===============================================================================
mbed_official 376:cb4d9db17537 92 [..]
mbed_official 376:cb4d9db17537 93 This subsection provides functions allowing to:
mbed_official 376:cb4d9db17537 94 (+) Start calibration.
mbed_official 376:cb4d9db17537 95 (+) Get calibration factor.
mbed_official 376:cb4d9db17537 96 (+) Set calibration factor.
mbed_official 376:cb4d9db17537 97
mbed_official 376:cb4d9db17537 98 @endverbatim
mbed_official 376:cb4d9db17537 99 * @{
mbed_official 376:cb4d9db17537 100 */
mbed_official 376:cb4d9db17537 101
mbed_official 376:cb4d9db17537 102
mbed_official 376:cb4d9db17537 103 /**
mbed_official 376:cb4d9db17537 104 * @brief Start an automatic calibration
mbed_official 376:cb4d9db17537 105 * @param hadc: pointer to a ADC_HandleTypeDef structure that contains
mbed_official 376:cb4d9db17537 106 * the configuration information for the specified ADC.
mbed_official 376:cb4d9db17537 107 * @param SingleDiff: Selection of single-ended or differential input
mbed_official 376:cb4d9db17537 108 * This parameter can be only of the following values:
mbed_official 376:cb4d9db17537 109 * @arg ADC_SINGLE_ENDED: Channel in mode input single ended
mbed_official 376:cb4d9db17537 110 * @retval HAL status
mbed_official 376:cb4d9db17537 111 */
mbed_official 376:cb4d9db17537 112 HAL_StatusTypeDef HAL_ADCEx_Calibration_Start(ADC_HandleTypeDef* hadc, uint32_t SingleDiff)
mbed_official 376:cb4d9db17537 113 {
mbed_official 376:cb4d9db17537 114 uint32_t tickstart = 0;
mbed_official 376:cb4d9db17537 115
mbed_official 376:cb4d9db17537 116 /* Check the parameters */
mbed_official 376:cb4d9db17537 117 assert_param(IS_ADC_ALL_INSTANCE(hadc->Instance));
mbed_official 376:cb4d9db17537 118 assert_param(IS_ADC_SINGLE_DIFFERENTIAL(SingleDiff));
mbed_official 376:cb4d9db17537 119
mbed_official 376:cb4d9db17537 120 /* Process locked */
mbed_official 376:cb4d9db17537 121 __HAL_LOCK(hadc);
mbed_official 376:cb4d9db17537 122
mbed_official 376:cb4d9db17537 123 /* Disable the ADC (if not already disabled) */
mbed_official 489:119543c9f674 124 if (ADC_IS_ENABLE(hadc) != RESET )
mbed_official 376:cb4d9db17537 125 {
mbed_official 376:cb4d9db17537 126 /* Check if conditions to disable the ADC are fulfilled */
mbed_official 489:119543c9f674 127 if (ADC_DISABLING_CONDITIONS(hadc) != RESET)
mbed_official 376:cb4d9db17537 128 {
mbed_official 376:cb4d9db17537 129 __HAL_ADC_DISABLE(hadc);
mbed_official 376:cb4d9db17537 130 }
mbed_official 376:cb4d9db17537 131 else
mbed_official 376:cb4d9db17537 132 {
mbed_official 376:cb4d9db17537 133 hadc->State= HAL_ADC_STATE_ERROR;
mbed_official 376:cb4d9db17537 134
mbed_official 376:cb4d9db17537 135 /* Process unlocked */
mbed_official 376:cb4d9db17537 136 __HAL_UNLOCK(hadc);
mbed_official 376:cb4d9db17537 137
mbed_official 376:cb4d9db17537 138 return HAL_ERROR;
mbed_official 376:cb4d9db17537 139 }
mbed_official 376:cb4d9db17537 140
mbed_official 376:cb4d9db17537 141 /* Wait for ADC effectively disabled */
mbed_official 376:cb4d9db17537 142 /* Get timeout */
mbed_official 376:cb4d9db17537 143 tickstart = HAL_GetTick();
mbed_official 376:cb4d9db17537 144
mbed_official 376:cb4d9db17537 145 /* Wait for disabling completion */
mbed_official 376:cb4d9db17537 146 while(HAL_IS_BIT_SET(hadc->Instance->CR, ADC_CR_ADEN))
mbed_official 376:cb4d9db17537 147 {
mbed_official 376:cb4d9db17537 148 /* Check for the Timeout */
mbed_official 376:cb4d9db17537 149 if(ADC_DISABLE_TIMEOUT != HAL_MAX_DELAY)
mbed_official 376:cb4d9db17537 150 {
mbed_official 376:cb4d9db17537 151 if((HAL_GetTick() - tickstart ) > ADC_DISABLE_TIMEOUT)
mbed_official 376:cb4d9db17537 152 {
mbed_official 376:cb4d9db17537 153 hadc->State= HAL_ADC_STATE_TIMEOUT;
mbed_official 376:cb4d9db17537 154
mbed_official 376:cb4d9db17537 155 /* Process unlocked */
mbed_official 376:cb4d9db17537 156 __HAL_UNLOCK(hadc);
mbed_official 376:cb4d9db17537 157
mbed_official 376:cb4d9db17537 158 return HAL_TIMEOUT;
mbed_official 376:cb4d9db17537 159 }
mbed_official 376:cb4d9db17537 160 }
mbed_official 376:cb4d9db17537 161 }
mbed_official 376:cb4d9db17537 162 }
mbed_official 376:cb4d9db17537 163
mbed_official 376:cb4d9db17537 164 /* Start ADC calibration */
mbed_official 376:cb4d9db17537 165 hadc->Instance->CR |= ADC_CR_ADCAL;
mbed_official 376:cb4d9db17537 166
mbed_official 376:cb4d9db17537 167 /* Get timeout */
mbed_official 376:cb4d9db17537 168 tickstart = HAL_GetTick();
mbed_official 376:cb4d9db17537 169
mbed_official 376:cb4d9db17537 170 /* Wait for calibration completion */
mbed_official 376:cb4d9db17537 171 while(HAL_IS_BIT_SET(hadc->Instance->CR, ADC_CR_ADCAL))
mbed_official 376:cb4d9db17537 172 {
mbed_official 376:cb4d9db17537 173 /* Check for the Timeout */
mbed_official 376:cb4d9db17537 174 if(ADC_CALIBRATION_TIMEOUT != HAL_MAX_DELAY)
mbed_official 376:cb4d9db17537 175 {
mbed_official 376:cb4d9db17537 176 if((HAL_GetTick() - tickstart ) > ADC_CALIBRATION_TIMEOUT)
mbed_official 376:cb4d9db17537 177 {
mbed_official 376:cb4d9db17537 178 hadc->State= HAL_ADC_STATE_TIMEOUT;
mbed_official 376:cb4d9db17537 179
mbed_official 376:cb4d9db17537 180 /* Process unlocked */
mbed_official 376:cb4d9db17537 181 __HAL_UNLOCK(hadc);
mbed_official 376:cb4d9db17537 182
mbed_official 376:cb4d9db17537 183 return HAL_TIMEOUT;
mbed_official 376:cb4d9db17537 184 }
mbed_official 376:cb4d9db17537 185 }
mbed_official 376:cb4d9db17537 186 }
mbed_official 376:cb4d9db17537 187
mbed_official 376:cb4d9db17537 188 /* Process unlocked */
mbed_official 376:cb4d9db17537 189 __HAL_UNLOCK(hadc);
mbed_official 376:cb4d9db17537 190
mbed_official 376:cb4d9db17537 191 /* Return function status */
mbed_official 376:cb4d9db17537 192 return HAL_OK;
mbed_official 376:cb4d9db17537 193
mbed_official 376:cb4d9db17537 194 }
mbed_official 376:cb4d9db17537 195
mbed_official 376:cb4d9db17537 196 /**
mbed_official 376:cb4d9db17537 197 * @brief Get the calibration factor.
mbed_official 376:cb4d9db17537 198 * @param hadc: ADC handle.
mbed_official 376:cb4d9db17537 199 * @param SingleDiff: This parameter can be only:
mbed_official 376:cb4d9db17537 200 * @arg ADC_SINGLE_ENDED: Channel in mode input single ended.
mbed_official 376:cb4d9db17537 201 * @retval Calibration value.
mbed_official 376:cb4d9db17537 202 */
mbed_official 376:cb4d9db17537 203 uint32_t HAL_ADCEx_Calibration_GetValue(ADC_HandleTypeDef* hadc, uint32_t SingleDiff)
mbed_official 376:cb4d9db17537 204 {
mbed_official 376:cb4d9db17537 205 /* Check the parameters */
mbed_official 376:cb4d9db17537 206 assert_param(IS_ADC_ALL_INSTANCE(hadc->Instance));
mbed_official 376:cb4d9db17537 207 assert_param(IS_ADC_SINGLE_DIFFERENTIAL(SingleDiff));
mbed_official 376:cb4d9db17537 208
mbed_official 376:cb4d9db17537 209 /* Return the ADC calibration value */
mbed_official 376:cb4d9db17537 210 return ((hadc->Instance->CALFACT) & 0x0000007F);
mbed_official 376:cb4d9db17537 211 }
mbed_official 376:cb4d9db17537 212
mbed_official 376:cb4d9db17537 213 /**
mbed_official 376:cb4d9db17537 214 * @brief Set the calibration factor to overwrite automatic conversion result.
mbed_official 376:cb4d9db17537 215 * ADC must be enabled and no conversion is ongoing.
mbed_official 376:cb4d9db17537 216 * @param hadc: ADC handle
mbed_official 376:cb4d9db17537 217 * @param SingleDiff: This parameter can be only:
mbed_official 376:cb4d9db17537 218 * @arg ADC_SINGLE_ENDED: Channel in mode input single ended.
mbed_official 376:cb4d9db17537 219 * @param CalibrationFactor: Calibration factor (coded on 7 bits maximum)
mbed_official 376:cb4d9db17537 220 * @retval HAL state
mbed_official 376:cb4d9db17537 221 */
mbed_official 376:cb4d9db17537 222 HAL_StatusTypeDef HAL_ADCEx_Calibration_SetValue(ADC_HandleTypeDef* hadc, uint32_t SingleDiff, uint32_t CalibrationFactor)
mbed_official 376:cb4d9db17537 223 {
mbed_official 376:cb4d9db17537 224 HAL_StatusTypeDef tmpHALStatus = HAL_OK;
mbed_official 376:cb4d9db17537 225
mbed_official 376:cb4d9db17537 226 /* Check the parameters */
mbed_official 376:cb4d9db17537 227 assert_param(IS_ADC_ALL_INSTANCE(hadc->Instance));
mbed_official 376:cb4d9db17537 228 assert_param(IS_ADC_SINGLE_DIFFERENTIAL(SingleDiff));
mbed_official 376:cb4d9db17537 229 assert_param(IS_ADC_CALFACT(CalibrationFactor));
mbed_official 376:cb4d9db17537 230
mbed_official 376:cb4d9db17537 231 /* Process locked */
mbed_official 376:cb4d9db17537 232 __HAL_LOCK(hadc);
mbed_official 376:cb4d9db17537 233
mbed_official 376:cb4d9db17537 234 /* Verification of hardware constraints before modifying the calibration */
mbed_official 376:cb4d9db17537 235 /* factors register: ADC must be enabled, no conversion on going. */
mbed_official 489:119543c9f674 236 if ( (ADC_IS_ENABLE(hadc) != RESET) &&
mbed_official 489:119543c9f674 237 (ADC_IS_CONVERSION_ONGOING(hadc) == RESET) )
mbed_official 376:cb4d9db17537 238 {
mbed_official 376:cb4d9db17537 239 /* Set the selected ADC calibration value */
mbed_official 376:cb4d9db17537 240 hadc->Instance->CALFACT &= ~ADC_CALFACT_CALFACT;
mbed_official 376:cb4d9db17537 241 hadc->Instance->CALFACT |= CalibrationFactor;
mbed_official 376:cb4d9db17537 242 }
mbed_official 376:cb4d9db17537 243 else
mbed_official 376:cb4d9db17537 244 {
mbed_official 376:cb4d9db17537 245 /* Update ADC state machine to error */
mbed_official 376:cb4d9db17537 246 hadc->State = HAL_ADC_STATE_ERROR;
mbed_official 376:cb4d9db17537 247
mbed_official 376:cb4d9db17537 248 /* Update ADC state machine to error */
mbed_official 376:cb4d9db17537 249 tmpHALStatus = HAL_ERROR;
mbed_official 376:cb4d9db17537 250 }
mbed_official 376:cb4d9db17537 251
mbed_official 376:cb4d9db17537 252 /* Process unlocked */
mbed_official 376:cb4d9db17537 253 __HAL_UNLOCK(hadc);
mbed_official 376:cb4d9db17537 254
mbed_official 376:cb4d9db17537 255 /* Return function status */
mbed_official 376:cb4d9db17537 256 return tmpHALStatus;
mbed_official 376:cb4d9db17537 257 }
mbed_official 376:cb4d9db17537 258
mbed_official 376:cb4d9db17537 259 /**
mbed_official 489:119543c9f674 260 * @brief Enables the Buffer Vrefint for the ADC.
mbed_official 489:119543c9f674 261 * @note This is functional only if the LOCK is not set.
mbed_official 489:119543c9f674 262 * @retval None
mbed_official 489:119543c9f674 263 */
mbed_official 489:119543c9f674 264 void HAL_ADCEx_EnableVREFINT(void)
mbed_official 489:119543c9f674 265 {
mbed_official 489:119543c9f674 266 /* Enable the Buffer for the ADC by setting EN_VREFINT bit and the ENBUF_SENSOR_ADC in the CFGR3 register */
mbed_official 489:119543c9f674 267 SET_BIT(SYSCFG->CFGR3, (SYSCFG_CFGR3_ENBUF_VREFINT_ADC | SYSCFG_CFGR3_EN_VREFINT));
mbed_official 489:119543c9f674 268 }
mbed_official 489:119543c9f674 269
mbed_official 489:119543c9f674 270 /**
mbed_official 489:119543c9f674 271 * @brief Disables the Buffer Vrefint for the ADC.
mbed_official 489:119543c9f674 272 * @note This is functional only if the LOCK is not set.
mbed_official 489:119543c9f674 273 * @retval None
mbed_official 489:119543c9f674 274 */
mbed_official 489:119543c9f674 275 void HAL_ADCEx_DisableVREFINT(void)
mbed_official 489:119543c9f674 276 {
mbed_official 489:119543c9f674 277 /* Disable the Vrefint by resetting EN_VREFINT bit and the ENBUF_SENSOR_ADC in the CFGR3 register */
mbed_official 489:119543c9f674 278 CLEAR_BIT(SYSCFG->CFGR3, (SYSCFG_CFGR3_ENBUF_VREFINT_ADC | SYSCFG_CFGR3_EN_VREFINT));
mbed_official 489:119543c9f674 279 }
mbed_official 489:119543c9f674 280
mbed_official 489:119543c9f674 281 /**
mbed_official 489:119543c9f674 282 * @brief Enables VEREFINT and the Sensor for the ADC.
mbed_official 489:119543c9f674 283 * @note This is functional only if the LOCK is not set.
mbed_official 489:119543c9f674 284 * @retval None
mbed_official 489:119543c9f674 285 */
mbed_official 489:119543c9f674 286 void HAL_ADCEx_EnableVREFINTTempSensor(void)
mbed_official 489:119543c9f674 287 {
mbed_official 489:119543c9f674 288 /* Enable the Buffer for the ADC by setting EN_VREFINT bit and the ENBUF_SENSOR_ADC in the CFGR3 register */
mbed_official 489:119543c9f674 289 SET_BIT(SYSCFG->CFGR3, (SYSCFG_CFGR3_ENBUF_SENSOR_ADC | SYSCFG_CFGR3_EN_VREFINT));
mbed_official 489:119543c9f674 290 }
mbed_official 489:119543c9f674 291
mbed_official 489:119543c9f674 292 /**
mbed_official 489:119543c9f674 293 * @brief Disables the VEREFINT and Sensor for the ADC.
mbed_official 489:119543c9f674 294 * @note This is functional only if the LOCK is not set.
mbed_official 489:119543c9f674 295 * @retval None
mbed_official 489:119543c9f674 296 */
mbed_official 489:119543c9f674 297 void HAL_ADCEx_DisableVREFINTTempSensor(void)
mbed_official 489:119543c9f674 298 {
mbed_official 489:119543c9f674 299 /* Disable the Vrefint by resetting EN_VREFINT bit and the ENBUF_SENSOR_ADC in the CFGR3 register */
mbed_official 489:119543c9f674 300 CLEAR_BIT(SYSCFG->CFGR3, (SYSCFG_CFGR3_ENBUF_SENSOR_ADC | SYSCFG_CFGR3_EN_VREFINT));
mbed_official 489:119543c9f674 301 }
mbed_official 489:119543c9f674 302
mbed_official 489:119543c9f674 303 /**
mbed_official 376:cb4d9db17537 304 * @}
mbed_official 376:cb4d9db17537 305 */
mbed_official 376:cb4d9db17537 306
mbed_official 376:cb4d9db17537 307
mbed_official 376:cb4d9db17537 308 #endif /* HAL_ADC_MODULE_ENABLED */
mbed_official 376:cb4d9db17537 309 /**
mbed_official 376:cb4d9db17537 310 * @}
mbed_official 376:cb4d9db17537 311 */
mbed_official 376:cb4d9db17537 312
mbed_official 376:cb4d9db17537 313 /**
mbed_official 376:cb4d9db17537 314 * @}
mbed_official 376:cb4d9db17537 315 */
mbed_official 376:cb4d9db17537 316
mbed_official 376:cb4d9db17537 317 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/