wdt_a.h
Go to the documentation of this file.
1 #ifndef __WATCHDOG_H__
2 #define __WATCHDOG_H__
3 
4 //*****************************************************************************
5 //
8 //
9 //*****************************************************************************
10 
11 //*****************************************************************************
12 //
13 // If building with a C++ compiler, make all of the definitions in this header
14 // have a C binding.
15 //
16 //*****************************************************************************
17 #ifdef __cplusplus
18 extern "C"
19 {
20 #endif
21 
22 #include <msp.h>
23 #include <stdint.h>
24 #include "sysctl.h"
25 
26 #define WDT_A_HARD_RESET SYSCTL_HARD_RESET
27 #define WDT_A_SOFT_RESET SYSCTL_SOFT_RESET
28 
29 //*****************************************************************************
30 //
31 // The following are values that can be passed to the clockSelect parameter for
32 // functions: WDT_A_watchdogTimerInit(), and WDT_A_intervalTimerInit().
33 //
34 //*****************************************************************************
35 #define WDT_A_CLOCKSOURCE_SMCLK (WDT_A_CTL_SSEL_0)
36 #define WDT_A_CLOCKSOURCE_ACLK (WDT_A_CTL_SSEL_1)
37 #define WDT_A_CLOCKSOURCE_VLOCLK (WDT_A_CTL_SSEL_2)
38 #define WDT_A_CLOCKSOURCE_XCLK (WDT_A_CTL_SSEL_3)
39 #define WDT_A_CLOCKSOURCE_BCLK (WDT_A_CTL_SSEL_4)
40 
41 //*****************************************************************************
42 //
43 // The following are values that can be passed to the clockDivider parameter
44 // for functions: WDT_A_watchdogTimerInit(), and WDT_A_intervalTimerInit().
45 //
46 //*****************************************************************************
47 #define WDT_A_CLOCKDIVIDER_2G (WDT_A_CTL_IS_0)
48 #define WDT_A_CLOCKDIVIDER_128M (WDT_A_CTL_IS_1)
49 #define WDT_A_CLOCKDIVIDER_8192K (WDT_A_CTL_IS_2)
50 #define WDT_A_CLOCKDIVIDER_512K (WDT_A_CTL_IS_3)
51 #define WDT_A_CLOCKDIVIDER_32K (WDT_A_CTL_IS_4)
52 #define WDT_A_CLOCKDIVIDER_8192 (WDT_A_CTL_IS_5)
53 #define WDT_A_CLOCKDIVIDER_512 (WDT_A_CTL_IS_6)
54 #define WDT_A_CLOCKDIVIDER_64 (WDT_A_CTL_IS_7)
55 #define WDT_A_CLOCKITERATIONS_2G WDT_A_CLOCKDIVIDER_2G
56 #define WDT_A_CLOCKITERATIONS_128M WDT_A_CLOCKDIVIDER_128M
57 #define WDT_A_CLOCKITERATIONS_8192K WDT_A_CLOCKDIVIDER_8192K
58 #define WDT_A_CLOCKITERATIONS_512K WDT_A_CLOCKDIVIDER_512K
59 #define WDT_A_CLOCKITERATIONS_32K WDT_A_CLOCKDIVIDER_32K
60 #define WDT_A_CLOCKITERATIONS_8192 WDT_A_CLOCKDIVIDER_8192
61 #define WDT_A_CLOCKITERATIONS_512 WDT_A_CLOCKDIVIDER_512
62 #define WDT_A_CLOCKITERATIONS_64 WDT_A_CLOCKDIVIDER_64
63 
64 //*****************************************************************************
65 //
66 // Prototypes for the APIs.
67 //
68 //*****************************************************************************
69 
70 //*****************************************************************************
71 //
78 //
79 //*****************************************************************************
80 extern void WDT_A_holdTimer(void);
81 
82 //*****************************************************************************
83 //
89 //
90 //*****************************************************************************
91 extern void WDT_A_startTimer(void);
92 
93 //*****************************************************************************
94 //
101 //
102 //*****************************************************************************
103 extern void WDT_A_clearTimer(void);
104 
105 //*****************************************************************************
106 //
132 //
133 //*****************************************************************************
134 extern void WDT_A_initWatchdogTimer(uint_fast8_t clockSelect,
135  uint_fast8_t clockDivider);
136 
137 //*****************************************************************************
138 //
163 //
164 //*****************************************************************************
165 extern void WDT_A_initIntervalTimer(uint_fast8_t clockSelect,
166  uint_fast8_t clockDivider);
167 
168 //*****************************************************************************
169 //
176 //
177 //*****************************************************************************
178 extern void WDT_A_registerInterrupt(void (*intHandler)(void));
179 
180 //*****************************************************************************
181 //
192 //
193 //*****************************************************************************
194 extern void WDT_A_unregisterInterrupt(void);
195 
196 //*****************************************************************************
197 //
208 //
209 //
210 //*****************************************************************************
211 extern void WDT_A_setPasswordViolationReset(uint_fast8_t resetType);
212 
213 //*****************************************************************************
214 //
224 //
225 //
226 //*****************************************************************************
227 extern void WDT_A_setTimeoutReset(uint_fast8_t resetType);
228 
229 /* Defines for future devices that might have multiple instances */
230 #define WDT_A_holdTimerMultipleTimer(a) WDT_A_holdTimer()
231 #define WDT_A_startTimerMultipleTimer(a) WDT_A_startTimer()
232 #define WDT_A_resetTimerMultipleTimer(a) WDT_A_clearTimer()
233 #define WDT_A_initWatchdogTimerMultipleTimer(a,b,c) WDT_A_initWatchdogTimer(b,c)
234 #define WDT_A_initIntervalTimerMultipleTimer(a,b,c) WDT_A_initIntervalTimer(b,c)
235 #define WDT_A_registerInterruptMultipleTimer(a,b) WDT_A_registerInterrupt(b)
236 #define WDT_A_unregisterInterruptMultipleTimer(a) WDT_A_unregisterInterrupt()
237 
238 /* Backwards compatibility layer */
239 #define WDT_A_hold WDT_A_holdTimerMultipleTimer
240 #define WDT_A_start WDT_A_startTimerMultipleTimer
241 #define WDT_A_resetTimer WDT_A_resetTimerMultipleTimer
242 #define WDT_A_watchdogTimerInit WDT_A_initWatchdogTimerMultipleTimer
243 #define WDT_A_intervalTimerInit WDT_A_initIntervalTimerMultipleTimer
244 
245 //*****************************************************************************
246 //
247 // Mark the end of the C bindings section for C++ compilers.
248 //
249 //*****************************************************************************
250 #ifdef __cplusplus
251 }
252 #endif
253 
254 //*****************************************************************************
255 //
256 // Close the Doxygen group.
258 //
259 //*****************************************************************************
260 
261 #endif // __WATCHDOG_H__
void WDT_A_initWatchdogTimer(uint_fast8_t clockSelect, uint_fast8_t clockDivider)
Definition: wdt_a.c:33
void WDT_A_setPasswordViolationReset(uint_fast8_t resetType)
Definition: wdt_a.c:48
void WDT_A_startTimer(void)
Definition: wdt_a.c:17
void WDT_A_initIntervalTimer(uint_fast8_t clockSelect, uint_fast8_t clockDivider)
Definition: wdt_a.c:40
void WDT_A_setTimeoutReset(uint_fast8_t resetType)
Definition: wdt_a.c:53
void WDT_A_unregisterInterrupt(void)
Definition: wdt_a.c:71
void WDT_A_registerInterrupt(void(*intHandler)(void))
Definition: wdt_a.c:58
void WDT_A_holdTimer(void)
Definition: wdt_a.c:9
void WDT_A_clearTimer(void)
Definition: wdt_a.c:25

Copyright 2016, Texas Instruments Incorporated