WatchdogMSP432E4.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017-2019, 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  */
32 /*!****************************************************************************
33  * @file WatchdogMSP432E4.h
34  *
35  * @brief Watchdog driver implementation for MSP432E4
36  *
37  * The Watchdog header file for MSP432E4 should be included in an application
38  * as follows:
39  * @code
40  * #include <ti/drivers/Watchdog.h>
41  * #include <ti/drivers/watchdog/WatchdogMSP432E4.h>
42  * @endcode
43  *
44  * Refer to @ref Watchdog.h for a complete description of APIs.
45  *
46  * ## Overview #
47  * This Watchdog driver implementation is designed to operate on a MSP432E4
48  * device. Once opened, MSP432E4 Watchdog will count down from the reload
49  * value specified in the WatchdogMSP432E4_HWAttrs. If it times out, the
50  * Watchdog interrupt flag will be set, and a user-provided callback function
51  * will be called. If resets have been enabled in the #Watchdog_Params and
52  * the Watchdog Timer is allowed to timeout again while the interrupt flag is
53  * still pending, a reset signal will be generated. To prevent a reset,
54  * Watchdog_clear() must be called to clear the interrupt flag.
55  *
56  * @warning The watchdog peripheral does not support a Non-Maskable Interrupt (NMI).
57  *
58  * The reload value from which the Watchdog Timer counts down may be changed
59  * during runtime using Watchdog_setReload().
60  *
61  * Watchdog_close() is <b>not</b> supported by this driver implementation.
62  *
63  * By default the Watchdog driver has resets turned on. However, they may be
64  * turned off in the #Watchdog_Params which allows the Watchdog Timer to be
65  * used like another timer interrupt. This functionality is <b>not</b>
66  * supported by all platforms, refer to device specific documentation for
67  * details.
68  *
69  * To have a user-defined function run at the warning interrupt, first define
70  * a void-type function that takes a Watchdog_Handle cast to a uintptr_t as an
71  * argument such as the one shown below.
72  *
73  * @code
74  * void callback(uintptr_t handle);
75  *
76  * ...
77  *
78  * Watchdog_Handle handle;
79  * Watchdog_Params params;
80  *
81  * Watchdog_Params_init(&params);
82  * params.callbackFxn = callback;
83  * handle = Watchdog_open(CONFIG_WATCHDOG0, &params);
84  * @endcode
85  ******************************************************************************
86  */
87 #ifndef ti_drivers_watchdog_WatchdogMSP432E4__include
88 #define ti_drivers_watchdog_WatchdogMSP432E4__include
89 
90 #include <stdbool.h>
91 #include <stdint.h>
92 
93 #include <ti/drivers/Watchdog.h>
94 
95 #ifdef __cplusplus
96 extern "C" {
97 #endif
98 
109 /* Add WatchdogMSP432E4_STATUS_* macros here */
110 
123 /* Add WatchdogMSP432E4_CMD_* macros here */
124 
129 
165 typedef struct {
166  uint32_t baseAddr;
167  uint32_t intNum;
168  uint32_t intPriority;
169  uint32_t reloadValue;
171 
177 typedef struct {
178  bool isOpen; /* Flag for open/close status */
180 
181 #ifdef __cplusplus
182 }
183 #endif
184 
185 #endif /* ti_drivers_watchdog_WatchdogMSP432E4__include */
uint32_t intNum
Definition: WatchdogMSP432E4.h:167
Watchdog driver interface.
Watchdog hardware attributes for MSP432E4.
Definition: WatchdogMSP432E4.h:165
uint32_t intPriority
Definition: WatchdogMSP432E4.h:168
const Watchdog_FxnTable WatchdogMSP432E4_fxnTable
Watchdog function table for MSP432E4.
uint32_t baseAddr
Definition: WatchdogMSP432E4.h:166
uint32_t reloadValue
Definition: WatchdogMSP432E4.h:169
bool isOpen
Definition: WatchdogMSP432E4.h:178
Watchdog Object for MSP432E4.
Definition: WatchdogMSP432E4.h:177
The definition of a Watchdog function table that contains the required set of functions to control a ...
Definition: Watchdog.h:362
© Copyright 1995-2020, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale