wdt_a.h
Go to the documentation of this file.
1 /* --COPYRIGHT--,BSD
2  * Copyright (c) 2017, Texas Instruments Incorporated
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution.
15  *
16  * * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  * --/COPYRIGHT--*/
32 #ifndef __WATCHDOG_H__
33 #define __WATCHDOG_H__
34 
35 //*****************************************************************************
36 //
39 //
40 //*****************************************************************************
41 
42 //*****************************************************************************
43 //
44 // If building with a C++ compiler, make all of the definitions in this header
45 // have a C binding.
46 //
47 //*****************************************************************************
48 #ifdef __cplusplus
49 extern "C"
50 {
51 #endif
52 
53 /* Includes */
54 #include <ti/devices/msp432p4xx/inc/msp.h>
55 #include <stdint.h>
56 
57 #ifdef __MCU_HAS_SYSCTL_A__
58 
59 #define WDT_A_HARD_RESET SYSCTL_A_HARD_RESET
60 #define WDT_A_SOFT_RESET SYSCTL_A_SOFT_RESET
61 
62 #else
63 
64 #define WDT_A_HARD_RESET SYSCTL_HARD_RESET
65 #define WDT_A_SOFT_RESET SYSCTL_SOFT_RESET
66 
67 #endif
68 
69 //*****************************************************************************
70 //
71 // The following are values that can be passed to the clockSelect parameter for
72 // functions: WDT_A_watchdogTimerInit(), and WDT_A_intervalTimerInit().
73 //
74 //*****************************************************************************
75 #define WDT_A_CLOCKSOURCE_SMCLK (WDT_A_CTL_SSEL_0)
76 #define WDT_A_CLOCKSOURCE_ACLK (WDT_A_CTL_SSEL_1)
77 #define WDT_A_CLOCKSOURCE_VLOCLK (WDT_A_CTL_SSEL_2)
78 #define WDT_A_CLOCKSOURCE_BCLK (WDT_A_CTL_SSEL_3)
79 
80 //*****************************************************************************
81 //
82 // The following are values that can be passed to the clockDivider parameter
83 // for functions: WDT_A_watchdogTimerInit(), and WDT_A_intervalTimerInit().
84 //
85 //*****************************************************************************
86 #define WDT_A_CLOCKDIVIDER_2G (WDT_A_CTL_IS_0)
87 #define WDT_A_CLOCKDIVIDER_128M (WDT_A_CTL_IS_1)
88 #define WDT_A_CLOCKDIVIDER_8192K (WDT_A_CTL_IS_2)
89 #define WDT_A_CLOCKDIVIDER_512K (WDT_A_CTL_IS_3)
90 #define WDT_A_CLOCKDIVIDER_32K (WDT_A_CTL_IS_4)
91 #define WDT_A_CLOCKDIVIDER_8192 (WDT_A_CTL_IS_5)
92 #define WDT_A_CLOCKDIVIDER_512 (WDT_A_CTL_IS_6)
93 #define WDT_A_CLOCKDIVIDER_64 (WDT_A_CTL_IS_7)
94 #define WDT_A_CLOCKITERATIONS_2G WDT_A_CLOCKDIVIDER_2G
95 #define WDT_A_CLOCKITERATIONS_128M WDT_A_CLOCKDIVIDER_128M
96 #define WDT_A_CLOCKITERATIONS_8192K WDT_A_CLOCKDIVIDER_8192K
97 #define WDT_A_CLOCKITERATIONS_512K WDT_A_CLOCKDIVIDER_512K
98 #define WDT_A_CLOCKITERATIONS_32K WDT_A_CLOCKDIVIDER_32K
99 #define WDT_A_CLOCKITERATIONS_8192 WDT_A_CLOCKDIVIDER_8192
100 #define WDT_A_CLOCKITERATIONS_512 WDT_A_CLOCKDIVIDER_512
101 #define WDT_A_CLOCKITERATIONS_64 WDT_A_CLOCKDIVIDER_64
102 
103 //*****************************************************************************
104 //
105 // Prototypes for the APIs.
106 //
107 //*****************************************************************************
108 
109 //*****************************************************************************
110 //
117 //
118 //*****************************************************************************
119 extern void WDT_A_holdTimer(void);
120 
121 //*****************************************************************************
122 //
128 //
129 //*****************************************************************************
130 extern void WDT_A_startTimer(void);
131 
132 //*****************************************************************************
133 //
140 //
141 //*****************************************************************************
142 extern void WDT_A_clearTimer(void);
143 
144 //*****************************************************************************
145 //
171 //
172 //*****************************************************************************
173 extern void WDT_A_initWatchdogTimer(uint_fast8_t clockSelect,
174  uint_fast8_t clockDivider);
175 
176 //*****************************************************************************
177 //
202 //
203 //*****************************************************************************
204 extern void WDT_A_initIntervalTimer(uint_fast8_t clockSelect,
205  uint_fast8_t clockDivider);
206 
207 //*****************************************************************************
208 //
215 //
216 //*****************************************************************************
217 extern void WDT_A_registerInterrupt(void (*intHandler)(void));
218 
219 //*****************************************************************************
220 //
231 //
232 //*****************************************************************************
233 extern void WDT_A_unregisterInterrupt(void);
234 
235 //*****************************************************************************
236 //
247 //
248 //
249 //*****************************************************************************
250 extern void WDT_A_setPasswordViolationReset(uint_fast8_t resetType);
251 
252 //*****************************************************************************
253 //
263 //
264 //
265 //*****************************************************************************
266 extern void WDT_A_setTimeoutReset(uint_fast8_t resetType);
267 
268 /* Defines for future devices that might have multiple instances */
269 #define WDT_A_holdTimerMultipleTimer(a) WDT_A_holdTimer()
270 #define WDT_A_startTimerMultipleTimer(a) WDT_A_startTimer()
271 #define WDT_A_resetTimerMultipleTimer(a) WDT_A_clearTimer()
272 #define WDT_A_initWatchdogTimerMultipleTimer(a,b,c) WDT_A_initWatchdogTimer(b,c)
273 #define WDT_A_initIntervalTimerMultipleTimer(a,b,c) WDT_A_initIntervalTimer(b,c)
274 #define WDT_A_registerInterruptMultipleTimer(a,b) WDT_A_registerInterrupt(b)
275 #define WDT_A_unregisterInterruptMultipleTimer(a) WDT_A_unregisterInterrupt()
276 
277 /* Backwards compatibility layer */
278 #define WDT_A_hold WDT_A_holdTimerMultipleTimer
279 #define WDT_A_start WDT_A_startTimerMultipleTimer
280 #define WDT_A_resetTimer WDT_A_resetTimerMultipleTimer
281 #define WDT_A_watchdogTimerInit WDT_A_initWatchdogTimerMultipleTimer
282 #define WDT_A_intervalTimerInit WDT_A_initIntervalTimerMultipleTimer
283 
284 //*****************************************************************************
285 //
286 // Mark the end of the C bindings section for C++ compilers.
287 //
288 //*****************************************************************************
289 #ifdef __cplusplus
290 }
291 #endif
292 
293 //*****************************************************************************
294 //
295 // Close the Doxygen group.
297 //
298 //*****************************************************************************
299 
300 #endif // __WATCHDOG_H__
void WDT_A_initWatchdogTimer(uint_fast8_t clockSelect, uint_fast8_t clockDivider)
Definition: wdt_a.c:71
void WDT_A_setPasswordViolationReset(uint_fast8_t resetType)
Definition: wdt_a.c:86
void WDT_A_startTimer(void)
Definition: wdt_a.c:55
void WDT_A_initIntervalTimer(uint_fast8_t clockSelect, uint_fast8_t clockDivider)
Definition: wdt_a.c:78
void WDT_A_setTimeoutReset(uint_fast8_t resetType)
Definition: wdt_a.c:95
void WDT_A_unregisterInterrupt(void)
Definition: wdt_a.c:117
void WDT_A_registerInterrupt(void(*intHandler)(void))
Definition: wdt_a.c:104
void WDT_A_holdTimer(void)
Definition: wdt_a.c:47
void WDT_A_clearTimer(void)
Definition: wdt_a.c:63

Copyright 2019, Texas Instruments Incorporated