NEORV32 - Software Framework Documentation
No Matches
neorv32_wdt.h File Reference

Watchdog Timer (WDT) HW driver header file. More...

Go to the source code of this file.


int neorv32_wdt_available (void)
void neorv32_wdt_setup (uint8_t prsc, uint8_t mode, uint8_t lock)
int neorv32_wdt_disable (void)
void neorv32_wdt_reset (void)
int neorv32_wdt_get_cause (void)
void neorv32_wdt_force (void)

Detailed Description

Watchdog Timer (WDT) HW driver header file.

These functions should only be used if the WDT unit was synthesized (IO_WDT_EN = true).

Function Documentation

◆ neorv32_wdt_available()

int neorv32_wdt_available ( void  )

Check if WDT unit was synthesized.

0 if WDT was not synthesized, 1 if WDT is available.

◆ neorv32_wdt_disable()

int neorv32_wdt_disable ( void  )

Disable watchdog timer.

Returns 0 if WDT is really deactivated, -1 otherwise.

◆ neorv32_wdt_force()

void neorv32_wdt_force ( void  )

Force immediate watchdog action (reset/IRQ).

◆ neorv32_wdt_get_cause()

int neorv32_wdt_get_cause ( void  )

Get cause of last system reset.

Cause of last reset (0: system reset - OCD or external, 1: watchdog timeout).

◆ neorv32_wdt_reset()

void neorv32_wdt_reset ( void  )

Feed watchdog (reset timeout counter).

◆ neorv32_wdt_setup()

void neorv32_wdt_setup ( uint8_t  prsc,
uint8_t  mode,
uint8_t  lock 

Configure and enable watchdog timer. The WDT control register bits are listed in NEORV32_WDT_CTRL_enum.

Once set the watchdog lock can only be removed by an external hardware reset!
[in]prscClock prescaler to select timeout interval. See NEORV32_CLOCK_PRSC_enum.
[in]modeTrigger system reset on timeout when 1, trigger interrupt on timeout when 0.
[in]lockControl register will be locked when 1 (until next reset).