X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=firmware%2Finclude%2Fcommand.h;h=be52d17c1bd0e8209a52eb206759c441513fb2e1;hb=ea4f451d1fbdc93bb175c7b55a43f3e906219a62;hp=fe3beb1faa983efd30aba551f1ba5383652f4208;hpb=f4a6b415e762bcdc560f3ea655851d16f483ea5a;p=goodfet diff --git a/firmware/include/command.h b/firmware/include/command.h index fe3beb1..be52d17 100644 --- a/firmware/include/command.h +++ b/firmware/include/command.h @@ -3,12 +3,28 @@ \brief Command codes and buffers. */ -//! Global data buffer. + +//Types +#define u8 unsigned char +#define u16 unsigned int +#define u32 unsigned long + + +#ifdef msp430x2254 +//256 bytes, plus overhead +//For chips with very little RAM. +#define CMDDATALEN 0x104 +#warning Very little RAM. +#endif #ifndef CMDDATALEN -#define CMDDATALEN 0x200 +//512 bytes +#define CMDDATALEN 0x204 +//4k +//#define CMDDATALEN 0x1004 #endif +//! Global data buffer. extern unsigned char cmddata[CMDDATALEN]; extern unsigned char silent; @@ -46,34 +62,7 @@ extern unsigned char silent; #define MONITOR_SIZEBUF 0xC2 -//CHIPCON commands -#define CC_CHIP_ERASE 0x80 -#define CC_WR_CONFIG 0x81 -#define CC_RD_CONFIG 0x82 -#define CC_GET_PC 0x83 -#define CC_READ_STATUS 0x84 -#define CC_SET_HW_BRKPNT 0x85 -#define CC_HALT 0x86 -#define CC_RESUME 0x87 -#define CC_DEBUG_INSTR 0x88 -#define CC_STEP_INSTR 0x89 -#define CC_STEP_REPLACE 0x8a -#define CC_GET_CHIP_ID 0x8b -//CHIPCON macros -#define CC_READ_CODE_MEMORY 0x90 -#define CC_READ_XDATA_MEMORY 0x91 -#define CC_WRITE_XDATA_MEMORY 0x92 -#define CC_SET_PC 0x93 -#define CC_CLOCK_INIT 0x94 -#define CC_WRITE_FLASH_PAGE 0x95 -#define CC_READ_FLASH_PAGE 0x96 -#define CC_MASS_ERASE_FLASH 0x97 -#define CC_PROGRAM_FLASH 0x98 - -//JTAG commands -#define JTAG_IR_SHIFT 0x80 -#define JTAG_DR_SHIFT 0x81 -#define JTAG_DR_SHIFT20 0x91 + //SPI commands #define SPI_JEDEC 0x80 @@ -83,21 +72,14 @@ extern unsigned char silent; #define OCT_CMP 0x90 #define OCT_RES 0x91 -//JTAG430 commands -#define JTAG430_HALTCPU 0xA0 -#define JTAG430_RELEASECPU 0xA1 -#define JTAG430_SETINSTRFETCH 0xC1 -#define JTAG430_SETPC 0xC2 -#define JTAG430_WRITEMEM 0xE0 -#define JTAG430_WRITEFLASH 0xE1 -#define JTAG430_READMEM 0xE2 -#define JTAG430_ERASEFLASH 0xE3 -#define JTAG430_ERASECHECK 0xE4 -#define JTAG430_VERIFYMEM 0xE5 -#define JTAG430_BLOWFUSE 0xE6 -#define JTAG430_ISFUSEBLOWN 0xE7 -#define JTAG430_COREIP_ID 0xF0 -#define JTAG430_DEVICE_ID 0xF1 +#define WEAKDEF __attribute__ ((weak)) + +//! Handle a plugin, weak-linked to error. +extern int pluginhandle(unsigned char app, + unsigned char verb, + unsigned int len) + WEAKDEF; + //! Handle a command. Defined in goodfet.c void handle(unsigned char app, @@ -137,10 +119,12 @@ void msdelay(unsigned int ms); void monitorhandle(unsigned char, unsigned char, unsigned long); void spihandle(unsigned char, unsigned char, unsigned long); -void i2chandle(unsigned char, unsigned char, unsigned long); -void cchandle(unsigned char, unsigned char, unsigned long); +void i2chandle(unsigned char, unsigned char, unsigned long) WEAKDEF; +void cchandle(unsigned char, unsigned char, unsigned long) WEAKDEF; void jtaghandle(unsigned char, unsigned char, unsigned long); void jtag430handle(unsigned char, unsigned char, unsigned long); void jtag430x2handle(unsigned char app, unsigned char verb, unsigned long len); - +void avrhandle(unsigned char app, + unsigned char verb, + unsigned long len);