API Reference
The NEORV32 RISC-V Processor
Loading...
Searching...
No Matches
Functions
neorv32_wdt.c File Reference

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

#include <neorv32.h>

Functions

int neorv32_wdt_available (void)
 
void neorv32_wdt_setup (uint32_t timeout, int lock)
 
int neorv32_wdt_disable (void)
 
void neorv32_wdt_feed (uint32_t password)
 
void neorv32_wdt_force_hwreset (void)
 
int neorv32_wdt_get_cause (void)
 

Detailed Description

Watchdog Timer (WDT) HW driver source file.

Function Documentation

◆ neorv32_wdt_available()

int neorv32_wdt_available ( void  )

Check if WDT unit was synthesized.

Returns
0 if WDT was not synthesized, non-zero if WDT is available.

◆ neorv32_wdt_disable()

int neorv32_wdt_disable ( void  )

Disable watchdog timer.

Returns
Returns 0 if WDT is deactivated, non-zero otherwise.

◆ neorv32_wdt_feed()

void neorv32_wdt_feed ( uint32_t  password)

Feed watchdog (reset timeout counter).

Parameters
[in]passwordPassword for WDT reset.

◆ neorv32_wdt_force_hwreset()

void neorv32_wdt_force_hwreset ( void  )

Force a hardware reset triggered by the watchdog.

◆ neorv32_wdt_get_cause()

int neorv32_wdt_get_cause ( void  )

Get cause of last system reset.

Returns
Cause of last reset (NEORV32_WDT_RCAUSE_enum).

◆ neorv32_wdt_setup()

void neorv32_wdt_setup ( uint32_t  timeout,
int  lock 
)

Configure and enable watchdog timer.

Warning
Once the lock bit is set it can only be removed by a hardware reset.
Parameters
[in]timeoutLSB-aligned 24-bit timeout value (number of clock cycles).
[in]lockControl register will be locked when 1 (until next HW reset).