23 #if defined ( __ICCARM__ ) 24 #pragma system_include 31 #ifndef __CORE_CM3_H_GENERIC 32 #define __CORE_CM3_H_GENERIC 75 #define __CM3_CMSIS_VERSION_MAIN (0x02) 76 #define __CM3_CMSIS_VERSION_SUB (0x10) 77 #define __CM3_CMSIS_VERSION ((__CM3_CMSIS_VERSION_MAIN << 16) | __CM3_CMSIS_VERSION_SUB) 79 #define __CORTEX_M (0x03) 82 #if defined ( __CC_ARM ) 84 #define __INLINE __inline 86 #elif defined ( __ICCARM__ ) 88 #define __INLINE inline 90 #elif defined ( __GNUC__ ) 92 #define __INLINE inline 94 #elif defined ( __TASKING__ ) 96 #define __INLINE inline 103 #if defined ( __CC_ARM ) 104 #if defined __TARGET_FPU_VFP 105 #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" 107 #elif defined ( __ICCARM__ ) 108 #if defined __ARMVFP__ 109 #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" 112 #elif defined ( __GNUC__ ) 113 #if defined (__VFP_FP__) && !defined(__SOFTFP__) 114 #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" 117 #elif defined ( __TASKING__ ) 127 #ifndef __CMSIS_GENERIC 129 #ifndef __CORE_CM3_H_DEPENDANT 130 #define __CORE_CM3_H_DEPENDANT 133 #if defined __CHECK_DEVICE_DEFINES 135 #define __CM3_REV 0x0200 136 #warning "__CM3_REV not defined in device header file; using default!" 139 #ifndef __MPU_PRESENT 140 #define __MPU_PRESENT 0 141 #warning "__MPU_PRESENT not defined in device header file; using default!" 144 #ifndef __NVIC_PRIO_BITS 145 #define __NVIC_PRIO_BITS 4 146 #warning "__NVIC_PRIO_BITS not defined in device header file; using default!" 149 #ifndef __Vendor_SysTickConfig 150 #define __Vendor_SysTickConfig 0 151 #warning "__Vendor_SysTickConfig not defined in device header file; using default!" 159 #define __I volatile const 162 #define __IO volatile 193 #if (__CORTEX_M != 0x04) 194 uint32_t _reserved0:27;
196 uint32_t _reserved0:16;
198 uint32_t _reserved1:7;
217 uint32_t _reserved0:23;
230 #if (__CORTEX_M != 0x04) 231 uint32_t _reserved0:15;
233 uint32_t _reserved0:7;
235 uint32_t _reserved1:4;
258 uint32_t _reserved0:29;
276 __IO uint32_t ISER[8];
277 uint32_t RESERVED0[24];
278 __IO uint32_t ICER[8];
279 uint32_t RSERVED1[24];
280 __IO uint32_t ISPR[8];
281 uint32_t RESERVED2[24];
282 __IO uint32_t ICPR[8];
283 uint32_t RESERVED3[24];
285 uint32_t RESERVED4[56];
287 uint32_t RESERVED5[644];
292 #define NVIC_STIR_INTID_Pos 0 293 #define NVIC_STIR_INTID_Msk (0x1FFUL << NVIC_STIR_INTID_Pos) 327 uint32_t RESERVED0[5];
332 #define SCB_CPUID_IMPLEMENTER_Pos 24 333 #define SCB_CPUID_IMPLEMENTER_Msk (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos) 335 #define SCB_CPUID_VARIANT_Pos 20 336 #define SCB_CPUID_VARIANT_Msk (0xFUL << SCB_CPUID_VARIANT_Pos) 338 #define SCB_CPUID_ARCHITECTURE_Pos 16 339 #define SCB_CPUID_ARCHITECTURE_Msk (0xFUL << SCB_CPUID_ARCHITECTURE_Pos) 341 #define SCB_CPUID_PARTNO_Pos 4 342 #define SCB_CPUID_PARTNO_Msk (0xFFFUL << SCB_CPUID_PARTNO_Pos) 344 #define SCB_CPUID_REVISION_Pos 0 345 #define SCB_CPUID_REVISION_Msk (0xFUL << SCB_CPUID_REVISION_Pos) 348 #define SCB_ICSR_NMIPENDSET_Pos 31 349 #define SCB_ICSR_NMIPENDSET_Msk (1UL << SCB_ICSR_NMIPENDSET_Pos) 351 #define SCB_ICSR_PENDSVSET_Pos 28 352 #define SCB_ICSR_PENDSVSET_Msk (1UL << SCB_ICSR_PENDSVSET_Pos) 354 #define SCB_ICSR_PENDSVCLR_Pos 27 355 #define SCB_ICSR_PENDSVCLR_Msk (1UL << SCB_ICSR_PENDSVCLR_Pos) 357 #define SCB_ICSR_PENDSTSET_Pos 26 358 #define SCB_ICSR_PENDSTSET_Msk (1UL << SCB_ICSR_PENDSTSET_Pos) 360 #define SCB_ICSR_PENDSTCLR_Pos 25 361 #define SCB_ICSR_PENDSTCLR_Msk (1UL << SCB_ICSR_PENDSTCLR_Pos) 363 #define SCB_ICSR_ISRPREEMPT_Pos 23 364 #define SCB_ICSR_ISRPREEMPT_Msk (1UL << SCB_ICSR_ISRPREEMPT_Pos) 366 #define SCB_ICSR_ISRPENDING_Pos 22 367 #define SCB_ICSR_ISRPENDING_Msk (1UL << SCB_ICSR_ISRPENDING_Pos) 369 #define SCB_ICSR_VECTPENDING_Pos 12 370 #define SCB_ICSR_VECTPENDING_Msk (0x1FFUL << SCB_ICSR_VECTPENDING_Pos) 372 #define SCB_ICSR_RETTOBASE_Pos 11 373 #define SCB_ICSR_RETTOBASE_Msk (1UL << SCB_ICSR_RETTOBASE_Pos) 375 #define SCB_ICSR_VECTACTIVE_Pos 0 376 #define SCB_ICSR_VECTACTIVE_Msk (0x1FFUL << SCB_ICSR_VECTACTIVE_Pos) 379 #if (__CM3_REV < 0x0201) 380 #define SCB_VTOR_TBLBASE_Pos 29 381 #define SCB_VTOR_TBLBASE_Msk (1UL << SCB_VTOR_TBLBASE_Pos) 383 #define SCB_VTOR_TBLOFF_Pos 7 384 #define SCB_VTOR_TBLOFF_Msk (0x3FFFFFUL << SCB_VTOR_TBLOFF_Pos) 386 #define SCB_VTOR_TBLOFF_Pos 7 387 #define SCB_VTOR_TBLOFF_Msk (0x1FFFFFFUL << SCB_VTOR_TBLOFF_Pos) 391 #define SCB_AIRCR_VECTKEY_Pos 16 392 #define SCB_AIRCR_VECTKEY_Msk (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos) 394 #define SCB_AIRCR_VECTKEYSTAT_Pos 16 395 #define SCB_AIRCR_VECTKEYSTAT_Msk (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos) 397 #define SCB_AIRCR_ENDIANESS_Pos 15 398 #define SCB_AIRCR_ENDIANESS_Msk (1UL << SCB_AIRCR_ENDIANESS_Pos) 400 #define SCB_AIRCR_PRIGROUP_Pos 8 401 #define SCB_AIRCR_PRIGROUP_Msk (7UL << SCB_AIRCR_PRIGROUP_Pos) 403 #define SCB_AIRCR_SYSRESETREQ_Pos 2 404 #define SCB_AIRCR_SYSRESETREQ_Msk (1UL << SCB_AIRCR_SYSRESETREQ_Pos) 406 #define SCB_AIRCR_VECTCLRACTIVE_Pos 1 407 #define SCB_AIRCR_VECTCLRACTIVE_Msk (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos) 409 #define SCB_AIRCR_VECTRESET_Pos 0 410 #define SCB_AIRCR_VECTRESET_Msk (1UL << SCB_AIRCR_VECTRESET_Pos) 413 #define SCB_SCR_SEVONPEND_Pos 4 414 #define SCB_SCR_SEVONPEND_Msk (1UL << SCB_SCR_SEVONPEND_Pos) 416 #define SCB_SCR_SLEEPDEEP_Pos 2 417 #define SCB_SCR_SLEEPDEEP_Msk (1UL << SCB_SCR_SLEEPDEEP_Pos) 419 #define SCB_SCR_SLEEPONEXIT_Pos 1 420 #define SCB_SCR_SLEEPONEXIT_Msk (1UL << SCB_SCR_SLEEPONEXIT_Pos) 423 #define SCB_CCR_STKALIGN_Pos 9 424 #define SCB_CCR_STKALIGN_Msk (1UL << SCB_CCR_STKALIGN_Pos) 426 #define SCB_CCR_BFHFNMIGN_Pos 8 427 #define SCB_CCR_BFHFNMIGN_Msk (1UL << SCB_CCR_BFHFNMIGN_Pos) 429 #define SCB_CCR_DIV_0_TRP_Pos 4 430 #define SCB_CCR_DIV_0_TRP_Msk (1UL << SCB_CCR_DIV_0_TRP_Pos) 432 #define SCB_CCR_UNALIGN_TRP_Pos 3 433 #define SCB_CCR_UNALIGN_TRP_Msk (1UL << SCB_CCR_UNALIGN_TRP_Pos) 435 #define SCB_CCR_USERSETMPEND_Pos 1 436 #define SCB_CCR_USERSETMPEND_Msk (1UL << SCB_CCR_USERSETMPEND_Pos) 438 #define SCB_CCR_NONBASETHRDENA_Pos 0 439 #define SCB_CCR_NONBASETHRDENA_Msk (1UL << SCB_CCR_NONBASETHRDENA_Pos) 442 #define SCB_SHCSR_USGFAULTENA_Pos 18 443 #define SCB_SHCSR_USGFAULTENA_Msk (1UL << SCB_SHCSR_USGFAULTENA_Pos) 445 #define SCB_SHCSR_BUSFAULTENA_Pos 17 446 #define SCB_SHCSR_BUSFAULTENA_Msk (1UL << SCB_SHCSR_BUSFAULTENA_Pos) 448 #define SCB_SHCSR_MEMFAULTENA_Pos 16 449 #define SCB_SHCSR_MEMFAULTENA_Msk (1UL << SCB_SHCSR_MEMFAULTENA_Pos) 451 #define SCB_SHCSR_SVCALLPENDED_Pos 15 452 #define SCB_SHCSR_SVCALLPENDED_Msk (1UL << SCB_SHCSR_SVCALLPENDED_Pos) 454 #define SCB_SHCSR_BUSFAULTPENDED_Pos 14 455 #define SCB_SHCSR_BUSFAULTPENDED_Msk (1UL << SCB_SHCSR_BUSFAULTPENDED_Pos) 457 #define SCB_SHCSR_MEMFAULTPENDED_Pos 13 458 #define SCB_SHCSR_MEMFAULTPENDED_Msk (1UL << SCB_SHCSR_MEMFAULTPENDED_Pos) 460 #define SCB_SHCSR_USGFAULTPENDED_Pos 12 461 #define SCB_SHCSR_USGFAULTPENDED_Msk (1UL << SCB_SHCSR_USGFAULTPENDED_Pos) 463 #define SCB_SHCSR_SYSTICKACT_Pos 11 464 #define SCB_SHCSR_SYSTICKACT_Msk (1UL << SCB_SHCSR_SYSTICKACT_Pos) 466 #define SCB_SHCSR_PENDSVACT_Pos 10 467 #define SCB_SHCSR_PENDSVACT_Msk (1UL << SCB_SHCSR_PENDSVACT_Pos) 469 #define SCB_SHCSR_MONITORACT_Pos 8 470 #define SCB_SHCSR_MONITORACT_Msk (1UL << SCB_SHCSR_MONITORACT_Pos) 472 #define SCB_SHCSR_SVCALLACT_Pos 7 473 #define SCB_SHCSR_SVCALLACT_Msk (1UL << SCB_SHCSR_SVCALLACT_Pos) 475 #define SCB_SHCSR_USGFAULTACT_Pos 3 476 #define SCB_SHCSR_USGFAULTACT_Msk (1UL << SCB_SHCSR_USGFAULTACT_Pos) 478 #define SCB_SHCSR_BUSFAULTACT_Pos 1 479 #define SCB_SHCSR_BUSFAULTACT_Msk (1UL << SCB_SHCSR_BUSFAULTACT_Pos) 481 #define SCB_SHCSR_MEMFAULTACT_Pos 0 482 #define SCB_SHCSR_MEMFAULTACT_Msk (1UL << SCB_SHCSR_MEMFAULTACT_Pos) 485 #define SCB_CFSR_USGFAULTSR_Pos 16 486 #define SCB_CFSR_USGFAULTSR_Msk (0xFFFFUL << SCB_CFSR_USGFAULTSR_Pos) 488 #define SCB_CFSR_BUSFAULTSR_Pos 8 489 #define SCB_CFSR_BUSFAULTSR_Msk (0xFFUL << SCB_CFSR_BUSFAULTSR_Pos) 491 #define SCB_CFSR_MEMFAULTSR_Pos 0 492 #define SCB_CFSR_MEMFAULTSR_Msk (0xFFUL << SCB_CFSR_MEMFAULTSR_Pos) 495 #define SCB_HFSR_DEBUGEVT_Pos 31 496 #define SCB_HFSR_DEBUGEVT_Msk (1UL << SCB_HFSR_DEBUGEVT_Pos) 498 #define SCB_HFSR_FORCED_Pos 30 499 #define SCB_HFSR_FORCED_Msk (1UL << SCB_HFSR_FORCED_Pos) 501 #define SCB_HFSR_VECTTBL_Pos 1 502 #define SCB_HFSR_VECTTBL_Msk (1UL << SCB_HFSR_VECTTBL_Pos) 505 #define SCB_DFSR_EXTERNAL_Pos 4 506 #define SCB_DFSR_EXTERNAL_Msk (1UL << SCB_DFSR_EXTERNAL_Pos) 508 #define SCB_DFSR_VCATCH_Pos 3 509 #define SCB_DFSR_VCATCH_Msk (1UL << SCB_DFSR_VCATCH_Pos) 511 #define SCB_DFSR_DWTTRAP_Pos 2 512 #define SCB_DFSR_DWTTRAP_Msk (1UL << SCB_DFSR_DWTTRAP_Pos) 514 #define SCB_DFSR_BKPT_Pos 1 515 #define SCB_DFSR_BKPT_Msk (1UL << SCB_DFSR_BKPT_Pos) 517 #define SCB_DFSR_HALTED_Pos 0 518 #define SCB_DFSR_HALTED_Msk (1UL << SCB_DFSR_HALTED_Pos) 533 uint32_t RESERVED0[1];
535 #if ((defined __CM3_REV) && (__CM3_REV >= 0x200)) 538 uint32_t RESERVED1[1];
543 #define SCnSCB_ICTR_INTLINESNUM_Pos 0 544 #define SCnSCB_ICTR_INTLINESNUM_Msk (0xFUL << SCnSCB_ICTR_INTLINESNUM_Pos) 548 #define SCnSCB_ACTLR_DISFOLD_Pos 2 549 #define SCnSCB_ACTLR_DISFOLD_Msk (1UL << SCnSCB_ACTLR_DISFOLD_Pos) 551 #define SCnSCB_ACTLR_DISDEFWBUF_Pos 1 552 #define SCnSCB_ACTLR_DISDEFWBUF_Msk (1UL << SCnSCB_ACTLR_DISDEFWBUF_Pos) 554 #define SCnSCB_ACTLR_DISMCYCINT_Pos 0 555 #define SCnSCB_ACTLR_DISMCYCINT_Msk (1UL << SCnSCB_ACTLR_DISMCYCINT_Pos) 577 #define SysTick_CTRL_COUNTFLAG_Pos 16 578 #define SysTick_CTRL_COUNTFLAG_Msk (1UL << SysTick_CTRL_COUNTFLAG_Pos) 580 #define SysTick_CTRL_CLKSOURCE_Pos 2 581 #define SysTick_CTRL_CLKSOURCE_Msk (1UL << SysTick_CTRL_CLKSOURCE_Pos) 583 #define SysTick_CTRL_TICKINT_Pos 1 584 #define SysTick_CTRL_TICKINT_Msk (1UL << SysTick_CTRL_TICKINT_Pos) 586 #define SysTick_CTRL_ENABLE_Pos 0 587 #define SysTick_CTRL_ENABLE_Msk (1UL << SysTick_CTRL_ENABLE_Pos) 590 #define SysTick_LOAD_RELOAD_Pos 0 591 #define SysTick_LOAD_RELOAD_Msk (0xFFFFFFUL << SysTick_LOAD_RELOAD_Pos) 594 #define SysTick_VAL_CURRENT_Pos 0 595 #define SysTick_VAL_CURRENT_Msk (0xFFFFFFUL << SysTick_VAL_CURRENT_Pos) 598 #define SysTick_CALIB_NOREF_Pos 31 599 #define SysTick_CALIB_NOREF_Msk (1UL << SysTick_CALIB_NOREF_Pos) 601 #define SysTick_CALIB_SKEW_Pos 30 602 #define SysTick_CALIB_SKEW_Msk (1UL << SysTick_CALIB_SKEW_Pos) 604 #define SysTick_CALIB_TENMS_Pos 0 605 #define SysTick_CALIB_TENMS_Msk (0xFFFFFFUL << SysTick_VAL_CURRENT_Pos) 626 uint32_t RESERVED0[864];
628 uint32_t RESERVED1[15];
630 uint32_t RESERVED2[15];
635 #define ITM_TPR_PRIVMASK_Pos 0 636 #define ITM_TPR_PRIVMASK_Msk (0xFUL << ITM_TPR_PRIVMASK_Pos) 639 #define ITM_TCR_BUSY_Pos 23 640 #define ITM_TCR_BUSY_Msk (1UL << ITM_TCR_BUSY_Pos) 642 #define ITM_TCR_TraceBusID_Pos 16 643 #define ITM_TCR_TraceBusID_Msk (0x7FUL << ITM_TCR_TraceBusID_Pos) 645 #define ITM_TCR_GTSFREQ_Pos 10 646 #define ITM_TCR_GTSFREQ_Msk (3UL << ITM_TCR_GTSFREQ_Pos) 648 #define ITM_TCR_TSPrescale_Pos 8 649 #define ITM_TCR_TSPrescale_Msk (3UL << ITM_TCR_TSPrescale_Pos) 651 #define ITM_TCR_SWOENA_Pos 4 652 #define ITM_TCR_SWOENA_Msk (1UL << ITM_TCR_SWOENA_Pos) 654 #define ITM_TCR_TXENA_Pos 3 655 #define ITM_TCR_TXENA_Msk (1UL << ITM_TCR_TXENA_Pos) 657 #define ITM_TCR_SYNCENA_Pos 2 658 #define ITM_TCR_SYNCENA_Msk (1UL << ITM_TCR_SYNCENA_Pos) 660 #define ITM_TCR_TSENA_Pos 1 661 #define ITM_TCR_TSENA_Msk (1UL << ITM_TCR_TSENA_Pos) 663 #define ITM_TCR_ITMENA_Pos 0 664 #define ITM_TCR_ITMENA_Msk (1UL << ITM_TCR_ITMENA_Pos) 669 #if (__MPU_PRESENT == 1) 685 __IO uint32_t RBAR_A1;
686 __IO uint32_t RASR_A1;
687 __IO uint32_t RBAR_A2;
688 __IO uint32_t RASR_A2;
689 __IO uint32_t RBAR_A3;
690 __IO uint32_t RASR_A3;
694 #define MPU_TYPE_IREGION_Pos 16 695 #define MPU_TYPE_IREGION_Msk (0xFFUL << MPU_TYPE_IREGION_Pos) 697 #define MPU_TYPE_DREGION_Pos 8 698 #define MPU_TYPE_DREGION_Msk (0xFFUL << MPU_TYPE_DREGION_Pos) 700 #define MPU_TYPE_SEPARATE_Pos 0 701 #define MPU_TYPE_SEPARATE_Msk (1UL << MPU_TYPE_SEPARATE_Pos) 704 #define MPU_CTRL_PRIVDEFENA_Pos 2 705 #define MPU_CTRL_PRIVDEFENA_Msk (1UL << MPU_CTRL_PRIVDEFENA_Pos) 707 #define MPU_CTRL_HFNMIENA_Pos 1 708 #define MPU_CTRL_HFNMIENA_Msk (1UL << MPU_CTRL_HFNMIENA_Pos) 710 #define MPU_CTRL_ENABLE_Pos 0 711 #define MPU_CTRL_ENABLE_Msk (1UL << MPU_CTRL_ENABLE_Pos) 714 #define MPU_RNR_REGION_Pos 0 715 #define MPU_RNR_REGION_Msk (0xFFUL << MPU_RNR_REGION_Pos) 718 #define MPU_RBAR_ADDR_Pos 5 719 #define MPU_RBAR_ADDR_Msk (0x7FFFFFFUL << MPU_RBAR_ADDR_Pos) 721 #define MPU_RBAR_VALID_Pos 4 722 #define MPU_RBAR_VALID_Msk (1UL << MPU_RBAR_VALID_Pos) 724 #define MPU_RBAR_REGION_Pos 0 725 #define MPU_RBAR_REGION_Msk (0xFUL << MPU_RBAR_REGION_Pos) 728 #define MPU_RASR_ATTRS_Pos 16 729 #define MPU_RASR_ATTRS_Msk (0xFFFFUL << MPU_RASR_ATTRS_Pos) 731 #define MPU_RASR_SRD_Pos 8 732 #define MPU_RASR_SRD_Msk (0xFFUL << MPU_RASR_SRD_Pos) 734 #define MPU_RASR_SIZE_Pos 1 735 #define MPU_RASR_SIZE_Msk (0x1FUL << MPU_RASR_SIZE_Pos) 737 #define MPU_RASR_ENABLE_Pos 0 738 #define MPU_RASR_ENABLE_Msk (1UL << MPU_RASR_ENABLE_Pos) 761 #define CoreDebug_DHCSR_DBGKEY_Pos 16 762 #define CoreDebug_DHCSR_DBGKEY_Msk (0xFFFFUL << CoreDebug_DHCSR_DBGKEY_Pos) 764 #define CoreDebug_DHCSR_S_RESET_ST_Pos 25 765 #define CoreDebug_DHCSR_S_RESET_ST_Msk (1UL << CoreDebug_DHCSR_S_RESET_ST_Pos) 767 #define CoreDebug_DHCSR_S_RETIRE_ST_Pos 24 768 #define CoreDebug_DHCSR_S_RETIRE_ST_Msk (1UL << CoreDebug_DHCSR_S_RETIRE_ST_Pos) 770 #define CoreDebug_DHCSR_S_LOCKUP_Pos 19 771 #define CoreDebug_DHCSR_S_LOCKUP_Msk (1UL << CoreDebug_DHCSR_S_LOCKUP_Pos) 773 #define CoreDebug_DHCSR_S_SLEEP_Pos 18 774 #define CoreDebug_DHCSR_S_SLEEP_Msk (1UL << CoreDebug_DHCSR_S_SLEEP_Pos) 776 #define CoreDebug_DHCSR_S_HALT_Pos 17 777 #define CoreDebug_DHCSR_S_HALT_Msk (1UL << CoreDebug_DHCSR_S_HALT_Pos) 779 #define CoreDebug_DHCSR_S_REGRDY_Pos 16 780 #define CoreDebug_DHCSR_S_REGRDY_Msk (1UL << CoreDebug_DHCSR_S_REGRDY_Pos) 782 #define CoreDebug_DHCSR_C_SNAPSTALL_Pos 5 783 #define CoreDebug_DHCSR_C_SNAPSTALL_Msk (1UL << CoreDebug_DHCSR_C_SNAPSTALL_Pos) 785 #define CoreDebug_DHCSR_C_MASKINTS_Pos 3 786 #define CoreDebug_DHCSR_C_MASKINTS_Msk (1UL << CoreDebug_DHCSR_C_MASKINTS_Pos) 788 #define CoreDebug_DHCSR_C_STEP_Pos 2 789 #define CoreDebug_DHCSR_C_STEP_Msk (1UL << CoreDebug_DHCSR_C_STEP_Pos) 791 #define CoreDebug_DHCSR_C_HALT_Pos 1 792 #define CoreDebug_DHCSR_C_HALT_Msk (1UL << CoreDebug_DHCSR_C_HALT_Pos) 794 #define CoreDebug_DHCSR_C_DEBUGEN_Pos 0 795 #define CoreDebug_DHCSR_C_DEBUGEN_Msk (1UL << CoreDebug_DHCSR_C_DEBUGEN_Pos) 798 #define CoreDebug_DCRSR_REGWnR_Pos 16 799 #define CoreDebug_DCRSR_REGWnR_Msk (1UL << CoreDebug_DCRSR_REGWnR_Pos) 801 #define CoreDebug_DCRSR_REGSEL_Pos 0 802 #define CoreDebug_DCRSR_REGSEL_Msk (0x1FUL << CoreDebug_DCRSR_REGSEL_Pos) 805 #define CoreDebug_DEMCR_TRCENA_Pos 24 806 #define CoreDebug_DEMCR_TRCENA_Msk (1UL << CoreDebug_DEMCR_TRCENA_Pos) 808 #define CoreDebug_DEMCR_MON_REQ_Pos 19 809 #define CoreDebug_DEMCR_MON_REQ_Msk (1UL << CoreDebug_DEMCR_MON_REQ_Pos) 811 #define CoreDebug_DEMCR_MON_STEP_Pos 18 812 #define CoreDebug_DEMCR_MON_STEP_Msk (1UL << CoreDebug_DEMCR_MON_STEP_Pos) 814 #define CoreDebug_DEMCR_MON_PEND_Pos 17 815 #define CoreDebug_DEMCR_MON_PEND_Msk (1UL << CoreDebug_DEMCR_MON_PEND_Pos) 817 #define CoreDebug_DEMCR_MON_EN_Pos 16 818 #define CoreDebug_DEMCR_MON_EN_Msk (1UL << CoreDebug_DEMCR_MON_EN_Pos) 820 #define CoreDebug_DEMCR_VC_HARDERR_Pos 10 821 #define CoreDebug_DEMCR_VC_HARDERR_Msk (1UL << CoreDebug_DEMCR_VC_HARDERR_Pos) 823 #define CoreDebug_DEMCR_VC_INTERR_Pos 9 824 #define CoreDebug_DEMCR_VC_INTERR_Msk (1UL << CoreDebug_DEMCR_VC_INTERR_Pos) 826 #define CoreDebug_DEMCR_VC_BUSERR_Pos 8 827 #define CoreDebug_DEMCR_VC_BUSERR_Msk (1UL << CoreDebug_DEMCR_VC_BUSERR_Pos) 829 #define CoreDebug_DEMCR_VC_STATERR_Pos 7 830 #define CoreDebug_DEMCR_VC_STATERR_Msk (1UL << CoreDebug_DEMCR_VC_STATERR_Pos) 832 #define CoreDebug_DEMCR_VC_CHKERR_Pos 6 833 #define CoreDebug_DEMCR_VC_CHKERR_Msk (1UL << CoreDebug_DEMCR_VC_CHKERR_Pos) 835 #define CoreDebug_DEMCR_VC_NOCPERR_Pos 5 836 #define CoreDebug_DEMCR_VC_NOCPERR_Msk (1UL << CoreDebug_DEMCR_VC_NOCPERR_Pos) 838 #define CoreDebug_DEMCR_VC_MMERR_Pos 4 839 #define CoreDebug_DEMCR_VC_MMERR_Msk (1UL << CoreDebug_DEMCR_VC_MMERR_Pos) 841 #define CoreDebug_DEMCR_VC_CORERESET_Pos 0 842 #define CoreDebug_DEMCR_VC_CORERESET_Msk (1UL << CoreDebug_DEMCR_VC_CORERESET_Pos) 852 #define SCS_BASE (0xE000E000UL) 853 #define ITM_BASE (0xE0000000UL) 854 #define CoreDebug_BASE (0xE000EDF0UL) 855 #define SysTick_BASE (SCS_BASE + 0x0010UL) 856 #define NVIC_BASE (SCS_BASE + 0x0100UL) 857 #define SCB_BASE (SCS_BASE + 0x0D00UL) 859 #define SCnSCB ((SCnSCB_Type *) SCS_BASE ) 860 #define SCB ((SCB_Type *) SCB_BASE ) 861 #define SysTick ((SysTick_Type *) SysTick_BASE ) 862 #define NVIC ((NVIC_Type *) NVIC_BASE ) 863 #define ITM ((ITM_Type *) ITM_BASE ) 864 #define CoreDebug ((CoreDebug_Type *) CoreDebug_BASE) 866 #if (__MPU_PRESENT == 1) 867 #define MPU_BASE (SCS_BASE + 0x0D90UL) 868 #define MPU ((MPU_Type *) MPU_BASE ) 904 static __INLINE
void NVIC_SetPriorityGrouping(uint32_t PriorityGroup)
907 uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07);
909 reg_value =
SCB->AIRCR;
911 reg_value = (reg_value |
913 (PriorityGroupTmp << 8));
914 SCB->AIRCR = reg_value;
925 static __INLINE uint32_t NVIC_GetPriorityGrouping(
void)
938 static __INLINE
void NVIC_EnableIRQ(IRQn_Type
IRQn)
940 NVIC->ISER[((uint32_t)(IRQn) >> 5)] = (1 << ((uint32_t)(
IRQn) & 0x1F));
951 static __INLINE
void NVIC_DisableIRQ(IRQn_Type IRQn)
953 NVIC->ICER[((uint32_t)(IRQn) >> 5)] = (1 << ((uint32_t)(
IRQn) & 0x1F));
966 static __INLINE uint32_t NVIC_GetPendingIRQ(IRQn_Type IRQn)
968 return((uint32_t) ((
NVIC->ISPR[(uint32_t)(IRQn) >> 5] & (1 << ((uint32_t)(IRQn) & 0x1F)))?1:0));
979 static __INLINE
void NVIC_SetPendingIRQ(IRQn_Type IRQn)
981 NVIC->ISPR[((uint32_t)(IRQn) >> 5)] = (1 << ((uint32_t)(
IRQn) & 0x1F));
992 static __INLINE
void NVIC_ClearPendingIRQ(IRQn_Type IRQn)
994 NVIC->ICPR[((uint32_t)(IRQn) >> 5)] = (1 << ((uint32_t)(
IRQn) & 0x1F));
1005 static __INLINE uint32_t NVIC_GetActive(IRQn_Type IRQn)
1007 return((uint32_t)((
NVIC->IABR[(uint32_t)(IRQn) >> 5] & (1 << ((uint32_t)(IRQn) & 0x1F)))?1:0));
1022 static __INLINE
void NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority)
1043 static __INLINE uint32_t NVIC_GetPriority(IRQn_Type IRQn)
1067 static __INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority)
1069 uint32_t PriorityGroupTmp = (PriorityGroup & 0x07);
1070 uint32_t PreemptPriorityBits;
1071 uint32_t SubPriorityBits;
1077 ((PreemptPriority & ((1 << (PreemptPriorityBits)) - 1)) << SubPriorityBits) |
1078 ((SubPriority & ((1 << (SubPriorityBits )) - 1)))
1097 static __INLINE
void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* pPreemptPriority, uint32_t* pSubPriority)
1099 uint32_t PriorityGroupTmp = (PriorityGroup & 0x07);
1100 uint32_t PreemptPriorityBits;
1101 uint32_t SubPriorityBits;
1106 *pPreemptPriority = (Priority >> SubPriorityBits) & ((1 << (PreemptPriorityBits)) - 1);
1107 *pSubPriority = (Priority ) & ((1 << (SubPriorityBits )) - 1);
1115 static __INLINE
void NVIC_SystemReset(
void)
1136 #if (__Vendor_SysTickConfig == 0) 1147 static __INLINE uint32_t SysTick_Config(uint32_t ticks)
1173 #define ITM_RXBUFFER_EMPTY 0x5AA55AA5 1185 static __INLINE uint32_t ITM_SendChar (uint32_t ch) 1189 (
ITM->TER & (1UL << 0) ) )
1191 while (
ITM->PORT[0].u32 == 0);
1192 ITM->PORT[0].u8 = (uint8_t) ch;
1207 static __INLINE int32_t ITM_ReceiveChar (
void) {
1227 static __INLINE int32_t ITM_CheckChar (
void) {
__IO uint32_t DEMCR
Definition: core_cm3.h:757
__O uint32_t STIR
Definition: core_cm3.h:288
#define SCB_AIRCR_PRIGROUP_Msk
Definition: core_cm3.h:401
__IO uint32_t DCRDR
Definition: core_cm3.h:756
__I uint32_t DFR
Definition: core_cm3.h:323
__O uint8_t u8
Definition: core_cm3.h:622
Structure type to access the System Control and ID Register not in the SCB.
Definition: core_cm3.h:531
__IO uint32_t AFSR
Definition: core_cm3.h:321
__IO uint32_t DHCSR
Definition: core_cm3.h:754
#define ISR(func)
Define service routine.
Definition: interrupt_sam_nvic.h:65
__I uint32_t ADR
Definition: core_cm3.h:324
__O uint32_t DCRSR
Definition: core_cm3.h:755
#define SysTick_CTRL_TICKINT_Msk
Definition: core_cm3.h:584
__IO uint32_t HFSR
Definition: core_cm3.h:317
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_cm3.h:862
__IO uint32_t DFSR
Definition: core_cm3.h:318
__O uint32_t u32
Definition: core_cm3.h:624
__IO uint32_t CFSR
Definition: core_cm3.h:316
Structure type to access the System Control Block (SCB).
Definition: core_cm0.h:292
#define SysTick
Definition: core_cm3.h:861
__IO uint32_t TCR
Definition: core_cm3.h:631
#define SCB
Definition: core_cm3.h:860
#define ITM_TCR_ITMENA_Msk
Definition: core_cm3.h:664
#define ITM_RXBUFFER_EMPTY
Definition: core_cm3.h:1173
__IO uint32_t BFAR
Definition: core_cm3.h:320
#define SCB_AIRCR_SYSRESETREQ_Msk
Definition: core_cm3.h:404
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_cm3.h:587
#define SysTick_CTRL_CLKSOURCE_Msk
Definition: core_cm3.h:581
#define __IO
Definition: core_cm3.h:162
#define SCB_AIRCR_PRIGROUP_Pos
Definition: core_cm3.h:400
Union type to access the Interrupt Program Status Register (IPSR).
Definition: core_cm0.h:205
__I uint32_t ICTR
Definition: core_cm3.h:534
#define __O
Definition: core_cm3.h:161
#define __I
Definition: core_cm3.h:159
__IO uint32_t TPR
Definition: core_cm3.h:629
#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_cm3.h:864
__IO uint32_t MMFAR
Definition: core_cm3.h:319
#define SCB_AIRCR_VECTKEY_Pos
Definition: core_cm3.h:391
#define SysTick_LOAD_RELOAD_Msk
Definition: core_cm3.h:591
Union type to access the Special-Purpose Program Status Registers (xPSR).
Definition: core_cm0.h:218
#define SCB_AIRCR_VECTKEY_Msk
Definition: core_cm3.h:392
__IO uint32_t CPACR
Definition: core_cm3.h:328
#define CoreDebug_DEMCR_TRCENA_Msk
Definition: core_cm3.h:806
__O uint16_t u16
Definition: core_cm3.h:623
__IO uint32_t VTOR
Definition: core_cm3.h:310
__IO uint32_t TER
Definition: core_cm3.h:627
CMSIS Cortex-M Core Function Access Header File.
#define ITM
Definition: core_cm3.h:863