/* hwWatchdogDrvK.h - header for the hardware watchdog driver */

/* Copyright 2004 - 2009 Kontron Modular Computers GmbH */

/*
modification history
--------------------
01c,12nov09,pfr added pTimeoutIsSupported struct field
01b,06nov09,pwo check min/max supported timeout added
01a,08may08,jed initially created
*/

#ifndef __INChwWatchdogDrvK_h
#define __INChwWatchdogDrvK_h

#ifdef __cplusplus
extern "C" {
#endif

/* includes */

#include <vxWorks.h>
#include <ioLib.h>
#include <vxBusLib.h>
#include "versionK.h"

/* defines */

KONTRON_VERSION(hwWatchdogDrvK_h,01c)			/* version identifier */

/* typedefs */

typedef struct hwd_drv_ctrl
{
	DEV_HDR devHdr;
	SEM_ID semId;		/* ID of open semaphore indicating watchdog timeout */
	BOOL started;
	VXB_DEVICE_ID pDev;
	void * pHandle;		/* handler to suitable for accessing a
						given BAR with the vxbReadXX()/vxbWriteXX() */
	FUNCPTR pHwdIrqEnableFunc;	/* BSP specific IRQ enabling function */
	FUNCPTR pHwdIrqHandleFunc;	/* BSP specific interrupt handler */

	FUNCPTR pTimeoutIsSupported;	/* BSP specific */
} HWD_DRV_CTRL;

typedef struct hwd_drv_ctrl * pHWD_DRV_CTRL;

/* function declarations */

#if defined(__STDC__) || defined(__cplusplus)

IMPORT STATUS hwWatchdogIoInit (void);
IMPORT void hwWatchdogRegister(void);

#else

IMPORT STATUS hwWatchdogIoInit ();
IMPORT void hwWatchdogRegister();

#endif	/* __STDC__ */

#ifdef __cplusplus
}
#endif

#endif /* __INChwWatchdogDrvK_h */

/* eof */
