Watchdog device driver

Chris Johns chrisj at rtems.org
Wed May 21 23:12:48 UTC 2008


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



More information about the users mailing list