A modified version of the GDEP015OC1 library that supports x-or as a color.
Fork of GDEP015OC1 by
Revision 9:1f1e705a5f02, committed 2017-07-16
- Comitter:
- ivo_n
- Date:
- Sun Jul 16 20:40:52 2017 +0000
- Parent:
- 8:cd51988ee35d
- Commit message:
- Added old API so old example won't break.
Changed in this revision
GDEP015OC1.cpp | Show annotated file Show diff for this revision Revisions of this file |
GDEP015OC1.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/GDEP015OC1.cpp Mon Jan 16 15:48:53 2017 +0000 +++ b/GDEP015OC1.cpp Sun Jul 16 20:40:52 2017 +0000 @@ -224,6 +224,56 @@ _sleep(); } +void GDEP015OC1::drawPixel(uint16_t startX, uint16_t startY, bool color) +{ + drawPixel( startX, startY, color?eBlack:eWhite); +} + +void GDEP015OC1::drawLine(uint16_t startX, uint16_t startY, uint16_t stopX, uint16_t stopY, bool color) +{ + drawLine( startX, startY, stopX, stopY, color?eBlack:eWhite); +} + +void GDEP015OC1::drawTriangle(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t x3, uint16_t y3, bool color) +{ + drawTriangle( x1, y1, x2, y2, x3, y3, color?eBlack:eWhite); +} + +void GDEP015OC1::drawRectangle(uint16_t startX, uint16_t startY, uint16_t stopX, uint16_t stopY, bool color) +{ + drawRectangle( startX, startY, stopX, stopY, color?eBlack:eWhite); +} + +void GDEP015OC1::drawCircle(uint16_t startX, uint16_t startY, uint16_t radius, bool color) +{ + drawCircle(startX, startY, radius, color?eBlack:eWhite); +} + +void GDEP015OC1::fillCircle(uint16_t startX, uint16_t startY, uint16_t radius, bool color) +{ + fillCircle( startX, startY, radius, color?eBlack:eWhite); +} + +void GDEP015OC1::drawEllipse(uint16_t startX, uint16_t startY, uint16_t width, uint16_t height, bool color) +{ + drawEllipse(startX, startY, width, height, color?eBlack:eWhite); +} + +void GDEP015OC1::fillEllipse(uint16_t startX, uint16_t startY, uint16_t width, uint16_t height, bool color) +{ + fillEllipse(startX, startY, width, height, color?eBlack:eWhite); +} + +void GDEP015OC1::writeChar(char character, uint16_t startX, uint16_t startY, bool color) +{ + writeChar(character, startX, startY, color?eBlack:eWhite); +} + +void GDEP015OC1::writeString(char *string, uint16_t startX, uint16_t startY, bool color) +{ + writeString(string, startX, startY, color?eBlack:eWhite); +} + void GDEP015OC1::drawPixel(uint16_t startX, uint16_t startY, Color color=eBlack){ if(startX>199 || startY>199) return;
--- a/GDEP015OC1.h Mon Jan 16 15:48:53 2017 +0000 +++ b/GDEP015OC1.h Sun Jul 16 20:40:52 2017 +0000 @@ -1,5 +1,6 @@ /** * Created by Filip Hormot (f.hormot@gmail.com) on 14/09/16. + * Modified by knutsel.org on 16/07/2017. */ #include "mbed.h" @@ -22,6 +23,20 @@ void invert(void); void write(void); void writeFull(void); + + //old, put here to not break the API. + void drawPixel(uint16_t startX, uint16_t startY, bool color); + void drawLine(uint16_t startX, uint16_t startY, uint16_t stopX, uint16_t stopY, bool color); + void drawTriangle(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t x3, uint16_t y3, bool color); + void drawRectangle(uint16_t startX, uint16_t startY, uint16_t stopX, uint16_t stopY, bool color); + void drawCircle(uint16_t startX, uint16_t startY, uint16_t radius, bool color); + void fillCircle(uint16_t startX, uint16_t startY, uint16_t radius, bool color); + void drawEllipse(uint16_t startX, uint16_t startY, uint16_t width, uint16_t height, bool color); + void fillEllipse(uint16_t startX, uint16_t startY, uint16_t width, uint16_t height, bool color); + void writeChar(char character, uint16_t startX, uint16_t startY, bool color); + void writeString(char *string, uint16_t startX, uint16_t startY, bool color); + // + void drawPixel(uint16_t startX, uint16_t startY, Color color); void drawLine(uint16_t startX, uint16_t startY, uint16_t stopX, uint16_t stopY, Color color); void drawTriangle(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t x3, uint16_t y3, Color color); @@ -33,6 +48,7 @@ void fillEllipse(uint16_t startX, uint16_t startY, uint16_t width, uint16_t height, Color color); void writeChar(char character, uint16_t startX, uint16_t startY, Color color); void writeString(char *string, uint16_t startX, uint16_t startY, Color color); + private: SPI& _spi; DigitalOut _cs;