/***************************************************************************
**
**    $Header:   D:/EPSLDV1/SRC/LOG/FWSETUP/ABIEXTFN.H__   1.3   20 Jun 1996 09:34:50   ZJRD  $
**
**    $Log:   D:/EPSLDV1/SRC/LOG/FWSETUP/ABIEXTFN.H__  $
** 
**    Rev 1.3   20 Jun 1996 09:34:50   ZJRD
** EasyPack/SLD Version 1.20a
** 
**    Rev 1.1   10 Jun 1996 10:29:44   ZJRD
** EasyPack/SLD Version 1.20
** 
**    Rev 1.28   15 Feb 1996 08:52:00   Shirley
** EasyPack/SLD Version 1.01
** 
**    Rev 1.27   12 Feb 1996 14:10:22   Shirley
** No change.
** 
**    Rev 1.26   06 Feb 1996 15:36:44   Shirley
** No change.
** 
**    Rev 1.25   06 Feb 1996 13:51:00   Shirley
** No change.
** 
**    Rev 1.24   01 Feb 1996 10:12:16   Shirley
** No change.
** 
**    Rev 1.23   26 Jan 1996 09:15:20   Shirley
** No change.
** 
**    Rev 1.22   25 Jan 1996 13:15:14   Shirley
** No change.
** 
**    Rev 1.21   24 Jan 1996 10:38:50   Shirley
** No change.
** 
**    Rev 1.20   23 Jan 1996 11:24:00   Shirley
** No change.
** 
**    Rev 1.19   18 Jan 1996 10:08:44   Shirley
** No change.
** 
**    Rev 1.18   15 Jan 1996 16:13:36   Shirley
** No change.
** 
**    Rev 1.17   04 Jan 1996 11:08:00   Shirley
** No change.
** 
**    Rev 1.16   30 Nov 1995 09:10:32   Shirley
** No change.
** 
**    Rev 1.15   28 Nov 1995 15:31:20   Shirley
** No change.
** 
**    Rev 1.14   21 Nov 1995 11:18:44   Shirley
** EasyPack/SLD Version 0.31
** 
**    Rev 1.13   13 Nov 1995 09:27:32   Shirley
** No change.
** 
**    Rev 1.12   12 Nov 1995 11:32:58   Shirley
** No change.
** 
**    Rev 1.11   08 Nov 1995 16:31:22   Shirley
** No change.
** 
**    Rev 1.10   08 Nov 1995 12:42:56   Shirley
** EasyPack/SLD Version 0.22
** 
**    Rev 1.9   02 Nov 1995 10:03:46   Shirley
** No change.
** 
**    Rev 1.8   27 Oct 1995 16:50:24   Shirley
** No change.
** 
**    Rev 1.7   27 Oct 1995 13:46:46   Shirley
** No change.
** 
**    Rev 1.6   25 Oct 1995 14:30:52   Shirley
** No change.
** 
**    Rev 1.5   18 Oct 1995 14:46:56   Shirley
** No change.
** 
**    Rev 1.4   13 Oct 1995 13:21:46   Shirley
** EasyPack/SLD Version 0.1d
** 
**    Rev 1.3   29 Sep 1995 09:52:04   Shirley
** EasyPack/SLD Version 0.1c
** 
**    Rev 1.2   20 Sep 1995 10:51:26   Shirley
** No change.
** 
**    Rev 1.1   15 Sep 1995 09:43:22   Shirley
** No change.
** 
**    Rev 1.0   07 Sep 1995 09:53:14   Shirley
** Initial revision.
**
****************************************************************************/

/***************************************************************************
**
** File name : abiextfn.h
**
** Description:
**
** Modification:
**
** Programmer: Frank Chang
**
**    Copyright (C) 1996 Microtek International, Inc.
**    All Rights Reserved
**
****************************************************************************/

#include "abibase.h"

//////////////////////////////////////////////////////////////////////////////
//Communication ABI rountines
//
extern BOOL SetCommType(int nTempCommType);
extern BOOL SetupCommunication(UINT pData);

//////////////////////////////////////////////////////////////////////////////
//memory group ABI rountines
//
extern STATUS AbiGetMemN(ADDR addr1, ADDR addr2,char* pchBuff);
extern STATUS AbiSetMemN(ADDR addr, char* pchBuff, UINT uPatternLen);
extern STATUS AbiFill(ADDR addr1, ADDR addr2,char* pchBuff, UINT uPatternLen);
extern STATUS AbiChecksum(ADDR addr1, ADDR addr2, UINT* uChecksum);
extern STATUS AbiTest(ADDR addr1, ADDR addr2);
extern STATUS AbiCopy(ADDR addr1, ADDR addr2, ADDR destAddr);
extern STATUS AbiSearch(ADDR addr1, ADDR addr2, SEARCH_INFO searchInfo,
                        ADDR* retAddr);
