提交 | 用户 | age
|
483170
|
1 |
/** |
Q |
2 |
****************************************************************************** |
|
3 |
* @file : BoardType.h |
|
4 |
* @brief : Define of BoardType. |
|
5 |
* This file contains the defines of the BoardType. |
|
6 |
****************************************************************************** |
|
7 |
*/ |
|
8 |
#ifndef __BOARDTYPE_H__ |
|
9 |
#define __BOARDTYPE_H__ |
|
10 |
|
8b51c7
|
11 |
#define KWLESS 1 |
Q |
12 |
|
483170
|
13 |
/* |
Q |
14 |
0 //old board 4 in 4 out |
|
15 |
1 //old board 8 in 8 out |
|
16 |
2 //Master 16 in16 out |
|
17 |
3 //Slave 8 in 8 out |
|
18 |
4 //New Master 16 in16 out V1.2 |
|
19 |
5 //Slave 8 in 8 out V1.2 |
|
20 |
*/ |
7d8ba5
|
21 |
#define USART1_AUTO_BAUDRATE 0 |
483170
|
22 |
|
Q |
23 |
#define USART2_USE_HARDWARE_DE 1 |
|
24 |
#define USART2_DE_ASSERTION_TIME 31 |
|
25 |
#define USART2_DE_DEASSERTION_TIME 31 |
|
26 |
|
|
27 |
enum enBOARD_TYPE |
|
28 |
{ |
|
29 |
BOARD_UNKNOWN =0, |
|
30 |
BOARD_OLD4=1, // 1 //old board 4 in 4 o |
|
31 |
BOARD_OLD8, //2 old board 8 in 8 o |
|
32 |
BOARD_MASTER, //3 Master 16 in16 o |
|
33 |
BOARD_SLAVE, //4 Slave 8 in 8 o |
|
34 |
BOARD_NEW_MASTER, //5 New Master 16 in16 o |
|
35 |
BOARD_NEW_SLAVE, //6 New Slave 8 in 8 o |
|
36 |
BOARD_V4_MASTER, //7 New V4 Master 16 in16 o |
|
37 |
BOARD_V4_SLAVE, //8 New V4 Slave 8 in 8 o |
|
38 |
BOARD_V42_MASTER, //9 New V4.2 Master 16 in16 o |
|
39 |
BOARD_V42_SLAVE, //10 New V4.2 Slave 8 in 8 o |
|
40 |
|
|
41 |
BOARD_V30_MINI =11, //11 Mini Board |
|
42 |
BOARD_V45_NET = 13, |
|
43 |
BOARD_EXT_FP0 = 14, |
|
44 |
BOARD_V50_RADIO_16 = 15, |
|
45 |
BOARD_V50_RADIO_8 = 16, |
|
46 |
|
|
47 |
}; |
|
48 |
|
842bb6
|
49 |
#define BOARD_TYPE 16 |
483170
|
50 |
#define BOARD_VER 1 |
Q |
51 |
|
|
52 |
#if (BOARD_TYPE == 11) |
|
53 |
#define XLAT_FREQ 12 |
|
54 |
#elif (BOARD_TYPE == 14) |
|
55 |
#define XLAT_FREQ 12 |
|
56 |
#else |
|
57 |
#define XLAT_FREQ 8 |
|
58 |
#endif |
|
59 |
|
|
60 |
#define GetBoardType() (BOARD_TYPE) |
|
61 |
|
842bb6
|
62 |
#define PLCFUNC 1 |
Q |
63 |
|
483170
|
64 |
#if ( BOARD_TYPE == 1) |
Q |
65 |
#define DINPUT 4 |
|
66 |
#define DOUTPUT 4 |
842bb6
|
67 |
#elif (BOARD_TYPE == 2 || BOARD_TYPE == 4 || BOARD_TYPE == 6 || BOARD_TYPE == 8 || BOARD_TYPE == 10 || BOARD_TYPE == 11 ) |
483170
|
68 |
#define DINPUT 8 |
Q |
69 |
#define DOUTPUT 8 |
842bb6
|
70 |
#elif BOARD_TYPE == 3 || BOARD_TYPE == 5 || BOARD_TYPE == 7 || BOARD_TYPE == 9 || BOARD_TYPE == 13 |
483170
|
71 |
#define DINPUT 16 |
Q |
72 |
#define DOUTPUT 16 |
|
73 |
#elif BOARD_TYPE == 14 |
|
74 |
#define DINPUT 0 |
|
75 |
#define DOUTPUT 6 |
842bb6
|
76 |
#elif (BOARD_TYPE == 15) |
Q |
77 |
#define DINPUT 16 |
|
78 |
#define DOUTPUT 16 |
|
79 |
#elif (BOARD_TYPE == 16) |
|
80 |
#define DINPUT 16 |
|
81 |
#define DOUTPUT 16 |
|
82 |
#define EXDINPUT 8 |
|
83 |
#define EXDOUPUT 8 |
483170
|
84 |
#else |
Q |
85 |
#define DINPUT 0 |
|
86 |
#define DOUTPUT 0 |
|
87 |
#endif |
|
88 |
|
842bb6
|
89 |
typedef struct tagInfoBlockHdr { |
Q |
90 |
unsigned short nBlkSign; // 开始标志 |
|
91 |
unsigned short nBlkTypeVer; // 类型和版本 |
|
92 |
unsigned short nBlkSize; // Block 大小, 包括开始和结束标志 |
|
93 |
unsigned short Pad1; |
|
94 |
}stInfoBlockHdr; |
|
95 |
|
|
96 |
typedef struct tagInfoBlockTail { |
|
97 |
|
|
98 |
unsigned short CRC16; |
|
99 |
unsigned short EndSign; |
|
100 |
}stInfoBlockTail; |
|
101 |
|
|
102 |
typedef struct tagBtLdrInfoBlock { |
|
103 |
stInfoBlockHdr Hdr; |
|
104 |
unsigned short nBtldrVer; |
|
105 |
unsigned short nBtldrDevice; |
|
106 |
unsigned short nBtldrSize; // 设计大小 |
|
107 |
unsigned short nBtldrDataSize; //代码大小 |
|
108 |
unsigned int nBtldr_AppAddr; |
|
109 |
unsigned int nBtldr_NewAppInfoAddr; |
|
110 |
unsigned int nBtldr_NewAppAddr; |
|
111 |
stInfoBlockTail tail; |
|
112 |
}stBtLdrInfoBlock, *pBtLdrInfoBlock; |
|
113 |
|
|
114 |
typedef struct tagAppInfoBlock { |
|
115 |
stInfoBlockHdr Hdr; |
|
116 |
unsigned short nAppVer; |
|
117 |
unsigned short nAppDevice; |
|
118 |
unsigned short nAppSize; // 代码设计大小 |
|
119 |
unsigned short nAppDataSize; //实际代码大小 |
|
120 |
unsigned int nAppStartAddr; |
|
121 |
unsigned int nAppStartOffset; |
|
122 |
unsigned int nApp; |
|
123 |
stInfoBlockTail tail; |
|
124 |
}stAppInfoBlock, * pAppInfoBlock; |
|
125 |
|
|
126 |
|
483170
|
127 |
|
Q |
128 |
#endif /* __BOARDTYPE_H__ */ |