00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef _COMBINED_DIGITAL_OUT_
00020 #define _COMBINED_DIGITAL_OUT_
00021
00022 #include <rtt/dev/DigitalOutput.hpp>
00023 #include <vector>
00024
00025 namespace RTT
00026 {
00027 enum combinetype {OR, AND};
00028
00029 class CombinedDigitalOutInterface: public DigitalOutInterface
00030 {
00031 private:
00032 std::vector<bool> _channels;
00033 RTT::DigitalOutput* _digitalout;
00034 enum combinetype _combine;
00035
00036 void refresh();
00037
00038
00039 public:
00040 CombinedDigitalOutInterface (const std::string& name, RTT::DigitalOutput* digitalout, unsigned int num_channels, combinetype type);
00041 virtual ~CombinedDigitalOutInterface();
00042
00043 virtual void switchOn( unsigned int n );
00044 virtual void switchOff( unsigned int n );
00045 virtual void setBit( unsigned int bit, bool value );
00046 virtual void setSequence(unsigned int start_bit, unsigned int stop_bit, unsigned int value);
00047 virtual bool checkBit(unsigned int n) const;
00048 virtual unsigned int checkSequence( unsigned int start_bit, unsigned int stop_bit ) const;
00049 virtual unsigned int nbOfOutputs() const;
00050 };
00051
00052 }
00053 #endif