]> git.donarmstrong.com Git - qmk_firmware.git/blob - tool/mbed/mbed-sdk/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L073RZ/stm32l0xx.h
Squashed 'tmk_core/' changes from 7967731..b9e0ea0
[qmk_firmware.git] / tool / mbed / mbed-sdk / libraries / mbed / targets / cmsis / TARGET_STM / TARGET_STM32L0 / TARGET_NUCLEO_L073RZ / stm32l0xx.h
1 /**
2   ******************************************************************************
3   * @file    stm32l0xx.h
4   * @author  MCD Application Team
5   * @version V1.2.0
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.            
10   *            
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"
19   *  
20   ******************************************************************************
21   * @attention
22   *
23   * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
24   *
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.
35   *
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.
46   *
47   ******************************************************************************  
48   */ 
49
50 /** @addtogroup CMSIS
51   * @{
52   */
53
54 /** @addtogroup stm32l0xx
55   * @{
56   */
57     
58 #ifndef __STM32L0xx_H
59 #define __STM32L0xx_H
60
61 #ifdef __cplusplus
62  extern "C" {
63 #endif /* __cplusplus */
64    
65 /** @addtogroup Library_configuration_section
66   * @{
67   */
68
69 /**
70   * @brief STM32 Family
71   */
72 #if !defined (STM32L0)
73 #define STM32L0
74 #endif /* STM32L0 */
75
76 /* Uncomment the line below according to the target STM32 device used in your
77    application 
78   */
79
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 */   /*!< */ 
94 #endif
95    
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.
98   */
99 #if !defined  (USE_HAL_DRIVER)
100 /**
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 
104    */
105 #define USE_HAL_DRIVER
106 #endif /* USE_HAL_DRIVER */
107
108 /**
109   * @brief CMSIS Device version number V1.2.0
110   */
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))
119                                              
120 /**
121   * @}
122   */
123
124 /** @addtogroup Device_Included
125   * @{
126   */
127
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"
156 #else
157  #error "Please select first the target STM32L0xx device used in your application (in stm32l0xx.h file)"
158 #endif
159
160 /**
161   * @}
162   */
163
164 /** @addtogroup Exported_types
165   * @{
166   */ 
167 typedef enum 
168 {
169   RESET = 0, 
170   SET = !RESET
171 } FlagStatus, ITStatus;
172
173 typedef enum 
174 {
175   DISABLE = 0, 
176   ENABLE = !DISABLE
177 } FunctionalState;
178 #define IS_FUNCTIONAL_STATE(STATE) (((STATE) == DISABLE) || ((STATE) == ENABLE))
179
180 typedef enum 
181 {
182   ERROR = 0, 
183   SUCCESS = !ERROR
184 } ErrorStatus;
185
186 /**
187   * @}
188   */
189
190
191 /** @addtogroup Exported_macro
192   * @{
193   */
194 #define SET_BIT(REG, BIT)     ((REG) |= (BIT))
195
196 #define CLEAR_BIT(REG, BIT)   ((REG) &= ~(BIT))
197
198 #define READ_BIT(REG, BIT)    ((REG) & (BIT))
199
200 #define CLEAR_REG(REG)        ((REG) = (0x0))
201
202 #define WRITE_REG(REG, VAL)   ((REG) = (VAL))
203
204 #define READ_REG(REG)         ((REG))
205
206 #define MODIFY_REG(REG, CLEARMASK, SETMASK)  WRITE_REG((REG), (((READ_REG(REG)) & (~(CLEARMASK))) | (SETMASK)))
207
208
209 /**
210   * @}
211   */
212
213 #if defined (USE_HAL_DRIVER)
214  #include "stm32l0xx_hal.h"
215 #endif /* USE_HAL_DRIVER */
216
217 #ifdef __cplusplus
218 }
219 #endif /* __cplusplus */
220
221 #endif /* __STM32L0xx_H */
222 /**
223   * @}
224   */
225
226 /**
227   * @}
228   */
229   
230
231
232
233 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/