Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1915 | - | 1 | #ifndef _WAYPOINTS_H |
2 | #define _WAYPOINTS_H |
||
3 | |||
4 | //#include "ubx.h" |
||
5 | #include "../mk-data-structs.h" |
||
6 | #define POINT_TYPE_INVALID 255 |
||
7 | #define POINT_TYPE_WP 0 |
||
8 | #define POINT_TYPE_POI 1 |
||
9 | #define INVALID 0x00 |
||
10 | |||
11 | //typedef struct |
||
12 | //{ |
||
13 | // int32_t Longitude; // in 1E-7 deg |
||
14 | // int32_t Latitude; // in 1E-7 deg |
||
15 | // int32_t Altitude; // in mm |
||
16 | // uint8_t Status;// validity of data |
||
17 | //} __attribute__((packed)) GPS_Pos_t; |
||
18 | |||
19 | |||
20 | //typedef struct |
||
21 | //{ |
||
22 | // GPS_Pos_t Position; // the gps position of the waypoint, see ubx.h for details |
||
23 | // int16_t Heading; // orientation, 0 no action, 1...360 fix heading, neg. = Index to POI in WP List |
||
24 | // uint8_t ToleranceRadius; // in meters, if the MK is within that range around the target, then the next target is triggered |
||
25 | // 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 |
||
26 | // uint8_t Event_Flag; // future implementation |
||
27 | // uint8_t Index; // to indentify different waypoints, workaround for bad communications PC <-> NC |
||
28 | // uint8_t Type; // typeof Waypoint |
||
29 | // uint8_t WP_EventChannelValue; // |
||
30 | // uint8_t AltitudeRate; // rate to change the setpoint |
||
31 | // uint8_t reserve[8]; // reserve |
||
32 | //} __attribute__((packed)) Point_t; |
||
33 | |||
34 | // Init List, return TRUE on success |
||
35 | uint8_t PointList_Init(void); |
||
36 | // Clear List, return TRUE on success |
||
37 | uint8_t PointList_Clear(void); |
||
38 | // Returns number of points in the list |
||
39 | uint8_t PointList_GetCount(void); |
||
40 | // return pointer to point at position |
||
41 | Point_t* PointList_GetAt(uint8_t index); |
||
42 | // set a point in the list at index, returns its index on success, else 0 |
||
43 | uint8_t PointList_SetAt(Point_t* pPoint); |
||
44 | // goto the first WP in the list and return pointer to it |
||
45 | Point_t* PointList_WPBegin(void); |
||
46 | // goto the last WP in the list and return pointer to it |
||
47 | Point_t* PointList_WPEnd(void); |
||
48 | // goto next WP in the list and return pointer to it |
||
49 | Point_t* PointList_WPNext(void); |
||
50 | // enables/disables waypoint function |
||
51 | void PointList_WPActive(uint8_t set); |
||
52 | // returns pointer to actual POI |
||
53 | Point_t* PointList_GetPOI(void); |
||
54 | |||
55 | |||
56 | #endif // _WAYPOINTS_H |