Вы здесь

DlnGpioPinGetDirection() Function

The DlnGpioPinGetDirection() function retrieves current direction of a GPIO pin.

Syntax
C/C++
DLN_RESULT DlnGpioPinGetDirection(
   HDLN handle,
   uint8_t pin,
   uint8_t* direction
);
Parameters
handle

A handle to the DLN-series adapter.

pin

A number of the GPIO pin that you want to check.

direction

A pointer to an unsigned 8-bit integer. After the function execution, the integer will be filled with the pin current direction. Possible values:

ValueDescription

1

The pin is an output.

0

The pin is an input.

Return Value
DLN_RES_SUCCESS (0x00)

The function successfully retrieved the pin direction.

DLN_RES_INVALID_PIN_NUMBER (0xAB)

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

Remarks

If the pin is not currently assigned to the GPIO module, the pin direction setting is got from internal memory where it is saved when you define it. To change the current pin direction, use the DlnGpioPinSetDirection() function.

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

Языки

Вход на сайт