Вы здесь

DlnGpioPinGetVal() Function

The DlnGpioPinGetVal() function retrieves the current value on the specified GPIO pin.

Syntax
C/C++
DLN_RESULT DlnGpioPinGetVal(
   HDLN handle, 
   uint8_t pin,
   uint8_t* value
);
Parameters
handle

A handle to the DLN-series adapter.

pin

A number of the pin which value you want to know.

value

A pointer to an unsigned 8-bit integer. After the function execution, this integer will be set to the pin value.

Return Value
DLN_RES_SUCCESS (0x00)

The function retrieved the current pin value successfully.

DLN_RES_INVALID_PIN_NUMBER (0xAB)

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

Remarks

The DlnGpioPinGetVal() function retrieves the value on the pin regardless of its direction. To check the GPIO pin direction, use the DlnGpioPinGetDirection() function. You can change the pin output value by using the DlnGpioPinSetOutVal() function.

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

Языки

Вход на сайт