File indexing completed on 2025-05-11 08:23:03
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025 #if defined ( __ICCARM__ )
0026 #pragma system_include
0027 #elif defined (__clang__)
0028 #pragma clang system_header
0029 #endif
0030
0031 #ifndef __CORE_CM7_H_GENERIC
0032 #define __CORE_CM7_H_GENERIC
0033
0034 #include <stdint.h>
0035
0036 #ifdef __cplusplus
0037 extern "C" {
0038 #endif
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060
0061
0062
0063 #include "cmsis_version.h"
0064
0065
0066 #define __CM7_CMSIS_VERSION_MAIN (__CM_CMSIS_VERSION_MAIN)
0067 #define __CM7_CMSIS_VERSION_SUB ( __CM_CMSIS_VERSION_SUB)
0068 #define __CM7_CMSIS_VERSION ((__CM7_CMSIS_VERSION_MAIN << 16U) | \
0069 __CM7_CMSIS_VERSION_SUB )
0070
0071 #define __CORTEX_M (7U)
0072
0073
0074
0075
0076 #if defined ( __CC_ARM )
0077 #if defined __TARGET_FPU_VFP
0078 #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)
0079 #define __FPU_USED 1U
0080 #else
0081 #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
0082 #define __FPU_USED 0U
0083 #endif
0084 #else
0085 #define __FPU_USED 0U
0086 #endif
0087
0088 #elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
0089 #if defined __ARM_FP
0090 #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)
0091 #define __FPU_USED 1U
0092 #else
0093 #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
0094 #define __FPU_USED 0U
0095 #endif
0096 #else
0097 #define __FPU_USED 0U
0098 #endif
0099
0100 #elif defined (__ti__)
0101 #if defined (__ARM_FP)
0102 #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)
0103 #define __FPU_USED 1U
0104 #else
0105 #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
0106 #define __FPU_USED 0U
0107 #endif
0108 #else
0109 #define __FPU_USED 0U
0110 #endif
0111
0112 #elif defined ( __GNUC__ )
0113 #if defined (__VFP_FP__) && !defined(__SOFTFP__)
0114 #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)
0115 #define __FPU_USED 1U
0116 #else
0117 #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
0118 #define __FPU_USED 0U
0119 #endif
0120 #else
0121 #define __FPU_USED 0U
0122 #endif
0123
0124 #elif defined ( __ICCARM__ )
0125 #if defined __ARMVFP__
0126 #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)
0127 #define __FPU_USED 1U
0128 #else
0129 #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
0130 #define __FPU_USED 0U
0131 #endif
0132 #else
0133 #define __FPU_USED 0U
0134 #endif
0135
0136 #elif defined ( __TI_ARM__ )
0137 #if defined __TI_VFP_SUPPORT__
0138 #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)
0139 #define __FPU_USED 1U
0140 #else
0141 #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
0142 #define __FPU_USED 0U
0143 #endif
0144 #else
0145 #define __FPU_USED 0U
0146 #endif
0147
0148 #elif defined ( __TASKING__ )
0149 #if defined __FPU_VFP__
0150 #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)
0151 #define __FPU_USED 1U
0152 #else
0153 #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
0154 #define __FPU_USED 0U
0155 #endif
0156 #else
0157 #define __FPU_USED 0U
0158 #endif
0159
0160 #elif defined ( __CSMC__ )
0161 #if ( __CSMC__ & 0x400U)
0162 #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)
0163 #define __FPU_USED 1U
0164 #else
0165 #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
0166 #define __FPU_USED 0U
0167 #endif
0168 #else
0169 #define __FPU_USED 0U
0170 #endif
0171
0172 #endif
0173
0174 #include "cmsis_compiler.h" /* CMSIS compiler specific defines */
0175
0176
0177 #ifdef __cplusplus
0178 }
0179 #endif
0180
0181 #endif
0182
0183 #ifndef __CMSIS_GENERIC
0184
0185 #ifndef __CORE_CM7_H_DEPENDANT
0186 #define __CORE_CM7_H_DEPENDANT
0187
0188 #ifdef __cplusplus
0189 extern "C" {
0190 #endif
0191
0192
0193 #if defined __CHECK_DEVICE_DEFINES
0194 #ifndef __CM7_REV
0195 #define __CM7_REV 0x0000U
0196 #warning "__CM7_REV not defined in device header file; using default!"
0197 #endif
0198
0199 #ifndef __FPU_PRESENT
0200 #define __FPU_PRESENT 0U
0201 #warning "__FPU_PRESENT not defined in device header file; using default!"
0202 #endif
0203
0204 #ifndef __MPU_PRESENT
0205 #define __MPU_PRESENT 0U
0206 #warning "__MPU_PRESENT not defined in device header file; using default!"
0207 #endif
0208
0209 #ifndef __ICACHE_PRESENT
0210 #define __ICACHE_PRESENT 0U
0211 #warning "__ICACHE_PRESENT not defined in device header file; using default!"
0212 #endif
0213
0214 #ifndef __DCACHE_PRESENT
0215 #define __DCACHE_PRESENT 0U
0216 #warning "__DCACHE_PRESENT not defined in device header file; using default!"
0217 #endif
0218
0219 #ifndef __DTCM_PRESENT
0220 #define __DTCM_PRESENT 0U
0221 #warning "__DTCM_PRESENT not defined in device header file; using default!"
0222 #endif
0223
0224 #ifndef __VTOR_PRESENT
0225 #define __VTOR_PRESENT 1U
0226 #warning "__VTOR_PRESENT not defined in device header file; using default!"
0227 #endif
0228
0229 #ifndef __NVIC_PRIO_BITS
0230 #define __NVIC_PRIO_BITS 3U
0231 #warning "__NVIC_PRIO_BITS not defined in device header file; using default!"
0232 #endif
0233
0234 #ifndef __Vendor_SysTickConfig
0235 #define __Vendor_SysTickConfig 0U
0236 #warning "__Vendor_SysTickConfig not defined in device header file; using default!"
0237 #endif
0238 #endif
0239
0240
0241
0242
0243
0244
0245
0246
0247
0248 #ifdef __cplusplus
0249 #define __I volatile
0250 #else
0251 #define __I volatile const
0252 #endif
0253 #define __O volatile
0254 #define __IO volatile
0255
0256
0257 #define __IM volatile const
0258 #define __OM volatile
0259 #define __IOM volatile
0260
0261
0262
0263
0264
0265
0266
0267
0268
0269
0270
0271
0272
0273
0274
0275
0276
0277
0278
0279
0280
0281
0282
0283
0284
0285
0286
0287
0288
0289
0290
0291 typedef union
0292 {
0293 struct
0294 {
0295 uint32_t _reserved0:16;
0296 uint32_t GE:4;
0297 uint32_t _reserved1:7;
0298 uint32_t Q:1;
0299 uint32_t V:1;
0300 uint32_t C:1;
0301 uint32_t Z:1;
0302 uint32_t N:1;
0303 } b;
0304 uint32_t w;
0305 } APSR_Type;
0306
0307
0308 #define APSR_N_Pos 31U
0309 #define APSR_N_Msk (1UL << APSR_N_Pos)
0310
0311 #define APSR_Z_Pos 30U
0312 #define APSR_Z_Msk (1UL << APSR_Z_Pos)
0313
0314 #define APSR_C_Pos 29U
0315 #define APSR_C_Msk (1UL << APSR_C_Pos)
0316
0317 #define APSR_V_Pos 28U
0318 #define APSR_V_Msk (1UL << APSR_V_Pos)
0319
0320 #define APSR_Q_Pos 27U
0321 #define APSR_Q_Msk (1UL << APSR_Q_Pos)
0322
0323 #define APSR_GE_Pos 16U
0324 #define APSR_GE_Msk (0xFUL << APSR_GE_Pos)
0325
0326
0327
0328
0329
0330 typedef union
0331 {
0332 struct
0333 {
0334 uint32_t ISR:9;
0335 uint32_t _reserved0:23;
0336 } b;
0337 uint32_t w;
0338 } IPSR_Type;
0339
0340
0341 #define IPSR_ISR_Pos 0U
0342 #define IPSR_ISR_Msk (0x1FFUL )
0343
0344
0345
0346
0347
0348 typedef union
0349 {
0350 struct
0351 {
0352 uint32_t ISR:9;
0353 uint32_t _reserved0:1;
0354 uint32_t ICI_IT_1:6;
0355 uint32_t GE:4;
0356 uint32_t _reserved1:4;
0357 uint32_t T:1;
0358 uint32_t ICI_IT_2:2;
0359 uint32_t Q:1;
0360 uint32_t V:1;
0361 uint32_t C:1;
0362 uint32_t Z:1;
0363 uint32_t N:1;
0364 } b;
0365 uint32_t w;
0366 } xPSR_Type;
0367
0368
0369 #define xPSR_N_Pos 31U
0370 #define xPSR_N_Msk (1UL << xPSR_N_Pos)
0371
0372 #define xPSR_Z_Pos 30U
0373 #define xPSR_Z_Msk (1UL << xPSR_Z_Pos)
0374
0375 #define xPSR_C_Pos 29U
0376 #define xPSR_C_Msk (1UL << xPSR_C_Pos)
0377
0378 #define xPSR_V_Pos 28U
0379 #define xPSR_V_Msk (1UL << xPSR_V_Pos)
0380
0381 #define xPSR_Q_Pos 27U
0382 #define xPSR_Q_Msk (1UL << xPSR_Q_Pos)
0383
0384 #define xPSR_ICI_IT_2_Pos 25U
0385 #define xPSR_ICI_IT_2_Msk (3UL << xPSR_ICI_IT_2_Pos)
0386
0387 #define xPSR_T_Pos 24U
0388 #define xPSR_T_Msk (1UL << xPSR_T_Pos)
0389
0390 #define xPSR_GE_Pos 16U
0391 #define xPSR_GE_Msk (0xFUL << xPSR_GE_Pos)
0392
0393 #define xPSR_ICI_IT_1_Pos 10U
0394 #define xPSR_ICI_IT_1_Msk (0x3FUL << xPSR_ICI_IT_1_Pos)
0395
0396 #define xPSR_ISR_Pos 0U
0397 #define xPSR_ISR_Msk (0x1FFUL )
0398
0399
0400
0401
0402
0403 typedef union
0404 {
0405 struct
0406 {
0407 uint32_t nPRIV:1;
0408 uint32_t SPSEL:1;
0409 uint32_t FPCA:1;
0410 uint32_t _reserved0:29;
0411 } b;
0412 uint32_t w;
0413 } CONTROL_Type;
0414
0415
0416 #define CONTROL_FPCA_Pos 2U
0417 #define CONTROL_FPCA_Msk (1UL << CONTROL_FPCA_Pos)
0418
0419 #define CONTROL_SPSEL_Pos 1U
0420 #define CONTROL_SPSEL_Msk (1UL << CONTROL_SPSEL_Pos)
0421
0422 #define CONTROL_nPRIV_Pos 0U
0423 #define CONTROL_nPRIV_Msk (1UL )
0424
0425
0426
0427
0428
0429
0430
0431
0432
0433
0434
0435
0436
0437
0438 typedef struct
0439 {
0440 __IOM uint32_t ISER[8U];
0441 uint32_t RESERVED0[24U];
0442 __IOM uint32_t ICER[8U];
0443 uint32_t RESERVED1[24U];
0444 __IOM uint32_t ISPR[8U];
0445 uint32_t RESERVED2[24U];
0446 __IOM uint32_t ICPR[8U];
0447 uint32_t RESERVED3[24U];
0448 __IOM uint32_t IABR[8U];
0449 uint32_t RESERVED4[56U];
0450 __IOM uint8_t IP[240U];
0451 uint32_t RESERVED5[644U];
0452 __OM uint32_t STIR;
0453 } NVIC_Type;
0454
0455
0456 #define NVIC_STIR_INTID_Pos 0U
0457 #define NVIC_STIR_INTID_Msk (0x1FFUL )
0458
0459
0460
0461
0462
0463
0464
0465
0466
0467
0468
0469
0470
0471
0472 typedef struct
0473 {
0474 __IM uint32_t CPUID;
0475 __IOM uint32_t ICSR;
0476 __IOM uint32_t VTOR;
0477 __IOM uint32_t AIRCR;
0478 __IOM uint32_t SCR;
0479 __IOM uint32_t CCR;
0480 __IOM uint8_t SHPR[12U];
0481 __IOM uint32_t SHCSR;
0482 __IOM uint32_t CFSR;
0483 __IOM uint32_t HFSR;
0484 __IOM uint32_t DFSR;
0485 __IOM uint32_t MMFAR;
0486 __IOM uint32_t BFAR;
0487 __IOM uint32_t AFSR;
0488 __IM uint32_t ID_PFR[2U];
0489 __IM uint32_t ID_DFR;
0490 __IM uint32_t ID_AFR;
0491 __IM uint32_t ID_MFR[4U];
0492 __IM uint32_t ID_ISAR[5U];
0493 uint32_t RESERVED0[1U];
0494 __IM uint32_t CLIDR;
0495 __IM uint32_t CTR;
0496 __IM uint32_t CCSIDR;
0497 __IOM uint32_t CSSELR;
0498 __IOM uint32_t CPACR;
0499 uint32_t RESERVED3[93U];
0500 __OM uint32_t STIR;
0501 uint32_t RESERVED4[15U];
0502 __IM uint32_t MVFR0;
0503 __IM uint32_t MVFR1;
0504 __IM uint32_t MVFR2;
0505 uint32_t RESERVED5[1U];
0506 __OM uint32_t ICIALLU;
0507 uint32_t RESERVED6[1U];
0508 __OM uint32_t ICIMVAU;
0509 __OM uint32_t DCIMVAC;
0510 __OM uint32_t DCISW;
0511 __OM uint32_t DCCMVAU;
0512 __OM uint32_t DCCMVAC;
0513 __OM uint32_t DCCSW;
0514 __OM uint32_t DCCIMVAC;
0515 __OM uint32_t DCCISW;
0516 __OM uint32_t BPIALL;
0517 uint32_t RESERVED7[5U];
0518 __IOM uint32_t ITCMCR;
0519 __IOM uint32_t DTCMCR;
0520 __IOM uint32_t AHBPCR;
0521 __IOM uint32_t CACR;
0522 __IOM uint32_t AHBSCR;
0523 uint32_t RESERVED8[1U];
0524 __IOM uint32_t ABFSR;
0525 } SCB_Type;
0526
0527
0528 #define SCB_CPUID_IMPLEMENTER_Pos 24U
0529 #define SCB_CPUID_IMPLEMENTER_Msk (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos)
0530
0531 #define SCB_CPUID_VARIANT_Pos 20U
0532 #define SCB_CPUID_VARIANT_Msk (0xFUL << SCB_CPUID_VARIANT_Pos)
0533
0534 #define SCB_CPUID_ARCHITECTURE_Pos 16U
0535 #define SCB_CPUID_ARCHITECTURE_Msk (0xFUL << SCB_CPUID_ARCHITECTURE_Pos)
0536
0537 #define SCB_CPUID_PARTNO_Pos 4U
0538 #define SCB_CPUID_PARTNO_Msk (0xFFFUL << SCB_CPUID_PARTNO_Pos)
0539
0540 #define SCB_CPUID_REVISION_Pos 0U
0541 #define SCB_CPUID_REVISION_Msk (0xFUL )
0542
0543
0544 #define SCB_ICSR_NMIPENDSET_Pos 31U
0545 #define SCB_ICSR_NMIPENDSET_Msk (1UL << SCB_ICSR_NMIPENDSET_Pos)
0546
0547 #define SCB_ICSR_PENDSVSET_Pos 28U
0548 #define SCB_ICSR_PENDSVSET_Msk (1UL << SCB_ICSR_PENDSVSET_Pos)
0549
0550 #define SCB_ICSR_PENDSVCLR_Pos 27U
0551 #define SCB_ICSR_PENDSVCLR_Msk (1UL << SCB_ICSR_PENDSVCLR_Pos)
0552
0553 #define SCB_ICSR_PENDSTSET_Pos 26U
0554 #define SCB_ICSR_PENDSTSET_Msk (1UL << SCB_ICSR_PENDSTSET_Pos)
0555
0556 #define SCB_ICSR_PENDSTCLR_Pos 25U
0557 #define SCB_ICSR_PENDSTCLR_Msk (1UL << SCB_ICSR_PENDSTCLR_Pos)
0558
0559 #define SCB_ICSR_ISRPREEMPT_Pos 23U
0560 #define SCB_ICSR_ISRPREEMPT_Msk (1UL << SCB_ICSR_ISRPREEMPT_Pos)
0561
0562 #define SCB_ICSR_ISRPENDING_Pos 22U
0563 #define SCB_ICSR_ISRPENDING_Msk (1UL << SCB_ICSR_ISRPENDING_Pos)
0564
0565 #define SCB_ICSR_VECTPENDING_Pos 12U
0566 #define SCB_ICSR_VECTPENDING_Msk (0x1FFUL << SCB_ICSR_VECTPENDING_Pos)
0567
0568 #define SCB_ICSR_RETTOBASE_Pos 11U
0569 #define SCB_ICSR_RETTOBASE_Msk (1UL << SCB_ICSR_RETTOBASE_Pos)
0570
0571 #define SCB_ICSR_VECTACTIVE_Pos 0U
0572 #define SCB_ICSR_VECTACTIVE_Msk (0x1FFUL )
0573
0574
0575 #define SCB_VTOR_TBLOFF_Pos 7U
0576 #define SCB_VTOR_TBLOFF_Msk (0x1FFFFFFUL << SCB_VTOR_TBLOFF_Pos)
0577
0578
0579 #define SCB_AIRCR_VECTKEY_Pos 16U
0580 #define SCB_AIRCR_VECTKEY_Msk (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos)
0581
0582 #define SCB_AIRCR_VECTKEYSTAT_Pos 16U
0583 #define SCB_AIRCR_VECTKEYSTAT_Msk (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos)
0584
0585 #define SCB_AIRCR_ENDIANESS_Pos 15U
0586 #define SCB_AIRCR_ENDIANESS_Msk (1UL << SCB_AIRCR_ENDIANESS_Pos)
0587
0588 #define SCB_AIRCR_PRIGROUP_Pos 8U
0589 #define SCB_AIRCR_PRIGROUP_Msk (7UL << SCB_AIRCR_PRIGROUP_Pos)
0590
0591 #define SCB_AIRCR_SYSRESETREQ_Pos 2U
0592 #define SCB_AIRCR_SYSRESETREQ_Msk (1UL << SCB_AIRCR_SYSRESETREQ_Pos)
0593
0594 #define SCB_AIRCR_VECTCLRACTIVE_Pos 1U
0595 #define SCB_AIRCR_VECTCLRACTIVE_Msk (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos)
0596
0597 #define SCB_AIRCR_VECTRESET_Pos 0U
0598 #define SCB_AIRCR_VECTRESET_Msk (1UL )
0599
0600
0601 #define SCB_SCR_SEVONPEND_Pos 4U
0602 #define SCB_SCR_SEVONPEND_Msk (1UL << SCB_SCR_SEVONPEND_Pos)
0603
0604 #define SCB_SCR_SLEEPDEEP_Pos 2U
0605 #define SCB_SCR_SLEEPDEEP_Msk (1UL << SCB_SCR_SLEEPDEEP_Pos)
0606
0607 #define SCB_SCR_SLEEPONEXIT_Pos 1U
0608 #define SCB_SCR_SLEEPONEXIT_Msk (1UL << SCB_SCR_SLEEPONEXIT_Pos)
0609
0610
0611 #define SCB_CCR_BP_Pos 18U
0612 #define SCB_CCR_BP_Msk (1UL << SCB_CCR_BP_Pos)
0613
0614 #define SCB_CCR_IC_Pos 17U
0615 #define SCB_CCR_IC_Msk (1UL << SCB_CCR_IC_Pos)
0616
0617 #define SCB_CCR_DC_Pos 16U
0618 #define SCB_CCR_DC_Msk (1UL << SCB_CCR_DC_Pos)
0619
0620 #define SCB_CCR_STKALIGN_Pos 9U
0621 #define SCB_CCR_STKALIGN_Msk (1UL << SCB_CCR_STKALIGN_Pos)
0622
0623 #define SCB_CCR_BFHFNMIGN_Pos 8U
0624 #define SCB_CCR_BFHFNMIGN_Msk (1UL << SCB_CCR_BFHFNMIGN_Pos)
0625
0626 #define SCB_CCR_DIV_0_TRP_Pos 4U
0627 #define SCB_CCR_DIV_0_TRP_Msk (1UL << SCB_CCR_DIV_0_TRP_Pos)
0628
0629 #define SCB_CCR_UNALIGN_TRP_Pos 3U
0630 #define SCB_CCR_UNALIGN_TRP_Msk (1UL << SCB_CCR_UNALIGN_TRP_Pos)
0631
0632 #define SCB_CCR_USERSETMPEND_Pos 1U
0633 #define SCB_CCR_USERSETMPEND_Msk (1UL << SCB_CCR_USERSETMPEND_Pos)
0634
0635 #define SCB_CCR_NONBASETHRDENA_Pos 0U
0636 #define SCB_CCR_NONBASETHRDENA_Msk (1UL )
0637
0638
0639 #define SCB_SHCSR_USGFAULTENA_Pos 18U
0640 #define SCB_SHCSR_USGFAULTENA_Msk (1UL << SCB_SHCSR_USGFAULTENA_Pos)
0641
0642 #define SCB_SHCSR_BUSFAULTENA_Pos 17U
0643 #define SCB_SHCSR_BUSFAULTENA_Msk (1UL << SCB_SHCSR_BUSFAULTENA_Pos)
0644
0645 #define SCB_SHCSR_MEMFAULTENA_Pos 16U
0646 #define SCB_SHCSR_MEMFAULTENA_Msk (1UL << SCB_SHCSR_MEMFAULTENA_Pos)
0647
0648 #define SCB_SHCSR_SVCALLPENDED_Pos 15U
0649 #define SCB_SHCSR_SVCALLPENDED_Msk (1UL << SCB_SHCSR_SVCALLPENDED_Pos)
0650
0651 #define SCB_SHCSR_BUSFAULTPENDED_Pos 14U
0652 #define SCB_SHCSR_BUSFAULTPENDED_Msk (1UL << SCB_SHCSR_BUSFAULTPENDED_Pos)
0653
0654 #define SCB_SHCSR_MEMFAULTPENDED_Pos 13U
0655 #define SCB_SHCSR_MEMFAULTPENDED_Msk (1UL << SCB_SHCSR_MEMFAULTPENDED_Pos)
0656
0657 #define SCB_SHCSR_USGFAULTPENDED_Pos 12U
0658 #define SCB_SHCSR_USGFAULTPENDED_Msk (1UL << SCB_SHCSR_USGFAULTPENDED_Pos)
0659
0660 #define SCB_SHCSR_SYSTICKACT_Pos 11U
0661 #define SCB_SHCSR_SYSTICKACT_Msk (1UL << SCB_SHCSR_SYSTICKACT_Pos)
0662
0663 #define SCB_SHCSR_PENDSVACT_Pos 10U
0664 #define SCB_SHCSR_PENDSVACT_Msk (1UL << SCB_SHCSR_PENDSVACT_Pos)
0665
0666 #define SCB_SHCSR_MONITORACT_Pos 8U
0667 #define SCB_SHCSR_MONITORACT_Msk (1UL << SCB_SHCSR_MONITORACT_Pos)
0668
0669 #define SCB_SHCSR_SVCALLACT_Pos 7U
0670 #define SCB_SHCSR_SVCALLACT_Msk (1UL << SCB_SHCSR_SVCALLACT_Pos)
0671
0672 #define SCB_SHCSR_USGFAULTACT_Pos 3U
0673 #define SCB_SHCSR_USGFAULTACT_Msk (1UL << SCB_SHCSR_USGFAULTACT_Pos)
0674
0675 #define SCB_SHCSR_BUSFAULTACT_Pos 1U
0676 #define SCB_SHCSR_BUSFAULTACT_Msk (1UL << SCB_SHCSR_BUSFAULTACT_Pos)
0677
0678 #define SCB_SHCSR_MEMFAULTACT_Pos 0U
0679 #define SCB_SHCSR_MEMFAULTACT_Msk (1UL )
0680
0681
0682 #define SCB_CFSR_USGFAULTSR_Pos 16U
0683 #define SCB_CFSR_USGFAULTSR_Msk (0xFFFFUL << SCB_CFSR_USGFAULTSR_Pos)
0684
0685 #define SCB_CFSR_BUSFAULTSR_Pos 8U
0686 #define SCB_CFSR_BUSFAULTSR_Msk (0xFFUL << SCB_CFSR_BUSFAULTSR_Pos)
0687
0688 #define SCB_CFSR_MEMFAULTSR_Pos 0U
0689 #define SCB_CFSR_MEMFAULTSR_Msk (0xFFUL )
0690
0691
0692 #define SCB_CFSR_MMARVALID_Pos (SCB_CFSR_MEMFAULTSR_Pos + 7U)
0693 #define SCB_CFSR_MMARVALID_Msk (1UL << SCB_CFSR_MMARVALID_Pos)
0694
0695 #define SCB_CFSR_MLSPERR_Pos (SCB_CFSR_MEMFAULTSR_Pos + 5U)
0696 #define SCB_CFSR_MLSPERR_Msk (1UL << SCB_CFSR_MLSPERR_Pos)
0697
0698 #define SCB_CFSR_MSTKERR_Pos (SCB_CFSR_MEMFAULTSR_Pos + 4U)
0699 #define SCB_CFSR_MSTKERR_Msk (1UL << SCB_CFSR_MSTKERR_Pos)
0700
0701 #define SCB_CFSR_MUNSTKERR_Pos (SCB_CFSR_MEMFAULTSR_Pos + 3U)
0702 #define SCB_CFSR_MUNSTKERR_Msk (1UL << SCB_CFSR_MUNSTKERR_Pos)
0703
0704 #define SCB_CFSR_DACCVIOL_Pos (SCB_CFSR_MEMFAULTSR_Pos + 1U)
0705 #define SCB_CFSR_DACCVIOL_Msk (1UL << SCB_CFSR_DACCVIOL_Pos)
0706
0707 #define SCB_CFSR_IACCVIOL_Pos (SCB_CFSR_MEMFAULTSR_Pos + 0U)
0708 #define SCB_CFSR_IACCVIOL_Msk (1UL )
0709
0710
0711 #define SCB_CFSR_BFARVALID_Pos (SCB_CFSR_BUSFAULTSR_Pos + 7U)
0712 #define SCB_CFSR_BFARVALID_Msk (1UL << SCB_CFSR_BFARVALID_Pos)
0713
0714 #define SCB_CFSR_LSPERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 5U)
0715 #define SCB_CFSR_LSPERR_Msk (1UL << SCB_CFSR_LSPERR_Pos)
0716
0717 #define SCB_CFSR_STKERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 4U)
0718 #define SCB_CFSR_STKERR_Msk (1UL << SCB_CFSR_STKERR_Pos)
0719
0720 #define SCB_CFSR_UNSTKERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 3U)
0721 #define SCB_CFSR_UNSTKERR_Msk (1UL << SCB_CFSR_UNSTKERR_Pos)
0722
0723 #define SCB_CFSR_IMPRECISERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 2U)
0724 #define SCB_CFSR_IMPRECISERR_Msk (1UL << SCB_CFSR_IMPRECISERR_Pos)
0725
0726 #define SCB_CFSR_PRECISERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 1U)
0727 #define SCB_CFSR_PRECISERR_Msk (1UL << SCB_CFSR_PRECISERR_Pos)
0728
0729 #define SCB_CFSR_IBUSERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 0U)
0730 #define SCB_CFSR_IBUSERR_Msk (1UL << SCB_CFSR_IBUSERR_Pos)
0731
0732
0733 #define SCB_CFSR_DIVBYZERO_Pos (SCB_CFSR_USGFAULTSR_Pos + 9U)
0734 #define SCB_CFSR_DIVBYZERO_Msk (1UL << SCB_CFSR_DIVBYZERO_Pos)
0735
0736 #define SCB_CFSR_UNALIGNED_Pos (SCB_CFSR_USGFAULTSR_Pos + 8U)
0737 #define SCB_CFSR_UNALIGNED_Msk (1UL << SCB_CFSR_UNALIGNED_Pos)
0738
0739 #define SCB_CFSR_NOCP_Pos (SCB_CFSR_USGFAULTSR_Pos + 3U)
0740 #define SCB_CFSR_NOCP_Msk (1UL << SCB_CFSR_NOCP_Pos)
0741
0742 #define SCB_CFSR_INVPC_Pos (SCB_CFSR_USGFAULTSR_Pos + 2U)
0743 #define SCB_CFSR_INVPC_Msk (1UL << SCB_CFSR_INVPC_Pos)
0744
0745 #define SCB_CFSR_INVSTATE_Pos (SCB_CFSR_USGFAULTSR_Pos + 1U)
0746 #define SCB_CFSR_INVSTATE_Msk (1UL << SCB_CFSR_INVSTATE_Pos)
0747
0748 #define SCB_CFSR_UNDEFINSTR_Pos (SCB_CFSR_USGFAULTSR_Pos + 0U)
0749 #define SCB_CFSR_UNDEFINSTR_Msk (1UL << SCB_CFSR_UNDEFINSTR_Pos)
0750
0751
0752 #define SCB_HFSR_DEBUGEVT_Pos 31U
0753 #define SCB_HFSR_DEBUGEVT_Msk (1UL << SCB_HFSR_DEBUGEVT_Pos)
0754
0755 #define SCB_HFSR_FORCED_Pos 30U
0756 #define SCB_HFSR_FORCED_Msk (1UL << SCB_HFSR_FORCED_Pos)
0757
0758 #define SCB_HFSR_VECTTBL_Pos 1U
0759 #define SCB_HFSR_VECTTBL_Msk (1UL << SCB_HFSR_VECTTBL_Pos)
0760
0761
0762 #define SCB_DFSR_EXTERNAL_Pos 4U
0763 #define SCB_DFSR_EXTERNAL_Msk (1UL << SCB_DFSR_EXTERNAL_Pos)
0764
0765 #define SCB_DFSR_VCATCH_Pos 3U
0766 #define SCB_DFSR_VCATCH_Msk (1UL << SCB_DFSR_VCATCH_Pos)
0767
0768 #define SCB_DFSR_DWTTRAP_Pos 2U
0769 #define SCB_DFSR_DWTTRAP_Msk (1UL << SCB_DFSR_DWTTRAP_Pos)
0770
0771 #define SCB_DFSR_BKPT_Pos 1U
0772 #define SCB_DFSR_BKPT_Msk (1UL << SCB_DFSR_BKPT_Pos)
0773
0774 #define SCB_DFSR_HALTED_Pos 0U
0775 #define SCB_DFSR_HALTED_Msk (1UL )
0776
0777
0778 #define SCB_CLIDR_LOUU_Pos 27U
0779 #define SCB_CLIDR_LOUU_Msk (7UL << SCB_CLIDR_LOUU_Pos)
0780
0781 #define SCB_CLIDR_LOC_Pos 24U
0782 #define SCB_CLIDR_LOC_Msk (7UL << SCB_CLIDR_LOC_Pos)
0783
0784
0785 #define SCB_CTR_FORMAT_Pos 29U
0786 #define SCB_CTR_FORMAT_Msk (7UL << SCB_CTR_FORMAT_Pos)
0787
0788 #define SCB_CTR_CWG_Pos 24U
0789 #define SCB_CTR_CWG_Msk (0xFUL << SCB_CTR_CWG_Pos)
0790
0791 #define SCB_CTR_ERG_Pos 20U
0792 #define SCB_CTR_ERG_Msk (0xFUL << SCB_CTR_ERG_Pos)
0793
0794 #define SCB_CTR_DMINLINE_Pos 16U
0795 #define SCB_CTR_DMINLINE_Msk (0xFUL << SCB_CTR_DMINLINE_Pos)
0796
0797 #define SCB_CTR_IMINLINE_Pos 0U
0798 #define SCB_CTR_IMINLINE_Msk (0xFUL )
0799
0800
0801 #define SCB_CCSIDR_WT_Pos 31U
0802 #define SCB_CCSIDR_WT_Msk (1UL << SCB_CCSIDR_WT_Pos)
0803
0804 #define SCB_CCSIDR_WB_Pos 30U
0805 #define SCB_CCSIDR_WB_Msk (1UL << SCB_CCSIDR_WB_Pos)
0806
0807 #define SCB_CCSIDR_RA_Pos 29U
0808 #define SCB_CCSIDR_RA_Msk (1UL << SCB_CCSIDR_RA_Pos)
0809
0810 #define SCB_CCSIDR_WA_Pos 28U
0811 #define SCB_CCSIDR_WA_Msk (1UL << SCB_CCSIDR_WA_Pos)
0812
0813 #define SCB_CCSIDR_NUMSETS_Pos 13U
0814 #define SCB_CCSIDR_NUMSETS_Msk (0x7FFFUL << SCB_CCSIDR_NUMSETS_Pos)
0815
0816 #define SCB_CCSIDR_ASSOCIATIVITY_Pos 3U
0817 #define SCB_CCSIDR_ASSOCIATIVITY_Msk (0x3FFUL << SCB_CCSIDR_ASSOCIATIVITY_Pos)
0818
0819 #define SCB_CCSIDR_LINESIZE_Pos 0U
0820 #define SCB_CCSIDR_LINESIZE_Msk (7UL )
0821
0822
0823 #define SCB_CSSELR_LEVEL_Pos 1U
0824 #define SCB_CSSELR_LEVEL_Msk (7UL << SCB_CSSELR_LEVEL_Pos)
0825
0826 #define SCB_CSSELR_IND_Pos 0U
0827 #define SCB_CSSELR_IND_Msk (1UL )
0828
0829
0830 #define SCB_STIR_INTID_Pos 0U
0831 #define SCB_STIR_INTID_Msk (0x1FFUL )
0832
0833
0834 #define SCB_DCISW_WAY_Pos 30U
0835 #define SCB_DCISW_WAY_Msk (3UL << SCB_DCISW_WAY_Pos)
0836
0837 #define SCB_DCISW_SET_Pos 5U
0838 #define SCB_DCISW_SET_Msk (0x1FFUL << SCB_DCISW_SET_Pos)
0839
0840
0841 #define SCB_DCCSW_WAY_Pos 30U
0842 #define SCB_DCCSW_WAY_Msk (3UL << SCB_DCCSW_WAY_Pos)
0843
0844 #define SCB_DCCSW_SET_Pos 5U
0845 #define SCB_DCCSW_SET_Msk (0x1FFUL << SCB_DCCSW_SET_Pos)
0846
0847
0848 #define SCB_DCCISW_WAY_Pos 30U
0849 #define SCB_DCCISW_WAY_Msk (3UL << SCB_DCCISW_WAY_Pos)
0850
0851 #define SCB_DCCISW_SET_Pos 5U
0852 #define SCB_DCCISW_SET_Msk (0x1FFUL << SCB_DCCISW_SET_Pos)
0853
0854
0855 #define SCB_ITCMCR_SZ_Pos 3U
0856 #define SCB_ITCMCR_SZ_Msk (0xFUL << SCB_ITCMCR_SZ_Pos)
0857
0858 #define SCB_ITCMCR_RETEN_Pos 2U
0859 #define SCB_ITCMCR_RETEN_Msk (1UL << SCB_ITCMCR_RETEN_Pos)
0860
0861 #define SCB_ITCMCR_RMW_Pos 1U
0862 #define SCB_ITCMCR_RMW_Msk (1UL << SCB_ITCMCR_RMW_Pos)
0863
0864 #define SCB_ITCMCR_EN_Pos 0U
0865 #define SCB_ITCMCR_EN_Msk (1UL )
0866
0867
0868 #define SCB_DTCMCR_SZ_Pos 3U
0869 #define SCB_DTCMCR_SZ_Msk (0xFUL << SCB_DTCMCR_SZ_Pos)
0870
0871 #define SCB_DTCMCR_RETEN_Pos 2U
0872 #define SCB_DTCMCR_RETEN_Msk (1UL << SCB_DTCMCR_RETEN_Pos)
0873
0874 #define SCB_DTCMCR_RMW_Pos 1U
0875 #define SCB_DTCMCR_RMW_Msk (1UL << SCB_DTCMCR_RMW_Pos)
0876
0877 #define SCB_DTCMCR_EN_Pos 0U
0878 #define SCB_DTCMCR_EN_Msk (1UL )
0879
0880
0881 #define SCB_AHBPCR_SZ_Pos 1U
0882 #define SCB_AHBPCR_SZ_Msk (7UL << SCB_AHBPCR_SZ_Pos)
0883
0884 #define SCB_AHBPCR_EN_Pos 0U
0885 #define SCB_AHBPCR_EN_Msk (1UL )
0886
0887
0888 #define SCB_CACR_FORCEWT_Pos 2U
0889 #define SCB_CACR_FORCEWT_Msk (1UL << SCB_CACR_FORCEWT_Pos)
0890
0891 #define SCB_CACR_ECCEN_Pos 1U
0892 #define SCB_CACR_ECCEN_Msk (1UL << SCB_CACR_ECCEN_Pos)
0893
0894 #define SCB_CACR_ECCDIS_Pos 1U
0895 #define SCB_CACR_ECCDIS_Msk (1UL << SCB_CACR_ECCDIS_Pos)
0896
0897 #define SCB_CACR_SIWT_Pos 0U
0898 #define SCB_CACR_SIWT_Msk (1UL )
0899
0900
0901 #define SCB_AHBSCR_INITCOUNT_Pos 11U
0902 #define SCB_AHBSCR_INITCOUNT_Msk (0x1FUL << SCB_AHBSCR_INITCOUNT_Pos)
0903
0904 #define SCB_AHBSCR_TPRI_Pos 2U
0905 #define SCB_AHBSCR_TPRI_Msk (0x1FFUL << SCB_AHBSCR_TPRI_Pos)
0906
0907 #define SCB_AHBSCR_CTL_Pos 0U
0908 #define SCB_AHBSCR_CTL_Msk (3UL )
0909
0910
0911 #define SCB_ABFSR_AXIMTYPE_Pos 8U
0912 #define SCB_ABFSR_AXIMTYPE_Msk (3UL << SCB_ABFSR_AXIMTYPE_Pos)
0913
0914 #define SCB_ABFSR_EPPB_Pos 4U
0915 #define SCB_ABFSR_EPPB_Msk (1UL << SCB_ABFSR_EPPB_Pos)
0916
0917 #define SCB_ABFSR_AXIM_Pos 3U
0918 #define SCB_ABFSR_AXIM_Msk (1UL << SCB_ABFSR_AXIM_Pos)
0919
0920 #define SCB_ABFSR_AHBP_Pos 2U
0921 #define SCB_ABFSR_AHBP_Msk (1UL << SCB_ABFSR_AHBP_Pos)
0922
0923 #define SCB_ABFSR_DTCM_Pos 1U
0924 #define SCB_ABFSR_DTCM_Msk (1UL << SCB_ABFSR_DTCM_Pos)
0925
0926 #define SCB_ABFSR_ITCM_Pos 0U
0927 #define SCB_ABFSR_ITCM_Msk (1UL )
0928
0929
0930
0931
0932
0933
0934
0935
0936
0937
0938
0939
0940
0941
0942 typedef struct
0943 {
0944 uint32_t RESERVED0[1U];
0945 __IM uint32_t ICTR;
0946 __IOM uint32_t ACTLR;
0947 } SCnSCB_Type;
0948
0949
0950 #define SCnSCB_ICTR_INTLINESNUM_Pos 0U
0951 #define SCnSCB_ICTR_INTLINESNUM_Msk (0xFUL )
0952
0953
0954 #define SCnSCB_ACTLR_DISDYNADD_Pos 26U
0955 #define SCnSCB_ACTLR_DISDYNADD_Msk (1UL << SCnSCB_ACTLR_DISDYNADD_Pos)
0956
0957 #define SCnSCB_ACTLR_DISISSCH1_Pos 21U
0958 #define SCnSCB_ACTLR_DISISSCH1_Msk (0x1FUL << SCnSCB_ACTLR_DISISSCH1_Pos)
0959
0960 #define SCnSCB_ACTLR_DISDI_Pos 16U
0961 #define SCnSCB_ACTLR_DISDI_Msk (0x1FUL << SCnSCB_ACTLR_DISDI_Pos)
0962
0963 #define SCnSCB_ACTLR_DISCRITAXIRUR_Pos 15U
0964 #define SCnSCB_ACTLR_DISCRITAXIRUR_Msk (1UL << SCnSCB_ACTLR_DISCRITAXIRUR_Pos)
0965
0966 #define SCnSCB_ACTLR_DISBTACALLOC_Pos 14U
0967 #define SCnSCB_ACTLR_DISBTACALLOC_Msk (1UL << SCnSCB_ACTLR_DISBTACALLOC_Pos)
0968
0969 #define SCnSCB_ACTLR_DISBTACREAD_Pos 13U
0970 #define SCnSCB_ACTLR_DISBTACREAD_Msk (1UL << SCnSCB_ACTLR_DISBTACREAD_Pos)
0971
0972 #define SCnSCB_ACTLR_DISITMATBFLUSH_Pos 12U
0973 #define SCnSCB_ACTLR_DISITMATBFLUSH_Msk (1UL << SCnSCB_ACTLR_DISITMATBFLUSH_Pos)
0974
0975 #define SCnSCB_ACTLR_DISRAMODE_Pos 11U
0976 #define SCnSCB_ACTLR_DISRAMODE_Msk (1UL << SCnSCB_ACTLR_DISRAMODE_Pos)
0977
0978 #define SCnSCB_ACTLR_FPEXCODIS_Pos 10U
0979 #define SCnSCB_ACTLR_FPEXCODIS_Msk (1UL << SCnSCB_ACTLR_FPEXCODIS_Pos)
0980
0981 #define SCnSCB_ACTLR_DISFOLD_Pos 2U
0982 #define SCnSCB_ACTLR_DISFOLD_Msk (1UL << SCnSCB_ACTLR_DISFOLD_Pos)
0983
0984 #define SCnSCB_ACTLR_DISMCYCINT_Pos 0U
0985 #define SCnSCB_ACTLR_DISMCYCINT_Msk (1UL )
0986
0987
0988
0989
0990
0991
0992
0993
0994
0995
0996
0997
0998
0999
1000 typedef struct
1001 {
1002 __IOM uint32_t CTRL;
1003 __IOM uint32_t LOAD;
1004 __IOM uint32_t VAL;
1005 __IM uint32_t CALIB;
1006 } SysTick_Type;
1007
1008
1009 #define SysTick_CTRL_COUNTFLAG_Pos 16U
1010 #define SysTick_CTRL_COUNTFLAG_Msk (1UL << SysTick_CTRL_COUNTFLAG_Pos)
1011
1012 #define SysTick_CTRL_CLKSOURCE_Pos 2U
1013 #define SysTick_CTRL_CLKSOURCE_Msk (1UL << SysTick_CTRL_CLKSOURCE_Pos)
1014
1015 #define SysTick_CTRL_TICKINT_Pos 1U
1016 #define SysTick_CTRL_TICKINT_Msk (1UL << SysTick_CTRL_TICKINT_Pos)
1017
1018 #define SysTick_CTRL_ENABLE_Pos 0U
1019 #define SysTick_CTRL_ENABLE_Msk (1UL )
1020
1021
1022 #define SysTick_LOAD_RELOAD_Pos 0U
1023 #define SysTick_LOAD_RELOAD_Msk (0xFFFFFFUL )
1024
1025
1026 #define SysTick_VAL_CURRENT_Pos 0U
1027 #define SysTick_VAL_CURRENT_Msk (0xFFFFFFUL )
1028
1029
1030 #define SysTick_CALIB_NOREF_Pos 31U
1031 #define SysTick_CALIB_NOREF_Msk (1UL << SysTick_CALIB_NOREF_Pos)
1032
1033 #define SysTick_CALIB_SKEW_Pos 30U
1034 #define SysTick_CALIB_SKEW_Msk (1UL << SysTick_CALIB_SKEW_Pos)
1035
1036 #define SysTick_CALIB_TENMS_Pos 0U
1037 #define SysTick_CALIB_TENMS_Msk (0xFFFFFFUL )
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052 typedef struct
1053 {
1054 __OM union
1055 {
1056 __OM uint8_t u8;
1057 __OM uint16_t u16;
1058 __OM uint32_t u32;
1059 } PORT [32U];
1060 uint32_t RESERVED0[864U];
1061 __IOM uint32_t TER;
1062 uint32_t RESERVED1[15U];
1063 __IOM uint32_t TPR;
1064 uint32_t RESERVED2[15U];
1065 __IOM uint32_t TCR;
1066 uint32_t RESERVED3[32U];
1067 uint32_t RESERVED4[43U];
1068 __OM uint32_t LAR;
1069 __IM uint32_t LSR;
1070 uint32_t RESERVED5[6U];
1071 __IM uint32_t PID4;
1072 __IM uint32_t PID5;
1073 __IM uint32_t PID6;
1074 __IM uint32_t PID7;
1075 __IM uint32_t PID0;
1076 __IM uint32_t PID1;
1077 __IM uint32_t PID2;
1078 __IM uint32_t PID3;
1079 __IM uint32_t CID0;
1080 __IM uint32_t CID1;
1081 __IM uint32_t CID2;
1082 __IM uint32_t CID3;
1083 } ITM_Type;
1084
1085
1086 #define ITM_TPR_PRIVMASK_Pos 0U
1087 #define ITM_TPR_PRIVMASK_Msk (0xFFFFFFFFUL )
1088
1089
1090 #define ITM_TCR_BUSY_Pos 23U
1091 #define ITM_TCR_BUSY_Msk (1UL << ITM_TCR_BUSY_Pos)
1092
1093 #define ITM_TCR_TRACEBUSID_Pos 16U
1094 #define ITM_TCR_TRACEBUSID_Msk (0x7FUL << ITM_TCR_TRACEBUSID_Pos)
1095
1096 #define ITM_TCR_GTSFREQ_Pos 10U
1097 #define ITM_TCR_GTSFREQ_Msk (3UL << ITM_TCR_GTSFREQ_Pos)
1098
1099 #define ITM_TCR_TSPRESCALE_Pos 8U
1100 #define ITM_TCR_TSPRESCALE_Msk (3UL << ITM_TCR_TSPRESCALE_Pos)
1101
1102 #define ITM_TCR_SWOENA_Pos 4U
1103 #define ITM_TCR_SWOENA_Msk (1UL << ITM_TCR_SWOENA_Pos)
1104
1105 #define ITM_TCR_DWTENA_Pos 3U
1106 #define ITM_TCR_DWTENA_Msk (1UL << ITM_TCR_DWTENA_Pos)
1107
1108 #define ITM_TCR_SYNCENA_Pos 2U
1109 #define ITM_TCR_SYNCENA_Msk (1UL << ITM_TCR_SYNCENA_Pos)
1110
1111 #define ITM_TCR_TSENA_Pos 1U
1112 #define ITM_TCR_TSENA_Msk (1UL << ITM_TCR_TSENA_Pos)
1113
1114 #define ITM_TCR_ITMENA_Pos 0U
1115 #define ITM_TCR_ITMENA_Msk (1UL )
1116
1117
1118 #define ITM_LSR_BYTEACC_Pos 2U
1119 #define ITM_LSR_BYTEACC_Msk (1UL << ITM_LSR_BYTEACC_Pos)
1120
1121 #define ITM_LSR_ACCESS_Pos 1U
1122 #define ITM_LSR_ACCESS_Msk (1UL << ITM_LSR_ACCESS_Pos)
1123
1124 #define ITM_LSR_PRESENT_Pos 0U
1125 #define ITM_LSR_PRESENT_Msk (1UL )
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140 typedef struct
1141 {
1142 __IOM uint32_t CTRL;
1143 __IOM uint32_t CYCCNT;
1144 __IOM uint32_t CPICNT;
1145 __IOM uint32_t EXCCNT;
1146 __IOM uint32_t SLEEPCNT;
1147 __IOM uint32_t LSUCNT;
1148 __IOM uint32_t FOLDCNT;
1149 __IM uint32_t PCSR;
1150 __IOM uint32_t COMP0;
1151 __IOM uint32_t MASK0;
1152 __IOM uint32_t FUNCTION0;
1153 uint32_t RESERVED0[1U];
1154 __IOM uint32_t COMP1;
1155 __IOM uint32_t MASK1;
1156 __IOM uint32_t FUNCTION1;
1157 uint32_t RESERVED1[1U];
1158 __IOM uint32_t COMP2;
1159 __IOM uint32_t MASK2;
1160 __IOM uint32_t FUNCTION2;
1161 uint32_t RESERVED2[1U];
1162 __IOM uint32_t COMP3;
1163 __IOM uint32_t MASK3;
1164 __IOM uint32_t FUNCTION3;
1165 uint32_t RESERVED3[981U];
1166 __OM uint32_t LAR;
1167 __IM uint32_t LSR;
1168 } DWT_Type;
1169
1170
1171 #define DWT_CTRL_NUMCOMP_Pos 28U
1172 #define DWT_CTRL_NUMCOMP_Msk (0xFUL << DWT_CTRL_NUMCOMP_Pos)
1173
1174 #define DWT_CTRL_NOTRCPKT_Pos 27U
1175 #define DWT_CTRL_NOTRCPKT_Msk (0x1UL << DWT_CTRL_NOTRCPKT_Pos)
1176
1177 #define DWT_CTRL_NOEXTTRIG_Pos 26U
1178 #define DWT_CTRL_NOEXTTRIG_Msk (0x1UL << DWT_CTRL_NOEXTTRIG_Pos)
1179
1180 #define DWT_CTRL_NOCYCCNT_Pos 25U
1181 #define DWT_CTRL_NOCYCCNT_Msk (0x1UL << DWT_CTRL_NOCYCCNT_Pos)
1182
1183 #define DWT_CTRL_NOPRFCNT_Pos 24U
1184 #define DWT_CTRL_NOPRFCNT_Msk (0x1UL << DWT_CTRL_NOPRFCNT_Pos)
1185
1186 #define DWT_CTRL_CYCEVTENA_Pos 22U
1187 #define DWT_CTRL_CYCEVTENA_Msk (0x1UL << DWT_CTRL_CYCEVTENA_Pos)
1188
1189 #define DWT_CTRL_FOLDEVTENA_Pos 21U
1190 #define DWT_CTRL_FOLDEVTENA_Msk (0x1UL << DWT_CTRL_FOLDEVTENA_Pos)
1191
1192 #define DWT_CTRL_LSUEVTENA_Pos 20U
1193 #define DWT_CTRL_LSUEVTENA_Msk (0x1UL << DWT_CTRL_LSUEVTENA_Pos)
1194
1195 #define DWT_CTRL_SLEEPEVTENA_Pos 19U
1196 #define DWT_CTRL_SLEEPEVTENA_Msk (0x1UL << DWT_CTRL_SLEEPEVTENA_Pos)
1197
1198 #define DWT_CTRL_EXCEVTENA_Pos 18U
1199 #define DWT_CTRL_EXCEVTENA_Msk (0x1UL << DWT_CTRL_EXCEVTENA_Pos)
1200
1201 #define DWT_CTRL_CPIEVTENA_Pos 17U
1202 #define DWT_CTRL_CPIEVTENA_Msk (0x1UL << DWT_CTRL_CPIEVTENA_Pos)
1203
1204 #define DWT_CTRL_EXCTRCENA_Pos 16U
1205 #define DWT_CTRL_EXCTRCENA_Msk (0x1UL << DWT_CTRL_EXCTRCENA_Pos)
1206
1207 #define DWT_CTRL_PCSAMPLENA_Pos 12U
1208 #define DWT_CTRL_PCSAMPLENA_Msk (0x1UL << DWT_CTRL_PCSAMPLENA_Pos)
1209
1210 #define DWT_CTRL_SYNCTAP_Pos 10U
1211 #define DWT_CTRL_SYNCTAP_Msk (0x3UL << DWT_CTRL_SYNCTAP_Pos)
1212
1213 #define DWT_CTRL_CYCTAP_Pos 9U
1214 #define DWT_CTRL_CYCTAP_Msk (0x1UL << DWT_CTRL_CYCTAP_Pos)
1215
1216 #define DWT_CTRL_POSTINIT_Pos 5U
1217 #define DWT_CTRL_POSTINIT_Msk (0xFUL << DWT_CTRL_POSTINIT_Pos)
1218
1219 #define DWT_CTRL_POSTPRESET_Pos 1U
1220 #define DWT_CTRL_POSTPRESET_Msk (0xFUL << DWT_CTRL_POSTPRESET_Pos)
1221
1222 #define DWT_CTRL_CYCCNTENA_Pos 0U
1223 #define DWT_CTRL_CYCCNTENA_Msk (0x1UL )
1224
1225
1226 #define DWT_CPICNT_CPICNT_Pos 0U
1227 #define DWT_CPICNT_CPICNT_Msk (0xFFUL )
1228
1229
1230 #define DWT_EXCCNT_EXCCNT_Pos 0U
1231 #define DWT_EXCCNT_EXCCNT_Msk (0xFFUL )
1232
1233
1234 #define DWT_SLEEPCNT_SLEEPCNT_Pos 0U
1235 #define DWT_SLEEPCNT_SLEEPCNT_Msk (0xFFUL )
1236
1237
1238 #define DWT_LSUCNT_LSUCNT_Pos 0U
1239 #define DWT_LSUCNT_LSUCNT_Msk (0xFFUL )
1240
1241
1242 #define DWT_FOLDCNT_FOLDCNT_Pos 0U
1243 #define DWT_FOLDCNT_FOLDCNT_Msk (0xFFUL )
1244
1245
1246 #define DWT_MASK_MASK_Pos 0U
1247 #define DWT_MASK_MASK_Msk (0x1FUL )
1248
1249
1250 #define DWT_FUNCTION_MATCHED_Pos 24U
1251 #define DWT_FUNCTION_MATCHED_Msk (0x1UL << DWT_FUNCTION_MATCHED_Pos)
1252
1253 #define DWT_FUNCTION_DATAVADDR1_Pos 16U
1254 #define DWT_FUNCTION_DATAVADDR1_Msk (0xFUL << DWT_FUNCTION_DATAVADDR1_Pos)
1255
1256 #define DWT_FUNCTION_DATAVADDR0_Pos 12U
1257 #define DWT_FUNCTION_DATAVADDR0_Msk (0xFUL << DWT_FUNCTION_DATAVADDR0_Pos)
1258
1259 #define DWT_FUNCTION_DATAVSIZE_Pos 10U
1260 #define DWT_FUNCTION_DATAVSIZE_Msk (0x3UL << DWT_FUNCTION_DATAVSIZE_Pos)
1261
1262 #define DWT_FUNCTION_LNK1ENA_Pos 9U
1263 #define DWT_FUNCTION_LNK1ENA_Msk (0x1UL << DWT_FUNCTION_LNK1ENA_Pos)
1264
1265 #define DWT_FUNCTION_DATAVMATCH_Pos 8U
1266 #define DWT_FUNCTION_DATAVMATCH_Msk (0x1UL << DWT_FUNCTION_DATAVMATCH_Pos)
1267
1268 #define DWT_FUNCTION_CYCMATCH_Pos 7U
1269 #define DWT_FUNCTION_CYCMATCH_Msk (0x1UL << DWT_FUNCTION_CYCMATCH_Pos)
1270
1271 #define DWT_FUNCTION_EMITRANGE_Pos 5U
1272 #define DWT_FUNCTION_EMITRANGE_Msk (0x1UL << DWT_FUNCTION_EMITRANGE_Pos)
1273
1274 #define DWT_FUNCTION_FUNCTION_Pos 0U
1275 #define DWT_FUNCTION_FUNCTION_Msk (0xFUL )
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290 typedef struct
1291 {
1292 __IM uint32_t SSPSR;
1293 __IOM uint32_t CSPSR;
1294 uint32_t RESERVED0[2U];
1295 __IOM uint32_t ACPR;
1296 uint32_t RESERVED1[55U];
1297 __IOM uint32_t SPPR;
1298 uint32_t RESERVED2[131U];
1299 __IM uint32_t FFSR;
1300 __IOM uint32_t FFCR;
1301 __IM uint32_t FSCR;
1302 uint32_t RESERVED3[759U];
1303 __IM uint32_t TRIGGER;
1304 __IM uint32_t FIFO0;
1305 __IM uint32_t ITATBCTR2;
1306 uint32_t RESERVED4[1U];
1307 __IM uint32_t ITATBCTR0;
1308 __IM uint32_t FIFO1;
1309 __IOM uint32_t ITCTRL;
1310 uint32_t RESERVED5[39U];
1311 __IOM uint32_t CLAIMSET;
1312 __IOM uint32_t CLAIMCLR;
1313 uint32_t RESERVED7[8U];
1314 __IM uint32_t DEVID;
1315 __IM uint32_t DEVTYPE;
1316 } TPI_Type;
1317
1318
1319 #define TPI_ACPR_PRESCALER_Pos 0U
1320 #define TPI_ACPR_PRESCALER_Msk (0x1FFFUL )
1321
1322
1323 #define TPI_SPPR_TXMODE_Pos 0U
1324 #define TPI_SPPR_TXMODE_Msk (0x3UL )
1325
1326
1327 #define TPI_FFSR_FtNonStop_Pos 3U
1328 #define TPI_FFSR_FtNonStop_Msk (0x1UL << TPI_FFSR_FtNonStop_Pos)
1329
1330 #define TPI_FFSR_TCPresent_Pos 2U
1331 #define TPI_FFSR_TCPresent_Msk (0x1UL << TPI_FFSR_TCPresent_Pos)
1332
1333 #define TPI_FFSR_FtStopped_Pos 1U
1334 #define TPI_FFSR_FtStopped_Msk (0x1UL << TPI_FFSR_FtStopped_Pos)
1335
1336 #define TPI_FFSR_FlInProg_Pos 0U
1337 #define TPI_FFSR_FlInProg_Msk (0x1UL )
1338
1339
1340 #define TPI_FFCR_TrigIn_Pos 8U
1341 #define TPI_FFCR_TrigIn_Msk (0x1UL << TPI_FFCR_TrigIn_Pos)
1342
1343 #define TPI_FFCR_EnFCont_Pos 1U
1344 #define TPI_FFCR_EnFCont_Msk (0x1UL << TPI_FFCR_EnFCont_Pos)
1345
1346
1347 #define TPI_TRIGGER_TRIGGER_Pos 0U
1348 #define TPI_TRIGGER_TRIGGER_Msk (0x1UL )
1349
1350
1351 #define TPI_FIFO0_ITM_ATVALID_Pos 29U
1352 #define TPI_FIFO0_ITM_ATVALID_Msk (0x1UL << TPI_FIFO0_ITM_ATVALID_Pos)
1353
1354 #define TPI_FIFO0_ITM_bytecount_Pos 27U
1355 #define TPI_FIFO0_ITM_bytecount_Msk (0x3UL << TPI_FIFO0_ITM_bytecount_Pos)
1356
1357 #define TPI_FIFO0_ETM_ATVALID_Pos 26U
1358 #define TPI_FIFO0_ETM_ATVALID_Msk (0x1UL << TPI_FIFO0_ETM_ATVALID_Pos)
1359
1360 #define TPI_FIFO0_ETM_bytecount_Pos 24U
1361 #define TPI_FIFO0_ETM_bytecount_Msk (0x3UL << TPI_FIFO0_ETM_bytecount_Pos)
1362
1363 #define TPI_FIFO0_ETM2_Pos 16U
1364 #define TPI_FIFO0_ETM2_Msk (0xFFUL << TPI_FIFO0_ETM2_Pos)
1365
1366 #define TPI_FIFO0_ETM1_Pos 8U
1367 #define TPI_FIFO0_ETM1_Msk (0xFFUL << TPI_FIFO0_ETM1_Pos)
1368
1369 #define TPI_FIFO0_ETM0_Pos 0U
1370 #define TPI_FIFO0_ETM0_Msk (0xFFUL )
1371
1372
1373 #define TPI_ITATBCTR2_ATREADY2_Pos 0U
1374 #define TPI_ITATBCTR2_ATREADY2_Msk (0x1UL )
1375
1376 #define TPI_ITATBCTR2_ATREADY1_Pos 0U
1377 #define TPI_ITATBCTR2_ATREADY1_Msk (0x1UL )
1378
1379
1380 #define TPI_FIFO1_ITM_ATVALID_Pos 29U
1381 #define TPI_FIFO1_ITM_ATVALID_Msk (0x1UL << TPI_FIFO1_ITM_ATVALID_Pos)
1382
1383 #define TPI_FIFO1_ITM_bytecount_Pos 27U
1384 #define TPI_FIFO1_ITM_bytecount_Msk (0x3UL << TPI_FIFO1_ITM_bytecount_Pos)
1385
1386 #define TPI_FIFO1_ETM_ATVALID_Pos 26U
1387 #define TPI_FIFO1_ETM_ATVALID_Msk (0x1UL << TPI_FIFO1_ETM_ATVALID_Pos)
1388
1389 #define TPI_FIFO1_ETM_bytecount_Pos 24U
1390 #define TPI_FIFO1_ETM_bytecount_Msk (0x3UL << TPI_FIFO1_ETM_bytecount_Pos)
1391
1392 #define TPI_FIFO1_ITM2_Pos 16U
1393 #define TPI_FIFO1_ITM2_Msk (0xFFUL << TPI_FIFO1_ITM2_Pos)
1394
1395 #define TPI_FIFO1_ITM1_Pos 8U
1396 #define TPI_FIFO1_ITM1_Msk (0xFFUL << TPI_FIFO1_ITM1_Pos)
1397
1398 #define TPI_FIFO1_ITM0_Pos 0U
1399 #define TPI_FIFO1_ITM0_Msk (0xFFUL )
1400
1401
1402 #define TPI_ITATBCTR0_ATREADY2_Pos 0U
1403 #define TPI_ITATBCTR0_ATREADY2_Msk (0x1UL )
1404
1405 #define TPI_ITATBCTR0_ATREADY1_Pos 0U
1406 #define TPI_ITATBCTR0_ATREADY1_Msk (0x1UL )
1407
1408
1409 #define TPI_ITCTRL_Mode_Pos 0U
1410 #define TPI_ITCTRL_Mode_Msk (0x3UL )
1411
1412
1413 #define TPI_DEVID_NRZVALID_Pos 11U
1414 #define TPI_DEVID_NRZVALID_Msk (0x1UL << TPI_DEVID_NRZVALID_Pos)
1415
1416 #define TPI_DEVID_MANCVALID_Pos 10U
1417 #define TPI_DEVID_MANCVALID_Msk (0x1UL << TPI_DEVID_MANCVALID_Pos)
1418
1419 #define TPI_DEVID_PTINVALID_Pos 9U
1420 #define TPI_DEVID_PTINVALID_Msk (0x1UL << TPI_DEVID_PTINVALID_Pos)
1421
1422 #define TPI_DEVID_MinBufSz_Pos 6U
1423 #define TPI_DEVID_MinBufSz_Msk (0x7UL << TPI_DEVID_MinBufSz_Pos)
1424
1425 #define TPI_DEVID_AsynClkIn_Pos 5U
1426 #define TPI_DEVID_AsynClkIn_Msk (0x1UL << TPI_DEVID_AsynClkIn_Pos)
1427
1428 #define TPI_DEVID_NrTraceInput_Pos 0U
1429 #define TPI_DEVID_NrTraceInput_Msk (0x1FUL )
1430
1431
1432 #define TPI_DEVTYPE_SubType_Pos 4U
1433 #define TPI_DEVTYPE_SubType_Msk (0xFUL )
1434
1435 #define TPI_DEVTYPE_MajorType_Pos 0U
1436 #define TPI_DEVTYPE_MajorType_Msk (0xFUL << TPI_DEVTYPE_MajorType_Pos)
1437
1438
1439
1440
1441 #if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U)
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452 typedef struct
1453 {
1454 __IM uint32_t TYPE;
1455 __IOM uint32_t CTRL;
1456 __IOM uint32_t RNR;
1457 __IOM uint32_t RBAR;
1458 __IOM uint32_t RASR;
1459 __IOM uint32_t RBAR_A1;
1460 __IOM uint32_t RASR_A1;
1461 __IOM uint32_t RBAR_A2;
1462 __IOM uint32_t RASR_A2;
1463 __IOM uint32_t RBAR_A3;
1464 __IOM uint32_t RASR_A3;
1465 } MPU_Type;
1466
1467 #define MPU_TYPE_RALIASES 4U
1468
1469
1470 #define MPU_TYPE_IREGION_Pos 16U
1471 #define MPU_TYPE_IREGION_Msk (0xFFUL << MPU_TYPE_IREGION_Pos)
1472
1473 #define MPU_TYPE_DREGION_Pos 8U
1474 #define MPU_TYPE_DREGION_Msk (0xFFUL << MPU_TYPE_DREGION_Pos)
1475
1476 #define MPU_TYPE_SEPARATE_Pos 0U
1477 #define MPU_TYPE_SEPARATE_Msk (1UL )
1478
1479
1480 #define MPU_CTRL_PRIVDEFENA_Pos 2U
1481 #define MPU_CTRL_PRIVDEFENA_Msk (1UL << MPU_CTRL_PRIVDEFENA_Pos)
1482
1483 #define MPU_CTRL_HFNMIENA_Pos 1U
1484 #define MPU_CTRL_HFNMIENA_Msk (1UL << MPU_CTRL_HFNMIENA_Pos)
1485
1486 #define MPU_CTRL_ENABLE_Pos 0U
1487 #define MPU_CTRL_ENABLE_Msk (1UL )
1488
1489
1490 #define MPU_RNR_REGION_Pos 0U
1491 #define MPU_RNR_REGION_Msk (0xFFUL )
1492
1493
1494 #define MPU_RBAR_ADDR_Pos 5U
1495 #define MPU_RBAR_ADDR_Msk (0x7FFFFFFUL << MPU_RBAR_ADDR_Pos)
1496
1497 #define MPU_RBAR_VALID_Pos 4U
1498 #define MPU_RBAR_VALID_Msk (1UL << MPU_RBAR_VALID_Pos)
1499
1500 #define MPU_RBAR_REGION_Pos 0U
1501 #define MPU_RBAR_REGION_Msk (0xFUL )
1502
1503
1504 #define MPU_RASR_ATTRS_Pos 16U
1505 #define MPU_RASR_ATTRS_Msk (0xFFFFUL << MPU_RASR_ATTRS_Pos)
1506
1507 #define MPU_RASR_XN_Pos 28U
1508 #define MPU_RASR_XN_Msk (1UL << MPU_RASR_XN_Pos)
1509
1510 #define MPU_RASR_AP_Pos 24U
1511 #define MPU_RASR_AP_Msk (0x7UL << MPU_RASR_AP_Pos)
1512
1513 #define MPU_RASR_TEX_Pos 19U
1514 #define MPU_RASR_TEX_Msk (0x7UL << MPU_RASR_TEX_Pos)
1515
1516 #define MPU_RASR_S_Pos 18U
1517 #define MPU_RASR_S_Msk (1UL << MPU_RASR_S_Pos)
1518
1519 #define MPU_RASR_C_Pos 17U
1520 #define MPU_RASR_C_Msk (1UL << MPU_RASR_C_Pos)
1521
1522 #define MPU_RASR_B_Pos 16U
1523 #define MPU_RASR_B_Msk (1UL << MPU_RASR_B_Pos)
1524
1525 #define MPU_RASR_SRD_Pos 8U
1526 #define MPU_RASR_SRD_Msk (0xFFUL << MPU_RASR_SRD_Pos)
1527
1528 #define MPU_RASR_SIZE_Pos 1U
1529 #define MPU_RASR_SIZE_Msk (0x1FUL << MPU_RASR_SIZE_Pos)
1530
1531 #define MPU_RASR_ENABLE_Pos 0U
1532 #define MPU_RASR_ENABLE_Msk (1UL )
1533
1534
1535 #endif
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548 typedef struct
1549 {
1550 uint32_t RESERVED0[1U];
1551 __IOM uint32_t FPCCR;
1552 __IOM uint32_t FPCAR;
1553 __IOM uint32_t FPDSCR;
1554 __IM uint32_t MVFR0;
1555 __IM uint32_t MVFR1;
1556 __IM uint32_t MVFR2;
1557 } FPU_Type;
1558
1559
1560 #define FPU_FPCCR_ASPEN_Pos 31U
1561 #define FPU_FPCCR_ASPEN_Msk (1UL << FPU_FPCCR_ASPEN_Pos)
1562
1563 #define FPU_FPCCR_LSPEN_Pos 30U
1564 #define FPU_FPCCR_LSPEN_Msk (1UL << FPU_FPCCR_LSPEN_Pos)
1565
1566 #define FPU_FPCCR_MONRDY_Pos 8U
1567 #define FPU_FPCCR_MONRDY_Msk (1UL << FPU_FPCCR_MONRDY_Pos)
1568
1569 #define FPU_FPCCR_BFRDY_Pos 6U
1570 #define FPU_FPCCR_BFRDY_Msk (1UL << FPU_FPCCR_BFRDY_Pos)
1571
1572 #define FPU_FPCCR_MMRDY_Pos 5U
1573 #define FPU_FPCCR_MMRDY_Msk (1UL << FPU_FPCCR_MMRDY_Pos)
1574
1575 #define FPU_FPCCR_HFRDY_Pos 4U
1576 #define FPU_FPCCR_HFRDY_Msk (1UL << FPU_FPCCR_HFRDY_Pos)
1577
1578 #define FPU_FPCCR_THREAD_Pos 3U
1579 #define FPU_FPCCR_THREAD_Msk (1UL << FPU_FPCCR_THREAD_Pos)
1580
1581 #define FPU_FPCCR_USER_Pos 1U
1582 #define FPU_FPCCR_USER_Msk (1UL << FPU_FPCCR_USER_Pos)
1583
1584 #define FPU_FPCCR_LSPACT_Pos 0U
1585 #define FPU_FPCCR_LSPACT_Msk (1UL )
1586
1587
1588 #define FPU_FPCAR_ADDRESS_Pos 3U
1589 #define FPU_FPCAR_ADDRESS_Msk (0x1FFFFFFFUL << FPU_FPCAR_ADDRESS_Pos)
1590
1591
1592 #define FPU_FPDSCR_AHP_Pos 26U
1593 #define FPU_FPDSCR_AHP_Msk (1UL << FPU_FPDSCR_AHP_Pos)
1594
1595 #define FPU_FPDSCR_DN_Pos 25U
1596 #define FPU_FPDSCR_DN_Msk (1UL << FPU_FPDSCR_DN_Pos)
1597
1598 #define FPU_FPDSCR_FZ_Pos 24U
1599 #define FPU_FPDSCR_FZ_Msk (1UL << FPU_FPDSCR_FZ_Pos)
1600
1601 #define FPU_FPDSCR_RMode_Pos 22U
1602 #define FPU_FPDSCR_RMode_Msk (3UL << FPU_FPDSCR_RMode_Pos)
1603
1604
1605 #define FPU_MVFR0_FP_rounding_modes_Pos 28U
1606 #define FPU_MVFR0_FP_rounding_modes_Msk (0xFUL << FPU_MVFR0_FP_rounding_modes_Pos)
1607
1608 #define FPU_MVFR0_Short_vectors_Pos 24U
1609 #define FPU_MVFR0_Short_vectors_Msk (0xFUL << FPU_MVFR0_Short_vectors_Pos)
1610
1611 #define FPU_MVFR0_Square_root_Pos 20U
1612 #define FPU_MVFR0_Square_root_Msk (0xFUL << FPU_MVFR0_Square_root_Pos)
1613
1614 #define FPU_MVFR0_Divide_Pos 16U
1615 #define FPU_MVFR0_Divide_Msk (0xFUL << FPU_MVFR0_Divide_Pos)
1616
1617 #define FPU_MVFR0_FP_excep_trapping_Pos 12U
1618 #define FPU_MVFR0_FP_excep_trapping_Msk (0xFUL << FPU_MVFR0_FP_excep_trapping_Pos)
1619
1620 #define FPU_MVFR0_Double_precision_Pos 8U
1621 #define FPU_MVFR0_Double_precision_Msk (0xFUL << FPU_MVFR0_Double_precision_Pos)
1622
1623 #define FPU_MVFR0_Single_precision_Pos 4U
1624 #define FPU_MVFR0_Single_precision_Msk (0xFUL << FPU_MVFR0_Single_precision_Pos)
1625
1626 #define FPU_MVFR0_A_SIMD_registers_Pos 0U
1627 #define FPU_MVFR0_A_SIMD_registers_Msk (0xFUL )
1628
1629
1630 #define FPU_MVFR1_FP_fused_MAC_Pos 28U
1631 #define FPU_MVFR1_FP_fused_MAC_Msk (0xFUL << FPU_MVFR1_FP_fused_MAC_Pos)
1632
1633 #define FPU_MVFR1_FP_HPFP_Pos 24U
1634 #define FPU_MVFR1_FP_HPFP_Msk (0xFUL << FPU_MVFR1_FP_HPFP_Pos)
1635
1636 #define FPU_MVFR1_D_NaN_mode_Pos 4U
1637 #define FPU_MVFR1_D_NaN_mode_Msk (0xFUL << FPU_MVFR1_D_NaN_mode_Pos)
1638
1639 #define FPU_MVFR1_FtZ_mode_Pos 0U
1640 #define FPU_MVFR1_FtZ_mode_Msk (0xFUL )
1641
1642
1643
1644 #define FPU_MVFR2_VFP_Misc_Pos 4U
1645 #define FPU_MVFR2_VFP_Misc_Msk (0xFUL << FPU_MVFR2_VFP_Misc_Pos)
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660 typedef struct
1661 {
1662 __IOM uint32_t DHCSR;
1663 __OM uint32_t DCRSR;
1664 __IOM uint32_t DCRDR;
1665 __IOM uint32_t DEMCR;
1666 } CoreDebug_Type;
1667
1668
1669 #define CoreDebug_DHCSR_DBGKEY_Pos 16U
1670 #define CoreDebug_DHCSR_DBGKEY_Msk (0xFFFFUL << CoreDebug_DHCSR_DBGKEY_Pos)
1671
1672 #define CoreDebug_DHCSR_S_RESET_ST_Pos 25U
1673 #define CoreDebug_DHCSR_S_RESET_ST_Msk (1UL << CoreDebug_DHCSR_S_RESET_ST_Pos)
1674
1675 #define CoreDebug_DHCSR_S_RETIRE_ST_Pos 24U
1676 #define CoreDebug_DHCSR_S_RETIRE_ST_Msk (1UL << CoreDebug_DHCSR_S_RETIRE_ST_Pos)
1677
1678 #define CoreDebug_DHCSR_S_LOCKUP_Pos 19U
1679 #define CoreDebug_DHCSR_S_LOCKUP_Msk (1UL << CoreDebug_DHCSR_S_LOCKUP_Pos)
1680
1681 #define CoreDebug_DHCSR_S_SLEEP_Pos 18U
1682 #define CoreDebug_DHCSR_S_SLEEP_Msk (1UL << CoreDebug_DHCSR_S_SLEEP_Pos)
1683
1684 #define CoreDebug_DHCSR_S_HALT_Pos 17U
1685 #define CoreDebug_DHCSR_S_HALT_Msk (1UL << CoreDebug_DHCSR_S_HALT_Pos)
1686
1687 #define CoreDebug_DHCSR_S_REGRDY_Pos 16U
1688 #define CoreDebug_DHCSR_S_REGRDY_Msk (1UL << CoreDebug_DHCSR_S_REGRDY_Pos)
1689
1690 #define CoreDebug_DHCSR_C_SNAPSTALL_Pos 5U
1691 #define CoreDebug_DHCSR_C_SNAPSTALL_Msk (1UL << CoreDebug_DHCSR_C_SNAPSTALL_Pos)
1692
1693 #define CoreDebug_DHCSR_C_MASKINTS_Pos 3U
1694 #define CoreDebug_DHCSR_C_MASKINTS_Msk (1UL << CoreDebug_DHCSR_C_MASKINTS_Pos)
1695
1696 #define CoreDebug_DHCSR_C_STEP_Pos 2U
1697 #define CoreDebug_DHCSR_C_STEP_Msk (1UL << CoreDebug_DHCSR_C_STEP_Pos)
1698
1699 #define CoreDebug_DHCSR_C_HALT_Pos 1U
1700 #define CoreDebug_DHCSR_C_HALT_Msk (1UL << CoreDebug_DHCSR_C_HALT_Pos)
1701
1702 #define CoreDebug_DHCSR_C_DEBUGEN_Pos 0U
1703 #define CoreDebug_DHCSR_C_DEBUGEN_Msk (1UL )
1704
1705
1706 #define CoreDebug_DCRSR_REGWnR_Pos 16U
1707 #define CoreDebug_DCRSR_REGWnR_Msk (1UL << CoreDebug_DCRSR_REGWnR_Pos)
1708
1709 #define CoreDebug_DCRSR_REGSEL_Pos 0U
1710 #define CoreDebug_DCRSR_REGSEL_Msk (0x1FUL )
1711
1712
1713 #define CoreDebug_DEMCR_TRCENA_Pos 24U
1714 #define CoreDebug_DEMCR_TRCENA_Msk (1UL << CoreDebug_DEMCR_TRCENA_Pos)
1715
1716 #define CoreDebug_DEMCR_MON_REQ_Pos 19U
1717 #define CoreDebug_DEMCR_MON_REQ_Msk (1UL << CoreDebug_DEMCR_MON_REQ_Pos)
1718
1719 #define CoreDebug_DEMCR_MON_STEP_Pos 18U
1720 #define CoreDebug_DEMCR_MON_STEP_Msk (1UL << CoreDebug_DEMCR_MON_STEP_Pos)
1721
1722 #define CoreDebug_DEMCR_MON_PEND_Pos 17U
1723 #define CoreDebug_DEMCR_MON_PEND_Msk (1UL << CoreDebug_DEMCR_MON_PEND_Pos)
1724
1725 #define CoreDebug_DEMCR_MON_EN_Pos 16U
1726 #define CoreDebug_DEMCR_MON_EN_Msk (1UL << CoreDebug_DEMCR_MON_EN_Pos)
1727
1728 #define CoreDebug_DEMCR_VC_HARDERR_Pos 10U
1729 #define CoreDebug_DEMCR_VC_HARDERR_Msk (1UL << CoreDebug_DEMCR_VC_HARDERR_Pos)
1730
1731 #define CoreDebug_DEMCR_VC_INTERR_Pos 9U
1732 #define CoreDebug_DEMCR_VC_INTERR_Msk (1UL << CoreDebug_DEMCR_VC_INTERR_Pos)
1733
1734 #define CoreDebug_DEMCR_VC_BUSERR_Pos 8U
1735 #define CoreDebug_DEMCR_VC_BUSERR_Msk (1UL << CoreDebug_DEMCR_VC_BUSERR_Pos)
1736
1737 #define CoreDebug_DEMCR_VC_STATERR_Pos 7U
1738 #define CoreDebug_DEMCR_VC_STATERR_Msk (1UL << CoreDebug_DEMCR_VC_STATERR_Pos)
1739
1740 #define CoreDebug_DEMCR_VC_CHKERR_Pos 6U
1741 #define CoreDebug_DEMCR_VC_CHKERR_Msk (1UL << CoreDebug_DEMCR_VC_CHKERR_Pos)
1742
1743 #define CoreDebug_DEMCR_VC_NOCPERR_Pos 5U
1744 #define CoreDebug_DEMCR_VC_NOCPERR_Msk (1UL << CoreDebug_DEMCR_VC_NOCPERR_Pos)
1745
1746 #define CoreDebug_DEMCR_VC_MMERR_Pos 4U
1747 #define CoreDebug_DEMCR_VC_MMERR_Msk (1UL << CoreDebug_DEMCR_VC_MMERR_Pos)
1748
1749 #define CoreDebug_DEMCR_VC_CORERESET_Pos 0U
1750 #define CoreDebug_DEMCR_VC_CORERESET_Msk (1UL )
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768 #define _VAL2FLD(field, value) (((uint32_t)(value) << field ## _Pos) & field ## _Msk)
1769
1770
1771
1772
1773
1774
1775
1776 #define _FLD2VAL(field, value) (((uint32_t)(value) & field ## _Msk) >> field ## _Pos)
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789 #define SCS_BASE (0xE000E000UL)
1790 #define ITM_BASE (0xE0000000UL)
1791 #define DWT_BASE (0xE0001000UL)
1792 #define TPI_BASE (0xE0040000UL)
1793 #define CoreDebug_BASE (0xE000EDF0UL)
1794 #define SysTick_BASE (SCS_BASE + 0x0010UL)
1795 #define NVIC_BASE (SCS_BASE + 0x0100UL)
1796 #define SCB_BASE (SCS_BASE + 0x0D00UL)
1797
1798 #define SCnSCB ((SCnSCB_Type *) SCS_BASE )
1799 #define SCB ((SCB_Type *) SCB_BASE )
1800 #define SysTick ((SysTick_Type *) SysTick_BASE )
1801 #define NVIC ((NVIC_Type *) NVIC_BASE )
1802 #define ITM ((ITM_Type *) ITM_BASE )
1803 #define DWT ((DWT_Type *) DWT_BASE )
1804 #define TPI ((TPI_Type *) TPI_BASE )
1805 #define CoreDebug ((CoreDebug_Type *) CoreDebug_BASE)
1806
1807 #if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U)
1808 #define MPU_BASE (SCS_BASE + 0x0D90UL)
1809 #define MPU ((MPU_Type *) MPU_BASE )
1810 #endif
1811
1812 #define FPU_BASE (SCS_BASE + 0x0F30UL)
1813 #define FPU ((FPU_Type *) FPU_BASE )
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828 #define ITM_TCR_TraceBusID_Pos (ITM_TCR_TRACEBUSID_Pos)
1829 #define ITM_TCR_TraceBusID_Msk (ITM_TCR_TRACEBUSID_Msk)
1830
1831 #define ITM_TCR_TSPrescale_Pos (ITM_TCR_TSPRESCALE_Pos)
1832 #define ITM_TCR_TSPrescale_Msk (ITM_TCR_TSPRESCALE_Msk)
1833
1834
1835 #define ITM_LSR_ByteAcc_Pos (ITM_LSR_BYTEACC_Pos)
1836 #define ITM_LSR_ByteAcc_Msk (ITM_LSR_BYTEACC_Msk)
1837
1838 #define ITM_LSR_Access_Pos (ITM_LSR_ACCESS_Pos)
1839 #define ITM_LSR_Access_Msk (ITM_LSR_ACCESS_Msk)
1840
1841 #define ITM_LSR_Present_Pos (ITM_LSR_PRESENT_Pos)
1842 #define ITM_LSR_Present_Msk (ITM_LSR_PRESENT_Msk)
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870 #ifdef CMSIS_NVIC_VIRTUAL
1871 #ifndef CMSIS_NVIC_VIRTUAL_HEADER_FILE
1872 #define CMSIS_NVIC_VIRTUAL_HEADER_FILE "cmsis_nvic_virtual.h"
1873 #endif
1874 #include CMSIS_NVIC_VIRTUAL_HEADER_FILE
1875 #else
1876 #define NVIC_SetPriorityGrouping __NVIC_SetPriorityGrouping
1877 #define NVIC_GetPriorityGrouping __NVIC_GetPriorityGrouping
1878 #define NVIC_EnableIRQ __NVIC_EnableIRQ
1879 #define NVIC_GetEnableIRQ __NVIC_GetEnableIRQ
1880 #define NVIC_DisableIRQ __NVIC_DisableIRQ
1881 #define NVIC_GetPendingIRQ __NVIC_GetPendingIRQ
1882 #define NVIC_SetPendingIRQ __NVIC_SetPendingIRQ
1883 #define NVIC_ClearPendingIRQ __NVIC_ClearPendingIRQ
1884 #define NVIC_GetActive __NVIC_GetActive
1885 #define NVIC_SetPriority __NVIC_SetPriority
1886 #define NVIC_GetPriority __NVIC_GetPriority
1887 #define NVIC_SystemReset __NVIC_SystemReset
1888 #endif
1889
1890 #ifdef CMSIS_VECTAB_VIRTUAL
1891 #ifndef CMSIS_VECTAB_VIRTUAL_HEADER_FILE
1892 #define CMSIS_VECTAB_VIRTUAL_HEADER_FILE "cmsis_vectab_virtual.h"
1893 #endif
1894 #include CMSIS_VECTAB_VIRTUAL_HEADER_FILE
1895 #else
1896 #define NVIC_SetVector __NVIC_SetVector
1897 #define NVIC_GetVector __NVIC_GetVector
1898 #endif
1899
1900 #define NVIC_USER_IRQ_OFFSET 16
1901
1902
1903
1904 #define EXC_RETURN_HANDLER (0xFFFFFFF1UL)
1905 #define EXC_RETURN_THREAD_MSP (0xFFFFFFF9UL)
1906 #define EXC_RETURN_THREAD_PSP (0xFFFFFFFDUL)
1907 #define EXC_RETURN_HANDLER_FPU (0xFFFFFFE1UL)
1908 #define EXC_RETURN_THREAD_MSP_FPU (0xFFFFFFE9UL)
1909 #define EXC_RETURN_THREAD_PSP_FPU (0xFFFFFFEDUL)
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921 __STATIC_INLINE void __NVIC_SetPriorityGrouping(uint32_t PriorityGroup)
1922 {
1923 uint32_t reg_value;
1924 uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL);
1925
1926 reg_value = SCB->AIRCR;
1927 reg_value &= ~((uint32_t)(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk));
1928 reg_value = (reg_value |
1929 ((uint32_t)0x5FAUL << SCB_AIRCR_VECTKEY_Pos) |
1930 (PriorityGroupTmp << SCB_AIRCR_PRIGROUP_Pos) );
1931 SCB->AIRCR = reg_value;
1932 }
1933
1934
1935
1936
1937
1938
1939
1940 __STATIC_INLINE uint32_t __NVIC_GetPriorityGrouping(void)
1941 {
1942 return ((uint32_t)((SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) >> SCB_AIRCR_PRIGROUP_Pos));
1943 }
1944
1945
1946
1947
1948
1949
1950
1951
1952 __STATIC_INLINE void __NVIC_EnableIRQ(IRQn_Type IRQn)
1953 {
1954 if ((int32_t)(IRQn) >= 0)
1955 {
1956 __COMPILER_BARRIER();
1957 NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
1958 __COMPILER_BARRIER();
1959 }
1960 }
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971 __STATIC_INLINE uint32_t __NVIC_GetEnableIRQ(IRQn_Type IRQn)
1972 {
1973 if ((int32_t)(IRQn) >= 0)
1974 {
1975 return((uint32_t)(((NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
1976 }
1977 else
1978 {
1979 return(0U);
1980 }
1981 }
1982
1983
1984
1985
1986
1987
1988
1989
1990 __STATIC_INLINE void __NVIC_DisableIRQ(IRQn_Type IRQn)
1991 {
1992 if ((int32_t)(IRQn) >= 0)
1993 {
1994 NVIC->ICER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
1995 __DSB();
1996 __ISB();
1997 }
1998 }
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009 __STATIC_INLINE uint32_t __NVIC_GetPendingIRQ(IRQn_Type IRQn)
2010 {
2011 if ((int32_t)(IRQn) >= 0)
2012 {
2013 return((uint32_t)(((NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
2014 }
2015 else
2016 {
2017 return(0U);
2018 }
2019 }
2020
2021
2022
2023
2024
2025
2026
2027
2028 __STATIC_INLINE void __NVIC_SetPendingIRQ(IRQn_Type IRQn)
2029 {
2030 if ((int32_t)(IRQn) >= 0)
2031 {
2032 NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
2033 }
2034 }
2035
2036
2037
2038
2039
2040
2041
2042
2043 __STATIC_INLINE void __NVIC_ClearPendingIRQ(IRQn_Type IRQn)
2044 {
2045 if ((int32_t)(IRQn) >= 0)
2046 {
2047 NVIC->ICPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
2048 }
2049 }
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060 __STATIC_INLINE uint32_t __NVIC_GetActive(IRQn_Type IRQn)
2061 {
2062 if ((int32_t)(IRQn) >= 0)
2063 {
2064 return((uint32_t)(((NVIC->IABR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
2065 }
2066 else
2067 {
2068 return(0U);
2069 }
2070 }
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082 __STATIC_INLINE void __NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority)
2083 {
2084 if ((int32_t)(IRQn) >= 0)
2085 {
2086 NVIC->IP[((uint32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL);
2087 }
2088 else
2089 {
2090 SCB->SHPR[(((uint32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL);
2091 }
2092 }
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104 __STATIC_INLINE uint32_t __NVIC_GetPriority(IRQn_Type IRQn)
2105 {
2106
2107 if ((int32_t)(IRQn) >= 0)
2108 {
2109 return(((uint32_t)NVIC->IP[((uint32_t)IRQn)] >> (8U - __NVIC_PRIO_BITS)));
2110 }
2111 else
2112 {
2113 return(((uint32_t)SCB->SHPR[(((uint32_t)IRQn) & 0xFUL)-4UL] >> (8U - __NVIC_PRIO_BITS)));
2114 }
2115 }
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129 __STATIC_INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority)
2130 {
2131 uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL);
2132 uint32_t PreemptPriorityBits;
2133 uint32_t SubPriorityBits;
2134
2135 PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp);
2136 SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS));
2137
2138 return (
2139 ((PreemptPriority & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL)) << SubPriorityBits) |
2140 ((SubPriority & (uint32_t)((1UL << (SubPriorityBits )) - 1UL)))
2141 );
2142 }
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156 __STATIC_INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* const pPreemptPriority, uint32_t* const pSubPriority)
2157 {
2158 uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL);
2159 uint32_t PreemptPriorityBits;
2160 uint32_t SubPriorityBits;
2161
2162 PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp);
2163 SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS));
2164
2165 *pPreemptPriority = (Priority >> SubPriorityBits) & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL);
2166 *pSubPriority = (Priority ) & (uint32_t)((1UL << (SubPriorityBits )) - 1UL);
2167 }
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179 __STATIC_INLINE void __NVIC_SetVector(IRQn_Type IRQn, uint32_t vector)
2180 {
2181 uint32_t *vectors = (uint32_t *)SCB->VTOR;
2182 vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET] = vector;
2183 __DSB();
2184 }
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195 __STATIC_INLINE uint32_t __NVIC_GetVector(IRQn_Type IRQn)
2196 {
2197 uint32_t *vectors = (uint32_t *)SCB->VTOR;
2198 return vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET];
2199 }
2200
2201
2202
2203
2204
2205
2206 __NO_RETURN __STATIC_INLINE void __NVIC_SystemReset(void)
2207 {
2208 __DSB();
2209
2210 SCB->AIRCR = (uint32_t)((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) |
2211 (SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) |
2212 SCB_AIRCR_SYSRESETREQ_Msk );
2213 __DSB();
2214
2215 for(;;)
2216 {
2217 __NOP();
2218 }
2219 }
2220
2221
2222
2223
2224
2225
2226 #if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U)
2227
2228 #include "mpu_armv7.h"
2229
2230 #endif
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249 __STATIC_INLINE uint32_t SCB_GetFPUType(void)
2250 {
2251 uint32_t mvfr0;
2252
2253 mvfr0 = SCB->MVFR0;
2254 if ((mvfr0 & (FPU_MVFR0_Single_precision_Msk | FPU_MVFR0_Double_precision_Msk)) == 0x220U)
2255 {
2256 return 2U;
2257 }
2258 else if ((mvfr0 & (FPU_MVFR0_Single_precision_Msk | FPU_MVFR0_Double_precision_Msk)) == 0x020U)
2259 {
2260 return 1U;
2261 }
2262 else
2263 {
2264 return 0U;
2265 }
2266 }
2267
2268
2269
2270
2271
2272
2273 #if ((defined (__ICACHE_PRESENT) && (__ICACHE_PRESENT == 1U)) || \
2274 (defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U)))
2275 #include "cachel1_armv7.h"
2276 #endif
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287 #if defined (__Vendor_SysTickConfig) && (__Vendor_SysTickConfig == 0U)
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300 __STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks)
2301 {
2302 if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk)
2303 {
2304 return (1UL);
2305 }
2306
2307 SysTick->LOAD = (uint32_t)(ticks - 1UL);
2308 NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL);
2309 SysTick->VAL = 0UL;
2310 SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
2311 SysTick_CTRL_TICKINT_Msk |
2312 SysTick_CTRL_ENABLE_Msk;
2313 return (0UL);
2314 }
2315
2316 #endif
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330 extern volatile int32_t ITM_RxBuffer;
2331 #define ITM_RXBUFFER_EMPTY ((int32_t)0x5AA55AA5U)
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342 __STATIC_INLINE uint32_t ITM_SendChar (uint32_t ch)
2343 {
2344 if (((ITM->TCR & ITM_TCR_ITMENA_Msk) != 0UL) &&
2345 ((ITM->TER & 1UL ) != 0UL) )
2346 {
2347 while (ITM->PORT[0U].u32 == 0UL)
2348 {
2349 __NOP();
2350 }
2351 ITM->PORT[0U].u8 = (uint8_t)ch;
2352 }
2353 return (ch);
2354 }
2355
2356
2357
2358
2359
2360
2361
2362
2363 __STATIC_INLINE int32_t ITM_ReceiveChar (void)
2364 {
2365 int32_t ch = -1;
2366
2367 if (ITM_RxBuffer != ITM_RXBUFFER_EMPTY)
2368 {
2369 ch = ITM_RxBuffer;
2370 ITM_RxBuffer = ITM_RXBUFFER_EMPTY;
2371 }
2372
2373 return (ch);
2374 }
2375
2376
2377
2378
2379
2380
2381
2382
2383 __STATIC_INLINE int32_t ITM_CheckChar (void)
2384 {
2385
2386 if (ITM_RxBuffer == ITM_RXBUFFER_EMPTY)
2387 {
2388 return (0);
2389 }
2390 else
2391 {
2392 return (1);
2393 }
2394 }
2395
2396
2397
2398
2399
2400
2401 #ifdef __cplusplus
2402 }
2403 #endif
2404
2405 #endif
2406
2407 #endif