MSP430 DriverLib for MSP430FR2xx_4xx Devices  2.91.13.01
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 compareOutputMode
454 // parameter for functions: Timer_A_setOutputMode(); the param parameter for
455 // functions: Timer_A_initCaptureMode(), Timer_A_initCompareMode(), and
456 // Timer_A_outputPWM().
457 //
458 //*****************************************************************************
459 #define TIMER_A_OUTPUTMODE_OUTBITVALUE OUTMOD_0
460 #define TIMER_A_OUTPUTMODE_SET OUTMOD_1
461 #define TIMER_A_OUTPUTMODE_TOGGLE_RESET OUTMOD_2
462 #define TIMER_A_OUTPUTMODE_SET_RESET OUTMOD_3
463 #define TIMER_A_OUTPUTMODE_TOGGLE OUTMOD_4
464 #define TIMER_A_OUTPUTMODE_RESET OUTMOD_5
465 #define TIMER_A_OUTPUTMODE_TOGGLE_SET OUTMOD_6
466 #define TIMER_A_OUTPUTMODE_RESET_SET OUTMOD_7
467 
468 //*****************************************************************************
469 //
470 // The following are values that can be passed to the compareRegister parameter
471 // for functions: Timer_A_setCompareValue(), and Timer_A_setOutputMode(); the
472 // captureCompareRegister parameter for functions:
473 // Timer_A_enableCaptureCompareInterrupt(),
474 // Timer_A_disableCaptureCompareInterrupt(),
475 // Timer_A_getCaptureCompareInterruptStatus(),
476 // Timer_A_getSynchronizedCaptureCompareInput(),
477 // Timer_A_getOutputForOutputModeOutBitValue(),
478 // Timer_A_getCaptureCompareCount(),
479 // Timer_A_setOutputForOutputModeOutBitValue(), and
480 // Timer_A_clearCaptureCompareInterrupt(); the param parameter for functions:
481 // Timer_A_initCaptureMode(), Timer_A_initCompareMode(), and
482 // Timer_A_outputPWM().
483 //
484 //*****************************************************************************
485 #define TIMER_A_CAPTURECOMPARE_REGISTER_0 0x02
486 #define TIMER_A_CAPTURECOMPARE_REGISTER_1 0x04
487 #define TIMER_A_CAPTURECOMPARE_REGISTER_2 0x06
488 
489 //*****************************************************************************
490 //
491 // The following are values that can be passed to the param parameter for
492 // functions: Timer_A_initCaptureMode().
493 //
494 //*****************************************************************************
495 #define TIMER_A_CAPTUREMODE_NO_CAPTURE CM_0
496 #define TIMER_A_CAPTUREMODE_RISING_EDGE CM_1
497 #define TIMER_A_CAPTUREMODE_FALLING_EDGE CM_2
498 #define TIMER_A_CAPTUREMODE_RISING_AND_FALLING_EDGE CM_3
499 
500 //*****************************************************************************
501 //
502 // The following are values that can be passed to the param parameter for
503 // functions: Timer_A_initCaptureMode().
504 //
505 //*****************************************************************************
506 #define TIMER_A_CAPTURE_ASYNCHRONOUS 0x00
507 #define TIMER_A_CAPTURE_SYNCHRONOUS SCS
508 
509 //*****************************************************************************
510 //
511 // The following are values that can be passed to the mask parameter for
512 // functions: Timer_A_getCaptureCompareInterruptStatus() as well as returned by
513 // the Timer_A_getCaptureCompareInterruptStatus() function.
514 //
515 //*****************************************************************************
516 #define TIMER_A_CAPTURE_OVERFLOW COV
517 #define TIMER_A_CAPTURECOMPARE_INTERRUPT_FLAG CCIFG
518 
519 //*****************************************************************************
520 //
521 // The following are values that can be passed to the synchronized parameter
522 // for functions: Timer_A_getSynchronizedCaptureCompareInput().
523 //
524 //*****************************************************************************
525 #define TIMER_A_READ_SYNCHRONIZED_CAPTURECOMPAREINPUT SCCI
526 #define TIMER_A_READ_CAPTURE_COMPARE_INPUT CCI
527 
528 //*****************************************************************************
529 //
530 // The following are values that can be passed toThe following are values that
531 // can be returned by the Timer_A_getSynchronizedCaptureCompareInput()
532 // function.
533 //
534 //*****************************************************************************
535 #define TIMER_A_CAPTURECOMPARE_INPUT_HIGH 0x01
536 #define TIMER_A_CAPTURECOMPARE_INPUT_LOW 0x00
537 
538 //*****************************************************************************
539 //
540 // The following are values that can be passed to the outputModeOutBitValue
541 // parameter for functions: Timer_A_setOutputForOutputModeOutBitValue() as well
542 // as returned by the Timer_A_getOutputForOutputModeOutBitValue() function.
543 //
544 //*****************************************************************************
545 #define TIMER_A_OUTPUTMODE_OUTBITVALUE_HIGH OUT
546 #define TIMER_A_OUTPUTMODE_OUTBITVALUE_LOW 0x00
547 
548 //*****************************************************************************
549 //
550 // The following are values that can be passed toThe following are values that
551 // can be returned by the Timer_A_getInterruptStatus() function.
552 //
553 //*****************************************************************************
554 #define TIMER_A_INTERRUPT_NOT_PENDING 0x00
555 #define TIMER_A_INTERRUPT_PENDING 0x01
556 
557 //*****************************************************************************
558 //
559 // Prototypes for the APIs.
560 //
561 //*****************************************************************************
562 
563 //*****************************************************************************
564 //
565 //! \brief Starts Timer_A counter
566 //!
567 //! This function assumes that the timer has been previously configured using
568 //! Timer_A_initContinuousMode, Timer_A_initUpMode or Timer_A_initUpDownMode.
569 //!
570 //! \param baseAddress is the base address of the TIMER_A module.
571 //! \param timerMode mode to put the timer in
572 //! Valid values are:
573 //! - \b TIMER_A_STOP_MODE
574 //! - \b TIMER_A_UP_MODE
575 //! - \b TIMER_A_CONTINUOUS_MODE [Default]
576 //! - \b TIMER_A_UPDOWN_MODE
577 //!
578 //! Modified bits of \b TAxCTL register.
579 //!
580 //! \return None
581 //
582 //*****************************************************************************
583 extern void Timer_A_startCounter(uint16_t baseAddress,
584  uint16_t timerMode);
585 
586 //*****************************************************************************
587 //
588 //! \brief Configures Timer_A in continuous mode.
589 //!
590 //! \param baseAddress is the base address of the TIMER_A module.
591 //! \param param is the pointer to struct for continuous mode initialization.
592 //!
593 //! Modified bits of \b TAxCTL register.
594 //!
595 //! \return None
596 //
597 //*****************************************************************************
598 extern void Timer_A_initContinuousMode(uint16_t baseAddress,
600 
601 //*****************************************************************************
602 //
603 //! \brief Configures Timer_A in up mode.
604 //!
605 //! \param baseAddress is the base address of the TIMER_A module.
606 //! \param param is the pointer to struct for up mode initialization.
607 //!
608 //! Modified bits of \b TAxCTL register, bits of \b TAxCCTL0 register and bits
609 //! of \b TAxCCR0 register.
610 //!
611 //! \return None
612 //
613 //*****************************************************************************
614 extern void Timer_A_initUpMode(uint16_t baseAddress,
615  Timer_A_initUpModeParam *param);
616 
617 //*****************************************************************************
618 //
619 //! \brief Configures Timer_A in up down mode.
620 //!
621 //! \param baseAddress is the base address of the TIMER_A module.
622 //! \param param is the pointer to struct for up-down mode initialization.
623 //!
624 //! Modified bits of \b TAxCTL register, bits of \b TAxCCTL0 register and bits
625 //! of \b TAxCCR0 register.
626 //!
627 //! \return None
628 //
629 //*****************************************************************************
630 extern void Timer_A_initUpDownMode(uint16_t baseAddress,
632 
633 //*****************************************************************************
634 //
635 //! \brief Initializes Capture Mode
636 //!
637 //! \param baseAddress is the base address of the TIMER_A module.
638 //! \param param is the pointer to struct for capture mode initialization.
639 //!
640 //! Modified bits of \b TAxCCTLn register.
641 //!
642 //! \return None
643 //
644 //*****************************************************************************
645 extern void Timer_A_initCaptureMode(uint16_t baseAddress,
647 
648 //*****************************************************************************
649 //
650 //! \brief Initializes Compare Mode
651 //!
652 //! \param baseAddress is the base address of the TIMER_A module.
653 //! \param param is the pointer to struct for compare mode initialization.
654 //!
655 //! Modified bits of \b TAxCCRn register and bits of \b TAxCCTLn register.
656 //!
657 //! \return None
658 //
659 //*****************************************************************************
660 extern void Timer_A_initCompareMode(uint16_t baseAddress,
662 
663 //*****************************************************************************
664 //
665 //! \brief Enable timer interrupt
666 //!
667 //! Does not clear interrupt flags
668 //!
669 //! \param baseAddress is the base address of the TIMER_A module.
670 //!
671 //! Modified bits of \b TAxCTL register.
672 //!
673 //! \return None
674 //
675 //*****************************************************************************
676 extern void Timer_A_enableInterrupt(uint16_t baseAddress);
677 
678 //*****************************************************************************
679 //
680 //! \brief Disable timer interrupt
681 //!
682 //! \param baseAddress is the base address of the TIMER_A module.
683 //!
684 //! Modified bits of \b TAxCTL register.
685 //!
686 //! \return None
687 //
688 //*****************************************************************************
689 extern void Timer_A_disableInterrupt(uint16_t baseAddress);
690 
691 //*****************************************************************************
692 //
693 //! \brief Get timer interrupt status
694 //!
695 //! \param baseAddress is the base address of the TIMER_A module.
696 //!
697 //! \return One of the following:
698 //! - \b TIMER_A_INTERRUPT_NOT_PENDING
699 //! - \b TIMER_A_INTERRUPT_PENDING
700 //! \n indicating the Timer_A interrupt status
701 //
702 //*****************************************************************************
703 extern uint32_t Timer_A_getInterruptStatus(uint16_t baseAddress);
704 
705 //*****************************************************************************
706 //
707 //! \brief Enable capture compare interrupt
708 //!
709 //! Does not clear interrupt flags
710 //!
711 //! \param baseAddress is the base address of the TIMER_A module.
712 //! \param captureCompareRegister is the selected capture compare register
713 //! Valid values are:
714 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_0
715 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_1
716 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_2
717 //!
718 //! Modified bits of \b TAxCCTLn register.
719 //!
720 //! \return None
721 //
722 //*****************************************************************************
723 extern void Timer_A_enableCaptureCompareInterrupt(uint16_t baseAddress,
724  uint16_t captureCompareRegister);
725 
726 //*****************************************************************************
727 //
728 //! \brief Disable capture compare interrupt
729 //!
730 //! \param baseAddress is the base address of the TIMER_A module.
731 //! \param captureCompareRegister is the selected capture compare register
732 //! Valid values are:
733 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_0
734 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_1
735 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_2
736 //!
737 //! Modified bits of \b TAxCCTLn register.
738 //!
739 //! \return None
740 //
741 //*****************************************************************************
742 extern void Timer_A_disableCaptureCompareInterrupt(uint16_t baseAddress,
743  uint16_t captureCompareRegister);
744 
745 //*****************************************************************************
746 //
747 //! \brief Return capture compare interrupt status
748 //!
749 //! \param baseAddress is the base address of the TIMER_A module.
750 //! \param captureCompareRegister is the selected capture compare register
751 //! Valid values are:
752 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_0
753 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_1
754 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_2
755 //! \param mask is the mask for the interrupt status
756 //! Mask value is the logical OR of any of the following:
757 //! - \b TIMER_A_CAPTURE_OVERFLOW
758 //! - \b TIMER_A_CAPTURECOMPARE_INTERRUPT_FLAG
759 //!
760 //! \return Logical OR of any of the following:
761 //! - \b TIMER_A_CAPTURE_OVERFLOW
762 //! - \b TIMER_A_CAPTURECOMPARE_INTERRUPT_FLAG
763 //! \n indicating the status of the masked interrupts
764 //
765 //*****************************************************************************
766 extern uint32_t Timer_A_getCaptureCompareInterruptStatus(uint16_t baseAddress,
767  uint16_t captureCompareRegister,
768  uint16_t mask);
769 
770 //*****************************************************************************
771 //
772 //! \brief Reset/Clear the timer clock divider, count direction, count
773 //!
774 //! \param baseAddress is the base address of the TIMER_A module.
775 //!
776 //! Modified bits of \b TAxCTL register.
777 //!
778 //! \return None
779 //
780 //*****************************************************************************
781 extern void Timer_A_clear(uint16_t baseAddress);
782 
783 //*****************************************************************************
784 //
785 //! \brief Get synchronized capturecompare input
786 //!
787 //! \param baseAddress is the base address of the TIMER_A module.
788 //! \param captureCompareRegister
789 //! Valid values are:
790 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_0
791 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_1
792 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_2
793 //! \param synchronized
794 //! Valid values are:
795 //! - \b TIMER_A_READ_SYNCHRONIZED_CAPTURECOMPAREINPUT
796 //! - \b TIMER_A_READ_CAPTURE_COMPARE_INPUT
797 //!
798 //! \return One of the following:
799 //! - \b TIMER_A_CAPTURECOMPARE_INPUT_HIGH
800 //! - \b TIMER_A_CAPTURECOMPARE_INPUT_LOW
801 //
802 //*****************************************************************************
803 extern uint8_t Timer_A_getSynchronizedCaptureCompareInput(uint16_t baseAddress,
804  uint16_t captureCompareRegister,
805  uint16_t synchronized);
806 
807 //*****************************************************************************
808 //
809 //! \brief Get output bit for output mode
810 //!
811 //! \param baseAddress is the base address of the TIMER_A module.
812 //! \param captureCompareRegister
813 //! Valid values are:
814 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_0
815 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_1
816 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_2
817 //!
818 //! \return One of the following:
819 //! - \b TIMER_A_OUTPUTMODE_OUTBITVALUE_HIGH
820 //! - \b TIMER_A_OUTPUTMODE_OUTBITVALUE_LOW
821 //
822 //*****************************************************************************
823 extern uint8_t Timer_A_getOutputForOutputModeOutBitValue(uint16_t baseAddress,
824  uint16_t captureCompareRegister);
825 
826 //*****************************************************************************
827 //
828 //! \brief Get current capturecompare count
829 //!
830 //! \param baseAddress is the base address of the TIMER_A module.
831 //! \param captureCompareRegister
832 //! Valid values are:
833 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_0
834 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_1
835 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_2
836 //!
837 //! \return Current count as an uint16_t
838 //
839 //*****************************************************************************
840 extern uint16_t Timer_A_getCaptureCompareCount(uint16_t baseAddress,
841  uint16_t captureCompareRegister);
842 
843 //*****************************************************************************
844 //
845 //! \brief Set output bit for output mode
846 //!
847 //! \param baseAddress is the base address of the TIMER_A module.
848 //! \param captureCompareRegister
849 //! Valid values are:
850 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_0
851 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_1
852 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_2
853 //! \param outputModeOutBitValue is the value to be set for out bit
854 //! Valid values are:
855 //! - \b TIMER_A_OUTPUTMODE_OUTBITVALUE_HIGH
856 //! - \b TIMER_A_OUTPUTMODE_OUTBITVALUE_LOW
857 //!
858 //! Modified bits of \b TAxCCTLn register.
859 //!
860 //! \return None
861 //
862 //*****************************************************************************
863 extern void Timer_A_setOutputForOutputModeOutBitValue(uint16_t baseAddress,
864  uint16_t captureCompareRegister,
865  uint8_t outputModeOutBitValue);
866 
867 //*****************************************************************************
868 //
869 //! \brief Generate a PWM with timer running in up mode
870 //!
871 //! \param baseAddress is the base address of the TIMER_A module.
872 //! \param param is the pointer to struct for PWM configuration.
873 //!
874 //! Modified bits of \b TAxCTL register, bits of \b TAxCCTL0 register, bits of
875 //! \b TAxCCR0 register and bits of \b TAxCCTLn register.
876 //!
877 //! \return None
878 //
879 //*****************************************************************************
880 extern void Timer_A_outputPWM(uint16_t baseAddress,
881  Timer_A_outputPWMParam *param);
882 
883 //*****************************************************************************
884 //
885 //! \brief Stops the timer
886 //!
887 //! \param baseAddress is the base address of the TIMER_A module.
888 //!
889 //! Modified bits of \b TAxCTL register.
890 //!
891 //! \return None
892 //
893 //*****************************************************************************
894 extern void Timer_A_stop(uint16_t baseAddress);
895 
896 //*****************************************************************************
897 //
898 //! \brief Sets the value of the capture-compare register
899 //!
900 //! \param baseAddress is the base address of the TIMER_A module.
901 //! \param compareRegister selects the Capture register being used. Refer to
902 //! datasheet to ensure the device has the capture compare register
903 //! being used.
904 //! Valid values are:
905 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_0
906 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_1
907 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_2
908 //! \param compareValue is the count to be compared with in compare mode
909 //!
910 //! Modified bits of \b TAxCCRn register.
911 //!
912 //! \return None
913 //
914 //*****************************************************************************
915 extern void Timer_A_setCompareValue(uint16_t baseAddress,
916  uint16_t compareRegister,
917  uint16_t compareValue);
918 
919 //*****************************************************************************
920 //
921 //! \brief Sets the output mode
922 //!
923 //! Sets the output mode for the timer even the timer is already running.
924 //!
925 //! \param baseAddress is the base address of the TIMER_A module.
926 //! \param compareRegister selects the compare register being used.
927 //! Valid values are:
928 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_0
929 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_1
930 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_2
931 //! \param compareOutputMode specifies the output mode.
932 //! Valid values are:
933 //! - \b TIMER_A_OUTPUTMODE_OUTBITVALUE [Default]
934 //! - \b TIMER_A_OUTPUTMODE_SET
935 //! - \b TIMER_A_OUTPUTMODE_TOGGLE_RESET
936 //! - \b TIMER_A_OUTPUTMODE_SET_RESET
937 //! - \b TIMER_A_OUTPUTMODE_TOGGLE
938 //! - \b TIMER_A_OUTPUTMODE_RESET
939 //! - \b TIMER_A_OUTPUTMODE_TOGGLE_SET
940 //! - \b TIMER_A_OUTPUTMODE_RESET_SET
941 //!
942 //! Modified bits are \b OUTMOD of \b TAxCCTLn register.
943 //!
944 //! \return None
945 //
946 //*****************************************************************************
947 extern void Timer_A_setOutputMode(uint16_t baseAddress,
948  uint16_t compareRegister,
949  uint16_t compareOutputMode);
950 
951 //*****************************************************************************
952 //
953 //! \brief Clears the Timer TAIFG interrupt flag
954 //!
955 //! \param baseAddress is the base address of the TIMER_A module.
956 //!
957 //! Modified bits are \b TAIFG of \b TAxCTL register.
958 //!
959 //! \return None
960 //
961 //*****************************************************************************
962 extern void Timer_A_clearTimerInterrupt(uint16_t baseAddress);
963 
964 //*****************************************************************************
965 //
966 //! \brief Clears the capture-compare interrupt flag
967 //!
968 //! \param baseAddress is the base address of the TIMER_A module.
969 //! \param captureCompareRegister selects the Capture-compare register being
970 //! used.
971 //! Valid values are:
972 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_0
973 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_1
974 //! - \b TIMER_A_CAPTURECOMPARE_REGISTER_2
975 //!
976 //! Modified bits are \b CCIFG of \b TAxCCTLn register.
977 //!
978 //! \return None
979 //
980 //*****************************************************************************
981 extern void Timer_A_clearCaptureCompareInterrupt(uint16_t baseAddress,
982  uint16_t captureCompareRegister);
983 
984 //*****************************************************************************
985 //
986 //! \brief Reads the current timer count value
987 //!
988 //! Reads the current count value of the timer. There is a majority vote system
989 //! in place to confirm an accurate value is returned. The TIMER_A_THRESHOLD
990 //! #define in the corresponding header file can be modified so that the votes
991 //! must be closer together for a consensus to occur.
992 //!
993 //! \param baseAddress is the base address of the TIMER_A module.
994 //!
995 //! \return Majority vote of timer count value
996 //
997 //*****************************************************************************
998 extern uint16_t Timer_A_getCounterValue(uint16_t baseAddress);
999 
1000 //*****************************************************************************
1001 //
1002 // Mark the end of the C bindings section for C++ compilers.
1003 //
1004 //*****************************************************************************
1005 #ifdef __cplusplus
1006 }
1007 #endif
1008 
1009 #endif
1010 #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:29
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:179
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:270
void Timer_A_clearCaptureCompareInterrupt(uint16_t baseAddress, uint16_t captureCompareRegister)
Clears the capture-compare interrupt flag.
Definition: timer_a.c:295
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:157
void Timer_A_clearTimerInterrupt(uint16_t baseAddress)
Clears the Timer TAIFG interrupt flag.
Definition: timer_a.c:290
uint16_t Timer_A_getCaptureCompareCount(uint16_t baseAddress, uint16_t captureCompareRegister)
Get current capturecompare count.
Definition: timer_a.c:225
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:200
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:140
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:233
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:172
uint16_t captureMode
Definition: timer_a.h:107
void Timer_A_disableInterrupt(uint16_t baseAddress)
Disable timer interrupt.
Definition: timer_a.c:162
void Timer_A_initUpDownMode(uint16_t baseAddress, Timer_A_initUpDownModeParam *param)
Configures Timer_A in up down mode.
Definition: timer_a.c:86
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:275
void Timer_A_initCaptureMode(uint16_t baseAddress, Timer_A_initCaptureModeParam *param)
Initializes Capture Mode.
Definition: timer_a.c:118
uint16_t Timer_A_getCounterValue(uint16_t baseAddress)
Reads the current timer count value.
Definition: timer_a.c:302
uint32_t Timer_A_getInterruptStatus(uint16_t baseAddress)
Get timer interrupt status.
Definition: timer_a.c:167
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:243
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:53
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:186
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:213
uint16_t clockSourceDivider
Definition: timer_a.h:174
Used in the Timer_A_initContinuousMode() function as the param parameter.
Definition: timer_a.h:41
void Timer_A_setOutputMode(uint16_t baseAddress, uint16_t compareRegister, uint16_t compareOutputMode)
Sets the output mode.
Definition: timer_a.c:283
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:194
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 2020, Texas Instruments Incorporated