| mraa
    1.9.0
    Low Level Skeleton Library for Communication on GNU/Linux platforms | 
Gpio is the General Purpose IO interface to libmraa. Its features depend on the board type used, it can use gpiolibs (exported via a kernel module through sysfs), or memory mapped IO via a /dev/uio device or /dev/mem depending again on the board configuration.
Go to the source code of this file.
| Typedefs | |
| typedef struct _gpio * | mraa_gpio_context | 
| Enumerations | |
| enum | mraa_gpio_mode_t { MRAA_GPIO_STRONG = 0, MRAA_GPIO_PULLUP = 1, MRAA_GPIO_PULLDOWN = 2, MRAA_GPIO_HIZ = 3 } | 
| enum | mraa_gpio_dir_t { MRAA_GPIO_OUT = 0, MRAA_GPIO_IN = 1, MRAA_GPIO_OUT_HIGH = 2, MRAA_GPIO_OUT_LOW = 3 } | 
| enum | mraa_gpio_edge_t { MRAA_GPIO_EDGE_NONE = 0, MRAA_GPIO_EDGE_BOTH = 1, MRAA_GPIO_EDGE_RISING = 2, MRAA_GPIO_EDGE_FALLING = 3 } | 
| enum | mraa_gpio_input_mode_t { MRAA_GPIO_ACTIVE_HIGH = 0, MRAA_GPIO_ACTIVE_LOW = 1 } | 
| enum | mraa_gpio_out_driver_mode_t { MRAA_GPIO_OPEN_DRAIN = 0, MRAA_GPIO_PUSH_PULL = 1 } | 
| mraa_gpio_context mraa_gpio_init | ( | int | pin | ) | 
Initialise gpio_context, based on board number
| pin | Pin number read from the board, i.e IO3 is 3 | 

| mraa_gpio_context mraa_gpio_init_raw | ( | int | gpiopin | ) | 
Initialise gpio context without any mapping to a pin
| gpiopin | gpio pin as listed in SYSFS | 

| mraa_result_t mraa_gpio_edge_mode | ( | mraa_gpio_context | dev, | 
| mraa_gpio_edge_t | mode | ||
| ) | 
Set the edge mode on the gpio
| dev | The Gpio context | 
| mode | The edge mode to set the gpio into | 

| mraa_result_t mraa_gpio_isr | ( | mraa_gpio_context | dev, | 
| mraa_gpio_edge_t | edge, | ||
| void(*)(void *) | fptr, | ||
| void * | args | ||
| ) | 
Set an interrupt on pin
| dev | The Gpio context | 
| edge | The edge mode to set the gpio into | 
| fptr | Function pointer to function to be called when interrupt is triggered | 
| args | Arguments passed to the interrupt handler (fptr) | 

| mraa_result_t mraa_gpio_isr_exit | ( | mraa_gpio_context | dev | ) | 
Stop the current interrupt watcher on this Gpio, and set the Gpio edge mode to MRAA_GPIO_EDGE_NONE
| dev | The Gpio context | 

| mraa_result_t mraa_gpio_mode | ( | mraa_gpio_context | dev, | 
| mraa_gpio_mode_t | mode | ||
| ) | 
Set Gpio Output Mode,
| dev | The Gpio context | 
| mode | The Gpio Output Mode | 

| mraa_result_t mraa_gpio_dir | ( | mraa_gpio_context | dev, | 
| mraa_gpio_dir_t | dir | ||
| ) | 
Set Gpio direction
| dev | The Gpio context | 
| dir | The direction of the Gpio | 

| mraa_result_t mraa_gpio_read_dir | ( | mraa_gpio_context | dev, | 
| mraa_gpio_dir_t * | dir | ||
| ) | 
Read Gpio direction
| dev | The Gpio context | 
| dir | The address where to store the Gpio direction | 

| mraa_result_t mraa_gpio_close | ( | mraa_gpio_context | dev | ) | 
Close the Gpio context
| dev | The Gpio context | 

| int mraa_gpio_read | ( | mraa_gpio_context | dev | ) | 
Read the Gpio value. This can be 0 or 1. A resonse of -1 means that there was a fatal error.
| dev | The Gpio context | 

| mraa_result_t mraa_gpio_write | ( | mraa_gpio_context | dev, | 
| int | value | ||
| ) | 
Write to the Gpio Value.
| dev | The Gpio context | 
| value | Integer value to write | 

| mraa_result_t mraa_gpio_owner | ( | mraa_gpio_context | dev, | 
| mraa_boolean_t | owner | ||
| ) | 
Change ownership of the context.
| dev | The Gpio context | 
| owner | Does this context own the pin | 

| mraa_result_t mraa_gpio_use_mmaped | ( | mraa_gpio_context | dev, | 
| mraa_boolean_t | mmap | ||
| ) | 
Enable using memory mapped io instead of sysfs
| dev | The Gpio context | 
| mmap | Use mmap instead of sysfs | 

| int mraa_gpio_get_pin | ( | mraa_gpio_context | dev | ) | 
Get a pin number of the gpio, invalid will return -1
| dev | The Gpio context | 

| int mraa_gpio_get_pin_raw | ( | mraa_gpio_context | dev | ) | 
Get a gpio number as used within sysfs, invalid will return -1
| dev | The Gpio context | 

| mraa_result_t mraa_gpio_input_mode | ( | mraa_gpio_context | dev, | 
| mraa_gpio_input_mode_t | mode | ||
| ) | 
Set Gpio input mode
| dev | The Gpio context | 
| mode | Mode to set input pin state | 

| mraa_result_t mraa_gpio_out_driver_mode | ( | mraa_gpio_context | dev, | 
| mraa_gpio_out_driver_mode_t | mode | ||
| ) | 
Set Gpio output driver mode. This is not a standard feature, it needs custom implementation for each board
| dev | The Gpio context | 
| mode | Set output driver mode | 

| typedef struct _gpio* mraa_gpio_context | 
Opaque pointer definition to the internal struct _gpio
| enum mraa_gpio_mode_t | 
| enum mraa_gpio_dir_t | 
| enum mraa_gpio_edge_t | 

 1.8.11
 1.8.11