MAX32672 Peripheral Driver API
Peripheral Driver API for the MAX32672
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Modules Pages
wdt.h
1
6/******************************************************************************
7 *
8 * Copyright (C) 2022-2023 Maxim Integrated Products, Inc. (now owned by
9 * Analog Devices, Inc.),
10 * Copyright (C) 2023-2024 Analog Devices, Inc.
11 *
12 * Licensed under the Apache License, Version 2.0 (the "License");
13 * you may not use this file except in compliance with the License.
14 * You may obtain a copy of the License at
15 *
16 * http://www.apache.org/licenses/LICENSE-2.0
17 *
18 * Unless required by applicable law or agreed to in writing, software
19 * distributed under the License is distributed on an "AS IS" BASIS,
20 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21 * See the License for the specific language governing permissions and
22 * limitations under the License.
23 *
24 ******************************************************************************/
25
26/* Define to prevent redundant inclusion */
27#ifndef LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32672_WDT_H_
28#define LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32672_WDT_H_
29
30/* **** Includes **** */
31#include <stdint.h>
32#include "mxc_device.h"
33#include "wdt_regs.h"
34
35#ifdef __cplusplus
36extern "C" {
37#endif
38
45/* **** Definitions **** */
46
49typedef enum {
67
71typedef enum {
72 MXC_WDT_INT_TOO_LATE = MXC_F_WDT_CTRL_INT_LATE,
73 MXC_WDT_INT_TOO_SOON = MXC_F_WDT_CTRL_INT_EARLY,
75
79typedef enum {
80 MXC_WDT_RST_TOO_LATE = MXC_F_WDT_CTRL_RST_LATE,
81 MXC_WDT_RST_TOO_SOON = MXC_F_WDT_CTRL_RST_EARLY,
83
87typedef enum {
88 MXC_WDT_COMPATIBILITY = 0,
89 MXC_WDT_WINDOWED = 1,
91
95typedef enum {
96 MXC_WDT_PCLK = 0,
97 MXC_WDT_IPO_CLK,
98 MXC_WDT_IBRO_CLK,
99 MXC_WDT_INRO_CLK,
100 MXC_WDT_ERTCO_CLK,
101 MXC_WDT_EXT_CLK,
102 MXC_WDT_ERFO_CLK
104
108typedef struct {
115/* **** Function Prototypes **** */
116
129
136
143
150
156
162
168
174
180
186
192
199
205
212
218
225
228#ifdef __cplusplus
229}
230#endif
231
232#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32672_WDT_H_
#define MXC_S_WDT_CTRL_INT_LATE_VAL_WDT2POW28
Definition: wdt_regs.h:111
#define MXC_S_WDT_CTRL_INT_LATE_VAL_WDT2POW20
Definition: wdt_regs.h:127
#define MXC_S_WDT_CTRL_INT_LATE_VAL_WDT2POW22
Definition: wdt_regs.h:123
#define MXC_S_WDT_CTRL_INT_LATE_VAL_WDT2POW16
Definition: wdt_regs.h:135
#define MXC_F_WDT_CTRL_RST_EARLY
Definition: wdt_regs.h:267
#define MXC_S_WDT_CTRL_INT_LATE_VAL_WDT2POW24
Definition: wdt_regs.h:119
#define MXC_S_WDT_CTRL_INT_LATE_VAL_WDT2POW26
Definition: wdt_regs.h:115
#define MXC_F_WDT_CTRL_RST_LATE
Definition: wdt_regs.h:270
#define MXC_S_WDT_CTRL_INT_LATE_VAL_WDT2POW18
Definition: wdt_regs.h:131
#define MXC_S_WDT_CTRL_INT_LATE_VAL_WDT2POW30
Definition: wdt_regs.h:107
#define MXC_S_WDT_CTRL_INT_LATE_VAL_WDT2POW23
Definition: wdt_regs.h:121
#define MXC_S_WDT_CTRL_INT_LATE_VAL_WDT2POW21
Definition: wdt_regs.h:125
#define MXC_F_WDT_CTRL_INT_LATE
Definition: wdt_regs.h:176
#define MXC_S_WDT_CTRL_INT_LATE_VAL_WDT2POW27
Definition: wdt_regs.h:113
#define MXC_S_WDT_CTRL_INT_LATE_VAL_WDT2POW19
Definition: wdt_regs.h:129
#define MXC_S_WDT_CTRL_INT_LATE_VAL_WDT2POW29
Definition: wdt_regs.h:109
#define MXC_S_WDT_CTRL_INT_LATE_VAL_WDT2POW25
Definition: wdt_regs.h:117
#define MXC_F_WDT_CTRL_INT_EARLY
Definition: wdt_regs.h:185
#define MXC_S_WDT_CTRL_INT_LATE_VAL_WDT2POW17
Definition: wdt_regs.h:133
#define MXC_S_WDT_CTRL_INT_LATE_VAL_WDT2POW31
Definition: wdt_regs.h:105
Definition: wdt_regs.h:76
mxc_wdt_period_t lowerIntPeriod
Interrupt lower limit.
Definition: wdt.h:113
mxc_wdt_period_t lowerResetPeriod
Reset lower limit.
Definition: wdt.h:111
mxc_wdt_period_t upperResetPeriod
Reset upper limit.
Definition: wdt.h:110
mxc_wdt_period_t upperIntPeriod
Interrupt upper limit.
Definition: wdt.h:112
mxc_wdt_mode_t mode
WDT mode.
Definition: wdt.h:109
void MXC_WDT_EnableReset(mxc_wdt_regs_t *wdt)
Enable the watchdog reset.
int MXC_WDT_GetIntFlag(mxc_wdt_regs_t *wdt)
Get the status of the interrupt flag.
void MXC_WDT_SetIntPeriod(mxc_wdt_regs_t *wdt, mxc_wdt_cfg_t *cfg)
Set the period of the watchdog interrupt.
mxc_wdt_rst_t
Watchdog reset flag enumeration.
Definition: wdt.h:79
mxc_wdt_period_t
Watchdog upper limit period enumeration. Used to configure the period of the watchdog interrupt.
Definition: wdt.h:49
void MXC_WDT_Disable(mxc_wdt_regs_t *wdt)
Disable the watchdog timer.
int MXC_WDT_Init(mxc_wdt_regs_t *wdt, mxc_wdt_cfg_t *cfg)
Initialize the Watchdog Timer.
void MXC_WDT_SetResetPeriod(mxc_wdt_regs_t *wdt, mxc_wdt_cfg_t *cfg)
Set the period of the watchdog reset.
int MXC_WDT_Shutdown(mxc_wdt_regs_t *wdt)
Shutdown the Watchdog Timer.
void MXC_WDT_ResetTimer(mxc_wdt_regs_t *wdt)
Reset the watchdog timer.
void MXC_WDT_Enable(mxc_wdt_regs_t *wdt)
Enable the watchdog timer.
mxc_wdt_int_t
Watchdog interrupt flag enumeration.
Definition: wdt.h:71
void MXC_WDT_ClearResetFlag(mxc_wdt_regs_t *wdt)
Clears the reset flag.
void MXC_WDT_DisableReset(mxc_wdt_regs_t *wdt)
Disable the watchdog reset.
void MXC_WDT_DisableInt(mxc_wdt_regs_t *wdt)
Disable the watchdog interrupt.
mxc_wdt_clock_t
Peripheral Clock settings.
Definition: wdt.h:95
mxc_wdt_mode_t
Watchdog mode enumeration.
Definition: wdt.h:87
void MXC_WDT_ClearIntFlag(mxc_wdt_regs_t *wdt)
Clears the interrupt flag.
int MXC_WDT_GetResetFlag(mxc_wdt_regs_t *wdt)
Get the status of the reset flag.
int MXC_WDT_SetClockSource(mxc_wdt_regs_t *wdt, mxc_wdt_clock_t clock_source)
Sets clock source.
void MXC_WDT_EnableInt(mxc_wdt_regs_t *wdt)
Enable the watchdog interrupt.
@ MXC_WDT_PERIOD_2_19
Period 2^19.
Definition: wdt.h:62
@ MXC_WDT_PERIOD_2_18
Period 2^18.
Definition: wdt.h:63
@ MXC_WDT_PERIOD_2_16
Period 2^16.
Definition: wdt.h:65
@ MXC_WDT_PERIOD_2_30
Period 2^30.
Definition: wdt.h:51
@ MXC_WDT_PERIOD_2_17
Period 2^17.
Definition: wdt.h:64
@ MXC_WDT_PERIOD_2_28
Period 2^28.
Definition: wdt.h:53
@ MXC_WDT_PERIOD_2_21
Period 2^21.
Definition: wdt.h:60
@ MXC_WDT_PERIOD_2_29
Period 2^29.
Definition: wdt.h:52
@ MXC_WDT_PERIOD_2_26
Period 2^26.
Definition: wdt.h:55
@ MXC_WDT_PERIOD_2_22
Period 2^22.
Definition: wdt.h:59
@ MXC_WDT_PERIOD_2_25
Period 2^25.
Definition: wdt.h:56
@ MXC_WDT_PERIOD_2_23
Period 2^23.
Definition: wdt.h:58
@ MXC_WDT_PERIOD_2_24
Period 2^24.
Definition: wdt.h:57
@ MXC_WDT_PERIOD_2_20
Period 2^20.
Definition: wdt.h:61
@ MXC_WDT_PERIOD_2_31
Period 2^31.
Definition: wdt.h:50
@ MXC_WDT_PERIOD_2_27
Period 2^27.
Definition: wdt.h:54
Timer Configuration.
Definition: wdt.h:108
Registers, Bit Masks and Bit Positions for the WDT Peripheral Module.