mirror of
https://github.com/tsl0922/EPD-nRF5.git
synced 2025-12-06 15:42:48 +08:00
add function to dump LUT
This commit is contained in:
@@ -94,6 +94,22 @@ static void _setPartialRamArea(uint16_t x, uint16_t y, uint16_t w, uint16_t h)
|
|||||||
EPD_Write(CMD_RAM_YCOUNT, y % 256, y / 256);
|
EPD_Write(CMD_RAM_YCOUNT, y % 256, y / 256);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SSD1619_Dump_LUT(void)
|
||||||
|
{
|
||||||
|
uint8_t lut[128];
|
||||||
|
|
||||||
|
// Load LUT
|
||||||
|
SSD1619_Update(0xB1);
|
||||||
|
SSD1619_WaitBusy(200);
|
||||||
|
|
||||||
|
EPD_WriteCmd(CMD_READ_LUT);
|
||||||
|
EPD_ReadData(lut, sizeof(lut));
|
||||||
|
|
||||||
|
NRF_LOG_DEBUG("=== LUT BEGIN ===\n");
|
||||||
|
NRF_LOG_HEXDUMP_DEBUG(lut, sizeof(lut));
|
||||||
|
NRF_LOG_DEBUG("=== LUT END ===\n");
|
||||||
|
}
|
||||||
|
|
||||||
void SSD1619_Init()
|
void SSD1619_Init()
|
||||||
{
|
{
|
||||||
epd_model_t *EPD = epd_get();
|
epd_model_t *EPD = epd_get();
|
||||||
@@ -106,6 +122,8 @@ void SSD1619_Init()
|
|||||||
EPD_Write(CMD_BORDER_CTRL, 0x01);
|
EPD_Write(CMD_BORDER_CTRL, 0x01);
|
||||||
EPD_Write(CMD_TSENSOR_CTRL, 0x80);
|
EPD_Write(CMD_TSENSOR_CTRL, 0x80);
|
||||||
|
|
||||||
|
// SSD1619_Dump_LUT();
|
||||||
|
|
||||||
_setPartialRamArea(0, 0, EPD->width, EPD->height);
|
_setPartialRamArea(0, 0, EPD->width, EPD->height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
20
EPD/UC8176.c
20
EPD/UC8176.c
@@ -109,6 +109,7 @@ void UC8176_Refresh(void)
|
|||||||
{
|
{
|
||||||
NRF_LOG_DEBUG("[EPD]: refresh begin\n");
|
NRF_LOG_DEBUG("[EPD]: refresh begin\n");
|
||||||
UC8176_PowerOn();
|
UC8176_PowerOn();
|
||||||
|
|
||||||
NRF_LOG_DEBUG("[EPD]: temperature: %d\n", UC8176_Read_Temp());
|
NRF_LOG_DEBUG("[EPD]: temperature: %d\n", UC8176_Read_Temp());
|
||||||
EPD_WriteCmd(CMD_DRF);
|
EPD_WriteCmd(CMD_DRF);
|
||||||
delay(100);
|
delay(100);
|
||||||
@@ -131,11 +132,30 @@ static void _setPartialRamArea(uint16_t x, uint16_t y, uint16_t w, uint16_t h)
|
|||||||
0x01);
|
0x01);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void UC8176_Dump_OTP(void)
|
||||||
|
{
|
||||||
|
uint8_t data[128];
|
||||||
|
|
||||||
|
UC8176_PowerOn();
|
||||||
|
EPD_Write(CMD_ROTP, 0x00);
|
||||||
|
|
||||||
|
NRF_LOG_DEBUG("=== OTP BEGIN ===\n");
|
||||||
|
for (int i = 0; i < 0xFFF; i += sizeof(data)) {
|
||||||
|
EPD_ReadData(data, sizeof(data));
|
||||||
|
NRF_LOG_HEXDUMP_DEBUG(data, sizeof(data));
|
||||||
|
}
|
||||||
|
NRF_LOG_DEBUG("=== OTP END ===\n");
|
||||||
|
|
||||||
|
UC8176_PowerOff();
|
||||||
|
}
|
||||||
|
|
||||||
void UC8176_Init()
|
void UC8176_Init()
|
||||||
{
|
{
|
||||||
epd_model_t *EPD = epd_get();
|
epd_model_t *EPD = epd_get();
|
||||||
|
|
||||||
EPD_Reset(HIGH, 10);
|
EPD_Reset(HIGH, 10);
|
||||||
|
|
||||||
|
// UC8176_Dump_OTP();
|
||||||
|
|
||||||
EPD_Write(CMD_PSR, EPD->bwr ? 0x0F : 0x1F);
|
EPD_Write(CMD_PSR, EPD->bwr ? 0x0F : 0x1F);
|
||||||
EPD_Write(CMD_CDI, EPD->bwr ? 0x77 : 0x97);
|
EPD_Write(CMD_CDI, EPD->bwr ? 0x77 : 0x97);
|
||||||
|
|||||||
1
main.c
1
main.c
@@ -757,6 +757,7 @@ int main(void)
|
|||||||
// Save reset reason.
|
// Save reset reason.
|
||||||
m_resetreas = NRF_POWER->RESETREAS;
|
m_resetreas = NRF_POWER->RESETREAS;
|
||||||
NRF_POWER->RESETREAS |= NRF_POWER->RESETREAS;
|
NRF_POWER->RESETREAS |= NRF_POWER->RESETREAS;
|
||||||
|
NRF_LOG_DEBUG("== RESET REASON: %d ===\n", m_resetreas);
|
||||||
|
|
||||||
NRF_LOG_DEBUG("init..\n");
|
NRF_LOG_DEBUG("init..\n");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user