EPD display library. Check this version (it should work)

Fork of GDEP015OC1 by Jurica Resetar

Revision:
9:e4e77e840b1f
Parent:
8:5ae728fa8820
Child:
10:73cf09a74996
--- a/GDEP015OC1.cpp	Wed Feb 22 07:52:45 2017 +0000
+++ b/GDEP015OC1.cpp	Thu Apr 13 00:33:42 2017 +0000
@@ -43,6 +43,7 @@
     empty();    
 }
 
+
 void GDEP015OC1::_wakeUp(bool partial){
     _rst = 0;
     wait_ms(EPD_WAIT_CONSTANT);
@@ -52,53 +53,71 @@
     //Stage 3
     //Driver Output control
     _spiCommand(0x01);
-    _spiData(0xC7);
-    _spiData(0x00);
-    _spiData(0x00);
+    _spiData(0xC7);     // (yDot-1)%256
+    _spiData(0x00);     // (yDot-1)/256
+    _spiData(0x00);     // 0x00
+    
     //Softstart
     _spiCommand(0x0C);
     _spiData(0xD7);
     _spiData(0xD6);
     _spiData(0x9D);
 
-    _spiCommand(0x22);
-    _spiData(0xF0);
-
     //VCOM setting
     _spiCommand(0x2C);
     _spiData(0xA8);
+    
     //Dummy line period
     _spiCommand(0x3A);
     _spiData(0x1A);
-    //Gate line width
+    
+    //Gate line width // 2us per line
     _spiCommand(0x3B);
     _spiData(0x08);
+    
     //Set data entry mode
     _spiCommand(0x11);
     _spiData(0x01); //DO NOT TOUCH THIS! (MUST BE 0x01)
-
-    //Gate driver start position
-    _spiCommand(0x0F);
-    _spiData(0x2B);
-    _spiData(0x01);
-
+    
+    // ^--- Ovdje zavrsavana Kneska fca EPD_W21_DispInit
+    
+    
+    /*
+    // Clock
+    _spiCommand(0x22);
+    _spiData(0xF0);
     //VGH VGL
     _spiCommand(0x03);
     _spiData(0x00);
     //VSH, VSL
     _spiCommand(0x04);
     _spiData(0x0A);
+    // Source voltage +15V/-15V
+    _spiCommand(0xF0);
+    _spiData(0x1F);
+    //Gate driver start position
+    _spiCommand(0x0F);
+    _spiData(0x2B);
+    _spiData(0x01);
+    */
+    
+    
+    
+    
+        
+    
+
 
     //Define X display size
     _spiCommand(0x44);
     _spiData(0x00);
-    _spiData(0x18);
+    _spiData(0x18);     //(xDot-1)/8
     //Define Y display size
     _spiCommand(0x45);
-    _spiData(0xC7);
-    _spiData(0x00);
-    _spiData(0x2B);
-    _spiData(0x01);
+    _spiData(0xC7);     //(yDot-1)%256
+    _spiData(0x00);     //(yDot-1)/256
+    _spiData(0x00);     // Was 0x2B
+    _spiData(0x00);     // Was 0x01
 
     //Define X RAM address
     _spiCommand(0x4E);
@@ -108,9 +127,12 @@
     _spiData(0xC7);
     _spiData(0x00);
 
+
     //Border waveform control
-    _spiCommand(0x3C);
-    _spiData(0x33);
+    //_spiCommand(0x3C);
+    //_spiData(0x33);
+    
+    // ^---- Do ovuda je sve po Kinezima
 
     //Write LUT
     _spiCommand(0x32);
@@ -125,16 +147,16 @@
     }
 
     //Power on
-    _spiCommand(0x22);
-    _spiData(0xC0);
+    //_spiCommand(0x22);
+    //_spiData(0xFF);
 
     //Define X RAM address
-    _spiCommand(0x4E);
-    _spiData(0x00);
+    //_spiCommand(0x4E);
+    //_spiData(0x00);
     //Define Y RAM address
-    _spiCommand(0x4F);
-    _spiData(0xC7);
-    _spiData(0x00);
+    //_spiCommand(0x4F);
+    //_spiData(0xC7);
+    //_spiData(0x00);
 }
 
 void GDEP015OC1::_sleep(void){