upm
1.5.0
Sensor/Actuator repository for libmraa (v1.8.0)
|
API for EBOLED spi controlled OLED display. More...
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.
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 () |
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.
spi | spi bus to use |
CD | Command/Data select pin |
reset | reset pin |
int clear | ( | ) |
Clear display
void drawChar | ( | short | x, |
short | y, | ||
short | data, | ||
short | color, | ||
short | size | ||
) |
Write a single character to the screen.
x | Axis on the horizontal scale |
y | Axis on the vertical scale |
data | Character to write |
color | Character color |
size | Size of the font |
void drawCircle | ( | short | x0, |
short | y0, | ||
short | radius, | ||
short | color | ||
) |
Draw a circle to the screen buffer.
x0 | the x coordinate of the circle's center |
y0 | the y coordinate of the circle's center |
radius | the radius of the circle |
color | outline 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.
x0 | the x coordinate of the circle's center |
y0 | the y coordinate of the circle's center |
radius | the radius of the circle |
color | outline 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.
x0 | the x position of the beginning of the line |
y0 | the y position of the beginning of the line |
x1 | the x position of the end of the line |
y1 | the y position of the end of the line |
color | line 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.
x | the x position of the beginning of the line |
y | the y position of the beginning of the line |
width | is the horizontal length of the line |
color | line 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.
x | the x position of the beginning of the line |
y | the y position of the beginning of the line |
height | is the vertical length of the line |
color | line 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.
x | the x position of the pixel |
y | the y position of the pixel |
color | pixel 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.
x | the left edge |
y | the top edge |
width | sets the right edge |
height | bottom edge |
color | outline 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.
x | the left edge |
y | the top edge |
width | sets the right edge |
height | bottom edge |
color | fill 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.
x0 | the x coordinate of the arc's center |
y0 | the y coordinate of the arc's center |
radius | the radius of the arc |
cornername | denotes which of the 4 quarters to draw - 1,2,4,8 |
color | outline 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.
x0 | the x coordinate of the arc's center |
y0 | the y coordinate of the arc's center |
radius | the radius of the arc |
cornername | denotes which of the 4 quarters to draw - 1,2,4,8 |
color | fill 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.
x | the left edge |
y | the top edge |
width | sets the right edge |
height | bottom edge |
radius | of the rounded corners |
color | outline 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.
x0 | the x coordinate of the first corner |
y0 | the y coordinate of the first corner |
x1 | the x coordinate of the second corner |
y1 | the y coordinate of the second corner |
x2 | the x coordinate of the third corner |
y2 | the y coordinate of the third corner |
color | outline 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.
x0 | the x coordinate of the first corner |
y0 | the y coordinate of the first corner |
x1 | the x coordinate of the second corner |
y1 | the y coordinate of the second corner |
x2 | the x coordinate of the third corner |
y2 | the y coordinate of the third corner |
color | fill color is COLOR_WHITE, COLOR_BLACK or COLOR_XOR |
void fillScreen | ( | short | color | ) |
Fill the screen buffer with specified color.
color | fill color is COLOR_WHITE, COLOR_BLACK or COLOR_XOR |
int home | ( | ) |
Return to coordinate 0,0
int refresh | ( | ) |
Draw the buffer to screen.
int setCursor | ( | int | row, |
int | column | ||
) |
Set cursor to a coordinate
row | Axis on the vertical scale. This device supports 6 rows. |
column | Axis on the horizontal scale This device supports 64 columns |
void setTextColor | ( | short | textColor | ) |
Sets a text color for a message
textColor | Font color: COLOR_WHITE, COLOR_BLACK or COLOR_XOR |
void setTextSize | ( | short | size | ) |
Sets the size of the font
size | Font size |
void setTextWrap | ( | short | wrap | ) |
Wraps a printed message
wrap | True (1) or false (0) |
int write | ( | String | msg | ) |
Write a string to LCD
msg | the std::string to write to display, note only ascii chars are supported |