MSP430 DriverLib for MSP430F5xx_6xx Devices  2.10.00.09
 All Data Structures Functions Variables Modules Pages
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_initUpDownMode() function as the param
194 //! 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  //! Is the specified timer period
235  uint16_t timerPeriod;
236  //! Is to enable or disable timer interrupt
237  //! \n Valid values are:
238  //! - \b TIMER_D_TDIE_INTERRUPT_ENABLE
239  //! - \b TIMER_D_TDIE_INTERRUPT_DISABLE [Default]
241  //! Is to enable or disable timer CCR0 captureComapre interrupt.
242  //! \n Valid values are:
243  //! - \b TIMER_D_CCIE_CCR0_INTERRUPT_ENABLE
244  //! - \b TIMER_D_CCIE_CCR0_INTERRUPT_DISABLE [Default]
246  //! Decides if timer clock divider, count direction, count need to be
247  //! reset.
248  //! \n Valid values are:
249  //! - \b TIMER_D_DO_CLEAR
250  //! - \b TIMER_D_SKIP_CLEAR [Default]
251  uint16_t timerClear;
253 
254 //*****************************************************************************
255 //
256 //! \brief Used in the Timer_D_initHighResGeneratorInRegulatedMode() function
257 //! as the param parameter.
258 //
259 //*****************************************************************************
261  //! Selects Clock source.
262  //! \n Valid values are:
263  //! - \b TIMER_D_CLOCKSOURCE_EXTERNAL_TDCLK [Default]
264  //! - \b TIMER_D_CLOCKSOURCE_ACLK
265  //! - \b TIMER_D_CLOCKSOURCE_SMCLK
266  //! - \b TIMER_D_CLOCKSOURCE_INVERTED_EXTERNAL_TDCLK
267  uint16_t clockSource;
268  //! Is the divider for clock source.
269  //! \n Valid values are:
270  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_1 [Default]
271  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_2
272  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_3
273  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_4
274  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_5
275  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_6
276  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_7
277  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_8
278  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_10
279  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_12
280  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_14
281  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_16
282  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_20
283  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_24
284  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_28
285  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_32
286  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_40
287  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_48
288  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_56
289  //! - \b TIMER_D_CLOCKSOURCE_DIVIDER_64
291  //! Is the selected clock mode register values.
292  //! \n Valid values are:
293  //! - \b TIMER_D_CLOCKINGMODE_EXTERNAL_CLOCK [Default]
294  //! - \b TIMER_D_CLOCKINGMODE_HIRES_LOCAL_CLOCK
295  //! - \b TIMER_D_CLOCKINGMODE_AUXILIARY_CLK
296  uint16_t clockingMode;
297  //! Selects the high resolution multiply factor.
298  //! \n Valid values are:
299  //! - \b TIMER_D_HIGHRES_CLK_MULTIPLY_FACTOR_8x
300  //! - \b TIMER_D_HIGHRES_CLK_MULTIPLY_FACTOR_16x
302  //! Selects the high resolution divider.
303  //! \n Valid values are:
304  //! - \b TIMER_D_HIGHRES_CLK_DIVIDER_1
305  //! - \b TIMER_D_HIGHRES_CLK_DIVIDER_2
306  //! - \b TIMER_D_HIGHRES_CLK_DIVIDER_4
307  //! - \b TIMER_D_HIGHRES_CLK_DIVIDER_8
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
360  //! - \b TIMER_D_COMBINE_CCR5_CCR6
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
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 param parameter for
638 // functions: Timer_D_initCaptureMode(), Timer_D_initCompareMode(),
639 // Timer_D_outputPWM(), and Timer_D_combineTDCCRToOutputPWM().
640 //
641 //*****************************************************************************
642 #define TIMER_D_OUTPUTMODE_OUTBITVALUE OUTMOD_0
643 #define TIMER_D_OUTPUTMODE_SET OUTMOD_1
644 #define TIMER_D_OUTPUTMODE_TOGGLE_RESET OUTMOD_2
645 #define TIMER_D_OUTPUTMODE_SET_RESET OUTMOD_3
646 #define TIMER_D_OUTPUTMODE_TOGGLE OUTMOD_4
647 #define TIMER_D_OUTPUTMODE_RESET OUTMOD_5
648 #define TIMER_D_OUTPUTMODE_TOGGLE_SET OUTMOD_6
649 #define TIMER_D_OUTPUTMODE_RESET_SET OUTMOD_7
650 
651 //*****************************************************************************
652 //
653 // The following are values that can be passed to the compareRegister parameter
654 // for functions: Timer_D_setCompareValue(), and
655 // Timer_D_initCompareLatchLoadEvent(); the captureCompareRegister parameter
656 // for functions: Timer_D_enableCaptureCompareInterrupt(),
657 // Timer_D_disableCaptureCompareInterrupt(),
658 // Timer_D_getCaptureCompareInterruptStatus(),
659 // Timer_D_getSynchronizedCaptureCompareInput(),
660 // Timer_D_getOutputForOutputModeOutBitValue(),
661 // Timer_D_getCaptureCompareCount(), Timer_D_getCaptureCompareLatchCount(),
662 // Timer_D_getCaptureCompareInputSignal(),
663 // Timer_D_setOutputForOutputModeOutBitValue(), and
664 // Timer_D_clearCaptureCompareInterrupt(); the param parameter for functions:
665 // Timer_D_initCaptureMode(), Timer_D_outputPWM(), and
666 // Timer_D_initCompareMode().
667 //
668 //*****************************************************************************
669 #define TIMER_D_CAPTURECOMPARE_REGISTER_0 0x08
670 #define TIMER_D_CAPTURECOMPARE_REGISTER_1 0x0E
671 #define TIMER_D_CAPTURECOMPARE_REGISTER_2 0x14
672 #define TIMER_D_CAPTURECOMPARE_REGISTER_3 0x1A
673 #define TIMER_D_CAPTURECOMPARE_REGISTER_4 0x20
674 #define TIMER_D_CAPTURECOMPARE_REGISTER_5 0x28
675 #define TIMER_D_CAPTURECOMPARE_REGISTER_6 0x2E
676 
677 //*****************************************************************************
678 //
679 // The following are values that can be passed to the param parameter for
680 // functions: Timer_D_initCaptureMode().
681 //
682 //*****************************************************************************
683 #define TIMER_D_CAPTUREMODE_NO_CAPTURE CM_0
684 #define TIMER_D_CAPTUREMODE_RISING_EDGE CM_1
685 #define TIMER_D_CAPTUREMODE_FALLING_EDGE CM_2
686 #define TIMER_D_CAPTUREMODE_RISING_AND_FALLING_EDGE CM_3
687 
688 //*****************************************************************************
689 //
690 // The following are values that can be passed to the param parameter for
691 // functions: Timer_D_initCaptureMode().
692 //
693 //*****************************************************************************
694 #define TIMER_D_CAPTURE_ASYNCHRONOUS 0x00
695 #define TIMER_D_CAPTURE_SYNCHRONOUS SCS
696 
697 //*****************************************************************************
698 //
699 // The following are values that can be passed to the param parameter for
700 // functions: Timer_D_initCompareMode().
701 //
702 //*****************************************************************************
703 #define TIMER_D_CAPTURECOMPARE_INTERRUPT_ENABLE CCIE
704 #define TIMER_D_CAPTURECOMPARE_INTERRUPT_DISABLE 0x00
705 
706 //*****************************************************************************
707 //
708 // The following are values that can be passed to the mask parameter for
709 // functions: Timer_D_enableHighResInterrupt(),
710 // Timer_D_disableHighResInterrupt(), Timer_D_getHighResInterruptStatus(), and
711 // Timer_D_clearHighResInterrupt() as well as returned by the
712 // Timer_D_getHighResInterruptStatus() function.
713 //
714 //*****************************************************************************
715 #define TIMER_D_HIGH_RES_FREQUENCY_UNLOCK TDHUNLKIE
716 #define TIMER_D_HIGH_RES_FREQUENCY_LOCK TDHLKIE
717 #define TIMER_D_HIGH_RES_FAIL_HIGH TDHFHIE
718 #define TIMER_D_HIGH_RES_FAIL_LOW TDHFLIE
719 
720 //*****************************************************************************
721 //
722 // The following are values that can be passed to the mask parameter for
723 // functions: Timer_D_getCaptureCompareInterruptStatus() as well as returned by
724 // the Timer_D_getCaptureCompareInterruptStatus() function.
725 //
726 //*****************************************************************************
727 #define TIMER_D_CAPTURE_OVERFLOW COV
728 #define TIMER_D_CAPTURECOMPARE_INTERRUPT_FLAG CCIFG
729 
730 //*****************************************************************************
731 //
732 // The following are values that can be passed to the synchronized parameter
733 // for functions: Timer_D_getSynchronizedCaptureCompareInput().
734 //
735 //*****************************************************************************
736 #define TIMER_D_READ_SYNCHRONIZED_CAPTURECOMPAREINPUT SCCI
737 #define TIMER_D_READ_CAPTURE_COMPARE_INPUT CCI
738 
739 //*****************************************************************************
740 //
741 // The following are values that can be passed to the outputModeOutBitValue
742 // parameter for functions: Timer_D_setOutputForOutputModeOutBitValue() as well
743 // as returned by the Timer_D_getOutputForOutputModeOutBitValue() function.
744 //
745 //*****************************************************************************
746 #define TIMER_D_OUTPUTMODE_OUTBITVALUE_HIGH OUT
747 #define TIMER_D_OUTPUTMODE_OUTBITVALUE_LOW 0x00
748 
749 //*****************************************************************************
750 //
751 // The following are values that can be passed to the desiredHighResFrequency
752 // parameter for functions: Timer_D_initHighResGeneratorInFreeRunningMode().
753 //
754 //*****************************************************************************
755 #define TIMER_D_HIGHRES_64MHZ 0x00
756 #define TIMER_D_HIGHRES_128MHZ 0x01
757 #define TIMER_D_HIGHRES_200MHZ 0x02
758 #define TIMER_D_HIGHRES_256MHZ 0x03
759 
760 //*****************************************************************************
761 //
762 // The following are values that can be passed to the param parameter for
763 // functions: Timer_D_initHighResGeneratorInRegulatedMode().
764 //
765 //*****************************************************************************
766 #define TIMER_D_HIGHRES_CLK_DIVIDER_1 TDHD__1
767 #define TIMER_D_HIGHRES_CLK_DIVIDER_2 TDHD__2
768 #define TIMER_D_HIGHRES_CLK_DIVIDER_4 TDHD__4
769 #define TIMER_D_HIGHRES_CLK_DIVIDER_8 TDHD__8
770 
771 //*****************************************************************************
772 //
773 // The following are values that can be passed to the param parameter for
774 // functions: Timer_D_initHighResGeneratorInRegulatedMode().
775 //
776 //*****************************************************************************
777 #define TIMER_D_HIGHRES_CLK_MULTIPLY_FACTOR_8x TDHM_0
778 #define TIMER_D_HIGHRES_CLK_MULTIPLY_FACTOR_16x TDHM_1
779 
780 //*****************************************************************************
781 //
782 // The following are values that can be passed to the param parameter for
783 // functions: Timer_D_combineTDCCRToOutputPWM().
784 //
785 //*****************************************************************************
786 #define TIMER_D_COMBINE_CCR1_CCR2 2
787 #define TIMER_D_COMBINE_CCR3_CCR4 4
788 #define TIMER_D_COMBINE_CCR5_CCR6 6
789 
790 //*****************************************************************************
791 //
792 // The following are values that can be passed to the groupLatch parameter for
793 // functions: Timer_D_selectLatchingGroup().
794 //
795 //*****************************************************************************
796 #define TIMER_D_GROUP_NONE TDCLGRP_0
797 #define TIMER_D_GROUP_CL12_CL23_CL56 TDCLGRP_1
798 #define TIMER_D_GROUP_CL123_CL456 TDCLGRP_2
799 #define TIMER_D_GROUP_ALL TDCLGRP_3
800 
801 //*****************************************************************************
802 //
803 // The following are values that can be passed to the counterLength parameter
804 // for functions: Timer_D_selectCounterLength().
805 //
806 //*****************************************************************************
807 #define TIMER_D_COUNTER_16BIT CNTL_0
808 #define TIMER_D_COUNTER_12BIT CNTL_1
809 #define TIMER_D_COUNTER_10BIT CNTL_2
810 #define TIMER_D_COUNTER_8BIT CNTL_3
811 
812 //*****************************************************************************
813 //
814 // The following are values that can be passed to the compareLatchLoadEvent
815 // parameter for functions: Timer_D_initCompareLatchLoadEvent().
816 //
817 //*****************************************************************************
818 #define TIMER_D_LATCH_ON_WRITE_TO_TDxCCRn_COMPARE_REGISTER CLLD_0
819 #define TIMER_D_LATCH_WHEN_COUNTER_COUNTS_TO_0_IN_UP_OR_CONT_MODE CLLD_1
820 #define TIMER_D_LATCH_WHEN_COUNTER_COUNTS_TO_0_IN_UPDOWN_MODE CLLD_2
821 #define TIMER_D_LATCH_WHEN_COUNTER_COUNTS_TO_CURRENT_COMPARE_LATCH_VALUE CLLD_3
822 
823 //*****************************************************************************
824 //
825 // The following are values that can be passed to the highResCoarseClockRange
826 // parameter for functions: Timer_D_selectHighResCoarseClockRange().
827 //
828 //*****************************************************************************
829 #define TIMER_D_HIGHRES_BELOW_15MHz 0x00
830 #define TIMER_D_HIGHRES_ABOVE_15MHz TDHCLKCR
831 
832 //*****************************************************************************
833 //
834 // The following are values that can be passed to the highResClockRange
835 // parameter for functions: Timer_D_selectHighResClockRange().
836 //
837 //*****************************************************************************
838 #define TIMER_D_CLOCK_RANGE0 0x0000
839 #define TIMER_D_CLOCK_RANGE1 0x2000
840 #define TIMER_D_CLOCK_RANGE2 0x4000
841 
842 //*****************************************************************************
843 //
844 // The following are values that can be passed toThe following are values that
845 // can be returned by the Timer_D_getSynchronizedCaptureCompareInput()
846 // function.
847 //
848 //*****************************************************************************
849 #define TIMER_D_CAPTURECOMPARE_INPUT_HIGH 0x01
850 #define TIMER_D_CAPTURECOMPARE_INPUT_LOW 0x00
851 
852 //*****************************************************************************
853 //
854 // The following are values that can be passed toThe following are values that
855 // can be returned by the Timer_D_getTimerInterruptStatus() function.
856 //
857 //*****************************************************************************
858 #define TIMER_D_INTERRUPT_NOT_PENDING 0x00
859 #define TIMER_D_INTERRUPT_PENDING 0x01
860 
861 //*****************************************************************************
862 //
863 // The following are values that can be passed toThe following are values that
864 // can be returned by the Timer_D_getCaptureCompareInputSignal() function.
865 //
866 //*****************************************************************************
867 #define TIMER_D_CAPTURECOMPARE_INPUT CCI
868 
869 //*****************************************************************************
870 //
871 // Prototypes for the APIs.
872 //
873 //*****************************************************************************
874 
875 //*****************************************************************************
876 //
877 //! \brief Starts Timer_D counter
878 //!
879 //! NOTE: This function assumes that the timer has been previously configured
880 //! using Timer_D_initContinuousMode, Timer_D_initUpMode or
881 //! Timer_D_initUpDownMode.
882 //!
883 //! \param baseAddress is the base address of the TIMER_DA module.
884 //! \param timerMode selects the mode of the timer
885 //! Valid values are:
886 //! - \b TIMER_D_STOP_MODE
887 //! - \b TIMER_D_UP_MODE
888 //! - \b TIMER_D_CONTINUOUS_MODE [Default]
889 //! - \b TIMER_D_UPDOWN_MODE
890 //!
891 //! Modified bits of \b TDxCTL0 register.
892 //!
893 //! \return None
894 //
895 //*****************************************************************************
896 extern void Timer_D_startCounter(uint16_t baseAddress,
897  uint16_t timerMode);
898 
899 //*****************************************************************************
900 //
901 //! \brief Configures timer in continuous mode.
902 //!
903 //! This API does not start the timer. Timer needs to be started when required
904 //! using the Timer_D_start API.
905 //!
906 //! \param baseAddress is the base address of the TIMER_D module.
907 //! \param param is the pointer to struct for continuous mode initialization.
908 //!
909 //! Modified bits of \b TDxCTL0 register and bits of \b TDxCTL1 register.
910 //!
911 //! \return None
912 //
913 //*****************************************************************************
914 extern void Timer_D_initContinuousMode(uint16_t baseAddress,
916 
917 //*****************************************************************************
918 //
919 //! \brief Configures timer in up mode.
920 //!
921 //! This API does not start the timer. Timer needs to be started when required
922 //! using the Timer_D_start API.
923 //!
924 //! \param baseAddress is the base address of the TIMER_D module.
925 //! \param param is the pointer to struct for up mode initialization.
926 //!
927 //! Modified bits of \b TDxCCR0 register, bits of \b TDxCCTL0 register, bits of
928 //! \b TDxCTL0 register and bits of \b TDxCTL1 register.
929 //!
930 //! \return None
931 //
932 //*****************************************************************************
933 extern void Timer_D_initUpMode(uint16_t baseAddress,
934  Timer_D_initUpModeParam *param);
935 
936 //*****************************************************************************
937 //
938 //! \brief Configures timer in up down mode.
939 //!
940 //! This API does not start the timer. Timer needs to be started when required
941 //! using the Timer_D_start API.
942 //!
943 //! \param baseAddress is the base address of the TIMER_D module.
944 //! \param param is the pointer to struct for up-down mode initialization.
945 //!
946 //! Modified bits of \b TDxCCR0 register, bits of \b TDxCCTL0 register, bits of
947 //! \b TDxCTL0 register and bits of \b TDxCTL1 register.
948 //!
949 //! \return None
950 //
951 //*****************************************************************************
952 extern void Timer_D_initUpDownMode(uint16_t baseAddress,
954 
955 //*****************************************************************************
956 //
957 //! \brief Initializes Capture Mode
958 //!
959 //! \param baseAddress is the base address of the TIMER_D module.
960 //! \param param is the pointer to struct for capture mode initialization.
961 //!
962 //! Modified bits of \b TDxCCTLn register and bits of \b TDxCTL2 register.
963 //!
964 //! \return None
965 //
966 //*****************************************************************************
967 extern void Timer_D_initCaptureMode(uint16_t baseAddress,
969 
970 //*****************************************************************************
971 //
972 //! \brief Initializes Compare Mode
973 //!
974 //! \param baseAddress is the base address of the TIMER_D module.
975 //! \param param is the pointer to struct for compare mode initialization.
976 //!
977 //! Modified bits of \b TDxCCTLn register and bits of \b TDxCCRn register.
978 //!
979 //! \return None
980 //
981 //*****************************************************************************
982 extern void Timer_D_initCompareMode(uint16_t baseAddress,
984 
985 //*****************************************************************************
986 //
987 //! \brief Enable timer interrupt
988 //!
989 //! \param baseAddress is the base address of the TIMER_D module.
990 //!
991 //! Modified bits of \b TDxCTL0 register.
992 //!
993 //! \return None
994 //
995 //*****************************************************************************
996 extern void Timer_D_enableTimerInterrupt(uint16_t baseAddress);
997 
998 //*****************************************************************************
999 //
1000 //! \brief Enable High Resolution interrupt
1001 //!
1002 //! \param baseAddress is the base address of the TIMER_D module.
1003 //! \param mask is the mask of interrupts to enable
1004 //! Mask value is the logical OR of any of the following:
1005 //! - \b TIMER_D_HIGH_RES_FREQUENCY_UNLOCK
1006 //! - \b TIMER_D_HIGH_RES_FREQUENCY_LOCK
1007 //! - \b TIMER_D_HIGH_RES_FAIL_HIGH
1008 //! - \b TIMER_D_HIGH_RES_FAIL_LOW
1009 //!
1010 //! Modified bits of \b TDxHINT register.
1011 //!
1012 //! \return None
1013 //
1014 //*****************************************************************************
1015 extern void Timer_D_enableHighResInterrupt(uint16_t baseAddress,
1016  uint16_t mask);
1017 
1018 //*****************************************************************************
1019 //
1020 //! \brief Disable timer interrupt
1021 //!
1022 //! \param baseAddress is the base address of the TIMER_D module.
1023 //!
1024 //! Modified bits of \b TDxCTL0 register.
1025 //!
1026 //! \return None
1027 //
1028 //*****************************************************************************
1029 extern void Timer_D_disableTimerInterrupt(uint16_t baseAddress);
1030 
1031 //*****************************************************************************
1032 //
1033 //! \brief Disable High Resolution interrupt
1034 //!
1035 //! \param baseAddress is the base address of the TIMER_D module.
1036 //! \param mask is the mask of interrupts to disable
1037 //! Mask value is the logical OR of any of the following:
1038 //! - \b TIMER_D_HIGH_RES_FREQUENCY_UNLOCK
1039 //! - \b TIMER_D_HIGH_RES_FREQUENCY_LOCK
1040 //! - \b TIMER_D_HIGH_RES_FAIL_HIGH
1041 //! - \b TIMER_D_HIGH_RES_FAIL_LOW
1042 //!
1043 //! Modified bits of \b TDxHINT register.
1044 //!
1045 //! \return None
1046 //
1047 //*****************************************************************************
1048 extern void Timer_D_disableHighResInterrupt(uint16_t baseAddress,
1049  uint16_t mask);
1050 
1051 //*****************************************************************************
1052 //
1053 //! \brief Get timer interrupt status
1054 //!
1055 //! \param baseAddress is the base address of the TIMER_D module.
1056 //!
1057 //! \return One of the following:
1058 //! - \b Timer_D_INTERRUPT_NOT_PENDING
1059 //! - \b Timer_D_INTERRUPT_PENDING
1060 //! \n indicating the timer interrupt status
1061 //
1062 //*****************************************************************************
1063 extern uint32_t Timer_D_getTimerInterruptStatus(uint16_t baseAddress);
1064 
1065 //*****************************************************************************
1066 //
1067 //! \brief Enable capture compare interrupt
1068 //!
1069 //! \param baseAddress is the base address of the TIMER_D module.
1070 //! \param captureCompareRegister is the selected capture compare register
1071 //! Valid values are:
1072 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_0
1073 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_1
1074 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_2
1075 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_3
1076 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_4
1077 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_5
1078 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_6
1079 //!
1080 //! Modified bits of \b TDxCCTLn register.
1081 //!
1082 //! \return None
1083 //
1084 //*****************************************************************************
1085 extern void Timer_D_enableCaptureCompareInterrupt(uint16_t baseAddress,
1086  uint16_t captureCompareRegister);
1087 
1088 //*****************************************************************************
1089 //
1090 //! \brief Disable capture compare interrupt
1091 //!
1092 //! \param baseAddress is the base address of the TIMER_D module.
1093 //! \param captureCompareRegister is the selected capture compare register
1094 //! Valid values are:
1095 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_0
1096 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_1
1097 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_2
1098 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_3
1099 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_4
1100 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_5
1101 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_6
1102 //!
1103 //! Modified bits of \b TDxCCTLn register.
1104 //!
1105 //! \return None
1106 //
1107 //*****************************************************************************
1108 extern void Timer_D_disableCaptureCompareInterrupt(uint16_t baseAddress,
1109  uint16_t captureCompareRegister);
1110 
1111 //*****************************************************************************
1112 //
1113 //! \brief Return capture compare interrupt status
1114 //!
1115 //! \param baseAddress is the base address of the TIMER_D module.
1116 //! \param captureCompareRegister is the selected capture compare register
1117 //! Valid values are:
1118 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_0
1119 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_1
1120 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_2
1121 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_3
1122 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_4
1123 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_5
1124 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_6
1125 //! \param mask is the mask for the interrupt status
1126 //! Mask value is the logical OR of any of the following:
1127 //! - \b TIMER_D_CAPTURE_OVERFLOW
1128 //! - \b TIMER_D_CAPTURECOMPARE_INTERRUPT_FLAG
1129 //!
1130 //! \return Logical OR of any of the following:
1131 //! - \b Timer_D_CAPTURE_OVERFLOW
1132 //! - \b Timer_D_CAPTURECOMPARE_INTERRUPT_FLAG
1133 //! \n indicating the status of the masked flags
1134 //
1135 //*****************************************************************************
1136 extern uint32_t Timer_D_getCaptureCompareInterruptStatus(uint16_t baseAddress,
1137  uint16_t captureCompareRegister,
1138  uint16_t mask);
1139 
1140 //*****************************************************************************
1141 //
1142 //! \brief Returns High Resolution interrupt status
1143 //!
1144 //! \param baseAddress is the base address of the TIMER_D module.
1145 //! \param mask is the mask for the interrupt status
1146 //! Mask value is the logical OR of any of the following:
1147 //! - \b TIMER_D_HIGH_RES_FREQUENCY_UNLOCK
1148 //! - \b TIMER_D_HIGH_RES_FREQUENCY_LOCK
1149 //! - \b TIMER_D_HIGH_RES_FAIL_HIGH
1150 //! - \b TIMER_D_HIGH_RES_FAIL_LOW
1151 //!
1152 //! Modified bits of \b TDxHINT register.
1153 //!
1154 //! \return Logical OR of any of the following:
1155 //! - \b Timer_D_HIGH_RES_FREQUENCY_UNLOCK
1156 //! - \b Timer_D_HIGH_RES_FREQUENCY_LOCK
1157 //! - \b Timer_D_HIGH_RES_FAIL_HIGH
1158 //! - \b Timer_D_HIGH_RES_FAIL_LOW
1159 //! \n indicating the status of the masked interrupts
1160 //
1161 //*****************************************************************************
1162 extern uint16_t Timer_D_getHighResInterruptStatus(uint16_t baseAddress,
1163  uint16_t mask);
1164 
1165 //*****************************************************************************
1166 //
1167 //! \brief Reset/Clear the timer clock divider, count direction, count
1168 //!
1169 //! \param baseAddress is the base address of the TIMER_D module.
1170 //!
1171 //! Modified bits of \b TDxCTL0 register.
1172 //!
1173 //! \return None
1174 //
1175 //*****************************************************************************
1176 extern void Timer_D_clear(uint16_t baseAddress);
1177 
1178 //*****************************************************************************
1179 //
1180 //! \brief Clears High Resolution interrupt status
1181 //!
1182 //! \param baseAddress is the base address of the TIMER_D module.
1183 //! \param mask is the mask for the interrupts to clear
1184 //! Mask value is the logical OR of any of the following:
1185 //! - \b TIMER_D_HIGH_RES_FREQUENCY_UNLOCK
1186 //! - \b TIMER_D_HIGH_RES_FREQUENCY_LOCK
1187 //! - \b TIMER_D_HIGH_RES_FAIL_HIGH
1188 //! - \b TIMER_D_HIGH_RES_FAIL_LOW
1189 //!
1190 //! Modified bits of \b TDxHINT register.
1191 //!
1192 //! \return None
1193 //
1194 //*****************************************************************************
1195 extern void Timer_D_clearHighResInterrupt(uint16_t baseAddress,
1196  uint16_t mask);
1197 
1198 //*****************************************************************************
1199 //
1200 //! \brief Get synchronized capturecompare input
1201 //!
1202 //! \param baseAddress is the base address of the TIMER_D module.
1203 //! \param captureCompareRegister selects the Capture register being used.
1204 //! Valid values are:
1205 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_0
1206 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_1
1207 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_2
1208 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_3
1209 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_4
1210 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_5
1211 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_6
1212 //! \param synchronized is to select type of capture compare input.
1213 //! Valid values are:
1214 //! - \b TIMER_D_READ_SYNCHRONIZED_CAPTURECOMPAREINPUT
1215 //! - \b TIMER_D_READ_CAPTURE_COMPARE_INPUT
1216 //!
1217 //! \return One of the following:
1218 //! - \b Timer_D_CAPTURECOMPARE_INPUT_HIGH
1219 //! - \b Timer_D_CAPTURECOMPARE_INPUT_LOW
1220 //
1221 //*****************************************************************************
1222 extern uint8_t Timer_D_getSynchronizedCaptureCompareInput(uint16_t baseAddress,
1223  uint16_t captureCompareRegister,
1224  uint16_t synchronized);
1225 
1226 //*****************************************************************************
1227 //
1228 //! \brief Get output bit for output mode
1229 //!
1230 //! \param baseAddress is the base address of the TIMER_D module.
1231 //! \param captureCompareRegister selects the Capture register being used.
1232 //! Valid values are:
1233 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_0
1234 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_1
1235 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_2
1236 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_3
1237 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_4
1238 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_5
1239 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_6
1240 //!
1241 //! \return One of the following:
1242 //! - \b Timer_D_OUTPUTMODE_OUTBITVALUE_HIGH
1243 //! - \b Timer_D_OUTPUTMODE_OUTBITVALUE_LOW
1244 //
1245 //*****************************************************************************
1246 extern uint8_t Timer_D_getOutputForOutputModeOutBitValue(uint16_t baseAddress,
1247  uint16_t captureCompareRegister);
1248 
1249 //*****************************************************************************
1250 //
1251 //! \brief Get current capturecompare count
1252 //!
1253 //! \param baseAddress is the base address of the TIMER_D module.
1254 //! \param captureCompareRegister selects the Capture register being used.
1255 //! Valid values are:
1256 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_0
1257 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_1
1258 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_2
1259 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_3
1260 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_4
1261 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_5
1262 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_6
1263 //!
1264 //! \return current count as uint16_t
1265 //
1266 //*****************************************************************************
1267 extern uint16_t Timer_D_getCaptureCompareCount(uint16_t baseAddress,
1268  uint16_t captureCompareRegister);
1269 
1270 //*****************************************************************************
1271 //
1272 //! \brief Get current capture compare latch register count
1273 //!
1274 //! \param baseAddress is the base address of the TIMER_D module.
1275 //! \param captureCompareRegister selects the Capture register being used.
1276 //! Valid values are:
1277 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_0
1278 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_1
1279 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_2
1280 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_3
1281 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_4
1282 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_5
1283 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_6
1284 //!
1285 //! \return current count as uint16_t
1286 //
1287 //*****************************************************************************
1288 extern uint16_t Timer_D_getCaptureCompareLatchCount(uint16_t baseAddress,
1289  uint16_t captureCompareRegister);
1290 
1291 //*****************************************************************************
1292 //
1293 //! \brief Get current capturecompare input signal
1294 //!
1295 //! \param baseAddress is the base address of the TIMER_D module.
1296 //! \param captureCompareRegister selects the Capture register being used.
1297 //! Valid values are:
1298 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_0
1299 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_1
1300 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_2
1301 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_3
1302 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_4
1303 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_5
1304 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_6
1305 //!
1306 //! \return One of the following:
1307 //! - \b Timer_D_CAPTURECOMPARE_INPUT
1308 //! - \b 0x00
1309 //! \n indicating the current input signal
1310 //
1311 //*****************************************************************************
1312 extern uint8_t Timer_D_getCaptureCompareInputSignal(uint16_t baseAddress,
1313  uint16_t captureCompareRegister);
1314 
1315 //*****************************************************************************
1316 //
1317 //! \brief Set output bit for output mode
1318 //!
1319 //! \param baseAddress is the base address of the TIMER_D module.
1320 //! \param captureCompareRegister selects the Capture register being used.
1321 //! Valid values are:
1322 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_0
1323 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_1
1324 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_2
1325 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_3
1326 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_4
1327 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_5
1328 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_6
1329 //! \param outputModeOutBitValue the value to be set for out bit
1330 //! Valid values are:
1331 //! - \b TIMER_D_OUTPUTMODE_OUTBITVALUE_HIGH
1332 //! - \b TIMER_D_OUTPUTMODE_OUTBITVALUE_LOW
1333 //!
1334 //! Modified bits of \b TDxCCTLn register.
1335 //!
1336 //! \return None
1337 //
1338 //*****************************************************************************
1339 extern void Timer_D_setOutputForOutputModeOutBitValue(uint16_t baseAddress,
1340  uint16_t captureCompareRegister,
1341  uint8_t outputModeOutBitValue);
1342 
1343 //*****************************************************************************
1344 //
1345 //! \brief Generate a PWM with timer running in up mode
1346 //!
1347 //! \param baseAddress is the base address of the TIMER_D module.
1348 //! \param param is the pointer to struct for PWM configuration.
1349 //!
1350 //! Modified bits of \b TDxCCTLn register, bits of \b TDxCCR0 register, bits of
1351 //! \b TDxCCTL0 register, bits of \b TDxCTL0 register and bits of \b TDxCTL1
1352 //! register.
1353 //!
1354 //! \return None
1355 //
1356 //*****************************************************************************
1357 extern void Timer_D_outputPWM(uint16_t baseAddress,
1358  Timer_D_outputPWMParam *param);
1359 
1360 //*****************************************************************************
1361 //
1362 //! \brief Stops the timer
1363 //!
1364 //! \param baseAddress is the base address of the TIMER_D module.
1365 //!
1366 //! Modified bits of \b TDxCTL0 register.
1367 //!
1368 //! \return None
1369 //
1370 //*****************************************************************************
1371 extern void Timer_D_stop(uint16_t baseAddress);
1372 
1373 //*****************************************************************************
1374 //
1375 //! \brief Sets the value of the capture-compare register
1376 //!
1377 //! \param baseAddress is the base address of the TIMER_D module.
1378 //! \param compareRegister selects the Capture register being used.
1379 //! Valid values are:
1380 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_0
1381 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_1
1382 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_2
1383 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_3
1384 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_4
1385 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_5
1386 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_6
1387 //! \param compareValue is the count to be compared with in compare mode
1388 //!
1389 //! Modified bits of \b TDxCCRn register.
1390 //!
1391 //! \return None
1392 //
1393 //*****************************************************************************
1394 extern void Timer_D_setCompareValue(uint16_t baseAddress,
1395  uint16_t compareRegister,
1396  uint16_t compareValue);
1397 
1398 //*****************************************************************************
1399 //
1400 //! \brief Clears the Timer TDIFG interrupt flag
1401 //!
1402 //! \param baseAddress is the base address of the TIMER_D module.
1403 //!
1404 //! Modified bits are \b TDIFG of \b TDxCTL0 register.
1405 //!
1406 //! \return None
1407 //
1408 //*****************************************************************************
1409 extern void Timer_D_clearTimerInterrupt(uint16_t baseAddress);
1410 
1411 //*****************************************************************************
1412 //
1413 //! \brief Clears the capture-compare interrupt flag
1414 //!
1415 //! \param baseAddress is the base address of the TIMER_D module.
1416 //! \param captureCompareRegister selects the Capture-compare register being
1417 //! used.
1418 //! Valid values are:
1419 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_0
1420 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_1
1421 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_2
1422 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_3
1423 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_4
1424 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_5
1425 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_6
1426 //!
1427 //! Modified bits are \b CCIFG of \b TDxCCTLn register.
1428 //!
1429 //! \return None
1430 //
1431 //*****************************************************************************
1432 extern void Timer_D_clearCaptureCompareInterrupt(uint16_t baseAddress,
1433  uint16_t captureCompareRegister);
1434 
1435 //*****************************************************************************
1436 //
1437 //! \brief Configures Timer_D in free running mode
1438 //!
1439 //! \param baseAddress is the base address of the TIMER_D module.
1440 //! \param desiredHighResFrequency selects the desired High Resolution
1441 //! frequency used.
1442 //! Valid values are:
1443 //! - \b TIMER_D_HIGHRES_64MHZ
1444 //! - \b TIMER_D_HIGHRES_128MHZ
1445 //! - \b TIMER_D_HIGHRES_200MHZ
1446 //! - \b TIMER_D_HIGHRES_256MHZ
1447 //!
1448 //! Modified bits of \b TDxHCTL1 register, bits of \b TDxHCTL0 register and
1449 //! bits of \b TDxCTL1 register.
1450 //!
1451 //! \return STATUS_SUCCESS or STATUS_FAIL
1452 //
1453 //*****************************************************************************
1454 extern uint8_t Timer_D_initHighResGeneratorInFreeRunningMode(uint16_t baseAddress,
1455  uint8_t desiredHighResFrequency);
1456 
1457 //*****************************************************************************
1458 //
1459 //! \brief Configures Timer_D in Regulated mode
1460 //!
1461 //! \param baseAddress is the base address of the TIMER_D module.
1462 //! \param param is the pointer to struct for high resolution generator in
1463 //! regulated mode.
1464 //!
1465 //! Modified bits of \b TDxHCTL0 register, bits of \b TDxCTL0 register and bits
1466 //! of \b TDxCTL1 register.
1467 //!
1468 //! \return None
1469 //
1470 //*****************************************************************************
1471 extern void Timer_D_initHighResGeneratorInRegulatedMode(uint16_t baseAddress,
1473 
1474 //*****************************************************************************
1475 //
1476 //! \brief Combine TDCCR to get PWM
1477 //!
1478 //! \param baseAddress is the base address of the TIMER_D module.
1479 //! \param param is the pointer to struct for PWM generation using two CCRs.
1480 //!
1481 //! Modified bits of \b TDxCCTLn register, bits of \b TDxCCR0 register, bits of
1482 //! \b TDxCCTL0 register, bits of \b TDxCTL0 register and bits of \b TDxCTL1
1483 //! register.
1484 //!
1485 //! \return None
1486 //
1487 //*****************************************************************************
1488 extern void Timer_D_combineTDCCRToOutputPWM(uint16_t baseAddress,
1490 
1491 //*****************************************************************************
1492 //
1493 //! \brief Selects Timer_D Latching Group
1494 //!
1495 //! \param baseAddress is the base address of the TIMER_D module.
1496 //! \param groupLatch selects the group latch
1497 //! Valid values are:
1498 //! - \b TIMER_D_GROUP_NONE [Default]
1499 //! - \b TIMER_D_GROUP_CL12_CL23_CL56
1500 //! - \b TIMER_D_GROUP_CL123_CL456
1501 //! - \b TIMER_D_GROUP_ALL
1502 //!
1503 //! Modified bits are \b TDCLGRP of \b TDxCTL0 register.
1504 //!
1505 //! \return None
1506 //
1507 //*****************************************************************************
1508 extern void Timer_D_selectLatchingGroup(uint16_t baseAddress,
1509  uint16_t groupLatch);
1510 
1511 //*****************************************************************************
1512 //
1513 //! \brief Selects Timer_D counter length
1514 //!
1515 //! \param baseAddress is the base address of the TIMER_D module.
1516 //! \param counterLength selects the value of counter length.
1517 //! Valid values are:
1518 //! - \b TIMER_D_COUNTER_16BIT [Default]
1519 //! - \b TIMER_D_COUNTER_12BIT
1520 //! - \b TIMER_D_COUNTER_10BIT
1521 //! - \b TIMER_D_COUNTER_8BIT
1522 //!
1523 //! Modified bits are \b CNTL of \b TDxCTL0 register.
1524 //!
1525 //! \return None
1526 //
1527 //*****************************************************************************
1528 extern void Timer_D_selectCounterLength(uint16_t baseAddress,
1529  uint16_t counterLength);
1530 
1531 //*****************************************************************************
1532 //
1533 //! \brief Selects Compare Latch Load Event
1534 //!
1535 //! \param baseAddress is the base address of the TIMER_D module.
1536 //! \param compareRegister selects the compare register being used.
1537 //! Valid values are:
1538 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_0
1539 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_1
1540 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_2
1541 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_3
1542 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_4
1543 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_5
1544 //! - \b TIMER_D_CAPTURECOMPARE_REGISTER_6
1545 //! \param compareLatchLoadEvent selects the latch load event
1546 //! Valid values are:
1547 //! - \b TIMER_D_LATCH_ON_WRITE_TO_TDxCCRn_COMPARE_REGISTER [Default]
1548 //! - \b TIMER_D_LATCH_WHEN_COUNTER_COUNTS_TO_0_IN_UP_OR_CONT_MODE
1549 //! - \b TIMER_D_LATCH_WHEN_COUNTER_COUNTS_TO_0_IN_UPDOWN_MODE
1550 //! - \b
1551 //! TIMER_D_LATCH_WHEN_COUNTER_COUNTS_TO_CURRENT_COMPARE_LATCH_VALUE
1552 //!
1553 //! Modified bits are \b CLLD of \b TDxCCTLn register.
1554 //!
1555 //! \return None
1556 //
1557 //*****************************************************************************
1558 extern void Timer_D_initCompareLatchLoadEvent(uint16_t baseAddress,
1559  uint16_t compareRegister,
1560  uint16_t compareLatchLoadEvent);
1561 
1562 //*****************************************************************************
1563 //
1564 //! \brief Disable High Resolution fast wakeup
1565 //!
1566 //! \param baseAddress is the base address of the TIMER_D module.
1567 //!
1568 //! Modified bits are \b TDHFW of \b TDxHCTL0 register.
1569 //!
1570 //! \return None
1571 //
1572 //*****************************************************************************
1573 extern void Timer_D_disableHighResFastWakeup(uint16_t baseAddress);
1574 
1575 //*****************************************************************************
1576 //
1577 //! \brief Enable High Resolution fast wakeup
1578 //!
1579 //! \param baseAddress is the base address of the TIMER_D module.
1580 //!
1581 //! Modified bits are \b TDHFW of \b TDxHCTL0 register.
1582 //!
1583 //! \return None
1584 //
1585 //*****************************************************************************
1586 extern void Timer_D_enableHighResFastWakeup(uint16_t baseAddress);
1587 
1588 //*****************************************************************************
1589 //
1590 //! \brief Disable High Resolution Clock Enhanced Accuracy
1591 //!
1592 //! \param baseAddress is the base address of the TIMER_D module.
1593 //!
1594 //! Modified bits are \b TDHEAEN of \b TDxHCTL0 register.
1595 //!
1596 //! \return None
1597 //
1598 //*****************************************************************************
1599 extern void Timer_D_disableHighResClockEnhancedAccuracy(uint16_t baseAddress);
1600 
1601 //*****************************************************************************
1602 //
1603 //! \brief Enable High Resolution Clock Enhanced Accuracy
1604 //!
1605 //! \param baseAddress is the base address of the TIMER_D module.
1606 //!
1607 //! Modified bits are \b TDHEAEN of \b TDxHCTL0 register.
1608 //!
1609 //! \return None
1610 //
1611 //*****************************************************************************
1612 extern void Timer_D_enableHighResClockEnhancedAccuracy(uint16_t baseAddress);
1613 
1614 //*****************************************************************************
1615 //
1616 //! \brief Disable High Resolution Clock Enhanced Accuracy
1617 //!
1618 //! High-resolution generator is on if the Timer_D counter
1619 //!
1620 //! \param baseAddress is the base address of the TIMER_D module.
1621 //!
1622 //! Modified bits are \b TDHRON of \b TDxHCTL0 register.
1623 //!
1624 //! \return None
1625 //
1626 //*****************************************************************************
1627 extern void Timer_D_disableHighResGeneratorForceON(uint16_t baseAddress);
1628 
1629 //*****************************************************************************
1630 //
1631 //! \brief Enable High Resolution Clock Enhanced Accuracy
1632 //!
1633 //! High-resolution generator is on in all Timer_D MCx modes. The PMM remains
1634 //! in high-current mode.
1635 //!
1636 //! \param baseAddress is the base address of the TIMER_D module.
1637 //!
1638 //! Modified bits are \b TDHRON of \b TDxHCTL0 register.
1639 //!
1640 //! \return None
1641 //
1642 //*****************************************************************************
1643 extern void Timer_D_enableHighResGeneratorForceON(uint16_t baseAddress);
1644 
1645 //*****************************************************************************
1646 //
1647 //! \brief Select High Resolution Coarse Clock Range
1648 //!
1649 //! \param baseAddress is the base address of the TIMER_D module.
1650 //! \param highResCoarseClockRange selects the High Resolution Coarse Clock
1651 //! Range
1652 //! Valid values are:
1653 //! - \b TIMER_D_HIGHRES_BELOW_15MHz [Default]
1654 //! - \b TIMER_D_HIGHRES_ABOVE_15MHz
1655 //!
1656 //! Modified bits are \b TDHCLKCR of \b TDxHCTL1 register.
1657 //!
1658 //! \return None
1659 //
1660 //*****************************************************************************
1661 extern void Timer_D_selectHighResCoarseClockRange(uint16_t baseAddress,
1662  uint16_t highResCoarseClockRange);
1663 
1664 //*****************************************************************************
1665 //
1666 //! \brief Select High Resolution Clock Range Selection
1667 //!
1668 //! \param baseAddress is the base address of the TIMER_D module.
1669 //! \param highResClockRange selects the High Resolution Clock Range. Refer to
1670 //! datasheet for frequency details
1671 //! Valid values are:
1672 //! - \b TIMER_D_CLOCK_RANGE0 [Default]
1673 //! - \b TIMER_D_CLOCK_RANGE1
1674 //! - \b TIMER_D_CLOCK_RANGE2
1675 //!
1676 //! \return None
1677 //
1678 //*****************************************************************************
1679 extern void Timer_D_selectHighResClockRange(uint16_t baseAddress,
1680  uint16_t highResClockRange);
1681 
1682 //*****************************************************************************
1683 //
1684 //! \brief Reads the current timer count value
1685 //!
1686 //! Reads the current count value of the timer. There is a majority vote system
1687 //! in place to confirm an accurate value is returned. The Timer_D_THRESHOLD
1688 //! #define in the corresponding header file can be modified so that the votes
1689 //! must be closer together for a consensus to occur.
1690 //!
1691 //! \param baseAddress is the base address of the TIMER_D module.
1692 //!
1693 //! \return Majority vote of timer count value
1694 //
1695 //*****************************************************************************
1696 extern uint16_t Timer_D_getCounterValue(uint16_t baseAddress);
1697 
1698 //*****************************************************************************
1699 //
1700 // Mark the end of the C bindings section for C++ compilers.
1701 //
1702 //*****************************************************************************
1703 #ifdef __cplusplus
1704 }
1705 #endif
1706 
1707 #endif
1708 #endif // __MSP430WARE_TIMER_D_H__
uint8_t highResClockMultiplyFactor
Definition: timer_d.h:301
uint16_t captureMode
Definition: timer_d.h:403
uint16_t timerPeriod
Is the specified timer period.
Definition: timer_d.h:235
void Timer_D_disableCaptureCompareInterrupt(uint16_t baseAddress, uint16_t captureCompareRegister)
Disable capture compare interrupt.
Definition: timer_d.c:192
uint16_t compareOutputMode
Definition: timer_d.h:130
uint16_t timerClear
Definition: timer_d.h:251
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:260
void Timer_D_clearHighResInterrupt(uint16_t baseAddress, uint16_t mask)
Clears High Resolution interrupt status.
Definition: timer_d.c:219
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:207
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:260
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:155
uint16_t timerInterruptEnable_TDIE
Definition: timer_d.h:240
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:245
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:320
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:328
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:179
uint16_t clockSourceDivider
Definition: timer_d.h:290
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:227
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:204
Used in the Timer_D_initUpDownMode() function as the param parameter.
Definition: timer_d.h:197
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:161
uint16_t timerInterruptEnable_TDIE
Definition: timer_d.h:182
uint16_t dutyCycle
Specifies the dutycycle for the generated waveform.
Definition: timer_d.h:505
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:227
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:276
void Timer_D_disableHighResInterrupt(uint16_t baseAddress, uint16_t mask)
Disable High Resolution interrupt.
Definition: timer_d.c:173
uint16_t clockingMode
Definition: timer_d.h:76
uint16_t timerClear
Definition: timer_d.h:95
uint16_t clockingMode
Definition: timer_d.h:233
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:199
uint16_t clockSource
Definition: timer_d.h:267
void Timer_D_enableCaptureCompareInterrupt(uint16_t baseAddress, uint16_t captureCompareRegister)
Enable capture compare interrupt.
Definition: timer_d.c:184
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:296
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:252
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:341
void Timer_D_stop(uint16_t baseAddress)
Stops the timer.
Definition: timer_d.c:315
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:214
uint16_t timerClear
Definition: timer_d.h:188
void Timer_D_disableTimerInterrupt(uint16_t baseAddress)
Disable timer interrupt.
Definition: timer_d.c:168
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:333
uint8_t Timer_D_getCaptureCompareInputSignal(uint16_t baseAddress, uint16_t captureCompareRegister)
Get current capturecompare input signal.
Definition: timer_d.c:268
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:240
void Timer_D_disableHighResFastWakeup(uint16_t baseAddress)
Disable High Resolution fast wakeup.
Definition: timer_d.c:467
uint8_t highResClockDivider
Definition: timer_d.h:308
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 2015, Texas Instruments Incorporated