mraa
0.6.0
Low Level Skeleton Library for Communication on GNU/Linux platforms
|
Gpio is the General Purpose IO interface to libmraa. It's features depends 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 configuratio, 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.
Functions | |
mraa_gpio_context | mraa_gpio_init (int pin) |
mraa_gpio_context | mraa_gpio_init_raw (int gpiopin) |
mraa_result_t | mraa_gpio_edge_mode (mraa_gpio_context dev, gpio_edge_t mode) |
mraa_result_t | mraa_gpio_isr (mraa_gpio_context dev, gpio_edge_t edge, void(*fptr)(void *), void *args) |
mraa_result_t | mraa_gpio_isr_exit (mraa_gpio_context dev) |
mraa_result_t | mraa_gpio_mode (mraa_gpio_context dev, gpio_mode_t mode) |
mraa_result_t | mraa_gpio_dir (mraa_gpio_context dev, gpio_dir_t dir) |
mraa_result_t | mraa_gpio_close (mraa_gpio_context dev) |
int | mraa_gpio_read (mraa_gpio_context dev) |
mraa_result_t | mraa_gpio_write (mraa_gpio_context dev, int value) |
mraa_result_t | mraa_gpio_owner (mraa_gpio_context dev, mraa_boolean_t owner) |
mraa_result_t | mraa_gpio_use_mmaped (mraa_gpio_context dev, mraa_boolean_t mmap) |
int | mraa_gpio_get_pin (mraa_gpio_context dev) |
int | mraa_gpio_get_pin_raw (mraa_gpio_context dev) |
Typedefs | |
typedef struct _gpio * | mraa_gpio_context |
Enumerations | |
enum | gpio_mode_t { MRAA_GPIO_STRONG = 0, MRAA_GPIO_PULLUP = 1, MRAA_GPIO_PULLDOWN = 2, MRAA_GPIO_HIZ = 3 } |
enum | gpio_dir_t { MRAA_GPIO_OUT = 0, MRAA_GPIO_IN = 1, MRAA_GPIO_OUT_HIGH = 2, MRAA_GPIO_OUT_LOW = 3 } |
enum | gpio_edge_t { MRAA_GPIO_EDGE_NONE = 0, MRAA_GPIO_EDGE_BOTH = 1, MRAA_GPIO_EDGE_RISING = 2, MRAA_GPIO_EDGE_FALLING = 3 } |
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, |
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, |
gpio_edge_t | edge, | ||
void(*)(void *) | fptr, | ||
void * | args | ||
) |
Set an interupt on pin
dev | The Gpio context |
edge | The edge mode to set the gpio into |
fptr | Function pointer to function to be called when interupt is triggered |
args | Arguments passed to the interrupt handler (fptr) |
mraa_result_t mraa_gpio_isr_exit | ( | mraa_gpio_context | dev | ) |
Stop the current interupt 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, |
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, |
gpio_dir_t | dir | ||
) |
Set Gpio direction
dev | The Gpio context |
dir | The direction of the Gpio |
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
dev | The Gpio context |
int mraa_gpio_get_pin_raw | ( | mraa_gpio_context | dev | ) |
Get a gpio number as used within sysfs
dev | The Gpio context |
typedef struct _gpio* mraa_gpio_context |
Opaque pointer definition to the internal struct _gpio
enum gpio_mode_t |
enum gpio_dir_t |
enum gpio_edge_t |