Subversion Repositories Projects

Rev

Rev 231 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 231 Rev 333
1
#ifndef _UART0_H
1
#ifndef _UART0_H
2
#define _UART0_H
2
#define _UART0_H
-
 
3
 
-
 
4
#include "ubx.h"
3
 
5
 
4
#define RXD_BUFFER_LEN  150
6
#define RXD_BUFFER_LEN  150
5
// must be at least 4('#'+Addr+'CmdID'+'\r')+ (80 * 4)/3 = 111 bytes
7
// must be at least 4('#'+Addr+'CmdID'+'\r')+ (80 * 4)/3 = 111 bytes
6
#define TXD_BUFFER_LEN  150
8
#define TXD_BUFFER_LEN  150
7
#define RXD_BUFFER_LEN  150
9
#define RXD_BUFFER_LEN  150
8
 
10
 
9
#include <inttypes.h>
11
#include <inttypes.h>
10
 
12
 
11
//Baud rate of the USART
13
//Baud rate of the USART
12
#define USART0_BAUD 57600
14
#define USART0_BAUD 57600
13
 
15
 
14
 
16
 
15
extern void USART0_Init (void);
17
extern void USART0_Init (void);
16
extern void USART0_TransmitTxData(void);
18
extern void USART0_TransmitTxData(void);
17
extern void USART0_ProcessRxData(void);
19
extern void USART0_ProcessRxData(void);
18
extern int16_t uart_putchar(int8_t c);
20
extern int16_t uart_putchar(int8_t c);
19
 
21
 
20
extern uint8_t PcAccess;
22
extern uint8_t PcAccess;
21
extern uint8_t RemotePollDisplayLine;
23
extern uint8_t RemotePollDisplayLine;
22
 
24
 
23
typedef struct
25
typedef struct
24
{
26
{
25
        uint8_t Digital[2];
27
        uint8_t Digital[2];
26
        uint8_t RemoteButtons;
28
        uint8_t RemoteButtons;
27
        int8_t  Nick;
29
        int8_t  Nick;
28
        int8_t  Roll;
30
        int8_t  Roll;
29
        int8_t  Yaw;
31
        int8_t  Yaw;
30
        uint8_t Gas;
32
        uint8_t Gas;
31
        int8_t  Height;
33
        int8_t  Height;
32
        uint8_t free;
34
        uint8_t free;
33
        uint8_t Frame;
35
        uint8_t Frame;
34
        uint8_t Config;
36
        uint8_t Config;
35
} __attribute__((packed)) ExternControl_t;
37
} __attribute__((packed)) ExternControl_t;
36
 
38
 
37
extern ExternControl_t ExternControl;
39
extern ExternControl_t ExternControl;
38
 
40
 
39
 
41
 
40
typedef struct
42
typedef struct
41
{
43
{
42
        uint8_t Digital[2];
44
        uint8_t Digital[2];
43
        uint16_t Analog[32];    // Debugvalues
45
        uint16_t Analog[32];    // Debugvalues
44
} __attribute__((packed)) DebugOut_t;
46
} __attribute__((packed)) DebugOut_t;
45
 
47
 
46
extern DebugOut_t DebugOut;
48
extern DebugOut_t DebugOut;
47
 
49
 
48
typedef struct
50
typedef struct
49
{
51
{
50
        uint8_t SWMajor;
52
        uint8_t SWMajor;
51
        uint8_t SWMinor;
53
        uint8_t SWMinor;
52
        uint8_t ProtoMajor;
54
        uint8_t ProtoMajor;
53
        uint8_t ProtoMinor;
55
        uint8_t ProtoMinor;
54
        uint8_t SWPatch;
56
        uint8_t SWPatch;
55
        uint8_t Reserved[5];
57
        uint8_t Reserved[5];
56
}  __attribute__((packed)) UART_VersionInfo_t;
58
}  __attribute__((packed)) UART_VersionInfo_t;
-
 
59
 
-
 
60
typedef struct
-
 
61
{
-
 
62
        GPS_Pos_t Position;             // the gps position of the waypoint, see ubx.h for details
-
 
63
        int16_t Heading;                        // orientation, future implementation
-
 
64
        uint8_t ToleranceRadius;        // in meters, if the MK is within that range around the target, then the next target is triggered
-
 
65
        uint8_t HoldTime;                       // in seconds, if the was once in the tolerance area around a WP, this time defines the delay before the next WP is triggered
-
 
66
        uint8_t Event_Flag;                     // future implementation
-
 
67
        uint8_t reserve[12];            // reserve
-
 
68
} __attribute__((packed)) Waypoint_t;
-
 
69
 
-
 
70
extern Waypoint_t FollowMe;
57
 
71
extern uint8_t Request_SendFollowMe;
58
 
72
 
59
#endif //_UART0_H
73
#endif //_UART0_H
60
 
74