6052E interrupts triggered by a digital input line

Hi,
I am trying to trigger an interrupt with comedi, so that I can use an
RTAI irq handler.
The situation is as follows: I have a NI 6052E card, and I would like
to cause an interrupt on IRQ 11 (that of the PCI card) whenever I get
a rising edge on a digital input line (P0.1, for example).

I tried calling

  ret=comedi_register_callback(it,subd,COMEDI_CB_EOS,callback,NULL);

before sending a command with the TRIG_RT flag, and a TRIG_EXT with an
arg of 1 (for P0.1), but to no avail. For the time being, the actual
scanning is unimportant, I just want to cause an interrupt on IRQ11.

 cmd.subdev = subd;
 cmd.flags = TRIG_RT;

 cmd.start_src = TRIG_EXT;
 cmd.start_arg = 1;

 cmd.scan_begin_src = TRIG_TIMER;
 cmd.scan_begin_arg = 10;

 cmd.convert_src = TRIG_TIMER;
 cmd.convert_arg = 10;

 cmd.scan_end_src = TRIG_COUNT;
 cmd.scan_end_arg = 3;

 cmd.stop_src = TRIG_COUNT;
 cmd.stop_arg = 1;

Is there something fundamental that I am doing wrong? Is there a way
to solve my problem, or is there an altogether different way to do
what I want?


Also, what are the available flags for comedi_register_callback? In
all of the examples I found, only COMEDI_CB_EOS was used. Are there
any others?

Thank you,
Matthieu Roussel

Received on 2007-02-20Z10:27:22