[patch] NI DAQ-STC support for non-20MHz external timebase

The existing NI DAQ-STC comedi drivers allow the use of an external 
timebase through the use of the INSN_CONFIG_SET_RTSI_CLOCK_MODE "sub-op" 
of the INSN_CONFIG instruction, but the drivers still expect that 
timebase to be the same 20 MHz frequency as the internal timebase.  The 
attached patch removes this limitation and fixes a couple of minor 
problems while maintaining backwards compatibility with existing code.

Here's a more detailed summary...

1. Allows the external timebase period to be specified (in nanoseconds) 
in the data[2] field of the instruction when setting the clock mode to 
COMEDI_RTSI_CLOCK_MODE_SLAVE.

2. Changes the number of channels reported by the RTSI subdevice to be 7 
rather than 8.  The ni_rtsi_insn_config function errors out if the 
channel is greater than 6, which matches the STC documentation, so it 
seems appropriate to report only 7 channels for the rtsi subdevice 
instead of 8.

3. Added INSN_CONFIG_SET_RTSI_CLOCK_MODE to check_insn_config_length() 
so that warning messages are not logged when using that sub-op.

I've tested it with an NI PXI-6031E and a 10 MHz external timebase and 
it seems to work well.  I've also attached clkmode.c, a program that 
demonstrates how to use the new functionality.  clkmode.c could go into 
comedilib/demo.

I hope this patch can get added to CVS; please let me know if I can 
facilitate that in any way.

Thanks,
Dave

Received on 2006-07-11Z20:43:06