
// The following ifdef block is the standard way of creating macros which make exporting 
// from a DLL simpler. All files within this DLL are compiled with the KOMWDG_EXPORTS
// symbol defined on the command line. this symbol should not be defined on any project
// that uses this DLL. This way any other project whose source files include this file see 
// KOMWDG_API functions as being imported from a DLL, where as this DLL sees symbols
// defined with this macro as being exported.

//For detailed description of this API please see KomWdgApi.chm help file.

/*
modification history
--------------------
 2008-01-18   Created							                           Dzk
*/


#ifdef __cplusplus
extern "C" {
#endif

#ifdef KOMWDG_EXPORTS
#define KOMWDG_API __declspec(dllexport)
#else
#define KOMWDG_API __declspec(dllimport)
#endif

#include <windows.h>

//tbd

#define KOMWDG_TIMEOUT_125MS	0x00
#define KOMWDG_TIMEOUT_250MS	0x01
#define KOMWDG_TIMEOUT_500MS	0x02
#define KOMWDG_TIMEOUT_1S		0x03
#define KOMWDG_TIMEOUT_2S		0x04
#define KOMWDG_TIMEOUT_4S		0x05
#define KOMWDG_TIMEOUT_8S		0x06
#define KOMWDG_TIMEOUT_16S		0x07
#define KOMWDG_TIMEOUT_32S		0x08
#define KOMWDG_TIMEOUT_64S		0x09
#define KOMWDG_TIMEOUT_128S		0x0a
#define KOMWDG_TIMEOUT_256S		0x0b

#define KOMWDG_MODE_RESET		0x00
#define KOMWDG_MODE_IRQ			0x01
#define KOMWDG_MODE_DUAL_STAGE	0x02
#define KOMWDG_MODE_TIMER		0x03

typedef struct KomWdgConfig
{
	BYTE bTimeout;
	BYTE bMode;
	BOOLEAN fEnabled;
	BOOLEAN fIrqAvailable;
}tKomWdgConfig, *ptKomWdgConfig;

const char sKomWdgTimeoutValue[][9] = 
{
	"125 msec",
	"250 msec",
	"500 msec",
	"1 sec",
	"2 sec",
	"4 sec",
	"8 sec",
	"16 sec",
	"32 sec",
	"64 sec",
	"128 sec",
	"256 sec"
};

const char sKomWdgMode[][11] = 
{
	"Reset",
	"IRQ",
	"Dual stage",
	"Timer only"
};
//Library exports:

KOMWDG_API DWORD KomWdgSetRestoreStatus(BOOL fRestore);
KOMWDG_API DWORD KomWdgGetRestoreStatus(BOOL* pfRestore);
KOMWDG_API DWORD KomWdgSetTimeout(BYTE bTimeout);
KOMWDG_API DWORD KomWdgRetrigger(void);
KOMWDG_API DWORD KomWdgCheckTimeoutStatus(BOOL *pfTimeout);
KOMWDG_API DWORD KomWdgWaitForTimeout(BOOL *pfTimeout);
KOMWDG_API DWORD KomWdgGetConfig(ptKomWdgConfig pConfig);
KOMWDG_API DWORD KomWdgSetMode(BYTE bMode);

#ifdef __cplusplus
}
#endif

//EOF