parallel.pas 3.8 KB

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