Lib for the new LCD Display with ILI9341 controller
Diff: SPI_TFT_ILI9341.cpp
- Revision:
- 12:98cc5c193ecd
- Parent:
- 11:59eca2723ec5
- Child:
- 13:b2b3e5430f81
diff -r 59eca2723ec5 -r 98cc5c193ecd SPI_TFT_ILI9341.cpp --- a/SPI_TFT_ILI9341.cpp Tue Jun 24 15:37:52 2014 +0000 +++ b/SPI_TFT_ILI9341.cpp Wed Jun 25 07:54:58 2014 +0000 @@ -17,9 +17,12 @@ // 26.01.14 Change interface for BMP_16 to also use SD-cards // 23.06.14 switch back to old Version - fork for L152 // 24.06.14 Add compiler flag for optimized L152 version +// 25.06.14 Add optimized F103 version // exclude this file for platforms with optimized version -#ifndef TARGET_NUCLEO_L152RE +#if defined TARGET_NUCLEO_L152RE || defined TARGET_NUCLEO_F103RB +// this platforms are supported by special version in different source file +#else #include "SPI_TFT_ILI9341.h" #include "mbed.h" @@ -354,24 +357,8 @@ void SPI_TFT_ILI9341::cls (void) { - int pixel = ( width() * height()); - WindowMax(); - wr_cmd(0x2C); // send pixel - #if defined TARGET_KL25Z // 8 Bit SPI - unsigned int i; - for (i = 0; i < ( width() * height()); i++){ - SPI::write(_background >> 8); - SPI::write(_background & 0xff); - } - - #else - SPI::format(16,3); // switch to 16 bit Mode 3 - unsigned int i; - for (i = 0; i < ( width() * height()); i++) - SPI::write(_background); - SPI::format(8,3); - #endif - _cs = 1; + // we can use the fillrect function + fillrect(0,0,width()-1,height()-1,_background); }