23 #ifndef __STM32W_SYSTICK_H
24 #define __STM32W_SYSTICK_H
26 #include "stm32w108-type.h"
27 #include "stm32w-conf.h"
41 #define SCS_BASE ((u32)0xE000E000)
43 #define SysTick_BASE (SCS_BASE + 0x0010)
44 #define NVIC_BASE (SCS_BASE + 0x0100)
45 #define SCB_BASE (SCS_BASE + 0x0D00)
48 #define SysTick ((SysTick_TypeDef *) SysTick_BASE)
54 #define SysTick_CTRL_ENABLE ((u32)0x00000001)
56 #define SysTick_CTRL_TICKINT ((u32)0x00000002)
58 #define SysTick_CTRL_CLKSOURCE ((u32)0x00000004)
60 #define SysTick_CTRL_COUNTFLAG ((u32)0x00010000)
68 #define SysTick_LOAD_RELOAD ((u32)0x00FFFFFF)
73 #define SysTick_VAL_CURRENT ((u32)0x00FFFFFF)
78 #define SysTick_CALIB_TENMS ((u32)0x00FFFFFF)
80 #define SysTick_CALIB_SKEW ((u32)0x40000000)
82 #define SysTick_CALIB_NOREF ((u32)0x80000000)
85 #define SysTick_CLKSource_HCLK_Div8 ((u32)0xFFFFFFFB)
86 #define SysTick_CLKSource_HCLK ((u32)0x00000004)
87 #define IS_SYSTICK_CLK_SOURCE(SOURCE) (((SOURCE) == SysTick_CLKSource_HCLK) || \
88 ((SOURCE) == SysTick_CLKSource_HCLK_Div8))
91 #define SysTick_Counter_Disable ((u32)0xFFFFFFFE)
92 #define SysTick_Counter_Enable ((u32)0x00000001)
93 #define SysTick_Counter_Clear ((u32)0x00000000)
95 #define IS_SYSTICK_COUNTER(COUNTER) (((COUNTER) == SysTick_Counter_Disable) || \
96 ((COUNTER) == SysTick_Counter_Enable) || \
97 ((COUNTER) == SysTick_Counter_Clear))
100 #define SysTick_FLAG_COUNT ((u32)0x00000010)
101 #define SysTick_FLAG_SKEW ((u32)0x0000001E)
102 #define SysTick_FLAG_NOREF ((u32)0x0000001F)
104 #define IS_SYSTICK_FLAG(FLAG) (((FLAG) == SysTick_FLAG_COUNT) || \
105 ((FLAG) == SysTick_FLAG_SKEW) || \
106 ((FLAG) == SysTick_FLAG_NOREF))
108 #define IS_SYSTICK_RELOAD(RELOAD) (((RELOAD) > 0) && ((RELOAD) <= 0xFFFFFF))
void SysTick_SetReload(uint32_t Reload)
Sets SysTick Reload value.
void SysTick_CLKSourceConfig(uint32_t SysTick_CLKSource)
Configures the SysTick clock source.
FlagStatus SysTick_GetFlagStatus(uint8_t SysTick_FLAG)
Checks whether the specified SysTick flag is set or not.
void SysTick_ITConfig(FunctionalState NewState)
Enables or disables the SysTick Interrupt.
void SysTick_CounterCmd(uint32_t SysTick_Counter)
Enables or disables the SysTick counter.
uint32_t SysTick_GetCounter(void)
Gets SysTick counter value.