
/***************************************************************************
**
**    $Header$
**
**    $Log$
** 
****************************************************************************/
/***************************************************************************
**
** File name : abiextfn.h
**
** Description: john 1997.1 for TW ABI
**
** Modification:
**
** Programmer: 
**
**    Copyright (C) 1996 Microtek International, Inc.
**    All Rights Reserved
**
****************************************************************************/
#ifndef _ABIEXTFN_
#define _ABIEXTFN_

#include "stdafx.h"   
#include "abitype.h"
#include "abicore.h"     

//////////////////////////////////////////////////////////////////////////////
#ifdef __cplusplus
extern "C" {
#endif	// __cplusplus
void WINAPI InitABIDLL();
BOOL WINAPI NewABIDLL(ABI_INIT_OPTION nOption);
BOOL WINAPI ExitABIDLL();

CBaseAbi* WINAPI GetAbi();
CBaseSerialAgree* WINAPI GetCom();
void WINAPI GetSerialBaudRateStr(CString& strBaud);
void WINAPI GetSerialPortNumStr(CString& strPort);


STATUS WINAPI emuAbort();
STATUS WINAPI emuChecksum(ADDR addr, U32 len, U16 *n,RET_ADDR* retAddr);
STATUS WINAPI emuClrEvent(U16 evId);
STATUS WINAPI emuClrAllEvent();
STATUS WINAPI emuCompare(ADDR addr1, U32 len, ADDR addr2, RET_ADDR *findAddr1, RET_ADDR *findAddr2);
STATUS WINAPI emuCopy(ADDR addr1, U32 len, ADDR addr2,RET_ADDR* addrRet1,RET_ADDR* addrRet2);
STATUS WINAPI emuFill(ADDR addr, U32 len, U16 patternLen, U8 *buff,RET_ADDR* retAddr);
STATUS WINAPI emuGetAllReg(U32 *cpuReg);
STATUS WINAPI emuGetTrigger(U8 *byTrigStatus,
                     U8 *byLv1Status, TRIGGER_LEVEL* pLv1,
                     U8 *byLv2Status, TRIGGER_LEVEL* pLv2,
                     TRIGGER_LOGIC* pTrigLogic);
STATUS WINAPI emuGetControl(U16 *signals);
STATUS WINAPI emuGetCpuStatus(U32 *cpuStatus);
STATUS WINAPI emuGetEvent(U8 *byControl, U8 *byEv3,BUS_EVENT *pEv1, BUS_EVENT *pEv2);
STATUS WINAPI emuGetID(U8 *ID_Info);
STATUS WINAPI emuGetMap(ADDR,ADDR,MAP_INFO *mapData);
STATUS WINAPI emuGetMemN(ADDR addr, U16 len ,U8 *buff,RET_ADDR* retAddr);
STATUS WINAPI emuGetReg(REG_MODE regMode, S16 regId,U32 *content);
STATUS WINAPI emuGetTraceDepth(U16 bufID,BUFFER_DEPTH *traceDepth);
STATUS WINAPI emuGetVerify(U16 *verifyFlag);
STATUS WINAPI emuGo(U16 mode,ADDR fromAddr,ADDR tillAddr);
STATUS WINAPI emuInput(U16 port, U16 len, U16 size, U8 *buff);
STATUS WINAPI emuListTraceBuff(U32 startFrame, 
			            U32 endFrame, QUALIFY_INFO *qualifyInfo,
			          	U8 *frameLen,TRACE_INFO *traceInfo,
						U8 *readEnd);
STATUS WINAPI emuOutput (U16 port, U8 *buff , U16 len, U16 size);
STATUS WINAPI emuReset(ADDR addr);
STATUS WINAPI emuSearch(ADDR addr, U32 len, U8 *buff, U16 patternLen,U8 caseFlag,
				 RET_ADDR* retAddr);
STATUS WINAPI emuSetBp(ADDR addr);
STATUS WINAPI emuSetControl(U16 signals);
STATUS WINAPI emuSetEvent(U16 evId, BUS_EVENT *busEventData);
STATUS WINAPI emuSetExtEvent(U16 evData);
STATUS WINAPI emuSetID(U16 idFlag);
STATUS WINAPI emuSetMap(ADDR addr1, ADDR addr2, U16 attrib);
STATUS WINAPI emuSetMemN(ADDR addr, U8 *buff, U16 patternLen,RET_ADDR* retAddr);
STATUS WINAPI emuSetTrigLogic(TRIGGER_LOGIC* trigLogicData);
STATUS WINAPI emuSetVerify(U16 verifyFlag);
STATUS WINAPI emuStepRange(U16 uNextAddrNum, ADDR* NextAddr,ADDR* stopAddr);
STATUS WINAPI emuTest(ADDR addr1, U32 len,RET_ADDR* retAddr);
STATUS WINAPI emuGetFWSupport(U16 * wCpuNum,U16* wCpuType);
STATUS WINAPI emuClrBp(ADDR addr);
STATUS WINAPI emuStepOne();
STATUS WINAPI emuStepOver();
STATUS WINAPI emuEreaseFlash (U32 bankNo,RET_ADDR* addr);
STATUS WINAPI emuProgFlash(U8 dataLen, U8 bOptionBankLowOrHigh,U16 startAddr, U8 *dataContent); 
STATUS WINAPI emuSwitchFlash ();
STATUS WINAPI emuFillFlashBland ( ADDR addr1, ADDR addr2, U8 blankValue,RET_ADDR* retAddr);
STATUS WINAPI emuFwInit();
STATUS WINAPI emuSetQualify(QUALIFY* qualifyData);
STATUS WINAPI emuClearQualify();
STATUS WINAPI emuSetTrigLevel(int levelId, TRIGGER_LEVEL* trigLevelData);
STATUS WINAPI emuSetTriggerStatus(U8 triggerFlag);
STATUS WINAPI emuSetTraceStatus(U8 tracerFlag);
STATUS WINAPI emuInitBank(BANKINIT* bankInit);
STATUS WINAPI emuGetBp(ADDR addr1, ADDR addr2, ADDR* bpAddr);
STATUS WINAPI emuSetReg(REG_MODE regMode, S16 regId,U32 content);
STATUS WINAPI emuSelectBaud(BYTE bBaud);
STATUS WINAPI emuTestCom(BYTE* pChar,BYTE& bRetLen);
STATUS WINAPI emuSetMemMode(BYTE bMode);
STATUS WINAPI emuGetMemMode(BYTE& bMode);
STATUS WINAPI emuGetUesData(BYTE bType,BYTE& bLen,BYTE* pBuff);
STATUS WINAPI emuProgram(BYTE bType,BYTE bUes);
STATUS WINAPI emuSendProgData(WORD wAddr,BYTE bLen,BYTE* pBuff);
STATUS WINAPI emuGetTimerCount(float& fTimerCounter);
STATUS WINAPI emuDiagnostic(BYTE* pbOption, DIAGNORESULT* result);
//only for diagnostic 97.6
STATUS WINAPI emuGetDiagnosticMeterTimer(BYTE& bTimer);
STATUS WINAPI emuSetDiagnosticIsStop(BOOL isStop); 
#ifdef __cplusplus
}
#endif
#endif
