提交 | 用户 | 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 |
BOARD_V45_NET = 13,
|
Q |
40 |
BOARD_EXT_FP0 = 14,
|
0fe6b0
|
41 |
BOARD_V50_RADIO_16 = 15,
|
Q |
42 |
BOARD_V50_RADIO_8 = 16,
|
a7db3c
|
43 |
|
bfc108
|
44 |
};
|
Q |
45 |
|
7b8b07
|
46 |
#define BOARD_TYPE 14
|
0fe6b0
|
47 |
#define BOARD_VER 1
|
0aeaad
|
48 |
|
0fe6b0
|
49 |
#if (BOARD_TYPE == 11)
|
Q |
50 |
#define XLAT_FREQ 12
|
|
51 |
#elif (BOARD_TYPE == 14)
|
|
52 |
#define XLAT_FREQ 12
|
|
53 |
#else
|
|
54 |
#define XLAT_FREQ 8
|
|
55 |
#endif
|
bfc108
|
56 |
|
a7db3c
|
57 |
#define GetBoardType() (BOARD_TYPE)
|
bfc108
|
58 |
|
Q |
59 |
extern volatile int PendSvCount;
|
|
60 |
|
|
61 |
typedef struct tagUartStat
|
|
62 |
{
|
|
63 |
volatile int SendBytes;
|
0fe6b0
|
64 |
volatile int RecvBytes;
|
Q |
65 |
volatile char bInited;
|
|
66 |
volatile char bSending;
|
|
67 |
volatile char bRecving;
|
|
68 |
volatile char bUseAltRecvBuf;
|
|
69 |
volatile int IRQCount;
|
bfc108
|
70 |
volatile int RXNECount;
|
Q |
71 |
volatile int TXECount;
|
|
72 |
volatile int PECount;
|
|
73 |
volatile int OverRunCount;
|
|
74 |
volatile int TcCount; //Transmit Complete
|
|
75 |
volatile int IdelCount; //RecvIdel
|
|
76 |
volatile int LostBytes;
|
|
77 |
volatile int DMACount;
|
|
78 |
volatile int DMASendLen;
|
|
79 |
volatile int DMARecvLen;
|
|
80 |
stMyQueue QRx;
|
|
81 |
stMyQueue QTx;
|
|
82 |
volatile int SentPacket;
|
|
83 |
volatile int bPacketRecved;
|
|
84 |
volatile int OKPacket;
|
|
85 |
volatile int TimeOutErr;
|
|
86 |
volatile int NotPacketErr;
|
|
87 |
volatile int LengthErr;
|
|
88 |
volatile int BCCerr;
|
|
89 |
}stUartStat;
|
|
90 |
|
|
91 |
|
|
92 |
extern stUartStat Uart1Stat;
|
|
93 |
extern stUartStat Uart2Stat;
|
|
94 |
|
|
95 |
extern unsigned int Uart1Baud;
|
|
96 |
extern unsigned int Uart2Baud;
|
|
97 |
|
|
98 |
extern unsigned char Uart1RecvBuf1[128];
|
|
99 |
extern int Uart1RecvBuf1DataLen;
|
0fe6b0
|
100 |
//extern unsigned char Uart1RecvBuf2[128];
|
Q |
101 |
//extern int Uart1RecvBuf2DataLen;
|
bfc108
|
102 |
|
Q |
103 |
extern unsigned char Uart2RecvBuf1[128];
|
|
104 |
extern int Uart2RecvBuf1DataLen;
|
0fe6b0
|
105 |
//extern unsigned char Uart2RecvBuf2[128];
|
Q |
106 |
//extern int Uart2RecvBuf2DataLen;
|
bfc108
|
107 |
|
Q |
108 |
extern volatile int Uart1BaudGot;
|
|
109 |
extern volatile int Uart1BaudFirstGot;
|
0fe6b0
|
110 |
//extern volatile int Uart2BaudGot;
|
Q |
111 |
//extern volatile int Uart2BaudFirstGot;
|
bfc108
|
112 |
|
0fe6b0
|
113 |
//extern volatile int Uart1DmaInts;
|
Q |
114 |
//extern volatile int Uart2DmaInts;
|
bfc108
|
115 |
|
Q |
116 |
struct stSysConfig{
|
|
117 |
int bInited:1;
|
|
118 |
int bConfiged:1;
|
a7db3c
|
119 |
int bKBusMaster:1;
|
bfc108
|
120 |
};
|
Q |
121 |
|
|
122 |
|
|
123 |
#endif /* __GLOBALDEF_H__ */
|