|
RocketLogger
2.0.0
|
#include <gpiod.h>#include <time.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_FHR1 30 |
| GPIO number for forcing I1 high. More... | |
| #define | GPIO_FHR2 60 |
| GPIO number for forcing I2 high. More... | |
| #define | GPIO_LED_STATUS 45 |
| GPIO number of status LED. More... | |
| #define | GPIO_LED_ERROR 44 |
| GPIO number of error LED. More... | |
| #define | GPIO_BUTTON 26 |
| GPIO number of start/stop button. More... | |
| #define | GPIO_POWER 31 |
| GPIO number of RocketLogger cape power enable. More... | |
Typedefs | |
| typedef enum gpio_mode | gpio_mode_t |
| typedef enum gpio_interrupt | gpio_interrupt_t |
| typedef struct gpiod_line | gpio_t |
Enumerations | |
| enum | gpio_mode { GPIO_MODE_IN , GPIO_MODE_OUT } |
| enum | gpio_interrupt { GPIO_INTERRUPT_NONE , GPIO_INTERRUPT_RISING , GPIO_INTERRUPT_FALLING , GPIO_INTERRUPT_BOTH } |
Functions | |
| int | gpio_init () |
| void | gpio_deinit () |
| gpio_t * | gpio_setup (int gpio_number, gpio_mode_t mode, const char *name) |
| gpio_t * | gpio_setup_interrupt (int gpio_number, gpio_interrupt_t edge, const char *name) |
| void | gpio_release (gpio_t *gpio) |
| int | gpio_set_value (gpio_t *gpio, int value) |
| int | gpio_get_value (gpio_t *gpio) |
| int | gpio_wait_interrupt (gpio_t *gpio, const struct timespec *timeout) |
| #define GPIO_FHR1 30 |
GPIO number for forcing I1 high.
Copyright (c) 2016-2020, ETH Zurich, Computer Engineering Group All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
| #define GPIO_POWER 31 |
| typedef enum gpio_interrupt gpio_interrupt_t |
GPIO interrupt edge definition
| typedef enum gpio_mode gpio_mode_t |
GPIO direction definition
| enum gpio_interrupt |
| enum gpio_mode |
| void gpio_deinit | ( | ) |
Denitialize GPIO module.
Definition at line 92 of file gpio.c.
References gpio_chip, and GPIO_CHIP_COUNT.
Referenced by hw_deinit().
| int gpio_get_value | ( | gpio_t * | gpio | ) |
| int gpio_init | ( | ) |
Initialize GPIO module.
Definition at line 77 of file gpio.c.
References ERROR, gpio_chip, GPIO_CHIP_COUNT, rl_log(), RL_LOG_ERROR, and SUCCESS.
Referenced by hw_init().
Here is the call graph for this function:| void gpio_release | ( | gpio_t * | gpio | ) |
Release an aquired GPIO resource.
| gpio | The GPIO resource to release |
Definition at line 130 of file gpio.c.
Referenced by hw_deinit().
| int gpio_set_value | ( | gpio_t * | gpio, |
| int | value | ||
| ) |
Set the GPIO value.
| gpio | GPIO resource to set the output value |
| value | GPIO state to set (0 or 1) |
Definition at line 135 of file gpio.c.
References ERROR.
Referenced by hw_deinit(), hw_init(), and hw_sample().
| gpio_t* gpio_setup | ( | int | gpio_number, |
| gpio_mode_t | mode, | ||
| const char * | name | ||
| ) |
Set up a specific GPIO pin for input/output.
| gpio_number | Resource number of the GPIO to set up |
| mode | GPIO mode (input or output) to configure |
| name | Name to label the set up GPIO |
Definition at line 103 of file gpio.c.
Referenced by hw_init().
| gpio_t* gpio_setup_interrupt | ( | int | gpio_number, |
| gpio_interrupt_t | edge, | ||
| const char * | name | ||
| ) |
Set up a specific GPIO pin for interrupt event.
| gpio_number | Resource number of the GPIO to set up |
| edge | GPIO interrupt edge to configure |
| name | Name to label the set up GPIO |
| int gpio_wait_interrupt | ( | gpio_t * | gpio, |
| const struct timespec * | timeout | ||
| ) |
Wait for interrupt on GPIO pin.
| gpio_number | Linux sysfs GPIO resource number |
| timeout | Pointer to timeout timespec, NULL for infinite timeout |
Definition at line 187 of file gpio.c.
References ERROR, GPIO_DEBOUNCE_DELAY_US, rl_log(), and RL_LOG_ERROR.
Here is the call graph for this function: