MAX32665 SDK Documentation  0.2
Software Development Kit Overview and API Documentation
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  * $Date: 2018-09-07 11:28:54 -0500 (Fri, 07 Sep 2018) $
38  * $Revision: 37731 $
39  *
40  *************************************************************************** */
41 
42 /* Define to prevent redundant inclusion */
43 #ifndef _WDT_H_
44 #define _WDT_H_
45 
46 /* **** Includes **** */
47 #include <stdint.h>
48 #include "mxc_config.h"
49 #include "wdt_regs.h"
50 
51 #ifdef __cplusplus
52 extern "C" {
53 #endif
54 
61 /* **** Definitions **** */
62 
65 typedef enum {
82 } wdt_period_t;
83 
84 /* **** Function Prototypes **** */
85 
91 int WDT_Init(mxc_wdt_regs_t* wdt, sys_cfg_wdt_t sys_cfg);
97 void WDT_SetIntPeriod(mxc_wdt_regs_t* wdt, wdt_period_t period);
98 
104 void WDT_SetResetPeriod(mxc_wdt_regs_t* wdt, wdt_period_t period);
105 
111 void WDT_Enable(mxc_wdt_regs_t* wdt, int enable);
112 
118 void WDT_EnableInt(mxc_wdt_regs_t* wdt, int enable);
119 
125 void WDT_EnableReset(mxc_wdt_regs_t* wdt, int enable);
126 
131 void WDT_ResetTimer(mxc_wdt_regs_t* wdt);
132 
139 
145 
152 
158 
161 #ifdef __cplusplus
162 }
163 #endif
164 
165 #endif /* _WDT_H_ */
#define MXC_S_WDT_CTRL_INT_PERIOD_WDT2POW27
CTRL_INT_PERIOD_WDT2POW27 Setting.
Definition: wdt_regs.h:121
Period 2^16.
Definition: wdt.h:81
void WDT_SetIntPeriod(mxc_wdt_regs_t *wdt, wdt_period_t period)
Set the period of the watchdog interrupt.
#define MXC_S_WDT_CTRL_INT_PERIOD_WDT2POW19
CTRL_INT_PERIOD_WDT2POW19 Setting.
Definition: wdt_regs.h:137
#define MXC_S_WDT_CTRL_INT_PERIOD_WDT2POW17
CTRL_INT_PERIOD_WDT2POW17 Setting.
Definition: wdt_regs.h:141
Period 2^22.
Definition: wdt.h:75
#define MXC_S_WDT_CTRL_INT_PERIOD_WDT2POW31
CTRL_INT_PERIOD_WDT2POW31 Setting.
Definition: wdt_regs.h:113
Structure type to access the WDT Registers.
Definition: wdt_regs.h:88
Period 2^26.
Definition: wdt.h:71
wdt_period_t
Watchdog period enumeration.
Definition: wdt.h:65
#define MXC_S_WDT_CTRL_INT_PERIOD_WDT2POW28
CTRL_INT_PERIOD_WDT2POW28 Setting.
Definition: wdt_regs.h:119
#define MXC_S_WDT_CTRL_INT_PERIOD_WDT2POW23
CTRL_INT_PERIOD_WDT2POW23 Setting.
Definition: wdt_regs.h:129
Period 2^31.
Definition: wdt.h:66
#define MXC_S_WDT_CTRL_INT_PERIOD_WDT2POW25
CTRL_INT_PERIOD_WDT2POW25 Setting.
Definition: wdt_regs.h:125
void WDT_ResetTimer(mxc_wdt_regs_t *wdt)
Reset the watchdog timer.
Period 2^25.
Definition: wdt.h:72
Period 2^23.
Definition: wdt.h:74
int WDT_GetIntFlag(mxc_wdt_regs_t *wdt)
Get the status of the interrupt flag.
void WDT_EnableReset(mxc_wdt_regs_t *wdt, int enable)
Enable the watchdog reset.
void WDT_Enable(mxc_wdt_regs_t *wdt, int enable)
Enable the watchdog timer.
#define MXC_S_WDT_CTRL_INT_PERIOD_WDT2POW18
CTRL_INT_PERIOD_WDT2POW18 Setting.
Definition: wdt_regs.h:139
#define MXC_S_WDT_CTRL_INT_PERIOD_WDT2POW29
CTRL_INT_PERIOD_WDT2POW29 Setting.
Definition: wdt_regs.h:117
Period 2^27.
Definition: wdt.h:70
void WDT_ClearIntFlag(mxc_wdt_regs_t *wdt)
Clears the interrupt flag.
Period 2^20.
Definition: wdt.h:77
#define MXC_S_WDT_CTRL_INT_PERIOD_WDT2POW22
CTRL_INT_PERIOD_WDT2POW22 Setting.
Definition: wdt_regs.h:131
Period 2^30.
Definition: wdt.h:67
void WDT_SetResetPeriod(mxc_wdt_regs_t *wdt, wdt_period_t period)
Set the period of the watchdog reset.
#define MXC_S_WDT_CTRL_INT_PERIOD_WDT2POW26
CTRL_INT_PERIOD_WDT2POW26 Setting.
Definition: wdt_regs.h:123
#define MXC_S_WDT_CTRL_INT_PERIOD_WDT2POW24
CTRL_INT_PERIOD_WDT2POW24 Setting.
Definition: wdt_regs.h:127
void WDT_ClearResetFlag(mxc_wdt_regs_t *wdt)
Clears the reset flag.
void WDT_EnableInt(mxc_wdt_regs_t *wdt, int enable)
Enable the watchdog interrupt.
Period 2^19.
Definition: wdt.h:78
Period 2^18.
Definition: wdt.h:79
Period 2^17.
Definition: wdt.h:80
#define MXC_S_WDT_CTRL_INT_PERIOD_WDT2POW21
CTRL_INT_PERIOD_WDT2POW21 Setting.
Definition: wdt_regs.h:133
#define MXC_S_WDT_CTRL_INT_PERIOD_WDT2POW30
CTRL_INT_PERIOD_WDT2POW30 Setting.
Definition: wdt_regs.h:115
int WDT_Init(mxc_wdt_regs_t *wdt, sys_cfg_wdt_t sys_cfg)
Initialize the Watchdog Timer.
Period 2^29.
Definition: wdt.h:68
Period 2^21.
Definition: wdt.h:76
#define MXC_S_WDT_CTRL_INT_PERIOD_WDT2POW20
CTRL_INT_PERIOD_WDT2POW20 Setting.
Definition: wdt_regs.h:135
int WDT_GetResetFlag(mxc_wdt_regs_t *wdt)
Get the status of the reset flag.
Period 2^24.
Definition: wdt.h:73
Period 2^28.
Definition: wdt.h:69
#define MXC_S_WDT_CTRL_INT_PERIOD_WDT2POW16
CTRL_INT_PERIOD_WDT2POW16 Setting.
Definition: wdt_regs.h:143