From 4c25a3ccd021774bcf663aca3a5325d3e148f1a7 Mon Sep 17 00:00:00 2001 From: Frank Mori Hess Date: Fri, 8 Dec 2006 16:50:11 +0000 Subject: [PATCH] Added additional field to INSN_CONFIG_SET/GET_GATE_SRC, to support devices with multiple gate inputs (NI counters can have 2 gates). --- Documentation/comedi/insn_config | 10 ++++++++++ comedi/drivers/amplc_dio200.c | 8 ++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Documentation/comedi/insn_config b/Documentation/comedi/insn_config index d93fc6b9..e21bda1b 100644 --- a/Documentation/comedi/insn_config +++ b/Documentation/comedi/insn_config @@ -240,3 +240,13 @@ ID=INSN_CONFIG_GET_CLOCK_SRC: Ask which master clock is being used [1] - clock source [2] - clock period (nanoseconds) +ID=INSN_CONFIG_SET_GATE_SRC: Select gate source. + [0] - ID + [1] - index identifying which gate we are configuring (0 if there is only one gate) + [2] - gate source + +ID=INSN_CONFIG_GET_GATE_SRC: Query gate + chanspec - the gate whose source is being queried (if the subdevice has multiple gates) + [0] - ID + [1] - index identifying which gate we are querying (0 if there is only one gate) + [2] - gate source diff --git a/comedi/drivers/amplc_dio200.c b/comedi/drivers/amplc_dio200.c index a051d505..d5075bfc 100644 --- a/comedi/drivers/amplc_dio200.c +++ b/comedi/drivers/amplc_dio200.c @@ -113,7 +113,7 @@ instructions are supported: clock source in data[1]. INSN_CONFIG_SET_GATE_SRC. Sets the counter channel's gate source as - specified in data[1] (this is a hardware-specific value). Not + specified in data[2] (this is a hardware-specific value). Not supported on PC214E. For the other boards, valid gate sources are 0 to 7 as follows: @@ -130,7 +130,7 @@ instructions are supported: 7. Reserved. INSN_CONFIG_GET_GATE_SRC. Returns the counter channel's current gate - source in data[1]. + source in data[2]. Clock and gate interconnection notes: @@ -1081,13 +1081,13 @@ dio200_subdev_8254_config(comedi_device *dev, comedi_subdevice *s, data[1] = i8254_status(subpriv->iobase, chan); break; case INSN_CONFIG_SET_GATE_SRC: - ret = dio200_set_gate_src(subpriv, chan, data[1]); + ret = dio200_set_gate_src(subpriv, chan, data[2]); if (ret < 0) return -EINVAL; break; case INSN_CONFIG_GET_GATE_SRC: ret = dio200_get_gate_src(subpriv, chan); if (ret < 0) return -EINVAL; - data[1] = ret; + data[2] = ret; break; case INSN_CONFIG_SET_CLOCK_SRC: ret = dio200_set_clock_src(subpriv, chan, data[1]); -- 2.26.2