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

📄 simple_mac.lst

📁 zigbee通讯程序,设计方案为MC13191+C51,通过串口对无线模块进行控制
💻 LST
📖 第 1 页 / 共 2 页
字号:
C51 COMPILER V7.06   SIMPLE_MAC                                                            09/18/2006 21:57:30 PAGE 1   


C51 COMPILER V7.06, COMPILATION OF MODULE SIMPLE_MAC
OBJECT MODULE PLACED IN simple_mac.OBJ
COMPILER INVOKED BY: D:\Keil\C51\BIN\C51.EXE simple_mac.c BROWSE DEBUG OBJECTEXTEND

stmt level    source

   1          /**************************************************************
   2          *   This is the SMAC C source media (i.e. MAC) layer file for the HC(S)08 MCU
   3          *   and MC13192 transceiver.
   4          *   The SMAC MAC is the highest layer of C code for the SMAC.
   5          **************************************************************/
   6          
   7          
   8          /**************************************************************
   9          *       Includes
  10          **************************************************************/
  11          #include <REG51F.H>
  12          #include "pub_def.h"
  13          #include "drivers.h"
  14          #include "simple_phy.h"
  15          #include "simple_mac.h"
  16          
  17          /**************************************************************
  18          *       Externals
  19          **************************************************************/
  20          extern rx_packet_t *drv_rx_packet;
  21          extern unsigned char rtx_mode;
  22          
  23          /**************************************************************
  24          * Version string to put in NVM. Note! size limits
  25          **************************************************************/
  26          
  27          // Normally it shoud be enough to change the version numbers.
  28          //#define Database_Label_Version        "1.00"
  29          //#define MAC_Version                   "1.00"
  30          //#define MAC_Label               "SMAC "
  31          
  32          //#pragma MESSAGE DISABLE C3303  // Warning C3303: Implicit concatenation of strings
  33          //#pragma MESSAGE DISABLE C4200  // Warning C4200: Other segment than in previous declaration
  34          
  35          //#pragma CONST_SEG BOOTLOADER_MAC_NV_DATA0
  36          
  37          // DO NOT CHANGE OR REMOVE
  38          
  39          // These strings will be located in the NV RAM0 section.
  40          // Note!!Check that items are location in the same sequence as specified. 
  41          //const unsigned char Freescale_Copyright[54] = "(c) Copyright 2004 Freescale Inc. All rights reserved";
  42          //const unsigned char Firmware_Database_Label[40] = "DB Label: XXXXXXXXXXXXXXXXXXXX Ver " Database_Label_V
             -ersion;
  43          //const unsigned char SMAC_Version[47] = "MAC " MAC_Label " Ver " MAC_Version " Build: "__DATE__" "__TIME_
             -_;
  44          
  45          //#pragma CONST_SEG DEFAULT
  46          
  47          
  48          /**************************************************************
  49          *       Function:       Transmit data packet
  50          *       Parameters: packet pointer
  51          *       Return:         status
  52          **************************************************************/
  53          int MCPS_data_request(tx_packet_t *packet)
C51 COMPILER V7.06   SIMPLE_MAC                                                            09/18/2006 21:57:30 PAGE 2   

  54          {
  55   1              __uint8__ status;
  56   1              /* Send it to the phy for processing */
  57   1              status = pd_data_request(packet);
  58   1              return status;
  59   1      }
  60          
  61          /**************************************************************
  62          *       MCPS_data_indication
  63          *       Function:       Receive data packet indication
  64          *       Parameters: data packet pointer
  65          *       Notes: This function return should be located in the application
  66          **************************************************************/
  67          
  68          /**************************************************************
  69          *       Function:       Hibernate the MC13192 (very low current, no CLKO)
  70          *       Parameters: none
  71          *       Return:         status
  72          **************************************************************/
  73          int MLME_hibernate_request(void)
  74          {
  75   1              __uint8__ status = 0;
  76   1              status = PLME_hibernate_request();
  77   1              return status;
  78   1      }
  79          
  80          /**************************************************************
  81          *       Function:       Doze the MC13192 (Low current, CLKO <= 1MHz)
  82          *       Parameters: none
  83          *       Return:         status
  84          **************************************************************/
  85          int MLME_doze_request(void)
  86          {
  87   1              __uint8__ status = 0;
  88   1              status = PLME_doze_request();
  89   1              return status;
  90   1      }
  91          
  92          /**************************************************************
  93          *       Function:       Wake the MC13192 from Hibernate or Doze
  94          *       Parameters: none
  95          *       Return:         status
  96          **************************************************************/
  97          int MLME_wake_request(void)
  98          {
  99   1              __uint8__ status = 0;
 100   1              status = PLME_wake_request();
 101   1              return status;
 102   1      }
 103          
 104          /**************************************************************
 105          *       Function:       Set the MC13192 operating channel
 106          *       Parameters: channel number (0-15)
 107          *       Channel frequencies:
 108          *       0: 2.405GHz
 109          *       1: 2.410GHz
 110          *       2: 2.415GHz
 111          *       3: 2.420GHz
 112          *       4: 2.425GHz
 113          *       5: 2.430GHz
 114          *       6: 2.435GHz
 115          *       7: 2.440GHz
C51 COMPILER V7.06   SIMPLE_MAC                                                            09/18/2006 21:57:30 PAGE 3   

 116          *       8: 2.445GHz
 117          *       9: 2.450GHz
 118          *       10: 2.455GHz
 119          *       11: 2.460GHz
 120          *       12: 2.465GHz
 121          *       13: 2.470GHz
 122          *       14: 2.475GHz
 123          *       15: 2.480GHz
 124          *       Return:         status
 125          **************************************************************/
 126          int MLME_set_channel_request(__uint8__ ch)
 127          {
 128   1              __uint8__ status = 0;
 129   1              status = PLME_set_channel_request(ch);
 130   1              return status;
 131   1      }
 132          
 133          /**************************************************************
 134          *       Function:       Set the MC13192 receiver ON (with optional timeout)
 135          *       Parameters: packet pointer for received data and timeout
 136          *       Return:         status
 137          *       Notes:          Timeout of 0 disables the timeout.
 138          *                               The actual timeout period is the timeout value times
 139          *                               the MC13192 timer rate from MLME_set_MC13192_tmr_prescale.
 140          **************************************************************/
 141          int MLME_RX_enable_request(rx_packet_t *rx_packet, __uint32__ timeout)
 142          {
 143   1              __uint8__ status = 0;
 144   1              __uint32__ current_time;
 145   1              drv_rx_packet = rx_packet;      /* Assign the rx_packet to SMAC global. */
 146   1              if (timeout == 0) /* Timeout disabled */
 147   1              {
 148   2                      status = PLME_set_trx_state_request(RX_MODE); /* Just enable the receiver */
 149   2              }
 150   1              else /* Timeout requested. Get the current time and add the timeout value. */
 151   1              {       
 152   2                      current_time = PLME_get_time_request();
 153   2                      current_time +=  timeout;
 154   2                      status = PLME_enable_MC13192_timer1(current_time); /* Set the timeout in TC1 */
 155   2                      status = PLME_set_trx_state_request(RX_MODE_WTO);
 156   2              }
 157   1              return status;
 158   1      }
 159          
 160          /**************************************************************

⌨️ 快捷键说明

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