Subversion Repositories FlightCtrl

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1538 killagreg 1
#ifndef _UART0_H
2
#define _UART0_H
3
 
4
#define RXD_BUFFER_LEN  150
5
// must be at least 4('#'+Addr+'CmdID'+'\r')+ (80 * 4)/3 = 111 bytes
6
#define TXD_BUFFER_LEN  150
7
#define RXD_BUFFER_LEN  150
8
 
9
#include <inttypes.h>
10
 
11
//Baud rate of the USART
12
#define USART0_BAUD 57600
13
 
14
 
15
extern void USART0_Init (void);
16
extern void USART0_TransmitTxData(void);
17
extern void USART0_ProcessRxData(void);
18
extern int16_t uart_putchar(int8_t c);
19
 
20
extern uint8_t PcAccess;
21
extern uint8_t RemotePollDisplayLine;
22
 
23
extern uint8_t MotorTest_Active;
24
extern uint8_t MotorTest[16];
25
 
26
typedef struct
27
{
28
        uint8_t Digital[2];
29
        uint16_t Analog[32];    // Debugvalues
30
} __attribute__((packed)) DebugOut_t;
31
 
32
extern DebugOut_t DebugOut;
33
 
34
typedef struct
35
{
36
   int16_t AngleNick;   // in 0.1 deg
37
   int16_t AngleRoll;   // in 0.1 deg
38
   int16_t Heading;     // in 0.1 deg
39
   uint8_t reserve[8];
40
} __attribute__((packed)) Data3D_t;
41
 
42
 
43
 
44
typedef struct
45
{
46
        uint8_t Digital[2];
47
        uint8_t RemoteButtons;
48
        int8_t  Nick;
49
        int8_t  Roll;
50
        int8_t  Yaw;
51
        uint8_t Gas;
52
        int8_t  Height;
53
        uint8_t free;
54
        uint8_t Frame;
55
        uint8_t Config;
56
} __attribute__((packed)) ExternControl_t;
57
 
58
extern ExternControl_t ExternControl;
59
 
60
typedef struct
61
{
62
        uint8_t SWMajor;
63
        uint8_t SWMinor;
64
        uint8_t ProtoMajor;
65
        uint8_t ProtoMinor;
66
        uint8_t SWPatch;
67
        uint8_t Reserved[5];
68
}  __attribute__((packed)) UART_VersionInfo_t;
69
 
70
 
71
#endif //_UART0_H