Added dio_config and dio_bitfield2 to c++ binding.
authorFrank Mori Hess <fmhess@speakeasy.net>
Mon, 15 Oct 2007 19:37:50 +0000 (19:37 +0000)
committerFrank Mori Hess <fmhess@speakeasy.net>
Mon, 15 Oct 2007 19:37:50 +0000 (19:37 +0000)
c++/include/comedilib.hpp

index 0df1f950a581b278c3340f22eb4a75d10ab67fbb..17cf3e72c225a14491c9d2997dfb323d33ac3781 100644 (file)
@@ -258,6 +258,31 @@ namespace comedi
                        }
                }
                device dev() const {return _device;}
+               void dio_bitfield2(unsigned write_mask, unsigned *bits, unsigned base_channel)
+               {
+                       int retval = comedi_dio_bitfield2(comedi_handle(), index(),
+                               write_mask, bits, base_channel);
+                       if(retval < 0)
+                       {
+                               std::ostringstream message;
+                               message << __PRETTY_FUNCTION__ << ": comedi_dio_bitfield2() failed.";
+                               std::cerr << message.str() << std::endl;
+                               comedi_perror("comedi_dio_bitfield2");
+                               throw std::runtime_error(message.str());
+                       }
+               }
+               void dio_config(unsigned channel, enum comedi_io_direction direction)
+               {
+                       int retval = comedi_dio_config(comedi_handle(), index(), channel, direction);
+                       if(retval < 0)
+                       {
+                               std::ostringstream message;
+                               message << __PRETTY_FUNCTION__ << ": comedi_dio_config() failed.";
+                               std::cerr << message.str() << std::endl;
+                               comedi_perror("comedi_dio_config");
+                               throw std::runtime_error(message.str());
+                       }
+               }
                unsigned flags() const
                {
                        int retval = comedi_get_subdevice_flags(comedi_handle(), index());