提交 | 用户 | age
|
483170
|
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 |
|
|
11 |
#include "BoardType.h" |
|
12 |
#include "MyQueue.h" |
|
13 |
|
eaf5d5
|
14 |
#define DefaultUart1Baud 115200 |
483170
|
15 |
#define DefaultUart2Baud 1000000 |
Q |
16 |
#define AlterUart2Baud 500000 |
|
17 |
|
|
18 |
extern volatile int PendSvCount; |
|
19 |
|
842bb6
|
20 |
#pragma anon_unions |
483170
|
21 |
typedef struct tagUartStat |
Q |
22 |
{ |
|
23 |
volatile int SendBytes; |
|
24 |
volatile int RecvBytes; |
842bb6
|
25 |
volatile int SentPacket; |
Q |
26 |
union{ |
|
27 |
volatile unsigned char state; |
|
28 |
struct { |
|
29 |
volatile unsigned char bInited:1; |
|
30 |
volatile unsigned char bSending:1; |
|
31 |
volatile unsigned char bRecving:1; |
|
32 |
volatile unsigned char bUseAltRecvBuf:1; |
|
33 |
|
|
34 |
}; |
|
35 |
}; |
|
36 |
volatile unsigned char bPacketRecved; |
|
37 |
volatile unsigned char bSendDone; |
483170
|
38 |
volatile int IRQCount; |
Q |
39 |
volatile int RXNECount; |
|
40 |
volatile int TXECount; |
|
41 |
volatile int PECount; |
|
42 |
volatile int OverRunCount; |
|
43 |
volatile int TcCount; //Transmit Complete |
|
44 |
volatile int IdelCount; //RecvIdel |
842bb6
|
45 |
// volatile int LostBytes; |
483170
|
46 |
volatile int DMACount; |
Q |
47 |
volatile int DMASendLen; |
|
48 |
volatile int DMARecvLen; |
|
49 |
stMyQueue QRx; |
|
50 |
stMyQueue QTx; |
842bb6
|
51 |
|
Q |
52 |
|
|
53 |
// volatile int OKPacket; |
|
54 |
// volatile int TimeOutErr; |
|
55 |
// volatile int NotPacketErr; |
|
56 |
// volatile int LengthErr; |
|
57 |
// volatile int BCCerr; |
483170
|
58 |
}stUartStat; |
Q |
59 |
|
|
60 |
|
|
61 |
extern stUartStat Uart1Stat; |
|
62 |
extern stUartStat Uart2Stat; |
|
63 |
|
842bb6
|
64 |
#define Uart1RecvBufSize 256 |
Q |
65 |
|
483170
|
66 |
extern unsigned int Uart1Baud; |
Q |
67 |
extern unsigned int Uart2Baud; |
|
68 |
|
842bb6
|
69 |
extern unsigned char Uart1RecvBuf1[Uart1RecvBufSize]; |
483170
|
70 |
extern int Uart1RecvBuf1DataLen; |
842bb6
|
71 |
|
483170
|
72 |
|
Q |
73 |
extern unsigned char Uart2RecvBuf1[128]; |
|
74 |
extern int Uart2RecvBuf1DataLen; |
842bb6
|
75 |
|
483170
|
76 |
|
Q |
77 |
extern volatile int Uart1BaudGot; |
|
78 |
extern volatile int Uart1BaudFirstGot; |
|
79 |
//extern volatile int Uart2BaudGot; |
|
80 |
//extern volatile int Uart2BaudFirstGot; |
|
81 |
|
|
82 |
//extern volatile int Uart1DmaInts; |
|
83 |
//extern volatile int Uart2DmaInts; |
|
84 |
|
|
85 |
struct stSysConfig{ |
|
86 |
int bInited:1; |
|
87 |
int bConfiged:1; |
|
88 |
int bKBusMaster:1; |
|
89 |
}; |
|
90 |
|
|
91 |
|
|
92 |
#endif /* __GLOBALDEF_H__ */ |