Embedded Xinu Operating System
An ongoing research project and educational operating system.
 All Data Structures Files Functions Variables Typedefs Enumerations Macros Groups Pages
Macros | Functions
watchdog.c File Reference
#include <stddef.h>
#include "bcm2837.h"

Macros

#define PM_RSTC   (PM_REGS_BASE + 0x1c)
 
#define PM_WDOG   (PM_REGS_BASE + 0x24)
 
#define PM_PASSWORD   0x5a000000
 
#define PM_RSTC_WRCFG_CLR   0xffffffcf
 
#define PM_RSTC_WRCFG_FULL_RESET   0x00000020
 
#define PM_WDOG_UNITS_PER_SECOND   (1 << 16)
 
#define PM_WDOG_UNITS_PER_MILLISECOND   (PM_WDOG_UNITS_PER_SECOND / 1000)
 

Functions

syscall watchdogset (uint msecs)
 

Detailed Description

This file contains code to set the Watchdog Timer on the BCM2835 SoC used on the Raspberry Pi. When enabled, the Watchdog Timer must be refreshed before it expires, otherwise the system resets itself.

Function Documentation

syscall watchdogset ( uint  msecs)

Set the watchdog timer.

Parameters
msecsMilliseconds to wait until the system resets itself.
Returns
OK