MSP430 DriverLib for MSP430FR5xx_6xx Devices  2.21.00.08
 All Data Structures Functions Variables Modules Pages
timer_a.h
1 //*****************************************************************************
2 //
3 // timer_a.h - Driver for the TIMER_A Module.
4 //
5 //*****************************************************************************
6 
7 #ifndef __MSP430WARE_TIMER_A_H__
8 #define __MSP430WARE_TIMER_A_H__
9 
10 #include "inc/hw_memmap.h"
11 
12 #ifdef __MSP430_HAS_TxA7__
13 
14 //*****************************************************************************
15 //
16 // If building with a C++ compiler, make all of the definitions in this header
17 // have a C binding.
18 //
19 //*****************************************************************************
20 #ifdef __cplusplus
21 extern "C"
22 {
23 #endif
24 
25 #include "inc/hw_memmap.h"
26 //*****************************************************************************
27 //
28 // The following is a parameter used for Timer_A_getCounterValue that
29 // determines the maximum difference in counts of the TAxR register for a
30 // majority vote.
31 //
32 //*****************************************************************************
33 #define TIMER_A_THRESHOLD 50
34 
35 //*****************************************************************************
36 //
37 //! \brief Used in the Timer_A_initContinuousMode() function as the param
38 //! parameter.
39 //
40 //*****************************************************************************
42  //! Selects Clock source.
43  //! \n Valid values are:
44  //! - \b TIMER_A_CLOCKSOURCE_EXTERNAL_TXCLK [Default]
45  //! - \b TIMER_A_CLOCKSOURCE_ACLK
46  //! - \b TIMER_A_CLOCKSOURCE_SMCLK
47  //! - \b TIMER_A_CLOCKSOURCE_INVERTED_EXTERNAL_TXCLK
48  uint16_t clockSource;
49  //! Is the desired divider for the clock source
50  //! \n Valid values are:
51  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_1 [Default]
52  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_2
53  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_3
54  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_4
55  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_5
56  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_6
57  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_7
58  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_8
59  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_10
60  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_12
61  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_14
62  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_16
63  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_20
64  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_24
65  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_28
66  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_32
67  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_40
68  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_48
69  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_56
70  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_64
72  //! Is to enable or disable Timer_A interrupt
73  //! \n Valid values are:
74  //! - \b TIMER_A_TAIE_INTERRUPT_ENABLE
75  //! - \b TIMER_A_TAIE_INTERRUPT_DISABLE [Default]
77  //! Decides if Timer_A clock divider, count direction, count need to be
78  //! reset.
79  //! \n Valid values are:
80  //! - \b TIMER_A_DO_CLEAR
81  //! - \b TIMER_A_SKIP_CLEAR [Default]
82  uint16_t timerClear;
83  //! Whether to start the timer immediately
84  bool startTimer;
86 
87 //*****************************************************************************
88 //
89 //! \brief Used in the Timer_A_initCaptureMode() function as the param
90 //! parameter.
91 //
92 //*****************************************************************************
94  //! Selects the Capture register being used. Refer to datasheet to ensure
95  //! the device has the capture compare register being used.
96  //! \n Valid values are:
97  //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_0
98  //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_1
99  //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_2
100  //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_3
101  //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_4
102  //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_5
103  //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_6
104  uint16_t captureRegister;
105  //! Is the capture mode selected.
106  //! \n Valid values are:
107  //! - \b TIMER_A_CAPTUREMODE_NO_CAPTURE [Default]
108  //! - \b TIMER_A_CAPTUREMODE_RISING_EDGE
109  //! - \b TIMER_A_CAPTUREMODE_FALLING_EDGE
110  //! - \b TIMER_A_CAPTUREMODE_RISING_AND_FALLING_EDGE
111  uint16_t captureMode;
112  //! Decides the Input Select
113  //! \n Valid values are:
114  //! - \b TIMER_A_CAPTURE_INPUTSELECT_CCIxA
115  //! - \b TIMER_A_CAPTURE_INPUTSELECT_CCIxB
116  //! - \b TIMER_A_CAPTURE_INPUTSELECT_GND
117  //! - \b TIMER_A_CAPTURE_INPUTSELECT_Vcc
119  //! Decides if capture source should be synchronized with timer clock
120  //! \n Valid values are:
121  //! - \b TIMER_A_CAPTURE_ASYNCHRONOUS [Default]
122  //! - \b TIMER_A_CAPTURE_SYNCHRONOUS
124  //! Is to enable or disable timer captureComapre interrupt.
125  //! \n Valid values are:
126  //! - \b TIMER_A_CAPTURECOMPARE_INTERRUPT_DISABLE [Default]
127  //! - \b TIMER_A_CAPTURECOMPARE_INTERRUPT_ENABLE
129  //! Specifies the output mode.
130  //! \n Valid values are:
131  //! - \b TIMER_A_OUTPUTMODE_OUTBITVALUE [Default]
132  //! - \b TIMER_A_OUTPUTMODE_SET
133  //! - \b TIMER_A_OUTPUTMODE_TOGGLE_RESET
134  //! - \b TIMER_A_OUTPUTMODE_SET_RESET
135  //! - \b TIMER_A_OUTPUTMODE_TOGGLE
136  //! - \b TIMER_A_OUTPUTMODE_RESET
137  //! - \b TIMER_A_OUTPUTMODE_TOGGLE_SET
138  //! - \b TIMER_A_OUTPUTMODE_RESET_SET
141 
142 //*****************************************************************************
143 //
144 //! \brief Used in the Timer_A_initUpDownMode() function as the param
145 //! parameter.
146 //
147 //*****************************************************************************
149  //! Selects Clock source.
150  //! \n Valid values are:
151  //! - \b TIMER_A_CLOCKSOURCE_EXTERNAL_TXCLK [Default]
152  //! - \b TIMER_A_CLOCKSOURCE_ACLK
153  //! - \b TIMER_A_CLOCKSOURCE_SMCLK
154  //! - \b TIMER_A_CLOCKSOURCE_INVERTED_EXTERNAL_TXCLK
155  uint16_t clockSource;
156  //! Is the desired divider for the clock source
157  //! \n Valid values are:
158  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_1 [Default]
159  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_2
160  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_3
161  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_4
162  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_5
163  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_6
164  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_7
165  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_8
166  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_10
167  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_12
168  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_14
169  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_16
170  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_20
171  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_24
172  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_28
173  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_32
174  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_40
175  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_48
176  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_56
177  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_64
179  //! Is the specified Timer_A period
180  uint16_t timerPeriod;
181  //! Is to enable or disable Timer_A interrupt
182  //! \n Valid values are:
183  //! - \b TIMER_A_TAIE_INTERRUPT_ENABLE
184  //! - \b TIMER_A_TAIE_INTERRUPT_DISABLE [Default]
186  //! Is to enable or disable Timer_A CCR0 captureComapre interrupt.
187  //! \n Valid values are:
188  //! - \b TIMER_A_CCIE_CCR0_INTERRUPT_ENABLE
189  //! - \b TIMER_A_CCIE_CCR0_INTERRUPT_DISABLE [Default]
191  //! Decides if Timer_A clock divider, count direction, count need to be
192  //! reset.
193  //! \n Valid values are:
194  //! - \b TIMER_A_DO_CLEAR
195  //! - \b TIMER_A_SKIP_CLEAR [Default]
196  uint16_t timerClear;
197  //! Whether to start the timer immediately
200 
201 //*****************************************************************************
202 //
203 //! \brief Used in the Timer_A_outputPWM() function as the param parameter.
204 //
205 //*****************************************************************************
206 typedef struct Timer_A_outputPWMParam {
207  //! Selects Clock source.
208  //! \n Valid values are:
209  //! - \b TIMER_A_CLOCKSOURCE_EXTERNAL_TXCLK [Default]
210  //! - \b TIMER_A_CLOCKSOURCE_ACLK
211  //! - \b TIMER_A_CLOCKSOURCE_SMCLK
212  //! - \b TIMER_A_CLOCKSOURCE_INVERTED_EXTERNAL_TXCLK
213  uint16_t clockSource;
214  //! Is the desired divider for the clock source
215  //! \n Valid values are:
216  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_1 [Default]
217  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_2
218  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_3
219  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_4
220  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_5
221  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_6
222  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_7
223  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_8
224  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_10
225  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_12
226  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_14
227  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_16
228  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_20
229  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_24
230  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_28
231  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_32
232  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_40
233  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_48
234  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_56
235  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_64
237  //! Selects the desired timer period
238  uint16_t timerPeriod;
239  //! Selects the compare register being used. Refer to datasheet to ensure
240  //! the device has the capture compare register being used.
241  //! \n Valid values are:
242  //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_0
243  //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_1
244  //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_2
245  //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_3
246  //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_4
247  //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_5
248  //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_6
249  uint16_t compareRegister;
250  //! Specifies the output mode.
251  //! \n Valid values are:
252  //! - \b TIMER_A_OUTPUTMODE_OUTBITVALUE [Default]
253  //! - \b TIMER_A_OUTPUTMODE_SET
254  //! - \b TIMER_A_OUTPUTMODE_TOGGLE_RESET
255  //! - \b TIMER_A_OUTPUTMODE_SET_RESET
256  //! - \b TIMER_A_OUTPUTMODE_TOGGLE
257  //! - \b TIMER_A_OUTPUTMODE_RESET
258  //! - \b TIMER_A_OUTPUTMODE_TOGGLE_SET
259  //! - \b TIMER_A_OUTPUTMODE_RESET_SET
261  //! Specifies the dutycycle for the generated waveform
262  uint16_t dutyCycle;
264 
265 //*****************************************************************************
266 //
267 //! \brief Used in the Timer_A_initUpMode() function as the param parameter.
268 //
269 //*****************************************************************************
270 typedef struct Timer_A_initUpModeParam {
271  //! Selects Clock source.
272  //! \n Valid values are:
273  //! - \b TIMER_A_CLOCKSOURCE_EXTERNAL_TXCLK [Default]
274  //! - \b TIMER_A_CLOCKSOURCE_ACLK
275  //! - \b TIMER_A_CLOCKSOURCE_SMCLK
276  //! - \b TIMER_A_CLOCKSOURCE_INVERTED_EXTERNAL_TXCLK
277  uint16_t clockSource;
278  //! Is the desired divider for the clock source
279  //! \n Valid values are:
280  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_1 [Default]
281  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_2
282  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_3
283  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_4
284  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_5
285  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_6
286  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_7
287  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_8
288  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_10
289  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_12
290  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_14
291  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_16
292  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_20
293  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_24
294  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_28
295  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_32
296  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_40
297  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_48
298  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_56
299  //! - \b TIMER_A_CLOCKSOURCE_DIVIDER_64
301  //! Is the specified Timer_A period. This is the value that gets written
302  //! into the CCR0. Limited to 16 bits[uint16_t]
303  uint16_t timerPeriod;
304  //! Is to enable or disable Timer_A interrupt
305  //! \n Valid values are:
306  //! - \b TIMER_A_TAIE_INTERRUPT_ENABLE
307  //! - \b TIMER_A_TAIE_INTERRUPT_DISABLE [Default]
309  //! Is to enable or disable Timer_A CCR0 captureComapre interrupt.
310  //! \n Valid values are:
311  //! - \b TIMER_A_CCIE_CCR0_INTERRUPT_ENABLE
312  //! - \b TIMER_A_CCIE_CCR0_INTERRUPT_DISABLE [Default]
314  //! Decides if Timer_A clock divider, count direction, count need to be
315  //! reset.
316  //! \n Valid values are:
317  //! - \b TIMER_A_DO_CLEAR
318  //! - \b TIMER_A_SKIP_CLEAR [Default]
319  uint16_t timerClear;
320  //! Whether to start the timer immediately
323 
324 //*****************************************************************************
325 //
326 //! \brief Used in the Timer_A_initCompareMode() function as the param
327 //! parameter.
328 //
329 //*****************************************************************************
331  //! Selects the Capture register being used. Refer to datasheet to ensure
332  //! the device has the capture compare register being used.
333  //! \n Valid values are:
334  //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_0
335  //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_1
336  //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_2
337  //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_3
338  //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_4
339  //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_5
340  //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_6
341  uint16_t compareRegister;
342  //! Is to enable or disable timer captureComapre interrupt.
343  //! \n Valid values are:
344  //! - \b TIMER_A_CAPTURECOMPARE_INTERRUPT_DISABLE [Default]
345  //! - \b TIMER_A_CAPTURECOMPARE_INTERRUPT_ENABLE
347  //! Specifies the output mode.
348  //! \n Valid values are:
349  //! - \b TIMER_A_OUTPUTMODE_OUTBITVALUE [Default]
350  //! - \b TIMER_A_OUTPUTMODE_SET
351  //! - \b TIMER_A_OUTPUTMODE_TOGGLE_RESET
352  //! - \b TIMER_A_OUTPUTMODE_SET_RESET
353  //! - \b TIMER_A_OUTPUTMODE_TOGGLE
354  //! - \b TIMER_A_OUTPUTMODE_RESET
355  //! - \b TIMER_A_OUTPUTMODE_TOGGLE_SET
356  //! - \b TIMER_A_OUTPUTMODE_RESET_SET
358  //! Is the count to be compared with in compare mode
359  uint16_t compareValue;
361 
362 
363 //*****************************************************************************
364 //
365 // The following are values that can be passed to the param parameter for
366 // functions: Timer_A_initContinuousMode(), Timer_A_initUpMode(),
367 // Timer_A_initUpDownMode(), and Timer_A_outputPWM().
368 //
369 //*****************************************************************************
370 #define TIMER_A_CLOCKSOURCE_DIVIDER_1 0x00
371 #define TIMER_A_CLOCKSOURCE_DIVIDER_2 0x08
372 #define TIMER_A_CLOCKSOURCE_DIVIDER_3 0x02
373 #define TIMER_A_CLOCKSOURCE_DIVIDER_4 0x10
374 #define TIMER_A_CLOCKSOURCE_DIVIDER_5 0x04
375 #define TIMER_A_CLOCKSOURCE_DIVIDER_6 0x05
376 #define TIMER_A_CLOCKSOURCE_DIVIDER_7 0x06
377 #define TIMER_A_CLOCKSOURCE_DIVIDER_8 0x18
378 #define TIMER_A_CLOCKSOURCE_DIVIDER_10 0x0C
379 #define TIMER_A_CLOCKSOURCE_DIVIDER_12 0x0D
380 #define TIMER_A_CLOCKSOURCE_DIVIDER_14 0x0E
381 #define TIMER_A_CLOCKSOURCE_DIVIDER_16 0x0F
382 #define TIMER_A_CLOCKSOURCE_DIVIDER_20 0x14
383 #define TIMER_A_CLOCKSOURCE_DIVIDER_24 0x15
384 #define TIMER_A_CLOCKSOURCE_DIVIDER_28 0x16
385 #define TIMER_A_CLOCKSOURCE_DIVIDER_32 0x17
386 #define TIMER_A_CLOCKSOURCE_DIVIDER_40 0x1C
387 #define TIMER_A_CLOCKSOURCE_DIVIDER_48 0x1D
388 #define TIMER_A_CLOCKSOURCE_DIVIDER_56 0x1E
389 #define TIMER_A_CLOCKSOURCE_DIVIDER_64 0x1F
390 
391 //*****************************************************************************
392 //
393 // The following are values that can be passed to the timerMode parameter for
394 // functions: Timer_A_startCounter().
395 //
396 //*****************************************************************************
397 #define TIMER_A_STOP_MODE MC_0
398 #define TIMER_A_UP_MODE MC_1
399 #define TIMER_A_CONTINUOUS_MODE MC_2
400 #define TIMER_A_UPDOWN_MODE MC_3
401 
402 //*****************************************************************************
403 //
404 // The following are values that can be passed to the param parameter for
405 // functions: Timer_A_initContinuousMode(), Timer_A_initUpMode(), and
406 // Timer_A_initUpDownMode().
407 //
408 //*****************************************************************************
409 #define TIMER_A_DO_CLEAR TACLR
410 #define TIMER_A_SKIP_CLEAR 0x00
411 
412 //*****************************************************************************
413 //
414 // The following are values that can be passed to the param parameter for
415 // functions: Timer_A_initContinuousMode(), Timer_A_initUpMode(),
416 // Timer_A_initUpDownMode(), and Timer_A_outputPWM().
417 //
418 //*****************************************************************************
419 #define TIMER_A_CLOCKSOURCE_EXTERNAL_TXCLK TASSEL__TACLK
420 #define TIMER_A_CLOCKSOURCE_ACLK TASSEL__ACLK
421 #define TIMER_A_CLOCKSOURCE_SMCLK TASSEL__SMCLK
422 #define TIMER_A_CLOCKSOURCE_INVERTED_EXTERNAL_TXCLK TASSEL__INCLK
423 
424 //*****************************************************************************
425 //
426 // The following are values that can be passed to the param parameter for
427 // functions: Timer_A_initContinuousMode(), Timer_A_initUpMode(), and
428 // Timer_A_initUpDownMode().
429 //
430 //*****************************************************************************
431 #define TIMER_A_TAIE_INTERRUPT_ENABLE TAIE
432 #define TIMER_A_TAIE_INTERRUPT_DISABLE 0x00
433 
434 //*****************************************************************************
435 //
436 // The following are values that can be passed to the param parameter for
437 // functions: Timer_A_initUpMode(), and Timer_A_initUpDownMode().
438 //
439 //*****************************************************************************
440 #define TIMER_A_CCIE_CCR0_INTERRUPT_ENABLE CCIE
441 #define TIMER_A_CCIE_CCR0_INTERRUPT_DISABLE 0x00
442 
443 //*****************************************************************************
444 //
445 // The following are values that can be passed to the param parameter for
446 // functions: Timer_A_initCaptureMode(), and Timer_A_initCompareMode().
447 //
448 //*****************************************************************************
449 #define TIMER_A_CAPTURECOMPARE_INTERRUPT_DISABLE 0x00
450 #define TIMER_A_CAPTURECOMPARE_INTERRUPT_ENABLE CCIE
451 
452 //*****************************************************************************
453 //
454 // The following are values that can be passed to the param parameter for
455 // functions: Timer_A_initCaptureMode().
456 //
457 //*****************************************************************************
458 #define TIMER_A_CAPTURE_INPUTSELECT_CCIxA CCIS_0
459 #define TIMER_A_CAPTURE_INPUTSELECT_CCIxB CCIS_1
460 #define TIMER_A_CAPTURE_INPUTSELECT_GND CCIS_2
461 #define TIMER_A_CAPTURE_INPUTSELECT_Vcc CCIS_3
462 
463 //*****************************************************************************
464 //
465 // The following are values that can be passed to the param parameter for
466 // functions: Timer_A_initCaptureMode(), Timer_A_initCompareMode(), and
467 // Timer_A_outputPWM().
468 //
469 //*****************************************************************************
470 #define TIMER_A_OUTPUTMODE_OUTBITVALUE OUTMOD_0
471 #define TIMER_A_OUTPUTMODE_SET OUTMOD_1
472 #define TIMER_A_OUTPUTMODE_TOGGLE_RESET OUTMOD_2
473 #define TIMER_A_OUTPUTMODE_SET_RESET OUTMOD_3
474 #define TIMER_A_OUTPUTMODE_TOGGLE OUTMOD_4
475 #define TIMER_A_OUTPUTMODE_RESET OUTMOD_5
476 #define TIMER_A_OUTPUTMODE_TOGGLE_SET OUTMOD_6
477 #define TIMER_A_OUTPUTMODE_RESET_SET OUTMOD_7
478 
479 //*****************************************************************************
480 //
481 // The following are values that can be passed to the compareRegister parameter
482 // for functions: Timer_A_setCompareValue(); the captureCompareRegister
483 // parameter for functions: Timer_A_enableCaptureCompareInterrupt(),
484 // Timer_A_disableCaptureCompareInterrupt(),
485 // Timer_A_getCaptureCompareInterruptStatus(),
486 // Timer_A_getSynchronizedCaptureCompareInput(),
487 // Timer_A_getOutputForOutputModeOutBitValue(),
488 // Timer_A_getCaptureCompareCount(),
489 // Timer_A_setOutputForOutputModeOutBitValue(), and
490 // Timer_A_clearCaptureCompareInterrupt(); the param parameter for functions:
491 // Timer_A_initCaptureMode(), Timer_A_initCompareMode(), and
492 // Timer_A_outputPWM().
493 //
494 //*****************************************************************************
495 #define TIMER_A_CAPTURECOMPARE_REGISTER_0 0x02
496 #define TIMER_A_CAPTURECOMPARE_REGISTER_1 0x04
497 #define TIMER_A_CAPTURECOMPARE_REGISTER_2 0x06
498 #define TIMER_A_CAPTURECOMPARE_REGISTER_3 0x08
499 #define TIMER_A_CAPTURECOMPARE_REGISTER_4 0x0A
500 #define TIMER_A_CAPTURECOMPARE_REGISTER_5 0x0C
501 #define TIMER_A_CAPTURECOMPARE_REGISTER_6 0x0E
502 
503 //*****************************************************************************
504 //
505 // The following are values that can be passed to the param parameter for
506 // functions: Timer_A_initCaptureMode().
507 //
508 //*****************************************************************************
509 #define TIMER_A_CAPTUREMODE_NO_CAPTURE CM_0
510 #define TIMER_A_CAPTUREMODE_RISING_EDGE CM_1
511 #define TIMER_A_CAPTUREMODE_FALLING_EDGE CM_2
512 #define TIMER_A_CAPTUREMODE_RISING_AND_FALLING_EDGE CM_3
513 
514 //*****************************************************************************
515 //
516 // The following are values that can be passed to the param parameter for
517 // functions: Timer_A_initCaptureMode().
518 //
519 //*****************************************************************************
520 #define TIMER_A_CAPTURE_ASYNCHRONOUS 0x00
521 #define TIMER_A_CAPTURE_SYNCHRONOUS SCS
522 
523 //*****************************************************************************
524 //
525 // The following are values that can be passed to the mask parameter for
526 // functions: Timer_A_getCaptureCompareInterruptStatus() as well as returned by
527 // the Timer_A_getCaptureCompareInterruptStatus() function.
528 //
529 //*****************************************************************************
530 #define TIMER_A_CAPTURE_OVERFLOW COV
531 #define TIMER_A_CAPTURECOMPARE_INTERRUPT_FLAG CCIFG
532 
533 //*****************************************************************************
534 //
535 // The following are values that can be passed to the synchronized parameter
536 // for functions: Timer_A_getSynchronizedCaptureCompareInput().
537 //
538 //*****************************************************************************
539 #define TIMER_A_READ_SYNCHRONIZED_CAPTURECOMPAREINPUT SCCI
540 #define TIMER_A_READ_CAPTURE_COMPARE_INPUT CCI
541 
542 //*****************************************************************************
543 //
544 // The following are values that can be passed toThe following are values that
545 // can be returned by the Timer_A_getSynchronizedCaptureCompareInput()
546 // function.
547 //
548 //*****************************************************************************
549 #define TIMER_A_CAPTURECOMPARE_INPUT_HIGH 0x01
550 #define TIMER_A_CAPTURECOMPARE_INPUT_LOW 0x00
551 
552 //*****************************************************************************
553 //
554 // The following are values that can be passed to the outputModeOutBitValue
555 // parameter for functions: Timer_A_setOutputForOutputModeOutBitValue() as well
556 // as returned by the Timer_A_getOutputForOutputModeOutBitValue() function.
557 //
558 //*****************************************************************************
559 #define TIMER_A_OUTPUTMODE_OUTBITVALUE_HIGH OUT
560 #define TIMER_A_OUTPUTMODE_OUTBITVALUE_LOW 0x00
561 
562 //*****************************************************************************
563 //
564 // The following are values that can be passed toThe following are values that
565 // can be returned by the Timer_A_getInterruptStatus() function.
566 //
567 //*****************************************************************************
568 #define TIMER_A_INTERRUPT_NOT_PENDING 0x00
569 #define TIMER_A_INTERRUPT_PENDING 0x01
570 
571 //*****************************************************************************
572 //
573 // Prototypes for the APIs.
574 //
575 //*****************************************************************************
576 
577 //*****************************************************************************
578 //
579 //! \brief Starts Timer_A counter
580 //!
581 //! This function assumes that the timer has been previously configured using
582 //! Timer_A_initContinuousMode, Timer_A_initUpMode or Timer_A_initUpDownMode.
583 //!
584 //! \param baseAddress is the base address of the TIMER_A module.
585 //! \param timerMode mode to put the timer in
586 //! Valid values are:
587 //! - \b TIMER_A_STOP_MODE
588 //! - \b TIMER_A_UP_MODE
589 //! - \b TIMER_A_CONTINUOUS_MODE [Default]
590 //! - \b TIMER_A_UPDOWN_MODE
591 //!
592 //! Modified bits of \b TAxCTL register.
593 //!
594 //! \return None
595 //
596 //*****************************************************************************
597 extern void Timer_A_startCounter(uint16_t baseAddress,
598  uint16_t timerMode);
599 
600 //*****************************************************************************
601 //
602 //! \brief Configures Timer_A in continuous mode.
603 //!
604 //! \param baseAddress is the base address of the TIMER_A module.
605 //! \param param is the pointer to struct for continuous mode initialization.
606 //!
607 //! Modified bits of \b TAxCTL register.
608 //!
609 //! \return None
610 //
611 //*****************************************************************************
612 extern void Timer_A_initContinuousMode(uint16_t baseAddress,
614 
615 //*****************************************************************************
616 //
617 //! \brief Configures Timer_A in up mode.
618 //!
619 //! \param baseAddress is the base address of the TIMER_A module.
620 //! \param param is the pointer to struct for up mode initialization.
621 //!
622 //! Modified bits of \b TAxCTL register, bits of \b TAxCCTL0 register and bits
623 //! of \b TAxCCR0 register.
624 //!
625 //! \return None
626 //
627 //*****************************************************************************
628 extern void Timer_A_initUpMode(uint16_t baseAddress,
629  Timer_A_initUpModeParam *param);
630 
631 //*****************************************************************************
632 //
633 //! \brief Configures Timer_A in up down mode.
634 //!
635 //! \param baseAddress is the base address of the TIMER_A module.
636 //! \param param is the pointer to struct for up-down mode initialization.
637 //!
638 //! Modified bits of \b TAxCTL register, bits of \b TAxCCTL0 register and bits
639 //! of \b TAxCCR0 register.
640 //!
641 //! \return None
642 //
643 //*****************************************************************************
644 extern void Timer_A_initUpDownMode(uint16_t baseAddress,
646 
647 //*****************************************************************************
648 //
649 //! \brief Initializes Capture Mode
650 //!
651 //! \param baseAddress is the base address of the TIMER_A module.
652 //! \param param is the pointer to struct for capture mode initialization.
653 //!
654 //! Modified bits of \b TAxCCTLn register.
655 //!
656 //! \return None
657 //
658 //*****************************************************************************
659 extern void Timer_A_initCaptureMode(uint16_t baseAddress,
661 
662 //*****************************************************************************
663 //
664 //! \brief Initializes Compare Mode
665 //!
666 //! \param baseAddress is the base address of the TIMER_A module.
667 //! \param param is the pointer to struct for compare mode initialization.
668 //!
669 //! Modified bits of \b TAxCCRn register and bits of \b TAxCCTLn register.
670 //!
671 //! \return None
672 //
673 //*****************************************************************************
674 extern void Timer_A_initCompareMode(uint16_t baseAddress,
676 
677 //*****************************************************************************
678 //
679 //! \brief Enable timer interrupt
680 //!
681 //! Does not clear interrupt flags
682 //!
683 //! \param baseAddress is the base address of the TIMER_A module.
684 //!
685 //! Modified bits of \b TAxCTL register.
686 //!
687 //! \return None
688 //
689 //*****************************************************************************
690 extern void Timer_A_enableInterrupt(uint16_t baseAddress);
691 
692 //*****************************************************************************
693 //
694 //! \brief Disable timer interrupt
695 //!
696 //! \param baseAddress is the base address of the TIMER_A module.
697 //!
698 //! Modified bits of \b TAxCTL register.
699 //!
700 //! \return None
701 //
702 //*****************************************************************************
703 extern void Timer_A_disableInterrupt(uint16_t baseAddress);
704 
705 //*****************************************************************************
706 //
707 //! \brief Get timer interrupt status
708 //!
709 //! \param baseAddress is the base address of the TIMER_A module.
710 //!
711 //! \return One of the following:
712 //! - \b Timer_A_INTERRUPT_NOT_PENDING
713 //! - \b Timer_A_INTERRUPT_PENDING
714 //! \n indicating the Timer_A interrupt status
715 //
716 //*****************************************************************************
717 extern uint32_t Timer_A_getInterruptStatus(uint16_t baseAddress);
718 
719 //*****************************************************************************
720 //
721 //! \brief Enable capture compare interrupt
722 //!
723 //! Does not clear interrupt flags
724 //!
725 //! \param baseAddress is the base address of the TIMER_A module.
726 //! \param captureCompareRegister is the selected capture compare register
727 //! Valid values are:
728 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_0
729 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_1
730 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_2
731 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_3
732 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_4
733 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_5
734 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_6
735 //!
736 //! Modified bits of \b TAxCCTLn register.
737 //!
738 //! \return None
739 //
740 //*****************************************************************************
741 extern void Timer_A_enableCaptureCompareInterrupt(uint16_t baseAddress,
742  uint16_t captureCompareRegister);
743 
744 //*****************************************************************************
745 //
746 //! \brief Disable capture compare interrupt
747 //!
748 //! \param baseAddress is the base address of the TIMER_A module.
749 //! \param captureCompareRegister is the selected capture compare register
750 //! Valid values are:
751 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_0
752 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_1
753 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_2
754 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_3
755 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_4
756 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_5
757 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_6
758 //!
759 //! Modified bits of \b TAxCCTLn register.
760 //!
761 //! \return None
762 //
763 //*****************************************************************************
764 extern void Timer_A_disableCaptureCompareInterrupt(uint16_t baseAddress,
765  uint16_t captureCompareRegister);
766 
767 //*****************************************************************************
768 //
769 //! \brief Return capture compare interrupt status
770 //!
771 //! \param baseAddress is the base address of the TIMER_A module.
772 //! \param captureCompareRegister is the selected capture compare register
773 //! Valid values are:
774 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_0
775 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_1
776 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_2
777 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_3
778 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_4
779 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_5
780 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_6
781 //! \param mask is the mask for the interrupt status
782 //! Mask value is the logical OR of any of the following:
783 //! - \b TIMER_A_CAPTURE_OVERFLOW
784 //! - \b TIMER_A_CAPTURECOMPARE_INTERRUPT_FLAG
785 //!
786 //! \return Logical OR of any of the following:
787 //! - \b Timer_A_CAPTURE_OVERFLOW
788 //! - \b Timer_A_CAPTURECOMPARE_INTERRUPT_FLAG
789 //! \n indicating the status of the masked interrupts
790 //
791 //*****************************************************************************
792 extern uint32_t Timer_A_getCaptureCompareInterruptStatus(uint16_t baseAddress,
793  uint16_t captureCompareRegister,
794  uint16_t mask);
795 
796 //*****************************************************************************
797 //
798 //! \brief Reset/Clear the timer clock divider, count direction, count
799 //!
800 //! \param baseAddress is the base address of the TIMER_A module.
801 //!
802 //! Modified bits of \b TAxCTL register.
803 //!
804 //! \return None
805 //
806 //*****************************************************************************
807 extern void Timer_A_clear(uint16_t baseAddress);
808 
809 //*****************************************************************************
810 //
811 //! \brief Get synchronized capturecompare input
812 //!
813 //! \param baseAddress is the base address of the TIMER_A module.
814 //! \param captureCompareRegister
815 //! Valid values are:
816 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_0
817 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_1
818 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_2
819 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_3
820 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_4
821 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_5
822 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_6
823 //! \param synchronized
824 //! Valid values are:
825 //! - \b TIMER_A_READ_SYNCHRONIZED_CAPTURECOMPAREINPUT
826 //! - \b TIMER_A_READ_CAPTURE_COMPARE_INPUT
827 //!
828 //! \return One of the following:
829 //! - \b Timer_A_CAPTURECOMPARE_INPUT_HIGH
830 //! - \b Timer_A_CAPTURECOMPARE_INPUT_LOW
831 //
832 //*****************************************************************************
833 extern uint8_t Timer_A_getSynchronizedCaptureCompareInput(uint16_t baseAddress,
834  uint16_t captureCompareRegister,
835  uint16_t synchronized);
836 
837 //*****************************************************************************
838 //
839 //! \brief Get output bit for output mode
840 //!
841 //! \param baseAddress is the base address of the TIMER_A module.
842 //! \param captureCompareRegister
843 //! Valid values are:
844 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_0
845 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_1
846 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_2
847 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_3
848 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_4
849 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_5
850 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_6
851 //!
852 //! \return One of the following:
853 //! - \b Timer_A_OUTPUTMODE_OUTBITVALUE_HIGH
854 //! - \b Timer_A_OUTPUTMODE_OUTBITVALUE_LOW
855 //
856 //*****************************************************************************
857 extern uint8_t Timer_A_getOutputForOutputModeOutBitValue(uint16_t baseAddress,
858  uint16_t captureCompareRegister);
859 
860 //*****************************************************************************
861 //
862 //! \brief Get current capturecompare count
863 //!
864 //! \param baseAddress is the base address of the TIMER_A module.
865 //! \param captureCompareRegister
866 //! Valid values are:
867 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_0
868 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_1
869 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_2
870 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_3
871 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_4
872 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_5
873 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_6
874 //!
875 //! \return Current count as an uint16_t
876 //
877 //*****************************************************************************
878 extern uint16_t Timer_A_getCaptureCompareCount(uint16_t baseAddress,
879  uint16_t captureCompareRegister);
880 
881 //*****************************************************************************
882 //
883 //! \brief Set output bit for output mode
884 //!
885 //! \param baseAddress is the base address of the TIMER_A module.
886 //! \param captureCompareRegister
887 //! Valid values are:
888 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_0
889 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_1
890 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_2
891 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_3
892 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_4
893 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_5
894 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_6
895 //! \param outputModeOutBitValue is the value to be set for out bit
896 //! Valid values are:
897 //! - \b TIMER_A_OUTPUTMODE_OUTBITVALUE_HIGH
898 //! - \b TIMER_A_OUTPUTMODE_OUTBITVALUE_LOW
899 //!
900 //! Modified bits of \b TAxCCTLn register.
901 //!
902 //! \return None
903 //
904 //*****************************************************************************
905 extern void Timer_A_setOutputForOutputModeOutBitValue(uint16_t baseAddress,
906  uint16_t captureCompareRegister,
907  uint8_t outputModeOutBitValue);
908 
909 //*****************************************************************************
910 //
911 //! \brief Generate a PWM with timer running in up mode
912 //!
913 //! \param baseAddress is the base address of the TIMER_A module.
914 //! \param param is the pointer to struct for PWM configuration.
915 //!
916 //! Modified bits of \b TAxCTL register, bits of \b TAxCCTL0 register, bits of
917 //! \b TAxCCR0 register and bits of \b TAxCCTLn register.
918 //!
919 //! \return None
920 //
921 //*****************************************************************************
922 extern void Timer_A_outputPWM(uint16_t baseAddress,
923  Timer_A_outputPWMParam *param);
924 
925 //*****************************************************************************
926 //
927 //! \brief Stops the timer
928 //!
929 //! \param baseAddress is the base address of the TIMER_A module.
930 //!
931 //! Modified bits of \b TAxCTL register.
932 //!
933 //! \return None
934 //
935 //*****************************************************************************
936 extern void Timer_A_stop(uint16_t baseAddress);
937 
938 //*****************************************************************************
939 //
940 //! \brief Sets the value of the capture-compare register
941 //!
942 //! \param baseAddress is the base address of the TIMER_A module.
943 //! \param compareRegister selects the Capture register being used. Refer to
944 //! datasheet to ensure the device has the capture compare register
945 //! being used.
946 //! Valid values are:
947 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_0
948 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_1
949 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_2
950 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_3
951 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_4
952 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_5
953 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_6
954 //! \param compareValue is the count to be compared with in compare mode
955 //!
956 //! Modified bits of \b TAxCCRn register.
957 //!
958 //! \return None
959 //
960 //*****************************************************************************
961 extern void Timer_A_setCompareValue(uint16_t baseAddress,
962  uint16_t compareRegister,
963  uint16_t compareValue);
964 
965 //*****************************************************************************
966 //
967 //! \brief Clears the Timer TAIFG interrupt flag
968 //!
969 //! \param baseAddress is the base address of the TIMER_A module.
970 //!
971 //! Modified bits are \b TAIFG of \b TAxCTL register.
972 //!
973 //! \return None
974 //
975 //*****************************************************************************
976 extern void Timer_A_clearTimerInterrupt(uint16_t baseAddress);
977 
978 //*****************************************************************************
979 //
980 //! \brief Clears the capture-compare interrupt flag
981 //!
982 //! \param baseAddress is the base address of the TIMER_A module.
983 //! \param captureCompareRegister selects the Capture-compare register being
984 //! used.
985 //! Valid values are:
986 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_0
987 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_1
988 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_2
989 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_3
990 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_4
991 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_5
992 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_6
993 //!
994 //! Modified bits are \b CCIFG of \b TAxCCTLn register.
995 //!
996 //! \return None
997 //
998 //*****************************************************************************
999 extern void Timer_A_clearCaptureCompareInterrupt(uint16_t baseAddress,
1000  uint16_t captureCompareRegister);
1001 
1002 //*****************************************************************************
1003 //
1004 //! \brief Reads the current timer count value
1005 //!
1006 //! Reads the current count value of the timer. There is a majority vote system
1007 //! in place to confirm an accurate value is returned. The TIMER_A_THRESHOLD
1008 //! #define in the corresponding header file can be modified so that the votes
1009 //! must be closer together for a consensus to occur.
1010 //!
1011 //! \param baseAddress is the base address of the TIMER_A module.
1012 //!
1013 //! \return Majority vote of timer count value
1014 //
1015 //*****************************************************************************
1016 extern uint16_t Timer_A_getCounterValue(uint16_t baseAddress);
1017 
1018 //*****************************************************************************
1019 //
1020 // Mark the end of the C bindings section for C++ compilers.
1021 //
1022 //*****************************************************************************
1023 #ifdef __cplusplus
1024 }
1025 #endif
1026 
1027 #endif
1028 #endif // __MSP430WARE_TIMER_A_H__
void Timer_A_initContinuousMode(uint16_t baseAddress, Timer_A_initContinuousModeParam *param)
Configures Timer_A in continuous mode.
Definition: timer_a.c:28
uint16_t captureOutputMode
Definition: timer_a.h:139
uint16_t timerClear
Definition: timer_a.h:82
uint16_t synchronizeCaptureSource
Definition: timer_a.h:123
bool startTimer
Whether to start the timer immediately.
Definition: timer_a.h:84
void Timer_A_disableCaptureCompareInterrupt(uint16_t baseAddress, uint16_t captureCompareRegister)
Disable capture compare interrupt.
Definition: timer_a.c:178
uint16_t captureRegister
Definition: timer_a.h:104
void Timer_A_startCounter(uint16_t baseAddress, uint16_t timerMode)
Starts Timer_A counter.
Definition: timer_a.c:21
uint16_t clockSourceDivider
Definition: timer_a.h:236
void Timer_A_stop(uint16_t baseAddress)
Stops the timer.
Definition: timer_a.c:268
void Timer_A_clearCaptureCompareInterrupt(uint16_t baseAddress, uint16_t captureCompareRegister)
Clears the capture-compare interrupt flag.
Definition: timer_a.c:286
uint16_t compareOutputMode
Definition: timer_a.h:260
uint16_t timerClear
Definition: timer_a.h:319
uint16_t timerPeriod
Is the specified Timer_A period.
Definition: timer_a.h:180
void Timer_A_enableInterrupt(uint16_t baseAddress)
Enable timer interrupt.
Definition: timer_a.c:156
void Timer_A_clearTimerInterrupt(uint16_t baseAddress)
Clears the Timer TAIFG interrupt flag.
Definition: timer_a.c:281
uint16_t Timer_A_getCaptureCompareCount(uint16_t baseAddress, uint16_t captureCompareRegister)
Get current capturecompare count.
Definition: timer_a.c:224
Used in the Timer_A_initUpDownMode() function as the param parameter.
Definition: timer_a.h:148
uint16_t clockSource
Definition: timer_a.h:48
uint8_t Timer_A_getSynchronizedCaptureCompareInput(uint16_t baseAddress, uint16_t captureCompareRegister, uint16_t synchronized)
Get synchronized capturecompare input.
Definition: timer_a.c:199
uint16_t compareOutputMode
Definition: timer_a.h:357
uint16_t timerInterruptEnable_TAIE
Definition: timer_a.h:185
void Timer_A_initCompareMode(uint16_t baseAddress, Timer_A_initCompareModeParam *param)
Initializes Compare Mode.
Definition: timer_a.c:139
uint16_t dutyCycle
Specifies the dutycycle for the generated waveform.
Definition: timer_a.h:262
bool startTimer
Whether to start the timer immediately.
Definition: timer_a.h:321
uint16_t timerClear
Definition: timer_a.h:196
uint16_t captureCompareInterruptEnable_CCR0_CCIE
Definition: timer_a.h:190
uint16_t compareInterruptEnable
Definition: timer_a.h:346
uint16_t timerPeriod
Definition: timer_a.h:303
void Timer_A_setOutputForOutputModeOutBitValue(uint16_t baseAddress, uint16_t captureCompareRegister, uint8_t outputModeOutBitValue)
Set output bit for output mode.
Definition: timer_a.c:232
uint16_t clockSourceDivider
Definition: timer_a.h:300
Used in the Timer_A_initCaptureMode() function as the param parameter.
Definition: timer_a.h:93
Used in the Timer_A_initUpMode() function as the param parameter.
Definition: timer_a.h:270
Used in the Timer_A_initCompareMode() function as the param parameter.
Definition: timer_a.h:330
void Timer_A_enableCaptureCompareInterrupt(uint16_t baseAddress, uint16_t captureCompareRegister)
Enable capture compare interrupt.
Definition: timer_a.c:171
uint16_t captureMode
Definition: timer_a.h:111
void Timer_A_disableInterrupt(uint16_t baseAddress)
Disable timer interrupt.
Definition: timer_a.c:161
void Timer_A_initUpDownMode(uint16_t baseAddress, Timer_A_initUpDownModeParam *param)
Configures Timer_A in up down mode.
Definition: timer_a.c:85
uint16_t clockSource
Definition: timer_a.h:213
uint16_t compareValue
Is the count to be compared with in compare mode.
Definition: timer_a.h:359
uint16_t captureInputSelect
Definition: timer_a.h:118
void Timer_A_setCompareValue(uint16_t baseAddress, uint16_t compareRegister, uint16_t compareValue)
Sets the value of the capture-compare register.
Definition: timer_a.c:273
void Timer_A_initCaptureMode(uint16_t baseAddress, Timer_A_initCaptureModeParam *param)
Initializes Capture Mode.
Definition: timer_a.c:117
uint16_t Timer_A_getCounterValue(uint16_t baseAddress)
Reads the current timer count value.
Definition: timer_a.c:293
uint32_t Timer_A_getInterruptStatus(uint16_t baseAddress)
Get timer interrupt status.
Definition: timer_a.c:166
Used in the Timer_A_outputPWM() function as the param parameter.
Definition: timer_a.h:206
void Timer_A_outputPWM(uint16_t baseAddress, Timer_A_outputPWMParam *param)
Generate a PWM with timer running in up mode.
Definition: timer_a.c:242
uint16_t compareRegister
Definition: timer_a.h:341
uint16_t timerInterruptEnable_TAIE
Definition: timer_a.h:308
void Timer_A_initUpMode(uint16_t baseAddress, Timer_A_initUpModeParam *param)
Configures Timer_A in up mode.
Definition: timer_a.c:52
bool startTimer
Whether to start the timer immediately.
Definition: timer_a.h:198
uint16_t clockSourceDivider
Definition: timer_a.h:71
uint32_t Timer_A_getCaptureCompareInterruptStatus(uint16_t baseAddress, uint16_t captureCompareRegister, uint16_t mask)
Return capture compare interrupt status.
Definition: timer_a.c:185
uint16_t clockSource
Definition: timer_a.h:155
uint8_t Timer_A_getOutputForOutputModeOutBitValue(uint16_t baseAddress, uint16_t captureCompareRegister)
Get output bit for output mode.
Definition: timer_a.c:212
uint16_t clockSourceDivider
Definition: timer_a.h:178
Used in the Timer_A_initContinuousMode() function as the param parameter.
Definition: timer_a.h:41
uint16_t compareRegister
Definition: timer_a.h:249
void Timer_A_clear(uint16_t baseAddress)
Reset/Clear the timer clock divider, count direction, count.
Definition: timer_a.c:193
uint16_t captureInterruptEnable
Definition: timer_a.h:128
uint16_t timerPeriod
Selects the desired timer period.
Definition: timer_a.h:238
uint16_t timerInterruptEnable_TAIE
Definition: timer_a.h:76
uint16_t captureCompareInterruptEnable_CCR0_CCIE
Definition: timer_a.h:313
uint16_t clockSource
Definition: timer_a.h:277

Copyright 2015, Texas Instruments Incorporated