RTEMS 6.1-rc4
Loading...
Searching...
No Matches
Macros | Functions | Variables
watchdog.c File Reference

Watchdog Driver. More...

#include <bsp/raspberrypi.h>
#include <bsp/watchdog.h>

Macros

#define PM_WDOG   BCM2835_REG(BCM2711_PM_WDOG)
 
#define PM_RSTC   BCM2835_REG(BCM2711_PM_RSTC)
 

Functions

void raspberrypi_watchdog_init ()
 Initialize BSP watchdog routines.
 
void raspberrypi_watchdog_start (uint32_t timeout_ms)
 Turn on the watchdog / begin the counter at the desired value.
 
void raspberrypi_watchdog_stop ()
 Turn off the watchdog.
 
void raspberrypi_watchdog_reload ()
 Reload watchdog.
 
uint32_t raspberrypi_watchdog_get_remaining_time ()
 Get the remaining time of the watchdog. The return value is still valid when the watchdog has been stopped.
 

Variables

uint32_t raspberrypi_watchdog_timeout
 

Detailed Description

Watchdog Driver.

Function Documentation

◆ raspberrypi_watchdog_get_remaining_time()

uint32_t raspberrypi_watchdog_get_remaining_time ( void  )

Get the remaining time of the watchdog. The return value is still valid when the watchdog has been stopped.

Return values
Watchdogremaining time in ms.

◆ raspberrypi_watchdog_init()

void raspberrypi_watchdog_init ( void  )

Initialize BSP watchdog routines.

Note
a brief example of expected usage.

void raspberrypi_watchdog_example() { raspberrypi_watchdog_init(); raspberrypi_watchdog_start(15000);

raspberrypi_watchdog_reload(); ... raspberrypi_watchdog_reload();

raspberrypi_watchdog_stop(); }

◆ raspberrypi_watchdog_start()

void raspberrypi_watchdog_start ( uint32_t  timeout_ms)

Turn on the watchdog / begin the counter at the desired value.

Parameters
timeoutWatchdog timeout value in ms. The watchdog device has 20 bits of timeout, so it only supports a maximum of 15999 ms for its timeout. This value should be between 0 and 15999.