core_armv8mml.h 178 KB

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