|
RocketLogger
1.0
|
#include <stdio.h>#include <stdlib.h>#include <string.h>#include <unistd.h>#include <fcntl.h>#include <poll.h>#include "types.h"#include "log.h"
Include dependency graph for gpio.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Macros | |
| #define | GPIO_PATH "/sys/class/gpio/" |
| Path to linux GPIO device files. More... | |
| #define | MIN_BUTTON_TIME 100000 |
| Minimal time a button needs to be pressed (in µs) More... | |
Typedefs | |
| typedef enum direction | rl_direction |
| typedef enum edge | rl_edge |
Enumerations | |
| enum | direction { IN, OUT } |
| enum | edge { NONE, RISING, FALLING, BOTH } |
Functions | |
| int | gpio_unexport (int num) |
| int | gpio_export (int num) |
| int | gpio_dir (int num, rl_direction dir) |
| int | gpio_set_value (int num, int val) |
| int | gpio_get_value (int num) |
| int | gpio_interrupt (int num, rl_edge e) |
| int | gpio_wait_interrupt (int num, int timeout) |
| #define GPIO_PATH "/sys/class/gpio/" |
Path to linux GPIO device files.
Copyright (c) 2016-2017, ETH Zurich, Computer Engineering Group
Definition at line 16 of file gpio.h.
Referenced by gpio_dir(), gpio_export(), gpio_get_value(), gpio_interrupt(), gpio_set_value(), gpio_unexport(), and gpio_wait_interrupt().
| #define MIN_BUTTON_TIME 100000 |
Minimal time a button needs to be pressed (in µs)
Definition at line 18 of file gpio.h.
Referenced by gpio_wait_interrupt().
| typedef enum direction rl_direction |
GPIO direction definition
| enum direction |
| enum edge |
| int gpio_dir | ( | int | num, |
| rl_direction | dir | ||
| ) |
| int gpio_export | ( | int | num | ) |
| int gpio_get_value | ( | int | num | ) |
| int gpio_interrupt | ( | int | num, |
| rl_edge | edge | ||
| ) |
Set direction of GPIO interrupt edge.
| num | Linux GPIO number. |
| edge | Edge direction. |
Definition at line 92 of file gpio.c.
References BOTH, ERROR, FAILURE, FALLING, GPIO_PATH, MAX_PATH_LENGTH, NONE, RISING, rl_log(), and SUCCESS.
Referenced by gpio_setup().
Here is the call graph for this function:| int gpio_set_value | ( | int | num, |
| int | val | ||
| ) |
Set value of GPIO.
| num | Linux GPIO number. |
| val | Value (0 or 1). |
Definition at line 132 of file gpio.c.
References ERROR, FAILURE, GPIO_PATH, MAX_PATH_LENGTH, rl_log(), and SUCCESS.
Referenced by hw_close(), hw_init(), and hw_sample().
Here is the call graph for this function:| int gpio_unexport | ( | int | num | ) |
| int gpio_wait_interrupt | ( | int | num, |
| int | timeout | ||
| ) |
Wait on GPIO interrupt.
| num | Linux GPIO number. |
| timeout | Maximum waiting time (in ms). Set to 0 for infinite time out. |
Definition at line 188 of file gpio.c.
References ERROR, FAILURE, GPIO_PATH, MAX_PATH_LENGTH, MIN_BUTTON_TIME, and rl_log().
Referenced by main().
Here is the call graph for this function: