AnalogInInterface.hpp
Go to the documentation of this file.
00001 // $Id: AnalogInInterface.hpp,v 1.10 2003/08/20 08:16:55 kgadeyne Exp $
00002 /***************************************************************************
00003   tag: Peter Soetens  Thu Oct 10 16:16:56 CEST 2002  AnalogInInterface.hpp
00004 
00005                         AnalogInInterface.hpp -  description
00006                            -------------------
00007     begin                : Thu October 10 2002
00008     copyright            : (C) 2002 Peter Soetens
00009     email                : peter.soetens@mech.kuleuven.ac.be
00010 
00011  ***************************************************************************
00012  *   This library is free software; you can redistribute it and/or         *
00013  *   modify it under the terms of the GNU General Public                   *
00014  *   License as published by the Free Software Foundation;                 *
00015  *   version 2 of the License.                                             *
00016  *                                                                         *
00017  *   As a special exception, you may use this file as part of a free       *
00018  *   software library without restriction.  Specifically, if other files   *
00019  *   instantiate templates or use macros or inline functions from this     *
00020  *   file, or you compile this file and link it with other files to        *
00021  *   produce an executable, this file does not by itself cause the         *
00022  *   resulting executable to be covered by the GNU General Public          *
00023  *   License.  This exception does not however invalidate any other        *
00024  *   reasons why the executable file might be covered by the GNU General   *
00025  *   Public License.                                                       *
00026  *                                                                         *
00027  *   This library is distributed in the hope that it will be useful,       *
00028  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00029  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
00030  *   Lesser General Public License for more details.                       *
00031  *                                                                         *
00032  *   You should have received a copy of the GNU General Public             *
00033  *   License along with this library; if not, write to the Free Software   *
00034  *   Foundation, Inc., 59 Temple Place,                                    *
00035  *   Suite 330, Boston, MA  02111-1307  USA                                *
00036  *                                                                         *
00037  ***************************************************************************/
00038 /* Klaas Gadeyne, Mon August 11 2003
00039    - Added "channel" param to lowest(), highest(), resolution() calls (these
00040    are mostly configurable on a per channel basis.  If not, there's
00041    no problem
00042    - In comedi, this is also done for their "binary"-counterpoles.  I
00043    don't know if this is necessary
00044 
00045    Klaas Gadeyne, Wed August 20 2003
00046    - Added rangeSet() and arefSet() methods, that allready existed in
00047    the comedi implementations of these interfaces
00048 */
00049 
00050 #ifndef ANALOGININTERFACE_HPP
00051 #define ANALOGININTERFACE_HPP
00052 
00053 #include "NameServer.hpp"
00054 #include "NameServerRegistrator.hpp"
00055 #include "../../rtt-config.h"
00056 
00057 namespace RTT
00058 { namespace dev {
00059 
00068     class RTT_API AnalogInInterface
00069         : private NameServerRegistrator<AnalogInInterface*>
00070     {
00071     public:
00076         enum AnalogReference { Ground = 0, 
00077                                Common, 
00078                                Differential, 
00079                                Other 
00080         };
00081 
00085         AnalogInInterface( )
00086         {}
00087 
00092         AnalogInInterface( const std::string& name )
00093             : NameServerRegistrator<AnalogInInterface*>( nameserver, name, this )
00094         {}
00095 
00096         virtual ~AnalogInInterface()
00097         {}
00098 
00106         virtual void rangeSet(unsigned int chan,
00107                               unsigned int range) = 0;
00108 
00116             virtual void arefSet(unsigned int chan,
00117                              unsigned int aref) = 0;
00118 
00123         virtual int rawRead( unsigned int chan, int& value ) = 0;
00124 
00129         virtual int read( unsigned int chan, double& value ) = 0;
00130 
00134         virtual unsigned int rawRange() const = 0;
00135 
00140         virtual double lowest(unsigned int chan) const = 0;
00141 
00146         virtual double highest(unsigned int chan) const = 0;
00147 
00151         virtual double resolution(unsigned int chan) const = 0;
00152 
00156         virtual unsigned int nbOfChannels() const = 0;
00157 
00162         unsigned int binaryRange() const { return rawRange(); }
00163 
00168         int binaryLowest() const { return 0; }
00169 
00174         int binaryHighest() const { return rawRange(); }
00175 
00180         static NameServer<AnalogInInterface*> nameserver;
00181 
00182     private:
00183 
00184     };
00185 }};
00186 
00187 #endif


rtt
Author(s): RTT Developers
autogenerated on Sat Jun 8 2019 18:46:05