/*++

Copyright (c) 1990-2000 Microsoft Corporation, All Rights Reserved

Module Name:

    gpioctl.h

Abstract:

    Include file for Generic Port I/O Example Driver

--*/

#if     !defined(__GPIOCTL_H__)
#define __GPIOCTL_H__

//
// Define the IOCTL codes we will use.  The IOCTL code contains a command
// identifier, plus other information about the device, the type of access
// with which the file must have been opened, and the type of buffering.
//

//
// Device type           -- in the "User Defined" range."
//

#define GPD_TYPE 40000

// The IOCTL function codes from 0x800 to 0xFFF are for customer use.

#define IOCTL_GPD_READ_PORT_UCHAR \
    CTL_CODE( GPD_TYPE, 0x900, METHOD_BUFFERED, FILE_READ_ACCESS )

#define IOCTL_GPD_READ_PORT_USHORT \
    CTL_CODE( GPD_TYPE, 0x901, METHOD_BUFFERED, FILE_READ_ACCESS )

#define IOCTL_GPD_READ_PORT_ULONG \
    CTL_CODE( GPD_TYPE, 0x902, METHOD_BUFFERED, FILE_READ_ACCESS )

#define IOCTL_GPD_WRITE_PORT_UCHAR \
    CTL_CODE(GPD_TYPE,  0x910, METHOD_BUFFERED, FILE_WRITE_ACCESS)

#define IOCTL_GPD_WRITE_PORT_USHORT \
    CTL_CODE(GPD_TYPE,  0x911, METHOD_BUFFERED, FILE_WRITE_ACCESS)

#define IOCTL_GPD_WRITE_PORT_ULONG \
    CTL_CODE(GPD_TYPE,  0x912, METHOD_BUFFERED, FILE_WRITE_ACCESS)


//#define MOXA_DIO_PCI_IOCTL 0x920 //Add by Epson 2013-10-24-16
//
//#define IOCTL_SET_DOUT \
//    CTL_CODE( GPD_TYPE, MOXA_DIO_PCI_IOCTL, METHOD_BUFFERED, FILE_WRITE_ACCESS )
//
//#define IOCTL_SET_DOUT_ALL \
//    CTL_CODE( GPD_TYPE, MOXA_DIO_PCI_IOCTL + 1, METHOD_BUFFERED, FILE_WRITE_ACCESS )
//
//#define IOCTL_GET_DOUT \
//    CTL_CODE( GPD_TYPE, MOXA_DIO_PCI_IOCTL + 2, METHOD_BUFFERED, FILE_READ_ACCESS )
//    
//#define IOCTL_GET_DOUT_ALL \
//    CTL_CODE(GPD_TYPE,  MOXA_DIO_PCI_IOCTL + 3, METHOD_BUFFERED, FILE_READ_ACCESS )    
//
//#define IOCTL_GET_DIN \
//    CTL_CODE( GPD_TYPE, MOXA_DIO_PCI_IOCTL + 4, METHOD_BUFFERED, FILE_READ_ACCESS  )
//
//#define IOCTL_GET_DIN_ALL \
//    CTL_CODE(GPD_TYPE,  MOXA_DIO_PCI_IOCTL + 5, METHOD_BUFFERED, FILE_ANY_ACCESS )
//    
//#define IOCTL_SET_COUNTER_PCI \
//    CTL_CODE(GPD_TYPE,  MOXA_DIO_PCI_IOCTL + 6, METHOD_BUFFERED, FILE_ANY_ACCESS )
//    
//#define IOCTL_GET_COUNTER_PCI \
//    CTL_CODE(GPD_TYPE,  MOXA_DIO_PCI_IOCTL + 7, METHOD_BUFFERED, FILE_ANY_ACCESS )
//
//#define IOCTL_CLEAR_COUNTER_PCI \
//    CTL_CODE(GPD_TYPE,  MOXA_DIO_PCI_IOCTL + 7, METHOD_BUFFERED, FILE_ANY_ACCESS )


typedef struct  _GENPORT_WRITE_INPUT {
    ULONG   PortNumber;     // Port # to write to
    union   {               // Data to be output to port
        ULONG   LongData;
        USHORT  ShortData;
        UCHAR   CharData;
        #pragma warning(suppress:4201)
    };
}   GENPORT_WRITE_INPUT;

#endif

