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