upm  0.3.2
Sensor/Actuator repository for libmraa (v0.7.2)
Public Member Functions | Protected Member Functions

API for EBOLED spi controlled OLED display. More...

Detailed Description

The EBOLED is an ssd1306 with some modifications to work as an Edison Block. It is a 64x48 pixel OLED display that connects directly to an edison via it's 80-pin connector. Edison Blocks are stackable modules created by Sparkfun.

This block has some buttons on it that can be accessed using standard GPIO – this driver only concerns itself with the display.

// Instantiate an Edison Block OLED using default values
upm::EBOLED *lcd = new upm::EBOLED();
lcd->clear();
lcd->setCursor(2, 0);
lcd->write("Hello");
lcd->setCursor(3, 5);
lcd->write("World!");
cout << "Sleeping for 5 seconds..." << endl;
sleep(5);
delete lcd;

Public Member Functions

 EBOLED (int spi=EBOLED_DEFAULT_SPI_BUS, int CD=EBOLED_DEFAULT_CD, int reset=EBOLED_DEFAULT_RESET)
 
 ~EBOLED ()
 
mraa_result_t draw (uint8_t *data, int bytes)
 
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 LCD
mraa_result_t write (int x, int y, std::string msg)
 
std::string name ()
 

Protected Member Functions

mraa_result_t command (uint8_t cmd)
 
mraa_result_t data (uint8_t data)
 
mraa_result_t writeChar (uint8_t value)
 
mraa_result_t setAddressingMode (displayAddressingMode mode)
 

Additional Inherited Members

- Protected Attributes inherited from LCD
std::string m_name
 

Constructor & Destructor Documentation

EBOLED ( int  spi = EBOLED_DEFAULT_SPI_BUS,
int  CD = EBOLED_DEFAULT_CD,
int  reset = EBOLED_DEFAULT_RESET 
)

EBOLED Constructor. Note that you will not have any choice as to the pins used, so they are all set to default values.

Parameters
spispi bus to use
CDCommand/Data select pin
resetreset pin
addressthe slave address the lcd is registered on

Here is the call graph for this function:

~EBOLED ( )

EBOLED Destructor

Here is the call graph for this function:

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 write
bytesthe number of bytes to write
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 LCD.

mraa_result_t setCursor ( int  row,
int  column 
)
virtual

Set cursor to a coordinate

Parameters
rowthe row to set cursor to. This device supports 6 rows.
columnthe column to set cursor to. This device support 64 columns
Returns
result of operation

Implements LCD.

Here is the caller graph for this function:

mraa_result_t clear ( )
virtual

Clear display

Returns
result of operation

Implements LCD.

Here is the call graph for this function:

Here is the caller graph for this function:

mraa_result_t home ( )
virtual

Return to coordinate 0,0

Returns
result of operation

Implements LCD.

Here is the call graph for this function:

Here is the caller graph for this function:

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

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