WatchdogMSP432.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015-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  */
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 resetMode
57  * parameter) allows the Watchdog Timer to be used like another timer
58  * interrupt. The callback fxn provided in the params will be executed when
59  * the timer expires.
60  *
61  * ## Unsupported Functionality #
62  * 1. Watchdog_Params debugStallMode is not supported by this implementation.
63  * 2. Watchdog_Params callbackFxn is not supported when using
64  * Watchdog_RESET_ON mode.
65  * 3. Watchdog_setReload() and WatchdogMSP432_convertMsToTicks() APIs are not
66  * supported by this implementation.
67  ******************************************************************************
68  */
69 
70 #ifndef ti_drivers_watchdog_WatchdogMSP432__include
71 #define ti_drivers_watchdog_WatchdogMSP432__include
72 
73 #ifdef __cplusplus
74 extern "C" {
75 #endif
76 
77 #include <stdint.h>
78 #include <stdbool.h>
79 
80 #include <ti/drivers/Watchdog.h>
81 
82 #include <ti/drivers/dpl/HwiP.h>
83 
94 /* Add WatchdogMSP432_STATUS_* macros here */
95 
108 /* Add WatchdogMSP432_CMD_* macros here */
109 
114 
144 typedef struct WatchdogMSP432_HWAttrs {
145  uint32_t baseAddr;
146  uint8_t intNum;
147  uint8_t intPriority;
148  uint8_t clockSource;
149  uint8_t clockDivider;
151 
157 typedef struct WatchdogMSP432_Object {
159  HwiP_Handle hwiHandle;
160  bool isOpen; /* Flag for open/close status */
162 
163 #ifdef __cplusplus
164 }
165 #endif
166 
167 #endif /* ti_drivers_watchdog_WatchdogMSP432__include */
uint8_t clockSource
Definition: WatchdogMSP432.h:148
struct WatchdogMSP432_Object WatchdogMSP432_Object
Watchdog Object for MSP432.
enum Watchdog_ResetMode_ Watchdog_ResetMode
Watchdog reset mode settings.
uint8_t intPriority
Definition: WatchdogMSP432.h:147
bool isOpen
Definition: WatchdogMSP432.h:160
HwiP_Handle hwiHandle
Definition: WatchdogMSP432.h:159
Watchdog hardware attributes for MSP432 These fields are used by driverlib APIs and therefore must be...
Definition: WatchdogMSP432.h:144
Watchdog driver interface.
uint8_t clockDivider
Definition: WatchdogMSP432.h:149
const Watchdog_FxnTable WatchdogMSP432_fxnTable
Watchdog function table for MSP432.
uint32_t baseAddr
Definition: WatchdogMSP432.h:145
The definition of a Watchdog function table that contains the required set of functions to control a ...
Definition: Watchdog.h:347
uint8_t intNum
Definition: WatchdogMSP432.h:146
Watchdog_ResetMode resetMode
Definition: WatchdogMSP432.h:158
struct WatchdogMSP432_HWAttrs WatchdogMSP432_HWAttrs
Watchdog hardware attributes for MSP432 These fields are used by driverlib APIs and therefore must be...
Watchdog Object for MSP432.
Definition: WatchdogMSP432.h:157
© Copyright 1995-2018, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale