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 - 2024 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
18#ifndef neorv32_wdt_h
19#define neorv32_wdt_h
20
21#include <stdint.h>
22
23
24/**********************************************************************/
29typedef volatile struct __attribute__((packed,aligned(4))) {
30 uint32_t CTRL;
31 uint32_t RESET;
33
35#define NEORV32_WDT ((neorv32_wdt_t*) (NEORV32_WDT_BASE))
36
53/**********************************************************************/
56#define WDT_PASSWORD (0x709D1AB3)
57
58
59/**********************************************************************/
67
68
69/**********************************************************************/
73int neorv32_wdt_available(void);
74void neorv32_wdt_setup(uint32_t timeout, int lock, int debug_en, int sleep_en, int strict);
75int neorv32_wdt_disable(void);
76void neorv32_wdt_feed(void);
77int neorv32_wdt_get_cause(void);
81#endif // neorv32_wdt_h
NEORV32_WDT_CTRL_enum
Definition neorv32_wdt.h:38
@ WDT_CTRL_EN
Definition neorv32_wdt.h:39
@ WDT_CTRL_RCAUSE_LO
Definition neorv32_wdt.h:44
@ WDT_CTRL_TIMEOUT_MSB
Definition neorv32_wdt.h:48
@ WDT_CTRL_STRICT
Definition neorv32_wdt.h:43
@ WDT_CTRL_TIMEOUT_LSB
Definition neorv32_wdt.h:47
@ WDT_CTRL_DBEN
Definition neorv32_wdt.h:41
@ WDT_CTRL_RCAUSE_HI
Definition neorv32_wdt.h:45
@ WDT_CTRL_SEN
Definition neorv32_wdt.h:42
@ WDT_CTRL_LOCK
Definition neorv32_wdt.h:40
void neorv32_wdt_setup(uint32_t timeout, int lock, int debug_en, int sleep_en, int strict)
Definition neorv32_wdt.c:49
void neorv32_wdt_feed(void)
Definition neorv32_wdt.c:93
int neorv32_wdt_available(void)
Definition neorv32_wdt.c:26
NEORV32_WDT_RCAUSE_enum
Definition neorv32_wdt.h:62
@ WDT_RCAUSE_OCD
Definition neorv32_wdt.h:64
@ WDT_RCAUSE_WDT
Definition neorv32_wdt.h:65
@ WDT_RCAUSE_EXT
Definition neorv32_wdt.h:63
int neorv32_wdt_get_cause(void)
Definition neorv32_wdt.c:104
int neorv32_wdt_disable(void)
Definition neorv32_wdt.c:74
Definition neorv32_wdt.h:29
uint32_t RESET
Definition neorv32_wdt.h:31
uint32_t CTRL
Definition neorv32_wdt.h:30