upm  1.5.0
Sensor/Actuator repository for libmraa (v1.8.0)
Public Member Functions | List of all members

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.

eboled.jpg


OLED Sensor image provided by SparkFun* under CC BY-NC-SA-3.0.

Public Member Functions

synchronized void delete ()
 
 EBOLED (int spi, int CD, int reset)
 
 EBOLED (int spi, int CD)
 
 EBOLED (int spi)
 
int refresh ()
 
int write (String msg)
 
int setCursor (int row, int column)
 
void setTextColor (short textColor)
 
void setTextSize (short size)
 
void setTextWrap (short wrap)
 
void drawChar (short x, short y, short data, short color, short size)
 
int clear ()
 
void clearScreenBuffer ()
 
int home ()
 
void drawPixel (byte x, byte y, short color)
 
void drawPixel (byte x, byte y)
 
void drawLine (byte x0, byte y0, byte x1, byte y1, short color)
 
void drawLine (byte x0, byte y0, byte x1, byte y1)
 
void drawLineHorizontal (byte x, byte y, short width, short color)
 
void drawLineHorizontal (byte x, byte y, short width)
 
void drawLineVertical (byte x, byte y, short height, short color)
 
void drawLineVertical (byte x, byte y, short height)
 
void drawRectangle (byte x, byte y, short width, short height, short color)
 
void drawRectangle (byte x, byte y, short width, short height)
 
void drawRoundedRectangle (byte x, byte y, byte width, byte height, short radius, short color)
 
void drawRectangleFilled (byte x, byte y, short width, short height, short color)
 
void drawRectangleFilled (byte x, byte y, short width, short height)
 
void drawTriangle (byte x0, byte y0, byte x1, byte y1, byte x2, byte y2, short color)
 
void drawTriangle (byte x0, byte y0, byte x1, byte y1, byte x2, byte y2)
 
void drawTriangleFilled (byte x0, byte y0, byte x1, byte y1, byte x2, byte y2, short color)
 
void drawCircle (short x0, short y0, short radius, short color)
 
void drawCircle (short x0, short y0, short radius)
 
void drawRoundCorners (byte x0, byte y0, short radius, short cornername, short color)
 
void drawCircleFilled (byte x0, byte y0, short radius, short color)
 
void drawRoundedCornersFilled (byte x0, byte y0, short radius, short cornername, short delta, short color)
 
void fillScreen (short color)
 
void fillScreen ()
 
- Public Member Functions inherited from LCD
synchronized void delete ()
 
int write (int x, int y, String msg)
 
int write (String msg)
 
int setCursor (int row, int column)
 
int clear ()
 
int home ()
 
String name ()
 

Constructor & Destructor Documentation

