Nexus Embedded Platform 0.1.0
Statically assembled reusable embedded mechanisms
Loading...
Searching...
No Matches
watchdog.h File Reference

Irreversible IWDG effects and neutral hardware reset causes. More...

Go to the source code of this file.

Data Structures

struct  nx_watchdog_state_t
 Hardware-selected timeout bounds, including declared LSI uncertainty. More...
struct  nx_watchdog_ops_t
 Shared read-only methods using one provider state. More...
struct  nx_watchdog_port
 Immutable interface pointing to caller-owned state. More...

Macros

#define NX_RESET_POWER_ON   1u
#define NX_RESET_PIN   2u
#define NX_RESET_SOFTWARE   4u
#define NX_RESET_IWDG   8u
#define NX_RESET_WWDG   16u
#define NX_RESET_LOW_POWER   32u
#define NX_RESET_BROWNOUT   64u

Typedefs

typedef struct nx_watchdog_port nx_watchdog_port_t

Functions

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.
nx_result_t nx_watchdog_port_feed (const nx_watchdog_port_t *port)
 Feed an enabled IWDG without changing product health policy.
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.
uint32_t nx_reset_cause (void)
 Read latched boot reset causes captured before clearing flags.

Detailed Description

Irreversible IWDG effects and neutral hardware reset causes.

Author
Nexus Team

Definition in file watchdog.h.

Macro Definition Documentation

◆ NX_RESET_BROWNOUT

#define NX_RESET_BROWNOUT   64u

Definition at line 23 of file watchdog.h.

◆ NX_RESET_IWDG

#define NX_RESET_IWDG   8u

Definition at line 20 of file watchdog.h.

◆ NX_RESET_LOW_POWER

#define NX_RESET_LOW_POWER   32u

Definition at line 22 of file watchdog.h.

◆ NX_RESET_PIN

#define NX_RESET_PIN   2u

Definition at line 18 of file watchdog.h.

◆ NX_RESET_POWER_ON

#define NX_RESET_POWER_ON   1u

Definition at line 17 of file watchdog.h.

◆ NX_RESET_SOFTWARE

#define NX_RESET_SOFTWARE   4u

Definition at line 19 of file watchdog.h.

◆ NX_RESET_WWDG

#define NX_RESET_WWDG   16u

Definition at line 21 of file watchdog.h.

Typedef Documentation

◆ nx_watchdog_port_t

Definition at line 16 of file watchdog.h.

Function Documentation

◆ nx_reset_cause()

uint32_t nx_reset_cause ( void )

Read latched boot reset causes captured before clearing flags.

Returns
Bitmask of NX_RESET_*; multiple causes may be reported.
Note
No implicit acknowledgement, reboot or product classification.

◆ nx_watchdog_port_enable()

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.

Parameters
[in,out]portFixed provider; product owns feed/recovery policy.
[in]timeout_usRequested nominal timeout in maintained range.
[in]debug_freezeWhether debug halting freezes counting.
[out]stateActual timeout bounds and remaining effect, including enabled=true when later setup reports failure after enabling.
Returns
Success or INVALID/STATE/IO; never claims enabled hardware was disabled during rollback. Existing enable is identified.

◆ nx_watchdog_port_feed()

nx_result_t nx_watchdog_port_feed ( const nx_watchdog_port_t * port)

Feed an enabled IWDG without changing product health policy.

Parameters
[in,out]portFixed enabled provider with one serialized feed owner.
Returns
Success or INVALID/STATE; bounded task/IRQ, no allocation.

◆ nx_watchdog_port_state()

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.

Parameters
[in]portFixed provider.
[out]stateCurrent hardware/remembered initialization state.
Returns
Success or INVALID.