USB-I2C/SPI/GPIO Interface Adapters
Published on USB-I2C/SPI/GPIO Interface Adapters (https://dlnware.com)

Home > C/C++ API > GPIO Interface > GPIO Interface Functions > DlnGpioPinEnable() Function

DlnGpioPinEnable() Function

The DlnGpioPinEnable() function connects a pin to the GPIO module.

Syntax
C/C++
DLN_RESULT DlnGpioPinEnable(
    HDLN handle,
    uint8_t pin
);
Parameters
handle

A handle to a DLN-series adapter.

pin

A number of the pin that you want to configure.

Return Value
DLN_RES_SUCCESS (0x00)

The function successfully connected the pin to the GPIO module.

DLN_RES_INVALID_PIN_NUMBER (0xAB)

The pin number is not valid. Use the DlnGpioGetPinCount() [1] function to find the maximum possible pin number.

DLN_RES_PIN_IN_USE (0xA5)

Another module uses the pin and the GPIO module cannot use it. Use the DlnGetPinCfg() [2]function to get the name of module using the pin.

Remarks

If you have not changed the configuration settings for the pin which you want to configure as a GPIO, it will have the default configuration. See Digital Input Events [3] for details.

The DlnGpioPinEnable() function is declared in the dln_gpio.h file.


Links:
[1] http://dlnware.com/dll/DlnGpioGetPinCount
[2] http://dlnware.com/dll/DlnGetPinCfg-0
[3] http://dlnware.com/dll/Digital-Input-Events