31 #ifndef IOTBUS_GPIO_H_ 32 #define IOTBUS_GPIO_H_ 34 #include <tinyara/config.h> 44 IOTBUS_GPIO_DRIVE_PULLUP = 0,
45 IOTBUS_GPIO_DRIVE_PULLDOWN = 1,
46 IOTBUS_GPIO_DRIVE_FLOAT = 2,
58 IOTBUS_GPIO_DIRECTION_NONE = 0,
59 IOTBUS_GPIO_DIRECTION_OUT = 1,
60 IOTBUS_GPIO_DIRECTION_IN = 2,
73 IOTBUS_GPIO_EDGE_NONE = 0,
74 IOTBUS_GPIO_EDGE_BOTH = 1,
75 IOTBUS_GPIO_EDGE_RISING = 2,
76 IOTBUS_GPIO_EDGE_FALLING = 3
79 struct _iotbus_gpio_s;
90 typedef void (*gpio_isr_cb)(
void *user_data);
246 #ifndef CONFIG_DISABLE_SIGNALS struct _iotbus_gpio_wrapper_s * iotbus_gpio_context_h
Pointer definition to the internal struct _iotbus_gpio_wrapper_s.
int iotbus_gpio_get_edge_mode(iotbus_gpio_context_h dev, iotbus_gpio_edge_e *edge)
gets a edge mode of the gpio.
int iotbus_gpio_set_direction(iotbus_gpio_context_h dev, iotbus_gpio_direction_e dir)
sets gpio direction.
int iotbus_gpio_close(iotbus_gpio_context_h dev)
closes the gpio_context.
int iotbus_gpio_get_pin(iotbus_gpio_context_h dev)
gets a pin number of the gpio.
int iotbus_gpio_unregister_cb(iotbus_gpio_context_h dev)
unregisters event handler callback for interrupt.
iotbus_gpio_edge_e
Enumeration of Gpio edge type for interrupt.
int iotbus_gpio_get_drive_mode(iotbus_gpio_context_h dev, iotbus_gpio_drive_e *drive)
gets a drive mode of the gpio.
int iotbus_gpio_set_edge_mode(iotbus_gpio_context_h dev, iotbus_gpio_edge_e edge)
sets the edge mode on the gpio.
iotbus_gpio_context_h iotbus_gpio_open(int gpiopin)
initializes gpio_context based on gpio pin.
int iotbus_gpio_write(iotbus_gpio_context_h dev, int value)
writes to the gpio value.
int iotbus_gpio_get_direction(iotbus_gpio_context_h dev, iotbus_gpio_direction_e *dir)
gets a direction of the gpio.
iotbus_gpio_drive_e
Enumeration of Gpio output mode.
int iotbus_gpio_register_signal(iotbus_gpio_context_h dev, iotbus_gpio_edge_e edge)
registers a signal for current on rising or falling edge of gpio
int iotbus_gpio_register_cb(iotbus_gpio_context_h dev, iotbus_gpio_edge_e edge, gpio_isr_cb isr_cb, void *user_data)
registers event handler callback for interrupt.
iotbus_gpio_direction_e
Enumeration of Gpio direction options.
int iotbus_gpio_read(iotbus_gpio_context_h dev)
reads the gpio value.
int iotbus_gpio_set_drive_mode(iotbus_gpio_context_h dev, iotbus_gpio_drive_e drive)
sets gpio output mode.