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>
Sets the output value for an output GPIO. Only has an effect on GPIOs opened as outputs.
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_SetValue(int gpioFd, GPIO_Value_Type value);
Parameters
gpioFdThe file descriptor for the GPIO.valueThe GPIO_Value value to set - GPIO_Value_High or GPIO_Value_Low.
Errors
Returns -1 if an error is encountered and sets errno to the error value.
EINVAL: the
valueis not a GPIO_Value.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.