upm  0.3.1
Sensor/Actuator repository for libmraa (v0.7.2)
Public Member Functions

API for SSD1327 i2c controlled OLED displays. More...

Detailed Description

The SSD1327 is a 96x96 Dot matrix OLED/PLED segment driver with controller. This implementation was tested using the Grove LED 96×96 Display module which is an OLED monochrome display.

ssd1327.jpeg
upm::SSD1327 *lcd = new upm::SSD1327(BUS_NUMBER, 0x3C);
// If you don't set the display to be white, the seeed logo will appear jagged
lcd->setGrayLevel(12);
lcd->draw(SeeedLogo, 96 * 96 / 8);
// Simple print hello world
for (uint8_t i = 0; i < 12; i++)
{
lcd->setCursor(i, 0);
lcd->setGrayLevel(i);
lcd->write("Hello World");
}
delete lcd;

Public Member Functions

 SSD1327 (int bus, int address=0x3C)
 
 ~SSD1327 ()
 
mraa_result_t draw (uint8_t *data, int bytes)
 
void setGrayLevel (uint8_t level)
 
mraa_result_t write (std::string msg)
 
mraa_result_t setCursor (int row, int column)
 
mraa_result_t clear ()
 
mraa_result_t home ()
 
- Public Member Functions inherited from I2CLcd
 I2CLcd (int bus, int lcdAddress)
 
mraa_result_t write (int x, int y, std::string msg)
 
virtual mraa_result_t createChar (uint8_t charSlot, uint8_t charData[])
 
std::string name ()
 

Additional Inherited Members

- Protected Attributes inherited from I2CLcd
std::string m_name
 
int m_lcd_control_address
 
int m_bus
 
mraa::I2c m_i2c_lcd_control
 

Constructor & Destructor Documentation

SSD1327 ( int  bus,
int  address = 0x3C 
)

SSD1327 Constructor, calls libmraa initialisation functions

Parameters
busi2c bus to use
addressthe slave address the lcd is registered on

Here is the call graph for this function:

~SSD1327 ( )

SSD1327 destructor

Member Function Documentation

mraa_result_t draw ( uint8_t *  data,
int  bytes 
)

Draw an image, see examples/python/make_oled_pic.py for an explanation on how the pixels are mapped to bytes

Parameters
datathe buffer to read
bytesthe amount of bytes to read from the pointer
Returns
Result of operation
void setGrayLevel ( uint8_t  level)

Set gray level for LCD panel

Parameters
graylevel from 0-255
Returns
Result of operation
mraa_result_t write ( std::string  msg)
virtual

Write a string to LCD

Parameters
msgThe std::string to write to display, note only ascii chars are supported
Returns
Result of operation

Implements I2CLcd.

mraa_result_t setCursor ( int  row,
int  column 
)
virtual

Set cursor to a coordinate

Parameters
rowThe row to set cursor to
columnThe column to set cursor to
Returns
Result of operation

Implements I2CLcd.

Here is the caller graph for this function:

mraa_result_t clear ( )
virtual

Clear display from characters

Returns
Result of operatio

Implements I2CLcd.

Here is the caller graph for this function:

mraa_result_t home ( )
virtual

Return to coordinate 0,0

Returns
Result of operation

Implements I2CLcd.

Here is the call graph for this function:

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

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