From f97908c06e3e6b5e9ba01240d253642b7c587428 Mon Sep 17 00:00:00 2001 From: Frank Mori Hess Date: Wed, 18 Feb 2004 00:14:30 +0000 Subject: [PATCH] sync with comedi --- include/comedi.h | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/include/comedi.h b/include/comedi.h index 52f4627..f344656 100644 --- a/include/comedi.h +++ b/include/comedi.h @@ -117,7 +117,7 @@ typedef unsigned short sampl_t; #define TRIG_DEGLITCH 0x0004 /* enable deglitching */ //#define TRIG_RT 0x0008 /* perform op in real time */ #define TRIG_CONFIG 0x0010 /* perform configuration, not triggering */ -//#define TRIG_WAKE_EOS 0x0020 /* wake up on end-of-scan events */ +#define TRIG_WAKE_EOS 0x0020 /* wake up on end-of-scan events */ //#define TRIG_WRITE 0x0040 /* write to bidirectional devices */ /* command flags */ @@ -126,7 +126,6 @@ typedef unsigned short sampl_t; #define CMDF_PRIORITY 0x00000008 /* try to use a real-time interrupt while performing command */ #define TRIG_RT CMDF_PRIORITY /* compatibility definition */ -#define TRIG_WAKE_EOS 0x00000020 /* legacy definition for COMEDI_EV_SCAN_END */ #define CMDF_WRITE 0x00000040 #define TRIG_WRITE CMDF_WRITE /* compatibility definition */ @@ -234,6 +233,8 @@ enum configuration_ids 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 + INSN_CONFIG_8254_SET_MODE = 4097, + INSN_CONFIG_8254_READ_STATUS = 4098 }; /* ioctls */ @@ -447,6 +448,36 @@ struct comedi_bufinfo_struct{ // Reset when index pulse arrives? #define GPCT_RESET_COUNTER_ON_INDEX 1 +/* + 8254 specific configuration. + + It supports two config commands: + + 0 ID: INSN_CONFIG_8254_SET_MODE + 1 8254 Mode + I8254_MODE0, I8254_MODE1, ..., I8254_MODE5 + OR'ed with: + I8254_BCD, I8254_BINARY + + 0 ID: INSN_CONFIG_8254_READ_STATUS + 1 <-- Status byte returned here. + B7=Output + B6=NULL Count + B5-B0 Current mode. + +*/ + +enum i8254_mode +{ + I8254_MODE0 = (0<<1), /* Interrupt on terminal count */ + I8254_MODE1 = (1<<1), /* Hardware retriggerable one-shot */ + I8254_MODE2 = (2<<1), /* Rate generator */ + I8254_MODE3 = (3<<1), /* Square wave mode */ + I8254_MODE4 = (4<<1), /* Software triggered strobe */ + I8254_MODE5 = (5<<1), /* Hardware triggered strobe (retriggerable) */ + I8254_BCD = 1, /* use binary-coded decimal instead of binary (pretty useless) */ + I8254_BINARY = 0 +}; #ifdef __cplusplus } #endif -- 2.26.2