You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

239 lines
9.4 KiB

  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>&copy; 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. /** @addtogroup CMSIS
  32. * @{
  33. */
  34. /** @addtogroup stm32l0xx
  35. * @{
  36. */
  37. #ifndef __STM32L0xx_H
  38. #define __STM32L0xx_H
  39. #ifdef __cplusplus
  40. extern "C" {
  41. #endif /* __cplusplus */
  42. /** @addtogroup Library_configuration_section
  43. * @{
  44. */
  45. /**
  46. * @brief STM32 Family
  47. */
  48. #if !defined (STM32L0)
  49. #define STM32L0
  50. #endif /* STM32L0 */
  51. /* Uncomment the line below according to the target STM32 device used in your
  52. application
  53. */
  54. #if !defined (STM32L010x4) && !defined (STM32L010x6) && !defined (STM32L010x8) && !defined (STM32L010xB) && \
  55. !defined (STM32L011xx) && !defined (STM32L021xx) && \
  56. !defined (STM32L031xx) && !defined (STM32L041xx) && \
  57. !defined (STM32L051xx) && !defined (STM32L052xx) && !defined (STM32L053xx) && \
  58. !defined (STM32L061xx) && !defined (STM32L062xx) && !defined (STM32L063xx) && \
  59. !defined (STM32L071xx) && !defined (STM32L072xx) && !defined (STM32L073xx) && \
  60. !defined (STM32L081xx) && !defined (STM32L082xx) && !defined (STM32L083xx)
  61. /* #define STM32L010x4 */ /*!< STM32L010K4, STM32L010F4 Devices */
  62. /* #define STM32L010x6 */ /*!< STM32L010C6 Devices */
  63. /* #define STM32L010x8 */ /*!< STM32L010K8, STM32L010R8 Devices */
  64. /* #define STM32L010xB */ /*!< STM32L010RB Devices */
  65. /* #define STM32L011xx */ /*!< STM32L031C6, STM32L031E6, STM32L031F6, STM32L031G6, STM32L031K6 Devices */
  66. /* #define STM32L021xx */ /*!< STM32L021D4, STM32L021F4, STM32L021G4, STM32L021K4 Devices */
  67. /* #define STM32L031xx */ /*!< STM32L031C6, STM32L031E6, STM32L031F6, STM32L031G6, STM32L031K6 Devices */
  68. /* #define STM32L041xx */ /*!< STM32L041C6, STM32L041K6, STM32L041G6, STM32L041F6, STM32L041E6 Devices */
  69. /* #define STM32L051xx */ /*!< STM32L051K8, STM32L051C6, STM32L051C8, STM32L051R6, STM32L051R8, STM32L051K6, STM32L051T6, STM32L051T8 Devices */
  70. /* #define STM32L052xx */ /*!< STM32L052K6, STM32L052K8, STM32L052C6, STM32L052C8, STM32L052R6, STM32L052R8, STM32L052T6, STM32L052T8 Devices */
  71. /* #define STM32L053xx */ /*!< STM32L053C6, STM32L053C8, STM32L053R6, STM32L053R8 Devices */
  72. /* #define STM32L061xx */ /*!< */
  73. /* #define STM32L062xx */ /*!< STM32L062K8 Devices */
  74. /* #define STM32L063xx */ /*!< STM32L063C8, STM32L063R8 Devices */
  75. /* #define STM32L071xx */ /*!< STM32L071V8, STM32L071K8, STM32L071VB, STM32L071RB, STM32L071CB, STM32L071KB, STM32L071VZ, STM32L071RZ, STM32L071CZ, STM32L071KZ, STM32L071C8 Devices */
  76. /* #define STM32L072xx */ /*!< STM32L072V8, STM32L072VB, STM32L072RB, STM32L072CB, STM32L072VZ, STM32L072RZ, STM32L072CZ, STM32L072KB, STM32L072KZ Devices */
  77. /* #define STM32L073xx */ /*!< STM32L073V8, STM32L073VB, STM32L073RB, STM32L073VZ, STM32L073RZ, STM32L073CB, STM32L073CZ Devices */
  78. /* #define STM32L081xx */ /*!< STM32L081CB, STM32L081CZ, STM32L081KZ Devices */
  79. /* #define STM32L082xx */ /*!< STM32L082KB, STM32L082KZ, STM32L082CZ Devices */
  80. /* #define STM32L083xx */ /*!< STM32L083V8, STM32L083VB, STM32L083RB, STM32L083VZ, STM32L083RZ, STM32L083CB, STM32L083CZ Devices */
  81. #endif
  82. /* Tip: To avoid modifying this file each time you need to switch between these
  83. devices, you can define the device in your toolchain compiler preprocessor.
  84. */
  85. #if !defined (USE_HAL_DRIVER)
  86. /**
  87. * @brief Comment the line below if you will not use the peripherals drivers.
  88. In this case, these drivers will not be included and the application code will
  89. be based on direct access to peripherals registers
  90. */
  91. /*#define USE_HAL_DRIVER */
  92. #endif /* USE_HAL_DRIVER */
  93. /**
  94. * @brief CMSIS Device version number
  95. */
  96. #define __STM32L0xx_CMSIS_VERSION_MAIN (0x01) /*!< [31:24] main version */
  97. #define __STM32L0xx_CMSIS_VERSION_SUB1 (0x09) /*!< [23:16] sub1 version */
  98. #define __STM32L0xx_CMSIS_VERSION_SUB2 (0x00) /*!< [15:8] sub2 version */
  99. #define __STM32L0xx_CMSIS_VERSION_RC (0x00) /*!< [7:0] release candidate */
  100. #define __STM32L0xx_CMSIS_VERSION ((__STM32L0xx_CMSIS_VERSION_MAIN << 24)\
  101. |(__STM32L0xx_CMSIS_VERSION_SUB1 << 16)\
  102. |(__STM32L0xx_CMSIS_VERSION_SUB2 << 8 )\
  103. |(__STM32L0xx_CMSIS_VERSION_RC))
  104. /**
  105. * @}
  106. */
  107. /** @addtogroup Device_Included
  108. * @{
  109. */
  110. #if defined(STM32L010xB)
  111. #include "stm32l010xb.h"
  112. #elif defined(STM32L010x8)
  113. #include "stm32l010x8.h"
  114. #elif defined(STM32L010x6)
  115. #include "stm32l010x6.h"
  116. #elif defined(STM32L010x4)
  117. #include "stm32l010x4.h"
  118. #elif defined(STM32L011xx)
  119. #include "stm32l011xx.h"
  120. #elif defined(STM32L021xx)
  121. #include "stm32l021xx.h"
  122. #elif defined(STM32L031xx)
  123. #include "stm32l031xx.h"
  124. #elif defined(STM32L041xx)
  125. #include "stm32l041xx.h"
  126. #elif defined(STM32L051xx)
  127. #include "stm32l051xx.h"
  128. #elif defined(STM32L052xx)
  129. #include "stm32l052xx.h"
  130. #elif defined(STM32L053xx)
  131. #include "stm32l053xx.h"
  132. #elif defined(STM32L062xx)
  133. #include "stm32l062xx.h"
  134. #elif defined(STM32L063xx)
  135. #include "stm32l063xx.h"
  136. #elif defined(STM32L061xx)
  137. #include "stm32l061xx.h"
  138. #elif defined(STM32L071xx)
  139. #include "stm32l071xx.h"
  140. #elif defined(STM32L072xx)
  141. #include "stm32l072xx.h"
  142. #elif defined(STM32L073xx)
  143. #include "stm32l073xx.h"
  144. #elif defined(STM32L082xx)
  145. #include "stm32l082xx.h"
  146. #elif defined(STM32L083xx)
  147. #include "stm32l083xx.h"
  148. #elif defined(STM32L081xx)
  149. #include "stm32l081xx.h"
  150. #else
  151. #error "Please select first the target STM32L0xx device used in your application (in stm32l0xx.h file)"
  152. #endif
  153. /**
  154. * @}
  155. */
  156. /** @addtogroup Exported_types
  157. * @{
  158. */
  159. typedef enum
  160. {
  161. RESET = 0,
  162. SET = !RESET
  163. } FlagStatus, ITStatus;
  164. typedef enum
  165. {
  166. DISABLE = 0,
  167. ENABLE = !DISABLE
  168. } FunctionalState;
  169. #define IS_FUNCTIONAL_STATE(STATE) (((STATE) == DISABLE) || ((STATE) == ENABLE))
  170. typedef enum
  171. {
  172. SUCCESS = 0,
  173. ERROR = !SUCCESS
  174. } ErrorStatus;
  175. /**
  176. * @}
  177. */
  178. /** @addtogroup Exported_macro
  179. * @{
  180. */
  181. #define SET_BIT(REG, BIT) ((REG) |= (BIT))
  182. #define CLEAR_BIT(REG, BIT) ((REG) &= ~(BIT))
  183. #define READ_BIT(REG, BIT) ((REG) & (BIT))
  184. #define CLEAR_REG(REG) ((REG) = (0x0))
  185. #define WRITE_REG(REG, VAL) ((REG) = (VAL))
  186. #define READ_REG(REG) ((REG))
  187. #define MODIFY_REG(REG, CLEARMASK, SETMASK) WRITE_REG((REG), (((READ_REG(REG)) & (~(CLEARMASK))) | (SETMASK)))
  188. /**
  189. * @}
  190. */
  191. #if defined (USE_HAL_DRIVER)
  192. #include "stm32l0xx_hal.h"
  193. #endif /* USE_HAL_DRIVER */
  194. #ifdef __cplusplus
  195. }
  196. #endif /* __cplusplus */
  197. #endif /* __STM32L0xx_H */
  198. /**
  199. * @}
  200. */
  201. /**
  202. * @}
  203. */
  204. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/