The I2C 0.96" OLED and I2C 1.12" OLED displays have quite a bit of common functionality. More...
#include <sg_common_OLED.hpp>
Public Types | |
enum | EOrientation { EOrientation::kInvalid = 0, EOrientation::kLandscape, EOrientation::kPortrait, EOrientation::kLandscape180, EOrientation::kPortrait180 } |
Orientation for the display. More... | |
typedef uint8_t | I2CBus |
I2C bus. More... | |
typedef uint8_t | I2CAddress |
I2C addresses. More... | |
typedef uint8_t | I2CRegister |
I2C register. More... | |
typedef std::vector< uint8_t > | I2CBlock |
Block of sequential bytes to read or write. More... | |
Public Member Functions | |
virtual | ~CommonOLED (void) |
Destructor. More... | |
CommonOLED (const SG::EGroveType t=SG::EGroveType::kUnknown, const std::string &name="", const SG::GroveI2CDigital::I2CAddress addr=0) | |
Constructor. More... | |
virtual size_t | pixel_width (void) const =0 |
Get the width in pixels. More... | |
virtual size_t | pixel_height (void) const =0 |
Get the height in pixels. More... | |
virtual size_t | pixel_depth (void) const =0 |
Get the number of bits per pixel. More... | |
virtual size_t | memory_width (void) const =0 |
Get the number of pixels that can be stored in memory. More... | |
virtual size_t | memory_height (void) const =0 |
Get the number of pixels that can be stored in memory. More... | |
virtual size_t | memory_depth (void) const =0 |
Get the number of bits each pixel occupies in memory. More... | |
virtual CommonOLED & | reset (void)=0 |
Reset the OLED. More... | |
virtual CommonOLED & | clear_screen (void)=0 |
Set all of the GDDRAM to 0x00 to clear the screen. More... | |
virtual CommonOLED & | turn_on (void) |
Turn ON the OLED. More... | |
virtual CommonOLED & | turn_off (void) |
turn OFF the OLED. More... | |
virtual CommonOLED & | set_contrast (const uint8_t level=0x7f) |
Set the contrast level to a value between 0 and 255. More... | |
virtual CommonOLED & | lock (void) |
Lock the OLED driver IC MCU. Once locked, the only command that will be accepted is unlock(). All other commands and memory access are ignored. More... | |
virtual CommonOLED & | unlock (void) |
Unlock the OLED driver IC MCU. More... | |
virtual CommonOLED & | start_scrolling (void) |
Start horizontal scrolling. Multiple calls can be made to start_scrolling() and stop_scrolling() to start and stop scrolling multiple times. More... | |
virtual CommonOLED & | stop_scrolling (void) |
virtual CommonOLED & | send_command (const uint8_t cmd) |
Stop horizontal scrolling. More... | |
virtual CommonOLED & | send_command (const uint8_t cmd, const uint8_t value) |
Send a command with an additional 1-byte parameter. More... | |
virtual CommonOLED & | set_XY (const uint8_t x=0, const uint8_t y=0) |
virtual CommonOLED & | flood (const I2CBlock &pattern) |
Repeat the given pattern until it fills up the entire OLED. More... | |
virtual CommonOLED & | fade_white_to_black (const size_t milliseconds_between_transitions=500) |
Fade from white to black. More... | |
virtual CommonOLED & | fade_black_to_white (const size_t milliseconds_between_transitions=500) |
Fade from black to white. More... | |
virtual I2CBlock | get_display_bitmap (void) |
Get the full display bitmap. More... | |
virtual CommonOLED & | set_display_bitmap (const I2CBlock &block) |
Set the full display bitmap. More... | |
virtual EOrientation | get_orientation (void) const |
Return the current orientation. The default after reset() is EOrientation::kLandscape. More... | |
virtual bool | is_analog (void) const |
This is always false for GroveI2CDigital. More... | |
virtual bool | is_digital (void) const |
This is always true for GroveI2CDigital. More... | |
I2CAddress | get_address_from_type (void) const |
Get the address for this Grove type. More... | |
virtual uint8_t | read8 (const I2CRegister reg) |
Read a byte (8 bits) from the specificed register. More... | |
virtual uint16_t | read16 (const I2CRegister reg) |
Read a 16-bit word from the specified register. More... | |
virtual uint16_t | read12 (const I2CRegister reg) |
Read a 16-bit word from the specified register, but only keep the bottom 12 bits. More... | |
virtual I2CBlock | read_block (const I2CRegister reg) |
Read a consecutive block of bytes, anywhere between 1 and 32 bytes in length. More... | |
virtual GroveI2CDigital & | write_byte (const uint8_t value) |
Write a single byte to the I2C bus. More... | |
virtual GroveI2CDigital & | write_block (const I2CRegister reg, const I2CBlock &v) |
Write a consecutive block of bytes, anywhere between 1 and 32 bytes in length. More... | |
virtual GroveI2CDigital & | write_block (const I2CBlock &v) |
Write a consecutive block of bytes directly to the I2C file handle. 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 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... | |
virtual CommonOLED & | normal_display (void)=0 |
Toggle the various display modes. More... | |
virtual CommonOLED & | all_on_display (void)=0 |
All pixels set ON . More... | |
virtual CommonOLED & | all_off_display (void)=0 |
All pixels set OFF . More... | |
virtual CommonOLED & | invert_display (void)=0 |
Invert display mode. More... | |
virtual CommonOLED & | set_font (const Font::EType type=SG::Font::EType::k8x8CapRouge) |
Set a font to use when writing text to the OLED. By default, if not explicitely set, the font used will be SG::Font::CapRouge. More... | |
virtual CommonOLED & | set_font (std::shared_ptr< SG::Font::Monospace > font_to_use) |
virtual CommonOLED & | show (const char c) |
Display the given text. More... | |
virtual CommonOLED & | show (const std::string &str) |
Display the given text. More... | |
bool | is_portrait (void) const |
Quickly determine if the OLED is in portrait or landscape mode. More... | |
bool | is_landscape (void) const |
Quickly determine if the OLED is in portrait or landscape mode. More... | |
virtual CommonOLED & | rotate_90 (void) |
Set the orientation for the display. More... | |
virtual CommonOLED & | rotate_180 (void) |
Set the orientation for the display. More... | |
virtual CommonOLED & | rotate_270 (void) |
Set the orientation for the display. More... | |
virtual CommonOLED & | set_orientation (const EOrientation new_orientation=EOrientation::kLandscape) |
virtual GroveI2CDigital & | write8 (const I2CRegister reg, const uint8_t value) |
Write the given value to the specified register. More... | |
virtual GroveI2CDigital & | write16 (const I2CRegister reg, const uint16_t value) |
bool | operator== (const GroveBase &rhs) const |
Test object equality. More... | |
bool | operator!= (const GroveBase &rhs) const |
Test object equality. More... | |
Static Public Member Functions | |
static I2CBus | detect_i2c_bus_number (const bool force_detect=false, const int force_bus_number=-1) |
Detect the I2C bus to use to talk to Grove I2C devices. More... | |
static I2CAddress | get_address_from_type (const EGroveType &type) |
Get the default I2C address for a given type. More... | |
Public Attributes | |
I2CBus | i2c_bus_number |
The bus number to use for I2C Grove twigs. More... | |
I2CAddress | i2c_address |
The I2C address used to communicate with the Grove device. More... | |
int | i2c_file_handle |
The file handle to /dev/i2c-* used to communicate with the Grove device. More... | |
EGroveType | grove_type |
Grove type. More... | |
std::string | grove_name |
User-supplied name. More... | |
Protected Attributes | |
EOrientation | orientation |
Landscape or portrait mode. More... | |
std::shared_ptr< Font::Monospace > | font |
Font used when writing text to the OLED. Default is SG::Font::CapRouge. More... | |
Font::Monospace::Fontmap | font_map |
Font used when writing text to the OLED. Default is SG::Font::CapRouge. More... | |
The I2C 0.96" OLED and I2C 1.12" OLED displays have quite a bit of common functionality.
These two Grove twigs use chips that function in similar manners.
Grove Twig | SG++ Class | Chip | Dimensions | Colour Depth | Datasheet URL |
---|---|---|---|---|---|
1.12" OLED | OLED112 | Solomon Systech SSD1308 | 128 x 64 pixels | 1-level on/off (1-bit) | http://garden.seeedstudio.com/images/4/46/SSD1308_1.0.pdf |
0.96" OLED | OLED096 | Solomon Systech SSD1327 | 128 x 128 pixels | 1-level on/off (1-bit) | http://garden.seeedstudio.com/images/8/82/SSD1327_datasheet.pdf |
Both of these appear at I2C address 0x3c
.
|
inherited |
I2C addresses.
|
inherited |
Block of sequential bytes to read or write.
|
inherited |
I2C bus.
|
inherited |
I2C register.
|
strong |
|
virtual |
Destructor.
SG::CommonOLED::CommonOLED | ( | const SG::EGroveType | t = SG::EGroveType::kUnknown , |
const std::string & | name = "" , |
||
const SG::GroveI2CDigital::I2CAddress | addr = 0 |
||
) |
Constructor.
References SG::Font::k8x8CapRouge, and set_font().
|
pure virtual |
All pixels set OFF
.
Implemented in SG::OLED112, and SG::OLED096.
Referenced by common_oled().
|
pure virtual |
All pixels set ON
.
Implemented in SG::OLED112, and SG::OLED096.
Referenced by common_oled().
|
pure virtual |
Set all of the GDDRAM to 0x00 to clear the screen.
Implemented in SG::OLED112, and SG::OLED096.
Referenced by flood().
|
staticinherited |
Detect the I2C bus to use to talk to Grove I2C devices.
This is normally 1
or 2
. The detection consists of looking at /dev/i2c* devices.
[in] | force_detect | The detected bus number is usually remembered to prevent having to re-detect it every time a new GroveI2C object is instantiated. If force_detect is set to true , then this will force GroveI2C to ignore the previously cached bus number and re-detect the I2C bus. |
[in] | force_bus_number | If an explicit bus number should be used, then force_bus_number can be set to the correct bus value. This will prevent calls to detect_i2c_bus_number() from attempting to auto-detect the I2C bus. Setting the I2C bus number this way wont change existing GroveI2C objects that have already been instantiated. Only new objects will use the new bus number. The actual bus number used by specific objects is i2c_bus_number. |
std::system_error | if /dev cannot be opened. |
std::runtime_error | if the I2C bus cannot be found in /dev. |
Referenced by SG::GroveI2CDigital::is_digital().
|
virtual |
Fade from black to white.
There are 4 transitions, so the default 500 millisecond pause between each transition means a total time of 2 seconds before this function returns.
References flood().
Referenced by SG::OLED112::reset(), and stop_scrolling().
|
virtual |
Fade from white to black.
There are 4 transitions, so the default 500 millisecond pause between each transition means a total time of 2 seconds before this function returns.
References flood().
Referenced by SG::OLED112::reset(), and stop_scrolling().
|
virtual |
Repeat the given pattern until it fills up the entire OLED.
References clear_screen(), pixel_height(), pixel_width(), set_XY(), and SG::GroveI2CDigital::write_block().
Referenced by SG::OLED112::clear_screen(), fade_black_to_white(), fade_white_to_black(), and stop_scrolling().
|
staticinherited |
Get the default I2C address for a given type.
Note that several Grove types have multiple addresses. This only returns the first address.
References SG::k3AxisDigitalAccelerometer16g, SG::k3AxisDigitalAccelerometer1_5g, SG::k3AxisDigitalAccelerometer400g, SG::k3AxisDigitalCompass, SG::k3AxisDigitalGyro, SG::k6AxisAccelerometerAndCompassV1, SG::k6AxisAccelerometerAndCompassV2, SG::kBarometerHighAccuracy, SG::kBarometerSensor, SG::kBarometerSensorBMP180, SG::kDigitalInfraredTemperatureSensor, SG::kDigitalLightSensor, SG::kGestureV1, SG::kI2CADC, SG::kI2CColorSensor, SG::kI2CFMReceiver, SG::kI2CMotorDriverV10, SG::kI2CMotorDriverV12, SG::kIMU10DOF, SG::kIMU9DOFV1, SG::kIMU9DOFV2, SG::kLCDRGBBacklight, SG::kMultichannelGasSensor, SG::kNFCTag, SG::kOLEDDisplay0_96, SG::kOLEDDisplay1_12, SG::kQTouchSensor, SG::kRTC, SG::kTemperatureAndHumiditySensor, and SG::kTouchSensor.
|
inlineinherited |
Get the address for this Grove type.
References SG::GroveI2CDigital::get_address_from_type(), SG::GroveBase::get_type(), SG::GroveI2CDigital::read16(), and SG::GroveI2CDigital::read8().
Referenced by SG::GroveI2CDigital::get_address_from_type(), SG::GroveI2CDigital::GroveI2CDigital(), and SG::GroveI2CDigital::is_digital().
|
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(), set_display_bitmap(), set_orientation(), temperature(), variable_led(), SG::GroveI2CDigital::write16(), SG::GroveI2CDigital::write8(), SG::GroveI2CDigital::write_block(), and SG::GroveI2CDigital::write_byte().
|
virtual |
Get the full display bitmap.
The display contains 128 x 128 pixels, and each pixels has 4 bits, for a total of 65536 bits, or 8192 bytes (8 KiB).
Referenced by stop_scrolling().
|
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==().
|
inlinevirtual |
Return the current orientation. The default after reset() is EOrientation::kLandscape.
References orientation.
|
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().
|
pure virtual |
Invert display mode.
Implemented in SG::OLED112, and SG::OLED096.
Referenced by common_oled().
|
inlinevirtualinherited |
This is always false
for GroveI2CDigital.
Implements SG::GroveI2C.
|
inlinevirtualinherited |
This is always true
for GroveI2CDigital.
Implements SG::GroveI2C.
References SG::GroveI2CDigital::detect_i2c_bus_number(), and SG::GroveI2CDigital::get_address_from_type().
|
inlinevirtualinherited |
This is always false
for GroveI2C.
Implements SG::GroveBase.
References SG::GroveI2C::is_analog(), and SG::GroveI2C::is_digital().
|
inlinevirtualinherited |
This is always true
for GroveI2C.
Implements SG::GroveBase.
|
inlinevirtualinherited |
This is always false
for GroveI2C.
Implements SG::GroveBase.
|
inline |
Quickly determine if the OLED is in portrait or landscape mode.
References kLandscape, kLandscape180, orientation, rotate_180(), rotate_270(), rotate_90(), and set_orientation().
|
inline |
Quickly determine if the OLED is in portrait or landscape mode.
References kPortrait, kPortrait180, and orientation.
Referenced by show().
|
inlinevirtual |
Lock the OLED driver IC MCU. Once locked, the only command that will be accepted is unlock(). All other commands and memory access are ignored.
References send_command().
Referenced by common_oled().
|
pure virtual |
Get the number of bits each pixel occupies in memory.
Implemented in SG::OLED112, and SG::OLED096.
|
pure virtual |
Get the number of pixels that can be stored in memory.
Implemented in SG::OLED112, and SG::OLED096.
|
pure virtual |
Get the number of pixels that can be stored in memory.
Implemented in SG::OLED112, and SG::OLED096.
|
pure virtual |
Toggle the various display modes.
Normal display mode.
Implemented in SG::OLED112, and SG::OLED096.
Referenced by common_oled().
|
inlineinherited |
Test object equality.
References SG::GroveBase::operator==().
|
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==().
|
pure virtual |
Get the number of bits per pixel.
Implemented in SG::OLED112, and SG::OLED096.
|
pure virtual |
Get the height in pixels.
Implemented in SG::OLED112, and SG::OLED096.
Referenced by flood().
|
pure virtual |
Get the width in pixels.
Implemented in SG::OLED112, and SG::OLED096.
Referenced by flood().
|
inlinevirtualinherited |
Read a 16-bit word from the specified register, but only keep the bottom 12 bits.
Some devices such as the I2CADC return 12-bit values.
References SG::GroveI2CDigital::read16(), SG::GroveI2CDigital::read_block(), SG::GroveI2CDigital::write16(), SG::GroveI2CDigital::write8(), SG::GroveI2CDigital::write_block(), and SG::GroveI2CDigital::write_byte().
Referenced by SG::I2CADC::read12().
|
virtualinherited |
Read a 16-bit word from the specified register.
std::system_error | if the register cannot be read. |
References SG::GroveBase::get_description(), SG::GroveI2CDigital::i2c_address, and SG::GroveI2CDigital::i2c_file_handle.
Referenced by SG::GroveI2CDigital::get_address_from_type(), and SG::GroveI2CDigital::read12().
|
virtualinherited |
Read a byte (8 bits) from the specificed register.
std::system_error | if the register cannot be read. |
References SG::GroveBase::get_description(), SG::GroveI2CDigital::i2c_address, and SG::GroveI2CDigital::i2c_file_handle.
Referenced by SG::GroveI2CDigital::get_address_from_type(), SG::ThreeAxisDigitalCompass::get_config(), SG::ThreeAxisDigitalCompass::get_data(), SG::ThreeAxisDigitalCompass::get_mode(), SG::ThreeAxisDigitalCompass::get_status(), and SG::I2CADC::read8().
|
virtualinherited |
Read a consecutive block of bytes, anywhere between 1 and 32 bytes in length.
std::system_error | if the register cannot be read. |
References SG::GroveBase::get_description(), SG::GroveI2CDigital::i2c_address, and SG::GroveI2CDigital::i2c_file_handle.
Referenced by SG::GroveI2CDigital::read12().
|
pure virtual |
Reset the OLED.
Implemented in SG::OLED112, and SG::OLED096.
Referenced by common_oled().
|
virtual |
Set the orientation for the display.
References kLandscape, kLandscape180, kPortrait, kPortrait180, orientation, and set_orientation().
Referenced by is_landscape().
|
virtual |
Set the orientation for the display.
References kLandscape, kLandscape180, kPortrait, kPortrait180, orientation, and set_orientation().
Referenced by is_landscape().
|
virtual |
Set the orientation for the display.
References kLandscape, kLandscape180, kPortrait, kPortrait180, orientation, and set_orientation().
Referenced by is_landscape().
|
virtual |
Stop horizontal scrolling.
References SG::GroveI2CDigital::write_block().
Referenced by SG::OLED112::all_on_display(), SG::OLED112::do_not_invert_display(), SG::OLED112::invert_display(), lock(), SG::OLED112::normal_display(), SG::OLED112::reset(), set_contrast(), start_scrolling(), stop_scrolling(), turn_off(), turn_on(), and unlock().
|
virtual |
Send a command with an additional 1-byte parameter.
References SG::GroveI2CDigital::write_block().
|
inlinevirtual |
Set the contrast level to a value between 0 and 255.
[in] | level | Default level is 127 (0x7f). 0 is dark, and 255 is bright. |
References send_command().
Referenced by common_oled(), and SG::OLED112::reset().
|
virtual |
Set the full display bitmap.
[in] | block | Must be exactly 8192 bytes to represent 128 x 128 pixels x 4 bits grayscale. |
References SG::GroveBase::get_description(), SG::GroveI2CDigital::write_block(), and SG::GroveI2CDigital::write_byte().
Referenced by stop_scrolling().
|
virtual |
Set a font to use when writing text to the OLED. By default, if not explicitely set, the font used will be SG::Font::CapRouge.
Fonts included with SG++:
References SG::Font::get().
Referenced by CommonOLED(), SG::OLED112::reset(), and stop_scrolling().
|
virtual |
For example:
|
virtual |
std::invalid_argument | if the orientation is invalid. |
References SG::GroveBase::get_description(), kLandscape, kLandscape180, kPortrait, kPortrait180, orientation, stop_scrolling(), SG::BeagleBone::Detect::to_string(), and SG::GroveI2CDigital::write_block().
Referenced by is_landscape(), SG::OLED112::reset(), rotate_180(), rotate_270(), and rotate_90().
|
virtual |
Referenced by flood(), SG::OLED112::reset(), and stop_scrolling().
|
virtual |
Display the given text.
std::runtime_error | if the font bitmap is the wrong size. |
References font, font_map, is_portrait(), SG::BeagleBone::Detect::to_string(), and SG::GroveI2CDigital::write_block().
Referenced by SG::OLED112::reset(), show(), and stop_scrolling().
|
virtual |
Display the given text.
std::runtime_error | if the font bitmap is the wrong size. |
References show().
|
inlinevirtual |
Start horizontal scrolling. Multiple calls can be made to start_scrolling() and stop_scrolling() to start and stop scrolling multiple times.
References send_command().
Referenced by common_oled().
|
inlinevirtual |
References fade_black_to_white(), fade_white_to_black(), flood(), get_display_bitmap(), SG::Font::k8x8CapRouge, send_command(), set_display_bitmap(), set_font(), set_XY(), and show().
Referenced by SG::OLED112::clear_screen(), common_oled(), SG::OLED112::reset(), and set_orientation().
|
inlinevirtual |
turn OFF
the OLED.
References send_command().
Referenced by common_oled(), and SG::OLED112::reset().
|
inlinevirtual |
Turn ON
the OLED.
References send_command().
Referenced by common_oled(), SG::OLED096::reset(), and SG::OLED112::reset().
|
inlinevirtual |
Unlock the OLED driver IC MCU.
References send_command().
Referenced by common_oled(), and SG::OLED112::reset().
|
virtualinherited |
std::system_error | if the value cannot be written. |
References SG::GroveBase::get_description(), SG::GroveI2CDigital::i2c_address, and SG::GroveI2CDigital::i2c_file_handle.
Referenced by SG::GroveI2CDigital::read12(), and SG::I2CADC::write16().
|
virtualinherited |
Write the given value to the specified register.
std::system_error | if the value cannot be written. |
References SG::GroveBase::get_description(), SG::GroveI2CDigital::i2c_address, and SG::GroveI2CDigital::i2c_file_handle.
Referenced by SG::GroveI2CDigital::read12(), SG::ThreeAxisDigitalCompass::set_config(), SG::ThreeAxisDigitalCompass::set_mode(), and SG::I2CADC::write8().
|
virtualinherited |
Write a consecutive block of bytes, anywhere between 1 and 32 bytes in length.
std::length_error | if the block is too long to write. |
std::system_error | if the block failed to write. |
References SG::GroveBase::get_description(), SG::GroveI2CDigital::i2c_address, SG::GroveI2CDigital::i2c_file_handle, and SG::BeagleBone::Detect::to_string().
Referenced by flood(), SG::GroveI2CDigital::read12(), SG::OLED096::reset(), send_command(), set_display_bitmap(), set_orientation(), and show().
|
virtualinherited |
Write a consecutive block of bytes directly to the I2C file handle.
std::system_error | if the block failed to write. |
References SG::GroveBase::get_description(), SG::GroveI2CDigital::i2c_address, SG::GroveI2CDigital::i2c_file_handle, and SG::BeagleBone::Detect::to_string().
|
virtualinherited |
Write a single byte to the I2C bus.
std::system_error | if the value cannot be writen. |
References SG::GroveBase::get_description(), SG::GroveI2CDigital::i2c_address, and SG::GroveI2CDigital::i2c_file_handle.
Referenced by SG::OLED096::all_off_display(), SG::OLED096::all_on_display(), SG::OLED096::invert_display(), SG::OLED096::normal_display(), SG::GroveI2CDigital::read12(), and set_display_bitmap().
|
protected |
Font used when writing text to the OLED. Default is SG::Font::CapRouge.
Referenced by set_font(), and show().
|
protected |
Font used when writing text to the OLED. Default is SG::Font::CapRouge.
Referenced by set_font(), and show().
|
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=().
|
inherited |
The I2C address used to communicate with the Grove device.
Referenced by SG::GroveI2CDigital::GroveI2CDigital(), SG::I2CADC::operator==(), SG::GroveI2CDigital::read16(), SG::GroveI2CDigital::read8(), SG::GroveI2CDigital::read_block(), SG::GroveI2CDigital::write16(), SG::GroveI2CDigital::write8(), SG::GroveI2CDigital::write_block(), and SG::GroveI2CDigital::write_byte().
|
inherited |
The bus number to use for I2C Grove twigs.
The exposed I2C bus is usually 1
or 2
. This is normally auto-detected by detect_i2c_bus_number() called by the constructor, and doesn't need to be manually set.
Referenced by SG::GroveI2CDigital::GroveI2CDigital().
|
inherited |
The file handle to /dev/i2c-* used to communicate with the Grove device.
Referenced by SG::GroveI2CDigital::GroveI2CDigital(), SG::GroveI2CDigital::read16(), SG::GroveI2CDigital::read8(), SG::GroveI2CDigital::read_block(), SG::GroveI2CDigital::write16(), SG::GroveI2CDigital::write8(), SG::GroveI2CDigital::write_block(), SG::GroveI2CDigital::write_byte(), and SG::GroveI2CDigital::~GroveI2CDigital().
|
protected |
Landscape or portrait mode.
Referenced by get_orientation(), is_landscape(), is_portrait(), rotate_180(), rotate_270(), rotate_90(), and set_orientation().