DUNE: Uniform Navigational Environment  2019.02.1
DUNE::Hardware::GPIO Class Reference

Public Types

Public Member Functions

 GPIO (unsigned int number)
 
 ~GPIO (void)
 
void setDirection (Direction direction)
 
void setDirection (const std::string &direction)
 
void setValue (bool value)
 
bool getValue (void)
 

Member Enumeration Documentation

Enumerator
GPIO_DIR_INPUT 

GPIO is used as input.

GPIO_DIR_OUTPUT 

GPIO is used as output.

Constructor & Destructor Documentation

DUNE::Hardware::GPIO::GPIO ( unsigned int  number)

Initialize GPIO.

Parameters
[in]numberGPIO number.
DUNE::Hardware::GPIO::~GPIO ( void  )

Default destructor.

Member Function Documentation

bool DUNE::Hardware::GPIO::getValue ( void  )

Get GPIO value.

Returns
pin value (false = off, true = on).

References GPIO_DIR_INPUT.

void DUNE::Hardware::GPIO::setDirection ( Direction  direction)

Set GPIO direction.

Parameters
[in]directionGPIO direction.

References GPIO_DIR_INPUT.

Referenced by setDirection().

void DUNE::Hardware::GPIO::setDirection ( const std::string &  direction)

Set GPIO direction.

Parameters
[in]direction"input" or "output".

References GPIO_DIR_INPUT, GPIO_DIR_OUTPUT, and setDirection().

void DUNE::Hardware::GPIO::setValue ( bool  value)

Set GPIO value.

Parameters
[in]valuepin value (false = off, true = on).

References GPIO_DIR_OUTPUT.

Collaboration diagram for DUNE::Hardware::GPIO:
Collaboration graph