-
January 5th, 2004, 11:56 AM
#1
Win32 access to parallel port
Any sample code available for Win32 application to directly access parallel port? Need to use parallel port outputs as discrete lines, not strobe data. Thanks.
-
January 5th, 2004, 03:26 PM
#2
The file input and output (I/O) functions ('CreateFile()', 'CloseHandle()', 'ReadFile()', 'ReadFileEx()', 'WriteFile()' and 'WriteFileEx()') provide the basic interface for opening and closing a communications resource handle and for performing read and write operations. Depending of what you are trying to do take also a look at the following functions...
Code:
// Parallel Device Callback Routines
USHORT *DetermineIeeeModes(IN PDEVICE_EXTENSION Extension)
NTSTATUS *IeeeFwdToRevMode(IN PDEVICE_EXTENSION Extension)
NTSTATUS *IeeeRevToFwdMode(IN PDEVICE_EXTENSION Extension)
NTSTATUS *NegotiateIeeeMode(IN PDEVICE_EXTENSION Extension,
IN USHORT ModeMaskFwd,
IN USHORT ModeMaskRev,
IN PARALLEL_SAFETY ModeSafety,
IN BOOLEAN IsForward)
NTSTATUS *ParallelRead(IN PDEVICE_EXTENSION Extension,
IN PVOID Buffer,
IN ULONG NumBytesToRead,
OUT PULONG NumBytesRead,
IN UCHAR Channel)
NTSTATUS *ParallelWrite(IN PDEVICE_EXTENSION Extension,
OUT PVOID Buffer,
IN ULONG NumBytesToWrite,
OUT PULONG NumBytesWritten,
IN UCHAR Channel)
NTSTATUS *TerminateIeeeMode(IN PDEVICE_EXTENSION Extension)
// Parallel Port Callback Routines
NTSTATUS *ClearChipMode(IN PDEVICE_EXTENSION Extension, IN UCHAR ChipMode)
NTSTATUS *DeselectDevice(IN PVOID Context, IN PVOID DeselectCommand)
VOID *FreePort(IN PVOID Context)
VOID *FreePortFromInterruptLevel(IN PVOID Context)
ULONG *QueryNumWaiters(IN PVOID Extension)
BOOLEAN *TryAllocatePort(IN PVOID Context)
BOOLEAN *TryAllocatePortAtInterruptLevel(IN PVOID Context)
NTSTATUS *TrySelectDevice(IN PVOID Context, IN PVOID TrySelectCommand)
NTSTATUS *TrySetChipMode(IN PDEVICE_EXTENSION Extension, IN UCHAR ChipMode)
All functions are coming from the Windows DDK (Driver Development Kit). For further information look within the MSDN (http:// msdn.microsoft.com)...
-
January 5th, 2004, 07:48 PM
#3
I have a few links around the bottom of my Device Information page. You say "Win32 application" but the solution might depend somewhat on the version of Windows. However you can look at those other sites for answers to that also.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|