Seeed Grove ++  v0.0.1-2019
Linux C++ Library For Seeed Grove Devices
SG::GroveI2C Class Referenceabstract

Base class for Groves that use the I2C (Inter-Integrated Circuit) interface. More...

#include <sg_GroveI2C.hpp>

Inheritance diagram for SG::GroveI2C:
Collaboration diagram for SG::GroveI2C:

Public Member Functions

 GroveI2C (const SG::EGroveType t=SG::EGroveType::kUnknown, const std::string &n="")
 Constructor. More...
 
virtual ~GroveI2C (void)
 Destructor. More...
 
virtual bool is_grove_uart (void) const
 This is always false for GroveI2C. More...
 
virtual bool is_grove_i2c (void) const
 This is always true for GroveI2C. More...
 
virtual bool is_grove_gpio (void) const
 This is always false for GroveI2C. More...
 
virtual bool is_analog (void) const =0
 Determine if this is a Grove I2C analog device. More...
 
virtual bool is_digital (void) const =0
 Determine if this is a Grove I2C digital 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 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...
 

Detailed Description

Base class for Groves that use the I2C (Inter-Integrated Circuit) interface.

See also
GroveI2CAnalog
GroveI2CDigital

Constructor & Destructor Documentation

SG::GroveI2C::GroveI2C ( const SG::EGroveType  t = SG::EGroveType::kUnknown,
const std::string &  n = "" 
)

Constructor.

SG::GroveI2C::~GroveI2C ( void  )
virtual

Destructor.

Member Function Documentation

virtual std::string SG::GroveBase::get_name ( void  ) const
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==().

Here is the call graph for this function:

Here is the caller graph for this function:

virtual uint32_t SG::GroveBase::get_sku ( void  ) const
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().

Here is the call graph for this function:

Here is the caller graph for this function:

virtual EGroveType SG::GroveBase::get_type ( void  ) const
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==().

Here is the caller graph for this function:

virtual std::string SG::GroveBase::get_type_name ( void  ) const
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().

Here is the call graph for this function:

Here is the caller graph for this function:

virtual bool SG::GroveI2C::is_analog ( void  ) const
pure virtual

Determine if this is a Grove I2C analog device.

Implemented in SG::GroveI2CDigital, and SG::GroveI2CAnalog.

Referenced by is_grove_gpio().

Here is the caller graph for this function:

virtual bool SG::GroveI2C::is_digital ( void  ) const
pure virtual

Determine if this is a Grove I2C digital device.

Implemented in SG::GroveI2CDigital, and SG::GroveI2CAnalog.

Referenced by is_grove_gpio().

Here is the caller graph for this function:

virtual bool SG::GroveI2C::is_grove_gpio ( void  ) const
inlinevirtual

This is always false for GroveI2C.

Implements SG::GroveBase.

References is_analog(), and is_digital().

Here is the call graph for this function:

virtual bool SG::GroveI2C::is_grove_i2c ( void  ) const
inlinevirtual

This is always true for GroveI2C.

Implements SG::GroveBase.

virtual bool SG::GroveI2C::is_grove_uart ( void  ) const
inlinevirtual

This is always false for GroveI2C.

Implements SG::GroveBase.

bool SG::GroveBase::operator!= ( const GroveBase rhs) const
inlineinherited

Test object equality.

References SG::GroveBase::operator==().

Here is the call graph for this function:

bool SG::GroveBase::operator== ( const GroveBase rhs) const
inherited

Test object equality.

References SG::GroveBase::get_name(), and SG::GroveBase::get_type().

Referenced by SG::GroveBase::operator!=(), SG::Buzzer::operator==(), SG::TemperatureAndHumiditySensor::operator==(), SG::TemperatureSensor::operator==(), and SG::I2CADC::operator==().

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

std::string SG::GroveBase::grove_name
inherited

User-supplied name.

Referenced by SG::GroveBase::get_name(), and SG::GroveBase::operator=().


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