DlnGpioGetPinCount() Function

The DlnGpioGetPinCount() function retrieves the total number of GPIO pins available in the DLN-series adapter.

Syntax
C/C++
DLN_RESULT DlnGpioGetPinCount(
    HDLN handle,
    uint16_t* count
 );
Parameters
handle

A handle to a DLN-series adapter.

count

A pointer to an unsigned 16-bit integer that receives the number of available GPIO pins.

Return Value
DLN_RES_SUCCESS (0x00)

The function successfully retrieved the GPIO pin count.

Remarks

The DlnGpioGetPinCount() function retrieves the number of pins that can be configured as GPIO. Even the pins that are assigned for other modules (but can be configured as GPIO) will be counted. To check whether a pin is connected to the GPIO module, use the DlnGpioPinIsEnabled() function.

The GPIO functions that accept a pin number as a parameter will return the DLN_RES_INVALID_PIN_NUMBER error code if the specified pin number exceeds the value returned by the DlnGpioGetPinCount() function.

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