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