core_armv81mml.h 165 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968
  1. /**************************************************************************//**
  2. * @file core_armv81mml.h
  3. * @brief CMSIS Armv8.1-M Mainline Core Peripheral Access Layer Header File
  4. * @version V1.0.0
  5. * @date 15. March 2019
  6. ******************************************************************************/
  7. /*
  8. * Copyright (c) 2018-2019 Arm Limited. All rights reserved.
  9. *
  10. * SPDX-License-Identifier: Apache-2.0
  11. *
  12. * Licensed under the Apache License, Version 2.0 (the License); you may
  13. * not use this file except in compliance with the License.
  14. * You may obtain a copy of the License at
  15. *
  16. * www.apache.org/licenses/LICENSE-2.0
  17. *
  18. * Unless required by applicable law or agreed to in writing, software
  19. * distributed under the License is distributed on an AS IS BASIS, WITHOUT
  20. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  21. * See the License for the specific language governing permissions and
  22. * limitations under the License.
  23. */
  24. #if defined ( __ICCARM__ )
  25. #pragma system_include /* treat file as system include file for MISRA check */
  26. #elif defined (__clang__)
  27. #pragma clang system_header /* treat file as system include file */
  28. #endif
  29. #ifndef __CORE_ARMV81MML_H_GENERIC
  30. #define __CORE_ARMV81MML_H_GENERIC
  31. #include <stdint.h>
  32. #ifdef __cplusplus
  33. extern "C" {
  34. #endif
  35. /**
  36. \page CMSIS_MISRA_Exceptions MISRA-C:2004 Compliance Exceptions
  37. CMSIS violates the following MISRA-C:2004 rules:
  38. \li Required Rule 8.5, object/function definition in header file.<br>
  39. Function definitions in header files are used to allow 'inlining'.
  40. \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.<br>
  41. Unions are used for effective representation of core registers.
  42. \li Advisory Rule 19.7, Function-like macro defined.<br>
  43. Function-like macros are used to allow more efficient code.
  44. */
  45. /*******************************************************************************
  46. * CMSIS definitions
  47. ******************************************************************************/
  48. /**
  49. \ingroup Cortex_ARMV81MML
  50. @{
  51. */
  52. #include "cmsis_version.h"
  53. #define __ARM_ARCH_8M_MAIN__ 1 // patching for now
  54. /* CMSIS ARMV81MML definitions */
  55. #define __ARMv81MML_CMSIS_VERSION_MAIN (__CM_CMSIS_VERSION_MAIN) /*!< \deprecated [31:16] CMSIS HAL main version */
  56. #define __ARMv81MML_CMSIS_VERSION_SUB (__CM_CMSIS_VERSION_SUB) /*!< \deprecated [15:0] CMSIS HAL sub version */
  57. #define __ARMv81MML_CMSIS_VERSION ((__ARMv81MML_CMSIS_VERSION_MAIN << 16U) | \
  58. __ARMv81MML_CMSIS_VERSION_SUB ) /*!< \deprecated CMSIS HAL version number */
  59. #define __CORTEX_M (81U) /*!< Cortex-M Core */
  60. /** __FPU_USED indicates whether an FPU is used or not.
  61. For this, __FPU_PRESENT has to be checked prior to making use of FPU specific registers and functions.
  62. */
  63. #if defined ( __CC_ARM )
  64. #if defined __TARGET_FPU_VFP
  65. #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)
  66. #define __FPU_USED 1U
  67. #else
  68. #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
  69. #define __FPU_USED 0U
  70. #endif
  71. #else
  72. #define __FPU_USED 0U
  73. #endif
  74. #if defined(__ARM_FEATURE_DSP)
  75. #if defined(__DSP_PRESENT) && (__DSP_PRESENT == 1U)
  76. #define __DSP_USED 1U
  77. #else
  78. #error "Compiler generates DSP (SIMD) instructions for a devices without DSP extensions (check __DSP_PRESENT)"
  79. #define __DSP_USED 0U
  80. #endif
  81. #else
  82. #define __DSP_USED 0U
  83. #endif
  84. #elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
  85. #if defined __ARM_FP
  86. #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)
  87. #define __FPU_USED 1U
  88. #else
  89. #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
  90. #define __FPU_USED 0U
  91. #endif
  92. #else
  93. #define __FPU_USED 0U
  94. #endif
  95. #if defined(__ARM_FEATURE_DSP)
  96. #if defined(__DSP_PRESENT) && (__DSP_PRESENT == 1U)
  97. #define __DSP_USED 1U
  98. #else
  99. #error "Compiler generates DSP (SIMD) instructions for a devices without DSP extensions (check __DSP_PRESENT)"
  100. #define __DSP_USED 0U
  101. #endif
  102. #else
  103. #define __DSP_USED 0U
  104. #endif
  105. #elif defined ( __GNUC__ )
  106. #if defined (__VFP_FP__) && !defined(__SOFTFP__)
  107. #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)
  108. #define __FPU_USED 1U
  109. #else
  110. #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
  111. #define __FPU_USED 0U
  112. #endif
  113. #else
  114. #define __FPU_USED 0U
  115. #endif
  116. #if defined(__ARM_FEATURE_DSP)
  117. #if defined(__DSP_PRESENT) && (__DSP_PRESENT == 1U)
  118. #define __DSP_USED 1U
  119. #else
  120. #error "Compiler generates DSP (SIMD) instructions for a devices without DSP extensions (check __DSP_PRESENT)"
  121. #define __DSP_USED 0U
  122. #endif
  123. #else
  124. #define __DSP_USED 0U
  125. #endif
  126. #elif defined ( __ICCARM__ )
  127. #if defined __ARMVFP__
  128. #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)
  129. #define __FPU_USED 1U
  130. #else
  131. #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
  132. #define __FPU_USED 0U
  133. #endif
  134. #else
  135. #define __FPU_USED 0U
  136. #endif
  137. #if defined(__ARM_FEATURE_DSP)
  138. #if defined(__DSP_PRESENT) && (__DSP_PRESENT == 1U)
  139. #define __DSP_USED 1U
  140. #else
  141. #error "Compiler generates DSP (SIMD) instructions for a devices without DSP extensions (check __DSP_PRESENT)"
  142. #define __DSP_USED 0U
  143. #endif
  144. #else
  145. #define __DSP_USED 0U
  146. #endif
  147. #elif defined ( __TI_ARM__ )
  148. #if defined __TI_VFP_SUPPORT__
  149. #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)
  150. #define __FPU_USED 1U
  151. #else
  152. #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
  153. #define __FPU_USED 0U
  154. #endif
  155. #else
  156. #define __FPU_USED 0U
  157. #endif
  158. #elif defined ( __TASKING__ )
  159. #if defined __FPU_VFP__
  160. #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)
  161. #define __FPU_USED 1U
  162. #else
  163. #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
  164. #define __FPU_USED 0U
  165. #endif
  166. #else
  167. #define __FPU_USED 0U
  168. #endif
  169. #elif defined ( __CSMC__ )
  170. #if ( __CSMC__ & 0x400U)
  171. #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)
  172. #define __FPU_USED 1U
  173. #else
  174. #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
  175. #define __FPU_USED 0U
  176. #endif
  177. #else
  178. #define __FPU_USED 0U
  179. #endif
  180. #endif
  181. #include "cmsis_compiler.h" /* CMSIS compiler specific defines */
  182. #ifdef __cplusplus
  183. }
  184. #endif
  185. #endif /* __CORE_ARMV81MML_H_GENERIC */
  186. #ifndef __CMSIS_GENERIC
  187. #ifndef __CORE_ARMV81MML_H_DEPENDANT
  188. #define __CORE_ARMV81MML_H_DEPENDANT
  189. #ifdef __cplusplus
  190. extern "C" {
  191. #endif
  192. /* check device defines and use defaults */
  193. #if defined __CHECK_DEVICE_DEFINES
  194. #ifndef __ARMv81MML_REV
  195. #define __ARMv81MML_REV 0x0000U
  196. #warning "__ARMv81MML_REV not defined in device header file; using default!"
  197. #endif
  198. #ifndef __FPU_PRESENT
  199. #define __FPU_PRESENT 0U
  200. #warning "__FPU_PRESENT not defined in device header file; using default!"
  201. #endif
  202. #ifndef __MPU_PRESENT
  203. #define __MPU_PRESENT 0U
  204. #warning "__MPU_PRESENT not defined in device header file; using default!"
  205. #endif
  206. #ifndef __SAUREGION_PRESENT
  207. #define __SAUREGION_PRESENT 0U
  208. #warning "__SAUREGION_PRESENT not defined in device header file; using default!"
  209. #endif
  210. #ifndef __DSP_PRESENT
  211. #define __DSP_PRESENT 0U
  212. #warning "__DSP_PRESENT not defined in device header file; using default!"
  213. #endif
  214. #ifndef __NVIC_PRIO_BITS
  215. #define __NVIC_PRIO_BITS 3U
  216. #warning "__NVIC_PRIO_BITS not defined in device header file; using default!"
  217. #endif
  218. #ifndef __Vendor_SysTickConfig
  219. #define __Vendor_SysTickConfig 0U
  220. #warning "__Vendor_SysTickConfig not defined in device header file; using default!"
  221. #endif
  222. #endif
  223. /* IO definitions (access restrictions to peripheral registers) */
  224. /**
  225. \defgroup CMSIS_glob_defs CMSIS Global Defines
  226. <strong>IO Type Qualifiers</strong> are used
  227. \li to specify the access to peripheral variables.
  228. \li for automatic generation of peripheral register debug information.
  229. */
  230. #ifdef __cplusplus
  231. #define __I volatile /*!< Defines 'read only' permissions */
  232. #else
  233. #define __I volatile const /*!< Defines 'read only' permissions */
  234. #endif
  235. #define __O volatile /*!< Defines 'write only' permissions */
  236. #define __IO volatile /*!< Defines 'read / write' permissions */
  237. /* following defines should be used for structure members */
  238. #define __IM volatile const /*! Defines 'read only' structure member permissions */
  239. #define __OM volatile /*! Defines 'write only' structure member permissions */
  240. #define __IOM volatile /*! Defines 'read / write' structure member permissions */
  241. /*@} end of group ARMv81MML */
  242. /*******************************************************************************
  243. * Register Abstraction
  244. Core Register contain:
  245. - Core Register
  246. - Core NVIC Register
  247. - Core SCB Register
  248. - Core SysTick Register
  249. - Core Debug Register
  250. - Core MPU Register
  251. - Core SAU Register
  252. - Core FPU Register
  253. ******************************************************************************/
  254. /**
  255. \defgroup CMSIS_core_register Defines and Type Definitions
  256. \brief Type definitions and defines for Cortex-M processor based devices.
  257. */
  258. /**
  259. \ingroup CMSIS_core_register
  260. \defgroup CMSIS_CORE Status and Control Registers
  261. \brief Core Register type definitions.
  262. @{
  263. */
  264. /**
  265. \brief Union type to access the Application Program Status Register (APSR).
  266. */
  267. typedef union
  268. {
  269. struct
  270. {
  271. uint32_t _reserved0:16; /*!< bit: 0..15 Reserved */
  272. uint32_t GE:4; /*!< bit: 16..19 Greater than or Equal flags */
  273. uint32_t _reserved1:7; /*!< bit: 20..26 Reserved */
  274. uint32_t Q:1; /*!< bit: 27 Saturation condition flag */
  275. uint32_t V:1; /*!< bit: 28 Overflow condition code flag */
  276. uint32_t C:1; /*!< bit: 29 Carry condition code flag */
  277. uint32_t Z:1; /*!< bit: 30 Zero condition code flag */
  278. uint32_t N:1; /*!< bit: 31 Negative condition code flag */
  279. } b; /*!< Structure used for bit access */
  280. uint32_t w; /*!< Type used for word access */
  281. } APSR_Type;
  282. /* APSR Register Definitions */
  283. #define APSR_N_Pos 31U /*!< APSR: N Position */
  284. #define APSR_N_Msk (1UL << APSR_N_Pos) /*!< APSR: N Mask */
  285. #define APSR_Z_Pos 30U /*!< APSR: Z Position */
  286. #define APSR_Z_Msk (1UL << APSR_Z_Pos) /*!< APSR: Z Mask */
  287. #define APSR_C_Pos 29U /*!< APSR: C Position */
  288. #define APSR_C_Msk (1UL << APSR_C_Pos) /*!< APSR: C Mask */
  289. #define APSR_V_Pos 28U /*!< APSR: V Position */
  290. #define APSR_V_Msk (1UL << APSR_V_Pos) /*!< APSR: V Mask */
  291. #define APSR_Q_Pos 27U /*!< APSR: Q Position */
  292. #define APSR_Q_Msk (1UL << APSR_Q_Pos) /*!< APSR: Q Mask */
  293. #define APSR_GE_Pos 16U /*!< APSR: GE Position */
  294. #define APSR_GE_Msk (0xFUL << APSR_GE_Pos) /*!< APSR: GE Mask */
  295. /**
  296. \brief Union type to access the Interrupt Program Status Register (IPSR).
  297. */
  298. typedef union
  299. {
  300. struct
  301. {
  302. uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */
  303. uint32_t _reserved0:23; /*!< bit: 9..31 Reserved */
  304. } b; /*!< Structure used for bit access */
  305. uint32_t w; /*!< Type used for word access */
  306. } IPSR_Type;
  307. /* IPSR Register Definitions */
  308. #define IPSR_ISR_Pos 0U /*!< IPSR: ISR Position */
  309. #define IPSR_ISR_Msk (0x1FFUL /*<< IPSR_ISR_Pos*/) /*!< IPSR: ISR Mask */
  310. /**
  311. \brief Union type to access the Special-Purpose Program Status Registers (xPSR).
  312. */
  313. typedef union
  314. {
  315. struct
  316. {
  317. uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */
  318. uint32_t _reserved0:7; /*!< bit: 9..15 Reserved */
  319. uint32_t GE:4; /*!< bit: 16..19 Greater than or Equal flags */
  320. uint32_t _reserved1:4; /*!< bit: 20..23 Reserved */
  321. uint32_t T:1; /*!< bit: 24 Thumb bit (read 0) */
  322. uint32_t IT:2; /*!< bit: 25..26 saved IT state (read 0) */
  323. uint32_t Q:1; /*!< bit: 27 Saturation condition flag */
  324. uint32_t V:1; /*!< bit: 28 Overflow condition code flag */
  325. uint32_t C:1; /*!< bit: 29 Carry condition code flag */
  326. uint32_t Z:1; /*!< bit: 30 Zero condition code flag */
  327. uint32_t N:1; /*!< bit: 31 Negative condition code flag */
  328. } b; /*!< Structure used for bit access */
  329. uint32_t w; /*!< Type used for word access */
  330. } xPSR_Type;
  331. /* xPSR Register Definitions */
  332. #define xPSR_N_Pos 31U /*!< xPSR: N Position */
  333. #define xPSR_N_Msk (1UL << xPSR_N_Pos) /*!< xPSR: N Mask */
  334. #define xPSR_Z_Pos 30U /*!< xPSR: Z Position */
  335. #define xPSR_Z_Msk (1UL << xPSR_Z_Pos) /*!< xPSR: Z Mask */
  336. #define xPSR_C_Pos 29U /*!< xPSR: C Position */
  337. #define xPSR_C_Msk (1UL << xPSR_C_Pos) /*!< xPSR: C Mask */
  338. #define xPSR_V_Pos 28U /*!< xPSR: V Position */
  339. #define xPSR_V_Msk (1UL << xPSR_V_Pos) /*!< xPSR: V Mask */
  340. #define xPSR_Q_Pos 27U /*!< xPSR: Q Position */
  341. #define xPSR_Q_Msk (1UL << xPSR_Q_Pos) /*!< xPSR: Q Mask */
  342. #define xPSR_IT_Pos 25U /*!< xPSR: IT Position */
  343. #define xPSR_IT_Msk (3UL << xPSR_IT_Pos) /*!< xPSR: IT Mask */
  344. #define xPSR_T_Pos 24U /*!< xPSR: T Position */
  345. #define xPSR_T_Msk (1UL << xPSR_T_Pos) /*!< xPSR: T Mask */
  346. #define xPSR_GE_Pos 16U /*!< xPSR: GE Position */
  347. #define xPSR_GE_Msk (0xFUL << xPSR_GE_Pos) /*!< xPSR: GE Mask */
  348. #define xPSR_ISR_Pos 0U /*!< xPSR: ISR Position */
  349. #define xPSR_ISR_Msk (0x1FFUL /*<< xPSR_ISR_Pos*/) /*!< xPSR: ISR Mask */
  350. /**
  351. \brief Union type to access the Control Registers (CONTROL).
  352. */
  353. typedef union
  354. {
  355. struct
  356. {
  357. uint32_t nPRIV:1; /*!< bit: 0 Execution privilege in Thread mode */
  358. uint32_t SPSEL:1; /*!< bit: 1 Stack-pointer select */
  359. uint32_t FPCA:1; /*!< bit: 2 Floating-point context active */
  360. uint32_t SFPA:1; /*!< bit: 3 Secure floating-point active */
  361. uint32_t _reserved1:28; /*!< bit: 4..31 Reserved */
  362. } b; /*!< Structure used for bit access */
  363. uint32_t w; /*!< Type used for word access */
  364. } CONTROL_Type;
  365. /* CONTROL Register Definitions */
  366. #define CONTROL_SFPA_Pos 3U /*!< CONTROL: SFPA Position */
  367. #define CONTROL_SFPA_Msk (1UL << CONTROL_SFPA_Pos) /*!< CONTROL: SFPA Mask */
  368. #define CONTROL_FPCA_Pos 2U /*!< CONTROL: FPCA Position */
  369. #define CONTROL_FPCA_Msk (1UL << CONTROL_FPCA_Pos) /*!< CONTROL: FPCA Mask */
  370. #define CONTROL_SPSEL_Pos 1U /*!< CONTROL: SPSEL Position */
  371. #define CONTROL_SPSEL_Msk (1UL << CONTROL_SPSEL_Pos) /*!< CONTROL: SPSEL Mask */
  372. #define CONTROL_nPRIV_Pos 0U /*!< CONTROL: nPRIV Position */
  373. #define CONTROL_nPRIV_Msk (1UL /*<< CONTROL_nPRIV_Pos*/) /*!< CONTROL: nPRIV Mask */
  374. /*@} end of group CMSIS_CORE */
  375. /**
  376. \ingroup CMSIS_core_register
  377. \defgroup CMSIS_NVIC Nested Vectored Interrupt Controller (NVIC)
  378. \brief Type definitions for the NVIC Registers
  379. @{
  380. */
  381. /**
  382. \brief Structure type to access the Nested Vectored Interrupt Controller (NVIC).
  383. */
  384. typedef struct
  385. {
  386. __IOM uint32_t ISER[16U]; /*!< Offset: 0x000 (R/W) Interrupt Set Enable Register */
  387. uint32_t RESERVED0[16U];
  388. __IOM uint32_t ICER[16U]; /*!< Offset: 0x080 (R/W) Interrupt Clear Enable Register */
  389. uint32_t RSERVED1[16U];
  390. __IOM uint32_t ISPR[16U]; /*!< Offset: 0x100 (R/W) Interrupt Set Pending Register */
  391. uint32_t RESERVED2[16U];
  392. __IOM uint32_t ICPR[16U]; /*!< Offset: 0x180 (R/W) Interrupt Clear Pending Register */
  393. uint32_t RESERVED3[16U];
  394. __IOM uint32_t IABR[16U]; /*!< Offset: 0x200 (R/W) Interrupt Active bit Register */
  395. uint32_t RESERVED4[16U];
  396. __IOM uint32_t ITNS[16U]; /*!< Offset: 0x280 (R/W) Interrupt Non-Secure State Register */
  397. uint32_t RESERVED5[16U];
  398. __IOM uint8_t IPR[496U]; /*!< Offset: 0x300 (R/W) Interrupt Priority Register (8Bit wide) */
  399. uint32_t RESERVED6[580U];
  400. __OM uint32_t STIR; /*!< Offset: 0xE00 ( /W) Software Trigger Interrupt Register */
  401. } NVIC_Type;
  402. /* Software Triggered Interrupt Register Definitions */
  403. #define NVIC_STIR_INTID_Pos 0U /*!< STIR: INTLINESNUM Position */
  404. #define NVIC_STIR_INTID_Msk (0x1FFUL /*<< NVIC_STIR_INTID_Pos*/) /*!< STIR: INTLINESNUM Mask */
  405. /*@} end of group CMSIS_NVIC */
  406. /**
  407. \ingroup CMSIS_core_register
  408. \defgroup CMSIS_SCB System Control Block (SCB)
  409. \brief Type definitions for the System Control Block Registers
  410. @{
  411. */
  412. /**
  413. \brief Structure type to access the System Control Block (SCB).
  414. */
  415. typedef struct
  416. {
  417. __IM uint32_t CPUID; /*!< Offset: 0x000 (R/ ) CPUID Base Register */
  418. __IOM uint32_t ICSR; /*!< Offset: 0x004 (R/W) Interrupt Control and State Register */
  419. __IOM uint32_t VTOR; /*!< Offset: 0x008 (R/W) Vector Table Offset Register */
  420. __IOM uint32_t AIRCR; /*!< Offset: 0x00C (R/W) Application Interrupt and Reset Control Register */
  421. __IOM uint32_t SCR; /*!< Offset: 0x010 (R/W) System Control Register */
  422. __IOM uint32_t CCR; /*!< Offset: 0x014 (R/W) Configuration Control Register */
  423. __IOM uint8_t SHPR[12U]; /*!< Offset: 0x018 (R/W) System Handlers Priority Registers (4-7, 8-11, 12-15) */
  424. __IOM uint32_t SHCSR; /*!< Offset: 0x024 (R/W) System Handler Control and State Register */
  425. __IOM uint32_t CFSR; /*!< Offset: 0x028 (R/W) Configurable Fault Status Register */
  426. __IOM uint32_t HFSR; /*!< Offset: 0x02C (R/W) HardFault Status Register */
  427. __IOM uint32_t DFSR; /*!< Offset: 0x030 (R/W) Debug Fault Status Register */
  428. __IOM uint32_t MMFAR; /*!< Offset: 0x034 (R/W) MemManage Fault Address Register */
  429. __IOM uint32_t BFAR; /*!< Offset: 0x038 (R/W) BusFault Address Register */
  430. __IOM uint32_t AFSR; /*!< Offset: 0x03C (R/W) Auxiliary Fault Status Register */
  431. __IM uint32_t ID_PFR[2U]; /*!< Offset: 0x040 (R/ ) Processor Feature Register */
  432. __IM uint32_t ID_DFR; /*!< Offset: 0x048 (R/ ) Debug Feature Register */
  433. __IM uint32_t ID_ADR; /*!< Offset: 0x04C (R/ ) Auxiliary Feature Register */
  434. __IM uint32_t ID_MMFR[4U]; /*!< Offset: 0x050 (R/ ) Memory Model Feature Register */
  435. __IM uint32_t ID_ISAR[6U]; /*!< Offset: 0x060 (R/ ) Instruction Set Attributes Register */
  436. __IM uint32_t CLIDR; /*!< Offset: 0x078 (R/ ) Cache Level ID register */
  437. __IM uint32_t CTR; /*!< Offset: 0x07C (R/ ) Cache Type register */
  438. __IM uint32_t CCSIDR; /*!< Offset: 0x080 (R/ ) Cache Size ID Register */
  439. __IOM uint32_t CSSELR; /*!< Offset: 0x084 (R/W) Cache Size Selection Register */
  440. __IOM uint32_t CPACR; /*!< Offset: 0x088 (R/W) Coprocessor Access Control Register */
  441. __IOM uint32_t NSACR; /*!< Offset: 0x08C (R/W) Non-Secure Access Control Register */
  442. uint32_t RESERVED3[92U];
  443. __OM uint32_t STIR; /*!< Offset: 0x200 ( /W) Software Triggered Interrupt Register */
  444. uint32_t RESERVED4[15U];
  445. __IM uint32_t MVFR0; /*!< Offset: 0x240 (R/ ) Media and VFP Feature Register 0 */
  446. __IM uint32_t MVFR1; /*!< Offset: 0x244 (R/ ) Media and VFP Feature Register 1 */
  447. __IM uint32_t MVFR2; /*!< Offset: 0x248 (R/ ) Media and VFP Feature Register 2 */
  448. uint32_t RESERVED5[1U];
  449. __OM uint32_t ICIALLU; /*!< Offset: 0x250 ( /W) I-Cache Invalidate All to PoU */
  450. uint32_t RESERVED6[1U];
  451. __OM uint32_t ICIMVAU; /*!< Offset: 0x258 ( /W) I-Cache Invalidate by MVA to PoU */
  452. __OM uint32_t DCIMVAC; /*!< Offset: 0x25C ( /W) D-Cache Invalidate by MVA to PoC */
  453. __OM uint32_t DCISW; /*!< Offset: 0x260 ( /W) D-Cache Invalidate by Set-way */
  454. __OM uint32_t DCCMVAU; /*!< Offset: 0x264 ( /W) D-Cache Clean by MVA to PoU */
  455. __OM uint32_t DCCMVAC; /*!< Offset: 0x268 ( /W) D-Cache Clean by MVA to PoC */
  456. __OM uint32_t DCCSW; /*!< Offset: 0x26C ( /W) D-Cache Clean by Set-way */
  457. __OM uint32_t DCCIMVAC; /*!< Offset: 0x270 ( /W) D-Cache Clean and Invalidate by MVA to PoC */
  458. __OM uint32_t DCCISW; /*!< Offset: 0x274 ( /W) D-Cache Clean and Invalidate by Set-way */
  459. uint32_t RESERVED7[6U];
  460. __IOM uint32_t ITCMCR; /*!< Offset: 0x290 (R/W) Instruction Tightly-Coupled Memory Control Register */
  461. __IOM uint32_t DTCMCR; /*!< Offset: 0x294 (R/W) Data Tightly-Coupled Memory Control Registers */
  462. __IOM uint32_t AHBPCR; /*!< Offset: 0x298 (R/W) AHBP Control Register */
  463. __IOM uint32_t CACR; /*!< Offset: 0x29C (R/W) L1 Cache Control Register */
  464. __IOM uint32_t AHBSCR; /*!< Offset: 0x2A0 (R/W) AHB Slave Control Register */
  465. uint32_t RESERVED8[1U];
  466. __IOM uint32_t ABFSR; /*!< Offset: 0x2A8 (R/W) Auxiliary Bus Fault Status Register */
  467. } SCB_Type;
  468. /* SCB CPUID Register Definitions */
  469. #define SCB_CPUID_IMPLEMENTER_Pos 24U /*!< SCB CPUID: IMPLEMENTER Position */
  470. #define SCB_CPUID_IMPLEMENTER_Msk (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos) /*!< SCB CPUID: IMPLEMENTER Mask */
  471. #define SCB_CPUID_VARIANT_Pos 20U /*!< SCB CPUID: VARIANT Position */
  472. #define SCB_CPUID_VARIANT_Msk (0xFUL << SCB_CPUID_VARIANT_Pos) /*!< SCB CPUID: VARIANT Mask */
  473. #define SCB_CPUID_ARCHITECTURE_Pos 16U /*!< SCB CPUID: ARCHITECTURE Position */
  474. #define SCB_CPUID_ARCHITECTURE_Msk (0xFUL << SCB_CPUID_ARCHITECTURE_Pos) /*!< SCB CPUID: ARCHITECTURE Mask */
  475. #define SCB_CPUID_PARTNO_Pos 4U /*!< SCB CPUID: PARTNO Position */
  476. #define SCB_CPUID_PARTNO_Msk (0xFFFUL << SCB_CPUID_PARTNO_Pos) /*!< SCB CPUID: PARTNO Mask */
  477. #define SCB_CPUID_REVISION_Pos 0U /*!< SCB CPUID: REVISION Position */
  478. #define SCB_CPUID_REVISION_Msk (0xFUL /*<< SCB_CPUID_REVISION_Pos*/) /*!< SCB CPUID: REVISION Mask */
  479. /* SCB Interrupt Control State Register Definitions */
  480. #define SCB_ICSR_PENDNMISET_Pos 31U /*!< SCB ICSR: PENDNMISET Position */
  481. #define SCB_ICSR_PENDNMISET_Msk (1UL << SCB_ICSR_PENDNMISET_Pos) /*!< SCB ICSR: PENDNMISET Mask */
  482. #define SCB_ICSR_NMIPENDSET_Pos SCB_ICSR_PENDNMISET_Pos /*!< SCB ICSR: NMIPENDSET Position, backward compatibility */
  483. #define SCB_ICSR_NMIPENDSET_Msk SCB_ICSR_PENDNMISET_Msk /*!< SCB ICSR: NMIPENDSET Mask, backward compatibility */
  484. #define SCB_ICSR_PENDNMICLR_Pos 30U /*!< SCB ICSR: PENDNMICLR Position */
  485. #define SCB_ICSR_PENDNMICLR_Msk (1UL << SCB_ICSR_PENDNMICLR_Pos) /*!< SCB ICSR: PENDNMICLR Mask */
  486. #define SCB_ICSR_PENDSVSET_Pos 28U /*!< SCB ICSR: PENDSVSET Position */
  487. #define SCB_ICSR_PENDSVSET_Msk (1UL << SCB_ICSR_PENDSVSET_Pos) /*!< SCB ICSR: PENDSVSET Mask */
  488. #define SCB_ICSR_PENDSVCLR_Pos 27U /*!< SCB ICSR: PENDSVCLR Position */
  489. #define SCB_ICSR_PENDSVCLR_Msk (1UL << SCB_ICSR_PENDSVCLR_Pos) /*!< SCB ICSR: PENDSVCLR Mask */
  490. #define SCB_ICSR_PENDSTSET_Pos 26U /*!< SCB ICSR: PENDSTSET Position */
  491. #define SCB_ICSR_PENDSTSET_Msk (1UL << SCB_ICSR_PENDSTSET_Pos) /*!< SCB ICSR: PENDSTSET Mask */
  492. #define SCB_ICSR_PENDSTCLR_Pos 25U /*!< SCB ICSR: PENDSTCLR Position */
  493. #define SCB_ICSR_PENDSTCLR_Msk (1UL << SCB_ICSR_PENDSTCLR_Pos) /*!< SCB ICSR: PENDSTCLR Mask */
  494. #define SCB_ICSR_STTNS_Pos 24U /*!< SCB ICSR: STTNS Position (Security Extension) */
  495. #define SCB_ICSR_STTNS_Msk (1UL << SCB_ICSR_STTNS_Pos) /*!< SCB ICSR: STTNS Mask (Security Extension) */
  496. #define SCB_ICSR_ISRPREEMPT_Pos 23U /*!< SCB ICSR: ISRPREEMPT Position */
  497. #define SCB_ICSR_ISRPREEMPT_Msk (1UL << SCB_ICSR_ISRPREEMPT_Pos) /*!< SCB ICSR: ISRPREEMPT Mask */
  498. #define SCB_ICSR_ISRPENDING_Pos 22U /*!< SCB ICSR: ISRPENDING Position */
  499. #define SCB_ICSR_ISRPENDING_Msk (1UL << SCB_ICSR_ISRPENDING_Pos) /*!< SCB ICSR: ISRPENDING Mask */
  500. #define SCB_ICSR_VECTPENDING_Pos 12U /*!< SCB ICSR: VECTPENDING Position */
  501. #define SCB_ICSR_VECTPENDING_Msk (0x1FFUL << SCB_ICSR_VECTPENDING_Pos) /*!< SCB ICSR: VECTPENDING Mask */
  502. #define SCB_ICSR_RETTOBASE_Pos 11U /*!< SCB ICSR: RETTOBASE Position */
  503. #define SCB_ICSR_RETTOBASE_Msk (1UL << SCB_ICSR_RETTOBASE_Pos) /*!< SCB ICSR: RETTOBASE Mask */
  504. #define SCB_ICSR_VECTACTIVE_Pos 0U /*!< SCB ICSR: VECTACTIVE Position */
  505. #define SCB_ICSR_VECTACTIVE_Msk (0x1FFUL /*<< SCB_ICSR_VECTACTIVE_Pos*/) /*!< SCB ICSR: VECTACTIVE Mask */
  506. /* SCB Vector Table Offset Register Definitions */
  507. #define SCB_VTOR_TBLOFF_Pos 7U /*!< SCB VTOR: TBLOFF Position */
  508. #define SCB_VTOR_TBLOFF_Msk (0x1FFFFFFUL << SCB_VTOR_TBLOFF_Pos) /*!< SCB VTOR: TBLOFF Mask */
  509. /* SCB Application Interrupt and Reset Control Register Definitions */
  510. #define SCB_AIRCR_VECTKEY_Pos 16U /*!< SCB AIRCR: VECTKEY Position */
  511. #define SCB_AIRCR_VECTKEY_Msk (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos) /*!< SCB AIRCR: VECTKEY Mask */
  512. #define SCB_AIRCR_VECTKEYSTAT_Pos 16U /*!< SCB AIRCR: VECTKEYSTAT Position */
  513. #define SCB_AIRCR_VECTKEYSTAT_Msk (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos) /*!< SCB AIRCR: VECTKEYSTAT Mask */
  514. #define SCB_AIRCR_ENDIANESS_Pos 15U /*!< SCB AIRCR: ENDIANESS Position */
  515. #define SCB_AIRCR_ENDIANESS_Msk (1UL << SCB_AIRCR_ENDIANESS_Pos) /*!< SCB AIRCR: ENDIANESS Mask */
  516. #define SCB_AIRCR_PRIS_Pos 14U /*!< SCB AIRCR: PRIS Position */
  517. #define SCB_AIRCR_PRIS_Msk (1UL << SCB_AIRCR_PRIS_Pos) /*!< SCB AIRCR: PRIS Mask */
  518. #define SCB_AIRCR_BFHFNMINS_Pos 13U /*!< SCB AIRCR: BFHFNMINS Position */
  519. #define SCB_AIRCR_BFHFNMINS_Msk (1UL << SCB_AIRCR_BFHFNMINS_Pos) /*!< SCB AIRCR: BFHFNMINS Mask */
  520. #define SCB_AIRCR_PRIGROUP_Pos 8U /*!< SCB AIRCR: PRIGROUP Position */
  521. #define SCB_AIRCR_PRIGROUP_Msk (7UL << SCB_AIRCR_PRIGROUP_Pos) /*!< SCB AIRCR: PRIGROUP Mask */
  522. #define SCB_AIRCR_SYSRESETREQS_Pos 3U /*!< SCB AIRCR: SYSRESETREQS Position */
  523. #define SCB_AIRCR_SYSRESETREQS_Msk (1UL << SCB_AIRCR_SYSRESETREQS_Pos) /*!< SCB AIRCR: SYSRESETREQS Mask */
  524. #define SCB_AIRCR_SYSRESETREQ_Pos 2U /*!< SCB AIRCR: SYSRESETREQ Position */
  525. #define SCB_AIRCR_SYSRESETREQ_Msk (1UL << SCB_AIRCR_SYSRESETREQ_Pos) /*!< SCB AIRCR: SYSRESETREQ Mask */
  526. #define SCB_AIRCR_VECTCLRACTIVE_Pos 1U /*!< SCB AIRCR: VECTCLRACTIVE Position */
  527. #define SCB_AIRCR_VECTCLRACTIVE_Msk (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos) /*!< SCB AIRCR: VECTCLRACTIVE Mask */
  528. /* SCB System Control Register Definitions */
  529. #define SCB_SCR_SEVONPEND_Pos 4U /*!< SCB SCR: SEVONPEND Position */
  530. #define SCB_SCR_SEVONPEND_Msk (1UL << SCB_SCR_SEVONPEND_Pos) /*!< SCB SCR: SEVONPEND Mask */
  531. #define SCB_SCR_SLEEPDEEPS_Pos 3U /*!< SCB SCR: SLEEPDEEPS Position */
  532. #define SCB_SCR_SLEEPDEEPS_Msk (1UL << SCB_SCR_SLEEPDEEPS_Pos) /*!< SCB SCR: SLEEPDEEPS Mask */
  533. #define SCB_SCR_SLEEPDEEP_Pos 2U /*!< SCB SCR: SLEEPDEEP Position */
  534. #define SCB_SCR_SLEEPDEEP_Msk (1UL << SCB_SCR_SLEEPDEEP_Pos) /*!< SCB SCR: SLEEPDEEP Mask */
  535. #define SCB_SCR_SLEEPONEXIT_Pos 1U /*!< SCB SCR: SLEEPONEXIT Position */
  536. #define SCB_SCR_SLEEPONEXIT_Msk (1UL << SCB_SCR_SLEEPONEXIT_Pos) /*!< SCB SCR: SLEEPONEXIT Mask */
  537. /* SCB Configuration Control Register Definitions */
  538. #define SCB_CCR_BP_Pos 18U /*!< SCB CCR: BP Position */
  539. #define SCB_CCR_BP_Msk (1UL << SCB_CCR_BP_Pos) /*!< SCB CCR: BP Mask */
  540. #define SCB_CCR_IC_Pos 17U /*!< SCB CCR: IC Position */
  541. #define SCB_CCR_IC_Msk (1UL << SCB_CCR_IC_Pos) /*!< SCB CCR: IC Mask */
  542. #define SCB_CCR_DC_Pos 16U /*!< SCB CCR: DC Position */
  543. #define SCB_CCR_DC_Msk (1UL << SCB_CCR_DC_Pos) /*!< SCB CCR: DC Mask */
  544. #define SCB_CCR_STKOFHFNMIGN_Pos 10U /*!< SCB CCR: STKOFHFNMIGN Position */
  545. #define SCB_CCR_STKOFHFNMIGN_Msk (1UL << SCB_CCR_STKOFHFNMIGN_Pos) /*!< SCB CCR: STKOFHFNMIGN Mask */
  546. #define SCB_CCR_BFHFNMIGN_Pos 8U /*!< SCB CCR: BFHFNMIGN Position */
  547. #define SCB_CCR_BFHFNMIGN_Msk (1UL << SCB_CCR_BFHFNMIGN_Pos) /*!< SCB CCR: BFHFNMIGN Mask */
  548. #define SCB_CCR_DIV_0_TRP_Pos 4U /*!< SCB CCR: DIV_0_TRP Position */
  549. #define SCB_CCR_DIV_0_TRP_Msk (1UL << SCB_CCR_DIV_0_TRP_Pos) /*!< SCB CCR: DIV_0_TRP Mask */
  550. #define SCB_CCR_UNALIGN_TRP_Pos 3U /*!< SCB CCR: UNALIGN_TRP Position */
  551. #define SCB_CCR_UNALIGN_TRP_Msk (1UL << SCB_CCR_UNALIGN_TRP_Pos) /*!< SCB CCR: UNALIGN_TRP Mask */
  552. #define SCB_CCR_USERSETMPEND_Pos 1U /*!< SCB CCR: USERSETMPEND Position */
  553. #define SCB_CCR_USERSETMPEND_Msk (1UL << SCB_CCR_USERSETMPEND_Pos) /*!< SCB CCR: USERSETMPEND Mask */
  554. /* SCB System Handler Control and State Register Definitions */
  555. #define SCB_SHCSR_HARDFAULTPENDED_Pos 21U /*!< SCB SHCSR: HARDFAULTPENDED Position */
  556. #define SCB_SHCSR_HARDFAULTPENDED_Msk (1UL << SCB_SHCSR_HARDFAULTPENDED_Pos) /*!< SCB SHCSR: HARDFAULTPENDED Mask */
  557. #define SCB_SHCSR_SECUREFAULTPENDED_Pos 20U /*!< SCB SHCSR: SECUREFAULTPENDED Position */
  558. #define SCB_SHCSR_SECUREFAULTPENDED_Msk (1UL << SCB_SHCSR_SECUREFAULTPENDED_Pos) /*!< SCB SHCSR: SECUREFAULTPENDED Mask */
  559. #define SCB_SHCSR_SECUREFAULTENA_Pos 19U /*!< SCB SHCSR: SECUREFAULTENA Position */
  560. #define SCB_SHCSR_SECUREFAULTENA_Msk (1UL << SCB_SHCSR_SECUREFAULTENA_Pos) /*!< SCB SHCSR: SECUREFAULTENA Mask */
  561. #define SCB_SHCSR_USGFAULTENA_Pos 18U /*!< SCB SHCSR: USGFAULTENA Position */
  562. #define SCB_SHCSR_USGFAULTENA_Msk (1UL << SCB_SHCSR_USGFAULTENA_Pos) /*!< SCB SHCSR: USGFAULTENA Mask */
  563. #define SCB_SHCSR_BUSFAULTENA_Pos 17U /*!< SCB SHCSR: BUSFAULTENA Position */
  564. #define SCB_SHCSR_BUSFAULTENA_Msk (1UL << SCB_SHCSR_BUSFAULTENA_Pos) /*!< SCB SHCSR: BUSFAULTENA Mask */
  565. #define SCB_SHCSR_MEMFAULTENA_Pos 16U /*!< SCB SHCSR: MEMFAULTENA Position */
  566. #define SCB_SHCSR_MEMFAULTENA_Msk (1UL << SCB_SHCSR_MEMFAULTENA_Pos) /*!< SCB SHCSR: MEMFAULTENA Mask */
  567. #define SCB_SHCSR_SVCALLPENDED_Pos 15U /*!< SCB SHCSR: SVCALLPENDED Position */
  568. #define SCB_SHCSR_SVCALLPENDED_Msk (1UL << SCB_SHCSR_SVCALLPENDED_Pos) /*!< SCB SHCSR: SVCALLPENDED Mask */
  569. #define SCB_SHCSR_BUSFAULTPENDED_Pos 14U /*!< SCB SHCSR: BUSFAULTPENDED Position */
  570. #define SCB_SHCSR_BUSFAULTPENDED_Msk (1UL << SCB_SHCSR_BUSFAULTPENDED_Pos) /*!< SCB SHCSR: BUSFAULTPENDED Mask */
  571. #define SCB_SHCSR_MEMFAULTPENDED_Pos 13U /*!< SCB SHCSR: MEMFAULTPENDED Position */
  572. #define SCB_SHCSR_MEMFAULTPENDED_Msk (1UL << SCB_SHCSR_MEMFAULTPENDED_Pos) /*!< SCB SHCSR: MEMFAULTPENDED Mask */
  573. #define SCB_SHCSR_USGFAULTPENDED_Pos 12U /*!< SCB SHCSR: USGFAULTPENDED Position */
  574. #define SCB_SHCSR_USGFAULTPENDED_Msk (1UL << SCB_SHCSR_USGFAULTPENDED_Pos) /*!< SCB SHCSR: USGFAULTPENDED Mask */
  575. #define SCB_SHCSR_SYSTICKACT_Pos 11U /*!< SCB SHCSR: SYSTICKACT Position */
  576. #define SCB_SHCSR_SYSTICKACT_Msk (1UL << SCB_SHCSR_SYSTICKACT_Pos) /*!< SCB SHCSR: SYSTICKACT Mask */
  577. #define SCB_SHCSR_PENDSVACT_Pos 10U /*!< SCB SHCSR: PENDSVACT Position */
  578. #define SCB_SHCSR_PENDSVACT_Msk (1UL << SCB_SHCSR_PENDSVACT_Pos) /*!< SCB SHCSR: PENDSVACT Mask */
  579. #define SCB_SHCSR_MONITORACT_Pos 8U /*!< SCB SHCSR: MONITORACT Position */
  580. #define SCB_SHCSR_MONITORACT_Msk (1UL << SCB_SHCSR_MONITORACT_Pos) /*!< SCB SHCSR: MONITORACT Mask */
  581. #define SCB_SHCSR_SVCALLACT_Pos 7U /*!< SCB SHCSR: SVCALLACT Position */
  582. #define SCB_SHCSR_SVCALLACT_Msk (1UL << SCB_SHCSR_SVCALLACT_Pos) /*!< SCB SHCSR: SVCALLACT Mask */
  583. #define SCB_SHCSR_NMIACT_Pos 5U /*!< SCB SHCSR: NMIACT Position */
  584. #define SCB_SHCSR_NMIACT_Msk (1UL << SCB_SHCSR_NMIACT_Pos) /*!< SCB SHCSR: NMIACT Mask */
  585. #define SCB_SHCSR_SECUREFAULTACT_Pos 4U /*!< SCB SHCSR: SECUREFAULTACT Position */
  586. #define SCB_SHCSR_SECUREFAULTACT_Msk (1UL << SCB_SHCSR_SECUREFAULTACT_Pos) /*!< SCB SHCSR: SECUREFAULTACT Mask */
  587. #define SCB_SHCSR_USGFAULTACT_Pos 3U /*!< SCB SHCSR: USGFAULTACT Position */
  588. #define SCB_SHCSR_USGFAULTACT_Msk (1UL << SCB_SHCSR_USGFAULTACT_Pos) /*!< SCB SHCSR: USGFAULTACT Mask */
  589. #define SCB_SHCSR_HARDFAULTACT_Pos 2U /*!< SCB SHCSR: HARDFAULTACT Position */
  590. #define SCB_SHCSR_HARDFAULTACT_Msk (1UL << SCB_SHCSR_HARDFAULTACT_Pos) /*!< SCB SHCSR: HARDFAULTACT Mask */
  591. #define SCB_SHCSR_BUSFAULTACT_Pos 1U /*!< SCB SHCSR: BUSFAULTACT Position */
  592. #define SCB_SHCSR_BUSFAULTACT_Msk (1UL << SCB_SHCSR_BUSFAULTACT_Pos) /*!< SCB SHCSR: BUSFAULTACT Mask */
  593. #define SCB_SHCSR_MEMFAULTACT_Pos 0U /*!< SCB SHCSR: MEMFAULTACT Position */
  594. #define SCB_SHCSR_MEMFAULTACT_Msk (1UL /*<< SCB_SHCSR_MEMFAULTACT_Pos*/) /*!< SCB SHCSR: MEMFAULTACT Mask */
  595. /* SCB Configurable Fault Status Register Definitions */
  596. #define SCB_CFSR_USGFAULTSR_Pos 16U /*!< SCB CFSR: Usage Fault Status Register Position */
  597. #define SCB_CFSR_USGFAULTSR_Msk (0xFFFFUL << SCB_CFSR_USGFAULTSR_Pos) /*!< SCB CFSR: Usage Fault Status Register Mask */
  598. #define SCB_CFSR_BUSFAULTSR_Pos 8U /*!< SCB CFSR: Bus Fault Status Register Position */
  599. #define SCB_CFSR_BUSFAULTSR_Msk (0xFFUL << SCB_CFSR_BUSFAULTSR_Pos) /*!< SCB CFSR: Bus Fault Status Register Mask */
  600. #define SCB_CFSR_MEMFAULTSR_Pos 0U /*!< SCB CFSR: Memory Manage Fault Status Register Position */
  601. #define SCB_CFSR_MEMFAULTSR_Msk (0xFFUL /*<< SCB_CFSR_MEMFAULTSR_Pos*/) /*!< SCB CFSR: Memory Manage Fault Status Register Mask */
  602. /* MemManage Fault Status Register (part of SCB Configurable Fault Status Register) */
  603. #define SCB_CFSR_MMARVALID_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 7U) /*!< SCB CFSR (MMFSR): MMARVALID Position */
  604. #define SCB_CFSR_MMARVALID_Msk (1UL << SCB_CFSR_MMARVALID_Pos) /*!< SCB CFSR (MMFSR): MMARVALID Mask */
  605. #define SCB_CFSR_MLSPERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 5U) /*!< SCB CFSR (MMFSR): MLSPERR Position */
  606. #define SCB_CFSR_MLSPERR_Msk (1UL << SCB_CFSR_MLSPERR_Pos) /*!< SCB CFSR (MMFSR): MLSPERR Mask */
  607. #define SCB_CFSR_MSTKERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 4U) /*!< SCB CFSR (MMFSR): MSTKERR Position */
  608. #define SCB_CFSR_MSTKERR_Msk (1UL << SCB_CFSR_MSTKERR_Pos) /*!< SCB CFSR (MMFSR): MSTKERR Mask */
  609. #define SCB_CFSR_MUNSTKERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 3U) /*!< SCB CFSR (MMFSR): MUNSTKERR Position */
  610. #define SCB_CFSR_MUNSTKERR_Msk (1UL << SCB_CFSR_MUNSTKERR_Pos) /*!< SCB CFSR (MMFSR): MUNSTKERR Mask */
  611. #define SCB_CFSR_DACCVIOL_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 1U) /*!< SCB CFSR (MMFSR): DACCVIOL Position */
  612. #define SCB_CFSR_DACCVIOL_Msk (1UL << SCB_CFSR_DACCVIOL_Pos) /*!< SCB CFSR (MMFSR): DACCVIOL Mask */
  613. #define SCB_CFSR_IACCVIOL_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 0U) /*!< SCB CFSR (MMFSR): IACCVIOL Position */
  614. #define SCB_CFSR_IACCVIOL_Msk (1UL /*<< SCB_CFSR_IACCVIOL_Pos*/) /*!< SCB CFSR (MMFSR): IACCVIOL Mask */
  615. /* BusFault Status Register (part of SCB Configurable Fault Status Register) */
  616. #define SCB_CFSR_BFARVALID_Pos (SCB_CFSR_BUSFAULTSR_Pos + 7U) /*!< SCB CFSR (BFSR): BFARVALID Position */
  617. #define SCB_CFSR_BFARVALID_Msk (1UL << SCB_CFSR_BFARVALID_Pos) /*!< SCB CFSR (BFSR): BFARVALID Mask */
  618. #define SCB_CFSR_LSPERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 5U) /*!< SCB CFSR (BFSR): LSPERR Position */
  619. #define SCB_CFSR_LSPERR_Msk (1UL << SCB_CFSR_LSPERR_Pos) /*!< SCB CFSR (BFSR): LSPERR Mask */
  620. #define SCB_CFSR_STKERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 4U) /*!< SCB CFSR (BFSR): STKERR Position */
  621. #define SCB_CFSR_STKERR_Msk (1UL << SCB_CFSR_STKERR_Pos) /*!< SCB CFSR (BFSR): STKERR Mask */
  622. #define SCB_CFSR_UNSTKERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 3U) /*!< SCB CFSR (BFSR): UNSTKERR Position */
  623. #define SCB_CFSR_UNSTKERR_Msk (1UL << SCB_CFSR_UNSTKERR_Pos) /*!< SCB CFSR (BFSR): UNSTKERR Mask */
  624. #define SCB_CFSR_IMPRECISERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 2U) /*!< SCB CFSR (BFSR): IMPRECISERR Position */
  625. #define SCB_CFSR_IMPRECISERR_Msk (1UL << SCB_CFSR_IMPRECISERR_Pos) /*!< SCB CFSR (BFSR): IMPRECISERR Mask */
  626. #define SCB_CFSR_PRECISERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 1U) /*!< SCB CFSR (BFSR): PRECISERR Position */
  627. #define SCB_CFSR_PRECISERR_Msk (1UL << SCB_CFSR_PRECISERR_Pos) /*!< SCB CFSR (BFSR): PRECISERR Mask */
  628. #define SCB_CFSR_IBUSERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 0U) /*!< SCB CFSR (BFSR): IBUSERR Position */
  629. #define SCB_CFSR_IBUSERR_Msk (1UL << SCB_CFSR_IBUSERR_Pos) /*!< SCB CFSR (BFSR): IBUSERR Mask */
  630. /* UsageFault Status Register (part of SCB Configurable Fault Status Register) */
  631. #define SCB_CFSR_DIVBYZERO_Pos (SCB_CFSR_USGFAULTSR_Pos + 9U) /*!< SCB CFSR (UFSR): DIVBYZERO Position */
  632. #define SCB_CFSR_DIVBYZERO_Msk (1UL << SCB_CFSR_DIVBYZERO_Pos) /*!< SCB CFSR (UFSR): DIVBYZERO Mask */
  633. #define SCB_CFSR_UNALIGNED_Pos (SCB_CFSR_USGFAULTSR_Pos + 8U) /*!< SCB CFSR (UFSR): UNALIGNED Position */
  634. #define SCB_CFSR_UNALIGNED_Msk (1UL << SCB_CFSR_UNALIGNED_Pos) /*!< SCB CFSR (UFSR): UNALIGNED Mask */
  635. #define SCB_CFSR_STKOF_Pos (SCB_CFSR_USGFAULTSR_Pos + 4U) /*!< SCB CFSR (UFSR): STKOF Position */
  636. #define SCB_CFSR_STKOF_Msk (1UL << SCB_CFSR_STKOF_Pos) /*!< SCB CFSR (UFSR): STKOF Mask */
  637. #define SCB_CFSR_NOCP_Pos (SCB_CFSR_USGFAULTSR_Pos + 3U) /*!< SCB CFSR (UFSR): NOCP Position */
  638. #define SCB_CFSR_NOCP_Msk (1UL << SCB_CFSR_NOCP_Pos) /*!< SCB CFSR (UFSR): NOCP Mask */
  639. #define SCB_CFSR_INVPC_Pos (SCB_CFSR_USGFAULTSR_Pos + 2U) /*!< SCB CFSR (UFSR): INVPC Position */
  640. #define SCB_CFSR_INVPC_Msk (1UL << SCB_CFSR_INVPC_Pos) /*!< SCB CFSR (UFSR): INVPC Mask */
  641. #define SCB_CFSR_INVSTATE_Pos (SCB_CFSR_USGFAULTSR_Pos + 1U) /*!< SCB CFSR (UFSR): INVSTATE Position */
  642. #define SCB_CFSR_INVSTATE_Msk (1UL << SCB_CFSR_INVSTATE_Pos) /*!< SCB CFSR (UFSR): INVSTATE Mask */
  643. #define SCB_CFSR_UNDEFINSTR_Pos (SCB_CFSR_USGFAULTSR_Pos + 0U) /*!< SCB CFSR (UFSR): UNDEFINSTR Position */
  644. #define SCB_CFSR_UNDEFINSTR_Msk (1UL << SCB_CFSR_UNDEFINSTR_Pos) /*!< SCB CFSR (UFSR): UNDEFINSTR Mask */
  645. /* SCB Hard Fault Status Register Definitions */
  646. #define SCB_HFSR_DEBUGEVT_Pos 31U /*!< SCB HFSR: DEBUGEVT Position */
  647. #define SCB_HFSR_DEBUGEVT_Msk (1UL << SCB_HFSR_DEBUGEVT_Pos) /*!< SCB HFSR: DEBUGEVT Mask */
  648. #define SCB_HFSR_FORCED_Pos 30U /*!< SCB HFSR: FORCED Position */
  649. #define SCB_HFSR_FORCED_Msk (1UL << SCB_HFSR_FORCED_Pos) /*!< SCB HFSR: FORCED Mask */
  650. #define SCB_HFSR_VECTTBL_Pos 1U /*!< SCB HFSR: VECTTBL Position */
  651. #define SCB_HFSR_VECTTBL_Msk (1UL << SCB_HFSR_VECTTBL_Pos) /*!< SCB HFSR: VECTTBL Mask */
  652. /* SCB Debug Fault Status Register Definitions */
  653. #define SCB_DFSR_EXTERNAL_Pos 4U /*!< SCB DFSR: EXTERNAL Position */
  654. #define SCB_DFSR_EXTERNAL_Msk (1UL << SCB_DFSR_EXTERNAL_Pos) /*!< SCB DFSR: EXTERNAL Mask */
  655. #define SCB_DFSR_VCATCH_Pos 3U /*!< SCB DFSR: VCATCH Position */
  656. #define SCB_DFSR_VCATCH_Msk (1UL << SCB_DFSR_VCATCH_Pos) /*!< SCB DFSR: VCATCH Mask */
  657. #define SCB_DFSR_DWTTRAP_Pos 2U /*!< SCB DFSR: DWTTRAP Position */
  658. #define SCB_DFSR_DWTTRAP_Msk (1UL << SCB_DFSR_DWTTRAP_Pos) /*!< SCB DFSR: DWTTRAP Mask */
  659. #define SCB_DFSR_BKPT_Pos 1U /*!< SCB DFSR: BKPT Position */
  660. #define SCB_DFSR_BKPT_Msk (1UL << SCB_DFSR_BKPT_Pos) /*!< SCB DFSR: BKPT Mask */
  661. #define SCB_DFSR_HALTED_Pos 0U /*!< SCB DFSR: HALTED Position */
  662. #define SCB_DFSR_HALTED_Msk (1UL /*<< SCB_DFSR_HALTED_Pos*/) /*!< SCB DFSR: HALTED Mask */
  663. /* SCB Non-Secure Access Control Register Definitions */
  664. #define SCB_NSACR_CP11_Pos 11U /*!< SCB NSACR: CP11 Position */
  665. #define SCB_NSACR_CP11_Msk (1UL << SCB_NSACR_CP11_Pos) /*!< SCB NSACR: CP11 Mask */
  666. #define SCB_NSACR_CP10_Pos 10U /*!< SCB NSACR: CP10 Position */
  667. #define SCB_NSACR_CP10_Msk (1UL << SCB_NSACR_CP10_Pos) /*!< SCB NSACR: CP10 Mask */
  668. #define SCB_NSACR_CPn_Pos 0U /*!< SCB NSACR: CPn Position */
  669. #define SCB_NSACR_CPn_Msk (1UL /*<< SCB_NSACR_CPn_Pos*/) /*!< SCB NSACR: CPn Mask */
  670. /* SCB Cache Level ID Register Definitions */
  671. #define SCB_CLIDR_LOUU_Pos 27U /*!< SCB CLIDR: LoUU Position */
  672. #define SCB_CLIDR_LOUU_Msk (7UL << SCB_CLIDR_LOUU_Pos) /*!< SCB CLIDR: LoUU Mask */
  673. #define SCB_CLIDR_LOC_Pos 24U /*!< SCB CLIDR: LoC Position */
  674. #define SCB_CLIDR_LOC_Msk (7UL << SCB_CLIDR_LOC_Pos) /*!< SCB CLIDR: LoC Mask */
  675. /* SCB Cache Type Register Definitions */
  676. #define SCB_CTR_FORMAT_Pos 29U /*!< SCB CTR: Format Position */
  677. #define SCB_CTR_FORMAT_Msk (7UL << SCB_CTR_FORMAT_Pos) /*!< SCB CTR: Format Mask */
  678. #define SCB_CTR_CWG_Pos 24U /*!< SCB CTR: CWG Position */
  679. #define SCB_CTR_CWG_Msk (0xFUL << SCB_CTR_CWG_Pos) /*!< SCB CTR: CWG Mask */
  680. #define SCB_CTR_ERG_Pos 20U /*!< SCB CTR: ERG Position */
  681. #define SCB_CTR_ERG_Msk (0xFUL << SCB_CTR_ERG_Pos) /*!< SCB CTR: ERG Mask */
  682. #define SCB_CTR_DMINLINE_Pos 16U /*!< SCB CTR: DminLine Position */
  683. #define SCB_CTR_DMINLINE_Msk (0xFUL << SCB_CTR_DMINLINE_Pos) /*!< SCB CTR: DminLine Mask */
  684. #define SCB_CTR_IMINLINE_Pos 0U /*!< SCB CTR: ImInLine Position */
  685. #define SCB_CTR_IMINLINE_Msk (0xFUL /*<< SCB_CTR_IMINLINE_Pos*/) /*!< SCB CTR: ImInLine Mask */
  686. /* SCB Cache Size ID Register Definitions */
  687. #define SCB_CCSIDR_WT_Pos 31U /*!< SCB CCSIDR: WT Position */
  688. #define SCB_CCSIDR_WT_Msk (1UL << SCB_CCSIDR_WT_Pos) /*!< SCB CCSIDR: WT Mask */
  689. #define SCB_CCSIDR_WB_Pos 30U /*!< SCB CCSIDR: WB Position */
  690. #define SCB_CCSIDR_WB_Msk (1UL << SCB_CCSIDR_WB_Pos) /*!< SCB CCSIDR: WB Mask */
  691. #define SCB_CCSIDR_RA_Pos 29U /*!< SCB CCSIDR: RA Position */
  692. #define SCB_CCSIDR_RA_Msk (1UL << SCB_CCSIDR_RA_Pos) /*!< SCB CCSIDR: RA Mask */
  693. #define SCB_CCSIDR_WA_Pos 28U /*!< SCB CCSIDR: WA Position */
  694. #define SCB_CCSIDR_WA_Msk (1UL << SCB_CCSIDR_WA_Pos) /*!< SCB CCSIDR: WA Mask */
  695. #define SCB_CCSIDR_NUMSETS_Pos 13U /*!< SCB CCSIDR: NumSets Position */
  696. #define SCB_CCSIDR_NUMSETS_Msk (0x7FFFUL << SCB_CCSIDR_NUMSETS_Pos) /*!< SCB CCSIDR: NumSets Mask */
  697. #define SCB_CCSIDR_ASSOCIATIVITY_Pos 3U /*!< SCB CCSIDR: Associativity Position */
  698. #define SCB_CCSIDR_ASSOCIATIVITY_Msk (0x3FFUL << SCB_CCSIDR_ASSOCIATIVITY_Pos) /*!< SCB CCSIDR: Associativity Mask */
  699. #define SCB_CCSIDR_LINESIZE_Pos 0U /*!< SCB CCSIDR: LineSize Position */
  700. #define SCB_CCSIDR_LINESIZE_Msk (7UL /*<< SCB_CCSIDR_LINESIZE_Pos*/) /*!< SCB CCSIDR: LineSize Mask */
  701. /* SCB Cache Size Selection Register Definitions */
  702. #define SCB_CSSELR_LEVEL_Pos 1U /*!< SCB CSSELR: Level Position */
  703. #define SCB_CSSELR_LEVEL_Msk (7UL << SCB_CSSELR_LEVEL_Pos) /*!< SCB CSSELR: Level Mask */
  704. #define SCB_CSSELR_IND_Pos 0U /*!< SCB CSSELR: InD Position */
  705. #define SCB_CSSELR_IND_Msk (1UL /*<< SCB_CSSELR_IND_Pos*/) /*!< SCB CSSELR: InD Mask */
  706. /* SCB Software Triggered Interrupt Register Definitions */
  707. #define SCB_STIR_INTID_Pos 0U /*!< SCB STIR: INTID Position */
  708. #define SCB_STIR_INTID_Msk (0x1FFUL /*<< SCB_STIR_INTID_Pos*/) /*!< SCB STIR: INTID Mask */
  709. /* SCB D-Cache Invalidate by Set-way Register Definitions */
  710. #define SCB_DCISW_WAY_Pos 30U /*!< SCB DCISW: Way Position */
  711. #define SCB_DCISW_WAY_Msk (3UL << SCB_DCISW_WAY_Pos) /*!< SCB DCISW: Way Mask */
  712. #define SCB_DCISW_SET_Pos 5U /*!< SCB DCISW: Set Position */
  713. #define SCB_DCISW_SET_Msk (0x1FFUL << SCB_DCISW_SET_Pos) /*!< SCB DCISW: Set Mask */
  714. /* SCB D-Cache Clean by Set-way Register Definitions */
  715. #define SCB_DCCSW_WAY_Pos 30U /*!< SCB DCCSW: Way Position */
  716. #define SCB_DCCSW_WAY_Msk (3UL << SCB_DCCSW_WAY_Pos) /*!< SCB DCCSW: Way Mask */
  717. #define SCB_DCCSW_SET_Pos 5U /*!< SCB DCCSW: Set Position */
  718. #define SCB_DCCSW_SET_Msk (0x1FFUL << SCB_DCCSW_SET_Pos) /*!< SCB DCCSW: Set Mask */
  719. /* SCB D-Cache Clean and Invalidate by Set-way Register Definitions */
  720. #define SCB_DCCISW_WAY_Pos 30U /*!< SCB DCCISW: Way Position */
  721. #define SCB_DCCISW_WAY_Msk (3UL << SCB_DCCISW_WAY_Pos) /*!< SCB DCCISW: Way Mask */
  722. #define SCB_DCCISW_SET_Pos 5U /*!< SCB DCCISW: Set Position */
  723. #define SCB_DCCISW_SET_Msk (0x1FFUL << SCB_DCCISW_SET_Pos) /*!< SCB DCCISW: Set Mask */
  724. /* Instruction Tightly-Coupled Memory Control Register Definitions */
  725. #define SCB_ITCMCR_SZ_Pos 3U /*!< SCB ITCMCR: SZ Position */
  726. #define SCB_ITCMCR_SZ_Msk (0xFUL << SCB_ITCMCR_SZ_Pos) /*!< SCB ITCMCR: SZ Mask */
  727. #define SCB_ITCMCR_RETEN_Pos 2U /*!< SCB ITCMCR: RETEN Position */
  728. #define SCB_ITCMCR_RETEN_Msk (1UL << SCB_ITCMCR_RETEN_Pos) /*!< SCB ITCMCR: RETEN Mask */
  729. #define SCB_ITCMCR_RMW_Pos 1U /*!< SCB ITCMCR: RMW Position */
  730. #define SCB_ITCMCR_RMW_Msk (1UL << SCB_ITCMCR_RMW_Pos) /*!< SCB ITCMCR: RMW Mask */
  731. #define SCB_ITCMCR_EN_Pos 0U /*!< SCB ITCMCR: EN Position */
  732. #define SCB_ITCMCR_EN_Msk (1UL /*<< SCB_ITCMCR_EN_Pos*/) /*!< SCB ITCMCR: EN Mask */
  733. /* Data Tightly-Coupled Memory Control Register Definitions */
  734. #define SCB_DTCMCR_SZ_Pos 3U /*!< SCB DTCMCR: SZ Position */
  735. #define SCB_DTCMCR_SZ_Msk (0xFUL << SCB_DTCMCR_SZ_Pos) /*!< SCB DTCMCR: SZ Mask */
  736. #define SCB_DTCMCR_RETEN_Pos 2U /*!< SCB DTCMCR: RETEN Position */
  737. #define SCB_DTCMCR_RETEN_Msk (1UL << SCB_DTCMCR_RETEN_Pos) /*!< SCB DTCMCR: RETEN Mask */
  738. #define SCB_DTCMCR_RMW_Pos 1U /*!< SCB DTCMCR: RMW Position */
  739. #define SCB_DTCMCR_RMW_Msk (1UL << SCB_DTCMCR_RMW_Pos) /*!< SCB DTCMCR: RMW Mask */
  740. #define SCB_DTCMCR_EN_Pos 0U /*!< SCB DTCMCR: EN Position */
  741. #define SCB_DTCMCR_EN_Msk (1UL /*<< SCB_DTCMCR_EN_Pos*/) /*!< SCB DTCMCR: EN Mask */
  742. /* AHBP Control Register Definitions */
  743. #define SCB_AHBPCR_SZ_Pos 1U /*!< SCB AHBPCR: SZ Position */
  744. #define SCB_AHBPCR_SZ_Msk (7UL << SCB_AHBPCR_SZ_Pos) /*!< SCB AHBPCR: SZ Mask */
  745. #define SCB_AHBPCR_EN_Pos 0U /*!< SCB AHBPCR: EN Position */
  746. #define SCB_AHBPCR_EN_Msk (1UL /*<< SCB_AHBPCR_EN_Pos*/) /*!< SCB AHBPCR: EN Mask */
  747. /* L1 Cache Control Register Definitions */
  748. #define SCB_CACR_FORCEWT_Pos 2U /*!< SCB CACR: FORCEWT Position */
  749. #define SCB_CACR_FORCEWT_Msk (1UL << SCB_CACR_FORCEWT_Pos) /*!< SCB CACR: FORCEWT Mask */
  750. #define SCB_CACR_ECCEN_Pos 1U /*!< SCB CACR: ECCEN Position */
  751. #define SCB_CACR_ECCEN_Msk (1UL << SCB_CACR_ECCEN_Pos) /*!< SCB CACR: ECCEN Mask */
  752. #define SCB_CACR_SIWT_Pos 0U /*!< SCB CACR: SIWT Position */
  753. #define SCB_CACR_SIWT_Msk (1UL /*<< SCB_CACR_SIWT_Pos*/) /*!< SCB CACR: SIWT Mask */
  754. /* AHBS Control Register Definitions */
  755. #define SCB_AHBSCR_INITCOUNT_Pos 11U /*!< SCB AHBSCR: INITCOUNT Position */
  756. #define SCB_AHBSCR_INITCOUNT_Msk (0x1FUL << SCB_AHBPCR_INITCOUNT_Pos) /*!< SCB AHBSCR: INITCOUNT Mask */
  757. #define SCB_AHBSCR_TPRI_Pos 2U /*!< SCB AHBSCR: TPRI Position */
  758. #define SCB_AHBSCR_TPRI_Msk (0x1FFUL << SCB_AHBPCR_TPRI_Pos) /*!< SCB AHBSCR: TPRI Mask */
  759. #define SCB_AHBSCR_CTL_Pos 0U /*!< SCB AHBSCR: CTL Position*/
  760. #define SCB_AHBSCR_CTL_Msk (3UL /*<< SCB_AHBPCR_CTL_Pos*/) /*!< SCB AHBSCR: CTL Mask */
  761. /* Auxiliary Bus Fault Status Register Definitions */
  762. #define SCB_ABFSR_AXIMTYPE_Pos 8U /*!< SCB ABFSR: AXIMTYPE Position*/
  763. #define SCB_ABFSR_AXIMTYPE_Msk (3UL << SCB_ABFSR_AXIMTYPE_Pos) /*!< SCB ABFSR: AXIMTYPE Mask */
  764. #define SCB_ABFSR_EPPB_Pos 4U /*!< SCB ABFSR: EPPB Position*/
  765. #define SCB_ABFSR_EPPB_Msk (1UL << SCB_ABFSR_EPPB_Pos) /*!< SCB ABFSR: EPPB Mask */
  766. #define SCB_ABFSR_AXIM_Pos 3U /*!< SCB ABFSR: AXIM Position*/
  767. #define SCB_ABFSR_AXIM_Msk (1UL << SCB_ABFSR_AXIM_Pos) /*!< SCB ABFSR: AXIM Mask */
  768. #define SCB_ABFSR_AHBP_Pos 2U /*!< SCB ABFSR: AHBP Position*/
  769. #define SCB_ABFSR_AHBP_Msk (1UL << SCB_ABFSR_AHBP_Pos) /*!< SCB ABFSR: AHBP Mask */
  770. #define SCB_ABFSR_DTCM_Pos 1U /*!< SCB ABFSR: DTCM Position*/
  771. #define SCB_ABFSR_DTCM_Msk (1UL << SCB_ABFSR_DTCM_Pos) /*!< SCB ABFSR: DTCM Mask */
  772. #define SCB_ABFSR_ITCM_Pos 0U /*!< SCB ABFSR: ITCM Position*/
  773. #define SCB_ABFSR_ITCM_Msk (1UL /*<< SCB_ABFSR_ITCM_Pos*/) /*!< SCB ABFSR: ITCM Mask */
  774. /*@} end of group CMSIS_SCB */
  775. /**
  776. \ingroup CMSIS_core_register
  777. \defgroup CMSIS_SCnSCB System Controls not in SCB (SCnSCB)
  778. \brief Type definitions for the System Control and ID Register not in the SCB
  779. @{
  780. */
  781. /**
  782. \brief Structure type to access the System Control and ID Register not in the SCB.
  783. */
  784. typedef struct
  785. {
  786. uint32_t RESERVED0[1U];
  787. __IM uint32_t ICTR; /*!< Offset: 0x004 (R/ ) Interrupt Controller Type Register */
  788. __IOM uint32_t ACTLR; /*!< Offset: 0x008 (R/W) Auxiliary Control Register */
  789. __IOM uint32_t CPPWR; /*!< Offset: 0x00C (R/W) Coprocessor Power Control Register */
  790. } SCnSCB_Type;
  791. /* Interrupt Controller Type Register Definitions */
  792. #define SCnSCB_ICTR_INTLINESNUM_Pos 0U /*!< ICTR: INTLINESNUM Position */
  793. #define SCnSCB_ICTR_INTLINESNUM_Msk (0xFUL /*<< SCnSCB_ICTR_INTLINESNUM_Pos*/) /*!< ICTR: INTLINESNUM Mask */
  794. /*@} end of group CMSIS_SCnotSCB */
  795. /**
  796. \ingroup CMSIS_core_register
  797. \defgroup CMSIS_SysTick System Tick Timer (SysTick)
  798. \brief Type definitions for the System Timer Registers.
  799. @{
  800. */
  801. /**
  802. \brief Structure type to access the System Timer (SysTick).
  803. */
  804. typedef struct
  805. {
  806. __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) SysTick Control and Status Register */
  807. __IOM uint32_t LOAD; /*!< Offset: 0x004 (R/W) SysTick Reload Value Register */
  808. __IOM uint32_t VAL; /*!< Offset: 0x008 (R/W) SysTick Current Value Register */
  809. __IM uint32_t CALIB; /*!< Offset: 0x00C (R/ ) SysTick Calibration Register */
  810. } SysTick_Type;
  811. /* SysTick Control / Status Register Definitions */
  812. #define SysTick_CTRL_COUNTFLAG_Pos 16U /*!< SysTick CTRL: COUNTFLAG Position */
  813. #define SysTick_CTRL_COUNTFLAG_Msk (1UL << SysTick_CTRL_COUNTFLAG_Pos) /*!< SysTick CTRL: COUNTFLAG Mask */
  814. #define SysTick_CTRL_CLKSOURCE_Pos 2U /*!< SysTick CTRL: CLKSOURCE Position */
  815. #define SysTick_CTRL_CLKSOURCE_Msk (1UL << SysTick_CTRL_CLKSOURCE_Pos) /*!< SysTick CTRL: CLKSOURCE Mask */
  816. #define SysTick_CTRL_TICKINT_Pos 1U /*!< SysTick CTRL: TICKINT Position */
  817. #define SysTick_CTRL_TICKINT_Msk (1UL << SysTick_CTRL_TICKINT_Pos) /*!< SysTick CTRL: TICKINT Mask */
  818. #define SysTick_CTRL_ENABLE_Pos 0U /*!< SysTick CTRL: ENABLE Position */
  819. #define SysTick_CTRL_ENABLE_Msk (1UL /*<< SysTick_CTRL_ENABLE_Pos*/) /*!< SysTick CTRL: ENABLE Mask */
  820. /* SysTick Reload Register Definitions */
  821. #define SysTick_LOAD_RELOAD_Pos 0U /*!< SysTick LOAD: RELOAD Position */
  822. #define SysTick_LOAD_RELOAD_Msk (0xFFFFFFUL /*<< SysTick_LOAD_RELOAD_Pos*/) /*!< SysTick LOAD: RELOAD Mask */
  823. /* SysTick Current Register Definitions */
  824. #define SysTick_VAL_CURRENT_Pos 0U /*!< SysTick VAL: CURRENT Position */
  825. #define SysTick_VAL_CURRENT_Msk (0xFFFFFFUL /*<< SysTick_VAL_CURRENT_Pos*/) /*!< SysTick VAL: CURRENT Mask */
  826. /* SysTick Calibration Register Definitions */
  827. #define SysTick_CALIB_NOREF_Pos 31U /*!< SysTick CALIB: NOREF Position */
  828. #define SysTick_CALIB_NOREF_Msk (1UL << SysTick_CALIB_NOREF_Pos) /*!< SysTick CALIB: NOREF Mask */
  829. #define SysTick_CALIB_SKEW_Pos 30U /*!< SysTick CALIB: SKEW Position */
  830. #define SysTick_CALIB_SKEW_Msk (1UL << SysTick_CALIB_SKEW_Pos) /*!< SysTick CALIB: SKEW Mask */
  831. #define SysTick_CALIB_TENMS_Pos 0U /*!< SysTick CALIB: TENMS Position */
  832. #define SysTick_CALIB_TENMS_Msk (0xFFFFFFUL /*<< SysTick_CALIB_TENMS_Pos*/) /*!< SysTick CALIB: TENMS Mask */
  833. /*@} end of group CMSIS_SysTick */
  834. /**
  835. \ingroup CMSIS_core_register
  836. \defgroup CMSIS_ITM Instrumentation Trace Macrocell (ITM)
  837. \brief Type definitions for the Instrumentation Trace Macrocell (ITM)
  838. @{
  839. */
  840. /**
  841. \brief Structure type to access the Instrumentation Trace Macrocell Register (ITM).
  842. */
  843. typedef struct
  844. {
  845. __OM union
  846. {
  847. __OM uint8_t u8; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 8-bit */
  848. __OM uint16_t u16; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 16-bit */
  849. __OM uint32_t u32; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 32-bit */
  850. } PORT [32U]; /*!< Offset: 0x000 ( /W) ITM Stimulus Port Registers */
  851. uint32_t RESERVED0[864U];
  852. __IOM uint32_t TER; /*!< Offset: 0xE00 (R/W) ITM Trace Enable Register */
  853. uint32_t RESERVED1[15U];
  854. __IOM uint32_t TPR; /*!< Offset: 0xE40 (R/W) ITM Trace Privilege Register */
  855. uint32_t RESERVED2[15U];
  856. __IOM uint32_t TCR; /*!< Offset: 0xE80 (R/W) ITM Trace Control Register */
  857. uint32_t RESERVED3[29U];
  858. __OM uint32_t IWR; /*!< Offset: 0xEF8 ( /W) ITM Integration Write Register */
  859. __IM uint32_t IRR; /*!< Offset: 0xEFC (R/ ) ITM Integration Read Register */
  860. __IOM uint32_t IMCR; /*!< Offset: 0xF00 (R/W) ITM Integration Mode Control Register */
  861. uint32_t RESERVED4[43U];
  862. __OM uint32_t LAR; /*!< Offset: 0xFB0 ( /W) ITM Lock Access Register */
  863. __IM uint32_t LSR; /*!< Offset: 0xFB4 (R/ ) ITM Lock Status Register */
  864. uint32_t RESERVED5[1U];
  865. __IM uint32_t DEVARCH; /*!< Offset: 0xFBC (R/ ) ITM Device Architecture Register */
  866. uint32_t RESERVED6[4U];
  867. __IM uint32_t PID4; /*!< Offset: 0xFD0 (R/ ) ITM Peripheral Identification Register #4 */
  868. __IM uint32_t PID5; /*!< Offset: 0xFD4 (R/ ) ITM Peripheral Identification Register #5 */
  869. __IM uint32_t PID6; /*!< Offset: 0xFD8 (R/ ) ITM Peripheral Identification Register #6 */
  870. __IM uint32_t PID7; /*!< Offset: 0xFDC (R/ ) ITM Peripheral Identification Register #7 */
  871. __IM uint32_t PID0; /*!< Offset: 0xFE0 (R/ ) ITM Peripheral Identification Register #0 */
  872. __IM uint32_t PID1; /*!< Offset: 0xFE4 (R/ ) ITM Peripheral Identification Register #1 */
  873. __IM uint32_t PID2; /*!< Offset: 0xFE8 (R/ ) ITM Peripheral Identification Register #2 */
  874. __IM uint32_t PID3; /*!< Offset: 0xFEC (R/ ) ITM Peripheral Identification Register #3 */
  875. __IM uint32_t CID0; /*!< Offset: 0xFF0 (R/ ) ITM Component Identification Register #0 */
  876. __IM uint32_t CID1; /*!< Offset: 0xFF4 (R/ ) ITM Component Identification Register #1 */
  877. __IM uint32_t CID2; /*!< Offset: 0xFF8 (R/ ) ITM Component Identification Register #2 */
  878. __IM uint32_t CID3; /*!< Offset: 0xFFC (R/ ) ITM Component Identification Register #3 */
  879. } ITM_Type;
  880. /* ITM Stimulus Port Register Definitions */
  881. #define ITM_STIM_DISABLED_Pos 1U /*!< ITM STIM: DISABLED Position */
  882. #define ITM_STIM_DISABLED_Msk (0x1UL << ITM_STIM_DISABLED_Pos) /*!< ITM STIM: DISABLED Mask */
  883. #define ITM_STIM_FIFOREADY_Pos 0U /*!< ITM STIM: FIFOREADY Position */
  884. #define ITM_STIM_FIFOREADY_Msk (0x1UL /*<< ITM_STIM_FIFOREADY_Pos*/) /*!< ITM STIM: FIFOREADY Mask */
  885. /* ITM Trace Privilege Register Definitions */
  886. #define ITM_TPR_PRIVMASK_Pos 0U /*!< ITM TPR: PRIVMASK Position */
  887. #define ITM_TPR_PRIVMASK_Msk (0xFUL /*<< ITM_TPR_PRIVMASK_Pos*/) /*!< ITM TPR: PRIVMASK Mask */
  888. /* ITM Trace Control Register Definitions */
  889. #define ITM_TCR_BUSY_Pos 23U /*!< ITM TCR: BUSY Position */
  890. #define ITM_TCR_BUSY_Msk (1UL << ITM_TCR_BUSY_Pos) /*!< ITM TCR: BUSY Mask */
  891. #define ITM_TCR_TRACEBUSID_Pos 16U /*!< ITM TCR: ATBID Position */
  892. #define ITM_TCR_TRACEBUSID_Msk (0x7FUL << ITM_TCR_TRACEBUSID_Pos) /*!< ITM TCR: ATBID Mask */
  893. #define ITM_TCR_GTSFREQ_Pos 10U /*!< ITM TCR: Global timestamp frequency Position */
  894. #define ITM_TCR_GTSFREQ_Msk (3UL << ITM_TCR_GTSFREQ_Pos) /*!< ITM TCR: Global timestamp frequency Mask */
  895. #define ITM_TCR_TSPRESCALE_Pos 8U /*!< ITM TCR: TSPRESCALE Position */
  896. #define ITM_TCR_TSPRESCALE_Msk (3UL << ITM_TCR_TSPRESCALE_Pos) /*!< ITM TCR: TSPRESCALE Mask */
  897. #define ITM_TCR_STALLENA_Pos 5U /*!< ITM TCR: STALLENA Position */
  898. #define ITM_TCR_STALLENA_Msk (1UL << ITM_TCR_STALLENA_Pos) /*!< ITM TCR: STALLENA Mask */
  899. #define ITM_TCR_SWOENA_Pos 4U /*!< ITM TCR: SWOENA Position */
  900. #define ITM_TCR_SWOENA_Msk (1UL << ITM_TCR_SWOENA_Pos) /*!< ITM TCR: SWOENA Mask */
  901. #define ITM_TCR_DWTENA_Pos 3U /*!< ITM TCR: DWTENA Position */
  902. #define ITM_TCR_DWTENA_Msk (1UL << ITM_TCR_DWTENA_Pos) /*!< ITM TCR: DWTENA Mask */
  903. #define ITM_TCR_SYNCENA_Pos 2U /*!< ITM TCR: SYNCENA Position */
  904. #define ITM_TCR_SYNCENA_Msk (1UL << ITM_TCR_SYNCENA_Pos) /*!< ITM TCR: SYNCENA Mask */
  905. #define ITM_TCR_TSENA_Pos 1U /*!< ITM TCR: TSENA Position */
  906. #define ITM_TCR_TSENA_Msk (1UL << ITM_TCR_TSENA_Pos) /*!< ITM TCR: TSENA Mask */
  907. #define ITM_TCR_ITMENA_Pos 0U /*!< ITM TCR: ITM Enable bit Position */
  908. #define ITM_TCR_ITMENA_Msk (1UL /*<< ITM_TCR_ITMENA_Pos*/) /*!< ITM TCR: ITM Enable bit Mask */
  909. /* ITM Integration Write Register Definitions */
  910. #define ITM_IWR_ATVALIDM_Pos 0U /*!< ITM IWR: ATVALIDM Position */
  911. #define ITM_IWR_ATVALIDM_Msk (1UL /*<< ITM_IWR_ATVALIDM_Pos*/) /*!< ITM IWR: ATVALIDM Mask */
  912. /* ITM Integration Read Register Definitions */
  913. #define ITM_IRR_ATREADYM_Pos 0U /*!< ITM IRR: ATREADYM Position */
  914. #define ITM_IRR_ATREADYM_Msk (1UL /*<< ITM_IRR_ATREADYM_Pos*/) /*!< ITM IRR: ATREADYM Mask */
  915. /* ITM Integration Mode Control Register Definitions */
  916. #define ITM_IMCR_INTEGRATION_Pos 0U /*!< ITM IMCR: INTEGRATION Position */
  917. #define ITM_IMCR_INTEGRATION_Msk (1UL /*<< ITM_IMCR_INTEGRATION_Pos*/) /*!< ITM IMCR: INTEGRATION Mask */
  918. /* ITM Lock Status Register Definitions */
  919. #define ITM_LSR_ByteAcc_Pos 2U /*!< ITM LSR: ByteAcc Position */
  920. #define ITM_LSR_ByteAcc_Msk (1UL << ITM_LSR_ByteAcc_Pos) /*!< ITM LSR: ByteAcc Mask */
  921. #define ITM_LSR_Access_Pos 1U /*!< ITM LSR: Access Position */
  922. #define ITM_LSR_Access_Msk (1UL << ITM_LSR_Access_Pos) /*!< ITM LSR: Access Mask */
  923. #define ITM_LSR_Present_Pos 0U /*!< ITM LSR: Present Position */
  924. #define ITM_LSR_Present_Msk (1UL /*<< ITM_LSR_Present_Pos*/) /*!< ITM LSR: Present Mask */
  925. /*@}*/ /* end of group CMSIS_ITM */
  926. /**
  927. \ingroup CMSIS_core_register
  928. \defgroup CMSIS_DWT Data Watchpoint and Trace (DWT)
  929. \brief Type definitions for the Data Watchpoint and Trace (DWT)
  930. @{
  931. */
  932. /**
  933. \brief Structure type to access the Data Watchpoint and Trace Register (DWT).
  934. */
  935. typedef struct
  936. {
  937. __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) Control Register */
  938. __IOM uint32_t CYCCNT; /*!< Offset: 0x004 (R/W) Cycle Count Register */
  939. __IOM uint32_t CPICNT; /*!< Offset: 0x008 (R/W) CPI Count Register */
  940. __IOM uint32_t EXCCNT; /*!< Offset: 0x00C (R/W) Exception Overhead Count Register */
  941. __IOM uint32_t SLEEPCNT; /*!< Offset: 0x010 (R/W) Sleep Count Register */
  942. __IOM uint32_t LSUCNT; /*!< Offset: 0x014 (R/W) LSU Count Register */
  943. __IOM uint32_t FOLDCNT; /*!< Offset: 0x018 (R/W) Folded-instruction Count Register */
  944. __IM uint32_t PCSR; /*!< Offset: 0x01C (R/ ) Program Counter Sample Register */
  945. __IOM uint32_t COMP0; /*!< Offset: 0x020 (R/W) Comparator Register 0 */
  946. uint32_t RESERVED1[1U];
  947. __IOM uint32_t FUNCTION0; /*!< Offset: 0x028 (R/W) Function Register 0 */
  948. uint32_t RESERVED2[1U];
  949. __IOM uint32_t COMP1; /*!< Offset: 0x030 (R/W) Comparator Register 1 */
  950. uint32_t RESERVED3[1U];
  951. __IOM uint32_t FUNCTION1; /*!< Offset: 0x038 (R/W) Function Register 1 */
  952. uint32_t RESERVED4[1U];
  953. __IOM uint32_t COMP2; /*!< Offset: 0x040 (R/W) Comparator Register 2 */
  954. uint32_t RESERVED5[1U];
  955. __IOM uint32_t FUNCTION2; /*!< Offset: 0x048 (R/W) Function Register 2 */
  956. uint32_t RESERVED6[1U];
  957. __IOM uint32_t COMP3; /*!< Offset: 0x050 (R/W) Comparator Register 3 */
  958. uint32_t RESERVED7[1U];
  959. __IOM uint32_t FUNCTION3; /*!< Offset: 0x058 (R/W) Function Register 3 */
  960. uint32_t RESERVED8[1U];
  961. __IOM uint32_t COMP4; /*!< Offset: 0x060 (R/W) Comparator Register 4 */
  962. uint32_t RESERVED9[1U];
  963. __IOM uint32_t FUNCTION4; /*!< Offset: 0x068 (R/W) Function Register 4 */
  964. uint32_t RESERVED10[1U];
  965. __IOM uint32_t COMP5; /*!< Offset: 0x070 (R/W) Comparator Register 5 */
  966. uint32_t RESERVED11[1U];
  967. __IOM uint32_t FUNCTION5; /*!< Offset: 0x078 (R/W) Function Register 5 */
  968. uint32_t RESERVED12[1U];
  969. __IOM uint32_t COMP6; /*!< Offset: 0x080 (R/W) Comparator Register 6 */
  970. uint32_t RESERVED13[1U];
  971. __IOM uint32_t FUNCTION6; /*!< Offset: 0x088 (R/W) Function Register 6 */
  972. uint32_t RESERVED14[1U];
  973. __IOM uint32_t COMP7; /*!< Offset: 0x090 (R/W) Comparator Register 7 */
  974. uint32_t RESERVED15[1U];
  975. __IOM uint32_t FUNCTION7; /*!< Offset: 0x098 (R/W) Function Register 7 */
  976. uint32_t RESERVED16[1U];
  977. __IOM uint32_t COMP8; /*!< Offset: 0x0A0 (R/W) Comparator Register 8 */
  978. uint32_t RESERVED17[1U];
  979. __IOM uint32_t FUNCTION8; /*!< Offset: 0x0A8 (R/W) Function Register 8 */
  980. uint32_t RESERVED18[1U];
  981. __IOM uint32_t COMP9; /*!< Offset: 0x0B0 (R/W) Comparator Register 9 */
  982. uint32_t RESERVED19[1U];
  983. __IOM uint32_t FUNCTION9; /*!< Offset: 0x0B8 (R/W) Function Register 9 */
  984. uint32_t RESERVED20[1U];
  985. __IOM uint32_t COMP10; /*!< Offset: 0x0C0 (R/W) Comparator Register 10 */
  986. uint32_t RESERVED21[1U];
  987. __IOM uint32_t FUNCTION10; /*!< Offset: 0x0C8 (R/W) Function Register 10 */
  988. uint32_t RESERVED22[1U];
  989. __IOM uint32_t COMP11; /*!< Offset: 0x0D0 (R/W) Comparator Register 11 */
  990. uint32_t RESERVED23[1U];
  991. __IOM uint32_t FUNCTION11; /*!< Offset: 0x0D8 (R/W) Function Register 11 */
  992. uint32_t RESERVED24[1U];
  993. __IOM uint32_t COMP12; /*!< Offset: 0x0E0 (R/W) Comparator Register 12 */
  994. uint32_t RESERVED25[1U];
  995. __IOM uint32_t FUNCTION12; /*!< Offset: 0x0E8 (R/W) Function Register 12 */
  996. uint32_t RESERVED26[1U];
  997. __IOM uint32_t COMP13; /*!< Offset: 0x0F0 (R/W) Comparator Register 13 */
  998. uint32_t RESERVED27[1U];
  999. __IOM uint32_t FUNCTION13; /*!< Offset: 0x0F8 (R/W) Function Register 13 */
  1000. uint32_t RESERVED28[1U];
  1001. __IOM uint32_t COMP14; /*!< Offset: 0x100 (R/W) Comparator Register 14 */
  1002. uint32_t RESERVED29[1U];
  1003. __IOM uint32_t FUNCTION14; /*!< Offset: 0x108 (R/W) Function Register 14 */
  1004. uint32_t RESERVED30[1U];
  1005. __IOM uint32_t COMP15; /*!< Offset: 0x110 (R/W) Comparator Register 15 */
  1006. uint32_t RESERVED31[1U];
  1007. __IOM uint32_t FUNCTION15; /*!< Offset: 0x118 (R/W) Function Register 15 */
  1008. uint32_t RESERVED32[934U];
  1009. __IM uint32_t LSR; /*!< Offset: 0xFB4 (R ) Lock Status Register */
  1010. uint32_t RESERVED33[1U];
  1011. __IM uint32_t DEVARCH; /*!< Offset: 0xFBC (R/ ) Device Architecture Register */
  1012. } DWT_Type;
  1013. /* DWT Control Register Definitions */
  1014. #define DWT_CTRL_NUMCOMP_Pos 28U /*!< DWT CTRL: NUMCOMP Position */
  1015. #define DWT_CTRL_NUMCOMP_Msk (0xFUL << DWT_CTRL_NUMCOMP_Pos) /*!< DWT CTRL: NUMCOMP Mask */
  1016. #define DWT_CTRL_NOTRCPKT_Pos 27U /*!< DWT CTRL: NOTRCPKT Position */
  1017. #define DWT_CTRL_NOTRCPKT_Msk (0x1UL << DWT_CTRL_NOTRCPKT_Pos) /*!< DWT CTRL: NOTRCPKT Mask */
  1018. #define DWT_CTRL_NOEXTTRIG_Pos 26U /*!< DWT CTRL: NOEXTTRIG Position */
  1019. #define DWT_CTRL_NOEXTTRIG_Msk (0x1UL << DWT_CTRL_NOEXTTRIG_Pos) /*!< DWT CTRL: NOEXTTRIG Mask */
  1020. #define DWT_CTRL_NOCYCCNT_Pos 25U /*!< DWT CTRL: NOCYCCNT Position */
  1021. #define DWT_CTRL_NOCYCCNT_Msk (0x1UL << DWT_CTRL_NOCYCCNT_Pos) /*!< DWT CTRL: NOCYCCNT Mask */
  1022. #define DWT_CTRL_NOPRFCNT_Pos 24U /*!< DWT CTRL: NOPRFCNT Position */
  1023. #define DWT_CTRL_NOPRFCNT_Msk (0x1UL << DWT_CTRL_NOPRFCNT_Pos) /*!< DWT CTRL: NOPRFCNT Mask */
  1024. #define DWT_CTRL_CYCDISS_Pos 23U /*!< DWT CTRL: CYCDISS Position */
  1025. #define DWT_CTRL_CYCDISS_Msk (0x1UL << DWT_CTRL_CYCDISS_Pos) /*!< DWT CTRL: CYCDISS Mask */
  1026. #define DWT_CTRL_CYCEVTENA_Pos 22U /*!< DWT CTRL: CYCEVTENA Position */
  1027. #define DWT_CTRL_CYCEVTENA_Msk (0x1UL << DWT_CTRL_CYCEVTENA_Pos) /*!< DWT CTRL: CYCEVTENA Mask */
  1028. #define DWT_CTRL_FOLDEVTENA_Pos 21U /*!< DWT CTRL: FOLDEVTENA Position */
  1029. #define DWT_CTRL_FOLDEVTENA_Msk (0x1UL << DWT_CTRL_FOLDEVTENA_Pos) /*!< DWT CTRL: FOLDEVTENA Mask */
  1030. #define DWT_CTRL_LSUEVTENA_Pos 20U /*!< DWT CTRL: LSUEVTENA Position */
  1031. #define DWT_CTRL_LSUEVTENA_Msk (0x1UL << DWT_CTRL_LSUEVTENA_Pos) /*!< DWT CTRL: LSUEVTENA Mask */
  1032. #define DWT_CTRL_SLEEPEVTENA_Pos 19U /*!< DWT CTRL: SLEEPEVTENA Position */
  1033. #define DWT_CTRL_SLEEPEVTENA_Msk (0x1UL << DWT_CTRL_SLEEPEVTENA_Pos) /*!< DWT CTRL: SLEEPEVTENA Mask */
  1034. #define DWT_CTRL_EXCEVTENA_Pos 18U /*!< DWT CTRL: EXCEVTENA Position */
  1035. #define DWT_CTRL_EXCEVTENA_Msk (0x1UL << DWT_CTRL_EXCEVTENA_Pos) /*!< DWT CTRL: EXCEVTENA Mask */
  1036. #define DWT_CTRL_CPIEVTENA_Pos 17U /*!< DWT CTRL: CPIEVTENA Position */
  1037. #define DWT_CTRL_CPIEVTENA_Msk (0x1UL << DWT_CTRL_CPIEVTENA_Pos) /*!< DWT CTRL: CPIEVTENA Mask */
  1038. #define DWT_CTRL_EXCTRCENA_Pos 16U /*!< DWT CTRL: EXCTRCENA Position */
  1039. #define DWT_CTRL_EXCTRCENA_Msk (0x1UL << DWT_CTRL_EXCTRCENA_Pos) /*!< DWT CTRL: EXCTRCENA Mask */
  1040. #define DWT_CTRL_PCSAMPLENA_Pos 12U /*!< DWT CTRL: PCSAMPLENA Position */
  1041. #define DWT_CTRL_PCSAMPLENA_Msk (0x1UL << DWT_CTRL_PCSAMPLENA_Pos) /*!< DWT CTRL: PCSAMPLENA Mask */
  1042. #define DWT_CTRL_SYNCTAP_Pos 10U /*!< DWT CTRL: SYNCTAP Position */
  1043. #define DWT_CTRL_SYNCTAP_Msk (0x3UL << DWT_CTRL_SYNCTAP_Pos) /*!< DWT CTRL: SYNCTAP Mask */
  1044. #define DWT_CTRL_CYCTAP_Pos 9U /*!< DWT CTRL: CYCTAP Position */
  1045. #define DWT_CTRL_CYCTAP_Msk (0x1UL << DWT_CTRL_CYCTAP_Pos) /*!< DWT CTRL: CYCTAP Mask */
  1046. #define DWT_CTRL_POSTINIT_Pos 5U /*!< DWT CTRL: POSTINIT Position */
  1047. #define DWT_CTRL_POSTINIT_Msk (0xFUL << DWT_CTRL_POSTINIT_Pos) /*!< DWT CTRL: POSTINIT Mask */
  1048. #define DWT_CTRL_POSTPRESET_Pos 1U /*!< DWT CTRL: POSTPRESET Position */
  1049. #define DWT_CTRL_POSTPRESET_Msk (0xFUL << DWT_CTRL_POSTPRESET_Pos) /*!< DWT CTRL: POSTPRESET Mask */
  1050. #define DWT_CTRL_CYCCNTENA_Pos 0U /*!< DWT CTRL: CYCCNTENA Position */
  1051. #define DWT_CTRL_CYCCNTENA_Msk (0x1UL /*<< DWT_CTRL_CYCCNTENA_Pos*/) /*!< DWT CTRL: CYCCNTENA Mask */
  1052. /* DWT CPI Count Register Definitions */
  1053. #define DWT_CPICNT_CPICNT_Pos 0U /*!< DWT CPICNT: CPICNT Position */
  1054. #define DWT_CPICNT_CPICNT_Msk (0xFFUL /*<< DWT_CPICNT_CPICNT_Pos*/) /*!< DWT CPICNT: CPICNT Mask */
  1055. /* DWT Exception Overhead Count Register Definitions */
  1056. #define DWT_EXCCNT_EXCCNT_Pos 0U /*!< DWT EXCCNT: EXCCNT Position */
  1057. #define DWT_EXCCNT_EXCCNT_Msk (0xFFUL /*<< DWT_EXCCNT_EXCCNT_Pos*/) /*!< DWT EXCCNT: EXCCNT Mask */
  1058. /* DWT Sleep Count Register Definitions */
  1059. #define DWT_SLEEPCNT_SLEEPCNT_Pos 0U /*!< DWT SLEEPCNT: SLEEPCNT Position */
  1060. #define DWT_SLEEPCNT_SLEEPCNT_Msk (0xFFUL /*<< DWT_SLEEPCNT_SLEEPCNT_Pos*/) /*!< DWT SLEEPCNT: SLEEPCNT Mask */
  1061. /* DWT LSU Count Register Definitions */
  1062. #define DWT_LSUCNT_LSUCNT_Pos 0U /*!< DWT LSUCNT: LSUCNT Position */
  1063. #define DWT_LSUCNT_LSUCNT_Msk (0xFFUL /*<< DWT_LSUCNT_LSUCNT_Pos*/) /*!< DWT LSUCNT: LSUCNT Mask */
  1064. /* DWT Folded-instruction Count Register Definitions */
  1065. #define DWT_FOLDCNT_FOLDCNT_Pos 0U /*!< DWT FOLDCNT: FOLDCNT Position */
  1066. #define DWT_FOLDCNT_FOLDCNT_Msk (0xFFUL /*<< DWT_FOLDCNT_FOLDCNT_Pos*/) /*!< DWT FOLDCNT: FOLDCNT Mask */
  1067. /* DWT Comparator Function Register Definitions */
  1068. #define DWT_FUNCTION_ID_Pos 27U /*!< DWT FUNCTION: ID Position */
  1069. #define DWT_FUNCTION_ID_Msk (0x1FUL << DWT_FUNCTION_ID_Pos) /*!< DWT FUNCTION: ID Mask */
  1070. #define DWT_FUNCTION_MATCHED_Pos 24U /*!< DWT FUNCTION: MATCHED Position */
  1071. #define DWT_FUNCTION_MATCHED_Msk (0x1UL << DWT_FUNCTION_MATCHED_Pos) /*!< DWT FUNCTION: MATCHED Mask */
  1072. #define DWT_FUNCTION_DATAVSIZE_Pos 10U /*!< DWT FUNCTION: DATAVSIZE Position */
  1073. #define DWT_FUNCTION_DATAVSIZE_Msk (0x3UL << DWT_FUNCTION_DATAVSIZE_Pos) /*!< DWT FUNCTION: DATAVSIZE Mask */
  1074. #define DWT_FUNCTION_ACTION_Pos 4U /*!< DWT FUNCTION: ACTION Position */
  1075. #define DWT_FUNCTION_ACTION_Msk (0x1UL << DWT_FUNCTION_ACTION_Pos) /*!< DWT FUNCTION: ACTION Mask */
  1076. #define DWT_FUNCTION_MATCH_Pos 0U /*!< DWT FUNCTION: MATCH Position */
  1077. #define DWT_FUNCTION_MATCH_Msk (0xFUL /*<< DWT_FUNCTION_MATCH_Pos*/) /*!< DWT FUNCTION: MATCH Mask */
  1078. /*@}*/ /* end of group CMSIS_DWT */
  1079. /**
  1080. \ingroup CMSIS_core_register
  1081. \defgroup CMSIS_TPI Trace Port Interface (TPI)
  1082. \brief Type definitions for the Trace Port Interface (TPI)
  1083. @{
  1084. */
  1085. /**
  1086. \brief Structure type to access the Trace Port Interface Register (TPI).
  1087. */
  1088. typedef struct
  1089. {
  1090. __IM uint32_t SSPSR; /*!< Offset: 0x000 (R/ ) Supported Parallel Port Sizes Register */
  1091. __IOM uint32_t CSPSR; /*!< Offset: 0x004 (R/W) Current Parallel Port Sizes Register */
  1092. uint32_t RESERVED0[2U];
  1093. __IOM uint32_t ACPR; /*!< Offset: 0x010 (R/W) Asynchronous Clock Prescaler Register */
  1094. uint32_t RESERVED1[55U];
  1095. __IOM uint32_t SPPR; /*!< Offset: 0x0F0 (R/W) Selected Pin Protocol Register */
  1096. uint32_t RESERVED2[131U];
  1097. __IM uint32_t FFSR; /*!< Offset: 0x300 (R/ ) Formatter and Flush Status Register */
  1098. __IOM uint32_t FFCR; /*!< Offset: 0x304 (R/W) Formatter and Flush Control Register */
  1099. __IM uint32_t FSCR; /*!< Offset: 0x308 (R/ ) Formatter Synchronization Counter Register */
  1100. uint32_t RESERVED3[759U];
  1101. __IM uint32_t TRIGGER; /*!< Offset: 0xEE8 (R/ ) TRIGGER */
  1102. __IM uint32_t FIFO0; /*!< Offset: 0xEEC (R/ ) Integration ETM Data */
  1103. __IM uint32_t ITATBCTR2; /*!< Offset: 0xEF0 (R/ ) ITATBCTR2 */
  1104. uint32_t RESERVED4[1U];
  1105. __IM uint32_t ITATBCTR0; /*!< Offset: 0xEF8 (R/ ) ITATBCTR0 */
  1106. __IM uint32_t FIFO1; /*!< Offset: 0xEFC (R/ ) Integration ITM Data */
  1107. __IOM uint32_t ITCTRL; /*!< Offset: 0xF00 (R/W) Integration Mode Control */
  1108. uint32_t RESERVED5[39U];
  1109. __IOM uint32_t CLAIMSET; /*!< Offset: 0xFA0 (R/W) Claim tag set */
  1110. __IOM uint32_t CLAIMCLR; /*!< Offset: 0xFA4 (R/W) Claim tag clear */
  1111. uint32_t RESERVED7[8U];
  1112. __IM uint32_t DEVID; /*!< Offset: 0xFC8 (R/ ) TPIU_DEVID */
  1113. __IM uint32_t DEVTYPE; /*!< Offset: 0xFCC (R/ ) TPIU_DEVTYPE */
  1114. } TPI_Type;
  1115. /* TPI Asynchronous Clock Prescaler Register Definitions */
  1116. #define TPI_ACPR_PRESCALER_Pos 0U /*!< TPI ACPR: PRESCALER Position */
  1117. #define TPI_ACPR_PRESCALER_Msk (0x1FFFUL /*<< TPI_ACPR_PRESCALER_Pos*/) /*!< TPI ACPR: PRESCALER Mask */
  1118. /* TPI Selected Pin Protocol Register Definitions */
  1119. #define TPI_SPPR_TXMODE_Pos 0U /*!< TPI SPPR: TXMODE Position */
  1120. #define TPI_SPPR_TXMODE_Msk (0x3UL /*<< TPI_SPPR_TXMODE_Pos*/) /*!< TPI SPPR: TXMODE Mask */
  1121. /* TPI Formatter and Flush Status Register Definitions */
  1122. #define TPI_FFSR_FtNonStop_Pos 3U /*!< TPI FFSR: FtNonStop Position */
  1123. #define TPI_FFSR_FtNonStop_Msk (0x1UL << TPI_FFSR_FtNonStop_Pos) /*!< TPI FFSR: FtNonStop Mask */
  1124. #define TPI_FFSR_TCPresent_Pos 2U /*!< TPI FFSR: TCPresent Position */
  1125. #define TPI_FFSR_TCPresent_Msk (0x1UL << TPI_FFSR_TCPresent_Pos) /*!< TPI FFSR: TCPresent Mask */
  1126. #define TPI_FFSR_FtStopped_Pos 1U /*!< TPI FFSR: FtStopped Position */
  1127. #define TPI_FFSR_FtStopped_Msk (0x1UL << TPI_FFSR_FtStopped_Pos) /*!< TPI FFSR: FtStopped Mask */
  1128. #define TPI_FFSR_FlInProg_Pos 0U /*!< TPI FFSR: FlInProg Position */
  1129. #define TPI_FFSR_FlInProg_Msk (0x1UL /*<< TPI_FFSR_FlInProg_Pos*/) /*!< TPI FFSR: FlInProg Mask */
  1130. /* TPI Formatter and Flush Control Register Definitions */
  1131. #define TPI_FFCR_TrigIn_Pos 8U /*!< TPI FFCR: TrigIn Position */
  1132. #define TPI_FFCR_TrigIn_Msk (0x1UL << TPI_FFCR_TrigIn_Pos) /*!< TPI FFCR: TrigIn Mask */
  1133. #define TPI_FFCR_EnFCont_Pos 1U /*!< TPI FFCR: EnFCont Position */
  1134. #define TPI_FFCR_EnFCont_Msk (0x1UL << TPI_FFCR_EnFCont_Pos) /*!< TPI FFCR: EnFCont Mask */
  1135. /* TPI TRIGGER Register Definitions */
  1136. #define TPI_TRIGGER_TRIGGER_Pos 0U /*!< TPI TRIGGER: TRIGGER Position */
  1137. #define TPI_TRIGGER_TRIGGER_Msk (0x1UL /*<< TPI_TRIGGER_TRIGGER_Pos*/) /*!< TPI TRIGGER: TRIGGER Mask */
  1138. /* TPI Integration ETM Data Register Definitions (FIFO0) */
  1139. #define TPI_FIFO0_ITM_ATVALID_Pos 29U /*!< TPI FIFO0: ITM_ATVALID Position */
  1140. #define TPI_FIFO0_ITM_ATVALID_Msk (0x3UL << TPI_FIFO0_ITM_ATVALID_Pos) /*!< TPI FIFO0: ITM_ATVALID Mask */
  1141. #define TPI_FIFO0_ITM_bytecount_Pos 27U /*!< TPI FIFO0: ITM_bytecount Position */
  1142. #define TPI_FIFO0_ITM_bytecount_Msk (0x3UL << TPI_FIFO0_ITM_bytecount_Pos) /*!< TPI FIFO0: ITM_bytecount Mask */
  1143. #define TPI_FIFO0_ETM_ATVALID_Pos 26U /*!< TPI FIFO0: ETM_ATVALID Position */
  1144. #define TPI_FIFO0_ETM_ATVALID_Msk (0x3UL << TPI_FIFO0_ETM_ATVALID_Pos) /*!< TPI FIFO0: ETM_ATVALID Mask */
  1145. #define TPI_FIFO0_ETM_bytecount_Pos 24U /*!< TPI FIFO0: ETM_bytecount Position */
  1146. #define TPI_FIFO0_ETM_bytecount_Msk (0x3UL << TPI_FIFO0_ETM_bytecount_Pos) /*!< TPI FIFO0: ETM_bytecount Mask */
  1147. #define TPI_FIFO0_ETM2_Pos 16U /*!< TPI FIFO0: ETM2 Position */
  1148. #define TPI_FIFO0_ETM2_Msk (0xFFUL << TPI_FIFO0_ETM2_Pos) /*!< TPI FIFO0: ETM2 Mask */
  1149. #define TPI_FIFO0_ETM1_Pos 8U /*!< TPI FIFO0: ETM1 Position */
  1150. #define TPI_FIFO0_ETM1_Msk (0xFFUL << TPI_FIFO0_ETM1_Pos) /*!< TPI FIFO0: ETM1 Mask */
  1151. #define TPI_FIFO0_ETM0_Pos 0U /*!< TPI FIFO0: ETM0 Position */
  1152. #define TPI_FIFO0_ETM0_Msk (0xFFUL /*<< TPI_FIFO0_ETM0_Pos*/) /*!< TPI FIFO0: ETM0 Mask */
  1153. /* TPI ITATBCTR2 Register Definitions */
  1154. #define TPI_ITATBCTR2_ATREADY_Pos 0U /*!< TPI ITATBCTR2: ATREADY Position */
  1155. #define TPI_ITATBCTR2_ATREADY_Msk (0x1UL /*<< TPI_ITATBCTR2_ATREADY_Pos*/) /*!< TPI ITATBCTR2: ATREADY Mask */
  1156. /* TPI Integration ITM Data Register Definitions (FIFO1) */
  1157. #define TPI_FIFO1_ITM_ATVALID_Pos 29U /*!< TPI FIFO1: ITM_ATVALID Position */
  1158. #define TPI_FIFO1_ITM_ATVALID_Msk (0x3UL << TPI_FIFO1_ITM_ATVALID_Pos) /*!< TPI FIFO1: ITM_ATVALID Mask */
  1159. #define TPI_FIFO1_ITM_bytecount_Pos 27U /*!< TPI FIFO1: ITM_bytecount Position */
  1160. #define TPI_FIFO1_ITM_bytecount_Msk (0x3UL << TPI_FIFO1_ITM_bytecount_Pos) /*!< TPI FIFO1: ITM_bytecount Mask */
  1161. #define TPI_FIFO1_ETM_ATVALID_Pos 26U /*!< TPI FIFO1: ETM_ATVALID Position */
  1162. #define TPI_FIFO1_ETM_ATVALID_Msk (0x3UL << TPI_FIFO1_ETM_ATVALID_Pos) /*!< TPI FIFO1: ETM_ATVALID Mask */
  1163. #define TPI_FIFO1_ETM_bytecount_Pos 24U /*!< TPI FIFO1: ETM_bytecount Position */
  1164. #define TPI_FIFO1_ETM_bytecount_Msk (0x3UL << TPI_FIFO1_ETM_bytecount_Pos) /*!< TPI FIFO1: ETM_bytecount Mask */
  1165. #define TPI_FIFO1_ITM2_Pos 16U /*!< TPI FIFO1: ITM2 Position */
  1166. #define TPI_FIFO1_ITM2_Msk (0xFFUL << TPI_FIFO1_ITM2_Pos) /*!< TPI FIFO1: ITM2 Mask */
  1167. #define TPI_FIFO1_ITM1_Pos 8U /*!< TPI FIFO1: ITM1 Position */
  1168. #define TPI_FIFO1_ITM1_Msk (0xFFUL << TPI_FIFO1_ITM1_Pos) /*!< TPI FIFO1: ITM1 Mask */
  1169. #define TPI_FIFO1_ITM0_Pos 0U /*!< TPI FIFO1: ITM0 Position */
  1170. #define TPI_FIFO1_ITM0_Msk (0xFFUL /*<< TPI_FIFO1_ITM0_Pos*/) /*!< TPI FIFO1: ITM0 Mask */
  1171. /* TPI ITATBCTR0 Register Definitions */
  1172. #define TPI_ITATBCTR0_ATREADY_Pos 0U /*!< TPI ITATBCTR0: ATREADY Position */
  1173. #define TPI_ITATBCTR0_ATREADY_Msk (0x1UL /*<< TPI_ITATBCTR0_ATREADY_Pos*/) /*!< TPI ITATBCTR0: ATREADY Mask */
  1174. /* TPI Integration Mode Control Register Definitions */
  1175. #define TPI_ITCTRL_Mode_Pos 0U /*!< TPI ITCTRL: Mode Position */
  1176. #define TPI_ITCTRL_Mode_Msk (0x1UL /*<< TPI_ITCTRL_Mode_Pos*/) /*!< TPI ITCTRL: Mode Mask */
  1177. /* TPI DEVID Register Definitions */
  1178. #define TPI_DEVID_NRZVALID_Pos 11U /*!< TPI DEVID: NRZVALID Position */
  1179. #define TPI_DEVID_NRZVALID_Msk (0x1UL << TPI_DEVID_NRZVALID_Pos) /*!< TPI DEVID: NRZVALID Mask */
  1180. #define TPI_DEVID_MANCVALID_Pos 10U /*!< TPI DEVID: MANCVALID Position */
  1181. #define TPI_DEVID_MANCVALID_Msk (0x1UL << TPI_DEVID_MANCVALID_Pos) /*!< TPI DEVID: MANCVALID Mask */
  1182. #define TPI_DEVID_PTINVALID_Pos 9U /*!< TPI DEVID: PTINVALID Position */
  1183. #define TPI_DEVID_PTINVALID_Msk (0x1UL << TPI_DEVID_PTINVALID_Pos) /*!< TPI DEVID: PTINVALID Mask */
  1184. #define TPI_DEVID_MinBufSz_Pos 6U /*!< TPI DEVID: MinBufSz Position */
  1185. #define TPI_DEVID_MinBufSz_Msk (0x7UL << TPI_DEVID_MinBufSz_Pos) /*!< TPI DEVID: MinBufSz Mask */
  1186. #define TPI_DEVID_AsynClkIn_Pos 5U /*!< TPI DEVID: AsynClkIn Position */
  1187. #define TPI_DEVID_AsynClkIn_Msk (0x1UL << TPI_DEVID_AsynClkIn_Pos) /*!< TPI DEVID: AsynClkIn Mask */
  1188. #define TPI_DEVID_NrTraceInput_Pos 0U /*!< TPI DEVID: NrTraceInput Position */
  1189. #define TPI_DEVID_NrTraceInput_Msk (0x1FUL /*<< TPI_DEVID_NrTraceInput_Pos*/) /*!< TPI DEVID: NrTraceInput Mask */
  1190. /* TPI DEVTYPE Register Definitions */
  1191. #define TPI_DEVTYPE_MajorType_Pos 4U /*!< TPI DEVTYPE: MajorType Position */
  1192. #define TPI_DEVTYPE_MajorType_Msk (0xFUL << TPI_DEVTYPE_MajorType_Pos) /*!< TPI DEVTYPE: MajorType Mask */
  1193. #define TPI_DEVTYPE_SubType_Pos 0U /*!< TPI DEVTYPE: SubType Position */
  1194. #define TPI_DEVTYPE_SubType_Msk (0xFUL /*<< TPI_DEVTYPE_SubType_Pos*/) /*!< TPI DEVTYPE: SubType Mask */
  1195. /*@}*/ /* end of group CMSIS_TPI */
  1196. #if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U)
  1197. /**
  1198. \ingroup CMSIS_core_register
  1199. \defgroup CMSIS_MPU Memory Protection Unit (MPU)
  1200. \brief Type definitions for the Memory Protection Unit (MPU)
  1201. @{
  1202. */
  1203. /**
  1204. \brief Structure type to access the Memory Protection Unit (MPU).
  1205. */
  1206. typedef struct
  1207. {
  1208. __IM uint32_t TYPE; /*!< Offset: 0x000 (R/ ) MPU Type Register */
  1209. __IOM uint32_t CTRL; /*!< Offset: 0x004 (R/W) MPU Control Register */
  1210. __IOM uint32_t RNR; /*!< Offset: 0x008 (R/W) MPU Region Number Register */
  1211. __IOM uint32_t RBAR; /*!< Offset: 0x00C (R/W) MPU Region Base Address Register */
  1212. __IOM uint32_t RLAR; /*!< Offset: 0x010 (R/W) MPU Region Limit Address Register */
  1213. __IOM uint32_t RBAR_A1; /*!< Offset: 0x014 (R/W) MPU Region Base Address Register Alias 1 */
  1214. __IOM uint32_t RLAR_A1; /*!< Offset: 0x018 (R/W) MPU Region Limit Address Register Alias 1 */
  1215. __IOM uint32_t RBAR_A2; /*!< Offset: 0x01C (R/W) MPU Region Base Address Register Alias 2 */
  1216. __IOM uint32_t RLAR_A2; /*!< Offset: 0x020 (R/W) MPU Region Limit Address Register Alias 2 */
  1217. __IOM uint32_t RBAR_A3; /*!< Offset: 0x024 (R/W) MPU Region Base Address Register Alias 3 */
  1218. __IOM uint32_t RLAR_A3; /*!< Offset: 0x028 (R/W) MPU Region Limit Address Register Alias 3 */
  1219. uint32_t RESERVED0[1];
  1220. union {
  1221. __IOM uint32_t MAIR[2];
  1222. struct {
  1223. __IOM uint32_t MAIR0; /*!< Offset: 0x030 (R/W) MPU Memory Attribute Indirection Register 0 */
  1224. __IOM uint32_t MAIR1; /*!< Offset: 0x034 (R/W) MPU Memory Attribute Indirection Register 1 */
  1225. };
  1226. };
  1227. } MPU_Type;
  1228. #define MPU_TYPE_RALIASES 4U
  1229. /* MPU Type Register Definitions */
  1230. #define MPU_TYPE_IREGION_Pos 16U /*!< MPU TYPE: IREGION Position */
  1231. #define MPU_TYPE_IREGION_Msk (0xFFUL << MPU_TYPE_IREGION_Pos) /*!< MPU TYPE: IREGION Mask */
  1232. #define MPU_TYPE_DREGION_Pos 8U /*!< MPU TYPE: DREGION Position */
  1233. #define MPU_TYPE_DREGION_Msk (0xFFUL << MPU_TYPE_DREGION_Pos) /*!< MPU TYPE: DREGION Mask */
  1234. #define MPU_TYPE_SEPARATE_Pos 0U /*!< MPU TYPE: SEPARATE Position */
  1235. #define MPU_TYPE_SEPARATE_Msk (1UL /*<< MPU_TYPE_SEPARATE_Pos*/) /*!< MPU TYPE: SEPARATE Mask */
  1236. /* MPU Control Register Definitions */
  1237. #define MPU_CTRL_PRIVDEFENA_Pos 2U /*!< MPU CTRL: PRIVDEFENA Position */
  1238. #define MPU_CTRL_PRIVDEFENA_Msk (1UL << MPU_CTRL_PRIVDEFENA_Pos) /*!< MPU CTRL: PRIVDEFENA Mask */
  1239. #define MPU_CTRL_HFNMIENA_Pos 1U /*!< MPU CTRL: HFNMIENA Position */
  1240. #define MPU_CTRL_HFNMIENA_Msk (1UL << MPU_CTRL_HFNMIENA_Pos) /*!< MPU CTRL: HFNMIENA Mask */
  1241. #define MPU_CTRL_ENABLE_Pos 0U /*!< MPU CTRL: ENABLE Position */
  1242. #define MPU_CTRL_ENABLE_Msk (1UL /*<< MPU_CTRL_ENABLE_Pos*/) /*!< MPU CTRL: ENABLE Mask */
  1243. /* MPU Region Number Register Definitions */
  1244. #define MPU_RNR_REGION_Pos 0U /*!< MPU RNR: REGION Position */
  1245. #define MPU_RNR_REGION_Msk (0xFFUL /*<< MPU_RNR_REGION_Pos*/) /*!< MPU RNR: REGION Mask */
  1246. /* MPU Region Base Address Register Definitions */
  1247. #define MPU_RBAR_ADDR_Pos 5U /*!< MPU RBAR: ADDR Position */
  1248. #define MPU_RBAR_ADDR_Msk (0x7FFFFFFUL << MPU_RBAR_ADDR_Pos) /*!< MPU RBAR: ADDR Mask */
  1249. #define MPU_RBAR_SH_Pos 3U /*!< MPU RBAR: SH Position */
  1250. #define MPU_RBAR_SH_Msk (0x3UL << MPU_RBAR_SH_Pos) /*!< MPU RBAR: SH Mask */
  1251. #define MPU_RBAR_AP_Pos 1U /*!< MPU RBAR: AP Position */
  1252. #define MPU_RBAR_AP_Msk (0x3UL << MPU_RBAR_AP_Pos) /*!< MPU RBAR: AP Mask */
  1253. #define MPU_RBAR_XN_Pos 0U /*!< MPU RBAR: XN Position */
  1254. #define MPU_RBAR_XN_Msk (01UL /*<< MPU_RBAR_XN_Pos*/) /*!< MPU RBAR: XN Mask */
  1255. /* MPU Region Limit Address Register Definitions */
  1256. #define MPU_RLAR_LIMIT_Pos 5U /*!< MPU RLAR: LIMIT Position */
  1257. #define MPU_RLAR_LIMIT_Msk (0x7FFFFFFUL << MPU_RLAR_LIMIT_Pos) /*!< MPU RLAR: LIMIT Mask */
  1258. #define MPU_RLAR_PXN_Pos 4U /*!< MPU RLAR: PXN Position */
  1259. #define MPU_RLAR_PXN_Msk (0x1UL << MPU_RLAR_PXN_Pos) /*!< MPU RLAR: PXN Mask */
  1260. #define MPU_RLAR_AttrIndx_Pos 1U /*!< MPU RLAR: AttrIndx Position */
  1261. #define MPU_RLAR_AttrIndx_Msk (0x7UL << MPU_RLAR_AttrIndx_Pos) /*!< MPU RLAR: AttrIndx Mask */
  1262. #define MPU_RLAR_EN_Pos 0U /*!< MPU RLAR: Region enable bit Position */
  1263. #define MPU_RLAR_EN_Msk (1UL /*<< MPU_RLAR_EN_Pos*/) /*!< MPU RLAR: Region enable bit Disable Mask */
  1264. /* MPU Memory Attribute Indirection Register 0 Definitions */
  1265. #define MPU_MAIR0_Attr3_Pos 24U /*!< MPU MAIR0: Attr3 Position */
  1266. #define MPU_MAIR0_Attr3_Msk (0xFFUL << MPU_MAIR0_Attr3_Pos) /*!< MPU MAIR0: Attr3 Mask */
  1267. #define MPU_MAIR0_Attr2_Pos 16U /*!< MPU MAIR0: Attr2 Position */
  1268. #define MPU_MAIR0_Attr2_Msk (0xFFUL << MPU_MAIR0_Attr2_Pos) /*!< MPU MAIR0: Attr2 Mask */
  1269. #define MPU_MAIR0_Attr1_Pos 8U /*!< MPU MAIR0: Attr1 Position */
  1270. #define MPU_MAIR0_Attr1_Msk (0xFFUL << MPU_MAIR0_Attr1_Pos) /*!< MPU MAIR0: Attr1 Mask */
  1271. #define MPU_MAIR0_Attr0_Pos 0U /*!< MPU MAIR0: Attr0 Position */
  1272. #define MPU_MAIR0_Attr0_Msk (0xFFUL /*<< MPU_MAIR0_Attr0_Pos*/) /*!< MPU MAIR0: Attr0 Mask */
  1273. /* MPU Memory Attribute Indirection Register 1 Definitions */
  1274. #define MPU_MAIR1_Attr7_Pos 24U /*!< MPU MAIR1: Attr7 Position */
  1275. #define MPU_MAIR1_Attr7_Msk (0xFFUL << MPU_MAIR1_Attr7_Pos) /*!< MPU MAIR1: Attr7 Mask */
  1276. #define MPU_MAIR1_Attr6_Pos 16U /*!< MPU MAIR1: Attr6 Position */
  1277. #define MPU_MAIR1_Attr6_Msk (0xFFUL << MPU_MAIR1_Attr6_Pos) /*!< MPU MAIR1: Attr6 Mask */
  1278. #define MPU_MAIR1_Attr5_Pos 8U /*!< MPU MAIR1: Attr5 Position */
  1279. #define MPU_MAIR1_Attr5_Msk (0xFFUL << MPU_MAIR1_Attr5_Pos) /*!< MPU MAIR1: Attr5 Mask */
  1280. #define MPU_MAIR1_Attr4_Pos 0U /*!< MPU MAIR1: Attr4 Position */
  1281. #define MPU_MAIR1_Attr4_Msk (0xFFUL /*<< MPU_MAIR1_Attr4_Pos*/) /*!< MPU MAIR1: Attr4 Mask */
  1282. /*@} end of group CMSIS_MPU */
  1283. #endif
  1284. #if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
  1285. /**
  1286. \ingroup CMSIS_core_register
  1287. \defgroup CMSIS_SAU Security Attribution Unit (SAU)
  1288. \brief Type definitions for the Security Attribution Unit (SAU)
  1289. @{
  1290. */
  1291. /**
  1292. \brief Structure type to access the Security Attribution Unit (SAU).
  1293. */
  1294. typedef struct
  1295. {
  1296. __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) SAU Control Register */
  1297. __IM uint32_t TYPE; /*!< Offset: 0x004 (R/ ) SAU Type Register */
  1298. #if defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U)
  1299. __IOM uint32_t RNR; /*!< Offset: 0x008 (R/W) SAU Region Number Register */
  1300. __IOM uint32_t RBAR; /*!< Offset: 0x00C (R/W) SAU Region Base Address Register */
  1301. __IOM uint32_t RLAR; /*!< Offset: 0x010 (R/W) SAU Region Limit Address Register */
  1302. #else
  1303. uint32_t RESERVED0[3];
  1304. #endif
  1305. __IOM uint32_t SFSR; /*!< Offset: 0x014 (R/W) Secure Fault Status Register */
  1306. __IOM uint32_t SFAR; /*!< Offset: 0x018 (R/W) Secure Fault Address Register */
  1307. } SAU_Type;
  1308. /* SAU Control Register Definitions */
  1309. #define SAU_CTRL_ALLNS_Pos 1U /*!< SAU CTRL: ALLNS Position */
  1310. #define SAU_CTRL_ALLNS_Msk (1UL << SAU_CTRL_ALLNS_Pos) /*!< SAU CTRL: ALLNS Mask */
  1311. #define SAU_CTRL_ENABLE_Pos 0U /*!< SAU CTRL: ENABLE Position */
  1312. #define SAU_CTRL_ENABLE_Msk (1UL /*<< SAU_CTRL_ENABLE_Pos*/) /*!< SAU CTRL: ENABLE Mask */
  1313. /* SAU Type Register Definitions */
  1314. #define SAU_TYPE_SREGION_Pos 0U /*!< SAU TYPE: SREGION Position */
  1315. #define SAU_TYPE_SREGION_Msk (0xFFUL /*<< SAU_TYPE_SREGION_Pos*/) /*!< SAU TYPE: SREGION Mask */
  1316. #if defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U)
  1317. /* SAU Region Number Register Definitions */
  1318. #define SAU_RNR_REGION_Pos 0U /*!< SAU RNR: REGION Position */
  1319. #define SAU_RNR_REGION_Msk (0xFFUL /*<< SAU_RNR_REGION_Pos*/) /*!< SAU RNR: REGION Mask */
  1320. /* SAU Region Base Address Register Definitions */
  1321. #define SAU_RBAR_BADDR_Pos 5U /*!< SAU RBAR: BADDR Position */
  1322. #define SAU_RBAR_BADDR_Msk (0x7FFFFFFUL << SAU_RBAR_BADDR_Pos) /*!< SAU RBAR: BADDR Mask */
  1323. /* SAU Region Limit Address Register Definitions */
  1324. #define SAU_RLAR_LADDR_Pos 5U /*!< SAU RLAR: LADDR Position */
  1325. #define SAU_RLAR_LADDR_Msk (0x7FFFFFFUL << SAU_RLAR_LADDR_Pos) /*!< SAU RLAR: LADDR Mask */
  1326. #define SAU_RLAR_NSC_Pos 1U /*!< SAU RLAR: NSC Position */
  1327. #define SAU_RLAR_NSC_Msk (1UL << SAU_RLAR_NSC_Pos) /*!< SAU RLAR: NSC Mask */
  1328. #define SAU_RLAR_ENABLE_Pos 0U /*!< SAU RLAR: ENABLE Position */
  1329. #define SAU_RLAR_ENABLE_Msk (1UL /*<< SAU_RLAR_ENABLE_Pos*/) /*!< SAU RLAR: ENABLE Mask */
  1330. #endif /* defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U) */
  1331. /* Secure Fault Status Register Definitions */
  1332. #define SAU_SFSR_LSERR_Pos 7U /*!< SAU SFSR: LSERR Position */
  1333. #define SAU_SFSR_LSERR_Msk (1UL << SAU_SFSR_LSERR_Pos) /*!< SAU SFSR: LSERR Mask */
  1334. #define SAU_SFSR_SFARVALID_Pos 6U /*!< SAU SFSR: SFARVALID Position */
  1335. #define SAU_SFSR_SFARVALID_Msk (1UL << SAU_SFSR_SFARVALID_Pos) /*!< SAU SFSR: SFARVALID Mask */
  1336. #define SAU_SFSR_LSPERR_Pos 5U /*!< SAU SFSR: LSPERR Position */
  1337. #define SAU_SFSR_LSPERR_Msk (1UL << SAU_SFSR_LSPERR_Pos) /*!< SAU SFSR: LSPERR Mask */
  1338. #define SAU_SFSR_INVTRAN_Pos 4U /*!< SAU SFSR: INVTRAN Position */
  1339. #define SAU_SFSR_INVTRAN_Msk (1UL << SAU_SFSR_INVTRAN_Pos) /*!< SAU SFSR: INVTRAN Mask */
  1340. #define SAU_SFSR_AUVIOL_Pos 3U /*!< SAU SFSR: AUVIOL Position */
  1341. #define SAU_SFSR_AUVIOL_Msk (1UL << SAU_SFSR_AUVIOL_Pos) /*!< SAU SFSR: AUVIOL Mask */
  1342. #define SAU_SFSR_INVER_Pos 2U /*!< SAU SFSR: INVER Position */
  1343. #define SAU_SFSR_INVER_Msk (1UL << SAU_SFSR_INVER_Pos) /*!< SAU SFSR: INVER Mask */
  1344. #define SAU_SFSR_INVIS_Pos 1U /*!< SAU SFSR: INVIS Position */
  1345. #define SAU_SFSR_INVIS_Msk (1UL << SAU_SFSR_INVIS_Pos) /*!< SAU SFSR: INVIS Mask */
  1346. #define SAU_SFSR_INVEP_Pos 0U /*!< SAU SFSR: INVEP Position */
  1347. #define SAU_SFSR_INVEP_Msk (1UL /*<< SAU_SFSR_INVEP_Pos*/) /*!< SAU SFSR: INVEP Mask */
  1348. /*@} end of group CMSIS_SAU */
  1349. #endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */
  1350. /**
  1351. \ingroup CMSIS_core_register
  1352. \defgroup CMSIS_FPU Floating Point Unit (FPU)
  1353. \brief Type definitions for the Floating Point Unit (FPU)
  1354. @{
  1355. */
  1356. /**
  1357. \brief Structure type to access the Floating Point Unit (FPU).
  1358. */
  1359. typedef struct
  1360. {
  1361. uint32_t RESERVED0[1U];
  1362. __IOM uint32_t FPCCR; /*!< Offset: 0x004 (R/W) Floating-Point Context Control Register */
  1363. __IOM uint32_t FPCAR; /*!< Offset: 0x008 (R/W) Floating-Point Context Address Register */
  1364. __IOM uint32_t FPDSCR; /*!< Offset: 0x00C (R/W) Floating-Point Default Status Control Register */
  1365. __IM uint32_t MVFR0; /*!< Offset: 0x010 (R/ ) Media and FP Feature Register 0 */
  1366. __IM uint32_t MVFR1; /*!< Offset: 0x014 (R/ ) Media and FP Feature Register 1 */
  1367. } FPU_Type;
  1368. /* Floating-Point Context Control Register Definitions */
  1369. #define FPU_FPCCR_ASPEN_Pos 31U /*!< FPCCR: ASPEN bit Position */
  1370. #define FPU_FPCCR_ASPEN_Msk (1UL << FPU_FPCCR_ASPEN_Pos) /*!< FPCCR: ASPEN bit Mask */
  1371. #define FPU_FPCCR_LSPEN_Pos 30U /*!< FPCCR: LSPEN Position */
  1372. #define FPU_FPCCR_LSPEN_Msk (1UL << FPU_FPCCR_LSPEN_Pos) /*!< FPCCR: LSPEN bit Mask */
  1373. #define FPU_FPCCR_LSPENS_Pos 29U /*!< FPCCR: LSPENS Position */
  1374. #define FPU_FPCCR_LSPENS_Msk (1UL << FPU_FPCCR_LSPENS_Pos) /*!< FPCCR: LSPENS bit Mask */
  1375. #define FPU_FPCCR_CLRONRET_Pos 28U /*!< FPCCR: CLRONRET Position */
  1376. #define FPU_FPCCR_CLRONRET_Msk (1UL << FPU_FPCCR_CLRONRET_Pos) /*!< FPCCR: CLRONRET bit Mask */
  1377. #define FPU_FPCCR_CLRONRETS_Pos 27U /*!< FPCCR: CLRONRETS Position */
  1378. #define FPU_FPCCR_CLRONRETS_Msk (1UL << FPU_FPCCR_CLRONRETS_Pos) /*!< FPCCR: CLRONRETS bit Mask */
  1379. #define FPU_FPCCR_TS_Pos 26U /*!< FPCCR: TS Position */
  1380. #define FPU_FPCCR_TS_Msk (1UL << FPU_FPCCR_TS_Pos) /*!< FPCCR: TS bit Mask */
  1381. #define FPU_FPCCR_UFRDY_Pos 10U /*!< FPCCR: UFRDY Position */
  1382. #define FPU_FPCCR_UFRDY_Msk (1UL << FPU_FPCCR_UFRDY_Pos) /*!< FPCCR: UFRDY bit Mask */
  1383. #define FPU_FPCCR_SPLIMVIOL_Pos 9U /*!< FPCCR: SPLIMVIOL Position */
  1384. #define FPU_FPCCR_SPLIMVIOL_Msk (1UL << FPU_FPCCR_SPLIMVIOL_Pos) /*!< FPCCR: SPLIMVIOL bit Mask */
  1385. #define FPU_FPCCR_MONRDY_Pos 8U /*!< FPCCR: MONRDY Position */
  1386. #define FPU_FPCCR_MONRDY_Msk (1UL << FPU_FPCCR_MONRDY_Pos) /*!< FPCCR: MONRDY bit Mask */
  1387. #define FPU_FPCCR_SFRDY_Pos 7U /*!< FPCCR: SFRDY Position */
  1388. #define FPU_FPCCR_SFRDY_Msk (1UL << FPU_FPCCR_SFRDY_Pos) /*!< FPCCR: SFRDY bit Mask */
  1389. #define FPU_FPCCR_BFRDY_Pos 6U /*!< FPCCR: BFRDY Position */
  1390. #define FPU_FPCCR_BFRDY_Msk (1UL << FPU_FPCCR_BFRDY_Pos) /*!< FPCCR: BFRDY bit Mask */
  1391. #define FPU_FPCCR_MMRDY_Pos 5U /*!< FPCCR: MMRDY Position */
  1392. #define FPU_FPCCR_MMRDY_Msk (1UL << FPU_FPCCR_MMRDY_Pos) /*!< FPCCR: MMRDY bit Mask */
  1393. #define FPU_FPCCR_HFRDY_Pos 4U /*!< FPCCR: HFRDY Position */
  1394. #define FPU_FPCCR_HFRDY_Msk (1UL << FPU_FPCCR_HFRDY_Pos) /*!< FPCCR: HFRDY bit Mask */
  1395. #define FPU_FPCCR_THREAD_Pos 3U /*!< FPCCR: processor mode bit Position */
  1396. #define FPU_FPCCR_THREAD_Msk (1UL << FPU_FPCCR_THREAD_Pos) /*!< FPCCR: processor mode active bit Mask */
  1397. #define FPU_FPCCR_S_Pos 2U /*!< FPCCR: Security status of the FP context bit Position */
  1398. #define FPU_FPCCR_S_Msk (1UL << FPU_FPCCR_S_Pos) /*!< FPCCR: Security status of the FP context bit Mask */
  1399. #define FPU_FPCCR_USER_Pos 1U /*!< FPCCR: privilege level bit Position */
  1400. #define FPU_FPCCR_USER_Msk (1UL << FPU_FPCCR_USER_Pos) /*!< FPCCR: privilege level bit Mask */
  1401. #define FPU_FPCCR_LSPACT_Pos 0U /*!< FPCCR: Lazy state preservation active bit Position */
  1402. #define FPU_FPCCR_LSPACT_Msk (1UL /*<< FPU_FPCCR_LSPACT_Pos*/) /*!< FPCCR: Lazy state preservation active bit Mask */
  1403. /* Floating-Point Context Address Register Definitions */
  1404. #define FPU_FPCAR_ADDRESS_Pos 3U /*!< FPCAR: ADDRESS bit Position */
  1405. #define FPU_FPCAR_ADDRESS_Msk (0x1FFFFFFFUL << FPU_FPCAR_ADDRESS_Pos) /*!< FPCAR: ADDRESS bit Mask */
  1406. /* Floating-Point Default Status Control Register Definitions */
  1407. #define FPU_FPDSCR_AHP_Pos 26U /*!< FPDSCR: AHP bit Position */
  1408. #define FPU_FPDSCR_AHP_Msk (1UL << FPU_FPDSCR_AHP_Pos) /*!< FPDSCR: AHP bit Mask */
  1409. #define FPU_FPDSCR_DN_Pos 25U /*!< FPDSCR: DN bit Position */
  1410. #define FPU_FPDSCR_DN_Msk (1UL << FPU_FPDSCR_DN_Pos) /*!< FPDSCR: DN bit Mask */
  1411. #define FPU_FPDSCR_FZ_Pos 24U /*!< FPDSCR: FZ bit Position */
  1412. #define FPU_FPDSCR_FZ_Msk (1UL << FPU_FPDSCR_FZ_Pos) /*!< FPDSCR: FZ bit Mask */
  1413. #define FPU_FPDSCR_RMode_Pos 22U /*!< FPDSCR: RMode bit Position */
  1414. #define FPU_FPDSCR_RMode_Msk (3UL << FPU_FPDSCR_RMode_Pos) /*!< FPDSCR: RMode bit Mask */
  1415. /* Media and FP Feature Register 0 Definitions */
  1416. #define FPU_MVFR0_FP_rounding_modes_Pos 28U /*!< MVFR0: FP rounding modes bits Position */
  1417. #define FPU_MVFR0_FP_rounding_modes_Msk (0xFUL << FPU_MVFR0_FP_rounding_modes_Pos) /*!< MVFR0: FP rounding modes bits Mask */
  1418. #define FPU_MVFR0_Short_vectors_Pos 24U /*!< MVFR0: Short vectors bits Position */
  1419. #define FPU_MVFR0_Short_vectors_Msk (0xFUL << FPU_MVFR0_Short_vectors_Pos) /*!< MVFR0: Short vectors bits Mask */
  1420. #define FPU_MVFR0_Square_root_Pos 20U /*!< MVFR0: Square root bits Position */
  1421. #define FPU_MVFR0_Square_root_Msk (0xFUL << FPU_MVFR0_Square_root_Pos) /*!< MVFR0: Square root bits Mask */
  1422. #define FPU_MVFR0_Divide_Pos 16U /*!< MVFR0: Divide bits Position */
  1423. #define FPU_MVFR0_Divide_Msk (0xFUL << FPU_MVFR0_Divide_Pos) /*!< MVFR0: Divide bits Mask */
  1424. #define FPU_MVFR0_FP_excep_trapping_Pos 12U /*!< MVFR0: FP exception trapping bits Position */
  1425. #define FPU_MVFR0_FP_excep_trapping_Msk (0xFUL << FPU_MVFR0_FP_excep_trapping_Pos) /*!< MVFR0: FP exception trapping bits Mask */
  1426. #define FPU_MVFR0_Double_precision_Pos 8U /*!< MVFR0: Double-precision bits Position */
  1427. #define FPU_MVFR0_Double_precision_Msk (0xFUL << FPU_MVFR0_Double_precision_Pos) /*!< MVFR0: Double-precision bits Mask */
  1428. #define FPU_MVFR0_Single_precision_Pos 4U /*!< MVFR0: Single-precision bits Position */
  1429. #define FPU_MVFR0_Single_precision_Msk (0xFUL << FPU_MVFR0_Single_precision_Pos) /*!< MVFR0: Single-precision bits Mask */
  1430. #define FPU_MVFR0_A_SIMD_registers_Pos 0U /*!< MVFR0: A_SIMD registers bits Position */
  1431. #define FPU_MVFR0_A_SIMD_registers_Msk (0xFUL /*<< FPU_MVFR0_A_SIMD_registers_Pos*/) /*!< MVFR0: A_SIMD registers bits Mask */
  1432. /* Media and FP Feature Register 1 Definitions */
  1433. #define FPU_MVFR1_FP_fused_MAC_Pos 28U /*!< MVFR1: FP fused MAC bits Position */
  1434. #define FPU_MVFR1_FP_fused_MAC_Msk (0xFUL << FPU_MVFR1_FP_fused_MAC_Pos) /*!< MVFR1: FP fused MAC bits Mask */
  1435. #define FPU_MVFR1_FP_HPFP_Pos 24U /*!< MVFR1: FP HPFP bits Position */
  1436. #define FPU_MVFR1_FP_HPFP_Msk (0xFUL << FPU_MVFR1_FP_HPFP_Pos) /*!< MVFR1: FP HPFP bits Mask */
  1437. #define FPU_MVFR1_D_NaN_mode_Pos 4U /*!< MVFR1: D_NaN mode bits Position */
  1438. #define FPU_MVFR1_D_NaN_mode_Msk (0xFUL << FPU_MVFR1_D_NaN_mode_Pos) /*!< MVFR1: D_NaN mode bits Mask */
  1439. #define FPU_MVFR1_FtZ_mode_Pos 0U /*!< MVFR1: FtZ mode bits Position */
  1440. #define FPU_MVFR1_FtZ_mode_Msk (0xFUL /*<< FPU_MVFR1_FtZ_mode_Pos*/) /*!< MVFR1: FtZ mode bits Mask */
  1441. /*@} end of group CMSIS_FPU */
  1442. /**
  1443. \ingroup CMSIS_core_register
  1444. \defgroup CMSIS_CoreDebug Core Debug Registers (CoreDebug)
  1445. \brief Type definitions for the Core Debug Registers
  1446. @{
  1447. */
  1448. /**
  1449. \brief Structure type to access the Core Debug Register (CoreDebug).
  1450. */
  1451. typedef struct
  1452. {
  1453. __IOM uint32_t DHCSR; /*!< Offset: 0x000 (R/W) Debug Halting Control and Status Register */
  1454. __OM uint32_t DCRSR; /*!< Offset: 0x004 ( /W) Debug Core Register Selector Register */
  1455. __IOM uint32_t DCRDR; /*!< Offset: 0x008 (R/W) Debug Core Register Data Register */
  1456. __IOM uint32_t DEMCR; /*!< Offset: 0x00C (R/W) Debug Exception and Monitor Control Register */
  1457. uint32_t RESERVED4[1U];
  1458. __IOM uint32_t DAUTHCTRL; /*!< Offset: 0x014 (R/W) Debug Authentication Control Register */
  1459. __IOM uint32_t DSCSR; /*!< Offset: 0x018 (R/W) Debug Security Control and Status Register */
  1460. } CoreDebug_Type;
  1461. /* Debug Halting Control and Status Register Definitions */
  1462. #define CoreDebug_DHCSR_DBGKEY_Pos 16U /*!< CoreDebug DHCSR: DBGKEY Position */
  1463. #define CoreDebug_DHCSR_DBGKEY_Msk (0xFFFFUL << CoreDebug_DHCSR_DBGKEY_Pos) /*!< CoreDebug DHCSR: DBGKEY Mask */
  1464. #define CoreDebug_DHCSR_S_RESTART_ST_Pos 26U /*!< CoreDebug DHCSR: S_RESTART_ST Position */
  1465. #define CoreDebug_DHCSR_S_RESTART_ST_Msk (1UL << CoreDebug_DHCSR_S_RESTART_ST_Pos) /*!< CoreDebug DHCSR: S_RESTART_ST Mask */
  1466. #define CoreDebug_DHCSR_S_RESET_ST_Pos 25U /*!< CoreDebug DHCSR: S_RESET_ST Position */
  1467. #define CoreDebug_DHCSR_S_RESET_ST_Msk (1UL << CoreDebug_DHCSR_S_RESET_ST_Pos) /*!< CoreDebug DHCSR: S_RESET_ST Mask */
  1468. #define CoreDebug_DHCSR_S_RETIRE_ST_Pos 24U /*!< CoreDebug DHCSR: S_RETIRE_ST Position */
  1469. #define CoreDebug_DHCSR_S_RETIRE_ST_Msk (1UL << CoreDebug_DHCSR_S_RETIRE_ST_Pos) /*!< CoreDebug DHCSR: S_RETIRE_ST Mask */
  1470. #define CoreDebug_DHCSR_S_LOCKUP_Pos 19U /*!< CoreDebug DHCSR: S_LOCKUP Position */
  1471. #define CoreDebug_DHCSR_S_LOCKUP_Msk (1UL << CoreDebug_DHCSR_S_LOCKUP_Pos) /*!< CoreDebug DHCSR: S_LOCKUP Mask */
  1472. #define CoreDebug_DHCSR_S_SLEEP_Pos 18U /*!< CoreDebug DHCSR: S_SLEEP Position */
  1473. #define CoreDebug_DHCSR_S_SLEEP_Msk (1UL << CoreDebug_DHCSR_S_SLEEP_Pos) /*!< CoreDebug DHCSR: S_SLEEP Mask */
  1474. #define CoreDebug_DHCSR_S_HALT_Pos 17U /*!< CoreDebug DHCSR: S_HALT Position */
  1475. #define CoreDebug_DHCSR_S_HALT_Msk (1UL << CoreDebug_DHCSR_S_HALT_Pos) /*!< CoreDebug DHCSR: S_HALT Mask */
  1476. #define CoreDebug_DHCSR_S_REGRDY_Pos 16U /*!< CoreDebug DHCSR: S_REGRDY Position */
  1477. #define CoreDebug_DHCSR_S_REGRDY_Msk (1UL << CoreDebug_DHCSR_S_REGRDY_Pos) /*!< CoreDebug DHCSR: S_REGRDY Mask */
  1478. #define CoreDebug_DHCSR_C_SNAPSTALL_Pos 5U /*!< CoreDebug DHCSR: C_SNAPSTALL Position */
  1479. #define CoreDebug_DHCSR_C_SNAPSTALL_Msk (1UL << CoreDebug_DHCSR_C_SNAPSTALL_Pos) /*!< CoreDebug DHCSR: C_SNAPSTALL Mask */
  1480. #define CoreDebug_DHCSR_C_MASKINTS_Pos 3U /*!< CoreDebug DHCSR: C_MASKINTS Position */
  1481. #define CoreDebug_DHCSR_C_MASKINTS_Msk (1UL << CoreDebug_DHCSR_C_MASKINTS_Pos) /*!< CoreDebug DHCSR: C_MASKINTS Mask */
  1482. #define CoreDebug_DHCSR_C_STEP_Pos 2U /*!< CoreDebug DHCSR: C_STEP Position */
  1483. #define CoreDebug_DHCSR_C_STEP_Msk (1UL << CoreDebug_DHCSR_C_STEP_Pos) /*!< CoreDebug DHCSR: C_STEP Mask */
  1484. #define CoreDebug_DHCSR_C_HALT_Pos 1U /*!< CoreDebug DHCSR: C_HALT Position */
  1485. #define CoreDebug_DHCSR_C_HALT_Msk (1UL << CoreDebug_DHCSR_C_HALT_Pos) /*!< CoreDebug DHCSR: C_HALT Mask */
  1486. #define CoreDebug_DHCSR_C_DEBUGEN_Pos 0U /*!< CoreDebug DHCSR: C_DEBUGEN Position */
  1487. #define CoreDebug_DHCSR_C_DEBUGEN_Msk (1UL /*<< CoreDebug_DHCSR_C_DEBUGEN_Pos*/) /*!< CoreDebug DHCSR: C_DEBUGEN Mask */
  1488. /* Debug Core Register Selector Register Definitions */
  1489. #define CoreDebug_DCRSR_REGWnR_Pos 16U /*!< CoreDebug DCRSR: REGWnR Position */
  1490. #define CoreDebug_DCRSR_REGWnR_Msk (1UL << CoreDebug_DCRSR_REGWnR_Pos) /*!< CoreDebug DCRSR: REGWnR Mask */
  1491. #define CoreDebug_DCRSR_REGSEL_Pos 0U /*!< CoreDebug DCRSR: REGSEL Position */
  1492. #define CoreDebug_DCRSR_REGSEL_Msk (0x1FUL /*<< CoreDebug_DCRSR_REGSEL_Pos*/) /*!< CoreDebug DCRSR: REGSEL Mask */
  1493. /* Debug Exception and Monitor Control Register Definitions */
  1494. #define CoreDebug_DEMCR_TRCENA_Pos 24U /*!< CoreDebug DEMCR: TRCENA Position */
  1495. #define CoreDebug_DEMCR_TRCENA_Msk (1UL << CoreDebug_DEMCR_TRCENA_Pos) /*!< CoreDebug DEMCR: TRCENA Mask */
  1496. #define CoreDebug_DEMCR_MON_REQ_Pos 19U /*!< CoreDebug DEMCR: MON_REQ Position */
  1497. #define CoreDebug_DEMCR_MON_REQ_Msk (1UL << CoreDebug_DEMCR_MON_REQ_Pos) /*!< CoreDebug DEMCR: MON_REQ Mask */
  1498. #define CoreDebug_DEMCR_MON_STEP_Pos 18U /*!< CoreDebug DEMCR: MON_STEP Position */
  1499. #define CoreDebug_DEMCR_MON_STEP_Msk (1UL << CoreDebug_DEMCR_MON_STEP_Pos) /*!< CoreDebug DEMCR: MON_STEP Mask */
  1500. #define CoreDebug_DEMCR_MON_PEND_Pos 17U /*!< CoreDebug DEMCR: MON_PEND Position */
  1501. #define CoreDebug_DEMCR_MON_PEND_Msk (1UL << CoreDebug_DEMCR_MON_PEND_Pos) /*!< CoreDebug DEMCR: MON_PEND Mask */
  1502. #define CoreDebug_DEMCR_MON_EN_Pos 16U /*!< CoreDebug DEMCR: MON_EN Position */
  1503. #define CoreDebug_DEMCR_MON_EN_Msk (1UL << CoreDebug_DEMCR_MON_EN_Pos) /*!< CoreDebug DEMCR: MON_EN Mask */
  1504. #define CoreDebug_DEMCR_VC_HARDERR_Pos 10U /*!< CoreDebug DEMCR: VC_HARDERR Position */
  1505. #define CoreDebug_DEMCR_VC_HARDERR_Msk (1UL << CoreDebug_DEMCR_VC_HARDERR_Pos) /*!< CoreDebug DEMCR: VC_HARDERR Mask */
  1506. #define CoreDebug_DEMCR_VC_INTERR_Pos 9U /*!< CoreDebug DEMCR: VC_INTERR Position */
  1507. #define CoreDebug_DEMCR_VC_INTERR_Msk (1UL << CoreDebug_DEMCR_VC_INTERR_Pos) /*!< CoreDebug DEMCR: VC_INTERR Mask */
  1508. #define CoreDebug_DEMCR_VC_BUSERR_Pos 8U /*!< CoreDebug DEMCR: VC_BUSERR Position */
  1509. #define CoreDebug_DEMCR_VC_BUSERR_Msk (1UL << CoreDebug_DEMCR_VC_BUSERR_Pos) /*!< CoreDebug DEMCR: VC_BUSERR Mask */
  1510. #define CoreDebug_DEMCR_VC_STATERR_Pos 7U /*!< CoreDebug DEMCR: VC_STATERR Position */
  1511. #define CoreDebug_DEMCR_VC_STATERR_Msk (1UL << CoreDebug_DEMCR_VC_STATERR_Pos) /*!< CoreDebug DEMCR: VC_STATERR Mask */
  1512. #define CoreDebug_DEMCR_VC_CHKERR_Pos 6U /*!< CoreDebug DEMCR: VC_CHKERR Position */
  1513. #define CoreDebug_DEMCR_VC_CHKERR_Msk (1UL << CoreDebug_DEMCR_VC_CHKERR_Pos) /*!< CoreDebug DEMCR: VC_CHKERR Mask */
  1514. #define CoreDebug_DEMCR_VC_NOCPERR_Pos 5U /*!< CoreDebug DEMCR: VC_NOCPERR Position */
  1515. #define CoreDebug_DEMCR_VC_NOCPERR_Msk (1UL << CoreDebug_DEMCR_VC_NOCPERR_Pos) /*!< CoreDebug DEMCR: VC_NOCPERR Mask */
  1516. #define CoreDebug_DEMCR_VC_MMERR_Pos 4U /*!< CoreDebug DEMCR: VC_MMERR Position */
  1517. #define CoreDebug_DEMCR_VC_MMERR_Msk (1UL << CoreDebug_DEMCR_VC_MMERR_Pos) /*!< CoreDebug DEMCR: VC_MMERR Mask */
  1518. #define CoreDebug_DEMCR_VC_CORERESET_Pos 0U /*!< CoreDebug DEMCR: VC_CORERESET Position */
  1519. #define CoreDebug_DEMCR_VC_CORERESET_Msk (1UL /*<< CoreDebug_DEMCR_VC_CORERESET_Pos*/) /*!< CoreDebug DEMCR: VC_CORERESET Mask */
  1520. /* Debug Authentication Control Register Definitions */
  1521. #define CoreDebug_DAUTHCTRL_INTSPNIDEN_Pos 3U /*!< CoreDebug DAUTHCTRL: INTSPNIDEN, Position */
  1522. #define CoreDebug_DAUTHCTRL_INTSPNIDEN_Msk (1UL << CoreDebug_DAUTHCTRL_INTSPNIDEN_Pos) /*!< CoreDebug DAUTHCTRL: INTSPNIDEN, Mask */
  1523. #define CoreDebug_DAUTHCTRL_SPNIDENSEL_Pos 2U /*!< CoreDebug DAUTHCTRL: SPNIDENSEL Position */
  1524. #define CoreDebug_DAUTHCTRL_SPNIDENSEL_Msk (1UL << CoreDebug_DAUTHCTRL_SPNIDENSEL_Pos) /*!< CoreDebug DAUTHCTRL: SPNIDENSEL Mask */
  1525. #define CoreDebug_DAUTHCTRL_INTSPIDEN_Pos 1U /*!< CoreDebug DAUTHCTRL: INTSPIDEN Position */
  1526. #define CoreDebug_DAUTHCTRL_INTSPIDEN_Msk (1UL << CoreDebug_DAUTHCTRL_INTSPIDEN_Pos) /*!< CoreDebug DAUTHCTRL: INTSPIDEN Mask */
  1527. #define CoreDebug_DAUTHCTRL_SPIDENSEL_Pos 0U /*!< CoreDebug DAUTHCTRL: SPIDENSEL Position */
  1528. #define CoreDebug_DAUTHCTRL_SPIDENSEL_Msk (1UL /*<< CoreDebug_DAUTHCTRL_SPIDENSEL_Pos*/) /*!< CoreDebug DAUTHCTRL: SPIDENSEL Mask */
  1529. /* Debug Security Control and Status Register Definitions */
  1530. #define CoreDebug_DSCSR_CDS_Pos 16U /*!< CoreDebug DSCSR: CDS Position */
  1531. #define CoreDebug_DSCSR_CDS_Msk (1UL << CoreDebug_DSCSR_CDS_Pos) /*!< CoreDebug DSCSR: CDS Mask */
  1532. #define CoreDebug_DSCSR_SBRSEL_Pos 1U /*!< CoreDebug DSCSR: SBRSEL Position */
  1533. #define CoreDebug_DSCSR_SBRSEL_Msk (1UL << CoreDebug_DSCSR_SBRSEL_Pos) /*!< CoreDebug DSCSR: SBRSEL Mask */
  1534. #define CoreDebug_DSCSR_SBRSELEN_Pos 0U /*!< CoreDebug DSCSR: SBRSELEN Position */
  1535. #define CoreDebug_DSCSR_SBRSELEN_Msk (1UL /*<< CoreDebug_DSCSR_SBRSELEN_Pos*/) /*!< CoreDebug DSCSR: SBRSELEN Mask */
  1536. /*@} end of group CMSIS_CoreDebug */
  1537. /**
  1538. \ingroup CMSIS_core_register
  1539. \defgroup CMSIS_core_bitfield Core register bit field macros
  1540. \brief Macros for use with bit field definitions (xxx_Pos, xxx_Msk).
  1541. @{
  1542. */
  1543. /**
  1544. \brief Mask and shift a bit field value for use in a register bit range.
  1545. \param[in] field Name of the register bit field.
  1546. \param[in] value Value of the bit field. This parameter is interpreted as an uint32_t type.
  1547. \return Masked and shifted value.
  1548. */
  1549. #define _VAL2FLD(field, value) (((uint32_t)(value) << field ## _Pos) & field ## _Msk)
  1550. /**
  1551. \brief Mask and shift a register value to extract a bit filed value.
  1552. \param[in] field Name of the register bit field.
  1553. \param[in] value Value of register. This parameter is interpreted as an uint32_t type.
  1554. \return Masked and shifted bit field value.
  1555. */
  1556. #define _FLD2VAL(field, value) (((uint32_t)(value) & field ## _Msk) >> field ## _Pos)
  1557. /*@} end of group CMSIS_core_bitfield */
  1558. /**
  1559. \ingroup CMSIS_core_register
  1560. \defgroup CMSIS_core_base Core Definitions
  1561. \brief Definitions for base addresses, unions, and structures.
  1562. @{
  1563. */
  1564. /* Memory mapping of Core Hardware */
  1565. #define SCS_BASE (0xE000E000UL) /*!< System Control Space Base Address */
  1566. #define ITM_BASE (0xE0000000UL) /*!< ITM Base Address */
  1567. #define DWT_BASE (0xE0001000UL) /*!< DWT Base Address */
  1568. #define TPI_BASE (0xE0040000UL) /*!< TPI Base Address */
  1569. #define CoreDebug_BASE (0xE000EDF0UL) /*!< Core Debug Base Address */
  1570. #define SysTick_BASE (SCS_BASE + 0x0010UL) /*!< SysTick Base Address */
  1571. #define NVIC_BASE (SCS_BASE + 0x0100UL) /*!< NVIC Base Address */
  1572. #define SCB_BASE (SCS_BASE + 0x0D00UL) /*!< System Control Block Base Address */
  1573. #define SCnSCB ((SCnSCB_Type *) SCS_BASE ) /*!< System control Register not in SCB */
  1574. #define SCB ((SCB_Type *) SCB_BASE ) /*!< SCB configuration struct */
  1575. #define SysTick ((SysTick_Type *) SysTick_BASE ) /*!< SysTick configuration struct */
  1576. #define NVIC ((NVIC_Type *) NVIC_BASE ) /*!< NVIC configuration struct */
  1577. #define ITM ((ITM_Type *) ITM_BASE ) /*!< ITM configuration struct */
  1578. #define DWT ((DWT_Type *) DWT_BASE ) /*!< DWT configuration struct */
  1579. #define TPI ((TPI_Type *) TPI_BASE ) /*!< TPI configuration struct */
  1580. #define CoreDebug ((CoreDebug_Type *) CoreDebug_BASE ) /*!< Core Debug configuration struct */
  1581. #if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U)
  1582. #define MPU_BASE (SCS_BASE + 0x0D90UL) /*!< Memory Protection Unit */
  1583. #define MPU ((MPU_Type *) MPU_BASE ) /*!< Memory Protection Unit */
  1584. #endif
  1585. #if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
  1586. #define SAU_BASE (SCS_BASE + 0x0DD0UL) /*!< Security Attribution Unit */
  1587. #define SAU ((SAU_Type *) SAU_BASE ) /*!< Security Attribution Unit */
  1588. #endif
  1589. #define FPU_BASE (SCS_BASE + 0x0F30UL) /*!< Floating Point Unit */
  1590. #define FPU ((FPU_Type *) FPU_BASE ) /*!< Floating Point Unit */
  1591. #if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
  1592. #define SCS_BASE_NS (0xE002E000UL) /*!< System Control Space Base Address (non-secure address space) */
  1593. #define CoreDebug_BASE_NS (0xE002EDF0UL) /*!< Core Debug Base Address (non-secure address space) */
  1594. #define SysTick_BASE_NS (SCS_BASE_NS + 0x0010UL) /*!< SysTick Base Address (non-secure address space) */
  1595. #define NVIC_BASE_NS (SCS_BASE_NS + 0x0100UL) /*!< NVIC Base Address (non-secure address space) */
  1596. #define SCB_BASE_NS (SCS_BASE_NS + 0x0D00UL) /*!< System Control Block Base Address (non-secure address space) */
  1597. #define SCnSCB_NS ((SCnSCB_Type *) SCS_BASE_NS ) /*!< System control Register not in SCB(non-secure address space) */
  1598. #define SCB_NS ((SCB_Type *) SCB_BASE_NS ) /*!< SCB configuration struct (non-secure address space) */
  1599. #define SysTick_NS ((SysTick_Type *) SysTick_BASE_NS ) /*!< SysTick configuration struct (non-secure address space) */
  1600. #define NVIC_NS ((NVIC_Type *) NVIC_BASE_NS ) /*!< NVIC configuration struct (non-secure address space) */
  1601. #define CoreDebug_NS ((CoreDebug_Type *) CoreDebug_BASE_NS) /*!< Core Debug configuration struct (non-secure address space) */
  1602. #if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U)
  1603. #define MPU_BASE_NS (SCS_BASE_NS + 0x0D90UL) /*!< Memory Protection Unit (non-secure address space) */
  1604. #define MPU_NS ((MPU_Type *) MPU_BASE_NS ) /*!< Memory Protection Unit (non-secure address space) */
  1605. #endif
  1606. #define FPU_BASE_NS (SCS_BASE_NS + 0x0F30UL) /*!< Floating Point Unit (non-secure address space) */
  1607. #define FPU_NS ((FPU_Type *) FPU_BASE_NS ) /*!< Floating Point Unit (non-secure address space) */
  1608. #endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */
  1609. /*@} */
  1610. /*******************************************************************************
  1611. * Hardware Abstraction Layer
  1612. Core Function Interface contains:
  1613. - Core NVIC Functions
  1614. - Core SysTick Functions
  1615. - Core Debug Functions
  1616. - Core Register Access Functions
  1617. ******************************************************************************/
  1618. /**
  1619. \defgroup CMSIS_Core_FunctionInterface Functions and Instructions Reference
  1620. */
  1621. /* ########################## NVIC functions #################################### */
  1622. /**
  1623. \ingroup CMSIS_Core_FunctionInterface
  1624. \defgroup CMSIS_Core_NVICFunctions NVIC Functions
  1625. \brief Functions that manage interrupts and exceptions via the NVIC.
  1626. @{
  1627. */
  1628. #ifdef CMSIS_NVIC_VIRTUAL
  1629. #ifndef CMSIS_NVIC_VIRTUAL_HEADER_FILE
  1630. #define CMSIS_NVIC_VIRTUAL_HEADER_FILE "cmsis_nvic_virtual.h"
  1631. #endif
  1632. #include CMSIS_NVIC_VIRTUAL_HEADER_FILE
  1633. #else
  1634. #define NVIC_SetPriorityGrouping __NVIC_SetPriorityGrouping
  1635. #define NVIC_GetPriorityGrouping __NVIC_GetPriorityGrouping
  1636. #define NVIC_EnableIRQ __NVIC_EnableIRQ
  1637. #define NVIC_GetEnableIRQ __NVIC_GetEnableIRQ
  1638. #define NVIC_DisableIRQ __NVIC_DisableIRQ
  1639. #define NVIC_GetPendingIRQ __NVIC_GetPendingIRQ
  1640. #define NVIC_SetPendingIRQ __NVIC_SetPendingIRQ
  1641. #define NVIC_ClearPendingIRQ __NVIC_ClearPendingIRQ
  1642. #define NVIC_GetActive __NVIC_GetActive
  1643. #define NVIC_SetPriority __NVIC_SetPriority
  1644. #define NVIC_GetPriority __NVIC_GetPriority
  1645. #define NVIC_SystemReset __NVIC_SystemReset
  1646. #endif /* CMSIS_NVIC_VIRTUAL */
  1647. #ifdef CMSIS_VECTAB_VIRTUAL
  1648. #ifndef CMSIS_VECTAB_VIRTUAL_HEADER_FILE
  1649. #define CMSIS_VECTAB_VIRTUAL_HEADER_FILE "cmsis_vectab_virtual.h"
  1650. #endif
  1651. #include CMSIS_VECTAB_VIRTUAL_HEADER_FILE
  1652. #else
  1653. #define NVIC_SetVector __NVIC_SetVector
  1654. #define NVIC_GetVector __NVIC_GetVector
  1655. #endif /* (CMSIS_VECTAB_VIRTUAL) */
  1656. #define NVIC_USER_IRQ_OFFSET 16
  1657. /**
  1658. \brief Set Priority Grouping
  1659. \details Sets the priority grouping field using the required unlock sequence.
  1660. The parameter PriorityGroup is assigned to the field SCB->AIRCR [10:8] PRIGROUP field.
  1661. Only values from 0..7 are used.
  1662. In case of a conflict between priority grouping and available
  1663. priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set.
  1664. \param [in] PriorityGroup Priority grouping field.
  1665. */
  1666. __STATIC_INLINE void __NVIC_SetPriorityGrouping(uint32_t PriorityGroup)
  1667. {
  1668. uint32_t reg_value;
  1669. uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */
  1670. reg_value = SCB->AIRCR; /* read old register configuration */
  1671. reg_value &= ~((uint32_t)(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk)); /* clear bits to change */
  1672. reg_value = (reg_value |
  1673. ((uint32_t)0x5FAUL << SCB_AIRCR_VECTKEY_Pos) |
  1674. (PriorityGroupTmp << 8U) ); /* Insert write key and priorty group */
  1675. SCB->AIRCR = reg_value;
  1676. }
  1677. /**
  1678. \brief Get Priority Grouping
  1679. \details Reads the priority grouping field from the NVIC Interrupt Controller.
  1680. \return Priority grouping field (SCB->AIRCR [10:8] PRIGROUP field).
  1681. */
  1682. __STATIC_INLINE uint32_t __NVIC_GetPriorityGrouping(void)
  1683. {
  1684. return ((uint32_t)((SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) >> SCB_AIRCR_PRIGROUP_Pos));
  1685. }
  1686. /**
  1687. \brief Enable Interrupt
  1688. \details Enables a device specific interrupt in the NVIC interrupt controller.
  1689. \param [in] IRQn Device specific interrupt number.
  1690. \note IRQn must not be negative.
  1691. */
  1692. __STATIC_INLINE void __NVIC_EnableIRQ(IRQn_Type IRQn)
  1693. {
  1694. if ((int32_t)(IRQn) >= 0)
  1695. {
  1696. NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
  1697. }
  1698. }
  1699. /**
  1700. \brief Get Interrupt Enable status
  1701. \details Returns a device specific interrupt enable status from the NVIC interrupt controller.
  1702. \param [in] IRQn Device specific interrupt number.
  1703. \return 0 Interrupt is not enabled.
  1704. \return 1 Interrupt is enabled.
  1705. \note IRQn must not be negative.
  1706. */
  1707. __STATIC_INLINE uint32_t __NVIC_GetEnableIRQ(IRQn_Type IRQn)
  1708. {
  1709. if ((int32_t)(IRQn) >= 0)
  1710. {
  1711. return((uint32_t)(((NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
  1712. }
  1713. else
  1714. {
  1715. return(0U);
  1716. }
  1717. }
  1718. /**
  1719. \brief Disable Interrupt
  1720. \details Disables a device specific interrupt in the NVIC interrupt controller.
  1721. \param [in] IRQn Device specific interrupt number.
  1722. \note IRQn must not be negative.
  1723. */
  1724. __STATIC_INLINE void __NVIC_DisableIRQ(IRQn_Type IRQn)
  1725. {
  1726. if ((int32_t)(IRQn) >= 0)
  1727. {
  1728. NVIC->ICER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
  1729. __DSB();
  1730. __ISB();
  1731. }
  1732. }
  1733. /**
  1734. \brief Get Pending Interrupt
  1735. \details Reads the NVIC pending register and returns the pending bit for the specified device specific interrupt.
  1736. \param [in] IRQn Device specific interrupt number.
  1737. \return 0 Interrupt status is not pending.
  1738. \return 1 Interrupt status is pending.
  1739. \note IRQn must not be negative.
  1740. */
  1741. __STATIC_INLINE uint32_t __NVIC_GetPendingIRQ(IRQn_Type IRQn)
  1742. {
  1743. if ((int32_t)(IRQn) >= 0)
  1744. {
  1745. return((uint32_t)(((NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
  1746. }
  1747. else
  1748. {
  1749. return(0U);
  1750. }
  1751. }
  1752. /**
  1753. \brief Set Pending Interrupt
  1754. \details Sets the pending bit of a device specific interrupt in the NVIC pending register.
  1755. \param [in] IRQn Device specific interrupt number.
  1756. \note IRQn must not be negative.
  1757. */
  1758. __STATIC_INLINE void __NVIC_SetPendingIRQ(IRQn_Type IRQn)
  1759. {
  1760. if ((int32_t)(IRQn) >= 0)
  1761. {
  1762. NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
  1763. }
  1764. }
  1765. /**
  1766. \brief Clear Pending Interrupt
  1767. \details Clears the pending bit of a device specific interrupt in the NVIC pending register.
  1768. \param [in] IRQn Device specific interrupt number.
  1769. \note IRQn must not be negative.
  1770. */
  1771. __STATIC_INLINE void __NVIC_ClearPendingIRQ(IRQn_Type IRQn)
  1772. {
  1773. if ((int32_t)(IRQn) >= 0)
  1774. {
  1775. NVIC->ICPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
  1776. }
  1777. }
  1778. /**
  1779. \brief Get Active Interrupt
  1780. \details Reads the active register in the NVIC and returns the active bit for the device specific interrupt.
  1781. \param [in] IRQn Device specific interrupt number.
  1782. \return 0 Interrupt status is not active.
  1783. \return 1 Interrupt status is active.
  1784. \note IRQn must not be negative.
  1785. */
  1786. __STATIC_INLINE uint32_t __NVIC_GetActive(IRQn_Type IRQn)
  1787. {
  1788. if ((int32_t)(IRQn) >= 0)
  1789. {
  1790. return((uint32_t)(((NVIC->IABR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
  1791. }
  1792. else
  1793. {
  1794. return(0U);
  1795. }
  1796. }
  1797. #if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
  1798. /**
  1799. \brief Get Interrupt Target State
  1800. \details Reads the interrupt target field in the NVIC and returns the interrupt target bit for the device specific interrupt.
  1801. \param [in] IRQn Device specific interrupt number.
  1802. \return 0 if interrupt is assigned to Secure
  1803. \return 1 if interrupt is assigned to Non Secure
  1804. \note IRQn must not be negative.
  1805. */
  1806. __STATIC_INLINE uint32_t NVIC_GetTargetState(IRQn_Type IRQn)
  1807. {
  1808. if ((int32_t)(IRQn) >= 0)
  1809. {
  1810. return((uint32_t)(((NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
  1811. }
  1812. else
  1813. {
  1814. return(0U);
  1815. }
  1816. }
  1817. /**
  1818. \brief Set Interrupt Target State
  1819. \details Sets the interrupt target field in the NVIC and returns the interrupt target bit for the device specific interrupt.
  1820. \param [in] IRQn Device specific interrupt number.
  1821. \return 0 if interrupt is assigned to Secure
  1822. 1 if interrupt is assigned to Non Secure
  1823. \note IRQn must not be negative.
  1824. */
  1825. __STATIC_INLINE uint32_t NVIC_SetTargetState(IRQn_Type IRQn)
  1826. {
  1827. if ((int32_t)(IRQn) >= 0)
  1828. {
  1829. NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] |= ((uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)));
  1830. return((uint32_t)(((NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
  1831. }
  1832. else
  1833. {
  1834. return(0U);
  1835. }
  1836. }
  1837. /**
  1838. \brief Clear Interrupt Target State
  1839. \details Clears the interrupt target field in the NVIC and returns the interrupt target bit for the device specific interrupt.
  1840. \param [in] IRQn Device specific interrupt number.
  1841. \return 0 if interrupt is assigned to Secure
  1842. 1 if interrupt is assigned to Non Secure
  1843. \note IRQn must not be negative.
  1844. */
  1845. __STATIC_INLINE uint32_t NVIC_ClearTargetState(IRQn_Type IRQn)
  1846. {
  1847. if ((int32_t)(IRQn) >= 0)
  1848. {
  1849. NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] &= ~((uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)));
  1850. return((uint32_t)(((NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
  1851. }
  1852. else
  1853. {
  1854. return(0U);
  1855. }
  1856. }
  1857. #endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */
  1858. /**
  1859. \brief Set Interrupt Priority
  1860. \details Sets the priority of a device specific interrupt or a processor exception.
  1861. The interrupt number can be positive to specify a device specific interrupt,
  1862. or negative to specify a processor exception.
  1863. \param [in] IRQn Interrupt number.
  1864. \param [in] priority Priority to set.
  1865. \note The priority cannot be set for every processor exception.
  1866. */
  1867. __STATIC_INLINE void __NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority)
  1868. {
  1869. if ((int32_t)(IRQn) >= 0)
  1870. {
  1871. NVIC->IPR[((uint32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL);
  1872. }
  1873. else
  1874. {
  1875. SCB->SHPR[(((uint32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL);
  1876. }
  1877. }
  1878. /**
  1879. \brief Get Interrupt Priority
  1880. \details Reads the priority of a device specific interrupt or a processor exception.
  1881. The interrupt number can be positive to specify a device specific interrupt,
  1882. or negative to specify a processor exception.
  1883. \param [in] IRQn Interrupt number.
  1884. \return Interrupt Priority.
  1885. Value is aligned automatically to the implemented priority bits of the microcontroller.
  1886. */
  1887. __STATIC_INLINE uint32_t __NVIC_GetPriority(IRQn_Type IRQn)
  1888. {
  1889. if ((int32_t)(IRQn) >= 0)
  1890. {
  1891. return(((uint32_t)NVIC->IPR[((uint32_t)IRQn)] >> (8U - __NVIC_PRIO_BITS)));
  1892. }
  1893. else
  1894. {
  1895. return(((uint32_t)SCB->SHPR[(((uint32_t)IRQn) & 0xFUL)-4UL] >> (8U - __NVIC_PRIO_BITS)));
  1896. }
  1897. }
  1898. /**
  1899. \brief Encode Priority
  1900. \details Encodes the priority for an interrupt with the given priority group,
  1901. preemptive priority value, and subpriority value.
  1902. In case of a conflict between priority grouping and available
  1903. priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set.
  1904. \param [in] PriorityGroup Used priority group.
  1905. \param [in] PreemptPriority Preemptive priority value (starting from 0).
  1906. \param [in] SubPriority Subpriority value (starting from 0).
  1907. \return Encoded priority. Value can be used in the function \ref NVIC_SetPriority().
  1908. */
  1909. __STATIC_INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority)
  1910. {
  1911. uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */
  1912. uint32_t PreemptPriorityBits;
  1913. uint32_t SubPriorityBits;
  1914. PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp);
  1915. SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS));
  1916. return (
  1917. ((PreemptPriority & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL)) << SubPriorityBits) |
  1918. ((SubPriority & (uint32_t)((1UL << (SubPriorityBits )) - 1UL)))
  1919. );
  1920. }
  1921. /**
  1922. \brief Decode Priority
  1923. \details Decodes an interrupt priority value with a given priority group to
  1924. preemptive priority value and subpriority value.
  1925. In case of a conflict between priority grouping and available
  1926. priority bits (__NVIC_PRIO_BITS) the smallest possible priority group is set.
  1927. \param [in] Priority Priority value, which can be retrieved with the function \ref NVIC_GetPriority().
  1928. \param [in] PriorityGroup Used priority group.
  1929. \param [out] pPreemptPriority Preemptive priority value (starting from 0).
  1930. \param [out] pSubPriority Subpriority value (starting from 0).
  1931. */
  1932. __STATIC_INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* const pPreemptPriority, uint32_t* const pSubPriority)
  1933. {
  1934. uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */
  1935. uint32_t PreemptPriorityBits;
  1936. uint32_t SubPriorityBits;
  1937. PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp);
  1938. SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS));
  1939. *pPreemptPriority = (Priority >> SubPriorityBits) & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL);
  1940. *pSubPriority = (Priority ) & (uint32_t)((1UL << (SubPriorityBits )) - 1UL);
  1941. }
  1942. /**
  1943. \brief Set Interrupt Vector
  1944. \details Sets an interrupt vector in SRAM based interrupt vector table.
  1945. The interrupt number can be positive to specify a device specific interrupt,
  1946. or negative to specify a processor exception.
  1947. VTOR must been relocated to SRAM before.
  1948. \param [in] IRQn Interrupt number
  1949. \param [in] vector Address of interrupt handler function
  1950. */
  1951. __STATIC_INLINE void __NVIC_SetVector(IRQn_Type IRQn, uint32_t vector)
  1952. {
  1953. uint32_t *vectors = (uint32_t *)SCB->VTOR;
  1954. vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET] = vector;
  1955. __DSB();
  1956. }
  1957. /**
  1958. \brief Get Interrupt Vector
  1959. \details Reads an interrupt vector from interrupt vector table.
  1960. The interrupt number can be positive to specify a device specific interrupt,
  1961. or negative to specify a processor exception.
  1962. \param [in] IRQn Interrupt number.
  1963. \return Address of interrupt handler function
  1964. */
  1965. __STATIC_INLINE uint32_t __NVIC_GetVector(IRQn_Type IRQn)
  1966. {
  1967. uint32_t *vectors = (uint32_t *)SCB->VTOR;
  1968. return vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET];
  1969. }
  1970. /**
  1971. \brief System Reset
  1972. \details Initiates a system reset request to reset the MCU.
  1973. */
  1974. __NO_RETURN __STATIC_INLINE void __NVIC_SystemReset(void)
  1975. {
  1976. __DSB(); /* Ensure all outstanding memory accesses included
  1977. buffered write are completed before reset */
  1978. SCB->AIRCR = (uint32_t)((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) |
  1979. (SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) |
  1980. SCB_AIRCR_SYSRESETREQ_Msk ); /* Keep priority group unchanged */
  1981. __DSB(); /* Ensure completion of memory access */
  1982. for(;;) /* wait until reset */
  1983. {
  1984. __NOP();
  1985. }
  1986. }
  1987. #if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
  1988. /**
  1989. \brief Set Priority Grouping (non-secure)
  1990. \details Sets the non-secure priority grouping field when in secure state using the required unlock sequence.
  1991. The parameter PriorityGroup is assigned to the field SCB->AIRCR [10:8] PRIGROUP field.
  1992. Only values from 0..7 are used.
  1993. In case of a conflict between priority grouping and available
  1994. priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set.
  1995. \param [in] PriorityGroup Priority grouping field.
  1996. */
  1997. __STATIC_INLINE void TZ_NVIC_SetPriorityGrouping_NS(uint32_t PriorityGroup)
  1998. {
  1999. uint32_t reg_value;
  2000. uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */
  2001. reg_value = SCB_NS->AIRCR; /* read old register configuration */
  2002. reg_value &= ~((uint32_t)(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk)); /* clear bits to change */
  2003. reg_value = (reg_value |
  2004. ((uint32_t)0x5FAUL << SCB_AIRCR_VECTKEY_Pos) |
  2005. (PriorityGroupTmp << 8U) ); /* Insert write key and priorty group */
  2006. SCB_NS->AIRCR = reg_value;
  2007. }
  2008. /**
  2009. \brief Get Priority Grouping (non-secure)
  2010. \details Reads the priority grouping field from the non-secure NVIC when in secure state.
  2011. \return Priority grouping field (SCB->AIRCR [10:8] PRIGROUP field).
  2012. */
  2013. __STATIC_INLINE uint32_t TZ_NVIC_GetPriorityGrouping_NS(void)
  2014. {
  2015. return ((uint32_t)((SCB_NS->AIRCR & SCB_AIRCR_PRIGROUP_Msk) >> SCB_AIRCR_PRIGROUP_Pos));
  2016. }
  2017. /**
  2018. \brief Enable Interrupt (non-secure)
  2019. \details Enables a device specific interrupt in the non-secure NVIC interrupt controller when in secure state.
  2020. \param [in] IRQn Device specific interrupt number.
  2021. \note IRQn must not be negative.
  2022. */
  2023. __STATIC_INLINE void TZ_NVIC_EnableIRQ_NS(IRQn_Type IRQn)
  2024. {
  2025. if ((int32_t)(IRQn) >= 0)
  2026. {
  2027. NVIC_NS->ISER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
  2028. }
  2029. }
  2030. /**
  2031. \brief Get Interrupt Enable status (non-secure)
  2032. \details Returns a device specific interrupt enable status from the non-secure NVIC interrupt controller when in secure state.
  2033. \param [in] IRQn Device specific interrupt number.
  2034. \return 0 Interrupt is not enabled.
  2035. \return 1 Interrupt is enabled.
  2036. \note IRQn must not be negative.
  2037. */
  2038. __STATIC_INLINE uint32_t TZ_NVIC_GetEnableIRQ_NS(IRQn_Type IRQn)
  2039. {
  2040. if ((int32_t)(IRQn) >= 0)
  2041. {
  2042. return((uint32_t)(((NVIC_NS->ISER[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
  2043. }
  2044. else
  2045. {
  2046. return(0U);
  2047. }
  2048. }
  2049. /**
  2050. \brief Disable Interrupt (non-secure)
  2051. \details Disables a device specific interrupt in the non-secure NVIC interrupt controller when in secure state.
  2052. \param [in] IRQn Device specific interrupt number.
  2053. \note IRQn must not be negative.
  2054. */
  2055. __STATIC_INLINE void TZ_NVIC_DisableIRQ_NS(IRQn_Type IRQn)
  2056. {
  2057. if ((int32_t)(IRQn) >= 0)
  2058. {
  2059. NVIC_NS->ICER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
  2060. }
  2061. }
  2062. /**
  2063. \brief Get Pending Interrupt (non-secure)
  2064. \details Reads the NVIC pending register in the non-secure NVIC when in secure state and returns the pending bit for the specified device specific interrupt.
  2065. \param [in] IRQn Device specific interrupt number.
  2066. \return 0 Interrupt status is not pending.
  2067. \return 1 Interrupt status is pending.
  2068. \note IRQn must not be negative.
  2069. */
  2070. __STATIC_INLINE uint32_t TZ_NVIC_GetPendingIRQ_NS(IRQn_Type IRQn)
  2071. {
  2072. if ((int32_t)(IRQn) >= 0)
  2073. {
  2074. return((uint32_t)(((NVIC_NS->ISPR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
  2075. }
  2076. else
  2077. {
  2078. return(0U);
  2079. }
  2080. }
  2081. /**
  2082. \brief Set Pending Interrupt (non-secure)
  2083. \details Sets the pending bit of a device specific interrupt in the non-secure NVIC pending register when in secure state.
  2084. \param [in] IRQn Device specific interrupt number.
  2085. \note IRQn must not be negative.
  2086. */
  2087. __STATIC_INLINE void TZ_NVIC_SetPendingIRQ_NS(IRQn_Type IRQn)
  2088. {
  2089. if ((int32_t)(IRQn) >= 0)
  2090. {
  2091. NVIC_NS->ISPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
  2092. }
  2093. }
  2094. /**
  2095. \brief Clear Pending Interrupt (non-secure)
  2096. \details Clears the pending bit of a device specific interrupt in the non-secure NVIC pending register when in secure state.
  2097. \param [in] IRQn Device specific interrupt number.
  2098. \note IRQn must not be negative.
  2099. */
  2100. __STATIC_INLINE void TZ_NVIC_ClearPendingIRQ_NS(IRQn_Type IRQn)
  2101. {
  2102. if ((int32_t)(IRQn) >= 0)
  2103. {
  2104. NVIC_NS->ICPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
  2105. }
  2106. }
  2107. /**
  2108. \brief Get Active Interrupt (non-secure)
  2109. \details Reads the active register in non-secure NVIC when in secure state and returns the active bit for the device specific interrupt.
  2110. \param [in] IRQn Device specific interrupt number.
  2111. \return 0 Interrupt status is not active.
  2112. \return 1 Interrupt status is active.
  2113. \note IRQn must not be negative.
  2114. */
  2115. __STATIC_INLINE uint32_t TZ_NVIC_GetActive_NS(IRQn_Type IRQn)
  2116. {
  2117. if ((int32_t)(IRQn) >= 0)
  2118. {
  2119. return((uint32_t)(((NVIC_NS->IABR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
  2120. }
  2121. else
  2122. {
  2123. return(0U);
  2124. }
  2125. }
  2126. /**
  2127. \brief Set Interrupt Priority (non-secure)
  2128. \details Sets the priority of a non-secure device specific interrupt or a non-secure processor exception when in secure state.
  2129. The interrupt number can be positive to specify a device specific interrupt,
  2130. or negative to specify a processor exception.
  2131. \param [in] IRQn Interrupt number.
  2132. \param [in] priority Priority to set.
  2133. \note The priority cannot be set for every non-secure processor exception.
  2134. */
  2135. __STATIC_INLINE void TZ_NVIC_SetPriority_NS(IRQn_Type IRQn, uint32_t priority)
  2136. {
  2137. if ((int32_t)(IRQn) >= 0)
  2138. {
  2139. NVIC_NS->IPR[((uint32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL);
  2140. }
  2141. else
  2142. {
  2143. SCB_NS->SHPR[(((uint32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL);
  2144. }
  2145. }
  2146. /**
  2147. \brief Get Interrupt Priority (non-secure)
  2148. \details Reads the priority of a non-secure device specific interrupt or a non-secure processor exception when in secure state.
  2149. The interrupt number can be positive to specify a device specific interrupt,
  2150. or negative to specify a processor exception.
  2151. \param [in] IRQn Interrupt number.
  2152. \return Interrupt Priority. Value is aligned automatically to the implemented priority bits of the microcontroller.
  2153. */
  2154. __STATIC_INLINE uint32_t TZ_NVIC_GetPriority_NS(IRQn_Type IRQn)
  2155. {
  2156. if ((int32_t)(IRQn) >= 0)
  2157. {
  2158. return(((uint32_t)NVIC_NS->IPR[((uint32_t)IRQn)] >> (8U - __NVIC_PRIO_BITS)));
  2159. }
  2160. else
  2161. {
  2162. return(((uint32_t)SCB_NS->SHPR[(((uint32_t)IRQn) & 0xFUL)-4UL] >> (8U - __NVIC_PRIO_BITS)));
  2163. }
  2164. }
  2165. #endif /* defined (__ARM_FEATURE_CMSE) &&(__ARM_FEATURE_CMSE == 3U) */
  2166. /*@} end of CMSIS_Core_NVICFunctions */
  2167. /* ########################## MPU functions #################################### */
  2168. #if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U)
  2169. #include "mpu_armv8.h"
  2170. #endif
  2171. /* ########################## FPU functions #################################### */
  2172. /**
  2173. \ingroup CMSIS_Core_FunctionInterface
  2174. \defgroup CMSIS_Core_FpuFunctions FPU Functions
  2175. \brief Function that provides FPU type.
  2176. @{
  2177. */
  2178. /**
  2179. \brief get FPU type
  2180. \details returns the FPU type
  2181. \returns
  2182. - \b 0: No FPU
  2183. - \b 1: Single precision FPU
  2184. - \b 2: Double + Single precision FPU
  2185. */
  2186. __STATIC_INLINE uint32_t SCB_GetFPUType(void)
  2187. {
  2188. uint32_t mvfr0;
  2189. mvfr0 = FPU->MVFR0;
  2190. if ((mvfr0 & (FPU_MVFR0_Single_precision_Msk | FPU_MVFR0_Double_precision_Msk)) == 0x220U)
  2191. {
  2192. return 2U; /* Double + Single precision FPU */
  2193. }
  2194. else if ((mvfr0 & (FPU_MVFR0_Single_precision_Msk | FPU_MVFR0_Double_precision_Msk)) == 0x020U)
  2195. {
  2196. return 1U; /* Single precision FPU */
  2197. }
  2198. else
  2199. {
  2200. return 0U; /* No FPU */
  2201. }
  2202. }
  2203. /*@} end of CMSIS_Core_FpuFunctions */
  2204. /* ########################## SAU functions #################################### */
  2205. /**
  2206. \ingroup CMSIS_Core_FunctionInterface
  2207. \defgroup CMSIS_Core_SAUFunctions SAU Functions
  2208. \brief Functions that configure the SAU.
  2209. @{
  2210. */
  2211. #if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
  2212. /**
  2213. \brief Enable SAU
  2214. \details Enables the Security Attribution Unit (SAU).
  2215. */
  2216. __STATIC_INLINE void TZ_SAU_Enable(void)
  2217. {
  2218. SAU->CTRL |= (SAU_CTRL_ENABLE_Msk);
  2219. }
  2220. /**
  2221. \brief Disable SAU
  2222. \details Disables the Security Attribution Unit (SAU).
  2223. */
  2224. __STATIC_INLINE void TZ_SAU_Disable(void)
  2225. {
  2226. SAU->CTRL &= ~(SAU_CTRL_ENABLE_Msk);
  2227. }
  2228. #endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */
  2229. /*@} end of CMSIS_Core_SAUFunctions */
  2230. /* ################################## SysTick function ############################################ */
  2231. /**
  2232. \ingroup CMSIS_Core_FunctionInterface
  2233. \defgroup CMSIS_Core_SysTickFunctions SysTick Functions
  2234. \brief Functions that configure the System.
  2235. @{
  2236. */
  2237. #if defined (__Vendor_SysTickConfig) && (__Vendor_SysTickConfig == 0U)
  2238. /**
  2239. \brief System Tick Configuration
  2240. \details Initializes the System Timer and its interrupt, and starts the System Tick Timer.
  2241. Counter is in free running mode to generate periodic interrupts.
  2242. \param [in] ticks Number of ticks between two interrupts.
  2243. \return 0 Function succeeded.
  2244. \return 1 Function failed.
  2245. \note When the variable <b>__Vendor_SysTickConfig</b> is set to 1, then the
  2246. function <b>SysTick_Config</b> is not included. In this case, the file <b><i>device</i>.h</b>
  2247. must contain a vendor-specific implementation of this function.
  2248. */
  2249. __STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks)
  2250. {
  2251. if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk)
  2252. {
  2253. return (1UL); /* Reload value impossible */
  2254. }
  2255. SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */
  2256. NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */
  2257. SysTick->VAL = 0UL; /* Load the SysTick Counter Value */
  2258. SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
  2259. SysTick_CTRL_TICKINT_Msk |
  2260. SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */
  2261. return (0UL); /* Function successful */
  2262. }
  2263. #if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
  2264. /**
  2265. \brief System Tick Configuration (non-secure)
  2266. \details Initializes the non-secure System Timer and its interrupt when in secure state, and starts the System Tick Timer.
  2267. Counter is in free running mode to generate periodic interrupts.
  2268. \param [in] ticks Number of ticks between two interrupts.
  2269. \return 0 Function succeeded.
  2270. \return 1 Function failed.
  2271. \note When the variable <b>__Vendor_SysTickConfig</b> is set to 1, then the
  2272. function <b>TZ_SysTick_Config_NS</b> is not included. In this case, the file <b><i>device</i>.h</b>
  2273. must contain a vendor-specific implementation of this function.
  2274. */
  2275. __STATIC_INLINE uint32_t TZ_SysTick_Config_NS(uint32_t ticks)
  2276. {
  2277. if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk)
  2278. {
  2279. return (1UL); /* Reload value impossible */
  2280. }
  2281. SysTick_NS->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */
  2282. TZ_NVIC_SetPriority_NS (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */
  2283. SysTick_NS->VAL = 0UL; /* Load the SysTick Counter Value */
  2284. SysTick_NS->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
  2285. SysTick_CTRL_TICKINT_Msk |
  2286. SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */
  2287. return (0UL); /* Function successful */
  2288. }
  2289. #endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */
  2290. #endif
  2291. /*@} end of CMSIS_Core_SysTickFunctions */
  2292. /* ##################################### Debug In/Output function ########################################### */
  2293. /**
  2294. \ingroup CMSIS_Core_FunctionInterface
  2295. \defgroup CMSIS_core_DebugFunctions ITM Functions
  2296. \brief Functions that access the ITM debug interface.
  2297. @{
  2298. */
  2299. extern volatile int32_t ITM_RxBuffer; /*!< External variable to receive characters. */
  2300. #define ITM_RXBUFFER_EMPTY ((int32_t)0x5AA55AA5U) /*!< Value identifying \ref ITM_RxBuffer is ready for next character. */
  2301. /**
  2302. \brief ITM Send Character
  2303. \details Transmits a character via the ITM channel 0, and
  2304. \li Just returns when no debugger is connected that has booked the output.
  2305. \li Is blocking when a debugger is connected, but the previous character sent has not been transmitted.
  2306. \param [in] ch Character to transmit.
  2307. \returns Character to transmit.
  2308. */
  2309. __STATIC_INLINE uint32_t ITM_SendChar (uint32_t ch)
  2310. {
  2311. if (((ITM->TCR & ITM_TCR_ITMENA_Msk) != 0UL) && /* ITM enabled */
  2312. ((ITM->TER & 1UL ) != 0UL) ) /* ITM Port #0 enabled */
  2313. {
  2314. while (ITM->PORT[0U].u32 == 0UL)
  2315. {
  2316. __NOP();
  2317. }
  2318. ITM->PORT[0U].u8 = (uint8_t)ch;
  2319. }
  2320. return (ch);
  2321. }
  2322. /**
  2323. \brief ITM Receive Character
  2324. \details Inputs a character via the external variable \ref ITM_RxBuffer.
  2325. \return Received character.
  2326. \return -1 No character pending.
  2327. */
  2328. __STATIC_INLINE int32_t ITM_ReceiveChar (void)
  2329. {
  2330. int32_t ch = -1; /* no character available */
  2331. if (ITM_RxBuffer != ITM_RXBUFFER_EMPTY)
  2332. {
  2333. ch = ITM_RxBuffer;
  2334. ITM_RxBuffer = ITM_RXBUFFER_EMPTY; /* ready for next character */
  2335. }
  2336. return (ch);
  2337. }
  2338. /**
  2339. \brief ITM Check Character
  2340. \details Checks whether a character is pending for reading in the variable \ref ITM_RxBuffer.
  2341. \return 0 No character available.
  2342. \return 1 Character available.
  2343. */
  2344. __STATIC_INLINE int32_t ITM_CheckChar (void)
  2345. {
  2346. if (ITM_RxBuffer == ITM_RXBUFFER_EMPTY)
  2347. {
  2348. return (0); /* no character available */
  2349. }
  2350. else
  2351. {
  2352. return (1); /* character available */
  2353. }
  2354. }
  2355. /*@} end of CMSIS_core_DebugFunctions */
  2356. #ifdef __cplusplus
  2357. }
  2358. #endif
  2359. #endif /* __CORE_ARMV81MML_H_DEPENDANT */
  2360. #endif /* __CMSIS_GENERIC */