- From: David Schleef <ds_at_schleef.org>
- Date: Wed, 18 Sep 2002 12:20:37 -0700
On Thu, Sep 19, 2002 at 01:19:47AM +0800, Edwin wrote: > Hi all: > > I am developing driver for a DI/DO pci card, which could > enable/disable interrupt of specific DI channel by reading/writing > specific registers. > > For example, it has 32 DI channels, write base+0cH with 0x01 to > disable interrupt of channel 0-15, and 0x02 to disable channel 16-31. > > I feel confused to implement this feature, how can I implement > it with comedi? The comedi_parport driver does something similar. It implements a separate subdevice that allows you to run a simple command that will put a sample in the buffer each time that a parallel port interrupt occurs. The sample is always 0, since the hardware doesn't latch data properly to use real data. Basically, the driver pretends that there's subdevice that reads a fake signal that is always 0. The fake "latching" or "A/D conversion" is triggered by an external digital line, which in the Comedi API is indicated by cmd->scan_begin_src=TRIG_EXT and cmd->scan_begin_arg=0. (In the more general case, convert_src would indicate the trigger source for a conversion, but in this case, sample==scan.) In your case, you'll probably allow _arg to be either 0 or 1, depending on which bank/channel causes the interrupt. (This is all assuming that it is 2 individual digital lines, e.g., line 0 and 8, that cause the interrupt.) It's a hack, but it works. dave...
Received on 2002-09-18Z18:20:37