meh

Fork of mbed by mbed official

Committer:
Kojto
Date:
Tue Mar 17 14:27:45 2015 +0000
Revision:
96:487b796308b0
Parent:
92:4fc01daae5a5
Release 96 of the mbed library

Changes:
- IAR support for ble boards, lpc, ethernet stack
- RTC - attach function to redirect time functions
- Nucleo F103RB - cube driver
- k20xx - fixes for teensy and k20 platforms in sleep/deepsleep and usb
- STM32L0, Nucleo/Disco L053 - refactoring

Who changed what in which revision?

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