meh

Fork of mbed by mbed official

Committer:
ricardobtez
Date:
Tue Apr 05 23:51:21 2016 +0000
Revision:
118:16969dd821af
Parent:
92:4fc01daae5a5
Child:
96:487b796308b0
dgdgr

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.h
bogdanm 84:0b3ab51c8877 4 * @author MCD Application Team
bogdanm 92:4fc01daae5a5 5 * @version V1.1.0
bogdanm 92:4fc01daae5a5 6 * @date 18-June-2014
bogdanm 84:0b3ab51c8877 7 * @brief CMSIS Cortex-M0+ Device Peripheral Access Layer Header File.
bogdanm 84:0b3ab51c8877 8 * This file contains all the peripheral register's definitions, bits
bogdanm 84:0b3ab51c8877 9 * definitions and memory mapping for STM32L0xx devices.
bogdanm 84:0b3ab51c8877 10 *
bogdanm 84:0b3ab51c8877 11 * The file is the unique include file that the application programmer
bogdanm 84:0b3ab51c8877 12 * is using in the C source code, usually in main.c. This file contains:
bogdanm 84:0b3ab51c8877 13 * - Configuration section that allows to select:
bogdanm 84:0b3ab51c8877 14 * - The device used in the target application
bogdanm 84:0b3ab51c8877 15 * - To use or not the peripheral’s drivers in application code(i.e.
bogdanm 84:0b3ab51c8877 16 * code will be based on direct access to peripheral’s registers
bogdanm 84:0b3ab51c8877 17 * rather than drivers API), this option is controlled by
bogdanm 84:0b3ab51c8877 18 * "#define USE_HAL_DRIVER"
bogdanm 84:0b3ab51c8877 19 *
bogdanm 84:0b3ab51c8877 20 ******************************************************************************
bogdanm 84:0b3ab51c8877 21 * @attention
bogdanm 84:0b3ab51c8877 22 *
bogdanm 84:0b3ab51c8877 23 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
bogdanm 84:0b3ab51c8877 24 *
bogdanm 84:0b3ab51c8877 25 * Redistribution and use in source and binary forms, with or without modification,
bogdanm 84:0b3ab51c8877 26 * are permitted provided that the following conditions are met:
bogdanm 84:0b3ab51c8877 27 * 1. Redistributions of source code must retain the above copyright notice,
bogdanm 84:0b3ab51c8877 28 * this list of conditions and the following disclaimer.
bogdanm 84:0b3ab51c8877 29 * 2. Redistributions in binary form must reproduce the above copyright notice,
bogdanm 84:0b3ab51c8877 30 * this list of conditions and the following disclaimer in the documentation
bogdanm 84:0b3ab51c8877 31 * and/or other materials provided with the distribution.
bogdanm 84:0b3ab51c8877 32 * 3. Neither the name of STMicroelectronics nor the names of its contributors
bogdanm 84:0b3ab51c8877 33 * may be used to endorse or promote products derived from this software
bogdanm 84:0b3ab51c8877 34 * without specific prior written permission.
bogdanm 84:0b3ab51c8877 35 *
bogdanm 84:0b3ab51c8877 36 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
bogdanm 84:0b3ab51c8877 37 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
bogdanm 84:0b3ab51c8877 38 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
bogdanm 84:0b3ab51c8877 39 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
bogdanm 84:0b3ab51c8877 40 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
bogdanm 84:0b3ab51c8877 41 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
bogdanm 84:0b3ab51c8877 42 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
bogdanm 84:0b3ab51c8877 43 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
bogdanm 84:0b3ab51c8877 44 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
bogdanm 84:0b3ab51c8877 45 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
bogdanm 84:0b3ab51c8877 46 *
bogdanm 84:0b3ab51c8877 47 ******************************************************************************
bogdanm 84:0b3ab51c8877 48 */
bogdanm 84:0b3ab51c8877 49
bogdanm 84:0b3ab51c8877 50 /** @addtogroup CMSIS
bogdanm 84:0b3ab51c8877 51 * @{
bogdanm 84:0b3ab51c8877 52 */
bogdanm 84:0b3ab51c8877 53
bogdanm 84:0b3ab51c8877 54 /** @addtogroup stm32l0xx
bogdanm 84:0b3ab51c8877 55 * @{
bogdanm 84:0b3ab51c8877 56 */
bogdanm 84:0b3ab51c8877 57
bogdanm 84:0b3ab51c8877 58 #ifndef __STM32L0xx_H
bogdanm 84:0b3ab51c8877 59 #define __STM32L0xx_H
bogdanm 84:0b3ab51c8877 60
bogdanm 84:0b3ab51c8877 61 #ifdef __cplusplus
bogdanm 84:0b3ab51c8877 62 extern "C" {
bogdanm 84:0b3ab51c8877 63 #endif /* __cplusplus */
bogdanm 84:0b3ab51c8877 64
bogdanm 84:0b3ab51c8877 65 /** @addtogroup Library_configuration_section
bogdanm 84:0b3ab51c8877 66 * @{
bogdanm 84:0b3ab51c8877 67 */
bogdanm 84:0b3ab51c8877 68
bogdanm 84:0b3ab51c8877 69 /* Uncomment the line below according to the target STM32 device used in your
bogdanm 84:0b3ab51c8877 70 application
bogdanm 84:0b3ab51c8877 71 */
bogdanm 84:0b3ab51c8877 72
bogdanm 84:0b3ab51c8877 73 #if !defined (STM32L051xx) && !defined (STM32L052xx) && !defined (STM32L053xx) && !defined (STM32L062xx) && \
bogdanm 84:0b3ab51c8877 74 !defined (STM32L063xx) && !defined (STM32L061xx)
bogdanm 84:0b3ab51c8877 75 /* #define STM32L051xx */ /*!< STM32L051K8, STM32L051C6,STM32L051C8,STM32L051R6 and STM32L051R8 Devices */
bogdanm 84:0b3ab51c8877 76 /* #define STM32L052xx */ /*!< STM32L052K6, STM32L052K8,STM32L052C6,STM32L052C8,STM32L052R6 and STM32L052R8 Devices */
bogdanm 84:0b3ab51c8877 77 #define STM32L053xx /*!< STM32L053C6, STM32L053C8, STM32L053R6, and STM32L053R8 Devices */
bogdanm 84:0b3ab51c8877 78 /* #define STM32L062xx */ /*!< STM32L062K8 */
bogdanm 84:0b3ab51c8877 79 /* #define STM32L063xx */ /*!< STM32L063C8, STM32L063R8 */
bogdanm 84:0b3ab51c8877 80 /* #define STM32L061xx */
bogdanm 84:0b3ab51c8877 81 #endif
bogdanm 84:0b3ab51c8877 82
bogdanm 84:0b3ab51c8877 83 /* Tip: To avoid modifying this file each time you need to switch between these
bogdanm 84:0b3ab51c8877 84 devices, you can define the device in your toolchain compiler preprocessor.
bogdanm 84:0b3ab51c8877 85 */
bogdanm 84:0b3ab51c8877 86 #if !defined (USE_HAL_DRIVER)
bogdanm 84:0b3ab51c8877 87 /**
bogdanm 84:0b3ab51c8877 88 * @brief Comment the line below if you will not use the peripherals drivers.
bogdanm 84:0b3ab51c8877 89 In this case, these drivers will not be included and the application code will
bogdanm 84:0b3ab51c8877 90 be based on direct access to peripherals registers
bogdanm 84:0b3ab51c8877 91 */
bogdanm 84:0b3ab51c8877 92 #define USE_HAL_DRIVER
bogdanm 84:0b3ab51c8877 93 #endif /* USE_HAL_DRIVER */
bogdanm 84:0b3ab51c8877 94
bogdanm 84:0b3ab51c8877 95 /**
bogdanm 92:4fc01daae5a5 96 * @brief CMSIS Device version number V1.1.0
bogdanm 84:0b3ab51c8877 97 */
bogdanm 84:0b3ab51c8877 98 #define __STM32L0xx_CMSIS_DEVICE_VERSION_MAIN (0x01) /*!< [31:24] main version */
bogdanm 92:4fc01daae5a5 99 #define __STM32L0xx_CMSIS_DEVICE_VERSION_SUB1 (0x01) /*!< [23:16] sub1 version */
bogdanm 84:0b3ab51c8877 100 #define __STM32L0xx_CMSIS_DEVICE_VERSION_SUB2 (0x00) /*!< [15:8] sub2 version */
bogdanm 84:0b3ab51c8877 101 #define __STM32L0xx_CMSIS_DEVICE_VERSION_RC (0x00) /*!< [7:0] release candidate */
bogdanm 84:0b3ab51c8877 102 #define __STM32L0xx_CMSIS_DEVICE_VERSION ((__CMSIS_DEVICE_VERSION_MAIN << 24)\
bogdanm 84:0b3ab51c8877 103 |(__CMSIS_DEVICE_HAL_VERSION_SUB1 << 16)\
bogdanm 84:0b3ab51c8877 104 |(__CMSIS_DEVICE_HAL_VERSION_SUB2 << 8 )\
bogdanm 84:0b3ab51c8877 105 |(__CMSIS_DEVICE_HAL_VERSION_RC))
bogdanm 84:0b3ab51c8877 106
bogdanm 84:0b3ab51c8877 107 /**
bogdanm 84:0b3ab51c8877 108 * @}
bogdanm 84:0b3ab51c8877 109 */
bogdanm 84:0b3ab51c8877 110
bogdanm 84:0b3ab51c8877 111 /** @addtogroup Device_Included
bogdanm 84:0b3ab51c8877 112 * @{
bogdanm 84:0b3ab51c8877 113 */
bogdanm 84:0b3ab51c8877 114
bogdanm 84:0b3ab51c8877 115 #if defined(STM32L051xx)
bogdanm 84:0b3ab51c8877 116 #include "stm32l051xx.h"
bogdanm 84:0b3ab51c8877 117 #elif defined(STM32L052xx)
bogdanm 84:0b3ab51c8877 118 #include "stm32l052xx.h"
bogdanm 84:0b3ab51c8877 119 #elif defined(STM32L053xx)
bogdanm 84:0b3ab51c8877 120 #include "stm32l053xx.h"
bogdanm 84:0b3ab51c8877 121 #elif defined(STM32L062xx)
bogdanm 84:0b3ab51c8877 122 #include "stm32l062xx.h"
bogdanm 84:0b3ab51c8877 123 #elif defined(STM32L063xx)
bogdanm 84:0b3ab51c8877 124 #include "stm32l063xx.h"
bogdanm 84:0b3ab51c8877 125 #elif defined(STM32L061xx)
bogdanm 84:0b3ab51c8877 126 #include "stm32l061xx.h"
bogdanm 84:0b3ab51c8877 127 #else
bogdanm 84:0b3ab51c8877 128 #error "Please select first the target STM32L0xx device used in your application (in stm32l0xx.h file)"
bogdanm 84:0b3ab51c8877 129 #endif
bogdanm 84:0b3ab51c8877 130
bogdanm 84:0b3ab51c8877 131 /**
bogdanm 84:0b3ab51c8877 132 * @}
bogdanm 84:0b3ab51c8877 133 */
bogdanm 84:0b3ab51c8877 134
bogdanm 84:0b3ab51c8877 135 /** @addtogroup Exported_types
bogdanm 84:0b3ab51c8877 136 * @{
bogdanm 84:0b3ab51c8877 137 */
bogdanm 84:0b3ab51c8877 138 typedef enum
bogdanm 84:0b3ab51c8877 139 {
bogdanm 84:0b3ab51c8877 140 RESET = 0,
bogdanm 84:0b3ab51c8877 141 SET = !RESET
bogdanm 84:0b3ab51c8877 142 } FlagStatus, ITStatus;
bogdanm 84:0b3ab51c8877 143
bogdanm 84:0b3ab51c8877 144 typedef enum
bogdanm 84:0b3ab51c8877 145 {
bogdanm 84:0b3ab51c8877 146 DISABLE = 0,
bogdanm 84:0b3ab51c8877 147 ENABLE = !DISABLE
bogdanm 84:0b3ab51c8877 148 } FunctionalState;
bogdanm 84:0b3ab51c8877 149 #define IS_FUNCTIONAL_STATE(STATE) (((STATE) == DISABLE) || ((STATE) == ENABLE))
bogdanm 84:0b3ab51c8877 150
bogdanm 84:0b3ab51c8877 151 typedef enum
bogdanm 84:0b3ab51c8877 152 {
bogdanm 84:0b3ab51c8877 153 ERROR = 0,
bogdanm 84:0b3ab51c8877 154 SUCCESS = !ERROR
bogdanm 84:0b3ab51c8877 155 } ErrorStatus;
bogdanm 84:0b3ab51c8877 156
bogdanm 84:0b3ab51c8877 157 /**
bogdanm 84:0b3ab51c8877 158 * @}
bogdanm 84:0b3ab51c8877 159 */
bogdanm 84:0b3ab51c8877 160
bogdanm 84:0b3ab51c8877 161
bogdanm 84:0b3ab51c8877 162 /** @addtogroup Exported_macro
bogdanm 84:0b3ab51c8877 163 * @{
bogdanm 84:0b3ab51c8877 164 */
bogdanm 84:0b3ab51c8877 165 #define SET_BIT(REG, BIT) ((REG) |= (BIT))
bogdanm 84:0b3ab51c8877 166
bogdanm 84:0b3ab51c8877 167 #define CLEAR_BIT(REG, BIT) ((REG) &= ~(BIT))
bogdanm 84:0b3ab51c8877 168
bogdanm 84:0b3ab51c8877 169 #define READ_BIT(REG, BIT) ((REG) & (BIT))
bogdanm 84:0b3ab51c8877 170
bogdanm 84:0b3ab51c8877 171 #define CLEAR_REG(REG) ((REG) = (0x0))
bogdanm 84:0b3ab51c8877 172
bogdanm 84:0b3ab51c8877 173 #define WRITE_REG(REG, VAL) ((REG) = (VAL))
bogdanm 84:0b3ab51c8877 174
bogdanm 84:0b3ab51c8877 175 #define READ_REG(REG) ((REG))
bogdanm 84:0b3ab51c8877 176
bogdanm 84:0b3ab51c8877 177 #define MODIFY_REG(REG, CLEARMASK, SETMASK) WRITE_REG((REG), (((READ_REG(REG)) & (~(CLEARMASK))) | (SETMASK)))
bogdanm 84:0b3ab51c8877 178
bogdanm 84:0b3ab51c8877 179
bogdanm 84:0b3ab51c8877 180
bogdanm 84:0b3ab51c8877 181 /**
bogdanm 84:0b3ab51c8877 182 * @}
bogdanm 84:0b3ab51c8877 183 */
bogdanm 84:0b3ab51c8877 184
bogdanm 84:0b3ab51c8877 185 #if defined (USE_HAL_DRIVER)
bogdanm 84:0b3ab51c8877 186 #include "stm32l0xx_hal.h"
bogdanm 84:0b3ab51c8877 187 #endif /* USE_HAL_DRIVER */
bogdanm 84:0b3ab51c8877 188
bogdanm 84:0b3ab51c8877 189
bogdanm 84:0b3ab51c8877 190 #ifdef __cplusplus
bogdanm 84:0b3ab51c8877 191 }
bogdanm 84:0b3ab51c8877 192 #endif /* __cplusplus */
bogdanm 84:0b3ab51c8877 193
bogdanm 84:0b3ab51c8877 194 #endif /* __STM32L0xx_H */
bogdanm 84:0b3ab51c8877 195 /**
bogdanm 84:0b3ab51c8877 196 * @}
bogdanm 84:0b3ab51c8877 197 */
bogdanm 84:0b3ab51c8877 198
bogdanm 84:0b3ab51c8877 199 /**
bogdanm 84:0b3ab51c8877 200 * @}
bogdanm 84:0b3ab51c8877 201 */
bogdanm 84:0b3ab51c8877 202
bogdanm 84:0b3ab51c8877 203
bogdanm 84:0b3ab51c8877 204
bogdanm 84:0b3ab51c8877 205
bogdanm 84:0b3ab51c8877 206 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/