Skip to content

Commit

Permalink
V1.3.6 (#25)
Browse files Browse the repository at this point in the history
* High speed color bitmap function

* Corrected param

* fixed _setWindow call

* Add high speed color drawBitmap function
  • Loading branch information
Nkawu authored Mar 1, 2018
1 parent 34c1cf0 commit 7ebda46
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 6 deletions.
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
TFT_22_ILI9225
==============

**v1.3.6, released 2018-03-01, Add high speed color drawBitmap function** Credit: [LAK132](https://github.com/LAK132)

**v1.3.5, released 2018-02-27, Stm32 f1 support and speeding up the library** Credit: [MicroBahner](https://github.com/MicroBahner)

**v1.3.4, released 2017-11-27, add support for ESP32**
Expand Down
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
TFT_22_ILI9225
==============

**v1.3.5, released 2018-02-27, Stm32 f1 support and speeding up the library** Credit: [MicroBahner](https://github.com/MicroBahner)

**v1.3.4, released 2017-11-27, add support for ESP32**
**v1.3.6, released 2018-03-01, Add high speed color drawBitmap function** Credit: [LAK132](https://github.com/LAK132)

**v1.3.3, released 2017-11-26, add support for STM32F1** Credit: [nicolasimeoni](https://github.com/nicolasimeoni)
**v1.3.5, released 2018-02-27, Stm32 f1 support and speeding up the library** Credit: [MicroBahner](https://github.com/MicroBahner)

This is a library for the ILI9225 based 2.2" 176x220 TFT LCD shields commonly found on eBay, originally forked from the screen_4D_22_library library. The ability to use GLCD fonts has been added and the syntax has been changed to match the Adafruit libraries somewhat.

Expand Down
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"authors": {
"name": "Nkawu"
},
"version": "1.3.5",
"version": "1.3.6",
"frameworks": "arduino",
"platforms": "*"
}
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=TFT_22_ILI9225
version=1.3.5
version=1.3.6
author=Nkawu
maintainer=Nkawu
sentence=ILI9225 2.2" 176x220 TFT LCD shield
Expand Down
36 changes: 36 additions & 0 deletions src/TFT_22_ILI9225.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1182,6 +1182,42 @@ const uint8_t *bitmap, int16_t w, int16_t h, uint16_t color, uint16_t bg, bool t
}
*/

//High speed color bitmap
void TFT_22_ILI9225::drawBitmap(uint16_t x1, uint16_t y1,
const uint16_t** bitmap, int16_t w, int16_t h) {
_setWindow(x1, y1, x1+w, y1+h);
startWrite();
SPI_DC_HIGH();
SPI_CS_LOW();
for (uint16_t x = 0; x < w; x++) {
for (uint16_t y = 0; y < h; y++) {
uint16_t col = bitmap[x][y];
_spiWrite(col>>8);
_spiWrite(col);
}
}
SPI_CS_HIGH();
endWrite();
}

//High speed color bitmap
void TFT_22_ILI9225::drawBitmap(uint16_t x1, uint16_t y1,
uint16_t** bitmap, int16_t w, int16_t h) {
_setWindow(x1, y1, x1+w, y1+h);
startWrite();
SPI_DC_HIGH();
SPI_CS_LOW();
for (uint16_t x = 0; x < w; x++) {
for (uint16_t y = 0; y < h; y++) {
uint16_t col = bitmap[x][y];
_spiWrite(col>>8);
_spiWrite(col);
}
}
SPI_CS_HIGH();
endWrite();
}

void TFT_22_ILI9225::startWrite(void){
SPI_BEGIN_TRANSACTION();
SPI_CS_LOW();
Expand Down
9 changes: 9 additions & 0 deletions src/TFT_22_ILI9225.h
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,15 @@ class TFT_22_ILI9225 {

void drawXBitmap(int16_t x, int16_t y, const uint8_t *bitmap, int16_t w, int16_t h, uint16_t color);
void drawXBitmap(int16_t x, int16_t y, const uint8_t *bitmap, int16_t w, int16_t h, uint16_t color, uint16_t bg);

/// Draw bitmap
/// @param x point coordinate, x-axis
/// @param y point coordinate, y-axis
/// @param bitmap, 2D 16bit color bitmap
/// @param w width
/// @param h height
void drawBitmap(uint16_t x, uint16_t y, const uint16_t** bitmap, int16_t w, int16_t h);
void drawBitmap(uint16_t x, uint16_t y, uint16_t** bitmap, int16_t w, int16_t h);

/// Set current GFX font
/// @param f GFX font name defined in include file
Expand Down

0 comments on commit 7ebda46

Please sign in to comment.