00001 #ifndef IP_FASTDAC_AOUTINTERFACE_HPP
00002 #define IP_FASTDAC_AOUTINTERFACE_HPP
00003
00004
00005 #include "drivers/LiAS_lxrt_user.h"
00006 #include <rtt/dev/AnalogOutInterface.hpp>
00007 #include <iostream>
00008
00009 class IP_FastDAC_AOutInterface : public RTT::AnalogOutInterface
00010 {
00011 public:
00012 IP_FastDAC_AOutInterface(const std::string& name);
00013 IP_FastDAC_AOutInterface();
00014 virtual ~IP_FastDAC_AOutInterface() {};
00015
00016 virtual void rangeSet(unsigned int chan, unsigned int range)
00017 {
00018 IP_FastDAC_set_gain_of_group( chan/2 + 1, range);
00019 }
00020
00021 virtual void arefSet(unsigned int chan, unsigned int aref) {};
00022
00023 virtual void write( unsigned int chan, unsigned int value )
00024 {
00025
00026 IP_FastDAC_write_to_channel (value, chan);
00027 }
00028
00029 virtual unsigned int binaryRange() const { return 8192; }
00030
00031 virtual unsigned int binaryLowest() const { return 0; }
00032
00033 virtual unsigned int binaryHighest() const { return 8191; }
00034
00035 virtual double lowest(unsigned int chan) const { return -10.0; }
00036
00037 virtual double highest(unsigned int chan) const { return 10.0; }
00038
00042 virtual double resolution(unsigned int chan) const { return 8192/20.0; }
00043
00044 virtual unsigned int nbOfChannels() const {return 8; }
00045 };
00046
00047
00048 #endif