#pragma once

#include "ftd2xx.h"
#include "../EngineDef.h"

#pragma warning( disable : 4996)

int board_present;
int bus_busy;
char m_NameNmbr[256];

HICON m_hIcon;
HMODULE m_hmodule;
FT_HANDLE m_ftHandle;

	FT_STATUS Engine Open(PVOID pvDevice);
	FT_STATUS Engine OpenEx(PVOID pArg1, DWORD dwFlags);
	FT_STATUS Engine ListDevices(PVOID pArg1, PVOID pArg2, DWORD dwFlags);
	FT_STATUS Engine UCIDrvClose();	
	FT_STATUS Engine Read(LPVOID lpvBuffer, DWORD dwBuffSize, LPDWORD lpdwBytesRead);	
	FT_STATUS Engine Write(LPVOID lpvBuffer, DWORD dwBuffSize, LPDWORD lpdwBytes);	
	FT_STATUS Engine ResetDevice();	
	FT_STATUS Engine Purge(ULONG dwMask);	
	FT_STATUS Engine SetTimeouts(ULONG dwReadTimeout, ULONG dwWriteTimeout);	
	FT_STATUS Engine GetQueueStatus(LPDWORD lpdwAmountInRxQueue);
	int Engine InitDrv();
	int Engine UCIDrvInit();
	void Engine Outputb(int PPI, int add);
	unsigned char Engine HexASC_TO_INT(char* str);
	int Engine Inputb(int PPI);
	int Engine CalCulBit(int data, int BitNum);
	