// 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 SOLPETSDLL_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 
// SOLPETSDLL_API functions as being imported from a DLL, whereas this DLL sees symbols
// defined with this macro as being exported.
#ifdef SOLPETSDLL_EXPORTS
#define SOLPETSDLL_API __declspec(dllexport)
#else
#define SOLPETSDLL_API __declspec(dllimport)
#endif

// This class is exported from the SolPeTsDll.dll
class SOLPETSDLL_API CSolPeTsDll {
public:
	CSolPeTsDll(void);
	// TODO: add your methods here.
};

extern SOLPETSDLL_API int nSolPeTsDll;

SOLPETSDLL_API int fnSolPeTsDll(void);



#define CPEMDLL_SUCESS				0 
#define CPEMDLL_FAIL				1
#define CPEMDLL_ERROR_PEMNOTEXIST	2
#define CPEMDLL_ERROR_ADCNOTEXIST	3
#define CPEMDLL_ERROR_POWERFAIL		4
#define CPEMDLL_ERROR_DEVNOTEXIST	5
#define CPEMDLL_ERROR_DEVNOTMATCH	6
#define CPEMDLL_ERROR_DEVNEEDCFG	7

#define CPEMDLL_ERROR_3V3AUXSHORT	0x04
#define CPEMDLL_ERROR_3V3SHORT		0x02
#define CPEMDLL_ERROR_1V5SHORT		0x01

#define PEMCTRL_ERROR_3V3AUXSHORT	0x01
#define PEMCTRL_ERROR_3V3SHORT		0x02
#define PEMCTRL_ERROR_1V5SHORT		0x04

//!#00C0: IO Conttrol FOR PEM IOM V1.01
#define CPEMDLL_ERROR_IOMNOTEXIST	0x80
#define CPEMDLL_ERROR_IOMISINPUT	0x81

enum{
	CPEMDLL_PEMIO_PERSTn,		// 0
	CPEMDLL_PEMIO_CLKREQn,
	CPEMDLL_PEMIO_WAKEn,
	CPEMDLL_PEMIO_LED_WWANn,
	CPEMDLL_PEMIO_LED_WLANn,
	CPEMDLL_PEMIO_LED_WPANn,
	CPEMDLL_PEMIO_RS_PIN3,
	CPEMDLL_PEMIO_RS_PIN5,
	CPEMDLL_PEMIO_RS_PIN20,		// 8
	CPEMDLL_PEMIO_UIM_RESET,
	CPEMDLL_PEMIO_UIM_CLK,
	CPEMDLL_PEMIO_UIM_DATA,
	CPEMDLL_PEMIO_UIM_VPP,
	CPEMDLL_PEMIO_UIM_PWR,		// 13
	CPEMDLL_PEMIO_RS_PIN17,		//
	CPEMDLL_PEMIO_RS_PIN19,		// 
	CPEMDLL_PEMIO_RS_PIN45,		//16
	CPEMDLL_PEMIO_RS_PIN47,
	CPEMDLL_PEMIO_RS_PIN49,
	CPEMDLL_PEMIO_RS_PIN51
};
// This class is exported from the PEMDll.dll
class SOLPETSDLL_API CPEMDll 
{
	public:
		CPEMDll(void);
		char CPEMDLL_PEMIO_Name[24][16];
		
		int INIT();
		int INIT(int comport);
		int INITEX();
		int INITEX(DWORD addr);
		int EXIT();
		int EXIT(DWORD opt);
		int VALIDPEM(DWORD addr);
		int SELPEM(DWORD addr);

		int GETPNTYPE();
		int GETPNNAME(char *str);
		int VALIDDEV();	
		int SELDEV(DWORD Vid, DWORD Did, int index);
		int SELDEV(DWORD Vid, DWORD Did, DWORD Svid, DWORD Sdid, int index);		//2013/09/12 Add
		int SELDEV(DWORD Busno, DWORD Devno);
		int PON();
		int POFF();
		int GETPWRSTS();
		int CHKSHORT();
		int GET3V3V(double* volatge);
		int GET1V5V(double* volatge);
		int GET12V(double* volatge);
		int GET3V3I(double* current);
		int GET1V5I(double* current);
		int GET3V3IMAX(double* current);	//!#0004
		int GET1V5IMAX(double* current);	//!#0004
		int GET12I(double* volatge);
		int GETTEMP(DWORD devaddr, double* temp);	//!#0003

