Subversion Repositories NaviCtrl

Rev

Rev 259 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
41 ingob 1
#ifndef _WAYPOINTS_H
2
#define _WAYPOINTS_H
3
 
4
#include "ubx.h"
5
 
277 killagreg 6
#define POINT_TYPE_INVALID 255
225 killagreg 7
#define POINT_TYPE_WP   0
8
#define POINT_TYPE_POI  1
9
 
41 ingob 10
typedef struct
11
{
12
        GPS_Pos_t Position;             // the gps position of the waypoint, see ubx.h for details
277 killagreg 13
        s16 Heading;                    // orientation, 0 no action, 1...360 fix heading, neg. = Index to POI in WP List
41 ingob 14
        u8  ToleranceRadius;    // in meters, if the MK is within that range around the target, then the next target is triggered
88 killagreg 15
        u8  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
16
        u8  Event_Flag;                 // future implementation
162 ingob 17
        u8  Index;              // to indentify different waypoints, workaround for bad communications PC <-> NC
225 killagreg 18
        u8  Type;                               // typeof Waypoint
277 killagreg 19
        u8  WP_EventChannelValue;  //
259 holgerb 20
        u8  reserve[9];             // reserve
41 ingob 21
} __attribute__((packed)) Waypoint_t;
22
 
277 killagreg 23
// Init List, return TRUE on success
41 ingob 24
u8 WPList_Init(void);
277 killagreg 25
// Clear List, return TRUE on success
41 ingob 26
u8 WPList_Clear(void);
277 killagreg 27
// Returns number of points in the list
41 ingob 28
u8 WPList_GetCount(void);
277 killagreg 29
// appends a point to the list, returns TRUE on success
41 ingob 30
u8 WPList_Append(Waypoint_t* pwp);
277 killagreg 31
// goto the first WP in the list and return pointer to it
41 ingob 32
Waypoint_t* WPList_Begin(void);
277 killagreg 33
// goto the last WP in the list and return pointer to it
151 killagreg 34
Waypoint_t* WPList_End(void);
277 killagreg 35
// goto next WP in the list and return pointer to it
41 ingob 36
Waypoint_t* WPList_Next(void);
277 killagreg 37
// return pointer to point at position
92 killagreg 38
Waypoint_t* WPList_GetAt(u8 index);
277 killagreg 39
// returns pointer to actual POI
224 killagreg 40
Waypoint_t* WPList_GetPOI(void);
41 ingob 41
 
42
#endif // _WAYPOINTS_H