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 /* Forward compatibility layer */
65 #ifdef __MCU_HAS_SYSCTL_A__
66 
67 #define SysCtl_setWDTPasswordViolationResetType SysCtl_A_setWDTPasswordViolationResetType
68 #define SysCtl_setWDTTimeoutResetType SysCtl_A_setWDTTimeoutResetType
69 
70 #endif
71 
72 
73 //*****************************************************************************
74 //
75 // Prototypes for the APIs.
76 //
77 //*****************************************************************************
78 
79 //*****************************************************************************
80 //
87 //
88 //*****************************************************************************
89 extern void WDT_A_holdTimer(void);
90 
91 //*****************************************************************************
92 //
98 //
99 //*****************************************************************************
100 extern void WDT_A_startTimer(void);
101 
102 //*****************************************************************************
103 //
110 //
111 //*****************************************************************************
112 extern void WDT_A_clearTimer(void);
113 
114 //*****************************************************************************
115 //
141 //
142 //*****************************************************************************
143 extern void WDT_A_initWatchdogTimer(uint_fast8_t clockSelect,
144  uint_fast8_t clockDivider);
145 
146 //*****************************************************************************
147 //
172 //
173 //*****************************************************************************
174 extern void WDT_A_initIntervalTimer(uint_fast8_t clockSelect,
175  uint_fast8_t clockDivider);
176 
177 //*****************************************************************************
178 //
185 //
186 //*****************************************************************************
187 extern void WDT_A_registerInterrupt(void (*intHandler)(void));
188 
189 //*****************************************************************************
190 //
201 //
202 //*****************************************************************************
203 extern void WDT_A_unregisterInterrupt(void);
204 
205 //*****************************************************************************
206 //
217 //
218 //
219 //*****************************************************************************
220 extern void WDT_A_setPasswordViolationReset(uint_fast8_t resetType);
221 
222 //*****************************************************************************
223 //
233 //
234 //
235 //*****************************************************************************
236 extern void WDT_A_setTimeoutReset(uint_fast8_t resetType);
237 
238 /* Defines for future devices that might have multiple instances */
239 #define WDT_A_holdTimerMultipleTimer(a) WDT_A_holdTimer()
240 #define WDT_A_startTimerMultipleTimer(a) WDT_A_startTimer()
241 #define WDT_A_resetTimerMultipleTimer(a) WDT_A_clearTimer()
242 #define WDT_A_initWatchdogTimerMultipleTimer(a,b,c) WDT_A_initWatchdogTimer(b,c)
243 #define WDT_A_initIntervalTimerMultipleTimer(a,b,c) WDT_A_initIntervalTimer(b,c)
244 #define WDT_A_registerInterruptMultipleTimer(a,b) WDT_A_registerInterrupt(b)
245 #define WDT_A_unregisterInterruptMultipleTimer(a) WDT_A_unregisterInterrupt()
246 
247 /* Backwards compatibility layer */
248 #define WDT_A_hold WDT_A_holdTimerMultipleTimer
249 #define WDT_A_start WDT_A_startTimerMultipleTimer
250 #define WDT_A_resetTimer WDT_A_resetTimerMultipleTimer
251 #define WDT_A_watchdogTimerInit WDT_A_initWatchdogTimerMultipleTimer
252 #define WDT_A_intervalTimerInit WDT_A_initIntervalTimerMultipleTimer
253 
254 //*****************************************************************************
255 //
256 // Mark the end of the C bindings section for C++ compilers.
257 //
258 //*****************************************************************************
259 #ifdef __cplusplus
260 }
261 #endif
262 
263 //*****************************************************************************
264 //
265 // Close the Doxygen group.
267 //
268 //*****************************************************************************
269 
270 #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