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 "register_remap.h"
23 #include <stdbool.h>
24 #include <msp432.h>
25 
26 //*****************************************************************************
27 //
28 // Control specific variables
29 //
30 //*****************************************************************************
31 #define TIMER_OFFSET 0x020
32 
33 #define TIMER32_0_MODULE __T32_BASE__
34 #define TIMER32_1_MODULE (__T32_BASE__ + OFS_T32LOAD2)
35 
36 #define TIMER32_0_INTERRUPT INT_T32_INT1
37 #define TIMER32_1_INTERRUPT INT_T32_INT2
38 #define TIMER32_COMBINED_INTERRUPT INT_T32_INTC
39 
40 #define TIMER32_1_MODULE6BIT 0x00
41 #define TIMER32_32BIT 0x01
42 
43 #define TIMER32_PRESCALER_1 0x00
44 #define TIMER32_PRESCALER_16 0x04
45 #define TIMER32_PRESCALER_256 0x08
46 
47 #define TIMER32_FREE_RUN_MODE 0x00
48 #define TIMER32_PERIODIC_MODE 0x01
49 
50 //*****************************************************************************
51 //
52 // API Function prototypes
53 //
54 //*****************************************************************************
55 
56 //*****************************************************************************
57 //
85 //
86 //*****************************************************************************
87 extern void Timer32_initModule(uint32_t timer, uint32_t preScaler,
88  uint32_t resolution, uint32_t mode);
89 
90 //*****************************************************************************
91 //
109 //
110 //*****************************************************************************
111 extern void Timer32_setCount(uint32_t timer, uint32_t count);
112 
113 //*****************************************************************************
114 //
132 //
133 //*****************************************************************************
134 extern void Timer32_setCountInBackground(uint32_t timer, uint32_t count);
135 
136 //*****************************************************************************
137 //
146 //
147 //*****************************************************************************
148 extern uint32_t Timer32_getValue(uint32_t timer);
149 
150 //*****************************************************************************
151 //
154 // starting the timer.
172 //
173 //*****************************************************************************
174 extern void Timer32_startTimer(uint32_t timer, bool oneShot);
175 
176 //*****************************************************************************
177 //
186 //
187 //*****************************************************************************
188 extern void Timer32_haltTimer(uint32_t timer);
189 
190 //*****************************************************************************
191 //
202 //
203 //*****************************************************************************
204 extern void Timer32_enableInterrupt(uint32_t timer);
205 
206 //*****************************************************************************
207 //
218 //
219 //*****************************************************************************
220 extern void Timer32_disableInterrupt(uint32_t timer);
221 
222 //*****************************************************************************
223 //
234 //
235 //*****************************************************************************
236 extern void Timer32_clearInterruptFlag(uint32_t timer);
237 
238 //*****************************************************************************
239 //
252 //
253 //*****************************************************************************
254 extern uint32_t Timer32_getInterruptStatus(uint32_t timer);
255 
256 //*****************************************************************************
257 //
279 //
280 //*****************************************************************************
281 extern void Timer32_registerInterrupt(uint32_t timerInterrupt,
282  void (*intHandler)(void));
283 
284 //*****************************************************************************
285 //
304 //
305 //*****************************************************************************
306 extern void Timer32_unregisterInterrupt(uint32_t timerInterrupt);
307 
308 //*****************************************************************************
309 //
310 // Mark the end of the C bindings section for C++ compilers.
311 //
312 //*****************************************************************************
313 #ifdef __cplusplus
314 }
315 #endif
316 
317 //*****************************************************************************
318 //
319 // Close the Doxygen group.
321 //
322 //*****************************************************************************
323 
324 #endif /* TIMER32_H_ */
void Timer32_clearInterruptFlag(uint32_t timer)
Definition: timer32.c:85
void Timer32_setCountInBackground(uint32_t timer, uint32_t count)
Definition: timer32.c:43
void Timer32_setCount(uint32_t timer, uint32_t count)
Definition: timer32.c:35
uint32_t Timer32_getValue(uint32_t timer)
Definition: timer32.c:51
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:68
void Timer32_startTimer(uint32_t timer, bool oneShot)
Definition: timer32.c:56
void Timer32_disableInterrupt(uint32_t timer)
Definition: timer32.c:80
uint32_t Timer32_getInterruptStatus(uint32_t timer)
Definition: timer32.c:90
void Timer32_registerInterrupt(uint32_t timerInterrupt, void(*intHandler)(void))
Definition: timer32.c:95
void Timer32_unregisterInterrupt(uint32_t timerInterrupt)
Definition: timer32.c:102
void Timer32_enableInterrupt(uint32_t timer)
Definition: timer32.c:75

Copyright 2014, Texas Instruments Incorporated