MAX32655 Peripheral Driver API
Peripheral Driver API for the MAX32655
wdt.h
1 
6 /* ****************************************************************************
7  * Copyright (C) 2016 Maxim Integrated Products, Inc., All Rights Reserved.
8  *
9  * Permission is hereby granted, free of charge, to any person obtaining a
10  * copy of this software and associated documentation files (the "Software"),
11  * to deal in the Software without restriction, including without limitation
12  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13  * and/or sell copies of the Software, and to permit persons to whom the
14  * Software is furnished to do so, subject to the following conditions:
15  *
16  * The above copyright notice and this permission notice shall be included
17  * in all copies or substantial portions of the Software.
18  *
19  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
22  * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES
23  * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
24  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25  * OTHER DEALINGS IN THE SOFTWARE.
26  *
27  * Except as contained in this notice, the name of Maxim Integrated
28  * Products, Inc. shall not be used except as stated in the Maxim Integrated
29  * Products, Inc. Branding Policy.
30  *
31  * The mere transfer of this software does not imply any licenses
32  * of trade secrets, proprietary technology, copyrights, patents,
33  * trademarks, maskwork rights, or any other form of intellectual
34  * property whatsoever. Maxim Integrated Products, Inc. retains all
35  * ownership rights.
36  *
37  *************************************************************************** */
38 
39 /* Define to prevent redundant inclusion */
40 #ifndef _WDT_H_
41 #define _WDT_H_
42 
43 /* **** Includes **** */
44 #include <stdint.h>
45 #include "mxc_device.h"
46 #include "wdt_regs.h"
47 
48 #ifdef __cplusplus
49 extern "C" {
50 #endif
51 
58 /* **** Definitions **** */
59 
62 typedef enum {
80 
84 typedef enum {
85  MXC_WDT_INT_TOO_LATE = MXC_F_WDT_CTRL_INT_LATE,
86  MXC_WDT_INT_TOO_SOON = MXC_F_WDT_CTRL_INT_EARLY,
88 
92 typedef enum {
93  MXC_WDT_RST_TOO_LATE = MXC_F_WDT_CTRL_RST_LATE,
94  MXC_WDT_RST_TOO_SOON = MXC_F_WDT_CTRL_RST_EARLY,
96 
100 typedef enum {
101  MXC_WDT_COMPATIBILITY = 0,
102  MXC_WDT_WINDOWED = 1,
104 
108 typedef struct {
110  mxc_wdt_period_t upperResetPeriod;
111  mxc_wdt_period_t lowerResetPeriod;
112  mxc_wdt_period_t upperIntPeriod;
113  mxc_wdt_period_t lowerIntPeriod;
114 } mxc_wdt_cfg_t;
115 /* **** Function Prototypes **** */
116 
123 int MXC_WDT_Init (mxc_wdt_regs_t* wdt, mxc_wdt_cfg_t *cfg);
124 
131 
138 
145 
150 void MXC_WDT_Enable (mxc_wdt_regs_t* wdt);
151 
156 void MXC_WDT_Disable (mxc_wdt_regs_t* wdt);
157 
163 
169 
175 
181 
187 
194 
200 
207 
213 
216 #ifdef __cplusplus
217 }
218 #endif
219 
220 #endif /* _WDT_H_ */
Period 2^28.
Definition: wdt.h:66
Period 2^31.
Definition: wdt.h:63
void MXC_WDT_EnableReset(mxc_wdt_regs_t *wdt)
Enable the watchdog reset.
#define MXC_S_WDT_CTRL_INT_LATE_VAL_WDT2POW19
Definition: wdt_regs.h:141
void MXC_WDT_Disable(mxc_wdt_regs_t *wdt)
Disable the watchdog timer.
Period 2^26.
Definition: wdt.h:68
Period 2^29.
Definition: wdt.h:65
#define MXC_S_WDT_CTRL_INT_LATE_VAL_WDT2POW25
Definition: wdt_regs.h:129
mxc_wdt_period_t upperResetPeriod
Reset upper limit.
Definition: wdt.h:110
#define MXC_F_WDT_CTRL_RST_EARLY
Definition: wdt_regs.h:279
mxc_wdt_mode_t mode
WDT mode.
Definition: wdt.h:109
void MXC_WDT_ClearIntFlag(mxc_wdt_regs_t *wdt)
Clears the interrupt flag.
#define MXC_S_WDT_CTRL_INT_LATE_VAL_WDT2POW30
Definition: wdt_regs.h:119
#define MXC_S_WDT_CTRL_INT_LATE_VAL_WDT2POW31
Definition: wdt_regs.h:117
#define MXC_S_WDT_CTRL_INT_LATE_VAL_WDT2POW24
Definition: wdt_regs.h:131
#define MXC_S_WDT_CTRL_INT_LATE_VAL_WDT2POW17
Definition: wdt_regs.h:145
Period 2^30.
Definition: wdt.h:64
void MXC_WDT_SetIntPeriod(mxc_wdt_regs_t *wdt, mxc_wdt_cfg_t *cfg)
Set the period of the watchdog interrupt.
void MXC_WDT_DisableInt(mxc_wdt_regs_t *wdt)
Disable the watchdog interrupt.
Period 2^27.
Definition: wdt.h:67
mxc_wdt_period_t
Watchdog upper limit period enumeration. Used to configure the period of the watchdog interrupt...
Definition: wdt.h:62
Period 2^24.
Definition: wdt.h:70
void MXC_WDT_EnableInt(mxc_wdt_regs_t *wdt)
Enable the watchdog interrupt.
#define MXC_S_WDT_CTRL_INT_LATE_VAL_WDT2POW21
Definition: wdt_regs.h:137
#define MXC_S_WDT_CTRL_INT_LATE_VAL_WDT2POW27
Definition: wdt_regs.h:125
Period 2^20.
Definition: wdt.h:74
#define MXC_F_WDT_CTRL_INT_EARLY
Definition: wdt_regs.h:197
int MXC_WDT_GetResetFlag(mxc_wdt_regs_t *wdt)
Get the status of the reset flag.
void MXC_WDT_Enable(mxc_wdt_regs_t *wdt)
Enable the watchdog timer.
#define MXC_S_WDT_CTRL_INT_LATE_VAL_WDT2POW20
Definition: wdt_regs.h:139
Period 2^23.
Definition: wdt.h:71
#define MXC_S_WDT_CTRL_INT_LATE_VAL_WDT2POW16
Definition: wdt_regs.h:147
void MXC_WDT_SetResetPeriod(mxc_wdt_regs_t *wdt, mxc_wdt_cfg_t *cfg)
Set the period of the watchdog reset.
void MXC_WDT_ResetTimer(mxc_wdt_regs_t *wdt)
Reset the watchdog timer.
Timer Configuration.
Definition: wdt.h:108
Period 2^25.
Definition: wdt.h:69
#define MXC_S_WDT_CTRL_INT_LATE_VAL_WDT2POW29
Definition: wdt_regs.h:121
#define MXC_S_WDT_CTRL_INT_LATE_VAL_WDT2POW23
Definition: wdt_regs.h:133
mxc_wdt_period_t lowerIntPeriod
Interrupt lower limit.
Definition: wdt.h:113
#define MXC_F_WDT_CTRL_INT_LATE
Definition: wdt_regs.h:188
mxc_wdt_mode_t
Watchdog mode enumeration.
Definition: wdt.h:100
int MXC_WDT_Shutdown(mxc_wdt_regs_t *wdt)
Shutdown the Watchdog Timer.
mxc_wdt_period_t lowerResetPeriod
Reset lower limit.
Definition: wdt.h:111
Definition: wdt_regs.h:88
Period 2^18.
Definition: wdt.h:76
int MXC_WDT_GetIntFlag(mxc_wdt_regs_t *wdt)
Get the status of the interrupt flag.
Period 2^21.
Definition: wdt.h:73
#define MXC_F_WDT_CTRL_RST_LATE
Definition: wdt_regs.h:282
#define MXC_S_WDT_CTRL_INT_LATE_VAL_WDT2POW22
Definition: wdt_regs.h:135
Period 2^16.
Definition: wdt.h:78
Period 2^22.
Definition: wdt.h:72
#define MXC_S_WDT_CTRL_INT_LATE_VAL_WDT2POW26
Definition: wdt_regs.h:127
mxc_wdt_int_t
Watchdog interrupt flag enumeration.
Definition: wdt.h:84
mxc_wdt_rst_t
Watchdog reset flag enumeration.
Definition: wdt.h:92
#define MXC_S_WDT_CTRL_INT_LATE_VAL_WDT2POW18
Definition: wdt_regs.h:143
mxc_wdt_period_t upperIntPeriod
Interrupt upper limit.
Definition: wdt.h:112
Period 2^19.
Definition: wdt.h:75
void MXC_WDT_DisableReset(mxc_wdt_regs_t *wdt)
Disable the watchdog reset.
#define MXC_S_WDT_CTRL_INT_LATE_VAL_WDT2POW28
Definition: wdt_regs.h:123
void MXC_WDT_ClearResetFlag(mxc_wdt_regs_t *wdt)
Clears the reset flag.
Period 2^17.
Definition: wdt.h:77
int MXC_WDT_Init(mxc_wdt_regs_t *wdt, mxc_wdt_cfg_t *cfg)
Initialize the Watchdog Timer.