Robot Control Library
gpio.h File Reference
#include <stdint.h>

Go to the source code of this file.

Macros

#define GPIOHANDLE_REQUEST_INPUT   (1UL << 0)
 
#define GPIOHANDLE_REQUEST_OUTPUT   (1UL << 1)
 
#define GPIOHANDLE_REQUEST_ACTIVE_LOW   (1UL << 2)
 
#define GPIOHANDLE_REQUEST_OPEN_DRAIN   (1UL << 3)
 
#define GPIOHANDLE_REQUEST_OPEN_SOURCE   (1UL << 4)
 
#define GPIOEVENT_REQUEST_RISING_EDGE   (1UL << 0)
 
#define GPIOEVENT_REQUEST_FALLING_EDGE   (1UL << 1)
 
#define GPIOEVENT_REQUEST_BOTH_EDGES   ((1UL << 0) | (1UL << 1))
 
#define RC_GPIOEVENT_ERROR   -1
 
#define RC_GPIOEVENT_TIMEOUT   0
 
#define RC_GPIOEVENT_RISING_EDGE   1
 
#define RC_GPIOEVENT_FALLING_EDGE   2
 

Functions

int rc_gpio_init (int chip, int pin, int handle_flags)
 Configures a gpio pin as input or output. More...
 
int rc_gpio_set_value (int chip, int pin, int value)
 Sets the value of a GPIO pin when in output mode. More...
 
int rc_gpio_get_value (int chip, int pin)
 Reads the value of a GPIO pin when in input mode or output mode. More...
 
int rc_gpio_init_event (int chip, int pin, int handle_flags, int event_flags)
 Initializes a pin for interrupt event polling and normal reading. More...
 
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 More...
 
void rc_gpio_cleanup (int chip, int pin)
 closes the file descriptor for a pin More...