提交 | 用户 | age
|
bfc108
|
1 |
/**
|
Q |
2 |
******************************************************************************
|
|
3 |
* @file : GlobalDef.h
|
|
4 |
* @brief : Header for GlobalDef.c file.
|
|
5 |
* This file contains the Global defines of the application.
|
|
6 |
******************************************************************************
|
|
7 |
*/
|
|
8 |
#ifndef __GLOBALDEF_H__
|
|
9 |
#define __GLOBALDEF_H__
|
|
10 |
#include "MyQueue.h"
|
|
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 |
*/
|
a7db3c
|
19 |
|
Q |
20 |
|
|
21 |
#define DefaultUart1Baud 230400
|
|
22 |
#define DefaultUart2Baud 1000000
|
0aeaad
|
23 |
|
bfc108
|
24 |
enum enBOARD_TYPE
|
Q |
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
|
0aeaad
|
37 |
|
Q |
38 |
BOARD_V30_MINI =11, //11 Mini Board
|
a7db3c
|
39 |
|
Q |
40 |
BOARD_V45_NET = 13,
|
|
41 |
|
|
42 |
BOARD_EXT_FP0 = 14,
|
|
43 |
|
7a2ff3
|
44 |
BOARD_V50_RADIO_16 = 15,
|
Q |
45 |
BOARD_V50_RADIO_8 = 16,
|
|
46 |
|
bfc108
|
47 |
};
|
Q |
48 |
|
7a2ff3
|
49 |
#define BOARD_TYPE 16
|
Q |
50 |
#define BOARD_VER 1
|
c97b4c
|
51 |
#define XLAT_FREQ 8
|
0aeaad
|
52 |
|
bfc108
|
53 |
|
a7db3c
|
54 |
#define GetBoardType() (BOARD_TYPE)
|
bfc108
|
55 |
|
7a2ff3
|
56 |
#if ( BOARD_TYPE == 1)
|
Q |
57 |
#define DINPUT 4
|
|
58 |
#define DOUTPUT 4
|
|
59 |
#elif (BOARD_TYPE == 2 || BOARD_TYPE == 4 || BOARD_TYPE == 6 || BOARD_TYPE == 8 || BOARD_TYPE == 10 || BOARD_TYPE == 11 || BOARD_TYPE == 16)
|
|
60 |
#define DINPUT 8
|
|
61 |
#define DOUTPUT 8
|
|
62 |
#elif BOARD_TYPE == 3 || BOARD_TYPE == 5 || BOARD_TYPE == 7 || BOARD_TYPE == 9 || BOARD_TYPE == 13 || BOARD_TYPE == 15
|
|
63 |
#define DINPUT 16
|
|
64 |
#define DOUTPUT 16
|
|
65 |
#elif BOARD_TYPE == 14
|
|
66 |
#define DINPUT 0
|
|
67 |
#define DOUTPUT 6
|
|
68 |
#else
|
|
69 |
#define DINPUT 0
|
|
70 |
#define DOUTPUT 0
|
|
71 |
#endif
|
bfc108
|
72 |
extern volatile int PendSvCount;
|
Q |
73 |
|
|
74 |
typedef struct tagUartStat
|
|
75 |
{
|
|
76 |
volatile int Inited;
|
|
77 |
volatile int RecvBytes;
|
|
78 |
volatile int SendBytes;
|
|
79 |
volatile int Sending;
|
|
80 |
volatile int Recving;
|
|
81 |
volatile int UseAltRecvBuf;
|
|
82 |
volatile int IntCount;
|
|
83 |
volatile int RXNECount;
|
|
84 |
volatile int TXECount;
|
|
85 |
volatile int PECount;
|
|
86 |
volatile int OverRunCount;
|
|
87 |
volatile int TcCount; //Transmit Complete
|
|
88 |
volatile int IdelCount; //RecvIdel
|
|
89 |
volatile int LostBytes;
|
|
90 |
volatile int DMACount;
|
|
91 |
volatile int DMASendLen;
|
|
92 |
volatile int DMARecvLen;
|
|
93 |
stMyQueue QRx;
|
|
94 |
stMyQueue QTx;
|
|
95 |
volatile int SentPacket;
|
|
96 |
volatile int bPacketRecved;
|
|
97 |
volatile int OKPacket;
|
|
98 |
volatile int TimeOutErr;
|
|
99 |
volatile int NotPacketErr;
|
|
100 |
volatile int LengthErr;
|
|
101 |
volatile int BCCerr;
|
|
102 |
}stUartStat;
|
|
103 |
|
|
104 |
|
|
105 |
extern stUartStat Uart1Stat;
|
|
106 |
extern stUartStat Uart2Stat;
|
|
107 |
|
|
108 |
extern unsigned int Uart1Baud;
|
|
109 |
extern unsigned int Uart2Baud;
|
|
110 |
|
|
111 |
extern unsigned char Uart1RecvBuf1[128];
|
|
112 |
extern int Uart1RecvBuf1DataLen;
|
|
113 |
extern unsigned char Uart1RecvBuf2[128];
|
|
114 |
extern int Uart1RecvBuf2DataLen;
|
|
115 |
|
|
116 |
extern unsigned char Uart2RecvBuf1[128];
|
|
117 |
extern int Uart2RecvBuf1DataLen;
|
|
118 |
extern unsigned char Uart2RecvBuf2[128];
|
|
119 |
extern int Uart2RecvBuf2DataLen;
|
|
120 |
|
|
121 |
extern volatile int Uart1BaudGot;
|
|
122 |
extern volatile int Uart1BaudFirstGot;
|
|
123 |
extern volatile int Uart2BaudGot;
|
|
124 |
extern volatile int Uart2BaudFirstGot;
|
|
125 |
|
|
126 |
extern volatile int Uart1DmaInts;
|
|
127 |
extern volatile int Uart2DmaInts;
|
|
128 |
|
|
129 |
struct stSysConfig{
|
|
130 |
int bInited:1;
|
|
131 |
int bConfiged:1;
|
a7db3c
|
132 |
int bKBusMaster:1;
|
bfc108
|
133 |
};
|
Q |
134 |
|
|
135 |
|
|
136 |
#endif /* __GLOBALDEF_H__ */
|