⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 agdi.h

📁 KEIL的例程
💻 H
📖 第 1 页 / 共 3 页
字号:

#pragma pack(1)
typedef struct PgRess  {   // Progress-Setup and Control structure
  I32       Job;           // PROGRESS_INIT/KILL/SETPOS
  I32       pos;           // PROGRESS_SETPOS: position to set
  I32       low;           // low percent (normally 0) 
  I32       hig;           // high percent (normally 100)
  SC8    *label;           // text-label before progress-bar or NULL
  SC8    *ctext;           // 15.3.2003, Text instead of % display
} OIL;
#pragma pack()


/*
 * Flash-Parameter-Block, used in AG_CB_GETFLASHPARAM CallBack
 */
#pragma pack(1)
typedef struct FlashBlock   {
  UL32           start;   // Start-Address
  UL32            many;   // Number of Bytes
  UC8           *image;   // Content
  UL32         ActSize;   // total number of bytes
  UL32        Stop : 1;   // cancel FlashDownLoad
  UL32        Res [16];   // reserved, unused
} FLASHPARM;
#pragma pack()



/*
 * Init/Query Target features
 */

#define AG_INITFEATURES   0x0100       // Init target features
#define AG_GETFEATURE     0x0200       // extract a single feature
#define AG_INITITEM       0x0300       // Init item
#define AG_EXECITEM       0x0400       // Execute item


/*
 * Supported Target Features:
 */
#define AG_F_MEMACCR      0x0001       // memory-access while running
#define AG_F_REGACCR      0x0002       // register-access while running
#define AG_F_TRACE        0x0003       // back-trace support
#define AG_F_COVERAGE     0x0004       // code-coverage support
#define AG_F_PALYZE       0x0005       // Performance-Analyzer support
#define AG_F_MEMMAP       0x0006       // Memory-Map support
#define AG_F_RESETR       0x0007       // Reset while running possible feature
#define AG_F_251MODE      0x0008       // 251: get mode (SRC_MODE/BIN_MODE)
#define AG_F_251FRMSZ     0x0009       // 251: get framesize (FRM_SIZE2/4)
#define AG_F_251CPU       0x000A       // 251: get CPU type (CPU_251/CPU_51)
#define AG_F_16XBIE       0x000B       // 167: brk within EXTx-Sequ allowed
                                       //      ret: 1:=yes, 0:=no
#define AG_F_LANALYZER    0x000C       // Logic-Analyzer support


/*
 * Connection and Communication Items used for 'AG_INITITEM':
 */
#define AG_INITMENU       0x0007       // init extension menu
#define AG_INITEXTDLGUPD  0x0008       // init modeless extesion dlg update function
#define AG_INITMHANDLEP   0x0009       // setup ptr to HWND of active modeless dlg
#define AG_INITPHANDLEP   0x000A       // pointer to parent handle (MainFrame)
#define AG_INITINSTHANDLE 0x000B       // pointer to Agdi-instance handle
#define AG_INITBPHEAD     0x000E       // pointer to Bp-head
#define AG_INITCURPC      0x000F       // pointer to Program counter
#define AG_INITDOEVENTS   0x0010       // pointer do DoEvents()
#define AG_INITUSRMSG     0x0011       // Registered Message for SendMessage
#define AG_INITCALLBACK   0x0012       // pointer to callback function

//---19.7.2002: added for Flash DownLoad:
#define AG_INITFLASHLOAD  0x0013       // Prepare for Flash Download
#define AG_STARTFLASHLOAD 0x0014       // Start Flash DownLoad

//---2.11.2004: added for Hitex-AGDI:
#define AG_INITCWINAPP    0x0020       // sent Item is 'CWinApp *'
#define AG_INITSTARTLOAD  0x0021       // 'Load about to start' (item := 'LOADPARMS *')
#define AG_INITENDLOAD    0x0022       // 'Load finished' (item := NULL)

/*
 * AG_EXECITEM items:
 */
#define AG_UNINIT         0x000C       // Clean up target
#define AG_RESET          0x000D       // Reset target system
#define AG_GETMODE        0x000E       // for S8051.DLL: Get Dallas Contigious Mode
//---26.10.2000: added for Hitex Emulators:
#define AG_RUNSTART       0x0010       // Announcement: Go/Step about to start
#define AG_RUNSTOP        0x0011       //             : Go/Step completed.
#define AG_QUERY_LASIG    0x0012       // 27.1.2005
#define AG_KILLED_LASIG   0x0013       // 27.1.2005
//---



