Helper functions to make working with GPIO easier.
More...
|
#define | ICSC_GPIO_OUTPUT 0 |
|
#define | ICSC_GPIO_INPUT 1 |
|
Helper functions to make working with GPIO easier.
int icsc_gpio_close |
( |
int |
num | ) |
|
Close a GPIO. Unexports the GPIO node.
- Parameters
-
- Returns
- 0 on success or -1 on error.
int icsc_gpio_open |
( |
int |
num, |
|
|
int |
mode |
|
) |
| |
Open a GPIO device in either input or output mode. Exports the GPIO node.
- Parameters
-
num | GPIO number |
mode | Either ICSC_GPIO_INPUT or ICSC_GPIO_OUTPUT |
- Returns
- 0 on success or -1 on error.
int icsc_gpio_read |
( |
int |
num | ) |
|
Read the value of a GPIO.
- Parameters
-
- Returns
- 1 if the GPIO reads high, 0 if it reads low, or -1 on an error.
int icsc_gpio_write |
( |
int |
num, |
|
|
int |
level |
|
) |
| |
Set a GPIO to high or low.
- Parameters
-
num | GPIO number |
level | 1 for logic high or 0 for logic low |
- Returns
- 0 on success or -1 on error.