2 ******************************************************************************
4 * @author MCD Application Team
6 * @date 06-February-2015
7 * @brief CMSIS Cortex-M0+ Device Peripheral Access Layer Header File.
8 * This file contains all the peripheral register's definitions, bits
9 * definitions and memory mapping for STM32L0xx devices.
11 * The file is the unique include file that the application programmer
12 * is using in the C source code, usually in main.c. This file contains:
13 * - Configuration section that allows to select:
14 * - The device used in the target application
15 * - To use or not the peripheral’s drivers in application code(i.e.
16 * code will be based on direct access to peripheral’s registers
17 * rather than drivers API), this option is controlled by
18 * "#define USE_HAL_DRIVER"
20 ******************************************************************************
23 * <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
25 * Redistribution and use in source and binary forms, with or without modification,
26 * are permitted provided that the following conditions are met:
27 * 1. Redistributions of source code must retain the above copyright notice,
28 * this list of conditions and the following disclaimer.
29 * 2. Redistributions in binary form must reproduce the above copyright notice,
30 * this list of conditions and the following disclaimer in the documentation
31 * and/or other materials provided with the distribution.
32 * 3. Neither the name of STMicroelectronics nor the names of its contributors
33 * may be used to endorse or promote products derived from this software
34 * without specific prior written permission.
36 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
37 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
38 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
39 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
40 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
41 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
42 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
43 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
44 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
45 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
47 ******************************************************************************
54 /** @addtogroup stm32l0xx
63 #endif /* __cplusplus */
65 /** @addtogroup Library_configuration_section
72 #if !defined (STM32L0)
76 /* Uncomment the line below according to the target STM32 device used in your
80 #if !defined (STM32L051xx) && !defined (STM32L052xx) && !defined (STM32L053xx) && !defined (STM32L061xx) && !defined (STM32L062xx) && !defined (STM32L063xx) \
81 && !defined (STM32L071xx) && !defined (STM32L072xx) && !defined (STM32L073xx) && !defined (STM32L081xx) && !defined (STM32L082xx) && !defined (STM32L083xx)
82 /* #define STM32L051xx */ /*!< STM32L051K8, STM32L051C6, STM32L051C8, STM32L051R6, STM32L051R8 Devices */
83 /* #define STM32L052xx */ /*!< STM32L052K6, STM32L052K8, STM32L052C6, STM32L052C8, STM32L052R6, STM32L052R8 Devices */
84 /* #define STM32L053xx */ /*!< STM32L053C6, STM32L053C8, STM32L053R6, STM32L053R8 Devices */
85 /* #define STM32L061xx */ /*!< */
86 /* #define STM32L062xx */ /*!< STM32L062K8 */
87 /* #define STM32L063xx */ /*!< STM32L063C8, STM32L063R8 */
88 /* #define STM32L071xx */ /*!< */
89 /* #define STM32L072xx */ /*!< */
90 #define STM32L073xx /*!< STM32L073V8, STM32L073VB, STM32L073RB, STM32L073VZ, STM32L073RZ Devices */
91 /* #define STM32L081xx */ /*!< */
92 /* #define STM32L082xx */ /*!< */
93 /* #define STM32L083xx */ /*!< */
96 /* Tip: To avoid modifying this file each time you need to switch between these
97 devices, you can define the device in your toolchain compiler preprocessor.
99 #if !defined (USE_HAL_DRIVER)
101 * @brief Comment the line below if you will not use the peripherals drivers.
102 In this case, these drivers will not be included and the application code will
103 be based on direct access to peripherals registers
105 #define USE_HAL_DRIVER
106 #endif /* USE_HAL_DRIVER */
109 * @brief CMSIS Device version number V1.2.0
111 #define __STM32L0xx_CMSIS_DEVICE_VERSION_MAIN (0x01) /*!< [31:24] main version */
112 #define __STM32L0xx_CMSIS_DEVICE_VERSION_SUB1 (0x02) /*!< [23:16] sub1 version */
113 #define __STM32L0xx_CMSIS_DEVICE_VERSION_SUB2 (0x00) /*!< [15:8] sub2 version */
114 #define __STM32L0xx_CMSIS_DEVICE_VERSION_RC (0x00) /*!< [7:0] release candidate */
115 #define __STM32L0xx_CMSIS_DEVICE_VERSION ((__CMSIS_DEVICE_VERSION_MAIN << 24)\
116 |(__CMSIS_DEVICE_HAL_VERSION_SUB1 << 16)\
117 |(__CMSIS_DEVICE_HAL_VERSION_SUB2 << 8 )\
118 |(__CMSIS_DEVICE_HAL_VERSION_RC))
124 /** @addtogroup Device_Included
128 #if defined(STM32L031xx)
129 #include "stm32l031xx.h"
130 #elif defined(STM32L041xx)
131 #include "stm32l041xx.h"
132 #elif defined(STM32L051xx)
133 #include "stm32l051xx.h"
134 #elif defined(STM32L052xx)
135 #include "stm32l052xx.h"
136 #elif defined(STM32L053xx)
137 #include "stm32l053xx.h"
138 #elif defined(STM32L062xx)
139 #include "stm32l062xx.h"
140 #elif defined(STM32L063xx)
141 #include "stm32l063xx.h"
142 #elif defined(STM32L061xx)
143 #include "stm32l061xx.h"
144 #elif defined(STM32L071xx)
145 #include "stm32l071xx.h"
146 #elif defined(STM32L072xx)
147 #include "stm32l072xx.h"
148 #elif defined(STM32L073xx)
149 #include "stm32l073xx.h"
150 #elif defined(STM32L082xx)
151 #include "stm32l082xx.h"
152 #elif defined(STM32L083xx)
153 #include "stm32l083xx.h"
154 #elif defined(STM32L081xx)
155 #include "stm32l081xx.h"
157 #error "Please select first the target STM32L0xx device used in your application (in stm32l0xx.h file)"
164 /** @addtogroup Exported_types
171 } FlagStatus, ITStatus;
178 #define IS_FUNCTIONAL_STATE(STATE) (((STATE) == DISABLE) || ((STATE) == ENABLE))
191 /** @addtogroup Exported_macro
194 #define SET_BIT(REG, BIT) ((REG) |= (BIT))
196 #define CLEAR_BIT(REG, BIT) ((REG) &= ~(BIT))
198 #define READ_BIT(REG, BIT) ((REG) & (BIT))
200 #define CLEAR_REG(REG) ((REG) = (0x0))
202 #define WRITE_REG(REG, VAL) ((REG) = (VAL))
204 #define READ_REG(REG) ((REG))
206 #define MODIFY_REG(REG, CLEARMASK, SETMASK) WRITE_REG((REG), (((READ_REG(REG)) & (~(CLEARMASK))) | (SETMASK)))
213 #if defined (USE_HAL_DRIVER)
214 #include "stm32l0xx_hal.h"
215 #endif /* USE_HAL_DRIVER */
219 #endif /* __cplusplus */
221 #endif /* __STM32L0xx_H */
233 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/