]> git.donarmstrong.com Git - qmk_firmware.git/blob - tool/mbed/mbed-sdk/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32L0/stm32l0xx_hal_adc_ex.h
Squashed 'tmk_core/' changes from 7967731..b9e0ea0
[qmk_firmware.git] / tool / mbed / mbed-sdk / libraries / mbed / targets / cmsis / TARGET_STM / TARGET_STM32L0 / stm32l0xx_hal_adc_ex.h
1 /**
2   ******************************************************************************
3   * @file    stm32l0xx_hal_adc_ex.h
4   * @author  MCD Application Team
5   * @version V1.2.0
6   * @date    06-February-2015
7   * @brief  This file contains all the functions prototypes for the ADC firmware 
8   *          library.
9   ******************************************************************************
10   * @attention
11   *
12   * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
13   *
14   * Redistribution and use in source and binary forms, with or without modification,
15   * are permitted provided that the following conditions are met:
16   *   1. Redistributions of source code must retain the above copyright notice,
17   *      this list of conditions and the following disclaimer.
18   *   2. Redistributions in binary form must reproduce the above copyright notice,
19   *      this list of conditions and the following disclaimer in the documentation
20   *      and/or other materials provided with the distribution.
21   *   3. Neither the name of STMicroelectronics nor the names of its contributors
22   *      may be used to endorse or promote products derived from this software
23   *      without specific prior written permission.
24   *
25   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
26   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
28   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
29   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
31   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
32   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
33   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
34   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35   *
36   ******************************************************************************
37   */
38
39 /* Define to prevent recursive inclusion -------------------------------------*/
40 #ifndef __STM32L0xx_ADC_EX_H
41 #define __STM32L0xx_ADC_EX_H
42
43 #ifdef __cplusplus
44  extern "C" {
45 #endif
46
47 /* Includes ------------------------------------------------------------------*/
48 #include "stm32l0xx_hal_def.h"
49   
50 /** @addtogroup STM32L0xx_HAL_Driver
51   * @{
52   */
53
54 /** @addtogroup ADCEx
55   * @{
56   */ 
57
58 /* Exported types ------------------------------------------------------------*/
59 /* Exported constants --------------------------------------------------------*/
60 /** @defgroup ADCEx_Exported_Constants
61   * @{
62   */
63
64  /** @defgroup ADCEx_TimeOut_Values
65   * @{
66   */ 
67 #define ADC_CALIBRATION_TIMEOUT       10
68 /**
69   * @}
70   */
71    
72   
73 /** @defgroup ADCEx_Channel_Mode
74   * @{
75   */   
76 #define ADC_SINGLE_ENDED                        (uint32_t)0x00000000   /* dummy value */
77 #define IS_ADC_SINGLE_DIFFERENTIAL(SING_DIFF)   ((SING_DIFF) == ADC_SINGLE_ENDED)
78 /**
79   * @}
80   */
81     
82 /** @defgroup ADCEx_calibration_factor_length_verification
83   * @{
84   */ 
85 /**
86   * @brief Calibration factor lenght verification (7 bits maximum)
87   * @param _Calibration_Factor_: Calibration factor value
88   * @retval None
89   */
90 #define IS_ADC_CALFACT(_Calibration_Factor_) ((_Calibration_Factor_) <= ((uint32_t)0x7F))
91 /**
92   * @}
93   */ 
94
95 #define ADC_FLAG_SENSOR         SYSCFG_CFGR3_SENSOR_ADC_RDYF
96 #define ADC_FLAG_VREFINT        SYSCFG_VREFINT_ADC_RDYF
97
98 /**
99   * @}
100   */
101    
102 /* Exported functions --------------------------------------------------------*/  
103 /* Peripheral Control functions ***********************************************/
104 HAL_StatusTypeDef   HAL_ADCEx_Calibration_Start(ADC_HandleTypeDef* hadc, uint32_t SingleDiff);
105 uint32_t            HAL_ADCEx_Calibration_GetValue(ADC_HandleTypeDef* hadc, uint32_t SingleDiff);
106 HAL_StatusTypeDef   HAL_ADCEx_Calibration_SetValue(ADC_HandleTypeDef* hadc, uint32_t SingleDiff, uint32_t CalibrationFactor);
107 void HAL_ADCEx_EnableVREFINT(void);
108 void HAL_ADCEx_DisableVREFINT(void);
109 void HAL_ADCEx_EnableVREFINTTempSensor(void);
110 void HAL_ADCEx_DisableVREFINTTempSensor(void);
111
112
113 /**
114   * @}
115   */
116
117 /**
118   * @}
119   */
120
121 #ifdef __cplusplus
122 }
123 #endif
124
125 #endif /*__STM32L0xx_ADC_H */
126
127
128 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
129