/***************************************************************** ** parint.h - header file for parint device driver ****************************************************************** */ #ifndef _PARINT_H #define _PARINT_H // ioctl() cmd defines #define PARINT_IOCTL_GET_TIME 1 // get time data #define PARINT_IOCTL_FLUSH 2 // waits for data. #define PARINT_IOCTL_PULSE 3 // toggle output bit (test/debug function). #define PARINT_IOCTL_ONESHOT_CLEAR 4 // clear one shot data. #define PARINT_IOCTL_ONESHOT_GET 5 // retrieve one shot data. #define PARINT_IOCTL_T1 6 // debug/test function #define PARINT_IOCTL_T2 7 // 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( int fd ); int parint_oneshot_clear( int fd ); int parint_oneshot_get( int fd, int * has_data, struct timeval * tv ); int parint_pulse( int fd, struct timeval * tv); int parint_t1( int fd ); int parint_t2( int fd, unsigned char *uc ); #endif // _PARINT_H