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 > DlnGpioPinIsEnabled() Function

DlnGpioPinIsEnabled() Function

The DlnGpioPinIsEnabled() function informs whether the GPIO module currently uses the pin.

Syntax
C/C++
DLN_RESULT DlnGpioPinIsEnabled(
   HDLN handle,
   uint8_t pin, 
   uint8_t* enabled
);
Parameters
handle

A handle to a DLN-series adapter.

pin

A number of the pin that you want to check.

enabled

A pointer to an unsigned 8-bit integer. After the function execution, this integer is set to one of the following values:

ValueDescription

1

The pin is configured as GPIO.

0

The pin is NOT configured as GPIO.

Return Value
DLN_RES_SUCCESS (0x00)

The function successfully retrieved the pin information.

DLN_RES_INVALID_PIN_NUMBER ( 0xAB)

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

Remarks

To connect the pin with the GPIO module, use the DlnGpioPinEnable() [2] function. To disconnect the pin assigned to the GPIO module, call the DlnGpioPinDisable() [3] function.

To check which module uses the pin, use the DlnGetPinCfg() [4]function.

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


Links:
[1] http://dlnware.com/dll/DlnGpioGetPinCount
[2] http://dlnware.com/dll/DlnGpioPinEnable
[3] http://dlnware.com/dll/DlnGpioPinDisable
[4] http://dlnware.com/dll/DlnGetPinCfg-0