MSP430 DriverLib for MSP430F5xx_6xx Devices  2.91.13.01
timer_d.h
1 //*****************************************************************************
2 //
3 // timer_d.h - Driver for the TIMER_D Module.
4 //
5 //*****************************************************************************
6 
7 #ifndef __MSP430WARE_TIMER_D_H__
8 #define __MSP430WARE_TIMER_D_H__
9 
10 #include "inc/hw_memmap.h"
11 
12 #ifdef __MSP430_HAS_TxD7__
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_D_getCounterValue that
29 // determines the maximum difference in counts of the TDxR register for a
30 // majority vote.
31 //
32 //*****************************************************************************
33 #define TIMER_D_THRESHOLD 50
34 
35 //*****************************************************************************
36 //
37 //! \brief Used in the Timer_D_initUpMode() function as the param parameter.
38 //
39 //*****************************************************************************
40 typedef struct Timer_D_initUpModeParam {
41  //! Selects Clock source.
42  //! \n Valid values are:
43  //! - \b TIMER_D_CLOCKSOURCE_EXTERNAL_TDCLK [Default]
44  //! - \b TIMER_D_CLOCKSOURCE_ACLK
45  //! - \b TIMER_D_CLOCKSOURCE_SMCLK
46  //! - \b TIMER_D_CLOCKSOURCE_INVERTED_EXTERNAL_TDCLK
47  uint16_t clockSource;
48  //! Is the divider for clock source.
49  //! \n Valid values are:
50  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_1 [Default]
51  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_2
52  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_3
53  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_4
54  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_5
55  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_6
56  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_7
57  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_8
58  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_10
59  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_12
60  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_14
61  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_16
62  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_20
63  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_24
64  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_28
65  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_32
66  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_40
67  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_48
68  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_56
69  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_64
71  //! Is the selected clock mode register values.
72  //! \n Valid values are:
73  //! - \b TIMER_D_CLOCKINGMODE_EXTERNAL_CLOCK [Default]
74  //! - \b TIMER_D_CLOCKINGMODE_HIRES_LOCAL_CLOCK
75  //! - \b TIMER_D_CLOCKINGMODE_AUXILIARY_CLK
76  uint16_t clockingMode;
77  //! Is the specified timer period. This is the value that gets written into
78  //! the CCR0. Limited to 16 bits [uint16_t]
79  uint16_t timerPeriod;
80  //! Is to enable or disable timer interrupt
81  //! \n Valid values are:
82  //! - \b TIMER_D_TDIE_INTERRUPT_ENABLE
83  //! - \b TIMER_D_TDIE_INTERRUPT_DISABLE [Default]
85  //! Is to enable or disable timer CCR0 captureComapre interrupt.
86  //! \n Valid values are:
87  //! - \b TIMER_D_CCIE_CCR0_INTERRUPT_ENABLE
88  //! - \b TIMER_D_CCIE_CCR0_INTERRUPT_DISABLE [Default]
90  //! Decides if timer clock divider, count direction, count need to be
91  //! reset.
92  //! \n Valid values are:
93  //! - \b TIMER_D_DO_CLEAR
94  //! - \b TIMER_D_SKIP_CLEAR [Default]
95  uint16_t timerClear;
97 
98 //*****************************************************************************
99 //
100 //! \brief Used in the Timer_D_initCompareMode() function as the param
101 //! parameter.
102 //
103 //*****************************************************************************
105  //! Selects the Capture register being used.
106  //! \n Valid values are:
107  //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_0
108  //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_1
109  //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_2
110  //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_3
111  //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_4
112  //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_5
113  //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_6
114  uint16_t compareRegister;
115  //! Is to enable or disable timer captureComapre interrupt.
116  //! \n Valid values are:
117  //! - \b TIMER_D_CAPTURECOMPARE_INTERRUPT_ENABLE
118  //! - \b TIMER_D_CAPTURECOMPARE_INTERRUPT_DISABLE [Default]
120  //! Specifies the output mode.
121  //! \n Valid values are:
122  //! - \b TIMER_D_OUTPUTMODE_OUTBITVALUE [Default]
123  //! - \b TIMER_D_OUTPUTMODE_SET
124  //! - \b TIMER_D_OUTPUTMODE_TOGGLE_RESET
125  //! - \b TIMER_D_OUTPUTMODE_SET_RESET
126  //! - \b TIMER_D_OUTPUTMODE_TOGGLE
127  //! - \b TIMER_D_OUTPUTMODE_RESET
128  //! - \b TIMER_D_OUTPUTMODE_TOGGLE_SET
129  //! - \b TIMER_D_OUTPUTMODE_RESET_SET
131  //! Is the count to be compared with in compare mode
132  uint16_t compareValue;
134 
135 //*****************************************************************************
136 //
137 //! \brief Used in the Timer_D_initContinuousMode() function as the param
138 //! parameter.
139 //
140 //*****************************************************************************
142  //! Selects Clock source.
143  //! \n Valid values are:
144  //! - \b TIMER_D_CLOCKSOURCE_EXTERNAL_TDCLK [Default]
145  //! - \b TIMER_D_CLOCKSOURCE_ACLK
146  //! - \b TIMER_D_CLOCKSOURCE_SMCLK
147  //! - \b TIMER_D_CLOCKSOURCE_INVERTED_EXTERNAL_TDCLK
148  uint16_t clockSource;
149  //! Is the divider for clock source.
150  //! \n Valid values are:
151  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_1 [Default]
152  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_2
153  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_3
154  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_4
155  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_5
156  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_6
157  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_7
158  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_8
159  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_10
160  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_12
161  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_14
162  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_16
163  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_20
164  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_24
165  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_28
166  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_32
167  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_40
168  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_48
169  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_56
170  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_64
172  //! Is the selected clock mode register values.
173  //! \n Valid values are:
174  //! - \b TIMER_D_CLOCKINGMODE_EXTERNAL_CLOCK [Default]
175  //! - \b TIMER_D_CLOCKINGMODE_HIRES_LOCAL_CLOCK
176  //! - \b TIMER_D_CLOCKINGMODE_AUXILIARY_CLK
177  uint16_t clockingMode;
178  //! Is to enable or disable timer interrupt
179  //! \n Valid values are:
180  //! - \b TIMER_D_TDIE_INTERRUPT_ENABLE
181  //! - \b TIMER_D_TDIE_INTERRUPT_DISABLE [Default]
183  //! Decides if timer clock divider, count direction, count need to be
184  //! reset.
185  //! \n Valid values are:
186  //! - \b TIMER_D_DO_CLEAR
187  //! - \b TIMER_D_SKIP_CLEAR [Default]
188  uint16_t timerClear;
190 
191 //*****************************************************************************
192 //
193 //! \brief Used in the Timer_D_initHighResGeneratorInRegulatedMode() function
194 //! as the param parameter.
195 //
196 //*****************************************************************************
198  //! Selects Clock source.
199  //! \n Valid values are:
200  //! - \b TIMER_D_CLOCKSOURCE_EXTERNAL_TDCLK [Default]
201  //! - \b TIMER_D_CLOCKSOURCE_ACLK
202  //! - \b TIMER_D_CLOCKSOURCE_SMCLK
203  //! - \b TIMER_D_CLOCKSOURCE_INVERTED_EXTERNAL_TDCLK
204  uint16_t clockSource;
205  //! Is the divider for clock source.
206  //! \n Valid values are:
207  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_1 [Default]
208  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_2
209  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_3
210  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_4
211  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_5
212  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_6
213  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_7
214  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_8
215  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_10
216  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_12
217  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_14
218  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_16
219  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_20
220  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_24
221  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_28
222  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_32
223  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_40
224  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_48
225  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_56
226  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_64
228  //! Is the selected clock mode register values.
229  //! \n Valid values are:
230  //! - \b TIMER_D_CLOCKINGMODE_EXTERNAL_CLOCK [Default]
231  //! - \b TIMER_D_CLOCKINGMODE_HIRES_LOCAL_CLOCK
232  //! - \b TIMER_D_CLOCKINGMODE_AUXILIARY_CLK
233  uint16_t clockingMode;
234  //! Selects the high resolution multiply factor.
235  //! \n Valid values are:
236  //! - \b TIMER_D_HIGHRES_CLK_MULTIPLY_FACTOR_8x
237  //! - \b TIMER_D_HIGHRES_CLK_MULTIPLY_FACTOR_16x
239  //! Selects the high resolution divider.
240  //! \n Valid values are:
241  //! - \b TIMER_D_HIGHRES_CLK_DIVIDER_1
242  //! - \b TIMER_D_HIGHRES_CLK_DIVIDER_2
243  //! - \b TIMER_D_HIGHRES_CLK_DIVIDER_4
244  //! - \b TIMER_D_HIGHRES_CLK_DIVIDER_8
247 
248 //*****************************************************************************
249 //
250 //! \brief Used in the Timer_D_initUpDownMode() function as the param
251 //! parameter.
252 //
253 //*****************************************************************************
255  //! Selects Clock source.
256  //! \n Valid values are:
257  //! - \b TIMER_D_CLOCKSOURCE_EXTERNAL_TDCLK [Default]
258  //! - \b TIMER_D_CLOCKSOURCE_ACLK
259  //! - \b TIMER_D_CLOCKSOURCE_SMCLK
260  //! - \b TIMER_D_CLOCKSOURCE_INVERTED_EXTERNAL_TDCLK
261  uint16_t clockSource;
262  //! Is the divider for clock source.
263  //! \n Valid values are:
264  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_1 [Default]
265  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_2
266  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_3
267  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_4
268  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_5
269  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_6
270  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_7
271  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_8
272  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_10
273  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_12
274  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_14
275  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_16
276  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_20
277  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_24
278  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_28
279  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_32
280  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_40
281  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_48
282  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_56
283  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_64
285  //! Is the selected clock mode register values.
286  //! \n Valid values are:
287  //! - \b TIMER_D_CLOCKINGMODE_EXTERNAL_CLOCK [Default]
288  //! - \b TIMER_D_CLOCKINGMODE_HIRES_LOCAL_CLOCK
289  //! - \b TIMER_D_CLOCKINGMODE_AUXILIARY_CLK
290  uint16_t clockingMode;
291  //! Is the specified timer period
292  uint16_t timerPeriod;
293  //! Is to enable or disable timer interrupt
294  //! \n Valid values are:
295  //! - \b TIMER_D_TDIE_INTERRUPT_ENABLE
296  //! - \b TIMER_D_TDIE_INTERRUPT_DISABLE [Default]
298  //! Is to enable or disable timer CCR0 captureComapre interrupt.
299  //! \n Valid values are:
300  //! - \b TIMER_D_CCIE_CCR0_INTERRUPT_ENABLE
301  //! - \b TIMER_D_CCIE_CCR0_INTERRUPT_DISABLE [Default]
303  //! Decides if timer clock divider, count direction, count need to be
304  //! reset.
305  //! \n Valid values are:
306  //! - \b TIMER_D_DO_CLEAR
307  //! - \b TIMER_D_SKIP_CLEAR [Default]
308  uint16_t timerClear;
310 
311 //*****************************************************************************
312 //
313 //! \brief Used in the Timer_D_combineTDCCRToOutputPWM() function as the param
314 //! parameter.
315 //
316 //*****************************************************************************
318  //! Selects Clock source.
319  //! \n Valid values are:
320  //! - \b TIMER_D_CLOCKSOURCE_EXTERNAL_TDCLK [Default]
321  //! - \b TIMER_D_CLOCKSOURCE_ACLK
322  //! - \b TIMER_D_CLOCKSOURCE_SMCLK
323  //! - \b TIMER_D_CLOCKSOURCE_INVERTED_EXTERNAL_TDCLK
324  uint16_t clockSource;
325  //! Is the divider for clock source.
326  //! \n Valid values are:
327  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_1 [Default]
328  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_2
329  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_3
330  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_4
331  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_5
332  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_6
333  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_7
334  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_8
335  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_10
336  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_12
337  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_14
338  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_16
339  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_20
340  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_24
341  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_28
342  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_32
343  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_40
344  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_48
345  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_56
346  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_64
348  //! Is the selected clock mode register values.
349  //! \n Valid values are:
350  //! - \b TIMER_D_CLOCKINGMODE_EXTERNAL_CLOCK [Default]
351  //! - \b TIMER_D_CLOCKINGMODE_HIRES_LOCAL_CLOCK
352  //! - \b TIMER_D_CLOCKINGMODE_AUXILIARY_CLK
353  uint16_t clockingMode;
354  //! Is the specified timer period
355  uint16_t timerPeriod;
356  //! Selects desired CCR registers to combine
357  //! \n Valid values are:
358  //! - \b TIMER_D_COMBINE_CCR1_CCR2
359  //! - \b TIMER_D_COMBINE_CCR3_CCR4 - (available on Timer_D5, Timer_D7)
360  //! - \b TIMER_D_COMBINE_CCR5_CCR6 - (available only on Timer_D7)
362  //! Specifies the output mode.
363  //! \n Valid values are:
364  //! - \b TIMER_D_OUTPUTMODE_OUTBITVALUE [Default]
365  //! - \b TIMER_D_OUTPUTMODE_SET
366  //! - \b TIMER_D_OUTPUTMODE_TOGGLE_RESET
367  //! - \b TIMER_D_OUTPUTMODE_SET_RESET
368  //! - \b TIMER_D_OUTPUTMODE_TOGGLE
369  //! - \b TIMER_D_OUTPUTMODE_RESET
370  //! - \b TIMER_D_OUTPUTMODE_TOGGLE_SET
371  //! - \b TIMER_D_OUTPUTMODE_RESET_SET
373  //! Specifies the dutycycle for the generated waveform
374  uint16_t dutyCycle1;
375  //! Specifies the dutycycle for the generated waveform
376  uint16_t dutyCycle2;
378 
379 //*****************************************************************************
380 //
381 //! \brief Used in the Timer_D_initCaptureMode() function as the param
382 //! parameter.
383 //
384 //*****************************************************************************
386  //! Selects the Capture register being used. Refer to datasheet to ensure
387  //! the device has the capture compare register being used
388  //! \n Valid values are:
389  //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_0
390  //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_1
391  //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_2
392  //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_3
393  //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_4
394  //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_5
395  //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_6
396  uint16_t captureRegister;
397  //! Is the capture mode selected.
398  //! \n Valid values are:
399  //! - \b TIMER_D_CAPTUREMODE_NO_CAPTURE [Default]
400  //! - \b TIMER_D_CAPTUREMODE_RISING_EDGE
401  //! - \b TIMER_D_CAPTUREMODE_FALLING_EDGE
402  //! - \b TIMER_D_CAPTUREMODE_RISING_AND_FALLING_EDGE
403  uint16_t captureMode;
404  //! Decides the Input Select
405  //! \n Valid values are:
406  //! - \b TIMER_D_CAPTURE_INPUTSELECT_CCIxA [Default]
407  //! - \b TIMER_D_CAPTURE_INPUTSELECT_CCIxB
408  //! - \b TIMER_D_CAPTURE_INPUTSELECT_GND
409  //! - \b TIMER_D_CAPTURE_INPUTSELECT_Vcc
411  //! Decides if capture source should be synchronized with timer clock
412  //! \n Valid values are:
413  //! - \b TIMER_D_CAPTURE_ASYNCHRONOUS [Default]
414  //! - \b TIMER_D_CAPTURE_SYNCHRONOUS
416  //! Is to enable or disabel capture interrupt
417  //! \n Valid values are:
418  //! - \b TIMER_D_CAPTURE_INTERRUPT_ENABLE
419  //! - \b TIMER_D_CAPTURE_INTERRUPT_DISABLE [Default]
421  //! Specifies the output mode.
422  //! \n Valid values are:
423  //! - \b TIMER_D_OUTPUTMODE_OUTBITVALUE [Default]
424  //! - \b TIMER_D_OUTPUTMODE_SET
425  //! - \b TIMER_D_OUTPUTMODE_TOGGLE_RESET
426  //! - \b TIMER_D_OUTPUTMODE_SET_RESET
427  //! - \b TIMER_D_OUTPUTMODE_TOGGLE
428  //! - \b TIMER_D_OUTPUTMODE_RESET
429  //! - \b TIMER_D_OUTPUTMODE_TOGGLE_SET
430  //! - \b TIMER_D_OUTPUTMODE_RESET_SET
432  //! Specifies single/dual capture mode.
433  //! \n Valid values are:
434  //! - \b TIMER_D_SINGLE_CAPTURE_MODE - value],
435  //! - \b TIMER_D_DUAL_CAPTURE_MODE
438 
439 //*****************************************************************************
440 //
441 //! \brief Used in the Timer_D_outputPWM() function as the param parameter.
442 //
443 //*****************************************************************************
444 typedef struct Timer_D_outputPWMParam {
445  //! Selects Clock source.
446  //! \n Valid values are:
447  //! - \b TIMER_D_CLOCKSOURCE_EXTERNAL_TDCLK [Default]
448  //! - \b TIMER_D_CLOCKSOURCE_ACLK
449  //! - \b TIMER_D_CLOCKSOURCE_SMCLK
450  //! - \b TIMER_D_CLOCKSOURCE_INVERTED_EXTERNAL_TDCLK
451  uint16_t clockSource;
452  //! Is the divider for clock source.
453  //! \n Valid values are:
454  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_1 [Default]
455  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_2
456  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_3
457  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_4
458  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_5
459  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_6
460  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_7
461  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_8
462  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_10
463  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_12
464  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_14
465  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_16
466  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_20
467  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_24
468  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_28
469  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_32
470  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_40
471  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_48
472  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_56
473  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_64
475  //! Is the selected clock mode register values.
476  //! \n Valid values are:
477  //! - \b TIMER_D_CLOCKINGMODE_EXTERNAL_CLOCK [Default]
478  //! - \b TIMER_D_CLOCKINGMODE_HIRES_LOCAL_CLOCK
479  //! - \b TIMER_D_CLOCKINGMODE_AUXILIARY_CLK
480  uint16_t clockingMode;
481  //! Is the specified timer period
482  uint16_t timerPeriod;
483  //! Selects the compare register being used.
484  //! \n Valid values are:
485  //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_0
486  //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_1
487  //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_2
488  //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_3
489  //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_4
490  //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_5
491  //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_6
492  uint16_t compareRegister;
493  //! Specifies the output mode.
494  //! \n Valid values are:
495  //! - \b TIMER_D_OUTPUTMODE_OUTBITVALUE [Default]
496  //! - \b TIMER_D_OUTPUTMODE_SET
497  //! - \b TIMER_D_OUTPUTMODE_TOGGLE_RESET
498  //! - \b TIMER_D_OUTPUTMODE_SET_RESET
499  //! - \b TIMER_D_OUTPUTMODE_TOGGLE
500  //! - \b TIMER_D_OUTPUTMODE_RESET
501  //! - \b TIMER_D_OUTPUTMODE_TOGGLE_SET
502  //! - \b TIMER_D_OUTPUTMODE_RESET_SET
504  //! Specifies the dutycycle for the generated waveform
505  uint16_t dutyCycle;
507 
508 
509 //*****************************************************************************
510 //
511 // The following are values that can be passed to the param parameter for
512 // functions: Timer_D_initContinuousMode(), Timer_D_initUpMode(),
513 // Timer_D_initUpDownMode(), Timer_D_outputPWM(),
514 // Timer_D_initHighResGeneratorInRegulatedMode(), and
515 // Timer_D_combineTDCCRToOutputPWM().
516 //
517 //*****************************************************************************
518 #define TIMER_D_CLOCKSOURCE_DIVIDER_1 0x00
519 #define TIMER_D_CLOCKSOURCE_DIVIDER_2 0x08
520 #define TIMER_D_CLOCKSOURCE_DIVIDER_3 0x02
521 #define TIMER_D_CLOCKSOURCE_DIVIDER_4 0x10
522 #define TIMER_D_CLOCKSOURCE_DIVIDER_5 0x04
523 #define TIMER_D_CLOCKSOURCE_DIVIDER_6 0x05
524 #define TIMER_D_CLOCKSOURCE_DIVIDER_7 0x06
525 #define TIMER_D_CLOCKSOURCE_DIVIDER_8 0x18
526 #define TIMER_D_CLOCKSOURCE_DIVIDER_10 0x0C
527 #define TIMER_D_CLOCKSOURCE_DIVIDER_12 0x0D
528 #define TIMER_D_CLOCKSOURCE_DIVIDER_14 0x0E
529 #define TIMER_D_CLOCKSOURCE_DIVIDER_16 0x0F
530 #define TIMER_D_CLOCKSOURCE_DIVIDER_20 0x14
531 #define TIMER_D_CLOCKSOURCE_DIVIDER_24 0x15
532 #define TIMER_D_CLOCKSOURCE_DIVIDER_28 0x16
533 #define TIMER_D_CLOCKSOURCE_DIVIDER_32 0x17
534 #define TIMER_D_CLOCKSOURCE_DIVIDER_40 0x1C
535 #define TIMER_D_CLOCKSOURCE_DIVIDER_48 0x1D
536 #define TIMER_D_CLOCKSOURCE_DIVIDER_56 0x1E
537 #define TIMER_D_CLOCKSOURCE_DIVIDER_64 0x1F
538 
539 //*****************************************************************************
540 //
541 // The following are values that can be passed to the timerMode parameter for
542 // functions: Timer_D_startCounter().
543 //
544 //*****************************************************************************
545 #define TIMER_D_STOP_MODE MC_0
546 #define TIMER_D_UP_MODE MC_1
547 #define TIMER_D_CONTINUOUS_MODE MC_2
548 #define TIMER_D_UPDOWN_MODE MC_3
549 
550 //*****************************************************************************
551 //
552 // The following are values that can be passed to the param parameter for
553 // functions: Timer_D_initContinuousMode(), Timer_D_initUpMode(), and
554 // Timer_D_initUpDownMode().
555 //
556 //*****************************************************************************
557 #define TIMER_D_DO_CLEAR TDCLR
558 #define TIMER_D_SKIP_CLEAR 0x00
559 
560 //*****************************************************************************
561 //
562 // The following are values that can be passed to the param parameter for
563 // functions: Timer_D_initContinuousMode(), Timer_D_initUpMode(),
564 // Timer_D_initUpDownMode(), Timer_D_outputPWM(),
565 // Timer_D_initHighResGeneratorInRegulatedMode(), and
566 // Timer_D_combineTDCCRToOutputPWM().
567 //
568 //*****************************************************************************
569 #define TIMER_D_CLOCKSOURCE_EXTERNAL_TDCLK TDSSEL__TACLK
570 #define TIMER_D_CLOCKSOURCE_ACLK TDSSEL__ACLK
571 #define TIMER_D_CLOCKSOURCE_SMCLK TDSSEL__SMCLK
572 #define TIMER_D_CLOCKSOURCE_INVERTED_EXTERNAL_TDCLK TDSSEL__INCLK
573 
574 //*****************************************************************************
575 //
576 // The following are values that can be passed to the param parameter for
577 // functions: Timer_D_initContinuousMode(), Timer_D_initUpMode(),
578 // Timer_D_initUpDownMode(), Timer_D_outputPWM(),
579 // Timer_D_initHighResGeneratorInRegulatedMode(), and
580 // Timer_D_combineTDCCRToOutputPWM().
581 //
582 //*****************************************************************************
583 #define TIMER_D_CLOCKINGMODE_EXTERNAL_CLOCK TDCLKM_0
584 #define TIMER_D_CLOCKINGMODE_HIRES_LOCAL_CLOCK TDCLKM_1
585 #define TIMER_D_CLOCKINGMODE_AUXILIARY_CLK TDCLKM_2
586 
587 //*****************************************************************************
588 //
589 // The following are values that can be passed to the param parameter for
590 // functions: Timer_D_initContinuousMode(), Timer_D_initUpMode(), and
591 // Timer_D_initUpDownMode().
592 //
593 //*****************************************************************************
594 #define TIMER_D_TDIE_INTERRUPT_ENABLE TDIE
595 #define TIMER_D_TDIE_INTERRUPT_DISABLE 0x00
596 
597 //*****************************************************************************
598 //
599 // The following are values that can be passed to the param parameter for
600 // functions: Timer_D_initCaptureMode().
601 //
602 //*****************************************************************************
603 #define TIMER_D_CAPTURE_INTERRUPT_ENABLE TDIE
604 #define TIMER_D_CAPTURE_INTERRUPT_DISABLE 0x00
605 
606 //*****************************************************************************
607 //
608 // The following are values that can be passed to the param parameter for
609 // functions: Timer_D_initUpMode(), and Timer_D_initUpDownMode().
610 //
611 //*****************************************************************************
612 #define TIMER_D_CCIE_CCR0_INTERRUPT_ENABLE CCIE
613 #define TIMER_D_CCIE_CCR0_INTERRUPT_DISABLE 0x00
614 
615 //*****************************************************************************
616 //
617 // The following are values that can be passed to the param parameter for
618 // functions: Timer_D_initCaptureMode().
619 //
620 //*****************************************************************************
621 #define TIMER_D_SINGLE_CAPTURE_MODE 0x00
622 #define TIMER_D_DUAL_CAPTURE_MODE 0x01
623 
624 //*****************************************************************************
625 //
626 // The following are values that can be passed to the param parameter for
627 // functions: Timer_D_initCaptureMode().
628 //
629 //*****************************************************************************
630 #define TIMER_D_CAPTURE_INPUTSELECT_CCIxA CCIS_0
631 #define TIMER_D_CAPTURE_INPUTSELECT_CCIxB CCIS_1
632 #define TIMER_D_CAPTURE_INPUTSELECT_GND CCIS_2
633 #define TIMER_D_CAPTURE_INPUTSELECT_Vcc CCIS_3
634 
635 //*****************************************************************************
636 //
637 // The following are values that can be passed to the compareOutputMode
638 // parameter for functions: Timer_D_setOutputMode(); the param parameter for
639 // functions: Timer_D_initCaptureMode(), Timer_D_initCompareMode(),
640 // Timer_D_outputPWM(), and Timer_D_combineTDCCRToOutputPWM().
641 //
642 //*****************************************************************************
643 #define TIMER_D_OUTPUTMODE_OUTBITVALUE OUTMOD_0
644 #define TIMER_D_OUTPUTMODE_SET OUTMOD_1
645 #define TIMER_D_OUTPUTMODE_TOGGLE_RESET OUTMOD_2
646 #define TIMER_D_OUTPUTMODE_SET_RESET OUTMOD_3
647 #define TIMER_D_OUTPUTMODE_TOGGLE OUTMOD_4
648 #define TIMER_D_OUTPUTMODE_RESET OUTMOD_5
649 #define TIMER_D_OUTPUTMODE_TOGGLE_SET OUTMOD_6
650 #define TIMER_D_OUTPUTMODE_RESET_SET OUTMOD_7
651 
652 //*****************************************************************************
653 //
654 // The following are values that can be passed to the compareRegister parameter
655 // for functions: Timer_D_setCompareValue(),
656 // Timer_D_initCompareLatchLoadEvent(), and Timer_D_setOutputMode(); the
657 // captureCompareRegister parameter for functions:
658 // Timer_D_enableCaptureCompareInterrupt(),
659 // Timer_D_disableCaptureCompareInterrupt(),
660 // Timer_D_getCaptureCompareInterruptStatus(),
661 // Timer_D_getSynchronizedCaptureCompareInput(),
662 // Timer_D_getOutputForOutputModeOutBitValue(),
663 // Timer_D_getCaptureCompareCount(), Timer_D_getCaptureCompareLatchCount(),
664 // Timer_D_getCaptureCompareInputSignal(),
665 // Timer_D_setOutputForOutputModeOutBitValue(), and
666 // Timer_D_clearCaptureCompareInterrupt(); the param parameter for functions:
667 // Timer_D_initCaptureMode(), Timer_D_outputPWM(), and
668 // Timer_D_initCompareMode().
669 //
670 //*****************************************************************************
671 #define TIMER_D_CAPTURECOMPARE_REGISTER_0 0x08
672 #define TIMER_D_CAPTURECOMPARE_REGISTER_1 0x0E
673 #define TIMER_D_CAPTURECOMPARE_REGISTER_2 0x14
674 #define TIMER_D_CAPTURECOMPARE_REGISTER_3 0x1A
675 #define TIMER_D_CAPTURECOMPARE_REGISTER_4 0x20
676 #define TIMER_D_CAPTURECOMPARE_REGISTER_5 0x28
677 #define TIMER_D_CAPTURECOMPARE_REGISTER_6 0x2E
678 
679 //*****************************************************************************
680 //
681 // The following are values that can be passed to the param parameter for
682 // functions: Timer_D_initCaptureMode().
683 //
684 //*****************************************************************************
685 #define TIMER_D_CAPTUREMODE_NO_CAPTURE CM_0
686 #define TIMER_D_CAPTUREMODE_RISING_EDGE CM_1
687 #define TIMER_D_CAPTUREMODE_FALLING_EDGE CM_2
688 #define TIMER_D_CAPTUREMODE_RISING_AND_FALLING_EDGE CM_3
689 
690 //*****************************************************************************
691 //
692 // The following are values that can be passed to the param parameter for
693 // functions: Timer_D_initCaptureMode().
694 //
695 //*****************************************************************************
696 #define TIMER_D_CAPTURE_ASYNCHRONOUS 0x00
697 #define TIMER_D_CAPTURE_SYNCHRONOUS SCS
698 
699 //*****************************************************************************
700 //
701 // The following are values that can be passed to the param parameter for
702 // functions: Timer_D_initCompareMode().
703 //
704 //*****************************************************************************
705 #define TIMER_D_CAPTURECOMPARE_INTERRUPT_ENABLE CCIE
706 #define TIMER_D_CAPTURECOMPARE_INTERRUPT_DISABLE 0x00
707 
708 //*****************************************************************************
709 //
710 // The following are values that can be passed to the mask parameter for
711 // functions: Timer_D_enableHighResInterrupt(),
712 // Timer_D_disableHighResInterrupt(), Timer_D_getHighResInterruptStatus(), and
713 // Timer_D_clearHighResInterrupt() as well as returned by the
714 // Timer_D_getHighResInterruptStatus() function.
715 //
716 //*****************************************************************************
717 #define TIMER_D_HIGH_RES_FREQUENCY_UNLOCK TDHUNLKIE
718 #define TIMER_D_HIGH_RES_FREQUENCY_LOCK TDHLKIE
719 #define TIMER_D_HIGH_RES_FAIL_HIGH TDHFHIE
720 #define TIMER_D_HIGH_RES_FAIL_LOW TDHFLIE
721 
722 //*****************************************************************************
723 //
724 // The following are values that can be passed to the mask parameter for
725 // functions: Timer_D_getCaptureCompareInterruptStatus() as well as returned by
726 // the Timer_D_getCaptureCompareInterruptStatus() function.
727 //
728 //*****************************************************************************
729 #define TIMER_D_CAPTURE_OVERFLOW COV
730 #define TIMER_D_CAPTURECOMPARE_INTERRUPT_FLAG CCIFG
731 
732 //*****************************************************************************
733 //
734 // The following are values that can be passed to the synchronized parameter
735 // for functions: Timer_D_getSynchronizedCaptureCompareInput().
736 //
737 //*****************************************************************************
738 #define TIMER_D_READ_SYNCHRONIZED_CAPTURECOMPAREINPUT SCCI
739 #define TIMER_D_READ_CAPTURE_COMPARE_INPUT CCI
740 
741 //*****************************************************************************
742 //
743 // The following are values that can be passed to the outputModeOutBitValue
744 // parameter for functions: Timer_D_setOutputForOutputModeOutBitValue() as well
745 // as returned by the Timer_D_getOutputForOutputModeOutBitValue() function.
746 //
747 //*****************************************************************************
748 #define TIMER_D_OUTPUTMODE_OUTBITVALUE_HIGH OUT
749 #define TIMER_D_OUTPUTMODE_OUTBITVALUE_LOW 0x00
750 
751 //*****************************************************************************
752 //
753 // The following are values that can be passed to the desiredHighResFrequency
754 // parameter for functions: Timer_D_initHighResGeneratorInFreeRunningMode().
755 //
756 //*****************************************************************************
757 #define TIMER_D_HIGHRES_64MHZ 0x00
758 #define TIMER_D_HIGHRES_128MHZ 0x01
759 #define TIMER_D_HIGHRES_200MHZ 0x02
760 #define TIMER_D_HIGHRES_256MHZ 0x03
761 
762 //*****************************************************************************
763 //
764 // The following are values that can be passed to the param parameter for
765 // functions: Timer_D_initHighResGeneratorInRegulatedMode().
766 //
767 //*****************************************************************************
768 #define TIMER_D_HIGHRES_CLK_DIVIDER_1 TDHD__1
769 #define TIMER_D_HIGHRES_CLK_DIVIDER_2 TDHD__2
770 #define TIMER_D_HIGHRES_CLK_DIVIDER_4 TDHD__4
771 #define TIMER_D_HIGHRES_CLK_DIVIDER_8 TDHD__8
772 
773 //*****************************************************************************
774 //
775 // The following are values that can be passed to the param parameter for
776 // functions: Timer_D_initHighResGeneratorInRegulatedMode().
777 //
778 //*****************************************************************************
779 #define TIMER_D_HIGHRES_CLK_MULTIPLY_FACTOR_8x TDHM_0
780 #define TIMER_D_HIGHRES_CLK_MULTIPLY_FACTOR_16x TDHM_1
781 
782 //*****************************************************************************
783 //
784 // The following are values that can be passed to the param parameter for
785 // functions: Timer_D_combineTDCCRToOutputPWM().
786 //
787 //*****************************************************************************
788 #define TIMER_D_COMBINE_CCR1_CCR2 2
789 #define TIMER_D_COMBINE_CCR3_CCR4 4
790 #define TIMER_D_COMBINE_CCR5_CCR6 6
791 
792 //*****************************************************************************
793 //
794 // The following are values that can be passed to the groupLatch parameter for
795 // functions: Timer_D_selectLatchingGroup().
796 //
797 //*****************************************************************************
798 #define TIMER_D_GROUP_NONE TDCLGRP_0
799 #define TIMER_D_GROUP_CL12_CL23_CL56 TDCLGRP_1
800 #define TIMER_D_GROUP_CL123_CL456 TDCLGRP_2
801 #define TIMER_D_GROUP_ALL TDCLGRP_3
802 
803 //*****************************************************************************
804 //
805 // The following are values that can be passed to the counterLength parameter
806 // for functions: Timer_D_selectCounterLength().
807 //
808 //*****************************************************************************
809 #define TIMER_D_COUNTER_16BIT CNTL_0
810 #define TIMER_D_COUNTER_12BIT CNTL_1
811 #define TIMER_D_COUNTER_10BIT CNTL_2
812 #define TIMER_D_COUNTER_8BIT CNTL_3
813 
814 //*****************************************************************************
815 //
816 // The following are values that can be passed to the compareLatchLoadEvent
817 // parameter for functions: Timer_D_initCompareLatchLoadEvent().
818 //
819 //*****************************************************************************
820 #define TIMER_D_LATCH_ON_WRITE_TO_TDxCCRn_COMPARE_REGISTER CLLD_0
821 #define TIMER_D_LATCH_WHEN_COUNTER_COUNTS_TO_0_IN_UP_OR_CONT_MODE CLLD_1
822 #define TIMER_D_LATCH_WHEN_COUNTER_COUNTS_TO_0_IN_UPDOWN_MODE CLLD_2
823 #define TIMER_D_LATCH_WHEN_COUNTER_COUNTS_TO_CURRENT_COMPARE_LATCH_VALUE CLLD_3
824 
825 //*****************************************************************************
826 //
827 // The following are values that can be passed to the highResCoarseClockRange
828 // parameter for functions: Timer_D_selectHighResCoarseClockRange().
829 //
830 //*****************************************************************************
831 #define TIMER_D_HIGHRES_BELOW_15MHz 0x00
832 #define TIMER_D_HIGHRES_ABOVE_15MHz TDHCLKCR
833 
834 //*****************************************************************************
835 //
836 // The following are values that can be passed to the highResClockRange
837 // parameter for functions: Timer_D_selectHighResClockRange().
838 //
839 //*****************************************************************************
840 #define TIMER_D_CLOCK_RANGE0 0x0000
841 #define TIMER_D_CLOCK_RANGE1 0x2000
842 #define TIMER_D_CLOCK_RANGE2 0x4000
843 
844 //*****************************************************************************
845 //
846 // The following are values that can be passed toThe following are values that
847 // can be returned by the Timer_D_getSynchronizedCaptureCompareInput()
848 // function.
849 //
850 //*****************************************************************************
851 #define TIMER_D_CAPTURECOMPARE_INPUT_HIGH 0x01
852 #define TIMER_D_CAPTURECOMPARE_INPUT_LOW 0x00
853 
854 //*****************************************************************************
855 //
856 // The following are values that can be passed toThe following are values that
857 // can be returned by the Timer_D_getTimerInterruptStatus() function.
858 //
859 //*****************************************************************************
860 #define TIMER_D_INTERRUPT_NOT_PENDING 0x00
861 #define TIMER_D_INTERRUPT_PENDING 0x01
862 
863 //*****************************************************************************
864 //
865 // The following are values that can be passed toThe following are values that
866 // can be returned by the Timer_D_getCaptureCompareInputSignal() function.
867 //
868 //*****************************************************************************
869 #define TIMER_D_CAPTURECOMPARE_INPUT CCI
870 
871 //*****************************************************************************
872 //
873 // Prototypes for the APIs.
874 //
875 //*****************************************************************************
876 
877 //*****************************************************************************
878 //
879 //! \brief Starts Timer_D counter
880 //!
881 //! NOTE: This function assumes that the timer has been previously configured
882 //! using Timer_D_initContinuousMode, Timer_D_initUpMode or
883 //! Timer_D_initUpDownMode.
884 //!
885 //! \param baseAddress is the base address of the TIMER_DA module.
886 //! \param timerMode selects the mode of the timer
887 //! Valid values are:
888 //! - \b TIMER_D_STOP_MODE
889 //! - \b TIMER_D_UP_MODE
890 //! - \b TIMER_D_CONTINUOUS_MODE [Default]
891 //! - \b TIMER_D_UPDOWN_MODE
892 //!
893 //! Modified bits of \b TDxCTL0 register.
894 //!
895 //! \return None
896 //
897 //*****************************************************************************
898 extern void Timer_D_startCounter(uint16_t baseAddress,
899  uint16_t timerMode);
900 
901 //*****************************************************************************
902 //
903 //! \brief Configures timer in continuous mode.
904 //!
905 //! This API does not start the timer. Timer needs to be started when required
906 //! using the Timer_D_start API.
907 //!
908 //! \param baseAddress is the base address of the TIMER_D module.
909 //! \param param is the pointer to struct for continuous mode initialization.
910 //!
911 //! Modified bits of \b TDxCTL0 register and bits of \b TDxCTL1 register.
912 //!
913 //! \return None
914 //
915 //*****************************************************************************
916 extern void Timer_D_initContinuousMode(uint16_t baseAddress,
918 
919 //*****************************************************************************
920 //
921 //! \brief Configures timer in up mode.
922 //!
923 //! This API does not start the timer. Timer needs to be started when required
924 //! using the Timer_D_start API.
925 //!
926 //! \param baseAddress is the base address of the TIMER_D module.
927 //! \param param is the pointer to struct for up mode initialization.
928 //!
929 //! Modified bits of \b TDxCCR0 register, bits of \b TDxCCTL0 register, bits of
930 //! \b TDxCTL0 register and bits of \b TDxCTL1 register.
931 //!
932 //! \return None
933 //
934 //*****************************************************************************
935 extern void Timer_D_initUpMode(uint16_t baseAddress,
936  Timer_D_initUpModeParam *param);
937 
938 //*****************************************************************************
939 //
940 //! \brief Configures timer in up down mode.
941 //!
942 //! This API does not start the timer. Timer needs to be started when required
943 //! using the Timer_D_start API.
944 //!
945 //! \param baseAddress is the base address of the TIMER_D module.
946 //! \param param is the pointer to struct for up-down mode initialization.
947 //!
948 //! Modified bits of \b TDxCCR0 register, bits of \b TDxCCTL0 register, bits of
949 //! \b TDxCTL0 register and bits of \b TDxCTL1 register.
950 //!
951 //! \return None
952 //
953 //*****************************************************************************
954 extern void Timer_D_initUpDownMode(uint16_t baseAddress,
956 
957 //*****************************************************************************
958 //
959 //! \brief Initializes Capture Mode
960 //!
961 //! \param baseAddress is the base address of the TIMER_D module.
962 //! \param param is the pointer to struct for capture mode initialization.
963 //!
964 //! Modified bits of \b TDxCCTLn register and bits of \b TDxCTL2 register.
965 //!
966 //! \return None
967 //
968 //*****************************************************************************
969 extern void Timer_D_initCaptureMode(uint16_t baseAddress,
971 
972 //*****************************************************************************
973 //
974 //! \brief Initializes Compare Mode
975 //!
976 //! \param baseAddress is the base address of the TIMER_D module.
977 //! \param param is the pointer to struct for compare mode initialization.
978 //!
979 //! Modified bits of \b TDxCCTLn register and bits of \b TDxCCRn register.
980 //!
981 //! \return None
982 //
983 //*****************************************************************************
984 extern void Timer_D_initCompareMode(uint16_t baseAddress,
986 
987 //*****************************************************************************
988 //
989 //! \brief Enable timer interrupt
990 //!
991 //! \param baseAddress is the base address of the TIMER_D module.
992 //!
993 //! Modified bits of \b TDxCTL0 register.
994 //!
995 //! \return None
996 //
997 //*****************************************************************************
998 extern void Timer_D_enableTimerInterrupt(uint16_t baseAddress);
999 
1000 //*****************************************************************************
1001 //
1002 //! \brief Enable High Resolution interrupt
1003 //!
1004 //! \param baseAddress is the base address of the TIMER_D module.
1005 //! \param mask is the mask of interrupts to enable
1006 //! Mask value is the logical OR of any of the following:
1007 //! - \b TIMER_D_HIGH_RES_FREQUENCY_UNLOCK
1008 //! - \b TIMER_D_HIGH_RES_FREQUENCY_LOCK
1009 //! - \b TIMER_D_HIGH_RES_FAIL_HIGH
1010 //! - \b TIMER_D_HIGH_RES_FAIL_LOW
1011 //!
1012 //! Modified bits of \b TDxHINT register.
1013 //!
1014 //! \return None
1015 //
1016 //*****************************************************************************
1017 extern void Timer_D_enableHighResInterrupt(uint16_t baseAddress,
1018  uint16_t mask);
1019 
1020 //*****************************************************************************
1021 //
1022 //! \brief Disable timer interrupt
1023 //!
1024 //! \param baseAddress is the base address of the TIMER_D module.
1025 //!
1026 //! Modified bits of \b TDxCTL0 register.
1027 //!
1028 //! \return None
1029 //
1030 //*****************************************************************************
1031 extern void Timer_D_disableTimerInterrupt(uint16_t baseAddress);
1032 
1033 //*****************************************************************************
1034 //
1035 //! \brief Disable High Resolution interrupt
1036 //!
1037 //! \param baseAddress is the base address of the TIMER_D module.
1038 //! \param mask is the mask of interrupts to disable
1039 //! Mask value is the logical OR of any of the following:
1040 //! - \b TIMER_D_HIGH_RES_FREQUENCY_UNLOCK
1041 //! - \b TIMER_D_HIGH_RES_FREQUENCY_LOCK
1042 //! - \b TIMER_D_HIGH_RES_FAIL_HIGH
1043 //! - \b TIMER_D_HIGH_RES_FAIL_LOW
1044 //!
1045 //! Modified bits of \b TDxHINT register.
1046 //!
1047 //! \return None
1048 //
1049 //*****************************************************************************
1050 extern void Timer_D_disableHighResInterrupt(uint16_t baseAddress,
1051  uint16_t mask);
1052 
1053 //*****************************************************************************
1054 //
1055 //! \brief Get timer interrupt status
1056 //!
1057 //! \param baseAddress is the base address of the TIMER_D module.
1058 //!
1059 //! \return One of the following:
1060 //! - \b TIMER_D_INTERRUPT_NOT_PENDING
1061 //! - \b TIMER_D_INTERRUPT_PENDING
1062 //! \n indicating the timer interrupt status
1063 //
1064 //*****************************************************************************
1065 extern uint32_t Timer_D_getTimerInterruptStatus(uint16_t baseAddress);
1066 
1067 //*****************************************************************************
1068 //
1069 //! \brief Enable capture compare interrupt
1070 //!
1071 //! \param baseAddress is the base address of the TIMER_D module.
1072 //! \param captureCompareRegister is the selected capture compare register
1073 //! Valid values are:
1074 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_0
1075 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_1
1076 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_2
1077 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_3
1078 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_4
1079 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_5
1080 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_6
1081 //!
1082 //! Modified bits of \b TDxCCTLn register.
1083 //!
1084 //! \return None
1085 //
1086 //*****************************************************************************
1087 extern void Timer_D_enableCaptureCompareInterrupt(uint16_t baseAddress,
1088  uint16_t captureCompareRegister);
1089 
1090 //*****************************************************************************
1091 //
1092 //! \brief Disable capture compare interrupt
1093 //!
1094 //! \param baseAddress is the base address of the TIMER_D module.
1095 //! \param captureCompareRegister is the selected capture compare register
1096 //! Valid values are:
1097 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_0
1098 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_1
1099 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_2
1100 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_3
1101 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_4
1102 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_5
1103 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_6
1104 //!
1105 //! Modified bits of \b TDxCCTLn register.
1106 //!
1107 //! \return None
1108 //
1109 //*****************************************************************************
1110 extern void Timer_D_disableCaptureCompareInterrupt(uint16_t baseAddress,
1111  uint16_t captureCompareRegister);
1112 
1113 //*****************************************************************************
1114 //
1115 //! \brief Return capture compare interrupt status
1116 //!
1117 //! \param baseAddress is the base address of the TIMER_D module.
1118 //! \param captureCompareRegister is the selected capture compare register
1119 //! Valid values are:
1120 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_0
1121 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_1
1122 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_2
1123 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_3
1124 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_4
1125 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_5
1126 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_6
1127 //! \param mask is the mask for the interrupt status
1128 //! Mask value is the logical OR of any of the following:
1129 //! - \b TIMER_D_CAPTURE_OVERFLOW
1130 //! - \b TIMER_D_CAPTURECOMPARE_INTERRUPT_FLAG
1131 //!
1132 //! \return Logical OR of any of the following:
1133 //! - \b TIMER_D_CAPTURE_OVERFLOW
1134 //! - \b TIMER_D_CAPTURECOMPARE_INTERRUPT_FLAG
1135 //! \n indicating the status of the masked flags
1136 //
1137 //*****************************************************************************
1138 extern uint32_t Timer_D_getCaptureCompareInterruptStatus(uint16_t baseAddress,
1139  uint16_t captureCompareRegister,
1140  uint16_t mask);
1141 
1142 //*****************************************************************************
1143 //
1144 //! \brief Returns High Resolution interrupt status
1145 //!
1146 //! \param baseAddress is the base address of the TIMER_D module.
1147 //! \param mask is the mask for the interrupt status
1148 //! Mask value is the logical OR of any of the following:
1149 //! - \b TIMER_D_HIGH_RES_FREQUENCY_UNLOCK
1150 //! - \b TIMER_D_HIGH_RES_FREQUENCY_LOCK
1151 //! - \b TIMER_D_HIGH_RES_FAIL_HIGH
1152 //! - \b TIMER_D_HIGH_RES_FAIL_LOW
1153 //!
1154 //! Modified bits of \b TDxHINT register.
1155 //!
1156 //! \return Logical OR of any of the following:
1157 //! - \b TIMER_D_HIGH_RES_FREQUENCY_UNLOCK
1158 //! - \b TIMER_D_HIGH_RES_FREQUENCY_LOCK
1159 //! - \b TIMER_D_HIGH_RES_FAIL_HIGH
1160 //! - \b TIMER_D_HIGH_RES_FAIL_LOW
1161 //! \n indicating the status of the masked interrupts
1162 //
1163 //*****************************************************************************
1164 extern uint16_t Timer_D_getHighResInterruptStatus(uint16_t baseAddress,
1165  uint16_t mask);
1166 
1167 //*****************************************************************************
1168 //
1169 //! \brief Reset/Clear the timer clock divider, count direction, count
1170 //!
1171 //! \param baseAddress is the base address of the TIMER_D module.
1172 //!
1173 //! Modified bits of \b TDxCTL0 register.
1174 //!
1175 //! \return None
1176 //
1177 //*****************************************************************************
1178 extern void Timer_D_clear(uint16_t baseAddress);
1179 
1180 //*****************************************************************************
1181 //
1182 //! \brief Clears High Resolution interrupt status
1183 //!
1184 //! \param baseAddress is the base address of the TIMER_D module.
1185 //! \param mask is the mask for the interrupts to clear
1186 //! Mask value is the logical OR of any of the following:
1187 //! - \b TIMER_D_HIGH_RES_FREQUENCY_UNLOCK
1188 //! - \b TIMER_D_HIGH_RES_FREQUENCY_LOCK
1189 //! - \b TIMER_D_HIGH_RES_FAIL_HIGH
1190 //! - \b TIMER_D_HIGH_RES_FAIL_LOW
1191 //!
1192 //! Modified bits of \b TDxHINT register.
1193 //!
1194 //! \return None
1195 //
1196 //*****************************************************************************
1197 extern void Timer_D_clearHighResInterrupt(uint16_t baseAddress,
1198  uint16_t mask);
1199 
1200 //*****************************************************************************
1201 //
1202 //! \brief Get synchronized capturecompare input
1203 //!
1204 //! \param baseAddress is the base address of the TIMER_D module.
1205 //! \param captureCompareRegister selects the Capture register being used.
1206 //! Valid values are:
1207 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_0
1208 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_1
1209 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_2
1210 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_3
1211 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_4
1212 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_5
1213 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_6
1214 //! \param synchronized is to select type of capture compare input.
1215 //! Valid values are:
1216 //! - \b TIMER_D_READ_SYNCHRONIZED_CAPTURECOMPAREINPUT
1217 //! - \b TIMER_D_READ_CAPTURE_COMPARE_INPUT
1218 //!
1219 //! \return One of the following:
1220 //! - \b TIMER_D_CAPTURECOMPARE_INPUT_HIGH
1221 //! - \b TIMER_D_CAPTURECOMPARE_INPUT_LOW
1222 //
1223 //*****************************************************************************
1224 extern uint8_t Timer_D_getSynchronizedCaptureCompareInput(uint16_t baseAddress,
1225  uint16_t captureCompareRegister,
1226  uint16_t synchronized);
1227 
1228 //*****************************************************************************
1229 //
1230 //! \brief Get output bit for output mode
1231 //!
1232 //! \param baseAddress is the base address of the TIMER_D module.
1233 //! \param captureCompareRegister selects the Capture register being used.
1234 //! Valid values are:
1235 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_0
1236 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_1
1237 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_2
1238 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_3
1239 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_4
1240 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_5
1241 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_6
1242 //!
1243 //! \return One of the following:
1244 //! - \b TIMER_D_OUTPUTMODE_OUTBITVALUE_HIGH
1245 //! - \b TIMER_D_OUTPUTMODE_OUTBITVALUE_LOW
1246 //
1247 //*****************************************************************************
1248 extern uint8_t Timer_D_getOutputForOutputModeOutBitValue(uint16_t baseAddress,
1249  uint16_t captureCompareRegister);
1250 
1251 //*****************************************************************************
1252 //
1253 //! \brief Get current capturecompare count
1254 //!
1255 //! \param baseAddress is the base address of the TIMER_D module.
1256 //! \param captureCompareRegister selects the Capture register being used.
1257 //! Valid values are:
1258 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_0
1259 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_1
1260 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_2
1261 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_3
1262 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_4
1263 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_5
1264 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_6
1265 //!
1266 //! \return current count as uint16_t
1267 //
1268 //*****************************************************************************
1269 extern uint16_t Timer_D_getCaptureCompareCount(uint16_t baseAddress,
1270  uint16_t captureCompareRegister);
1271 
1272 //*****************************************************************************
1273 //
1274 //! \brief Get current capture compare latch register count
1275 //!
1276 //! \param baseAddress is the base address of the TIMER_D module.
1277 //! \param captureCompareRegister selects the Capture register being used.
1278 //! Valid values are:
1279 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_0
1280 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_1
1281 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_2
1282 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_3
1283 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_4
1284 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_5
1285 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_6
1286 //!
1287 //! \return current count as uint16_t
1288 //
1289 //*****************************************************************************
1290 extern uint16_t Timer_D_getCaptureCompareLatchCount(uint16_t baseAddress,
1291  uint16_t captureCompareRegister);
1292 
1293 //*****************************************************************************
1294 //
1295 //! \brief Get current capturecompare input signal
1296 //!
1297 //! \param baseAddress is the base address of the TIMER_D module.
1298 //! \param captureCompareRegister selects the Capture register being used.
1299 //! Valid values are:
1300 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_0
1301 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_1
1302 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_2
1303 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_3
1304 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_4
1305 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_5
1306 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_6
1307 //!
1308 //! \return One of the following:
1309 //! - \b TIMER_D_CAPTURECOMPARE_INPUT
1310 //! - \b 0x00
1311 //! \n indicating the current input signal
1312 //
1313 //*****************************************************************************
1314 extern uint8_t Timer_D_getCaptureCompareInputSignal(uint16_t baseAddress,
1315  uint16_t captureCompareRegister);
1316 
1317 //*****************************************************************************
1318 //
1319 //! \brief Set output bit for output mode
1320 //!
1321 //! \param baseAddress is the base address of the TIMER_D module.
1322 //! \param captureCompareRegister selects the Capture register being used.
1323 //! Valid values are:
1324 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_0
1325 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_1
1326 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_2
1327 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_3
1328 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_4
1329 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_5
1330 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_6
1331 //! \param outputModeOutBitValue the value to be set for out bit
1332 //! Valid values are:
1333 //! - \b TIMER_D_OUTPUTMODE_OUTBITVALUE_HIGH
1334 //! - \b TIMER_D_OUTPUTMODE_OUTBITVALUE_LOW
1335 //!
1336 //! Modified bits of \b TDxCCTLn register.
1337 //!
1338 //! \return None
1339 //
1340 //*****************************************************************************
1341 extern void Timer_D_setOutputForOutputModeOutBitValue(uint16_t baseAddress,
1342  uint16_t captureCompareRegister,
1343  uint8_t outputModeOutBitValue);
1344 
1345 //*****************************************************************************
1346 //
1347 //! \brief Generate a PWM with timer running in up mode
1348 //!
1349 //! \param baseAddress is the base address of the TIMER_D module.
1350 //! \param param is the pointer to struct for PWM configuration.
1351 //!
1352 //! Modified bits of \b TDxCCTLn register, bits of \b TDxCCR0 register, bits of
1353 //! \b TDxCCTL0 register, bits of \b TDxCTL0 register and bits of \b TDxCTL1
1354 //! register.
1355 //!
1356 //! \return None
1357 //
1358 //*****************************************************************************
1359 extern void Timer_D_outputPWM(uint16_t baseAddress,
1360  Timer_D_outputPWMParam *param);
1361 
1362 //*****************************************************************************
1363 //
1364 //! \brief Stops the timer
1365 //!
1366 //! \param baseAddress is the base address of the TIMER_D module.
1367 //!
1368 //! Modified bits of \b TDxCTL0 register.
1369 //!
1370 //! \return None
1371 //
1372 //*****************************************************************************
1373 extern void Timer_D_stop(uint16_t baseAddress);
1374 
1375 //*****************************************************************************
1376 //
1377 //! \brief Sets the value of the capture-compare register
1378 //!
1379 //! \param baseAddress is the base address of the TIMER_D module.
1380 //! \param compareRegister selects the Capture register being used.
1381 //! Valid values are:
1382 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_0
1383 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_1
1384 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_2
1385 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_3
1386 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_4
1387 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_5
1388 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_6
1389 //! \param compareValue is the count to be compared with in compare mode
1390 //!
1391 //! Modified bits of \b TDxCCRn register.
1392 //!
1393 //! \return None
1394 //
1395 //*****************************************************************************
1396 extern void Timer_D_setCompareValue(uint16_t baseAddress,
1397  uint16_t compareRegister,
1398  uint16_t compareValue);
1399 
1400 //*****************************************************************************
1401 //
1402 //! \brief Clears the Timer TDIFG interrupt flag
1403 //!
1404 //! \param baseAddress is the base address of the TIMER_D module.
1405 //!
1406 //! Modified bits are \b TDIFG of \b TDxCTL0 register.
1407 //!
1408 //! \return None
1409 //
1410 //*****************************************************************************
1411 extern void Timer_D_clearTimerInterrupt(uint16_t baseAddress);
1412 
1413 //*****************************************************************************
1414 //
1415 //! \brief Clears the capture-compare interrupt flag
1416 //!
1417 //! \param baseAddress is the base address of the TIMER_D module.
1418 //! \param captureCompareRegister selects the Capture-compare register being
1419 //! used.
1420 //! Valid values are:
1421 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_0
1422 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_1
1423 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_2
1424 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_3
1425 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_4
1426 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_5
1427 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_6
1428 //!
1429 //! Modified bits are \b CCIFG of \b TDxCCTLn register.
1430 //!
1431 //! \return None
1432 //
1433 //*****************************************************************************
1434 extern void Timer_D_clearCaptureCompareInterrupt(uint16_t baseAddress,
1435  uint16_t captureCompareRegister);
1436 
1437 //*****************************************************************************
1438 //
1439 //! \brief Configures Timer_D in free running mode
1440 //!
1441 //! \param baseAddress is the base address of the TIMER_D module.
1442 //! \param desiredHighResFrequency selects the desired High Resolution
1443 //! frequency used.
1444 //! Valid values are:
1445 //! - \b TIMER_D_HIGHRES_64MHZ
1446 //! - \b TIMER_D_HIGHRES_128MHZ
1447 //! - \b TIMER_D_HIGHRES_200MHZ
1448 //! - \b TIMER_D_HIGHRES_256MHZ
1449 //!
1450 //! Modified bits of \b TDxHCTL1 register, bits of \b TDxHCTL0 register and
1451 //! bits of \b TDxCTL1 register.
1452 //!
1453 //! \return STATUS_SUCCESS or STATUS_FAIL
1454 //
1455 //*****************************************************************************
1456 extern uint8_t Timer_D_initHighResGeneratorInFreeRunningMode(uint16_t baseAddress,
1457  uint8_t desiredHighResFrequency);
1458 
1459 //*****************************************************************************
1460 //
1461 //! \brief Configures Timer_D in Regulated mode
1462 //!
1463 //! \param baseAddress is the base address of the TIMER_D module.
1464 //! \param param is the pointer to struct for high resolution generator in
1465 //! regulated mode.
1466 //!
1467 //! Modified bits of \b TDxHCTL0 register, bits of \b TDxCTL0 register and bits
1468 //! of \b TDxCTL1 register.
1469 //!
1470 //! \return None
1471 //
1472 //*****************************************************************************
1473 extern void Timer_D_initHighResGeneratorInRegulatedMode(uint16_t baseAddress,
1475 
1476 //*****************************************************************************
1477 //
1478 //! \brief Combine TDCCR to get PWM
1479 //!
1480 //! \param baseAddress is the base address of the TIMER_D module.
1481 //! \param param is the pointer to struct for PWM generation using two CCRs.
1482 //!
1483 //! Modified bits of \b TDxCCTLn register, bits of \b TDxCCR0 register, bits of
1484 //! \b TDxCCTL0 register, bits of \b TDxCTL0 register and bits of \b TDxCTL1
1485 //! register.
1486 //!
1487 //! \return None
1488 //
1489 //*****************************************************************************
1490 extern void Timer_D_combineTDCCRToOutputPWM(uint16_t baseAddress,
1492 
1493 //*****************************************************************************
1494 //
1495 //! \brief Selects Timer_D Latching Group
1496 //!
1497 //! \param baseAddress is the base address of the TIMER_D module.
1498 //! \param groupLatch selects the group latch
1499 //! Valid values are:
1500 //! - \b TIMER_D_GROUP_NONE [Default]
1501 //! - \b TIMER_D_GROUP_CL12_CL23_CL56
1502 //! - \b TIMER_D_GROUP_CL123_CL456
1503 //! - \b TIMER_D_GROUP_ALL
1504 //!
1505 //! Modified bits are \b TDCLGRP of \b TDxCTL0 register.
1506 //!
1507 //! \return None
1508 //
1509 //*****************************************************************************
1510 extern void Timer_D_selectLatchingGroup(uint16_t baseAddress,
1511  uint16_t groupLatch);
1512 
1513 //*****************************************************************************
1514 //
1515 //! \brief Selects Timer_D counter length
1516 //!
1517 //! \param baseAddress is the base address of the TIMER_D module.
1518 //! \param counterLength selects the value of counter length.
1519 //! Valid values are:
1520 //! - \b TIMER_D_COUNTER_16BIT [Default]
1521 //! - \b TIMER_D_COUNTER_12BIT
1522 //! - \b TIMER_D_COUNTER_10BIT
1523 //! - \b TIMER_D_COUNTER_8BIT
1524 //!
1525 //! Modified bits are \b CNTL of \b TDxCTL0 register.
1526 //!
1527 //! \return None
1528 //
1529 //*****************************************************************************
1530 extern void Timer_D_selectCounterLength(uint16_t baseAddress,
1531  uint16_t counterLength);
1532 
1533 //*****************************************************************************
1534 //
1535 //! \brief Selects Compare Latch Load Event
1536 //!
1537 //! \param baseAddress is the base address of the TIMER_D module.
1538 //! \param compareRegister selects the compare register being used.
1539 //! Valid values are:
1540 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_0
1541 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_1
1542 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_2
1543 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_3
1544 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_4
1545 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_5
1546 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_6
1547 //! \param compareLatchLoadEvent selects the latch load event
1548 //! Valid values are:
1549 //! - \b TIMER_D_LATCH_ON_WRITE_TO_TDxCCRn_COMPARE_REGISTER [Default]
1550 //! - \b TIMER_D_LATCH_WHEN_COUNTER_COUNTS_TO_0_IN_UP_OR_CONT_MODE
1551 //! - \b TIMER_D_LATCH_WHEN_COUNTER_COUNTS_TO_0_IN_UPDOWN_MODE
1552 //! - \b
1553 //! TIMER_D_LATCH_WHEN_COUNTER_COUNTS_TO_CURRENT_COMPARE_LATCH_VALUE
1554 //!
1555 //! Modified bits are \b CLLD of \b TDxCCTLn register.
1556 //!
1557 //! \return None
1558 //
1559 //*****************************************************************************
1560 extern void Timer_D_initCompareLatchLoadEvent(uint16_t baseAddress,
1561  uint16_t compareRegister,
1562  uint16_t compareLatchLoadEvent);
1563 
1564 //*****************************************************************************
1565 //
1566 //! \brief Disable High Resolution fast wakeup
1567 //!
1568 //! \param baseAddress is the base address of the TIMER_D module.
1569 //!
1570 //! Modified bits are \b TDHFW of \b TDxHCTL0 register.
1571 //!
1572 //! \return None
1573 //
1574 //*****************************************************************************
1575 extern void Timer_D_disableHighResFastWakeup(uint16_t baseAddress);
1576 
1577 //*****************************************************************************
1578 //
1579 //! \brief Enable High Resolution fast wakeup
1580 //!
1581 //! \param baseAddress is the base address of the TIMER_D module.
1582 //!
1583 //! Modified bits are \b TDHFW of \b TDxHCTL0 register.
1584 //!
1585 //! \return None
1586 //
1587 //*****************************************************************************
1588 extern void Timer_D_enableHighResFastWakeup(uint16_t baseAddress);
1589 
1590 //*****************************************************************************
1591 //
1592 //! \brief Disable High Resolution Clock Enhanced Accuracy
1593 //!
1594 //! \param baseAddress is the base address of the TIMER_D module.
1595 //!
1596 //! Modified bits are \b TDHEAEN of \b TDxHCTL0 register.
1597 //!
1598 //! \return None
1599 //
1600 //*****************************************************************************
1601 extern void Timer_D_disableHighResClockEnhancedAccuracy(uint16_t baseAddress);
1602 
1603 //*****************************************************************************
1604 //
1605 //! \brief Enable High Resolution Clock Enhanced Accuracy
1606 //!
1607 //! \param baseAddress is the base address of the TIMER_D module.
1608 //!
1609 //! Modified bits are \b TDHEAEN of \b TDxHCTL0 register.
1610 //!
1611 //! \return None
1612 //
1613 //*****************************************************************************
1614 extern void Timer_D_enableHighResClockEnhancedAccuracy(uint16_t baseAddress);
1615 
1616 //*****************************************************************************
1617 //
1618 //! \brief Disable High Resolution Clock Enhanced Accuracy
1619 //!
1620 //! High-resolution generator is on if the Timer_D counter
1621 //!
1622 //! \param baseAddress is the base address of the TIMER_D module.
1623 //!
1624 //! Modified bits are \b TDHRON of \b TDxHCTL0 register.
1625 //!
1626 //! \return None
1627 //
1628 //*****************************************************************************
1629 extern void Timer_D_disableHighResGeneratorForceON(uint16_t baseAddress);
1630 
1631 //*****************************************************************************
1632 //
1633 //! \brief Enable High Resolution Clock Enhanced Accuracy
1634 //!
1635 //! High-resolution generator is on in all Timer_D MCx modes. The PMM remains
1636 //! in high-current mode.
1637 //!
1638 //! \param baseAddress is the base address of the TIMER_D module.
1639 //!
1640 //! Modified bits are \b TDHRON of \b TDxHCTL0 register.
1641 //!
1642 //! \return None
1643 //
1644 //*****************************************************************************
1645 extern void Timer_D_enableHighResGeneratorForceON(uint16_t baseAddress);
1646 
1647 //*****************************************************************************
1648 //
1649 //! \brief Select High Resolution Coarse Clock Range
1650 //!
1651 //! \param baseAddress is the base address of the TIMER_D module.
1652 //! \param highResCoarseClockRange selects the High Resolution Coarse Clock
1653 //! Range
1654 //! Valid values are:
1655 //! - \b TIMER_D_HIGHRES_BELOW_15MHz [Default]
1656 //! - \b TIMER_D_HIGHRES_ABOVE_15MHz
1657 //!
1658 //! Modified bits are \b TDHCLKCR of \b TDxHCTL1 register.
1659 //!
1660 //! \return None
1661 //
1662 //*****************************************************************************
1663 extern void Timer_D_selectHighResCoarseClockRange(uint16_t baseAddress,
1664  uint16_t highResCoarseClockRange);
1665 
1666 //*****************************************************************************
1667 //
1668 //! \brief Select High Resolution Clock Range Selection
1669 //!
1670 //! \param baseAddress is the base address of the TIMER_D module.
1671 //! \param highResClockRange selects the High Resolution Clock Range. Refer to
1672 //! datasheet for frequency details
1673 //! Valid values are:
1674 //! - \b TIMER_D_CLOCK_RANGE0 [Default]
1675 //! - \b TIMER_D_CLOCK_RANGE1
1676 //! - \b TIMER_D_CLOCK_RANGE2
1677 //!
1678 //! \return None
1679 //
1680 //*****************************************************************************
1681 extern void Timer_D_selectHighResClockRange(uint16_t baseAddress,
1682  uint16_t highResClockRange);
1683 
1684 //*****************************************************************************
1685 //
1686 //! \brief Reads the current timer count value
1687 //!
1688 //! Reads the current count value of the timer. There is a majority vote system
1689 //! in place to confirm an accurate value is returned. The Timer_D_THRESHOLD
1690 //! #define in the corresponding header file can be modified so that the votes
1691 //! must be closer together for a consensus to occur.
1692 //!
1693 //! \param baseAddress is the base address of the TIMER_D module.
1694 //!
1695 //! \return Majority vote of timer count value
1696 //
1697 //*****************************************************************************
1698 extern uint16_t Timer_D_getCounterValue(uint16_t baseAddress);
1699 
1700 //*****************************************************************************
1701 //
1702 //! \brief Sets the output mode
1703 //!
1704 //! Sets the output mode for the timer even the timer is already running.
1705 //!
1706 //! \param baseAddress is the base address of the TIMER_D module.
1707 //! \param compareRegister selects the compare register being used.
1708 //! Valid values are:
1709 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_0
1710 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_1
1711 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_2
1712 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_3
1713 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_4
1714 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_5
1715 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_6
1716 //! \param compareOutputMode specifies the output mode.
1717 //! Valid values are:
1718 //! - \b TIMER_D_OUTPUTMODE_OUTBITVALUE [Default]
1719 //! - \b TIMER_D_OUTPUTMODE_SET
1720 //! - \b TIMER_D_OUTPUTMODE_TOGGLE_RESET
1721 //! - \b TIMER_D_OUTPUTMODE_SET_RESET
1722 //! - \b TIMER_D_OUTPUTMODE_TOGGLE
1723 //! - \b TIMER_D_OUTPUTMODE_RESET
1724 //! - \b TIMER_D_OUTPUTMODE_TOGGLE_SET
1725 //! - \b TIMER_D_OUTPUTMODE_RESET_SET
1726 //!
1727 //! Modified bits are \b OUTMOD of \b TDxCCTLn register.
1728 //!
1729 //! \return None
1730 //
1731 //*****************************************************************************
1732 extern void Timer_D_setOutputMode(uint16_t baseAddress,
1733  uint16_t compareRegister,
1734  uint16_t compareOutputMode);
1735 
1736 //*****************************************************************************
1737 //
1738 // Mark the end of the C bindings section for C++ compilers.
1739 //
1740 //*****************************************************************************
1741 #ifdef __cplusplus
1742 }
1743 #endif
1744 
1745 #endif
1746 #endif // __MSP430WARE_TIMER_D_H__
uint8_t highResClockMultiplyFactor
Definition: timer_d.h:238
uint16_t captureMode
Definition: timer_d.h:403
uint16_t timerPeriod
Is the specified timer period.
Definition: timer_d.h:292
void Timer_D_disableCaptureCompareInterrupt(uint16_t baseAddress, uint16_t captureCompareRegister)
Disable capture compare interrupt.
Definition: timer_d.c:191
uint16_t compareOutputMode
Definition: timer_d.h:130
uint16_t timerClear
Definition: timer_d.h:308
Used in the Timer_D_combineTDCCRToOutputPWM() function as the param parameter.
Definition: timer_d.h:317
uint16_t compareRegister
Definition: timer_d.h:114
void Timer_D_enableHighResFastWakeup(uint16_t baseAddress)
Enable High Resolution fast wakeup.
Definition: timer_d.c:472
uint16_t clockSourceDivider
Definition: timer_d.h:171
Used in the Timer_D_initHighResGeneratorInRegulatedMode() function as the param parameter.
Definition: timer_d.h:197
void Timer_D_clearHighResInterrupt(uint16_t baseAddress, uint16_t mask)
Clears High Resolution interrupt status.
Definition: timer_d.c:218
void Timer_D_outputPWM(uint16_t baseAddress, Timer_D_outputPWMParam *param)
Generate a PWM with timer running in up mode.
Definition: timer_d.c:284
uint16_t clockingMode
Definition: timer_d.h:480
uint16_t clockSource
Definition: timer_d.h:451
uint16_t captureRegister
Definition: timer_d.h:396
void Timer_D_enableHighResGeneratorForceON(uint16_t baseAddress)
Enable High Resolution Clock Enhanced Accuracy.
Definition: timer_d.c:492
uint16_t Timer_D_getHighResInterruptStatus(uint16_t baseAddress, uint16_t mask)
Returns High Resolution interrupt status.
Definition: timer_d.c:206
void Timer_D_selectHighResCoarseClockRange(uint16_t baseAddress, uint16_t highResCoarseClockRange)
Select High Resolution Coarse Clock Range.
Definition: timer_d.c:497
uint16_t Timer_D_getCaptureCompareLatchCount(uint16_t baseAddress, uint16_t captureCompareRegister)
Get current capture compare latch register count.
Definition: timer_d.c:259
uint8_t channelCaptureMode
Definition: timer_d.h:436
uint16_t captureInputSelect
Definition: timer_d.h:410
void Timer_D_enableTimerInterrupt(uint16_t baseAddress)
Enable timer interrupt.
Definition: timer_d.c:154
uint16_t timerInterruptEnable_TDIE
Definition: timer_d.h:297
uint16_t compareOutputMode
Definition: timer_d.h:503
void Timer_D_initCompareLatchLoadEvent(uint16_t baseAddress, uint16_t compareRegister, uint16_t compareLatchLoadEvent)
Selects Compare Latch Load Event.
Definition: timer_d.c:457
uint16_t captureCompareInterruptEnable_CCR0_CCIE
Definition: timer_d.h:302
void Timer_D_initUpDownMode(uint16_t baseAddress, Timer_D_initUpDownModeParam *param)
Configures timer in up down mode.
Definition: timer_d.c:80
uint16_t dutyCycle2
Specifies the dutycycle for the generated waveform.
Definition: timer_d.h:376
Used in the Timer_D_initCaptureMode() function as the param parameter.
Definition: timer_d.h:385
void Timer_D_setCompareValue(uint16_t baseAddress, uint16_t compareRegister, uint16_t compareValue)
Sets the value of the capture-compare register.
Definition: timer_d.c:319
uint16_t clockSource
Definition: timer_d.h:148
void Timer_D_initCompareMode(uint16_t baseAddress, Timer_D_initCompareModeParam *param)
Initializes Compare Mode.
Definition: timer_d.c:137
Used in the Timer_D_initCompareMode() function as the param parameter.
Definition: timer_d.h:104
void Timer_D_clearTimerInterrupt(uint16_t baseAddress)
Clears the Timer TDIFG interrupt flag.
Definition: timer_d.c:327
uint16_t clockingMode
Definition: timer_d.h:177
uint16_t compareInterruptEnable
Definition: timer_d.h:119
uint32_t Timer_D_getTimerInterruptStatus(uint16_t baseAddress)
Get timer interrupt status.
Definition: timer_d.c:178
uint16_t clockSourceDivider
Definition: timer_d.h:227
void Timer_D_selectCounterLength(uint16_t baseAddress, uint16_t counterLength)
Selects Timer_D counter length.
Definition: timer_d.c:448
uint16_t clockSourceDivider
Definition: timer_d.h:284
void Timer_D_startCounter(uint16_t baseAddress, uint16_t timerMode)
Starts Timer_D counter.
Definition: timer_d.c:22
uint16_t clockSourceDivider
Definition: timer_d.h:474
Used in the Timer_D_initUpMode() function as the param parameter.
Definition: timer_d.h:40
void Timer_D_selectHighResClockRange(uint16_t baseAddress, uint16_t highResClockRange)
Select High Resolution Clock Range Selection.
Definition: timer_d.c:505
void Timer_D_initContinuousMode(uint16_t baseAddress, Timer_D_initContinuousModeParam *param)
Configures timer in continuous mode.
Definition: timer_d.c:29
uint16_t Timer_D_getCounterValue(uint16_t baseAddress)
Reads the current timer count value.
Definition: timer_d.c:513
uint16_t clockSourceDivider
Definition: timer_d.h:70
uint16_t compareOutputMode
Definition: timer_d.h:372
uint16_t compareValue
Is the count to be compared with in compare mode.
Definition: timer_d.h:132
uint16_t captureOutputMode
Definition: timer_d.h:431
uint16_t clockSource
Definition: timer_d.h:261
Used in the Timer_D_initUpDownMode() function as the param parameter.
Definition: timer_d.h:254
uint16_t dutyCycle1
Specifies the dutycycle for the generated waveform.
Definition: timer_d.h:374
void Timer_D_combineTDCCRToOutputPWM(uint16_t baseAddress, Timer_D_combineTDCCRToOutputPWMParam *param)
Combine TDCCR to get PWM.
Definition: timer_d.c:416
void Timer_D_initHighResGeneratorInRegulatedMode(uint16_t baseAddress, Timer_D_initHighResGeneratorInRegulatedModeParam *param)
Configures Timer_D in Regulated mode.
Definition: timer_d.c:396
void Timer_D_enableHighResInterrupt(uint16_t baseAddress, uint16_t mask)
Enable High Resolution interrupt.
Definition: timer_d.c:160
uint16_t timerInterruptEnable_TDIE
Definition: timer_d.h:182
uint16_t dutyCycle
Specifies the dutycycle for the generated waveform.
Definition: timer_d.h:505
void Timer_D_setOutputMode(uint16_t baseAddress, uint16_t compareRegister, uint16_t compareOutputMode)
Sets the output mode.
Definition: timer_d.c:537
uint16_t clockSourceDivider
Definition: timer_d.h:347
uint16_t synchronizeCaptureSource
Definition: timer_d.h:415
uint8_t Timer_D_getSynchronizedCaptureCompareInput(uint16_t baseAddress, uint16_t captureCompareRegister, uint16_t synchronized)
Get synchronized capturecompare input.
Definition: timer_d.c:226
void Timer_D_disableHighResClockEnhancedAccuracy(uint16_t baseAddress)
Disable High Resolution Clock Enhanced Accuracy.
Definition: timer_d.c:477
void Timer_D_setOutputForOutputModeOutBitValue(uint16_t baseAddress, uint16_t captureCompareRegister, uint8_t outputModeOutBitValue)
Set output bit for output mode.
Definition: timer_d.c:275
void Timer_D_disableHighResInterrupt(uint16_t baseAddress, uint16_t mask)
Disable High Resolution interrupt.
Definition: timer_d.c:172
uint16_t clockingMode
Definition: timer_d.h:76
uint16_t timerClear
Definition: timer_d.h:95
uint16_t clockingMode
Definition: timer_d.h:290
uint16_t clockingMode
Definition: timer_d.h:353
Used in the Timer_D_outputPWM() function as the param parameter.
Definition: timer_d.h:444
uint32_t Timer_D_getCaptureCompareInterruptStatus(uint16_t baseAddress, uint16_t captureCompareRegister, uint16_t mask)
Return capture compare interrupt status.
Definition: timer_d.c:198
uint16_t clockSource
Definition: timer_d.h:204
void Timer_D_enableCaptureCompareInterrupt(uint16_t baseAddress, uint16_t captureCompareRegister)
Enable capture compare interrupt.
Definition: timer_d.c:183
void Timer_D_enableHighResClockEnhancedAccuracy(uint16_t baseAddress)
Enable High Resolution Clock Enhanced Accuracy.
Definition: timer_d.c:482
uint16_t timerPeriod
Is the specified timer period.
Definition: timer_d.h:355
Used in the Timer_D_initContinuousMode() function as the param parameter.
Definition: timer_d.h:141
uint16_t timerPeriod
Definition: timer_d.h:79
uint16_t timerInterruptEnable_TDIE
Definition: timer_d.h:84
uint16_t clockingMode
Definition: timer_d.h:233
void Timer_D_initCaptureMode(uint16_t baseAddress, Timer_D_initCaptureModeParam *param)
Initializes Capture Mode.
Definition: timer_d.c:111
uint16_t compareRegister
Definition: timer_d.h:492
uint16_t Timer_D_getCaptureCompareCount(uint16_t baseAddress, uint16_t captureCompareRegister)
Get current capturecompare count.
Definition: timer_d.c:251
uint16_t clockSource
Definition: timer_d.h:47
uint8_t Timer_D_initHighResGeneratorInFreeRunningMode(uint16_t baseAddress, uint8_t desiredHighResFrequency)
Configures Timer_D in free running mode.
Definition: timer_d.c:340
void Timer_D_stop(uint16_t baseAddress)
Stops the timer.
Definition: timer_d.c:314
void Timer_D_selectLatchingGroup(uint16_t baseAddress, uint16_t groupLatch)
Selects Timer_D Latching Group.
Definition: timer_d.c:440
uint16_t captureCompareInterruptEnable_CCR0_CCIE
Definition: timer_d.h:89
void Timer_D_clear(uint16_t baseAddress)
Reset/Clear the timer clock divider, count direction, count.
Definition: timer_d.c:213
uint16_t timerClear
Definition: timer_d.h:188
void Timer_D_disableTimerInterrupt(uint16_t baseAddress)
Disable timer interrupt.
Definition: timer_d.c:167
void Timer_D_initUpMode(uint16_t baseAddress, Timer_D_initUpModeParam *param)
Configures timer in up mode.
Definition: timer_d.c:50
void Timer_D_clearCaptureCompareInterrupt(uint16_t baseAddress, uint16_t captureCompareRegister)
Clears the capture-compare interrupt flag.
Definition: timer_d.c:332
uint8_t Timer_D_getCaptureCompareInputSignal(uint16_t baseAddress, uint16_t captureCompareRegister)
Get current capturecompare input signal.
Definition: timer_d.c:267
uint16_t captureInterruptEnable
Definition: timer_d.h:420
uint8_t Timer_D_getOutputForOutputModeOutBitValue(uint16_t baseAddress, uint16_t captureCompareRegister)
Get output bit for output mode.
Definition: timer_d.c:239
void Timer_D_disableHighResFastWakeup(uint16_t baseAddress)
Disable High Resolution fast wakeup.
Definition: timer_d.c:467
uint8_t highResClockDivider
Definition: timer_d.h:245
uint16_t timerPeriod
Is the specified timer period.
Definition: timer_d.h:482
void Timer_D_disableHighResGeneratorForceON(uint16_t baseAddress)
Disable High Resolution Clock Enhanced Accuracy.
Definition: timer_d.c:487
uint16_t clockSource
Definition: timer_d.h:324
uint16_t combineCCRRegistersCombination
Definition: timer_d.h:361

Copyright 2020, Texas Instruments Incorporated