Fx2lib
0.2
|
00001 // Copyright (C) 2009 Ubixum, Inc. 00002 // 00003 // This library is free software; you can redistribute it and/or 00004 // modify it under the terms of the GNU Lesser General Public 00005 // License as published by the Free Software Foundation; either 00006 // version 2.1 of the License, or (at your option) any later version. 00007 // 00008 // This library is distributed in the hope that it will be useful, 00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00011 // Lesser General Public License for more details. 00012 // 00013 // You should have received a copy of the GNU Lesser General Public 00014 // License along with this library; if not, write to the Free Software 00015 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00016 00038 #ifndef FX2REGS_H 00039 #define FX2REGS_H 00040 00041 #include "fx2types.h" 00042 00043 __xdata __at 0xE400 volatile BYTE GPIF_WAVE_DATA; 00044 __xdata __at 0xE480 volatile BYTE RES_WAVEDATA_END; 00045 00046 // General Configuration 00047 00048 __xdata __at 0xE600 volatile BYTE CPUCS; 00049 __xdata __at 0xE601 volatile BYTE IFCONFIG; 00050 __xdata __at 0xE602 volatile BYTE PINFLAGSAB; 00051 __xdata __at 0xE603 volatile BYTE PINFLAGSCD; 00052 __xdata __at 0xE604 volatile BYTE FIFORESET; 00053 __xdata __at 0xE605 volatile BYTE BREAKPT; 00054 __xdata __at 0xE606 volatile BYTE BPADDRH; 00055 __xdata __at 0xE607 volatile BYTE BPADDRL; 00056 __xdata __at 0xE608 volatile BYTE UART230; 00057 __xdata __at 0xE609 volatile BYTE FIFOPINPOLAR; 00058 __xdata __at 0xE60A volatile BYTE REVID; 00059 __xdata __at 0xE60B volatile BYTE REVCTL; 00060 00061 // Endpoint Configuration 00062 00063 __xdata __at 0xE610 volatile BYTE EP1OUTCFG; 00064 __xdata __at 0xE611 volatile BYTE EP1INCFG; 00065 __xdata __at 0xE612 volatile BYTE EP2CFG; 00066 __xdata __at 0xE613 volatile BYTE EP4CFG; 00067 __xdata __at 0xE614 volatile BYTE EP6CFG; 00068 __xdata __at 0xE615 volatile BYTE EP8CFG; 00069 __xdata __at 0xE618 volatile BYTE EP2FIFOCFG; 00070 __xdata __at 0xE619 volatile BYTE EP4FIFOCFG; 00071 __xdata __at 0xE61A volatile BYTE EP6FIFOCFG; 00072 __xdata __at 0xE61B volatile BYTE EP8FIFOCFG; 00073 __xdata __at 0xE620 volatile BYTE EP2AUTOINLENH; 00074 __xdata __at 0xE621 volatile BYTE EP2AUTOINLENL; 00075 __xdata __at 0xE622 volatile BYTE EP4AUTOINLENH; 00076 __xdata __at 0xE623 volatile BYTE EP4AUTOINLENL; 00077 __xdata __at 0xE624 volatile BYTE EP6AUTOINLENH; 00078 __xdata __at 0xE625 volatile BYTE EP6AUTOINLENL; 00079 __xdata __at 0xE626 volatile BYTE EP8AUTOINLENH; 00080 __xdata __at 0xE627 volatile BYTE EP8AUTOINLENL; 00081 __xdata __at 0xE630 volatile BYTE EP2FIFOPFH; 00082 __xdata __at 0xE631 volatile BYTE EP2FIFOPFL; 00083 __xdata __at 0xE632 volatile BYTE EP4FIFOPFH; 00084 __xdata __at 0xE633 volatile BYTE EP4FIFOPFL; 00085 __xdata __at 0xE634 volatile BYTE EP6FIFOPFH; 00086 __xdata __at 0xE635 volatile BYTE EP6FIFOPFL; 00087 __xdata __at 0xE636 volatile BYTE EP8FIFOPFH; 00088 __xdata __at 0xE637 volatile BYTE EP8FIFOPFL; 00089 __xdata __at 0xE640 volatile BYTE EP2ISOINPKTS; 00090 __xdata __at 0xE641 volatile BYTE EP4ISOINPKTS; 00091 __xdata __at 0xE642 volatile BYTE EP6ISOINPKTS; 00092 __xdata __at 0xE643 volatile BYTE EP8ISOINPKTS; 00093 __xdata __at 0xE648 volatile BYTE INPKTEND; 00094 __xdata __at 0xE649 volatile BYTE OUTPKTEND; 00095 00096 // Interrupts 00097 00098 __xdata __at 0xE650 volatile BYTE EP2FIFOIE; 00099 __xdata __at 0xE651 volatile BYTE EP2FIFOIRQ; 00100 __xdata __at 0xE652 volatile BYTE EP4FIFOIE; 00101 __xdata __at 0xE653 volatile BYTE EP4FIFOIRQ; 00102 __xdata __at 0xE654 volatile BYTE EP6FIFOIE; 00103 __xdata __at 0xE655 volatile BYTE EP6FIFOIRQ; 00104 __xdata __at 0xE656 volatile BYTE EP8FIFOIE; 00105 __xdata __at 0xE657 volatile BYTE EP8FIFOIRQ; 00106 __xdata __at 0xE658 volatile BYTE IBNIE; 00107 __xdata __at 0xE659 volatile BYTE IBNIRQ; 00108 __xdata __at 0xE65A volatile BYTE NAKIE; 00109 __xdata __at 0xE65B volatile BYTE NAKIRQ; 00110 __xdata __at 0xE65C volatile BYTE USBIE; 00111 __xdata __at 0xE65D volatile BYTE USBIRQ; 00112 __xdata __at 0xE65E volatile BYTE EPIE; 00113 __xdata __at 0xE65F volatile BYTE EPIRQ; 00114 __xdata __at 0xE660 volatile BYTE GPIFIE; 00115 __xdata __at 0xE661 volatile BYTE GPIFIRQ; 00116 __xdata __at 0xE662 volatile BYTE USBERRIE; 00117 __xdata __at 0xE663 volatile BYTE USBERRIRQ; 00118 __xdata __at 0xE664 volatile BYTE ERRCNTLIM; 00119 __xdata __at 0xE665 volatile BYTE CLRERRCNT; 00120 __xdata __at 0xE666 volatile BYTE INT2IVEC; 00121 __xdata __at 0xE667 volatile BYTE INT4IVEC; 00122 __xdata __at 0xE668 volatile BYTE INTSETUP; 00123 00124 // Input/Output 00125 00126 __xdata __at 0xE670 volatile BYTE PORTACFG; 00127 __xdata __at 0xE671 volatile BYTE PORTCCFG; 00128 __xdata __at 0xE672 volatile BYTE PORTECFG; 00129 __xdata __at 0xE678 volatile BYTE I2CS; 00130 __xdata __at 0xE679 volatile BYTE I2DAT; 00131 __xdata __at 0xE67A volatile BYTE I2CTL; 00132 __xdata __at 0xE67B volatile BYTE XAUTODAT1; 00133 __xdata __at 0xE67C volatile BYTE XAUTODAT2; 00134 00135 #define EXTAUTODAT1 XAUTODAT1 00136 #define EXTAUTODAT2 XAUTODAT2 00137 00138 // USB Control 00139 00140 __xdata __at 0xE680 volatile BYTE USBCS; 00141 __xdata __at 0xE681 volatile BYTE SUSPEND; 00142 __xdata __at 0xE682 volatile BYTE WAKEUPCS; 00143 __xdata __at 0xE683 volatile BYTE TOGCTL; 00144 __xdata __at 0xE684 volatile BYTE USBFRAMEH; 00145 __xdata __at 0xE685 volatile BYTE USBFRAMEL; 00146 __xdata __at 0xE686 volatile BYTE MICROFRAME; 00147 __xdata __at 0xE687 volatile BYTE FNADDR; 00148 00149 // Endpoints 00150 00151 __xdata __at 0xE68A volatile BYTE EP0BCH; 00152 __xdata __at 0xE68B volatile BYTE EP0BCL; 00153 __xdata __at 0xE68D volatile BYTE EP1OUTBC; 00154 __xdata __at 0xE68F volatile BYTE EP1INBC; 00155 __xdata __at 0xE690 volatile BYTE EP2BCH; 00156 __xdata __at 0xE691 volatile BYTE EP2BCL; 00157 __xdata __at 0xE694 volatile BYTE EP4BCH; 00158 __xdata __at 0xE695 volatile BYTE EP4BCL; 00159 __xdata __at 0xE698 volatile BYTE EP6BCH; 00160 __xdata __at 0xE699 volatile BYTE EP6BCL; 00161 __xdata __at 0xE69C volatile BYTE EP8BCH; 00162 __xdata __at 0xE69D volatile BYTE EP8BCL; 00163 __xdata __at 0xE6A0 volatile BYTE EP0CS; 00164 __xdata __at 0xE6A1 volatile BYTE EP1OUTCS; 00165 __xdata __at 0xE6A2 volatile BYTE EP1INCS; 00166 __xdata __at 0xE6A3 volatile BYTE EP2CS; 00167 __xdata __at 0xE6A4 volatile BYTE EP4CS; 00168 __xdata __at 0xE6A5 volatile BYTE EP6CS; 00169 __xdata __at 0xE6A6 volatile BYTE EP8CS; 00170 __xdata __at 0xE6A7 volatile BYTE EP2FIFOFLGS; 00171 __xdata __at 0xE6A8 volatile BYTE EP4FIFOFLGS; 00172 __xdata __at 0xE6A9 volatile BYTE EP6FIFOFLGS; 00173 __xdata __at 0xE6AA volatile BYTE EP8FIFOFLGS; 00174 __xdata __at 0xE6AB volatile BYTE EP2FIFOBCH; 00175 __xdata __at 0xE6AC volatile BYTE EP2FIFOBCL; 00176 __xdata __at 0xE6AD volatile BYTE EP4FIFOBCH; 00177 __xdata __at 0xE6AE volatile BYTE EP4FIFOBCL; 00178 __xdata __at 0xE6AF volatile BYTE EP6FIFOBCH; 00179 __xdata __at 0xE6B0 volatile BYTE EP6FIFOBCL; 00180 __xdata __at 0xE6B1 volatile BYTE EP8FIFOBCH; 00181 __xdata __at 0xE6B2 volatile BYTE EP8FIFOBCL; 00182 __xdata __at 0xE6B3 volatile BYTE SUDPTRH; 00183 __xdata __at 0xE6B4 volatile BYTE SUDPTRL; 00184 __xdata __at 0xE6B5 volatile BYTE SUDPTRCTL; 00185 __xdata __at 0xE6B8 volatile BYTE SETUPDAT[8]; 00186 00187 // GPIF 00188 00189 __xdata __at 0xE6C0 volatile BYTE GPIFWFSELECT; 00190 __xdata __at 0xE6C1 volatile BYTE GPIFIDLECS; 00191 __xdata __at 0xE6C2 volatile BYTE GPIFIDLECTL; 00192 __xdata __at 0xE6C3 volatile BYTE GPIFCTLCFG; 00193 __xdata __at 0xE6C4 volatile BYTE GPIFADRH; 00194 __xdata __at 0xE6C5 volatile BYTE GPIFADRL; 00195 00196 __xdata __at 0xE6CE volatile BYTE GPIFTCB3; 00197 __xdata __at 0xE6CF volatile BYTE GPIFTCB2; 00198 __xdata __at 0xE6D0 volatile BYTE GPIFTCB1; 00199 __xdata __at 0xE6D1 volatile BYTE GPIFTCB0; 00200 00201 __xdata __at 0xE6D2 volatile BYTE EP2GPIFFLGSEL; 00202 __xdata __at 0xE6D3 volatile BYTE EP2GPIFPFSTOP; 00203 __xdata __at 0xE6D4 volatile BYTE EP2GPIFTRIG; 00204 __xdata __at 0xE6DA volatile BYTE EP4GPIFFLGSEL; 00205 __xdata __at 0xE6DB volatile BYTE EP4GPIFPFSTOP; 00206 __xdata __at 0xE6DC volatile BYTE EP4GPIFTRIG; 00207 __xdata __at 0xE6E2 volatile BYTE EP6GPIFFLGSEL; 00208 __xdata __at 0xE6E3 volatile BYTE EP6GPIFPFSTOP; 00209 __xdata __at 0xE6E4 volatile BYTE EP6GPIFTRIG; 00210 __xdata __at 0xE6EA volatile BYTE EP8GPIFFLGSEL; 00211 __xdata __at 0xE6EB volatile BYTE EP8GPIFPFSTOP; 00212 __xdata __at 0xE6EC volatile BYTE EP8GPIFTRIG; 00213 __xdata __at 0xE6F0 volatile BYTE XGPIFSGLDATH; 00214 __xdata __at 0xE6F1 volatile BYTE XGPIFSGLDATLX; 00215 __xdata __at 0xE6F2 volatile BYTE XGPIFSGLDATLNOX; 00216 __xdata __at 0xE6F3 volatile BYTE GPIFREADYCFG; 00217 __xdata __at 0xE6F4 volatile BYTE GPIFREADYSTAT; 00218 __xdata __at 0xE6F5 volatile BYTE GPIFABORT; 00219 00220 // UDMA 00221 00222 __xdata __at 0xE6C6 volatile BYTE FLOWSTATE; 00223 __xdata __at 0xE6C7 volatile BYTE FLOWLOGIC; 00224 __xdata __at 0xE6C8 volatile BYTE FLOWEQ0CTL; 00225 __xdata __at 0xE6C9 volatile BYTE FLOWEQ1CTL; 00226 __xdata __at 0xE6CA volatile BYTE FLOWHOLDOFF; 00227 __xdata __at 0xE6CB volatile BYTE FLOWSTB; 00228 __xdata __at 0xE6CC volatile BYTE FLOWSTBEDGE; 00229 __xdata __at 0xE6CD volatile BYTE FLOWSTBHPERIOD; 00230 __xdata __at 0xE60C volatile BYTE GPIFHOLDAMOUNT; 00231 __xdata __at 0xE67D volatile BYTE UDMACRCH; 00232 __xdata __at 0xE67E volatile BYTE UDMACRCL; 00233 __xdata __at 0xE67F volatile BYTE UDMACRCQUAL; 00234 00235 // Endpoint Buffers 00236 00237 __xdata __at 0xE740 volatile BYTE EP0BUF[64]; 00238 __xdata __at 0xE780 volatile BYTE EP1OUTBUF[64]; 00239 __xdata __at 0xE7C0 volatile BYTE EP1INBUF[64]; 00240 __xdata __at 0xF000 volatile BYTE EP2FIFOBUF[1024]; 00241 __xdata __at 0xF400 volatile BYTE EP4FIFOBUF[1024]; 00242 __xdata __at 0xF800 volatile BYTE EP6FIFOBUF[1024]; 00243 __xdata __at 0xFC00 volatile BYTE EP8FIFOBUF[1024]; 00244 00245 // Error Correction Code (ECC) Registers (FX2LP/FX1 only) 00246 00247 __xdata __at 0xE628 volatile BYTE ECCCFG; 00248 __xdata __at 0xE629 volatile BYTE ECCRESET; 00249 __xdata __at 0xE62A volatile BYTE ECC1B0; 00250 __xdata __at 0xE62B volatile BYTE ECC1B1; 00251 __xdata __at 0xE62C volatile BYTE ECC1B2; 00252 __xdata __at 0xE62D volatile BYTE ECC2B0; 00253 __xdata __at 0xE62E volatile BYTE ECC2B1; 00254 __xdata __at 0xE62F volatile BYTE ECC2B2; 00255 00256 // Feature Registers (FX2LP/FX1 only) 00257 __xdata __at 0xE50D volatile BYTE GPCR2; 00258 00268 __sfr __at 0x80 IOA; 00269 /* IOA */ 00270 __sbit __at 0x80 + 0 PA0; 00271 __sbit __at 0x80 + 1 PA1; 00272 __sbit __at 0x80 + 2 PA2; 00273 __sbit __at 0x80 + 3 PA3; 00274 __sbit __at 0x80 + 4 PA4; 00275 __sbit __at 0x80 + 5 PA5; 00276 __sbit __at 0x80 + 6 PA6; 00277 __sbit __at 0x80 + 7 PA7; 00278 __sfr __at 0x81 SP; 00279 __sfr __at 0x82 DPL; 00280 __sfr __at 0x83 DPH; 00281 __sfr __at 0x84 DPL1; 00282 __sfr __at 0x85 DPH1; 00283 __sfr __at 0x86 DPS; 00284 __sfr __at 0x87 PCON; 00285 __sfr __at 0x88 TCON; 00286 /* TCON */ 00287 __sbit __at 0x88+0 IT0; 00288 __sbit __at 0x88+1 IE0; 00289 __sbit __at 0x88+2 IT1; 00290 __sbit __at 0x88+3 IE1; 00291 __sbit __at 0x88+4 TR0; 00292 __sbit __at 0x88+5 TF0; 00293 __sbit __at 0x88+6 TR1; 00294 __sbit __at 0x88+7 TF1; 00295 __sfr __at 0x89 TMOD; 00296 __sfr __at 0x8A TL0; 00297 __sfr __at 0x8B TL1; 00298 __sfr __at 0x8C TH0; 00299 __sfr __at 0x8D TH1; 00300 __sfr __at 0x8E CKCON; 00301 __sfr __at 0x90 IOB; 00302 /* IOB */ 00303 __sbit __at 0x90 + 0 PB0; 00304 __sbit __at 0x90 + 1 PB1; 00305 __sbit __at 0x90 + 2 PB2; 00306 __sbit __at 0x90 + 3 PB3; 00307 __sbit __at 0x90 + 4 PB4; 00308 __sbit __at 0x90 + 5 PB5; 00309 __sbit __at 0x90 + 6 PB6; 00310 __sbit __at 0x90 + 7 PB7; 00311 __sfr __at 0x91 EXIF; 00312 00313 //__sfr __at 0x92 MPAGE; 00314 __sfr __at 0x92 _XPAGE; // same as MPAGE for pdata __sfr access w/ sdcc 00315 __sfr __at 0x98 SCON0; 00316 /* SCON0 */ 00317 __sbit __at 0x98+0 RI; 00318 __sbit __at 0x98+1 TI; 00319 __sbit __at 0x98+2 RB8; 00320 __sbit __at 0x98+3 TB8; 00321 __sbit __at 0x98+4 REN; 00322 __sbit __at 0x98+5 SM2; 00323 __sbit __at 0x98+6 SM1; 00324 __sbit __at 0x98+7 SM0; 00325 __sfr __at 0x99 SBUF0; 00326 00327 __sfr __at 0x9A AUTOPTRH1; 00328 __sfr __at 0x9B AUTOPTRL1; 00329 __sfr __at 0x9D AUTOPTRH2; 00330 __sfr __at 0x9E AUTOPTRL2; 00331 00332 __sfr __at 0xA0 IOC; 00333 /* IOC */ 00334 __sbit __at 0xA0 + 0 PC0; 00335 __sbit __at 0xA0 + 1 PC1; 00336 __sbit __at 0xA0 + 2 PC2; 00337 __sbit __at 0xA0 + 3 PC3; 00338 __sbit __at 0xA0 + 4 PC4; 00339 __sbit __at 0xA0 + 5 PC5; 00340 __sbit __at 0xA0 + 6 PC6; 00341 __sbit __at 0xA0 + 7 PC7; 00342 __sfr __at 0xA1 INT2CLR; 00343 __sfr __at 0xA2 INT4CLR; 00344 00345 __sfr __at 0xA8 IE; 00346 /* IE */ 00347 __sbit __at 0xA8+0 EX0; 00348 __sbit __at 0xA8+1 ET0; 00349 __sbit __at 0xA8+2 EX1; 00350 __sbit __at 0xA8+3 ET1; 00351 __sbit __at 0xA8+4 ES0; 00352 __sbit __at 0xA8+5 ET2; 00353 __sbit __at 0xA8+6 ES1; 00354 __sbit __at 0xA8+7 EA; 00355 00356 __sfr __at 0xAA EP2468STAT; 00357 __sfr __at 0xAB EP24FIFOFLGS; 00358 __sfr __at 0xAC EP68FIFOFLGS; 00359 __sfr __at 0xAF AUTOPTRSETUP; 00360 __sfr __at 0xB0 IOD; 00361 /* IOD */ 00362 __sbit __at 0xB0 + 0 PD0; 00363 __sbit __at 0xB0 + 1 PD1; 00364 __sbit __at 0xB0 + 2 PD2; 00365 __sbit __at 0xB0 + 3 PD3; 00366 __sbit __at 0xB0 + 4 PD4; 00367 __sbit __at 0xB0 + 5 PD5; 00368 __sbit __at 0xB0 + 6 PD6; 00369 __sbit __at 0xB0 + 7 PD7; 00370 __sfr __at 0xB1 IOE; 00371 __sfr __at 0xB2 OEA; 00372 __sfr __at 0xB3 OEB; 00373 __sfr __at 0xB4 OEC; 00374 __sfr __at 0xB5 OED; 00375 __sfr __at 0xB6 OEE; 00376 00377 __sfr __at 0xB8 IP; 00378 /* IP */ 00379 __sbit __at 0xB8+0 PX0; 00380 __sbit __at 0xB8+1 PT0; 00381 __sbit __at 0xB8+2 PX1; 00382 __sbit __at 0xB8+3 PT1; 00383 __sbit __at 0xB8+4 PS0; 00384 __sbit __at 0xB8+5 PT2; 00385 __sbit __at 0xB8+6 PS1; 00386 00387 __sfr __at 0xBA EP01STAT; 00388 __sfr __at 0xBB GPIFTRIG; 00389 00390 __sfr __at 0xBD GPIFSGLDATH; 00391 __sfr __at 0xBE GPIFSGLDATLX; 00392 __sfr __at 0xBF GPIFSGLDATLNOX; 00393 00394 __sfr __at 0xC0 SCON1; 00395 /* SCON1 */ 00396 __sbit __at 0xC0+0 RI1; 00397 __sbit __at 0xC0+1 TI1; 00398 __sbit __at 0xC0+2 RB81; 00399 __sbit __at 0xC0+3 TB81; 00400 __sbit __at 0xC0+4 REN1; 00401 __sbit __at 0xC0+5 SM21; 00402 __sbit __at 0xC0+6 SM11; 00403 __sbit __at 0xC0+7 SM01; 00404 __sfr __at 0xC1 SBUF1; 00405 __sfr __at 0xC8 T2CON; 00406 /* T2CON */ 00407 __sbit __at 0xC8+0 CP_RL2; 00408 __sbit __at 0xC8+1 C_T2; 00409 __sbit __at 0xC8+2 TR2; 00410 __sbit __at 0xC8+3 EXEN2; 00411 __sbit __at 0xC8+4 TCLK; 00412 __sbit __at 0xC8+5 RCLK; 00413 __sbit __at 0xC8+6 EXF2; 00414 __sbit __at 0xC8+7 TF2; 00415 __sfr __at 0xCA RCAP2L; 00416 __sfr __at 0xCB RCAP2H; 00417 __sfr __at 0xCC TL2; 00418 __sfr __at 0xCD TH2; 00419 __sfr __at 0xD0 PSW; 00420 /* PSW */ 00421 __sbit __at 0xD0+0 P; 00422 __sbit __at 0xD0+1 FL; 00423 __sbit __at 0xD0+2 OV; 00424 __sbit __at 0xD0+3 RS0; 00425 __sbit __at 0xD0+4 RS1; 00426 __sbit __at 0xD0+5 F0; 00427 __sbit __at 0xD0+6 AC; 00428 __sbit __at 0xD0+7 CY; 00429 __sfr __at 0xD8 EICON; // Was WDCON in DS80C320; Bit Values differ from Reg320 00430 /* EICON */ 00431 __sbit __at 0xD8+3 INT6; 00432 __sbit __at 0xD8+4 RESI; 00433 __sbit __at 0xD8+5 ERESI; 00434 __sbit __at 0xD8+7 SMOD1; 00435 __sfr __at 0xE0 ACC; 00436 __sfr __at 0xE8 EIE; // EIE Bit Values differ from Reg320 00437 /* EIE */ 00438 __sbit __at 0xE8+0 EUSB; 00439 __sbit __at 0xE8+1 EI2C; 00440 __sbit __at 0xE8+2 EIEX4; 00441 __sbit __at 0xE8+3 EIEX5; 00442 __sbit __at 0xE8+4 EIEX6; 00443 __sfr __at 0xF0 B; 00444 __sfr __at 0xF8 EIP; // EIP Bit Values differ from Reg320 00445 /* EIP */ 00446 __sbit __at 0xF8+0 PUSB; 00447 __sbit __at 0xF8+1 PI2C; 00448 __sbit __at 0xF8+2 EIPX4; 00449 __sbit __at 0xF8+3 EIPX5; 00450 __sbit __at 0xF8+4 EIPX6; 00451 00452 00453 /* CPU Control & Status Register (CPUCS) */ 00454 #define bmPRTCSTB bmBIT5 00455 #define bmCLKSPD (bmBIT4 | bmBIT3) 00456 #define bmCLKSPD1 bmBIT4 00457 #define bmCLKSPD0 bmBIT3 00458 #define bmCLKINV bmBIT2 00459 #define bmCLKOE bmBIT1 00460 #define bm8051RES bmBIT0 00461 /* Port Alternate Configuration Registers */ 00462 /* Port A (PORTACFG) */ 00463 #define bmFLAGD bmBIT7 00464 #define bmSLCS bmBIT6 00465 #define bmINT1 bmBIT1 00466 #define bmINT0 bmBIT0 00467 /* Port C (PORTCCFG) */ 00468 #define bmGPIFA7 bmBIT7 00469 #define bmGPIFA6 bmBIT6 00470 #define bmGPIFA5 bmBIT5 00471 #define bmGPIFA4 bmBIT4 00472 #define bmGPIFA3 bmBIT3 00473 #define bmGPIFA2 bmBIT2 00474 #define bmGPIFA1 bmBIT1 00475 #define bmGPIFA0 bmBIT0 00476 /* Port E (PORTECFG) */ 00477 #define bmGPIFA8 bmBIT7 00478 #define bmT2EX bmBIT6 00479 #define bmINT6 bmBIT5 00480 #define bmRXD1OUT bmBIT4 00481 #define bmRXD0OUT bmBIT3 00482 #define bmT2OUT bmBIT2 00483 #define bmT1OUT bmBIT1 00484 #define bmT0OUT bmBIT0 00485 00486 /* I2C Control & Status Register (I2CS) */ 00487 #define bmSTART bmBIT7 00488 #define bmSTOP bmBIT6 00489 #define bmLASTRD bmBIT5 00490 #define bmID (bmBIT4 | bmBIT3) 00491 #define bmBERR bmBIT2 00492 #define bmACK bmBIT1 00493 #define bmDONE bmBIT0 00494 /* I2C Control Register (I2CTL) */ 00495 #define bmSTOPIE bmBIT1 00496 #define bm400KHZ bmBIT0 00497 /* Interrupt 2 (USB) Autovector Register (INT2IVEC) */ 00498 #define bmIV4 bmBIT6 00499 #define bmIV3 bmBIT5 00500 #define bmIV2 bmBIT4 00501 #define bmIV1 bmBIT3 00502 #define bmIV0 bmBIT2 00503 /* USB Interrupt Request & Enable Registers (USBIE/USBIRQ) */ 00504 #define bmEP0ACK bmBIT6 00505 #define bmHSGRANT bmBIT5 00506 #define bmURES bmBIT4 00507 #define bmSUSP bmBIT3 00508 #define bmSUTOK bmBIT2 00509 #define bmSOF bmBIT1 00510 #define bmSUDAV bmBIT0 00511 /* USBERRIE/IRQ */ 00512 #define bmERRLIMIT bmBIT0 00513 #define bmISOEP2 bmBIT4 00514 #define bmISOEP4 bmBIT5 00515 #define bmISOEP6 bmBIT6 00516 #define bmISOEP8 bmBIT7 00517 00518 /* Endpoint Interrupt & Enable Registers (EPIE/EPIRQ) */ 00519 #define bmEP0IN bmBIT0 00520 #define bmEP0OUT bmBIT1 00521 #define bmEP1IN bmBIT2 00522 #define bmEP1OUT bmBIT3 00523 #define bmEP2 bmBIT4 00524 #define bmEP4 bmBIT5 00525 #define bmEP6 bmBIT6 00526 #define bmEP8 bmBIT7 00527 /* Breakpoint register (BREAKPT) */ 00528 #define bmBREAK bmBIT3 00529 #define bmBPPULSE bmBIT2 00530 #define bmBPEN bmBIT1 00531 /* Interrupt 2 & 4 Setup (INTSETUP) */ 00532 #define bmAV2EN bmBIT3 00533 #define INT4IN bmBIT1 00534 #define bmAV4EN bmBIT0 00535 /* USB Control & Status Register (USBCS) */ 00536 #define bmHSM bmBIT7 00537 #define bmDISCON bmBIT3 00538 #define bmNOSYNSOF bmBIT2 00539 #define bmRENUM bmBIT1 00540 #define bmSIGRESUME bmBIT0 00541 /* Wakeup Control and Status Register (WAKEUPCS) */ 00542 #define bmWU2 bmBIT7 00543 #define bmWU bmBIT6 00544 #define bmWU2POL bmBIT5 00545 #define bmWUPOL bmBIT4 00546 #define bmDPEN bmBIT2 00547 #define bmWU2EN bmBIT1 00548 #define bmWUEN bmBIT0 00549 /* End Point 0 Control & Status Register (EP0CS) */ 00550 #define bmHSNAK bmBIT7 00551 /* End Point 0-1 Control & Status Registers (EP0CS/EP1OUTCS/EP1INCS) */ 00552 #define bmEPBUSY bmBIT1 00553 #define bmEPSTALL bmBIT0 00554 /* End Point 2-8 Control & Status Registers (EP2CS/EP4CS/EP6CS/EP8CS) */ 00555 #define bmNPAK (bmBIT6 | bmBIT5 | bmBIT4) 00556 #define bmEPFULL bmBIT3 00557 #define bmEPEMPTY bmBIT2 00558 /* Endpoint Status (EP2468STAT) SFR bits */ 00559 #define bmEP8FULL bmBIT7 00560 #define bmEP8EMPTY bmBIT6 00561 #define bmEP6FULL bmBIT5 00562 #define bmEP6EMPTY bmBIT4 00563 #define bmEP4FULL bmBIT3 00564 #define bmEP4EMPTY bmBIT2 00565 #define bmEP2FULL bmBIT1 00566 #define bmEP2EMPTY bmBIT0 00567 /* Endpoint Config (EP[2468]CFG) */ 00568 #define bmVALID bmBIT7 00569 #define bmDIR bmBIT6 00570 #define bmTYPE (bmBIT4|bmBIT5) 00571 #define bmTYPE1 bmBIT5 00572 #define bmTYPE0 bmBIT4 00573 #define bmSIZE bmBIT3 00574 /* Endpoint Config (EP[24]CFG) */ 00575 #define bmBUF (bmBIT0|bmBIT1) 00576 #define bmBUF1 bmBIT1 00577 #define bmBUF0 bmBIT0 00578 /* SETUP Data Pointer Auto Mode (SUDPTRCTL) */ 00579 #define bmSDPAUTO bmBIT0 00580 /* Endpoint Data Toggle Control (TOGCTL) */ 00581 #define bmQUERYTOGGLE bmBIT7 00582 #define bmSETTOGGLE bmBIT6 00583 #define bmRESETTOGGLE bmBIT5 00584 #define bmTOGCTLEPMASK bmBIT3 | bmBIT2 | bmBIT1 | bmBIT0 00585 /* IBN (In Bulk Nak) enable and request bits (IBNIE/IBNIRQ) */ 00586 #define bmEP8IBN bmBIT5 00587 #define bmEP6IBN bmBIT4 00588 #define bmEP4IBN bmBIT3 00589 #define bmEP2IBN bmBIT2 00590 #define bmEP1IBN bmBIT1 00591 #define bmEP0IBN bmBIT0 00592 00593 /* PING-NAK enable and request bits (NAKIE/NAKIRQ) */ 00594 #define bmEP8PING bmBIT7 00595 #define bmEP6PING bmBIT6 00596 #define bmEP4PING bmBIT5 00597 #define bmEP2PING bmBIT4 00598 #define bmEP1PING bmBIT3 00599 #define bmEP0PING bmBIT2 00600 #define bmIBN bmBIT0 00601 00602 /* Interface Configuration bits (IFCONFIG) */ 00603 #define bmIFCLKSRC bmBIT7 00604 #define bm3048MHZ bmBIT6 00605 #define bmIFCLKOE bmBIT5 00606 #define bmIFCLKPOL bmBIT4 00607 #define bmASYNC bmBIT3 00608 #define bmGSTATE bmBIT2 00609 #define bmIFCFG1 bmBIT1 00610 #define bmIFCFG0 bmBIT0 00611 #define bmIFCFGMASK (bmIFCFG0 | bmIFCFG1) 00612 #define bmIFGPIF bmIFCFG1 00613 00614 /* EP 2468 FIFO Configuration bits (EP2FIFOCFG,EP4FIFOCFG,EP6FIFOCFG,EP8FIFOCFG) */ 00615 #define bmINFM bmBIT6 00616 #define bmOEP bmBIT5 00617 #define bmAUTOOUT bmBIT4 00618 #define bmAUTOIN bmBIT3 00619 #define bmZEROLENIN bmBIT2 00620 #define bmWORDWIDE bmBIT0 00621 00622 /* Chip Revision Control Bits (REVCTL) - used to ebable/disable revision specidic 00623 features */ 00624 #define bmNOAUTOARM bmBIT1 00625 #define bmSKIPCOMMIT bmBIT0 00626 00627 /* Fifo Reset bits (FIFORESET) */ 00628 #define bmNAKALL bmBIT7 00629 00630 /* Chip Feature Register (GPCR2) */ 00631 #define bmFULLSPEEDONLY bmBIT4 00632 00633 /* EP 01 status (EP01STAT) */ 00634 #define bmEP1INBSY bmBIT2 00635 #define bmEP1OUTBSY bmBIT1 00636 #define bmEP0BSY bmBIT0 00637 00638 /* EXIF - External interrupt flags */ 00639 #define bmIE5 bmBIT7 00640 #define bmIE4 bmBIT6 00641 #define bmI2CINT bmBIT5 00642 #define bmUSBNT bmBIT4 00643 00644 #endif /* FX2REGS_H */