2 \author Travis Goodspeed
3 \brief Command codes and buffers.
6 //! Global data buffer.
9 #define CMDDATALEN 0x204
12 extern unsigned char cmddata[CMDDATALEN];
13 extern unsigned char silent;
15 #define cmddataword ((unsigned int*) cmddata)
16 #define cmddatalong ((unsigned long*) cmddata)
17 #define memorybyte ((unsigned char*) 0)
18 #define memoryword ((unsigned int*) 0)
34 #define MONITOR_CHANGE_BAUD 0x80
35 #define MONITOR_RAM_PATTERN 0x90
36 #define MONITOR_RAM_DEPTH 0x91
38 #define MONITOR_DIR 0xA0
39 #define MONITOR_OUT 0xA1
40 #define MONITOR_IN 0xA2
42 #define MONITOR_SILENT 0xB0
44 #define MONITOR_READBUF 0xC0
45 #define MONITOR_WRITEBUF 0xC1
46 #define MONITOR_SIZEBUF 0xC2
50 #define CC_CHIP_ERASE 0x80
51 #define CC_WR_CONFIG 0x81
52 #define CC_RD_CONFIG 0x82
53 #define CC_GET_PC 0x83
54 #define CC_READ_STATUS 0x84
55 #define CC_SET_HW_BRKPNT 0x85
57 #define CC_RESUME 0x87
58 #define CC_DEBUG_INSTR 0x88
59 #define CC_STEP_INSTR 0x89
60 #define CC_STEP_REPLACE 0x8a
61 #define CC_GET_CHIP_ID 0x8b
63 #define CC_READ_CODE_MEMORY 0x90
64 #define CC_READ_XDATA_MEMORY 0x91
65 #define CC_WRITE_XDATA_MEMORY 0x92
66 #define CC_SET_PC 0x93
67 #define CC_CLOCK_INIT 0x94
68 #define CC_WRITE_FLASH_PAGE 0x95
69 #define CC_READ_FLASH_PAGE 0x96
70 #define CC_MASS_ERASE_FLASH 0x97
71 #define CC_PROGRAM_FLASH 0x98
74 #define JTAG_IR_SHIFT 0x80
75 #define JTAG_DR_SHIFT 0x81
76 #define JTAG_DR_SHIFT20 0x91
79 #define SPI_JEDEC 0x80
80 #define SPI_ERASE 0x81
87 #define JTAG430_HALTCPU 0xA0
88 #define JTAG430_RELEASECPU 0xA1
89 #define JTAG430_SETINSTRFETCH 0xC1
90 #define JTAG430_SETPC 0xC2
91 #define JTAG430_WRITEMEM 0xE0
92 #define JTAG430_WRITEFLASH 0xE1
93 #define JTAG430_READMEM 0xE2
94 #define JTAG430_ERASEFLASH 0xE3
95 #define JTAG430_ERASECHECK 0xE4
96 #define JTAG430_VERIFYMEM 0xE5
97 #define JTAG430_BLOWFUSE 0xE6
98 #define JTAG430_ISFUSEBLOWN 0xE7
99 #define JTAG430_COREIP_ID 0xF0
100 #define JTAG430_DEVICE_ID 0xF1
102 //! Handle a plugin, weak-linked to error.
103 extern int pluginhandle(unsigned char app,
106 __attribute__ ((weak));
109 //! Handle a command. Defined in goodfet.c
110 void handle(unsigned char app,
113 //! Transmit a header.
114 void txhead(unsigned char app,
118 void txdata(unsigned char app,
121 //! Transmit a string.
122 void txstring(unsigned char app,
127 unsigned long rxlong();
129 unsigned int rxword();
132 void txlong(unsigned long l);
134 void txword(unsigned int l);
136 //! Transmit a debug string.
137 void debugstr(const char *str);
139 //! Delay for a count.
140 void delay(unsigned int count);
142 void msdelay(unsigned int ms);
145 void monitorhandle(unsigned char, unsigned char, unsigned long);
146 void spihandle(unsigned char, unsigned char, unsigned long);
147 void i2chandle(unsigned char, unsigned char, unsigned long);
148 void cchandle(unsigned char, unsigned char, unsigned long);
149 void jtaghandle(unsigned char, unsigned char, unsigned long);
150 void jtag430handle(unsigned char, unsigned char, unsigned long);
151 void jtag430x2handle(unsigned char app, unsigned char verb,