1 { 2 This file is part of the Free Pascal run time library. 3 4 A file in Amiga system run time library. 5 Copyright (c) 1998 by Nils Sjoholm 6 member of the Amiga RTL development team. 7 8 See the file COPYING.FPC, included in this distribution, 9 for details about the copyright. 10 11 This program is distributed in the hope that it will be useful, 12 but WITHOUT ANY WARRANTY; without even the implied warranty of 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 15 **********************************************************************} 16 17 { 18 external declarations for Parallel Port Driver 19 } 20 21 unit parallel; 22 23 INTERFACE 24 25 uses exec; 26 27 28 Type 29 30 pIOPArray = ^tIOPArray; 31 tIOPArray = record 32 PTermArray0 : ULONG; 33 PTermArray1 : ULONG; 34 end; 35 36 37 {****************************************************************} 38 { CAUTION !! IF YOU ACCESS the parallel.device, you MUST (!!!!) use 39 an IOExtPar-sized structure or you may overlay innocent memory !! } 40 {****************************************************************} 41 42 pIOExtPar = ^tIOExtPar; 43 tIOExtPar = record 44 IOPar : tIOStdReq; 45 46 { STRUCT MsgNode 47 * 0 APTR Succ 48 * 4 APTR Pred 49 * 8 UBYTE Type 50 * 9 UBYTE Pri 51 * A APTR Name 52 * E APTR ReplyPort 53 * 12 UWORD MNLength 54 * STRUCT IOExt 55 * 14 APTR io_Device 56 * 18 APTR io_Unit 57 * 1C UWORD io_Command 58 * 1E UBYTE io_Flags 59 * 1F UBYTE io_Error 60 * STRUCT IOStdExt 61 * 20 ULONG io_Actual 62 * 24 ULONG io_Length 63 * 28 APTR io_Data 64 * 2C ULONG io_Offset 65 * 30 } 66 io_PExtFlags : ULONG; { (not used) flag extension area } 67 io_Status : Byte; { status of parallel port and registers } 68 io_ParFlags : Byte; { see PARFLAGS bit definitions below } 69 io_PTermArray : tIOPArray; { termination character array } 70 end; 71 72 Const 73 74 PARB_SHARED = 5; { ParFlags non-exclusive access bit } 75 PARF_SHARED = 32; { " non-exclusive access mask } 76 PARB_RAD_BOOGIE = 3; { " (not yet implemented) } 77 PARF_RAD_BOOGIE = 8; { " (not yet implemented) } 78 PARB_EOFMODE = 1; { " EOF mode enabled bit } 79 PARF_EOFMODE = 2; { " EOF mode enabled mask } 80 IOPARB_QUEUED = 6; { IO_FLAGS rqst-queued bit } 81 IOPARF_QUEUED = 64; { " rqst-queued mask } 82 IOPARB_ABORT = 5; { " rqst-aborted bit } 83 IOPARF_ABORT = 32; { " rqst-aborted mask } 84 IOPARB_ACTIVE = 4; { " rqst-qued-or-current bit } 85 IOPARF_ACTIVE = 16; { " rqst-qued-or-current mask } 86 IOPTB_RWDIR = 3; { IO_STATUS read=0,write=1 bit } 87 IOPTF_RWDIR = 8; { " read=0,write=1 mask } 88 IOPTB_PARSEL = 2; { " printer selected on the A1000 } 89 IOPTF_PARSEL = 4; { printer selected & serial "Ring Indicator" 90 on the A500 & A2000. Be careful when 91 making cables } 92 IOPTB_PAPEROUT = 1; { " paper out bit } 93 IOPTF_PAPEROUT = 2; { " paper out mask } 94 IOPTB_PARBUSY = 0; { " printer in busy toggle bit } 95 IOPTF_PARBUSY = 1; { " printer in busy toggle mask } 96 97 { Note: previous versions of this include files had bits 0 and 2 swapped } 98 99 PARALLELNAME : PChar = 'parallel.device'; 100 101 PDCMD_QUERY = CMD_NONSTD; 102 PDCMD_SETPARAMS = CMD_NONSTD + 1; 103 104 ParErr_DevBusy = 1; 105 ParErr_BufTooBig = 2; 106 ParErr_InvParam = 3; 107 ParErr_LineErr = 4; 108 ParErr_NotOpen = 5; 109 ParErr_PortReset = 6; 110 ParErr_InitErr = 7; 111 112 IMPLEMENTATION 113 114 end. 115