Audible buzzer. More...
#include <sg_107020000_Buzzer.hpp>
Public Member Functions | |
virtual | ~Buzzer (void) |
Destructor. More... | |
Buzzer (const std::string &n="") | |
Constructor. More... | |
Buzzer (const Buzzer &rhs) | |
Copy constructor. More... | |
Buzzer & | operator= (const Buzzer &rhs) |
Assignment. More... | |
Buzzer & | turn_on (void) |
Turn the buzzer on. More... | |
Buzzer & | turn_off (void) |
Turn the buzzer off. More... | |
Buzzer & | turn_on (const std::chrono::high_resolution_clock::duration &duration) |
Turn the buzzer on for a limited amount of time, then turn it off again. More... | |
Buzzer & | turn_off (const std::chrono::high_resolution_clock::duration &duration) |
Turn the buzzer off for a limited amount of time, then turn it on again. More... | |
virtual GroveGPIO & | send_2_bytes (uint16_t bits) |
Send 16 bits (2 bytes). More... | |
virtual GroveGPIO & | send_byte (uint8_t byte) |
Send a single byte. More... | |
virtual bool | is_grove_uart (void) const |
Determine if this is a Grove UART device. More... | |
virtual bool | is_grove_i2c (void) const |
Determine if this is a Grove I2C device. More... | |
virtual bool | is_grove_gpio (void) const |
Determine if this is a Grove GPIO device. More... | |
virtual uint32_t | get_sku (void) const |
Return a guess as to the Seeed SKU number based on the grove type. More... | |
virtual std::string | get_type_name (void) const |
Return a short text string representing the grove type. More... | |
virtual EGroveType | get_type (void) const |
Return the grove type. More... | |
virtual std::string | get_name (void) const |
Return the user-supplied name. More... | |
virtual std::string | get_description (void) const |
Return a multi-word 1-line description of this object. More... | |
bool | operator== (const Buzzer &rhs) const |
Test object equality. More... | |
bool | operator!= (const Buzzer &rhs) const |
Test object equality. More... | |
bool | operator== (const GroveBase &rhs) const |
Test object equality. More... | |
bool | operator!= (const GroveBase &rhs) const |
Test object equality. More... | |
Public Attributes | |
EGroveType | grove_type |
Grove type. More... | |
std::string | grove_name |
User-supplied name. More... | |
Audible buzzer.
Description | Image |
---|---|
Buzzer connected to the Grove UART interface. |
|
virtual |
Destructor.
References SG::SGpp::get(), SG::SGpp::gpio, and SG::GpioManagement::gpio_unexport().
SG::Buzzer::Buzzer | ( | const std::string & | n = "" | ) |
Constructor.
References SG::SGpp::get(), SG::SGpp::gpio, SG::GpioManagement::gpio_export(), and SG::GpioManagement::kOutput.
SG::Buzzer::Buzzer | ( | const Buzzer & | rhs | ) |
Copy constructor.
|
virtualinherited |
Return a multi-word 1-line description of this object.
References SG::demangle(), SG::GroveBase::get_name(), SG::GroveBase::get_sku(), SG::GroveBase::get_type_name(), SG::GroveBase::is_grove_gpio(), SG::GroveBase::is_grove_i2c(), SG::GroveBase::is_grove_uart(), and SG::BeagleBone::Detect::to_string().
Referenced by buzzer(), chainable_rgb_led(), common_oled(), SG::GroveBase::get_name(), SG::GroveI2CDigital::GroveI2CDigital(), SG::GroveI2CDigital::read16(), SG::GroveI2CDigital::read8(), SG::GroveI2CDigital::read_block(), SG::CommonOLED::set_display_bitmap(), SG::CommonOLED::set_orientation(), temperature(), variable_led(), SG::GroveI2CDigital::write16(), SG::GroveI2CDigital::write8(), SG::GroveI2CDigital::write_block(), and SG::GroveI2CDigital::write_byte().
|
inlinevirtualinherited |
Return the user-supplied name.
References SG::GroveBase::get_description(), SG::GroveBase::grove_name, SG::GroveBase::is_grove_gpio(), SG::GroveBase::is_grove_i2c(), and SG::GroveBase::is_grove_uart().
Referenced by SG::GroveBase::get_description(), SG::GroveBase::operator=(), and SG::GroveBase::operator==().
|
inlinevirtualinherited |
Return a guess as to the Seeed SKU number based on the grove type.
References SG::get_sku_from_grove_type(), and SG::GroveBase::grove_type.
Referenced by SG::GroveBase::get_description().
|
inlinevirtualinherited |
Return the grove type.
References SG::GroveBase::grove_type.
Referenced by SG::GroveI2CDigital::get_address_from_type(), SG::GroveBase::operator=(), and SG::GroveBase::operator==().
|
inlinevirtualinherited |
Return a short text string representing the grove type.
References SG::GroveBase::grove_type, and SG::to_string().
Referenced by SG::GroveBase::get_description().
|
inlinevirtualinherited |
|
inlinevirtualinherited |
|
inlinevirtualinherited |
|
inlineinherited |
Test object equality.
References SG::GroveBase::operator==().
|
inline |
Test object equality.
References operator==(), turn_off(), and turn_on().
SG::Buzzer & SG::Buzzer::operator= | ( | const Buzzer & | rhs | ) |
|
inherited |
Test object equality.
References SG::GroveBase::get_name(), and SG::GroveBase::get_type().
Referenced by SG::GroveBase::operator!=(), operator==(), SG::TemperatureAndHumiditySensor::operator==(), SG::TemperatureSensor::operator==(), and SG::I2CADC::operator==().
bool SG::Buzzer::operator== | ( | const Buzzer & | rhs | ) | const |
Test object equality.
References SG::GroveBase::operator==().
Referenced by operator!=().
|
virtualinherited |
Send 16 bits (2 bytes).
References SG::GroveGPIO::send_byte().
|
virtualinherited |
Send a single byte.
References SG::SGpp::get(), SG::SGpp::gpio, SG::GpioManagement::set_high(), and SG::GpioManagement::set_low().
Referenced by SG::GroveGPIO::send_2_bytes(), and SG::ChainableRGBLED::turn_on().
SG::Buzzer & SG::Buzzer::turn_off | ( | void | ) |
Turn the buzzer off.
References SG::SGpp::get(), SG::SGpp::gpio, and SG::GpioManagement::set_low().
Referenced by buzzer(), and operator!=().
SG::Buzzer & SG::Buzzer::turn_off | ( | const std::chrono::high_resolution_clock::duration & | duration | ) |
Turn the buzzer off for a limited amount of time, then turn it on again.
This call is synchronous, and will not return until the buzzer has cycled off then on again. The duration should be more than 5 milliseconds, otherwise the buzzer may not behave as expected.
References SG::SGpp::get(), SG::SGpp::gpio, SG::GpioManagement::set_high(), and SG::GpioManagement::set_low().
SG::Buzzer & SG::Buzzer::turn_on | ( | void | ) |
Turn the buzzer on.
References SG::SGpp::get(), SG::SGpp::gpio, and SG::GpioManagement::set_high().
Referenced by buzzer(), and operator!=().
SG::Buzzer & SG::Buzzer::turn_on | ( | const std::chrono::high_resolution_clock::duration & | duration | ) |
Turn the buzzer on for a limited amount of time, then turn it off again.
This call is synchronous, and will not return until the buzzer has cycled on then off again. The duration should be more than 5 milliseconds, otherwise the buzzer may not behave as expected.
References SG::SGpp::get(), SG::SGpp::gpio, SG::GpioManagement::set_high(), and SG::GpioManagement::set_low().
|
inherited |
User-supplied name.
Referenced by SG::GroveBase::get_name(), and SG::GroveBase::operator=().
|
inherited |
Grove type.
Referenced by SG::GroveBase::get_sku(), SG::GroveBase::get_type(), SG::GroveBase::get_type_name(), and SG::GroveBase::operator=().