См. документацию.
23 #if defined ( __ICCARM__ )
24 #pragma system_include
31 #ifndef __CORE_CM0_H_GENERIC
32 #define __CORE_CM0_H_GENERIC
56 #define __CM0_CMSIS_VERSION_MAIN (0x03)
57 #define __CM0_CMSIS_VERSION_SUB (0x01)
58 #define __CM0_CMSIS_VERSION ((__CM0_CMSIS_VERSION_MAIN << 16) | \
59 __CM0_CMSIS_VERSION_SUB )
61 #define __CORTEX_M (0x00)
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_CM0_H_DEPENDANT
120 #define __CORE_CM0_H_DEPENDANT
123 #if defined __CHECK_DEVICE_DEFINES
125 #define __CM0_REV 0x0000
126 #warning "__CM0_REV not defined in device header file; using default!"
129 #ifndef __NVIC_PRIO_BITS
130 #define __NVIC_PRIO_BITS 2
131 #warning "__NVIC_PRIO_BITS not defined in device header file; using default!"
134 #ifndef __Vendor_SysTickConfig
135 #define __Vendor_SysTickConfig 0
136 #warning "__Vendor_SysTickConfig not defined in device header file; using default!"
151 #define __I volatile const
154 #define __IO volatile
184 #if (__CORTEX_M != 0x04)
221 #if (__CORTEX_M != 0x04)
304 #define SCB_CPUID_IMPLEMENTER_Pos 24
305 #define SCB_CPUID_IMPLEMENTER_Msk (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos)
307 #define SCB_CPUID_VARIANT_Pos 20
308 #define SCB_CPUID_VARIANT_Msk (0xFUL << SCB_CPUID_VARIANT_Pos)
310 #define SCB_CPUID_ARCHITECTURE_Pos 16
311 #define SCB_CPUID_ARCHITECTURE_Msk (0xFUL << SCB_CPUID_ARCHITECTURE_Pos)
313 #define SCB_CPUID_PARTNO_Pos 4
314 #define SCB_CPUID_PARTNO_Msk (0xFFFUL << SCB_CPUID_PARTNO_Pos)
316 #define SCB_CPUID_REVISION_Pos 0
317 #define SCB_CPUID_REVISION_Msk (0xFUL << SCB_CPUID_REVISION_Pos)
320 #define SCB_ICSR_NMIPENDSET_Pos 31
321 #define SCB_ICSR_NMIPENDSET_Msk (1UL << SCB_ICSR_NMIPENDSET_Pos)
323 #define SCB_ICSR_PENDSVSET_Pos 28
324 #define SCB_ICSR_PENDSVSET_Msk (1UL << SCB_ICSR_PENDSVSET_Pos)
326 #define SCB_ICSR_PENDSVCLR_Pos 27
327 #define SCB_ICSR_PENDSVCLR_Msk (1UL << SCB_ICSR_PENDSVCLR_Pos)
329 #define SCB_ICSR_PENDSTSET_Pos 26
330 #define SCB_ICSR_PENDSTSET_Msk (1UL << SCB_ICSR_PENDSTSET_Pos)
332 #define SCB_ICSR_PENDSTCLR_Pos 25
333 #define SCB_ICSR_PENDSTCLR_Msk (1UL << SCB_ICSR_PENDSTCLR_Pos)
335 #define SCB_ICSR_ISRPREEMPT_Pos 23
336 #define SCB_ICSR_ISRPREEMPT_Msk (1UL << SCB_ICSR_ISRPREEMPT_Pos)
338 #define SCB_ICSR_ISRPENDING_Pos 22
339 #define SCB_ICSR_ISRPENDING_Msk (1UL << SCB_ICSR_ISRPENDING_Pos)
341 #define SCB_ICSR_VECTPENDING_Pos 12
342 #define SCB_ICSR_VECTPENDING_Msk (0x1FFUL << SCB_ICSR_VECTPENDING_Pos)
344 #define SCB_ICSR_VECTACTIVE_Pos 0
345 #define SCB_ICSR_VECTACTIVE_Msk (0x1FFUL << SCB_ICSR_VECTACTIVE_Pos)
348 #define SCB_AIRCR_VECTKEY_Pos 16
349 #define SCB_AIRCR_VECTKEY_Msk (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos)
351 #define SCB_AIRCR_VECTKEYSTAT_Pos 16
352 #define SCB_AIRCR_VECTKEYSTAT_Msk (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos)
354 #define SCB_AIRCR_ENDIANESS_Pos 15
355 #define SCB_AIRCR_ENDIANESS_Msk (1UL << SCB_AIRCR_ENDIANESS_Pos)
357 #define SCB_AIRCR_SYSRESETREQ_Pos 2
358 #define SCB_AIRCR_SYSRESETREQ_Msk (1UL << SCB_AIRCR_SYSRESETREQ_Pos)
360 #define SCB_AIRCR_VECTCLRACTIVE_Pos 1
361 #define SCB_AIRCR_VECTCLRACTIVE_Msk (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos)
364 #define SCB_SCR_SEVONPEND_Pos 4
365 #define SCB_SCR_SEVONPEND_Msk (1UL << SCB_SCR_SEVONPEND_Pos)
367 #define SCB_SCR_SLEEPDEEP_Pos 2
368 #define SCB_SCR_SLEEPDEEP_Msk (1UL << SCB_SCR_SLEEPDEEP_Pos)
370 #define SCB_SCR_SLEEPONEXIT_Pos 1
371 #define SCB_SCR_SLEEPONEXIT_Msk (1UL << SCB_SCR_SLEEPONEXIT_Pos)
374 #define SCB_CCR_STKALIGN_Pos 9
375 #define SCB_CCR_STKALIGN_Msk (1UL << SCB_CCR_STKALIGN_Pos)
377 #define SCB_CCR_UNALIGN_TRP_Pos 3
378 #define SCB_CCR_UNALIGN_TRP_Msk (1UL << SCB_CCR_UNALIGN_TRP_Pos)
381 #define SCB_SHCSR_SVCALLPENDED_Pos 15
382 #define SCB_SHCSR_SVCALLPENDED_Msk (1UL << SCB_SHCSR_SVCALLPENDED_Pos)
404 #define SysTick_CTRL_COUNTFLAG_Pos 16
405 #define SysTick_CTRL_COUNTFLAG_Msk (1UL << SysTick_CTRL_COUNTFLAG_Pos)
407 #define SysTick_CTRL_CLKSOURCE_Pos 2
408 #define SysTick_CTRL_CLKSOURCE_Msk (1UL << SysTick_CTRL_CLKSOURCE_Pos)
410 #define SysTick_CTRL_TICKINT_Pos 1
411 #define SysTick_CTRL_TICKINT_Msk (1UL << SysTick_CTRL_TICKINT_Pos)
413 #define SysTick_CTRL_ENABLE_Pos 0
414 #define SysTick_CTRL_ENABLE_Msk (1UL << SysTick_CTRL_ENABLE_Pos)
417 #define SysTick_LOAD_RELOAD_Pos 0
418 #define SysTick_LOAD_RELOAD_Msk (0xFFFFFFUL << SysTick_LOAD_RELOAD_Pos)
421 #define SysTick_VAL_CURRENT_Pos 0
422 #define SysTick_VAL_CURRENT_Msk (0xFFFFFFUL << SysTick_VAL_CURRENT_Pos)
425 #define SysTick_CALIB_NOREF_Pos 31
426 #define SysTick_CALIB_NOREF_Msk (1UL << SysTick_CALIB_NOREF_Pos)
428 #define SysTick_CALIB_SKEW_Pos 30
429 #define SysTick_CALIB_SKEW_Msk (1UL << SysTick_CALIB_SKEW_Pos)
431 #define SysTick_CALIB_TENMS_Pos 0
432 #define SysTick_CALIB_TENMS_Msk (0xFFFFFFUL << SysTick_VAL_CURRENT_Pos)
454 #define SCS_BASE (0xE000E000UL)
455 #define SysTick_BASE (SCS_BASE + 0x0010UL)
456 #define NVIC_BASE (SCS_BASE + 0x0100UL)
457 #define SCB_BASE (SCS_BASE + 0x0D00UL)
459 #define SCB ((SCB_Type *) SCB_BASE )
460 #define SysTick ((SysTick_Type *) SysTick_BASE )
461 #define NVIC ((NVIC_Type *) NVIC_BASE )
489 #define _BIT_SHIFT(IRQn) ( (((uint32_t)(IRQn) ) & 0x03) * 8 )
490 #define _SHP_IDX(IRQn) ( ((((uint32_t)(IRQn) & 0x0F)-8) >> 2) )
491 #define _IP_IDX(IRQn) ( ((uint32_t)(IRQn) >> 2) )
624 #if (__Vendor_SysTickConfig == 0)