23 #if defined ( __ICCARM__ ) 24 #pragma system_include 31 #ifndef __CORE_CM4_H_GENERIC 32 #define __CORE_CM4_H_GENERIC 76 #define __CM4_CMSIS_VERSION_MAIN (0x02) 77 #define __CM4_CMSIS_VERSION_SUB (0x10) 78 #define __CM4_CMSIS_VERSION ((__CM4_CMSIS_VERSION_MAIN << 16) | __CM4_CMSIS_VERSION_SUB) 80 #define __CORTEX_M (0x04) 83 #if defined ( __CC_ARM ) 85 #define __INLINE __inline 87 #elif defined ( __ICCARM__ ) 89 #define __INLINE inline 91 #elif defined ( __GNUC__ ) 93 #define __INLINE inline 95 #elif defined ( __TASKING__ ) 97 #define __INLINE inline 102 #if defined ( __CC_ARM ) 103 #if defined __TARGET_FPU_VFP 104 #if (__FPU_PRESENT == 1) 107 #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" 114 #elif defined ( __ICCARM__ ) 115 #if defined __ARMVFP__ 116 #if (__FPU_PRESENT == 1) 119 #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" 126 #elif defined ( __GNUC__ ) 127 #if defined (__VFP_FP__) && !defined(__SOFTFP__) 128 #if (__FPU_PRESENT == 1) 131 #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" 138 #elif defined ( __TASKING__ ) 150 #ifndef __CMSIS_GENERIC 152 #ifndef __CORE_CM4_H_DEPENDANT 153 #define __CORE_CM4_H_DEPENDANT 156 #if defined __CHECK_DEVICE_DEFINES 158 #define __CM4_REV 0x0000 159 #warning "__CM4_REV not defined in device header file; using default!" 162 #ifndef __FPU_PRESENT 163 #define __FPU_PRESENT 0 164 #warning "__FPU_PRESENT not defined in device header file; using default!" 167 #ifndef __MPU_PRESENT 168 #define __MPU_PRESENT 0 169 #warning "__MPU_PRESENT not defined in device header file; using default!" 172 #ifndef __NVIC_PRIO_BITS 173 #define __NVIC_PRIO_BITS 4 174 #warning "__NVIC_PRIO_BITS not defined in device header file; using default!" 177 #ifndef __Vendor_SysTickConfig 178 #define __Vendor_SysTickConfig 0 179 #warning "__Vendor_SysTickConfig not defined in device header file; using default!" 187 #define __I volatile const 190 #define __IO volatile 222 #if (__CORTEX_M != 0x04) 223 uint32_t _reserved0:27;
225 uint32_t _reserved0:16;
227 uint32_t _reserved1:7;
246 uint32_t _reserved0:23;
259 #if (__CORTEX_M != 0x04) 260 uint32_t _reserved0:15;
262 uint32_t _reserved0:7;
264 uint32_t _reserved1:4;
287 uint32_t _reserved0:29;
305 __IO uint32_t ISER[8];
306 uint32_t RESERVED0[24];
307 __IO uint32_t ICER[8];
308 uint32_t RSERVED1[24];
309 __IO uint32_t ISPR[8];
310 uint32_t RESERVED2[24];
311 __IO uint32_t ICPR[8];
312 uint32_t RESERVED3[24];
313 __IO uint32_t IABR[8];
314 uint32_t RESERVED4[56];
315 __IO uint8_t IP[240];
316 uint32_t RESERVED5[644];
321 #define NVIC_STIR_INTID_Pos 0 322 #define NVIC_STIR_INTID_Msk (0x1FFUL << NVIC_STIR_INTID_Pos) 343 __IO uint8_t SHP[12];
354 __I uint32_t MMFR[4];
355 __I uint32_t ISAR[5];
356 uint32_t RESERVED0[5];
361 #define SCB_CPUID_IMPLEMENTER_Pos 24 362 #define SCB_CPUID_IMPLEMENTER_Msk (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos) 364 #define SCB_CPUID_VARIANT_Pos 20 365 #define SCB_CPUID_VARIANT_Msk (0xFUL << SCB_CPUID_VARIANT_Pos) 367 #define SCB_CPUID_ARCHITECTURE_Pos 16 368 #define SCB_CPUID_ARCHITECTURE_Msk (0xFUL << SCB_CPUID_ARCHITECTURE_Pos) 370 #define SCB_CPUID_PARTNO_Pos 4 371 #define SCB_CPUID_PARTNO_Msk (0xFFFUL << SCB_CPUID_PARTNO_Pos) 373 #define SCB_CPUID_REVISION_Pos 0 374 #define SCB_CPUID_REVISION_Msk (0xFUL << SCB_CPUID_REVISION_Pos) 377 #define SCB_ICSR_NMIPENDSET_Pos 31 378 #define SCB_ICSR_NMIPENDSET_Msk (1UL << SCB_ICSR_NMIPENDSET_Pos) 380 #define SCB_ICSR_PENDSVSET_Pos 28 381 #define SCB_ICSR_PENDSVSET_Msk (1UL << SCB_ICSR_PENDSVSET_Pos) 383 #define SCB_ICSR_PENDSVCLR_Pos 27 384 #define SCB_ICSR_PENDSVCLR_Msk (1UL << SCB_ICSR_PENDSVCLR_Pos) 386 #define SCB_ICSR_PENDSTSET_Pos 26 387 #define SCB_ICSR_PENDSTSET_Msk (1UL << SCB_ICSR_PENDSTSET_Pos) 389 #define SCB_ICSR_PENDSTCLR_Pos 25 390 #define SCB_ICSR_PENDSTCLR_Msk (1UL << SCB_ICSR_PENDSTCLR_Pos) 392 #define SCB_ICSR_ISRPREEMPT_Pos 23 393 #define SCB_ICSR_ISRPREEMPT_Msk (1UL << SCB_ICSR_ISRPREEMPT_Pos) 395 #define SCB_ICSR_ISRPENDING_Pos 22 396 #define SCB_ICSR_ISRPENDING_Msk (1UL << SCB_ICSR_ISRPENDING_Pos) 398 #define SCB_ICSR_VECTPENDING_Pos 12 399 #define SCB_ICSR_VECTPENDING_Msk (0x1FFUL << SCB_ICSR_VECTPENDING_Pos) 401 #define SCB_ICSR_RETTOBASE_Pos 11 402 #define SCB_ICSR_RETTOBASE_Msk (1UL << SCB_ICSR_RETTOBASE_Pos) 404 #define SCB_ICSR_VECTACTIVE_Pos 0 405 #define SCB_ICSR_VECTACTIVE_Msk (0x1FFUL << SCB_ICSR_VECTACTIVE_Pos) 408 #define SCB_VTOR_TBLOFF_Pos 7 409 #define SCB_VTOR_TBLOFF_Msk (0x1FFFFFFUL << SCB_VTOR_TBLOFF_Pos) 412 #define SCB_AIRCR_VECTKEY_Pos 16 413 #define SCB_AIRCR_VECTKEY_Msk (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos) 415 #define SCB_AIRCR_VECTKEYSTAT_Pos 16 416 #define SCB_AIRCR_VECTKEYSTAT_Msk (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos) 418 #define SCB_AIRCR_ENDIANESS_Pos 15 419 #define SCB_AIRCR_ENDIANESS_Msk (1UL << SCB_AIRCR_ENDIANESS_Pos) 421 #define SCB_AIRCR_PRIGROUP_Pos 8 422 #define SCB_AIRCR_PRIGROUP_Msk (7UL << SCB_AIRCR_PRIGROUP_Pos) 424 #define SCB_AIRCR_SYSRESETREQ_Pos 2 425 #define SCB_AIRCR_SYSRESETREQ_Msk (1UL << SCB_AIRCR_SYSRESETREQ_Pos) 427 #define SCB_AIRCR_VECTCLRACTIVE_Pos 1 428 #define SCB_AIRCR_VECTCLRACTIVE_Msk (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos) 430 #define SCB_AIRCR_VECTRESET_Pos 0 431 #define SCB_AIRCR_VECTRESET_Msk (1UL << SCB_AIRCR_VECTRESET_Pos) 434 #define SCB_SCR_SEVONPEND_Pos 4 435 #define SCB_SCR_SEVONPEND_Msk (1UL << SCB_SCR_SEVONPEND_Pos) 437 #define SCB_SCR_SLEEPDEEP_Pos 2 438 #define SCB_SCR_SLEEPDEEP_Msk (1UL << SCB_SCR_SLEEPDEEP_Pos) 440 #define SCB_SCR_SLEEPONEXIT_Pos 1 441 #define SCB_SCR_SLEEPONEXIT_Msk (1UL << SCB_SCR_SLEEPONEXIT_Pos) 444 #define SCB_CCR_STKALIGN_Pos 9 445 #define SCB_CCR_STKALIGN_Msk (1UL << SCB_CCR_STKALIGN_Pos) 447 #define SCB_CCR_BFHFNMIGN_Pos 8 448 #define SCB_CCR_BFHFNMIGN_Msk (1UL << SCB_CCR_BFHFNMIGN_Pos) 450 #define SCB_CCR_DIV_0_TRP_Pos 4 451 #define SCB_CCR_DIV_0_TRP_Msk (1UL << SCB_CCR_DIV_0_TRP_Pos) 453 #define SCB_CCR_UNALIGN_TRP_Pos 3 454 #define SCB_CCR_UNALIGN_TRP_Msk (1UL << SCB_CCR_UNALIGN_TRP_Pos) 456 #define SCB_CCR_USERSETMPEND_Pos 1 457 #define SCB_CCR_USERSETMPEND_Msk (1UL << SCB_CCR_USERSETMPEND_Pos) 459 #define SCB_CCR_NONBASETHRDENA_Pos 0 460 #define SCB_CCR_NONBASETHRDENA_Msk (1UL << SCB_CCR_NONBASETHRDENA_Pos) 463 #define SCB_SHCSR_USGFAULTENA_Pos 18 464 #define SCB_SHCSR_USGFAULTENA_Msk (1UL << SCB_SHCSR_USGFAULTENA_Pos) 466 #define SCB_SHCSR_BUSFAULTENA_Pos 17 467 #define SCB_SHCSR_BUSFAULTENA_Msk (1UL << SCB_SHCSR_BUSFAULTENA_Pos) 469 #define SCB_SHCSR_MEMFAULTENA_Pos 16 470 #define SCB_SHCSR_MEMFAULTENA_Msk (1UL << SCB_SHCSR_MEMFAULTENA_Pos) 472 #define SCB_SHCSR_SVCALLPENDED_Pos 15 473 #define SCB_SHCSR_SVCALLPENDED_Msk (1UL << SCB_SHCSR_SVCALLPENDED_Pos) 475 #define SCB_SHCSR_BUSFAULTPENDED_Pos 14 476 #define SCB_SHCSR_BUSFAULTPENDED_Msk (1UL << SCB_SHCSR_BUSFAULTPENDED_Pos) 478 #define SCB_SHCSR_MEMFAULTPENDED_Pos 13 479 #define SCB_SHCSR_MEMFAULTPENDED_Msk (1UL << SCB_SHCSR_MEMFAULTPENDED_Pos) 481 #define SCB_SHCSR_USGFAULTPENDED_Pos 12 482 #define SCB_SHCSR_USGFAULTPENDED_Msk (1UL << SCB_SHCSR_USGFAULTPENDED_Pos) 484 #define SCB_SHCSR_SYSTICKACT_Pos 11 485 #define SCB_SHCSR_SYSTICKACT_Msk (1UL << SCB_SHCSR_SYSTICKACT_Pos) 487 #define SCB_SHCSR_PENDSVACT_Pos 10 488 #define SCB_SHCSR_PENDSVACT_Msk (1UL << SCB_SHCSR_PENDSVACT_Pos) 490 #define SCB_SHCSR_MONITORACT_Pos 8 491 #define SCB_SHCSR_MONITORACT_Msk (1UL << SCB_SHCSR_MONITORACT_Pos) 493 #define SCB_SHCSR_SVCALLACT_Pos 7 494 #define SCB_SHCSR_SVCALLACT_Msk (1UL << SCB_SHCSR_SVCALLACT_Pos) 496 #define SCB_SHCSR_USGFAULTACT_Pos 3 497 #define SCB_SHCSR_USGFAULTACT_Msk (1UL << SCB_SHCSR_USGFAULTACT_Pos) 499 #define SCB_SHCSR_BUSFAULTACT_Pos 1 500 #define SCB_SHCSR_BUSFAULTACT_Msk (1UL << SCB_SHCSR_BUSFAULTACT_Pos) 502 #define SCB_SHCSR_MEMFAULTACT_Pos 0 503 #define SCB_SHCSR_MEMFAULTACT_Msk (1UL << SCB_SHCSR_MEMFAULTACT_Pos) 506 #define SCB_CFSR_USGFAULTSR_Pos 16 507 #define SCB_CFSR_USGFAULTSR_Msk (0xFFFFUL << SCB_CFSR_USGFAULTSR_Pos) 509 #define SCB_CFSR_BUSFAULTSR_Pos 8 510 #define SCB_CFSR_BUSFAULTSR_Msk (0xFFUL << SCB_CFSR_BUSFAULTSR_Pos) 512 #define SCB_CFSR_MEMFAULTSR_Pos 0 513 #define SCB_CFSR_MEMFAULTSR_Msk (0xFFUL << SCB_CFSR_MEMFAULTSR_Pos) 516 #define SCB_HFSR_DEBUGEVT_Pos 31 517 #define SCB_HFSR_DEBUGEVT_Msk (1UL << SCB_HFSR_DEBUGEVT_Pos) 519 #define SCB_HFSR_FORCED_Pos 30 520 #define SCB_HFSR_FORCED_Msk (1UL << SCB_HFSR_FORCED_Pos) 522 #define SCB_HFSR_VECTTBL_Pos 1 523 #define SCB_HFSR_VECTTBL_Msk (1UL << SCB_HFSR_VECTTBL_Pos) 526 #define SCB_DFSR_EXTERNAL_Pos 4 527 #define SCB_DFSR_EXTERNAL_Msk (1UL << SCB_DFSR_EXTERNAL_Pos) 529 #define SCB_DFSR_VCATCH_Pos 3 530 #define SCB_DFSR_VCATCH_Msk (1UL << SCB_DFSR_VCATCH_Pos) 532 #define SCB_DFSR_DWTTRAP_Pos 2 533 #define SCB_DFSR_DWTTRAP_Msk (1UL << SCB_DFSR_DWTTRAP_Pos) 535 #define SCB_DFSR_BKPT_Pos 1 536 #define SCB_DFSR_BKPT_Msk (1UL << SCB_DFSR_BKPT_Pos) 538 #define SCB_DFSR_HALTED_Pos 0 539 #define SCB_DFSR_HALTED_Msk (1UL << SCB_DFSR_HALTED_Pos) 554 uint32_t RESERVED0[1];
560 #define SCnSCB_ICTR_INTLINESNUM_Pos 0 561 #define SCnSCB_ICTR_INTLINESNUM_Msk (0xFUL << SCnSCB_ICTR_INTLINESNUM_Pos) 564 #define SCnSCB_ACTLR_DISOOFP_Pos 9 565 #define SCnSCB_ACTLR_DISOOFP_Msk (1UL << SCnSCB_ACTLR_DISOOFP_Pos) 567 #define SCnSCB_ACTLR_DISFPCA_Pos 8 568 #define SCnSCB_ACTLR_DISFPCA_Msk (1UL << SCnSCB_ACTLR_DISFPCA_Pos) 570 #define SCnSCB_ACTLR_DISFOLD_Pos 2 571 #define SCnSCB_ACTLR_DISFOLD_Msk (1UL << SCnSCB_ACTLR_DISFOLD_Pos) 573 #define SCnSCB_ACTLR_DISDEFWBUF_Pos 1 574 #define SCnSCB_ACTLR_DISDEFWBUF_Msk (1UL << SCnSCB_ACTLR_DISDEFWBUF_Pos) 576 #define SCnSCB_ACTLR_DISMCYCINT_Pos 0 577 #define SCnSCB_ACTLR_DISMCYCINT_Msk (1UL << SCnSCB_ACTLR_DISMCYCINT_Pos) 599 #define SysTick_CTRL_COUNTFLAG_Pos 16 600 #define SysTick_CTRL_COUNTFLAG_Msk (1UL << SysTick_CTRL_COUNTFLAG_Pos) 602 #define SysTick_CTRL_CLKSOURCE_Pos 2 603 #define SysTick_CTRL_CLKSOURCE_Msk (1UL << SysTick_CTRL_CLKSOURCE_Pos) 605 #define SysTick_CTRL_TICKINT_Pos 1 606 #define SysTick_CTRL_TICKINT_Msk (1UL << SysTick_CTRL_TICKINT_Pos) 608 #define SysTick_CTRL_ENABLE_Pos 0 609 #define SysTick_CTRL_ENABLE_Msk (1UL << SysTick_CTRL_ENABLE_Pos) 612 #define SysTick_LOAD_RELOAD_Pos 0 613 #define SysTick_LOAD_RELOAD_Msk (0xFFFFFFUL << SysTick_LOAD_RELOAD_Pos) 616 #define SysTick_VAL_CURRENT_Pos 0 617 #define SysTick_VAL_CURRENT_Msk (0xFFFFFFUL << SysTick_VAL_CURRENT_Pos) 620 #define SysTick_CALIB_NOREF_Pos 31 621 #define SysTick_CALIB_NOREF_Msk (1UL << SysTick_CALIB_NOREF_Pos) 623 #define SysTick_CALIB_SKEW_Pos 30 624 #define SysTick_CALIB_SKEW_Msk (1UL << SysTick_CALIB_SKEW_Pos) 626 #define SysTick_CALIB_TENMS_Pos 0 627 #define SysTick_CALIB_TENMS_Msk (0xFFFFFFUL << SysTick_VAL_CURRENT_Pos) 648 uint32_t RESERVED0[864];
650 uint32_t RESERVED1[15];
652 uint32_t RESERVED2[15];
657 #define ITM_TPR_PRIVMASK_Pos 0 658 #define ITM_TPR_PRIVMASK_Msk (0xFUL << ITM_TPR_PRIVMASK_Pos) 661 #define ITM_TCR_BUSY_Pos 23 662 #define ITM_TCR_BUSY_Msk (1UL << ITM_TCR_BUSY_Pos) 664 #define ITM_TCR_TraceBusID_Pos 16 665 #define ITM_TCR_TraceBusID_Msk (0x7FUL << ITM_TCR_TraceBusID_Pos) 667 #define ITM_TCR_GTSFREQ_Pos 10 668 #define ITM_TCR_GTSFREQ_Msk (3UL << ITM_TCR_GTSFREQ_Pos) 670 #define ITM_TCR_TSPrescale_Pos 8 671 #define ITM_TCR_TSPrescale_Msk (3UL << ITM_TCR_TSPrescale_Pos) 673 #define ITM_TCR_SWOENA_Pos 4 674 #define ITM_TCR_SWOENA_Msk (1UL << ITM_TCR_SWOENA_Pos) 676 #define ITM_TCR_TXENA_Pos 3 677 #define ITM_TCR_TXENA_Msk (1UL << ITM_TCR_TXENA_Pos) 679 #define ITM_TCR_SYNCENA_Pos 2 680 #define ITM_TCR_SYNCENA_Msk (1UL << ITM_TCR_SYNCENA_Pos) 682 #define ITM_TCR_TSENA_Pos 1 683 #define ITM_TCR_TSENA_Msk (1UL << ITM_TCR_TSENA_Pos) 685 #define ITM_TCR_ITMENA_Pos 0 686 #define ITM_TCR_ITMENA_Msk (1UL << ITM_TCR_ITMENA_Pos) 691 #if (__MPU_PRESENT == 1) 707 __IO uint32_t RBAR_A1;
708 __IO uint32_t RASR_A1;
709 __IO uint32_t RBAR_A2;
710 __IO uint32_t RASR_A2;
711 __IO uint32_t RBAR_A3;
712 __IO uint32_t RASR_A3;
716 #define MPU_TYPE_IREGION_Pos 16 717 #define MPU_TYPE_IREGION_Msk (0xFFUL << MPU_TYPE_IREGION_Pos) 719 #define MPU_TYPE_DREGION_Pos 8 720 #define MPU_TYPE_DREGION_Msk (0xFFUL << MPU_TYPE_DREGION_Pos) 722 #define MPU_TYPE_SEPARATE_Pos 0 723 #define MPU_TYPE_SEPARATE_Msk (1UL << MPU_TYPE_SEPARATE_Pos) 726 #define MPU_CTRL_PRIVDEFENA_Pos 2 727 #define MPU_CTRL_PRIVDEFENA_Msk (1UL << MPU_CTRL_PRIVDEFENA_Pos) 729 #define MPU_CTRL_HFNMIENA_Pos 1 730 #define MPU_CTRL_HFNMIENA_Msk (1UL << MPU_CTRL_HFNMIENA_Pos) 732 #define MPU_CTRL_ENABLE_Pos 0 733 #define MPU_CTRL_ENABLE_Msk (1UL << MPU_CTRL_ENABLE_Pos) 736 #define MPU_RNR_REGION_Pos 0 737 #define MPU_RNR_REGION_Msk (0xFFUL << MPU_RNR_REGION_Pos) 740 #define MPU_RBAR_ADDR_Pos 5 741 #define MPU_RBAR_ADDR_Msk (0x7FFFFFFUL << MPU_RBAR_ADDR_Pos) 743 #define MPU_RBAR_VALID_Pos 4 744 #define MPU_RBAR_VALID_Msk (1UL << MPU_RBAR_VALID_Pos) 746 #define MPU_RBAR_REGION_Pos 0 747 #define MPU_RBAR_REGION_Msk (0xFUL << MPU_RBAR_REGION_Pos) 750 #define MPU_RASR_ATTRS_Pos 16 751 #define MPU_RASR_ATTRS_Msk (0xFFFFUL << MPU_RASR_ATTRS_Pos) 753 #define MPU_RASR_SRD_Pos 8 754 #define MPU_RASR_SRD_Msk (0xFFUL << MPU_RASR_SRD_Pos) 756 #define MPU_RASR_SIZE_Pos 1 757 #define MPU_RASR_SIZE_Msk (0x1FUL << MPU_RASR_SIZE_Pos) 759 #define MPU_RASR_ENABLE_Pos 0 760 #define MPU_RASR_ENABLE_Msk (1UL << MPU_RASR_ENABLE_Pos) 766 #if (__FPU_PRESENT == 1) 777 uint32_t RESERVED0[1];
780 __IO uint32_t FPDSCR;
786 #define FPU_FPCCR_ASPEN_Pos 31 787 #define FPU_FPCCR_ASPEN_Msk (1UL << FPU_FPCCR_ASPEN_Pos) 789 #define FPU_FPCCR_LSPEN_Pos 30 790 #define FPU_FPCCR_LSPEN_Msk (1UL << FPU_FPCCR_LSPEN_Pos) 792 #define FPU_FPCCR_MONRDY_Pos 8 793 #define FPU_FPCCR_MONRDY_Msk (1UL << FPU_FPCCR_MONRDY_Pos) 795 #define FPU_FPCCR_BFRDY_Pos 6 796 #define FPU_FPCCR_BFRDY_Msk (1UL << FPU_FPCCR_BFRDY_Pos) 798 #define FPU_FPCCR_MMRDY_Pos 5 799 #define FPU_FPCCR_MMRDY_Msk (1UL << FPU_FPCCR_MMRDY_Pos) 801 #define FPU_FPCCR_HFRDY_Pos 4 802 #define FPU_FPCCR_HFRDY_Msk (1UL << FPU_FPCCR_HFRDY_Pos) 804 #define FPU_FPCCR_THREAD_Pos 3 805 #define FPU_FPCCR_THREAD_Msk (1UL << FPU_FPCCR_THREAD_Pos) 807 #define FPU_FPCCR_USER_Pos 1 808 #define FPU_FPCCR_USER_Msk (1UL << FPU_FPCCR_USER_Pos) 810 #define FPU_FPCCR_LSPACT_Pos 0 811 #define FPU_FPCCR_LSPACT_Msk (1UL << FPU_FPCCR_LSPACT_Pos) 814 #define FPU_FPCAR_ADDRESS_Pos 3 815 #define FPU_FPCAR_ADDRESS_Msk (0x1FFFFFFFUL << FPU_FPCAR_ADDRESS_Pos) 818 #define FPU_FPDSCR_AHP_Pos 26 819 #define FPU_FPDSCR_AHP_Msk (1UL << FPU_FPDSCR_AHP_Pos) 821 #define FPU_FPDSCR_DN_Pos 25 822 #define FPU_FPDSCR_DN_Msk (1UL << FPU_FPDSCR_DN_Pos) 824 #define FPU_FPDSCR_FZ_Pos 24 825 #define FPU_FPDSCR_FZ_Msk (1UL << FPU_FPDSCR_FZ_Pos) 827 #define FPU_FPDSCR_RMode_Pos 22 828 #define FPU_FPDSCR_RMode_Msk (3UL << FPU_FPDSCR_RMode_Pos) 831 #define FPU_MVFR0_FP_rounding_modes_Pos 28 832 #define FPU_MVFR0_FP_rounding_modes_Msk (0xFUL << FPU_MVFR0_FP_rounding_modes_Pos) 834 #define FPU_MVFR0_Short_vectors_Pos 24 835 #define FPU_MVFR0_Short_vectors_Msk (0xFUL << FPU_MVFR0_Short_vectors_Pos) 837 #define FPU_MVFR0_Square_root_Pos 20 838 #define FPU_MVFR0_Square_root_Msk (0xFUL << FPU_MVFR0_Square_root_Pos) 840 #define FPU_MVFR0_Divide_Pos 16 841 #define FPU_MVFR0_Divide_Msk (0xFUL << FPU_MVFR0_Divide_Pos) 843 #define FPU_MVFR0_FP_excep_trapping_Pos 12 844 #define FPU_MVFR0_FP_excep_trapping_Msk (0xFUL << FPU_MVFR0_FP_excep_trapping_Pos) 846 #define FPU_MVFR0_Double_precision_Pos 8 847 #define FPU_MVFR0_Double_precision_Msk (0xFUL << FPU_MVFR0_Double_precision_Pos) 849 #define FPU_MVFR0_Single_precision_Pos 4 850 #define FPU_MVFR0_Single_precision_Msk (0xFUL << FPU_MVFR0_Single_precision_Pos) 852 #define FPU_MVFR0_A_SIMD_registers_Pos 0 853 #define FPU_MVFR0_A_SIMD_registers_Msk (0xFUL << FPU_MVFR0_A_SIMD_registers_Pos) 856 #define FPU_MVFR1_FP_fused_MAC_Pos 28 857 #define FPU_MVFR1_FP_fused_MAC_Msk (0xFUL << FPU_MVFR1_FP_fused_MAC_Pos) 859 #define FPU_MVFR1_FP_HPFP_Pos 24 860 #define FPU_MVFR1_FP_HPFP_Msk (0xFUL << FPU_MVFR1_FP_HPFP_Pos) 862 #define FPU_MVFR1_D_NaN_mode_Pos 4 863 #define FPU_MVFR1_D_NaN_mode_Msk (0xFUL << FPU_MVFR1_D_NaN_mode_Pos) 865 #define FPU_MVFR1_FtZ_mode_Pos 0 866 #define FPU_MVFR1_FtZ_mode_Msk (0xFUL << FPU_MVFR1_FtZ_mode_Pos) 889 #define CoreDebug_DHCSR_DBGKEY_Pos 16 890 #define CoreDebug_DHCSR_DBGKEY_Msk (0xFFFFUL << CoreDebug_DHCSR_DBGKEY_Pos) 892 #define CoreDebug_DHCSR_S_RESET_ST_Pos 25 893 #define CoreDebug_DHCSR_S_RESET_ST_Msk (1UL << CoreDebug_DHCSR_S_RESET_ST_Pos) 895 #define CoreDebug_DHCSR_S_RETIRE_ST_Pos 24 896 #define CoreDebug_DHCSR_S_RETIRE_ST_Msk (1UL << CoreDebug_DHCSR_S_RETIRE_ST_Pos) 898 #define CoreDebug_DHCSR_S_LOCKUP_Pos 19 899 #define CoreDebug_DHCSR_S_LOCKUP_Msk (1UL << CoreDebug_DHCSR_S_LOCKUP_Pos) 901 #define CoreDebug_DHCSR_S_SLEEP_Pos 18 902 #define CoreDebug_DHCSR_S_SLEEP_Msk (1UL << CoreDebug_DHCSR_S_SLEEP_Pos) 904 #define CoreDebug_DHCSR_S_HALT_Pos 17 905 #define CoreDebug_DHCSR_S_HALT_Msk (1UL << CoreDebug_DHCSR_S_HALT_Pos) 907 #define CoreDebug_DHCSR_S_REGRDY_Pos 16 908 #define CoreDebug_DHCSR_S_REGRDY_Msk (1UL << CoreDebug_DHCSR_S_REGRDY_Pos) 910 #define CoreDebug_DHCSR_C_SNAPSTALL_Pos 5 911 #define CoreDebug_DHCSR_C_SNAPSTALL_Msk (1UL << CoreDebug_DHCSR_C_SNAPSTALL_Pos) 913 #define CoreDebug_DHCSR_C_MASKINTS_Pos 3 914 #define CoreDebug_DHCSR_C_MASKINTS_Msk (1UL << CoreDebug_DHCSR_C_MASKINTS_Pos) 916 #define CoreDebug_DHCSR_C_STEP_Pos 2 917 #define CoreDebug_DHCSR_C_STEP_Msk (1UL << CoreDebug_DHCSR_C_STEP_Pos) 919 #define CoreDebug_DHCSR_C_HALT_Pos 1 920 #define CoreDebug_DHCSR_C_HALT_Msk (1UL << CoreDebug_DHCSR_C_HALT_Pos) 922 #define CoreDebug_DHCSR_C_DEBUGEN_Pos 0 923 #define CoreDebug_DHCSR_C_DEBUGEN_Msk (1UL << CoreDebug_DHCSR_C_DEBUGEN_Pos) 926 #define CoreDebug_DCRSR_REGWnR_Pos 16 927 #define CoreDebug_DCRSR_REGWnR_Msk (1UL << CoreDebug_DCRSR_REGWnR_Pos) 929 #define CoreDebug_DCRSR_REGSEL_Pos 0 930 #define CoreDebug_DCRSR_REGSEL_Msk (0x1FUL << CoreDebug_DCRSR_REGSEL_Pos) 933 #define CoreDebug_DEMCR_TRCENA_Pos 24 934 #define CoreDebug_DEMCR_TRCENA_Msk (1UL << CoreDebug_DEMCR_TRCENA_Pos) 936 #define CoreDebug_DEMCR_MON_REQ_Pos 19 937 #define CoreDebug_DEMCR_MON_REQ_Msk (1UL << CoreDebug_DEMCR_MON_REQ_Pos) 939 #define CoreDebug_DEMCR_MON_STEP_Pos 18 940 #define CoreDebug_DEMCR_MON_STEP_Msk (1UL << CoreDebug_DEMCR_MON_STEP_Pos) 942 #define CoreDebug_DEMCR_MON_PEND_Pos 17 943 #define CoreDebug_DEMCR_MON_PEND_Msk (1UL << CoreDebug_DEMCR_MON_PEND_Pos) 945 #define CoreDebug_DEMCR_MON_EN_Pos 16 946 #define CoreDebug_DEMCR_MON_EN_Msk (1UL << CoreDebug_DEMCR_MON_EN_Pos) 948 #define CoreDebug_DEMCR_VC_HARDERR_Pos 10 949 #define CoreDebug_DEMCR_VC_HARDERR_Msk (1UL << CoreDebug_DEMCR_VC_HARDERR_Pos) 951 #define CoreDebug_DEMCR_VC_INTERR_Pos 9 952 #define CoreDebug_DEMCR_VC_INTERR_Msk (1UL << CoreDebug_DEMCR_VC_INTERR_Pos) 954 #define CoreDebug_DEMCR_VC_BUSERR_Pos 8 955 #define CoreDebug_DEMCR_VC_BUSERR_Msk (1UL << CoreDebug_DEMCR_VC_BUSERR_Pos) 957 #define CoreDebug_DEMCR_VC_STATERR_Pos 7 958 #define CoreDebug_DEMCR_VC_STATERR_Msk (1UL << CoreDebug_DEMCR_VC_STATERR_Pos) 960 #define CoreDebug_DEMCR_VC_CHKERR_Pos 6 961 #define CoreDebug_DEMCR_VC_CHKERR_Msk (1UL << CoreDebug_DEMCR_VC_CHKERR_Pos) 963 #define CoreDebug_DEMCR_VC_NOCPERR_Pos 5 964 #define CoreDebug_DEMCR_VC_NOCPERR_Msk (1UL << CoreDebug_DEMCR_VC_NOCPERR_Pos) 966 #define CoreDebug_DEMCR_VC_MMERR_Pos 4 967 #define CoreDebug_DEMCR_VC_MMERR_Msk (1UL << CoreDebug_DEMCR_VC_MMERR_Pos) 969 #define CoreDebug_DEMCR_VC_CORERESET_Pos 0 970 #define CoreDebug_DEMCR_VC_CORERESET_Msk (1UL << CoreDebug_DEMCR_VC_CORERESET_Pos) 980 #define SCS_BASE (0xE000E000UL) 981 #define ITM_BASE (0xE0000000UL) 982 #define CoreDebug_BASE (0xE000EDF0UL) 983 #define SysTick_BASE (SCS_BASE + 0x0010UL) 984 #define NVIC_BASE (SCS_BASE + 0x0100UL) 985 #define SCB_BASE (SCS_BASE + 0x0D00UL) 987 #define SCnSCB ((SCnSCB_Type *) SCS_BASE ) 988 #define SCB ((SCB_Type *) SCB_BASE ) 989 #define SysTick ((SysTick_Type *) SysTick_BASE ) 990 #define NVIC ((NVIC_Type *) NVIC_BASE ) 991 #define ITM ((ITM_Type *) ITM_BASE ) 992 #define CoreDebug ((CoreDebug_Type *) CoreDebug_BASE) 994 #if (__MPU_PRESENT == 1) 995 #define MPU_BASE (SCS_BASE + 0x0D90UL) 996 #define MPU ((MPU_Type *) MPU_BASE ) 999 #if (__FPU_PRESENT == 1) 1000 #define FPU_BASE (SCS_BASE + 0x0F30UL) 1001 #define FPU ((FPU_Type *) FPU_BASE ) 1037 static __INLINE
void NVIC_SetPriorityGrouping(uint32_t PriorityGroup)
1040 uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07);
1042 reg_value =
SCB->AIRCR;
1044 reg_value = (reg_value |
1046 (PriorityGroupTmp << 8));
1047 SCB->AIRCR = reg_value;
1058 static __INLINE uint32_t NVIC_GetPriorityGrouping(
void)
1071 static __INLINE
void NVIC_EnableIRQ(IRQn_Type
IRQn)
1074 NVIC->ISER[(uint32_t)((int32_t)
IRQn) >> 5] = (uint32_t)(1 << ((uint32_t)((int32_t)
IRQn) & (uint32_t)0x1F));
1085 static __INLINE
void NVIC_DisableIRQ(IRQn_Type IRQn)
1087 NVIC->ICER[((uint32_t)(IRQn) >> 5)] = (1 << ((uint32_t)(
IRQn) & 0x1F));
1100 static __INLINE uint32_t NVIC_GetPendingIRQ(IRQn_Type IRQn)
1102 return((uint32_t) ((
NVIC->ISPR[(uint32_t)(IRQn) >> 5] & (1 << ((uint32_t)(IRQn) & 0x1F)))?1:0));
1113 static __INLINE
void NVIC_SetPendingIRQ(IRQn_Type IRQn)
1115 NVIC->ISPR[((uint32_t)(IRQn) >> 5)] = (1 << ((uint32_t)(
IRQn) & 0x1F));
1126 static __INLINE
void NVIC_ClearPendingIRQ(IRQn_Type IRQn)
1128 NVIC->ICPR[((uint32_t)(IRQn) >> 5)] = (1 << ((uint32_t)(
IRQn) & 0x1F));
1139 static __INLINE uint32_t NVIC_GetActive(IRQn_Type IRQn)
1141 return((uint32_t)((
NVIC->IABR[(uint32_t)(IRQn) >> 5] & (1 << ((uint32_t)(IRQn) & 0x1F)))?1:0));
1156 static __INLINE
void NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority)
1177 static __INLINE uint32_t NVIC_GetPriority(IRQn_Type IRQn)
1201 static __INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority)
1203 uint32_t PriorityGroupTmp = (PriorityGroup & 0x07);
1204 uint32_t PreemptPriorityBits;
1205 uint32_t SubPriorityBits;
1211 ((PreemptPriority & ((1 << (PreemptPriorityBits)) - 1)) << SubPriorityBits) |
1212 ((SubPriority & ((1 << (SubPriorityBits )) - 1)))
1231 static __INLINE
void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* pPreemptPriority, uint32_t* pSubPriority)
1233 uint32_t PriorityGroupTmp = (PriorityGroup & 0x07);
1234 uint32_t PreemptPriorityBits;
1235 uint32_t SubPriorityBits;
1240 *pPreemptPriority = (Priority >> SubPriorityBits) & ((1 << (PreemptPriorityBits)) - 1);
1241 *pSubPriority = (Priority ) & ((1 << (SubPriorityBits )) - 1);
1249 static __INLINE
void NVIC_SystemReset(
void)
1270 #if (__Vendor_SysTickConfig == 0) 1281 static __INLINE uint32_t SysTick_Config(uint32_t ticks)
1307 #define ITM_RXBUFFER_EMPTY 0x5AA55AA5 1319 static __INLINE uint32_t ITM_SendChar (uint32_t ch) 1323 (
ITM->TER & (1UL << 0) ) )
1325 while (
ITM->PORT[0].u32 == 0);
1326 ITM->PORT[0].u8 = (uint8_t) ch;
1341 static __INLINE int32_t ITM_ReceiveChar (
void) {
1361 static __INLINE int32_t ITM_CheckChar (
void) {
#define SCB_AIRCR_PRIGROUP_Msk
Definition: core_cm4.h:422
Structure type to access the System Control and ID Register not in the SCB.
Definition: core_cm3.h:531
#define ISR(func)
Define service routine.
Definition: interrupt_sam_nvic.h:65
#define SysTick_CTRL_TICKINT_Msk
Definition: core_cm4.h:606
__IO uint32_t ACTLR
Definition: core_cm4.h:556
Union type to access the Application Program Status Register (APSR).
Definition: core_cm0.h:182
IRQn
Definition: ARMCM0.h:35
Structure type to access the System Timer (SysTick).
Definition: core_cm0.h:397
Structure type to access the Instrumentation Trace Macrocell Register (ITM).
Definition: core_cm3.h:618
#define NVIC
Definition: core_cm4.h:990
CMSIS Cortex-M4 SIMD Header File.
Structure type to access the System Control Block (SCB).
Definition: core_cm0.h:292
#define SysTick
Definition: core_cm4.h:989
#define SCB
Definition: core_cm4.h:988
#define ITM_TCR_ITMENA_Msk
Definition: core_cm4.h:686
#define ITM_RXBUFFER_EMPTY
Definition: core_cm4.h:1307
#define SCB_AIRCR_SYSRESETREQ_Msk
Definition: core_cm4.h:425
Union type to access the Control Registers (CONTROL).
Definition: core_cm0.h:244
volatile int32_t ITM_RxBuffer
#define SysTick_CTRL_ENABLE_Msk
Definition: core_cm4.h:609
#define SysTick_CTRL_CLKSOURCE_Msk
Definition: core_cm4.h:603
#define __IO
Definition: core_cm4.h:190
#define SCB_AIRCR_PRIGROUP_Pos
Definition: core_cm4.h:421
Union type to access the Interrupt Program Status Register (IPSR).
Definition: core_cm0.h:205
#define __O
Definition: core_cm4.h:189
#define __I
Definition: core_cm4.h:187
#define __NVIC_PRIO_BITS
Definition: ARMCM0.h:62
Structure type to access the Nested Vectored Interrupt Controller (NVIC).
Definition: core_cm0.h:267
Structure type to access the Core Debug Register (CoreDebug).
Definition: core_cm3.h:752
CMSIS Cortex-M Core Instruction Access Header File.
#define CoreDebug
Definition: core_cm4.h:992
#define SCB_AIRCR_VECTKEY_Pos
Definition: core_cm4.h:412
#define SysTick_LOAD_RELOAD_Msk
Definition: core_cm4.h:613
Union type to access the Special-Purpose Program Status Registers (xPSR).
Definition: core_cm0.h:218
#define SCB_AIRCR_VECTKEY_Msk
Definition: core_cm4.h:413
#define CoreDebug_DEMCR_TRCENA_Msk
Definition: core_cm4.h:934
CMSIS Cortex-M Core Function Access Header File.
#define ITM
Definition: core_cm4.h:991