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

Public Types

enum  Direction { INPUT, OUTPUT }
 

Public Member Functions

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

Static Public Member Functions

static uint32_t getBankAddress (unsigned int bank)
 

Detailed Description

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

Member Function Documentation

int Gpio::open ( unsigned int  pin,
Direction  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
static uint32_t Gpio::getBankAddress ( unsigned int  bank)
static

A utility function to return the base address of a Gpio bank.


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