Voss Connection Detection  1
Detect a connector click using realtime code on Bela hardware
SimpleGPIO.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define SYSFS_GPIO_DIR   "/sys/class/gpio"
 
#define POLL_TIMEOUT   (3 * 1000) /* 3 seconds */
 
#define MAX_BUF   64
 
#define SYSFS_OMAP_MUX_DIR   "/sys/kernel/debug/omap_mux/"
 

Enumerations

enum  PIN_DIRECTION { INPUT_PIN =0, OUTPUT_PIN =1 }
 
enum  PIN_VALUE { LOW =0, HIGH =1 }
 

Functions

int gpio_export (unsigned int gpio)
 
int gpio_unexport (unsigned int gpio)
 
int gpio_set_dir (unsigned int gpio, PIN_DIRECTION out_flag)
 
int gpio_set_value (unsigned int gpio, PIN_VALUE value)
 
int gpio_get_value (unsigned int gpio, unsigned int *value)
 
int gpio_set_edge (unsigned int gpio, char *edge)
 
int gpio_fd_open (unsigned int gpio)
 
int gpio_fd_close (int fd)
 
int gpio_omap_mux_setup (const char *omap_pin0_name, const char *mode)
 

Macro Definition Documentation

◆ MAX_BUF

#define MAX_BUF   64

Definition at line 46 of file SimpleGPIO.h.

◆ POLL_TIMEOUT

#define POLL_TIMEOUT   (3 * 1000) /* 3 seconds */

Definition at line 45 of file SimpleGPIO.h.

◆ SYSFS_GPIO_DIR

#define SYSFS_GPIO_DIR   "/sys/class/gpio"

Definition at line 44 of file SimpleGPIO.h.

◆ SYSFS_OMAP_MUX_DIR

#define SYSFS_OMAP_MUX_DIR   "/sys/kernel/debug/omap_mux/"

Definition at line 47 of file SimpleGPIO.h.

Enumeration Type Documentation

◆ PIN_DIRECTION

Enumerator
INPUT_PIN 
OUTPUT_PIN 

Definition at line 49 of file SimpleGPIO.h.

◆ PIN_VALUE

enum PIN_VALUE
Enumerator
LOW 
HIGH 

Definition at line 54 of file SimpleGPIO.h.

Function Documentation

◆ gpio_export()

int gpio_export ( unsigned int  gpio)

Definition at line 49 of file SimpleGPIO.cpp.

◆ gpio_fd_close()

int gpio_fd_close ( int  fd)

Definition at line 211 of file SimpleGPIO.cpp.

◆ gpio_fd_open()

int gpio_fd_open ( unsigned int  gpio)

Definition at line 193 of file SimpleGPIO.cpp.

◆ gpio_get_value()

int gpio_get_value ( unsigned int  gpio,
unsigned int *  value 
)

Definition at line 140 of file SimpleGPIO.cpp.

◆ gpio_omap_mux_setup()

int gpio_omap_mux_setup ( const char *  omap_pin0_name,
const char *  mode 
)

Definition at line 220 of file SimpleGPIO.cpp.

◆ gpio_set_dir()

int gpio_set_dir ( unsigned int  gpio,
PIN_DIRECTION  out_flag 
)

Definition at line 90 of file SimpleGPIO.cpp.

◆ gpio_set_edge()

int gpio_set_edge ( unsigned int  gpio,
char *  edge 
)

Definition at line 171 of file SimpleGPIO.cpp.

◆ gpio_set_value()

int gpio_set_value ( unsigned int  gpio,
PIN_VALUE  value 
)

Definition at line 115 of file SimpleGPIO.cpp.

◆ gpio_unexport()

int gpio_unexport ( unsigned int  gpio)

Definition at line 70 of file SimpleGPIO.cpp.