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
43
44
45
46/**********************************************************************/
49#define WDT_PASSWORD (0x709D1AB3)
50
51
52/**********************************************************************/
61
62
63/**********************************************************************/
67int neorv32_wdt_available(void);
68void neorv32_wdt_setup(uint32_t timeout, int lock);
69int neorv32_wdt_disable(void);
70void neorv32_wdt_feed(uint32_t password);
72int neorv32_wdt_get_cause(void);
74
75
76#endif // NEORV32_WDT_H
void neorv32_wdt_force_hwreset(void)
Definition neorv32_wdt.c:88
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:37
@ WDT_CTRL_TIMEOUT_MSB
Definition neorv32_wdt.h:41
@ WDT_CTRL_TIMEOUT_LSB
Definition neorv32_wdt.h:40
@ WDT_CTRL_RCAUSE_HI
Definition neorv32_wdt.h:38
@ 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:55
@ WDT_RCAUSE_ACC
Definition neorv32_wdt.h:59
@ WDT_RCAUSE_TMO
Definition neorv32_wdt.h:58
@ WDT_RCAUSE_OCD
Definition neorv32_wdt.h:57
@ WDT_RCAUSE_EXT
Definition neorv32_wdt.h:56
int neorv32_wdt_get_cause(void)
Definition neorv32_wdt.c:108
int neorv32_wdt_disable(void)
Definition neorv32_wdt.c:58
void neorv32_wdt_feed(uint32_t password)
Definition neorv32_wdt.c:79
void neorv32_wdt_setup(uint32_t timeout, int lock)
Definition neorv32_wdt.c:36
Definition neorv32_wdt.h:25
uint32_t RESET
Definition neorv32_wdt.h:27
uint32_t CTRL
Definition neorv32_wdt.h:26