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

📄 function.lst

📁 USB 1.1 U Device for CH375 & USB 2.0 for CH375A 读写usb超精简的程序
💻 LST
字号:
C51 COMPILER V7.20   FUNCTION                                                              03/07/2006 16:55:21 PAGE 1   


C51 COMPILER V7.20, COMPILATION OF MODULE FUNCTION
OBJECT MODULE PLACED IN Function.OBJ
COMPILER INVOKED BY: C:\Program Files\Keil Uvision V7.20\C51\BIN\C51.EXE Function.C BROWSE DEBUG OBJECTEXTEND

line level    source

   1          //=================================================================================================
   2          //*************************************************************************************************
   3          // Module Name  :  Function.C
   4          // Device object: 
   5          // CreateDate   :  2005-11-14
   6          // ModifData    :  2005-11-14
   7          // Description  :  
   8          // Author       :  李远正
   9          // Version      :  V1.0
  10          //*************************************************************************************************
  11          //=================================================================================================
  12          // 
  13          
  14          #include <regx52.h>                       // SFR declarations 
  15          #include "Function.H"
  16          
  17          //=================================================================================================
  18          // 
  19          //=================================================================================================
  20          // 
  21          
  22          
  23          
  24          
  25          
  26          //=================================================================================================
  27          //=================================================================================================
  28          
  29          //#define SYSCLK       11059200             // SYSCLK frequency in Hz
  30          
  31          //=================================================================================================
  32          // UART_Init
  33          //=================================================================================================
  34          // Configure the UART0 using Timer2, for <baudrate> and 8-N-1.
  35          // 
  36          #define BAUDRATE0     115200              // Baud rate of UART0 in bps
  37          
  38          //-------------------------------------------------------------------------------------------------
  39          // UART Initialization 
  40          void UART0Init( void )
  41          {
  42   1              SCON = 0x50;                          // 串行口工作在方式3 
  43   1              TMOD = 0x20;                          // T1为方式2 
  44   1      
  45   1              TH1  = 0xFE;                          // 计数常数0xFE,波特率:14400 晶振:11.0592MHz  
  46   1              TL1  = 0xFE;
  47   1      
  48   1              PCON &= 0x7F;                         // SMOD=0 
  49   1              
  50   1              TR1 = 1;
  51   1      
  52   1      #if UART0_INT_EN  == 1                    // Enable UART0 interrupts
                      ES = 1;                               // Enable UART0 interrupts
              #endif
  55   1      }
C51 COMPILER V7.20   FUNCTION                                                              03/07/2006 16:55:21 PAGE 2   

  56          
  57          //-------------------------------------------------------------------------------------------------
  58          #if UART0SendByte_EN 
  59          //-------------------------------------------------------------------------------------------------
  60          // UART0 Send Byte 
  61          void UART0SendByte( unsigned char datum )
  62          {
  63   1              ES    = 0;                            // Disable UART0 interrupts
  64   1      
  65   1              TI    = 0;
  66   1              SBUF  = datum; 
  67   1              while ( TI == 0 ) ;                   // Waiting...
  68   1      
  69   1      #if UART0_INT_EN  == 1                    // Enable UART0 interrupts
                      ES = 1;                               // Enable UART0 interrupts
              #endif
  72   1      }
  73          //-------------------------------------------------------------------------------------------------
  74          #endif
  75          
  76          //-------------------------------------------------------------------------------------------------
  77          #if UART0SendString_EN 
  78          //-------------------------------------------------------------------------------------------------
  79          // UART0 Send String 
  80          void UART0SendString( unsigned char *p )
  81          {
  82   1              ES = 0;                               // Disable UART0 interrupts 
  83   1      
  84   1              while( *p != '\0' )
  85   1              {
  86   2                  SBUF = *p++; 
  87   2                  while( TI == 0 ) ;                // Waiting...
  88   2              TI   = 0;
  89   2              }
  90   1      
  91   1      #if UART0_INT_EN  == 1                    // Enable UART0 interrupts
                      ES = 1;                               // Enable UART0 interrupts
              #endif
  94   1      }
  95          //-------------------------------------------------------------------------------------------------
  96          #endif
  97          
  98          //-------------------------------------------------------------------------------------------------
  99          #if UART0RecvByte_EN 
 100          //-------------------------------------------------------------------------------------------------
 101          // UART0 Receive Byte 
 102          unsigned char UART0RecvByte( void )
 103          {
 104   1          unsigned char datum;
 105   1      
 106   1              ES = 0;                               // Disable UART0 interrupts
 107   1      
 108   1              while ( RI == 0 ) ;                   // Waiting...         
 109   1              datum = SBUF;
 110   1              RI    = 0;
 111   1      
 112   1      #if UART0_INT_EN  == 1                    // Enable UART0 interrupts
                      ES = 1;                               // Enable UART0 interrupts
              #endif
 115   1      
 116   1              return( datum );
 117   1      }
C51 COMPILER V7.20   FUNCTION                                                              03/07/2006 16:55:21 PAGE 3   

 118          //-------------------------------------------------------------------------------------------------
 119          #endif
 120          
 121          //-------------------------------------------------------------------------------------------------
 122          //-------------------------------------------------------------------------------------------------
 123          // UART0 Receive Interrupt 
 124          #if UART0_INT_EN     == 1                 // Enable UART0 interrupts
              void UART0_ISR( void ) interrupt 4 
              {
                      unsigned int  count;
                      unsigned char buffer;
              
                  RI = 0;                               // Clear Flag of RI0 
                      ES = 0;                               // Disable UART0 interrupts 
              
              
              
                      ES = 1;                               // Enable UART0 interrupts
              }
              #endif
 138          
 139          


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