Tezzeret  1
Tezzeret
GmCm221.hpp
1 #ifndef GM_CM221_HPP_
2 #define GM_CM221_HPP_
3 
4 /* RTOS Driver Header files */
5 #include <ti/drivers/UART.h>
6 #include <ti/drivers/GPIO.h>
7 #include <xdc/runtime/Timestamp.h>
8 
9 #include <magstructs.h>
10 
11 
12 #include <GmBufferedSensor.hpp>
13 
14 #ifndef GMMFAMDATA_HPP_
15 #include <GmMfamData.hpp>
16 #endif
17 
18 #include <GmRingBuffer.hpp>
19 #include "GmUartLineSensor.hpp"
20 
21 
22 
23 #define CM221_STRING_SIZE 100
24 
25 // ========== Master records for CM221 meta data ==============================
26 #define GM_CM221_RMC_RAW_DATA01 GM_DATA_DOMAIN_LOCATION | 0x01
27 #define GM_CM221_INDEXED_STRING_WITH_HEADER_01 GM_DATA_DOMAIN_LOCATION | 0x02
28 
29 #define CM221_UART_NO_ERROR 0
30 #define CM221_UART_ERROR_FAIL_INIT 1
31 #define CM221_UART_VOID_FIX 2
32 
33 namespace Geometrics
34 {
35  typedef char Cm221String[CM221_STRING_SIZE+2];
36 
37  PACKED_PRAGMA
38  class PACKED_SPEC IndexedCm221String
39  {
40  public:
41  uint64_t m_uiIndex; // offset 0
42  Cm221String m_gsData; // offset 8
43  };
44 
45  PACKED_PRAGMA
46  class PACKED_SPEC IndexedCm221StringWithHeader {
47  public:
48  DWORD m_dwRecordType; // offset 0
49  UInt32 m_uRecordSize; // offset 4
50  IndexedCm221String m_igsData; // offset 8
51  };
52 
53  PACKED_PRAGMA
54  class PACKED_SPEC GmTimestamped864MagRecord
55  {
56  public:
57  // Timestamp m_tsMagTimestamp;
58  IndexedCm221StringWithHeader m_ilswhIndexedMagData; // offset 0
59  };
60 
61  PACKED_PRAGMA
62  class PACKED_SPEC Gm864Record
63  {
64  public:
65  UInt32 m_ui32Seconds; // offset 0
66  UInt32 m_ui32HertzIndex; // offset 4
67  GmTimestamped864MagRecord m_t8mrMagData; // offset 8
68  };
69 
70  /********************************************************************************************/
115  class GmCm221 : public GmUartLineSensor
116  {
117  public:
118  GmCm221 (UInt8 iSubject,
120  int Initialize (int iBoardID);
121  virtual Void OnPreProcessUartString (char *pscString);
122  virtual int ConvertToCustomRecord (UInt8 *pscUartData,
123  UInt8 *pcCustomRecordBuffer);
124  int Parse860String (char *pc860SerialString,
125  struct _MagBody *pMagDatum);
126  virtual int WriteToStorage (UInt32 ui32Topic,
127  char *pData,
128  UInt32 iSize,
129  GmStorage *psStorage,
130  UInt32 ui32FormatId);
131  void SetSamplePeriod (unsigned int samplePeriodInMilliseconds);
132  int SetCycleTimeMilliseconds (int cycleTimeMilliseconds);
133  int RuntimeSetCycleTimeMilliseconds (int cycleTimeMilliseconds);
134  int GetCycleTimeMilliseconds ();
135  int WriteData (const char* pcData,
136  unsigned int iDataSize,
137  UInt32 ui32Topic);
138 
139 
140  int m_iCycleTimeMilliseconds;
141 
142  struct s_Indexed860MagBodyWithHeader m_i8mbwhMagRecord;
143 
144  protected:
145  int InitBaudRate ();
146  int AutoBaud (int *baudRateResult);
147  int SendCommand (const char *command);
148  int SendRuntimeCommand (const char *command);
149 
150  int m_iBoardId;
151  UART_Params *m_pUartParams;
152  };
153 }
154 
155 #endif
Definition: GmCm221.hpp:63
The sensor class for the traditional cesium mags used by the G-864.
Definition: GmCm221.hpp:116
virtual int WriteToStorage(UInt32 ui32Topic, char *pData, UInt32 iSize, GmStorage *psStorage, UInt32 ui32FormatId)
Definition: GmCm221.cpp:55
Definition: GmStorage.hpp:81
Definition: GmCm221.hpp:55
Definition: GmUartLineSensor.hpp:32
Definition: GmCm221.hpp:39
GmApp/GmLoggingApp.hpp>
Definition: Analogs.hpp:47
Definition: magstructs.h:38
Definition: magstructs.h:59