extern STATUS AbiCompare(ADDR addr1, ADDR addr2, ADDR destAddr,
                  ADDR* retAddr);
          
extern STATUS AbiSetMap(MAP_INFO mapInfo);
extern STATUS AbiGetMap(ADDR addr1, ADDR addr2, MAP_INFO* mapInfo);
extern STATUS AbiSetVerify(FLAG uVerifyFlag);

extern STATUS AbiInitEprom();
extern STATUS AbiBurnEprom(BURN_EPROM burnEprom, WORD *wChecksum);

//unchecked, 02/08/96
extern STATUS AbiSwitchFlash();
extern STATUS AbiEraseFlash();
extern STATUS AbiProgramFlash(ADDR addr, char* pchBuff, UINT uPatternLen);


//////////////////////////////////////////////////////////////////////////////
//cpu register group routines
//
extern STATUS AbiGetCpuId(UINT *nCpuId);
extern STATUS AbiSetCpuId(UINT nSetCpuId, UINT *nGetCpuId);
extern STATUS AbiGetFwId(UCHAR *uchMajor,  UCHAR *uchMinor);
extern STATUS AbiGetCpuStatus(UINT *uCpuStatus);
extern STATUS AbiGetFreq(UCHAR *pszBuffer);

extern STATUS AbiGetAllReg(UINT* uRegValue);
extern STATUS AbiGetOneReg(int iRegId, UINT* uRegValue);
extern STATUS AbiSetReg(int iRegId, UINT uRegValue);
extern STATUS AbiGetRegLen(UINT *nRegLen);
extern STATUS AbiGetFWSupport(UINT *nCpuNum, UINT* uCpuType);
extern STATUS AbiGetTargetSupport(UINT *nCpuNum, UINT* nCpuType);


extern STATUS AbiSetPort(PARA_PORT port);
extern STATUS AbiOutput(PARA_PORT port, UINT uPortValue, UINT uMaskFlag);
extern STATUS AbiInput(PARA_PORT port, UINT *uPortValue);

extern STATUS AbiGetControl(int iControlId, FLAG* uControlFlag);
extern STATUS AbiSetControl(int iControlId, FLAG uControlFlag);
extern STATUS AbiDiagnostic();
extern STATUS AbiGetTimerCount(TIMER_COUNT *pTimerCount);


//////////////////////////////////////////////////////////////////////////////
//trace group rountines
//
extern STATUS AbiGetBp(ADDR addr1, ADDR addr2, ADDR* bpAddr);
extern STATUS AbiSetBp(ADDR addr);
extern STATUS AbiClrBp(ADDR addr);
extern STATUS AbiClrAllBp();

extern STATUS AbiReset(ADDR addr);
extern STATUS AbiAbort();
extern STATUS AbiGo(FLAG runFlag, ADDR fromAddr, ADDR tillAddr);

extern STATUS AbiStepOne();
extern STATUS AbiStepOver();
extern STATUS AbiStepRange(ADDR stAddr, ADDR endAddr);
extern STATUS AbiStepOverRange(ADDR stAddr, ADDR endAddr);

extern STATUS AbiCycle(int *iCycleNum, CYCLE_INFO *cycleInfo);

extern STATUS AbiGetEvent(FLAG *byControl, FLAG *byEv3, QUALIFY *pQualify,
                          BUS_EVENT *pEv1, BUS_EVENT *pEv2);
extern STATUS AbiSetEvent(BUS_EVENT busEvData);
extern STATUS AbiClrEvent(int evId);
extern STATUS AbiSetQualify(QUALIFY qualifyData);
extern STATUS AbiClrQualify();


extern STATUS AbiGetTrigger (FLAG *byTrigStatus,
                             FLAG *byLv1Status, TRIGGER_LEVEL* pLv1,
                             FLAG *byLv2Status, TRIGGER_LEVEL* pLv2,
                             TRIGGER_LOGIC* pTrigLogic);

extern STATUS AbiSetTraceStatus(FLAG uTraceFlag);
extern STATUS AbiSetTimerStatus(FLAG uTimerFlag);

extern STATUS AbiSetTrigStatus(FLAG uTraceFlag);
extern STATUS AbiSetTrigLevel(int levelId, TRIGGER_LEVEL trigLevelData);
extern STATUS AbiSetTrigLogic(TRIGGER_LOGIC trigLogicData);
extern STATUS AbiGetTraceBuffer(UINT readDirect, UINT startFrame, UINT endFrame,
                         QUALIFY aQualify,
                         TRACE_INFO* traceInfo, UCHAR* frameNum, FLAG* readEnd);
extern STATUS AbiGetTraceLastFrame(UINT *uLastFrame);



///////////////////////////////////////////////////////////////////////
// the others
//
extern ADDR AbiGetErrorAddr();

