MAX32675 Peripheral Driver API
Peripheral Driver API for the MAX32675
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Modules
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_MAX32675_WDT_H_
28#define LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32675_WDT_H_
29
30#ifdef __CC_ARM
31#pragma diag_suppress 66 // enumeration value is out of int range
32#endif
33
34/* **** Includes **** */
35#include <stdint.h>
36#include "mxc_device.h"
37#include "wdt_regs.h"
38
39#ifdef __cplusplus
40extern "C" {
41#endif
42
49/* **** Definitions **** */
50
53typedef enum {
71
75typedef enum {
76 MXC_WDT_INT_TOO_LATE = MXC_F_WDT_CTRL_INT_LATE,
77 MXC_WDT_INT_TOO_SOON = MXC_F_WDT_CTRL_INT_EARLY,
79
83typedef enum {
84 MXC_WDT_RST_TOO_LATE = MXC_F_WDT_CTRL_RST_LATE,
85 MXC_WDT_RST_TOO_SOON = MXC_F_WDT_CTRL_RST_EARLY,
87
91typedef enum {
92 MXC_WDT_COMPATIBILITY = 0,
93 MXC_WDT_WINDOWED = 1,
95
99typedef enum {
100 MXC_WDT_PCLK = 0,
101 MXC_WDT_IPO_CLK,
102 MXC_WDT_IBRO_CLK,
103 MXC_WDT_INRO_CLK
105
109typedef struct {
116/* **** Function Prototypes **** */
117
130
137
144
151
157
163
169
175
181
187
193
200
206
213
219
226
229#ifdef __cplusplus
230}
231#endif
232
233#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32675_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:114
mxc_wdt_period_t lowerResetPeriod
Reset lower limit.
Definition: wdt.h:112
mxc_wdt_period_t upperResetPeriod
Reset upper limit.
Definition: wdt.h:111
mxc_wdt_period_t upperIntPeriod
Interrupt upper limit.
Definition: wdt.h:113
mxc_wdt_mode_t mode
WDT mode.
Definition: wdt.h:110
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:83
mxc_wdt_period_t
Watchdog upper limit period enumeration. Used to configure the period of the watchdog interrupt.
Definition: wdt.h:53
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:75
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:99
mxc_wdt_mode_t
Watchdog mode enumeration.
Definition: wdt.h:91
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:66
@ MXC_WDT_PERIOD_2_18
Period 2^18.
Definition: wdt.h:67
@ MXC_WDT_PERIOD_2_16
Period 2^16.
Definition: wdt.h:69
@ MXC_WDT_PERIOD_2_30
Period 2^30.
Definition: wdt.h:55
@ MXC_WDT_PERIOD_2_17
Period 2^17.
Definition: wdt.h:68
@ MXC_WDT_PERIOD_2_28
Period 2^28.
Definition: wdt.h:57
@ MXC_WDT_PERIOD_2_21
Period 2^21.
Definition: wdt.h:64
@ MXC_WDT_PERIOD_2_29
Period 2^29.
Definition: wdt.h:56
@ MXC_WDT_PERIOD_2_26
Period 2^26.
Definition: wdt.h:59
@ MXC_WDT_PERIOD_2_22
Period 2^22.
Definition: wdt.h:63
@ MXC_WDT_PERIOD_2_25
Period 2^25.
Definition: wdt.h:60
@ MXC_WDT_PERIOD_2_23
Period 2^23.
Definition: wdt.h:62
@ MXC_WDT_PERIOD_2_24
Period 2^24.
Definition: wdt.h:61
@ MXC_WDT_PERIOD_2_20
Period 2^20.
Definition: wdt.h:65
@ MXC_WDT_PERIOD_2_31
Period 2^31.
Definition: wdt.h:54
@ MXC_WDT_PERIOD_2_27
Period 2^27.
Definition: wdt.h:58
Timer Configuration.
Definition: wdt.h:109
Registers, Bit Masks and Bit Positions for the WDT Peripheral Module.