Added support for Newton M3 4.2 Yellow #273

This commit is contained in:
jjwbruijn
2024-04-20 21:02:48 +02:00
parent f4727483ad
commit f1010ad3cc
6 changed files with 42 additions and 15 deletions

View File

@@ -110,7 +110,7 @@ struct tagSpecs {
bool hasNFC = false;
bool hasLED = false;
bool ledInverted = false;
bool hasThirdColor = false;
uint8_t thirdColor = false;
uint8_t boardType = NRF_BOARDTYPE_REGULAR;
uint16_t macSuffix = 0x0000;
uint8_t OEPLtype = 0;

View File

@@ -34,6 +34,7 @@ void identifyTagInfo() {
0B 81 08 04 14 09 0F 04 00 0D 01 80 01 A8 00 38 00 07 81 9D 00 00 42 FF FF FF FF FF FF FF FF FF 2.9 UC8151
26 36 42 7E 16 03 14 04 00 15 01 80 01 A8 00 38 00 07 01 9C 00 00 42 FF FF FF FF FF FF FF FF FF 2.9 Lite (SSD) (no buttons)
F1 D5 B2 05 15 0A 04 04 00 12 01 90 01 2C 01 04 00 07 01 9C 00 00 46 FF FF FF FF FF FF FF FF FF 4.2 SSD
79 19 1C 06 16 01 05 04 00 12 02 90 01 2C 01 04 00 07 81 9D 00 00 46 FF FF FF FF FF FF FF FF FF 4.2 SSD Yellow
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
@@ -76,10 +77,7 @@ void identifyTagInfo() {
capabilities[0] = getUICRByte(0x12);
capabilities[1] = getUICRByte(0x13);
tag.solumType = getUICRByte(0x16);
if (getUICRByte(0x0A) == 0x01) {
tag.hasThirdColor = true;
}
tag.thirdColor = getUICRByte(0x0A);
switch (controllerType) {
case 0x0A:
@@ -142,7 +140,7 @@ void identifyTagInfo() {
} else {
printf("This tag have NFC: No\n");
}
if (tag.hasThirdColor) {
if (tag.thirdColor) {
printf("This tag is Black and white only: No\n");
} else {
printf("This tag is Black and white only: Yes\n");
@@ -197,8 +195,19 @@ void identifyTagInfo() {
epd->XOffset = 8;
break;
case STYPE_SIZE_042:
switch (tag.thirdColor) {
case 0x01:
tag.macSuffix = 0xB6D0;
tag.OEPLtype = SOLUM_M3_BWR_42;
break;
case 0x02:
tag.macSuffix = 0xC690;
tag.OEPLtype = SOLUM_M3_BWY_42;
break;
}
tag.macSuffix = 0xB6D0;
tag.OEPLtype = SOLUM_M3_BWR_42;
epd->epdMirrorV = true;
break;
case STYPE_SIZE_043:
@@ -233,7 +242,7 @@ void identifyTagInfo() {
tag.OEPLtype = SOLUM_M3_BWR_97;
break;
case STYPE_SIZE_013:
//epdXRes -= 1;
// epdXRes -= 1;
tag.ledInverted = true;
tag.macSuffix = 0xBDB0;
epd->drawDirectionRight = true;

View File

@@ -102,7 +102,7 @@ void dualssd::epdSetup() {
epdWrite(CMD_DATA_ENTRY_MODE + CONTROLLER_ONE, 1, 0x02);
epdWrite(CMD_DATA_ENTRY_MODE + CONTROLLER_TWO, 1, 0x03);
if (tag.hasThirdColor) {
if (tag.thirdColor) {
epdWrite(CMD_DISP_UPDATE_CTRL, 2, 0x08, 0x10);
} else {
epdWrite(CMD_DISP_UPDATE_CTRL, 2, 0x48, 0x10);
@@ -127,7 +127,7 @@ 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.
uint8_t c_increment = 1;
if (!tag.hasThirdColor) {
if (!tag.thirdColor) {
c_increment = 2;
}
for (uint8_t c = 0; c < 4; c = c + c_increment) {

View File

@@ -87,7 +87,7 @@ void unissd::epdSetup() {
epdWrite(CMD_TEMP_SENSOR_CONTROL, 1, 0x80);
// end stock init
// added
if (tag.hasThirdColor) {
if (tag.thirdColor) {
epdWrite(CMD_DISP_UPDATE_CTRL, 2, 0x08, 0x00); // fix reversed image with stock setup
} else {
epdWrite(CMD_DISP_UPDATE_CTRL, 2, 0x48, 0x00); // fix reversed image with stock setup
@@ -118,7 +118,7 @@ void unissd::epdWriteDisplayData() {
// this display expects two entire framebuffers worth of data to be written, one for b/w and one for red
uint8_t *buf[2] = {0, 0}; // this will hold pointers to odd/even data lines
uint8_t c_end = 2; // The loop must be executed 2 times if BWR, 1 time if BW
if (!tag.hasThirdColor) {
if (!tag.thirdColor) {
c_end = 1;
}
for (uint8_t c = 0; c < c_end; c++) {

View File

@@ -28,7 +28,7 @@ bool noAPShown = false;
void addOverlay() {
if (currentChannel == 0) {
drawMask(epd->Xres - 28, 4, 24, 24, COLOR_BLACK);
if (tag.hasThirdColor) {
if (tag.thirdColor) {
drawMask(epd->Xres - 28, 4, 24, 24, COLOR_RED);
drawRoundedRectangle(epd->Xres - 28, 4, 24, 24, COLOR_RED);
addBufferedImage(epd->Xres - 24, 8, COLOR_BLACK, rotation::ROTATE_0, ant, DRAW_NORMAL);
@@ -45,7 +45,7 @@ void addOverlay() {
if (lowBattery) {
drawMask(epd->Xres - 27, epd->Yres - 26, 22, 22, COLOR_BLACK);
if (tag.hasThirdColor) {
if (tag.thirdColor) {
drawMask(epd->Xres - 27, epd->Yres - 26, 22, 22, COLOR_RED);
drawRoundedRectangle(epd->Xres - 28, epd->Yres - 26, 24, 24, COLOR_RED);
} else {
@@ -60,7 +60,7 @@ void addOverlay() {
#ifdef DEBUG_BUILD
fontrender fr(&FreeSansBold18pt7b);
drawMask(15, epd->Yres - 53, 130, 33, COLOR_BLACK);
if (tag.hasThirdColor) {
if (tag.thirdColor) {
drawMask(15, epd->Yres - 53, 130, 33, COLOR_RED);
drawRoundedRectangle(15, epd->Yres - 53, 129, 33, COLOR_RED);
fr.epdPrintf(17, epd->Yres - 50, COLOR_RED, rotation::ROTATE_0, "DEBUG");
@@ -209,7 +209,7 @@ void showSplashScreen() {
}
#ifdef DEBUG_BUILD
drawMask(15, epd->Yres - 53, 129, 33, COLOR_BLACK);
if (tag.hasThirdColor) {
if (tag.thirdColor) {
drawMask(15, epd->Yres - 53, 129, 33, COLOR_RED);
drawRoundedRectangle(15, epd->Yres - 53, 129, 33, COLOR_RED);
fr.setFont(&FreeSansBold18pt7b);

View File

@@ -0,0 +1,18 @@
{
"version": 1,
"name": "M3 4.2 BWY\"",
"width": 400,
"height": 300,
"rotatebuffer": 0,
"bpp": 2,
"colortable": {
"white": [ 255, 255, 255 ],
"black": [ 0, 0, 0 ],
"yellow": [ 255, 255, 0 ]
},
"shortlut": 0,
"zlib_compression": "27",
"options": [ "button", "led" ],
"contentids": [ 22, 23, 1, 4, 5, 7, 8, 9, 10, 11, 17, 18, 19, 20 ],
"usetemplate": 2
}