Added Discovery F429ZI 8 bit SPI support. Added helper methods to character based locate.
Fork of SPI_TFT_ILI9341 by
Added Discovery F429ZI 8 bit SPI support to the original lib.
Diff: SPI_TFT_ILI9341.cpp
- Revision:
- 15:b7848705d2ab
- Parent:
- 14:a1133923c034
--- a/SPI_TFT_ILI9341.cpp Sat Feb 11 18:56:31 2017 +0000 +++ b/SPI_TFT_ILI9341.cpp Sun Feb 12 10:34:05 2017 +0000 @@ -804,9 +804,22 @@ return(1); } -void SPI_TFT_ILI9341::locateChar(uint16_t row, uint16_t column) +void SPI_TFT_ILI9341::locateChar(uint16_t row, uint16_t column, Text_AlignModeTypdef mode, uint16_t textLength) { - locate(getCharLeft(column), getCharTop(row)); + uint16_t x = 0; + switch (mode) + { + case LEFT_MODE: + x = getCharLeft(column); + break; + case CENTER_MODE: + x = (width() / 2) - ((textLength + 1) * font[FONT_WIDTH_INDEX]) / 2; + break; + case RIGHT_MODE: + x = width() - textLength * font[FONT_WIDTH_INDEX]; + break; + } + locate(x, getCharTop(row)); } uint16_t SPI_TFT_ILI9341::getCharLeft(uint16_t column) @@ -829,5 +842,9 @@ return font[FONT_WIDTH_INDEX] * (column + 1) - 1; } +void SPI_TFT_ILI9341::ClearStringLine(uint16_t row) +{ + fillrect(0, getCharTop(row), width(), getCharBottom(row), _background); +} + #endif -