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

qepower.h

Go to the documentation of this file.
00001 //
00002 // begin license header
00003 //  
00004 // This file is part of Terk and TerkOS.
00005 //
00006 // All Terk and TerkOS source code is provided under the terms of the 
00007 // GNU General Public License v2 (http://www.gnu.org/licenses/gpl-2.0.html).  
00008 // Those wishing to use Terk and TerkOS source code, software and/or
00009 // technologies under different licensing terms should contact us at 
00010 // [email protected]. Such licensing terms are available for
00011 // all portions of the Terk and TerkOS codebase presented here.
00012 //
00013 // end license header
00014 //
00015 
00016 #ifndef _QEPOWER_H
00017 #define _QEPOWER_H
00018 
00019 #include "9302hw.h"
00020 #include "qeanalog.h"
00021 #include "property.h"
00022 #include "singleton.h"
00023 
00024 #define QP_OBJECT                    2
00025 #define QP_PROP_HARDWARE_VERSION     PROP_ID(QP_OBJECT, 0)
00026 #define QP_PROP_BREAKER_STATE        PROP_ID(QP_OBJECT, 1)
00027 #define QP_PROP_MAIN_BATT_VOLTAGE    PROP_ID(QP_OBJECT, 2)
00028 #define QP_PROP_MAIN_BATT_STATE      PROP_ID(QP_OBJECT, 3)
00029 #define QP_PROP_BACKUP_BATT_VOLTAGE  PROP_ID(QP_OBJECT, 4)
00030 #define QP_PROP_BACKUP_BATT_STATE    PROP_ID(QP_OBJECT, 5)
00031 #define QP_PROP_MAIN_5V_VOLTAGE      PROP_ID(QP_OBJECT, 6)
00032 #define QP_PROP_IO_5V_VOLTAGE        PROP_ID(QP_OBJECT, 7)
00033 #define QP_PROP_IO_5V_STATE          PROP_ID(QP_OBJECT, 8)
00034 
00051 class CQEPower : public IProperty  
00052 {
00053 public:
00057   SINGLETON(CQEPower);
00058 
00063   void  PowerOff();
00064 
00069   virtual int GetProperty(int property, long *value);
00070 
00075   virtual int SetProperty(int property, long value);
00076 
00077 private:
00078   CQEPower();
00079   ~CQEPower();
00080 
00081   unsigned short GetBreakerState();
00082   unsigned int GetBattState();
00083 
00084   CQEAnalog *m_pAnalog;
00085   C9302Hardware *m_p9302hw;
00086   unsigned int m_version;
00087 };  
00088 
00089 
00090 #endif

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