[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Watchdog device driver
- Date: Thu, 22 May 2008 09:12:48 +1000
- From: chrisj at rtems.org (Chris Johns)
- Subject: Watchdog device driver
Joel Sherrill wrote:
> I guess it is such a simple device that no one has proposed
> anything like an API.
>
> I would not be opposed to an API for a watchdog timer. I
> don't see much of an API though since there isn't that much
> functionality.
>
> + enable with expiration
> + reset
> + disable
> + is enabled?
>
> But a standard API, no matter how simple encourages portability.
>
This is a good idea. I see the driver as something like:
int wd = open ("/dev/wd0", O_WRONLY, 0);
ioctl (wd, RTEMS_WDOG_RESET); /* reset the watchdog */
ioctl (wd, RTEMS_WDOG_CONFIG, 250); /* set the timeout to be 250msec */
ioctl (wd, RTEMS_WDOG_TRIGGER); /* trigger a watchdog reset */
close (wd);
Regards
Chris