Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Header: #include <applibs/gpio.h>
Gets the current value of a GPIO.
GPIO functions are thread-safe between calls to different GPIOs; however, it is the caller’s responsibility to ensure thread safety for accesses to the same GPIO.
int GPIO_GetValue(int gpioFd, GPIO_Value_Type *outValue);
Parameters
gpioFdThe file descriptor for the GPIO.outValueThe GPIO_Value read from the GPIO - GPIO_Value_High or GPIO_Value_Low.
Errors
Returns -1 if an error is encountered and sets errno to the error value.
EFAULT: the
outValueis NULL.EBADF: the
gpioFdis not valid.
Any other errno may also be specified; such errors aren't deterministic and the same behavior might not be retained through system updates.
Return value
Returns 0 for success, or -1 for failure, in which case errno will be set to the error value.
Application manifest requirements
To access individual GPIOs, your application must identify them in the Gpio field of the application manifest.