00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 #ifndef COMEDISUBDEVICEAIN_HPP
00035 #define COMEDISUBDEVICEAIN_HPP
00036
00037 #include "rtt/dev/AnalogInInterface.hpp"
00038 #include "ComediDevice.hpp"
00039
00040 namespace OCL
00041 {
00042
00046 class ComediSubDeviceAIn
00047 : public RTT::AnalogInInterface
00048 {
00049
00050 public:
00059 ComediSubDeviceAIn( ComediDevice* cd, const std::string& name, unsigned int subdevice=0);
00060
00061 ComediSubDeviceAIn( ComediDevice* cd, unsigned int subdevice=0 );
00062
00063 ~ComediSubDeviceAIn();
00064
00065 void init();
00066
00067 virtual void rangeSet(unsigned int chan, unsigned int range=0);
00068
00069 virtual void arefSet(unsigned int chan, unsigned int aref=AnalogInInterface::Ground);
00070
00071 virtual int rawRead( unsigned int chan, int& value );
00072
00073 virtual int read( unsigned int chan, double& value );
00074
00075 virtual unsigned int rawRange() const;
00076
00077 virtual double lowest(unsigned int chan) const;
00078
00079 virtual double highest(unsigned int chan) const;
00080
00081 virtual double resolution(unsigned int chan) const;
00082
00083 virtual unsigned int nbOfChannels() const;
00084
00085 protected:
00089 ComediDevice* myCard;
00090
00094 unsigned int _subDevice;
00095 unsigned int * _sd_range;
00096 unsigned int * _aref;
00097 unsigned int channels;
00098 mutable unsigned int rrange;
00099 double *max, *min;
00100 };
00101
00102 };
00103
00104 #endif