Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ sif_setup(3) — CLIX 3.1r7.6.22

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

sif_open(3)



  sifsetup(3)                        CLIX                        sifsetup(3)



  NAME

    sif_setup - Establishes parameters for a Scanner Interface (SIF) channel

  LIBRARY

    Intergraph XIO Library (libxi.a)

  SYNOPSIS

    #include <sys/xio/xerr.h>

    #include <sys/xio/xsif.h>

    int sif_setup(
      int channel ,
      int resolution ,
      int linewidth ,
      int swathsize ,
      int mode );

  PARAMETERS

    channel      Specifies the Scanner Interface (SIF) board for which the
                 setup data is intended.  The channel numbers start with 0.
                 Therefore the largest valid channel is one less than number
                 of SIF boards in the system.

    resolution   Specifies the resolution of the scanned data.  This parameter
                 is dependent on the hardware in use.  The valid values for
                 resolution are 256, 512 and 1024.

    linewidth    Decreases the amount of data received.  For each packet of
                 data received from the scanner, only the first linewidth
                 bytes are transferred to the user's buffer.  The size of the
                 packet is indicated by the resolution parameter.  The valid
                 values for linewidth are 32, 64, 128, 256, 512 and 1024.  The
                 value of linewidth must always be less than resolution.

    swathsize    Controls the number of lines per swath.

    mode         Determines the color mode in which the SIF will operate.  It
                 can also be used to put the driver into low memory mode.  The
                 following are valid values for mode and are defined in
                 <sys/xio/xsif.h>:

                 SIF_MONO_RED
                        Scan in monocolor mode using the red component.

                 SIF_MONO_GREEN
                        Scan in monocolor mode using the green component.



  2/94 - Intergraph Corporation                                              1






  sifsetup(3)                        CLIX                        sifsetup(3)



                 SIF_MONO_BLUE
                        Scan in monocolor mode using the blue component.

                 SIF_COLOR
                        Scan in color mode using all three components.

                 The SIF_LOW_BUF flag can be manipulated with a logical OR
                 with one of the four values listed above to put the SIF into
                 low memory mode.

  DESCRIPTION

    The sif_setup() function establishes Direct Memory Access (DMA) parameters
    for the specified SIF channel.  The channel parameter must have been
    opened with sif_open().

    The resolution and linewidth parameters are used together to determine the
    data hardware rejects automatically.  This should reduce memory and time
    requirements for the system.  If the concepts of resolution and linewidth
    do not apply, they should be set the same.

    For systems without a large amount of memory, the SIF can operate in the
    low memory mode.  This mode is used with sif_scan_mem_nw().  In normal
    operation mode sif_scan_mem_nw() passes the driver one buffer into which
    the data is scanned.  When the driver is put into the low memory mode,
    sif_scan_mem_nw() is still used to initiate the scan but does not pass the
    driver any buffer information.  Instead sif_lowmembuf_nw() is used to pass
    multiple buffers to use for the scan.  Once put into low memory mode, the
    SIF driver stays in this mode until another sif_setup() is called.

  EXAMPLES

    The following example shows how to set up scanner parameters:

    /*
     * Open sif device
     */

    err = sif_setup(chan, 1024, 256, swath, SIF_COLOR);

    if (err) {
         printf("Error in setup %d\n", err);
         exit(1);
    }


  FILES

    /usr/include/sys/xio/xerr.h   XIO error file

    /usr/include/sys/xio/xsif.h   Mode values file



  2                                              Intergraph Corporation - 2/94






  sifsetup(3)                        CLIX                        sifsetup(3)



  RETURN VALUES

    The function returns a value of 0 if successful.  If unsuccessful, the
    function returns one of the failure codes listed in the ERRORS section.

  ERRORS

    The sif_setup() function fails if one of the following is true:

    [XIO_FAILURE]
           The system does not contain the driver needed to support this
           request.

    [SIF_CHANNEL_INVALID]
           The specified channel is beyond the maximum allowed.

    [SIF_CHANNEL_NOT_OPEN]
           The specified channel is not open for this process.

    [SIF_INVALID_PARMS]
           The values for resolution and linewidth do not meet the stated
           requirements.

  RELATED INFORMATION

    Functions:  sif_open(3)

    Files:  xsif.ft 2 (7)


























  2/94 - Intergraph Corporation                                              3




Typewritten Software • bear@typewritten.org • Edmonds, WA 98026