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

📄 slave.lst

📁 这是一个单片机的项目
💻 LST
📖 第 1 页 / 共 4 页
字号:
C51 COMPILER V7.50   SLAVE                                                                 03/17/2008 11:04:03 PAGE 1   


C51 COMPILER V7.50, COMPILATION OF MODULE SLAVE
OBJECT MODULE PLACED IN Slave.OBJ
COMPILER INVOKED BY: C:\Program Files\Keil\C51\BIN\C51.EXE Slave.c BROWSE DEBUG OBJECTEXTEND

line level    source

   1          #include <SM89516A.h>
   2          #include <string.h>
   3          #include <math.h>
   4          #include "MyRam.h"
   5          #include "ComRam.h"
   6          
   7          #define uchar unsigned char
   8          #define uint  unsigned int
   9          
  10          /**************************************公共RAM区地址分配*****************************************/
  11          //公共RAM区从机采集数据包存储开始地址.
  12          #define ComSlaveDataStart1    0x0000       //000H~2FFH    公共RAM区从机1的数据的开始地址.
  13          #define ComSlaveLenAdd1       0x02FE        //公共RAM区从机1数据字节数的存贮地址.
  14          
  15          #define ComSlaveDataStart2    0x0300       //300H~5FFH    公共RAM区从机2的数据的开始地址.
  16          #define ComSlaveLenAdd2       0x05FE        //公共RAM区从机2数据字节数的存贮地址。
  17          
  18          #define ComSlaveDataStart3    0x0600       //600H~8FFH    公共RAM区从机3的数据的开始地址.
  19          #define ComSlaveLenAdd3       0x08FE        //公共RAM区从机3数据字节数的存贮地址。
  20          
  21          #define ComSlaveDataStart4    0x0900       //900H~BFFH    公共RAM区从机4的数据的开始地址.
  22          #define ComSlaveLenAdd4       0x0BFE        //公共RAM区从机4数据字节数的存贮地址。
  23          
  24          #define ComSlaveDataStart5    0x0C00       //C00H~EFFH    公共RAM区从机5的数据的开始地址.
  25          #define ComSlaveLenAdd5       0x0EFE        //公共RAM区从机5数据字节数的存贮地址。
  26          
  27          /*******从机的报警区********/
  28          #define ComAlarmStart1        0x1000      //1000H-10FDH  公共RAM区从机1报警的起始地址。
  29          #define ComAlarmLenAdd1       0x10FE      //10FEH-10FFH  公共RAM区从机1报警数据总长度的存储地址。
  30          
  31          #define ComAlarmStart2        0x1100      //1100H-10FDH  公共RAM区从机2报警的起始地址。
  32          #define ComAlarmLenAdd2       0x11FE      //11FEH-11FFH  公共RAM区从机2报警数据总长度的存储地址。
  33          
  34          #define ComAlarmStart3        0x1200      //1200H-12FDH  公共RAM区从机3报警的起始地址。
  35          #define ComAlarmLenAdd3       0x12FE      //12FEH-12FFH  公共RAM区从机3报警数据总长度的存储地址。
  36          
  37          #define ComAlarmStart4        0x1300      //1300H-13FDH  公共RAM区从机4报警的起始地址。
  38          #define ComAlarmLenAdd4       0x13FE      //13FEH-13FFH  公共RAM区从机4报警数据总长度的存储地址。
  39          
  40          #define ComAlarmStart5        0x1400      //1400H-14FDH  公共RAM区从机5报警的起始地址。
  41          #define ComAlarmLenAdd5       0x14FE      //14FEH-14FFH  公共RAM区从机5报警数据总长度的存储地址。
  42          
  43          //公共RAM区从机命令数据包存放开始地址.
  44          #define ComOrderStart           0x1500     //1500H~4FFFH  公共RAM区发给从机命令的起始地址。
  45          #define ComLenOrder             0x4FFE     //公共RAM区从机命令字节数的存贮RE认为》256N。
  46          #define ComNewOrderFlag         0x4FFD     //公共RAM区有新从机命令的标识位。
  47          
  48          //公共RAM区从机时间命令数据包存放开始地址.
  49          #define ComTimeStart            0x5000     //5000H~50FFH  公共RAM区日期和时间的其实地址。
  50          #define ComLenTimer             0x50FE     //公共RAM区时间字节数存贮地址。
  51          
  52          //公共RAM区输出数据包存放开始地址.
  53          #define ComOutputStart          0x5100     //5100H~6FFFH  公共RAM区发给输出单片机的起始地址。
  54          #define ComLenOutput            0x6FFE     //公共RAM区输出字节数存贮地址。
  55          
