kernel structures are currently statically allocated, thus you
don't want this to be much more than you actually use.
*/
-#define COMEDI_NDEVICES 4
+#define COMEDI_NDEVICES 16
/* number of config options in the config structure */
#define COMEDI_NDEVCONFOPTS 32
#define GPCT_CONT_PULSE_OUT 0x0200
#define GPCT_SINGLE_PULSE_OUT 0x0400
-
/* instructions */
#define INSN_MASK_WRITE 0x8000000
#define COMEDI_SUBD_MEMORY 8 /* memory, EEPROM, DPRAM */
#define COMEDI_SUBD_CALIB 9 /* calibration DACs */
#define COMEDI_SUBD_PROC 10 /* processor, DSP */
+#define COMEDI_SUBD_SERIAL 11 /* serial IO */
/* configuration instructions */
-#define COMEDI_INPUT 0
-#define COMEDI_OUTPUT 1
-#define COMEDI_OPENDRAIN 2
-
-#define INSN_CONFIG_ANALOG_TRIG 0x10
-//#define INSN_CONFIG_WAVEFORM 0x11
-//#define INSN_CONFIG_TRIG 0x12
-//#define INSN_CONFIG_COUNTER 0x13
-#define INSN_CONFIG_ALT_SOURCE 0x14
-#define INSN_CONFIG_DIGITAL_TRIG 0x15
-#define INSN_CONFIG_BLOCK_SIZE 0x16
-#define INSN_CONFIG_TIMER_1 0x17
-#define INSN_CONFIG_FILTER 0x18
-#define INSN_CONFIG_CHANGE_NOTIFY 0x19
+enum configuration_ids
+{
+ INSN_CONFIG_DIO_INPUT = 0,
+ INSN_CONFIG_DIO_OUTPUT = 1,
+ INSN_CONFIG_DIO_OPENDRAIN = 2,
+ COMEDI_INPUT = INSN_CONFIG_DIO_INPUT,
+ COMEDI_OUTPUT = INSN_CONFIG_DIO_OUTPUT,
+ COMEDI_OPENDRAIN = INSN_CONFIG_DIO_OPENDRAIN,
+ INSN_CONFIG_ANALOG_TRIG = 16,
+// INSN_CONFIG_WAVEFORM = 17,
+// INSN_CONFIG_TRIG = 18,
+// INSN_CONFIG_COUNTER = 19,
+ INSN_CONFIG_ALT_SOURCE = 20,
+ INSN_CONFIG_DIGITAL_TRIG = 21,
+ INSN_CONFIG_BLOCK_SIZE = 22,
+ INSN_CONFIG_TIMER_1 = 23,
+ INSN_CONFIG_FILTER = 24,
+ INSN_CONFIG_CHANGE_NOTIFY = 25,
+
+ /*ALPHA*/
+ INSN_CONFIG_SERIAL_CLOCK = 26,
+ INSN_CONFIG_BIDIRECTIONAL_DATA = 27,
+ INSN_CONFIG_GPCT_SINGLE_PULSE_GENERATOR = 1001, // Use CTR as single pulsegenerator
+ INSN_CONFIG_GPCT_PULSE_TRAIN_GENERATOR = 1002, // Use CTR as pulsetraingenerator
+ INSN_CONFIG_GPCT_QUADRATURE_ENCODER = 1003, // Use the counter as encoder
+};
/* ioctls */
#define COMEDI_CB_ERROR 16 /* card error during acquisition */
#define COMEDI_CB_OVERFLOW 32 /* buffer overflow/underflow */
+/**********************************************************/
+/* everything after this line is ALPHA */
+/**********************************************************/
+
+/*
+ Added by Klaas Gadeyne after implementation of driver for comedi NI
+ 660x counter card.
+ Please see
+ <http://people.mech.kuleuven.ac.be/~kgadeyne/linux/> for more
+ information about their use
+*/
+
+#define GPCT_X1 0x01 // X1 encoding
+#define GPCT_X2 0x02 // X2 encoding
+#define GPCT_X4 0x04 // X3 encoding
+// When to take into account the indexpulse:
+#define GPCT_IndexPhaseHighHigh 0
+#define GPCT_IndexPhaseLowHigh 1
+#define GPCT_IndexPhaseLowLow 2
+#define GPCT_IndexPhaseHighLow 3
+// Reset when index pulse arrives?
+#define GPCT_RESET_COUNTER_ON_INDEX 1
#ifdef __cplusplus
}