typedef struct agdi_la  {    // Query LA-Signal  /27.1.2005/
  struct agdi_la *next;
  U64             nAdr;      // LA-Signal: memory address
  U64            nSize;      // LA-Signal: size of analyzed item in Bytes
  GVAL               v;      // value
  U32            SigNo;      // internal LA signal number (don't change)
  U32           killed;      //
  U32         nRes[16];      // reserved

  char    szDname[128];      // Signal's display name
  char      szExp[128];      // the expr.-text: LA CREATE <expr>
  char    szError[256];      // Error-Text
} AGDI_LA;


typedef struct  {            // Write-Data-Record
  I64           tStamp;      // Time-Stamp of write
  I64          totTime;      // total running time
  U64              nPC;      // PC-value at time of write
  U64             nAdr;      // Write-Address
  GVAL               v;      // Write-value @nAdr
  U32            wType;      // 1:=Byte, 2:=W16, 4=U32, 8=U64
  U32            SigNo;      // LASIG-Number (1...255)
  U32         nRes[16];      // reserved
} AGDI_LAREC;
//---TODO: define - tStamp/totTime uSec or cycles ???


/*
 * Errors returned from AG_QUERY_LASIG:
 */
#define AGDI_LA_OK              1   // LA-Signal was accepted by target
#define AGDI_LA_NOTSUPPORTED (-10)  // LA-Sig Address-Range not accepted





/*
 * 26.1.2005, Info given on AG_INITSTARTLOAD: (see example dated /26.1.2005/ in this file)
 */
typedef struct  {
  char      szFile [512];              // full path name of App to load
  BYTE       Incremental;              // 1:=incremental load
  BYTE            NoCode;              // 1:=no code
  BYTE      Reserved[32];
} LOADPARMS;



#pragma pack(1)

typedef struct ag_line  {
  U16            line;
  UL32           addr;
} AG_LINE;

typedef struct ag_scope  {
  DWORD        AddrIn;    // Input: Address to be mapped to Scope
                          // Output values:
  const char *pModule;    // name of Module
  const char   *pFunc;    // name of Function

  DWORD         lowPC;    // Scope-Block lower bound
  DWORD         higPC;    // Scope-Block upper bound
  DWORD        nLines;    // number of lines
  DWORD       curLine;    // current line (or 0 if none)
  AG_LINE     *pLines;    // Line-Number Array
  char    szPath[512];    // full path name of source file

  DWORD      nRes[32];    // reserved
} AG_SCOPE;


typedef struct ag_block  {    // App/Module/Func Enumeration
  char const      *pApp;      // App-Name (wg. incremental load)
  char const   *pModule;      // Module-Name
  char const     *pFunc;      // Function-Name
  UL32            lowPC;      // Function starts at 'lowPC'
  UL32            higPC;      //          and extends up to and including 'higPC'
// ***DO NOT MODIFY these:
  void              *pA;      // internal reserved data  /App/
  void              *pT;      // internal reserved data  /Theadr/
  void              *pF;      // internal reserved data  /Func/
  UL32             m1:1;
} AG_BLOCK;

#pragma pack()



/*
 * Call-Back-Function in S166 and supported sub-functions
 */

typedef U32 (*pCBF) (U32 nCode, void *vp);
#define AG_CB_TRUEXPR         1   // vp := 'EXP *' (use for Bp->ep)
#define AG_CB_PROGRESS        2   // vp := 'struct PgRess *'
#define AG_CB_INITREGV        3   // vp := 'REGDSC *' (into RegView)
#define AG_CB_EXECCMD         4   // vp := 'char *' command string
#define AG_CB_FORCEUPDATE     5   // vp := NULL, force general windows update
#define AG_CB_DISASM          6   // vp := 'DAAS *', disasm opcodes
#define AG_CB_INLASM          7   // vp := 'DAAS *', assemble szB[] into Opc[]
#define AG_CB_MSGSTRING       8   // vp := 'char *' text for message pane
#define AG_CB_GETDEVINFO      9   // vp := 'DEV_X66 *', get device info
#define AG_CB_SYMBYVAL       10   // vp := 'SYMDESC *', find symbol by value
#define AG_CB_SYMBYNAME      11   // vp := 'SYMDESC *', find symbol by name
#define AG_CB_SLE66MM        12   // vp := &slots[0] out of [512]
#define AG_CB_PHYS2MMU       13   // vp := (void *) ((DWORD) physAdr)
#define AG_CB_MMU2PHYS       14   // vp := (void *) ((DWORD) logicalAdr)
#define AG_CB_GETFLASHPARAM  15   // vp := (FLASHPARM *) or NULL
#define AG_CB_GETBOMPTR      16   // vp := &ioc  /5.3.2003/

                                  // Note: special callback for DTC-Messaging
#define AG_CB_DCTMSG_WRITE   17   // vp := write-access address

