MAX32675 Peripheral Driver API
Peripheral Driver API for the MAX32675
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 #ifdef __CC_ARM
44 #pragma diag_suppress 66 // enumeration value is out of �int� range
45 #endif
46 
47 /* **** Includes **** */
48 #include <stdint.h>
49 #include "mxc_device.h"
50 #include "wdt_regs.h"
51 
52 #ifdef __cplusplus
53 extern "C" {
54 #endif
55 
62 /* **** Definitions **** */
63 
66 typedef enum {
84 
88 typedef enum {
89  MXC_WDT_INT_TOO_LATE = MXC_F_WDT_CTRL_INT_LATE,
90  MXC_WDT_INT_TOO_SOON = MXC_F_WDT_CTRL_INT_EARLY,
92 
96 typedef enum {
97  MXC_WDT_RST_TOO_LATE = MXC_F_WDT_CTRL_RST_LATE,
98  MXC_WDT_RST_TOO_SOON = MXC_F_WDT_CTRL_RST_EARLY,
100 
104 typedef enum {
105  MXC_WDT_COMPATIBILITY = 0,
106  MXC_WDT_WINDOWED = 1,
108 
112 typedef struct {
118 } mxc_wdt_cfg_t;
119 /* **** Function Prototypes **** */
120 
127 int MXC_WDT_Init (mxc_wdt_regs_t* wdt, mxc_wdt_cfg_t *cfg);
128 
135 
142 
149 
154 void MXC_WDT_Enable (mxc_wdt_regs_t* wdt);
155 
160 void MXC_WDT_Disable (mxc_wdt_regs_t* wdt);
161 
167 
173 
179 
185 
191 
198 
204 
211 
217 
220 #ifdef __cplusplus
221 }
222 #endif
223 
224 #endif /* _WDT_H_ */
MXC_WDT_PERIOD_2_18
@ MXC_WDT_PERIOD_2_18
Period 2^18.
Definition: wdt.h:80
MXC_F_WDT_CTRL_RST_EARLY
#define MXC_F_WDT_CTRL_RST_EARLY
Definition: wdt_regs.h:279
MXC_WDT_Disable
void MXC_WDT_Disable(mxc_wdt_regs_t *wdt)
Disable the watchdog timer.
MXC_F_WDT_CTRL_INT_EARLY
#define MXC_F_WDT_CTRL_INT_EARLY
Definition: wdt_regs.h:197
MXC_WDT_PERIOD_2_30
@ MXC_WDT_PERIOD_2_30
Period 2^30.
Definition: wdt.h:68
MXC_WDT_PERIOD_2_25
@ MXC_WDT_PERIOD_2_25
Period 2^25.
Definition: wdt.h:73
mxc_wdt_rst_t
mxc_wdt_rst_t
Watchdog reset flag enumeration.
Definition: wdt.h:96
MXC_WDT_SetIntPeriod
void MXC_WDT_SetIntPeriod(mxc_wdt_regs_t *wdt, mxc_wdt_cfg_t *cfg)
Set the period of the watchdog interrupt.
MXC_WDT_EnableReset
void MXC_WDT_EnableReset(mxc_wdt_regs_t *wdt)
Enable the watchdog reset.
mxc_wdt_period_t
mxc_wdt_period_t
Watchdog upper limit period enumeration. Used to configure the period of the watchdog interrupt.
Definition: wdt.h:66
mxc_wdt_int_t
mxc_wdt_int_t
Watchdog interrupt flag enumeration.
Definition: wdt.h:88
mxc_wdt_cfg_t::upperResetPeriod
mxc_wdt_period_t upperResetPeriod
Reset upper limit.
Definition: wdt.h:114
MXC_S_WDT_CTRL_INT_LATE_VAL_WDT2POW21
#define MXC_S_WDT_CTRL_INT_LATE_VAL_WDT2POW21
Definition: wdt_regs.h:137
MXC_S_WDT_CTRL_INT_LATE_VAL_WDT2POW20
#define MXC_S_WDT_CTRL_INT_LATE_VAL_WDT2POW20
Definition: wdt_regs.h:139
MXC_WDT_PERIOD_2_16
@ MXC_WDT_PERIOD_2_16
Period 2^16.
Definition: wdt.h:82
MXC_S_WDT_CTRL_INT_LATE_VAL_WDT2POW30
#define MXC_S_WDT_CTRL_INT_LATE_VAL_WDT2POW30
Definition: wdt_regs.h:119
MXC_WDT_PERIOD_2_22
@ MXC_WDT_PERIOD_2_22
Period 2^22.
Definition: wdt.h:76
MXC_S_WDT_CTRL_INT_LATE_VAL_WDT2POW18
#define MXC_S_WDT_CTRL_INT_LATE_VAL_WDT2POW18
Definition: wdt_regs.h:143
MXC_WDT_ClearResetFlag
void MXC_WDT_ClearResetFlag(mxc_wdt_regs_t *wdt)
Clears the reset flag.
mxc_wdt_cfg_t::mode
mxc_wdt_mode_t mode
WDT mode.
Definition: wdt.h:113
MXC_S_WDT_CTRL_INT_LATE_VAL_WDT2POW22
#define MXC_S_WDT_CTRL_INT_LATE_VAL_WDT2POW22
Definition: wdt_regs.h:135
MXC_WDT_GetResetFlag
int MXC_WDT_GetResetFlag(mxc_wdt_regs_t *wdt)
Get the status of the reset flag.
MXC_WDT_EnableInt
void MXC_WDT_EnableInt(mxc_wdt_regs_t *wdt)
Enable the watchdog interrupt.
mxc_wdt_mode_t
mxc_wdt_mode_t
Watchdog mode enumeration.
Definition: wdt.h:104
MXC_WDT_Enable
void MXC_WDT_Enable(mxc_wdt_regs_t *wdt)
Enable the watchdog timer.
MXC_S_WDT_CTRL_INT_LATE_VAL_WDT2POW24
#define MXC_S_WDT_CTRL_INT_LATE_VAL_WDT2POW24
Definition: wdt_regs.h:131
MXC_WDT_PERIOD_2_21
@ MXC_WDT_PERIOD_2_21
Period 2^21.
Definition: wdt.h:77
MXC_WDT_PERIOD_2_31
@ MXC_WDT_PERIOD_2_31
Period 2^31.
Definition: wdt.h:67
MXC_S_WDT_CTRL_INT_LATE_VAL_WDT2POW29
#define MXC_S_WDT_CTRL_INT_LATE_VAL_WDT2POW29
Definition: wdt_regs.h:121
MXC_S_WDT_CTRL_INT_LATE_VAL_WDT2POW27
#define MXC_S_WDT_CTRL_INT_LATE_VAL_WDT2POW27
Definition: wdt_regs.h:125
MXC_WDT_PERIOD_2_29
@ MXC_WDT_PERIOD_2_29
Period 2^29.
Definition: wdt.h:69
MXC_WDT_PERIOD_2_24
@ MXC_WDT_PERIOD_2_24
Period 2^24.
Definition: wdt.h:74
mxc_wdt_cfg_t::lowerIntPeriod
mxc_wdt_period_t lowerIntPeriod
Interrupt lower limit.
Definition: wdt.h:117
MXC_WDT_PERIOD_2_28
@ MXC_WDT_PERIOD_2_28
Period 2^28.
Definition: wdt.h:70
MXC_S_WDT_CTRL_INT_LATE_VAL_WDT2POW28
#define MXC_S_WDT_CTRL_INT_LATE_VAL_WDT2POW28
Definition: wdt_regs.h:123
mxc_wdt_regs_t
Definition: wdt_regs.h:88
mxc_wdt_cfg_t::lowerResetPeriod
mxc_wdt_period_t lowerResetPeriod
Reset lower limit.
Definition: wdt.h:115
MXC_WDT_PERIOD_2_20
@ MXC_WDT_PERIOD_2_20
Period 2^20.
Definition: wdt.h:78
MXC_WDT_PERIOD_2_17
@ MXC_WDT_PERIOD_2_17
Period 2^17.
Definition: wdt.h:81
MXC_WDT_SetResetPeriod
void MXC_WDT_SetResetPeriod(mxc_wdt_regs_t *wdt, mxc_wdt_cfg_t *cfg)
Set the period of the watchdog reset.
MXC_F_WDT_CTRL_INT_LATE
#define MXC_F_WDT_CTRL_INT_LATE
Definition: wdt_regs.h:188
MXC_WDT_ResetTimer
void MXC_WDT_ResetTimer(mxc_wdt_regs_t *wdt)
Reset the watchdog timer.
MXC_WDT_Shutdown
int MXC_WDT_Shutdown(mxc_wdt_regs_t *wdt)
Shutdown the Watchdog Timer.
MXC_WDT_GetIntFlag
int MXC_WDT_GetIntFlag(mxc_wdt_regs_t *wdt)
Get the status of the interrupt flag.
MXC_F_WDT_CTRL_RST_LATE
#define MXC_F_WDT_CTRL_RST_LATE
Definition: wdt_regs.h:282
MXC_S_WDT_CTRL_INT_LATE_VAL_WDT2POW31
#define MXC_S_WDT_CTRL_INT_LATE_VAL_WDT2POW31
Definition: wdt_regs.h:117
MXC_S_WDT_CTRL_INT_LATE_VAL_WDT2POW25
#define MXC_S_WDT_CTRL_INT_LATE_VAL_WDT2POW25
Definition: wdt_regs.h:129
MXC_S_WDT_CTRL_INT_LATE_VAL_WDT2POW17
#define MXC_S_WDT_CTRL_INT_LATE_VAL_WDT2POW17
Definition: wdt_regs.h:145
MXC_WDT_DisableInt
void MXC_WDT_DisableInt(mxc_wdt_regs_t *wdt)
Disable the watchdog interrupt.
MXC_WDT_Init
int MXC_WDT_Init(mxc_wdt_regs_t *wdt, mxc_wdt_cfg_t *cfg)
Initialize the Watchdog Timer.
MXC_WDT_PERIOD_2_27
@ MXC_WDT_PERIOD_2_27
Period 2^27.
Definition: wdt.h:71
MXC_WDT_PERIOD_2_19
@ MXC_WDT_PERIOD_2_19
Period 2^19.
Definition: wdt.h:79
MXC_S_WDT_CTRL_INT_LATE_VAL_WDT2POW23
#define MXC_S_WDT_CTRL_INT_LATE_VAL_WDT2POW23
Definition: wdt_regs.h:133
MXC_S_WDT_CTRL_INT_LATE_VAL_WDT2POW19
#define MXC_S_WDT_CTRL_INT_LATE_VAL_WDT2POW19
Definition: wdt_regs.h:141
MXC_WDT_PERIOD_2_26
@ MXC_WDT_PERIOD_2_26
Period 2^26.
Definition: wdt.h:72
MXC_WDT_PERIOD_2_23
@ MXC_WDT_PERIOD_2_23
Period 2^23.
Definition: wdt.h:75
mxc_wdt_cfg_t::upperIntPeriod
mxc_wdt_period_t upperIntPeriod
Interrupt upper limit.
Definition: wdt.h:116
MXC_S_WDT_CTRL_INT_LATE_VAL_WDT2POW16
#define MXC_S_WDT_CTRL_INT_LATE_VAL_WDT2POW16
Definition: wdt_regs.h:147
MXC_S_WDT_CTRL_INT_LATE_VAL_WDT2POW26
#define MXC_S_WDT_CTRL_INT_LATE_VAL_WDT2POW26
Definition: wdt_regs.h:127
mxc_wdt_cfg_t
Timer Configuration.
Definition: wdt.h:112
MXC_WDT_DisableReset
void MXC_WDT_DisableReset(mxc_wdt_regs_t *wdt)
Disable the watchdog reset.
MXC_WDT_ClearIntFlag
void MXC_WDT_ClearIntFlag(mxc_wdt_regs_t *wdt)
Clears the interrupt flag.