/***************************************************************** ** parint.h - header file for parint device driver ****************************************************************** */ #ifndef _PARINT_H #define _PARINT_H // ioctl() cmd defines #define PARINT_IOCTL_GET_TIME (1001) // get time data #define PARINT_IOCTL_FLUSH_FIFO (1002) // waits for data. #define PARINT_IOCTL_PULSE (1003) // toggle output bit (test/debug function). #define PARINT_IOCTL_ONESHOT_CLEAR (1004) // clear one shot data. #define PARINT_IOCTL_ONESHOT_GET (1005) // retrieve one shot data. #define PARINT_IOCTL_FLUSH_ALL (1006) // FLUSE_FIFO and ONE_SHOT_CLEAR #define PARINT_IOCTL_READ_REGS (1007) // read register values. #define PARINT_IOCTL_WRITE_REG_DATA (1008) // write to the data register #define PARINT_IOCTL_T1 (1010) // debug/test function #define PARINT_IOCTL_T2 (1011) // debug/test function /*------------------------------------------------------------ ** parint_parms_t - a general structure used to pass arguments ** & return values to the ioctl() call. **------------------------------------------------------------ */ struct parint_parms_t { int ret; /* return code */ unsigned long l[4]; /* array of longs */ void * p[4]; /* pointers */ }; //----------------------------------------------------- // nice prototypes //---------------------------------------------------- int parint_get_time( int fd, unsigned int * i_cnt, int * num_ret, struct timeval * tv, int max_tv ); int parint_flush_fifo( int fd ); int parint_oneshot_clear( int fd ); int parint_oneshot_get( int fd, int * has_data, struct timeval * tv ); int parint_flush_all( int fd ); int parint_read_regs( int fd, unsigned char *data, unsigned char *status, unsigned char *cntl ); int parint_write_reg_data( int fd, unsigned char data ); int parint_pulse( int fd, struct timeval * tv); int parint_t1( int fd ); int parint_t2( int fd, unsigned char *uc ); #endif // _PARINT_H