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

Copyright 2015, Texas Instruments Incorporated