		int SET1V5ICAL();
		int SET3V3ICAL();
		int SET12ICAL();
		int SETUSECAL(int i);
		int GETUSECAL();

		int WINCHECK();
		int WINEN(int delaytime);
		int WINDIS(int delaytime);
		int CHECKCFG(char* logfile);
		int WAITCARDREMOVE();
		int WAITCARDPLUG();
		int CHECKCD();	//!#0005
		int LEDGO();
		int LEDNG();
		int LEDOFF();
		int BEEP(int freq, int time);
		int SETPONRST(int setting);	//!#0004

		int GETPNTYPE(DWORD addr);
		int GETPNNAME(DWORD addr, char *str);
		int VALIDDEV(DWORD addr);
		int SELDEV(DWORD addr, DWORD Vid, DWORD Did, int index);
		int SELDEV(DWORD addr, DWORD Busno, DWORD Devno);
		int GETPWRSTS(DWORD addr);
		int CHKSHORT(DWORD addr);
		int GET3V3V(DWORD addr, double* volatge);
		int GET1V5V(DWORD addr, double* volatge);
		int GET12V(DWORD addr, double* volatge);
		int GET3V3I(DWORD addr, double* current);
		int GET1V5I(DWORD addr, double* current);
		int GET3V3IMAX(DWORD addr, double* current);	//!#0004
		int GET1V5IMAX(DWORD addr, double* current);	//!#0004
		int GETTEMP(DWORD addr, DWORD devaddr, double* temp); //!#0003

		int GET12I(DWORD addr, double* current);
		int SET1V5ICAL(DWORD addr); 

		int SET3V3ICAL(DWORD addr);
		int SET12ICAL(DWORD addr);
		int SETUSECAL(DWORD addr, int i);
		int GETUSECAL(DWORD addr);

		int PON(DWORD addr);
		int POFF(DWORD addr);
		int WINCHECK(DWORD addr);
		int WINEN(DWORD addr, int delaytime);
		int WINDIS(DWORD addr, int delaytime);
		int CHECKCFG(DWORD addr, char* logfile);
		int WAITCARDREMOVE(DWORD addr);
		int WAITCARDPLUG(DWORD addr);
		int CHECKCD(DWORD addr);	//!#0005
		int LEDGO(DWORD addr);
		int LEDNG(DWORD addr);
		int LEDOFF(DWORD addr);
		int BEEP(DWORD addr, int freq, int time);
		int SETPONRST(DWORD addr, int setting);	//!#0004

		void GETLIBVER(int* major, int* minor);
		int GETPCIDEVCOUNT();
		int SELPCIDEV(int num);
		char* GETPCIDEVDESC();
		DWORD GETPCIDEVVID();
		DWORD GETPCIDEVDID();
		DWORD GETPCIDEVBUSNO();
		DWORD GETPCIDEVDEVNO();
		//2013/09/12, Add
		DWORD GETPCIDEVSVID();	
		DWORD GETPCIDEVSDID();	
		
		DWORD GETDEVHWVID();
		DWORD GETDEVHWDID();
		DWORD GETDEVHWSVID();
		DWORD GETDEVHWSDID();		
		DWORD GETDEVHWVID(DWORD addr);
		DWORD GETDEVHWDID(DWORD addr);
		DWORD GETDEVHWSVID(DWORD addr);
		DWORD GETDEVHWSDID(DWORD addr);		
		//2013/09/12, Add End
				
		int GPIOSETUP(int pinno, int mode, int val);
		int GPIOOUTSET(int pinno);
		int GPIOOUTRESET(int pinno);
		int GPIOIN(int pinno);
		int GPIOGETSETUP(int pinno);

		int GPIOSETUP(DWORD addr, int pinno, int mode, int val);
		int GPIOOUTSET(DWORD addr, int pinno);
		int GPIOOUTRESET(DWORD addr, int pinno);
		int GPIOIN(DWORD addr, int pinno);
		int GPIOGETSETUP(DWORD addr, int pinno);

		//!#0009, Mar/09/2007
		int PROBESMBCLKRISE(double* time);
		int PROBESMBCLKRISE(DWORD addr, double* time);

		//!#000A, Apr/18/2007, Vincent
		int GET5V(double* volatge);
		int GET5VI(double* current);
		int GET5VIMAX(double* current);	
		int GET5V(DWORD addr, double* volatge);
		int GET5VI(DWORD addr, double* current);
		int GET5VIMAX(DWORD addr, double* current);
		int usecomport;

