A lib to handle a E-Paper display from Jiaxian Displays. The lib can handle graphic and text drawing and is using external fonts. SPI interface.

Dependents:   EPD_GDE021A1_demo

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers EpdGDE021A1.h Source File

EpdGDE021A1.h

00001 #ifndef EPDGDE021A1_H_
00002 #define EPDGDE021A1_H_
00003 
00004 #include "mbed.h"
00005 #include "Graphic.h"
00006 
00007 #define GED021A1_BUF_SIZE 3096
00008 #define GED021A1_WIDH 172
00009 #define GED021A1_HIGHT 72
00010 #define GED021A1_BITS 2
00011 
00012 class EpdGDE021A1: public Graphic {
00013 
00014 public:
00015     EpdGDE021A1(PinName mosi = p5, PinName sclk = p7, PinName cs = p8,
00016             PinName dc = p9, PinName reset = p10);
00017 
00018     void setup();
00019     void update();
00020     void sleep();
00021 
00022 public:
00023     virtual ~EpdGDE021A1() {
00024     }
00025 
00026 protected:
00027     void draw(unsigned char *data);
00028     void reset();
00029     void wait_busy();
00030     void write_lut();
00031     void init();
00032     void spi_write(int cmd, unsigned char val);
00033     void spi_cmd(unsigned char cmd);
00034     void spi_data(unsigned char val);
00035     SPI _spi;
00036     DigitalOut _spi_ncs;
00037     DigitalOut _spi_ndc;
00038     DigitalOut _reset;
00039     int _spi3w;
00040 
00041 public:
00042     unsigned char _buf[GED021A1_BUF_SIZE];
00043 };
00044 
00045 #endif /* EPDGDE021A1_H_ */