mirror of
https://github.com/fsender/readguy.git
synced 2025-12-12 04:58:14 +08:00
feat: add 5.83 inch support
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
## Release 1.3.4 - 2023/11/24
|
||||
|
||||
1. 添加5.83寸屏幕驱动. 默认开启, 嫌flash占用大的可以手动关
|
||||
|
||||
2. 修复别的一些bug
|
||||
|
||||
## Release 1.3.3 - 2023/11/12
|
||||
|
||||
1. 添加了2.66寸三色和黑白的不同驱动程序.
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
<img src="extra/artset/readguy_theme3.png" width="30%" height="auto">
|
||||
|
||||
**版本1.3.3正式发布!欢迎分享、star和fork~** 上面的图是项目看板娘, 盖. 可爱的盖姐在等你哟~
|
||||
**版本1.3.4正式发布!欢迎分享、star和fork~** 上面的图是项目看板娘, 盖. 可爱的盖姐在等你哟~
|
||||
|
||||
**即将发布7个全新的屏幕驱动: 欢迎支持! (详见后面的驱动表格)**
|
||||
|
||||
@@ -70,7 +70,7 @@ Supported displays: 1.54-inch, 2.13-inch, 2.66-inch, 2.9-inch, 4.2-inch.
|
||||
|14 |M5 Core.Ink 1.54寸 |即将支持|200*200|/|/|/|/|
|
||||
|15 |3.7寸低DPI版墨水屏 |即将支持|416*240|/|/|/|/|
|
||||
|16 |4.26寸高分辨率墨水屏|即将支持|800*480|/|/|/|/|
|
||||
|17 |5.83寸墨水屏幕 |即将支持|600*448|/|/|/|/|
|
||||
|17 |5.83寸墨水屏幕 |原创自研|600*448| 16阶 | 支持 | 1.7s | 0.8s |
|
||||
|18 |5.83寸GDEQ0583T31 |即将支持|640*480|/|/|/|/|
|
||||
|19 |7.5寸三色墨水屏幕 |即将支持|800*480|/|/|/|/|
|
||||
|20 |10.2寸GDEQ102T90 |即将支持|960*640|/|/|/|/|
|
||||
@@ -247,5 +247,5 @@ firmware.bin 0x10000
|
||||
|
||||
Copyright © 2022-2023 FriendshipEnder. All Rights reserved.
|
||||
|
||||
版权声明:需要经过作者@friendshipender的许可才能商用。
|
||||
版权声明:需要经过作者@friendshipender的许可才能商用。 可以联系邮箱playyinzhe@qq.com询问商用事宜
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
"type": "git",
|
||||
"url": "https://github.com/fsender/readguy"
|
||||
},
|
||||
"version": "1.3.3",
|
||||
"version": "1.3.4",
|
||||
"frameworks": "arduino",
|
||||
"platforms": ["espressif32", "espressif8266"],
|
||||
"headers": "readguy.h",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
name=readguy
|
||||
version=1.3.3
|
||||
version=1.3.4
|
||||
author=fsender <f_ender@163.com>
|
||||
maintainer=fsender <f_ender@163.com>
|
||||
sentence=A free E-paper display driver library supports 16-level greyscale.
|
||||
|
||||
@@ -35,34 +35,380 @@
|
||||
#include "guy_583A.h"
|
||||
#ifdef READGUY_DEV_583A
|
||||
namespace guydev_583A{
|
||||
//以下代码均为我 FriendshipEnder 原创, 呵呵哒~~
|
||||
/*LUT格式:
|
||||
重复次数,xnnnxnnn...(000=0,001=VSH,010=VSL,011=VSH_LV,100=VSL_LV,101=VSH_LVX,110=VSL_LVX,111=浮动),持续时间.......
|
||||
0x01, 0x00, 0x00, 0x1B, 0x10, 0x0F, 0x0A, 0x0A, 0x0F, 0x10, 0x1B
|
||||
0x01, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
0x01, 0x21, 0x21, 0x21, 0x21, 0x1B, 0x10, 0x0F, 0x0A, 0x0A, 0x0F, 0x10, 0x1B
|
||||
0x01, 0x12, 0x12, 0x12, 0x10, 0x14, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x00
|
||||
0x01, 0x11, 0x21, 0x21, 0x22, 0x1B, 0x10, 0x0F, 0x0A, 0x0A, 0x0F, 0x10, 0x1B
|
||||
0x01, 0x21, 0x21, 0x21, 0x20, 0x14, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x00
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
0x01, 0x12, 0x12, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02
|
||||
0x01, 0x21, 0x21, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
*/
|
||||
const PROGMEM unsigned char drv::lut_20_LUTC[] =
|
||||
{ 0x01, 0x00, 0x00, 0x1B, 0x10, 0x0F, 0x0A, 0x0A, 0x0F, 0x10, 0x1B};
|
||||
const PROGMEM unsigned char drv::lut_20_LUTCFAST[] =
|
||||
{ 0x01, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
||||
const PROGMEM unsigned char drv::lut_21_LUTB[] =//000
|
||||
{ 0x01, 0x21, 0x21, 0x21, 0x21, 0x1B, 0x14, 0x13, 0x12, 0x00, 0x00, 0x10, 0x1E};
|
||||
const PROGMEM unsigned char drv::lut_21_LUTBFAST[] =
|
||||
{ 0x01, 0x12, 0x12, 0x12, 0x10, 0x1f, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x00};
|
||||
const PROGMEM unsigned char drv::lut_22_LUTW[] =//011
|
||||
{ 0x01, 0x11, 0x21, 0x21, 0x22, 0x1B, 0x14, 0x13, 0x12, 0x00, 0x00, 0x10, 0x1E};
|
||||
const PROGMEM unsigned char drv::lut_22_LUTWFAST[] =
|
||||
{ 0x01, 0x21, 0x21, 0x21, 0x20, 0x1f, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x00};
|
||||
const PROGMEM unsigned char drv::lut_23_LUTG1[] =//001
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
||||
const PROGMEM unsigned char drv::lut_24_LUTG2[] =//010
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
||||
const PROGMEM unsigned char drv::lut_25_LUTR0[] =//100//WW
|
||||
{ 0x01, 0x12, 0x12, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x03};
|
||||
const PROGMEM unsigned char drv::lut_26_LUTR1[] =//101//BB
|
||||
{ 0x00/*0x01*/, 0x21, 0x21, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02};
|
||||
const PROGMEM unsigned char drv::lut_27_LUTR2[] =//110
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
||||
const PROGMEM unsigned char drv::lut_28_LUTR3[] =//111//局刷
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
||||
const PROGMEM unsigned char drv::lut_29_LUTXON[] =
|
||||
{ 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
||||
const PROGMEM unsigned char drv::customGrey[] =
|
||||
{ 0x00, 0x01, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x0a, 0x0c, 0x0e, 0x11, 0x14, 0x17, 0x1a, 0x1e,
|
||||
0x00, 0x0f, 0x0e, 0x0d, 0x0c, 0x0b, 0x0a, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01};
|
||||
const PROGMEM unsigned char *drv::luts[10]={
|
||||
lut_20_LUTC,lut_21_LUTB,lut_22_LUTW,lut_23_LUTG1,lut_24_LUTG2,
|
||||
lut_25_LUTR0,lut_26_LUTR1,lut_27_LUTR2,lut_28_LUTR3,lut_29_LUTXON
|
||||
};
|
||||
const unsigned char *drv::luts_fast[10]={
|
||||
lut_20_LUTCFAST,lut_21_LUTBFAST,lut_22_LUTWFAST,lut_23_LUTG1,lut_24_LUTG2,
|
||||
lut_25_LUTR0,lut_26_LUTR1,lut_27_LUTR2,lut_28_LUTR3,lut_29_LUTXON
|
||||
};
|
||||
|
||||
void drv::drv_init(){ //初始化屏幕
|
||||
//add driver code...
|
||||
#ifdef READGUY_583A_DUAL_BUFFER
|
||||
drv::drv(){ //构造时, 分配内存.
|
||||
buf_2nd=(uint8_t *)malloc(GUY_D_WIDTH*GUY_D_HEIGHT/8);
|
||||
if(buf_2nd) {
|
||||
Serial.println(F("[GUY MEM] allocate 33600B for 5.83' EPD."));
|
||||
//memset(buf_2nd,0,GUY_D_WIDTH*GUY_D_HEIGHT/8);
|
||||
}
|
||||
}
|
||||
void drv::drv_fullpart(bool part){ //初始化慢刷功能
|
||||
drv::~drv(){ //构造时, 分配内存.
|
||||
if(buf_2nd) free(buf_2nd);
|
||||
Serial.println(F("[GUY MEM] unallocate 33600B."));
|
||||
}
|
||||
#endif
|
||||
void drv::sendLut(int lutid){
|
||||
int lutlen=13,lutlen2=247;
|
||||
if(lutid==0){lutlen=11;lutlen2=209;}
|
||||
else if(lutid==9){lutlen=10;lutlen2=190;}
|
||||
guy_epdCmd(0x20+lutid);
|
||||
if(epdFull){
|
||||
for(int i=0;i<lutlen;i++){
|
||||
guy_epdParam(pgm_read_byte(luts[lutid]+i));
|
||||
}
|
||||
}
|
||||
else{
|
||||
for(int i=0;i<lutlen;i++){
|
||||
if(lutid==1 && i==5) guy_epdParam(pgm_read_byte(customGrey+iLut+greyscalingHighQuality));
|
||||
else
|
||||
guy_epdParam(pgm_read_byte(luts_fast[lutid]+i));
|
||||
}
|
||||
}
|
||||
for(int i=0;i<lutlen2;i++){
|
||||
guy_epdParam(0);
|
||||
}
|
||||
}
|
||||
void drv::epd_init(){
|
||||
if(!epd_PowerOn) Reset(); //设定为已上电
|
||||
guy_epdCmd(0x01);
|
||||
guy_epdParam(0x37);
|
||||
guy_epdParam(0x00);
|
||||
guy_epdParam(0x07);
|
||||
guy_epdParam(0x07);
|
||||
guy_epdCmd(0x00);
|
||||
guy_epdParam(0xcf);
|
||||
guy_epdParam(0x88);
|
||||
guy_epdCmd(0x06);
|
||||
guy_epdParam(0xc7);
|
||||
guy_epdParam(0xcc);
|
||||
guy_epdParam(0x28);
|
||||
guy_epdCmd(0x30);
|
||||
guy_epdParam(0x3a);
|
||||
guy_epdCmd(0x41);
|
||||
guy_epdParam(0x00);
|
||||
guy_epdCmd(0x50);
|
||||
guy_epdParam(0x77);
|
||||
guy_epdCmd(0x60);
|
||||
guy_epdParam(0x22);
|
||||
guy_epdCmd(0x61);
|
||||
guy_epdParam(0x02);
|
||||
guy_epdParam(0x58);
|
||||
guy_epdParam(0x01);
|
||||
guy_epdParam(0xc0);
|
||||
guy_epdCmd(0x82);
|
||||
guy_epdParam(0x28);
|
||||
for(int i=0;i<10;i++){
|
||||
sendLut(i);
|
||||
}
|
||||
guy_epdCmd(0xe5);
|
||||
guy_epdParam(0x03);
|
||||
}
|
||||
void drv::epd_sendZoneInfo(){
|
||||
guy_epdCmd(0x91);
|
||||
//send area info
|
||||
guy_epdCmd(0x90);
|
||||
guy_epdParam(0x00);
|
||||
guy_epdParam(0x00);
|
||||
guy_epdParam(0x02);
|
||||
guy_epdParam(0x57);
|
||||
guy_epdParam(0x00);
|
||||
guy_epdParam(0x00);
|
||||
guy_epdParam(0x01);
|
||||
guy_epdParam(0xbf);
|
||||
guy_epdParam(0x01);
|
||||
}
|
||||
void drv::epd_sendWriter(std::function<uint8_t(int)> f){
|
||||
guy_epdCmd(0x10); //Then write image data 显示数据
|
||||
#ifdef READGUY_583A_DUAL_BUFFER
|
||||
if(epdFull || buf_2nd==nullptr || greyscalingHighQuality){
|
||||
#endif
|
||||
for(int i=0;i<GUY_D_WIDTH*GUY_D_HEIGHT/8;i++){ //fill 0x03 for test
|
||||
uint8_t dat=0,dat_r=f(i);
|
||||
dat |= ((dat_r&0x80)?0x30:0);
|
||||
dat |= ((dat_r&0x40)?0x03:0);
|
||||
guy_epdParam(dat);
|
||||
dat&=0;
|
||||
dat |= ((dat_r&0x20)?0x30:0);
|
||||
dat |= ((dat_r&0x10)?0x03:0);
|
||||
guy_epdParam(dat);
|
||||
dat&=0;
|
||||
dat |= ((dat_r&0x08)?0x30:0);
|
||||
dat |= ((dat_r&0x04)?0x03:0);
|
||||
guy_epdParam(dat);
|
||||
dat&=0;
|
||||
dat |= ((dat_r&0x02)?0x30:0);
|
||||
dat |= ((dat_r&0x01)?0x03:0);
|
||||
guy_epdParam(dat);
|
||||
#ifdef READGUY_583A_DUAL_BUFFER
|
||||
buf_2nd[i]=dat_r;
|
||||
}
|
||||
}
|
||||
else{
|
||||
for(int i=0;i<GUY_D_WIDTH*GUY_D_HEIGHT/8;i++){ //fill 0x03 for test
|
||||
//guy_epdParam(0x03); //for data test
|
||||
uint8_t dat=0,dat_r=f(i);
|
||||
dat |= ((dat_r&0x80)?((buf_2nd[i]&0x80)?0x40:0x30):((buf_2nd[i]&0x80)?0x00:0x50));
|
||||
//0x3?黑->白色, 0x0?白->黑色 0x4? 白->白色 0x5? 黑->黑色
|
||||
dat |= ((dat_r&0x40)?((buf_2nd[i]&0x40)?0x4:0x3):((buf_2nd[i]&0x40)?0x0:0x5));
|
||||
guy_epdParam(dat);
|
||||
dat&=0;
|
||||
dat |= ((dat_r&0x20)?((buf_2nd[i]&0x20)?0x40:0x30):((buf_2nd[i]&0x20)?0x00:0x50));
|
||||
dat |= ((dat_r&0x10)?((buf_2nd[i]&0x10)?0x4:0x3):((buf_2nd[i]&0x10)?0x0:0x5));
|
||||
guy_epdParam(dat);
|
||||
dat&=0;
|
||||
dat |= ((dat_r&0x8)?((buf_2nd[i]&0x8)?0x40:0x30):((buf_2nd[i]&0x8)?0x00:0x50));
|
||||
dat |= ((dat_r&0x4)?((buf_2nd[i]&0x4)?0x4:0x3):((buf_2nd[i]&0x4)?0x0:0x5));
|
||||
guy_epdParam(dat);
|
||||
dat&=0;
|
||||
dat |= ((dat_r&0x2)?((buf_2nd[i]&0x2)?0x40:0x30):((buf_2nd[i]&0x2)?0x00:0x50));
|
||||
dat |= ((dat_r&0x1)?((buf_2nd[i]&0x1)?0x4:0x3):((buf_2nd[i]&0x1)?0x0:0x5));
|
||||
guy_epdParam(dat);
|
||||
buf_2nd[i]=dat_r;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
void drv::drv_init(){ //初始化屏幕
|
||||
epdFull=1;
|
||||
epd_PowerOn=0;
|
||||
}
|
||||
void drv::drv_fullpart(bool part){ //初始化慢刷/快刷功能
|
||||
if(lastRefresh) return;
|
||||
//add driver code...
|
||||
if(!epd_PowerOn) part=0;
|
||||
epdFull=!part;
|
||||
if(epdFull) iLut=15;
|
||||
}
|
||||
void drv::drv_setDepth(uint8_t i){
|
||||
if(!epd_PowerOn) return; //不支持切换到快刷的情形
|
||||
epdFull=0; iLut = i?(i>15?15:i):15; //如果需要, 改成自己的代码
|
||||
}
|
||||
void drv::drv_dispWriter(std::function<uint8_t(int)> f,uint8_t m){ //单色刷新
|
||||
if(m&1){//stage 1
|
||||
if(lastRefresh) drv_dispWriter(f,2);
|
||||
//add driver code...
|
||||
BeginTransfer();
|
||||
if(epdFull){
|
||||
if(!epd_PowerOn){
|
||||
epdFull=0; //发送快刷的lut
|
||||
epd_init();
|
||||
epdFull=1; //发送快刷的lut
|
||||
guy_epdCmd(0x04); //power on
|
||||
EndTransfer();
|
||||
guy_epdBusy(-60);
|
||||
BeginTransfer();
|
||||
guy_epdCmd(0x10);
|
||||
for(int i=0;i<GUY_D_WIDTH*GUY_D_HEIGHT/2;i++){ //fill 0x33
|
||||
guy_epdParam(0x33);
|
||||
}
|
||||
epd_PowerOn=1; //设定为已上电
|
||||
}
|
||||
else{ //full refresh need power on
|
||||
guy_epdCmd(0x04); //power on
|
||||
EndTransfer();
|
||||
guy_epdBusy(-60);
|
||||
BeginTransfer();
|
||||
}
|
||||
epd_sendZoneInfo();
|
||||
guy_epdCmd(0x10); //Then write image data
|
||||
for(int i=0;i<GUY_D_WIDTH*GUY_D_HEIGHT/2;i++){ //fill 0x03 for test
|
||||
guy_epdParam(0x33); //for test
|
||||
}
|
||||
guy_epdCmd(0x92);
|
||||
epd_init();
|
||||
//epd_init(); //repeat call in GxEPD2
|
||||
epd_sendWriter(f); //write image data
|
||||
}
|
||||
else{
|
||||
epd_init();
|
||||
//Power on fx
|
||||
guy_epdCmd(0x04);
|
||||
EndTransfer();
|
||||
guy_epdBusy(-60);
|
||||
BeginTransfer();
|
||||
epd_sendZoneInfo();
|
||||
epd_sendWriter(f);
|
||||
guy_epdCmd(0x92);
|
||||
epd_sendZoneInfo();
|
||||
}
|
||||
guy_epdCmd(0x12); //开始刷屏
|
||||
EndTransfer();
|
||||
lastRefresh=millis();
|
||||
}
|
||||
if(m&2){//stage 2
|
||||
uint32_t ms=millis()-lastRefresh;
|
||||
uint32_t u=epdFull?slowRefTime:fastRefTime; //全刷:局刷 busy时间
|
||||
if(ms<u) guy_epdBusy(u-ms); //对于busy电平为低电平忙碌,高电平正常的屏幕则改为ms-u
|
||||
int ms=millis()-lastRefresh;
|
||||
Serial.printf("epdFull? %d, epd_PowerOn? %d \n",epdFull,epd_PowerOn);
|
||||
int u=epdFull?slowRefTime:fastRefTime; //全刷:局刷 busy时间
|
||||
if(ms<u) guy_epdBusy(ms-u); //对于busy电平为低电平忙碌,高电平正常的屏幕则改为ms-u
|
||||
lastRefresh=0;
|
||||
//add driver code...
|
||||
BeginTransfer();
|
||||
if(epdFull){
|
||||
epdFull=0; //发送快刷的lut
|
||||
epd_init(); //repeat init in part mode
|
||||
epdFull=1; //发送快刷的lut
|
||||
epd_sendZoneInfo();
|
||||
guy_epdCmd(0x10); //Then write image data
|
||||
for(int i=0;i<GUY_D_WIDTH*GUY_D_HEIGHT/2;i++){ //fill 0x03 for test
|
||||
guy_epdParam(0x33); //for test
|
||||
}
|
||||
guy_epdCmd(0x02); //power off for test...
|
||||
//guy_epdBusy(-30);
|
||||
}
|
||||
else{
|
||||
guy_epdCmd(0x92);
|
||||
epd_sendZoneInfo();
|
||||
guy_epdCmd(0x10); //Then write image data 显示数据
|
||||
for(int i=0;i<GUY_D_WIDTH*GUY_D_HEIGHT/2;i++){ //fill 0x03 for test
|
||||
guy_epdParam(0x33); //for test:全白
|
||||
}
|
||||
guy_epdCmd(0x92);
|
||||
}
|
||||
EndTransfer();
|
||||
}
|
||||
/* test code , with stageless ------------------------------------------------------
|
||||
if(epdFull){ //慢刷
|
||||
BeginTransfer();
|
||||
if(!epd_PowerOn){
|
||||
epdFull=0; //发送快刷的lut
|
||||
epd_init();
|
||||
epdFull=1; //发送快刷的lut
|
||||
guy_epdCmd(0x04); //power on
|
||||
EndTransfer();
|
||||
guy_epdBusy(-60);
|
||||
BeginTransfer();
|
||||
guy_epdCmd(0x10);
|
||||
for(int i=0;i<GUY_D_WIDTH*GUY_D_HEIGHT/2;i++){ //fill 0x33
|
||||
guy_epdParam(0x33);
|
||||
}
|
||||
epd_PowerOn=1; //设定为已上电
|
||||
}
|
||||
else{ //full refresh need power on
|
||||
guy_epdCmd(0x04); //power on
|
||||
EndTransfer();
|
||||
guy_epdBusy(-60);
|
||||
BeginTransfer();
|
||||
}
|
||||
epd_sendZoneInfo();
|
||||
guy_epdCmd(0x10); //Then write image data
|
||||
for(int i=0;i<GUY_D_WIDTH*GUY_D_HEIGHT/2;i++){ //fill 0x03 for test
|
||||
guy_epdParam(0x33); //for test
|
||||
}
|
||||
guy_epdCmd(0x92);
|
||||
epd_init();
|
||||
//epd_init(); //repeat call in GxEPD2
|
||||
epd_sendWriter(f); //write image data
|
||||
guy_epdCmd(0x12);
|
||||
EndTransfer();
|
||||
guy_epdBusy(-4000);
|
||||
BeginTransfer();
|
||||
epdFull=0; //发送快刷的lut
|
||||
epd_init(); //repeat init in part mode
|
||||
epdFull=1; //发送快刷的lut
|
||||
epd_sendZoneInfo();
|
||||
guy_epdCmd(0x10); //Then write image data
|
||||
for(int i=0;i<GUY_D_WIDTH*GUY_D_HEIGHT/2;i++){ //fill 0x03 for test
|
||||
guy_epdParam(0x33); //for test
|
||||
}
|
||||
guy_epdCmd(0x02); //power off for test...
|
||||
EndTransfer();
|
||||
//guy_epdBusy(-30);
|
||||
}
|
||||
else{ //partmode
|
||||
BeginTransfer();
|
||||
epd_init();
|
||||
//Power on fx
|
||||
guy_epdCmd(0x04);
|
||||
EndTransfer();
|
||||
guy_epdBusy(-60);
|
||||
BeginTransfer();
|
||||
epd_sendZoneInfo();
|
||||
epd_sendWriter(f);
|
||||
guy_epdCmd(0x92);
|
||||
epd_sendZoneInfo();
|
||||
guy_epdCmd(0x12); //快刷
|
||||
EndTransfer();
|
||||
guy_epdBusy(-1000); //1秒钟刷屏时间
|
||||
BeginTransfer();
|
||||
guy_epdCmd(0x92);
|
||||
epd_sendZoneInfo();
|
||||
guy_epdCmd(0x10); //Then write image data 显示数据
|
||||
for(int i=0;i<GUY_D_WIDTH*GUY_D_HEIGHT/2;i++){ //fill 0x03 for test
|
||||
guy_epdParam(0x33); //for test:全白
|
||||
}
|
||||
guy_epdCmd(0x92);
|
||||
EndTransfer();
|
||||
}
|
||||
// test code , with stageless ------------------------------------------------------ */
|
||||
}
|
||||
void drv::drv_draw16grey_step(std::function<uint8_t(int)> f, int step){
|
||||
if(_quality&1) return readguyEpdBase::drv_draw16grey_step(f,step);
|
||||
if(step==1) drv_fullpart(1);//初始阶段,完成准备工作 //设置为快刷模式
|
||||
greyscalingHighQuality=16; //开启高品质灰度模式
|
||||
iLut=step;
|
||||
drv_dispWriter(f);
|
||||
//DelayMs(10); //未知原因()
|
||||
if(step==15) greyscalingHighQuality=0;//初始阶段,完成准备工作 //设置为快刷模式
|
||||
}
|
||||
void drv::drv_sleep() { //开始屏幕睡眠
|
||||
if(RST_PIN>=0){ //RST_PIN<0 无法唤醒
|
||||
//add driver code...
|
||||
guy_epdCmd(0x07); // deep sleep
|
||||
guy_epdParam(0xA5); // check code
|
||||
}
|
||||
epd_PowerOn = 0;
|
||||
epdFull = 1; //强制设置为慢刷新模式
|
||||
|
||||
@@ -36,13 +36,17 @@
|
||||
#define _GUY_EPD583A_H_FILE
|
||||
|
||||
namespace guydev_583A{
|
||||
constexpr int GUY_D_WIDTH =200; //驱动屏幕宽度
|
||||
constexpr int GUY_D_HEIGHT =200; //驱动屏幕高度
|
||||
constexpr int slowRefTime =2000; //驱动屏幕慢刷时间, 单位毫秒
|
||||
constexpr int fastRefTime =500; //驱动屏幕快刷时间, 单位毫秒
|
||||
constexpr int GUY_D_WIDTH =600; //驱动屏幕宽度
|
||||
constexpr int GUY_D_HEIGHT =448; //驱动屏幕高度
|
||||
constexpr int slowRefTime =1600; //驱动屏幕慢刷时间, 单位毫秒
|
||||
constexpr int fastRefTime =560; //驱动屏幕快刷时间, 单位毫秒
|
||||
|
||||
class drv : public readguyEpdBase {
|
||||
public:
|
||||
#ifdef READGUY_583A_DUAL_BUFFER
|
||||
drv();
|
||||
virtual ~drv();
|
||||
#endif
|
||||
int drv_ID() const { return READGUY_DEV_583A; }
|
||||
void drv_init(); //初始化屏幕
|
||||
void drv_fullpart(bool part); //切换慢刷/快刷功能
|
||||
@@ -52,11 +56,36 @@ public:
|
||||
//int drv_panelwidth() const { return GUY_D_WIDTH; }; //返回缓存的数据宽度
|
||||
int drv_height() const{ return GUY_D_HEIGHT; }; //返回显示区域高度
|
||||
void drv_setDepth(uint8_t i); //设置显示颜色深度
|
||||
int drv_supportGreyscaling() const { return 16; }
|
||||
int drv_supportGreyscaling() const { return (_quality&1)?16:-16; } //暂不支持灰度功能移植
|
||||
void drv_draw16grey_step(std::function<uint8_t(int)> f, int step);
|
||||
private:
|
||||
uint8_t epd_PowerOn=1; //是否上电. 睡眠则设为0
|
||||
uint8_t epdFull=0; //是partical模式/快速刷新模式 0快刷, 1慢刷
|
||||
uint8_t iLut=15; //颜色深度
|
||||
uint8_t greyscalingHighQuality = 0;
|
||||
static const unsigned char *luts[10];
|
||||
static const unsigned char *luts_fast[10];
|
||||
static const unsigned char lut_20_LUTC[];
|
||||
static const unsigned char lut_20_LUTCFAST[];
|
||||
static const unsigned char lut_21_LUTB[];
|
||||
static const unsigned char lut_21_LUTBFAST[];
|
||||
static const unsigned char lut_22_LUTW[];
|
||||
static const unsigned char lut_22_LUTWFAST[];
|
||||
static const unsigned char lut_23_LUTG1[];
|
||||
static const unsigned char lut_24_LUTG2[];
|
||||
static const unsigned char lut_25_LUTR0[];
|
||||
static const unsigned char lut_26_LUTR1[];
|
||||
static const unsigned char lut_27_LUTR2[];
|
||||
static const unsigned char lut_28_LUTR3[];
|
||||
static const unsigned char lut_29_LUTXON[];
|
||||
static const unsigned char customGrey[];
|
||||
void sendLut(int lutid);
|
||||
void epd_init();
|
||||
void epd_sendZoneInfo();
|
||||
void epd_sendWriter(std::function<uint8_t(int)> f);
|
||||
#ifdef READGUY_583A_DUAL_BUFFER
|
||||
uint8_t *buf_2nd=nullptr; //second Buffer for luts
|
||||
#endif
|
||||
};
|
||||
}
|
||||
#endif /* END OF FILE. ReadGuy project.
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
//#define READGUY_DEV_154C 14 //(即将推出) 1.54寸M09墨水屏 (M5Stack Core-Ink 同款; GDEW0154M09)
|
||||
//#define READGUY_DEV_370B 15 //(即将推出) 3.7寸低DPI墨水屏, 分辨率416*240, b站 @叫我武哒哒 的项目用
|
||||
//#define READGUY_DEV_426A 16 //(即将推出) 4.26寸高分辨率墨水屏, 800*480. GDEQ0426T82 支持硬件四灰
|
||||
//#define READGUY_DEV_583A 17 //(即将推出) 5.83寸墨水屏幕, 分辨率为600*448. 有黑白有三色
|
||||
#define READGUY_DEV_583A 17 //(即将推出) 5.83寸墨水屏幕, 分辨率为600*448. 有黑白有三色
|
||||
//#define READGUY_DEV_583B 18 //(即将推出) 5.83寸高分辨率, 640*480. GDEQ0583T31 只有黑白
|
||||
//#define READGUY_DEV_750A 19 //(即将推出) 7.5 寸墨水屏幕, 800*480. 只有三色(买不到黑白)
|
||||
//#define READGUY_DEV_1020A 20 //(即将推出) 10.2寸墨水屏GDEQ102T90, 芯片SSD1677. 黑白色分辨率960*640
|
||||
@@ -68,5 +68,7 @@
|
||||
|
||||
#define EPD_DRIVERS_NUM_MAX 21 //此选项请不要取消注释掉, 有几个屏幕就写多少.
|
||||
|
||||
#define READGUY_583A_DUAL_BUFFER //对于单缓存的5.83屏幕, 启用双缓存支持
|
||||
|
||||
#endif /* END OF FILE. ReadGuy project.
|
||||
Copyright (C) 2023 FriendshipEnder. */
|
||||
@@ -50,7 +50,7 @@ protected:
|
||||
uint8_t in_trans=0;
|
||||
uint8_t _quality=2; //灰度显示品质 0(默认)-高品质 1-低品质 部分屏幕支持高品质的连续刷灰度.
|
||||
#ifdef MEPD_DEBUG_WAVE
|
||||
uint16_t dat_combo = 0; //dc引脚状态 0 command, 1 data
|
||||
int dat_combo = 0; //dc引脚状态 0 command, 1 data
|
||||
#endif
|
||||
uint16_t *readBuff;// = new uint16_t[spr.width()];
|
||||
uint8_t *writeBuff;// = new uint8_t[w];
|
||||
|
||||
@@ -41,9 +41,9 @@
|
||||
//另外, 在提交新版本之前, 不要忘记在github上创建release, 否则Arduino IDE会读不到
|
||||
#define READGUY_V_MAJOR 1
|
||||
#define READGUY_V_MINOR 3
|
||||
#define READGUY_V_PATCH 3
|
||||
#define READGUY_V_PATCH 4
|
||||
#define READGUY_VERSION_VAL (READGUY_V_MAJOR*1000+READGUY_V_MINOR*100+READGUY_V_PATCH*10)
|
||||
#define READGUY_VERSION "1.3.3"
|
||||
#define READGUY_VERSION "1.3.4"
|
||||
|
||||
#ifdef ESP8266
|
||||
#define _READGUY_PLATFORM "ESP8266"
|
||||
|
||||
@@ -664,7 +664,7 @@ uint8_t ReadguyDriver::getBtn_impl(){ //按钮不可用, 返回0.
|
||||
if(res1 && millis()-last >= btn_rd[1].long_press_ms && (!btn_rd[1].isPressedRaw()))
|
||||
res4 = (res1 == 1)?1:2; //左键点按-向下翻页
|
||||
if(res2) {
|
||||
if((btn_rd[0].isPressedRaw()<<1)) res4 |= 3;
|
||||
if(btn_rd[0].isPressedRaw()) res4 |= 3; //避免GCC警告(我常年喜欢-Werror=all
|
||||
else if(res2 == 1) res4 |= 4; //右键点按-确定
|
||||
else if(res2 == 4) res4 |= 8; //右键长按-返回
|
||||
last=millis();
|
||||
|
||||
@@ -179,6 +179,7 @@ class ReadguyDriver: public LGFX_Sprite{ // readguy 基础类
|
||||
* @param WiFiSet 是否保持AP模式关闭. 0:配网完成自动关WiFi, 1:需要手动调用 WiFi.mode(WIFI_OFF) 关闭WiFi.
|
||||
* 2:自动连接到已存的WiFi, 但不等待连接成功
|
||||
* @param initepd 是否初始化墨水屏. 初始化后的首次刷屏必为慢刷. 如果是不断电复位, 可以不初始化墨水屏直接刷屏
|
||||
* @param initSD 是否初始化文件系统. 选是-初始化SD失败则初始化LittleFs; 选否-不初始化SD也不初始化littlefs.
|
||||
* @return SD卡是否就绪
|
||||
*/
|
||||
uint8_t init(uint8_t WiFiSet = 0, bool initepd = 1, bool initSD = 1);
|
||||
|
||||
Reference in New Issue
Block a user