A modified version of the GDEP015OC1 library that supports x-or as a color.
Fork of GDEP015OC1 by
GDEP015OC1.h@7:70c58d3cbc8b, 2016-09-26 (annotated)
- Committer:
- Anunnaki
- Date:
- Mon Sep 26 10:08:14 2016 +0000
- Revision:
- 7:70c58d3cbc8b
- Parent:
- 6:45d2ec037fd6
- Child:
- 8:cd51988ee35d
Added in partia refresh and separate functions for full and partial refresh
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Anunnaki | 3:dc7b794b59b7 | 1 | /** |
Anunnaki | 3:dc7b794b59b7 | 2 | * Created by Filip Hormot (f.hormot@gmail.com) on 14/09/16. |
Anunnaki | 3:dc7b794b59b7 | 3 | */ |
Anunnaki | 3:dc7b794b59b7 | 4 | |
Anunnaki | 2:1c8f73aa2a16 | 5 | #include "mbed.h" |
Anunnaki | 2:1c8f73aa2a16 | 6 | |
Anunnaki | 2:1c8f73aa2a16 | 7 | #define BUFFER_SIZE 5000 |
Anunnaki | 3:dc7b794b59b7 | 8 | #define FONT_WIDTH 5 |
Anunnaki | 3:dc7b794b59b7 | 9 | #define FONT_HEIGHT 7 |
Anunnaki | 2:1c8f73aa2a16 | 10 | #define BUSY_STATE 1 |
Anunnaki | 2:1c8f73aa2a16 | 11 | |
Anunnaki | 2:1c8f73aa2a16 | 12 | class GDEP015OC1 { |
Anunnaki | 2:1c8f73aa2a16 | 13 | public: |
Anunnaki | 6:45d2ec037fd6 | 14 | //unsigned char _buffer[BUFFER_SIZE]; |
Anunnaki | 2:1c8f73aa2a16 | 15 | GDEP015OC1(SPI& spi, PinName cs, PinName dc, PinName rst, PinName busy); |
Anunnaki | 2:1c8f73aa2a16 | 16 | |
Anunnaki | 4:86114342ce8f | 17 | void fill(unsigned char data, int i); |
Anunnaki | 2:1c8f73aa2a16 | 18 | unsigned char get(uint16_t i); |
Anunnaki | 2:1c8f73aa2a16 | 19 | void empty(void); |
Anunnaki | 2:1c8f73aa2a16 | 20 | void invert(void); |
Anunnaki | 7:70c58d3cbc8b | 21 | void write(void); |
Anunnaki | 7:70c58d3cbc8b | 22 | void writeFull(void); |
Anunnaki | 2:1c8f73aa2a16 | 23 | void drawPixel(uint16_t startX, uint16_t startY, bool color); |
Anunnaki | 2:1c8f73aa2a16 | 24 | void drawLine(uint16_t startX, uint16_t startY, uint16_t stopX, uint16_t stopY, bool color); |
Anunnaki | 3:dc7b794b59b7 | 25 | void drawTriangle(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t x3, uint16_t y3, bool color); |
Anunnaki | 3:dc7b794b59b7 | 26 | void drawRectangle(uint16_t startX, uint16_t startY, uint16_t stopX, uint16_t stopY, bool color); |
Anunnaki | 3:dc7b794b59b7 | 27 | void drawCircle(uint16_t startX, uint16_t startY, uint16_t radius, bool color); |
Anunnaki | 3:dc7b794b59b7 | 28 | void fillCircle(uint16_t startX, uint16_t startY, uint16_t radius, bool color); |
Anunnaki | 3:dc7b794b59b7 | 29 | void drawEllipse(uint16_t startX, uint16_t startY, uint16_t width, uint16_t height, bool color); |
Anunnaki | 3:dc7b794b59b7 | 30 | void fillEllipse(uint16_t startX, uint16_t startY, uint16_t width, uint16_t height, bool color); |
Anunnaki | 3:dc7b794b59b7 | 31 | void writeChar(char character, uint16_t startX, uint16_t startY, bool color); |
Anunnaki | 3:dc7b794b59b7 | 32 | void writeString(char *string, uint16_t startX, uint16_t startY, bool color); |
Anunnaki | 2:1c8f73aa2a16 | 33 | private: |
Anunnaki | 2:1c8f73aa2a16 | 34 | SPI& _spi; |
Anunnaki | 2:1c8f73aa2a16 | 35 | DigitalOut _cs; |
Anunnaki | 2:1c8f73aa2a16 | 36 | DigitalOut _dc; |
Anunnaki | 2:1c8f73aa2a16 | 37 | DigitalOut _rst; |
Anunnaki | 2:1c8f73aa2a16 | 38 | DigitalIn _busy; |
Anunnaki | 2:1c8f73aa2a16 | 39 | |
Anunnaki | 3:dc7b794b59b7 | 40 | bool _italic, _bold; |
Anunnaki | 3:dc7b794b59b7 | 41 | |
Anunnaki | 6:45d2ec037fd6 | 42 | unsigned char _buffer[BUFFER_SIZE]; |
Anunnaki | 2:1c8f73aa2a16 | 43 | |
Anunnaki | 2:1c8f73aa2a16 | 44 | void _spiCommand(unsigned char command); |
Anunnaki | 2:1c8f73aa2a16 | 45 | void _spiData(unsigned char data); |
Anunnaki | 2:1c8f73aa2a16 | 46 | void _init(void); |
Anunnaki | 7:70c58d3cbc8b | 47 | void _wakeUp(bool partial); |
Anunnaki | 2:1c8f73aa2a16 | 48 | void _sleep(void); |
Anunnaki | 2:1c8f73aa2a16 | 49 | unsigned char _pixelConv(unsigned char *data, int i); |
Anunnaki | 2:1c8f73aa2a16 | 50 | uint8_t _mirrorData(uint8_t data); |
Anunnaki | 2:1c8f73aa2a16 | 51 | }; |