Subversion Repositories FlightCtrl

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
886 killagreg 1
#ifndef _UART_H
2
#define _UART_H
1 ingob 3
 
1078 killagreg 4
#define RXD_BUFFER_LEN  150
5
// must be at least 4('#'+Addr+'CmdID'+'\r')+ (80 * 4)/3 = 111 bytes
886 killagreg 6
#define TXD_BUFFER_LEN  150
7
#define RXD_BUFFER_LEN  150
8
 
9
#include <inttypes.h>
304 ingob 10
 
886 killagreg 11
//Baud rate of the USART
12
#define USART0_BAUD 57600
1 ingob 13
 
14
 
886 killagreg 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);
693 hbuss 19
 
886 killagreg 20
extern uint8_t PcAccess;
21
extern uint8_t RemotePollDisplayLine;
22
extern uint8_t MotorTest[4];
1 ingob 23
 
886 killagreg 24
typedef struct
1 ingob 25
{
1081 killagreg 26
        uint8_t Digital[2];
27
        uint16_t Analog[32];    // Debugvalues
1078 killagreg 28
} __attribute__((packed)) DebugOut_t;
1 ingob 29
 
886 killagreg 30
extern DebugOut_t DebugOut;
1 ingob 31
 
886 killagreg 32
typedef struct
33
{
1081 killagreg 34
        uint8_t Digital[2];
35
        uint8_t RemoteButtons;
36
        int8_t          Nick;
37
        int8_t          Roll;
38
        int8_t          Yaw;
39
        uint8_t Gas;
40
        int8_t          Height;
41
        uint8_t free;
42
        uint8_t Frame;
43
        uint8_t Config;
1078 killagreg 44
} __attribute__((packed)) ExternControl_t;
1 ingob 45
 
886 killagreg 46
extern ExternControl_t ExternControl;
1 ingob 47
 
886 killagreg 48
typedef struct
49
{
1081 killagreg 50
        uint8_t SWMajor;
51
        uint8_t SWMinor;
52
        uint8_t ProtoMajor;
53
        uint8_t ProtoMinor;
54
        uint8_t SWPatch;
55
        uint8_t Reserved[5];
1078 killagreg 56
}  __attribute__((packed)) UART_VersionInfo_t;
1 ingob 57
 
58
 
59
#endif //_UART_H