mirror of
https://github.com/OpenEPaperLink/OpenEPaperLink.git
synced 2026-03-21 02:04:36 +01:00
Original commit for this support
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
#define SOLUM_M2_BWR_42 0x24
|
||||
#define SOLUM_M2_BW_16 0x25
|
||||
#define SOLUM_M2_BWR_75 0x26
|
||||
#define SOLUM_M2_BW_29 0x27
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
|
||||
|
||||
#include "userinterface.h"
|
||||
|
||||
#include <stdbool.h>
|
||||
@@ -80,16 +79,17 @@ void addOverlay() {
|
||||
#ifdef ISDEBUGBUILD
|
||||
#if (SCREEN_WIDTH == 152) || (SCREEN_WIDTH == 176) || (SCREEN_WIDTH == 200)
|
||||
epdPrintBegin(139, 151, EPD_DIRECTION_Y, EPD_SIZE_SINGLE, EPD_COLOR_RED);
|
||||
epdpr("DEBUG");
|
||||
epdPrintEnd();
|
||||
#elif (SCREEN_WIDTH == 400)
|
||||
epdPrintBegin(87, 0, EPD_DIRECTION_Y, EPD_SIZE_SINGLE, EPD_COLOR_RED);
|
||||
epdpr("DEBUG");
|
||||
epdPrintEnd();
|
||||
#elif (SCREEN_WIDTH == 128)
|
||||
epdPrintBegin(87, 0, EPD_DIRECTION_X, EPD_SIZE_SINGLE, EPD_COLOR_RED);
|
||||
loadRawBitmap(debugbuild, 100, 2, EPD_COLOR_RED);
|
||||
#elif (SCREEN_WIDTH == 176)
|
||||
loadRawBitmap(debugbuild, 144, 2, EPD_COLOR_RED);
|
||||
// epdPrintBegin(130, 1, EPD_DIRECTION_X, EPD_SIZE_SINGLE, EPD_COLOR_RED);
|
||||
#endif
|
||||
// epdpr("DEBUG");
|
||||
// epdPrintEnd();
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -292,8 +292,10 @@ void showSplashScreen() {
|
||||
spr(buffer + 12, "%02X%02X", mSelfMac[1], mSelfMac[0]);
|
||||
printBarcode(buffer, 120, 284);
|
||||
#ifndef LEAN_VERSION
|
||||
loadRawBitmap(oepli, 0, 12, EPD_COLOR_BLACK);
|
||||
|
||||
loadRawBitmap(cloud, 0, 0, EPD_COLOR_RED);
|
||||
loadRawBitmap(oepli, 0, 12, EPD_COLOR_BLACK);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
@@ -25,7 +25,11 @@
|
||||
#define CMD_POWER_ON_MEASURE 0x05
|
||||
#define CMD_BOOSTER_SOFT_START 0x06
|
||||
#define CMD_DEEP_SLEEP 0x07
|
||||
#ifndef BW_SCREEN
|
||||
#define CMD_DISPLAY_START_TRANSMISSION_DTM1 0x10
|
||||
#else
|
||||
#define CMD_DISPLAY_START_TRANSMISSION_DTM1 0x13
|
||||
#endif
|
||||
#define CMD_DATA_STOP 0x11
|
||||
#define CMD_DISPLAY_REFRESH 0x12
|
||||
#define CMD_DISPLAY_START_TRANSMISSION_DTM2 0x13
|
||||
@@ -344,7 +348,7 @@ static void epdDrawDirection(bool direction) {
|
||||
if (direction == drawDirection) return;
|
||||
|
||||
drawDirection = direction;
|
||||
|
||||
#ifndef BW_SCREEN
|
||||
uint8_t psr_setting = RES_128x296 | FORMAT_BWR | BOOSTER_ON | RESET_NONE | LUT_OTP | SHIFT_RIGHT;
|
||||
if (drawDirection) {
|
||||
psr_setting |= SCAN_DOWN;
|
||||
@@ -352,6 +356,16 @@ static void epdDrawDirection(bool direction) {
|
||||
psr_setting |= SCAN_UP;
|
||||
}
|
||||
shortCommand1(CMD_PANEL_SETTING, psr_setting);
|
||||
#else
|
||||
uint8_t psr_setting = RES_128x296 | FORMAT_BW | BOOSTER_ON | RESET_NONE | LUT_OTP | SHIFT_RIGHT;
|
||||
if (drawDirection) {
|
||||
psr_setting |= SCAN_DOWN;
|
||||
} else {
|
||||
psr_setting |= SCAN_UP;
|
||||
}
|
||||
shortCommand2(CMD_PANEL_SETTING, psr_setting, 0b00001011);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
void epdSetup() {
|
||||
@@ -359,7 +373,7 @@ void epdSetup() {
|
||||
|
||||
drawDirection = false;
|
||||
epdDrawDirection(true);
|
||||
|
||||
#ifndef BW_SCREEN
|
||||
commandBegin(CMD_POWER_SETTING);
|
||||
epdSend(VDS_INTERNAL | VDG_INTERNAL);
|
||||
epdSend(VCOM_VD | VGHL_16V);
|
||||
@@ -367,9 +381,13 @@ void epdSetup() {
|
||||
epdSend(0b101011);
|
||||
epdSend(0b101011);
|
||||
commandEnd();
|
||||
#else
|
||||
commandBegin(CMD_POWER_SETTING);
|
||||
epdSend(VDS_INTERNAL | VDG_INTERNAL);
|
||||
epdSend(VCOM_VD | VGHL_15V);
|
||||
commandEnd();
|
||||
#endif
|
||||
|
||||
shortCommand(CMD_POWER_ON);
|
||||
epdWaitRdy();
|
||||
|
||||
commandBegin(CMD_BOOSTER_SOFT_START);
|
||||
epdSend(START_10MS | STRENGTH_3 | OFF_6_58US);
|
||||
@@ -377,16 +395,23 @@ void epdSetup() {
|
||||
epdSend(START_10MS | STRENGTH_3 | OFF_6_58US);
|
||||
commandEnd();
|
||||
|
||||
shortCommand(CMD_POWER_ON);
|
||||
epdWaitRdy();
|
||||
|
||||
|
||||
commandBegin(CMD_RESOLUTION_SETING);
|
||||
epdSend(SCREEN_WIDTH);
|
||||
epdSend(SCREEN_HEIGHT >> 8);
|
||||
epdSend(SCREEN_HEIGHT & 0xFF);
|
||||
commandEnd();
|
||||
|
||||
shortCommand1(CMD_POWER_OFF_SEQUENCE, FRAMES_1);
|
||||
shortCommand1(CMD_TEMPERATURE_SELECT, TEMP_INTERNAL | OFFSET_0);
|
||||
shortCommand1(CMD_TCON_SETTING, 0x22);
|
||||
#ifndef BW_SCREEN
|
||||
shortCommand1(CMD_VCOM_INTERVAL, 0x8d); // 0x87
|
||||
#else
|
||||
shortCommand1(CMD_VCOM_INTERVAL, 0x4d); // 0x87
|
||||
#endif
|
||||
shortCommand1(CMD_PLL_CONTROL, HZ_200);
|
||||
epdWaitRdy();
|
||||
shortCommand(CMD_POWER_ON);
|
||||
@@ -493,6 +518,7 @@ void beginFullscreenImage() {
|
||||
// setPosXY(0, 0);
|
||||
}
|
||||
void beginWriteFramebuffer(bool color) {
|
||||
|
||||
if (color == EPD_COLOR_RED) {
|
||||
commandBegin(CMD_DISPLAY_START_TRANSMISSION_DTM2);
|
||||
} else {
|
||||
@@ -505,7 +531,7 @@ void endWriteFramebuffer() {
|
||||
}
|
||||
|
||||
void loadRawBitmap(uint8_t* bmp, uint16_t x, uint16_t y, bool color) __reentrant {
|
||||
// this function is very badly hurt by the switch to UC8151, taking up LOTS of valuable idata space. Only defining variables
|
||||
// this function is very badly hurt by the switch to UC8151, taking up LOTS of valuable idata space. Only defining variables
|
||||
// as static, or the function as reentrant (relegating variables to the stack) seemed to fix the idata issue. Fix me, or put me out of my misery...
|
||||
|
||||
uint16_t xsize = bmp[0] / 8;
|
||||
@@ -513,7 +539,7 @@ void loadRawBitmap(uint8_t* bmp, uint16_t x, uint16_t y, bool color) __reentrant
|
||||
uint16_t ysize = bmp[1];
|
||||
uint16_t size = xsize * bmp[1];
|
||||
|
||||
// shortCommand1(CMD_DATA_ENTRY_MODE, 3);
|
||||
//shortCommand1(CMD_DATA_ENTRY_MODE, 3);
|
||||
|
||||
bmp += 2;
|
||||
|
||||
@@ -530,7 +556,7 @@ void loadRawBitmap(uint8_t* bmp, uint16_t x, uint16_t y, bool color) __reentrant
|
||||
curY++;
|
||||
if (color) {
|
||||
commandBegin(CMD_DISPLAY_START_TRANSMISSION_DTM2);
|
||||
} else {
|
||||
} else {
|
||||
commandBegin(CMD_DISPLAY_START_TRANSMISSION_DTM1);
|
||||
}
|
||||
}
|
||||
@@ -726,7 +752,6 @@ void epdPrintBegin(uint16_t x, uint16_t y, bool direction, bool fontsize, bool c
|
||||
// shortCommand1(CMD_DATA_ENTRY_MODE, 7);
|
||||
memset(rbuffer, 0, 32);
|
||||
}
|
||||
|
||||
if (color) {
|
||||
commandBegin(CMD_DISPLAY_START_TRANSMISSION_DTM2);
|
||||
} else {
|
||||
|
||||
1
zbs243_shared/board/zbs29_BW_uc/board.c
Normal file
1
zbs243_shared/board/zbs29_BW_uc/board.c
Normal file
@@ -0,0 +1 @@
|
||||
#include "../boardZBS29common.c"
|
||||
33
zbs243_shared/board/zbs29_BW_uc/board.h
Normal file
33
zbs243_shared/board/zbs29_BW_uc/board.h
Normal file
@@ -0,0 +1,33 @@
|
||||
#ifndef _BOARD_H_
|
||||
#define _BOARD_H_
|
||||
|
||||
#include <stdint.h>
|
||||
#include "spi.h"
|
||||
|
||||
#define __packed
|
||||
#include "../oepl-definitions.h"
|
||||
|
||||
|
||||
#define eepromByte spiByte
|
||||
#define eepromPrvSelect() do { __asm__("nop\nnop\nnop\n"); P1_1 = 0; __asm__("nop\nnop\nnop\n"); } while(0)
|
||||
#define eepromPrvDeselect() do { __asm__("nop\nnop\nnop\n"); P1_1 = 1; __asm__("nop\nnop\nnop\n"); } while(0)
|
||||
|
||||
//eeprom map
|
||||
#define EEPROM_SETTINGS_AREA_START (0x00000UL)
|
||||
#define EEPROM_SETTINGS_AREA_LEN (0x01000UL)
|
||||
#define EEPROM_IMG_START (0x01000UL)
|
||||
#define EEPROM_IMG_EACH (0x03000UL)
|
||||
|
||||
#define HAS_EEPROM 1
|
||||
#define HAS_SCREEN 1
|
||||
#define NFC_TYPE 1
|
||||
#define AP_EMULATE_TAG 1
|
||||
|
||||
|
||||
//hw types
|
||||
#define HW_TYPE SOLUM_M2_BW_29
|
||||
|
||||
#include "../boardCommon.h"
|
||||
|
||||
|
||||
#endif
|
||||
7
zbs243_shared/board/zbs29_BW_uc/make.mk
Normal file
7
zbs243_shared/board/zbs29_BW_uc/make.mk
Normal file
@@ -0,0 +1,7 @@
|
||||
FLAGS += --code-size 0xfc00
|
||||
|
||||
SOC = zbs243
|
||||
|
||||
BARCODE = datamatrix
|
||||
|
||||
# 0xfc00 and not 0x10000 to leave some space for update header and updater in flash
|
||||
1
zbs243_shared/board/zbs29_BW_uc/screen.c
Normal file
1
zbs243_shared/board/zbs29_BW_uc/screen.c
Normal file
@@ -0,0 +1 @@
|
||||
#include "../uc8151.c"
|
||||
26
zbs243_shared/board/zbs29_BW_uc/screen.h
Normal file
26
zbs243_shared/board/zbs29_BW_uc/screen.h
Normal file
@@ -0,0 +1,26 @@
|
||||
#ifndef _SCREEN_H_
|
||||
#define _SCREEN_H_
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include "../uc8151.h"
|
||||
|
||||
#define BW_SCREEN
|
||||
#define SCREEN_WIDTH 128
|
||||
#define SCREEN_HEIGHT 296
|
||||
|
||||
#define SCREEN_NUM_GREYS 1
|
||||
#define SCREEN_FIRST_GREY_IDX 0
|
||||
#define SCREEN_EXTRA_COLOR_INDEX -1 //set to negative if nonexistent
|
||||
#define SCREEN_TX_BPP 4 //in transit
|
||||
|
||||
#define SCREEN_WIDTH_MM 29
|
||||
#define SCREEN_HEIGHT_MM 67
|
||||
|
||||
#define SCREEN_BYTE_FILL 0x44 //white
|
||||
|
||||
#define SCREEN_TYPE TagScreenEink_BW_1bpp
|
||||
|
||||
#define SCREEN_DATA_PASSES 2
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user