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 00035 #ifndef _ISR_H_ 00036 #define _ISR_H_ 00037 00038 /* 00039 * Standard Vector numbers 00040 */ 00041 00043 #define SV_INT_0 0x03 00044 00045 #define SV_TIMER_0 0x0b 00046 00047 #define SV_INT_1 0x13 00048 00049 #define SV_TIMER_1 0x1b 00050 00051 #define SV_SERIAL_0 0x23 00052 00053 #define SV_TIMER_2 0x2b 00054 00055 #define SV_RESUME 0x33 00056 00057 #define SV_SERIAL_1 0x3b 00058 00059 #define SV_INT_2 0x43 00060 00061 #define SV_I2C 0x4b 00062 00063 #define SV_INT_4 0x53 00064 00065 #define SV_INT_5 0x5b 00066 00067 #define SV_INT_6 0x63 00068 00069 #define SV_MIN SV_INT_0 00070 00071 #define SV_MAX SV_INT_6 00072 00073 /* 00074 * USB Auto Vector numbers 00075 */ 00077 #define UV_SUDAV 0x00 00078 00079 #define UV_SOF 0x04 00080 00081 #define UV_SUTOK 0x08 00082 00083 #define UV_SUSPEND 0x0c 00084 00085 #define UV_USBRESET 0x10 00086 00087 #define UV_HIGHSPEED 0x14 00088 00089 #define UV_EP0ACK 0x18 00090 00091 #define UV_SPARE_1C 0x1c 00092 00093 #define UV_EP0IN 0x20 00094 00095 #define UV_EP0OUT 0x24 00096 00097 #define UV_EP1IN 0x28 00098 00099 #define UV_EP1OUT 0x2c 00100 00101 #define UV_EP2 0x30 00102 00103 #define UV_EP4 0x34 00104 00105 #define UV_EP6 0x38 00106 00107 #define UV_EP8 0x3c 00108 00109 #define UV_IBN 0x40 00110 00111 #define UV_SPARE_44 0x44 00112 00113 #define UV_EP0PINGNAK 0x48 00114 00115 #define UV_EP1PINGNAK 0x4c 00116 00117 #define UV_EP2PINGNAK 0x50 00118 00119 #define UV_EP4PINGNAK 0x54 00120 00121 #define UV_EP6PINGNAK 0x58 00122 00123 #define UV_EP8PINGNAK 0x5c 00124 00125 #define UV_ERRLIMIT 0x60 00126 00127 #define UV_SPARE_64 0x64 00128 00129 #define UV_SPARE_68 0x68 00130 00131 #define UV_SPARE_6C 0x6c 00132 00133 #define UV_EP2ISOERR 0x70 00134 00135 #define UV_EP4ISOERR 0x74 00136 00137 #define UV_EP6ISOERR 0x78 00138 00139 #define UV_EP8ISOERR 0x7c 00140 00141 #define UV_MIN UV_SUDAV 00142 00143 #define UV_MAX UV_EP8ISOERR 00144 /***/ 00145 00146 /* 00147 * FIFO/GPIF Auto Vector numbers 00148 */ 00150 #define FGV_EP2PF 0x80 00151 00152 #define FGV_EP4PF 0x84 00153 00154 #define FGV_EP6PF 0x88 00155 00156 #define FGV_EP8PF 0x8c 00157 00158 #define FGV_EP2EF 0x90 00159 00160 #define FGV_EP4EF 0x94 00161 00162 #define FGV_EP6EF 0x98 00163 00164 #define FGV_EP8EF 0x9c 00165 00166 #define FGV_EP2FF 0xa0 00167 00168 #define FGV_EP4FF 0xa4 00169 00170 #define FGV_EP6FF 0xa8 00171 00172 #define FGV_EP8FF 0xac 00173 00174 #define FGV_GPIFDONE 0xb0 00175 00176 #define FGV_GPIFWF 0xb4 00177 00179 #define FGV_MIN FGV_EP2PF 00180 00181 #define FGV_MAX FGV_GPIFWF 00182 00183 00184 /* 00185 * Hook standard interrupt vector. 00186 * 00187 * vector_number is from the SV_<foo> list above. 00188 * addr is the address of the interrupt service routine. 00189 */ 00190 void hook_sv (unsigned char vector_number, unsigned short addr); 00191 00192 /* 00193 * Hook usb interrupt vector. 00194 * 00195 * vector_number is from the UV_<foo> list above. 00196 * addr is the address of the interrupt service routine. 00197 */ 00198 void hook_uv (unsigned char vector_number, unsigned short addr); 00199 00200 /* 00201 * Hook fifo/gpif interrupt vector. 00202 * 00203 * vector_number is from the FGV_<foo> list above. 00204 * addr is the address of the interrupt service routine. 00205 */ 00206 void hook_fgv (unsigned char vector_number, unsigned short addr); 00207 00208 /* 00209 * One time call to enable autovectoring for both USB and FIFO/GPIF 00210 */ 00211 void setup_autovectors (void); 00212 00216 #define clear_usb_irq() \ 00217 EXIF &= ~bmEXIF_USBINT; \ 00218 INT2CLR = 0 00219 00223 #define clear_fifo_gpif_irq() \ 00224 EXIF &= ~bmEXIF_IE4; \ 00225 INT4CLR = 0 00226 00227 #endif /* _ISR_H_ */