home *** CD-ROM | disk | FTP | other *** search
/ Stars of Shareware: Programmierung / SOURCE.mdf / programm / windows / c / pclw11 / pcl4w.ref < prev    next >
Encoding:
Text File  |  1994-07-31  |  58.9 KB  |  1,429 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.1
  19.  
  20.                                      August 1, 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.                                   ____|__     |                (R)
  47.                                --+       |    +-------------------
  48.                                  |   ____|__  |  Association of
  49.                                  |  |       |_|  Shareware
  50.                                  |__|   o   |    Professionals
  51.                                --+--+   |   +---------------------
  52.                                     |___|___|    MEMBER
  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.                    SioGetDiv.......................................9
  93.                    SioInfo.........................................9
  94.                    SioIRQ.........................................10
  95.                    SioLine........................................10
  96.                    SioLoopBack....................................11
  97.                    SioModem.......................................11
  98.                    SioParms.......................................12
  99.                    SioPorts.......................................12
  100.                    SioPutc........................................13
  101.                    SioRead........................................13
  102.                    SioReset.......................................14
  103.                    SioRI..........................................14
  104.                    SioRTS.........................................15
  105.                    SioRxBuf.......................................15
  106.                    SioRxFlush.....................................16
  107.                    SioRxQue.......................................16
  108.                    SioTxBuf.......................................17
  109.                    SioTxFlush.....................................17
  110.                    SioTxQue.......................................18
  111.                    SioUART........................................18
  112.                    SioUnGetc......................................19
  113.                 Function Summary..................................20
  114.                 Error Code Summary................................21
  115.                 Code Examples.....................................21
  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 library - 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 as
  178.               WTERM11.ZIP. Many PCL4W functions are used somewhere in TERM.  Other example
  179.               programs will 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(int Port,int BaudCode)
  211.                           /* Port:      Port selected (COM1 - COM4) */
  212.                           /* 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(int Port,char Cmd)
  243.                           /* Port:      Port selected (COM1 thru COM16) */
  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(int Port)
  278.                           /* int Port: Port selected (COM1 thru COM16) */
  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(int Port)
  312.                           /* Port: Port selected (COM1 thru COM16) */
  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(int Port)
  347.                           /* Port: Port selected (COM1 thru COM16) */
  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(int Port)
  381.                           /* Port: Port selected (COM1 thru COM16) */
  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(int Port,char Cmd)
  415.                           /* Port: Port selected (COM1 thru COM16) */
  416.                           /* 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.  DTR should always  be  set  when
  420.                           communicating with a modem. Commands (defined in PCL4W.H) 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.               |   SioFIFO   |  Sets the FIFO trigger level (16550 UART only).              *
  440.               +-------------+------------------------------------------------------------*
  441.  
  442.  
  443.                 Syntax    int SioFIFO(int Port,int LevelCode)
  444.                           /* Port:      Port selected (COM1 thru COM16) */
  445.                           /* LevelCode: FIFO level code (see below) */
  446.  
  447.                Remarks    The SioFIFO function  is  used to enable both transmit & receive
  448.                           FIFOs for 16550 UARTS, and to set the  trigger  level  at  which
  449.                           receive interrupts are generated.
  450.  
  451.                           For  example, if the FIFO level is set to 8, then the 16550 UART
  452.                           will not generate an interrupt until 8 bytes have been received.
  453.                           This reduces the  number  of  interrupts  generated  and  allows
  454.                           faster   processing   with   slower  machines  or  when  running
  455.                           simultaneous ports.
  456.  
  457.                           In order to take advantage of the TX FIFO, use the PCL4C library
  458.                           with TX interrupts enabled.
  459.  
  460.                           In order to test if your port is a 16550 UART, call SioFIFO with
  461.                           a LevelCode of other than FIFO_OFF. SioFIFO can  be  called  for
  462.                           the 8250 and 16450 UART without ill effect.
  463.  
  464.                           Code  PCL4W.H Name  Trigger Level
  465.                           -1      FIFO_OFF     Disable FIFO
  466.                            0      LEVEL_1      1 byte
  467.                            1      LEVEL_4      4 bytes
  468.                            2      LEVEL_8      8 bytes
  469.                            3      LEVEL_14     14 bytes
  470.  
  471.                Returns    -2 : Port not enabled. Call SioReset first.
  472.                           -4 : No such port.  Expect 0 to MaxPort.
  473.                           >0 : FIFO level set.
  474.                            0 : FIFO level not set (not 16550).
  475.  
  476.              PCL4W Reference Manual                                            Page 7
  477.               +------------+-------------------------------------------------------------+
  478.               |   SioFlow  |  Sets hardware (RTS/CTS) flow control.                      |
  479.               +------------+-------------------------------------------------------------+
  480.  
  481.  
  482.                 Syntax    int SioFlow(int Port,int Flag)
  483.                           /* Port: Port selected (COM1 thru COM16) */
  484.                           /* Flag: TRUE to enable flow control */
  485.  
  486.                Remarks    The SioFlow function is used to enable or disable hardware  flow
  487.                           control.  Hardware flow control uses RTS and CTS to control data
  488.                           flow  between  the  modem and the computer.  Refer to the User's
  489.                           Manual  for  a  discussion  of flow control.  To enable hardware
  490.                           flow control, call SioFlow with Flag=TRUE.
  491.  
  492.                           In order for hardware flow control to work correctly, your modem
  493.                           must also be configured to work with hardware flow control,  and
  494.                           your  computer  to  modem  cable  must  have  RTS  and CTS wired
  495.                           straight through. If you enable hardware flow  control,  do  not
  496.                           modify  the  RTS  line  (by  calling  SioRTS)  unless  you  know
  497.                           exactly what you are doing.
  498.  
  499.                           Flow control is disabled after resetting a port.  To  explicitly
  500.                           disable hardware flow control, call SioFlow with Flag=FALSE.
  501.  
  502.                Returns    -2 : Port not enabled. Call SioReset first.
  503.                           -4 : No such port.  Expect 0 to MaxPort.
  504.                           =0 : Flow control disabled.
  505.                           >0 : Flow control enabled.
  506.  
  507.               See Also    SioPutc
  508.  
  509.  
  510.  
  511.  
  512.  
  513.               +------------+-------------------------------------------------------------+
  514.               |   SioGetc  |  Reads the next character from the serial line.             |
  515.               +------------+-------------------------------------------------------------+
  516.  
  517.  
  518.                 Syntax    int SioGetc(int Port)
  519.                           /* Port: Port selected (COM1 thru COM16) */
  520.  
  521.                Remarks    The SioGetc function reads a byte from the selected serial port.
  522.                           The function will return immediately if no serial byte is ready.
  523.  
  524.                Returns    -2 : Port not enabled. Call SioReset first.
  525.                           -4 : No such port. Expect 0 to MaxPort.
  526.                           -1 : If timed out.
  527.                           >0 : Character read.
  528.  
  529.               See Also    SioUnGetc and SioPutc.
  530.  
  531.  
  532.  
  533.  
  534.  
  535.  
  536.  
  537.  
  538.  
  539.  
  540.  
  541.  
  542.  
  543.  
  544.              PCL4W Reference Manual                                            Page 8
  545.               +---------------+----------------------------------------------------------+
  546.               |   SioGetDiv   |  Reads the baud rate divisor.                            |
  547.               +---------------+----------------------------------------------------------+
  548.  
  549.  
  550.                 Syntax    int SioGetDiv(int Port)
  551.                           /* Port: Port selected (COM1 thru COM16) */
  552.  
  553.  
  554.                Remarks     The  SioGetDiv  function reads the baud rate divisor. The baud
  555.                           rate can then be determined by the divisor:
  556.  
  557.                           Baud   Divisor      Baud  Divisor      Baud  Divisor
  558.                            300    0180        4800   0018       38400   0003
  559.                           1200    0060        9600   000C       57600   0002
  560.                           2400    0030       19200   0006      115200   0001
  561.  
  562.                Returns    -2 : Port not enabled. Call SioReset first.
  563.                           -4 : No such port. Expect 0 to MaxPort.
  564.                           >0 : Baud rate divisor.
  565.  
  566.               See Also    SioParms.
  567.  
  568.  
  569.  
  570.  
  571.  
  572.  
  573.  
  574.               +-------------+------------------------------------------------------------+
  575.               |   SioInfo   |  Returns PCL4W library information.                        |
  576.               +-------------+------------------------------------------------------------+
  577.  
  578.  
  579.                 Syntax    int SioInfo(char Cmd)
  580.                           /* Cmd: Command ('V' or 'I') */
  581.  
  582.                Remarks    The  SioInfo  function returns an integer code  corresponding to
  583.                           either the (1) library version number  or  (2)  whether  or  not
  584.                           transmitter interrupts are enabled.
  585.  
  586.  
  587.                Returns    Version ('V')
  588.  
  589.                           hex byte XY where version is denoted as X.Y
  590.  
  591.                           TX Interrupts ('I')
  592.  
  593.                           TRUE  if  transmitter  interrupts  are  enabled  in the library,
  594.                           otherwise FALSE.
  595.  
  596.  
  597.  
  598.  
  599.  
  600.  
  601.  
  602.  
  603.  
  604.  
  605.  
  606.  
  607.  
  608.  
  609.  
  610.  
  611.  
  612.              PCL4W Reference Manual                                            Page 9
  613.               +-------------+------------------------------------------------------------+
  614.               |    SioIRQ   |  Assigns an IRQ line to a port.                            |
  615.               +-------------+------------------------------------------------------------+
  616.  
  617.  
  618.                 Syntax    int SioIRQ(int Port,intIRQcode)
  619.                           /* Port:    Port selected (COM1 thru COM16) */
  620.                           /* IRQcode: IRQ number [IRQ2..IRQ7] */
  621.  
  622.                Remarks    The SioIRQ function assigns an IRQ line to  a  port.   That  is,
  623.                           SioIRQ  maps  an  IRQ  to a port.  SioIRQ (like SioUART) must be
  624.                           called before calling SioReset. Unless you have  a  non-standard
  625.                           (COM1  &  COM3  use IRQ4 while COM2 & COM4 use IRQ3) serial port
  626.                           configuration  (or  don't  want  to  run  more  than   2   ports
  627.                           concurrently),  you  will not need to call SioIRQ.  Be EXTREMELY
  628.                           careful with SioIRQ as it can lock  your  machine  up  if  given
  629.                           incorrect information.
  630.  
  631.                           In  particular,  remember  that your port hardware must generate
  632.                           the interrupt that you have specified.  You should refer to your
  633.                           serial  board  hardware  manual  for  specfic  instructions   in
  634.                           configuring  your  hardware.  Be  sure to call SioPorts first to
  635.                           setup DigiBoard ports if you have  them.   Refer  to  the  PCL4W
  636.                           Users Manual for additional information.
  637.  
  638.  
  639.                Returns    -4 : No such port. Expect 0 to MaxPort.
  640.                          -15 : Port already enabled.  SioReset has already been called.
  641.                          |17 : No such IRQ.
  642.                          -18 : ISR limit (maximum of 4 PC IRQs) exceeded.
  643.                            0 : Otherwise
  644.  
  645.               See Also    SioUART and SioPorts.
  646.  
  647.  
  648.  
  649.  
  650.  
  651.               +-------------+------------------------------------------------------------+
  652.               |   SioLine   |  Reads the line status register.                           |
  653.               +-------------+------------------------------------------------------------+
  654.  
  655.  
  656.                 Syntax    int SioLine(int Port)
  657.                           /* Port: Port selected (COM1 thru COM16) */
  658.  
  659.                Remarks    The  SioLine  function  reads  the  line  status  register.  The
  660.                           individual bit masks are as follows:
  661.  
  662.                           0x40  = Transmitter empty.
  663.                           0x20  = Transmitter buffer empty.
  664.                           0x10  = Break detected.
  665.                           0x08  = Framming error.
  666.                           0x04  = Parity error.
  667.                           0x02  = Overrun error.
  668.                           0x01  = Data ready.
  669.  
  670.                           The above are documented in the file PCL4W.H.
  671.  
  672.                Returns    -2 : Port not enabled. Call SioReset first.
  673.                           -4 : No such port. Expect 0 to MaxPort.
  674.                           >0 : Line status (rightmost byte of word).
  675.  
  676.               See Also    SioModem.
  677.  
  678.  
  679.  
  680.              PCL4W Reference Manual                                            Page 10
  681.               +-------------+------------------------------------------------------------+
  682.               | SioLoopBack |  Does a UART loopback test.                                |
  683.               +-------------+------------------------------------------------------------+
  684.  
  685.  
  686.                 Syntax    int SioLoopBack(int Port)
  687.                           /* Port: Port selected (COM1 thru COM16) */
  688.  
  689.                Remarks    SioLoopBack makes use of the built in loopback  test  capability
  690.                           of  the  INS8250  family  UART.  Normally SioLoopBack will never
  691.                           need to be called unless you suspect that your UART is bad. Many
  692.                           UARTs must be reset after running a loopback test.
  693.  
  694.                Returns      0 : Loopback test is successfull.
  695.                            -2 : Port not enabled. Call SioReset first.
  696.                            -4 : No such port.  Expect 0 to MaxPort.
  697.                           -12 : Loopback test fails.
  698.  
  699.  
  700.  
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707.  
  708.  
  709.               +-------------+------------------------------------------------------------+
  710.               |   SioModem  |  Reads the modem status register.                          |
  711.               +-------------+------------------------------------------------------------+
  712.  
  713.  
  714.                 Syntax    int SioModem(int Port, int Mask)
  715.                           /* Port: Port selected (COM1 thru COM16) */
  716.                           /* Mask: Modem function mask */
  717.  
  718.                Remarks    The  SioModem  function  reads  the  modem  register.    The bit
  719.                           definitions for the function mask are as follows:
  720.  
  721.                           Bit Name  Function               Bit  Name      Function
  722.                            7  DCD   Data Carrier Detect     3   DeltaDCD  DCD has changed
  723.                            6  RI    Ring Indicator          2   DeltaRI   RI has changed
  724.                            5  DSR   Data Set Ready          1   DeltaDSR  DSR has changed
  725.                            4  CTS   Clear To Send           0   DeltaCTS  CTS has changed
  726.  
  727.                           Bits  4  through  7  represent  the  absolute  state  of   their
  728.                           respective  RS-232  inputs.  Bits 0 through 3 represent a change
  729.                           in the state of their respective RS-232 inputs since last  read.
  730.                           Once UART register 3 is read, the Delta bits are cleared.  Thus,
  731.                           it is best not to depend on the Delta bits.
  732.  
  733.  
  734.                Returns    -2 : Port not enabled. Call SioReset first.
  735.                           -4 : No such port. Expect 0 to MaxPort.
  736.                           >0 : Modem status (rightmost byte of word).
  737.  
  738.               See Also   SioCTS, SioDCD, SioDSR and SioRI.
  739.  
  740.  
  741.  
  742.  
  743.  
  744.  
  745.  
  746.  
  747.  
  748.              PCL4W Reference Manual                                            Page 11
  749.               +-------------+------------------------------------------------------------+
  750.               |  SioParms   |  Sets parity, stop bits, and word length.                  |
  751.               +-------------+------------------------------------------------------------+
  752.  
  753.  
  754.                Syntax     int  SioParms(int Port,int Parity,int StopBits, int DataBits)
  755.                           /* Port:     Port selected (COM1 - COM4) */
  756.                           /* Parity:   Parity code [0,1,2] */
  757.                           /* StopBits: Stop bits code [0,1] */
  758.                           /* DataBits: Word length code [0,1,2,3] */
  759.  
  760.                Remarks    The SioParms function sets  the  parity,  stop  bits,  and  word
  761.                           length.   If  the  default parity (none), stop bits (1), or word
  762.                           length (8) is not  acceptable,  then  they  can  be  changed  by
  763.                           calling SioParms.  SioParms can be called either before or after
  764.                           calling SioReset. See file PCL4W.H. (8 = default)
  765.  
  766.                                         Value   Description    PCL4W.H Name
  767.                           ParityCode:    *0      no parity      NoParity
  768.                                           1      odd parity     OddParity
  769.                                           3      even parity    EvenParity
  770.                           StopBitsCode:  *0      1 stop bit     OneStopBit
  771.                                           1      2 stop bits    TwoStopBits
  772.                           WordLengthCode: 0      5 data bits    WordLength5
  773.                                           1      6 data bits    WordLength6
  774.                                           2      7 data bits    WordLength7
  775.                                          *3      8 data bits    WordLength8
  776.  
  777.               Returns     -4 : No such port. Expect 0 to MaxPort.
  778.                           -7 : Bad parity code selected. Expecting  0 to 2.
  779.                           |8 : Bad stop bits code. Expecting  0 or 1.
  780.                           -9 : Bad word length code. Expecting  0 to 3.
  781.  
  782.              See Also    SioReset.
  783.  
  784.  
  785.               +-------------+------------------------------------------------------------+
  786.               |  SioPorts   |  Sets number of PC & Digiboard / BOCA Board ports.         |
  787.               +-------------+------------------------------------------------------------+
  788.  
  789.  
  790.                 Syntax     int  SioPorts(int NbrPorts,int FirstPort,int StatusReg,
  791.                                            int Code)
  792.                           /* NbrPorts:  Total number of ports */
  793.                           /* FirstPort: First DigiBoard port */
  794.                           /* StatusReg: DigiBoard Status Register */
  795.                           /* Code:      PC_PORTS, DIGIBOARD, or BOCABOARD */
  796.  
  797.                Remarks    The SioPorts function must be called  before  ANY  other  serial
  798.                           functions.   The  purpose of the SioPorts function is to set the
  799.                           total number of ports, the first DigiBoard (or BOCA board)  port
  800.                           and the DigiBoard (or BOCA board) status register address.
  801.  
  802.                           Once SioPorts is called, all COM ports starting with "FirstPort"
  803.                           will be treated as DigiBoard (or BOCA board) ports.  The default
  804.                           setup is 4 standard PC ports and no DigiBoard or  BOCA  ports  [
  805.                           SioPorts(4,4,0,PC_PORTS) ].
  806.  
  807.                           Refer  to  ther  PCL4W users maniual for more information on the
  808.                           DigiBoard and BOCA board.
  809.  
  810.                Returns    -4 : No such port. Expect 0 to 9.
  811.                           0 : No error (sets MaxPort to NumberPorts-1).
  812.  
  813.               See Also    SioUART, SioIRQ, and Code Examples.
  814.  
  815.  
  816.              PCL4W Reference Manual                                            Page 12
  817.               +-------------+------------------------------------------------------------+
  818.               |   SioPutc   |  Transmit a character over a serial line.                  |
  819.               +-------------+------------------------------------------------------------+
  820.  
  821.  
  822.                 Syntax    int SioPutc(int Port,char Ch)
  823.                           /* Port: Port selected (COM1 thru COM16) */
  824.                           /* Ch:   Character to send */
  825.  
  826.                Remarks    The SioPutc function transmits one character  over the  selected
  827.                           serial line.
  828.  
  829.                           If  flow  control has been enabled, then SioPutc may return a -1
  830.                           (time out) if the  number  of  tics  specified  in  the  SioFlow
  831.                           function was exceeded waiting for the modem to raise CTS.
  832.  
  833.                           Refer to the User's Manual for a discussion of flow control.
  834.  
  835.                           If  transmitter  interrupts  are  enabled  (there  are  separate
  836.                           versions of the library  for  transmitter  interrupts  enabled),
  837.                           then  the  byte  is  placed  in  the  transmit  buffer, awaiting
  838.                           transmission by the PCL4W interrupt service routine.
  839.  
  840.                Returns    -2 : Port not enabled. Call SioReset first.
  841.                           -4 : No such port. Expect 0 to MaxPort.
  842.                           -1 : Timed out waiting for CTS (flow control enabled)
  843.  
  844.               See Also    SioGetc and SioFlow.
  845.  
  846.  
  847.  
  848.  
  849.               +-------------+------------------------------------------------------------+
  850.               |   SioRead   |  Reads any UART register.                                  |
  851.               +-------------+------------------------------------------------------------+
  852.  
  853.  
  854.                 Syntax    int SioRead(int Port,int Reg)
  855.                           /* Port: Port selected (COM1 thru COM16) */
  856.                           /* Reg:  UART register (0 to 7) */
  857.  
  858.                Remarks    The SioReset function directly reads the contents of any of  the
  859.                           7  UART  registers.   This  function  is  useful  when debugging
  860.                           application  programs  and  as  a  method  for  verifying   UART
  861.                           contents.   Refer  to the PCL4W Users Manual for a discussion of
  862.                           the 7 UART registers.
  863.  
  864.                           The line status register (register 5)  can  also  be  read  with
  865.                           SioLine while the modem status register (register 6) can also be
  866.                           read  with  SioModem.  Refer  to  the  PCL4W User's Manual for a
  867.                           discussion of the UART registers.
  868.  
  869.                Returns     -3 : No buffer available. Call SioRxBuf first.
  870.                            -4 : No such port. Expect 0 to MaxPort.
  871.  
  872.               See Also    SioLine and SioModem.
  873.  
  874.  
  875.  
  876.  
  877.  
  878.  
  879.  
  880.  
  881.  
  882.  
  883.  
  884.              PCL4W Reference Manual                                            Page 13
  885.               +-------------+------------------------------------------------------------+
  886.               |  SioReset   |  Initialize a serial port for processing.                  |
  887.               +-------------+------------------------------------------------------------+
  888.  
  889.  
  890.                 Syntax    int SioReset(int Port,int BaudCode)
  891.                           /* Port:     Port selected (COM1 thru COM16) */
  892.                           /* BaudCode: Baud code or -1 */
  893.  
  894.                Remarks    The SioReset function  initializes  the  selected  serial  port.
  895.                           SioReset should be called after calling SioParm and SioRxBuf but
  896.                           before  making  any  other  calls  to  PCL4W.  SioReset uses the
  897.                           parity, stop bits, and  word  length  value  previously  set  if
  898.                           SioParm  was  called, otherwise the default values (see SioParm)
  899.                           are used.
  900.  
  901.                           Recall that COM1 and COM3 share the same  interrupt  vector  and
  902.                           therefore  cannot  operate  simultaneously. Similiarly, COM2 and
  903.                           COM4 cannot operate simultaneously. Any other combination of two
  904.                           ports can be used.
  905.  
  906.                           By specifing NORESET (-1) for the baud rate code, the port  will
  907.                           NOT  be  reset.   This is used to "take over" a port from a host
  908.                           communications program that allows a  "DOS  gateway".   External
  909.                           protocols  can  be implemented this way.  See SioBaud for a list
  910.                           of the baud rate codes, or see "PCL4W.H".
  911.  
  912.                Returns     -3 : No buffer available. Call SioRxBuf first.
  913.                            -4 : No such port. Expect 0 to MaxPort.
  914.                           -11 : Bad baud rate code selected. Expecting  0 to 9.
  915.                           |13 : UART undefined.  SioUART(Port,0) was called previously.
  916.                           |14 : Bad or missing UART.  You may not have hardware present.
  917.                           |15 : Port already enabled.  SioReset has already been called.
  918.                           -16 : Interrupt already in use.
  919.  
  920.               See Also    SioBaud, SioParms, SioRxBuf, SioDone, and SioUART.
  921.  
  922.  
  923.  
  924.  
  925.               +-------------+------------------------------------------------------------+
  926.               |    SioRI    |  Reads the Ring Indicator (RI) modem status bit.           |
  927.               +-------------+------------------------------------------------------------+
  928.  
  929.  
  930.                 Syntax    int SioRI(int Port)
  931.                           /* Port: Port selected (COM1 thru COM16) */
  932.  
  933.                Remarks    The SioRI function is used to read the Ring  Indicator
  934.                           (RI) modem status bit. Also see SioModem.
  935.  
  936.                Returns    -2 : Port not enabled. Call SioReset first.
  937.                           -4 : No such port.  Expect 0 to MaxPort.
  938.                            0 : RI is clear.
  939.                           >0 : RI is set (RING has occurred).
  940.  
  941.               See Also    SioDSR, SioCTS, SioDCD, and SioModem.
  942.  
  943.  
  944.  
  945.  
  946.  
  947.  
  948.  
  949.  
  950.  
  951.  
  952.              PCL4W Reference Manual                                            Page 14
  953.               +-------------+------------------------------------------------------------+
  954.               |    SioRTS   |  Sets, clears, or reads the Request to Send (RTS) line.    |
  955.               +-------------+------------------------------------------------------------+
  956.  
  957.  
  958.                 Syntax    int SioRTS(Port, char Cmd)
  959.                           /* Port: Port selected (COM1 thru COM16) */
  960.                           /* Cmd:  RTS command (SET, CLEAR, or READ) */
  961.  
  962.                Remarks    The SioRTS function controls the Request to Send (RTS bit in the
  963.                           modem control register.
  964.  
  965.                           The  RTS  line  is  used  by  some  error  correcting  modems to
  966.                           implement hardware flow control.  RTS is dropped by the computer
  967.                           to signal the modem not to send data, and is  raised  to  signal
  968.                           the modem to continue. RTS should be set when communicating with
  969.                           a modem unless Flow Control is being used.
  970.  
  971.                           Refer  to  the  User's  Manual for a discussion of flow control.
  972.                           Commands (defined in PCL4W.H) are:
  973.  
  974.                           SET_LINE ('S')   - set RTS (ON)
  975.                           CLEAR_LINE ('C') | clear RTS (OFF)
  976.                           READ_LINE ('R')  - read RTS
  977.  
  978.                Returns    -2 : Port not enabled. Call SioReset first.
  979.                           -4 : No such port. Expect 0 to MaxPort.
  980.                           -5 : Command is not one of 'S', 'C', or 'R'.
  981.                            0 : RTS is OFF (READ_LINE Command).
  982.                           >0 : RTS is ON  (READ_LINE Command).
  983.  
  984.               See Also    SioFlow and SioDTR.
  985.  
  986.  
  987.               +------------+-------------------------------------------------------------+
  988.               |  SioRxBuf  |  Sets up receive buffers.                                   |
  989.               +------------+-------------------------------------------------------------+
  990.  
  991.  
  992.                 Syntax    int SioRxBuf(int Port,int Selector,SizeCode)
  993.                           /* Port:     Port selected (COM1 thru COM16) */
  994.                           /* Selector: Receive buffer selector */
  995.                           /* SizeCode: Buffer size code */
  996.  
  997.                Remarks     The  SioRxBuf  function passes the address selector and size of
  998.                           the receive buffer to  PCL4W.   Recall  that  PCL4W  requires  a
  999.                           receive buffer for each port in simultaneous operation since the
  1000.                           receive  function is interrupt driven.  It must be called before
  1001.                           any incoming characters can be received. SioRxBuf must be called
  1002.                           before SioReset.  Buffer size codes are listed in "PCL4W.H".
  1003.  
  1004.                           Size Code       Buffer Size    PCL4W.H Name
  1005.                              4            128 bytes        Size128
  1006.                              5            256 bytes        Size256
  1007.                              6            512 bytes        Size512
  1008.                              7           1024 bytes        Size1024 or Size1K
  1009.                              8           2048 bytes        Size2048 or Size2K
  1010.                              9           4096 bytes        Size4096 or Size4K
  1011.                             10           8192 bytes        Size8192 or Size8K
  1012.                             11          16384 bytes        Size16384 or Size16K
  1013.                             12          32768 bytes        Size32768 or Size32K
  1014.  
  1015.                Returns    -4 : No such port. Expect 0 to MaxPort.
  1016.                          -10 : Bad buffer size code. Expecting 0 to 11.
  1017.  
  1018.               See Also    SioReset and Code Examples.
  1019.  
  1020.              PCL4W Reference Manual                                            Page 15
  1021.               +------------+-------------------------------------------------------------+
  1022.               | SioRxFlush |  Flushes (clears) the receive buffer.                       |
  1023.               +------------+-------------------------------------------------------------+
  1024.  
  1025.  
  1026.                 Syntax    int SioRxFlush(int Port)
  1027.                           /* Port: Port selected (COM1 thru COM16) */
  1028.  
  1029.                Remarks    The SioRxFlush  function  will  delete  any  characters  in  the
  1030.                           receive  buffer  for  the  specified port.  After execution, the
  1031.                           receive buffer will be empty.  Call SioRxBuf after  resetting  a
  1032.                           port in order to delete any spurious characters.
  1033.  
  1034.                Returns    -2 : Port not enabled. Call SioReset first.
  1035.                           -4 : No such port. Expect 0 to MaxPort.
  1036.  
  1037.               See Also    SioRxQue.
  1038.  
  1039.  
  1040.  
  1041.  
  1042.  
  1043.  
  1044.  
  1045.  
  1046.  
  1047.  
  1048.  
  1049.  
  1050.               +-------------+------------------------------------------------------------+
  1051.               |  SioRxQue   |  Returns the number of bytes in the receive queue.         |
  1052.               +-------------+------------------------------------------------------------+
  1053.  
  1054.  
  1055.                 Syntax    int SioRxQue(int Port)
  1056.                           /* Port: Port selected (COM1 thru COM16) */
  1057.  
  1058.                Remarks    The  SioRxQue  function  will return the number of characters in
  1059.                           the receive queue at the time of the call. It  can  be  used  to
  1060.                           implement XON/XOFF flow control.
  1061.  
  1062.                Returns    -2 : Port not enabled. Call SioReset first.
  1063.                           -4 : No such port. Expect 0 to MaxPort.
  1064.  
  1065.               See Also     SioRxFlush.
  1066.  
  1067.  
  1068.  
  1069.  
  1070.  
  1071.  
  1072.  
  1073.  
  1074.  
  1075.  
  1076.  
  1077.  
  1078.  
  1079.  
  1080.  
  1081.  
  1082.  
  1083.  
  1084.  
  1085.  
  1086.  
  1087.  
  1088.              PCL4W Reference Manual                                            Page 16
  1089.               +------------+-------------------------------------------------------------+
  1090.               |  SioTxBuf  |  Sets up transmitter buffer.                                |
  1091.               +------------+-------------------------------------------------------------+
  1092.  
  1093.  
  1094.                 Syntax    int SioTxBuf(int Port,int Selector,int SizeCode)
  1095.                           /* Port:     Port selected (COM1 thru COM16) */
  1096.                           /* Selector: Receive buffer selector */
  1097.                           /* SizeCode: Buffer size code */
  1098.  
  1099.                           int Port;     /* Port selected (COM1 thru COM16) */
  1100.                           char *Buffer; /* Transmit buffer */
  1101.                           int SizeCode; /* Buffer size code */
  1102.  
  1103.                Remarks     The  SioTxBuf  function passes the address selector and size of
  1104.                           the transmit buffer to PCL4W, provided that you will link with a
  1105.                           PCL4W  library  with  transmitter  interrupts  enabled.    PCL4W
  1106.                           requires  a  transmit  buffer  for  each  port  in  simultaneous
  1107.                           operation if you are using  the  version  of  the  library  with
  1108.                           transmitter interrupts enabled (PCL4W2.LIB).  SioTxBuf() must be
  1109.                           called before SioReset.
  1110.  
  1111.                           Size Code       Buffer Size    PCL4W.H Name
  1112.                              4            128 bytes        Size128
  1113.                              5            256 bytes        Size256
  1114.                              6            512 bytes        Size512
  1115.                              7           1024 bytes        Size1024 or Size1K
  1116.                              8           2048 bytes        Size2048 or Size2K
  1117.                              9           4096 bytes        Size4096 or Size4K
  1118.                             10           8192 bytes        Size8192 or Size8K
  1119.                             11          16384 bytes        Size16384 or Size16K
  1120.                             12          32768 bytes        Size32768 or Size32K
  1121.  
  1122.                           This function is not used unless the transmitter interrupts  are
  1123.                           enabled  (PCL4W2.LIB).  Refer  to  the  PCL4W  Users  Manual for
  1124.                           information on transmitter (TX) interrupts.
  1125.  
  1126.                Returns     -4 : No such port. Expect 0 to MaxPort.
  1127.                           -10 : Bad buffer size code. Expecting 0 to 11.
  1128.  
  1129.               See Also    SioRxBuf, SioReset and Code Examples.
  1130.  
  1131.  
  1132.               +------------+-------------------------------------------------------------+
  1133.               | SioTxFlush |  Flushes (clears) the transmitter buffer.                   |
  1134.               +------------+-------------------------------------------------------------+
  1135.  
  1136.  
  1137.                 Syntax    int SioTxFlush(int Port)
  1138.                           /* Port: Port selected (COM1 thru COM16) */
  1139.  
  1140.                Remarks    The SioTxFlush  function  will  delete  any  characters  in  the
  1141.                           transmit  buffer  for the specified port, provided that you will
  1142.                           link with a PCL4W library with transmitter  interrupts  enabled.
  1143.                           After execution, the transmit buffer will be empty.
  1144.  
  1145.                           Once  this  function is called, any character  in  the  transmit
  1146.                           buffer  (put  there  by  SioPutc) will be lost and therefore not
  1147.                           transmitted. This function is not used  unless  the  transmitter
  1148.                           interrupts  are  enabled  Refer  to  the  PCL4W Users Manual for
  1149.                           information on transmitter (TX) interrupts.
  1150.  
  1151.                Returns    -2 : Port not enabled. Call SioReset first.
  1152.                           -4 : No such port. Expect 0 to MaxPort.
  1153.  
  1154.               See Also    SioTxQue.
  1155.  
  1156.              PCL4W Reference Manual                                            Page 17
  1157.               +------------+-------------------------------------------------------------+
  1158.               |  SioTxQue  |  Returns the number of bytes in the transmit queue.         |
  1159.               +------------+-------------------------------------------------------------+
  1160.  
  1161.  
  1162.                 Syntax    int SioTxQue(int Port)
  1163.                           /* Port: Port selected (COM1 thru COM16) */
  1164.  
  1165.                Remarks    The SioTxQue function will return the number  of  characters  in
  1166.                           the  transmit  queue  at the time of the call, provided that you
  1167.                           will link with  a  PCL4W  library  with  transmitter  interrupts
  1168.                           enabled.
  1169.  
  1170.                           This function is not used unless the transmitter interrupts  are
  1171.                           enabled.  Refer  to  the  PCL4W  Users Manual for information on
  1172.                           transmitter (TX) interrupts.
  1173.  
  1174.                Returns    -2 : Port not enabled. Call SioReset first.
  1175.                           -4 : No such port. Expect 0 to MaxPort.
  1176.  
  1177.               See Also     SioTxFlush.
  1178.  
  1179.  
  1180.  
  1181.  
  1182.  
  1183.  
  1184.  
  1185.               +------------+-------------------------------------------------------------+
  1186.               |  SioUART   |  Sets the UART base address.                                |
  1187.               +------------+-------------------------------------------------------------+
  1188.  
  1189.  
  1190.                 Syntax    int SioUART(int Port,int Address)
  1191.                           /* Port:    Port selected (COM1 thru COM16) */                           int Port;     /* COM1 to COM4 */
  1192.                           /* Address: UART address */
  1193.  
  1194.                Remarks    The  SioUART  function  sets  the  UART  base  address  for  the
  1195.                           specified port.  SioUART must be called before SioReset in order
  1196.                           to have effect.  Be extremely sure that you know  what  you  are
  1197.                           doing!   Note   that  PCL4W  uses  the  standard  PC/XT/AT  port
  1198.                           addresses,  interrupt  request  lines,  and  interrupt   service
  1199.                           vectors.   Therefore,   this   function   is   only  needed  for
  1200.                           non-standard ports.
  1201.  
  1202.                Returns    >0 : The previous base address for this port.
  1203.                           -4 : No such port.  Expect 0 to MaxPort.
  1204.                          -15 : Port already enabled.  SioReset has already been called.
  1205.  
  1206.               See Also    SioPorts, SioIRQ, and SioReset.
  1207.  
  1208.  
  1209.  
  1210.  
  1211.  
  1212.  
  1213.  
  1214.  
  1215.  
  1216.  
  1217.  
  1218.  
  1219.  
  1220.  
  1221.  
  1222.  
  1223.  
  1224.              PCL4W Reference Manual                                            Page 18
  1225.               +------------+-----+-------------------------------------------------------+
  1226.               | SioUnGetc  |  "Un|gets" the last character read with SioGetc().          |
  1227.               +------------+-----+-------------------------------------------------------+
  1228.  
  1229.  
  1230.                 Syntax    int SioUnGetc(int Port,char Ch)
  1231.                           /* Port: Port selected (COM1 thru COM16) */
  1232.                           /* Ch:   Character to unget */
  1233.  
  1234.                Remarks    The SioUnGetc function returns  ("pushes")  the  character  back
  1235.                           into  the serial input buffer.  The character pushed will be the
  1236.                           next character returned by SioGetc.  Only one character  can  be
  1237.                           pushed back. This function works just like the "ungetc" function
  1238.                           in the C language.
  1239.  
  1240.                Returns    -2 : Port not enabled. Call SioReset first.
  1241.                           -4 : No such port. Expect 0 to MaxPort.
  1242.  
  1243.               See Also    SioReset.
  1244.  
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.  
  1259.  
  1260.  
  1261.  
  1262.  
  1263.  
  1264.  
  1265.  
  1266.  
  1267.  
  1268.  
  1269.  
  1270.  
  1271.  
  1272.  
  1273.  
  1274.  
  1275.  
  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.                    | SioGetDiv   | Port     |          |          |          |
  1311.                    | SioGetc     | Port     |          |          |          |
  1312.                    | SioInfo     | Cmd      |          |          |          |
  1313.                    | SioIRQ      | Port     | IRQcode  | ISRcode  |          |
  1314.                    | SioLine     | Port     |          |          |          |
  1315.                    | SioLoopBack | Port     |          |          |          |
  1316.                    | SioModem    | Port     | Mask     |          |          |
  1317.                    | SioParms    | Port     | Parity   | StopBits |WordLength|
  1318.                    | SioPorts    | NbrPorts | FirstDBP |StatusReg | Code     |
  1319.                    | SioPutc     | Port     | Ch       |          |          |
  1320.                    | SioRead     | Port     | Register |          |          |
  1321.                    | SioReset    | Port     | BaudCode |          |          |
  1322.                    | SioRI       | Port     |          |          |          |
  1323.                    | SioRTS      | Port     | Cmd      |          |          |
  1324.                    | SioRxBuf    | Port     | Buffer   | SizeCode |          |
  1325.                    | SioRxFlush  | Port     |          |          |          |
  1326.                    | SioRxQue    | Port     |          |          |          |
  1327.                    | SioTxBuf    | Port     | Buffer   | SizeCode |          |
  1328.                    | SioTxFlush  | Port     |          |          |          |
  1329.                    | SioTxQue    | Port     |          |          |          |
  1330.                    | SioUART     | Port     | Address  |          |          |
  1331.                    | SioUnGetc   | Port     | Ch       |          |          |
  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.                                        Code Examples
  1391.  
  1392.  
  1393.               SioRxBuf() Example
  1394.  
  1395.               dwValue = GlobalDosAlloc(1024));
  1396.               if(dwValue)
  1397.                 {/* get selector & lock */
  1398.                  RxSelector = LOWORD(dwValue);
  1399.                  GlobalPageLock(RxSelector);
  1400.                  /* pass selector to PCL4W */
  1401.                  SioRxBuf(Port,RxSelector,Size1024);
  1402.                 }
  1403.  
  1404.               DigiBoard Example
  1405.  
  1406.               /* use 0x140 for odd IRQs & 0x141 for even IRQs */
  1407.               SioPorts(8,COM1,0x140,DIGIBOARD);
  1408.               for(i=COM1;i<=COM16;i++)
  1409.                 {/* set DigiBoard UART addresses */
  1410.                  SioUART(i,0x100+8*i);
  1411.                  /* set DigiBoard for IRQ5 */
  1412.                  SioIRQ(i,IRQ5);
  1413.                 }
  1414.  
  1415.               BOCA Board Example
  1416.  
  1417.               /* use base port + 7 */
  1418.               SioPorts(16,COM1,0x100+7,BOCABOARD);
  1419.               for(i=COM1;i<=COM16;i++)
  1420.                 {/* set BOCA Board UART addresses */
  1421.                  SioUART(i,0x100+8*i);
  1422.                  /* set DigiBoard for IRQ5 */
  1423.                  SioIRQ(i,IRQ5);
  1424.                 }
  1425.  
  1426.  
  1427.  
  1428.              PCL4W Reference Manual                                            Page 21
  1429.