• Main Page
  • Classes
  • Files
  • File List
  • File Members

sonar.h

Go to the documentation of this file.
00001 #ifndef _SONAR_H
00002 #define _SONAR_H
00003 #include "qegpioint.h"
00004 
00005 #define SONAR_USPI 150
00006 #define SONAR_BIAS 300
00007 
00015 class CSonar
00016 {
00017 public:
00029   CSonar(unsigned int inputPort, unsigned int outputPort);
00030   ~CSonar();
00031 
00041   int Fire(bool wait=false);
00042   
00046   int GetVal();
00047 
00055   int RegisterCallback(void (*callback)(unsigned int inputPort, int val));
00056   
00062   int UnregisterCallback();
00063 
00064 private:
00065   static void Callback(unsigned int io, struct timeval *ptv, void *userPointer);
00066 
00067   struct timeval m_tv0;
00068   void (*m_callback)(unsigned int outputPort, int val);
00069   unsigned int m_echoPort;
00070   unsigned int m_triggerPort;
00071   bool m_flag;
00072   bool m_valid;
00073   int m_val;
00074 
00075   CQEGpioInt *m_pgpio;
00076 };
00077 
00078 #endif

Generated on Mon Oct 3 2011 15:36:31 for libqwerk by  doxygen 1.7.1