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

📄 interrupt.lst

📁 本程序运行于C8051F330
💻 LST
字号:
C51 COMPILER V7.05   INTERRUPT                                                             10/18/2006 16:44:42 PAGE 1   


C51 COMPILER V7.05, COMPILATION OF MODULE INTERRUPT
OBJECT MODULE PLACED IN interrupt.OBJ
COMPILER INVOKED BY: C:\SiLabs\MCU\IDEfiles\C51\BIN\C51.exe interrupt.c DB OE

stmt level    source

   1          #include "C8051F330.H"
   2          #include "IR_Rx_Tx.h"
   3            
   4          extern unsigned char DataAvailByte;
   5          extern int IR_Key;
   6          extern char IRsampData[40];
   7          extern char SampNo;
   8          extern char SampNoData;
   9          extern BOOL bAddrRecv;
  10          extern unsigned char* pSMB_DATA_OUT; 
  11          extern unsigned char SMB_DATA_LEN;
  12          
  13          unsigned char i_Tx;
  14          
  15          //-----------------------------------------------------------------------------
  16          // SMBus Interrupt
  17          //-----------------------------------------------------------------------------
  18          void Interrupt_SMBus(void) interrupt 7
  19          {
  20   1         switch (SMB0CN & 0xF0)                    // Status vector
  21   1         {
  22   2            //static char i;
  23   2                static unsigned char AddrTemp;
  24   2      
  25   2            // Detect a START condition and a slave address.
  26   2            case SMBus_DetectSTA:
  27   2                   STA = 0;
  28   2                       ACK = 0;
  29   2                       AddrTemp = 0;
  30   2                       AddrTemp = SMB0DAT;
  31   2                       if((SMB0DAT&0xFE)==0xE0)
  32   2                       {
  33   3                          ACK = 1;
  34   3                              SMB0DAT = 0x55;
  35   3                       }
  36   2               if((SMB0DAT&0xFE)==0xE2)              // The address received is correct
  37   2                       {
  38   3                              ACK = 1;
  39   3                              SMB0DAT = DataAvailByte;           // transmitt DataAvailByte
  40   3               }
  41   2                       if((SMB0DAT&0xFE)==0xE4)
  42   2                       {
  43   3                          ACK = 1;
  44   3                              i_Tx = 0;
  45   3                              SMB0DAT = *pSMB_DATA_OUT;
  46   3                              pSMB_DATA_OUT++;
  47   3                              i_Tx++;
  48   3                       }
  49   2      
  50   2               break;
  51   2             
  52   2                
  53   2                // A slave byte was received
  54   2                case SMBus_RxData:
  55   2      
C51 COMPILER V7.05   INTERRUPT                                                             10/18/2006 16:44:42 PAGE 2   

  56   2      
  57   2                       break;
  58   2                                 
  59   2                
  60   2                // A slave byte was transmitted and Validate the ACK  
  61   2            case SMBus_TxData:
  62   2                   if(ACK)
  63   2                       {
  64   3                          if(AddrTemp==SMBus_FlagAddress)
  65   3                                 ;
  66   3                              else if(AddrTemp==SMBus_DeviceAddress)
  67   3                                 ;
  68   3      
  69   3                          else if(AddrTemp==SMBus_DataAddress)
  70   3                              {
  71   4                                 if(i_Tx<SMB_DATA_LEN)
  72   4                                 {
  73   5                                    SMB0DAT = *pSMB_DATA_OUT;
  74   5                                pSMB_DATA_OUT++;
  75   5                                    i_Tx++;
  76   5                                 }
  77   4                                 if(i_Tx==SMB_DATA_LEN)
  78   4                                 {
  79   5                                    DataAvailByte = FALSE;
  80   5                                        pSMB_DATA_OUT = IRsampData;
  81   5                                    i_Tx = 0;
  82   5                                 }
  83   4                              }
  84   3                       }
  85   2                       else
  86   2                       {
  87   3                              if(i_Tx==SMB_DATA_LEN)
  88   3                              {
  89   4                                 DataAvailByte = FALSE;
  90   4                              }
  91   3                              pSMB_DATA_OUT = IRsampData;
  92   3                              i_Tx = 0;
  93   3                       }
  94   2                       
  95   2                       break;
  96   2      
  97   2            
  98   2            // Detect a STOP condition ---- No action need to do
  99   2                case SMBus_TxSTO:
 100   2                   DataAvailByte = FALSE;
 101   2                       break;
 102   2      
 103   2                case SMBus_RxSTO:
 104   2      
 105   2               STO = 0;                            // STO must be cleared by software when
 106   2                                                   // a STOP is detected as a slave
 107   2      
 108   2                       break;
 109   2      
 110   2            default:
 111   2               SMB0CN &= ~0x40;                       // Reset communication
 112   2               SMB0CN |= 0x40;
 113   2                       ACK = 0;
 114   2                       STA = 0;
 115   2                       STO = 1;
 116   2                   break;
 117   2      
C51 COMPILER V7.05   INTERRUPT                                                             10/18/2006 16:44:42 PAGE 3   

 118   2         }
 119   1      
 120   1         SI = 0;
 121   1      }
 122          
 123          
 124          
 125          
 126          


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