		int WINEN2(DWORD addr, int delaytime);
		int WINEN2(int delaytime);
		int DEVRESCAN(int delaytime);

		int RESETLINKEDDEVICECOUNT();
		int ADDLINKEDDEVICEFUNC(unsigned long busnoi, unsigned long devnoi, unsigned long funcnoi);
		int UPDATELINKEDDEVICE();

		int RESETLINKEDDEVICECOUNT(DWORD addr);
		int ADDLINKEDDEVICEFUNC(DWORD addr, unsigned long busnoi, unsigned long devnoi, unsigned long funcnoi);
		int UPDATELINKEDDEVICE(DWORD addr);
		//!#00B1, May/07/2008, Add
		int GETFIRMVER(DWORD addr, int* major, int* minor);
		int GETFIRMVER(int* major, int* minor);
		//!#00B2, Jun/05/2008, Add
		int PWRCTL_AUTO();
		int PWRCTL_MANUAL();
		int PWRCTL_AUTO(DWORD addr);
		int PWRCTL_MANUAL(DWORD addr);

		//!#00C1: IO Conttrol FOR PEM IOM V1.01
		int IOMINIT();
		int IOMGETPINOE(int pinno);
		int IOMGETPINIE(int pinno);
		int IOMSETPINOE(int pinno);
		int IOMSETPINIE(int pinno);
		int IOMSETPIN(int pinno, int hilo);
		int IOMGETPIN(int pinno);
		char* IOMGETPINNAME(int pinno);
		int IOMSETPINPU(int pinno, int hilo);
		int IOMGETPINPU(int pinno);

		int IOMSETOE(unsigned long val);
		int IOMSETIO(unsigned long val);
		int IOMSETPU(unsigned long val);
		int IOMGETIO(unsigned long *val);
		int IOMGETPU(unsigned long *val);
		int IOMGETOE(unsigned long *val);

		//!#00C1, Mar/05/2012, Vincent
		int PEX3V3AUXONWHENPOFF();
		int PEX3V3AUXOFFWHENPOFF();
		// !#00C2: 08/08/2012		
		int SELDEV(DWORD Busno, DWORD Devno, DWORD *FuncCtl);
		int SELDEV(DWORD addr, DWORD Busno, DWORD Devno, DWORD *FuncCtl);
		//!#00C3, Mar/05/2013, Vincent,
		int ISNGSSDVALID();
		int NGSSDSLOTOFF();
		int NGSSDSLOTON(int slot);
		int NGSSDLEDGO(int slot);
		int NGSSDLEDNG(int slot);
		int NGSSDLEDOFF(int slot);	
		int NGSSDGETCD(int slot);		
		int NGSSDGETPSTS(int slot);		
		int NGSSDGETCLKREQ(int slot);	
		//!#00C6, Aug/07/2014, Vincent 
		int RETRAINDEV();
		int RETRAINDEV(DWORD addr);
		// 2014/09/12: Add PEX4X Support 
		int PEX4INIT();
		int PEX4RESET();
		int PEX4CFGSAVE();
		int PEX4GETSN(DWORD *SN);
		int PEX4GETVBAT(double *VBAT_VOUT, int *VBAT_EN, int *VBAT_MODE, double *VBAT_VOLT);
		int PEX4GETVBATOC(double *OC);
		int PEX4GET3V3OC(double *OC);
		int PEX4GETPONRSTTIME(int *MS);
		int PEX4GETVAUXMODE(int *MODE);
		int PEX4SETVBATMODE(int VBAT_MODE); 	// 0: 12V MODE, 1: VBAT MODE 
		int PEX4SETVBAT(double VBAT_VOLT);
		int PEX4SETVBATOC(double OC);
		int PEX4SET3V3OC(double OC);
		int PEX4SETPONRSTTIME(int MS);
		int PEX4SETVAUXMODE(int MODE);
		int PEX4INIT(DWORD addr);
		int PEX4RESET(DWORD addr);
		int PEX4CFGSAVE(DWORD addr);
		int PEX4GETSN(DWORD addr, DWORD *SN);
		int PEX4GETVBAT(DWORD addr, double *VBAT_VOUT, int *VBAT_EN, int *VBAT_MODE, double *VBAT_VOLT);
		int PEX4GETVBATOC(DWORD addr, double *OC);
		int PEX4GET3V3OC(DWORD addr, double *OC);
		int PEX4GETPONRSTTIME(DWORD addr, int *MS);
		int PEX4GETVAUXMODE(DWORD addr, int *MODE);
		int PEX4SETVBATMODE(DWORD addr, int VBAT_MODE); 	// 0: 12V MODE, 1: VBAT MODE 
		int PEX4SETVBAT(DWORD addr, double VBAT_VOLT);
		int PEX4SETVBATOC(DWORD addr, double OC);
		int PEX4SET3V3OC(DWORD addr, double OC);
		int PEX4SETPONRSTTIME(DWORD addr, int MS);
		int PEX4SETVAUXMODE(DWORD addr, int MODE);

};

