gusimplewhiteboard
guWhiteboard::IOPins Class Reference

Class for controlling and getting the status of IO pins. More...

#include <IOPins.hpp>

Inheritance diagram for guWhiteboard::IOPins:
Collaboration diagram for guWhiteboard::IOPins:

Public Member Functions

bool get (int pin) const
 pin value setter More...
 
void set (int pin)
 pin value setter More...
 
void clr (int pin)
 clear the given pin More...
 
void set (int pin, bool value)
 set the given pin to the given value More...
 
void reset (int value=0)
 set all pins to the given value More...
 
bool operator== (const IOPins &other) const
 comparison operator More...
 
 IOPins (const std::string &pinvalues)
 string constructor More...
 
std::string description () const
 convert to a string More...
 
void from_string (const std::string &str)
 convert from a string More...
 
- Public Member Functions inherited from wb_io_pins
 ARRAY_PROPERTY (uint8_t, pins,(sizeof(gu_simple_message))) wb_io_pins(int value=0)
 bit vector of I/O pin values More...
 

Detailed Description

Class for controlling and getting the status of IO pins.

This is implemented as a bit vector with one bit per pin.

Definition at line 74 of file IOPins.hpp.

Constructor & Destructor Documentation

◆ IOPins()

guWhiteboard::IOPins::IOPins ( const std::string &  pinvalues)
inline

string constructor

Definition at line 97 of file IOPins.hpp.

References from_string().

Member Function Documentation

◆ clr()

void guWhiteboard::IOPins::clr ( int  pin)
inline

clear the given pin

Definition at line 84 of file IOPins.hpp.

References IO_PIN_CLR.

Referenced by from_string(), and set().

◆ description()

std::string guWhiteboard::IOPins::description ( ) const
inline

convert to a string

Definition at line 100 of file IOPins.hpp.

References IO_PIN_BIT_SIZE, and IO_PIN_GET.

◆ from_string()

void guWhiteboard::IOPins::from_string ( const std::string &  str)
inline

convert from a string

Definition at line 116 of file IOPins.hpp.

References clr(), IO_PIN_BIT_SIZE, and set().

Referenced by IOPins().

◆ get()

bool guWhiteboard::IOPins::get ( int  pin) const
inline

pin value setter

Definition at line 78 of file IOPins.hpp.

References IO_PIN_GET.

◆ operator==()

bool guWhiteboard::IOPins::operator== ( const IOPins other) const
inline

comparison operator

Definition at line 93 of file IOPins.hpp.

◆ reset()

void guWhiteboard::IOPins::reset ( int  value = 0)
inline

set all pins to the given value

Definition at line 90 of file IOPins.hpp.

◆ set() [1/2]

void guWhiteboard::IOPins::set ( int  pin)
inline

pin value setter

Definition at line 81 of file IOPins.hpp.

References IO_PIN_SET.

Referenced by from_string().

◆ set() [2/2]

void guWhiteboard::IOPins::set ( int  pin,
bool  value 
)
inline

set the given pin to the given value

Definition at line 87 of file IOPins.hpp.

References clr(), and set().

Referenced by set().


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