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 #ifndef COMEDISUBDEVICEAOUT_HPP
00032 #define COMEDISUBDEVICEAOUT_HPP
00033
00034 #include <rtt/dev/AnalogOutInterface.hpp>
00035 #include "ComediDevice.hpp"
00036
00037 namespace OCL
00038 {
00039
00043 class ComediSubDeviceAOut
00044 : public RTT::AnalogOutInterface
00045 {
00046
00047 public:
00055 ComediSubDeviceAOut( ComediDevice* cao, const std::string& name,
00056 unsigned int subdevice=1 );
00057
00058 ComediSubDeviceAOut( ComediDevice* cao, unsigned int subdevice=1 );
00059
00060 ~ComediSubDeviceAOut();
00061
00062 void init();
00063
00064 virtual void rangeSet(unsigned int chan, unsigned int range=0);
00065
00066 virtual void arefSet(unsigned int chan, unsigned int aref=AnalogOutInterface::Ground);
00067
00068 virtual int rawWrite( unsigned int chan, int value );
00069
00070 virtual int rawRead( unsigned int chan, int& value );
00071
00072 virtual unsigned int rawRange() const;
00073
00074 virtual int write( unsigned int chan, double value );
00075
00076 virtual int read( unsigned int chan, double& value );
00077
00078 virtual double lowest(unsigned int chan) const;
00079
00080 virtual double highest(unsigned int chan) const;
00081
00082 virtual double resolution(unsigned int chan) const;
00083
00084 virtual unsigned int nbOfChannels() const;
00085
00086 protected:
00090 ComediDevice* myCard;
00091
00095 unsigned int _subDevice;
00096 unsigned int * _sd_range;
00097 unsigned int * _aref;
00098 unsigned int channels;
00099 mutable unsigned int rrange;
00100 double *max, *min;
00101 };
00102
00103 };
00104
00105 #endif