Subversion Repositories NaviCtrl

Rev

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

Rev Author Line No. Line
717 holgerb 1
#ifndef _TRIG_H
2
#define _TRIG_H
3
 
4
#include "fat16.h"
5
#include "gps.h"
6
 
7
 
8
// possible state of an kml-document
9
typedef enum
10
{
11
        TRIG_DOC_CLOSED,
12
        TRIG_DOC_OPENED,
13
        TRIG_DOC_PLACEMARK_OPENED,
14
        TRIG_DOC_LINESTRING_OPENED,
15
        TRIG_DOC_END
16
}TRIG_DocState_t;
17
 
18
 
19
// structure of an kml-document
20
typedef struct trig_doc
21
{
22
        TRIG_DocState_t state;                                                                  // state of the kml-document
23
        File_t *file;                                                                                   // filepointer to the file where the data should be saved.
24
} TRIG_Document_t;
25
 
721 holgerb 26
 
717 holgerb 27
typedef enum
28
{
29
        LOGFILE_IDLE,
30
        LOGFILE_START,
31
        LOGFILE_CLOSED,
32
        LOGFILE_OPENED,
33
        LOGFILE_ERROR
721 holgerb 34
} tlogfilestate_t;
717 holgerb 35
 
36
typedef struct
37
{
38
 s32 Longitude;
39
 s32 Latitude;
40
 s32 AltiBaro; // in cm
41
 s32 AltiGPS;
42
 s16 Yaw;
43
 u16 Count;
44
 u16 ShutterCounter;
45
 u8 Hour;
46
 u8 Min;
47
 u8 Sec;
48
 u16 mSec;
49
 u16 ServoControlNick;
50
 u16 ServoControlPoi;
51
 u8 NewData;
52
}  TrigLog_t;
53
extern TrigLog_t TrigLogging;
54
 
721 holgerb 55
extern tlogfilestate_t LoggingTrigger(u32);
717 holgerb 56
u8 TRIG_LoggGPSCoordinates(TRIG_Document_t *);                          // intializes the kml-document with standard filename and adds points to the file
57
u8 TRIG_DocumentInit(TRIG_Document_t *);                                                // Init the new kml-document
58
u8 TRIG_DocumentOpen(s8 *, TRIG_Document_t *);                          // opens a new kml-document. a new file is created on the sd-memorycard
59
u8 TRIG_DocumentClose(TRIG_Document_t *doc);                                    // closes the specified document saving remaining data to the file.
60
u8 TRIG_PlaceMarkOpen(TRIG_Document_t *doc);                                    // opens a new placemark within the open kml-document
61
u8 TRIG_PlaceMarkClose(TRIG_Document_t *doc);                                   // closes the actual placemark
62
u8 TRIG_LineStringBegin(TRIG_Document_t *doc);                          // begins a new linestring within the actual placemark
63
u8 TRIG_LineStringEnd(TRIG_Document_t *doc);                                    // close the actual linestring within the actual placemark
64
u8 TRIG_LineStringAddPoint(TRIG_Document_t *);                          // adds a point from the gps (longitude, altitude, height) to the linestring
65
 
66
extern u16 Logged_TRIG_Counter;
67
extern u8  BlitzSchuhConnected;
68
 
69
extern void TriggerInput(void); // triggerinput on IO2 
70
#endif //_TRIG_H