Subversion Repositories NaviCtrl

Rev

Rev 726 | Blame | Compare with Previous | Last modification | View Log | RSS feed

#ifndef _TRIG_H
#define _TRIG_H

#include "fat16.h"
#include "gps.h"
#include "logging.h"


// possible state of an kml-document
typedef enum
{
        TRIG_DOC_CLOSED,
        TRIG_DOC_OPENED,
        TRIG_DOC_PLACEMARK_OPENED,
        TRIG_DOC_LINESTRING_OPENED,
        TRIG_DOC_END
}TRIG_DocState_t;


// structure of an kml-document
typedef struct trig_doc
{
        TRIG_DocState_t state;                                                                  // state of the kml-document
        File_t *file;                                                                                   // filepointer to the file where the data should be saved.
} TRIG_Document_t;



typedef struct
{
 s32 Longitude;
 s32 Latitude;
 s32 AltiBaro; // in cm
 s32 AltiGPS;
 s16 Yaw;
 u16 Count;
 u16 CountExternal;
 u16 ShutterCounter;
 u8 Hour;
 u8 Min;
 u8 Sec;
 u16 mSec;
 u16 ServoControlNick;
 u16 ServoControlPoi;
 u8 NewData;
}  TrigLog_t;
extern TrigLog_t TrigLogging;

extern logfilestate_t LoggingTrigger(u32);
u8 TRIG_LoggGPSCoordinates(TRIG_Document_t *);                          // intializes the kml-document with standard filename and adds points to the file
u8 TRIG_DocumentInit(TRIG_Document_t *);                                                // Init the new kml-document
u8 TRIG_DocumentOpen(s8 *, TRIG_Document_t *);                          // opens a new kml-document. a new file is created on the sd-memorycard
u8 TRIG_DocumentClose(TRIG_Document_t *doc);                                    // closes the specified document saving remaining data to the file.
u8 TRIG_PlaceMarkOpen(TRIG_Document_t *doc);                                    // opens a new placemark within the open kml-document
u8 TRIG_PlaceMarkClose(TRIG_Document_t *doc);                                   // closes the actual placemark
u8 TRIG_LineStringBegin(TRIG_Document_t *doc);                          // begins a new linestring within the actual placemark
u8 TRIG_LineStringEnd(TRIG_Document_t *doc);                                    // close the actual linestring within the actual placemark
u8 TRIG_LineStringAddPoint(TRIG_Document_t *);                          // adds a point from the gps (longitude, altitude, height) to the linestring

extern u16 Logged_TRIG_Counter;
extern u8  BlitzSchuhConnected;

extern void TriggerInput(void); // triggerinput on IO2
#endif //_TRIG_H