Rev 91 | Rev 97 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 91 | Rev 92 | ||
---|---|---|---|
Line 7... | Line 7... | ||
7 | 7 | ||
8 | #define TXD_BUFFER_LEN 150 |
8 | #define TXD_BUFFER_LEN 150 |
9 | #define RXD_BUFFER_LEN 150 |
9 | #define RXD_BUFFER_LEN 150 |
Line 10... | Line 10... | ||
10 | #define BAUD_RATE 57600 //Baud Rate for the serial interfaces |
10 | #define BAUD_RATE 57600 //Baud Rate for the serial interfaces |
Line 11... | Line 11... | ||
11 | 11 | ||
12 | #include "ubx.h" |
12 | #include "ubx.h" |
13 | 13 | ||
14 | typedef struct |
14 | typedef struct |
15 | { |
15 | { |
16 | s16 AngleNick; // in 0.1 deg |
16 | s16 AngleNick; // in 0.1 deg |
17 | s16 AngleRoll; // in 0.1 deg |
17 | s16 AngleRoll; // in 0.1 deg |
Line 18... | Line 18... | ||
18 | s16 Heading; // in 0.1 deg |
18 | s16 Heading; // in 0.1 deg |
Line 19... | Line 19... | ||
19 | u8 reserve[8]; |
19 | u8 reserve[8]; |
Line 53... | Line 53... | ||
53 | } __attribute__((packed)) Attitude_t; |
53 | } __attribute__((packed)) Attitude_t; |
Line 54... | Line 54... | ||
54 | 54 | ||
55 | typedef struct |
55 | typedef struct |
56 | { |
56 | { |
57 | u16 Distance; // distance to target in dm |
57 | u16 Distance; // distance to target in dm |
58 | s16 Bearing; // course to target in deg |
58 | s16 Bearing; // course to target in deg |
Line 59... | Line 59... | ||
59 | } __attribute__((packed)) GPS_PosDev_t; |
59 | } __attribute__((packed)) GPS_PosDev_t; |
Line 60... | Line 60... | ||
60 | 60 | ||
61 | #define NAVIDATA_VERSION 1 |
61 | #define NAVIDATA_VERSION 1 |
62 | 62 | ||
63 | typedef struct |
63 | typedef struct |
Line 84... | Line 84... | ||
84 | u8 MKFlags; // Flags from FC |
84 | u8 MKFlags; // Flags from FC |
85 | u8 NCFlags; // Flags from NC |
85 | u8 NCFlags; // Flags from NC |
86 | u8 Errorcode; // 0 --> okay |
86 | u8 Errorcode; // 0 --> okay |
87 | u8 OperatingRadius; // current operation radius around the Home Position in m |
87 | u8 OperatingRadius; // current operation radius around the Home Position in m |
88 | s16 TopSpeed; // velocity in vertical direction in cm/s |
88 | s16 TopSpeed; // velocity in vertical direction in cm/s |
- | 89 | u16 TargetHoldTime; // time in ms to stay at the given target, counts down to 0 if target has been reached |
|
89 | u8 Reserve[5]; // for future use |
90 | u8 Reserve[3]; // for future use |
90 | } __attribute__((packed)) NaviData_t; |
91 | } __attribute__((packed)) NaviData_t; |
Line 91... | Line 92... | ||
91 | 92 | ||
92 | extern NaviData_t NaviData; |
93 | extern NaviData_t NaviData; |
93 | extern u8 Request_NaviData; |
- | |
94 | - | ||
95 | #define NC_FLAG_FREE 1 |
- | |
96 | #define NC_FLAG_PH 2 |
- | |
97 | #define NC_FLAG_CH 4 |
- | |
98 | #define NC_FLAG_RANGE_LIMIT 8 |
- | |
Line 99... | Line 94... | ||
99 | #define NC_NO_SERIAL_DATA 0x10 |
94 | extern u8 Request_NaviData; |
100 | - | ||
101 | typedef struct |
95 | |
102 | { |
96 | #define NC_FLAG_FREE 0x01 |
103 | u8 SWMajor; |
97 | #define NC_FLAG_PH 0x02 |
104 | u8 SWMinor; |
98 | #define NC_FLAG_CH 0x04 |
105 | u8 ProtoMajor; |
99 | #define NC_FLAG_RANGE_LIMIT 0x08 |
106 | u8 ProtoMinor; |
100 | #define NC_FLAG_NOSERIALLINK 0x10 |
107 | u8 SWPatch; |
101 | #define NC_FLAG_TARGET_REACHED 0x20 |
108 | u8 Reserved[5]; |
102 | #define NC_FLAG_7 0x40 |
109 | } __attribute__((packed)) UART_VersionInfo_t; |
- | |
110 | - | ||
111 | extern volatile u8 rxd_buffer[RXD_BUFFER_LEN]; |
- | |
112 | extern volatile u8 ReceivedBytes; |
103 | #define NC_FLAG_8 0x80 |
113 | extern volatile u8 rxd_buffer_locked; |
104 | |
- | 105 | extern UART_TypeDef *DebugUART; |
|
Line 114... | Line 106... | ||
114 | extern UART_TypeDef *DebugUART; |
106 | extern volatile u8 SerialLinkOkay; |
115 | extern volatile u8 SerialDataOkay; |
107 | |
116 | 108 | ||
117 | void UART1_Init(void); |
109 | void UART1_Init(void); |
Line 118... | Line 110... | ||
118 | void UART1_Transmit(void); |
110 | void UART1_Transmit(void); |
119 | void UART1_TransmitTxData(void); |
111 | void UART1_TransmitTxData(void); |
120 | void UART1_ProcessRxData(void); |
- | |
121 | 112 | void UART1_ProcessRxData(void); |
|
122 | s16 uart_putchar (char c); |
113 | |
123 | void SerialPutString(u8 *s); |
114 | s16 uart_putchar (char c); |