timer32.h
Go to the documentation of this file.
1 #ifndef TIMER32_H_
2 #define TIMER32_H_
3 
4 //*****************************************************************************
5 //
8 //
9 //*****************************************************************************
10 
11 //*****************************************************************************
12 //
13 // If building with a C++ compiler, make all of the definitions in this header
14 // have a C binding.
15 //
16 //*****************************************************************************
17 #ifdef __cplusplus
18 extern "C"
19 {
20 #endif
21 #include <stdint.h>
22 #include <stdbool.h>
23 #include <msp.h>
24 
25 //*****************************************************************************
26 //
27 // Control specific variables
28 //
29 //*****************************************************************************
30 #define TIMER32_CMSIS(x) ((Timer32_Type *) x)
31 
32 #define TIMER_OFFSET 0x020
33 
34 #define TIMER32_0_BASE (uint32_t)TIMER32_1
35 #define TIMER32_1_BASE (uint32_t)TIMER32_2
36 
37 #define TIMER32_0_INTERRUPT INT_T32_INT1
38 #define TIMER32_1_INTERRUPT INT_T32_INT2
39 #define TIMER32_COMBINED_INTERRUPT INT_T32_INTC
40 
41 #define TIMER32_16BIT 0x00
42 #define TIMER32_32BIT 0x01
43 
44 #define TIMER32_PRESCALER_1 0x00
45 #define TIMER32_PRESCALER_16 0x04
46 #define TIMER32_PRESCALER_256 0x08
47 
48 #define TIMER32_FREE_RUN_MODE 0x00
49 #define TIMER32_PERIODIC_MODE 0x01
50 
51 //*****************************************************************************
52 //
53 // API Function prototypes
54 //
55 //*****************************************************************************
56 
57 //*****************************************************************************
58 //
86 //
87 //*****************************************************************************
88 extern void Timer32_initModule(uint32_t timer, uint32_t preScaler,
89  uint32_t resolution, uint32_t mode);
90 
91 //*****************************************************************************
92 //
110 //
111 //*****************************************************************************
112 extern void Timer32_setCount(uint32_t timer, uint32_t count);
113 
114 //*****************************************************************************
115 //
133 //
134 //*****************************************************************************
135 extern void Timer32_setCountInBackground(uint32_t timer, uint32_t count);
136 
137 //*****************************************************************************
138 //
147 //
148 //*****************************************************************************
149 extern uint32_t Timer32_getValue(uint32_t timer);
150 
151 //*****************************************************************************
152 //
155 // starting the timer.
173 //
174 //*****************************************************************************
175 extern void Timer32_startTimer(uint32_t timer, bool oneShot);
176 
177 //*****************************************************************************
178 //
187 //
188 //*****************************************************************************
189 extern void Timer32_haltTimer(uint32_t timer);
190 
191 //*****************************************************************************
192 //
203 //
204 //*****************************************************************************
205 extern void Timer32_enableInterrupt(uint32_t timer);
206 
207 //*****************************************************************************
208 //
219 //
220 //*****************************************************************************
221 extern void Timer32_disableInterrupt(uint32_t timer);
222 
223 //*****************************************************************************
224 //
235 //
236 //*****************************************************************************
237 extern void Timer32_clearInterruptFlag(uint32_t timer);
238 
239 //*****************************************************************************
240 //
253 //
254 //*****************************************************************************
255 extern uint32_t Timer32_getInterruptStatus(uint32_t timer);
256 
257 //*****************************************************************************
258 //
280 //
281 //*****************************************************************************
282 extern void Timer32_registerInterrupt(uint32_t timerInterrupt,
283  void (*intHandler)(void));
284 
285 //*****************************************************************************
286 //
305 //
306 //*****************************************************************************
307 extern void Timer32_unregisterInterrupt(uint32_t timerInterrupt);
308 
309 //*****************************************************************************
310 //
311 // Mark the end of the C bindings section for C++ compilers.
312 //
313 //*****************************************************************************
314 #ifdef __cplusplus
315 }
316 #endif
317 
318 //*****************************************************************************
319 //
320 // Close the Doxygen group.
322 //
323 //*****************************************************************************
324 
325 #endif /* TIMER32_H_ */
void Timer32_clearInterruptFlag(uint32_t timer)
Definition: timer32.c:93
void Timer32_setCountInBackground(uint32_t timer, uint32_t count)
Definition: timer32.c:48
void Timer32_setCount(uint32_t timer, uint32_t count)
Definition: timer32.c:39
uint32_t Timer32_getValue(uint32_t timer)
Definition: timer32.c:57
void Timer32_initModule(uint32_t timer, uint32_t preScaler, uint32_t resolution, uint32_t mode)
Definition: timer32.c:5
void Timer32_haltTimer(uint32_t timer)
Definition: timer32.c:76
void Timer32_startTimer(uint32_t timer, bool oneShot)
Definition: timer32.c:62
void Timer32_disableInterrupt(uint32_t timer)
Definition: timer32.c:88
uint32_t Timer32_getInterruptStatus(uint32_t timer)
Definition: timer32.c:98
void Timer32_registerInterrupt(uint32_t timerInterrupt, void(*intHandler)(void))
Definition: timer32.c:103
void Timer32_unregisterInterrupt(uint32_t timerInterrupt)
Definition: timer32.c:110
void Timer32_enableInterrupt(uint32_t timer)
Definition: timer32.c:83

Copyright 2016, Texas Instruments Incorporated