upm  0.5.1
Sensor/Actuator repository for libmraa (v0.9.1)
 All Data Structures Files Functions Variables Enumerations Enumerator Macros Groups Pages
Public Member Functions
SSD1308 Class Reference

API for SSD1308 I2C-controlled OLED displays. More...

Detailed Description

SSD1308 is a 128x64 dot-matrix OLED/PLED segment driver with a controller. This implementation was tested using the Grove LED 128×64 Display module, which is an OLED monochrome display.

ssd1308.jpeg
upm::SSD1308 *lcd = new upm::SSD1308(BUS_NUMBER, DEVICE_ADDRESS);
lcd->clear();
lcd->draw(intel_logo, 1024);
delete lcd;

Public Member Functions

 SSD1308 (int bus, int address=0x3C)
 
 ~SSD1308 ()
 
mraa::Result draw (uint8_t *data, int bytes)
 
mraa::Result write (std::string msg)
 
mraa::Result setCursor (int row, int column)
 
mraa::Result clear ()
 
mraa::Result home ()
 
- Public Member Functions inherited from LCD
mraa::Result write (int x, int y, std::string msg)
 
std::string name ()
 

Additional Inherited Members

- Protected Attributes inherited from LCD
std::string m_name
 

Constructor & Destructor Documentation

SSD1308 ( int  bus,
int  address = 0x3C 
)

SSD1308 constructor; calls libmraa initialisation functions

Parameters
busI2C bus to use
addressSlave address the LCD is registered on

Here is the call graph for this function:

~SSD1308 ( )

SSD1308 destructor

Member Function Documentation

mraa::Result draw ( uint8_t *  data,
int  bytes 
)

Draws an image; see examples/python/make_oled_pic.py for an explanation of how pixels are mapped to bytes

Parameters
dataBuffer to read
bytesNumber of bytes to read from the pointer
Returns
Result of the operation
mraa::Result write ( std::string  msg)
virtual

Writes a string to the LCD

Parameters
msgstd::string to write to the display; note: only ASCII characters are supported
Returns
Result of the operation

Implements LCD.

mraa::Result setCursor ( int  row,
int  column 
)
virtual

Sets the cursor to specified coordinates

Parameters
rowRow to set the cursor to
columnColumn to set the cursor to
Returns
Result of the operation

Implements LCD.

Here is the caller graph for this function:

mraa::Result clear ( )
virtual

Clears the display of all characters

Returns
Result of the operation

Implements LCD.

Here is the call graph for this function:

Here is the caller graph for this function:

mraa::Result home ( )
virtual

Returns to the original coordinates (0,0)

Returns
Result of the operation

Implements LCD.

Here is the call graph for this function:

Here is the caller graph for this function:

Inheritance diagram for SSD1308:
Inheritance graph
[legend]
Collaboration diagram for SSD1308:
Collaboration graph
[legend]

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