Tezzeret  1
Tezzeret
GmPpsEvent.hpp
1 #ifndef GM_TIVA_PPS_SENSOR_HPP_
2 #define GM_TIVA_PPS_SENSOR_HPP_
3 
4 #include "GmBufferedSensor.hpp"
5 #include <GmRingBuffer.hpp>
6 #include <GmManagedRingBuffer.hpp>
7 #include <GmChildRingBuffer.hpp>
8 
9 #ifndef GMMFAMDATA_HPP_
10 #include <GmMfamData.hpp>
11 #endif
12 
13 
14 #define COUNT_PPS_BUFFERS 10
15 
16 // Error codes.
17 // As with all sensors, the base success code is
18 // GM_SENSOR_OK, defined in the base CSensor header.
19 #define GM_PPS_FAILED_INIT 1
20 #define GM_PPS_FAILED 2
21 
22 typedef double (*GM_PPS_CallbackFxn)(unsigned int index);
23 
24 namespace Geometrics
25 {
26 
27  typedef struct _IndexedPps
28  {
29  DWORD m_dwRecordType; // Offset 0, size 4, value = GM_EVENT_PPS_BINARY_01
30  UInt32 m_uRecordSize; // Offset 4, size 4
31  uint64_t m_uiIndex; // Offset 8, size 8
32  double m_dTime; // Offset 16, size 8 Total Record size 24
34 
35  // accs is a define common to the embedded system that includes the sensor, not just the data.
36  // #ifdef accs
38  {
39  public:
40  GmPpsEventSensor (UInt8 iSubjectId,
42  int Initialize (int iBoardPPSPinEnum, ti_sysbios_knl_Swi_Handle iPpsId);
43  void ReadDataInternal ();
44  void SetPpsCallback (GM_PPS_CallbackFxn callback);
45 
46  protected:
47  static GM_PPS_CallbackFxn m_static_callBack;
48 
49  public:
50 
53  static void InitializingPpsCallback (unsigned int index);
54  static int sPPSPinEnum;
55 
56  // Callback function for PS Interrupt
57  static void PpsCallbackInternal (unsigned int index);
58 
59  virtual int WriteToStorage (UInt32 ui32Topic,
60  char *pData,
61  UInt32 iSize,
62  GmStorage *psStorage,
63  UInt32 ui32FormatId);
64 
65 
66 
67 
68  // This class is used as a singleton.
69  static GmPpsEventSensor *m_static_ppsTheOneSensor;
70  static ti_sysbios_knl_Swi_Handle m_iPpsId;
71  uint64_t m_uiLastCounter;
72  double m_dSeconds;
73  };
74  // #endif
75 
76 }
77 
78 #endif
The class from which event sources and sensors that post events to the application's main event queue...
Definition: GmBufferedSensor.hpp:18
Definition: GmPpsEvent.hpp:38
virtual int WriteToStorage(UInt32 ui32Topic, char *pData, UInt32 iSize, GmStorage *psStorage, UInt32 ui32FormatId)
Definition: GmPpsEvent.cpp:210
static void InitializingPpsCallback(unsigned int index)
Definition: GmPpsEvent.cpp:132
Definition: GmStorage.hpp:81
GmApp/GmLoggingApp.hpp>
Definition: Analogs.hpp:47
Definition: GmPpsEvent.hpp:28