#define AG_CB_DISASM_EXT     18   // vp := 'DAS_MIXED *', disasm to file
#define AG_CB_LAREC_DATA     19   // vp := 'AGDI_LAREC *', send data-record to Logic-Analyzer
#define AG_CB_SHUTDOWN       20   //
#define AG_CB_GETSCOPEINFO   21   // vp := 'AG_SCOPE *', get Scope Info
#define AG_CB_ENUMFUNCTIONS  22   // vp := 'AG_BLOCK *'. enumerate App/Modules/Functions



#ifdef _IN_TARG_         // define if used in Mon166,Emu...
  extern _EXPO_ U32   AG_Init (U16 nCode, void *vp);
#else                    // S166
  extern        U32 (*AG_Init) (U16 nCode, void *vp);
#endif



/*
 * Memory attributes
 */

#define AG_ATR_EXEC   0x01    // 'executable ' Attribute
#define AG_ATR_READ   0x02    // 'readable' Attribute
#define AG_ATR_WRITE  0x04    // 'writable' Attribute
#define AG_ATR_BREAK  0x08    // 'Exec-Break' Attribute
#define AG_ATR_EXECD  0x10    // 'Executed' Attribute
#define AG_ATR_WATCH  0x20    // Location has a Watch
#define AG_ATR_BPDIS  0x40    // 'disabled Exec-Break' Attribute
#define AG_ATR_PAP    0x80    // Location has a Perf.-Analyzer point
#define AG_ATR_WRBRK  0x100   // Loc has a write-access break
#define AG_ATR_RDBRK  0x200   // Loc has a read-access break
#define AG_ATR_COMC   0x400   // iMCS51/251: Common code marker
#define AG_ATR_VNM    0x800   // iMCS51: von Neumann mapped
#define AG_ATR_BEP    0x1000  // iMCS51: Bank-Entry Point
#define AG_ATR_EXTR   0x2000  // 166/167: within range of an EXTR sequence
#define AG_ATR_JTAKEN 0x4000  // Jump-taken attribute

/*
 * ARM-specific attributes:
 */
#define AG_ATR_THUMB   0x00000080   // 'Thumb' code
#define AG_ATR_ARM     0x00008000   // 'ARM' code
#define AG_ATR_NOINST  0x00080000   // 'No instruction' Attribute


#define AG_MEMMAP     0x01    // map memory
#define AG_GETMEMATT  0x02    // get memory attribute
#define AG_SETMEMATT  0x03    // set memory attribute


#ifdef _IN_TARG_         // define if used in Mon166,Emu...
  extern _EXPO_ U32   AG_MemAtt (U16 nCode, UL32 nAttr, GADR *pA);
#else
  extern        U32 (*AG_MemAtt) (U16 nCode, UL32 nAttr, GADR *pA);
#endif



/*
 * Breakpoint query and access
 */

#define AG_ABREAK  0        // simple code address break
#define AG_CBREAK  1        // conditional break (check after each instr.)
#define AG_WBREAK  2        // data access break
#define AG_RBREAK  3        // Address-Range Break (currently not used)


#pragma pack(1)
struct AG_Bps  {
  struct AG_Bps *next;
  struct AG_Bps *prev;

  UL32       type : 4;      // ABREAK, CBREAK, WBREAK
  UL32    enabled : 1;      // 1:=enabled, 0:=disabled
  UL32     ReCalc : 1;      // recalc expr flag
  UL32     BytObj : 1;      // WatchBrk: 0:=Bytes, 1:=Objects

  UL32            Adr;      // Address (or Range)
  UL32         mSpace;      // memory-space
  void            *pV;      // used on VTR-access breakpoints

  UL32          tsize;      // WatchBrk: size of one object
  UL32           many;      // WatchBrk: many objects or bytes
  U16             acc;      // WatchBrk: 1:=Read, 2:=Write, 3:=ReadWrite
  U16          BitPos;      // currently not used
  UL32         number;      // BreakPoint-Number
  I32          rcount;      // Break is taken when rcount = 1

  I32          ocount;      // Original Count
  void            *ep;      // conditional-Expression
  char           *cmd;      // Exec-Command
  char          *Line;      // Breakpoint-Expression Line for Display
  char            *pF;      // module file name
  UL32          nLine;      // line number
  UC8          Opc[8];      // Opcode-Save Area for Monitors
};
#pragma pack()

#define AG_BP  struct AG_Bps



#define AG_BPQUERY     0x01
#define AG_BPTOGGLE    0x02       // not sent to target
#define AG_BPINSREM    0x03       // not sent to target
#define AG_BPACTIVATE  0x04       // not sent to target
#define AG_BPDISALL    0x05       // Notification: all Bp's have been disabled
#define AG_BPKILLALL   0x06       // Notification: all Bp's have been killed
#define AG_BPEXQUERY   0x07
#define AG_CADRVALID   0x10       // Is code address valid ?
                                  // added these /8.2.99/
