Rover API Documentation
rover::RoverGpio Class Reference

RoverGpio class provides the member functions related to basic GPIO operations. This class wraps wiringPi library. More...

#include <rover_gpio.hpp>

Inheritance diagram for rover::RoverGpio:
rover::RoverButton rover::RoverBuzzer

Public Member Functions

 RoverGpio ()
 Constructor function for the RoverGpio class. More...
 
void wPiDigitalWrite (const int pin, const int value)
 Wrapper function to wiringPi's digitalWrite function. More...
 
int wPiDigitalRead (const int pin)
 Wrapper function to wiringPi's digitalRead function. More...
 
void wPiPinMode (const int pin, const int set_val)
 Wrapper function to wiringPi's pinMode function. More...
 
void wPiSoftToneCreate (const int pin)
 Wrapper function to wiringPi's softToneCreate function. Sets up a pin to have PWM soft tone output. More...
 
void wPiSoftToneWrite (const int pin, const int tone)
 Wrapper function to wiringPi's softToneWrite function. Sets up a pin to have PWM soft tone output. More...
 
void wPiDelay (const unsigned int period_ms)
 Delay function. Blocks some time in milliseconds. More...
 

Static Public Attributes

static const int INPUT_ = 0
 Static definition for INPUT pin mode for wPiPinMode function. More...
 
static const int OUTPUT_ = 1
 Static definition for OUTPUT pin mode for wPiPinMode function. More...
 
static const int PWM_OUTPUT_ = 2
 Static definition for PWM_OUTPUT pin mode for wPiPinMode function. More...
 
static const int GPIO_CLOCK_ = 3
 Static definition for GPIO_CLOCK pin mode for wPiPinMode function. More...
 
static const int SOFT_PWM_OUTPUT_ = 4
 Static definition for SOFT_PWM_OUTPUT pin mode for wPiPinMode function. More...
 
static const int SOFT_TONE_OUTPUT_ = 5
 Static definition for SOFT_TONE_OUTPUT pin mode for wPiPinMode function. More...
 
static const int PWM_TONE_OUTPUT_ = 6
 Static definition for PWM_TONE_OUTPUT pin mode for wPiPinMode function. More...
 
static const int LO = 0
 Static definition for digital voltage level : LOW. More...
 
static const int HI = 1
 Static definition for digital voltage level : HIGH. More...
 

Detailed Description

RoverGpio class provides the member functions related to basic GPIO operations. This class wraps wiringPi library.

Constructor & Destructor Documentation

rover::RoverGpio::RoverGpio ( )
explicit

Constructor function for the RoverGpio class.

Returns
void

Member Function Documentation

void rover::RoverGpio::wPiDelay ( const unsigned int  period_ms)

Delay function. Blocks some time in milliseconds.

Parameters
period_msPeriod in milliseconds
Returns
void
int rover::RoverGpio::wPiDigitalRead ( const int  pin)

Wrapper function to wiringPi's digitalRead function.

Parameters
pinPin number (int) to be read from using wiringPi pin descriptions.
Returns
value Digital value read from the pin. LOW -> 0 HIGH -> 1
void rover::RoverGpio::wPiDigitalWrite ( const int  pin,
const int  value 
)

Wrapper function to wiringPi's digitalWrite function.

Parameters
pinPin number (int) using wiringPi pin descriptions.
valueDigital value to be given as output to the pin. LOW -> 0 HIGH -> 1
Returns
void
void rover::RoverGpio::wPiPinMode ( const int  pin,
const int  set_val 
)

Wrapper function to wiringPi's pinMode function.

Parameters
pinPin number (int) to be set
set_valPin Mode to be set for the GPIO pin: RoverGpio::INPUT_, RoverGpio::OUTPUT_, RoverGpio::PWM_OUTPUT_, RoverGpio::GPIO_CLOCK_, RoverGpio::SOFT_PWM_OUTPUT_, RoverGpio::SOFT_TONE_OUTPUT_, RoverGpio::PWM_TONE_OUTPUT_
Returns
void
void rover::RoverGpio::wPiSoftToneCreate ( const int  pin)

Wrapper function to wiringPi's softToneCreate function. Sets up a pin to have PWM soft tone output.

Parameters
pinPin number (int) to be set
Returns
void
void rover::RoverGpio::wPiSoftToneWrite ( const int  pin,
const int  tone 
)

Wrapper function to wiringPi's softToneWrite function. Sets up a pin to have PWM soft tone output.

Parameters
pinPin number (int) to be set
toneTone frequency to create in Hz
Returns
void

Member Data Documentation

const int rover::RoverGpio::GPIO_CLOCK_ = 3
static

Static definition for GPIO_CLOCK pin mode for wPiPinMode function.

const int rover::RoverGpio::HI = 1
static

Static definition for digital voltage level : HIGH.

const int rover::RoverGpio::INPUT_ = 0
static

Static definition for INPUT pin mode for wPiPinMode function.

const int rover::RoverGpio::LO = 0
static

Static definition for digital voltage level : LOW.

const int rover::RoverGpio::OUTPUT_ = 1
static

Static definition for OUTPUT pin mode for wPiPinMode function.

const int rover::RoverGpio::PWM_OUTPUT_ = 2
static

Static definition for PWM_OUTPUT pin mode for wPiPinMode function.

const int rover::RoverGpio::PWM_TONE_OUTPUT_ = 6
static

Static definition for PWM_TONE_OUTPUT pin mode for wPiPinMode function.

const int rover::RoverGpio::SOFT_PWM_OUTPUT_ = 4
static

Static definition for SOFT_PWM_OUTPUT pin mode for wPiPinMode function.

const int rover::RoverGpio::SOFT_TONE_OUTPUT_ = 5
static

Static definition for SOFT_TONE_OUTPUT pin mode for wPiPinMode function.


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