MSP430 DriverLib for MSP430FR57xx Devices  2.10.00.09
 All Data Structures Functions Variables Modules Pages
wdt_a.h
1 //*****************************************************************************
2 //
3 // wdt_a.h - Driver for the WDT_A Module.
4 //
5 //*****************************************************************************
6 
7 #ifndef __MSP430WARE_WDT_A_H__
8 #define __MSP430WARE_WDT_A_H__
9 
10 #include "inc/hw_memmap.h"
11 
12 #ifdef __MSP430_HAS_WDT_A__
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 //*****************************************************************************
26 //
27 // The following are values that can be passed to the clockSelect parameter for
28 // functions: WDT_A_initWatchdogTimer(), and WDT_A_initIntervalTimer().
29 //
30 //*****************************************************************************
31 #define WDT_A_CLOCKSOURCE_SMCLK (WDTSSEL_0)
32 #define WDT_A_CLOCKSOURCE_ACLK (WDTSSEL_1)
33 #define WDT_A_CLOCKSOURCE_VLOCLK (WDTSSEL_2)
34 #define WDT_A_CLOCKSOURCE_XCLK (WDTSSEL_3)
35 
36 //*****************************************************************************
37 //
38 // The following are values that can be passed to the clockDivider parameter
39 // for functions: WDT_A_initWatchdogTimer(), and WDT_A_initIntervalTimer().
40 //
41 //*****************************************************************************
42 #define WDT_A_CLOCKDIVIDER_2G (WDTIS_0)
43 #define WDT_A_CLOCKDIVIDER_128M (WDTIS_1)
44 #define WDT_A_CLOCKDIVIDER_8192K (WDTIS_2)
45 #define WDT_A_CLOCKDIVIDER_512K (WDTIS_3)
46 #define WDT_A_CLOCKDIVIDER_32K (WDTIS_4)
47 #define WDT_A_CLOCKDIVIDER_8192 (WDTIS_5)
48 #define WDT_A_CLOCKDIVIDER_512 (WDTIS_6)
49 #define WDT_A_CLOCKDIVIDER_64 (WDTIS_7)
50 
51 //*****************************************************************************
52 //
53 // Prototypes for the APIs.
54 //
55 //*****************************************************************************
56 
57 //*****************************************************************************
58 //
59 //! \brief Holds the Watchdog Timer.
60 //!
61 //! This function stops the watchdog timer from running, that way no interrupt
62 //! or PUC is asserted.
63 //!
64 //! \param baseAddress is the base address of the WDT_A module.
65 //!
66 //! \return None
67 //
68 //*****************************************************************************
69 extern void WDT_A_hold(uint16_t baseAddress);
70 
71 //*****************************************************************************
72 //
73 //! \brief Starts the Watchdog Timer.
74 //!
75 //! This function starts the watchdog timer functionality to start counting
76 //! again.
77 //!
78 //! \param baseAddress is the base address of the WDT_A module.
79 //!
80 //! \return None
81 //
82 //*****************************************************************************
83 extern void WDT_A_start(uint16_t baseAddress);
84 
85 //*****************************************************************************
86 //
87 //! \brief Resets the timer counter of the Watchdog Timer.
88 //!
89 //! This function resets the watchdog timer to 0x0000h.
90 //!
91 //! \param baseAddress is the base address of the WDT_A module.
92 //!
93 //! \return None
94 //
95 //*****************************************************************************
96 extern void WDT_A_resetTimer(uint16_t baseAddress);
97 
98 //*****************************************************************************
99 //
100 //! \brief Sets the clock source for the Watchdog Timer in watchdog mode.
101 //!
102 //! This function sets the watchdog timer in watchdog mode, which will cause a
103 //! PUC when the timer overflows. When in the mode, a PUC can be avoided with a
104 //! call to WDT_A_resetTimer() before the timer runs out.
105 //!
106 //! \param baseAddress is the base address of the WDT_A module.
107 //! \param clockSelect is the clock source that the watchdog timer will use.
108 //! Valid values are:
109 //! - \b WDT_A_CLOCKSOURCE_SMCLK [Default]
110 //! - \b WDT_A_CLOCKSOURCE_ACLK
111 //! - \b WDT_A_CLOCKSOURCE_VLOCLK
112 //! - \b WDT_A_CLOCKSOURCE_XCLK
113 //! \n Modified bits are \b WDTSSEL of \b WDTCTL register.
114 //! \param clockDivider is the divider of the clock source, in turn setting the
115 //! watchdog timer interval.
116 //! Valid values are:
117 //! - \b WDT_A_CLOCKDIVIDER_2G
118 //! - \b WDT_A_CLOCKDIVIDER_128M
119 //! - \b WDT_A_CLOCKDIVIDER_8192K
120 //! - \b WDT_A_CLOCKDIVIDER_512K
121 //! - \b WDT_A_CLOCKDIVIDER_32K [Default]
122 //! - \b WDT_A_CLOCKDIVIDER_8192
123 //! - \b WDT_A_CLOCKDIVIDER_512
124 //! - \b WDT_A_CLOCKDIVIDER_64
125 //! \n Modified bits are \b WDTIS and \b WDTHOLD of \b WDTCTL register.
126 //!
127 //! \return None
128 //
129 //*****************************************************************************
130 extern void WDT_A_initWatchdogTimer(uint16_t baseAddress,
131  uint8_t clockSelect,
132  uint8_t clockDivider);
133 
134 //*****************************************************************************
135 //
136 //! \brief Sets the clock source for the Watchdog Timer in timer interval mode.
137 //!
138 //! This function sets the watchdog timer as timer interval mode, which will
139 //! assert an interrupt without causing a PUC.
140 //!
141 //! \param baseAddress is the base address of the WDT_A module.
142 //! \param clockSelect is the clock source that the watchdog timer will use.
143 //! Valid values are:
144 //! - \b WDT_A_CLOCKSOURCE_SMCLK [Default]
145 //! - \b WDT_A_CLOCKSOURCE_ACLK
146 //! - \b WDT_A_CLOCKSOURCE_VLOCLK
147 //! - \b WDT_A_CLOCKSOURCE_XCLK
148 //! \n Modified bits are \b WDTSSEL of \b WDTCTL register.
149 //! \param clockDivider is the divider of the clock source, in turn setting the
150 //! watchdog timer interval.
151 //! Valid values are:
152 //! - \b WDT_A_CLOCKDIVIDER_2G
153 //! - \b WDT_A_CLOCKDIVIDER_128M
154 //! - \b WDT_A_CLOCKDIVIDER_8192K
155 //! - \b WDT_A_CLOCKDIVIDER_512K
156 //! - \b WDT_A_CLOCKDIVIDER_32K [Default]
157 //! - \b WDT_A_CLOCKDIVIDER_8192
158 //! - \b WDT_A_CLOCKDIVIDER_512
159 //! - \b WDT_A_CLOCKDIVIDER_64
160 //! \n Modified bits are \b WDTIS and \b WDTHOLD of \b WDTCTL register.
161 //!
162 //! \return None
163 //
164 //*****************************************************************************
165 extern void WDT_A_initIntervalTimer(uint16_t baseAddress,
166  uint8_t clockSelect,
167  uint8_t clockDivider);
168 
169 //*****************************************************************************
170 //
171 // Mark the end of the C bindings section for C++ compilers.
172 //
173 //*****************************************************************************
174 #ifdef __cplusplus
175 }
176 #endif
177 
178 #endif
179 #endif // __MSP430WARE_WDT_A_H__
void WDT_A_initWatchdogTimer(uint16_t baseAddress, uint8_t clockSelect, uint8_t clockDivider)
Sets the clock source for the Watchdog Timer in watchdog mode.
Definition: wdt_a.c:48
void WDT_A_resetTimer(uint16_t baseAddress)
Resets the timer counter of the Watchdog Timer.
Definition: wdt_a.c:39
void WDT_A_initIntervalTimer(uint16_t baseAddress, uint8_t clockSelect, uint8_t clockDivider)
Sets the clock source for the Watchdog Timer in timer interval mode.
Definition: wdt_a.c:56
void WDT_A_hold(uint16_t baseAddress)
Holds the Watchdog Timer.
Definition: wdt_a.c:21
void WDT_A_start(uint16_t baseAddress)
Starts the Watchdog Timer.
Definition: wdt_a.c:30

Copyright 2015, Texas Instruments Incorporated