home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / library / windows / pclw10 / pcl4w.ref < prev    next >
Encoding:
Text File  |  1994-02-21  |  56.1 KB  |  1,431 lines

  1.  
  2.  
  3.                               Personal Communications Library
  4.  
  5.                                       For Windows
  6.  
  7.  
  8.                                          (PCL4W)
  9.  
  10.  
  11.  
  12.                                     REFERENCE MANUAL
  13.  
  14.  
  15.  
  16.  
  17.  
  18.                                       Version 1.01
  19.  
  20.                                       Feb 21, 1994
  21.  
  22.  
  23.  
  24.  
  25.                               This software is provided as-is.
  26.                        There are no warranties, expressed or implied.
  27.  
  28.  
  29.  
  30.  
  31.                                     Copyright (C) 1994
  32.                                     All rights reserved
  33.  
  34.  
  35.  
  36.                                   MarshallSoft Computing, Inc.
  37.                                   Post Office Box 4543
  38.                                   Huntsville AL 35815
  39.  
  40.                                    Voice 205-881-4630
  41.                                    FAX   205-881-4630
  42.                                    BBS   205-880-9748
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.              PCL4W Reference Manual                                            Page 1
  69.                                       T A B L E
  70.  
  71.                                          O F
  72.  
  73.                                     C O N T E N T S
  74.  
  75.  
  76.  
  77.  
  78.                 Chapter                                          Page
  79.  
  80.                 Table of Contents..................................2
  81.                 Introduction.......................................3
  82.                    SioBaud.........................................4
  83.                    SioBrkSig.......................................4
  84.                    SioCTS..........................................5
  85.                    SioDCD..........................................5
  86.                    SioDone.........................................6
  87.                    SioDSR..........................................6
  88.                    SioDTR..........................................7
  89.                    SioFIFO.........................................7
  90.                    SioFlow.........................................8
  91.                    SioGetc.........................................8
  92.                    SioInfo.........................................9
  93.                    SioIRQ..........................................9
  94.                    SioLine........................................10
  95.                    SioLoopBack....................................10
  96.                    SioModem.......................................11
  97.                    SioParms.......................................11
  98.                    SioPorts.......................................12
  99.                    SioPutc........................................12
  100.                    SioRead........................................13
  101.                    SioReset.......................................13
  102.                    SioRI..........................................14
  103.                    SioRTS.........................................14
  104.                    SioRxBuf.......................................15
  105.                    SioRxFlush.....................................15
  106.                    SioRxQue.......................................16
  107.                    SioTxBuf.......................................16
  108.                    SioTxFlush.....................................17
  109.                    SioTxQue.......................................17
  110.                    SioUART........................................18
  111.                    SioUnGetc......................................18
  112.                 Function Summary..................................19
  113.                 Error Code Summary................................20
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.              PCL4W Reference Manual                                            Page 2
  137.                                        Introduction
  138.  
  139.  
  140.  
  141.               This  manual  lists  all of the PCL4W functions in alphabetical order. Every
  142.               library function will return a value as follows:
  143.  
  144.               1.  Negative values for error conditions. See last page of this  manual  for
  145.                   a list of error values and their meanings.
  146.  
  147.               2.  Non-negative values when returning data (eg: SioLine).
  148.  
  149.               3.  Zero otherwise.
  150.  
  151.               When debugging an application, be sure  to  test  all  return  values.   Use
  152.               SioError() (see file SIOERROR.C) to print the associated text for errors.
  153.  
  154.               Example Code Segment
  155.  
  156.  
  157.               *****************************************************************
  158.               * int Code;                 /* MUST be 'int', not 'char' */     *
  159.               *                                                               *
  160.               * Code = SioFunction( );    /* any PCL4W function */            *
  161.               * if(Code<0)                                                    *
  162.               *   {/* error returned */                                       *
  163.               *    SioError(Code);        /* SioError prints error text */    *
  164.               *    SioDone(Port);         /* always call SioDone last */      *
  165.               *    exit(1);                                                   *
  166.               *   }                                                           *
  167.               * /* no errors */                                               *
  168.               * ...your application code...                                   *
  169.               *                                                               *
  170.               *****************************************************************
  171.  
  172.  
  173.               The  program  SIMPLE  is provided as a stright forward and simple example of
  174.               the use of the PCL4W librray -- at least as straight forward as any  Windows
  175.               programming can be.
  176.  
  177.               Also  look  at the TERM program, which is distributed separately from PCL4W.
  178.               Many PCL4W functions are used somewhere in TERM. Other example programs will
  179.               be provided. Look for them on our User Support BBS.
  180.  
  181.               Also note that there are two versions of the library. One  version  is  with
  182.               transmitter interrupts disabled and one with transmitter interrupts enabled.
  183.  
  184.               Refer to the User's Manual (PCL4W.USR) for additional information.
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.              PCL4W Reference Manual                                            Page 3
  205.               ****************************************************************************
  206.               *   SioBaud   *  Sets the baud rate of the selected port.                  *
  207.               ****************************************************************************
  208.  
  209.  
  210.                 Syntax    int SioBaud(Port,BaudCode)
  211.                           int Port;     /* Port selected (COM1 - COM4) */
  212.                           int BaudCode; /* Baud code */
  213.  
  214.                Remarks    The  SioBaud  function sets the baud rate without resetting  the
  215.                           port. It is used to change the baud rate after calling SioReset.
  216.  
  217.                            Code   Rate    Name             Code   Rate   Name
  218.                              0     300    Baud300            5    9600   Baud9600
  219.                              1     600    Baud600            6   19200   Baud19200
  220.                              2    1200    Baud1200           7   38400   Baud38400
  221.                              3    2400    Baud2400           8   57600   Baud57600
  222.                              4    4800    Baud4800           9  115200   Baud115200
  223.  
  224.  
  225.                Returns     -4 : No such port. Expect 0 to MaxPort.
  226.                           -11 : Bad baud rate code. See above code values.
  227.  
  228.               See Also    SioReset
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.               ****************************************************************************
  238.               *  SioBrkSig  *  Asserts, cancels, or detects BREAK signal.                *
  239.               ****************************************************************************
  240.  
  241.  
  242.                 Syntax    int SioBrkSig(Port,Cmd)
  243.                           int Port;      /* Port selected (COM1 thru COM4) */
  244.                           char Cmd;      /* ASSERT, CANCEL, or DETECT */
  245.  
  246.                Remarks    The SioBrkSig function controls the BREAK bit in the line status
  247.                           register. The legal commands are:
  248.  
  249.                           ASSERT_BREAK ('A') to assert BREAK
  250.                           CANCEL_BREAK ('C') to cancel BREAK
  251.                           DETECT_BREAK ('D') to detect BREAK
  252.  
  253.                           ASSERT_BREAK, CANCEL_BREAK,  and  DETECT_BREAK  are  defined  in
  254.                           PCL4W.H. See TERM.C for an example of the use of SioBrkSig.
  255.  
  256.                Returns    -2 : Port not enabled. Call SioReset first.
  257.                           -4 : No such port. Expect 0 to MaxPort.
  258.                           -6 : Illegal command. Expected 'A', 'C', or 'D'.
  259.                           >0 : BREAK signal detected (DETECT command only)
  260.  
  261.               See Also    SioBrkKey
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.              PCL4W Reference Manual                                            Page 4
  273.               ****************************************************************************
  274.               *   SioCTS    *  Reads the Clear to Send (CTS) modem status bit.           *
  275.               ****************************************************************************
  276.  
  277.                 Syntax    int SioCTS(Port)
  278.                           int Port;   /* Port selected (COM1 thru COM4) */
  279.  
  280.                Remarks    The SioCTS function is used to read  the  Clear  to  Send  (CTS)
  281.                           modem status bit.
  282.  
  283.                           The  CTS  line  is  used  by  some  error  correcting  modems to
  284.                           implement hardware flow control.  CTS is dropped by the modem to
  285.                           signal the computer not to send data  and is  raised  to  signal
  286.                           the computer to continue.
  287.  
  288.                           Refer to the User's Manual for a discussion of flow control.
  289.  
  290.                Returns    -2 : Port not enabled. Call SioReset first.
  291.                           -4 : No such port.  Expect 0 to MaxPort.
  292.                            0 : CTS is clear.
  293.                           >0 : CTS is set.
  294.  
  295.               See Also    SioFlow, SioDSR, SioRI, SioDCD, and SioModem.
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.               ****************************************************************************
  307.               *   SioDCD    *  Reads the Data Carrier Detect (DCD) modem staus bit.      *
  308.               ****************************************************************************
  309.  
  310.  
  311.                 Syntax    int SioDCD(Port)
  312.                           int Port;      /* Port selected (COM1 thru COM4) */
  313.  
  314.                Remarks    The  SioDCD  function is  used to read the Data Carrier Detect
  315.                           (DCD) modem status bit. Also see SioModem.
  316.  
  317.                Returns    -2 : Port not enabled. Call SioReset first.
  318.                           -4 : No such port.  Expect 0 to MaxPort.
  319.                            0 : DCD is clear.
  320.                           >0 : DCD is set.
  321.  
  322.               See Also    SioDSR, SioCTS, SioRI, and SioModem.
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338.  
  339.  
  340.              PCL4W Reference Manual                                            Page 5
  341.               ****************************************************************************
  342.               *   SioDone   *  Terminates further serial processing.                     *
  343.               ****************************************************************************
  344.  
  345.  
  346.                 Syntax    int SioDone(Port)
  347.                           int Port;     /* Port selected (COM1 thru COM4) */
  348.  
  349.                Remarks    The  SioDone  function  terminates  further  serial  processing.
  350.                           SioDone  MUST  be called before exiting your application so that
  351.                           interrupts can be restored to their original state.  Failure  to
  352.                           do  this  can crash the operating system.  If you forget to call
  353.                           SioDone before exiting, be sure to re-boot your  computer.   You
  354.                           can  call SioDone even if SioReset has not been called, so it is
  355.                           good  practice  to  always  call  SioDone  before  exiting  your
  356.                           application.
  357.  
  358.                           Also  note  that  SioDone  dereferences the transmit and receive
  359.                           buffers set up by SioRxQue and SioTxQue.
  360.  
  361.                Returns    -2 : Port not enabled. Call SioReset first.
  362.                           -4 : No such port. Expect 0 to MaxPort.
  363.  
  364.               See Also    SioReset.
  365.  
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.               ****************************************************************************
  376.               *    SioDSR   *  Reads the Data Set Ready (DSR) modem status bit.          *
  377.               ****************************************************************************
  378.  
  379.  
  380.                 Syntax    int SioDSR(Port)
  381.                           int Port;     /* Port selected (COM1 thru COM4) */
  382.  
  383.                Remarks    The SioDSR function is used to read the  Data  Set  Ready  (DSR)
  384.                           modem status bit.
  385.  
  386.                Returns    -2 : Port not enabled. Call SioReset first.
  387.                           -4 : No such port.  Expect 0 to MaxPort.
  388.                            0 : DSR is clear.
  389.                           >0 : DSR is set
  390.  
  391.               See Also    SioCTS, SioRI, SioDCD, and SioModem
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.  
  404.  
  405.  
  406.  
  407.  
  408.              PCL4W Reference Manual                                            Page 6
  409.               ****************************************************************************
  410.               *    SioDTR   *  Set, clear, or read Data Terminal Ready (DTR) status bit. *
  411.               ****************************************************************************
  412.  
  413.  
  414.                 Syntax    int SioDTR(Port,Cmd)
  415.                           int Port;     /* Port selected (COM1 thru COM4) */
  416.                           char Cmd;     /* DTR command (SET, CLEAR, or READ) */
  417.  
  418.                Remarks    The SioDTR function controls the Data Terminal Ready  (DTR)  bit
  419.                           in the modem control register.  Commands  (defined  in  PCL4W.H)
  420.                           are:
  421.  
  422.                           SET_LINE ('S')  to set DTR (ON)
  423.                           CLEAR_LINE ('C')  to clear DTR (OFF)
  424.                           READ_LINE ('R')  to read DTR
  425.  
  426.                Returns    -2 : Port not enabled. Call SioReset first.
  427.                           -4 : No such port. Expect 0 to MaxPort.
  428.                           -5 : Not one of 'S', 'C', or 'R'.
  429.                            0 : DTR is OFF (READ_LINE Command).
  430.                           >0 : DTR is ON (READ_LINE Command).
  431.  
  432.               See Also    SioRTS.
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.               ****************************************************************************
  440.               *   SioFIFO   *  Sets the FIFO trigger level (16550 UART only).              *
  441.               ****************************************************************************
  442.  
  443.  
  444.                 Syntax    int SioFIFO(Port,LevelCode)
  445.                           int Port;       /* Port selected (COM1 thru COM4) */
  446.                           int LevelCode;  /* FIFO level code (see below) */
  447.  
  448.                Remarks    The SioFIFO function  is  used to enable both transmit & receive
  449.                           FIFOs for 16550 UARTS, and to set the  trigger  level  at  which
  450.                           receive interrupts are generated.
  451.  
  452.                           For  example, if the FIFO level is set to 8, then the 16550 UART
  453.                           will not generate an interrupt until 8 bytes have been received.
  454.                           This reduces the  number  of  interrupts  generated  and  allows
  455.                           faster   processing   with   slower  machines  or  when  running
  456.                           simultaneous ports.
  457.  
  458.                           In order to take advantage of the TX FIFO, use the PCL4C library
  459.                           with TX interrupts enabled.
  460.  
  461.                           In order to test if your port is a 16550 UART, call SioFIFO with
  462.                           a LevelCode of other than FIFO_OFF. SioFIFO can  be  called  for
  463.                           the 8250 and 16450 UART without ill effect.
  464.  
  465.                           Code  PCL4W.H Name  Trigger Level
  466.                           -1      FIFO_OFF     Disable FIFO
  467.                            0      LEVEL_1      1 byte
  468.                            1      LEVEL_4      4 bytes
  469.                            2      LEVEL_8      8 bytes
  470.                            3      LEVEL_14     14 bytes
  471.  
  472.                Returns    -2 : Port not enabled. Call SioReset first.
  473.                           -4 : No such port.  Expect 0 to MaxPort.
  474.                           >0 : FIFO level set.
  475.  
  476.              PCL4W Reference Manual                                            Page 7
  477.                            0 : FIFO level not set (not 16550).
  478.  
  479.  
  480.  
  481.  
  482.  
  483.  
  484.  
  485.  
  486.  
  487.  
  488.  
  489.  
  490.  
  491.  
  492.  
  493.  
  494.  
  495.  
  496.  
  497.  
  498.  
  499.  
  500.  
  501.  
  502.  
  503.  
  504.  
  505.  
  506.  
  507.  
  508.  
  509.  
  510.  
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.  
  536.  
  537.  
  538.  
  539.  
  540.  
  541.  
  542.  
  543.  
  544.              PCL4W Reference Manual                                            Page 8
  545.               ****************************************************************************
  546.               *   SioFlow  *  Sets hardware (RTS/CTS) flow control.                      *
  547.               ****************************************************************************
  548.  
  549.  
  550.                 Syntax    int SioFlow(Port,Flag)
  551.                           int Port;       /* Port selected (COM1 thru COM4) */
  552.                           int Flag;       /* TRUE to enable flow control */
  553.  
  554.                Remarks    The SioFlow function is used to enable or disable hardware  flow
  555.                           control.  Hardware flow control uses RTS and CTS to control data
  556.                           flow  between  the  modem and the computer.  Refer to the User's
  557.                           Manual  for  a  discussion  of flow control.  To enable hardware
  558.                           flow control, call SioFlow with Flag=TRUE.
  559.  
  560.                           In order for hardware flow control to work correctly, your modem
  561.                           must also be configured to work with hardware flow control,  and
  562.                           your  computer  to  modem  cable  must  have  RTS  and CTS wired
  563.                           straight through. If you enable hardware flow  control,  do  not
  564.                           modify  the  RTS  line  (by  calling  SioRTS)  unless  you  know
  565.                           exactly what you are doing.
  566.  
  567.                           Flow control is disabled after resetting a port.  To  explicitly
  568.                           disable hardware flow control, call SioFlow with Flag=FALSE.
  569.  
  570.                Returns    -2 : Port not enabled. Call SioReset first.
  571.                           -4 : No such port.  Expect 0 to MaxPort.
  572.                           =0 : Flow control disabled.
  573.                           >0 : Flow control enabled.
  574.  
  575.               See Also    SioPutc
  576.  
  577.  
  578.  
  579.  
  580.  
  581.               ****************************************************************************
  582.               *   SioGetc  *  Reads the next character from the serial line.             *
  583.               ****************************************************************************
  584.  
  585.  
  586.                 Syntax    int SioGetc(Port)
  587.                           int Port;     /* COM1 to COM4 */
  588.  
  589.                Remarks    The SioGetc function reads a byte from the selected serial port.
  590.                           The function will return immediately if no serial byte is ready.
  591.  
  592.                Returns    -2 : Port not enabled. Call SioReset first.
  593.                           -4 : No such port. Expect 0 to MaxPort.
  594.                           -1 : If timed out.
  595.                           >0 : Character read.
  596.  
  597.               See Also    SioUnGetc and SioPutc.
  598.  
  599.  
  600.  
  601.  
  602.  
  603.  
  604.  
  605.  
  606.  
  607.  
  608.  
  609.  
  610.  
  611.  
  612.              PCL4W Reference Manual                                            Page 9
  613.               ****************************************************************************
  614.               *   SioInfo   *  Returns PCL4W library information.                        *
  615.               ****************************************************************************
  616.  
  617.  
  618.                 Syntax    int SioInfo(Cmd)
  619.                           char Cmd;   /* Command (VERSION or MODEL) */
  620.  
  621.                Remarks    The  SioInfo  function returns an integer code  corresponding to
  622.                           either the (1) library version number  or  (2)  whether  or  not
  623.                           transmitter interrupts are enabled.
  624.  
  625.  
  626.                Returns    Version ('V')
  627.  
  628.                           hex byte XY where version is denoted as X.Y
  629.  
  630.                           TX Interrupts ('I')
  631.  
  632.                           TRUE  if  transmitter  interrupts  are  enabled  in the library,
  633.                           otherwise FALSE.
  634.  
  635.  
  636.  
  637.  
  638.  
  639.  
  640.               ****************************************************************************
  641.               *    SioIRQ   *  Assigns an IRQ line to a port.                            *
  642.               ****************************************************************************
  643.  
  644.  
  645.                 Syntax    int SioIRQ(Port,IRQcode)
  646.                           int Port;     /* Port selected (COM1 thru COM4) */
  647.                           int IRQcode;  /* IRQ number [IRQ2..IRQ7] */
  648.  
  649.                Remarks    The SioIRQ function assigns an IRQ line to  a  port.   That  is,
  650.                           SioIRQ  maps  an  IRQ  to a port.  SioIRQ (like SioUART) must be
  651.                           called before calling SioReset. Unless you have  a  non-standard
  652.                           (COM1  &  COM3  use IRQ4 while COM2 & COM4 use IRQ3) serial port
  653.                           configuration  (or  don't  want  to  run  more  than   2   ports
  654.                           concurrently),  you  will not need to call SioIRQ.  Be EXTREMELY
  655.                           careful with SioIRQ as it can lock  your  machine  up  if  given
  656.                           incorrect information.
  657.  
  658.                           In  particular,  remember  that your port hardware must generate
  659.                           the interrupt that you have specified.  You should refer to your
  660.                           serial  board  hardware  manual  for  specfic  instructions   in
  661.                           configuring  your  hardware.  Be  sure to call SioPorts first to
  662.                           setup DigiBoard ports if you have  them.   Refer  to  the  PCL4W
  663.                           Users Manual for additional information.
  664.  
  665.  
  666.                Returns    -4 : No such port. Expect 0 to MaxPort.
  667.                          -15 : Port already enabled.  SioReset has already been called.
  668.                          -17 : No such IRQ.
  669.                          -18 : ISR limit (maximum of 4 PC IRQs) exceeded.
  670.                            0 : Otherwise
  671.  
  672.               See Also    SioUART and SioPorts.
  673.  
  674.  
  675.  
  676.  
  677.  
  678.  
  679.  
  680.              PCL4W Reference Manual                                            Page 10
  681.               ****************************************************************************
  682.               *   SioLine   *  Reads the line status register.                           *
  683.               ****************************************************************************
  684.  
  685.  
  686.                 Syntax    int SioLine(Port)
  687.                           int Port;     /* Port selected (COM1 thru COM4) */
  688.  
  689.                Remarks    The  SioLine  function  reads  the  line  status  register.  The
  690.                           individual bit masks are as follows:
  691.  
  692.                           0x40  = Transmitter empty.
  693.                           0x20  = Transmitter buffer empty.
  694.                           0x10  = Break detected.
  695.                           0x08  = Framming error.
  696.                           0x04  = Parity error.
  697.                           0x02  = Overrun error.
  698.                           0x01  = Data ready.
  699.  
  700.                           The above are documented in the file PCL4W.H.
  701.  
  702.                Returns    -2 : Port not enabled. Call SioReset first.
  703.                           -4 : No such port. Expect 0 to MaxPort.
  704.                           >0 : Line status (rightmost byte of word).
  705.  
  706.               See Also    SioModem.
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718.               ****************************************************************************
  719.               * SioLoopBack *  Does a UART loopback test.                                *
  720.               ****************************************************************************
  721.  
  722.  
  723.                 Syntax    int SioLoopBack(Port)
  724.                           int Port;     /* Port selected (COM1 thru COM4) */
  725.  
  726.                Remarks    SioLoopBack makes use of the built in loopback  test  capability
  727.                           of  the  INS8250  family  UART.  Normally SioLoopBack will never
  728.                           need to be called unless you suspect that your UART is bad. Many
  729.                           UARTs must be reset after running a loopback test.
  730.  
  731.                Returns      0 : Loopback test is successfull.
  732.                            -2 : Port not enabled. Call SioReset first.
  733.                            -4 : No such port.  Expect 0 to MaxPort.
  734.                           -12 : Loopback test fails.
  735.  
  736.  
  737.  
  738.  
  739.  
  740.  
  741.  
  742.  
  743.  
  744.  
  745.  
  746.  
  747.  
  748.              PCL4W Reference Manual                                            Page 11
  749.               ****************************************************************************
  750.               *   SioModem  *  Reads the modem status register.                          *
  751.               ****************************************************************************
  752.  
  753.  
  754.                 Syntax    int SioModem(Port, Mask)
  755.                           int Port;    /* Port selected (COM1 thru COM4) */
  756.                           char Mask;   /* Modem function mask */
  757.  
  758.                Remarks    The  SioModem  function  reads  the  modem  register.    The bit
  759.                           definitions for the function mask are as follows:
  760.  
  761.                           Bit Name  Function               Bit  Name      Function
  762.                            7  DCD   Data Carrier Detect     3   DeltaDCD  DCD has changed
  763.                            6  RI    Ring Indicator          2   DeltaRI   RI has changed
  764.                            5  DSR   Data Set Ready          1   DeltaDSR  DSR has changed
  765.                            4  CTS   Clear To Send           0   DeltaCTS  CTS has changed
  766.  
  767.                           Bits  4  through  7  represent  the  absolute  state  of   their
  768.                           respective  RS-232  inputs.  Bits 0 through 3 represent a change
  769.                           in the state of their respective RS-232 inputs since last read.
  770.  
  771.                Returns    -2 : Port not enabled. Call SioReset first.
  772.                           -4 : No such port. Expect 0 to MaxPort.
  773.                           >0 : Modem status (rightmost byte of word).
  774.  
  775.               See Also   SioCTS, SioDCD, SioDSR and SioRI.
  776.  
  777.  
  778.  
  779.               ****************************************************************************
  780.               *  SioParms   *  Sets parity, stop bits, and word length.                  *
  781.               ****************************************************************************
  782.  
  783.  
  784.                Syntax     int  SioParms(Port,ParityCode,StopBitsCode, WordLengthCode)
  785.                           int Port; /* Port selected (COM1 - COM4) */
  786.                           int ParityCode; /* parity code [0,1,2] */
  787.                           int StopBitsCode; /* stop bits code [0,1] */
  788.                           int WordLengthCode; /* word length code [0,1,2,3] */
  789.  
  790.                Remarks    The SioParms function sets  the  parity,  stop  bits,  and  word
  791.                           length.   If  the  default parity (none), stop bits (1), or word
  792.                           length (8) is not  acceptable,  then  they  can  be  changed  by
  793.                           calling SioParms.  SioParms can be called either before or after
  794.                           calling SioReset. See file PCL4W.H. (8 = default)
  795.  
  796.                                         Value   Description    PCL4W.H Name
  797.                           ParityCode:    *0      no parity      NoParity
  798.                                           1      odd parity     OddParity
  799.                                           3      even parity    EvenParity
  800.                           StopBitsCode:  *0      1 stop bit     OneStopBit
  801.                                           1      2 stop bits    TwoStopBits
  802.                           WordLengthCode: 0      5 data bits    WordLength5
  803.                                           1      6 data bits    WordLength6
  804.                                           2      7 data bits    WordLength7
  805.                                          *3      8 data bits    WordLength8
  806.  
  807.               Returns     -4 : No such port. Expect 0 to MaxPort.
  808.                           -7 : Bad parity code selected. Expecting  0 to 2.
  809.                           -8 : Bad stop bits code. Expecting  0 or 1.
  810.                           -9 : Bad word length code. Expecting  0 to 3.
  811.  
  812.              See Also    SioReset.
  813.  
  814.  
  815.  
  816.              PCL4W Reference Manual                                            Page 12
  817.               ****************************************************************************
  818.               *  SioPorts   *  Sets number of PC & Digiboard ports.                      *
  819.               ****************************************************************************
  820.  
  821.  
  822.                 Syntax    int SioPorts(NumberPorts,FirstPort,StatusReg)
  823.                           int NumberPorts;     /* total number of ports */
  824.                           int FirstPort;       /* First DigiBoard port */
  825.                           int StatusReg;       /* DigiBoard Status Register */
  826.  
  827.                Remarks    The SioPorts function must be called  before  ANY  other  serial
  828.                           functions.  The  purpose  of the SioPorts function is to set the
  829.                           total  number  of  ports,  the  first  DigiBoard  port  and  the
  830.                           DigiBoard status register address.
  831.  
  832.                           Once SioPorts is called, all COM ports starting with "FirstPort"
  833.                           will  be  treated  as  DigiBoard  ports.  The default setup is 4
  834.                           standard PC ports and no DigiBoard ports [ SioPorts(4,4,0) ].
  835.  
  836.                           The standard DigiBoard status register is 0x140 if you are using
  837.                           an odd IRQ for the DigiBoard, and 0x141 if you are using an even
  838.                           IRQ for the DigiBoard.  If  you  change  this  address  on  your
  839.                           DigiBoard, be sure to specify the correct value for "StatusReg".
  840.  
  841.                Returns    -4 : No such port. Expect 0 to 9.
  842.                           0 : No error (sets MaxPort to NumberPorts-1).
  843.  
  844.               See Also    SioUART, SioIRQ.
  845.  
  846.  
  847.  
  848.  
  849.  
  850.               ****************************************************************************
  851.               *   SioPutc   *  Transmit a character over a serial line.                  *
  852.               ****************************************************************************
  853.  
  854.  
  855.                 Syntax    int SioPutc(Port,c)
  856.                           int Port;     /* Port selected (COM1 thru COM4) */
  857.                           char c;       /* character to send */
  858.  
  859.                Remarks    The SioPutc function transmits one character  over the  selected
  860.                           serial line.
  861.  
  862.                           If  flow  control has been enabled, then SioPutc may return a -1
  863.                           (time out) if the  number  of  tics  specified  in  the  SioFlow
  864.                           function was exceeded waiting for the modem to raise CTS.
  865.  
  866.                           Refer to the User's Manual for a discussion of flow control.
  867.  
  868.                           If  transmitter  interrupts  are  enabled  (there  are  separate
  869.                           versions of the library  for  transmitter  interrupts  enabled),
  870.                           then  the  byte  is  placed  in  the  transmit  buffer, awaiting
  871.                           transmission by the PCL4W interrupt service routine.
  872.  
  873.                Returns    -2 : Port not enabled. Call SioReset first.
  874.                           -4 : No such port. Expect 0 to MaxPort.
  875.                           -1 : Timed out waiting for CTS (flow control enabled)
  876.  
  877.               See Also    SioGetc and SioFlow.
  878.  
  879.  
  880.  
  881.  
  882.  
  883.  
  884.              PCL4W Reference Manual                                            Page 13
  885.               ****************************************************************************
  886.               *   SioRead   *  Reads any UART register.                                  *
  887.               ****************************************************************************
  888.  
  889.  
  890.                 Syntax    int SioRead(Port,Reg)
  891.                           int Port;     /* Port selected (COM1 thru COM4) */
  892.                           int Reg;      /* UART register (0 to 7) */
  893.  
  894.                Remarks    The SioReset function directly reads the contents of any of  the
  895.                           7  UART  registers.   This  function  is  useful  when debugging
  896.                           application  programs  and  as  a  method  for  verifying   UART
  897.                           contents.   Refer  to the PCL4W Users Manual for a discussion of
  898.                           the 7 UART registers.
  899.  
  900.                           The line status register (register 5)  can  also  be  read  with
  901.                           SioLine while the modem status register (register 6) can also be
  902.                           read  with  SioModem.  Refer  to  the  PCL4W User's Manual for a
  903.                           discussion of the UART registers.
  904.  
  905.                Returns     -3 : No buffer available. Call SioRxBuf first.
  906.                            -4 : No such port. Expect 0 to MaxPort.
  907.  
  908.               See Also    SioLine and SioModem.
  909.  
  910.  
  911.  
  912.               ****************************************************************************
  913.               *  SioReset   *  Initialize a serial port for processing.                  *
  914.               ****************************************************************************
  915.  
  916.  
  917.                 Syntax    int SioReset(Port,BaudCode)
  918.                           int Port;     /* Port selected (COM1 thru COM4) */
  919.                           int BaudCode; /* baud code or -1 */
  920.  
  921.                Remarks    The SioReset function  initializes  the  selected  serial  port.
  922.                           SioReset should be called after calling SioParm and SioRxBuf but
  923.                           before  making  any  other  calls  to  PCL4W.  SioReset uses the
  924.                           parity, stop bits, and  word  length  value  previously  set  if
  925.                           SioParm  was  called, otherwise the default values (see SioParm)
  926.                           are used.
  927.  
  928.                           Recall that COM1 and COM3 share the same  interrupt  vector  and
  929.                           therefore  cannot  operate  simultaneously. Similiarly, COM2 and
  930.                           COM4 cannot operate simultaneously. Any other combination of two
  931.                           ports can be used.
  932.  
  933.                           By specifing NORESET (-1) for the baud rate code, the port  will
  934.                           NOT  be  reset.   This is used to "take over" a port from a host
  935.                           communications program that allows a  "DOS  gateway".   External
  936.                           protocols  can  be implemented this way.  See SioBaud for a list
  937.                           of the baud rate codes, or see "PCL4W.H".
  938.  
  939.                Returns     -3 : No buffer available. Call SioRxBuf first.
  940.                            -4 : No such port. Expect 0 to MaxPort.
  941.                           -11 : Bad baud rate code selected. Expecting  0 to 9.
  942.                           -13 : UART undefined.  SioUART(Port,0) was called previously.
  943.                           -14 : Bad or missing UART.  You may not have hardware present.
  944.                           -15 : Port already enabled.  SioReset has already been called.
  945.                           -16 : Interrupt already in use.
  946.  
  947.               See Also    SioBaud, SioParms, SioRxBuf, SioDone, and SioUART.
  948.  
  949.  
  950.  
  951.  
  952.              PCL4W Reference Manual                                            Page 14
  953.               ****************************************************************************
  954.               *    SioRI    *  Reads the Ring Indicator (RI) modem status bit.           *
  955.               ****************************************************************************
  956.  
  957.  
  958.                 Syntax    int SioRI(Port)
  959.                           int Port;     /* Port selected (COM1 thru COM4) */
  960.  
  961.                Remarks    The SioRI function is used to read the Ring  Indicator
  962.                           (RI) modem status bit. Also see SioModem.
  963.  
  964.                Returns    -2 : Port not enabled. Call SioReset first.
  965.                           -4 : No such port.  Expect 0 to MaxPort.
  966.                            0 : RI is clear.
  967.                           >0 : RI is set (RING has occurred).
  968.  
  969.               See Also    SioDSR, SioCTS, SioDCD, and SioModem.
  970.  
  971.  
  972.  
  973.  
  974.  
  975.  
  976.  
  977.  
  978.  
  979.               ****************************************************************************
  980.               *    SioRTS   *  Sets, clears, or reads the Request to Send (RTS) line.    *
  981.               ****************************************************************************
  982.  
  983.  
  984.                 Syntax    int SioRTS(Port,Cmd)
  985.                           int Port;     /* COM1 to COM4 */
  986.                           char Cmd;     /* RTS command (SET, CLEAR, or READ) */
  987.  
  988.                Remarks    The SioRTS function controls the Request to Send (RTS bit in the
  989.                           modem control register.
  990.  
  991.                           The  RTS  line  is  used  by  some  error  correcting  modems to
  992.                           implement hardware flow control.  RTS is dropped by the computer
  993.                           to signal the modem not to send data, and is  raised  to  signal
  994.                           the modem to continue.
  995.  
  996.                           Refer  to  the  User's  Manual for a discussion of flow control.
  997.                           Commands (defined in PCL4W.H) are:
  998.  
  999.                           SET_LINE ('S')   -- set RTS (ON)
  1000.                           CLEAR_LINE ('C') -- clear RTS (OFF)
  1001.                           READ_LINE ('R')  -- read RTS
  1002.  
  1003.                Returns    -2 : Port not enabled. Call SioReset first.
  1004.                           -4 : No such port. Expect 0 to MaxPort.
  1005.                           -5 : Command is not one of 'S', 'C', or 'R'.
  1006.                            0 : RTS is OFF (READ_LINE Command).
  1007.                           >0 : RTS is ON  (READ_LINE Command).
  1008.  
  1009.               See Also    SioFlow and SioDTR.
  1010.  
  1011.  
  1012.  
  1013.  
  1014.  
  1015.  
  1016.  
  1017.  
  1018.  
  1019.  
  1020.              PCL4W Reference Manual                                            Page 15
  1021.               ****************************************************************************
  1022.               *  SioRxBuf  *  Sets up receive buffers.                                   *
  1023.               ****************************************************************************
  1024.  
  1025.  
  1026.                 Syntax    int SioRxBuf(Port,Buffer,SizeCode)
  1027.                           int Port;     /* Port selected (COM1 thru COM4) */
  1028.                           char *Buffer  /* Receive buffer */
  1029.                           int SizeCode; /* Buffer size code */
  1030.  
  1031.                Remarks    The SioRxBuf function passes the address and size of the receive
  1032.                           buffer to PCL4W.  Recall that PCL4W requires  a  receive  buffer
  1033.                           for  each  port  in  simultaneous  operation  since  the receive
  1034.                           function is interrupt driven.  It  must  be  called  before  any
  1035.                           incoming  characters  can  be  received. SioRxBuf must be called
  1036.                           before SioReset.  Buffer size codes are listed in "PCL4W.H".
  1037.  
  1038.                           Size Code       Buffer Size    PCL4W.H Name
  1039.                              0              8 bytes        Size8
  1040.                              1             16 bytes        Size16
  1041.                              2             32 bytes        Size32
  1042.                              3             64 bytes        Size64
  1043.                              4            128 bytes        Size128
  1044.                              5            256 bytes        Size256
  1045.                              6            512 bytes        Size512
  1046.                              7           1024 bytes        Size1024 or Size1K
  1047.                              8           2048 bytes        Size2048 or Size2K
  1048.                              9           4096 bytes        Size4096 or Size4K
  1049.                             10           8192 bytes        Size8192 or Size8K
  1050.                             11          16384 bytes        Size16384 or Size16K
  1051.                             12          32768 bytes        Size32768 or Size32K
  1052.  
  1053.                Returns    -4 : No such port. Expect 0 to MaxPort.
  1054.                          -10 : Bad buffer size code. Expecting 0 to 11.
  1055.  
  1056.               See Also    SioReset.
  1057.  
  1058.  
  1059.  
  1060.  
  1061.  
  1062.  
  1063.               ****************************************************************************
  1064.               * SioRxFlush *  Flushes (clears) the receive buffer.                       *
  1065.               ****************************************************************************
  1066.  
  1067.  
  1068.                 Syntax    int SioRxFlush(Port)
  1069.                           int Port;   /* Port selected (COM1 thru COM4) */
  1070.  
  1071.                Remarks    The SioRxFlush  function  will  delete  any  characters  in  the
  1072.                           receive  buffer  for  the  specified port.  After execution, the
  1073.                           receive buffer will be empty.  Call SioRxBuf after  resetting  a
  1074.                           port in order to delete any spurious characters.
  1075.  
  1076.                Returns    -2 : Port not enabled. Call SioReset first.
  1077.                           -4 : No such port. Expect 0 to MaxPort.
  1078.  
  1079.               See Also    SioRxQue.
  1080.  
  1081.  
  1082.  
  1083.  
  1084.  
  1085.  
  1086.  
  1087.  
  1088.              PCL4W Reference Manual                                            Page 16
  1089.               ****************************************************************************
  1090.               *  SioRxQue   *  Returns the number of bytes in the receive queue.         *
  1091.               ****************************************************************************
  1092.  
  1093.  
  1094.                 Syntax    int SioRxQue(Port)
  1095.                           int Port;     /* Port selected (COM1 thru COM4) */
  1096.  
  1097.                Remarks    The  SioRxQue  function  will return the number of characters in
  1098.                           the receive queue at the time of the call. It  can  be  used  to
  1099.                           implement XON/XOFF flow control.
  1100.  
  1101.                Returns    -2 : Port not enabled. Call SioReset first.
  1102.                           -4 : No such port. Expect 0 to MaxPort.
  1103.  
  1104.               See Also     SioRxFlush.
  1105.  
  1106.  
  1107.  
  1108.  
  1109.  
  1110.  
  1111.  
  1112.               ****************************************************************************
  1113.               *  SioTxBuf  *  Sets up transmitter buffer.                                *
  1114.               ****************************************************************************
  1115.  
  1116.  
  1117.                 Syntax    int SioTxBuf(Port,Buffer,SizeCode)
  1118.                           int Port;     /* Port selected (COM1 thru COM4) */
  1119.                           char *Buffer; /* Transmit buffer */
  1120.                           int SizeCode; /* Buffer size code */
  1121.  
  1122.                Remarks    The  SioTxBuf  function  passes  the  address  and  size  of the
  1123.                           transmit buffer to PCL4W, provided that you  will  link  with  a
  1124.                           PCL4W   library  with  transmitter  interrupts  enabled.   PCL4W
  1125.                           requires  a  transmit  buffer  for  each  port  in  simultaneous
  1126.                           operation  if  you  are  using  the  version of the library with
  1127.                           transmitter interrupts enabled (PCL4W2.LIB).  SioTxBuf() must be
  1128.                           called before SioReset.
  1129.  
  1130.                           Size Code       Buffer Size    PCL4W.H Name
  1131.                              0              8 bytes        Size8
  1132.                              1             16 bytes        Size16
  1133.                              2             32 bytes        Size32
  1134.                              3             64 bytes        Size64
  1135.                              4            128 bytes        Size128
  1136.                              5            256 bytes        Size256
  1137.                              6            512 bytes        Size512
  1138.                              7           1024 bytes        Size1024 or Size1K
  1139.                              8           2048 bytes        Size2048 or Size2K
  1140.                              9           4096 bytes        Size4096 or Size4K
  1141.                             10           8192 bytes        Size8192 or Size8K
  1142.                             11          16384 bytes        Size16384 or Size16K
  1143.                             12          32768 bytes        Size32768 or Size32K
  1144.  
  1145.                           This function is not used unless the transmitter interrupts  are
  1146.                           enabled  (PCL4W2.LIB).  Refer  to  the  PCL4W  Users  Manual for
  1147.                           information on transmitter (TX) interrupts.
  1148.  
  1149.                Returns     -4 : No such port. Expect 0 to MaxPort.
  1150.                           -10 : Bad buffer size code. Expecting 0 to 11.
  1151.  
  1152.               See Also    SioRxBuf and SioReset.
  1153.  
  1154.  
  1155.  
  1156.              PCL4W Reference Manual                                            Page 17
  1157.               ****************************************************************************
  1158.               * SioTxFlush *  Flushes (clears) the transmitter buffer.                   *
  1159.               ****************************************************************************
  1160.  
  1161.  
  1162.                 Syntax    int SioTxFlush(Port)
  1163.                           int Port;   /* Port selected (COM1 thru COM4) */
  1164.  
  1165.                Remarks    The SioTxFlush  function  will  delete  any  characters  in  the
  1166.                           transmit  buffer  for the specified port, provided that you will
  1167.                           link with a PCL4W library with transmitter  interrupts  enabled.
  1168.                           After execution, the transmit buffer will be empty.
  1169.  
  1170.                           Once  this  function is called, any character  in  the  transmit
  1171.                           buffer  (put  there  by  SioPutc) will be lost and therefore not
  1172.                           transmitted. This function is not used  unless  the  transmitter
  1173.                           interrupts  are  enabled  Refer  to  the  PCL4W Users Manual for
  1174.                           information on transmitter (TX) interrupts.
  1175.  
  1176.                Returns    -2 : Port not enabled. Call SioReset first.
  1177.                           -4 : No such port. Expect 0 to MaxPort.
  1178.  
  1179.               See Also    SioTxQue.
  1180.  
  1181.  
  1182.  
  1183.  
  1184.  
  1185.  
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.               ****************************************************************************
  1192.               *  SioTxQue  *  Returns the number of bytes in the transmit queue.         *
  1193.               ****************************************************************************
  1194.  
  1195.  
  1196.                 Syntax    int SioTxQue(Port)
  1197.                           int Port;     /* Port selected (COM1 thru COM4) */
  1198.  
  1199.                Remarks    The SioTxQue function will return the number  of  characters  in
  1200.                           the  transmit  queue  at the time of the call, provided that you
  1201.                           will link with  a  PCL4W  library  with  transmitter  interrupts
  1202.                           enabled.
  1203.  
  1204.                           This function is not used unless the transmitter interrupts  are
  1205.                           enabled.  Refer  to  the  PCL4W  Users Manual for information on
  1206.                           transmitter (TX) interrupts.
  1207.  
  1208.                Returns    -2 : Port not enabled. Call SioReset first.
  1209.                           -4 : No such port. Expect 0 to MaxPort.
  1210.  
  1211.               See Also     SioTxFlush.
  1212.  
  1213.  
  1214.  
  1215.  
  1216.  
  1217.  
  1218.  
  1219.  
  1220.  
  1221.  
  1222.  
  1223.  
  1224.              PCL4W Reference Manual                                            Page 18
  1225.               ****************************************************************************
  1226.               *  SioUART   *  Sets the UART base address.                                *
  1227.               ****************************************************************************
  1228.  
  1229.  
  1230.                 Syntax    int SioUART(Port,Address)
  1231.                           int Port;     /* COM1 to COM4 */
  1232.                           int Address;  /* UART address */
  1233.  
  1234.                Remarks    The  SioUART  function  sets  the  UART  base  address  for  the
  1235.                           specified port.  SioUART must be called before SioReset in order
  1236.                           to have effect.  Be extremely sure that you know  what  you  are
  1237.                           doing!   Note   that  PCL4W  uses  the  standard  PC/XT/AT  port
  1238.                           addresses,  interrupt  request  lines,  and  interrupt   service
  1239.                           vectors.   Therefore,   this   function   is   only  needed  for
  1240.                           non-standard ports.
  1241.  
  1242.                Returns    >0 : The previous base address for this port.
  1243.                           -4 : No such port.  Expect 0 to MaxPort.
  1244.                          -15 : Port already enabled.  SioReset has already been called.
  1245.  
  1246.               See Also    SioPorts, SioIRQ, and SioReset.
  1247.  
  1248.  
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.               ****************************************************************************
  1258.               * SioUnGetc  *  "Un-gets" the last character read with SioGetc().          *
  1259.               ****************************************************************************
  1260.  
  1261.  
  1262.                 Syntax    int SioUnGetc(Port,c)
  1263.                           int Port;     /* Port selected (COM1 thru COM4) */
  1264.                           char c;       /* character to unget */
  1265.  
  1266.                Remarks    The SioUnGetc function returns  ("pushes")  the  character  back
  1267.                           into  the serial input buffer.  The character pushed will be the
  1268.                           next character returned by SioGetc.  Only one character  can  be
  1269.                           pushed back. This function works just like the "ungetc" function
  1270.                           in the C language.
  1271.  
  1272.                Returns    -2 : Port not enabled. Call SioReset first.
  1273.                           -4 : No such port. Expect 0 to MaxPort.
  1274.  
  1275.               See Also    SioReset.
  1276.  
  1277.  
  1278.  
  1279.  
  1280.  
  1281.  
  1282.  
  1283.  
  1284.  
  1285.  
  1286.  
  1287.  
  1288.  
  1289.  
  1290.  
  1291.  
  1292.              PCL4W Reference Manual                                            Page 19
  1293.                                        Function Sumary
  1294.  
  1295.  
  1296.  
  1297.                    ***********************************************************
  1298.                    * Function    *   Arg1   *   Arg2   *   Arg3   *   Arg4   *
  1299.                    ***********************************************************
  1300.                    * SioBaud     * Port     * BaudCode *          *          *
  1301.                    * SioBrkSig   * Port     * Cmd      *          *          *
  1302.                    * SioCTS      * Port     *          *          *          *
  1303.                    * SioDCD      * Port     *          *          *          *
  1304.                    * SioDone     * Port     *          *          *          *
  1305.                    * SioDSR      * Port     *          *          *          *
  1306.                    * SioDTR      * Port     * Cmd      *          *          *
  1307.                    * SioError    * Code     *          *          *          *
  1308.                    * SioFIFO     * Port     * FIFOcode *          *          *
  1309.                    * SioFlow     * Port     *          *          *          *
  1310.                    * SioGetc     * Port     *          *          *          *
  1311.                    * SioInfo     * Cmd      *          *          *          *
  1312.                    * SioIRQ      * Port     * IRQcode  * ISRcode  *          *
  1313.                    * SioLine     * Port     *          *          *          *
  1314.                    * SioLoopBack * Port     *          *          *          *
  1315.                    * SioModem    * Port     * Mask     *          *          *
  1316.                    * SioParms    * Port     * Parity   * StopBits *WordLength*
  1317.                    * SioPorts    * NbrPorts * FirstDBP *StatusReg *          *
  1318.                    * SioPutc     * Port     * Ch       *          *          *
  1319.                    * SioRead     * Port     * Register *          *          *
  1320.                    * SioReset    * Port     * BaudCode *          *          *
  1321.                    * SioRI       * Port     *          *          *          *
  1322.                    * SioRTS      * Port     * Cmd      *          *          *
  1323.                    * SioRxBuf    * Port     * Buffer   * SizeCode *          *
  1324.                    * SioRxFlush  * Port     *          *          *          *
  1325.                    * SioRxQue    * Port     *          *          *          *
  1326.                    * SioTxBuf    * Port     * Buffer   * SizeCode *          *
  1327.                    * SioTxFlush  * Port     *          *          *          *
  1328.                    * SioTxQue    * Port     *          *          *          *
  1329.                    * SioUART     * Port     * Address  *          *          *
  1330.                    * SioUnGetc   * Port     * Ch       *          *          *
  1331.                    ***********************************************************
  1332.  
  1333.  
  1334.  
  1335.  
  1336.  
  1337.  
  1338.  
  1339.  
  1340.  
  1341.  
  1342.  
  1343.  
  1344.  
  1345.  
  1346.  
  1347.  
  1348.  
  1349.  
  1350.  
  1351.  
  1352.  
  1353.  
  1354.  
  1355.  
  1356.  
  1357.  
  1358.  
  1359.  
  1360.              PCL4W Reference Manual                                            Page 20
  1361.                                        Error Code Summary
  1362.  
  1363.  
  1364.  
  1365.               *****************************************************************
  1366.               * Code *  Description                                           *
  1367.               *****************************************************************
  1368.               *   0  *  No error.                                             *
  1369.               *  -1  *  Timeout waiting for I/O.                              *
  1370.               *  -2  *  Port not enabled. Call SioReset first.                *
  1371.               *  -3  *  No buffer available. Call SioRxBuf first.             *
  1372.               *  -4  *  No such port. Expect 0 to MaxPort. (COM1 = 0)         *
  1373.               *  -5  *  Expected 'S', 'C', or 'R' as 2nd argument.            *
  1374.               *  -6  *  Expected 'A', 'C', or 'D' as 2nd argument.            *
  1375.               *  -7  *  Bad parity code specified. Expected 0 to 7.           *
  1376.               *  -8  *  Bad stop bits code specified. Expected 0 or 1.        *
  1377.               *  -9  *  Bad wordlength code specified. Expect 0 to MaxPort.   *
  1378.               * -10  *  Bad buffer size code specified. Expected 0 to 11.     *
  1379.               * -11  *  Bad baud rate code. Expected 0 to 9.                  *
  1380.               * -12  *  Loopback test fails.                                  *
  1381.               * -13  *  UART undefined.                                       *
  1382.               * -14  *  Missing or bad UART. (no UART hardware ?)             *
  1383.               * -15  *  Port already enabled.                                 *
  1384.               * -16  *  ISR (interrupt) already in use.                       *
  1385.               * -17  *  No such IRQ. (Should be 2 to 7)                       *
  1386.               * -18  *  ISR limit (maximum of 4 PC IRQs) exceeded.            *
  1387.               *****************************************************************
  1388.  
  1389.  
  1390.  
  1391.  
  1392.  
  1393.  
  1394.  
  1395.  
  1396.  
  1397.  
  1398.  
  1399.  
  1400.  
  1401.  
  1402.  
  1403.  
  1404.  
  1405.  
  1406.  
  1407.  
  1408.  
  1409.  
  1410.  
  1411.  
  1412.  
  1413.  
  1414.  
  1415.  
  1416.  
  1417.  
  1418.  
  1419.  
  1420.  
  1421.  
  1422.  
  1423.  
  1424.  
  1425.  
  1426.  
  1427.  
  1428.              PCL4W Reference Manual                                            Page 21
  1429.  
  1430.  
  1431.