C51 COMPILER V7.50   SLAVE                                                                 03/17/2008 11:04:03 PAGE 2   

  56          //公共RAM区从机使能数据包存放开始地址.
  57          #define ComSlaveEnable          0x7500     //公共RAM区从机使能数据包存贮地址.
  58          #define ComLenSlaveEnable       0x7510     //公共RAM区从机使能数据包状态标识存贮地址.
  59          #define ComSlaveEnableNewFlag   0x7511     //公共RAM区从机使能数据包状态标识存贮地址.
  60          
  61          /**************************************公共RAM区地址分配*****************************************/
  62          
  63          /**************************************自己的RAM区地址分配************************************************
             -/
  64          #define MyDataStart       0x0000      // 0000H-02FFH 从机1的数据的开始
  65          #define MyDataLenAdd      0x02FE      //从机1数据字节数的存贮地址
  66          
  67          #define MyOrderStart      0x0300      // 0300H-09FFH 从机命令的起始地址
  68          #define MyOrderLen        0x09FE      //从机命令字节数的
  69          //外设1的通道的参数保存地址。外设为7017则只用前8个通道,外设为7053则用16个通道。
  70          #define WsChannelParaLen  0x0B        //每个通道参数存储的长度。依次为每个通道的最大值(2Bytes),最小值(2By
             -tes),超高报警
  71                                                //号(2Bytes),超低报警号(2Bytes),通道使能,(1Bytes),超高报警动作号(
             -1Bytes),超低报警动作号(1Bytes)。  
  72                                                //如果已知外设i ,通道j,则对应存储的位置为: 1000H +(i-1) *100H+ j *1
             -0H。
  73          #define Ws1channel1       0x1000      //1000H-100FH
  74          #define Ws1channel2       0x1010      //1010H-101FH
  75          #define Ws1channel3       0x1020      //1020H-102FH
  76          #define Ws1channel4       0x1030
  77          #define Ws1channel5       0x1040
  78          #define Ws1channel6       0x1050
  79          #define Ws1channel7       0x1060
  80          #define Ws1channel8       0x1070
  81          #define Ws1channel9       0x1080
  82          #define Ws1channel10      0x1090
  83          #define Ws1channel11      0x10A0
  84          #define Ws1channel12      0x10B0
  85          #define Ws1channel13      0x10C0
  86          #define Ws1channel14      0x10D0
  87          #define Ws1channel15      0x10E0
  88          #define Ws1channel16      0x10F0
  89          //外设2的通道的参数保存地址。外设为7017则只用前8个通道,外设为7053则用16个通道。
  90          #define Ws2channel1       0x1100
  91          #define Ws2channel2       0x1110
  92          #define Ws2channel3       0x1120
  93          #define Ws2channel4       0x1130
  94          #define Ws2channel5       0x1140
  95          #define Ws2channel6       0x1150
  96          #define Ws2channel7       0x1160
  97          #define Ws2channel8       0x1170
  98          #define Ws2channel9       0x1180
  99          #define Ws2channel10      0x1190
 100          #define Ws2channel11      0x11A0
 101          #define Ws2channel12      0x11B0
 102          #define Ws2channel13      0x11C0
 103          #define Ws2channel14      0x11D0
 104          #define Ws2channel15      0x11E0
 105          #define Ws2channel16      0x11F0
 106          //外设3的通道的参数保存地址。外设为7017则只用前8个通道,外设为7053则用16个通道。
 107          #define Ws3channel1       0x1200
 108          #define Ws3channel2       0x1210
 109          #define Ws3channel3       0x1220
 110          #define Ws3channel4       0x1230
 111          #define Ws3channel5       0x1240
 112          #define Ws3channel6       0x1250
 113          #define Ws3channel7       0x1260
C51 COMPILER V7.50   SLAVE                                                                 03/17/2008 11:04:03 PAGE 3   

 114          #define Ws3channel8       0x1270
 115          #define Ws3channel9       0x1280
 116          #define Ws3channel10      0x1290
 117          #define Ws3channel11      0x12A0
 118          #define Ws3channel12      0x12B0
 119          #define Ws3channel13      0x12C0
 120          #define Ws3channel14      0x12D0
 121          #define Ws3channel15      0x12E0
 122          #define Ws3channel16      0x12F0
 123          //外设4的通道的参数保存地址。外设为7017则只用前8个通道,外设为7053则用16个通道。
 124          #define Ws4channel1       0x1300
 125          #define Ws4channel2       0x1310
 126          #define Ws4channel3       0x1320
 127          #define Ws4channel4       0x1330
 128          #define Ws4channel5       0x1340
 129          #define Ws4channel6       0x1350
 130          #define Ws4channel7       0x1360
 131          #define Ws4channel8       0x1370
 132          #define Ws4channel9       0x1380
 133          #define Ws4channel10      0x1390
 134          #define Ws4channel11      0x13A0
 135          #define Ws4channel12      0x13B0
 136          #define Ws4channel13      0x13C0
 137          #define Ws4channel14      0x13D0
 138          #define Ws4channel15      0x13E0
 139          #define Ws4channel16      0x13F0
 140          //外设5的通道的参数保存地址。外设为7017则只用前8个通道,外设为7053则用16个通道。
 141          #define Ws5channel1       0x1400
 142          #define Ws5channel2       0x1410
 143          #define Ws5channel3       0x1420
 144          #define Ws5channel4       0x1430
 145          #define Ws5channel5       0x1440
 146          #define Ws5channel6       0x1450
 147          #define Ws5channel7       0x1460
 148          #define Ws5channel8       0x1470
 149          #define Ws5channel9       0x1480
 150          #define Ws5channel10      0x1490
 151          #define Ws5channel11      0x14A0
 152          #define Ws5channel12      0x14B0
 153          #define Ws5channel13      0x14C0
 154          #define Ws5channel14      0x14D0
 155          #define Ws5channel15      0x14E0
 156          #define Ws5channel16      0x14F0
 157          //外设报警区域。
 158          #define WsAlarm          0x1500     //1500H-151FH
 159          #define WsAlarmLen       0x157F     
 160                
 161          //从机默认参数保存地址。
 162          #define MySlaveParaStart  0x1600     //1600H--1610H
 163          /**************************************自己的RAM区地址分配************************************************
             -/
 164          /**********************************************数据包*****************************************************
             -/
 165          //数据包标识。
 166          #define StartFlag        0x2A
 167          #define CmdWs            0xA1
 168          #define CmdSlave         0xA2
 169          #define CmdTime          0xA3
 170          #define CmdAlarm         0xA4
 171          #define CmdWsControl     0xA5
 172          #define CmdSendSlave     0xB1
 173          //数据包长度。
C51 COMPILER V7.50   SLAVE                                                                 03/17/2008 11:04:03 PAGE 4   

 174          #define LenCmdWs         0x10      //已改成16字节
 175          #define LenCmdSlave      0x08
 176          #define LenCmdTime       0x09
 177          #define LenCmdAlarm      0x04
 178          #define LenCmdWsControl  0x05     /*  需修正*/
 179          #define LenCmdSendSlave  0x07     //向上位机发送的数据包的字节数
 180          /**********************************************数据包*****************************************************
             -/
 181          
 182          /**********************************************外设信息***************************************************
             -/
 183          //外设地址信息。
 184          #define WsAddress1         0x01  //起始地址从01开始
 185          #define WsAddress2         0x02
 186          #define WsAddress3         0x03
 187          #define WsAddress4         0x04
 188          #define WsAddress5         0x05
 189          //外设类型信息。
 190          #define WsType1            0x01   //7017
 191          #define WsType2            0x02   //7053
 192          //外设通道信息。
 193          #define Channel1           0x00   //起始地址从00开始
 194          #define Channel2           0x01
 195          #define Channel3           0x02
 196          #define Channel4           0x03
 197          #define Channel5           0x04
 198          #define Channel6           0x05
 199          #define Channel7           0x06
 200          #define Channel8           0x07
 201          #define Channel9           0x08
 202          
 203          #define Channel10          0x09
 204          #define Channel11          0x0A
 205          #define Channel12          0x0B
 206          #define Channel13          0x0C

⌨️ 快捷键说明

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