Nexus Embedded Platform 0.1.0
Statically assembled reusable embedded mechanisms
Loading...
Searching...
No Matches
watchdog.h
Go to the documentation of this file.
1
9#ifndef NEXUS_WATCHDOG_H
10#define NEXUS_WATCHDOG_H
11
12#include "nexus/core/status.h"
13#ifdef __cplusplus
14extern "C" {
15#endif
17#define NX_RESET_POWER_ON 1u
18#define NX_RESET_PIN 2u
19#define NX_RESET_SOFTWARE 4u
20#define NX_RESET_IWDG 8u
21#define NX_RESET_WWDG 16u
22#define NX_RESET_LOW_POWER 32u
23#define NX_RESET_BROWNOUT 64u
35
42typedef struct {
43 nx_result_t (*enable)(void* context, uint32_t timeout_us, bool debug_freeze,
45 nx_result_t (*feed)(void* context);
46 nx_result_t (*state)(const void* context, nx_watchdog_state_t* state);
48
58
78 uint32_t timeout_us, bool debug_freeze,
79 nx_watchdog_state_t* state);
100 nx_watchdog_state_t* state);
110uint32_t nx_reset_cause(void);
111#ifdef __cplusplus
112}
113#endif
114
115#endif
Small vendor-independent result vocabulary.
nx_result_t
Operation result; success at submission means admission only.
Definition status.h:21
Shared read-only methods using one provider state.
Definition watchdog.h:42
nx_result_t(* enable)(void *context, uint32_t timeout_us, bool debug_freeze, nx_watchdog_state_t *state)
Definition watchdog.h:43
nx_result_t(* state)(const void *context, nx_watchdog_state_t *state)
Definition watchdog.h:46
nx_result_t(* feed)(void *context)
Definition watchdog.h:45
Immutable interface pointing to caller-owned state.
Definition watchdog.h:54
const nx_watchdog_ops_t * ops
Definition watchdog.h:55
Hardware-selected timeout bounds, including declared LSI uncertainty.
Definition watchdog.h:28
uint32_t minimum_timeout_us
Definition watchdog.h:29
uint32_t maximum_timeout_us
Definition watchdog.h:30
nx_result_t nx_watchdog_port_state(const nx_watchdog_port_t *port, nx_watchdog_state_t *state)
Query current watchdog effect and timeout uncertainty.
nx_result_t nx_watchdog_port_feed(const nx_watchdog_port_t *port)
Feed an enabled IWDG without changing product health policy.
struct nx_watchdog_port nx_watchdog_port_t
Definition watchdog.h:16
nx_result_t nx_watchdog_port_enable(const nx_watchdog_port_t *port, uint32_t timeout_us, bool debug_freeze, nx_watchdog_state_t *state)
Enable IWDG with reviewed bounds; activation is irreversible.
uint32_t nx_reset_cause(void)
Read latched boot reset causes captured before clearing flags.