Library for 1.8 inch 160*180 TFT Display. Nice fonts in different formats.
Diff: ST7735.cpp
- Revision:
- 2:291ac9fb4d64
- Parent:
- 1:6a6d8d2b19f1
diff -r 6a6d8d2b19f1 -r 291ac9fb4d64 ST7735.cpp --- a/ST7735.cpp Sat Aug 15 11:59:03 2015 +0000 +++ b/ST7735.cpp Sat Aug 22 11:25:19 2015 +0000 @@ -41,9 +41,7 @@ void ST7735::initSPI() { spi->format(8,0); // 8 bits, Mode 0 - spi->frequency(12000000); // SPI clock frequency - //spi->frequency(4000000); // SPI clock frequency - //spi->frequency(22000000); // SPI clock frequency 20.83 Mhz + spi->frequency(20000000); // SPI clock frequency } // Write data word @@ -66,8 +64,8 @@ // Rather than a bazillion writecommand() and writedata() calls, screen -// initialization commands and arguments are organized in these tables -// stored in PROGMEM. The table may look bulky, but that's mostly the +// initialization commands and arguments are organized in tables +// The table may look bulky, but that's mostly the // formatting -- storage-wise this is hundreds of bytes more compact // than the equivalent code. Companion function follows. #define DELAY 0x80 @@ -216,7 +214,7 @@ ms = numArgs & DELAY; // If hibit set, delay follows args numArgs &= ~DELAY; // Mask out delay bit while(numArgs--) { // For each argument... - writedata(pgm_read_byte(addr++)); // Read, issue argument + writedata(pgm_read_byte(addr++)); // Read, issue argument } if(ms) { @@ -1051,3 +1049,5 @@ writecommand(ST7735_RAMWR); // write to RAM } + +