-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathIF_NMEA.h
86 lines (66 loc) · 1.9 KB
/
IF_NMEA.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/*
* IF_NMEA.h
*
* Created on: 30 dic. 2018
* Author: Sergio
*/
#ifndef IF_NMEA_H_
#define IF_NMEA_H_
#include "GPSport.h" // Serial NMEA IF Configuration in GPSPort.h not in Fenix.ino!
#ifdef SERIAL_IF_AVAILABLE
#include <Arduino.h>
#include "emcNMEA.h"
#include "HMIArq.h"
#ifndef NMEAGPS_INTERRUPT_PROCESSING
#error You must define NMEAGPS_INTERRUPT_PROCESSING in NMEAGPS_cfg.h!
#endif
//// C runtime variables
//// -------------------
//extern unsigned int __bss_end;
//extern unsigned int __heap_start;
//extern void *__brkval;
class IF_NMEA: public emcNMEA, public HMIArq {
public:
IF_NMEA(Autopilot* Pilot);
//HMIArq I/F implementation
void setup();
void refresh();
void startAllTX();
void stopAllTX();
//emcNMEA I/F implementation
float getDm() { return MyPilot->getDm();}
float getMagnetic(float value) {return MyPilot->ChangeRef(value, BearingMonitor::TRUEtoMAGNETIC);}
float getTrue(float value) {return MyPilot->ChangeRef(value, BearingMonitor::MAGNETICtoTRUE);}
int getRudder(){return MyPilot->getCurrentRudder();}
float getHeading() {return MyPilot->getCurrentHeading();}
void printPEMC_03(Stream * outStream);
void printPEMC_05(Stream * outStream);
void printPEMC_07(Stream * outStream);
void printPEMC_12(Stream * outStream);
void printPEMC_13(Stream * outStream);
void printAPB(Stream * outStream, s_APB APB);
private:
void refresh_INorder();
// /*!
// @function freeMemory
// @abstract Return available RAM memory
// @discussion This routine returns the ammount of RAM memory available after
// initialising the C runtime.
// @param
// @return Free RAM available.
// */
// static int freeMemory ( void )
// {
// int free_memory;
//
// if((int)__brkval == 0)
// free_memory = ((int)&free_memory) - ((int)&__bss_end);
// else
// free_memory = ((int)&free_memory) - ((int)__brkval);
//
// return free_memory;
// }
};
#endif
#endif
/* IF_NMEA_H_ */