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

📄 f3xx_usb0_main.lst

📁 hid to rs232 usb_hid 转 串口程序
💻 LST
字号:
C51 COMPILER V8.17   F3XX_USB0_MAIN                                                        03/18/2009 09:55:18 PAGE 1   


C51 COMPILER V8.17, COMPILATION OF MODULE F3XX_USB0_MAIN
OBJECT MODULE PLACED IN F3xx_USB0_Main.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE F3xx_USB0_Main.c BROWSE DEBUG OBJECTEXTEND

line level    source

   1          //-----------------------------------------------------------------------------
   2          // F3xx_USB_Main.c
   3          //-----------------------------------------------------------------------------
   4          // Copyright 2008 Silicon Laboratories, Inc.
   5          // http://www.silabs.com
   6          //
   7          // Program Description:
   8          //
   9          // Stub file for Firmware Template.
  10          //
  11          //
  12          // How To Test:    See Readme.txt
  13          //
  14          //
  15          // FID             
  16          // Target:         C8051F32x/C8051F340
  17          // Tool chain:     Keil C51 7.50 / Keil EVAL C51
  18          //                 Silicon Laboratories IDE version 2.6
  19          // Command Line:   See Readme.txt
  20          // Project Name:   HIDtoUART
  21          //
  22          // Release 1.0
  23          //    -Initial Revision (PD)
  24          //    -04 JUN 2008
  25          //
  26          //-----------------------------------------------------------------------------
  27          // Header Files
  28          //-----------------------------------------------------------------------------
  29          
  30          #include "c8051f3xx.h"
  31          #include "F3xx_USB0_Register.h"
  32          #include "F3xx_USB0_InterruptServiceRoutine.h"
  33          #include "F3xx_USB0_Descriptor.h"
  34          #include "F3xx_HIDtoUART.h"
  35          
  36          //-----------------------------------------------------------------------------
  37          // Definitions
  38          //-----------------------------------------------------------------------------
  39          
  40          
  41          //-----------------------------------------------------------------------------
  42          // Local Variables
  43          //-----------------------------------------------------------------------------
  44          
  45          //-----------------------------------------------------------------------------
  46          // Main Routine
  47          //-----------------------------------------------------------------------------
  48          void main(void)
  49          {
  50   1         PCA0MD &= ~0x40;
  51   1         System_Init ();
  52   1         Usb_Init ();
  53   1      
  54   1         CKCON = 0x10;
  55   1         TMR2CN = 0x04;
C51 COMPILER V8.17   F3XX_USB0_MAIN                                                        03/18/2009 09:55:18 PAGE 2   

  56   1         P2 = 0;
  57   1      
  58   1         EA = 1;
  59   1      
  60   1         while (1)
  61   1         {
  62   2            // If bytes have been received across UART interface, initiate a USB
  63   2            // transfer to send them to the host  
  64   2            if ((UART_INPUT_SIZE != 0) && (!SendPacketBusy))
  65   2            {
  66   3               SendPacket (IN_DATA);
  67   3            }
  68   2      
  69   2            // If bytes have been received across the USB interface, transmit
  70   2            // them across UART
  71   2            if ((UART_OUTPUT_SIZE != 0) && (TX_Ready == 1))
  72   2            {
  73   3               TX_Ready = 0;
  74   3               TI0 = 1;                      // Start UART transmit
  75   3            }
  76   2      
  77   2            // This code functions when the firmware has suspended reception of
  78   2            // USB OUT reports because the UART buffer size is above the 
  79   2            // critical boundary
  80   2            EA = 0;
  81   2            if (USB_OUT_SUSPENDED == 1)
  82   2            {
  83   3               // Check to see if the buffer size has fallen back below the
  84   3               // boundary
  85   3               if (UART_OUTPUT_SIZE < UART_OUTPUT_OVERFLOW_BOUNDARY)
  86   3               {
  87   4                  // If it has, resume USB communication
  88   4                  USB_OUT_SUSPENDED = 0;
  89   4                  POLL_WRITE_BYTE (INDEX, 2);// Set index to endpoint 2 registers
  90   4                  // Clear Out Packet ready bit
  91   4                  POLL_WRITE_BYTE (EOUTCSR1, 0);   
  92   4               }
  93   3            }
  94   2            EA = 1;
  95   2         }
  96   1      
  97   1      }
  98          


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =     89    ----
   CONSTANT SIZE    =   ----    ----
   XDATA SIZE       =   ----    ----
   PDATA SIZE       =   ----    ----
   DATA SIZE        =   ----    ----
   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 + -