core_cm0.h 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960
  1. /**************************************************************************//**
  2. * @file core_cm0.h
  3. * @brief CMSIS Cortex-M0 Core Peripheral Access Layer Header File
  4. * @version V1.30
  5. * @date 30. October 2009
  6. *
  7. * @note
  8. * Copyright (C) 2009 ARM Limited. All rights reserved.
  9. *
  10. * @par
  11. * ARM Limited (ARM) is supplying this software for use with Cortex-M
  12. * processor based microcontrollers. This file can be freely distributed
  13. * within development tools that are supporting such ARM based processors.
  14. *
  15. * @par
  16. * THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
  17. * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
  18. * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
  19. * ARM SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
  20. * CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
  21. *
  22. ******************************************************************************/
  23. #ifndef __CM0_CORE_H__
  24. #define __CM0_CORE_H__
  25. /** @addtogroup CMSIS_CM0_core_LintCinfiguration CMSIS CM0 Core Lint Configuration
  26. *
  27. * List of Lint messages which will be suppressed and not shown:
  28. * - not yet checked
  29. * .
  30. * Note: To re-enable a Message, insert a space before 'lint' *
  31. *
  32. */
  33. /** @addtogroup CMSIS_CM0_core_definitions CM0 Core Definitions
  34. This file defines all structures and symbols for CMSIS core:
  35. - CMSIS version number
  36. - Cortex-M core registers and bitfields
  37. - Cortex-M core peripheral base address
  38. @{
  39. */
  40. #ifdef __cplusplus
  41. extern "C" {
  42. #endif
  43. #define __CM0_CMSIS_VERSION_MAIN (0x01) /*!< [31:16] CMSIS HAL main version */
  44. #define __CM0_CMSIS_VERSION_SUB (0x30) /*!< [15:0] CMSIS HAL sub version */
  45. #define __CM0_CMSIS_VERSION ((__CM0_CMSIS_VERSION_MAIN << 16) | __CM0_CMSIS_VERSION_SUB) /*!< CMSIS HAL version number */
  46. #define __CORTEX_M (0x00) /*!< Cortex core */
  47. #include <stdint.h> /* Include standard types */
  48. #if defined (__ICCARM__)
  49. #include <intrinsics.h> /* IAR Intrinsics */
  50. #endif
  51. #ifndef __NVIC_PRIO_BITS
  52. #define __NVIC_PRIO_BITS 2 /*!< standard definition for NVIC Priority Bits */
  53. #endif
  54. /**
  55. * IO definitions
  56. *
  57. * define access restrictions to peripheral registers
  58. */
  59. #ifdef __cplusplus
  60. #define __I volatile /*!< defines 'read only' permissions */
  61. #else
  62. #define __I volatile const /*!< defines 'read only' permissions */
  63. #endif
  64. #define __O volatile /*!< defines 'write only' permissions */
  65. #define __IO volatile /*!< defines 'read / write' permissions */
  66. /*******************************************************************************
  67. * Register Abstraction
  68. ******************************************************************************/
  69. /** @addtogroup CMSIS_CM0_core_register CMSIS CM0 Core Register
  70. @{
  71. */
  72. /** @addtogroup CMSIS_CM0_NVIC CMSIS CM0 NVIC
  73. memory mapped structure for Nested Vectored Interrupt Controller (NVIC)
  74. @{
  75. */
  76. typedef struct
  77. {
  78. __IO uint32_t ISER[1]; /*!< (Offset: 0x000) Interrupt Set Enable Register */
  79. uint32_t RESERVED0[31];
  80. __IO uint32_t ICER[1]; /*!< (Offset: 0x080) Interrupt Clear Enable Register */
  81. uint32_t RSERVED1[31];
  82. __IO uint32_t ISPR[1]; /*!< (Offset: 0x100) Interrupt Set Pending Register */
  83. uint32_t RESERVED2[31];
  84. __IO uint32_t ICPR[1]; /*!< (Offset: 0x180) Interrupt Clear Pending Register */
  85. uint32_t RESERVED3[31];
  86. uint32_t RESERVED4[64];
  87. __IO uint32_t IPR[8]; /*!< (Offset: 0x3EC) Interrupt Priority Register */
  88. } NVIC_Type;
  89. /*@}*/ /* end of group CMSIS_CM0_NVIC */
  90. /** @addtogroup CMSIS_CM0_SCB CMSIS CM0 SCB
  91. memory mapped structure for System Control Block (SCB)
  92. @{
  93. */
  94. typedef struct
  95. {
  96. __I uint32_t CPUID; /*!< Offset: 0x00 CPU ID Base Register */
  97. __IO uint32_t ICSR; /*!< Offset: 0x04 Interrupt Control State Register */
  98. uint32_t RESERVED0;
  99. __IO uint32_t AIRCR; /*!< Offset: 0x0C Application Interrupt / Reset Control Register */
  100. __IO uint32_t SCR; /*!< Offset: 0x10 System Control Register */
  101. __IO uint32_t CCR; /*!< Offset: 0x14 Configuration Control Register */
  102. uint32_t RESERVED1;
  103. __IO uint32_t SHP[2]; /*!< Offset: 0x1C System Handlers Priority Registers. [0] is RESERVED */
  104. __IO uint32_t SHCSR; /*!< Offset: 0x24 System Handler Control and State Register */
  105. uint32_t RESERVED2[2];
  106. __IO uint32_t DFSR; /*!< Offset: 0x30 Debug Fault Status Register */
  107. } SCB_Type;
  108. /* SCB CPUID Register Definitions */
  109. #define SCB_CPUID_IMPLEMENTER_Pos 24 /*!< SCB CPUID: IMPLEMENTER Position */
  110. #define SCB_CPUID_IMPLEMENTER_Msk (0xFFul << SCB_CPUID_IMPLEMENTER_Pos) /*!< SCB CPUID: IMPLEMENTER Mask */
  111. #define SCB_CPUID_VARIANT_Pos 20 /*!< SCB CPUID: VARIANT Position */
  112. #define SCB_CPUID_VARIANT_Msk (0xFul << SCB_CPUID_VARIANT_Pos) /*!< SCB CPUID: VARIANT Mask */
  113. #define SCB_CPUID_ARCHITECTURE_Pos 16 /*!< SCB CPUID: ARCHITECTURE Position */
  114. #define SCB_CPUID_ARCHITECTURE_Msk (0xFul << SCB_CPUID_ARCHITECTURE_Pos) /*!< SCB CPUID: ARCHITECTURE Mask */
  115. #define SCB_CPUID_PARTNO_Pos 4 /*!< SCB CPUID: PARTNO Position */
  116. #define SCB_CPUID_PARTNO_Msk (0xFFFul << SCB_CPUID_PARTNO_Pos) /*!< SCB CPUID: PARTNO Mask */
  117. #define SCB_CPUID_REVISION_Pos 0 /*!< SCB CPUID: REVISION Position */
  118. #define SCB_CPUID_REVISION_Msk (0xFul << SCB_CPUID_REVISION_Pos) /*!< SCB CPUID: REVISION Mask */
  119. /* SCB Interrupt Control State Register Definitions */
  120. #define SCB_ICSR_NMIPENDSET_Pos 31 /*!< SCB ICSR: NMIPENDSET Position */
  121. #define SCB_ICSR_NMIPENDSET_Msk (1ul << SCB_ICSR_NMIPENDSET_Pos) /*!< SCB ICSR: NMIPENDSET Mask */
  122. #define SCB_ICSR_PENDSVSET_Pos 28 /*!< SCB ICSR: PENDSVSET Position */
  123. #define SCB_ICSR_PENDSVSET_Msk (1ul << SCB_ICSR_PENDSVSET_Pos) /*!< SCB ICSR: PENDSVSET Mask */
  124. #define SCB_ICSR_PENDSVCLR_Pos 27 /*!< SCB ICSR: PENDSVCLR Position */
  125. #define SCB_ICSR_PENDSVCLR_Msk (1ul << SCB_ICSR_PENDSVCLR_Pos) /*!< SCB ICSR: PENDSVCLR Mask */
  126. #define SCB_ICSR_PENDSTSET_Pos 26 /*!< SCB ICSR: PENDSTSET Position */
  127. #define SCB_ICSR_PENDSTSET_Msk (1ul << SCB_ICSR_PENDSTSET_Pos) /*!< SCB ICSR: PENDSTSET Mask */
  128. #define SCB_ICSR_PENDSTCLR_Pos 25 /*!< SCB ICSR: PENDSTCLR Position */
  129. #define SCB_ICSR_PENDSTCLR_Msk (1ul << SCB_ICSR_PENDSTCLR_Pos) /*!< SCB ICSR: PENDSTCLR Mask */
  130. #define SCB_ICSR_ISRPREEMPT_Pos 23 /*!< SCB ICSR: ISRPREEMPT Position */
  131. #define SCB_ICSR_ISRPREEMPT_Msk (1ul << SCB_ICSR_ISRPREEMPT_Pos) /*!< SCB ICSR: ISRPREEMPT Mask */
  132. #define SCB_ICSR_ISRPENDING_Pos 22 /*!< SCB ICSR: ISRPENDING Position */
  133. #define SCB_ICSR_ISRPENDING_Msk (1ul << SCB_ICSR_ISRPENDING_Pos) /*!< SCB ICSR: ISRPENDING Mask */
  134. #define SCB_ICSR_VECTPENDING_Pos 12 /*!< SCB ICSR: VECTPENDING Position */
  135. #define SCB_ICSR_VECTPENDING_Msk (0x1FFul << SCB_ICSR_VECTPENDING_Pos) /*!< SCB ICSR: VECTPENDING Mask */
  136. #define SCB_ICSR_VECTACTIVE_Pos 0 /*!< SCB ICSR: VECTACTIVE Position */
  137. #define SCB_ICSR_VECTACTIVE_Msk (0x1FFul << SCB_ICSR_VECTACTIVE_Pos) /*!< SCB ICSR: VECTACTIVE Mask */
  138. /* SCB Application Interrupt and Reset Control Register Definitions */
  139. #define SCB_AIRCR_VECTKEY_Pos 16 /*!< SCB AIRCR: VECTKEY Position */
  140. #define SCB_AIRCR_VECTKEY_Msk (0xFFFFul << SCB_AIRCR_VECTKEY_Pos) /*!< SCB AIRCR: VECTKEY Mask */
  141. #define SCB_AIRCR_VECTKEYSTAT_Pos 16 /*!< SCB AIRCR: VECTKEYSTAT Position */
  142. #define SCB_AIRCR_VECTKEYSTAT_Msk (0xFFFFul << SCB_AIRCR_VECTKEYSTAT_Pos) /*!< SCB AIRCR: VECTKEYSTAT Mask */
  143. #define SCB_AIRCR_ENDIANESS_Pos 15 /*!< SCB AIRCR: ENDIANESS Position */
  144. #define SCB_AIRCR_ENDIANESS_Msk (1ul << SCB_AIRCR_ENDIANESS_Pos) /*!< SCB AIRCR: ENDIANESS Mask */
  145. #define SCB_AIRCR_SYSRESETREQ_Pos 2 /*!< SCB AIRCR: SYSRESETREQ Position */
  146. #define SCB_AIRCR_SYSRESETREQ_Msk (1ul << SCB_AIRCR_SYSRESETREQ_Pos) /*!< SCB AIRCR: SYSRESETREQ Mask */
  147. #define SCB_AIRCR_VECTCLRACTIVE_Pos 1 /*!< SCB AIRCR: VECTCLRACTIVE Position */
  148. #define SCB_AIRCR_VECTCLRACTIVE_Msk (1ul << SCB_AIRCR_VECTCLRACTIVE_Pos) /*!< SCB AIRCR: VECTCLRACTIVE Mask */
  149. /* SCB System Control Register Definitions */
  150. #define SCB_SCR_SEVONPEND_Pos 4 /*!< SCB SCR: SEVONPEND Position */
  151. #define SCB_SCR_SEVONPEND_Msk (1ul << SCB_SCR_SEVONPEND_Pos) /*!< SCB SCR: SEVONPEND Mask */
  152. #define SCB_SCR_SLEEPDEEP_Pos 2 /*!< SCB SCR: SLEEPDEEP Position */
  153. #define SCB_SCR_SLEEPDEEP_Msk (1ul << SCB_SCR_SLEEPDEEP_Pos) /*!< SCB SCR: SLEEPDEEP Mask */
  154. #define SCB_SCR_SLEEPONEXIT_Pos 1 /*!< SCB SCR: SLEEPONEXIT Position */
  155. #define SCB_SCR_SLEEPONEXIT_Msk (1ul << SCB_SCR_SLEEPONEXIT_Pos) /*!< SCB SCR: SLEEPONEXIT Mask */
  156. /* SCB Configuration Control Register Definitions */
  157. #define SCB_CCR_STKALIGN_Pos 9 /*!< SCB CCR: STKALIGN Position */
  158. #define SCB_CCR_STKALIGN_Msk (1ul << SCB_CCR_STKALIGN_Pos) /*!< SCB CCR: STKALIGN Mask */
  159. #define SCB_CCR_UNALIGN_TRP_Pos 3 /*!< SCB CCR: UNALIGN_TRP Position */
  160. #define SCB_CCR_UNALIGN_TRP_Msk (1ul << SCB_CCR_UNALIGN_TRP_Pos) /*!< SCB CCR: UNALIGN_TRP Mask */
  161. /* SCB System Handler Control and State Register Definitions */
  162. #define SCB_SHCSR_SVCALLPENDED_Pos 15 /*!< SCB SHCSR: SVCALLPENDED Position */
  163. #define SCB_SHCSR_SVCALLPENDED_Msk (1ul << SCB_SHCSR_SVCALLPENDED_Pos) /*!< SCB SHCSR: SVCALLPENDED Mask */
  164. /* SCB Debug Fault Status Register Definitions */
  165. #define SCB_DFSR_EXTERNAL_Pos 4 /*!< SCB DFSR: EXTERNAL Position */
  166. #define SCB_DFSR_EXTERNAL_Msk (1ul << SCB_DFSR_EXTERNAL_Pos) /*!< SCB DFSR: EXTERNAL Mask */
  167. #define SCB_DFSR_VCATCH_Pos 3 /*!< SCB DFSR: VCATCH Position */
  168. #define SCB_DFSR_VCATCH_Msk (1ul << SCB_DFSR_VCATCH_Pos) /*!< SCB DFSR: VCATCH Mask */
  169. #define SCB_DFSR_DWTTRAP_Pos 2 /*!< SCB DFSR: DWTTRAP Position */
  170. #define SCB_DFSR_DWTTRAP_Msk (1ul << SCB_DFSR_DWTTRAP_Pos) /*!< SCB DFSR: DWTTRAP Mask */
  171. #define SCB_DFSR_BKPT_Pos 1 /*!< SCB DFSR: BKPT Position */
  172. #define SCB_DFSR_BKPT_Msk (1ul << SCB_DFSR_BKPT_Pos) /*!< SCB DFSR: BKPT Mask */
  173. #define SCB_DFSR_HALTED_Pos 0 /*!< SCB DFSR: HALTED Position */
  174. #define SCB_DFSR_HALTED_Msk (1ul << SCB_DFSR_HALTED_Pos) /*!< SCB DFSR: HALTED Mask */
  175. /*@}*/ /* end of group CMSIS_CM0_SCB */
  176. /** @addtogroup CMSIS_CM0_SysTick CMSIS CM0 SysTick
  177. memory mapped structure for SysTick
  178. @{
  179. */
  180. typedef struct
  181. {
  182. __IO uint32_t CTRL; /*!< Offset: 0x00 SysTick Control and Status Register */
  183. __IO uint32_t LOAD; /*!< Offset: 0x04 SysTick Reload Value Register */
  184. __IO uint32_t VAL; /*!< Offset: 0x08 SysTick Current Value Register */
  185. __I uint32_t CALIB; /*!< Offset: 0x0C SysTick Calibration Register */
  186. } SysTick_Type;
  187. /* SysTick Control / Status Register Definitions */
  188. #define SysTick_CTRL_COUNTFLAG_Pos 16 /*!< SysTick CTRL: COUNTFLAG Position */
  189. #define SysTick_CTRL_COUNTFLAG_Msk (1ul << SysTick_CTRL_COUNTFLAG_Pos) /*!< SysTick CTRL: COUNTFLAG Mask */
  190. #define SysTick_CTRL_CLKSOURCE_Pos 2 /*!< SysTick CTRL: CLKSOURCE Position */
  191. #define SysTick_CTRL_CLKSOURCE_Msk (1ul << SysTick_CTRL_CLKSOURCE_Pos) /*!< SysTick CTRL: CLKSOURCE Mask */
  192. #define SysTick_CTRL_TICKINT_Pos 1 /*!< SysTick CTRL: TICKINT Position */
  193. #define SysTick_CTRL_TICKINT_Msk (1ul << SysTick_CTRL_TICKINT_Pos) /*!< SysTick CTRL: TICKINT Mask */
  194. #define SysTick_CTRL_ENABLE_Pos 0 /*!< SysTick CTRL: ENABLE Position */
  195. #define SysTick_CTRL_ENABLE_Msk (1ul << SysTick_CTRL_ENABLE_Pos) /*!< SysTick CTRL: ENABLE Mask */
  196. /* SysTick Reload Register Definitions */
  197. #define SysTick_LOAD_RELOAD_Pos 0 /*!< SysTick LOAD: RELOAD Position */
  198. #define SysTick_LOAD_RELOAD_Msk (0xFFFFFFul << SysTick_LOAD_RELOAD_Pos) /*!< SysTick LOAD: RELOAD Mask */
  199. /* SysTick Current Register Definitions */
  200. #define SysTick_VAL_CURRENT_Pos 0 /*!< SysTick VAL: CURRENT Position */
  201. #define SysTick_VAL_CURRENT_Msk (0xFFFFFFul << SysTick_VAL_CURRENT_Pos) /*!< SysTick VAL: CURRENT Mask */
  202. /* SysTick Calibration Register Definitions */
  203. #define SysTick_CALIB_NOREF_Pos 31 /*!< SysTick CALIB: NOREF Position */
  204. #define SysTick_CALIB_NOREF_Msk (1ul << SysTick_CALIB_NOREF_Pos) /*!< SysTick CALIB: NOREF Mask */
  205. #define SysTick_CALIB_SKEW_Pos 30 /*!< SysTick CALIB: SKEW Position */
  206. #define SysTick_CALIB_SKEW_Msk (1ul << SysTick_CALIB_SKEW_Pos) /*!< SysTick CALIB: SKEW Mask */
  207. #define SysTick_CALIB_TENMS_Pos 0 /*!< SysTick CALIB: TENMS Position */
  208. #define SysTick_CALIB_TENMS_Msk (0xFFFFFFul << SysTick_VAL_CURRENT_Pos) /*!< SysTick CALIB: TENMS Mask */
  209. /*@}*/ /* end of group CMSIS_CM0_SysTick */
  210. /** @addtogroup CMSIS_CM0_CoreDebug CMSIS CM0 Core Debug
  211. memory mapped structure for Core Debug Register
  212. @{
  213. */
  214. typedef struct
  215. {
  216. __IO uint32_t DHCSR; /*!< Offset: 0x00 Debug Halting Control and Status Register */
  217. __O uint32_t DCRSR; /*!< Offset: 0x04 Debug Core Register Selector Register */
  218. __IO uint32_t DCRDR; /*!< Offset: 0x08 Debug Core Register Data Register */
  219. __IO uint32_t DEMCR; /*!< Offset: 0x0C Debug Exception and Monitor Control Register */
  220. } CoreDebug_Type;
  221. /* Debug Halting Control and Status Register */
  222. #define CoreDebug_DHCSR_DBGKEY_Pos 16 /*!< CoreDebug DHCSR: DBGKEY Position */
  223. #define CoreDebug_DHCSR_DBGKEY_Msk (0xFFFFul << CoreDebug_DHCSR_DBGKEY_Pos) /*!< CoreDebug DHCSR: DBGKEY Mask */
  224. #define CoreDebug_DHCSR_S_RESET_ST_Pos 25 /*!< CoreDebug DHCSR: S_RESET_ST Position */
  225. #define CoreDebug_DHCSR_S_RESET_ST_Msk (1ul << CoreDebug_DHCSR_S_RESET_ST_Pos) /*!< CoreDebug DHCSR: S_RESET_ST Mask */
  226. #define CoreDebug_DHCSR_S_RETIRE_ST_Pos 24 /*!< CoreDebug DHCSR: S_RETIRE_ST Position */
  227. #define CoreDebug_DHCSR_S_RETIRE_ST_Msk (1ul << CoreDebug_DHCSR_S_RETIRE_ST_Pos) /*!< CoreDebug DHCSR: S_RETIRE_ST Mask */
  228. #define CoreDebug_DHCSR_S_LOCKUP_Pos 19 /*!< CoreDebug DHCSR: S_LOCKUP Position */
  229. #define CoreDebug_DHCSR_S_LOCKUP_Msk (1ul << CoreDebug_DHCSR_S_LOCKUP_Pos) /*!< CoreDebug DHCSR: S_LOCKUP Mask */
  230. #define CoreDebug_DHCSR_S_SLEEP_Pos 18 /*!< CoreDebug DHCSR: S_SLEEP Position */
  231. #define CoreDebug_DHCSR_S_SLEEP_Msk (1ul << CoreDebug_DHCSR_S_SLEEP_Pos) /*!< CoreDebug DHCSR: S_SLEEP Mask */
  232. #define CoreDebug_DHCSR_S_HALT_Pos 17 /*!< CoreDebug DHCSR: S_HALT Position */
  233. #define CoreDebug_DHCSR_S_HALT_Msk (1ul << CoreDebug_DHCSR_S_HALT_Pos) /*!< CoreDebug DHCSR: S_HALT Mask */
  234. #define CoreDebug_DHCSR_S_REGRDY_Pos 16 /*!< CoreDebug DHCSR: S_REGRDY Position */
  235. #define CoreDebug_DHCSR_S_REGRDY_Msk (1ul << CoreDebug_DHCSR_S_REGRDY_Pos) /*!< CoreDebug DHCSR: S_REGRDY Mask */
  236. #define CoreDebug_DHCSR_C_MASKINTS_Pos 3 /*!< CoreDebug DHCSR: C_MASKINTS Position */
  237. #define CoreDebug_DHCSR_C_MASKINTS_Msk (1ul << CoreDebug_DHCSR_C_MASKINTS_Pos) /*!< CoreDebug DHCSR: C_MASKINTS Mask */
  238. #define CoreDebug_DHCSR_C_STEP_Pos 2 /*!< CoreDebug DHCSR: C_STEP Position */
  239. #define CoreDebug_DHCSR_C_STEP_Msk (1ul << CoreDebug_DHCSR_C_STEP_Pos) /*!< CoreDebug DHCSR: C_STEP Mask */
  240. #define CoreDebug_DHCSR_C_HALT_Pos 1 /*!< CoreDebug DHCSR: C_HALT Position */
  241. #define CoreDebug_DHCSR_C_HALT_Msk (1ul << CoreDebug_DHCSR_C_HALT_Pos) /*!< CoreDebug DHCSR: C_HALT Mask */
  242. #define CoreDebug_DHCSR_C_DEBUGEN_Pos 0 /*!< CoreDebug DHCSR: C_DEBUGEN Position */
  243. #define CoreDebug_DHCSR_C_DEBUGEN_Msk (1ul << CoreDebug_DHCSR_C_DEBUGEN_Pos) /*!< CoreDebug DHCSR: C_DEBUGEN Mask */
  244. /* Debug Core Register Selector Register */
  245. #define CoreDebug_DCRSR_REGWnR_Pos 16 /*!< CoreDebug DCRSR: REGWnR Position */
  246. #define CoreDebug_DCRSR_REGWnR_Msk (1ul << CoreDebug_DCRSR_REGWnR_Pos) /*!< CoreDebug DCRSR: REGWnR Mask */
  247. #define CoreDebug_DCRSR_REGSEL_Pos 0 /*!< CoreDebug DCRSR: REGSEL Position */
  248. #define CoreDebug_DCRSR_REGSEL_Msk (0x1Ful << CoreDebug_DCRSR_REGSEL_Pos) /*!< CoreDebug DCRSR: REGSEL Mask */
  249. /* Debug Exception and Monitor Control Register */
  250. #define CoreDebug_DEMCR_DWTENA_Pos 24 /*!< CoreDebug DEMCR: DWTENA Position */
  251. #define CoreDebug_DEMCR_DWTENA_Msk (1ul << CoreDebug_DEMCR_DWTENA_Pos) /*!< CoreDebug DEMCR: DWTENA Mask */
  252. #define CoreDebug_DEMCR_VC_HARDERR_Pos 10 /*!< CoreDebug DEMCR: VC_HARDERR Position */
  253. #define CoreDebug_DEMCR_VC_HARDERR_Msk (1ul << CoreDebug_DEMCR_VC_HARDERR_Pos) /*!< CoreDebug DEMCR: VC_HARDERR Mask */
  254. #define CoreDebug_DEMCR_VC_CORERESET_Pos 0 /*!< CoreDebug DEMCR: VC_CORERESET Position */
  255. #define CoreDebug_DEMCR_VC_CORERESET_Msk (1ul << CoreDebug_DEMCR_VC_CORERESET_Pos) /*!< CoreDebug DEMCR: VC_CORERESET Mask */
  256. /*@}*/ /* end of group CMSIS_CM0_CoreDebug */
  257. /* Memory mapping of Cortex-M0 Hardware */
  258. #define SCS_BASE (0xE000E000) /*!< System Control Space Base Address */
  259. #define CoreDebug_BASE (0xE000EDF0) /*!< Core Debug Base Address */
  260. #define SysTick_BASE (SCS_BASE + 0x0010) /*!< SysTick Base Address */
  261. #define NVIC_BASE (SCS_BASE + 0x0100) /*!< NVIC Base Address */
  262. #define SCB_BASE (SCS_BASE + 0x0D00) /*!< System Control Block Base Address */
  263. #define SCB ((SCB_Type *) SCB_BASE) /*!< SCB configuration struct */
  264. #define SysTick ((SysTick_Type *) SysTick_BASE) /*!< SysTick configuration struct */
  265. #define NVIC ((NVIC_Type *) NVIC_BASE) /*!< NVIC configuration struct */
  266. #define CoreDebug ((CoreDebug_Type *) CoreDebug_BASE) /*!< Core Debug configuration struct */
  267. /*@}*/ /* end of group CMSIS_CM0_core_register */
  268. /*******************************************************************************
  269. * Hardware Abstraction Layer
  270. ******************************************************************************/
  271. #if defined ( __CC_ARM )
  272. #define __ASM __asm /*!< asm keyword for ARM Compiler */
  273. #define __INLINE __inline /*!< inline keyword for ARM Compiler */
  274. #elif defined ( __ICCARM__ )
  275. #define __ASM __asm /*!< asm keyword for IAR Compiler */
  276. #define __INLINE inline /*!< inline keyword for IAR Compiler. Only avaiable in High optimization mode! */
  277. #elif defined ( __GNUC__ )
  278. #define __ASM __asm /*!< asm keyword for GNU Compiler */
  279. #define __INLINE inline /*!< inline keyword for GNU Compiler */
  280. #elif defined ( __TASKING__ )
  281. #define __ASM __asm /*!< asm keyword for TASKING Compiler */
  282. #define __INLINE inline /*!< inline keyword for TASKING Compiler */
  283. #endif
  284. /* ################### Compiler specific Intrinsics ########################### */
  285. #if defined ( __CC_ARM ) /*------------------RealView Compiler -----------------*/
  286. /* ARM armcc specific functions */
  287. #define __enable_fault_irq __enable_fiq
  288. #define __disable_fault_irq __disable_fiq
  289. #define __NOP __nop
  290. #define __WFI __wfi
  291. #define __WFE __wfe
  292. #define __SEV __sev
  293. #define __ISB() __isb(0)
  294. #define __DSB() __dsb(0)
  295. #define __DMB() __dmb(0)
  296. #define __REV __rev
  297. /* intrinsic void __enable_irq(); */
  298. /* intrinsic void __disable_irq(); */
  299. /**
  300. * @brief Return the Process Stack Pointer
  301. *
  302. * @return ProcessStackPointer
  303. *
  304. * Return the actual process stack pointer
  305. */
  306. extern uint32_t __get_PSP(void);
  307. /**
  308. * @brief Set the Process Stack Pointer
  309. *
  310. * @param topOfProcStack Process Stack Pointer
  311. *
  312. * Assign the value ProcessStackPointer to the MSP
  313. * (process stack pointer) Cortex processor register
  314. */
  315. extern void __set_PSP(uint32_t topOfProcStack);
  316. /**
  317. * @brief Return the Main Stack Pointer
  318. *
  319. * @return Main Stack Pointer
  320. *
  321. * Return the current value of the MSP (main stack pointer)
  322. * Cortex processor register
  323. */
  324. extern uint32_t __get_MSP(void);
  325. /**
  326. * @brief Set the Main Stack Pointer
  327. *
  328. * @param topOfMainStack Main Stack Pointer
  329. *
  330. * Assign the value mainStackPointer to the MSP
  331. * (main stack pointer) Cortex processor register
  332. */
  333. extern void __set_MSP(uint32_t topOfMainStack);
  334. /**
  335. * @brief Reverse byte order in unsigned short value
  336. *
  337. * @param value value to reverse
  338. * @return reversed value
  339. *
  340. * Reverse byte order in unsigned short value
  341. */
  342. extern uint32_t __REV16(uint16_t value);
  343. /**
  344. * @brief Reverse byte order in signed short value with sign extension to integer
  345. *
  346. * @param value value to reverse
  347. * @return reversed value
  348. *
  349. * Reverse byte order in signed short value with sign extension to integer
  350. */
  351. extern int32_t __REVSH(int16_t value);
  352. #if (__ARMCC_VERSION < 400000)
  353. /**
  354. * @brief Return the Priority Mask value
  355. *
  356. * @return PriMask
  357. *
  358. * Return state of the priority mask bit from the priority mask register
  359. */
  360. extern uint32_t __get_PRIMASK(void);
  361. /**
  362. * @brief Set the Priority Mask value
  363. *
  364. * @param priMask PriMask
  365. *
  366. * Set the priority mask bit in the priority mask register
  367. */
  368. extern void __set_PRIMASK(uint32_t priMask);
  369. /**
  370. * @brief Return the Control Register value
  371. *
  372. * @return Control value
  373. *
  374. * Return the content of the control register
  375. */
  376. extern uint32_t __get_CONTROL(void);
  377. /**
  378. * @brief Set the Control Register value
  379. *
  380. * @param control Control value
  381. *
  382. * Set the control register
  383. */
  384. extern void __set_CONTROL(uint32_t control);
  385. #else /* (__ARMCC_VERSION >= 400000) */
  386. /**
  387. * @brief Return the Priority Mask value
  388. *
  389. * @return PriMask
  390. *
  391. * Return state of the priority mask bit from the priority mask register
  392. */
  393. static __INLINE uint32_t __get_PRIMASK(void)
  394. {
  395. register uint32_t __regPriMask __ASM("primask");
  396. return(__regPriMask);
  397. }
  398. /**
  399. * @brief Set the Priority Mask value
  400. *
  401. * @param priMask PriMask
  402. *
  403. * Set the priority mask bit in the priority mask register
  404. */
  405. static __INLINE void __set_PRIMASK(uint32_t priMask)
  406. {
  407. register uint32_t __regPriMask __ASM("primask");
  408. __regPriMask = (priMask);
  409. }
  410. /**
  411. * @brief Return the Control Register value
  412. *
  413. * @return Control value
  414. *
  415. * Return the content of the control register
  416. */
  417. static __INLINE uint32_t __get_CONTROL(void)
  418. {
  419. register uint32_t __regControl __ASM("control");
  420. return(__regControl);
  421. }
  422. /**
  423. * @brief Set the Control Register value
  424. *
  425. * @param control Control value
  426. *
  427. * Set the control register
  428. */
  429. static __INLINE void __set_CONTROL(uint32_t control)
  430. {
  431. register uint32_t __regControl __ASM("control");
  432. __regControl = control;
  433. }
  434. #endif /* __ARMCC_VERSION */
  435. #elif (defined (__ICCARM__)) /*------------------ ICC Compiler -------------------*/
  436. /* IAR iccarm specific functions */
  437. #define __enable_irq __enable_interrupt /*!< global Interrupt enable */
  438. #define __disable_irq __disable_interrupt /*!< global Interrupt disable */
  439. static __INLINE void __enable_fault_irq() { __ASM ("cpsie f"); }
  440. static __INLINE void __disable_fault_irq() { __ASM ("cpsid f"); }
  441. #define __NOP __no_operation /*!< no operation intrinsic in IAR Compiler */
  442. static __INLINE void __WFI() { __ASM ("wfi"); }
  443. static __INLINE void __WFE() { __ASM ("wfe"); }
  444. static __INLINE void __SEV() { __ASM ("sev"); }
  445. /* intrinsic void __ISB(void) */
  446. /* intrinsic void __DSB(void) */
  447. /* intrinsic void __DMB(void) */
  448. /* intrinsic void __set_PRIMASK(); */
  449. /* intrinsic void __get_PRIMASK(); */
  450. /* intrinsic uint32_t __REV(uint32_t value); */
  451. /* intrinsic uint32_t __REVSH(uint32_t value); */
  452. /**
  453. * @brief Return the Process Stack Pointer
  454. *
  455. * @return ProcessStackPointer
  456. *
  457. * Return the actual process stack pointer
  458. */
  459. extern uint32_t __get_PSP(void);
  460. /**
  461. * @brief Set the Process Stack Pointer
  462. *
  463. * @param topOfProcStack Process Stack Pointer
  464. *
  465. * Assign the value ProcessStackPointer to the MSP
  466. * (process stack pointer) Cortex processor register
  467. */
  468. extern void __set_PSP(uint32_t topOfProcStack);
  469. /**
  470. * @brief Return the Main Stack Pointer
  471. *
  472. * @return Main Stack Pointer
  473. *
  474. * Return the current value of the MSP (main stack pointer)
  475. * Cortex processor register
  476. */
  477. extern uint32_t __get_MSP(void);
  478. /**
  479. * @brief Set the Main Stack Pointer
  480. *
  481. * @param topOfMainStack Main Stack Pointer
  482. *
  483. * Assign the value mainStackPointer to the MSP
  484. * (main stack pointer) Cortex processor register
  485. */
  486. extern void __set_MSP(uint32_t topOfMainStack);
  487. /**
  488. * @brief Reverse byte order in unsigned short value
  489. *
  490. * @param value value to reverse
  491. * @return reversed value
  492. *
  493. * Reverse byte order in unsigned short value
  494. */
  495. extern uint32_t __REV16(uint16_t value);
  496. #elif (defined (__GNUC__)) /*------------------ GNU Compiler ---------------------*/
  497. /* GNU gcc specific functions */
  498. static __INLINE void __enable_irq() { __ASM volatile ("cpsie i"); }
  499. static __INLINE void __disable_irq() { __ASM volatile ("cpsid i"); }
  500. static __INLINE void __enable_fault_irq() { __ASM volatile ("cpsie f"); }
  501. static __INLINE void __disable_fault_irq() { __ASM volatile ("cpsid f"); }
  502. static __INLINE void __NOP() { __ASM volatile ("nop"); }
  503. static __INLINE void __WFI() { __ASM volatile ("wfi"); }
  504. static __INLINE void __WFE() { __ASM volatile ("wfe"); }
  505. static __INLINE void __SEV() { __ASM volatile ("sev"); }
  506. static __INLINE void __ISB() { __ASM volatile ("isb"); }
  507. static __INLINE void __DSB() { __ASM volatile ("dsb"); }
  508. static __INLINE void __DMB() { __ASM volatile ("dmb"); }
  509. /**
  510. * @brief Return the Process Stack Pointer
  511. *
  512. * @return ProcessStackPointer
  513. *
  514. * Return the actual process stack pointer
  515. */
  516. extern uint32_t __get_PSP(void);
  517. /**
  518. * @brief Set the Process Stack Pointer
  519. *
  520. * @param topOfProcStack Process Stack Pointer
  521. *
  522. * Assign the value ProcessStackPointer to the MSP
  523. * (process stack pointer) Cortex processor register
  524. */
  525. extern void __set_PSP(uint32_t topOfProcStack);
  526. /**
  527. * @brief Return the Main Stack Pointer
  528. *
  529. * @return Main Stack Pointer
  530. *
  531. * Return the current value of the MSP (main stack pointer)
  532. * Cortex processor register
  533. */
  534. extern uint32_t __get_MSP(void);
  535. /**
  536. * @brief Set the Main Stack Pointer
  537. *
  538. * @param topOfMainStack Main Stack Pointer
  539. *
  540. * Assign the value mainStackPointer to the MSP
  541. * (main stack pointer) Cortex processor register
  542. */
  543. extern void __set_MSP(uint32_t topOfMainStack);
  544. /**
  545. * @brief Return the Priority Mask value
  546. *
  547. * @return PriMask
  548. *
  549. * Return state of the priority mask bit from the priority mask register
  550. */
  551. extern uint32_t __get_PRIMASK(void);
  552. /**
  553. * @brief Set the Priority Mask value
  554. *
  555. * @param priMask PriMask
  556. *
  557. * Set the priority mask bit in the priority mask register
  558. */
  559. extern void __set_PRIMASK(uint32_t priMask);
  560. /**
  561. * @brief Return the Control Register value
  562. *
  563. * @return Control value
  564. *
  565. * Return the content of the control register
  566. */
  567. extern uint32_t __get_CONTROL(void);
  568. /**
  569. * @brief Set the Control Register value
  570. *
  571. * @param control Control value
  572. *
  573. * Set the control register
  574. */
  575. extern void __set_CONTROL(uint32_t control);
  576. /**
  577. * @brief Reverse byte order in integer value
  578. *
  579. * @param value value to reverse
  580. * @return reversed value
  581. *
  582. * Reverse byte order in integer value
  583. */
  584. extern uint32_t __REV(uint32_t value);
  585. /**
  586. * @brief Reverse byte order in unsigned short value
  587. *
  588. * @param value value to reverse
  589. * @return reversed value
  590. *
  591. * Reverse byte order in unsigned short value
  592. */
  593. extern uint32_t __REV16(uint16_t value);
  594. /**
  595. * @brief Reverse byte order in signed short value with sign extension to integer
  596. *
  597. * @param value value to reverse
  598. * @return reversed value
  599. *
  600. * Reverse byte order in signed short value with sign extension to integer
  601. */
  602. extern int32_t __REVSH(int16_t value);
  603. #elif (defined (__TASKING__)) /*------------------ TASKING Compiler ---------------------*/
  604. /* TASKING carm specific functions */
  605. /*
  606. * The CMSIS functions have been implemented as intrinsics in the compiler.
  607. * Please use "carm -?i" to get an up to date list of all instrinsics,
  608. * Including the CMSIS ones.
  609. */
  610. #endif
  611. /** @addtogroup CMSIS_CM0_Core_FunctionInterface CMSIS CM0 Core Function Interface
  612. Core Function Interface containing:
  613. - Core NVIC Functions
  614. - Core SysTick Functions
  615. - Core Reset Functions
  616. */
  617. /*@{*/
  618. /* ########################## NVIC functions #################################### */
  619. /* Interrupt Priorities are WORD accessible only under ARMv6M */
  620. /* The following MACROS handle generation of the register offset and byte masks */
  621. #define _BIT_SHIFT(IRQn) ( (((uint32_t)(IRQn) ) & 0x03) * 8 )
  622. #define _SHP_IDX(IRQn) ( ((((uint32_t)(IRQn) & 0x0F)-8) >> 2) )
  623. #define _IP_IDX(IRQn) ( ((uint32_t)(IRQn) >> 2) )
  624. /**
  625. * @brief Enable Interrupt in NVIC Interrupt Controller
  626. *
  627. * @param IRQn The positive number of the external interrupt to enable
  628. *
  629. * Enable a device specific interupt in the NVIC interrupt controller.
  630. * The interrupt number cannot be a negative value.
  631. */
  632. static __INLINE void NVIC_EnableIRQ(IRQn_Type IRQn)
  633. {
  634. NVIC->ISER[0] = (1 << ((uint32_t)(IRQn) & 0x1F)); /* enable interrupt */
  635. }
  636. /**
  637. * @brief Disable the interrupt line for external interrupt specified
  638. *
  639. * @param IRQn The positive number of the external interrupt to disable
  640. *
  641. * Disable a device specific interupt in the NVIC interrupt controller.
  642. * The interrupt number cannot be a negative value.
  643. */
  644. static __INLINE void NVIC_DisableIRQ(IRQn_Type IRQn)
  645. {
  646. NVIC->ICER[0] = (1 << ((uint32_t)(IRQn) & 0x1F)); /* disable interrupt */
  647. }
  648. /**
  649. * @brief Read the interrupt pending bit for a device specific interrupt source
  650. *
  651. * @param IRQn The number of the device specifc interrupt
  652. * @return 1 = interrupt pending, 0 = interrupt not pending
  653. *
  654. * Read the pending register in NVIC and return 1 if its status is pending,
  655. * otherwise it returns 0
  656. */
  657. static __INLINE uint32_t NVIC_GetPendingIRQ(IRQn_Type IRQn)
  658. {
  659. return((uint32_t) ((NVIC->ISPR[0] & (1 << ((uint32_t)(IRQn) & 0x1F)))?1:0)); /* Return 1 if pending else 0 */
  660. }
  661. /**
  662. * @brief Set the pending bit for an external interrupt
  663. *
  664. * @param IRQn The number of the interrupt for set pending
  665. *
  666. * Set the pending bit for the specified interrupt.
  667. * The interrupt number cannot be a negative value.
  668. */
  669. static __INLINE void NVIC_SetPendingIRQ(IRQn_Type IRQn)
  670. {
  671. NVIC->ISPR[0] = (1 << ((uint32_t)(IRQn) & 0x1F)); /* set interrupt pending */
  672. }
  673. /**
  674. * @brief Clear the pending bit for an external interrupt
  675. *
  676. * @param IRQn The number of the interrupt for clear pending
  677. *
  678. * Clear the pending bit for the specified interrupt.
  679. * The interrupt number cannot be a negative value.
  680. */
  681. static __INLINE void NVIC_ClearPendingIRQ(IRQn_Type IRQn)
  682. {
  683. NVIC->ICPR[0] = (1 << ((uint32_t)(IRQn) & 0x1F)); /* Clear pending interrupt */
  684. }
  685. /**
  686. * @brief Set the priority for an interrupt
  687. *
  688. * @param IRQn The number of the interrupt for set priority
  689. * @param priority The priority to set
  690. *
  691. * Set the priority for the specified interrupt. The interrupt
  692. * number can be positive to specify an external (device specific)
  693. * interrupt, or negative to specify an internal (core) interrupt.
  694. *
  695. * Note: The priority cannot be set for every core interrupt.
  696. */
  697. static __INLINE void NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority)
  698. {
  699. if(IRQn < 0) {
  700. SCB->SHP[_SHP_IDX(IRQn)] = (SCB->SHP[_SHP_IDX(IRQn)] & ~(0xFF << _BIT_SHIFT(IRQn))) |
  701. (((priority << (8 - __NVIC_PRIO_BITS)) & 0xFF) << _BIT_SHIFT(IRQn)); }
  702. else {
  703. NVIC->IPR[_IP_IDX(IRQn)] = (NVIC->IPR[_IP_IDX(IRQn)] & ~(0xFF << _BIT_SHIFT(IRQn))) |
  704. (((priority << (8 - __NVIC_PRIO_BITS)) & 0xFF) << _BIT_SHIFT(IRQn)); }
  705. }
  706. /**
  707. * @brief Read the priority for an interrupt
  708. *
  709. * @param IRQn The number of the interrupt for get priority
  710. * @return The priority for the interrupt
  711. *
  712. * Read the priority for the specified interrupt. The interrupt
  713. * number can be positive to specify an external (device specific)
  714. * interrupt, or negative to specify an internal (core) interrupt.
  715. *
  716. * The returned priority value is automatically aligned to the implemented
  717. * priority bits of the microcontroller.
  718. *
  719. * Note: The priority cannot be set for every core interrupt.
  720. */
  721. static __INLINE uint32_t NVIC_GetPriority(IRQn_Type IRQn)
  722. {
  723. if(IRQn < 0) {
  724. return((uint32_t)((SCB->SHP[_SHP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) >> (8 - __NVIC_PRIO_BITS))); } /* get priority for Cortex-M0 system interrupts */
  725. else {
  726. return((uint32_t)((NVIC->IPR[_IP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) >> (8 - __NVIC_PRIO_BITS))); } /* get priority for device specific interrupts */
  727. }
  728. /* ################################## SysTick function ############################################ */
  729. #if (!defined (__Vendor_SysTickConfig)) || (__Vendor_SysTickConfig == 0)
  730. /**
  731. * @brief Initialize and start the SysTick counter and its interrupt.
  732. *
  733. * @param ticks number of ticks between two interrupts
  734. * @return 1 = failed, 0 = successful
  735. *
  736. * Initialise the system tick timer and its interrupt and start the
  737. * system tick timer / counter in free running mode to generate
  738. * periodical interrupts.
  739. */
  740. static __INLINE uint32_t SysTick_Config(uint32_t ticks)
  741. {
  742. if (ticks > SysTick_LOAD_RELOAD_Msk) return (1); /* Reload value impossible */
  743. SysTick->LOAD = (ticks & SysTick_LOAD_RELOAD_Msk) - 1; /* set reload register */
  744. NVIC_SetPriority (SysTick_IRQn, (1<<__NVIC_PRIO_BITS) - 1); /* set Priority for Cortex-M0 System Interrupts */
  745. SysTick->VAL = 0; /* Load the SysTick Counter Value */
  746. SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
  747. SysTick_CTRL_TICKINT_Msk |
  748. SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */
  749. return (0); /* Function successful */
  750. }
  751. #endif
  752. /* ################################## Reset function ############################################ */
  753. /**
  754. * @brief Initiate a system reset request.
  755. *
  756. * Initiate a system reset request to reset the MCU
  757. */
  758. static __INLINE void NVIC_SystemReset(void)
  759. {
  760. SCB->AIRCR = ((0x5FA << SCB_AIRCR_VECTKEY_Pos) |
  761. SCB_AIRCR_SYSRESETREQ_Msk);
  762. __DSB(); /* Ensure completion of memory access */
  763. while(1); /* wait until reset */
  764. }
  765. /*@}*/ /* end of group CMSIS_CM0_Core_FunctionInterface */
  766. #ifdef __cplusplus
  767. }
  768. #endif
  769. /*@}*/ /* end of group CMSIS_CM0_core_definitions */
  770. #endif /* __CM0_CORE_H__ */
  771. /*lint -restore */