EBOLED ( int  spi,
int  CD,
int  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

Member Function Documentation

int clear ( )

Clear display

Returns
result of operation
void drawChar ( short  x,
short  y,
short  data,
short  color,
short  size 
)

Write a single character to the screen.

Parameters
xAxis on the horizontal scale
yAxis on the vertical scale
dataCharacter to write
colorCharacter color
sizeSize of the font
void drawCircle ( short  x0,
short  y0,
short  radius,
short  color 
)

Draw a circle to the screen buffer.

Parameters
x0the x coordinate of the circle's center
y0the y coordinate of the circle's center
radiusthe radius of the circle
coloroutline is COLOR_WHITE, COLOR_BLACK or COLOR_XOR
void drawCircleFilled ( byte  x0,
byte  y0,
short  radius,
short  color 
)

Draw a filled circle to the screen buffer.

Parameters
x0the x coordinate of the circle's center
y0the y coordinate of the circle's center
radiusthe radius of the circle
coloroutline is COLOR_WHITE, COLOR_BLACK or COLOR_XOR
void drawLine ( byte  x0,
byte  y0,
byte  x1,
byte  y1,
short  color 
)

Draw a line to the screen buffer.

Parameters
x0the x position of the beginning of the line
y0the y position of the beginning of the line
x1the x position of the end of the line
y1the y position of the end of the line
colorline is COLOR_WHITE, COLOR_BLACK or COLOR_XOR
void drawLineHorizontal ( byte  x,
byte  y,
short  width,
short  color 
)

Draw a horizontal line to the screen buffer.

Parameters
xthe x position of the beginning of the line
ythe y position of the beginning of the line
widthis the horizontal length of the line
colorline is COLOR_WHITE, COLOR_BLACK or COLOR_XOR
void drawLineVertical ( byte  x,
byte  y,
short  height,
short  color 
)

Draw a vertical line to the screen buffer.

Parameters
xthe x position of the beginning of the line
ythe y position of the beginning of the line
heightis the vertical length of the line
colorline is COLOR_WHITE, COLOR_BLACK or COLOR_XOR
void drawPixel ( byte  x,
byte  y,
short  color 
)

Write a single pixel to the screen buffer. Can do an specific color write or toggle (xor) a pixel.

Parameters
xthe x position of the pixel
ythe y position of the pixel
colorpixel is COLOR_WHITE, COLOR_BLACK or COLOR_XOR
void drawRectangle ( byte  x,
byte  y,
short  width,
short  height,
short  color 
)

Draw a rectangle to the screen buffer.

Parameters
xthe left edge
ythe top edge
widthsets the right edge
heightbottom edge
coloroutline is COLOR_WHITE, COLOR_BLACK or COLOR_XOR
void drawRectangleFilled ( byte  x,
byte  y,
short  width,
short  height,
short  color 
)

Draw a filled rectangle to the screen buffer.

Parameters
xthe left edge
ythe top edge
widthsets the right edge
heightbottom edge
colorfill color is COLOR_WHITE, COLOR_BLACK or COLOR_XOR
void drawRoundCorners ( byte  x0,
byte  y0,
short  radius,
short  cornername,
short  color 
)

Draw a quarter circle arc to the screen buffer.

Parameters
x0the x coordinate of the arc's center
y0the y coordinate of the arc's center
radiusthe radius of the arc
cornernamedenotes which of the 4 quarters to draw - 1,2,4,8
coloroutline is COLOR_WHITE, COLOR_BLACK or COLOR_XOR
void drawRoundedCornersFilled ( byte  x0,
byte  y0,
short  radius,
short  cornername,
short  delta,
short  color 
)

Draw a quarter pie to the screen buffer.

Parameters
x0the x coordinate of the arc's center
y0the y coordinate of the arc's center
radiusthe radius of the arc
cornernamedenotes which of the 4 quarters to draw - 1,2,4,8
colorfill color is COLOR_WHITE, COLOR_BLACK or COLOR_XOR
void drawRoundedRectangle ( byte  x,
byte  y,
byte  width,
byte  height,
short  radius,
short  color 
)

Draw a rectangle with rounded corners to the screen buffer.

Parameters
xthe left edge
ythe top edge
widthsets the right edge
heightbottom edge
radiusof the rounded corners
coloroutline is COLOR_WHITE, COLOR_BLACK or COLOR_XOR
void drawTriangle ( byte  x0,
byte  y0,
byte  x1,
byte  y1,
byte  x2,
byte  y2,
short  color 
)

Draw a triangle to the screen buffer.

Parameters
x0the x coordinate of the first corner
y0the y coordinate of the first corner
x1the x coordinate of the second corner
y1the y coordinate of the second corner
x2the x coordinate of the third corner
y2the y coordinate of the third corner
coloroutline is COLOR_WHITE, COLOR_BLACK or COLOR_XOR
void drawTriangleFilled ( byte  x0,
byte  y0,
byte  x1,
byte  y1,
byte  x2,
byte  y2,
short  color 
)

Draw a filled triangle to the screen buffer.

Parameters
x0the x coordinate of the first corner
y0the y coordinate of the first corner
x1the x coordinate of the second corner
y1the y coordinate of the second corner
x2the x coordinate of the third corner
y2the y coordinate of the third corner
colorfill color is COLOR_WHITE, COLOR_BLACK or COLOR_XOR
void fillScreen ( short  color)

Fill the screen buffer with specified color.

Parameters
colorfill color is COLOR_WHITE, COLOR_BLACK or COLOR_XOR

Here is the call graph for this function:

Here is the caller graph for this function:

int home ( )

Return to coordinate 0,0

Returns
result of operation
int refresh ( )

Draw the buffer to screen.

Returns
result of operation
int setCursor ( int  row,
int  column 
)

Set cursor to a coordinate

Parameters
rowAxis on the vertical scale. This device supports 6 rows.
columnAxis on the horizontal scale This device supports 64 columns
Returns
result of operation
void setTextColor ( short  textColor)

Sets a text color for a message

Parameters
textColorFont color: COLOR_WHITE, COLOR_BLACK or COLOR_XOR
void setTextSize ( short  size)

Sets the size of the font

Parameters
sizeFont size
void setTextWrap ( short  wrap)

Wraps a printed message

Parameters
wrapTrue (1) or false (0)
int write ( String  msg)

Write a string to LCD

Parameters
msgthe std::string to write to display, note only ascii chars are supported
Returns
result of operation
Inheritance diagram for EBOLED:
Inheritance graph
[legend]
Collaboration diagram for EBOLED:
Collaboration graph
[legend]

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