www.pudn.com > jtag_emulator.rar > jtag_protocol.h


#ifndef __JTAG_PROTOCOL_H__
#define __JTAG_PROTOCOL_H__

#define JTAG_COMMAND    0xA5111111
#define JTAG_REPLY      0xA5222222
#define JTAG_ERROR      0xA5444444

#define OP_RESET        0x00         // -                     -
#define OP_ID_RD        0x01         // -                     id

#define OP_ICE_RD       0x02         // reg                   val
#define OP_ICE_WR       0x03         // (reg, val) * count    -
#define OP_ICE_WAIT     0x04         // reg, mask, val        -

#define OP_RESTART      0x05         // -                     -

#define OP_DBG_RD       0x06         // -                     data * count
#define OP_DBG_WR       0x07         // data * count          -
#define OP_DBG_WR_BKPT  0x08         // -                     -

#define OP_EXEC         0x09         // instr                 -

#define OP_RESET_0      0x0A
#define OP_RESET_1      0x0B

#define ERROR_HEADER    1
#define ERROR_TIMEOUT   2
#define ERROR_BADOP     3

/* OP_EXEC is a shortcut instruction for:
**
** OP_DBG_WR | 1, ARM_NOP
** OP_DBG_WR_BKPT
** OP_DBG_WR | 2, , ARM_NOP
** OP_RESTART
** OP_ICE_WAIT, ICE_DEBUG_STATUS, 9, 9
**
*/

#define COUNT(n) ((n) << 8)
#endif