Merge pull request #125 from jonasniesner/master

Add multiple 2.2" M3 tag files
This commit is contained in:
Jonas Niesner
2023-09-03 20:09:56 +02:00
committed by GitHub
11 changed files with 250 additions and 6 deletions

View File

@@ -39,8 +39,10 @@ jobs:
- name: Build NRF firmware
run: |
cd ARM_Tag_FW/Newton_M3_nRF52811
pio run --environment Newton_M3_22_BWR
pio run --environment Newton_M3_29_BWR
pio run --environment Newton_M3_75_BWR
cp .pio/build/Newton_M3_22_BWR/firmware.hex /home/runner/work/OpenEPaperLink/OpenEPaperLink/binaries/Newton_M3_22_BWR.hex
cp .pio/build/Newton_M3_29_BWR/firmware.hex /home/runner/work/OpenEPaperLink/OpenEPaperLink/binaries/Newton_M3_29_BWR.hex
cp .pio/build/Newton_M3_75_BWR/firmware.hex /home/runner/work/OpenEPaperLink/OpenEPaperLink/binaries/Newton_M3_75_BWR.hex

View File

@@ -0,0 +1,35 @@
#ifndef _BOARDHEADER_H_
#define _BOARDHEADER_H_
#include "../../../../tag_types.h"
#include "HAL_Newton_M3.h"
// eeprom map
#define EEPROM_SETTINGS_AREA_START (0x01000UL)
#define EEPROM_SETTINGS_AREA_LEN (0x03000UL)
#define EEPROM_UPDATE_AREA_START (0x04000UL)
#define EEPROM_UPDATE_AREA_LEN (0x10000UL)
#define EEPROM_IMG_START (0x14000UL)
#define EEPROM_IMG_EACH (0x04000UL) // 160*296 / 8 * 2 = 0x2E40
// Mac fixed part
// 7E22CC67B298 (B29)
#define MAC_ID_0 0xB2
#define MAC_ID_1 0x90
// AP mode definitions
#define HAS_EEPROM 1
#define HAS_SCREEN 1
#define AP_EMULATE_TAG 1
// hw types
#define HW_TYPE SOLUM_M3_BWR_22
#include "../include/ssd1619.h"
#define SCREEN_WIDTH 160
#define SCREEN_HEIGHT 296
#define SCREEN_XOFFSET 8
#define SCREEN_YOFFSET 0
#endif

View File

@@ -29,6 +29,7 @@
#define SCREEN_WIDTH 168
#define SCREEN_HEIGHT 384
#define SCREEN_XOFFSET 0
#define SCREEN_YOFFSET 0
#endif

View File

@@ -29,5 +29,7 @@
#define SCREEN_WIDTH 800
#define SCREEN_HEIGHT 480
#define SCREEN_XOFFSET 0
#define SCREEN_YOFFSET 0
#endif

View File

@@ -1,3 +1,7 @@
#ifdef BUILD_NEWTON_M3_22_BWR
#include "../hal/Newton_M3_nRF52811/Newton_M3_nRF52811_22_BWR.h"
#include "../hal/Newton_M3_nRF52811/HAL_Newton_M3.h"
#endif
#ifdef BUILD_NEWTON_M3_29_BWR
#include "../hal/Newton_M3_nRF52811/Newton_M3_nRF52811_29_BWR.h"
#include "../hal/Newton_M3_nRF52811/HAL_Newton_M3.h"

View File

