⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 periph.lst

📁 开发usb块传输的固件程序,可pc循环向下微机发数据
💻 LST
📖 第 1 页 / 共 2 页
字号:
 226   1      }
 227          
 228          void ISR_Ep2in(void) interrupt 0
 229          {
 230   1      }
 231          
 232          void ISR_Ep2out(void) interrupt 0
 233          {
 234   1         int i;
 235   1      
 236   1         if (EPIO[IN2BUF_ID].cntrl & bmEPBUSY)
 237   1         {
 238   2            TOGCTL = 0x08 | IN2BUF_ID;
 239   2            WRITEDELAY();
 240   2            if (TOGCTL & 0x80)
 241   2               TOGCTL |= 0x20;
C51 COMPILER V6.10  PERIPH                                                                 06/30/2004 23:04:04 PAGE 5   

 242   2            else
 243   2               TOGCTL |= 0x40;
 244   2         }
 245   1      
 246   1         // Loop the data to the IN endpoint
 247   1         for (i=0; i < OUT2BC; i++)
 248   1         {
 249   2            IN2BUF[i] = ~OUT2BUF[i];
 250   2         }
 251   1      
 252   1         // Arm the IN endpoint
 253   1         IN2BC = i;
 254   1      
 255   1         // Arm the OUT so it can receive the next packet
 256   1         OUT2BC = 0;
 257   1      
 258   1         // clear the IRQ
 259   1      	EZUSB_IRQ_CLEAR();
 260   1      	OUT07IRQ = bmEP2;
 261   1      }
 262          
 263          void ISR_Ep3in(void) interrupt 0
 264          {
 265   1      }
 266          
 267          void ISR_Ep3out(void) interrupt 0
 268          {
 269   1         int i;
 270   1      
 271   1         if (EPIO[IN3BUF_ID].cntrl & bmEPBUSY)
 272   1         {
 273   2            TOGCTL = 0x08 | IN3BUF_ID;
 274   2            WRITEDELAY();
 275   2            if (TOGCTL & 0x80)
 276   2               TOGCTL |= 0x20;
 277   2            else
 278   2               TOGCTL |= 0x40;
 279   2         }
 280   1      
 281   1         // Loop the data to the IN endpoint
 282   1         for (i=0; i < OUT3BC; i++)
 283   1         {
 284   2            IN3BUF[i] = ~OUT3BUF[i];
 285   2         }
 286   1      
 287   1         // Arm the IN endpoint
 288   1         IN3BC = i;
 289   1      
 290   1         // Arm the OUT so it can receive the next packet
 291   1         OUT3BC = 0;
 292   1      
 293   1         // clear the IRQ
 294   1      	EZUSB_IRQ_CLEAR();
 295   1      	OUT07IRQ = bmEP3;
 296   1      }
 297          
 298          void ISR_Ep4in(void) interrupt 0
 299          {
 300   1      }
 301          
 302          void ISR_Ep4out(void) interrupt 0
 303          {
C51 COMPILER V6.10  PERIPH                                                                 06/30/2004 23:04:04 PAGE 6   

 304   1         int i;
 305   1      
 306   1         if (EPIO[IN4BUF_ID].cntrl & bmEPBUSY)
 307   1         {
 308   2            TOGCTL = 0x08 | IN4BUF_ID;
 309   2            WRITEDELAY();
 310   2            if (TOGCTL & 0x80)
 311   2               TOGCTL |= 0x20;
 312   2            else
 313   2               TOGCTL |= 0x40;
 314   2         }
 315   1      
 316   1         // Loop the data to the IN endpoint
 317   1         for (i=0; i < OUT4BC; i++)
 318   1         {
 319   2            IN4BUF[i] = ~OUT4BUF[i];
 320   2         }
 321   1      
 322   1         // Arm the IN endpoint
 323   1         IN4BC = i;
 324   1      
 325   1         // Arm the OUT so it can receive the next packet
 326   1         OUT4BC = 0;
 327   1      
 328   1         // clear the IRQ
 329   1      	EZUSB_IRQ_CLEAR();
 330   1      	OUT07IRQ = bmEP4;
 331   1      }
 332          
 333          void ISR_Ep5in(void) interrupt 0
 334          {
 335   1      }
 336          
 337          void ISR_Ep5out(void) interrupt 0
 338          {
 339   1         int i;
 340   1      
 341   1         if (EPIO[IN5BUF_ID].cntrl & bmEPBUSY)
 342   1         {
 343   2            TOGCTL = 0x08 | IN5BUF_ID;
 344   2            WRITEDELAY();
 345   2            if (TOGCTL & 0x80)
 346   2               TOGCTL |= 0x20;
 347   2            else
 348   2               TOGCTL |= 0x40;
 349   2         }
 350   1      
 351   1         // Loop the data to the IN endpoint
 352   1         for (i=0; i < OUT5BC; i++)
 353   1         {
 354   2            IN5BUF[i] = ~OUT5BUF[i];
 355   2         }
 356   1      
 357   1         // Arm the IN endpoint
 358   1         IN5BC = i;
 359   1      
 360   1         // Arm the OUT so it can receive the next packet
 361   1         OUT5BC = 0;
 362   1      
 363   1         // clear the IRQ
 364   1      	EZUSB_IRQ_CLEAR();
 365   1      	OUT07IRQ = bmEP5;
C51 COMPILER V6.10  PERIPH                                                                 06/30/2004 23:04:04 PAGE 7   

 366   1      }
 367          
 368          void ISR_Ep6in(void) interrupt 0
 369          {
 370   1      }
 371          
 372          void ISR_Ep6out(void) interrupt 0
 373          {
 374   1         int i;
 375   1      
 376   1         if (EPIO[IN6BUF_ID].cntrl & bmEPBUSY)
 377   1         {
 378   2            TOGCTL = 0x08 | IN6BUF_ID;
 379   2            WRITEDELAY();
 380   2            if (TOGCTL & 0x80)
 381   2               TOGCTL |= 0x20;
 382   2            else
 383   2               TOGCTL |= 0x40;
 384   2         }
 385   1      
 386   1         // Loop the data to the IN endpoint
 387   1         for (i=0; i < OUT6BC; i++)
 388   1         {
 389   2            IN6BUF[i] = ~OUT6BUF[i];
 390   2         }
 391   1      
 392   1         // Arm the IN endpoint
 393   1         IN6BC = i;
 394   1      
 395   1         // Arm the OUT so it can receive the next packet
 396   1         OUT6BC = 0;
 397   1      
 398   1         // clear the IRQ
 399   1      	EZUSB_IRQ_CLEAR();
 400   1      	OUT07IRQ = bmEP6;
 401   1      }
 402          
 403          void ISR_Ep7in(void) interrupt 0
 404          {
 405   1      }
 406          
 407          void ISR_Ep7out(void) interrupt 0
 408          {
 409   1         int i;
 410   1      
 411   1         if (EPIO[IN7BUF_ID].cntrl & bmEPBUSY)
 412   1         {
 413   2            TOGCTL = 0x08 | IN7BUF_ID;
 414   2            WRITEDELAY();
 415   2            if (TOGCTL & 0x80)
 416   2               TOGCTL |= 0x20;
 417   2            else
 418   2               TOGCTL |= 0x40;
 419   2         }
 420   1      
 421   1         // Loop the data to the IN endpoint
 422   1         for (i=0; i < OUT7BC; i++)
 423   1         {
 424   2            IN7BUF[i] = ~OUT7BUF[i];
 425   2         }
 426   1      
 427   1      //   // BUGBUG If 63 bytes was written, inject an error
C51 COMPILER V6.10  PERIPH                                                                 06/30/2004 23:04:04 PAGE 8   

 428   1      //   if (OUT7BC == 63)
 429   1      //   {
 430   1      //      IN7BUF[3] = IN7BUF[4];
 431   1      //   }
 432   1      
 433   1         // Arm the IN endpoint
 434   1         IN7BC = i;
 435   1      
 436   1         // Arm the OUT so it can receive the next packet
 437   1         OUT7BC = 0;
 438   1      
 439   1         // clear the IRQ
 440   1      	EZUSB_IRQ_CLEAR();
 441   1      	OUT07IRQ = bmEP7;
 442   1      }


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =   1211    ----
   CONSTANT SIZE    =   ----    ----
   XDATA SIZE       =   ----    ----
   PDATA SIZE       =   ----    ----
   DATA SIZE        =      3       7
   IDATA SIZE       =   ----    ----
   BIT SIZE         =   ----    ----
END OF MODULE INFORMATION.


C51 COMPILATION COMPLETE.  0 WARNING(S),  0 ERROR(S)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -