diff --git a/TFT_ILI9163C.cpp b/TFT_ILI9163C.cpp index 08da018..9c92279 100644 --- a/TFT_ILI9163C.cpp +++ b/TFT_ILI9163C.cpp @@ -268,25 +268,18 @@ void TFT_ILI9163C::chipInit() { delay(1); writecommand_cont(CMD_CLMADRS);//Set Column Address - /* - writedata8_cont(0x00); - writedata8_cont(0X00); - writedata8_cont(0X00); - writedata8_cont(_GRAMWIDTH); - */ writedata16_cont(0x00); writedata16_cont(_GRAMWIDTH); writecommand_cont(CMD_PGEADRS);//Set Page Address - /* - writedata8_cont(0x00); - writedata8_cont(0X00); - writedata8_cont(0X00); - writedata8_last(_GRAMHEIGH); - */ writedata16_cont(0x00); - writedata16_last(_GRAMHEIGH); - + writedata16_cont(_GRAMHEIGH); + // set scroll area (thanks Masuda) + writecommand_cont(CMD_VSCLLDEF); + writedata16_cont(__OFFSET); + writedata16_cont(_GRAMHEIGH - __OFFSET); + writedata16_last(0); + endProc(); colorSpace(_colorspaceData); setRotation(0); @@ -348,21 +341,17 @@ void TFT_ILI9163C::chipInit() { delay(1); writecommand(CMD_CLMADRS);//Set Column Address - //writedata(0x00); - //writedata(0X00); - //writedata(0X00); - //writedata(_GRAMWIDTH); writedata16(0x00); writedata16(_GRAMWIDTH); writecommand(CMD_PGEADRS);//Set Page Address - //writedata(0x00); - //writedata(0X00); - //writedata(0X00); - //writedata(_GRAMHEIGH); writedata16(0X00); writedata16(_GRAMHEIGH); - + // set scroll area (thanks Masuda) + writecommand(CMD_VSCLLDEF); + writedata16(__OFFSET); + writedata16(_GRAMHEIGH - __OFFSET); + writedata16(0); colorSpace(_colorspaceData); setRotation(0); writecommand(CMD_DISPON);//display ON @@ -498,12 +487,12 @@ void TFT_ILI9163C::scroll(uint16_t adrs) { } -//corrected! v2 +//corrected! v3 void TFT_ILI9163C::clearScreen(uint16_t color) { int px; #if defined(__MK20DX128__) || defined(__MK20DX256__) SPI.beginTransaction(SPISettings(SPICLOCK, MSBFIRST, SPI_MODE0)); - writecommand_cont(CMD_RAMWR);//this was missed! + //writecommand_cont(CMD_RAMWR); _setAddrWindow(0x00,0x00,_GRAMWIDTH,_GRAMHEIGH); for (px = 0;px < _GRAMSIZE; px++){ writedata16_cont(color); @@ -511,7 +500,7 @@ void TFT_ILI9163C::clearScreen(uint16_t color) { writecommand_last(CMD_NOP); endProc(); #else - writecommand(CMD_RAMWR); + //writecommand(CMD_RAMWR); setAddr(0x00,0x00,_GRAMWIDTH,_GRAMHEIGH);//go home for (px = 0;px < _GRAMSIZE; px++){ writedata16(color); @@ -572,7 +561,6 @@ void TFT_ILI9163C::writeScreen24(const uint32_t *bitmap,uint16_t size) { } void TFT_ILI9163C::homeAddress() { - //setAddrWindow(0x00,0x00,_GRAMWIDTH-1,_GRAMHEIGH-1); setAddrWindow(0x00,0x00,_GRAMWIDTH,_GRAMHEIGH); } diff --git a/TFT_ILI9163C.h b/TFT_ILI9163C.h index ecb923b..3075cab 100644 --- a/TFT_ILI9163C.h +++ b/TFT_ILI9163C.h @@ -2,7 +2,7 @@ ILI9163C - A fast SPI driver for TFT that use Ilitek ILI9163C. Features: - - Very FAST!, expecially with Teensy 3.x where uses DMA SPI. + - Very FAST!, expecially with Teensy 3.x where uses hyper optimized SPI. - It uses just 4 or 5 wires. - Compatible at command level with Adafruit display series so it's easy to adapt existing code. - It uses the standard Adafruit_GFX Library (you need to install). @@ -73,11 +73,11 @@ 0.3b2: Minor fix, load 24bit image, Added conversion utility 0.4: some improvement, new ballistic gauge example! 0.5: Added scroll and more commands, optimizations - Fixed a nasty bug in fill screen! 0.6: Small fix, added SD example and subroutines 0.6b1: Fix clearscreen, missed a parameter. 0.6b2: Scroll completed. (thanks Masuda) - 0.6b3: Clear Screen fix v2. + 0.6b3: Clear Screen fix v2. Added Idle mode. + 0.7: Init correction.Clear Screen fix v3 (last time?) +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ BugList of the current version: @@ -318,7 +318,6 @@ class TFT_ILI9163C : public Adafruit_GFX { void _setAddrWindow(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1);//graphic Addressing for Teensy - void waitFifoNotFull(void) { uint32_t sr; uint32_t tmp __attribute__((unused));