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