Adding 8255 support, and adding functionality to amplc_pci230

Hello there,

I have a question that I'm sure can be answered very easily by someone,
and I'm after opinions about a sensible approach to adding extra
functionality to a driver that's already been written by someone else
(amplc_pci230).

(1) Simple question

First the simple question. I've checked the docs and code as far as I can,
but to be honest I'm really confused by all the configuration/compilation
options on a big project such as comedi.

I'd like to include support for the 8255 DIO subdevice on my amplicon
PCI230 board. This seems to already be included in the amplc_pci230 driver
code; however, because "CONFIG_COMEDI_8255" or "CONFIG_COMEDI_8255_MODULE"
is not defined, a dummy "this isn't configured" function is used instead.

Where do I define the CONFIG_COMEDI_8255 flag? Is this within the
amplc_pci230 driver, or within the compiler configuration?
comedi-0.7.67/Documentation/Configure.help gives lots of useful help about
which flags need to be defined to include which bits of code, but where do
you add these flags? I presume the 8255.o module must be insmod'ed too...
or if CONFIG_COMEDI_8255 is set does modprobe magically know it's needed
when you insmod amplc_pci230.o? I'm sorry if that all seems like a set of
really dumb questions.


(2) Opinions sought

We have an Amplicon PCI230 data acquisition card, and our analogue data
acquisition requirements include the ability to take data from a list of
analogue channels in what I've previously been calling "triggered burst
mode." This is when an external event (a digital line going from low to
high) triggers the acquisition of a set list of channels, as fast as the
board can acquire them. Once all channels in the list are done, the board
waits for the next external trigger event.

The comedi command structure seems to allow this using:
start_src		TRIG_NOW
scan_begin_src		TRIG_EXT
convert_src		TRIG_TIMER
scan_end_src		TRIG_COUNT
stop_src		TRIG_COUNT

However, only TRIG_FOLLOW is "allowed" for scan_begin_src in
amplc_pci230.c

I plan to add scan_begin_src=TRIG_EXT functionality in one of 2 ways:

(1) use one of the 8255 port C lines as the GATE input to the 8254
counter/timer that's providing the convert clock pulses. This will require
an external pulse of the correct length (at least as long as the time
required to sample all the channels on the channel list) and some
mechanism for ensuring that the next scan doesn't begin before the next
external gate pulse is applied.

(2) using the EXT CLOCK input line to trigger one of the 8254
counter/timers to produce a pulse of the correct length, which is then
applied to the GATE input of the counter/timer that's providing the
convert clock pulses.

The second method seems more rugged... what to people think? Is this the
right way to go about doing this? Has anyone got any advice? Is this how
it's done in other drivers, or am I missing a trick?

Any help much appreciated!

Cheers!

   Steve Sharples.

Received on 2004-04-02Z12:31:20