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
|
|
@ -64,3 +64,5 @@
|
||||||
#define TFT_NORON 0x13 //normal mode
|
#define TFT_NORON 0x13 //normal mode
|
||||||
#define TFT_PTLON 0x12 //partial mode
|
#define TFT_PTLON 0x12 //partial mode
|
||||||
#define TFT_PTLAR 0x30 //partial area
|
#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
|
#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
|
** Function name: write
|
||||||
** Description: draw characters piped through serial stream
|
** Description: draw characters piped through serial stream
|
||||||
|
|
|
||||||
|
|
@ -359,6 +359,8 @@ class TFT_eSPI : public Print {
|
||||||
setPartialMode(bool mode),
|
setPartialMode(bool mode),
|
||||||
setPartialArea(int16_t startLine, int16_t endLine),
|
setPartialArea(int16_t startLine, int16_t endLine),
|
||||||
|
|
||||||
|
setIdleMode(bool mode),
|
||||||
|
|
||||||
drawCircle(int32_t x0, int32_t y0, int32_t r, uint32_t color),
|
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),
|
drawCircleHelper(int32_t x0, int32_t y0, int32_t r, uint8_t cornername, uint32_t color),
|
||||||
fillCircle(int32_t x0, int32_t y0, int32_t r, uint32_t color),
|
fillCircle(int32_t x0, int32_t y0, int32_t r, uint32_t color),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue