TFT library for Nucleo L476
Fork of SPI_TFT_ILI9341 by
Revision 10:f47649da1c3b, committed 2017-03-17
- Comitter:
- singhs
- Date:
- Fri Mar 17 00:23:37 2017 +0000
- Parent:
- 9:b8bc8296da24
- Commit message:
- Changes to make it work on Nucleo L476G
Changed in this revision
SPI_TFT_ILI9341.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r b8bc8296da24 -r f47649da1c3b SPI_TFT_ILI9341.cpp --- a/SPI_TFT_ILI9341.cpp Tue May 06 18:09:00 2014 +0000 +++ b/SPI_TFT_ILI9341.cpp Fri Mar 17 00:23:37 2017 +0000 @@ -278,7 +278,7 @@ _spi.write(y); _cs = 1; wr_cmd(0x2C); // send pixel - #if defined TARGET_KL25Z // 8 Bit SPI + #if defined TARGET_STM32L476xG // 8 Bit SPI _spi.write(color >> 8); _spi.write(color & 0xff); #else @@ -320,7 +320,7 @@ int pixel = ( width() * height()); WindowMax(); wr_cmd(0x2C); // send pixel - #if defined TARGET_KL25Z // 8 Bit SPI + #if defined TARGET_STM32L476xG // 8 Bit SPI unsigned int i; for (i = 0; i < ( width() * height()); i++){ _spi.write(_background >> 8); @@ -379,7 +379,7 @@ w = x1 - x0 + 1; window(x0,y,w,1); wr_cmd(0x2C); // send pixel - #if defined TARGET_KL25Z // 8 Bit SPI + #if defined TARGET_STM32L476xG // 8 Bit SPI int j; for (j=0; j<w; j++) { _spi.write(color >> 8); @@ -404,7 +404,7 @@ h = y1 - y0 + 1; window(x,y0,1,h); wr_cmd(0x2C); // send pixel - #if defined TARGET_KL25Z // 8 Bit SPI + #if defined TARGET_STM32L476xG // 8 Bit SPI for (int y=0; y<h; y++) { _spi.write(color >> 8); _spi.write(color & 0xff); @@ -523,7 +523,7 @@ int pixel = h * w; window(x0,y0,w,h); wr_cmd(0x2C); // send pixel - #if defined TARGET_KL25Z // 8 Bit SPI + #if defined TARGET_STM32L476xG // 8 Bit SPI for (int p=0; p<pixel; p++) { _spi.write(color >> 8); _spi.write(color & 0xff); @@ -601,7 +601,7 @@ } window(char_x, char_y,hor,vert); // char box wr_cmd(0x2C); // send pixel - #ifndef TARGET_KL25Z // 16 Bit SPI + #ifndef TARGET_STM32L476xG // 16 Bit SPI _spi.format(16,3); #endif // switch to 16 bit Mode 3 zeichen = &font[((c -32) * offset) + 4]; // start of char bitmap @@ -611,14 +611,14 @@ z = zeichen[bpl * i + ((j & 0xF8) >> 3)+1]; b = 1 << (j & 0x07); if (( z & b ) == 0x00) { - #ifndef TARGET_KL25Z // 16 Bit SPI + #ifndef TARGET_STM32L476xG // 16 Bit SPI _spi.write(_background); #else _spi.write(_background >> 8); _spi.write(_background & 0xff); #endif } else { - #ifndef TARGET_KL25Z // 16 Bit SPI + #ifndef TARGET_STM32L476xG // 16 Bit SPI _spi.write(_foreground); #else _spi.write(_foreground >> 8); @@ -628,7 +628,7 @@ } } _cs = 1; - #ifndef TARGET_KL25Z // 16 Bit SPI + #ifndef TARGET_STM32L476xG // 16 Bit SPI _spi.format(8,3); #endif WindowMax(); @@ -650,7 +650,7 @@ unsigned int j; int padd; unsigned short *bitmap_ptr = (unsigned short *)bitmap; - #if defined TARGET_KL25Z // 8 Bit SPI + #if defined TARGET_STM32L476xG // 8 Bit SPI unsigned short pix_temp; #endif @@ -664,12 +664,12 @@ window(x, y, w, h); bitmap_ptr += ((h - 1)* (w + padd)); wr_cmd(0x2C); // send pixel - #ifndef TARGET_KL25Z // 16 Bit SPI + #ifndef TARGET_STM32L476xG // 16 Bit SPI _spi.format(16,3); #endif // switch to 16 bit Mode 3 for (j = 0; j < h; j++) { //Lines for (i = 0; i < w; i++) { // one line - #if defined TARGET_KL25Z // 8 Bit SPI + #if defined TARGET_STM32L476xG // 8 Bit SPI pix_temp = *bitmap_ptr; _spi.write(pix_temp >> 8); _spi.write(pix_temp); @@ -683,7 +683,7 @@ bitmap_ptr -= padd; } _cs = 1; - #ifndef TARGET_KL25Z // 16 Bit SPI + #ifndef TARGET_STM32L476xG // 16 Bit SPI _spi.format(8,3); #endif WindowMax();