Tezzeret  1
Tezzeret
/home/kddev/dev/TivaWorkspace/TezzeretApps/Analogs.hpp
1 /*
2  * Analogs.hpp
3  *
4  * Created on: Jun 3, 2016
5  * Author: Owner
6  */
7 
8 #ifndef ANALOGS_HPP_
9 #define ANALOGS_HPP_
10 
11 #include <stdint.h>
12 #include <stdbool.h>
13 
14 /* XDCtools Header files */
15 #include <xdc/std.h>
16 #include <xdc/cfg/global.h>
17 //#include <xdc/runtime/Error.h>
18 #include <xdc/runtime/System.h>
19 
20 /* Tivaware Header files */
21 //#include <inc/hw_ints.h>
22 #include <inc/hw_memmap.h>
23 //#include <inc/hw_types.h>
24 //#include <inc/hw_adc.h>
25 
26 #include <driverlib/adc.h>
27 #include <driverlib/interrupt.h>
28 #include <driverlib/gpio.h>
29 #include <driverlib/pin_map.h>
30 #include <driverlib/sysctl.h>
31 #include <GmSensor.hpp>
32 #include <GmBufferedSensor.hpp>
33 
34 #ifndef GMMFAMDATA_HPP_
35 #include <GmMfamData.hpp>
36 #endif
37 
38 // TODO RHC document the meanings of all these.
39 #define COUNT_ANALOG_BUFFERS 50
40 
41 // Error codes.
42 // As with all sensors, the base success code is
43 // GM_SENSOR_OK, defined in the base CSensor header.
44 #define GM_ANALOG_FAIL 1
45 
46 namespace Geometrics
47 {
49  {
50  public :
51  AnalogConverter ();
52  static int Initialize ();
53  int Start () { return 0; };
54  Bool HasData ();
55  static int ReadRecord (char* pcDestination,
56  int iSize);
57  int ResetBuffers ();
58  static void ReadDataInternal (int iWhichA2D);
59 
60  protected:
61  static int m_static_iCurrentBuffer,
62  m_static_iLastBufferRead,
63  m_static_iLastBufferWritten;
64  static IndexedAnalog32Quad m_static_bufferCircle[COUNT_ANALOG_BUFFERS];
65  static Uint16 m_static_count;
66  static bool m_static_boolInitialized;
67  static int m_static_iCountADCsGotten;
68 
69  static IndexedAnalog32Quad *getBuffer (int i);
70 
71  private:
72 
73  // This class is a singleton.
74  static AnalogConverter *m_static_acTheOneConverter;
75 
76  };
77 
78 } // End of namespace
79 
80 #endif
81 
82 
Definition: Analogs.hpp:49
The class from which event sources and sensors that post events to the application's main event queue...
Definition: GmBufferedSensor.hpp:18
GmApp/GmLoggingApp.hpp>
Definition: Analogs.hpp:47
Definition: GmMfamData.hpp:332