00001 /*************************************************************************** 00002 tag: Peter Soetens Mon Jan 19 14:11:20 CET 2004 ComediSubDeviceDIn.hpp 00003 00004 ComediSubDeviceDIn.hpp - description 00005 ------------------- 00006 begin : Mon January 19 2004 00007 copyright : (C) 2004 Peter Soetens 00008 email : peter.soetens@mech.kuleuven.ac.be 00009 00010 *************************************************************************** 00011 * This library is free software; you can redistribute it and/or * 00012 * modify it under the terms of the GNU Lesser General Public * 00013 * License as published by the Free Software Foundation; either * 00014 * version 2.1 of the License, or (at your option) any later version. * 00015 * * 00016 * This library is distributed in the hope that it will be useful, * 00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 00019 * Lesser General Public License for more details. * 00020 * * 00021 * You should have received a copy of the GNU Lesser General Public * 00022 * License along with this library; if not, write to the Free Software * 00023 * Foundation, Inc., 59 Temple Place, * 00024 * Suite 330, Boston, MA 02111-1307 USA * 00025 * * 00026 ***************************************************************************/ 00027 00028 // $Id: ComediSubDeviceDIn.hpp,v 1.6 2003/08/14 09:17:13 kgadeyne Exp $ 00029 #ifndef COMEDISUBDEVICEDIN_HPP 00030 #define COMEDISUBDEVICEDIN_HPP 00031 00032 #include <rtt/dev/DigitalInInterface.hpp> 00033 #include "ComediDevice.hpp" 00034 00035 namespace OCL 00036 { 00037 00046 class ComediSubDeviceDIn 00047 : public RTT::DigitalInInterface 00048 { 00049 00050 public: 00061 ComediSubDeviceDIn( ComediDevice* cd, const std::string& name, unsigned int subdevice, bool configure_all_bits = true ); 00062 00063 ComediSubDeviceDIn( ComediDevice* cd, unsigned int subdevice, bool configure_all_bits = true); 00064 00069 bool useBit( unsigned int bit ); 00070 00071 virtual bool isOn( unsigned int bit = 0) const; 00072 00073 virtual bool isOff( unsigned int bit = 0) const; 00074 00075 virtual bool readBit( unsigned int bit = 0) const; 00076 00077 virtual unsigned int nbOfInputs() const; 00078 00079 virtual unsigned int readSequence(unsigned int start_bit, unsigned int stop_bit) const; 00080 00081 protected: 00082 00083 void init(bool all_bits); 00084 00088 ComediDevice* myCard; 00089 00093 unsigned int _subDevice; 00094 00095 bool error; 00096 }; 00097 00098 }; 00099 00100 #endif