DscDIOSetConfig

Universal Driver Documentation
Sets the DIO port configuration for future DIO operations.

Note: See board user manual or 82C55 datasheet (if applicable) for config_byte details.

Table of contents

Function Definition

BYTE dscDIOSetConfig(DSCB board, BYTE* config_bytes);

Function Parameters

NameDescription
boardThe handle of the board to operate on
config_bytesThe value(s) used to configure the digital I/O ports. See each board's user manual for information on the number and definition of the configuration bytes.

Return Value

Error code or 0.

Usage Example

The following code example configures digital I/O direction on a Garnet MM-48. See the Garnet user manual for more information.

    ERRPARAMS errparams;
    BYTE config_bytes[2];

    config_bytes[0] = 0x9b;  // Set all ports on first chip to input
    config_bytes[1] = 0x80;  // Set all ports on second chip to output

    if ((result = dscDIOSetConfig(dscb, config_bytes)) != DE_NONE)
    {
        dscGetLastError(&errparams);
        fprintf(stderr, "dscDIOSetConfig failed: %s (%s)\n", 
                dscGetErrorString(result), errparams.errstring);
        return result;
    }


This page was last modified 20:35, 11 Mar 2004.
Copyright (c) 2004 Diamond Systems. All Rights Reserved.