Subversion Repositories FlightCtrl

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1180 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
extern uint8_t MotorTest[4];
23
 
24
typedef struct
25
{
26
        uint8_t Digital[2];
27
        uint16_t Analog[32];    // Debugvalues
28
} __attribute__((packed)) DebugOut_t;
29
 
30
extern DebugOut_t DebugOut;
31
 
32
typedef struct
33
{
34
   int16_t AngleNick;   // in 0.1 deg
35
   int16_t AngleRoll;   // in 0.1 deg
36
   int16_t Heading;     // in 0.1 deg
37
   uint8_t reserve[8];
38
} __attribute__((packed)) Data3D_t;
39
 
40
 
41
 
42
typedef struct
43
{
44
        uint8_t Digital[2];
45
        uint8_t RemoteButtons;
46
        int8_t  Nick;
47
        int8_t  Roll;
48
        int8_t  Yaw;
49
        uint8_t Gas;
50
        int8_t  Height;
51
        uint8_t free;
52
        uint8_t Frame;
53
        uint8_t Config;
54
} __attribute__((packed)) ExternControl_t;
55
 
56
extern ExternControl_t ExternControl;
57
 
58
typedef struct
59
{
60
        uint8_t SWMajor;
61
        uint8_t SWMinor;
62
        uint8_t ProtoMajor;
63
        uint8_t ProtoMinor;
64
        uint8_t SWPatch;
65
        uint8_t Reserved[5];
66
}  __attribute__((packed)) UART_VersionInfo_t;
67
 
68
 
69
#endif //_UART0_H