RocketLogger  1.0
gpio.c File Reference
#include "gpio.h"
+ Include dependency graph for gpio.c:

Go to the source code of this file.

Functions

int gpio_unexport (int num)
 
int gpio_export (int num)
 
int gpio_dir (int num, rl_direction dir)
 
int gpio_interrupt (int num, rl_edge edge)
 
int gpio_set_value (int num, int val)
 
int gpio_get_value (int num)
 
int gpio_wait_interrupt (int num, int timeout)
 

Function Documentation

int gpio_dir ( int  num,
rl_direction  dir 
)

Set direction of GPIO.

Parameters
numLinux GPIO number.
dirDirection.
Returns
SUCCESS in case of success, FAILURE otherwise.

Definition at line 62 of file gpio.c.

References ERROR, FAILURE, GPIO_PATH, MAX_PATH_LENGTH, OUT, rl_log(), and SUCCESS.

Referenced by gpio_setup(), and hw_init().

+ Here is the call graph for this function:

int gpio_export ( int  num)

Export (activate) a GPIO.

Parameters
numLinux GPIO number.
Returns
SUCCESS in case of success, FAILURE otherwise.

Definition at line 37 of file gpio.c.

References ERROR, FAILURE, GPIO_PATH, rl_log(), and SUCCESS.

Referenced by gpio_setup(), and hw_init().

+ Here is the call graph for this function:

int gpio_get_value ( int  num)

Get GPIO value.

Parameters
numLinux GPIO number.
Returns
GPIO value, FAILURE on failure.

Definition at line 161 of file gpio.c.

References ERROR, FAILURE, GPIO_PATH, MAX_PATH_LENGTH, and rl_log().

+ Here is the call graph for this function:

int gpio_interrupt ( int  num,
rl_edge  edge 
)

Set direction of GPIO interrupt edge.

Parameters
numLinux GPIO number.
edgeEdge direction.
Returns
SUCCESS in case of success, FAILURE otherwise.

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.

Parameters
numLinux GPIO number.
valValue (0 or 1).
Returns
SUCCESS in case of success, FAILURE otherwise.

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)

Copyright (c) 2016-2017, ETH Zurich, Computer Engineering Group Unexport (deactivate) a GPIO.

Parameters
numLinux GPIO number.
Returns
SUCCESS in case of success, FAILURE otherwise.

Definition at line 12 of file gpio.c.

References ERROR, FAILURE, GPIO_PATH, rl_log(), and SUCCESS.

Referenced by hw_close().

+ Here is the call graph for this function:

int gpio_wait_interrupt ( int  num,
int  timeout 
)

Wait on GPIO interrupt.

Parameters
numLinux GPIO number.
timeoutMaximum waiting time (in ms). Set to 0 for infinite time out.
Returns
SUCCESS in case of interrupt, FAILURE otherwise.

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: