EPD display library. Check this version (it should work)
Fork of GDEP015OC1 by
Diff: GDEP015OC1.h
- Revision:
- 2:1c8f73aa2a16
- Parent:
- 1:4fff95e316c9
- Child:
- 3:dc7b794b59b7
diff -r 4fff95e316c9 -r 1c8f73aa2a16 GDEP015OC1.h --- a/GDEP015OC1.h Wed Sep 14 14:57:23 2016 +0000 +++ b/GDEP015OC1.h Thu Sep 15 09:19:30 2016 +0000 @@ -1,28 +1,34 @@ -namespace GDEP015OC1 -{ - class GDEP015OC1 - { - public: - void fill(unsigned char data, uin16_t i); - unsigned char get(uint16_t i); - void empty(void); - void invert(void); - bool write(void); - 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); - private: - SPI& _spi; - DigitalOut _cs; - DigitalOut _dc; - DigitalOut _rst; - DigitalIn _busy; +#include "mbed.h" + +#define BUFFER_SIZE 5000 +#define BUSY_STATE 1 + +class GDEP015OC1 { + public: + GDEP015OC1(SPI& spi, PinName cs, PinName dc, PinName rst, PinName busy); + + void fill(unsigned char data, uint16_t i); + unsigned char get(uint16_t i); + void empty(void); + void invert(void); + void write(void); + 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); + private: + SPI& _spi; + DigitalOut _cs; + DigitalOut _dc; + DigitalOut _rst; + DigitalIn _busy; + + unsigned char _buffer[BUFFER_SIZE]; + - void _spiCallback(int event); - bool _spiCommand(unsigned char command); - bool _spiData(unsigned char data); - void _init(void); - void _wakeUp(void); - void _sleep(void); - unsigned char _pixelConv(unsigned char *data, int i); - }; -} \ No newline at end of file + void _spiCommand(unsigned char command); + void _spiData(unsigned char data); + void _init(void); + void _wakeUp(void); + void _sleep(void); + unsigned char _pixelConv(unsigned char *data, int i); + uint8_t _mirrorData(uint8_t data); +}; \ No newline at end of file