Dimax English Dimax French Dimax English Dimax Translations
USB-I2C/SPI/GPIO Interface Adapter - U2C-12
Reference Manual

U2C_SetIoDirection


U2C_RESULT U2C_SetIoDirection (
            HANDLE hDevice,
             ULONG Value,
             ULONG Mask
);
 

The U2C_SetIoDirection function configures input/output direction of the GPIO port pins.

Parameters:
hDevice Handle to the U2C-12 device.
Value An unsigned long value specifying the direction of the GPIO. Value is treated as unsigned long 0xXXCCBBAA, where CC, BB and AA correspond to the C, B and A port pins:
  • AA bits 7..0 correspond to Port A pins 7..0
  • BB bits 7..0 correspond to Port B pins 7..0
  • CC bits 7..0 correspond to Port C pins 7..0
  • XX bits 7..0 reserved
Bit set to 1 indicates configuration of the corresponding pin as output.
Bit set to 0 indicates configuration of the corresponding pin as input.
Mask An unsigned long value specifying the data mask to use when modifying the GPIO pins direction. The mask value allows modification of the desired pins only, leaving rest of the pins unchanged. The bit mapping for Mask parameter is exactly the same as for Value parameter. Only direction of the pins with the mask bit set to 1 will be changed.
Return values:
U2C_SUCCESS The GPIO pins direction was successfully modified.
U2C_HARDWARE_NOT_FOUND U2C-12 device referenced by hDevice handle was not found.
            Copyright DIMAX 2002-2012