#define AG_BPENABLE    0x08       // Notification: Enable Bp at address
#define AG_BPDISABLE   0x09       // Notification: Disable Bp at address
#define AG_BPKILL      0x0A       // Notification: Kill Bp at address
#define AG_BPSET       0x0B       // Notification: Set Bp at address




#ifdef _IN_TARG_         // define if used in Mon166,Emu...
  extern _EXPO_ U32    AG_BpInfo (U16 nCode, void *vp);
  extern _EXPO_ AG_BP *AG_BreakFunc (U16 nCode, U16 n1, GADR *pA, AG_BP *pB);
#else
  extern U32     (*AG_BpInfo) (U16 nCode, void *vp);
  extern AG_BP  *(*AG_BreakFunc) (U16 nCode, U16 n1, GADR *pA, AG_BP *pB);
#endif

/*
 * AG_BP *AG_BreakFunc (U16 nCode, U16 n1, GADR *pA, AG_BP *pB);
 *   nCode := AG_BPQUERY, AG_BPINSREM, ...
 *      n1 :=  
 */

/*
 * Go/Step function
 */

#define AG_STOPRUN    0x01            // force target to stop Go/Step.
#define AG_NSTEP      0x02            // exteute 'n' steps
#define AG_GOTILADR   0x03            // go til address
#define AG_GOFORBRK   0x04            // go forever or some Bp fires


#ifdef _IN_TARG_         // define if used in Mon166,Emu...
  extern _EXPO_ U32   AG_GoStep (U16 nCode, U32 nSteps, GADR *pA);
#else
  extern        U32 (*AG_GoStep) (U16 nCode, U32 nSteps, GADR *pA);
#endif



/*
 * Serial-Window I/O (thread-safe)
 */


struct SerAS  {
  DWORD         n1;
  DWORD         n2;
  DWORD         n3;
  DWORD         n4;
  GVAL           v;
};

#define AG_SERBOUT  0x01       // write nMany bytes to Serial #1 Window
#define AG_SERWOUT  0x02       // write nMany words to Serial #1 Window
#define AG_SERXIN   0x03       // Key was pressed in Serial Window #1 or #2

#ifdef _IN_TARG_               // define if used in Mon166,Emu...
  extern _EXPO_ U32  AG_Serial (U16 nCode, U32 nSerNo, U32 nMany, void *vp);
                               // nCode := AG_SER?OUT / AG_SERXIN
                               // nSerNo:  0:=Serial #1, 1:=Serial #2
                               // nMany:   number of items
                               // vp:      pointer to items (UC8 or U16)
#else
  extern       U32 (*AG_Serial) (U16 nCode, U32 nSerNo, U32 nMany, void *vp);
#endif


/*
 * Register and Memory access functions
 */

#define AG_READ     0x01     // read operation
#define AG_WRITE    0x02     // write operation
#define AG_WROPC    0x03     // write opcodes
#define AG_RDOPC    0x04     // read opcodes
#define AG_RDMMU66  0x05     // 19.12.99, read Sle66 MMU content
#define AG_WRMMU66  0x06     // 19.12.99, write single Sle66 MMU-Descr.
#define AG_RCRC     0x07     // Sle66 read CRC
#define AG_RDSHIELD 0x08     // Sle66 read Shield
#define AG_RDACE    0x09     // Sle66 read ACE

//--- 8.7.2002: added for flash download, otherwise like 'AG_WRITE'
#define AG_F_WRITE  0x0A     // Write to Flash memory (download)
#define AG_F_VERIFY 0x0B     // Verify FLash Memory
#define AG_F_ERASE  0x0C     // Erase Flash
#define AG_F_RUN    0x0D     // Start flashed App.

//---2.4.2003: added for SmartMX Peripheral Access
#define AG_RD_XDES  0x10     // MXP: read DES (16 Bytes)
#define AG_RD_XAES  0x11     // MXP: read AES (16 Bytes)
#define AG_RD_XCRC  0x12     // MXP: read CRC (2 Bytes)
#define AG_RD_XVECT 0x13     // MXP: read Vectors (10 DWORDS, prepared)

//---22.7.2003: added for SLE66 RF Interface
#define AG_RDRF     0x14     // SLE66: Read RF Fifo registers
#define AG_WRRF     0x15     // SLE66: Write RF Fifo registers
#define AG_RDMOVB   0x16     // SLE66: Read  SFR via MOVB
#define AG_WRMOVB   0x17     // SLE66: Write SFR via MOVB

//---26.8.2004: added for SLE66 Special Access
#define AG_BONVMREAD   0x18  // SLE66: BoNVMRead Macro
#define AG_BONVMWRITE  0x19  // SLE66: BoNVMWrite Macro

#pragma pack (1)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -