From 95bea14e9e21493383258f4f00257529439d17d8 Mon Sep 17 00:00:00 2001 From: Frank Mori Hess Date: Mon, 15 Oct 2007 19:37:50 +0000 Subject: [PATCH] Added dio_config and dio_bitfield2 to c++ binding. --- c++/include/comedilib.hpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/c++/include/comedilib.hpp b/c++/include/comedilib.hpp index 0df1f95..17cf3e7 100644 --- a/c++/include/comedilib.hpp +++ b/c++/include/comedilib.hpp @@ -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()); -- 2.26.2