diff --git a/src/Makefile.am b/src/Makefile.am index 73739a8f4..4d9186cf1 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -10,5 +10,5 @@ libhamlib_la_CFLAGS = -DIN_HAMLIB $(AM_CFLAGS) -DHAMLIB_MODULE_DIR=\"$(libdir)\" libhamlib_la_LIBADD = @LIBLTDL@ $(top_builddir)/lib/libmisc.la @MATH_LIBS@ noinst_HEADERS = event.h misc.h serial.h iofunc.h cal.h tones.h \ - rot_conf.h token.h idx_builtin.h register.h + rot_conf.h token.h idx_builtin.h register.h par_nt.h diff --git a/src/par_nt.h b/src/par_nt.h new file mode 100644 index 000000000..6fe5f8143 --- /dev/null +++ b/src/par_nt.h @@ -0,0 +1,55 @@ +/* NT Parport Access stuff - Matthew Duggan (2002) */ + +/* + * ParallelVdm Device (0x2C) is mostly undocumented, used by VDM for parallel + * port compatibility. + */ + +/* + * Different from CTL_CODE in DDK, limited to ParallelVdm but makes this + * code cleaner. + */ + +#ifndef _PAR_NT_H + +#define _PAR_NT_H + +#define NT_CTL_CODE( Function ) ( (0x2C<<16) | ((Function) << 2) ) + +/* IOCTL codes */ +#define NT_IOCTL_DATA NT_CTL_CODE(1) /* Write Only */ +#define NT_IOCTL_CONTROL NT_CTL_CODE(2) /* Read/Write */ +#define NT_IOCTL_STATUS NT_CTL_CODE(3) /* Read Only */ + + +/* + * Raw port access (PC-style port registers but within inversions) + * Functions returning int may fail. + */ + +/* The status pin functions operate in terms of these bits: */ +enum ieee1284_status_bits +{ + S1284_NFAULT = 0x08, + S1284_SELECT = 0x10, + S1284_PERROR = 0x20, + S1284_NACK = 0x40, + S1284_BUSY = 0x80, + /* To convert those values into PC-style register values, use this: */ + S1284_INVERTED = S1284_BUSY +}; + +/* The control pin functions operate in terms of these bits: */ +enum ieee1284_control_bits +{ + C1284_NSTROBE = 0x01, + C1284_NAUTOFD = 0x02, + C1284_NINIT = 0x04, + C1284_NSELECTIN = 0x08, + /* To convert those values into PC-style register values, use this: */ + C1284_INVERTED = (C1284_NSTROBE| + C1284_NAUTOFD| + C1284_NSELECTIN) +}; + +#endif /* _PAR_NT_H */