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:
parent
174fccf2bd
commit
17b7cfb7a8
|
|
@ -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
|
||||
|
|
|
|||
14
TFT_eSPI.cpp
14
TFT_eSPI.cpp
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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),
|
||||
|
|
|
|||
Loading…
Reference in New Issue