home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / Misc / M2V11-1.LHA / modula / amiga / Parallel.def < prev    next >
Encoding:
Text File  |  1993-11-01  |  2.6 KB  |  73 lines

  1. DEFINITION FOR AMIGALIB MODULE Parallel ;
  2.  
  3. FROM SYSTEM IMPORT SHORTSET ;
  4. FROM Exec IMPORT IOStdReq , CMD_NONSTD ;
  5.  
  6. TYPE
  7.   IOPArrayPtr = POINTER TO IOPArray ;
  8.   IOExtParPtr = POINTER TO IOExtPar ;
  9.  
  10.   IOPArray = RECORD
  11.     PTermArray0 : LONGINT ;
  12.     PTermArray1 : LONGINT ;
  13.   END ;
  14.  
  15. (**********************************************************************)
  16. (*                                      *)
  17. (* CAUTION !!  IF YOU ACCESS the parallel.device, you MUST (!!!!) use *)
  18. (* an IOExtPar-sized structure or you may overlay innocent memory !!  *)
  19. (*                                      *)
  20. (**********************************************************************)
  21.  
  22.   IOExtPar = RECORD
  23.     IOPar      : IOStdReq  ;
  24.     io_PExtFlags  : LONGINT   ; (* (not used) flag extension area     *)
  25.     io_Status      : SHORTCARD ; (* status of parallel port and registers *)
  26.     io_ParFlags   : SHORTSET  ; (* see PARFLAGS bit definitions below    *)
  27.     io_PTermArray : IOPArray  ; (* termination character array         *)
  28.   END ;
  29.  
  30. CONST
  31.   PARB_SHARED        =  5  ;    (* ParFlags non-exclusive access bit    *)
  32.   PARF_SHARED        = {5} ;    (*     "     non-exclusive access mask    *)
  33.   PARB_RAD_BOOGIE    =  3  ;    (*     "     (not yet implemented)    *)
  34.   PARF_RAD_BOOGIE    = {3} ;    (*     "     (not yet implemented)    *)
  35.   PARB_EOFMODE        =  1  ;    (*     "     EOF mode enabled bit    *)
  36.   PARF_EOFMODE        = {1} ;    (*     "     EOF mode enabled mask    *)
  37.  
  38.   IOPARB_QUEUED        =  6  ;    (* IO_FLAGS rqst-queued bit        *)
  39.   IOPARF_QUEUED        = {6} ;    (*     "     rqst-queued mask        *)
  40.   IOPARB_ABORT        =  5  ;    (*     "     rqst-aborted bit        *)
  41.   IOPARF_ABORT        = {5} ;    (*     "     rqst-aborted mask        *)
  42.   IOPARB_ACTIVE        =  4  ;    (*     "     rqst-qued-or-current bit    *)
  43.   IOPARF_ACTIVE        = {4} ;    (*     "     rqst-qued-or-current mask    *)
  44.  
  45.   IOPTB_RWDIR        =  3  ;    (* IO_STATUS read=0,write=1 bit           *)
  46.   IOPTF_RWDIR        = {3} ;    (*     "     read=0,write=1 mask       *)
  47.   IOPTB_PARSEL        =  2  ;    (*     "     printer selected on the A1000 *)
  48.   IOPTF_PARSEL        = {2} ;    (* printer selected&serial "Ring Indicator"*)
  49.                 (*  on the A500 & A2000.  Be careful when  *)
  50.                 (* making cables               *)
  51.  
  52.   IOPTB_PAPEROUT    =  1  ;    (*     "     paper out bit           *)
  53.   IOPTF_PAPEROUT    = {1} ;    (*     "     paper out mask           *)
  54.   IOPTB_PARBUSY        =  0  ;    (*     "     printer in busy toggle bit    *)
  55.   IOPTF_PARBUSY        = {0} ;    (*     "     printer in busy toggle mask   *)
  56.  
  57.   (* Note: previous versions of this include files had bits 0 and 2 swapped *)
  58.  
  59.   PARALLELNAME    = "parallel.device" ;
  60.  
  61.   PDCMD_QUERY        = CMD_NONSTD ;
  62.   PDCMD_SETPARAMS    = CMD_NONSTD+1 ;
  63.  
  64.   ParErr_DevBusy    = 1 ;
  65.   ParErr_BufTooBig    = 2 ;
  66.   ParErr_InvParam    = 3 ;
  67.   ParErr_LineErr    = 4 ;
  68.   ParErr_NotOpen    = 5 ;
  69.   ParErr_PortReset    = 6 ;
  70.   ParErr_InitErr    = 7 ;
  71.  
  72. END Parallel.
  73.