USB-BDI
|
00001 /* USB-BDI Used for programming and debugging a MPC555 over USB 00002 * 00003 * Copyright 2005 NTB Interstate University of Applied Sciences of Technology Buchs 00004 * 00005 * This program is free software: you can redistribute it and/or modify 00006 * it under the terms of the GNU General Public License as published by 00007 * the Free Software Foundation, either version 3 of the License, or 00008 * (at your option) any later version. 00009 * 00010 * This program is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 * GNU General Public License for more details. 00014 */ 00015 00024 #ifndef DISPATCH_H_ 00025 #define DISPATCH_H_ 00026 00027 #include "fx2regs.h" 00028 #include "syncdelay.h" // SYNCDELAY macro 00029 00030 // Main Types 00032 #define MTYPE_ERROR 0x01 00033 00034 #define MTYPE_BDI_555 0x02 00035 00036 #define MTYPE_BDI_332 0x03 00037 00038 #define MTYPE_UART 0x04 00039 00040 // Sub Types 00041 // ERRORS 00043 #define STYPE_ERROR_UNKNOWN_MTYPE 0x70 00044 00045 #define STYPE_ERROR_HEADER 0x71 00046 00047 #define STYPE_ERROR_PACKET_END 0x72 00048 00049 // BDI 00050 // INSTRUCTION codes 00051 // General 00053 #define STYPE_BDI_GET_FREEZE 0x08 00054 // 555 00056 #define STYPE_BDI_555_35IN 0x01 00057 00058 #define STYPE_BDI_555_35OUT 0x02 00059 00060 #define STYPE_BDI_555_10IN 0x03 00061 00062 #define STYPE_BDI_555_10OUT 0x04 00063 00064 #define STYPE_BDI_555_FD_DATA 0x05 00065 00066 #define STYPE_BDI_555_HARD_RESET 0x06 00067 // 332 00069 #define STYPE_BDI_332_HARD_RESET 0x07 00070 00071 #define STYPE_BDI_332_IN 0x10 00072 00073 #define STYPE_BDI_332_OUT 0x11 00074 00075 #define STYPE_BDI_332_FILL_BYTE_WORD 0x12 00076 00077 #define STYPE_BDI_332_FILL_LONG 0x13 00078 00079 #define STYPE_BDI_332_DUMP 0x14 00080 00081 // RETURN codes 00083 #define STYPE_BDI_SUCCESS_FD 0x60 00084 00085 #define STYPE_BDI_HARD_RESET_SUCCESS 0x61 00086 00087 #define STYPE_BDI_FREEZE_RESULT 0x62 00088 00089 #define STYPE_BDI_DUMP_DATA 0x63 00090 // ERROR codes 00092 #define STYPE_BDI_UNKNOWN_STYPE 0x70 00093 00094 #define STYPE_BDI_ERROR_FD_LENGTH 0x71 00095 00096 #define STYPE_BDI_ERROR_FD_GENERAL 0x72 00097 00098 #define STYPE_BDI_ERROR_TIMEOUT 0x73 00099 00100 #define STYPE_BDI_DUMP_ERROR 0x74 00101 00102 // UART 0 00104 #define STYPE_UART_0_IN 0x11 00105 00106 #define STYPE_UART_0_OUT 0x22 00107 00108 // RETURN codes 00110 #define STYPE_UART_SUCCESS 0x60 00111 // ERROR codes 00113 #define STYPE_UART_UNKNOWN_STYPE 0x70 00114 00115 #define STYPE_UART_DATA_TOO_LONG 0x71 00116 00117 void initPacket(unsigned char mainType, unsigned char subType, unsigned short dataLength); 00118 void dispatch(unsigned short dataLength); 00119 00120 #endif /* DISPATCH_H_ */