QuakeGod
2024-07-27 842bb64195f958b050867c50db66fc0aa413dafb
提交 | 用户 | age
842bb6 1 #include "BoardType.h"
Q 2 #include "KMachine.h"
3 #include "KBus.h"
4
5 #define  APP_ADDR                      0x08001000  //应用程序首地址定义
6 #define  APPINFOBLOCK_ADDR          (APP_ADDR + 0x100)  //程序信息块 地址
7 #define  INFOBLOCK_ADDR          (APP_ADDR + 0x1000)  //信息块 地址
8
9 #define  APP_START_ADDR                     IROM1_START_ADDRESS
10 extern int Region$$Table$$Limit;
11
12 #define MAKE_VER(x,y) ((x<<8)|y)
13 #define APP_VER MAKE_VER(1,16)
14
15 const stAppInfoBlock AppInfoBlock __attribute__((at(APPINFOBLOCK_ADDR))) =
16 {
17     0xAA55,            // StartSign
18     0x0301,            // BlockType
19     sizeof(stAppInfoBlock),        //BlockSize
20     0,                                                    // Pad,
21     APP_VER,                                //AppVer                        
22     (BOARD_TYPE<<8) + BOARD_VER,                //AppDevice;
23     0x1000,                                //AppSize;
24     0x0C00,                                //AppDataSize;
25     APP_ADDR,                        //nAppStartAddr
26     (int)&Region$$Table$$Limit,                        //nBtldr_NewAppInfoAddr
27     0x08009000,                        //nBtldr_NewAppAddr
28     0xCCCC,                                //crc16;
29     0xAA55                                //EndSign;    
30     
31 };
32
33
34 const stKMInfoBlock KMInfoBlock __attribute__((at(INFOBLOCK_ADDR))) =
35 {
36 //    sizeof(stKMInfoBlock),
37     (BOARD_TYPE<<8) + BOARD_VER,            //nDeviceType     BOARD_VER,            //nDevieVer
38     APP_VER,            //ProgVer
39     0x0102,            //KLinkVer
40     KBUS_VER,            //KBusVer
41 //    0x0100,            //KNetVer
42 //    0x0100,            //KWLVer
43     
44     4,                    //nCapacity1    ?K
45     1,                    //nCapacity2    ?k
46     
47     DINPUT,                    //nDInput;
48     DOUTPUT,                //nDOutput
49     
50     0,                    //nAInput
51     0,                    //nAOutput
52     0,                    //nHInput
53     0,                    //nHOutput
54     0,                    //nExt1;
55     0,                    //nExt2;
56     0,                    //nLogSize;
57     3,                    //nPorts;
58     0,                    //nManSize;
59     0,                    //nAbility;
60     6,                    //nSwitchBits;
61 };
62
63 const stDeviceInfo MyDeviceInfo={
64         
65         (BOARD_TYPE<<8) + BOARD_VER,            //nDeviceTypeVer //    unsigned short ClientType;        // 子机类型
66         APP_VER,            //ProgVer                    //    unsigned short ClientVer;            // 子机版本
67
68         DINPUT,                                                //    unsigned char InBitCount;            // 输入开关量数量
69         DOUTPUT,                                            //    unsigned char OutBitCount;        // 输出开关量数量
70         0,                                //    unsigned char InDWCount;            // 输入数据字数
71         0,                                //    unsigned char OutDWCount;            // 输出数据字数
72         0,                                //    unsigned char AIWCount;                // 输入模拟量通道(字)数    // 16位为一个字(通道)
73         0,                                //    unsigned char AQWCount;                // 输出模拟量通道(字)数    // 16位为一个字(通道)
74 //    0,                                //    unsigned char AIBits;                    //  每通道位数        // 16位以下
75 //    0,                                //    unsigned char AQbits;                    //    每通道位数        // 16位以下
76 };
77
78 const stExDeviceInfo MyExDeviceInfo ={
79         (BOARD_TYPE<<8) + BOARD_VER,            //nDeviceTypeVer //    unsigned short ClientType;        // 子机类型
80         APP_VER,            //ProgVer                    //    unsigned short ClientVer;            // 子机版本
81
82         DINPUT,                                                //    unsigned char InBitCount;            // 输入开关量数量
83         DOUTPUT,                                            //    unsigned char OutBitCount;        // 输出开关量数量
84         0,                                //    unsigned char InDWCount;            // 输入数据字数
85         0,                                //    unsigned char OutDWCount;            // 输出数据字数    
86         0,                                //    unsigned char AIWCount;                // 输入模拟量通道(字)数    // 16位为一个字(通道)
87         0,                                //    unsigned char AQWCount;                // 输出模拟量通道(字)数    // 16位为一个字(通道)
88 //    0,                                //    unsigned char AIBits;                    //  每通道位数        // 16位以下
89 //    0,                                //    unsigned char AQbits;                    //    每通道位数        // 16位以下
90
91 };
92
93