#include "sg++.hpp"
#include <iostream>
#include <iomanip>
#include <thread>
#include <typeinfo>
#include <csignal>
#include <cstring>
#include <system_error>
#include <cmath>
Typedefs | |
typedef std::vector< std::string > | VStr |
Functions | |
void | list (const SG::VGroveTypes &v) |
void | list_all (void) |
void | list_detect (void) |
void | list_addresses (void) |
void | sg_fatal_signal_handler (int sig_num, siginfo_t *sig_info, void *context) |
void | sg_normal_signal_handler (int sig_num, siginfo_t *sig_info, void *context) |
void | setup_signal_handling (void) |
void | chainable_rgb_led (const VStr &args) |
void | buzzer (const VStr &args) |
void | temperature (const VStr &args) |
void | compass (const VStr &args) |
void | bb_detect (const VStr &args) |
void | bb_led (const VStr &args) |
void | bb_watchdog (const VStr &args) |
void | bb_usb (const VStr &args) |
void | common_oled (SG::CommonOLED &oled, const VStr &args) |
void | oled112 (const VStr &args) |
void | oled096 (const VStr &args) |
void | ledbar (const VStr &args) |
void | button (const VStr &args) |
void | variable_led (const VStr &args) |
void | show_help (void) |
int | seeedgrove_example_application (int argc, char **argv) |
int | main (int argc, char **argv) |
Variables | |
volatile sig_atomic_t | exit_signal_detected = 0 |
typedef std::vector<std::string> VStr |
void bb_detect | ( | const VStr & | args | ) |
References SG::BeagleBone::Detect::get_compatibilities(), SG::BeagleBone::Detect::get_model(), SG::BeagleBone::Detect::is_beaglebone_black_compatible(), SG::BeagleBone::Detect::is_beaglebone_compatible(), SG::BeagleBone::Detect::is_beaglebone_green_compatible(), and SG::BeagleBone::Detect::to_string().
Referenced by seeedgrove_example_application().
void bb_led | ( | const VStr & | args | ) |
References exit_signal_detected, SG::BeagleBone::LEDControl::load_random_pattern(), and SG::BeagleBone::LEDControl::start_blink_thread().
Referenced by seeedgrove_example_application().
void bb_usb | ( | const VStr & | args | ) |
References SG::BeagleBone::USB::toggle(), SG::BeagleBone::USB::turn_off(), and SG::BeagleBone::USB::turn_on().
Referenced by seeedgrove_example_application().
void bb_watchdog | ( | const VStr & | args | ) |
References exit_signal_detected, SG::BeagleBone::Watchdog::get_boot_status(), SG::BeagleBone::Watchdog::get_info(), SG::BeagleBone::Watchdog::get_seconds_remaining_before_reboot(), SG::BeagleBone::Watchdog::get_status(), SG::BeagleBone::Watchdog::get_timeout(), SG::BeagleBone::Watchdog::kick(), and SG::BeagleBone::Watchdog::set_timeout().
Referenced by seeedgrove_example_application().
void button | ( | const VStr & | args | ) |
References exit_signal_detected, SG::Button::is_up(), SG::Button::wait_for_button_down(), and SG::Button::wait_for_button_up().
Referenced by seeedgrove_example_application().
void buzzer | ( | const VStr & | args | ) |
References exit_signal_detected, SG::GroveBase::get_description(), SG::Buzzer::turn_off(), and SG::Buzzer::turn_on().
Referenced by seeedgrove_example_application().
void chainable_rgb_led | ( | const VStr & | args | ) |
References exit_signal_detected, SG::GroveBase::get_description(), SG::ChainableRGBLED::set_RGB(), and SG::ChainableRGBLED::start_pulse_thread().
Referenced by seeedgrove_example_application().
void common_oled | ( | SG::CommonOLED & | oled, |
const VStr & | args | ||
) |
References SG::CommonOLED::all_off_display(), SG::CommonOLED::all_on_display(), SG::GroveBase::get_description(), SG::CommonOLED::invert_display(), SG::CommonOLED::lock(), SG::CommonOLED::normal_display(), SG::CommonOLED::reset(), SG::CommonOLED::set_contrast(), SG::CommonOLED::start_scrolling(), SG::CommonOLED::stop_scrolling(), SG::CommonOLED::turn_off(), SG::CommonOLED::turn_on(), and SG::CommonOLED::unlock().
Referenced by oled096(), and oled112().
void compass | ( | const VStr & | args | ) |
References exit_signal_detected, SG::ThreeAxisDigitalCompass::get_config(), SG::ThreeAxisDigitalCompass::get_direction(), SG::ThreeAxisDigitalCompass::get_heading(), SG::ThreeAxisDigitalCompass::get_mode(), SG::ThreeAxisDigitalCompass::get_status(), SG::ThreeAxisDigitalCompass::k30Hz, SG::ThreeAxisDigitalCompass::k4_0Ga, SG::ThreeAxisDigitalCompass::kIdle, SG::ThreeAxisDigitalCompass::kPositiveBias, SG::ThreeAxisDigitalCompass::reset(), SG::ThreeAxisDigitalCompass::set_config(), SG::ThreeAxisDigitalCompass::set_mode(), SG::ThreeAxisDigitalCompass::to_string(), and SG::ThreeAxisDigitalCompass::wait_for_significant_change().
Referenced by seeedgrove_example_application().
void ledbar | ( | const VStr & | args | ) |
References SG::LEDBar::all_off(), and SG::LEDBar::all_on().
Referenced by seeedgrove_example_application().
void list | ( | const SG::VGroveTypes & | v | ) |
References SG::get_grove_type_name_map(), and SG::get_sku_from_grove_type().
Referenced by list_addresses(), list_all(), and list_detect().
void list_addresses | ( | void | ) |
References list().
Referenced by seeedgrove_example_application().
void list_all | ( | void | ) |
References SG::get_grove_type_name_map(), and list().
Referenced by seeedgrove_example_application().
void list_detect | ( | void | ) |
References SG::detect(), and list().
Referenced by seeedgrove_example_application().
int main | ( | int | argc, |
char ** | argv | ||
) |
References SG::demangle(), exit_signal_detected, SG::get_build_timestamp(), SG::get_version(), seeedgrove_example_application(), and setup_signal_handling().
void oled096 | ( | const VStr & | args | ) |
References common_oled().
Referenced by seeedgrove_example_application().
void oled112 | ( | const VStr & | args | ) |
References common_oled().
Referenced by seeedgrove_example_application().
int seeedgrove_example_application | ( | int | argc, |
char ** | argv | ||
) |
References bb_detect(), bb_led(), bb_usb(), bb_watchdog(), button(), buzzer(), chainable_rgb_led(), compass(), SG::SGpp::get(), SG::SGpp::initialize(), ledbar(), list_addresses(), list_all(), list_detect(), oled096(), oled112(), show_help(), temperature(), and variable_led().
Referenced by main().
void setup_signal_handling | ( | void | ) |
References sg_fatal_signal_handler(), and sg_normal_signal_handler().
Referenced by main().
void sg_fatal_signal_handler | ( | int | sig_num, |
siginfo_t * | sig_info, | ||
void * | context | ||
) |
References SG::SGpp::cleanup(), exit_signal_detected, and SG::SGpp::get().
Referenced by setup_signal_handling().
void sg_normal_signal_handler | ( | int | sig_num, |
siginfo_t * | sig_info, | ||
void * | context | ||
) |
References exit_signal_detected.
Referenced by setup_signal_handling().
void show_help | ( | void | ) |
void temperature | ( | const VStr & | args | ) |
References SG::I2CADC::enable_automatic_mode(), SG::TemperatureSensor::get_celsius(), and SG::GroveBase::get_description().
Referenced by seeedgrove_example_application().
void variable_led | ( | const VStr & | args | ) |
References exit_signal_detected, SG::GroveBase::get_description(), SG::VariableColorLED::turn_off(), and SG::VariableColorLED::turn_on().
Referenced by seeedgrove_example_application().
volatile sig_atomic_t exit_signal_detected = 0 |
Referenced by bb_led(), bb_watchdog(), button(), buzzer(), chainable_rgb_led(), compass(), main(), sg_fatal_signal_handler(), sg_normal_signal_handler(), and variable_led().