Function rc_gpio_poll#
Defined in File gpio.h
Function Documentation#
-
int rc_gpio_poll(int chip, int pin, int timeout_ms, uint64_t *event_time_ns)#
polls a pin when configured for interrupt event polling
This polls for an event and then reads one event from the queue.
- Parameters:
chip – [in] The chip number, /dev/gpiochipX
pin – [in] The pin ID
timeout_ms – [in] The timeout in milliseconds. Negative value causes infinite timeout, a value of 0 makes the function return immediately after reading an event in the queue.
event_time_ns – [out] pointer where the time of the gpio event occured. Units are nanoseconds since epoch. Set this as NULL if you don’t want to keep the time.
- Returns:
returns RC_GPIO_EVENT_ERROR, RC_GPIO_EVENT_TIMEOUT, RC_GPIO_EVENT_RISING_EDGE, or RC_GPIO_EVENT_FALLING_EDGE to indicate what happened.