2 \author Travis Goodspeed
3 \brief Command codes and buffers.
6 //! Global data buffer.
7 extern unsigned char cmddata[0x100];
8 extern unsigned char silent;
10 #define cmddataword ((unsigned int*) cmddata)
11 #define cmddatalong ((unsigned long*) cmddata)
12 #define memorybyte ((unsigned char*) 0)
13 #define memoryword ((unsigned int*) 0)
29 #define MONITOR_CHANGE_BAUD 0x80
30 #define MONITOR_RAM_PATTERN 0x90
31 #define MONITOR_RAM_DEPTH 0x91
33 #define MONITOR_DIR 0xA0
34 #define MONITOR_OUT 0xA1
35 #define MONITOR_IN 0xA2
37 #define MONITOR_SILENT 0xB0
39 #define MONITOR_READBUF 0xC0
40 #define MONITOR_WRITEBUF 0xC1
41 #define MONITOR_SIZEBUF 0xC2
45 #define CC_CHIP_ERASE 0x80
46 #define CC_WR_CONFIG 0x81
47 #define CC_RD_CONFIG 0x82
48 #define CC_GET_PC 0x83
49 #define CC_READ_STATUS 0x84
50 #define CC_SET_HW_BRKPNT 0x85
52 #define CC_RESUME 0x87
53 #define CC_DEBUG_INSTR 0x88
54 #define CC_STEP_INSTR 0x89
55 #define CC_STEP_REPLACE 0x8a
56 #define CC_GET_CHIP_ID 0x8b
58 #define CC_READ_CODE_MEMORY 0x90
59 #define CC_READ_XDATA_MEMORY 0x91
60 #define CC_WRITE_XDATA_MEMORY 0x92
61 #define CC_SET_PC 0x93
62 #define CC_CLOCK_INIT 0x94
63 #define CC_WRITE_FLASH_PAGE 0x95
64 #define CC_READ_FLASH_PAGE 0x96
65 #define CC_MASS_ERASE_FLASH 0x97
66 #define CC_PROGRAM_FLASH 0x98
69 #define JTAG_IR_SHIFT 0x80
70 #define JTAG_DR_SHIFT 0x81
71 #define JTAG_DR_SHIFT20 0x91
74 #define SPI_JEDEC 0x80
75 #define SPI_ERASE 0x81
82 #define JTAG430_HALTCPU 0xA0
83 #define JTAG430_RELEASECPU 0xA1
84 #define JTAG430_SETINSTRFETCH 0xC1
85 #define JTAG430_SETPC 0xC2
86 #define JTAG430_WRITEMEM 0xE0
87 #define JTAG430_WRITEFLASH 0xE1
88 #define JTAG430_READMEM 0xE2
89 #define JTAG430_ERASEFLASH 0xE3
90 #define JTAG430_ERASECHECK 0xE4
91 #define JTAG430_VERIFYMEM 0xE5
92 #define JTAG430_BLOWFUSE 0xE6
93 #define JTAG430_ISFUSEBLOWN 0xE7
94 #define JTAG430_COREIP_ID 0xF0
95 #define JTAG430_DEVICE_ID 0xF1
97 //! Handle a command. Defined in goodfet.c
98 void handle(unsigned char app,
103 void txdata(unsigned char app,
106 //! Transmit a string.
107 void txstring(unsigned char app,
110 //! Transmit a debug string.
111 void debugstr(const char *str);
113 //! Delay for a count.
114 void delay(unsigned int count);
116 void msdelay(unsigned int ms);
119 void monitorhandle(unsigned char, unsigned char, unsigned char);
120 void spihandle(unsigned char, unsigned char, unsigned char);
121 void i2chandle(unsigned char, unsigned char, unsigned char);
122 void cchandle(unsigned char, unsigned char, unsigned char);
123 void jtaghandle(unsigned char, unsigned char, unsigned char);
124 void jtag430handle(unsigned char, unsigned char, unsigned char);
125 void jtag430x2handle(unsigned char app, unsigned char verb,