NEORV32 Software Framework Documentation
The NEORV32 RISC-V Processor
Loading...
Searching...
No Matches
neorv32_wdt.c File Reference

Direct Memory Access Controller (DMA) HW driver source file. More...

#include <neorv32.h>

Functions

int neorv32_wdt_available (void)
 
void neorv32_wdt_setup (uint32_t timeout, int lock, int debug_en, int sleep_en, int strict)
 
int neorv32_wdt_disable (void)
 
void neorv32_wdt_feed (uint32_t password)
 
int neorv32_wdt_get_cause (void)
 

Detailed Description

Direct Memory Access Controller (DMA) HW driver source file.

Watchdog Timer (WDT) HW driver source file.

Note
These functions should only be used if the DMA controller was synthesized (IO_DMA_EN = true).
See also
https://stnolting.github.io/neorv32/sw/files.html
Note
These functions should only be used if the WDT unit was synthesized (IO_WDT_EN = true).
See also
https://stnolting.github.io/neorv32/sw/files.html

Function Documentation

◆ neorv32_wdt_available()

int neorv32_wdt_available ( void )

Check if WDT unit was synthesized.

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

◆ neorv32_wdt_disable()

int neorv32_wdt_disable ( void )

Disable watchdog timer.

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

◆ neorv32_wdt_feed()

void neorv32_wdt_feed ( uint32_t password)

Feed watchdog (reset timeout counter).

Parameters
[in]passwordPassword for WDT reset.

◆ 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,
int debug_en,
int sleep_en,
int strict )

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

Warning
Once the lock bit is set it can only be removed by a hardware reset!
Parameters
[in]timeout24-bit timeout value. A WDT IRQ is triggered when the internal counter reaches 'timeout/2'. A system hardware reset is triggered when the internal counter reaches 'timeout'.
[in]lockControl register will be locked when 1 (until next reset).
[in]debug_enAllow watchdog to continue operation even when CPU is in debug mode.
[in]sleep_enAllow watchdog to continue operation even when CPU is in sleep mode.
[in]strictForce hardware reset if reset password is incorrect or if trying to alter a locked configuration.