Go to the documentation of this file.
23 #if defined ( __ICCARM__ )
24 #pragma system_include
31 #ifndef __CORE_SC000_H_GENERIC
32 #define __CORE_SC000_H_GENERIC
56 #define __SC000_CMSIS_VERSION_MAIN (0x03)
57 #define __SC000_CMSIS_VERSION_SUB (0x01)
58 #define __SC000_CMSIS_VERSION ((__SC000_CMSIS_VERSION_MAIN << 16) | \
59 __SC000_CMSIS_VERSION_SUB )
61 #define __CORTEX_SC (0)
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_SC000_H_DEPENDANT
120 #define __CORE_SC000_H_DEPENDANT
123 #if defined __CHECK_DEVICE_DEFINES
125 #define __SC000_REV 0x0000
126 #warning "__SC000_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 2
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
190 #if (__CORTEX_M != 0x04)
227 #if (__CORTEX_M != 0x04)
312 #define SCB_CPUID_IMPLEMENTER_Pos 24
313 #define SCB_CPUID_IMPLEMENTER_Msk (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos)
315 #define SCB_CPUID_VARIANT_Pos 20
316 #define SCB_CPUID_VARIANT_Msk (0xFUL << SCB_CPUID_VARIANT_Pos)
318 #define SCB_CPUID_ARCHITECTURE_Pos 16
319 #define SCB_CPUID_ARCHITECTURE_Msk (0xFUL << SCB_CPUID_ARCHITECTURE_Pos)
321 #define SCB_CPUID_PARTNO_Pos 4
322 #define SCB_CPUID_PARTNO_Msk (0xFFFUL << SCB_CPUID_PARTNO_Pos)
324 #define SCB_CPUID_REVISION_Pos 0
325 #define SCB_CPUID_REVISION_Msk (0xFUL << SCB_CPUID_REVISION_Pos)
328 #define SCB_ICSR_NMIPENDSET_Pos 31
329 #define SCB_ICSR_NMIPENDSET_Msk (1UL << SCB_ICSR_NMIPENDSET_Pos)
331 #define SCB_ICSR_PENDSVSET_Pos 28
332 #define SCB_ICSR_PENDSVSET_Msk (1UL << SCB_ICSR_PENDSVSET_Pos)
334 #define SCB_ICSR_PENDSVCLR_Pos 27
335 #define SCB_ICSR_PENDSVCLR_Msk (1UL << SCB_ICSR_PENDSVCLR_Pos)
337 #define SCB_ICSR_PENDSTSET_Pos 26
338 #define SCB_ICSR_PENDSTSET_Msk (1UL << SCB_ICSR_PENDSTSET_Pos)
340 #define SCB_ICSR_PENDSTCLR_Pos 25
341 #define SCB_ICSR_PENDSTCLR_Msk (1UL << SCB_ICSR_PENDSTCLR_Pos)
343 #define SCB_ICSR_ISRPREEMPT_Pos 23
344 #define SCB_ICSR_ISRPREEMPT_Msk (1UL << SCB_ICSR_ISRPREEMPT_Pos)
346 #define SCB_ICSR_ISRPENDING_Pos 22
347 #define SCB_ICSR_ISRPENDING_Msk (1UL << SCB_ICSR_ISRPENDING_Pos)
349 #define SCB_ICSR_VECTPENDING_Pos 12
350 #define SCB_ICSR_VECTPENDING_Msk (0x1FFUL << SCB_ICSR_VECTPENDING_Pos)
352 #define SCB_ICSR_VECTACTIVE_Pos 0
353 #define SCB_ICSR_VECTACTIVE_Msk (0x1FFUL << SCB_ICSR_VECTACTIVE_Pos)
356 #define SCB_VTOR_TBLOFF_Pos 7
357 #define SCB_VTOR_TBLOFF_Msk (0x1FFFFFFUL << SCB_VTOR_TBLOFF_Pos)
360 #define SCB_AIRCR_VECTKEY_Pos 16
361 #define SCB_AIRCR_VECTKEY_Msk (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos)
363 #define SCB_AIRCR_VECTKEYSTAT_Pos 16
364 #define SCB_AIRCR_VECTKEYSTAT_Msk (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos)
366 #define SCB_AIRCR_ENDIANESS_Pos 15
367 #define SCB_AIRCR_ENDIANESS_Msk (1UL << SCB_AIRCR_ENDIANESS_Pos)
369 #define SCB_AIRCR_SYSRESETREQ_Pos 2
370 #define SCB_AIRCR_SYSRESETREQ_Msk (1UL << SCB_AIRCR_SYSRESETREQ_Pos)
372 #define SCB_AIRCR_VECTCLRACTIVE_Pos 1
373 #define SCB_AIRCR_VECTCLRACTIVE_Msk (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos)
376 #define SCB_SCR_SEVONPEND_Pos 4
377 #define SCB_SCR_SEVONPEND_Msk (1UL << SCB_SCR_SEVONPEND_Pos)
379 #define SCB_SCR_SLEEPDEEP_Pos 2
380 #define SCB_SCR_SLEEPDEEP_Msk (1UL << SCB_SCR_SLEEPDEEP_Pos)
382 #define SCB_SCR_SLEEPONEXIT_Pos 1
383 #define SCB_SCR_SLEEPONEXIT_Msk (1UL << SCB_SCR_SLEEPONEXIT_Pos)
386 #define SCB_CCR_STKALIGN_Pos 9
387 #define SCB_CCR_STKALIGN_Msk (1UL << SCB_CCR_STKALIGN_Pos)
389 #define SCB_CCR_UNALIGN_TRP_Pos 3
390 #define SCB_CCR_UNALIGN_TRP_Msk (1UL << SCB_CCR_UNALIGN_TRP_Pos)
393 #define SCB_SHCSR_SVCALLPENDED_Pos 15
394 #define SCB_SHCSR_SVCALLPENDED_Msk (1UL << SCB_SHCSR_SVCALLPENDED_Pos)
397 #define SCB_SFCR_UNIBRTIMING_Pos 0
398 #define SCB_SFCR_UNIBRTIMING_Msk (1UL << SCB_SHCSR_SVCALLPENDED_Pos)
400 #define SCB_SFCR_SECKEY_Pos 16
401 #define SCB_SFCR_SECKEY_Msk (0xFFFFUL << SCB_SHCSR_SVCALLPENDED_Pos)
421 #define SCnSCB_ACTLR_DISMCYCINT_Pos 0
422 #define SCnSCB_ACTLR_DISMCYCINT_Msk (1UL << SCnSCB_ACTLR_DISMCYCINT_Pos)
444 #define SysTick_CTRL_COUNTFLAG_Pos 16
445 #define SysTick_CTRL_COUNTFLAG_Msk (1UL << SysTick_CTRL_COUNTFLAG_Pos)
447 #define SysTick_CTRL_CLKSOURCE_Pos 2
448 #define SysTick_CTRL_CLKSOURCE_Msk (1UL << SysTick_CTRL_CLKSOURCE_Pos)
450 #define SysTick_CTRL_TICKINT_Pos 1
451 #define SysTick_CTRL_TICKINT_Msk (1UL << SysTick_CTRL_TICKINT_Pos)
453 #define SysTick_CTRL_ENABLE_Pos 0
454 #define SysTick_CTRL_ENABLE_Msk (1UL << SysTick_CTRL_ENABLE_Pos)
457 #define SysTick_LOAD_RELOAD_Pos 0
458 #define SysTick_LOAD_RELOAD_Msk (0xFFFFFFUL << SysTick_LOAD_RELOAD_Pos)
461 #define SysTick_VAL_CURRENT_Pos 0
462 #define SysTick_VAL_CURRENT_Msk (0xFFFFFFUL << SysTick_VAL_CURRENT_Pos)
465 #define SysTick_CALIB_NOREF_Pos 31
466 #define SysTick_CALIB_NOREF_Msk (1UL << SysTick_CALIB_NOREF_Pos)
468 #define SysTick_CALIB_SKEW_Pos 30
469 #define SysTick_CALIB_SKEW_Msk (1UL << SysTick_CALIB_SKEW_Pos)
471 #define SysTick_CALIB_TENMS_Pos 0
472 #define SysTick_CALIB_TENMS_Msk (0xFFFFFFUL << SysTick_VAL_CURRENT_Pos)
476 #if (__MPU_PRESENT == 1)
495 #define MPU_TYPE_IREGION_Pos 16
496 #define MPU_TYPE_IREGION_Msk (0xFFUL << MPU_TYPE_IREGION_Pos)
498 #define MPU_TYPE_DREGION_Pos 8
499 #define MPU_TYPE_DREGION_Msk (0xFFUL << MPU_TYPE_DREGION_Pos)
501 #define MPU_TYPE_SEPARATE_Pos 0
502 #define MPU_TYPE_SEPARATE_Msk (1UL << MPU_TYPE_SEPARATE_Pos)
505 #define MPU_CTRL_PRIVDEFENA_Pos 2
506 #define MPU_CTRL_PRIVDEFENA_Msk (1UL << MPU_CTRL_PRIVDEFENA_Pos)
508 #define MPU_CTRL_HFNMIENA_Pos 1
509 #define MPU_CTRL_HFNMIENA_Msk (1UL << MPU_CTRL_HFNMIENA_Pos)
511 #define MPU_CTRL_ENABLE_Pos 0
512 #define MPU_CTRL_ENABLE_Msk (1UL << MPU_CTRL_ENABLE_Pos)
515 #define MPU_RNR_REGION_Pos 0
516 #define MPU_RNR_REGION_Msk (0xFFUL << MPU_RNR_REGION_Pos)
519 #define MPU_RBAR_ADDR_Pos 8
520 #define MPU_RBAR_ADDR_Msk (0xFFFFFFUL << MPU_RBAR_ADDR_Pos)
522 #define MPU_RBAR_VALID_Pos 4
523 #define MPU_RBAR_VALID_Msk (1UL << MPU_RBAR_VALID_Pos)
525 #define MPU_RBAR_REGION_Pos 0
526 #define MPU_RBAR_REGION_Msk (0xFUL << MPU_RBAR_REGION_Pos)
529 #define MPU_RASR_ATTRS_Pos 16
530 #define MPU_RASR_ATTRS_Msk (0xFFFFUL << MPU_RASR_ATTRS_Pos)
532 #define MPU_RASR_XN_Pos 28
533 #define MPU_RASR_XN_Msk (1UL << MPU_RASR_XN_Pos)
535 #define MPU_RASR_AP_Pos 24
536 #define MPU_RASR_AP_Msk (0x7UL << MPU_RASR_AP_Pos)
538 #define MPU_RASR_TEX_Pos 19
539 #define MPU_RASR_TEX_Msk (0x7UL << MPU_RASR_TEX_Pos)
541 #define MPU_RASR_S_Pos 18
542 #define MPU_RASR_S_Msk (1UL << MPU_RASR_S_Pos)
544 #define MPU_RASR_C_Pos 17
545 #define MPU_RASR_C_Msk (1UL << MPU_RASR_C_Pos)
547 #define MPU_RASR_B_Pos 16
548 #define MPU_RASR_B_Msk (1UL << MPU_RASR_B_Pos)
550 #define MPU_RASR_SRD_Pos 8
551 #define MPU_RASR_SRD_Msk (0xFFUL << MPU_RASR_SRD_Pos)
553 #define MPU_RASR_SIZE_Pos 1
554 #define MPU_RASR_SIZE_Msk (0x1FUL << MPU_RASR_SIZE_Pos)
556 #define MPU_RASR_ENABLE_Pos 0
557 #define MPU_RASR_ENABLE_Msk (1UL << MPU_RASR_ENABLE_Pos)
580 #define SCS_BASE (0xE000E000UL)
581 #define SysTick_BASE (SCS_BASE + 0x0010UL)
582 #define NVIC_BASE (SCS_BASE + 0x0100UL)
583 #define SCB_BASE (SCS_BASE + 0x0D00UL)
585 #define SCnSCB ((SCnSCB_Type *) SCS_BASE )
586 #define SCB ((SCB_Type *) SCB_BASE )
587 #define SysTick ((SysTick_Type *) SysTick_BASE )
588 #define NVIC ((NVIC_Type *) NVIC_BASE )
590 #if (__MPU_PRESENT == 1)
591 #define MPU_BASE (SCS_BASE + 0x0D90UL)
592 #define MPU ((MPU_Type *) MPU_BASE )
620 #define _BIT_SHIFT(IRQn) ( (((uint32_t)(IRQn) ) & 0x03) * 8 )
621 #define _SHP_IDX(IRQn) ( ((((uint32_t)(IRQn) & 0x0F)-8) >> 2) )
622 #define _IP_IDX(IRQn) ( ((uint32_t)(IRQn) >> 2) )
755 #if (__Vendor_SysTickConfig == 0)