//////////////////////////////////////////////////////////////////////////
//
// ICP Programmer DLL Header
//
// Author:	Uwe Mayer (Contronix)
// Date:	2003-03-12
//
//////////////////////////////////////////////////////////////////////////


#define DllImport   __declspec( dllimport )


//////////////////////////////////////////////////////////////////////////
// function call results

enum ProgDLL_Result
{
	resNone,
	noProg,
	progFound, 
	MemError, 
	progBusy, 
	progIdle, 
	progProtected, 
	eraChip, 
	eraEEp,
	eraFlash,
	prgEEp, 
	prgFlash, 
	verifyEEp, 
	verifyFlash, 
	errPwrDown, 
	errSignature, 
	errProtected, 
	errNotEmpty, 
	errVerify, 
	progDone, 
	dwnLoading, 
	dwnLoadErrP, 
	dwnLoadErrE, 
	dwnLoadErrF, 
	dwnLoadErr, 
	invFile, 
	invFName, 
	FileExist, 
	notFound, 
	invPassword, 
	limitExc, 
	errProgType, 
	resOk, 
	progNoJTAG, 
	progNoSupply, 
	errPwrSupply 
};


CString	ResultTexts[] =
{
	"resNone",
	"noProg",
	"progFound", 
	"MemError", 
	"progBusy", 
	"progIdle", 
	"progProtected", 
	"eraChip", 
	"eraEEp",
	"eraFlash",
	"prgEEp", 
	"prgFlash", 
	"verifyEEp", 
	"verifyFlash", 
	"errPwrDown", 
	"errSignature", 
	"errProtected", 
	"errNotEmpty", 
	"errVerify", 
	"progDone", 
	"dwnLoading", 
	"dwnLoadErrP", 
	"dwnLoadErrE", 
	"dwnLoadErrF", 
	"dwnLoadErr", 
	"invFile", 
	"invFName", 
	"FileExist", 
	"notFound", 
	"invPassword", 
	"limitExc", 
	"errProgType", 
	"resOk", 
	"progNoJTAG", 
	"progNoSupply", 
	"errPwrSupply"
};


//////////////////////////////////////////////////////////////////////////
// functions

typedef void (CALLBACK *RINT_STR_RINT_STR)(int&, char*, int&, char*);
typedef void (CALLBACK *RINT_STR)(int&, char*);
typedef void (CALLBACK *INT_RINT_RINT_STR)(int, int&, int&, char*);
typedef void (CALLBACK *STR_INT_INT_RINT_STR)(char*, int, int, int&, char*);
typedef void (CALLBACK *STR_RINT_STR)(char*, int&, char*);
typedef void (CALLBACK *INT_RINT_STR)(int, int&, char*);
typedef void (CALLBACK *NOTHING)();


STR_RINT_STR AddNewFile;
STR_RINT_STR DeleteFileB;
INT_RINT_STR GetFile;
RINT_STR GetPasswd;
RINT_STR_RINT_STR SetChannel;
INT_RINT_STR CheckProgrammer;
INT_RINT_STR EraseProgrammer;
INT_RINT_RINT_STR GetProjName;
STR_INT_INT_RINT_STR DownloadFile;
INT_RINT_RINT_STR GetACCUstate;
INT_RINT_RINT_STR GetTargVolt;
INT_RINT_STR CheckDevice;
INT_RINT_STR ProgDevice;
INT_RINT_STR EraseDevice;
INT_RINT_STR VerifyDevice;
INT_RINT_STR VerifyFlashOnly;
INT_RINT_STR GetProgStatus;

NOTHING AbortAll;