Rover API Documentation
rover::RoverButton Class Reference

RoverButton class contains member functions to access Shutdown button, User button, and customly installed buttons on the rover. More...

#include <rover_button.hpp>

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

Public Member Functions

 RoverButton (const RoverButtonType_t button_type)
 (assigning) Constructor for RoverButton More...
 
void initialize (void)
 RoverButton initializer. More...
 
int readButton (void)
 Reads the digital value of the a button. More...
 
void setButtonPin (const int button_pin)
 Overrides the default button pin used in wiringPi format. More...
 
- Public Member Functions inherited from rover::RoverGpio
 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...
 

Private Attributes

int buttonPin
 Button pin. More...
 
RoverButtonType_t buttonType
 Button type. More...
 
int ROVERBUTTON_INIT_
 Flag to hold if RoverButton is set up. More...
 

Static Private Attributes

static const int SHUTDOWN_BUTTON_PIN = 29
 Shutdown button pin in wiringPi format. More...
 
static const int USER_BUTTON_PIN = 27
 User button pin in wiringPi format. More...
 

Additional Inherited Members

- Static Public Attributes inherited from rover::RoverGpio
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

RoverButton class contains member functions to access Shutdown button, User button, and customly installed buttons on the rover.

Constructor & Destructor Documentation

rover::RoverButton::RoverButton ( const RoverButtonType_t  button_type)

(assigning) Constructor for RoverButton

Member Function Documentation

void rover::RoverButton::initialize ( void  )

RoverButton initializer.

Returns
void
int rover::RoverButton::readButton ( void  )

Reads the digital value of the a button.

Returns
val RoverGpio::LO (low) or RoverGpio::HI (high). Embedded shutdown and user buttons are pulled-up. Therefore, when the button is pressed a LOW (0) is returned.
void rover::RoverButton::setButtonPin ( const int  button_pin)

Overrides the default button pin used in wiringPi format.

Parameters
button_pin
Returns
void

Member Data Documentation

int rover::RoverButton::buttonPin
private

Button pin.

RoverButtonType_t rover::RoverButton::buttonType
private

Button type.

int rover::RoverButton::ROVERBUTTON_INIT_
private

Flag to hold if RoverButton is set up.

const int rover::RoverButton::SHUTDOWN_BUTTON_PIN = 29
staticprivate

Shutdown button pin in wiringPi format.

const int rover::RoverButton::USER_BUTTON_PIN = 27
staticprivate

User button pin in wiringPi format.


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