API Reference
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 - 2026 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
14#ifndef NEORV32_WDT_H
15#define NEORV32_WDT_H
16
17#include <neorv32.h>
18#include <stdint.h>
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
45/**********************************************************************/
48#define WDT_PASSWORD (0x709D1AB3)
49
50/**********************************************************************/
59
60/**********************************************************************/
64int neorv32_wdt_available(void);
65void neorv32_wdt_setup(uint32_t timeout, int lock);
66int neorv32_wdt_disable(void);
67void neorv32_wdt_feed(uint32_t password);
69int neorv32_wdt_get_cause(void);
72#endif // NEORV32_WDT_H
Main NEORV32 core library / driver / HAL include file.
void neorv32_wdt_force_hwreset(void)
Definition neorv32_wdt.c:70
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:21
NEORV32_WDT_RCAUSE_enum
Definition neorv32_wdt.h:53
@ WDT_RCAUSE_ACC
Definition neorv32_wdt.h:57
@ WDT_RCAUSE_TMO
Definition neorv32_wdt.h:56
@ WDT_RCAUSE_OCD
Definition neorv32_wdt.h:55
@ WDT_RCAUSE_EXT
Definition neorv32_wdt.h:54
int neorv32_wdt_get_cause(void)
Definition neorv32_wdt.c:86
int neorv32_wdt_disable(void)
Definition neorv32_wdt.c:51
void neorv32_wdt_feed(uint32_t password)
Definition neorv32_wdt.c:62
void neorv32_wdt_setup(uint32_t timeout, int lock)
Definition neorv32_wdt.c:34
Definition neorv32_wdt.h:25
uint32_t RESET
Definition neorv32_wdt.h:27
uint32_t CTRL
Definition neorv32_wdt.h:26