Rev 426 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 426 | Rev 434 | ||
---|---|---|---|
1 | #ifndef _UART0_H |
1 | #ifndef _UART0_H |
2 | #define _UART0_H |
2 | #define _UART0_H |
3 | 3 | ||
4 | #include "ubx.h" |
4 | #include "ubx.h" |
5 | 5 | ||
6 | #define RXD_BUFFER_LEN 150 |
6 | #define RXD_BUFFER_LEN 150 |
7 | // 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 |
8 | #define TXD_BUFFER_LEN 150 |
8 | #define TXD_BUFFER_LEN 150 |
9 | #define RXD_BUFFER_LEN 150 |
9 | #define RXD_BUFFER_LEN 150 |
10 | 10 | ||
11 | #include <inttypes.h> |
11 | #include <inttypes.h> |
12 | 12 | ||
13 | //Baud rate of the USART |
13 | //Baud rate of the USART |
14 | #define USART0_BAUD 57600 |
14 | #define USART0_BAUD 57600 |
15 | 15 | ||
16 | 16 | ||
17 | extern void USART0_Init (void); |
17 | extern void USART0_Init (void); |
18 | extern void USART0_TransmitTxData(void); |
18 | extern void USART0_TransmitTxData(void); |
19 | extern void USART0_ProcessRxData(void); |
19 | extern void USART0_ProcessRxData(void); |
20 | extern int16_t uart_putchar(int8_t c); |
20 | extern int16_t uart_putchar(int8_t c); |
21 | 21 | ||
22 | extern uint8_t PcAccess; |
22 | extern uint8_t PcAccess; |
23 | extern uint8_t RemotePollDisplayLine; |
23 | extern uint8_t RemotePollDisplayLine; |
24 | - | ||
25 | extern uint8_t text[100]; // globally used text buffer |
24 | |
26 | 25 | ||
27 | typedef struct |
26 | typedef struct |
28 | { |
27 | { |
29 | uint8_t Digital[2]; |
28 | uint8_t Digital[2]; |
30 | uint8_t RemoteButtons; |
29 | uint8_t RemoteButtons; |
31 | int8_t Nick; |
30 | int8_t Nick; |
32 | int8_t Roll; |
31 | int8_t Roll; |
33 | int8_t Yaw; |
32 | int8_t Yaw; |
34 | uint8_t Gas; |
33 | uint8_t Gas; |
35 | int8_t Height; |
34 | int8_t Height; |
36 | uint8_t free; |
35 | uint8_t free; |
37 | uint8_t Frame; |
36 | uint8_t Frame; |
38 | uint8_t Config; |
37 | uint8_t Config; |
39 | } __attribute__((packed)) ExternControl_t; |
38 | } __attribute__((packed)) ExternControl_t; |
40 | 39 | ||
41 | extern ExternControl_t ExternControl; |
40 | extern ExternControl_t ExternControl; |
42 | 41 | ||
43 | 42 | ||
44 | typedef struct |
43 | typedef struct |
45 | { |
44 | { |
46 | uint8_t Digital[2]; |
45 | uint8_t Digital[2]; |
47 | uint16_t Analog[32]; // Debugvalues |
46 | uint16_t Analog[32]; // Debugvalues |
48 | } __attribute__((packed)) DebugOut_t; |
47 | } __attribute__((packed)) DebugOut_t; |
49 | 48 | ||
50 | extern DebugOut_t DebugOut; |
49 | extern DebugOut_t DebugOut; |
51 | 50 | ||
52 | typedef struct |
51 | typedef struct |
53 | { |
52 | { |
54 | uint8_t SWMajor; |
53 | uint8_t SWMajor; |
55 | uint8_t SWMinor; |
54 | uint8_t SWMinor; |
56 | uint8_t ProtoMajor; |
55 | uint8_t ProtoMajor; |
57 | uint8_t ProtoMinor; |
56 | uint8_t ProtoMinor; |
58 | uint8_t SWPatch; |
57 | uint8_t SWPatch; |
59 | uint8_t Reserved[5]; |
58 | uint8_t Reserved[5]; |
60 | } __attribute__((packed)) UART_VersionInfo_t; |
59 | } __attribute__((packed)) UART_VersionInfo_t; |
61 | 60 | ||
62 | typedef struct |
61 | typedef struct |
63 | { |
62 | { |
64 | GPS_Pos_t Position; // the gps position of the waypoint, see ubx.h for details |
63 | GPS_Pos_t Position; // the gps position of the waypoint, see ubx.h for details |
65 | int16_t Heading; // orientation, future implementation |
64 | int16_t Heading; // orientation, future implementation |
66 | uint8_t ToleranceRadius; // in meters, if the MK is within that range around the target, then the next target is triggered |
65 | uint8_t ToleranceRadius; // in meters, if the MK is within that range around the target, then the next target is triggered |
67 | 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 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 |
68 | uint8_t Event_Flag; // future implementation |
67 | uint8_t Event_Flag; // future implementation |
69 | uint8_t reserve[12]; // reserve |
68 | uint8_t reserve[12]; // reserve |
70 | } __attribute__((packed)) Waypoint_t; |
69 | } __attribute__((packed)) Waypoint_t; |
71 | 70 | ||
72 | extern Waypoint_t FollowMe; |
71 | extern Waypoint_t FollowMe; |
73 | extern uint8_t Request_SendFollowMe; |
72 | extern uint8_t Request_SendFollowMe; |
74 | 73 | ||
75 | #endif //_UART0_H |
74 | #endif //_UART0_H |
76 | 75 |