upm
0.5.1
Sensor/Actuator repository for libmraa (v0.9.1)
|
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 | |
EBOLED (int spi=EBOLED_DEFAULT_SPI_BUS, int CD=EBOLED_DEFAULT_CD, int reset=EBOLED_DEFAULT_RESET) | |
~EBOLED () | |
mraa::Result | refresh () |
mraa::Result | write (std::string msg) |
mraa::Result | setCursor (int row, int column) |
void | setTextColor (uint8_t textColor) |
void | setTextSize (uint8_t size) |
void | setTextWrap (uint8_t wrap) |
void | drawChar (uint8_t x, uint8_t y, uint8_t data, uint8_t color, uint8_t size) |
mraa::Result | clear () |
void | clearScreenBuffer () |
mraa::Result | home () |
void | drawPixel (int8_t x, int8_t y, uint8_t color=COLOR_WHITE) |
void | drawLine (int8_t x0, int8_t y0, int8_t x1, int8_t y1, uint8_t color=COLOR_WHITE) |
void | drawLineHorizontal (int8_t x, int8_t y, uint8_t width, uint8_t color=COLOR_WHITE) |
void | drawLineVertical (int8_t x, int8_t y, uint8_t height, uint8_t color=COLOR_WHITE) |
void | drawRectangle (int8_t x, int8_t y, uint8_t width, uint8_t height, uint8_t color=COLOR_WHITE) |
void | drawRoundedRectangle (int8_t x, int8_t y, int8_t width, int8_t height, int16_t radius, uint8_t color) |
void | drawRectangleFilled (int8_t x, int8_t y, uint8_t width, uint8_t height, uint8_t color=COLOR_WHITE) |
void | drawTriangle (int8_t x0, int8_t y0, int8_t x1, int8_t y1, int8_t x2, int8_t y2, uint8_t color=COLOR_WHITE) |
void | drawTriangleFilled (int8_t x0, int8_t y0, int8_t x1, int8_t y1, int8_t x2, int8_t y2, uint8_t color) |
void | drawCircle (int16_t x0, int16_t y0, int16_t radius, uint8_t color=COLOR_WHITE) |
void | drawRoundCorners (int8_t x0, int8_t y0, int16_t radius, uint8_t cornername, uint8_t color) |
void | drawCircleFilled (int8_t x0, int8_t y0, int16_t radius, uint8_t color) |
void | drawRoundedCornersFilled (int8_t x0, int8_t y0, int16_t radius, uint8_t cornername, int16_t delta, uint8_t color) |
void | fillScreen (uint8_t color=COLOR_WHITE) |
Public Member Functions inherited from LCD | |
mraa::Result | write (int x, int y, std::string msg) |
std::string | name () |
Protected Member Functions | |
mraa::Result | command (uint8_t cmd) |
mraa::Result | data (uint16_t data) |
mraa::Result | writeChar (uint8_t value) |
mraa::Result | setAddressingMode (displayAddressingMode mode) |
Additional Inherited Members | |
Protected Attributes inherited from LCD | |
std::string | m_name |
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.
spi | spi bus to use |
CD | Command/Data select pin |
reset | reset pin |
address | the slave address the lcd is registered on |
mraa::Result refresh | ( | ) |
Draw the buffer to screen.
|
virtual |
|
virtual |
Set cursor to a coordinate
y | Axis on the vertical scale. This device supports 6 rows. |
x | Axis on the horizontal scale This device supports 64 columns |
Implements LCD.
void setTextColor | ( | uint8_t | textColor | ) |
Sets a text color for a message
textColor | Font color: COLOR_WHITE, COLOR_BLACK or COLOR_XOR |
void setTextSize | ( | uint8_t | size | ) |
Sets the size of the font
size | Font size |
void setTextWrap | ( | uint8_t | wrap | ) |
Wraps a printed message
wrap | True (1) or false (0) |
void drawChar | ( | uint8_t | x, |
uint8_t | y, | ||
uint8_t | data, | ||
uint8_t | color, | ||
uint8_t | 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 |
bg | Character background color |
size | Size of the font |
|
virtual |
Clear display
Implements LCD.
|
virtual |
Return to coordinate 0,0
Implements LCD.
void drawPixel | ( | int8_t | x, |
int8_t | y, | ||
uint8_t | color = COLOR_WHITE |
||
) |
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 drawLine | ( | int8_t | x0, |
int8_t | y0, | ||
int8_t | x1, | ||
int8_t | y1, | ||
uint8_t | color = COLOR_WHITE |
||
) |
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 | ( | int8_t | x, |
int8_t | y, | ||
uint8_t | width, | ||
uint8_t | color = COLOR_WHITE |
||
) |
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 | ( | int8_t | x, |
int8_t | y, | ||
uint8_t | height, | ||
uint8_t | color = COLOR_WHITE |
||
) |
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 |
width | is the vertical length of the line |
color | line is COLOR_WHITE, COLOR_BLACK or COLOR_XOR |
void drawRectangle | ( | int8_t | x, |
int8_t | y, | ||
uint8_t | width, | ||
uint8_t | height, | ||
uint8_t | color = COLOR_WHITE |
||
) |
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 drawRoundedRectangle | ( | int8_t | x, |
int8_t | y, | ||
int8_t | width, | ||
int8_t | height, | ||
int16_t | radius, | ||
uint8_t | 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 drawRectangleFilled | ( | int8_t | x, |
int8_t | y, | ||
uint8_t | width, | ||
uint8_t | height, | ||
uint8_t | color = COLOR_WHITE |
||
) |
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 drawTriangle | ( | int8_t | x0, |
int8_t | y0, | ||
int8_t | x1, | ||
int8_t | y1, | ||
int8_t | x2, | ||
int8_t | y2, | ||
uint8_t | color = COLOR_WHITE |
||
) |
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 | ( | int8_t | x0, |
int8_t | y0, | ||
int8_t | x1, | ||
int8_t | y1, | ||
int8_t | x2, | ||
int8_t | y2, | ||
uint8_t | 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 drawCircle | ( | int16_t | x0, |
int16_t | y0, | ||
int16_t | radius, | ||
uint8_t | color = COLOR_WHITE |
||
) |
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 drawRoundCorners | ( | int8_t | x0, |
int8_t | y0, | ||
int16_t | radius, | ||
uint8_t | cornername, | ||
uint8_t | 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 drawCircleFilled | ( | int8_t | x0, |
int8_t | y0, | ||
int16_t | radius, | ||
uint8_t | 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 drawRoundedCornersFilled | ( | int8_t | x0, |
int8_t | y0, | ||
int16_t | radius, | ||
uint8_t | cornername, | ||
int16_t | delta, | ||
uint8_t | 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 fillScreen | ( | uint8_t | color = COLOR_WHITE | ) |
Fill the screen buffer with specified color.
color | fill color is COLOR_WHITE, COLOR_BLACK or COLOR_XOR |