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