add clear without refresh support

This commit is contained in:
Shuanglei Tao
2025-05-23 17:19:47 +08:00
parent 6e3f529912
commit 915ae9e69a
4 changed files with 6 additions and 6 deletions

View File

@@ -31,7 +31,7 @@
typedef struct
{
void (*init)(); /**< Initialize the e-Paper register */
void (*clear)(void); /**< Clear screen */
void (*clear)(bool refresh); /**< Clear screen */
void (*write_image)(uint8_t *black, uint8_t *color, uint16_t x, uint16_t y, uint16_t w, uint16_t h); /**< write image */
void (*refresh)(void); /**< Sends the image buffer in RAM to e-Paper and displays */
void (*sleep)(void); /**< Enter sleep mode */

View File

@@ -115,7 +115,7 @@ static void epd_service_on_write(ble_epd_t * p_epd, uint8_t * p_data, uint16_t l
case EPD_CMD_CLEAR:
p_epd->display_mode = MODE_NONE;
p_epd->epd->drv->clear();
p_epd->epd->drv->clear(length > 1 ? p_data[1] : true);
break;
case EPD_CMD_SEND_COMMAND:

View File

@@ -118,7 +118,7 @@ static void SSD1619_Refresh(void)
SSD1619_Update(0x83); // power off
}
void SSD1619_Clear(void)
void SSD1619_Clear(bool refresh)
{
epd_model_t *EPD = epd_get();
uint16_t Width = (EPD->width + 7) / 8;
@@ -138,7 +138,7 @@ void SSD1619_Clear(void)
}
}
SSD1619_Refresh();
if (refresh) SSD1619_Refresh();
}
void SSD1619_Write_Image(uint8_t *black, uint8_t *color, uint16_t x, uint16_t y, uint16_t w, uint16_t h)

View File

@@ -141,11 +141,11 @@ static void UC8176_Write_RAM(uint8_t cmd, uint8_t value)
}
}
void UC8176_Clear(void)
void UC8176_Clear(bool refresh)
{
UC8176_Write_RAM(CMD_DTM1, 0xFF);
UC8176_Write_RAM(CMD_DTM2, 0xFF);
UC8176_Refresh();
if (refresh) UC8176_Refresh();
}
static void _setPartialRamArea(uint16_t x, uint16_t y, uint16_t w, uint16_t h)