Implement idle mode for ILI9163

Support of idle mode.
Based on ILI9163 datasheet:
https://www.rockbox.org/wiki/pub/Main/SonyNWZE370/ILI9163.pdf
This commit is contained in:
vanklompf 2018-02-02 21:07:09 +01:00
parent 174fccf2bd
commit 17b7cfb7a8
3 changed files with 22 additions and 4 deletions

View File

@ -61,6 +61,8 @@
#define TFT_INVOFF 0x20
#define TFT_INVON 0x21
#define TFT_NORON 0x13 //normal mode
#define TFT_PTLON 0x12 //partial mode
#define TFT_PTLAR 0x30 //partial area
#define TFT_NORON 0x13 //normal mode
#define TFT_PTLON 0x12 //partial mode
#define TFT_PTLAR 0x30 //partial area
#define TFT_IDMOFF 0x38 //idle mode off
#define TFT_IDMON 0x39 //idle mode on

View File

@ -3273,6 +3273,20 @@ void TFT_eSPI::setPartialArea(int16_t startLine, int16_t endLine)
#endif
}
/***************************************************************************************
** Function name: setIdleMode
** Description: enables/disables "idle" mode, where color expression is reduced to 8 colors
** can be used with partial mode, further reducing power consumption
***************************************************************************************/
void TFT_eSPI::setIdleMode(bool mode)
{
#ifdef ILI9163_DRIVER
spi_begin();
writecommand(mode ? TFT_IDMON : TFT_IDMOFF);
spi_end();
#endif
}
/***************************************************************************************
** Function name: write
** Description: draw characters piped through serial stream

View File

@ -355,9 +355,11 @@ class TFT_eSPI : public Print {
setRotation(uint8_t r),
invertDisplay(boolean i),
setPartialMode(bool mode),
setPartialArea(int16_t startLine, int16_t endLine),
setIdleMode(bool mode),
drawCircle(int32_t x0, int32_t y0, int32_t r, uint32_t color),
drawCircleHelper(int32_t x0, int32_t y0, int32_t r, uint8_t cornername, uint32_t color),