/* $Id: dev_iopic.h,v 1.5 2006/05/25 12:28:50 stevelim Exp $*/

/* dev_iopic.h - Dearborn Group designed I/O board using a PIC processor    */

/* EVENT definitions (FT_EVENT frames)                              */



/* Device driver queue                                              */


/*               C A R D    C O M M A N D S             */


#define SET_PWM_FREQ_1      0x01
#define SET_PWM_VAL_1       0x02
#define SET_PWM_MODE_1      0x03
#define SET_DIGITAL_OUT     0x04
#define CLR_DIGITAL_OUT     0x05
#define TOG_DIGITAL_OUT     0x06
#define SET_PWM_FREQ_2      0x41
#define SET_PWM_VAL_2       0x42
#define SET_PWM_MODE_2      0x43
#define SET_CAP_TRIG_1      0x07
#define SET_CAP_PULSE_1     0x08
#define SET_CAP_MX_PER_1    0x09
#define SET_CAP_SCALE_1     0x0A
#define SET_CAP_TRIG_2      0x47
#define SET_CAP_PULSE_2     0x48
#define SET_CAP_MX_PER_2    0x49
#define SET_CAP_SCALE_2     0x4A
#define SET_PERIODIC_1      0x20
#define SET_PERIODIC_2      0x21
#define SET_PERIODIC_3      0x22
#define SET_PERIODIC_4      0x23

#define GET_CAP_VAL_1       0x81
#define GET_CAP_VAL_2       0xC1
#define GET_DIGITAL_IN      0x82
#define GET_DIGITAL_OUT     0x83
#define GET_ANALOG_IN1      0x90
#define GET_ANALOG_IN2      0x91
#define GET_ANALOG_IN3      0x92
#define GET_ANALOG_IN4      0x93
#define GET_ANALOG_IN5      0x94
#define GET_ANALOG_IN6      0x95
#define GET_ANALOG_IN7      0x96
#define GET_ANALOG_IN8      0x97


#define SET_GAIN_1          0xA0
#define SET_GAIN_2          0xA1
#define SET_GAIN_3          0xA2
#define SET_GAIN_4          0xA3
#define SET_GAIN_5          0xA4
#define SET_GAIN_6          0xA5
#define SET_GAIN_7          0xA6
#define SET_GAIN_8          0xA7


#define GET_INFO            0xFF

/* Command codes                                                            */



/* ID codes                                                                 */


/* IOCTL definitions - comments indicate data size */

#define GDGIOSETPWM1    0x11900001      /* 7 Frequency, initial value & mode*/
                                        /*   Mode is one byte               */
                                        /*     0 -> off                     */
                                        /*     1 -> PWM to output pin       */
                                        /*     2 -> PWM to variable voltage */
                                        /*     3 -> PWM to both of the above*/
#define GDGIOSETPWM2    0x11900002      /* 7 Frequency, initial value & mode*/
                                        /*   Mode is one byte               */
                                        /*     0 -> off                     */
                                        /*     1 -> PWM to output pin       */
                                        /*     2 -> PWM to variable voltage */
                                        /*     3 -> PWM to both of the above*/
#define GDGIOSETCAP1    0x11900003      /* 4 Rise/Fall edge trigger (0/1)   */
                                        /*   Pulses/revolution (1-255)      */
                                        /*   Max time in ms between pulses  */
#define GDGIOSETCAP2    0x11900004      /* 2 Rise/Fall edge trigger (0/1)   */
                                        /*   Pulses/revolution (1-255)      */
                                        /*   Max time in ms between pulses  */
#define GDGIOSETPER1    0x11900005      /* 4 - 15  Milliseconds (1-65,535)  */
                                        /*   number of GET card commands    */
                                        /*   1 to 12 GET card commands      */
#define GDGIOSETPER2    0x11900006      /* 4 - 15  Milliseconds (1-65,535)  */
                                        /*   number of GET card commands    */
                                        /*   1 to 12 GET card commands      */
#define GDGIOSETPER3    0x11900007      /* 4 - 15  Milliseconds (1-65,535)  */
                                        /*   number of GET card commands    */
                                        /*   1 to 12 GET card commands      */
#define GDGIOSETPER4    0x11900008      /* 4 - 15  Milliseconds (1-65,535)  */
                                        /*   number of GET card commands    */
                                        /*   1 to 12 GET card commands      */
#define GDGIOGETGAIN    0x11910009      /* 2  Analog channel number (0 - 7) */
                                        /*   Current gain value (1 - 20)    */
#define GDGIOSETGAIN    0x1191000A      /* 2  Analog channel number (0 - 7) */
                                        /*   Gain value (1, 2, 4, 5, 8, 10, */
                                        /*   16 or 20) to set.                     */
#define GDGIOGETSTATE   0x1191000B      /* 2  Analog channel number (0 - 7) */
                                        /*   State off/on 0/1               */
#define GDGIOSETSTATE   0x1191000C      /* 2  Analog channel number (0 - 7) */
                                        /*   State off/on 0/1               */

