uc-sdk
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
lpc17xx_systick.h
Go to the documentation of this file.
1 /***********************************************************************/
21 /* Peripheral group ----------------------------------------------------------- */
27 #ifndef LPC17XX_SYSTICK_H_
28 #define LPC17XX_SYSTICK_H_
29 
30 /* Includes ------------------------------------------------------------------- */
31 #include "LPC17xx.h"
32 #include "lpc_types.h"
33 
34 
35 #ifdef __cplusplus
36 extern "C"
37 {
38 #endif
39 
40 
41 /* Private Macros ------------------------------------------------------------- */
45 /*********************************************************************/
48 #define ST_CTRL_ENABLE ((uint32_t)(1<<0))
49 #define ST_CTRL_TICKINT ((uint32_t)(1<<1))
50 #define ST_CTRL_CLKSOURCE ((uint32_t)(1<<2))
51 #define ST_CTRL_COUNTFLAG ((uint32_t)(1<<16))
52 
53 /*********************************************************************/
56 #define ST_RELOAD_RELOAD(n) ((uint32_t)(n & 0x00FFFFFF))
57 
58 /*********************************************************************/
61 #define ST_RELOAD_CURRENT(n) ((uint32_t)(n & 0x00FFFFFF))
62 
63 /*********************************************************************/
66 #define ST_CALIB_TENMS(n) ((uint32_t)(n & 0x00FFFFFF))
67 #define ST_CALIB_SKEW ((uint32_t)(1<<30))
68 #define ST_CALIB_NOREF ((uint32_t)(1<<31))
69 
70 #define CLKSOURCE_EXT ((uint32_t)(0))
71 #define CLKSOURCE_CPU ((uint32_t)(1))
72 
78 /* Public Functions ----------------------------------------------------------- */
83 void SYSTICK_InternalInit(uint32_t time);
84 void SYSTICK_ExternalInit(uint32_t freq, uint32_t time);
85 
86 void SYSTICK_Cmd(FunctionalState NewState);
87 void SYSTICK_IntCmd(FunctionalState NewState);
88 uint32_t SYSTICK_GetCurrentValue(void);
89 void SYSTICK_ClearCounterFlag(void);
90 
96 #ifdef __cplusplus
97 }
98 #endif
99 
100 
101 #endif /* LPC17XX_SYSTICK_H_ */
102 
107 /* --------------------------------- End Of File ------------------------------ */