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

📄 sppreceive.lst

📁 无线龙ZigBee模块CC1010的接收-发送程序。
💻 LST
字号:
C51 COMPILER V7.08   SPPRECEIVE                                                            11/25/2008 21:39:39 PAGE 1   


C51 COMPILER V7.08, COMPILATION OF MODULE SPPRECEIVE
OBJECT MODULE PLACED IN sppReceive.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE sppReceive.c OMF2 BROWSE INCDIR(..\..\..\..\Include;..\..\..\..\lib;D:\KEIL
                    -\C51\BIN\;D:\Keil\C51\LIB\) DEFINE(FREQ433) DEBUG

line level    source

   1          /*****************************************************************************
   2           *                                                                           *
   3           *        **********                                                         *
   4           *       ************                                                        *
   5           *      ***        ***                                                       *
   6           *      ***   +++   ***                                                      *
   7           *      ***   + +   ***                                                      *
   8           *      ***   +                            CHIPCON CC1010                    *
   9           *      ***   + +   ***                      CUL - spp                       *
  10           *      ***   +++   ***                                                      *
  11           *      ***       ***                                                        *
  12           *       ***********                                                         *
  13           *        *********                                                          *
  14           *                                                                           *
  15           *****************************************************************************
  16           *                                                                           *
  17           *****************************************************************************
  18           * Author:              JOL                                                  *
  19           *****************************************************************************
  20           * Revision history:                                                         *
  21           *                                                                           *
  22           * $Log: sppReceive.c,v $
  23           * Revision 1.1  2002/10/14 12:27:33  tos
  24           * Initial version in CVS.
  25           *
  26           *                                                                           *
  27           ****************************************************************************/
  28          
  29          #include <chipcon/sppInternal.h>
  30          
  31          //----------------------------------------------------------------------------
  32          //  byte sppReceive (SPP_RX_INFO xdata* pRXInfo)
  33          //
  34          //  Description:
  35          //      If the transceiver is ready (in idle mode), the receive section will
  36          //              be powered up and the RF interrupt enabled. The RF ISR(中断服务程序) will then 
  37          //              receive the packet and transmit an ACK if requested to. When finished,
  38          //              the receive section will be powered down.
  39          //              
  40          //              This function will return immediately and the application can 
  41          //              continue while the ISR receives the packet. When finished, sppStatus() 
  42          //              will return IDLE_MODE. During the transmission it will 
  43          //              return RX_MODE or RXACK_MODE.
  44          //
  45          //              After the reception: Use pRXInfo->status to find out what happened:
  46          //                      SPP_RX_TIMEOUT =   Timeout (nothing received).
  47          //                      SPP_RX_TOO_LONG =  dataLen > maxDataLen (the buffer is invalid).
  48          //                      SPP_RX_FINISHED =  source, dataLen and *pDataBuffer in *pRXInfo  
  49          //                                         are valid.
  50          //
  51          //  Arguments:
  52          //      SPP_RX_INFO xdata *pRXInfo
  53          //                      An SPP_RX_INFO struct must be prepared before the reception,
  54          //                      including the following values:
C51 COMPILER V7.08   SPPRECEIVE                                                            11/25/2008 21:39:39 PAGE 2   

  55          //                              maxDataLen (Length of the data buffer, 0-255)
  56          //                              pDataBuffer (pointer to the reception buffer)
  57          //
  58          //  Return value:
  59          //              byte
  60          //                      SPP_RX_STARTED if OK
  61          //                      SPP_BUSY if not ready
  62          //----------------------------------------------------------------------------
  63          byte sppReceive (SPP_RX_INFO xdata *pRXInfo) { 
  64   1              INT_GLOBAL_ENABLE (INT_OFF);
  65   1      
  66   1              // Begin reception only if we're in the idle state
  67   1              if (sppIntData.mode == SPP_IDLE_MODE) {
  68   2      
  69   2                      // Initialize the fsm
  70   2                      sppRFStateFunc = RX_WAIT;
  71   2                      sppIntData.mode = SPP_RX_MODE;
  72   2                      sppIntData.pRXI = pRXInfo;
  73   2                      sppIntData.pRXI->status = SPP_RX_WAITING;
  74   2                      
  75   2                      // Activate receive timeout (disable timer 3 while we're changing the 16-bit number)
  76   2                      if (sppSettings.rxTimeout) {
  77   3                              SPP_ENABLE_TIMEOUT(sppSettings.rxTimeout);
  78   3                      } else {
  79   3                              SPP_DISABLE_TIMEOUT();
  80   3                      }
  81   2                      INT_GLOBAL_ENABLE (INT_ON);
  82   2                      
  83   2                      // Enable transceiver interrupt and enter the FSM
  84   2                      INT_SETFLAG (INUM_RF, INT_CLR);
  85   2                      INT_PRIORITY (INUM_RF, INT_HIGH);
  86   2                      INT_ENABLE (INUM_RF, INT_ON);
  87   2      
  88   2                      // Power up for RX
  89   2                      SPP_POWER_UP_RX();
  90   2      
  91   2                      return SPP_RX_STARTED;
  92   2              } else {
  93   2                      INT_GLOBAL_ENABLE (INT_ON);
  94   2                      return SPP_BUSY;
  95   2              }
  96   1      } // sppReceive


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =    113    ----
   CONSTANT SIZE    =   ----    ----
   XDATA SIZE       =   ----    ----
   PDATA SIZE       =   ----    ----
   DATA SIZE        =   ----    ----
   IDATA SIZE       =   ----    ----
   BIT SIZE         =   ----    ----
   EDATA SIZE       =   ----    ----
   HDATA SIZE       =   ----    ----
   XDATA CONST SIZE =   ----    ----
   FAR CONST SIZE   =   ----    ----
END OF MODULE INFORMATION.


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

⌨️ 快捷键说明

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