Subversion Repositories Projects

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1704 - 1
#ifndef _UART0_H
2
#define _UART0_H
3
 
4
#include "ubx.h"
5
 
6
#define RXD_BUFFER_LEN  150
7
// must be at least 4('#'+Addr+'CmdID'+'\r')+ (80 * 4)/3 = 111 bytes
8
#define TXD_BUFFER_LEN  150
9
#define RXD_BUFFER_LEN  150
10
 
11
#include <inttypes.h>
12
 
13
//Baud rate of the USART
14
#define USART0_BAUD 57600
15
 
16
//Waypoint Types
17
#define POINT_TYPE_INVALID 255
18
#define POINT_TYPE_WP   0
19
#define POINT_TYPE_POI  1
20
 
21
 
22
 
23
extern void USART0_Init (void);
24
extern void USART0_TransmitTxData(void);
25
extern void USART0_ProcessRxData(void);
26
extern int16_t uart_putchar(int8_t c);
27
 
28
extern uint8_t PcAccess;
29
extern uint8_t RemotePollDisplayLine;
30
 
31
 
32
typedef struct
33
{
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;
44
} __attribute__((packed)) ExternControl_t;
45
 
46
extern ExternControl_t ExternControl;
47
 
48
 
49
typedef struct
50
{
51
        uint8_t Digital[2];
52
        uint16_t Analog[32];    // Debugvalues
53
} __attribute__((packed)) DebugOut_t;
54
 
55
extern DebugOut_t DebugOut;
56
 
57
typedef struct
58
{
59
        uint8_t SWMajor;
60
        uint8_t SWMinor;
61
        uint8_t ProtoMajor;
62
        uint8_t ProtoMinor;
63
        uint8_t SWPatch;
64
        uint8_t Reserved[5];
65
}  __attribute__((packed)) UART_VersionInfo_t;
66
 
67
/* typedef struct
68
{
69
        GPS_Pos_t Position;                 // the gps position of the waypoint, see ubx.h for details
70
        int16_t Heading;                        // orientation, future implementation
71
        uint8_t ToleranceRadius;        // in meters, if the MK is within that range around the target, then the next target is triggered
72
        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
73
        uint8_t Event_Flag;                     // future implementation
74
        uint8_t Index;                          // index of the current waypoint
75
        uint8_t reserve[11];            // reserve
76
} __attribute__((packed)) Waypoint_t;
77
 
78
extern Waypoint_t FollowMe; */
79
 
80
typedef struct
81
{
82
     GPS_Pos_t Position;            // the gps position of the waypoint, see ubx.h for details
83
     int16_t  Heading;              // orientation, 0 no action, 1...360 fix heading, neg. = Index to POI in WP List
84
     uint8_t  ToleranceRadius;      // in meters, if the MK is within that range around the target, then the next target is triggered
85
     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
86
     uint8_t  Event_Flag;           // future implementation
87
     uint8_t  Index;                // to indentify different waypoints, workaround for bad communications PC <-> NC
88
     uint8_t  Type;                 // typeof Waypoint
89
     uint8_t  WP_EventChannelValue; // Will be transferred to the FC and can be used as Poti value there
90
     uint8_t  AltitudeRate;         // rate to change the setpoint
91
     uint8_t  Speed;                // rate to change the Position
92
     uint8_t  CamAngle;             // Camera servo angle in degree (255 -> POI-Automatic)
93
     uint8_t  Name[4];              // Name of that point (ASCII)
94
     uint8_t  reserve[2];           // reserve
95
} __attribute__((packed)) Point_t;
96
 
97
extern Point_t FollowMe;
98
 
99
extern uint8_t Request_SendFollowMe;
100
 
101
#endif //_UART0_H