WatchdogMSP432.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015-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 WatchdogMSP432.h
34  *
35  * @brief Watchdog driver implementation for MSP432
36  *
37  * The Watchdog header file for MSP432 should be included in an application
38  * as follows:
39  * @code
40  * #include <ti/drivers/Watchdog.h>
41  * #include <ti/drivers/watchdog/WatchdogMSP432.h>
42  * @endcode
43  *
44  * Refer to @ref Watchdog.h for a complete description of APIs & example of
45  * use.
46  *
47  * ## Overview #
48  * The MSP432 Watchdog Timer will cause resets at an interval based on the
49  * count calculated from the clock source and clock divider specified in the
50  * WatchdogMSP432_HWAttrs. By default the Watchdog driver has resets turned on.
51  * This means that if Watchdog_clear() is not called to reset the Watchdog
52  * timer before it times out, a reset will be generated. Watchdog_close() will
53  * stop the Watchdog timer. To restart it again, Watchdog_open() must be
54  * called.
55  *
56  * Opening the Watchdog driver with resets turned off (Using the
57  * #Watchdog_Params.resetMode parameter) allows the Watchdog Timer to be used
58  * like another timer interrupt. The callback fxn provided in the params will
59  * be executed when the timer expires.
60  *
61  * @warning The watchdog peripheral does not support a Non-Maskable Interrupt (NMI).
62  *
63  * ## Unsupported Functionality #
64  * 1. #Watchdog_Params.debugStallMode is not supported by this implementation.
65  * 2. #Watchdog_Params.callbackFxn is not supported when using
66  * #Watchdog_RESET_ON mode.
67  * 3. Watchdog_setReload() and Watchdog_convertMsToTicks() APIs are not
68  * supported by this implementation.
69  ******************************************************************************
70  */
71 
72 #ifndef ti_drivers_watchdog_WatchdogMSP432__include
73 #define ti_drivers_watchdog_WatchdogMSP432__include
74 
75 #include <stdint.h>
76 #include <stdbool.h>
77 
78 #include <ti/drivers/Watchdog.h>
79 
80 #include <ti/drivers/dpl/HwiP.h>
81 
82 #ifdef __cplusplus
83 extern "C" {
84 #endif
85 
96 /* Add WatchdogMSP432_STATUS_* macros here */
97 
110 /* Add WatchdogMSP432_CMD_* macros here */
111 
116 
146 typedef struct {
147  uint32_t baseAddr;
148  uint8_t intNum;
149  uint8_t intPriority;
150  uint8_t clockSource;
151  uint8_t clockDivider;
153 
159 typedef struct {
161  HwiP_Handle hwiHandle;
162  bool isOpen; /* Flag for open/close status */
164 
165 #ifdef __cplusplus
166 }
167 #endif
168 
169 #endif /* ti_drivers_watchdog_WatchdogMSP432__include */
uint8_t clockSource
Definition: WatchdogMSP432.h:150
uint8_t intPriority
Definition: WatchdogMSP432.h:149
bool isOpen
Definition: WatchdogMSP432.h:162
HwiP_Handle hwiHandle
Definition: WatchdogMSP432.h:161
Watchdog hardware attributes for MSP432 These fields are used by driverlib APIs and therefore must be...
Definition: WatchdogMSP432.h:146
Watchdog driver interface.
uint8_t clockDivider
Definition: WatchdogMSP432.h:151
const Watchdog_FxnTable WatchdogMSP432_fxnTable
Watchdog function table for MSP432.
uint32_t baseAddr
Definition: WatchdogMSP432.h:147
uint8_t intNum
Definition: WatchdogMSP432.h:148
Watchdog_ResetMode resetMode
Definition: WatchdogMSP432.h:160
The definition of a Watchdog function table that contains the required set of functions to control a ...
Definition: Watchdog.h:362
Watchdog_ResetMode
Watchdog reset mode settings.
Definition: Watchdog.h:276
Watchdog Object for MSP432.
Definition: WatchdogMSP432.h:159
© Copyright 1995-2019, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale