The SGpp class is the central class to the Seeed Grove ++ library. More...
#include <sg++.hpp>
Public Member Functions | |
~SGpp (void) | |
Destructor. This automatically calls cleanup(). More... | |
SGpp & | initialize (void) |
Initialize Seeed Grove ++. More... | |
SGpp & | cleanup (void) |
Cleanly shutdown (where possible) Seeed Grove ++. More... | |
bool | is_initialized (void) const |
Determine if Seeed Grove ++ has been initialized. More... | |
Static Public Member Functions | |
static SGpp & | get (void) |
Get the SGpp singleton. This will also indirectly ensure the Seeed Grove ++ library is initialized. More... | |
Public Attributes | |
GpioManagement & | gpio |
Access to GPIO functionality. More... | |
The SGpp class is the central class to the Seeed Grove ++ library.
Instantiate the SGpp constructor by calling SG::SGpp::get() which will get the singleton. For example:
The destructor will automatically call cleanup() when the static singleton SGpp object goes out of scope.
SG::SGpp::~SGpp | ( | void | ) |
SG::SGpp & SG::SGpp::cleanup | ( | void | ) |
Cleanly shutdown (where possible) Seeed Grove ++.
This is called automatically by the destructor, or can be manually called. This method can be safely called multiple times.
References SG::GpioManagement::cleanup(), and gpio.
Referenced by sg_fatal_signal_handler(), SG::GpioManagement::~GpioManagement(), and ~SGpp().
|
static |
Get the SGpp singleton. This will also indirectly ensure the Seeed Grove ++ library is initialized.
Referenced by SG::Button::Button(), SG::Buzzer::Buzzer(), SG::ChainableRGBLED::ChainableRGBLED(), SG::Button::is_down(), SG::LEDBar::LEDBar(), seeedgrove_example_application(), SG::GroveGPIO::send_byte(), SG::LEDBar::send_data(), sg_fatal_signal_handler(), SG::Buzzer::turn_off(), SG::VariableColorLED::turn_off(), SG::Buzzer::turn_on(), SG::VariableColorLED::turn_on(), SG::VariableColorLED::VariableColorLED(), SG::Button::~Button(), SG::Buzzer::~Buzzer(), SG::ChainableRGBLED::~ChainableRGBLED(), SG::LEDBar::~LEDBar(), and SG::VariableColorLED::~VariableColorLED().
SG::SGpp & SG::SGpp::initialize | ( | void | ) |
Initialize Seeed Grove ++.
This is called automatically by the constructor, or can be manually called. This method can be safely called multiple times.
Referenced by seeedgrove_example_application().
|
inline |
Determine if Seeed Grove ++ has been initialized.
GpioManagement& SG::SGpp::gpio |
Access to GPIO functionality.
Referenced by SG::Button::Button(), SG::Buzzer::Buzzer(), SG::ChainableRGBLED::ChainableRGBLED(), SG::GpioManagement::cleanup(), cleanup(), SG::GpioManagement::gpio_export(), SG::Button::is_down(), SG::LEDBar::LEDBar(), SG::GroveGPIO::send_byte(), SG::LEDBar::send_data(), SG::GpioManagement::set_direction(), SG::Buzzer::turn_off(), SG::VariableColorLED::turn_off(), SG::Buzzer::turn_on(), SG::VariableColorLED::turn_on(), SG::VariableColorLED::VariableColorLED(), SG::Button::~Button(), SG::Buzzer::~Buzzer(), SG::ChainableRGBLED::~ChainableRGBLED(), SG::LEDBar::~LEDBar(), and SG::VariableColorLED::~VariableColorLED().