@@ -11,6 +11,13 @@ lib_deps =
stevemarple/SoftWire @ ^2.0.9
stevemarple/AsyncDelay @ ^1.1.2
[env:Newton_M3_22_BWR]
build_flags =
${env.build_flags}
-D BUILD_NEWTON_M3_22_BWR
build_src_filter =
+<*>-<uc8179.cpp>+<../hal/Newton_M3_nRF52811/*>
[env:Newton_M3_29_BWR]
build_flags =
${env.build_flags}

View File

@@ -437,7 +437,7 @@ void clearWindow(bool color) {
}
}
void clearScreen() {
setWindowX(0, SCREEN_WIDTH);
setWindowX(SCREEN_XOFFSET, SCREEN_WIDTH + SCREEN_XOFFSET);
setWindowY(0, SCREEN_HEIGHT);
setPosXY(0, 0);
shortCommand1(CMD_DATA_ENTRY_MODE, 3); // was 3
@@ -489,6 +489,8 @@ void epdWaitRdy() {
epdBusyWaitFalling(120000);
}
void drawLineHorizontal(bool color, uint16_t x1, uint16_t x2, uint16_t y) {
x1 = x1 + SCREEN_XOFFSET;
x2 = x2 + SCREEN_XOFFSET;
setWindowX(x1, x2);
setWindowY(y, y + 1);
if (color) {
@@ -499,6 +501,7 @@ void drawLineHorizontal(bool color, uint16_t x1, uint16_t x2, uint16_t y) {
epdBusyWaitFalling(100);
}
void drawLineVertical(bool color, uint16_t x, uint16_t y1, uint16_t y2) {
x = x + SCREEN_XOFFSET;
setWindowY(y1, y2);
setWindowX(x, x + 8);
shortCommand1(CMD_DATA_ENTRY_MODE, 3);
@@ -517,7 +520,7 @@ void drawLineVertical(bool color, uint16_t x, uint16_t y1, uint16_t y2) {
}
void beginFullscreenImage() {
setColorMode(EPD_MODE_NORMAL, EPD_MODE_INVERT);
setWindowX(0, SCREEN_WIDTH);
setWindowX(SCREEN_XOFFSET, SCREEN_WIDTH + SCREEN_XOFFSET);
setWindowY(0, SCREEN_HEIGHT);
shortCommand1(CMD_DATA_ENTRY_MODE, 3);
setPosXY(0, 0);
@@ -534,6 +537,7 @@ void endWriteFramebuffer() {
commandEnd();
}
void loadRawBitmap(uint8_t *bmp, uint16_t x, uint16_t y, bool color) {
x = x + SCREEN_XOFFSET;
uint16_t xsize = bmp[0] / 8;
if (bmp[0] % 8)
xsize++;
@@ -689,6 +693,7 @@ void writeCharEPD(uint8_t c) {
// Print text to the EPD. Origin is top-left
void epdPrintBegin(uint16_t x, uint16_t y, bool direction, bool fontsize, bool color) {
x = x + SCREEN_XOFFSET;
directionY = direction;
epdCharSize = 1 + fontsize;
if (directionY) {
@@ -724,7 +729,7 @@ void epdPrintBegin(uint16_t x, uint16_t y, bool direction, bool fontsize, bool c
}
setPosXY(x, y);
fontCurXpos = x;
setWindowX(x, SCREEN_WIDTH);
setWindowX(x + SCREEN_XOFFSET, SCREEN_WIDTH + SCREEN_XOFFSET);
shortCommand1(CMD_DATA_ENTRY_MODE, 7);
memset(rbuffer, 0, 32);
}

View File

@@ -91,6 +91,12 @@ void afterFlashScreenSaver() {
epdPrintEnd();
#endif
#if (SCREEN_WIDTH == 160) // High-res 2.2"
epdPrintBegin(0, 295, EPD_DIRECTION_Y, EPD_SIZE_SINGLE, EPD_COLOR_BLACK);
epdpr("OpenEPaperLink");
epdPrintEnd();
#endif
#if (SCREEN_WIDTH == 168) // High-res 2.9"
epdPrintBegin(0, 295, EPD_DIRECTION_Y, EPD_SIZE_SINGLE, EPD_COLOR_BLACK);
epdpr("OpenEPaperLink");
@@ -144,6 +150,43 @@ void showSplashScreen() {
#endif
#if (SCREEN_WIDTH == 160) // 2.2" High res
epdPrintBegin(0, 295, EPD_DIRECTION_Y, EPD_SIZE_DOUBLE, EPD_COLOR_BLACK);
epdpr("Starting");
epdPrintEnd();
epdPrintBegin(64, 295, EPD_DIRECTION_Y, EPD_SIZE_SINGLE, EPD_COLOR_BLACK);
addCapabilities();
epdPrintEnd();
epdPrintBegin(80, 295, EPD_DIRECTION_Y, EPD_SIZE_SINGLE, EPD_COLOR_BLACK);
epdpr("zbs29v033 %d.%d.%d%s", fwVersion / 100, (fwVersion % 100) / 10, (fwVersion % 10), fwVersionSuffix);
epdPrintEnd();
epdPrintBegin(105, 270, EPD_DIRECTION_Y, EPD_SIZE_SINGLE, EPD_COLOR_RED);
epdpr("MAC: %02X:%02X", mSelfMac[7], mSelfMac[6]);
epdpr(":%02X:%02X", mSelfMac[5], mSelfMac[4]);
epdpr(":%02X:%02X", mSelfMac[3], mSelfMac[2]);
epdpr(":%02X:%02X", mSelfMac[1], mSelfMac[0]);
epdPrintEnd();
uint8_t buffer[17];
sprintf((char *)buffer, "%02X%02X", mSelfMac[7], mSelfMac[6]);
sprintf((char *)buffer + 4, "%02X%02X", mSelfMac[5], mSelfMac[4]);
sprintf((char *)buffer + 8, "%02X%02X", mSelfMac[3], mSelfMac[2]);
sprintf((char *)buffer + 12, "%02X%02X", mSelfMac[1], mSelfMac[0]);
printBarcode(buffer, 120, 284);
loadRawBitmap((uint8_t *)oepli, 0, 12, EPD_COLOR_BLACK);
loadRawBitmap((uint8_t *)cloud, 0, 0, EPD_COLOR_RED);
// lutTest();
// drawLineVertical(EPD_COLOR_RED, 64, 10, 286);
// drawLineVertical(EPD_COLOR_BLACK, 65, 10, 286);
// timerDelay(TIMER_TICKS_PER_SECOND * 4);
#endif
#if (SCREEN_WIDTH == 168) // High-res 2.9"
epdPrintBegin(0, 383, EPD_DIRECTION_Y, EPD_SIZE_DOUBLE, EPD_COLOR_BLACK);
@@ -291,6 +334,9 @@ void showApplyUpdate() {
#if (SCREEN_WIDTH == 152)
epdPrintBegin(12, 60, EPD_DIRECTION_X, EPD_SIZE_DOUBLE, EPD_COLOR_BLACK);
#endif
#if (SCREEN_WIDTH == 160)
epdPrintBegin(48, 220, EPD_DIRECTION_Y, EPD_SIZE_DOUBLE, EPD_COLOR_BLACK);
#endif
#if (SCREEN_WIDTH == 168)
epdPrintBegin(48, 220, EPD_DIRECTION_Y, EPD_SIZE_DOUBLE, EPD_COLOR_BLACK);
#endif
@@ -316,6 +362,16 @@ void showScanningWindow() {
setColorMode(EPD_MODE_NORMAL, EPD_MODE_INVERT);
selectLUT(EPD_LUT_FAST_NO_REDS);
clearScreen();
#if (SCREEN_WIDTH == 160) // 2.2" High res
epdPrintBegin(2, 275, EPD_DIRECTION_Y, EPD_SIZE_DOUBLE, EPD_COLOR_BLACK);
epdpr("Scanning for APs");
epdPrintEnd();
// epdPrintBegin(40, 262, EPD_DIRECTION_Y, EPD_SIZE_SINGLE, EPD_COLOR_RED);
// epdpr("Channel - Quality");
// epdPrintEnd();
loadRawBitmap((uint8_t *)receive, 36, 24, EPD_COLOR_BLACK);
#endif
#if (SCREEN_WIDTH == 168) // High-res 2.9"
epdPrintBegin(2, 374, EPD_DIRECTION_Y, EPD_SIZE_DOUBLE, EPD_COLOR_BLACK);
epdpr("Scanning for APs");
@@ -369,6 +425,10 @@ void showScanningWindow() {
void addScanResult(uint8_t channel, uint8_t lqi) {
if (channel == 11)
resultcounter = 0;
#if (SCREEN_WIDTH == 160) // 2.2" High res
epdPrintBegin(56 + ((resultcounter % 4) * 16), 282 - (47 * (resultcounter / 4)), EPD_DIRECTION_Y, EPD_SIZE_SINGLE, EPD_COLOR_BLACK);
#endif
#if (SCREEN_WIDTH == 168) // High-res 2.9"
epdPrintBegin(56 + ((resultcounter % 4) * 16), 282 - (47 * (resultcounter / 4)), EPD_DIRECTION_Y, EPD_SIZE_SINGLE, EPD_COLOR_BLACK);
#endif
@@ -393,6 +453,39 @@ void showAPFound() {
clearScreen();
setColorMode(EPD_MODE_NORMAL, EPD_MODE_INVERT);
selectLUT(1);
#if (SCREEN_WIDTH == 160)
epdPrintBegin(0, 285, EPD_DIRECTION_Y, EPD_SIZE_DOUBLE, EPD_COLOR_BLACK);
epdpr("Waiting for data...");
epdPrintEnd();
epdPrintBegin(48, 278, EPD_DIRECTION_Y, EPD_SIZE_SINGLE, EPD_COLOR_BLACK);
epdpr("Found the following AP:");
epdPrintEnd();
epdPrintBegin(64, 293, EPD_DIRECTION_Y, EPD_SIZE_SINGLE, EPD_COLOR_BLACK);
epdpr("AP MAC: %02X:%02X", APmac[7], APmac[6]);
epdpr(":%02X:%02X", APmac[5], APmac[4]);
epdpr(":%02X:%02X", APmac[3], APmac[2]);
epdpr(":%02X:%02X", APmac[1], APmac[0]);
epdPrintEnd();
epdPrintBegin(80, 293, EPD_DIRECTION_Y, EPD_SIZE_SINGLE, EPD_COLOR_BLACK);
epdpr("Ch: %d RSSI: %d LQI: %d", currentChannel, mLastRSSI, mLastLqi);
epdPrintEnd();
epdPrintBegin(103, 258, EPD_DIRECTION_Y, EPD_SIZE_SINGLE, EPD_COLOR_BLACK);
epdpr("Tag MAC: %02X:%02X", mSelfMac[7], mSelfMac[6]);
epdpr(":%02X:%02X", mSelfMac[5], mSelfMac[4]);
epdpr(":%02X:%02X", mSelfMac[3], mSelfMac[2]);
epdpr(":%02X:%02X", mSelfMac[1], mSelfMac[0]);
epdPrintEnd();
uint8_t buffer[17];
sprintf((char *)buffer, "%02X%02X", mSelfMac[7], mSelfMac[6]);
sprintf((char *)buffer + 4, "%02X%02X", mSelfMac[5], mSelfMac[4]);
sprintf((char *)buffer + 8, "%02X%02X", mSelfMac[3], mSelfMac[2]);
sprintf((char *)buffer + 12, "%02X%02X", mSelfMac[1], mSelfMac[0]);
printBarcode(buffer, 120, 253);
loadRawBitmap((uint8_t *)receive, 36, 14, EPD_COLOR_BLACK);
#endif
#if (SCREEN_WIDTH == 168)
epdPrintBegin(0, 374, EPD_DIRECTION_Y, EPD_SIZE_DOUBLE, EPD_COLOR_BLACK);
epdpr("Waiting for data...");
@@ -563,6 +656,19 @@ void showNoAP() {
selectLUT(EPD_LUT_NO_REPEATS);
setColorMode(EPD_MODE_NORMAL, EPD_MODE_INVERT);
clearScreen();
#if (SCREEN_WIDTH == 160) // 2,2" High res
epdPrintBegin(0, 285, EPD_DIRECTION_Y, EPD_SIZE_DOUBLE, EPD_COLOR_BLACK);
epdpr("No AP found :(");
epdPrintEnd();
epdPrintBegin(48, 285, EPD_DIRECTION_Y, EPD_SIZE_SINGLE, EPD_COLOR_BLACK);
epdpr("We'll try again in a");
epdPrintEnd();
epdPrintBegin(64, 285, EPD_DIRECTION_Y, EPD_SIZE_SINGLE, EPD_COLOR_BLACK);
epdpr("little while...");
epdPrintEnd();
loadRawBitmap((uint8_t *)receive, 36, 24, EPD_COLOR_BLACK);
loadRawBitmap((uint8_t *)failed, 42, 26, EPD_COLOR_RED);
#endif
#if (SCREEN_WIDTH == 168) // High-res 2,9"
epdPrintBegin(0, 374, EPD_DIRECTION_Y, EPD_SIZE_DOUBLE, EPD_COLOR_BLACK);
epdpr("No AP found :(");
@@ -651,6 +757,15 @@ void showNoEEPROM() {
selectLUT(EPD_LUT_NO_REPEATS);
clearScreen();
setColorMode(EPD_MODE_NORMAL, EPD_MODE_INVERT);
#if (SCREEN_WIDTH == 160) // 2.2" High-res
epdPrintBegin(0, 285, EPD_DIRECTION_Y, EPD_SIZE_DOUBLE, EPD_COLOR_BLACK);
epdpr("EEPROM FAILED :(");
epdPrintEnd();
epdPrintBegin(64, 285, EPD_DIRECTION_Y, EPD_SIZE_SINGLE, EPD_COLOR_BLACK);
epdpr("Sleeping forever :'(");
epdPrintEnd();
loadRawBitmap((uint8_t *)failed, 42, 26, EPD_COLOR_RED);
#endif
#if (SCREEN_WIDTH == 168) // High-res 2.9"
epdPrintBegin(0, 374, EPD_DIRECTION_Y, EPD_SIZE_DOUBLE, EPD_COLOR_BLACK);
epdpr("EEPROM FAILED :(");
@@ -707,6 +822,15 @@ void showNoMAC() {
selectLUT(EPD_LUT_NO_REPEATS);
clearScreen();
setColorMode(EPD_MODE_NORMAL, EPD_MODE_INVERT);
#if (SCREEN_WIDTH == 160) // 2.2" High res
epdPrintBegin(0, 285, EPD_DIRECTION_Y, EPD_SIZE_DOUBLE, EPD_COLOR_BLACK);
epdpr("NO MAC SET :(");
epdPrintEnd();
epdPrintBegin(64, 285, EPD_DIRECTION_Y, EPD_SIZE_SINGLE, EPD_COLOR_BLACK);
epdpr("Sleeping forever :'(");
epdPrintEnd();
loadRawBitmap((uint8_t *)failed, 42, 26, EPD_COLOR_RED);
#endif
#if (SCREEN_WIDTH == 168) // High-res 2.9"
epdPrintBegin(0, 374, EPD_DIRECTION_Y, EPD_SIZE_DOUBLE, EPD_COLOR_BLACK);
epdpr("NO MAC SET :(");

View File

@@ -0,0 +1,64 @@
{
"name": "EL022H3BRA 2.2\"",
"width": 296,
"height": 160,
"rotatebuffer": 1,
"bpp": 2,
"colors": 3,
"colortable": {
"white": [255, 255, 255],
"black": [0, 0, 0],
"red": [255, 0, 0],
"gray": [150, 150, 150]
},
"capabilities": ["button", "customlut"],
"template": {
"1": {
"weekday": [148, 10, "fonts/calibrib60"],
"date": [148, 73, "fonts/calibrib50"]
},
"16": {
"location": [ 5, 5, "fonts/bahnschrift30" ],
"title": [ 247, 11, "glasstown_nbp_tf" ],
"cols": [ 1, 125, 12, "glasstown_nbp_tf" ],
"bars": [ 5, 111, 10 ]
},
"2": {
"fonts": ["fonts/calibrib150", "fonts/calibrib150", "fonts/calibrib120", "fonts/calibrib100"],
"xy": [148, 74]
},
"4": {
"location": [5, 5, "fonts/bahnschrift30"],
"wind": [280, 5, "fonts/bahnschrift30"],
"temp": [5, 65, "fonts/bahnschrift70"],
"icon": [285, 20, 70, 2],
"dir": [245, -12, 40],
"umbrella": [190, -50, 25]
},
"8": {
"location": [5, 12, "t0_14b_tf"],
"column": [5, 59],
"day": [30, 18, "fonts/twcondensed20", 41, 108],
"icon": [30, 55, 30],
"wind": [18, 26],
"line": [20, 128]
},
"9": {
"title": [5, 3, "fonts/bahnschrift20"],
"items": 8,
"line": [5, 34, 13],
"font": "glasstown_nbp_tf"
},
"10": {
"title": [10, 5, "fonts/bahnschrift20"],
"pos": [149, 25]
},
"11": {
"title": [5, 2, "fonts/bahnschrift20"],
"date": [290, 2],
"items": 7,
"red": [0, 21, 296, 14],
"line": [5, 32, 15, "t0_14b_tf", 50]
}
}
}

View File

@@ -53,7 +53,7 @@ void dump(uint8_t *a, uint16_t l) {
}
int8_t powerPinsExt[] = FLASHER_EXT_POWER;
int8_t powerPinsExt[] = {16,17,18,21};
uint8_t pinsExt[] = {FLASHER_EXT_CLK, FLASHER_EXT_MISO, FLASHER_EXT_MOSI, FLASHER_EXT_RESET, FLASHER_EXT_RXD, FLASHER_EXT_SS, FLASHER_EXT_TEST, FLASHER_EXT_TXD};

View File

@@ -29,7 +29,7 @@ struct flasherCommand {
uint8_t* data = nullptr;
};
int8_t powerPins2[] = FLASHER_EXT_POWER;
int8_t powerPins2[] = {16,17,18,21};
bool autoFlash(flasher* f) {
f->getFirmwareMD5();