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>
Opens a GPIO (General Purpose Input/Output) as an input.
Call GPIO_GetValue on an open input GPIO to read the input value.
A GPIO_SetValue call on an open input GPIO will have no effect.
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_OpenAsInput(GPIO_Id gpioId);
Parameters
gpioIdA GPIO_Id that identifies the GPIO.
Errors
Returns -1 if an error is encountered and sets errno to the error value.
EACCES: access to
gpioIdis not permitted as the GPIO is not listed in the Gpio field of the application manifest.ENODEV: the provided
gpioIdis invalid.EBUSY: the
gpioIdis already open.
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 a file descriptor for the opened GPIO on success, or -1 for failure, in which case errno is 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.