Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: acd52832_ePaper acd52832_SAADC_Differential_input_2 acd52832_SAADC_Differential_input_EPD acd52832_Car_battery_ch ... more
Fork of GDEP015OC1 by
Revision 16:637e8c66dee6, committed 2017-07-04
- Comitter:
- jurica238814
- Date:
- Tue Jul 04 18:18:38 2017 +0000
- Parent:
- 15:29f6787506b7
- Child:
- 17:9f70a530ab01
- Commit message:
- Working version with a partial refresh. (Without InitPartial function).
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 Tue Jul 04 18:16:15 2017 +0000
+++ b/GDEP015OC1.cpp Tue Jul 04 18:18:38 2017 +0000
@@ -28,7 +28,6 @@
_cs = _dc = 0;
wait_us(1);
_spi.write(command);
- _cs = 1;
}
void GDEP015OC1::_spiData(unsigned char data){
@@ -36,82 +35,12 @@
_dc = 1;
wait_us(1);
_spi.write(data);
- _cs = 1;
}
void GDEP015OC1::_init(void){
- _rst = _cs = 1;
- _rst = 0;
- wait_ms(EPD_WAIT_CONSTANT);
- _rst = 1;
- wait_ms(EPD_WAIT_CONSTANT);
+ _rst = _cs = 1;
+ empty();
}
-
-void GDEP015OC1::initPartial(void){
-
- //Driver Output control
- _spiCommand(0x01);
- _spiData(0xC7); // (yDot-1)%256
- _spiData(0x00); // (yDot-1)/256
- _spiData(0x00); // 0x00
-
- //Softstart
- _spiCommand(0x0C);
- _spiData(0xD7);
- _spiData(0xD6);
- _spiData(0x9D);
-
- //VCOM setting
- _spiCommand(0x2C);
- _spiData(0xA8);
-
- //Dummy line period
- _spiCommand(0x3A);
- _spiData(0x1A);
-
- //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)
-
- //Define X display size
- _spiCommand(0x44);
- _spiData(0x00);
- _spiData(0x18); //(xDot-1)/8
- //Define Y display size
- _spiCommand(0x45);
- _spiData(0xC7); //(yDot-1)%256
- _spiData(0x00); //(yDot-1)/256
- _spiData(0x00); // Was 0x2B
- _spiData(0x00); // Was 0x01
-
- //Define X RAM address
- _spiCommand(0x4E);
- _spiData(0x00);
- //Define Y RAM address
- _spiCommand(0x4F);
- _spiData(0xC7);
- _spiData(0x00);
-
-
- //Write LUT
- //_spiCommand(0x32);
- for(uint8_t i = 0; i<30;i++){
- _spiData(_lutPart[i]);
- }
-
- // Power ON
- _spiCommand(0x22);
- _spiData(0xC0);
- _spiCommand(0x20);
-
- //wait_ms(1500);
-
-
- }
void GDEP015OC1::_wakeUp(bool partial){
_rst = 0;
@@ -222,74 +151,27 @@
}
void GDEP015OC1::write(void){
- //_wakeUp(true);
+ _wakeUp(true);
- //Define X display size
- _spiCommand(0x44);
- _spiData(0x00);
- _spiData(0x18); //(xDot-1)/8
- //Define Y display size
- _spiCommand(0x45);
- _spiData(0xC7); //(yDot-1)%256
- _spiData(0x00); //(yDot-1)/256
- _spiData(0x00); // Was 0x2B
- _spiData(0x00); // Was 0x01
-
- //Define X RAM address
- _spiCommand(0x4E);
- _spiData(0x00);
- //Define Y RAM address
- _spiCommand(0x4F);
- _spiData(0xC7);
- _spiData(0x00);
-
-
_spiCommand(0x24);
for(int16_t x=0; x>=0 && x<200; x++){
for(int16_t y=24; y>=0 && y<25; y--){
_spiData(_mirrorData(_pixelConv(_buffer, x*25+y)));
- //wait_us(EPD_WAIT_CONSTANT);
+ wait_us(EPD_WAIT_CONSTANT);
}
}
-
- // Update Partial
_spiCommand(0x22);
_spiData(0x04);
- _spiCommand(0x20);
- _spiCommand(0xFF);
-
- wait_ms(500);
-
- //Define X display size
- _spiCommand(0x44);
- _spiData(0x00);
- _spiData(0x18); //(xDot-1)/8
- //Define Y display size
- _spiCommand(0x45);
- _spiData(0xC7); //(yDot-1)%256
- _spiData(0x00); //(yDot-1)/256
- _spiData(0x00); // Was 0x2B
- _spiData(0x00); // Was 0x01
+ _spiCommand(0x22);
+ _spiData(0x08);
- //Define X RAM address
- _spiCommand(0x4E);
- _spiData(0x00);
- //Define Y RAM address
- _spiCommand(0x4F);
+ //Update
+ _spiCommand(0x22);
_spiData(0xC7);
- _spiData(0x00);
-
-
- _spiCommand(0x24);
- for(int16_t x=0; x>=0 && x<200; x++){
- for(int16_t y=24; y>=0 && y<25; y--){
- _spiData(_mirrorData(_pixelConv(_buffer, x*25+y)));
- //wait_us(EPD_WAIT_CONSTANT);
- }
- }
+ _spiCommand(0x20);
- //_sleep();
+ _sleep();
}
void GDEP015OC1::writeFull(void){
@@ -313,7 +195,7 @@
_spiData(0xC7);
_spiCommand(0x20);
- //_sleep();
+ _sleep();
}
void GDEP015OC1::drawPixel(uint16_t startX, uint16_t startY, bool color=0){
--- a/GDEP015OC1.h Tue Jul 04 18:16:15 2017 +0000
+++ b/GDEP015OC1.h Tue Jul 04 18:18:38 2017 +0000
@@ -30,7 +30,6 @@
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 initPartial(void); // Added by Jurica
private:
SPI& _spi;
DigitalOut _cs;