//!#000B, Oct/09/2007, Kikimum for Dll export to Borland C

#ifdef __cplusplus
extern "C" {
#endif

		SOLPETSDLL_API int   usecomport;
		SOLPETSDLL_API char CPEMDLL_PEMIO_Name[24][16];

		SOLPETSDLL_API int  __stdcall PETS_INIT();
		SOLPETSDLL_API int  __stdcall PETS_INIT1(int comport);
		SOLPETSDLL_API int  __stdcall PETS_INITEX();
		SOLPETSDLL_API int  __stdcall PETS_INITEX1(DWORD addr);
		SOLPETSDLL_API int  __stdcall PETS_EXIT();
		SOLPETSDLL_API int  __stdcall PETS_VALIDPEM(DWORD addr);
		SOLPETSDLL_API int  __stdcall PETS_SELPEM(DWORD addr);

		SOLPETSDLL_API int  __stdcall PETS_GETPNTYPE();
		SOLPETSDLL_API int  __stdcall PETS_VALIDDEV();
		SOLPETSDLL_API int  __stdcall PETS_SELDEVVD(DWORD Vid, DWORD Did, int index);
		SOLPETSDLL_API int  __stdcall PETS_SELDEVSVD(DWORD Vid, DWORD Did, DWORD Svid, DWORD Sdid, int index);		// 2013/09/12, Add
		SOLPETSDLL_API int  __stdcall PETS_SELDEVBD(DWORD Busno, DWORD Devno);  
		SOLPETSDLL_API int  __stdcall PETS_SELDEVFUNC(DWORD Busno, DWORD Devno, DWORD* FuncCtl);  // !#00C2: 08/08/2012		
		SOLPETSDLL_API int  __stdcall PETS_PON();
		SOLPETSDLL_API int  __stdcall PETS_POFF();
		SOLPETSDLL_API int  __stdcall PETS_GETPWRSTS();
		SOLPETSDLL_API int  __stdcall PETS_CHKSHORT();
		SOLPETSDLL_API int  __stdcall PETS_GET3V3V(double* volatge);
		SOLPETSDLL_API int  __stdcall PETS_GET1V5V(double* volatge);
		SOLPETSDLL_API int  __stdcall PETS_GET12V(double* volatge);
		SOLPETSDLL_API int  __stdcall PETS_GET3V3I(double* current);
		SOLPETSDLL_API int  __stdcall PETS_GET1V5I(double* current);
		SOLPETSDLL_API int  __stdcall PETS_GET3V3IMAX(double* current);	//!#0004
		SOLPETSDLL_API int  __stdcall PETS_GET1V5IMAX(double* current);	//!#0004
		SOLPETSDLL_API int  __stdcall PETS_GET12I(double* current);
		SOLPETSDLL_API int  __stdcall PETS_GETTEMP(DWORD devaddr, double* temp);	//!#0003

		SOLPETSDLL_API int  __stdcall PETS_SET1V5ICAL();
		SOLPETSDLL_API int  __stdcall PETS_SET3V3ICAL();
		SOLPETSDLL_API int  __stdcall PETS_SET12ICAL();
		SOLPETSDLL_API int  __stdcall PETS_SETUSECAL(int i);
		SOLPETSDLL_API int  __stdcall PETS_GETUSECAL();

		SOLPETSDLL_API int  __stdcall PETS_WINCHECK();
		SOLPETSDLL_API int  __stdcall PETS_WINEN(int delaytime);
		SOLPETSDLL_API int  __stdcall PETS_WINDIS(int delaytime);
		SOLPETSDLL_API int  __stdcall PETS_CHECKCFG(char* logfile);
		SOLPETSDLL_API int  __stdcall PETS_WAITCARDREMOVE();
		SOLPETSDLL_API int  __stdcall PETS_WAITCARDPLUG();
		SOLPETSDLL_API int  __stdcall PETS_CHECKCD();	//!#0005
		SOLPETSDLL_API int  __stdcall PETS_LEDGO();
		SOLPETSDLL_API int  __stdcall PETS_LEDNG();
		SOLPETSDLL_API int  __stdcall PETS_LEDOFF();
		SOLPETSDLL_API int  __stdcall PETS_BEEP(int freq, int time);
		SOLPETSDLL_API int  __stdcall PETS_SETPONRST(int setting);	//!#0004

		SOLPETSDLL_API int  __stdcall PETS_GETPNTYPE1(DWORD addr);
		SOLPETSDLL_API int  __stdcall PETS_VALIDDEV1(DWORD addr);
		SOLPETSDLL_API int  __stdcall PETS_SELDEVVD1(DWORD addr, DWORD Vid, DWORD Did, int index);
		SOLPETSDLL_API int  __stdcall PETS_SELDEVSVD1(DWORD addr, DWORD Vid, DWORD Did, DWORD Svid, DWORD Sdid, int index);		// 2013/09/12, Add		
		SOLPETSDLL_API int  __stdcall PETS_SELDEVBD1(DWORD addr, DWORD Busno, DWORD Devno);
		SOLPETSDLL_API int  __stdcall PETS_SELDEVFUNC1(DWORD addr, DWORD Busno, DWORD Devno, DWORD* FuncCtl);  // !#00C2: 08/08/2012				
		SOLPETSDLL_API int  __stdcall PETS_GETPWRSTS1(DWORD addr);
		SOLPETSDLL_API int  __stdcall PETS_CHKSHORT1(DWORD addr);
		SOLPETSDLL_API int  __stdcall PETS_GET3V3V1(DWORD addr, double* volatge);
		SOLPETSDLL_API int  __stdcall PETS_GET1V5V1(DWORD addr, double* volatge);
		SOLPETSDLL_API int  __stdcall PETS_GET12V1(DWORD addr, double* volatge);
		SOLPETSDLL_API int  __stdcall PETS_GET3V3I1(DWORD addr, double* current);
		SOLPETSDLL_API int  __stdcall PETS_GET1V5I1(DWORD addr, double* current);
		SOLPETSDLL_API int  __stdcall PETS_GET3V3IMAX1(DWORD addr, double* current);	//!#0004
		SOLPETSDLL_API int  __stdcall PETS_GET1V5IMAX1(DWORD addr, double* current);	//!#0004
		SOLPETSDLL_API int  __stdcall PETS_GETTEMP1(DWORD addr, DWORD devaddr, double* temp); //!#0003

		SOLPETSDLL_API int  __stdcall PETS_GET12I1(DWORD addr, double* current);
		SOLPETSDLL_API int  __stdcall PETS_SET1V5ICAL1(DWORD addr); 

		SOLPETSDLL_API int  __stdcall PETS_SET3V3ICAL1(DWORD addr);
		SOLPETSDLL_API int  __stdcall PETS_SET12ICAL1(DWORD addr);
		SOLPETSDLL_API int  __stdcall PETS_SETUSECAL1(DWORD addr, int i);
		SOLPETSDLL_API int  __stdcall PETS_GETUSECAL1(DWORD addr);

		SOLPETSDLL_API int  __stdcall PETS_PON1(DWORD addr);
		SOLPETSDLL_API int  __stdcall PETS_POFF1(DWORD addr);
		SOLPETSDLL_API int  __stdcall PETS_WINCHECK1(DWORD addr);
		SOLPETSDLL_API int  __stdcall PETS_WINEN1(DWORD addr, int delaytime);
		SOLPETSDLL_API int  __stdcall PETS_WINDIS1(DWORD addr, int delaytime);
		SOLPETSDLL_API int  __stdcall PETS_CHECKCFG1(DWORD addr, char* logfile);
		SOLPETSDLL_API int  __stdcall PETS_WAITCARDREMOVE1(DWORD addr);
		SOLPETSDLL_API int  __stdcall PETS_WAITCARDPLUG1(DWORD addr);
		SOLPETSDLL_API int  __stdcall PETS_CHECKCD1(DWORD addr);	//!#0005
		SOLPETSDLL_API int  __stdcall PETS_LEDGO1(DWORD addr);
		SOLPETSDLL_API int  __stdcall PETS_LEDNG1(DWORD addr);
		SOLPETSDLL_API int  __stdcall PETS_LEDOFF1(DWORD addr);
		SOLPETSDLL_API int  __stdcall PETS_BEEP1(DWORD addr, int freq, int time);
		SOLPETSDLL_API int	__stdcall PETS_SETPONRST1(DWORD addr, int setting);	//!#0004

		SOLPETSDLL_API void __stdcall PETS_GETLIBVER(int* major, int* minor);
		SOLPETSDLL_API int	__stdcall PETS_GETPCIDEVCOUNT();
		SOLPETSDLL_API int  __stdcall PETS_SELPCIDEV(int num);
		SOLPETSDLL_API char*	__stdcall PETS_GETPCIDEVDESC();
		SOLPETSDLL_API DWORD	__stdcall PETS_GETPCIDEVVID();
		SOLPETSDLL_API DWORD	__stdcall PETS_GETPCIDEVDID();
		SOLPETSDLL_API DWORD	__stdcall PETS_GETPCIDEVBUSNO();
		SOLPETSDLL_API DWORD	__stdcall PETS_GETPCIDEVDEVNO();
		SOLPETSDLL_API DWORD	__stdcall PETS_GETPCIDEVSVID();	//2013/09/12
		SOLPETSDLL_API DWORD	__stdcall PETS_GETPCIDEVSDID();	//2013/09/12

		SOLPETSDLL_API int  __stdcall PETS_GPIOSETUP(int pinno, int mode, int val);
		SOLPETSDLL_API int  __stdcall PETS_GPIOOUTSET(int pinno);
		SOLPETSDLL_API int  __stdcall PETS_GPIOOUTRESET(int pinno);
		SOLPETSDLL_API int  __stdcall PETS_GPIOIN(int pinno);
		SOLPETSDLL_API int  __stdcall PETS_GPIOGETSETUP(int pinno);

		SOLPETSDLL_API int  __stdcall PETS_GPIOSETUP1(DWORD addr, int pinno, int mode, int val);
		SOLPETSDLL_API int  __stdcall PETS_GPIOOUTSET1(DWORD addr, int pinno);
		SOLPETSDLL_API int  __stdcall PETS_GPIOOUTRESET1(DWORD addr, int pinno);
		SOLPETSDLL_API int  __stdcall PETS_GPIOIN1(DWORD addr, int pinno);
		SOLPETSDLL_API int  __stdcall PETS_GPIOGETSETUP1(DWORD addr, int pinno);

		//!#0009, Mar/09/2007
		SOLPETSDLL_API int  __stdcall PETS_PROBESMBCLKRISE(double* time);
		SOLPETSDLL_API int  __stdcall PETS_PROBESMBCLKRISE1(DWORD addr, double* time);
		//!#000A, Apr/18/2007, Vincent
		SOLPETSDLL_API int  __stdcall PETS_GET5V(double* volatge);
		SOLPETSDLL_API int  __stdcall PETS_GET5VI(double* current);
		SOLPETSDLL_API int  __stdcall PETS_GET5VIMAX(double* current);	
		SOLPETSDLL_API int  __stdcall PETS_GET5V1(DWORD addr, double* volatge);
		SOLPETSDLL_API int  __stdcall PETS_GET5VI1(DWORD addr, double* current);
		SOLPETSDLL_API int  __stdcall PETS_GET5VIMAX1(DWORD addr, double* current);


		SOLPETSDLL_API int  __stdcall PETS_WINEN21(DWORD addr, int delaytime);
		SOLPETSDLL_API int  __stdcall PETS_WINEN2(int delaytime);
		SOLPETSDLL_API int  __stdcall PETS_DEVRESCAN(int delaytime);

		SOLPETSDLL_API int  __stdcall PETS_RESETLINKEDDEVICECOUNT();
		SOLPETSDLL_API int  __stdcall PETS_ADDLINKEDDEVICEFUNC(unsigned long busnoi, unsigned long devnoi, unsigned long funcnoi);
		SOLPETSDLL_API int  __stdcall PETS_UPDATELINKEDDEVICE();

		SOLPETSDLL_API int  __stdcall PETS_RESETLINKEDDEVICECOUNT1(DWORD addr);
		SOLPETSDLL_API int  __stdcall PETS_ADDLINKEDDEVICEFUNC1(DWORD addr, unsigned long busnoi, unsigned long devnoi, unsigned long funcnoi);
		SOLPETSDLL_API int	__stdcall PETS_UPDATELINKEDDEVICE1(DWORD addr);

		//!#00B1, May/07/2008, Add
		SOLPETSDLL_API int  __stdcall	GETFIRMVERA(DWORD addr, int* major, int* minor);
		SOLPETSDLL_API int  __stdcall	GETFIRMVER(int* major, int* minor);
		//!#00B2, Jun/05/2008, Add
		SOLPETSDLL_API int  __stdcall	PWRCTL_AUTO();
		SOLPETSDLL_API int  __stdcall	PWRCTL_MANUAL();
		SOLPETSDLL_API int  __stdcall	PWRCTL_AUTOA(DWORD addr);
		SOLPETSDLL_API int  __stdcall	PWRCTL_MANUALA(DWORD addr);

		//!#00C1: IO Conttrol FOR PEM IOM V1.01
		SOLPETSDLL_API int __stdcall	PETS_IOMINIT();
		SOLPETSDLL_API int __stdcall	PETS_IOMGETPINOE(int pinno);
		SOLPETSDLL_API int __stdcall	PETS_IOMGETPINIE(int pinno);
		SOLPETSDLL_API int __stdcall	PETS_IOMSETPINOE(int pinno);
		SOLPETSDLL_API int __stdcall	PETS_IOMSETPINIE(int pinno);
		SOLPETSDLL_API int __stdcall	PETS_IOMSETPIN(int pinno, int hilo);
		SOLPETSDLL_API int __stdcall	PETS_IOMGETPIN(int pinno);
		SOLPETSDLL_API char* __stdcall	PETS_IOMGETPINNAME(int pinno);
		SOLPETSDLL_API int __stdcall	PETS_IOMSETPINPU(int pinno, int hilo);
		SOLPETSDLL_API int __stdcall	PETS_IOMGETPINPU(int pinno);

		SOLPETSDLL_API int __stdcall	PETS_IOMSETOE(unsigned long val);
		SOLPETSDLL_API int __stdcall	PETS_IOMSETIO(unsigned long val);
		SOLPETSDLL_API int __stdcall	PETS_IOMSETPU(unsigned long val);
		SOLPETSDLL_API int __stdcall	PETS_IOMGETIO(unsigned long *val);
		SOLPETSDLL_API int __stdcall	PETS_IOMGETPU(unsigned long *val);
		SOLPETSDLL_API int __stdcall	PETS_IOMGETOE(unsigned long *val);

		//!#00C3, Mar/05/2013, Vincent,
		SOLPETSDLL_API int __stdcall	NGSSDSLOTOFF();
		SOLPETSDLL_API int __stdcall	NGSSDSLOTON(int slot);
		SOLPETSDLL_API int __stdcall	NGSSDLEDGO(int slot);
		SOLPETSDLL_API int __stdcall	NGSSDLEDNG(int slot);
		SOLPETSDLL_API int __stdcall	NGSSDLEDOFF(int slot);	
		SOLPETSDLL_API int __stdcall	NGSSDGETCD(int slot);		
		SOLPETSDLL_API int __stdcall	NGSSDGETPSTS(int slot);		
		SOLPETSDLL_API int __stdcall	NGSSDGETCLKREQ(int slot);
		SOLPETSDLL_API int __stdcall	ISNGSSDVALID();


		SOLPETSDLL_API DWORD __stdcall PETS_GETDEVHWVID();
		SOLPETSDLL_API DWORD __stdcall PETS_GETDEVHWDID();
		SOLPETSDLL_API DWORD __stdcall PETS_GETDEVHWSVID();
		SOLPETSDLL_API DWORD __stdcall PETS_GETDEVHWSDID();		
		SOLPETSDLL_API DWORD __stdcall PETS_GETDEVHWVID1(DWORD addr);
		SOLPETSDLL_API DWORD __stdcall PETS_GETDEVHWDID1(DWORD addr);
		SOLPETSDLL_API DWORD __stdcall PETS_GETDEVHWSVID1(DWORD addr);
		SOLPETSDLL_API DWORD __stdcall PETS_GETDEVHWSDID1(DWORD addr);	
		
		//!#00C6, Aug/07/2014, Vincent 
		SOLPETSDLL_API int __stdcall PETS_RETRAINDEV();
		SOLPETSDLL_API int __stdcall PETS_RETRAINDEVA(DWORD addr);
		

#ifdef __cplusplus
}
#endif
