Bela
Real-time, ultra-low-latency audio and sensor processing system for BeagleBone Black
 All Classes Files Functions Variables Typedefs Macros Groups
Public Member Functions | List of all members
Gpio Class Reference

Public Member Functions

int open (unsigned int pin, unsigned int direction, bool unexport=true)
 
void close ()
 
bool read ()
 
void set ()
 
void clear ()
 
void write (bool value)
 
bool enabled ()
 

Detailed Description

Examples:
cape-test/render.cpp, and synchronous-gpio/render.cpp.

Member Function Documentation

int Gpio::open ( unsigned int  pin,
unsigned int  direction,
bool  unexport = true 
)

Opens a GPIO pin.

Parameters
pinthe GPIO pin ( 0 <= pin < 128)
directionone of INPUT or OUTPUT
unexportif false, it will not try to unexport the pin when calling close()
Returns
0 if success, -1 otherwise;
Examples:
cape-test/render.cpp, and synchronous-gpio/render.cpp.
void Gpio::close ( )

Closes a currently open GPIO

bool Gpio::read ( )
inline

Read the GPIO value.

Returns
the GPIO value
Examples:
synchronous-gpio/render.cpp.
void Gpio::set ( )
inline

Set the output to 1.

void Gpio::clear ( )
inline

Clear the output

void Gpio::write ( bool  value)
inline

Write an output value

Parameters
valuethe value to write
Examples:
cape-test/render.cpp, and synchronous-gpio/render.cpp.
bool Gpio::enabled ( )
inline

Check if the GPIO is enabled.

Returns
true if enabled, false otherwise

The documentation for this class was generated from the following file: