AS_COMPILER_FLAG([-Wno-unused-function],[PYTHON_QUIET="$PYTHON_QUIET -Wno-unused-function"], true )
AC_SUBST(PYTHON_QUIET)
-AC_ARG_ENABLE([ruby-binding],[ --disable-ruby-binding Disable building of Ruby binding],
- [ENABLE_RUBY=$enableval],[ENABLE_RUBY="yes"])
+AC_ARG_ENABLE([ruby-binding], [ --disable-ruby-binding Disable building of Ruby binding],
+ [ENABLE_RUBY=$enableval], [ENABLE_RUBY="yes"])
AC_PATH_PROG(RUBY, ruby, no)
if test "$RUBY" != "no" ; then
RUBY_INC_DIR=`$RUBY -e "require 'rbconfig'; c = ::Config::CONFIG; print c[['archdir']];"`
fi
AC_SUBST(RUBY_CONFIG_OPTIONS)
+AC_ARG_ENABLE([scxi], [ --enable-scxi Enable SCXI convenience library],
+ [ENABLE_SCXI=$enableval], [ENABLE_SCXI="no"])
+AM_CONDITIONAL(BUILD_SCXI, [test "$ENABLE_SCXI" == "yes"])
+
AC_PATH_PROG(DOCBOOK2MAN, docbook2man, no)
if test "$DOCBOOK2MAN" = "no" ; then
AC_MSG_WARN([docbook2man not found, will not be able to rebuild man pages])
include/Makefile
lib/Makefile
man/Makefile
+scxi/Makefile
swig/Makefile
swig/python/Makefile
swig/ruby/Makefile
--- /dev/null
+#include <comedilib.h>
+
+#define SLOT0_INTERVAL 1200
+#define FAST_INTERVAL 1200
+#define MEDIUM_INTERVAL 10000
+#define SLOW_INTERVAL 30000
+
+#define SCXI_LINE_MOSI 0
+#define SCXI_LINE_DA 1
+#define SCXI_LINE_SS 2
+#define SCXI_LINE_MISO 4
+
+#define SCXI_DIO_NONE 0
+#define SCXI_DIO_DO 1
+#define SCXI_DIO_DI 2
+
+#define SCXI_AIO_NONE 0
+#define SCXI_AIO_AO 1
+#define SCXI_AIO_AI 2
+
+struct scxi_board_struct {
+ unsigned int device_id;
+ char name[12];
+ int modclass;
+ unsigned int clock_interval;
+ int dio_type, aio_type, channels, status_reg, data_reg;
+ int config_reg, eeprom_reg, gain_reg;
+};
+
+typedef struct scxi_board_struct scxi_board_t;
+
+const scxi_board_t scxi_boards[] = {
+ { 0, "unknown\0", 2, SLOW_INTERVAL, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 0xffffffff, "empty\0", 2, SLOW_INTERVAL, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 0x06, "SCXI-1100\0", 1, FAST_INTERVAL, SCXI_DIO_NONE, SCXI_AIO_AI, 32,
+ 0x00, 0x00, 0x00, 0x00, 0x00 },
+ { 0x1e, "SCXI-1102\0", 2, FAST_INTERVAL, SCXI_DIO_NONE, SCXI_AIO_AI, 32,
+ 0x02, 0x05, 0x01, 0x03, 0x04 },
+ //{ 0x14, "SCXI-1124\0", 2, SLOW_INTERVAL, SCXI_DIO_NONE, SCXI_AIO_AO, 6,
+ // 0x02, 0x08, 0x00, 0x03, 0x00 },
+};
+
+#define n_scxi_boards ((sizeof(scxi_boards)/sizeof(scxi_boards[0])))
+
+struct scxi_module_struct {
+ comedi_t *dev;
+ unsigned int board;
+ unsigned int dio_subdev, ser_subdev;
+ unsigned int chassis, slot;
+};
+
+typedef struct scxi_module_struct scxi_mod_t;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int comedi_scxi_serial_readwrite(comedi_t *it, unsigned char out_bits, unsigned char *in_bits);
+int comedi_scxi_serial_config(comedi_t *it, unsigned int clock_interval);
+
+#ifdef __cplusplus
+}
+#endif
--- /dev/null
+#include "comedilib_scxi.h"
+
+int comedi_scxi_serial_config(comedi_t *it, unsigned int clock_interval)
+{
+ comedi_insn insn;
+ lsampl_t data[2];
+
+ memset(&insn,0,sizeof(insn));
+ insn.insn = INSN_CONFIG;
+ insn.n = 2;
+ insn.data = &data[0];
+ insn.subdev = comedi_find_subdevice_by_type(it, COMEDI_SUBD_SERIAL, 0);
+ data[0]=INSN_CONFIG_SERIAL_CLOCK;
+ data[1]=clock_interval;
+
+ return comedi_do_insn(it,&insn);
+}
+
+int comedi_scxi_serial_readwrite(comedi_t *it, unsigned char out_bits, unsigned char *in_bits)
+{
+ int ret;
+ comedi_insn insn;
+ lsampl_t data[2];
+
+ memset(&insn,0,sizeof(insn));
+
+ insn.insn = INSN_CONFIG;
+ insn.n = 2;
+ insn.data = data;
+ insn.subdev = comedi_find_subdevice_by_type(it, COMEDI_SUBD_SERIAL, 0);
+
+ data[0]=INSN_CONFIG_BIDIRECTIONAL_DATA;
+ data[1]=out_bits;
+
+ ret = comedi_do_insn(it,&insn);
+
+ if(ret<0) return ret;
+
+ if(in_bits)
+ *in_bits = data[1];
+
+ return 0;
+}