home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / cbm / os-include.lha / os-include / devices / parallel.h < prev    next >
C/C++ Source or Header  |  1993-10-15  |  4KB  |  103 lines

  1. #ifndef DEVICES_PARALLEL_H
  2. #define DEVICES_PARALLEL_H
  3. /*
  4. **    $VER: parallel.h 36.1 (10.5.90)
  5. **    Includes Release 40.15
  6. **
  7. **    parallel.device I/O request structure information
  8. **
  9. **    (C) Copyright 1985-1993 Commodore Amiga Inc.
  10. **        All rights reserved.
  11. */
  12.  
  13. #ifndef   EXEC_IO_H
  14. #include "exec/io.h"
  15. #endif     /* !EXEC_IO_H */
  16.  
  17.  struct  IOPArray {
  18.     ULONG PTermArray0;
  19.     ULONG PTermArray1;
  20. };
  21.  
  22. /******************************************************************/
  23. /* CAUTION !!  IF YOU ACCESS the parallel.device, you MUST (!!!!) use
  24.    an IOExtPar-sized structure or you may overlay innocent memory !! */
  25. /******************************************************************/
  26.  
  27.  struct   IOExtPar {
  28.     struct     IOStdReq IOPar;
  29.  
  30. /*     STRUCT    MsgNode
  31. *   0    APTR     Succ
  32. *   4    APTR     Pred
  33. *   8    UBYTE     Type
  34. *   9    UBYTE     Pri
  35. *   A    APTR     Name
  36. *   E    APTR     ReplyPort
  37. *  12    UWORD     MNLength
  38. *     STRUCT   IOExt
  39. *  14    APTR     io_Device
  40. *  18    APTR     io_Unit
  41. *  1C    UWORD     io_Command
  42. *  1E    UBYTE     io_Flags
  43. *  1F    UBYTE     io_Error
  44. *     STRUCT   IOStdExt
  45. *  20    ULONG     io_Actual
  46. *  24    ULONG     io_Length
  47. *  28    APTR     io_Data
  48. *  2C    ULONG     io_Offset
  49. *  30 */
  50.     ULONG    io_PExtFlags;     /* (not used) flag extension area */
  51.     UBYTE    io_Status;     /* status of parallel port and registers */
  52.     UBYTE    io_ParFlags;     /* see PARFLAGS bit definitions below */
  53.     struct    IOPArray io_PTermArray; /* termination character array */
  54. };
  55.  
  56. #define    PARB_SHARED    5       /* ParFlags non-exclusive access bit */
  57. #define    PARF_SHARED    (1<<5)       /*     "     non-exclusive access mask */
  58. #define PARB_SLOWMODE    4       /*     "     slow printer bit */
  59. #define PARF_SLOWMODE    (1<<4)       /*     "     slow printer mask */
  60. #define PARB_FASTMODE    3       /*     "     fast I/O mode selected bit */
  61. #define PARF_FASTMODE    (1<<3)       /*     "     fast I/O mode selected mask */
  62. #define PARB_RAD_BOOGIE    3       /*     "     for backward compatibility */
  63. #define PARF_RAD_BOOGIE    (1<<3)       /*     "     for backward compatibility */
  64.  
  65. #define PARB_ACKMODE    2       /*     "     ACK interrupt handshake bit */
  66. #define PARF_ACKMODE    (1<<2)       /*     "     ACK interrupt handshake mask */
  67.  
  68. #define PARB_EOFMODE    1       /*     "     EOF mode enabled bit */
  69. #define PARF_EOFMODE    (1<<1)       /*     "     EOF mode enabled mask */
  70.  
  71. #define IOPARB_QUEUED    6       /* IO_FLAGS rqst-queued bit */
  72. #define IOPARF_QUEUED    (1<<6)       /*     "     rqst-queued mask */
  73. #define    IOPARB_ABORT    5       /*     "     rqst-aborted bit */
  74. #define    IOPARF_ABORT    (1<<5)       /*     "     rqst-aborted mask */
  75. #define    IOPARB_ACTIVE    4       /*     "     rqst-qued-or-current bit */
  76. #define    IOPARF_ACTIVE    (1<<4)       /*     "     rqst-qued-or-current mask */
  77. #define    IOPTB_RWDIR    3       /* IO_STATUS read=0,write=1 bit */
  78. #define    IOPTF_RWDIR    (1<<3)       /*     "     read=0,write=1 mask */
  79. #define    IOPTB_PARSEL    2       /*     "     printer selected on the A1000 */
  80. #define    IOPTF_PARSEL    (1<<2)       /* printer selected & serial "Ring Indicator"
  81.                       on the A500 & A2000.  Be careful when
  82.                       making cables */
  83. #define    IOPTB_PAPEROUT 1       /*     "     paper out bit */
  84. #define    IOPTF_PAPEROUT (1<<1)       /*     "     paper out mask */
  85. #define    IOPTB_PARBUSY  0       /*     "     printer in busy toggle bit */
  86. #define    IOPTF_PARBUSY  (1<<0)       /*     "     printer in busy toggle mask */
  87. /* Note: previous versions of this include files had bits 0 and 2 swapped */
  88.  
  89. #define PARALLELNAME        "parallel.device"
  90.  
  91. #define PDCMD_QUERY        (CMD_NONSTD)
  92. #define PDCMD_SETPARAMS    (CMD_NONSTD+1)
  93.  
  94. #define ParErr_DevBusy            1
  95. #define ParErr_BufTooBig    2
  96. #define ParErr_InvParam    3
  97. #define ParErr_LineErr        4
  98. #define ParErr_NotOpen        5
  99. #define ParErr_PortReset    6
  100. #define ParErr_InitErr            7
  101.  
  102. #endif    /* DEVICES_PARALLEL_H */
  103.