Re: Change of state interrupts

On Wednesday 10 October 2007 04:23, Robin Cornelius wrote:
> Hi everyone,
>
> I've just started using comedi and I am using a adlink pci7348 card
> (which is not supported) so i hacked up the PCI-7296 driver go get it
> working, which it does :-) (Infact no modification for basic DIO, just
> swap all "adl_pci7296" for "adl_pci7348" and its a go (infact this
> should also work perfectly with the adl_pci7396).

If the boards are essentially the same programming-wise, they should both 
be supported by the same driver, as opposed to adding a second nearly 
identical one.

> Anyway the 7348 supports a change of state (COS) interrupt. I have
> implemented the IQR handler but I am unsure what to do next. I have read
> the documentation other examples but I do not fully understand the
> (comedi) driver level concepts still. How should i handle the COS event.
> Ideally when this happens the event needs to trigger a call back ASAP to
> minimise latency. I see mention of callbacks but can't see exactly what
> I want. Can someone give me some pointers on the correct way to handle
> this and pass the event back through comedi. Should i be using the
> s->events->async stuff?

The way it's been done before is to add support for an input command, that 
generates a bogus sample every time the event occurs.

> One final problem is that I seem to be getting continuous interrupts
> from the card, I believe I am setting the interrupt masks correctly and
> I am ACKing the interrupt correctly but it fires of at a enormous rate.

PCI interrupts can be shared, could it be another device generating the 
interrupts?  You might also check if there is a second bit in a register 
somewhere you need to use to clear the interrupt, like in the pci chip.

-- 
Frank

Received on 2007-10-11Z00:31:02