NEORV32 Software Framework Documentation
The NEORV32 RISC-V Processor
Loading...
Searching...
No Matches
neorv32_wdt.h
Go to the documentation of this file.
1// ================================================================================ //
2// The NEORV32 RISC-V Processor - https://github.com/stnolting/neorv32 //
3// Copyright (c) NEORV32 contributors. //
4// Copyright (c) 2020 - 2025 Stephan Nolting. All rights reserved. //
5// Licensed under the BSD-3-Clause license, see LICENSE for details. //
6// SPDX-License-Identifier: BSD-3-Clause //
7// ================================================================================ //
8
13
14#ifndef neorv32_wdt_h
15#define neorv32_wdt_h
16
17#include <stdint.h>
18
19
20/**********************************************************************/
25typedef volatile struct __attribute__((packed,aligned(4))) {
26 uint32_t CTRL;
27 uint32_t RESET;
29
31#define NEORV32_WDT ((neorv32_wdt_t*) (NEORV32_WDT_BASE))
32
44
45
46
47/**********************************************************************/
50#define WDT_PASSWORD (0x709D1AB3)
51
52
53/**********************************************************************/
62
63
64/**********************************************************************/
68int neorv32_wdt_available(void);
69void neorv32_wdt_setup(uint32_t timeout, int lock, int strict);
70int neorv32_wdt_disable(void);
71void neorv32_wdt_feed(uint32_t password);
72int neorv32_wdt_get_cause(void);
74
75
76#endif // neorv32_wdt_h
NEORV32_WDT_CTRL_enum
Definition neorv32_wdt.h:34
@ WDT_CTRL_EN
Definition neorv32_wdt.h:35
@ WDT_CTRL_RCAUSE_LO
Definition neorv32_wdt.h:38
@ WDT_CTRL_TIMEOUT_MSB
Definition neorv32_wdt.h:42
@ WDT_CTRL_STRICT
Definition neorv32_wdt.h:37
@ WDT_CTRL_TIMEOUT_LSB
Definition neorv32_wdt.h:41
@ WDT_CTRL_RCAUSE_HI
Definition neorv32_wdt.h:39
@ WDT_CTRL_LOCK
Definition neorv32_wdt.h:36
int neorv32_wdt_available(void)
Definition neorv32_wdt.c:22
NEORV32_WDT_RCAUSE_enum
Definition neorv32_wdt.h:56
@ WDT_RCAUSE_ACC
Definition neorv32_wdt.h:60
@ WDT_RCAUSE_TMO
Definition neorv32_wdt.h:59
@ WDT_RCAUSE_OCD
Definition neorv32_wdt.h:58
@ WDT_RCAUSE_EXT
Definition neorv32_wdt.h:57
int neorv32_wdt_get_cause(void)
Definition neorv32_wdt.c:98
int neorv32_wdt_disable(void)
Definition neorv32_wdt.c:66
void neorv32_wdt_setup(uint32_t timeout, int lock, int strict)
Definition neorv32_wdt.c:43
void neorv32_wdt_feed(uint32_t password)
Definition neorv32_wdt.c:87
Definition neorv32_wdt.h:25
uint32_t RESET
Definition neorv32_wdt.h:27
uint32_t CTRL
Definition neorv32_wdt.h:26