1 /** 2 ****************************************************************************** 3 * @file stm32l0xx.h 4 * @author MCD Application Team 5 * @brief CMSIS Cortex-M0+ Device Peripheral Access Layer Header File. 6 * This file contains all the peripheral register's definitions, bits 7 * definitions and memory mapping for STM32L0xx devices. 8 * 9 * The file is the unique include file that the application programmer 10 * is using in the C source code, usually in main.c. This file contains: 11 * - Configuration section that allows to select: 12 * - The device used in the target application 13 * - To use or not the peripheral's drivers in application code(i.e. 14 * code will be based on direct access to peripheral's registers 15 * rather than drivers API), this option is controlled by 16 * "#define USE_HAL_DRIVER" 17 * 18 ****************************************************************************** 19 * @attention 20 * 21 * <h2><center>© Copyright(c) 2016 STMicroelectronics. 22 * All rights reserved.</center></h2> 23 * 24 * This software component is licensed by ST under BSD 3-Clause license, 25 * the "License"; You may not use this file except in compliance with the 26 * License. You may obtain a copy of the License at: 27 * opensource.org/licenses/BSD-3-Clause 28 * 29 ****************************************************************************** 30 */ 31 32 /** @addtogroup CMSIS 33 * @{ 34 */ 35 36 /** @addtogroup stm32l0xx 37 * @{ 38 */ 39 40 #ifndef __STM32L0xx_H 41 #define __STM32L0xx_H 42 43 #ifdef __cplusplus 44 extern "C" { 45 #endif /* __cplusplus */ 46 47 /** @addtogroup Library_configuration_section 48 * @{ 49 */ 50 51 /** 52 * @brief STM32 Family 53 */ 54 #if !defined (STM32L0) 55 #define STM32L0 56 #endif /* STM32L0 */ 57 58 /* Uncomment the line below according to the target STM32 device used in your 59 application 60 */ 61 62 #if !defined (STM32L010x4) && !defined (STM32L010x6) && !defined (STM32L010x8) && !defined (STM32L010xB) && \ 63 !defined (STM32L011xx) && !defined (STM32L021xx) && \ 64 !defined (STM32L031xx) && !defined (STM32L041xx) && \ 65 !defined (STM32L051xx) && !defined (STM32L052xx) && !defined (STM32L053xx) && \ 66 !defined (STM32L061xx) && !defined (STM32L062xx) && !defined (STM32L063xx) && \ 67 !defined (STM32L071xx) && !defined (STM32L072xx) && !defined (STM32L073xx) && \ 68 !defined (STM32L081xx) && !defined (STM32L082xx) && !defined (STM32L083xx) 69 /* #define STM32L010x4 */ /*!< STM32L010K4, STM32L010F4 Devices */ 70 /* #define STM32L010x6 */ /*!< STM32L010C6 Devices */ 71 /* #define STM32L010x8 */ /*!< STM32L010K8, STM32L010R8 Devices */ 72 /* #define STM32L010xB */ /*!< STM32L010RB Devices */ 73 /* #define STM32L011xx */ /*!< STM32L031C6, STM32L031E6, STM32L031F6, STM32L031G6, STM32L031K6 Devices */ 74 /* #define STM32L021xx */ /*!< STM32L021D4, STM32L021F4, STM32L021G4, STM32L021K4 Devices */ 75 /* #define STM32L031xx */ /*!< STM32L031C6, STM32L031E6, STM32L031F6, STM32L031G6, STM32L031K6 Devices */ 76 /* #define STM32L041xx */ /*!< STM32L041C6, STM32L041K6, STM32L041G6, STM32L041F6, STM32L041E6 Devices */ 77 /* #define STM32L051xx */ /*!< STM32L051K8, STM32L051C6, STM32L051C8, STM32L051R6, STM32L051R8, STM32L051K6, STM32L051T6, STM32L051T8 Devices */ 78 /* #define STM32L052xx */ /*!< STM32L052K6, STM32L052K8, STM32L052C6, STM32L052C8, STM32L052R6, STM32L052R8, STM32L052T6, STM32L052T8 Devices */ 79 /* #define STM32L053xx */ /*!< STM32L053C6, STM32L053C8, STM32L053R6, STM32L053R8 Devices */ 80 /* #define STM32L061xx */ /*!< */ 81 /* #define STM32L062xx */ /*!< STM32L062K8 Devices */ 82 /* #define STM32L063xx */ /*!< STM32L063C8, STM32L063R8 Devices */ 83 /* #define STM32L071xx */ /*!< STM32L071V8, STM32L071K8, STM32L071VB, STM32L071RB, STM32L071CB, STM32L071KB, STM32L071VZ, STM32L071RZ, STM32L071CZ, STM32L071KZ, STM32L071C8 Devices */ 84 /* #define STM32L072xx */ /*!< STM32L072V8, STM32L072VB, STM32L072RB, STM32L072CB, STM32L072VZ, STM32L072RZ, STM32L072CZ, STM32L072KB, STM32L072KZ Devices */ 85 /* #define STM32L073xx */ /*!< STM32L073V8, STM32L073VB, STM32L073RB, STM32L073VZ, STM32L073RZ, STM32L073CB, STM32L073CZ Devices */ 86 /* #define STM32L081xx */ /*!< STM32L081CB, STM32L081CZ, STM32L081KZ Devices */ 87 /* #define STM32L082xx */ /*!< STM32L082KB, STM32L082KZ, STM32L082CZ Devices */ 88 /* #define STM32L083xx */ /*!< STM32L083V8, STM32L083VB, STM32L083RB, STM32L083VZ, STM32L083RZ, STM32L083CB, STM32L083CZ Devices */ 89 #endif 90 91 /* Tip: To avoid modifying this file each time you need to switch between these 92 devices, you can define the device in your toolchain compiler preprocessor. 93 */ 94 #if !defined (USE_HAL_DRIVER) 95 /** 96 * @brief Comment the line below if you will not use the peripherals drivers. 97 In this case, these drivers will not be included and the application code will 98 be based on direct access to peripherals registers 99 */ 100 /*#define USE_HAL_DRIVER */ 101 #endif /* USE_HAL_DRIVER */ 102 103 /** 104 * @brief CMSIS Device version number 105 */ 106 #define __STM32L0xx_CMSIS_VERSION_MAIN (0x01) /*!< [31:24] main version */ 107 #define __STM32L0xx_CMSIS_VERSION_SUB1 (0x09) /*!< [23:16] sub1 version */ 108 #define __STM32L0xx_CMSIS_VERSION_SUB2 (0x00) /*!< [15:8] sub2 version */ 109 #define __STM32L0xx_CMSIS_VERSION_RC (0x00) /*!< [7:0] release candidate */ 110 #define __STM32L0xx_CMSIS_VERSION ((__STM32L0xx_CMSIS_VERSION_MAIN << 24)\ 111 |(__STM32L0xx_CMSIS_VERSION_SUB1 << 16)\ 112 |(__STM32L0xx_CMSIS_VERSION_SUB2 << 8 )\ 113 |(__STM32L0xx_CMSIS_VERSION_RC)) 114 115 /** 116 * @} 117 */ 118 119 /** @addtogroup Device_Included 120 * @{ 121 */ 122 #if defined(STM32L010xB) 123 #include "stm32l010xb.h" 124 #elif defined(STM32L010x8) 125 #include "stm32l010x8.h" 126 #elif defined(STM32L010x6) 127 #include "stm32l010x6.h" 128 #elif defined(STM32L010x4) 129 #include "stm32l010x4.h" 130 #elif defined(STM32L011xx) 131 #include "stm32l011xx.h" 132 #elif defined(STM32L021xx) 133 #include "stm32l021xx.h" 134 #elif defined(STM32L031xx) 135 #include "stm32l031xx.h" 136 #elif defined(STM32L041xx) 137 #include "stm32l041xx.h" 138 #elif defined(STM32L051xx) 139 #include "stm32l051xx.h" 140 #elif defined(STM32L052xx) 141 #include "stm32l052xx.h" 142 #elif defined(STM32L053xx) 143 #include "stm32l053xx.h" 144 #elif defined(STM32L062xx) 145 #include "stm32l062xx.h" 146 #elif defined(STM32L063xx) 147 #include "stm32l063xx.h" 148 #elif defined(STM32L061xx) 149 #include "stm32l061xx.h" 150 #elif defined(STM32L071xx) 151 #include "stm32l071xx.h" 152 #elif defined(STM32L072xx) 153 #include "stm32l072xx.h" 154 #elif defined(STM32L073xx) 155 #include "stm32l073xx.h" 156 #elif defined(STM32L082xx) 157 #include "stm32l082xx.h" 158 #elif defined(STM32L083xx) 159 #include "stm32l083xx.h" 160 #elif defined(STM32L081xx) 161 #include "stm32l081xx.h" 162 #else 163 #error "Please select first the target STM32L0xx device used in your application (in stm32l0xx.h file)" 164 #endif 165 166 /** 167 * @} 168 */ 169 170 /** @addtogroup Exported_types 171 * @{ 172 */ 173 typedef enum 174 { 175 RESET = 0, 176 SET = !RESET 177 } FlagStatus, ITStatus; 178 179 typedef enum 180 { 181 DISABLE = 0, 182 ENABLE = !DISABLE 183 } FunctionalState; 184 #define IS_FUNCTIONAL_STATE(STATE) (((STATE) == DISABLE) || ((STATE) == ENABLE)) 185 186 typedef enum 187 { 188 SUCCESS = 0, 189 ERROR = !SUCCESS 190 } ErrorStatus; 191 192 /** 193 * @} 194 */ 195 196 197 /** @addtogroup Exported_macro 198 * @{ 199 */ 200 #define SET_BIT(REG, BIT) ((REG) |= (BIT)) 201 202 #define CLEAR_BIT(REG, BIT) ((REG) &= ~(BIT)) 203 204 #define READ_BIT(REG, BIT) ((REG) & (BIT)) 205 206 #define CLEAR_REG(REG) ((REG) = (0x0)) 207 208 #define WRITE_REG(REG, VAL) ((REG) = (VAL)) 209 210 #define READ_REG(REG) ((REG)) 211 212 #define MODIFY_REG(REG, CLEARMASK, SETMASK) WRITE_REG((REG), (((READ_REG(REG)) & (~(CLEARMASK))) | (SETMASK))) 213 214 /** 215 * @} 216 */ 217 218 #if defined (USE_HAL_DRIVER) 219 #include "stm32l0xx_hal.h" 220 #endif /* USE_HAL_DRIVER */ 221 222 #ifdef __cplusplus 223 } 224 #endif /* __cplusplus */ 225 226 #endif /* __STM32L0xx_H */ 227 /** 228 * @} 229 */ 230 231 /** 232 * @} 233 */ 234 235 236 237 238 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 239