23 #if defined ( __ICCARM__ )
24 #pragma system_include
31 #ifndef __CORE_SC300_H_GENERIC
32 #define __CORE_SC300_H_GENERIC
56 #define __SC300_CMSIS_VERSION_MAIN (0x03)
57 #define __SC300_CMSIS_VERSION_SUB (0x01)
58 #define __SC300_CMSIS_VERSION ((__SC300_CMSIS_VERSION_MAIN << 16) | \
59 __SC300_CMSIS_VERSION_SUB )
61 #define __CORTEX_SC (300)
64 #if defined ( __CC_ARM )
66 #define __INLINE __inline
67 #define __STATIC_INLINE static __inline
69 #elif defined ( __ICCARM__ )
71 #define __INLINE inline
72 #define __STATIC_INLINE static inline
74 #elif defined ( __GNUC__ )
76 #define __INLINE inline
77 #define __STATIC_INLINE static inline
79 #elif defined ( __TASKING__ )
81 #define __INLINE inline
82 #define __STATIC_INLINE static inline
90 #if defined ( __CC_ARM )
91 #if defined __TARGET_FPU_VFP
92 #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
95 #elif defined ( __ICCARM__ )
96 #if defined __ARMVFP__
97 #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
100 #elif defined ( __GNUC__ )
101 #if defined (__VFP_FP__) && !defined(__SOFTFP__)
102 #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
105 #elif defined ( __TASKING__ )
106 #if defined __FPU_VFP__
107 #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
117 #ifndef __CMSIS_GENERIC
119 #ifndef __CORE_SC300_H_DEPENDANT
120 #define __CORE_SC300_H_DEPENDANT
123 #if defined __CHECK_DEVICE_DEFINES
125 #define __SC300_REV 0x0000
126 #warning "__SC300_REV not defined in device header file; using default!"
129 #ifndef __MPU_PRESENT
130 #define __MPU_PRESENT 0
131 #warning "__MPU_PRESENT not defined in device header file; using default!"
134 #ifndef __NVIC_PRIO_BITS
135 #define __NVIC_PRIO_BITS 4
136 #warning "__NVIC_PRIO_BITS not defined in device header file; using default!"
139 #ifndef __Vendor_SysTickConfig
140 #define __Vendor_SysTickConfig 0
141 #warning "__Vendor_SysTickConfig not defined in device header file; using default!"
156 #define __I volatile const
159 #define __IO volatile
191 #if (__CORTEX_M != 0x04)
228 #if (__CORTEX_M != 0x04)
290 #define NVIC_STIR_INTID_Pos 0
291 #define NVIC_STIR_INTID_Msk (0x1FFUL << NVIC_STIR_INTID_Pos)
330 #define SCB_CPUID_IMPLEMENTER_Pos 24
331 #define SCB_CPUID_IMPLEMENTER_Msk (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos)
333 #define SCB_CPUID_VARIANT_Pos 20
334 #define SCB_CPUID_VARIANT_Msk (0xFUL << SCB_CPUID_VARIANT_Pos)
336 #define SCB_CPUID_ARCHITECTURE_Pos 16
337 #define SCB_CPUID_ARCHITECTURE_Msk (0xFUL << SCB_CPUID_ARCHITECTURE_Pos)
339 #define SCB_CPUID_PARTNO_Pos 4
340 #define SCB_CPUID_PARTNO_Msk (0xFFFUL << SCB_CPUID_PARTNO_Pos)
342 #define SCB_CPUID_REVISION_Pos 0
343 #define SCB_CPUID_REVISION_Msk (0xFUL << SCB_CPUID_REVISION_Pos)
346 #define SCB_ICSR_NMIPENDSET_Pos 31
347 #define SCB_ICSR_NMIPENDSET_Msk (1UL << SCB_ICSR_NMIPENDSET_Pos)
349 #define SCB_ICSR_PENDSVSET_Pos 28
350 #define SCB_ICSR_PENDSVSET_Msk (1UL << SCB_ICSR_PENDSVSET_Pos)
352 #define SCB_ICSR_PENDSVCLR_Pos 27
353 #define SCB_ICSR_PENDSVCLR_Msk (1UL << SCB_ICSR_PENDSVCLR_Pos)
355 #define SCB_ICSR_PENDSTSET_Pos 26
356 #define SCB_ICSR_PENDSTSET_Msk (1UL << SCB_ICSR_PENDSTSET_Pos)
358 #define SCB_ICSR_PENDSTCLR_Pos 25
359 #define SCB_ICSR_PENDSTCLR_Msk (1UL << SCB_ICSR_PENDSTCLR_Pos)
361 #define SCB_ICSR_ISRPREEMPT_Pos 23
362 #define SCB_ICSR_ISRPREEMPT_Msk (1UL << SCB_ICSR_ISRPREEMPT_Pos)
364 #define SCB_ICSR_ISRPENDING_Pos 22
365 #define SCB_ICSR_ISRPENDING_Msk (1UL << SCB_ICSR_ISRPENDING_Pos)
367 #define SCB_ICSR_VECTPENDING_Pos 12
368 #define SCB_ICSR_VECTPENDING_Msk (0x1FFUL << SCB_ICSR_VECTPENDING_Pos)
370 #define SCB_ICSR_RETTOBASE_Pos 11
371 #define SCB_ICSR_RETTOBASE_Msk (1UL << SCB_ICSR_RETTOBASE_Pos)
373 #define SCB_ICSR_VECTACTIVE_Pos 0
374 #define SCB_ICSR_VECTACTIVE_Msk (0x1FFUL << SCB_ICSR_VECTACTIVE_Pos)
377 #define SCB_VTOR_TBLBASE_Pos 29
378 #define SCB_VTOR_TBLBASE_Msk (1UL << SCB_VTOR_TBLBASE_Pos)
380 #define SCB_VTOR_TBLOFF_Pos 7
381 #define SCB_VTOR_TBLOFF_Msk (0x3FFFFFUL << SCB_VTOR_TBLOFF_Pos)
384 #define SCB_AIRCR_VECTKEY_Pos 16
385 #define SCB_AIRCR_VECTKEY_Msk (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos)
387 #define SCB_AIRCR_VECTKEYSTAT_Pos 16
388 #define SCB_AIRCR_VECTKEYSTAT_Msk (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos)
390 #define SCB_AIRCR_ENDIANESS_Pos 15
391 #define SCB_AIRCR_ENDIANESS_Msk (1UL << SCB_AIRCR_ENDIANESS_Pos)
393 #define SCB_AIRCR_PRIGROUP_Pos 8
394 #define SCB_AIRCR_PRIGROUP_Msk (7UL << SCB_AIRCR_PRIGROUP_Pos)
396 #define SCB_AIRCR_SYSRESETREQ_Pos 2
397 #define SCB_AIRCR_SYSRESETREQ_Msk (1UL << SCB_AIRCR_SYSRESETREQ_Pos)
399 #define SCB_AIRCR_VECTCLRACTIVE_Pos 1
400 #define SCB_AIRCR_VECTCLRACTIVE_Msk (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos)
402 #define SCB_AIRCR_VECTRESET_Pos 0
403 #define SCB_AIRCR_VECTRESET_Msk (1UL << SCB_AIRCR_VECTRESET_Pos)
406 #define SCB_SCR_SEVONPEND_Pos 4
407 #define SCB_SCR_SEVONPEND_Msk (1UL << SCB_SCR_SEVONPEND_Pos)
409 #define SCB_SCR_SLEEPDEEP_Pos 2
410 #define SCB_SCR_SLEEPDEEP_Msk (1UL << SCB_SCR_SLEEPDEEP_Pos)
412 #define SCB_SCR_SLEEPONEXIT_Pos 1
413 #define SCB_SCR_SLEEPONEXIT_Msk (1UL << SCB_SCR_SLEEPONEXIT_Pos)
416 #define SCB_CCR_STKALIGN_Pos 9
417 #define SCB_CCR_STKALIGN_Msk (1UL << SCB_CCR_STKALIGN_Pos)
419 #define SCB_CCR_BFHFNMIGN_Pos 8
420 #define SCB_CCR_BFHFNMIGN_Msk (1UL << SCB_CCR_BFHFNMIGN_Pos)
422 #define SCB_CCR_DIV_0_TRP_Pos 4
423 #define SCB_CCR_DIV_0_TRP_Msk (1UL << SCB_CCR_DIV_0_TRP_Pos)
425 #define SCB_CCR_UNALIGN_TRP_Pos 3
426 #define SCB_CCR_UNALIGN_TRP_Msk (1UL << SCB_CCR_UNALIGN_TRP_Pos)
428 #define SCB_CCR_USERSETMPEND_Pos 1
429 #define SCB_CCR_USERSETMPEND_Msk (1UL << SCB_CCR_USERSETMPEND_Pos)
431 #define SCB_CCR_NONBASETHRDENA_Pos 0
432 #define SCB_CCR_NONBASETHRDENA_Msk (1UL << SCB_CCR_NONBASETHRDENA_Pos)
435 #define SCB_SHCSR_USGFAULTENA_Pos 18
436 #define SCB_SHCSR_USGFAULTENA_Msk (1UL << SCB_SHCSR_USGFAULTENA_Pos)
438 #define SCB_SHCSR_BUSFAULTENA_Pos 17
439 #define SCB_SHCSR_BUSFAULTENA_Msk (1UL << SCB_SHCSR_BUSFAULTENA_Pos)
441 #define SCB_SHCSR_MEMFAULTENA_Pos 16
442 #define SCB_SHCSR_MEMFAULTENA_Msk (1UL << SCB_SHCSR_MEMFAULTENA_Pos)
444 #define SCB_SHCSR_SVCALLPENDED_Pos 15
445 #define SCB_SHCSR_SVCALLPENDED_Msk (1UL << SCB_SHCSR_SVCALLPENDED_Pos)
447 #define SCB_SHCSR_BUSFAULTPENDED_Pos 14
448 #define SCB_SHCSR_BUSFAULTPENDED_Msk (1UL << SCB_SHCSR_BUSFAULTPENDED_Pos)
450 #define SCB_SHCSR_MEMFAULTPENDED_Pos 13
451 #define SCB_SHCSR_MEMFAULTPENDED_Msk (1UL << SCB_SHCSR_MEMFAULTPENDED_Pos)
453 #define SCB_SHCSR_USGFAULTPENDED_Pos 12
454 #define SCB_SHCSR_USGFAULTPENDED_Msk (1UL << SCB_SHCSR_USGFAULTPENDED_Pos)
456 #define SCB_SHCSR_SYSTICKACT_Pos 11
457 #define SCB_SHCSR_SYSTICKACT_Msk (1UL << SCB_SHCSR_SYSTICKACT_Pos)
459 #define SCB_SHCSR_PENDSVACT_Pos 10
460 #define SCB_SHCSR_PENDSVACT_Msk (1UL << SCB_SHCSR_PENDSVACT_Pos)
462 #define SCB_SHCSR_MONITORACT_Pos 8
463 #define SCB_SHCSR_MONITORACT_Msk (1UL << SCB_SHCSR_MONITORACT_Pos)
465 #define SCB_SHCSR_SVCALLACT_Pos 7
466 #define SCB_SHCSR_SVCALLACT_Msk (1UL << SCB_SHCSR_SVCALLACT_Pos)
468 #define SCB_SHCSR_USGFAULTACT_Pos 3
469 #define SCB_SHCSR_USGFAULTACT_Msk (1UL << SCB_SHCSR_USGFAULTACT_Pos)
471 #define SCB_SHCSR_BUSFAULTACT_Pos 1
472 #define SCB_SHCSR_BUSFAULTACT_Msk (1UL << SCB_SHCSR_BUSFAULTACT_Pos)
474 #define SCB_SHCSR_MEMFAULTACT_Pos 0
475 #define SCB_SHCSR_MEMFAULTACT_Msk (1UL << SCB_SHCSR_MEMFAULTACT_Pos)
478 #define SCB_CFSR_USGFAULTSR_Pos 16
479 #define SCB_CFSR_USGFAULTSR_Msk (0xFFFFUL << SCB_CFSR_USGFAULTSR_Pos)
481 #define SCB_CFSR_BUSFAULTSR_Pos 8
482 #define SCB_CFSR_BUSFAULTSR_Msk (0xFFUL << SCB_CFSR_BUSFAULTSR_Pos)
484 #define SCB_CFSR_MEMFAULTSR_Pos 0
485 #define SCB_CFSR_MEMFAULTSR_Msk (0xFFUL << SCB_CFSR_MEMFAULTSR_Pos)
488 #define SCB_HFSR_DEBUGEVT_Pos 31
489 #define SCB_HFSR_DEBUGEVT_Msk (1UL << SCB_HFSR_DEBUGEVT_Pos)
491 #define SCB_HFSR_FORCED_Pos 30
492 #define SCB_HFSR_FORCED_Msk (1UL << SCB_HFSR_FORCED_Pos)
494 #define SCB_HFSR_VECTTBL_Pos 1
495 #define SCB_HFSR_VECTTBL_Msk (1UL << SCB_HFSR_VECTTBL_Pos)
498 #define SCB_DFSR_EXTERNAL_Pos 4
499 #define SCB_DFSR_EXTERNAL_Msk (1UL << SCB_DFSR_EXTERNAL_Pos)
501 #define SCB_DFSR_VCATCH_Pos 3
502 #define SCB_DFSR_VCATCH_Msk (1UL << SCB_DFSR_VCATCH_Pos)
504 #define SCB_DFSR_DWTTRAP_Pos 2
505 #define SCB_DFSR_DWTTRAP_Msk (1UL << SCB_DFSR_DWTTRAP_Pos)
507 #define SCB_DFSR_BKPT_Pos 1
508 #define SCB_DFSR_BKPT_Msk (1UL << SCB_DFSR_BKPT_Pos)
510 #define SCB_DFSR_HALTED_Pos 0
511 #define SCB_DFSR_HALTED_Msk (1UL << SCB_DFSR_HALTED_Pos)
532 #define SCnSCB_ICTR_INTLINESNUM_Pos 0
533 #define SCnSCB_ICTR_INTLINESNUM_Msk (0xFUL << SCnSCB_ICTR_INTLINESNUM_Pos)
555 #define SysTick_CTRL_COUNTFLAG_Pos 16
556 #define SysTick_CTRL_COUNTFLAG_Msk (1UL << SysTick_CTRL_COUNTFLAG_Pos)
558 #define SysTick_CTRL_CLKSOURCE_Pos 2
559 #define SysTick_CTRL_CLKSOURCE_Msk (1UL << SysTick_CTRL_CLKSOURCE_Pos)
561 #define SysTick_CTRL_TICKINT_Pos 1
562 #define SysTick_CTRL_TICKINT_Msk (1UL << SysTick_CTRL_TICKINT_Pos)
564 #define SysTick_CTRL_ENABLE_Pos 0
565 #define SysTick_CTRL_ENABLE_Msk (1UL << SysTick_CTRL_ENABLE_Pos)
568 #define SysTick_LOAD_RELOAD_Pos 0
569 #define SysTick_LOAD_RELOAD_Msk (0xFFFFFFUL << SysTick_LOAD_RELOAD_Pos)
572 #define SysTick_VAL_CURRENT_Pos 0
573 #define SysTick_VAL_CURRENT_Msk (0xFFFFFFUL << SysTick_VAL_CURRENT_Pos)
576 #define SysTick_CALIB_NOREF_Pos 31
577 #define SysTick_CALIB_NOREF_Msk (1UL << SysTick_CALIB_NOREF_Pos)
579 #define SysTick_CALIB_SKEW_Pos 30
580 #define SysTick_CALIB_SKEW_Msk (1UL << SysTick_CALIB_SKEW_Pos)
582 #define SysTick_CALIB_TENMS_Pos 0
583 #define SysTick_CALIB_TENMS_Msk (0xFFFFFFUL << SysTick_VAL_CURRENT_Pos)
633 #define ITM_TPR_PRIVMASK_Pos 0
634 #define ITM_TPR_PRIVMASK_Msk (0xFUL << ITM_TPR_PRIVMASK_Pos)
637 #define ITM_TCR_BUSY_Pos 23
638 #define ITM_TCR_BUSY_Msk (1UL << ITM_TCR_BUSY_Pos)
640 #define ITM_TCR_TraceBusID_Pos 16
641 #define ITM_TCR_TraceBusID_Msk (0x7FUL << ITM_TCR_TraceBusID_Pos)
643 #define ITM_TCR_GTSFREQ_Pos 10
644 #define ITM_TCR_GTSFREQ_Msk (3UL << ITM_TCR_GTSFREQ_Pos)
646 #define ITM_TCR_TSPrescale_Pos 8
647 #define ITM_TCR_TSPrescale_Msk (3UL << ITM_TCR_TSPrescale_Pos)
649 #define ITM_TCR_SWOENA_Pos 4
650 #define ITM_TCR_SWOENA_Msk (1UL << ITM_TCR_SWOENA_Pos)
652 #define ITM_TCR_DWTENA_Pos 3
653 #define ITM_TCR_DWTENA_Msk (1UL << ITM_TCR_DWTENA_Pos)
655 #define ITM_TCR_SYNCENA_Pos 2
656 #define ITM_TCR_SYNCENA_Msk (1UL << ITM_TCR_SYNCENA_Pos)
658 #define ITM_TCR_TSENA_Pos 1
659 #define ITM_TCR_TSENA_Msk (1UL << ITM_TCR_TSENA_Pos)
661 #define ITM_TCR_ITMENA_Pos 0
662 #define ITM_TCR_ITMENA_Msk (1UL << ITM_TCR_ITMENA_Pos)
665 #define ITM_IWR_ATVALIDM_Pos 0
666 #define ITM_IWR_ATVALIDM_Msk (1UL << ITM_IWR_ATVALIDM_Pos)
669 #define ITM_IRR_ATREADYM_Pos 0
670 #define ITM_IRR_ATREADYM_Msk (1UL << ITM_IRR_ATREADYM_Pos)
673 #define ITM_IMCR_INTEGRATION_Pos 0
674 #define ITM_IMCR_INTEGRATION_Msk (1UL << ITM_IMCR_INTEGRATION_Pos)
677 #define ITM_LSR_ByteAcc_Pos 2
678 #define ITM_LSR_ByteAcc_Msk (1UL << ITM_LSR_ByteAcc_Pos)
680 #define ITM_LSR_Access_Pos 1
681 #define ITM_LSR_Access_Msk (1UL << ITM_LSR_Access_Pos)
683 #define ITM_LSR_Present_Pos 0
684 #define ITM_LSR_Present_Msk (1UL << ITM_LSR_Present_Pos)
725 #define DWT_CTRL_NUMCOMP_Pos 28
726 #define DWT_CTRL_NUMCOMP_Msk (0xFUL << DWT_CTRL_NUMCOMP_Pos)
728 #define DWT_CTRL_NOTRCPKT_Pos 27
729 #define DWT_CTRL_NOTRCPKT_Msk (0x1UL << DWT_CTRL_NOTRCPKT_Pos)
731 #define DWT_CTRL_NOEXTTRIG_Pos 26
732 #define DWT_CTRL_NOEXTTRIG_Msk (0x1UL << DWT_CTRL_NOEXTTRIG_Pos)
734 #define DWT_CTRL_NOCYCCNT_Pos 25
735 #define DWT_CTRL_NOCYCCNT_Msk (0x1UL << DWT_CTRL_NOCYCCNT_Pos)
737 #define DWT_CTRL_NOPRFCNT_Pos 24
738 #define DWT_CTRL_NOPRFCNT_Msk (0x1UL << DWT_CTRL_NOPRFCNT_Pos)
740 #define DWT_CTRL_CYCEVTENA_Pos 22
741 #define DWT_CTRL_CYCEVTENA_Msk (0x1UL << DWT_CTRL_CYCEVTENA_Pos)
743 #define DWT_CTRL_FOLDEVTENA_Pos 21
744 #define DWT_CTRL_FOLDEVTENA_Msk (0x1UL << DWT_CTRL_FOLDEVTENA_Pos)
746 #define DWT_CTRL_LSUEVTENA_Pos 20
747 #define DWT_CTRL_LSUEVTENA_Msk (0x1UL << DWT_CTRL_LSUEVTENA_Pos)
749 #define DWT_CTRL_SLEEPEVTENA_Pos 19
750 #define DWT_CTRL_SLEEPEVTENA_Msk (0x1UL << DWT_CTRL_SLEEPEVTENA_Pos)
752 #define DWT_CTRL_EXCEVTENA_Pos 18
753 #define DWT_CTRL_EXCEVTENA_Msk (0x1UL << DWT_CTRL_EXCEVTENA_Pos)
755 #define DWT_CTRL_CPIEVTENA_Pos 17
756 #define DWT_CTRL_CPIEVTENA_Msk (0x1UL << DWT_CTRL_CPIEVTENA_Pos)
758 #define DWT_CTRL_EXCTRCENA_Pos 16
759 #define DWT_CTRL_EXCTRCENA_Msk (0x1UL << DWT_CTRL_EXCTRCENA_Pos)
761 #define DWT_CTRL_PCSAMPLENA_Pos 12
762 #define DWT_CTRL_PCSAMPLENA_Msk (0x1UL << DWT_CTRL_PCSAMPLENA_Pos)
764 #define DWT_CTRL_SYNCTAP_Pos 10
765 #define DWT_CTRL_SYNCTAP_Msk (0x3UL << DWT_CTRL_SYNCTAP_Pos)
767 #define DWT_CTRL_CYCTAP_Pos 9
768 #define DWT_CTRL_CYCTAP_Msk (0x1UL << DWT_CTRL_CYCTAP_Pos)
770 #define DWT_CTRL_POSTINIT_Pos 5
771 #define DWT_CTRL_POSTINIT_Msk (0xFUL << DWT_CTRL_POSTINIT_Pos)
773 #define DWT_CTRL_POSTPRESET_Pos 1
774 #define DWT_CTRL_POSTPRESET_Msk (0xFUL << DWT_CTRL_POSTPRESET_Pos)
776 #define DWT_CTRL_CYCCNTENA_Pos 0
777 #define DWT_CTRL_CYCCNTENA_Msk (0x1UL << DWT_CTRL_CYCCNTENA_Pos)
780 #define DWT_CPICNT_CPICNT_Pos 0
781 #define DWT_CPICNT_CPICNT_Msk (0xFFUL << DWT_CPICNT_CPICNT_Pos)
784 #define DWT_EXCCNT_EXCCNT_Pos 0
785 #define DWT_EXCCNT_EXCCNT_Msk (0xFFUL << DWT_EXCCNT_EXCCNT_Pos)
788 #define DWT_SLEEPCNT_SLEEPCNT_Pos 0
789 #define DWT_SLEEPCNT_SLEEPCNT_Msk (0xFFUL << DWT_SLEEPCNT_SLEEPCNT_Pos)
792 #define DWT_LSUCNT_LSUCNT_Pos 0
793 #define DWT_LSUCNT_LSUCNT_Msk (0xFFUL << DWT_LSUCNT_LSUCNT_Pos)
796 #define DWT_FOLDCNT_FOLDCNT_Pos 0
797 #define DWT_FOLDCNT_FOLDCNT_Msk (0xFFUL << DWT_FOLDCNT_FOLDCNT_Pos)
800 #define DWT_MASK_MASK_Pos 0
801 #define DWT_MASK_MASK_Msk (0x1FUL << DWT_MASK_MASK_Pos)
804 #define DWT_FUNCTION_MATCHED_Pos 24
805 #define DWT_FUNCTION_MATCHED_Msk (0x1UL << DWT_FUNCTION_MATCHED_Pos)
807 #define DWT_FUNCTION_DATAVADDR1_Pos 16
808 #define DWT_FUNCTION_DATAVADDR1_Msk (0xFUL << DWT_FUNCTION_DATAVADDR1_Pos)
810 #define DWT_FUNCTION_DATAVADDR0_Pos 12
811 #define DWT_FUNCTION_DATAVADDR0_Msk (0xFUL << DWT_FUNCTION_DATAVADDR0_Pos)
813 #define DWT_FUNCTION_DATAVSIZE_Pos 10
814 #define DWT_FUNCTION_DATAVSIZE_Msk (0x3UL << DWT_FUNCTION_DATAVSIZE_Pos)
816 #define DWT_FUNCTION_LNK1ENA_Pos 9
817 #define DWT_FUNCTION_LNK1ENA_Msk (0x1UL << DWT_FUNCTION_LNK1ENA_Pos)
819 #define DWT_FUNCTION_DATAVMATCH_Pos 8
820 #define DWT_FUNCTION_DATAVMATCH_Msk (0x1UL << DWT_FUNCTION_DATAVMATCH_Pos)
822 #define DWT_FUNCTION_CYCMATCH_Pos 7
823 #define DWT_FUNCTION_CYCMATCH_Msk (0x1UL << DWT_FUNCTION_CYCMATCH_Pos)
825 #define DWT_FUNCTION_EMITRANGE_Pos 5
826 #define DWT_FUNCTION_EMITRANGE_Msk (0x1UL << DWT_FUNCTION_EMITRANGE_Pos)
828 #define DWT_FUNCTION_FUNCTION_Pos 0
829 #define DWT_FUNCTION_FUNCTION_Msk (0xFUL << DWT_FUNCTION_FUNCTION_Pos)
871 #define TPI_ACPR_PRESCALER_Pos 0
872 #define TPI_ACPR_PRESCALER_Msk (0x1FFFUL << TPI_ACPR_PRESCALER_Pos)
875 #define TPI_SPPR_TXMODE_Pos 0
876 #define TPI_SPPR_TXMODE_Msk (0x3UL << TPI_SPPR_TXMODE_Pos)
879 #define TPI_FFSR_FtNonStop_Pos 3
880 #define TPI_FFSR_FtNonStop_Msk (0x1UL << TPI_FFSR_FtNonStop_Pos)
882 #define TPI_FFSR_TCPresent_Pos 2
883 #define TPI_FFSR_TCPresent_Msk (0x1UL << TPI_FFSR_TCPresent_Pos)
885 #define TPI_FFSR_FtStopped_Pos 1
886 #define TPI_FFSR_FtStopped_Msk (0x1UL << TPI_FFSR_FtStopped_Pos)
888 #define TPI_FFSR_FlInProg_Pos 0
889 #define TPI_FFSR_FlInProg_Msk (0x1UL << TPI_FFSR_FlInProg_Pos)
892 #define TPI_FFCR_TrigIn_Pos 8
893 #define TPI_FFCR_TrigIn_Msk (0x1UL << TPI_FFCR_TrigIn_Pos)
895 #define TPI_FFCR_EnFCont_Pos 1
896 #define TPI_FFCR_EnFCont_Msk (0x1UL << TPI_FFCR_EnFCont_Pos)
899 #define TPI_TRIGGER_TRIGGER_Pos 0
900 #define TPI_TRIGGER_TRIGGER_Msk (0x1UL << TPI_TRIGGER_TRIGGER_Pos)
903 #define TPI_FIFO0_ITM_ATVALID_Pos 29
904 #define TPI_FIFO0_ITM_ATVALID_Msk (0x3UL << TPI_FIFO0_ITM_ATVALID_Pos)
906 #define TPI_FIFO0_ITM_bytecount_Pos 27
907 #define TPI_FIFO0_ITM_bytecount_Msk (0x3UL << TPI_FIFO0_ITM_bytecount_Pos)
909 #define TPI_FIFO0_ETM_ATVALID_Pos 26
910 #define TPI_FIFO0_ETM_ATVALID_Msk (0x3UL << TPI_FIFO0_ETM_ATVALID_Pos)
912 #define TPI_FIFO0_ETM_bytecount_Pos 24
913 #define TPI_FIFO0_ETM_bytecount_Msk (0x3UL << TPI_FIFO0_ETM_bytecount_Pos)
915 #define TPI_FIFO0_ETM2_Pos 16
916 #define TPI_FIFO0_ETM2_Msk (0xFFUL << TPI_FIFO0_ETM2_Pos)
918 #define TPI_FIFO0_ETM1_Pos 8
919 #define TPI_FIFO0_ETM1_Msk (0xFFUL << TPI_FIFO0_ETM1_Pos)
921 #define TPI_FIFO0_ETM0_Pos 0
922 #define TPI_FIFO0_ETM0_Msk (0xFFUL << TPI_FIFO0_ETM0_Pos)
925 #define TPI_ITATBCTR2_ATREADY_Pos 0
926 #define TPI_ITATBCTR2_ATREADY_Msk (0x1UL << TPI_ITATBCTR2_ATREADY_Pos)
929 #define TPI_FIFO1_ITM_ATVALID_Pos 29
930 #define TPI_FIFO1_ITM_ATVALID_Msk (0x3UL << TPI_FIFO1_ITM_ATVALID_Pos)
932 #define TPI_FIFO1_ITM_bytecount_Pos 27
933 #define TPI_FIFO1_ITM_bytecount_Msk (0x3UL << TPI_FIFO1_ITM_bytecount_Pos)
935 #define TPI_FIFO1_ETM_ATVALID_Pos 26
936 #define TPI_FIFO1_ETM_ATVALID_Msk (0x3UL << TPI_FIFO1_ETM_ATVALID_Pos)
938 #define TPI_FIFO1_ETM_bytecount_Pos 24
939 #define TPI_FIFO1_ETM_bytecount_Msk (0x3UL << TPI_FIFO1_ETM_bytecount_Pos)
941 #define TPI_FIFO1_ITM2_Pos 16
942 #define TPI_FIFO1_ITM2_Msk (0xFFUL << TPI_FIFO1_ITM2_Pos)
944 #define TPI_FIFO1_ITM1_Pos 8
945 #define TPI_FIFO1_ITM1_Msk (0xFFUL << TPI_FIFO1_ITM1_Pos)
947 #define TPI_FIFO1_ITM0_Pos 0
948 #define TPI_FIFO1_ITM0_Msk (0xFFUL << TPI_FIFO1_ITM0_Pos)
951 #define TPI_ITATBCTR0_ATREADY_Pos 0
952 #define TPI_ITATBCTR0_ATREADY_Msk (0x1UL << TPI_ITATBCTR0_ATREADY_Pos)
955 #define TPI_ITCTRL_Mode_Pos 0
956 #define TPI_ITCTRL_Mode_Msk (0x1UL << TPI_ITCTRL_Mode_Pos)
959 #define TPI_DEVID_NRZVALID_Pos 11
960 #define TPI_DEVID_NRZVALID_Msk (0x1UL << TPI_DEVID_NRZVALID_Pos)
962 #define TPI_DEVID_MANCVALID_Pos 10
963 #define TPI_DEVID_MANCVALID_Msk (0x1UL << TPI_DEVID_MANCVALID_Pos)
965 #define TPI_DEVID_PTINVALID_Pos 9
966 #define TPI_DEVID_PTINVALID_Msk (0x1UL << TPI_DEVID_PTINVALID_Pos)
968 #define TPI_DEVID_MinBufSz_Pos 6
969 #define TPI_DEVID_MinBufSz_Msk (0x7UL << TPI_DEVID_MinBufSz_Pos)
971 #define TPI_DEVID_AsynClkIn_Pos 5
972 #define TPI_DEVID_AsynClkIn_Msk (0x1UL << TPI_DEVID_AsynClkIn_Pos)
974 #define TPI_DEVID_NrTraceInput_Pos 0
975 #define TPI_DEVID_NrTraceInput_Msk (0x1FUL << TPI_DEVID_NrTraceInput_Pos)
978 #define TPI_DEVTYPE_SubType_Pos 0
979 #define TPI_DEVTYPE_SubType_Msk (0xFUL << TPI_DEVTYPE_SubType_Pos)
981 #define TPI_DEVTYPE_MajorType_Pos 4
982 #define TPI_DEVTYPE_MajorType_Msk (0xFUL << TPI_DEVTYPE_MajorType_Pos)
987 #if (__MPU_PRESENT == 1)
1012 #define MPU_TYPE_IREGION_Pos 16
1013 #define MPU_TYPE_IREGION_Msk (0xFFUL << MPU_TYPE_IREGION_Pos)
1015 #define MPU_TYPE_DREGION_Pos 8
1016 #define MPU_TYPE_DREGION_Msk (0xFFUL << MPU_TYPE_DREGION_Pos)
1018 #define MPU_TYPE_SEPARATE_Pos 0
1019 #define MPU_TYPE_SEPARATE_Msk (1UL << MPU_TYPE_SEPARATE_Pos)
1022 #define MPU_CTRL_PRIVDEFENA_Pos 2
1023 #define MPU_CTRL_PRIVDEFENA_Msk (1UL << MPU_CTRL_PRIVDEFENA_Pos)
1025 #define MPU_CTRL_HFNMIENA_Pos 1
1026 #define MPU_CTRL_HFNMIENA_Msk (1UL << MPU_CTRL_HFNMIENA_Pos)
1028 #define MPU_CTRL_ENABLE_Pos 0
1029 #define MPU_CTRL_ENABLE_Msk (1UL << MPU_CTRL_ENABLE_Pos)
1032 #define MPU_RNR_REGION_Pos 0
1033 #define MPU_RNR_REGION_Msk (0xFFUL << MPU_RNR_REGION_Pos)
1036 #define MPU_RBAR_ADDR_Pos 5
1037 #define MPU_RBAR_ADDR_Msk (0x7FFFFFFUL << MPU_RBAR_ADDR_Pos)
1039 #define MPU_RBAR_VALID_Pos 4
1040 #define MPU_RBAR_VALID_Msk (1UL << MPU_RBAR_VALID_Pos)
1042 #define MPU_RBAR_REGION_Pos 0
1043 #define MPU_RBAR_REGION_Msk (0xFUL << MPU_RBAR_REGION_Pos)
1046 #define MPU_RASR_ATTRS_Pos 16
1047 #define MPU_RASR_ATTRS_Msk (0xFFFFUL << MPU_RASR_ATTRS_Pos)
1049 #define MPU_RASR_XN_Pos 28
1050 #define MPU_RASR_XN_Msk (1UL << MPU_RASR_XN_Pos)
1052 #define MPU_RASR_AP_Pos 24
1053 #define MPU_RASR_AP_Msk (0x7UL << MPU_RASR_AP_Pos)
1055 #define MPU_RASR_TEX_Pos 19
1056 #define MPU_RASR_TEX_Msk (0x7UL << MPU_RASR_TEX_Pos)
1058 #define MPU_RASR_S_Pos 18
1059 #define MPU_RASR_S_Msk (1UL << MPU_RASR_S_Pos)
1061 #define MPU_RASR_C_Pos 17
1062 #define MPU_RASR_C_Msk (1UL << MPU_RASR_C_Pos)
1064 #define MPU_RASR_B_Pos 16
1065 #define MPU_RASR_B_Msk (1UL << MPU_RASR_B_Pos)
1067 #define MPU_RASR_SRD_Pos 8
1068 #define MPU_RASR_SRD_Msk (0xFFUL << MPU_RASR_SRD_Pos)
1070 #define MPU_RASR_SIZE_Pos 1
1071 #define MPU_RASR_SIZE_Msk (0x1FUL << MPU_RASR_SIZE_Pos)
1073 #define MPU_RASR_ENABLE_Pos 0
1074 #define MPU_RASR_ENABLE_Msk (1UL << MPU_RASR_ENABLE_Pos)
1097 #define CoreDebug_DHCSR_DBGKEY_Pos 16
1098 #define CoreDebug_DHCSR_DBGKEY_Msk (0xFFFFUL << CoreDebug_DHCSR_DBGKEY_Pos)
1100 #define CoreDebug_DHCSR_S_RESET_ST_Pos 25
1101 #define CoreDebug_DHCSR_S_RESET_ST_Msk (1UL << CoreDebug_DHCSR_S_RESET_ST_Pos)
1103 #define CoreDebug_DHCSR_S_RETIRE_ST_Pos 24
1104 #define CoreDebug_DHCSR_S_RETIRE_ST_Msk (1UL << CoreDebug_DHCSR_S_RETIRE_ST_Pos)
1106 #define CoreDebug_DHCSR_S_LOCKUP_Pos 19
1107 #define CoreDebug_DHCSR_S_LOCKUP_Msk (1UL << CoreDebug_DHCSR_S_LOCKUP_Pos)
1109 #define CoreDebug_DHCSR_S_SLEEP_Pos 18
1110 #define CoreDebug_DHCSR_S_SLEEP_Msk (1UL << CoreDebug_DHCSR_S_SLEEP_Pos)
1112 #define CoreDebug_DHCSR_S_HALT_Pos 17
1113 #define CoreDebug_DHCSR_S_HALT_Msk (1UL << CoreDebug_DHCSR_S_HALT_Pos)
1115 #define CoreDebug_DHCSR_S_REGRDY_Pos 16
1116 #define CoreDebug_DHCSR_S_REGRDY_Msk (1UL << CoreDebug_DHCSR_S_REGRDY_Pos)
1118 #define CoreDebug_DHCSR_C_SNAPSTALL_Pos 5
1119 #define CoreDebug_DHCSR_C_SNAPSTALL_Msk (1UL << CoreDebug_DHCSR_C_SNAPSTALL_Pos)
1121 #define CoreDebug_DHCSR_C_MASKINTS_Pos 3
1122 #define CoreDebug_DHCSR_C_MASKINTS_Msk (1UL << CoreDebug_DHCSR_C_MASKINTS_Pos)
1124 #define CoreDebug_DHCSR_C_STEP_Pos 2
1125 #define CoreDebug_DHCSR_C_STEP_Msk (1UL << CoreDebug_DHCSR_C_STEP_Pos)
1127 #define CoreDebug_DHCSR_C_HALT_Pos 1
1128 #define CoreDebug_DHCSR_C_HALT_Msk (1UL << CoreDebug_DHCSR_C_HALT_Pos)
1130 #define CoreDebug_DHCSR_C_DEBUGEN_Pos 0
1131 #define CoreDebug_DHCSR_C_DEBUGEN_Msk (1UL << CoreDebug_DHCSR_C_DEBUGEN_Pos)
1134 #define CoreDebug_DCRSR_REGWnR_Pos 16
1135 #define CoreDebug_DCRSR_REGWnR_Msk (1UL << CoreDebug_DCRSR_REGWnR_Pos)
1137 #define CoreDebug_DCRSR_REGSEL_Pos 0
1138 #define CoreDebug_DCRSR_REGSEL_Msk (0x1FUL << CoreDebug_DCRSR_REGSEL_Pos)
1141 #define CoreDebug_DEMCR_TRCENA_Pos 24
1142 #define CoreDebug_DEMCR_TRCENA_Msk (1UL << CoreDebug_DEMCR_TRCENA_Pos)
1144 #define CoreDebug_DEMCR_MON_REQ_Pos 19
1145 #define CoreDebug_DEMCR_MON_REQ_Msk (1UL << CoreDebug_DEMCR_MON_REQ_Pos)
1147 #define CoreDebug_DEMCR_MON_STEP_Pos 18
1148 #define CoreDebug_DEMCR_MON_STEP_Msk (1UL << CoreDebug_DEMCR_MON_STEP_Pos)
1150 #define CoreDebug_DEMCR_MON_PEND_Pos 17
1151 #define CoreDebug_DEMCR_MON_PEND_Msk (1UL << CoreDebug_DEMCR_MON_PEND_Pos)
1153 #define CoreDebug_DEMCR_MON_EN_Pos 16
1154 #define CoreDebug_DEMCR_MON_EN_Msk (1UL << CoreDebug_DEMCR_MON_EN_Pos)
1156 #define CoreDebug_DEMCR_VC_HARDERR_Pos 10
1157 #define CoreDebug_DEMCR_VC_HARDERR_Msk (1UL << CoreDebug_DEMCR_VC_HARDERR_Pos)
1159 #define CoreDebug_DEMCR_VC_INTERR_Pos 9
1160 #define CoreDebug_DEMCR_VC_INTERR_Msk (1UL << CoreDebug_DEMCR_VC_INTERR_Pos)
1162 #define CoreDebug_DEMCR_VC_BUSERR_Pos 8
1163 #define CoreDebug_DEMCR_VC_BUSERR_Msk (1UL << CoreDebug_DEMCR_VC_BUSERR_Pos)
1165 #define CoreDebug_DEMCR_VC_STATERR_Pos 7
1166 #define CoreDebug_DEMCR_VC_STATERR_Msk (1UL << CoreDebug_DEMCR_VC_STATERR_Pos)
1168 #define CoreDebug_DEMCR_VC_CHKERR_Pos 6
1169 #define CoreDebug_DEMCR_VC_CHKERR_Msk (1UL << CoreDebug_DEMCR_VC_CHKERR_Pos)
1171 #define CoreDebug_DEMCR_VC_NOCPERR_Pos 5
1172 #define CoreDebug_DEMCR_VC_NOCPERR_Msk (1UL << CoreDebug_DEMCR_VC_NOCPERR_Pos)
1174 #define CoreDebug_DEMCR_VC_MMERR_Pos 4
1175 #define CoreDebug_DEMCR_VC_MMERR_Msk (1UL << CoreDebug_DEMCR_VC_MMERR_Pos)
1177 #define CoreDebug_DEMCR_VC_CORERESET_Pos 0
1178 #define CoreDebug_DEMCR_VC_CORERESET_Msk (1UL << CoreDebug_DEMCR_VC_CORERESET_Pos)
1190 #define SCS_BASE (0xE000E000UL)
1191 #define ITM_BASE (0xE0000000UL)
1192 #define DWT_BASE (0xE0001000UL)
1193 #define TPI_BASE (0xE0040000UL)
1194 #define CoreDebug_BASE (0xE000EDF0UL)
1195 #define SysTick_BASE (SCS_BASE + 0x0010UL)
1196 #define NVIC_BASE (SCS_BASE + 0x0100UL)
1197 #define SCB_BASE (SCS_BASE + 0x0D00UL)
1199 #define SCnSCB ((SCnSCB_Type *) SCS_BASE )
1200 #define SCB ((SCB_Type *) SCB_BASE )
1201 #define SysTick ((SysTick_Type *) SysTick_BASE )
1202 #define NVIC ((NVIC_Type *) NVIC_BASE )
1203 #define ITM ((ITM_Type *) ITM_BASE )
1204 #define DWT ((DWT_Type *) DWT_BASE )
1205 #define TPI ((TPI_Type *) TPI_BASE )
1206 #define CoreDebug ((CoreDebug_Type *) CoreDebug_BASE)
1208 #if (__MPU_PRESENT == 1)
1209 #define MPU_BASE (SCS_BASE + 0x0D90UL)
1210 #define MPU ((MPU_Type *) MPU_BASE )
1252 reg_value =
SCB->AIRCR;
1254 reg_value = (reg_value |
1256 (PriorityGroupTmp << 8));
1257 SCB->AIRCR = reg_value;
1405 uint32_t PriorityGroupTmp = (PriorityGroup & 0x07);
1413 ((PreemptPriority & ((1 << (PreemptPriorityBits)) - 1)) << SubPriorityBits) |
1414 ((SubPriority & ((1 << (SubPriorityBits )) - 1)))
1433 uint32_t PriorityGroupTmp = (PriorityGroup & 0x07);
1437 PreemptPriorityBits = ((7 - PriorityGroupTmp) > __NVIC_PRIO_BITS) ? __NVIC_PRIO_BITS : 7 - PriorityGroupTmp;
1440 *pPreemptPriority = (Priority >> SubPriorityBits) & ((1 << (PreemptPriorityBits)) - 1);
1441 *pSubPriority = (Priority ) & ((1 << (SubPriorityBits )) - 1);
1471 #if (__Vendor_SysTickConfig == 0)
1515 #define ITM_RXBUFFER_EMPTY 0x5AA55AA5
1531 (
ITM->TER & (1UL << 0) ) )
1533 while (
ITM->PORT[0].u32 == 0);