v.06
Dependents: ATT_AWS_IoT_demo_v06
Fork of SPI_TFT_ILI9341 by
Revision 14:a5d57a0b9d67, committed 2017-11-03
- Comitter:
- jilee
- Date:
- Fri Nov 03 20:24:05 2017 +0000
- Parent:
- 13:b2b3e5430f81
- Commit message:
- V.06
Changed in this revision
SPI_TFT_ILI9341.cpp | Show annotated file Show diff for this revision Revisions of this file |
SPI_TFT_ILI9341.h | Show annotated file Show diff for this revision Revisions of this file |
diff -r b2b3e5430f81 -r a5d57a0b9d67 SPI_TFT_ILI9341.cpp --- a/SPI_TFT_ILI9341.cpp Wed Jun 25 16:51:27 2014 +0000 +++ b/SPI_TFT_ILI9341.cpp Fri Nov 03 20:24:05 2017 +0000 @@ -668,6 +668,46 @@ } +void SPI_TFT_ILI9341::drawBitmap(int16_t x, int16_t y, const uint16_t *bitmap, int16_t w, int16_t h) { +#if 0 + int16_t i, j; + const uint16_t *p = bitmap; + + for(j=0; j<h; j++) { + for(i=0; i<w; i++ ) { + pixel(x+i, y+j, *p); + p++; + } + } +} +#else + unsigned int j; + int padd; + const uint16_t *bitmap_ptr = bitmap; + unsigned int i; + + // the lines are padded to multiple of 4 bytes in a bitmap + padd = -1; + do { + padd ++; + } while (2*(w + padd)%4 != 0); + + window(x, y, w, h); + wr_cmd(0x2C); // send pixel + SPI::format(16,3); + for (j = 0; j < h; j++) { //Lines + for (i = 0; i < w; i++) { // one line + SPI::write(*bitmap_ptr); // one line + bitmap_ptr++; + } + bitmap_ptr += padd; + } + _cs = 1; + SPI::format(8,3); + WindowMax(); +} +#endif + void SPI_TFT_ILI9341::Bitmap(unsigned int x, unsigned int y, unsigned int w, unsigned int h,unsigned char *bitmap) {
diff -r b2b3e5430f81 -r a5d57a0b9d67 SPI_TFT_ILI9341.h --- a/SPI_TFT_ILI9341.h Wed Jun 25 16:51:27 2014 +0000 +++ b/SPI_TFT_ILI9341.h Fri Nov 03 20:24:05 2017 +0000 @@ -245,7 +245,7 @@ int BMP_16(unsigned int x, unsigned int y, const char *Name_BMP); - + void drawBitmap(int16_t x, int16_t y, const uint16_t *bitmap, int16_t w, int16_t h); /** select the font to use *