From bee51a23b6db3e6bb663aa89b1351301e44d8bea Mon Sep 17 00:00:00 2001 From: VstudioLAB <57193516+VstudioLAB@users.noreply.github.com> Date: Thu, 15 Feb 2024 00:09:25 +0100 Subject: [PATCH] 5.85" Initial support and general preparation for BW only compatibility. --- .../hal/Newton_M3_nRF52811/HAL_Newton_M3.h | 2 +- .../hal/Newton_M3_nRF52811/tagtype_db.cpp | 21 ++++++- .../src/epd_driver/dualssd.cpp | 61 ++++++------------- .../Newton_M3_nRF52811/src/userinterface.cpp | 12 +++- 4 files changed, 49 insertions(+), 47 deletions(-) diff --git a/ARM_Tag_FW/Newton_M3_nRF52811/hal/Newton_M3_nRF52811/HAL_Newton_M3.h b/ARM_Tag_FW/Newton_M3_nRF52811/hal/Newton_M3_nRF52811/HAL_Newton_M3.h index 437e8bcc..e94df91b 100644 --- a/ARM_Tag_FW/Newton_M3_nRF52811/hal/Newton_M3_nRF52811/HAL_Newton_M3.h +++ b/ARM_Tag_FW/Newton_M3_nRF52811/hal/Newton_M3_nRF52811/HAL_Newton_M3.h @@ -105,7 +105,7 @@ struct tagSpecs { uint8_t buttonCount = 0; bool hasNFC = false; bool hasLED = false; - bool hasSecondColor = true; + bool hasThirdColor = false; uint16_t macSuffix = 0x0000; uint8_t OEPLtype = 0; uint8_t solumType = 0; diff --git a/ARM_Tag_FW/Newton_M3_nRF52811/hal/Newton_M3_nRF52811/tagtype_db.cpp b/ARM_Tag_FW/Newton_M3_nRF52811/hal/Newton_M3_nRF52811/tagtype_db.cpp index 9781c1ff..7feac362 100644 --- a/ARM_Tag_FW/Newton_M3_nRF52811/hal/Newton_M3_nRF52811/tagtype_db.cpp +++ b/ARM_Tag_FW/Newton_M3_nRF52811/hal/Newton_M3_nRF52811/tagtype_db.cpp @@ -36,7 +36,9 @@ void identifyTagInfo() { CA FE BA DE 15 0B 12 04 00 10 01 E0 01 20 03 39 00 03 81 9D 00 00 4C FF FF FF FF FF FF FF FF FF 7.4 UC8179 F3 22 BC 05 15 0A 0D 04 00 19 01 A0 02 C0 03 38 07 07 01 80 00 00 64 FF FF FF FF FF FF FF FF FF 9.7 SSD AD BA FE CA 15 0A 1B 04 00 19 01 A0 02 C0 03 38 07 07 01 80 00 00 64 FF FF FF FF FF FF FF FF FF 9.7 type 2 - 22 F0 BF 05 15 0A 14 04 00 12 00 18 03 10 01 04 07 07 01 80 00 00 24 FF FF FF FF FF FF FF FF FF 5.85 + 92 C3 80 05 15 08 19 04 00 12 01 18 03 10 01 04 07 07 01 80 00 00 63 FF FF FF FF FF FF FF FF FF 5.85 BWR + 22 F0 BF 05 15 0A 14 04 00 12 00 18 03 10 01 04 07 07 01 80 00 00 24 FF FF FF FF FF FF FF FF FF 5.85 BW + MAC | calib | |?????|Xres |Yres | ??? |capab| |type| @@ -51,7 +53,7 @@ void identifyTagInfo() { 0x12 - SSD (var1.6) 0x15 - SSD (2.9 lite) 0x19 - SSD (9.7) - + 0x0A - Have third color? 0x12 - 0x01 | (0x80 if it has a button) 0x13 - 0x80 | (0x10 if it has a LED) | (0x0C ?? ) | (0x01 if it has a button) */ @@ -67,6 +69,10 @@ void identifyTagInfo() { capabilities[1] = getUICRByte(0x13); tag.solumType = getUICRByte(0x16); + if(getUICRByte(0x0A) == 0x01){ + tag.hasThirdColor = true; + } + switch (controllerType) { case 0x0F: case 0x12: @@ -125,7 +131,11 @@ void identifyTagInfo() { }else{ printf("This tag have NFC: No\n"); } - + if(tag.hasThirdColor){ + printf("This tag is Black and white only: No\n"); + }else{ + printf("This tag is Black and white only: Yes\n"); + } // we'll calculate image slot size here uint32_t imageSize = epd->Xres * epd->Yres / 4; @@ -171,6 +181,11 @@ void identifyTagInfo() { epd->epdMirrorV = true; tag.OEPLtype = SOLUM_M3_BWR_58; break; + case STYPE_SIZE_058_FREEZER: + tag.macSuffix = 0x84D0; + epd->epdMirrorV = true; + tag.OEPLtype = SOLUM_M3_BW_58; + break; case STYPE_SIZE_060: tag.macSuffix = 0xB890; tag.OEPLtype = SOLUM_M3_BWR_60; diff --git a/ARM_Tag_FW/Newton_M3_nRF52811/src/epd_driver/dualssd.cpp b/ARM_Tag_FW/Newton_M3_nRF52811/src/epd_driver/dualssd.cpp index d339c696..b22f7cb5 100644 --- a/ARM_Tag_FW/Newton_M3_nRF52811/src/epd_driver/dualssd.cpp +++ b/ARM_Tag_FW/Newton_M3_nRF52811/src/epd_driver/dualssd.cpp @@ -69,20 +69,6 @@ void dualssd::epdSetup() { case 0x0F: case 0x12: case 0x15: - // stock init 1.6" - /*epdWrite(CMD_DRV_OUTPUT_CTRL, 3, this->effectiveYRes & 0xFF, this->effectiveYRes >> 8, 0x00); - epdWrite(CMD_DATA_ENTRY_MODE, 1, 0x01); - epdWrite(CMD_WINDOW_X_SIZE, 2, this->XOffset / 8, ((this->XOffset + this->effectiveXRes) / 8) - 1); - epdWrite(CMD_WINDOW_Y_SIZE, 4, (this->YOffset + this->effectiveYRes) & 0xFF, (this->YOffset + this->effectiveYRes) >> 8, this->YOffset & 0xFF, this->YOffset >> 8); - - epdWrite(CMD_BORDER_WAVEFORM_CTRL, 1, 0x05); - epdWrite(CMD_TEMP_SENSOR_CONTROL, 1, 0x80); - */ - // end stock init - // added - //epdWrite(CMD_DISP_UPDATE_CTRL, 2, 0x08, 0x00); // fix reversed image with stock setup - - /* 5.85 INIT SEQUENCE 0x11, 0x00 0x91, 0x01 @@ -113,7 +99,11 @@ void dualssd::epdSetup() { epdWrite(0x11, 1, 0x00); epdWrite(0x91, 1, 0x01); - epdWrite(0x21, 2, 0x08, 0x10); + if(tag.hasThirdColor){ + epdWrite(0x21, 2, 0x08, 0x10); + }else{ + epdWrite(0x21, 2, 0x48, 0x10); + } //epdWrite(CMD_WINDOW_X_SIZE, 2, this->XOffset / 8, ((this->XOffset + this->effectiveXRes) / 8) - 1); //epdWrite(CMD_WINDOW_Y_SIZE, 4, (this->YOffset + this->effectiveYRes) & 0xFF, (this->YOffset + this->effectiveYRes) >> 8, this->YOffset & 0xFF, this->YOffset >> 8); epdWrite(0x44, 2, 0x31, 0x00); @@ -126,28 +116,7 @@ void dualssd::epdSetup() { epdWrite(0xC5, 4, 0x0F, 0x01, 0x00, 0x00); epdWrite(0xCE, 1, 0x00); epdWrite(0xCF, 4, 0x0F, 0x01, 0x3C, 0x01); - - //epdWrite(CMD_DISP_UPDATE_CTRL, 2, 0x08, 0x00); // fix reversed image with stock setup - - - break; - case 0x19: - // stock init 9.7" - epdWrite(0x46, 1, 0xF7); - delay(15); - epdWrite(0x47, 1, 0xF7); - delay(15); - epdWrite(0x0C, 5, 0xAE, 0xC7, 0xC3, 0xC0, 0x80); - epdWrite(0x01, 3, 0x9F, 0x02, 0x00); - epdWrite(0x11, 1, 0x02); - epdWrite(0x44, 4, 0xBF, 0x03, 0x00, 0x00); - epdWrite(0x45, 4, 0x00, 0x00, 0x9F, 0x02); epdWrite(0x3C, 1, 0x01); - epdWrite(0x18, 1, 0x80); - epdWrite(0x22, 1, 0xF7); - // end stock init - // added - //epdWrite(CMD_DISP_UPDATE_CTRL, 2, 0x08, 0x00); // fix reversed image with stock setup break; } } @@ -156,12 +125,16 @@ void dualssd::epdWriteDisplayData() { uint8_t *buf[2] = {0, 0}; // this will hold pointers to odd/even data lines // Those dual SSD controller (SSD1683??) behave as 2 400pxx wide screens, that needs independent data transfers. - for (uint8_t c = 0; c < 4; c++) { + uint8_t c_increment = 1; + if(!tag.hasThirdColor){ + c_increment = 2; + } + for (uint8_t c = 0; c < 4; c = c + c_increment) { delay(10); - if (c == 0) epd_cmd(0x24);//RED - if (c == 1) epd_cmd(0x26);//BW - if (c == 2) epd_cmd(0xA4);//Red 2 - if (c == 3) epd_cmd(0xA6);//BW 2 + if (c == 0) epd_cmd(0x24);//BW + if (c == 1) epd_cmd(0x26);//RED + if (c == 2) epd_cmd(0xA4);//BW + if (c == 3) epd_cmd(0xA6);//RED delay(10); markData(); @@ -239,7 +212,11 @@ void dualssd::draw() { } void dualssd::drawNoWait() { epdWriteDisplayData(); - epdWrite(CMD_DISP_UPDATE_CTRL2, 1, 0xF7); + if(tag.hasThirdColor){ + epdWrite(CMD_DISP_UPDATE_CTRL2, 1, 0xF7); + }else{ + //epdWrite(CMD_DISP_UPDATE_CTRL2, 1, 0xF7); + } epdWrite(CMD_ACTIVATION, 0); } void dualssd::epdWaitRdy() { diff --git a/ARM_Tag_FW/Newton_M3_nRF52811/src/userinterface.cpp b/ARM_Tag_FW/Newton_M3_nRF52811/src/userinterface.cpp index 2214dca2..a94e841b 100644 --- a/ARM_Tag_FW/Newton_M3_nRF52811/src/userinterface.cpp +++ b/ARM_Tag_FW/Newton_M3_nRF52811/src/userinterface.cpp @@ -115,12 +115,22 @@ void showSplashScreen() { fr.setFont(&FreeSansBold18pt7b); fr.epdPrintf(2, 2, COLOR_BLACK, rotation::ROTATE_0, "OpenEPaperLink"); fr.setFont(&FreeSans9pt7b); - fr.epdPrintf(10, 38, 1, rotation::ROTATE_0, "Newton M3 5.85\""); + fr.epdPrintf(10, 38, COLOR_RED, rotation::ROTATE_0, "Newton M3 5.85\""); fr.setFont(&FreeSans9pt7b); fr.epdPrintf(epd->Xres - 17, 0, 0, rotation::ROTATE_270, "FW: %04X-%s", fwVersion, fwVersionSuffix); fr.epdPrintf(5, epd->Yres - 20, 0, rotation::ROTATE_0, "MAC: %02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X", mSelfMac[7], mSelfMac[6], mSelfMac[5], mSelfMac[4], mSelfMac[3], mSelfMac[2], mSelfMac[1], mSelfMac[0]); addQR(epd->Xres - 120, 42, 3, 3, "https://openepaperlink.eu/tag/0/%02X/%02X%02X%02X%02X%02X%02X%02X%02X/", tag.OEPLtype, mSelfMac[7], mSelfMac[6], mSelfMac[5], mSelfMac[4], mSelfMac[3], mSelfMac[2], mSelfMac[1], mSelfMac[0]); break; + case STYPE_SIZE_058_FREEZER: + fr.setFont(&FreeSansBold18pt7b); + fr.epdPrintf(2, 2, COLOR_BLACK, rotation::ROTATE_0, "OpenEPaperLink"); + fr.setFont(&FreeSans9pt7b); + fr.epdPrintf(10, 38, COLOR_BLACK, rotation::ROTATE_0, "Newton M3 5.85\" Freezer"); + fr.setFont(&FreeSans9pt7b); + fr.epdPrintf(epd->Xres - 17, 0, COLOR_BLACK, rotation::ROTATE_270, "FW: %04X-%s", fwVersion, fwVersionSuffix); + fr.epdPrintf(5, epd->Yres - 20, COLOR_BLACK, rotation::ROTATE_0, "MAC: %02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X", mSelfMac[7], mSelfMac[6], mSelfMac[5], mSelfMac[4], mSelfMac[3], mSelfMac[2], mSelfMac[1], mSelfMac[0]); + addQR(epd->Xres - 120, 42, 3, 3, "https://openepaperlink.eu/tag/0/%02X/%02X%02X%02X%02X%02X%02X%02X%02X/", tag.OEPLtype, mSelfMac[7], mSelfMac[6], mSelfMac[5], mSelfMac[4], mSelfMac[3], mSelfMac[2], mSelfMac[1], mSelfMac[0]); + break; case STYPE_SIZE_060: fr.setFont(&FreeSansBold24pt7b); fr.epdPrintf(10, 10, COLOR_BLACK, rotation::ROTATE_0, "OpenEPaperLink");