DEFINITION MODULE Serial; (*$Implementation:=FALSE*)
(* 10-May-1992/cn *)

FROM SYSTEM IMPORT ADDRESS,BYTE,LONGSET;

FROM ExecD IMPORT
 nonstd,IOFlagSet,IOStdReq;

CONST
 serialName="serial.device";

 query=nonstd;
 break=nonstd+1;
 setParams=nonstd+2;

 active=IOFlagSet{4};
 abort=IOFlagSet{5};
 queued=IOFlagSet{6};
 bufrRead=IOFlagSet{7};

 defaultCtlChar=11130000H;

TYPE
 IOTArray=RECORD
  termArray0:LONGCARD;
  termArray1:LONGCARD;
 END;

TYPE
 SerFlags=(
  partyOn,partyOdd,sevenWire,queuedBrk
  ,radBoogie,shared,eofMode,xDisabled
 );
 SerFlagSet=SET OF SerFlags;

 ExtSerFlags=(
  mark,mSpOn,esf2,esf3,esf4,esf5,esf6,esf7,
  esf8,esf9,esf10,esf11,esf12,esf13,esf14,esf15,
  esf16
 );
 ExtSerFlagSet=SET OF ExtSerFlags;

 Status=(
  sta0,sta1,ringIndicator,dataSetReady,clearToSend,carrierDetect
  ,readyToSend,dataTerminalReady,overrun,wroteBreak,readBreak
  ,xOffWrite,xOffRead
 );
 StatusSet=SET OF Status;

CONST
 select=ringIndicator;

TYPE
 Error=(
  e0,devBusy,baudMismatch,invBaud,bufErr,invParam,lineErr,notOpen
  ,portReset,parityErr,initErr,timerErr,bufOverflow,nodsr,nocts
  ,detectedBreak
 );

 IOExtSer=RECORD
  ioSer:IOStdReq;
  ctlChar:LONGCARD;
  rBufLen:LONGCARD;
  extFlags:ExtSerFlagSet;
  baud:LONGCARD;
  brkTime:LONGCARD;
  termArray:IOTArray;
  readLen:SHORTCARD;
  writeLen:SHORTCARD;
  stopBits:SHORTCARD;
  serFlags:SerFlagSet;
  status:StatusSet;
 END;
 IOExtSerPtr=POINTER TO IOExtSer;

(*
 Synonyme mit einheitlicher Namesgebung
*)
 IOSerial=IOExtSer;
 IOSerialPtr=IOExtSerPtr;

END Serial.noimp
