mirror of
https://github.com/jam422470459/EPD-nRF52-hema213.git
synced 2025-12-06 08:32:54 +08:00
update JD79668 driver
This commit is contained in:
@@ -74,6 +74,8 @@ static void on_disconnect(ble_epd_t * p_epd, ble_evt_t * p_ble_evt)
|
||||
{
|
||||
UNUSED_PARAMETER(p_ble_evt);
|
||||
p_epd->conn_handle = BLE_CONN_HANDLE_INVALID;
|
||||
p_epd->epd->drv->sleep();
|
||||
nrf_delay_ms(200); // for sleep
|
||||
EPD_GPIO_Uninit();
|
||||
}
|
||||
|
||||
|
||||
@@ -100,6 +100,8 @@ void JD79668_Init()
|
||||
EPD_Write(0xBD, 0x07);
|
||||
EPD_Write(0xBE, 0xFE);
|
||||
EPD_Write(0xE9, 0x01);
|
||||
|
||||
JD79668_PowerOn();
|
||||
}
|
||||
|
||||
// Fast update: 12s
|
||||
@@ -130,18 +132,15 @@ void JD79668_Init_Fast()
|
||||
EPD_Write(0xE6, 0x5A);
|
||||
EPD_Write(0xA5, 0x00);
|
||||
JD79668_WaitBusy(200);
|
||||
JD79668_PowerOff();
|
||||
}
|
||||
|
||||
static void JD79668_Refresh(void)
|
||||
{
|
||||
NRF_LOG_DEBUG("[EPD]: refresh begin\n");
|
||||
epd_model_t *EPD = epd_get();
|
||||
JD79668_PowerOn();
|
||||
_setPartialRamArea(0, 0, EPD->width, EPD->height);
|
||||
EPD_Write(CMD_DRF, 0x00);
|
||||
JD79668_WaitBusy(30000);
|
||||
JD79668_PowerOff();
|
||||
NRF_LOG_DEBUG("[EPD]: refresh end\n");
|
||||
}
|
||||
|
||||
@@ -175,8 +174,7 @@ void JD79668_Write_Image(uint8_t *black, uint8_t *color, uint16_t x, uint16_t y,
|
||||
|
||||
void JD79668_Sleep(void)
|
||||
{
|
||||
EPD_Write(CMD_POF, 0x00); // power off
|
||||
JD79668_WaitBusy(200);
|
||||
JD79668_PowerOff();
|
||||
delay(100);
|
||||
EPD_Write(CMD_DSLP, 0xA5); // deep sleep
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user