1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/**************************************************************************//**
* \file Sys_Tick.h
* \brief System tick timer header file
* \details
* \author Zhang Xuan
* \version V1.0.0
* \date 19-Jul-2018
* \par History:
* V1.0.0 Initial release
* \par Copyright:
* (c) Heilongjiang TYW Electronics co., LTD
******************************************************************************/
#ifndef _SYS_TICK_H_
#define _SYS_TICK_H_
/* Includes ------------------------------------------------------------------*/
/* C binding of definitions if building with C++ compiler */
#ifdef __cplusplus
extern {
#endif
/* Exported types ------------------------------------------------------------*/
typedef enum
{
SYS_TICK_50us_CB = 0U,
SYS_TICK_1ms_CB,
SYS_TICK_100ms_CB,
}Sys_Tick_Call_Back_Type_en_t;
/* Exported constants --------------------------------------------------------*/
/* Exported macro ------------------------------------------------------------*/
//#define SYS_TICK_INT_INTERVAL (50UL) /* 50us */
#define SYS_TICK_INT_INTERVAL (1000UL) /* 1000us */
#define SYS_TICK_CALL_BACK_TYPE_NUM (3U)
/* 50us rolling counter */
extern volatile uint16_t g_u16SysRollingCounter50us;
#define SYS_ROLLING_COUNTER_50us g_u16SysRollingCounter50us
/* 1ms rolling counter */
extern volatile uint16_t g_u16SysRollingCounter1ms;
#define SYS_ROLLING_COUNTER_1ms g_u16SysRollingCounter1ms
/* Interrupt service routine adaptor */
#define R_AWOT_TintIsr(i) SysTick_Handler()
/* Exported functions ------------------------------------------------------- */
extern void Sys_Tick_Timer_Start(void);
extern void Sys_Tick_Timer_Stop(void);
extern void Sys_Tick_Timer_Call_Back_Reg(Sys_Tick_Call_Back_Type_en_t enType, void (*pfnIsr)(void));
extern void SysTick_Handler(void);
#ifdef __cplusplus
}
#endif
#endif /* _GPIO_H_ */