|
|
@ -30,6 +30,79 @@
|
|||
#include <stdlib.h>
|
||||
#include "epd1in54_V2.h"
|
||||
|
||||
|
||||
// waveform full refresh
|
||||
unsigned char WF_Full_1IN54[159] =
|
||||
{
|
||||
0x80, 0x48, 0x40, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x40, 0x48, 0x80, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x80, 0x48, 0x40, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x40, 0x48, 0x80, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0xA, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x8, 0x1, 0x0, 0x8, 0x1, 0x0, 0x2,
|
||||
0xA, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x0, 0x0, 0x0,
|
||||
0x22, 0x17, 0x41, 0x0, 0x32, 0x20
|
||||
};
|
||||
|
||||
// waveform partial refresh(fast)
|
||||
unsigned char WF_PARTIAL_1IN54_0[159] =
|
||||
{
|
||||
0x0,0x40,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x80,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x40,0x40,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0xF,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x1,0x1,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x22,0x22,0x22,0x22,0x22,0x22,0x0,0x0,0x0,
|
||||
0x02,0x17,0x41,0xB0,0x32,0x28,
|
||||
};
|
||||
|
||||
// waveform partial refresh(quality)
|
||||
// unsigned char WF_PARTIAL_1IN54_1[159] =
|
||||
// {
|
||||
// 0x0,0x00,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
// 0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
// 0x40,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
// 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
// 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
// 0xA,0x0,0x0,0x0,0x0,0x0,0x1,
|
||||
// 0x1,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
// 0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
// 0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
// 0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
// 0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
// 0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
// 0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
// 0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
// 0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
// 0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
// 0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
// 0x22,0x22,0x22,0x22,0x22,0x22,0x0,0x0,0x0,
|
||||
// 0x22,0x17,0x41,0x0,0x32,0x20,
|
||||
// };
|
||||
|
||||
Epd::~Epd()
|
||||
{
|
||||
};
|
||||
|
|
@ -73,6 +146,33 @@ void Epd::WaitUntilIdle(void)
|
|||
DelayMs(200);
|
||||
}
|
||||
|
||||
void Epd::Lut(unsigned char* lut)
|
||||
{
|
||||
SendCommand(0x32);
|
||||
for(unsigned char i=0; i<153; i++)
|
||||
SendData(lut[i]);
|
||||
WaitUntilIdle();
|
||||
}
|
||||
|
||||
void Epd::SetLut(unsigned char* lut)
|
||||
{
|
||||
Lut(lut);
|
||||
|
||||
SendCommand(0x3f);
|
||||
SendData(lut[153]);
|
||||
|
||||
SendCommand(0x03);
|
||||
SendData(lut[154]);
|
||||
|
||||
SendCommand(0x04);
|
||||
SendData(lut[155]);
|
||||
SendData(lut[156]);
|
||||
SendData(lut[157]);
|
||||
|
||||
SendCommand(0x2c);
|
||||
SendData(lut[158]);
|
||||
}
|
||||
|
||||
// High Direction
|
||||
int Epd::HDirInit(void)
|
||||
{
|
||||
|
|
@ -121,6 +221,8 @@ int Epd::HDirInit(void)
|
|||
SendData(0xC7);
|
||||
SendData(0x00);
|
||||
WaitUntilIdle();
|
||||
|
||||
SetLut(WF_Full_1IN54);
|
||||
/* EPD hardware init end */
|
||||
|
||||
return 0;
|
||||
|
|
@ -151,12 +253,12 @@ int Epd::LDirInit(void)
|
|||
SendCommand(0x44);
|
||||
/* x point must be the multiple of 8 or the last 3 bits will be ignored */
|
||||
SendData((0 >> 3) & 0xFF);
|
||||
SendData((200 >> 3) & 0xFF);
|
||||
SendData((199 >> 3) & 0xFF);
|
||||
SendCommand(0x45);
|
||||
SendData(0 & 0xFF);
|
||||
SendData((0 >> 8) & 0xFF);
|
||||
SendData(200 & 0xFF);
|
||||
SendData((200 >> 8) & 0xFF);
|
||||
SendData(199 & 0xFF);
|
||||
SendData((199 >> 8) & 0xFF);
|
||||
|
||||
SendCommand(0x3C); //BorderWavefrom
|
||||
SendData(0x01);
|
||||
|
|
@ -174,6 +276,8 @@ int Epd::LDirInit(void)
|
|||
SendData(0xC7);
|
||||
SendData(0x00);
|
||||
WaitUntilIdle();
|
||||
|
||||
SetLut(WF_Full_1IN54);
|
||||
/* EPD hardware init end */
|
||||
|
||||
return 0;
|
||||
|
|
@ -188,11 +292,11 @@ int Epd::LDirInit(void)
|
|||
void Epd::Reset(void)
|
||||
{
|
||||
DigitalWrite(reset_pin, HIGH);
|
||||
DelayMs(200);
|
||||
DelayMs(20);
|
||||
DigitalWrite(reset_pin, LOW); //module reset
|
||||
DelayMs(10);
|
||||
DelayMs(5);
|
||||
DigitalWrite(reset_pin, HIGH);
|
||||
DelayMs(200);
|
||||
DelayMs(20);
|
||||
}
|
||||
|
||||
void Epd::Clear(void)
|
||||
|
|
@ -207,6 +311,12 @@ void Epd::Clear(void)
|
|||
SendData(0xff);
|
||||
}
|
||||
}
|
||||
SendCommand(0x26);
|
||||
for (int j = 0; j < h; j++) {
|
||||
for (int i = 0; i < w; i++) {
|
||||
SendData(0xff);
|
||||
}
|
||||
}
|
||||
//DISPLAY REFRESH
|
||||
DisplayFrame();
|
||||
}
|
||||
|
|
@ -339,7 +449,7 @@ void Epd::DisplayFrame(void)
|
|||
{
|
||||
//DISPLAY REFRESH
|
||||
SendCommand(0x22);
|
||||
SendData(0xF7);
|
||||
SendData(0xc7);
|
||||
SendCommand(0x20);
|
||||
WaitUntilIdle();
|
||||
}
|
||||
|
|
@ -347,7 +457,7 @@ void Epd::DisplayFrame(void)
|
|||
void Epd::DisplayPartFrame(void)
|
||||
{
|
||||
SendCommand(0x22);
|
||||
SendData(0xFF);
|
||||
SendData(0xcF);
|
||||
SendCommand(0x20);
|
||||
WaitUntilIdle();
|
||||
}
|
||||
|
|
@ -365,9 +475,9 @@ void Epd::SetFrameMemory(
|
|||
int y_end;
|
||||
|
||||
DigitalWrite(reset_pin, LOW); //module reset
|
||||
DelayMs(10);
|
||||
DelayMs(2);
|
||||
DigitalWrite(reset_pin, HIGH);
|
||||
DelayMs(10);
|
||||
DelayMs(2);
|
||||
SendCommand(0x3c);
|
||||
SendData(0x80);
|
||||
|
||||
|
|
@ -402,6 +512,74 @@ void Epd::SetFrameMemory(
|
|||
}
|
||||
}
|
||||
|
||||
void Epd::SetFrameMemoryPartial(
|
||||
const unsigned char* image_buffer,
|
||||
int x,
|
||||
int y,
|
||||
int image_width,
|
||||
int image_height
|
||||
)
|
||||
{
|
||||
int x_end;
|
||||
int y_end;
|
||||
|
||||
DigitalWrite(reset_pin, LOW); //module reset
|
||||
DelayMs(2);
|
||||
DigitalWrite(reset_pin, HIGH);
|
||||
DelayMs(2);
|
||||
|
||||
SetLut(WF_PARTIAL_1IN54_0);
|
||||
SendCommand(0x37);
|
||||
SendData(0x00);
|
||||
SendData(0x00);
|
||||
SendData(0x00);
|
||||
SendData(0x00);
|
||||
SendData(0x00);
|
||||
SendData(0x40);
|
||||
SendData(0x00);
|
||||
SendData(0x00);
|
||||
SendData(0x00);
|
||||
SendData(0x00);
|
||||
|
||||
SendCommand(0x3c);
|
||||
SendData(0x80);
|
||||
|
||||
SendCommand(0x22);
|
||||
SendData(0xc0);
|
||||
SendCommand(0x20);
|
||||
WaitUntilIdle();
|
||||
|
||||
if (
|
||||
image_buffer == NULL ||
|
||||
x < 0 || image_width < 0 ||
|
||||
y < 0 || image_height < 0
|
||||
) {
|
||||
return;
|
||||
}
|
||||
/* x point must be the multiple of 8 or the last 3 bits will be ignored */
|
||||
x &= 0xF8;
|
||||
image_width &= 0xF8;
|
||||
if (x + image_width >= this->width) {
|
||||
x_end = this->width - 1;
|
||||
} else {
|
||||
x_end = x + image_width - 1;
|
||||
}
|
||||
if (y + image_height >= this->height) {
|
||||
y_end = this->height - 1;
|
||||
} else {
|
||||
y_end = y + image_height - 1;
|
||||
}
|
||||
SetMemoryArea(x, y, x_end, y_end);
|
||||
SetMemoryPointer(x, y);
|
||||
SendCommand(0x24);
|
||||
/* send the image data */
|
||||
for (int j = 0; j < y_end - y + 1; j++) {
|
||||
for (int i = 0; i < (x_end - x + 1) / 8; i++) {
|
||||
SendData(image_buffer[i + j * (image_width / 8)]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief: After this command is transmitted, the chip would enter the
|
||||
* deep-sleep mode to save power.
|
||||
|
|
|
|||
|
|
@ -64,6 +64,13 @@ public:
|
|||
int image_width,
|
||||
int image_height
|
||||
);
|
||||
void SetFrameMemoryPartial(
|
||||
const unsigned char* image_buffer,
|
||||
int x,
|
||||
int y,
|
||||
int image_width,
|
||||
int image_height
|
||||
);
|
||||
void DisplayFrame(void);
|
||||
void DisplayPartFrame(void);
|
||||
|
||||
|
|
@ -74,6 +81,8 @@ private:
|
|||
unsigned int cs_pin;
|
||||
unsigned int busy_pin;
|
||||
|
||||
void Lut(unsigned char* lut);
|
||||
void SetLut(unsigned char* lut);
|
||||
void SetMemoryArea(int x_start, int y_start, int x_end, int y_end);
|
||||
void SetMemoryPointer(int x, int y);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ void setup()
|
|||
|
||||
Serial.println("e-Paper show pic");
|
||||
epd.HDirInit();
|
||||
epd.Display(IMAGE_DATA);
|
||||
// epd.Display(IMAGE_DATA);
|
||||
|
||||
//Part display
|
||||
epd.HDirInit();
|
||||
|
|
@ -73,7 +73,7 @@ void setup()
|
|||
for (i = 0; i < 10; i++) {
|
||||
paint.Clear(UNCOLORED);
|
||||
paint.DrawStringAt(10, 10, str[i], &Font24, COLORED);
|
||||
epd.SetFrameMemory(paint.GetImage(), 80, 70, paint.GetWidth(), paint.GetHeight());
|
||||
epd.SetFrameMemoryPartial(paint.GetImage(), 80, 70, paint.GetWidth(), paint.GetHeight());
|
||||
epd.DisplayPartFrame();
|
||||
delay(100);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
#include <stdlib.h>
|
||||
#include "epd2in9_V2.h"
|
||||
|
||||
unsigned char WF_PARTIAL_2IN9[159] =
|
||||
unsigned char _WF_PARTIAL_2IN9[159] =
|
||||
{
|
||||
0x0,0x40,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x80,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
|
|
@ -50,6 +50,29 @@ unsigned char WF_PARTIAL_2IN9[159] =
|
|||
0x22,0x17,0x41,0xB0,0x32,0x36,
|
||||
};
|
||||
|
||||
unsigned char WS_20_30[159] =
|
||||
{
|
||||
0x80, 0x66, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x40, 0x0, 0x0, 0x0,
|
||||
0x10, 0x66, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x20, 0x0, 0x0, 0x0,
|
||||
0x80, 0x66, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x40, 0x0, 0x0, 0x0,
|
||||
0x10, 0x66, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x20, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x14, 0x8, 0x0, 0x0, 0x0, 0x0, 0x1,
|
||||
0xA, 0xA, 0x0, 0xA, 0xA, 0x0, 0x1,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x14, 0x8, 0x0, 0x1, 0x0, 0x0, 0x1,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x0, 0x0, 0x0,
|
||||
0x22, 0x17, 0x41, 0x0, 0x32, 0x36
|
||||
};
|
||||
|
||||
Epd::~Epd() {
|
||||
};
|
||||
|
||||
|
|
@ -91,6 +114,8 @@ int Epd::Init() {
|
|||
|
||||
SetMemoryPointer(0, 0);
|
||||
WaitUntilIdle();
|
||||
|
||||
SetLut_by_host(WS_20_30);
|
||||
/* EPD hardware init end */
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -122,9 +147,9 @@ void Epd::WaitUntilIdle(void) {
|
|||
while(1) { //=1 BUSY
|
||||
if(DigitalRead(busy_pin)==LOW)
|
||||
break;
|
||||
DelayMs(50);
|
||||
DelayMs(5);
|
||||
}
|
||||
DelayMs(50);
|
||||
DelayMs(5);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -134,11 +159,11 @@ void Epd::WaitUntilIdle(void) {
|
|||
*/
|
||||
void Epd::Reset(void) {
|
||||
DigitalWrite(reset_pin, HIGH);
|
||||
DelayMs(200);
|
||||
DelayMs(20);
|
||||
DigitalWrite(reset_pin, LOW); //module reset
|
||||
DelayMs(5);
|
||||
DigitalWrite(reset_pin, HIGH);
|
||||
DelayMs(200);
|
||||
DelayMs(20);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -217,11 +242,11 @@ void Epd::SetFrameMemory_Partial(
|
|||
}
|
||||
|
||||
DigitalWrite(reset_pin, LOW);
|
||||
DelayMs(5);
|
||||
DelayMs(2);
|
||||
DigitalWrite(reset_pin, HIGH);
|
||||
DelayMs(10);
|
||||
DelayMs(2);
|
||||
|
||||
SetLut();
|
||||
SetLut(_WF_PARTIAL_2IN9);
|
||||
SendCommand(0x37);
|
||||
SendData(0x00);
|
||||
SendData(0x00);
|
||||
|
|
@ -317,7 +342,7 @@ void Epd::ClearFrameMemory(unsigned char color) {
|
|||
*/
|
||||
void Epd::DisplayFrame(void) {
|
||||
SendCommand(0x22);
|
||||
SendData(0xF7);
|
||||
SendData(0xc7);
|
||||
SendCommand(0x20);
|
||||
WaitUntilIdle();
|
||||
}
|
||||
|
|
@ -329,14 +354,28 @@ void Epd::DisplayFrame_Partial(void) {
|
|||
WaitUntilIdle();
|
||||
}
|
||||
|
||||
void Epd::SetLut(void) {
|
||||
void Epd::SetLut(unsigned char *lut) {
|
||||
unsigned char count;
|
||||
SendCommand(0x32);
|
||||
for(count=0; count<153; count++)
|
||||
SendData(WF_PARTIAL_2IN9[count]);
|
||||
SendData(lut[count]);
|
||||
WaitUntilIdle();
|
||||
}
|
||||
|
||||
void Epd::SetLut_by_host(unsigned char *lut) {
|
||||
SetLut((unsigned char *)lut);
|
||||
SendCommand(0x3f);
|
||||
SendData(*(lut+153));
|
||||
SendCommand(0x03); // gate voltage
|
||||
SendData(*(lut+154));
|
||||
SendCommand(0x04); // source voltage
|
||||
SendData(*(lut+155)); // VSH
|
||||
SendData(*(lut+156)); // VSH2
|
||||
SendData(*(lut+157)); // VSL
|
||||
SendCommand(0x2c); // VCOM
|
||||
SendData(*(lut+158));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief: private function to specify the memory area for data R/W
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -72,7 +72,8 @@ private:
|
|||
unsigned int cs_pin;
|
||||
unsigned int busy_pin;
|
||||
|
||||
void SetLut(void);
|
||||
void SetLut(unsigned char *lut);
|
||||
void SetLut_by_host(unsigned char *lut);
|
||||
void SetMemoryArea(int x_start, int y_start, int x_end, int y_end);
|
||||
void SetMemoryPointer(int x, int y);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -27,6 +27,60 @@
|
|||
#include <stdlib.h>
|
||||
#include "epd7in5_V2.h"
|
||||
|
||||
unsigned char Voltage_Frame_7IN5_V2[]={
|
||||
0x6, 0x3F, 0x3F, 0x11, 0x24, 0x7, 0x17,
|
||||
};
|
||||
|
||||
unsigned char LUT_VCOM_7IN5_V2[]={
|
||||
0x0, 0xF, 0xF, 0x0, 0x0, 0x1,
|
||||
0x0, 0xF, 0x1, 0xF, 0x1, 0x2,
|
||||
0x0, 0xF, 0xF, 0x0, 0x0, 0x1,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
};
|
||||
|
||||
unsigned char LUT_WW_7IN5_V2[]={
|
||||
0x10, 0xF, 0xF, 0x0, 0x0, 0x1,
|
||||
0x84, 0xF, 0x1, 0xF, 0x1, 0x2,
|
||||
0x20, 0xF, 0xF, 0x0, 0x0, 0x1,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
};
|
||||
|
||||
unsigned char LUT_BW_7IN5_V2[]={
|
||||
0x10, 0xF, 0xF, 0x0, 0x0, 0x1,
|
||||
0x84, 0xF, 0x1, 0xF, 0x1, 0x2,
|
||||
0x20, 0xF, 0xF, 0x0, 0x0, 0x1,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
};
|
||||
|
||||
unsigned char LUT_WB_7IN5_V2[]={
|
||||
0x80, 0xF, 0xF, 0x0, 0x0, 0x1,
|
||||
0x84, 0xF, 0x1, 0xF, 0x1, 0x2,
|
||||
0x40, 0xF, 0xF, 0x0, 0x0, 0x1,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
};
|
||||
|
||||
unsigned char LUT_BB_7IN5_V2[]={
|
||||
0x80, 0xF, 0xF, 0x0, 0x0, 0x1,
|
||||
0x84, 0xF, 0x1, 0xF, 0x1, 0x2,
|
||||
0x40, 0xF, 0xF, 0x0, 0x0, 0x1,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
};
|
||||
|
||||
Epd::~Epd() {
|
||||
};
|
||||
|
||||
|
|
@ -45,18 +99,60 @@ int Epd::Init(void) {
|
|||
}
|
||||
Reset();
|
||||
|
||||
SendCommand(0x01);
|
||||
SendData(0x07);
|
||||
SendData(0x07);
|
||||
SendData(0x3f);
|
||||
SendData(0x3f);
|
||||
// SendCommand(0x01);
|
||||
// SendData(0x07);
|
||||
// SendData(0x07);
|
||||
// SendData(0x3f);
|
||||
// SendData(0x3f);
|
||||
|
||||
SendCommand(0x04);
|
||||
// SendCommand(0x04);
|
||||
// DelayMs(100);
|
||||
// WaitUntilIdle();
|
||||
|
||||
// SendCommand(0X00); //PANNEL SETTING
|
||||
// SendData(0x1F); //KW-3f KWR-2F BWROTP 0f BWOTP 1f
|
||||
|
||||
// SendCommand(0x61); //tres
|
||||
// SendData(0x03); //source 800
|
||||
// SendData(0x20);
|
||||
// SendData(0x01); //gate 480
|
||||
// SendData(0xE0);
|
||||
|
||||
// SendCommand(0X15);
|
||||
// SendData(0x00);
|
||||
|
||||
// SendCommand(0X50); //VCOM AND DATA INTERVAL SETTING
|
||||
// SendData(0x10);
|
||||
// SendData(0x07);
|
||||
|
||||
// SendCommand(0X60); //TCON SETTING
|
||||
// SendData(0x22);
|
||||
|
||||
SendCommand(0x01); // power setting
|
||||
SendData(0x17); // 1-0=11: internal power
|
||||
SendData(*(Voltage_Frame_7IN5_V2+6)); // VGH&VGL
|
||||
SendData(*(Voltage_Frame_7IN5_V2+1)); // VSH
|
||||
SendData(*(Voltage_Frame_7IN5_V2+2)); // VSL
|
||||
SendData(*(Voltage_Frame_7IN5_V2+3)); // VSHR
|
||||
|
||||
SendCommand(0x82); // VCOM DC Setting
|
||||
SendData(*(Voltage_Frame_7IN5_V2+4)); // VCOM
|
||||
|
||||
SendCommand(0x06); // Booster Setting
|
||||
SendData(0x27);
|
||||
SendData(0x27);
|
||||
SendData(0x2F);
|
||||
SendData(0x17);
|
||||
|
||||
SendCommand(0x30); // OSC Setting
|
||||
SendData(*(Voltage_Frame_7IN5_V2+0)); // 2-0=100: N=4 ; 5-3=111: M=7 ; 3C=50Hz 3A=100HZ
|
||||
|
||||
SendCommand(0x04); //POWER ON
|
||||
DelayMs(100);
|
||||
WaitUntilIdle();
|
||||
|
||||
|
||||
SendCommand(0X00); //PANNEL SETTING
|
||||
SendData(0x1F); //KW-3f KWR-2F BWROTP 0f BWOTP 1f
|
||||
SendData(0x3F); //KW-3f KWR-2F BWROTP 0f BWOTP 1f
|
||||
|
||||
SendCommand(0x61); //tres
|
||||
SendData(0x03); //source 800
|
||||
|
|
@ -69,11 +165,19 @@ int Epd::Init(void) {
|
|||
|
||||
SendCommand(0X50); //VCOM AND DATA INTERVAL SETTING
|
||||
SendData(0x10);
|
||||
SendData(0x07);
|
||||
SendData(0x00);
|
||||
|
||||
SendCommand(0X60); //TCON SETTING
|
||||
SendData(0x22);
|
||||
|
||||
SendCommand(0x65); // Resolution setting
|
||||
SendData(0x00);
|
||||
SendData(0x00);//800*480
|
||||
SendData(0x00);
|
||||
SendData(0x00);
|
||||
|
||||
SetLut_by_host(LUT_VCOM_7IN5_V2, LUT_WW_7IN5_V2, LUT_BW_7IN5_V2, LUT_WB_7IN5_V2, LUT_BB_7IN5_V2);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -98,11 +202,13 @@ void Epd::SendData(unsigned char data) {
|
|||
*/
|
||||
void Epd::WaitUntilIdle(void) {
|
||||
unsigned char busy;
|
||||
Serial.print("e-Paper Busy\r\n ");
|
||||
do{
|
||||
SendCommand(0x71);
|
||||
busy = DigitalRead(busy_pin);
|
||||
}while(busy == 0);
|
||||
DelayMs(200);
|
||||
Serial.print("e-Paper Busy Release\r\n ");
|
||||
DelayMs(20);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -111,10 +217,12 @@ void Epd::WaitUntilIdle(void) {
|
|||
* see Epd::Sleep();
|
||||
*/
|
||||
void Epd::Reset(void) {
|
||||
DigitalWrite(reset_pin, HIGH);
|
||||
DelayMs(20);
|
||||
DigitalWrite(reset_pin, LOW); //module reset
|
||||
DelayMs(4);
|
||||
DigitalWrite(reset_pin, HIGH);
|
||||
DelayMs(200);
|
||||
DelayMs(20);
|
||||
}
|
||||
|
||||
void Epd::DisplayFrame(const unsigned char* frame_buffer) {
|
||||
|
|
@ -148,8 +256,33 @@ void Epd::Displaypart(const unsigned char* pbuffer, unsigned long xStart, unsign
|
|||
SendCommand(0x12);
|
||||
DelayMs(100);
|
||||
WaitUntilIdle();
|
||||
|
||||
}
|
||||
|
||||
void Epd::SetLut_by_host(unsigned char* lut_vcom, unsigned char* lut_ww, unsigned char* lut_bw, unsigned char* lut_wb, unsigned char* lut_bb)
|
||||
{
|
||||
unsigned char count;
|
||||
|
||||
SendCommand(0x20); //VCOM
|
||||
for(count=0; count<60; count++)
|
||||
SendData(lut_vcom[count]);
|
||||
|
||||
SendCommand(0x21); //LUTBW
|
||||
for(count=0; count<60; count++)
|
||||
SendData(lut_ww[count]);
|
||||
|
||||
SendCommand(0x22); //LUTBW
|
||||
for(count=0; count<60; count++)
|
||||
SendData(lut_bw[count]);
|
||||
|
||||
SendCommand(0x23); //LUTWB
|
||||
for(count=0; count<60; count++)
|
||||
SendData(lut_wb[count]);
|
||||
|
||||
SendCommand(0x24); //LUTBB
|
||||
for(count=0; count<60; count++)
|
||||
SendData(lut_bb[count]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief: After this command is transmitted, the chip would enter the
|
||||
* deep-sleep mode to save power.
|
||||
|
|
@ -167,10 +300,10 @@ void Epd::Sleep(void) {
|
|||
|
||||
void Epd::Clear(void) {
|
||||
|
||||
SendCommand(0x10);
|
||||
for(unsigned long i=0; i<height*width; i++) {
|
||||
SendData(0x00);
|
||||
}
|
||||
// SendCommand(0x10);
|
||||
// for(unsigned long i=0; i<height*width; i++) {
|
||||
// SendData(0x00);
|
||||
// }
|
||||
SendCommand(0x13);
|
||||
for(unsigned long i=0; i<height*width; i++) {
|
||||
SendData(0x00);
|
||||
|
|
|
|||
|
|
@ -55,6 +55,9 @@ private:
|
|||
unsigned int busy_pin;
|
||||
unsigned long width;
|
||||
unsigned long height;
|
||||
|
||||
void SetLut(unsigned char *lut);
|
||||
void SetLut_by_host(unsigned char *lut_vcom, unsigned char *lut_ww, unsigned char *lut_bw, unsigned char *lut_wb, unsigned char *lut_bb);
|
||||
};
|
||||
|
||||
#endif /* EPD7IN5_H */
|
||||
|
|
|
|||
|
|
@ -30,17 +30,21 @@
|
|||
|
||||
void setup() {
|
||||
// put your setup code here, to run once:
|
||||
Serial.begin(9600);
|
||||
Serial.begin(115200);
|
||||
Epd epd;
|
||||
Serial.print("e-Paper init \r\n ");
|
||||
if (epd.Init() != 0) {
|
||||
Serial.print("e-Paper init failed\r\n ");
|
||||
return;
|
||||
}
|
||||
|
||||
Serial.print("e-Paper Display\r\n ");
|
||||
epd.Displaypart(IMAGE_DATA,250, 200,240,103);
|
||||
|
||||
Serial.print("e-Paper Clear\r\n ");
|
||||
epd.Clear();
|
||||
|
||||
epd.Displaypart(IMAGE_DATA,250, 200,240,103);
|
||||
|
||||
epd.Sleep();
|
||||
}
|
||||
|
||||
void loop() {
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ JETSON_DEV_C = $(wildcard $(DIR_BIN)/sysfs_software_spi.o $(DIR_BIN)/sysfs_gpio.
|
|||
DEBUG = -D DEBUG
|
||||
|
||||
USELIB_RPI = USE_BCM2835_LIB
|
||||
# USELIB_RPI = USE_WIRINGPI_LIB
|
||||
#USELIB_RPI = USE_WIRINGPI_LIB
|
||||
# USELIB_RPI = USE_DEV_LIB
|
||||
|
||||
LIB_RPI=-Wl,--gc-sections
|
||||
|
|
|
|||
|
|
@ -114,23 +114,24 @@ int EPD_1in54_V2_test(void)
|
|||
Paint_DrawString_CN(5, 155, "΢ѩµç×Ó", &Font24CN, WHITE, BLACK);
|
||||
|
||||
EPD_1IN54_V2_Display(BlackImage);
|
||||
|
||||
DEV_Delay_ms(2000);
|
||||
#endif
|
||||
|
||||
#if 1 //Partial refresh, example shows time
|
||||
|
||||
// The image of the previous frame must be uploaded, otherwise the
|
||||
// first few seconds will display an exception.
|
||||
EPD_1IN54_V2_Init();
|
||||
EPD_1IN54_V2_DisplayPartBaseImage(BlackImage);
|
||||
|
||||
EPD_1IN54_V2_DisplayPartBaseImage(BlackImage);
|
||||
|
||||
// enter partial mode
|
||||
EPD_1IN54_V2_Init_Partial();
|
||||
printf("Partial refresh\r\n");
|
||||
Paint_SelectImage(BlackImage);
|
||||
PAINT_TIME sPaint_time;
|
||||
sPaint_time.Hour = 12;
|
||||
sPaint_time.Min = 34;
|
||||
sPaint_time.Sec = 56;
|
||||
UBYTE num = 20;
|
||||
UBYTE num = 15;
|
||||
for (;;) {
|
||||
sPaint_time.Sec = sPaint_time.Sec + 1;
|
||||
if (sPaint_time.Sec == 60) {
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@
|
|||
******************************************************************************/
|
||||
#include "EPD_Test.h"
|
||||
#include "EPD_2in7.h"
|
||||
#include <time.h>
|
||||
|
||||
int EPD_2in7_test(void)
|
||||
{
|
||||
|
|
@ -39,8 +40,12 @@ int EPD_2in7_test(void)
|
|||
|
||||
printf("e-Paper Init and Clear...\r\n");
|
||||
EPD_2IN7_Init();
|
||||
|
||||
struct timespec start={0,0}, finish={0,0};
|
||||
clock_gettime(CLOCK_REALTIME,&start);
|
||||
EPD_2IN7_Clear();
|
||||
DEV_Delay_ms(500);
|
||||
clock_gettime(CLOCK_REALTIME,&finish);
|
||||
printf("%ld S\r\n",finish.tv_sec-start.tv_sec);
|
||||
|
||||
//Create a new image cache
|
||||
UBYTE *BlackImage;
|
||||
|
|
|
|||
|
|
@ -91,26 +91,25 @@ int EPD_5in65f_test(void)
|
|||
Paint_DrawString_EN(10, 20, "hello world", &Font12, EPD_5IN65F_WHITE, EPD_5IN65F_BLACK);
|
||||
Paint_DrawNum(10, 33, 123456789, &Font12, EPD_5IN65F_BLACK, EPD_5IN65F_WHITE);
|
||||
Paint_DrawNum(10, 50, 987654321, &Font16, EPD_5IN65F_WHITE, EPD_5IN65F_BLACK);
|
||||
Paint_DrawString_CN(300, 0, "ÄãºÃabc", &Font12CN, EPD_5IN65F_BLACK, EPD_5IN65F_WHITE);
|
||||
Paint_DrawString_CN(300, 20, "ÄãºÃabc", &Font12CN, EPD_5IN65F_GREEN, EPD_5IN65F_WHITE);
|
||||
Paint_DrawString_CN(300, 40, "ÄãºÃabc", &Font12CN, EPD_5IN65F_BLUE, EPD_5IN65F_WHITE);
|
||||
Paint_DrawString_CN(300, 60, "ÄãºÃabc", &Font12CN, EPD_5IN65F_RED, EPD_5IN65F_WHITE);
|
||||
Paint_DrawString_CN(300, 80, "ÄãºÃabc", &Font12CN, EPD_5IN65F_YELLOW, EPD_5IN65F_WHITE);
|
||||
Paint_DrawString_CN(300, 100, "ÄãºÃabc", &Font12CN, EPD_5IN65F_ORANGE, EPD_5IN65F_WHITE);
|
||||
Paint_DrawString_CN(150, 0, "΢ѩµç×Ó", &Font24CN, EPD_5IN65F_WHITE, EPD_5IN65F_BLACK);
|
||||
Paint_DrawString_CN(150, 40, "΢ѩµç×Ó", &Font24CN, EPD_5IN65F_GREEN, EPD_5IN65F_BLACK);
|
||||
Paint_DrawString_CN(150, 80, "΢ѩµç×Ó", &Font24CN, EPD_5IN65F_BLUE, EPD_5IN65F_BLACK);
|
||||
Paint_DrawString_CN(150, 120, "΢ѩµç×Ó", &Font24CN, EPD_5IN65F_RED, EPD_5IN65F_BLACK);
|
||||
Paint_DrawString_CN(150, 160, "΢ѩµç×Ó", &Font24CN, EPD_5IN65F_YELLOW, EPD_5IN65F_BLACK);
|
||||
Paint_DrawString_CN(150, 200, "΢ѩµç×Ó", &Font24CN, EPD_5IN65F_ORANGE, EPD_5IN65F_BLACK);
|
||||
Paint_DrawString_CN(150, 240, "΢ѩµç×Ó", &Font24CN, EPD_5IN65F_BLACK, EPD_5IN65F_YELLOW);
|
||||
Paint_DrawString_CN(300, 0, "<EFBFBD><EFBFBD><EFBFBD>abc", &Font12CN, EPD_5IN65F_BLACK, EPD_5IN65F_WHITE);
|
||||
Paint_DrawString_CN(300, 20, "<EFBFBD><EFBFBD><EFBFBD>abc", &Font12CN, EPD_5IN65F_GREEN, EPD_5IN65F_WHITE);
|
||||
Paint_DrawString_CN(300, 40, "<EFBFBD><EFBFBD><EFBFBD>abc", &Font12CN, EPD_5IN65F_BLUE, EPD_5IN65F_WHITE);
|
||||
Paint_DrawString_CN(300, 60, "<EFBFBD><EFBFBD><EFBFBD>abc", &Font12CN, EPD_5IN65F_RED, EPD_5IN65F_WHITE);
|
||||
Paint_DrawString_CN(300, 80, "<EFBFBD><EFBFBD><EFBFBD>abc", &Font12CN, EPD_5IN65F_YELLOW, EPD_5IN65F_WHITE);
|
||||
Paint_DrawString_CN(300, 100, "<EFBFBD><EFBFBD><EFBFBD>abc", &Font12CN, EPD_5IN65F_ORANGE, EPD_5IN65F_WHITE);
|
||||
Paint_DrawString_CN(150, 0, "ѩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>", &Font24CN, EPD_5IN65F_WHITE, EPD_5IN65F_BLACK);
|
||||
Paint_DrawString_CN(150, 40, "ѩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>", &Font24CN, EPD_5IN65F_GREEN, EPD_5IN65F_BLACK);
|
||||
Paint_DrawString_CN(150, 80, "ѩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>", &Font24CN, EPD_5IN65F_BLUE, EPD_5IN65F_BLACK);
|
||||
Paint_DrawString_CN(150, 120, "ѩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>", &Font24CN, EPD_5IN65F_RED, EPD_5IN65F_BLACK);
|
||||
Paint_DrawString_CN(150, 160, "ѩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>", &Font24CN, EPD_5IN65F_YELLOW, EPD_5IN65F_BLACK);
|
||||
Paint_DrawString_CN(150, 200, "ѩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>", &Font24CN, EPD_5IN65F_ORANGE, EPD_5IN65F_BLACK);
|
||||
Paint_DrawString_CN(150, 240, "ѩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>", &Font24CN, EPD_5IN65F_BLACK, EPD_5IN65F_YELLOW);
|
||||
|
||||
EPD_5IN65F_Display(BlackImage);
|
||||
DEV_Delay_ms(4000);
|
||||
#endif
|
||||
printf("e-Paper Clear...\r\n");
|
||||
EPD_5IN65F_Clear(EPD_5IN65F_WHITE);
|
||||
EPD_5IN65F_Clear(EPD_5IN65F_WHITE);
|
||||
DEV_Delay_ms(1000);
|
||||
|
||||
printf("e-Paper Sleep...\r\n");
|
||||
|
|
|
|||
|
|
@ -30,14 +30,39 @@
|
|||
#include "EPD_1in54_V2.h"
|
||||
#include "Debug.h"
|
||||
|
||||
const unsigned char WF_PARTIAL_1IN54[159] =
|
||||
// waveform full refresh
|
||||
unsigned char WF_Full_1IN54[159] =
|
||||
{
|
||||
0x80, 0x48, 0x40, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x40, 0x48, 0x80, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x80, 0x48, 0x40, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x40, 0x48, 0x80, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0xA, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x8, 0x1, 0x0, 0x8, 0x1, 0x0, 0x2,
|
||||
0xA, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x0, 0x0, 0x0,
|
||||
0x22, 0x17, 0x41, 0x0, 0x32, 0x20
|
||||
};
|
||||
|
||||
// waveform partial refresh(fast)
|
||||
unsigned char WF_PARTIAL_1IN54_0[159] =
|
||||
{
|
||||
0x0,0x40,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x80,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x40,0x40,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0xF,0x0,0x0,0x0,0x0,0x0,0x1,
|
||||
0xF,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x1,0x1,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
|
|
@ -53,6 +78,30 @@ const unsigned char WF_PARTIAL_1IN54[159] =
|
|||
0x02,0x17,0x41,0xB0,0x32,0x28,
|
||||
};
|
||||
|
||||
// waveform partial refresh(quality)
|
||||
unsigned char WF_PARTIAL_1IN54_1[159] =
|
||||
{
|
||||
0x0,0x00,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x40,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0xA,0x0,0x0,0x0,0x0,0x0,0x1,
|
||||
0x1,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x22,0x22,0x22,0x22,0x22,0x22,0x0,0x0,0x0,
|
||||
0x22,0x17,0x41,0x0,0x32,0x20,
|
||||
};
|
||||
|
||||
/******************************************************************************
|
||||
function : Software reset
|
||||
parameter:
|
||||
|
|
@ -101,7 +150,7 @@ static void EPD_1IN54_V2_ReadBusy(void)
|
|||
{
|
||||
Debug("e-Paper busy\r\n");
|
||||
while(DEV_Digital_Read(EPD_BUSY_PIN) == 1) { //LOW: idle, HIGH: busy
|
||||
DEV_Delay_ms(10);
|
||||
DEV_Delay_ms(1);
|
||||
}
|
||||
Debug("e-Paper busy release\r\n");
|
||||
}
|
||||
|
|
@ -113,7 +162,7 @@ parameter:
|
|||
static void EPD_1IN54_V2_TurnOnDisplay(void)
|
||||
{
|
||||
EPD_1IN54_V2_SendCommand(0x22);
|
||||
EPD_1IN54_V2_SendData(0xF7);
|
||||
EPD_1IN54_V2_SendData(0xc7);
|
||||
EPD_1IN54_V2_SendCommand(0x20);
|
||||
EPD_1IN54_V2_ReadBusy();
|
||||
}
|
||||
|
|
@ -125,19 +174,38 @@ parameter:
|
|||
static void EPD_1IN54_V2_TurnOnDisplayPart(void)
|
||||
{
|
||||
EPD_1IN54_V2_SendCommand(0x22);
|
||||
EPD_1IN54_V2_SendData(0xFF);
|
||||
EPD_1IN54_V2_SendData(0xcF);
|
||||
EPD_1IN54_V2_SendCommand(0x20);
|
||||
EPD_1IN54_V2_ReadBusy();
|
||||
}
|
||||
|
||||
static void EPD_1IN54_V2_SetLut(void)
|
||||
static void EPD_1IN54_V2_Lut(UBYTE *lut)
|
||||
{
|
||||
EPD_1IN54_V2_SendCommand(0x32);
|
||||
for(UBYTE i=0; i<153; i++)
|
||||
EPD_1IN54_V2_SendData(WF_PARTIAL_1IN54[i]);
|
||||
EPD_1IN54_V2_SendData(lut[i]);
|
||||
EPD_1IN54_V2_ReadBusy();
|
||||
}
|
||||
|
||||
static void EPD_1IN54_V2_SetLut(UBYTE *lut)
|
||||
{
|
||||
EPD_1IN54_V2_Lut(lut);
|
||||
|
||||
EPD_1IN54_V2_SendCommand(0x3f);
|
||||
EPD_1IN54_V2_SendData(lut[153]);
|
||||
|
||||
EPD_1IN54_V2_SendCommand(0x03);
|
||||
EPD_1IN54_V2_SendData(lut[154]);
|
||||
|
||||
EPD_1IN54_V2_SendCommand(0x04);
|
||||
EPD_1IN54_V2_SendData(lut[155]);
|
||||
EPD_1IN54_V2_SendData(lut[156]);
|
||||
EPD_1IN54_V2_SendData(lut[157]);
|
||||
|
||||
EPD_1IN54_V2_SendCommand(0x2c);
|
||||
EPD_1IN54_V2_SendData(lut[158]);
|
||||
}
|
||||
|
||||
static void EPD_1IN54_V2_SetWindows(UWORD Xstart, UWORD Ystart, UWORD Xend, UWORD Yend)
|
||||
{
|
||||
EPD_1IN54_V2_SendCommand(0x44); // SET_RAM_X_ADDRESS_START_END_POSITION
|
||||
|
|
@ -181,15 +249,6 @@ void EPD_1IN54_V2_Init(void)
|
|||
EPD_1IN54_V2_SendCommand(0x11); //data entry mode
|
||||
EPD_1IN54_V2_SendData(0x01);
|
||||
|
||||
// EPD_1IN54_V2_SendCommand(0x44); //set Ram-X address start/end position
|
||||
// EPD_1IN54_V2_SendData(0x00);
|
||||
// EPD_1IN54_V2_SendData(0x18); //0x0C-->(18+1)*8=200
|
||||
|
||||
// EPD_1IN54_V2_SendCommand(0x45); //set Ram-Y address start/end position
|
||||
// EPD_1IN54_V2_SendData(0xC7); //0xC7-->(199+1)=200
|
||||
// EPD_1IN54_V2_SendData(0x00);
|
||||
// EPD_1IN54_V2_SendData(0x00);
|
||||
// EPD_1IN54_V2_SendData(0x00);
|
||||
EPD_1IN54_V2_SetWindows(0, EPD_1IN54_V2_HEIGHT-1, EPD_1IN54_V2_WIDTH-1, 0);
|
||||
|
||||
EPD_1IN54_V2_SendCommand(0x3C); //BorderWavefrom
|
||||
|
|
@ -202,13 +261,41 @@ void EPD_1IN54_V2_Init(void)
|
|||
EPD_1IN54_V2_SendData(0XB1);
|
||||
EPD_1IN54_V2_SendCommand(0x20);
|
||||
|
||||
// EPD_1IN54_V2_SendCommand(0x4E); // set RAM x address count to 0;
|
||||
// EPD_1IN54_V2_SendData(0x00);
|
||||
// EPD_1IN54_V2_SendCommand(0x4F); // set RAM y address count to 0X199;
|
||||
// EPD_1IN54_V2_SendData(0xC7);
|
||||
// EPD_1IN54_V2_SendData(0x00);
|
||||
EPD_1IN54_V2_SetCursor(0, EPD_1IN54_V2_HEIGHT-1);
|
||||
EPD_1IN54_V2_ReadBusy();
|
||||
|
||||
EPD_1IN54_V2_SetLut(WF_Full_1IN54);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
function : Initialize the e-Paper register (Partial display)
|
||||
parameter:
|
||||
******************************************************************************/
|
||||
void EPD_1IN54_V2_Init_Partial(void)
|
||||
{
|
||||
EPD_1IN54_V2_Reset();
|
||||
EPD_1IN54_V2_ReadBusy();
|
||||
|
||||
EPD_1IN54_V2_SetLut(WF_PARTIAL_1IN54_1);
|
||||
EPD_1IN54_V2_SendCommand(0x37);
|
||||
EPD_1IN54_V2_SendData(0x00);
|
||||
EPD_1IN54_V2_SendData(0x00);
|
||||
EPD_1IN54_V2_SendData(0x00);
|
||||
EPD_1IN54_V2_SendData(0x00);
|
||||
EPD_1IN54_V2_SendData(0x00);
|
||||
EPD_1IN54_V2_SendData(0x40);
|
||||
EPD_1IN54_V2_SendData(0x00);
|
||||
EPD_1IN54_V2_SendData(0x00);
|
||||
EPD_1IN54_V2_SendData(0x00);
|
||||
EPD_1IN54_V2_SendData(0x00);
|
||||
|
||||
EPD_1IN54_V2_SendCommand(0x3C); //BorderWavefrom
|
||||
EPD_1IN54_V2_SendData(0x80);
|
||||
|
||||
EPD_1IN54_V2_SendCommand(0x22);
|
||||
EPD_1IN54_V2_SendData(0xc0);
|
||||
EPD_1IN54_V2_SendCommand(0x20);
|
||||
EPD_1IN54_V2_ReadBusy();
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
|
|
@ -283,7 +370,7 @@ void EPD_1IN54_V2_DisplayPartBaseImage(UBYTE *Image)
|
|||
EPD_1IN54_V2_SendData(Image[Addr]);
|
||||
}
|
||||
}
|
||||
EPD_1IN54_V2_TurnOnDisplayPart();
|
||||
EPD_1IN54_V2_TurnOnDisplay();
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
|
|
@ -295,27 +382,6 @@ void EPD_1IN54_V2_DisplayPart(UBYTE *Image)
|
|||
UWORD Width, Height;
|
||||
Width = (EPD_1IN54_V2_WIDTH % 8 == 0)? (EPD_1IN54_V2_WIDTH / 8 ): (EPD_1IN54_V2_WIDTH / 8 + 1);
|
||||
Height = EPD_1IN54_V2_HEIGHT;
|
||||
|
||||
DEV_Digital_Write(EPD_RST_PIN, 0);
|
||||
DEV_Delay_ms(2);
|
||||
DEV_Digital_Write(EPD_RST_PIN, 1);
|
||||
DEV_Delay_ms(5);
|
||||
|
||||
EPD_1IN54_V2_SetLut();
|
||||
EPD_1IN54_V2_SendCommand(0x37);
|
||||
EPD_1IN54_V2_SendData(0x00);
|
||||
EPD_1IN54_V2_SendData(0x00);
|
||||
EPD_1IN54_V2_SendData(0x00);
|
||||
EPD_1IN54_V2_SendData(0x00);
|
||||
EPD_1IN54_V2_SendData(0x00);
|
||||
EPD_1IN54_V2_SendData(0x40);
|
||||
EPD_1IN54_V2_SendData(0x00);
|
||||
EPD_1IN54_V2_SendData(0x00);
|
||||
EPD_1IN54_V2_SendData(0x00);
|
||||
EPD_1IN54_V2_SendData(0x00);
|
||||
|
||||
EPD_1IN54_V2_SendCommand(0x3C); //BorderWavefrom
|
||||
EPD_1IN54_V2_SendData(0x80);
|
||||
|
||||
UDOUBLE Addr = 0;
|
||||
EPD_1IN54_V2_SendCommand(0x24);
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@
|
|||
#define EPD_1IN54_V2_HEIGHT 200
|
||||
|
||||
void EPD_1IN54_V2_Init(void);
|
||||
void EPD_1IN54_V2_Init_Partial(void);
|
||||
void EPD_1IN54_V2_Clear(void);
|
||||
void EPD_1IN54_V2_Display(UBYTE *Image);
|
||||
void EPD_1IN54_V2_DisplayPartBaseImage(UBYTE *Image);
|
||||
|
|
|
|||
|
|
@ -31,6 +31,52 @@
|
|||
#include "EPD_2in13_V3.h"
|
||||
#include "Debug.h"
|
||||
|
||||
UBYTE WF_PARTIAL_2IN13_V2[159] =
|
||||
{
|
||||
0x0,0x40,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x80,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x40,0x40,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x14,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x1,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x1,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x22,0x22,0x22,0x22,0x22,0x22,0x0,0x0,0x0,
|
||||
0x22,0x17,0x41,0x00,0x32,0x36,
|
||||
};
|
||||
|
||||
UBYTE WS_20_30_2IN13_V2[159] =
|
||||
{
|
||||
0x80, 0x4A, 0x40, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x40, 0x4A, 0x80, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x80, 0x4A, 0x40, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x40, 0x4A, 0x80, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0xF, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0xF, 0x0, 0x0, 0xF, 0x0, 0x0, 0x2,
|
||||
0xF, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x0, 0x0, 0x0,
|
||||
0x22, 0x17, 0x41, 0x0, 0x32, 0x36
|
||||
};
|
||||
|
||||
/******************************************************************************
|
||||
function : Software reset
|
||||
parameter:
|
||||
|
|
@ -95,7 +141,7 @@ parameter:
|
|||
static void EPD_2in13_V3_TurnOnDisplay(void)
|
||||
{
|
||||
EPD_2in13_V3_SendCommand(0x22); //Display Update Control
|
||||
EPD_2in13_V3_SendData(0xF7);
|
||||
EPD_2in13_V3_SendData(0xc7);
|
||||
EPD_2in13_V3_SendCommand(0x20); //Activate Display Update Sequence
|
||||
EPD_2in13_V3_ReadBusy();
|
||||
}
|
||||
|
|
@ -103,11 +149,36 @@ static void EPD_2in13_V3_TurnOnDisplay(void)
|
|||
static void EPD_2in13_V3_TurnOnDisplay_Partial(void)
|
||||
{
|
||||
EPD_2in13_V3_SendCommand(0x22); //Display Update Control
|
||||
EPD_2in13_V3_SendData(0xFF);
|
||||
EPD_2in13_V3_SendData(0x0f); // c0/ff
|
||||
EPD_2in13_V3_SendCommand(0x20); //Activate Display Update Sequence
|
||||
EPD_2in13_V3_ReadBusy();
|
||||
}
|
||||
|
||||
static void EPD_2IN13_V3_LUT(UBYTE *lut)
|
||||
{
|
||||
UBYTE count;
|
||||
EPD_2in13_V3_SendCommand(0x32);
|
||||
for(count=0; count<153; count++)
|
||||
EPD_2in13_V3_SendData(lut[count]);
|
||||
EPD_2in13_V3_ReadBusy();
|
||||
}
|
||||
|
||||
static void EPD_2IN13_V2_LUT_by_host(UBYTE *lut)
|
||||
{
|
||||
EPD_2IN13_V3_LUT((UBYTE *)lut); //lut
|
||||
EPD_2in13_V3_SendCommand(0x3f);
|
||||
EPD_2in13_V3_SendData(*(lut+153));
|
||||
EPD_2in13_V3_SendCommand(0x03); // gate voltage
|
||||
EPD_2in13_V3_SendData(*(lut+154));
|
||||
EPD_2in13_V3_SendCommand(0x04); // source voltage
|
||||
EPD_2in13_V3_SendData(*(lut+155)); // VSH
|
||||
EPD_2in13_V3_SendData(*(lut+156)); // VSH2
|
||||
EPD_2in13_V3_SendData(*(lut+157)); // VSL
|
||||
EPD_2in13_V3_SendCommand(0x2c); // VCOM
|
||||
EPD_2in13_V3_SendData(*(lut+158));
|
||||
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
function : Setting the display window
|
||||
parameter:
|
||||
|
|
@ -178,6 +249,8 @@ void EPD_2in13_V3_Init(void)
|
|||
|
||||
EPD_2in13_V3_SetCursor(0, 0);
|
||||
EPD_2in13_V3_ReadBusy();
|
||||
|
||||
EPD_2IN13_V2_LUT_by_host(WS_20_30_2IN13_V2);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
|
|
@ -233,12 +306,31 @@ void EPD_2in13_V3_Display_Partial(UBYTE *Image)
|
|||
|
||||
//Reset
|
||||
DEV_Digital_Write(EPD_RST_PIN, 0);
|
||||
DEV_Delay_ms(5);
|
||||
DEV_Delay_ms(2);
|
||||
DEV_Digital_Write(EPD_RST_PIN, 1);
|
||||
DEV_Delay_ms(10);
|
||||
DEV_Delay_ms(3);
|
||||
|
||||
EPD_2IN13_V2_LUT_by_host(WF_PARTIAL_2IN13_V2);
|
||||
|
||||
EPD_2in13_V3_SendCommand(0x37);
|
||||
EPD_2in13_V3_SendData(0x00);
|
||||
EPD_2in13_V3_SendData(0x00);
|
||||
EPD_2in13_V3_SendData(0x00);
|
||||
EPD_2in13_V3_SendData(0x00);
|
||||
EPD_2in13_V3_SendData(0x00);
|
||||
EPD_2in13_V3_SendData(0x40); ///RAM Ping-Pong enable
|
||||
EPD_2in13_V3_SendData(0x00);
|
||||
EPD_2in13_V3_SendData(0x00);
|
||||
EPD_2in13_V3_SendData(0x00);
|
||||
EPD_2in13_V3_SendData(0x00);
|
||||
|
||||
EPD_2in13_V3_SendCommand(0x3C); //BorderWavefrom
|
||||
EPD_2in13_V3_SendData(0x80);
|
||||
|
||||
EPD_2in13_V3_SendCommand(0x22); //Display Update Sequence Option
|
||||
EPD_2in13_V3_SendData(0xC0); // Enable clock and Enable analog
|
||||
EPD_2in13_V3_SendCommand(0x20); //Activate Display Update Sequence
|
||||
EPD_2in13_V3_ReadBusy();
|
||||
|
||||
EPD_2in13_V3_SetWindows(0, 0, EPD_2in13_V3_WIDTH-1, 296-1);
|
||||
EPD_2in13_V3_SetCursor(0, 0);
|
||||
|
|
|
|||
|
|
@ -54,6 +54,29 @@ UBYTE _WF_PARTIAL_2IN9[159] =
|
|||
0x22,0x17,0x41,0xB0,0x32,0x36,
|
||||
};
|
||||
|
||||
UBYTE WS_20_30[159] =
|
||||
{
|
||||
0x80, 0x66, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x40, 0x0, 0x0, 0x0,
|
||||
0x10, 0x66, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x20, 0x0, 0x0, 0x0,
|
||||
0x80, 0x66, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x40, 0x0, 0x0, 0x0,
|
||||
0x10, 0x66, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x20, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x14, 0x8, 0x0, 0x0, 0x0, 0x0, 0x1,
|
||||
0xA, 0xA, 0x0, 0xA, 0xA, 0x0, 0x1,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x14, 0x8, 0x0, 0x1, 0x0, 0x0, 0x1,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x0, 0x0, 0x0,
|
||||
0x22, 0x17, 0x41, 0x0, 0x32, 0x36
|
||||
};
|
||||
|
||||
/******************************************************************************
|
||||
function : Software reset
|
||||
parameter:
|
||||
|
|
@ -61,11 +84,11 @@ parameter:
|
|||
static void EPD_2IN9_V2_Reset(void)
|
||||
{
|
||||
DEV_Digital_Write(EPD_RST_PIN, 1);
|
||||
DEV_Delay_ms(100);
|
||||
DEV_Delay_ms(10);
|
||||
DEV_Digital_Write(EPD_RST_PIN, 0);
|
||||
DEV_Delay_ms(2);
|
||||
DEV_Digital_Write(EPD_RST_PIN, 1);
|
||||
DEV_Delay_ms(100);
|
||||
DEV_Delay_ms(10);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
|
|
@ -111,15 +134,31 @@ void EPD_2IN9_V2_ReadBusy(void)
|
|||
Debug("e-Paper busy release\r\n");
|
||||
}
|
||||
|
||||
static void EPD_2IN9_V2_LUT(void)
|
||||
static void EPD_2IN9_V2_LUT(UBYTE *lut)
|
||||
{
|
||||
UBYTE count;
|
||||
EPD_2IN9_V2_SendCommand(0x32);
|
||||
for(count=0; count<153; count++)
|
||||
EPD_2IN9_V2_SendData(_WF_PARTIAL_2IN9[count]);
|
||||
EPD_2IN9_V2_SendData(lut[count]);
|
||||
EPD_2IN9_V2_ReadBusy();
|
||||
}
|
||||
|
||||
static void EPD_2IN9_V2_LUT_by_host(UBYTE *lut)
|
||||
{
|
||||
EPD_2IN9_V2_LUT((UBYTE *)lut); //lut
|
||||
EPD_2IN9_V2_SendCommand(0x3f);
|
||||
EPD_2IN9_V2_SendData(*(lut+153));
|
||||
EPD_2IN9_V2_SendCommand(0x03); // gate voltage
|
||||
EPD_2IN9_V2_SendData(*(lut+154));
|
||||
EPD_2IN9_V2_SendCommand(0x04); // source voltage
|
||||
EPD_2IN9_V2_SendData(*(lut+155)); // VSH
|
||||
EPD_2IN9_V2_SendData(*(lut+156)); // VSH2
|
||||
EPD_2IN9_V2_SendData(*(lut+157)); // VSL
|
||||
EPD_2IN9_V2_SendCommand(0x2c); // VCOM
|
||||
EPD_2IN9_V2_SendData(*(lut+158));
|
||||
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
function : Turn On Display
|
||||
parameter:
|
||||
|
|
@ -127,7 +166,7 @@ parameter:
|
|||
static void EPD_2IN9_V2_TurnOnDisplay(void)
|
||||
{
|
||||
EPD_2IN9_V2_SendCommand(0x22); //Display Update Control
|
||||
EPD_2IN9_V2_SendData(0xF7);
|
||||
EPD_2IN9_V2_SendData(0xc7);
|
||||
EPD_2IN9_V2_SendCommand(0x20); //Activate Display Update Sequence
|
||||
EPD_2IN9_V2_ReadBusy();
|
||||
}
|
||||
|
|
@ -200,6 +239,8 @@ void EPD_2IN9_V2_Init(void)
|
|||
|
||||
EPD_2IN9_V2_SetCursor(0, 0);
|
||||
EPD_2IN9_V2_ReadBusy();
|
||||
|
||||
EPD_2IN9_V2_LUT_by_host(WS_20_30);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
|
|
@ -209,6 +250,7 @@ parameter:
|
|||
void EPD_2IN9_V2_Clear(void)
|
||||
{
|
||||
UWORD i;
|
||||
|
||||
EPD_2IN9_V2_SendCommand(0x24); //write RAM for black(0)/white (1)
|
||||
for(i=0;i<4736;i++)
|
||||
{
|
||||
|
|
@ -255,11 +297,11 @@ void EPD_2IN9_V2_Display_Partial(UBYTE *Image)
|
|||
|
||||
//Reset
|
||||
DEV_Digital_Write(EPD_RST_PIN, 0);
|
||||
DEV_Delay_ms(5);
|
||||
DEV_Delay_ms(1);
|
||||
DEV_Digital_Write(EPD_RST_PIN, 1);
|
||||
DEV_Delay_ms(10);
|
||||
DEV_Delay_ms(2);
|
||||
|
||||
EPD_2IN9_V2_LUT();
|
||||
EPD_2IN9_V2_LUT(_WF_PARTIAL_2IN9);
|
||||
EPD_2IN9_V2_SendCommand(0x37);
|
||||
EPD_2IN9_V2_SendData(0x00);
|
||||
EPD_2IN9_V2_SendData(0x00);
|
||||
|
|
|
|||
|
|
@ -31,6 +31,61 @@
|
|||
#include "EPD_7in5_V2.h"
|
||||
#include "Debug.h"
|
||||
|
||||
|
||||
UBYTE Voltage_Frame_7IN5_V2[]={
|
||||
0x6, 0x3F, 0x3F, 0x11, 0x24, 0x7, 0x17,
|
||||
};
|
||||
|
||||
UBYTE LUT_VCOM_7IN5_V2[]={
|
||||
0x0, 0xF, 0xF, 0x0, 0x0, 0x1,
|
||||
0x0, 0xF, 0x1, 0xF, 0x1, 0x2,
|
||||
0x0, 0xF, 0xF, 0x0, 0x0, 0x1,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
};
|
||||
|
||||
UBYTE LUT_WW_7IN5_V2[]={
|
||||
0x10, 0xF, 0xF, 0x0, 0x0, 0x1,
|
||||
0x84, 0xF, 0x1, 0xF, 0x1, 0x2,
|
||||
0x20, 0xF, 0xF, 0x0, 0x0, 0x1,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
};
|
||||
|
||||
UBYTE LUT_BW_7IN5_V2[]={
|
||||
0x10, 0xF, 0xF, 0x0, 0x0, 0x1,
|
||||
0x84, 0xF, 0x1, 0xF, 0x1, 0x2,
|
||||
0x20, 0xF, 0xF, 0x0, 0x0, 0x1,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
};
|
||||
|
||||
UBYTE LUT_WB_7IN5_V2[]={
|
||||
0x80, 0xF, 0xF, 0x0, 0x0, 0x1,
|
||||
0x84, 0xF, 0x1, 0xF, 0x1, 0x2,
|
||||
0x40, 0xF, 0xF, 0x0, 0x0, 0x1,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
};
|
||||
|
||||
UBYTE LUT_BB_7IN5_V2[]={
|
||||
0x80, 0xF, 0xF, 0x0, 0x0, 0x1,
|
||||
0x84, 0xF, 0x1, 0xF, 0x1, 0x2,
|
||||
0x40, 0xF, 0xF, 0x0, 0x0, 0x1,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
};
|
||||
|
||||
/******************************************************************************
|
||||
function : Software reset
|
||||
parameter:
|
||||
|
|
@ -38,11 +93,11 @@ parameter:
|
|||
static void EPD_Reset(void)
|
||||
{
|
||||
DEV_Digital_Write(EPD_RST_PIN, 1);
|
||||
DEV_Delay_ms(200);
|
||||
DEV_Delay_ms(20);
|
||||
DEV_Digital_Write(EPD_RST_PIN, 0);
|
||||
DEV_Delay_ms(2);
|
||||
DEV_Digital_Write(EPD_RST_PIN, 1);
|
||||
DEV_Delay_ms(200);
|
||||
DEV_Delay_ms(20);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
|
|
@ -79,20 +134,43 @@ static void EPD_WaitUntilIdle(void)
|
|||
{
|
||||
Debug("e-Paper busy\r\n");
|
||||
do{
|
||||
EPD_SendCommand(0x71);
|
||||
DEV_Delay_ms(20);
|
||||
DEV_Delay_ms(5);
|
||||
}while(!(DEV_Digital_Read(EPD_BUSY_PIN)));
|
||||
DEV_Delay_ms(20);
|
||||
DEV_Delay_ms(5);
|
||||
Debug("e-Paper busy release\r\n");
|
||||
}
|
||||
|
||||
static void EPD_7IN5_V2_LUT(UBYTE* lut_vcom, UBYTE* lut_ww, UBYTE* lut_bw, UBYTE* lut_wb, UBYTE* lut_bb)
|
||||
{
|
||||
UBYTE count;
|
||||
|
||||
EPD_SendCommand(0x20); //VCOM
|
||||
for(count=0; count<60; count++)
|
||||
EPD_SendData(lut_vcom[count]);
|
||||
|
||||
EPD_SendCommand(0x21); //LUTBW
|
||||
for(count=0; count<60; count++)
|
||||
EPD_SendData(lut_ww[count]);
|
||||
|
||||
EPD_SendCommand(0x22); //LUTBW
|
||||
for(count=0; count<60; count++)
|
||||
EPD_SendData(lut_bw[count]);
|
||||
|
||||
EPD_SendCommand(0x23); //LUTWB
|
||||
for(count=0; count<60; count++)
|
||||
EPD_SendData(lut_wb[count]);
|
||||
|
||||
EPD_SendCommand(0x24); //LUTBB
|
||||
for(count=0; count<60; count++)
|
||||
EPD_SendData(lut_bb[count]);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
function : Turn On Display
|
||||
parameter:
|
||||
******************************************************************************/
|
||||
static void EPD_7IN5_V2_TurnOnDisplay(void)
|
||||
{
|
||||
{
|
||||
EPD_SendCommand(0x12); //DISPLAY REFRESH
|
||||
DEV_Delay_ms(100); //!!!The delay here is necessary, 200uS at least!!!
|
||||
EPD_WaitUntilIdle();
|
||||
|
|
@ -106,18 +184,37 @@ UBYTE EPD_7IN5_V2_Init(void)
|
|||
{
|
||||
EPD_Reset();
|
||||
|
||||
EPD_SendCommand(0x01); //POWER SETTING
|
||||
EPD_SendData(0x07);
|
||||
EPD_SendData(0x07); //VGH=20V,VGL=-20V
|
||||
EPD_SendData(0x3f); //VDH=15V
|
||||
EPD_SendData(0x3f); //VDL=-15V
|
||||
// EPD_SendCommand(0x01); //POWER SETTING
|
||||
// EPD_SendData(0x07);
|
||||
// EPD_SendData(0x07); //VGH=20V,VGL=-20V
|
||||
// EPD_SendData(0x3f); //VDH=15V
|
||||
// EPD_SendData(0x3f); //VDL=-15V
|
||||
|
||||
EPD_SendCommand(0x01); // power setting
|
||||
EPD_SendData(0x17); // 1-0=11: internal power
|
||||
EPD_SendData(*(Voltage_Frame_7IN5_V2+6)); // VGH&VGL
|
||||
EPD_SendData(*(Voltage_Frame_7IN5_V2+1)); // VSH
|
||||
EPD_SendData(*(Voltage_Frame_7IN5_V2+2)); // VSL
|
||||
EPD_SendData(*(Voltage_Frame_7IN5_V2+3)); // VSHR
|
||||
|
||||
EPD_SendCommand(0x82); // VCOM DC Setting
|
||||
EPD_SendData(*(Voltage_Frame_7IN5_V2+4)); // VCOM
|
||||
|
||||
EPD_SendCommand(0x06); // Booster Setting
|
||||
EPD_SendData(0x27);
|
||||
EPD_SendData(0x27);
|
||||
EPD_SendData(0x2F);
|
||||
EPD_SendData(0x17);
|
||||
|
||||
EPD_SendCommand(0x30); // OSC Setting
|
||||
EPD_SendData(*(Voltage_Frame_7IN5_V2+0)); // 2-0=100: N=4 ; 5-3=111: M=7 ; 3C=50Hz 3A=100HZ
|
||||
|
||||
EPD_SendCommand(0x04); //POWER ON
|
||||
DEV_Delay_ms(100);
|
||||
EPD_WaitUntilIdle();
|
||||
|
||||
EPD_SendCommand(0X00); //PANNEL SETTING
|
||||
EPD_SendData(0x1F); //KW-3f KWR-2F BWROTP 0f BWOTP 1f
|
||||
EPD_SendData(0x3F); //KW-3f KWR-2F BWROTP 0f BWOTP 1f
|
||||
|
||||
EPD_SendCommand(0x61); //tres
|
||||
EPD_SendData(0x03); //source 800
|
||||
|
|
@ -141,6 +238,8 @@ UBYTE EPD_7IN5_V2_Init(void)
|
|||
EPD_SendData(0x00);
|
||||
EPD_SendData(0x00);
|
||||
|
||||
EPD_7IN5_V2_LUT(LUT_VCOM_7IN5_V2, LUT_WW_7IN5_V2, LUT_BW_7IN5_V2, LUT_WB_7IN5_V2, LUT_BB_7IN5_V2);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -193,13 +292,13 @@ void EPD_7IN5_V2_Display(const UBYTE *blackimage)
|
|||
UDOUBLE Width, Height;
|
||||
Width =(EPD_7IN5_V2_WIDTH % 8 == 0)?(EPD_7IN5_V2_WIDTH / 8 ):(EPD_7IN5_V2_WIDTH / 8 + 1);
|
||||
Height = EPD_7IN5_V2_HEIGHT;
|
||||
|
||||
EPD_SendCommand(0x10);
|
||||
for (UDOUBLE j = 0; j < Height; j++) {
|
||||
for (UDOUBLE i = 0; i < Width; i++) {
|
||||
EPD_SendData(blackimage[i + j * Width]);
|
||||
}
|
||||
}
|
||||
|
||||
// EPD_SendCommand(0x10);
|
||||
// for (UDOUBLE j = 0; j < Height; j++) {
|
||||
// for (UDOUBLE i = 0; i < Width; i++) {
|
||||
// EPD_SendData(blackimage[i + j * Width]);
|
||||
// }
|
||||
// }
|
||||
EPD_SendCommand(0x13);
|
||||
for (UDOUBLE j = 0; j < Height; j++) {
|
||||
for (UDOUBLE i = 0; i < Width; i++) {
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
|
|
@ -21,7 +21,7 @@ try:
|
|||
epd = epd1in54_V2.EPD()
|
||||
|
||||
logging.info("init and Clear")
|
||||
epd.init()
|
||||
epd.init(0)
|
||||
epd.Clear(0xFF)
|
||||
time.sleep(1)
|
||||
|
||||
|
|
@ -67,6 +67,7 @@ try:
|
|||
# Image.new('1', (epd.width, epd.height), 255)
|
||||
epd.displayPartBaseImage(epd.getbuffer(time_image))
|
||||
|
||||
epd.init(1) # into partial refresh mode
|
||||
time_draw = ImageDraw.Draw(time_image)
|
||||
num = 0
|
||||
while (True):
|
||||
|
|
@ -80,7 +81,7 @@ try:
|
|||
break
|
||||
|
||||
logging.info("Clear...")
|
||||
epd.init()
|
||||
epd.init(0)
|
||||
epd.Clear(0xFF)
|
||||
|
||||
logging.info("Goto Sleep...")
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ try:
|
|||
draw.arc((140, 50, 190, 100), 0, 360, fill = 0)
|
||||
draw.rectangle((80, 50, 130, 100), fill = 0)
|
||||
draw.chord((200, 50, 250, 100), 0, 360, fill = 0)
|
||||
# Himage = Himage.transpose(method=Image.ROTATE_180)
|
||||
epd.display(epd.getbuffer(Himage))
|
||||
time.sleep(2)
|
||||
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ try:
|
|||
drawblack = ImageDraw.Draw(HBlackimage)
|
||||
drawry = ImageDraw.Draw(HRYimage)
|
||||
drawblack.text((10, 0), 'hello world', font = font24, fill = 0)
|
||||
drawblack.text((10, 20), '5.83inch e-Paper bc', font = font24, fill = 0)
|
||||
drawblack.text((10, 20), '5.83inch e-Paper b V2', font = font24, fill = 0)
|
||||
drawblack.text((150, 0), u'微雪电子', font = font24, fill = 0)
|
||||
drawblack.line((20, 50, 70, 100), fill = 0)
|
||||
drawblack.line((70, 50, 20, 100), fill = 0)
|
||||
|
|
@ -57,7 +57,7 @@ try:
|
|||
drawry = ImageDraw.Draw(LRYimage)
|
||||
|
||||
drawblack.text((2, 0), 'hello world', font = font18, fill = 0)
|
||||
drawblack.text((2, 20), '5.83inch epd bc', font = font18, fill = 0)
|
||||
drawblack.text((2, 20), '5.83inch epd b V2', font = font18, fill = 0)
|
||||
drawblack.text((20, 50), u'微雪电子', font = font18, fill = 0)
|
||||
drawblack.line((10, 90, 60, 140), fill = 0)
|
||||
drawblack.line((60, 90, 10, 140), fill = 0)
|
||||
|
|
|
|||
|
|
@ -67,8 +67,8 @@ try:
|
|||
time.sleep(2)
|
||||
|
||||
logging.info("3.read bmp file")
|
||||
Himage = Image.open(os.path.join(picdir, '7in5_V2_r.bmp'))
|
||||
Himage_Other = Image.open(os.path.join(picdir, '7in5_V2_b.bmp'))
|
||||
Himage = Image.open(os.path.join(picdir, '7in5_V2_b.bmp'))
|
||||
Himage_Other = Image.open(os.path.join(picdir, '7in5_V2_r.bmp'))
|
||||
epd.display(epd.getbuffer(Himage),epd.getbuffer(Himage_Other))
|
||||
time.sleep(2)
|
||||
|
||||
|
|
|
|||
|
|
@ -43,6 +43,75 @@ class EPD:
|
|||
self.width = EPD_WIDTH
|
||||
self.height = EPD_HEIGHT
|
||||
|
||||
# waveform full refresh
|
||||
WF_Full_1IN54 = [
|
||||
0x80, 0x48, 0x40, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x40, 0x48, 0x80, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x80, 0x48, 0x40, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x40, 0x48, 0x80, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0xA, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x8, 0x1, 0x0, 0x8, 0x1, 0x0, 0x2,
|
||||
0xA, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x0, 0x0, 0x0,
|
||||
0x22, 0x17, 0x41, 0x0, 0x32, 0x20
|
||||
]
|
||||
|
||||
# waveform partial refresh(fast)
|
||||
WF_PARTIAL_1IN54_0 = [
|
||||
0x0,0x40,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x80,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x40,0x40,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0xF,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x1,0x1,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x22,0x22,0x22,0x22,0x22,0x22,0x0,0x0,0x0,
|
||||
0x02,0x17,0x41,0xB0,0x32,0x28,
|
||||
]
|
||||
|
||||
# waveform partial refresh(quality)
|
||||
WF_PARTIAL_1IN54_1 = [
|
||||
0x0,0x00,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x40,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0xA,0x0,0x0,0x0,0x0,0x0,0x1,
|
||||
0x1,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x22,0x22,0x22,0x22,0x22,0x22,0x0,0x0,0x0,
|
||||
0x22,0x17,0x41,0x0,0x32,0x20,
|
||||
]
|
||||
|
||||
# Hardware reset
|
||||
def reset(self):
|
||||
epdconfig.digital_write(self.reset_pin, 1)
|
||||
|
|
@ -72,62 +141,123 @@ class EPD:
|
|||
|
||||
def TurnOnDisplay(self):
|
||||
self.send_command(0x22) # DISPLAY_UPDATE_CONTROL_2
|
||||
self.send_data(0xF7)
|
||||
self.send_data(0xc7)
|
||||
self.send_command(0x20) # MASTER_ACTIVATION
|
||||
self.ReadBusy()
|
||||
|
||||
def TurnOnDisplayPart(self):
|
||||
self.send_command(0x22) # DISPLAY_UPDATE_CONTROL_2
|
||||
self.send_data(0xFF)
|
||||
self.send_data(0xcF)
|
||||
self.send_command(0x20) # MASTER_ACTIVATION
|
||||
self.ReadBusy()
|
||||
|
||||
def init(self):
|
||||
def lut(self, lut):
|
||||
self.send_command(0x32) # WRITE_LUT_REGISTER
|
||||
for i in range(0, len(lut)):
|
||||
self.send_data(lut[i])
|
||||
|
||||
def set_lut(self, lut):
|
||||
self.lut(lut)
|
||||
|
||||
self.send_command(0x3f)
|
||||
self.send_data(lut[153])
|
||||
|
||||
self.send_command(0x03)
|
||||
self.send_data(lut[154])
|
||||
|
||||
self.send_command(0x04)
|
||||
self.send_data(lut[155])
|
||||
self.send_data(lut[156])
|
||||
self.send_data(lut[157])
|
||||
|
||||
self.send_command(0x2c)
|
||||
self.send_data(lut[158])
|
||||
|
||||
def SetWindows(self, Xstart, Ystart, Xend, Yend):
|
||||
self.send_command(0x44); # SET_RAM_X_ADDRESS_START_END_POSITION
|
||||
self.send_data((Xstart>>3) & 0xFF);
|
||||
self.send_data((Xend>>3) & 0xFF);
|
||||
|
||||
self.send_command(0x45); # SET_RAM_Y_ADDRESS_START_END_POSITION
|
||||
self.send_data(Ystart & 0xFF);
|
||||
self.send_data((Ystart >> 8) & 0xFF);
|
||||
self.send_data(Yend & 0xFF);
|
||||
self.send_data((Yend >> 8) & 0xFF);
|
||||
|
||||
|
||||
def SetCursor(self, Xstart, Ystart):
|
||||
self.send_command(0x4E); # SET_RAM_X_ADDRESS_COUNTER
|
||||
self.send_data(Xstart & 0xFF);
|
||||
|
||||
self.send_command(0x4F); # SET_RAM_Y_ADDRESS_COUNTER
|
||||
self.send_data(Ystart & 0xFF);
|
||||
self.send_data((Ystart >> 8) & 0xFF);
|
||||
|
||||
def init(self, isPartial):
|
||||
if (epdconfig.module_init() != 0):
|
||||
return -1
|
||||
|
||||
# EPD hardware init start
|
||||
self.reset()
|
||||
if(isPartial):
|
||||
logging.debug("full refresh")
|
||||
self.reset()
|
||||
self.ReadBusy()
|
||||
|
||||
self.set_lut(self.WF_PARTIAL_1IN54_0)
|
||||
|
||||
self.send_command(0x37)
|
||||
self.send_data(0x00)
|
||||
self.send_data(0x00)
|
||||
self.send_data(0x00)
|
||||
self.send_data(0x00)
|
||||
self.send_data(0x00)
|
||||
self.send_data(0x40)
|
||||
self.send_data(0x00)
|
||||
self.send_data(0x00)
|
||||
self.send_data(0x00)
|
||||
self.send_data(0x00)
|
||||
|
||||
self.send_command(0x3c) # BorderWavefrom
|
||||
self.send_data(0x80)
|
||||
|
||||
self.send_command(0x22)
|
||||
self.send_data(0xc0)
|
||||
self.send_command(0x20)
|
||||
self.ReadBusy()
|
||||
|
||||
self.ReadBusy()
|
||||
self.send_command(0x12) # SWRESET
|
||||
self.ReadBusy()
|
||||
|
||||
self.send_command(0x01) # DRIVER_OUTPUT_CONTROL
|
||||
self.send_data(0xC7) # (EPD_HEIGHT - 1) & 0xFF
|
||||
self.send_data(0x00) # ((EPD_HEIGHT - 1) >> 8) & 0xFF
|
||||
self.send_data(0x01) # GD = 0 SM = 0 TB = 0
|
||||
|
||||
self.send_command(0x11) # data entry mode
|
||||
self.send_data(0x01)
|
||||
|
||||
self.send_command(0x44) # set Ram-X address start/end position
|
||||
self.send_data(0x00)
|
||||
self.send_data(0x18) # 0x0C-->(18+1)*8=200
|
||||
|
||||
self.send_command(0x45) # set Ram-Y address start/end position
|
||||
self.send_data(0xC7) # 0xC7-->(199+1)=200
|
||||
self.send_data(0x00)
|
||||
self.send_data(0x00)
|
||||
self.send_data(0x00)
|
||||
else:
|
||||
logging.debug("partial refresh")
|
||||
# EPD hardware init start
|
||||
self.reset()
|
||||
|
||||
self.ReadBusy()
|
||||
self.send_command(0x12) # SWRESET (software reset)
|
||||
self.ReadBusy()
|
||||
|
||||
self.send_command(0x01) # DRIVER_OUTPUT_CONTROL
|
||||
self.send_data(0xC7) # (EPD_HEIGHT - 1) & 0xFF
|
||||
self.send_data(0x00) # ((EPD_HEIGHT - 1) >> 8) & 0xFF
|
||||
self.send_data(0x01) # GD = 0 SM = 0 TB = 0
|
||||
|
||||
self.send_command(0x11) # data entry mode
|
||||
self.send_data(0x01)
|
||||
|
||||
self.SetWindows(0, self.height-1, self.width-1, 0) # Set Windows
|
||||
|
||||
self.send_command(0x3C) # BorderWavefrom
|
||||
self.send_data(0x01)
|
||||
|
||||
self.send_command(0x3C) # BorderWavefrom
|
||||
self.send_data(0x01)
|
||||
self.send_command(0x18)
|
||||
self.send_data(0x80)
|
||||
|
||||
self.send_command(0x18)
|
||||
self.send_data(0x80)
|
||||
self.send_command(0x22) # #Load Temperature and waveform setting.
|
||||
self.send_data(0XB1)
|
||||
self.send_command(0x20)
|
||||
|
||||
self.send_command(0x22) # #Load Temperature and waveform setting.
|
||||
self.send_data(0XB1)
|
||||
self.send_command(0x20)
|
||||
|
||||
self.send_command(0x4E) # set RAM x address count to 0;
|
||||
self.send_data(0x00)
|
||||
self.send_command(0x4F) # set RAM y address count to 0X199;
|
||||
self.send_data(0xC7)
|
||||
self.send_data(0x00)
|
||||
|
||||
self.ReadBusy()
|
||||
self.SetCursor(0, self.height-1) # Set Cursor
|
||||
|
||||
self.ReadBusy()
|
||||
|
||||
self.set_lut(self.WF_Full_1IN54) # Set lut
|
||||
|
||||
def Clear(self, color):
|
||||
self.send_command(0x24)
|
||||
|
|
@ -188,14 +318,6 @@ class EPD:
|
|||
def displayPart(self, image):
|
||||
if (image == None):
|
||||
return
|
||||
|
||||
epdconfig.digital_write(self.reset_pin, 0)
|
||||
epdconfig.delay_ms(10)
|
||||
epdconfig.digital_write(self.reset_pin, 1)
|
||||
epdconfig.delay_ms(10)
|
||||
|
||||
self.send_command(0x3c)
|
||||
self.send_data(0x80)
|
||||
|
||||
self.send_command(0x24)
|
||||
for j in range(0, self.height):
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
BIN
RaspberryPi_JetsonNano/python/pic/4in2_1.bmp
Normal file
|
After Width: | Height: | Size: 59 KiB |
BIN
RaspberryPi_JetsonNano/python/pic/4in2_B.bmp
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
RaspberryPi_JetsonNano/python/pic/4in2_Pico.bmp
Normal file
|
After Width: | Height: | Size: 59 KiB |
BIN
RaspberryPi_JetsonNano/python/pic/4in2_R.bmp
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
RaspberryPi_JetsonNano/python/pic/5.83_V2_0.bmp
Normal file
|
After Width: | Height: | Size: 39 KiB |
BIN
RaspberryPi_JetsonNano/python/pic/Pico-ePaper-5.65.bmp
Normal file
|
After Width: | Height: | Size: 788 KiB |
BIN
RaspberryPi_JetsonNano/python/pic/Pico_2in7.bmp
Normal file
|
After Width: | Height: | Size: 23 KiB |
|
|
@ -145,7 +145,7 @@
|
|||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>ST-LINKIII-KEIL_SWO</Key>
|
||||
<Name>-U34FF68064157373036130757 -O2254 -SF10000 -C0 -A0 -I0 -HNlocalhost -HP7184 -P2 -N00("") -D00(00000000) -L00(0) -TO18 -TC10000000 -TP21 -TDS8004 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO15 -FD20000000 -FC800 -FN1 -FF0STM32F10x_512.FLM -FS08000000 -FL080000 -FP0($$Device:STM32F103ZE$Flash\STM32F10x_512.FLM)</Name>
|
||||
<Name>-U38FF6D064246373030270457 -O2254 -SF1800 -C0 -A0 -I0 -HNlocalhost -HP7184 -P2 -N00("ARM CoreSight SW-DP") -D00(1BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8004 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO15 -FD20000000 -FC800 -FN1 -FF0STM32F10x_512 -FS08000000 -FL080000 -FP0($$Device:STM32F103ZE$Flash\STM32F10x_512.FLM)</Name>
|
||||
</SetRegEntry>
|
||||
</TargetDriverDllRegistry>
|
||||
<Breakpoint>
|
||||
|
|
@ -243,7 +243,7 @@
|
|||
|
||||
<Group>
|
||||
<GroupName>Application/MDK-ARM</GroupName>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
|
|
@ -343,7 +343,7 @@
|
|||
|
||||
<Group>
|
||||
<GroupName>Examples</GroupName>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
|
|
@ -1421,14 +1421,6 @@
|
|||
</File>
|
||||
</Group>
|
||||
|
||||
<Group>
|
||||
<GroupName>::CMSIS</GroupName>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>1</RteFlg>
|
||||
</Group>
|
||||
|
||||
<Group>
|
||||
<GroupName>Drivers/CMSIS</GroupName>
|
||||
<tvExp>0</tvExp>
|
||||
|
|
@ -1436,7 +1428,7 @@
|
|||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
<File>
|
||||
<GroupNumber>10</GroupNumber>
|
||||
<GroupNumber>9</GroupNumber>
|
||||
<FileNumber>94</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
|
|
@ -1456,7 +1448,7 @@
|
|||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
<File>
|
||||
<GroupNumber>11</GroupNumber>
|
||||
<GroupNumber>10</GroupNumber>
|
||||
<FileNumber>95</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
|
|
@ -1468,7 +1460,7 @@
|
|||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>11</GroupNumber>
|
||||
<GroupNumber>10</GroupNumber>
|
||||
<FileNumber>96</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
|
|
@ -1480,7 +1472,7 @@
|
|||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>11</GroupNumber>
|
||||
<GroupNumber>10</GroupNumber>
|
||||
<FileNumber>97</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
|
|
@ -1492,7 +1484,7 @@
|
|||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>11</GroupNumber>
|
||||
<GroupNumber>10</GroupNumber>
|
||||
<FileNumber>98</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
|
|
@ -1504,7 +1496,7 @@
|
|||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>11</GroupNumber>
|
||||
<GroupNumber>10</GroupNumber>
|
||||
<FileNumber>99</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
|
|
@ -1516,7 +1508,7 @@
|
|||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>11</GroupNumber>
|
||||
<GroupNumber>10</GroupNumber>
|
||||
<FileNumber>100</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
|
|
@ -1528,7 +1520,7 @@
|
|||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>11</GroupNumber>
|
||||
<GroupNumber>10</GroupNumber>
|
||||
<FileNumber>101</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
|
|
@ -1540,7 +1532,7 @@
|
|||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>11</GroupNumber>
|
||||
<GroupNumber>10</GroupNumber>
|
||||
<FileNumber>102</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
|
|
@ -1552,7 +1544,7 @@
|
|||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>11</GroupNumber>
|
||||
<GroupNumber>10</GroupNumber>
|
||||
<FileNumber>103</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
|
|
@ -1564,7 +1556,7 @@
|
|||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>11</GroupNumber>
|
||||
<GroupNumber>10</GroupNumber>
|
||||
<FileNumber>104</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
|
|
@ -1576,7 +1568,7 @@
|
|||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>11</GroupNumber>
|
||||
<GroupNumber>10</GroupNumber>
|
||||
<FileNumber>105</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
|
|
@ -1588,7 +1580,7 @@
|
|||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>11</GroupNumber>
|
||||
<GroupNumber>10</GroupNumber>
|
||||
<FileNumber>106</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
|
|
@ -1600,7 +1592,7 @@
|
|||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>11</GroupNumber>
|
||||
<GroupNumber>10</GroupNumber>
|
||||
<FileNumber>107</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
|
|
@ -1612,7 +1604,7 @@
|
|||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>11</GroupNumber>
|
||||
<GroupNumber>10</GroupNumber>
|
||||
<FileNumber>108</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
|
|
@ -1624,7 +1616,7 @@
|
|||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>11</GroupNumber>
|
||||
<GroupNumber>10</GroupNumber>
|
||||
<FileNumber>109</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
|
|
@ -1637,4 +1629,12 @@
|
|||
</File>
|
||||
</Group>
|
||||
|
||||
<Group>
|
||||
<GroupName>::CMSIS</GroupName>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>1</RteFlg>
|
||||
</Group>
|
||||
|
||||
</ProjectOpt>
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@
|
|||
<RunIndependent>0</RunIndependent>
|
||||
<UpdateFlashBeforeDebugging>1</UpdateFlashBeforeDebugging>
|
||||
<Capability>1</Capability>
|
||||
<DriverSelection>4103</DriverSelection>
|
||||
<DriverSelection>4101</DriverSelection>
|
||||
</Flash1>
|
||||
<bUseTDR>1</bUseTDR>
|
||||
<Flash2>STLink\ST-LINKIII-KEIL_SWO.dll</Flash2>
|
||||
|
|
@ -883,9 +883,6 @@
|
|||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>::CMSIS</GroupName>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>Drivers/CMSIS</GroupName>
|
||||
<GroupOption>
|
||||
|
|
@ -1930,6 +1927,9 @@
|
|||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>::CMSIS</GroupName>
|
||||
</Group>
|
||||
</Groups>
|
||||
</Target>
|
||||
</Targets>
|
||||
|
|
|
|||
|
|
@ -21,121 +21,15 @@ Target DLL: STLink\ST-LINKIII-KEIL_SWO.dll V3.0.1.0
|
|||
Dialog DLL: TCM.DLL V1.35.1.0
|
||||
|
||||
<h2>Project:</h2>
|
||||
E:\project\E-Paper_code\STM32\STM32-F103ZET6\MDK-ARM\epd-demo.uvprojx
|
||||
Project File Date: 05/27/2021
|
||||
E:\github\E-Paper_code\STM32\STM32-F103ZET6\MDK-ARM\epd-demo.uvprojx
|
||||
Project File Date: 07/19/2021
|
||||
|
||||
<h2>Output:</h2>
|
||||
*** Using Compiler 'V5.06 update 6 (build 750)', folder: 'D:\Program Files\keil5\ARM\ARMCC\Bin'
|
||||
Rebuild target 'epd-demo'
|
||||
assembling startup_stm32f103xe.s...
|
||||
compiling ImageData.c...
|
||||
compiling stm32f1xx_hal_msp.c...
|
||||
compiling gpio.c...
|
||||
compiling EPD_1in02_test.c...
|
||||
compiling spi.c...
|
||||
compiling stm32f1xx_it.c...
|
||||
Build target 'epd-demo'
|
||||
compiling main.c...
|
||||
compiling usart.c...
|
||||
compiling EPD_1in54_test.c...
|
||||
compiling EPD_1in54b_test.c...
|
||||
compiling EPD_1in54c_test.c...
|
||||
compiling EPD_2in7_test.c...
|
||||
compiling EPD_1in54b_V2_test.c...
|
||||
compiling EPD_2in7b_test.c...
|
||||
compiling EPD_1in54_V2_test.c...
|
||||
compiling EPD_2in9_V2_test.c...
|
||||
compiling EPD_2in9_test.c...
|
||||
compiling EPD_2in9bc_test.c...
|
||||
compiling EPD_2in13_test.c...
|
||||
compiling EPD_2in9d_test.c...
|
||||
compiling EPD_2in13_V2_test.c...
|
||||
compiling EPD_2in13d_test.c...
|
||||
compiling EPD_2in9b_V3_test.c...
|
||||
compiling EPD_2in13b_V3_test.c...
|
||||
compiling EPD_2in13bc_test.c...
|
||||
compiling EPD_4in01f_test.c...
|
||||
compiling EPD_2in66_test.c...
|
||||
compiling EPD_4in2bc_test.c...
|
||||
compiling EPD_2in66b_test.c...
|
||||
compiling EPD_4in2b_V2_test.c...
|
||||
compiling EPD_3in7_test.c...
|
||||
compiling EPD_5in65f_test.c...
|
||||
compiling EPD_4in2_test.c...
|
||||
compiling EPD_5in83_V2_test.c...
|
||||
compiling EPD_5in83bc_test.c...
|
||||
compiling EPD_7in5_V2_test.c...
|
||||
compiling EPD_7in5_test.c...
|
||||
compiling EPD_7in5b_V2_test.c...
|
||||
compiling EPD_5in83b_V2_test.c...
|
||||
compiling EPD_5in83_test.c...
|
||||
compiling EPD_7in5bc_test.c...
|
||||
compiling EPD_7in5b_HD_test.c...
|
||||
compiling EPD_2in7b_V2_test.c...
|
||||
compiling EPD_1in54b.c...
|
||||
compiling EPD_7in5_HD_test.c...
|
||||
compiling EPD_1in54_V2.c...
|
||||
compiling EPD_1in02d.c...
|
||||
compiling EPD_1in54.c...
|
||||
compiling EPD_1in54b_V2.c...
|
||||
compiling EPD_2in7b_V2.c...
|
||||
compiling EPD_2in7.c...
|
||||
compiling EPD_2in9.c...
|
||||
compiling EPD_2in7b.c...
|
||||
compiling EPD_1in54c.c...
|
||||
compiling EPD_2in9bc.c...
|
||||
compiling EPD_2in9b_V3.c...
|
||||
compiling EPD_2in9_V2.c...
|
||||
compiling EPD_2in13bc.c...
|
||||
compiling EPD_2in13b_V3.c...
|
||||
compiling EPD_2in66.c...
|
||||
compiling EPD_2in13_V2.c...
|
||||
compiling EPD_2in13.c...
|
||||
compiling EPD_2in9d.c...
|
||||
compiling EPD_2in13d.c...
|
||||
compiling EPD_2in66b.c...
|
||||
compiling EPD_5in83.c...
|
||||
compiling EPD_4in2bc.c...
|
||||
compiling EPD_4in2b_V2.c...
|
||||
compiling EPD_4in01f.c...
|
||||
compiling EPD_4in2.c...
|
||||
compiling EPD_5in83_V2.c...
|
||||
compiling EPD_5in65f.c...
|
||||
compiling EPD_3in7.c...
|
||||
compiling EPD_5in83bc.c...
|
||||
compiling EPD_7in5_HD.c...
|
||||
compiling EPD_7in5.c...
|
||||
compiling EPD_7in5b_HD.c...
|
||||
compiling EPD_7in5_V2.c...
|
||||
compiling EPD_5in83b_V2.c...
|
||||
compiling EPD_7in5b_V2.c...
|
||||
compiling EPD_7in5bc.c...
|
||||
compiling font8.c...
|
||||
compiling font12.c...
|
||||
compiling font12CN.c...
|
||||
compiling font16.c...
|
||||
compiling font20.c...
|
||||
compiling font24CN.c...
|
||||
compiling font24.c...
|
||||
compiling GUI_Paint.c...
|
||||
compiling DEV_Config.c...
|
||||
compiling stm32f1xx_hal_rcc_ex.c...
|
||||
compiling stm32f1xx_hal.c...
|
||||
compiling system_stm32f1xx.c...
|
||||
compiling stm32f1xx_hal_gpio_ex.c...
|
||||
compiling stm32f1xx_hal_spi.c...
|
||||
compiling stm32f1xx_hal_rcc.c...
|
||||
compiling stm32f1xx_hal_cortex.c...
|
||||
compiling stm32f1xx_hal_flash.c...
|
||||
compiling stm32f1xx_hal_pwr.c...
|
||||
compiling stm32f1xx_hal_tim.c...
|
||||
compiling stm32f1xx_hal_gpio.c...
|
||||
compiling stm32f1xx_hal_exti.c...
|
||||
compiling stm32f1xx_hal_dma.c...
|
||||
compiling stm32f1xx_hal_flash_ex.c...
|
||||
compiling stm32f1xx_hal_tim_ex.c...
|
||||
compiling stm32f1xx_hal_uart.c...
|
||||
linking...
|
||||
Program Size: Code=25320 RO-data=28600 RW-data=68 ZI-data=41140
|
||||
Program Size: Code=18544 RO-data=360 RW-data=20 ZI-data=4252
|
||||
FromELF: creating hex file...
|
||||
"epd-demo\epd-demo.axf" - 0 Error(s), 0 Warning(s).
|
||||
|
||||
|
|
@ -160,7 +54,7 @@ Package Vendor: Keil
|
|||
<h2>Collection of Component Files used:</h2>
|
||||
|
||||
* Component: ARM::CMSIS:CORE:5.4.0
|
||||
Build Time Elapsed: 00:00:47
|
||||
Build Time Elapsed: 00:00:03
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ int main(void)
|
|||
// EPD_1in54b_V2_test();
|
||||
// EPD_1in54c_test();
|
||||
|
||||
EPD_2in7_test();
|
||||
// EPD_2in7_test();
|
||||
// EPD_2in7b_test();
|
||||
// EPD_2in7b_V2_test();
|
||||
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ int EPD_1in54_V2_test(void)
|
|||
DEV_Delay_ms(2000);
|
||||
#endif
|
||||
|
||||
#if 0 // Drawing on the image
|
||||
#if 1 // Drawing on the image
|
||||
printf("Drawing\r\n");
|
||||
//1.Select Image
|
||||
Paint_SelectImage(BlackImage);
|
||||
|
|
@ -86,27 +86,29 @@ int EPD_1in54_V2_test(void)
|
|||
Paint_DrawString_EN(5, 85, "waveshare", &Font20, BLACK, WHITE);
|
||||
Paint_DrawNum(5, 110, 123456789, &Font20, BLACK, WHITE);
|
||||
|
||||
Paint_DrawString_CN(5, 135,"ÄãºÃabc", &Font12CN, BLACK, WHITE);
|
||||
Paint_DrawString_CN(5, 155, "΢ѩµç×Ó", &Font24CN, WHITE, BLACK);
|
||||
Paint_DrawString_CN(5, 135,"<EFBFBD><EFBFBD><EFBFBD>abc", &Font12CN, BLACK, WHITE);
|
||||
Paint_DrawString_CN(5, 155, "ѩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>", &Font24CN, WHITE, BLACK);
|
||||
|
||||
EPD_1IN54_V2_Display(BlackImage);
|
||||
DEV_Delay_ms(2000);
|
||||
#endif
|
||||
|
||||
#if 0 //Partial refresh, example shows time
|
||||
#if 1 //Partial refresh, example shows time
|
||||
|
||||
// The image of the previous frame must be uploaded, otherwise the
|
||||
// first few seconds will display an exception.
|
||||
EPD_1IN54_V2_Init();
|
||||
|
||||
EPD_1IN54_V2_DisplayPartBaseImage(BlackImage);
|
||||
|
||||
// enter partial mode
|
||||
EPD_1IN54_V2_Init_Partial();
|
||||
printf("Partial refresh\r\n");
|
||||
Paint_SelectImage(BlackImage);
|
||||
PAINT_TIME sPaint_time;
|
||||
sPaint_time.Hour = 12;
|
||||
sPaint_time.Min = 34;
|
||||
sPaint_time.Sec = 56;
|
||||
UBYTE num = 20;
|
||||
UBYTE num = 10;
|
||||
for (;;) {
|
||||
sPaint_time.Sec = sPaint_time.Sec + 1;
|
||||
if (sPaint_time.Sec == 60) {
|
||||
|
|
|
|||
|
|
@ -30,6 +30,78 @@
|
|||
#include "EPD_1in54_V2.h"
|
||||
#include "Debug.h"
|
||||
|
||||
// waveform full refresh
|
||||
unsigned char WF_Full_1IN54[159] =
|
||||
{
|
||||
0x80, 0x48, 0x40, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x40, 0x48, 0x80, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x80, 0x48, 0x40, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x40, 0x48, 0x80, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0xA, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x8, 0x1, 0x0, 0x8, 0x1, 0x0, 0x2,
|
||||
0xA, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x0, 0x0, 0x0,
|
||||
0x22, 0x17, 0x41, 0x0, 0x32, 0x20
|
||||
};
|
||||
|
||||
// waveform partial refresh(fast)
|
||||
unsigned char WF_PARTIAL_1IN54_0[159] =
|
||||
{
|
||||
0x0,0x40,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x80,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x40,0x40,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0xF,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x1,0x1,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x22,0x22,0x22,0x22,0x22,0x22,0x0,0x0,0x0,
|
||||
0x02,0x17,0x41,0xB0,0x32,0x28,
|
||||
};
|
||||
|
||||
// waveform partial refresh(quality)
|
||||
unsigned char WF_PARTIAL_1IN54_1[159] =
|
||||
{
|
||||
0x0,0x00,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x40,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0xA,0x0,0x0,0x0,0x0,0x0,0x1,
|
||||
0x1,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||
0x22,0x22,0x22,0x22,0x22,0x22,0x0,0x0,0x0,
|
||||
0x22,0x17,0x41,0x0,0x32,0x20,
|
||||
};
|
||||
|
||||
/******************************************************************************
|
||||
function : Software reset
|
||||
parameter:
|
||||
|
|
@ -77,15 +149,8 @@ parameter:
|
|||
static void EPD_1IN54_V2_ReadBusy(void)
|
||||
{
|
||||
Debug("e-Paper busy\r\n");
|
||||
// UBYTE busy;
|
||||
// do {
|
||||
// EPD_1IN54_V2_SendCommand(0x71);
|
||||
// busy = DEV_Digital_Read(EPD_BUSY_PIN);
|
||||
// busy = !(busy & 0x01);
|
||||
// } while(busy);
|
||||
// DEV_Delay_ms(200);
|
||||
while(DEV_Digital_Read(EPD_BUSY_PIN) == 1) { //LOW: idle, HIGH: busy
|
||||
DEV_Delay_ms(100);
|
||||
DEV_Delay_ms(10);
|
||||
}
|
||||
Debug("e-Paper busy release\r\n");
|
||||
}
|
||||
|
|
@ -97,7 +162,7 @@ parameter:
|
|||
static void EPD_1IN54_V2_TurnOnDisplay(void)
|
||||
{
|
||||
EPD_1IN54_V2_SendCommand(0x22);
|
||||
EPD_1IN54_V2_SendData(0xF7);
|
||||
EPD_1IN54_V2_SendData(0xc7);
|
||||
EPD_1IN54_V2_SendCommand(0x20);
|
||||
EPD_1IN54_V2_ReadBusy();
|
||||
}
|
||||
|
|
@ -109,11 +174,61 @@ parameter:
|
|||
static void EPD_1IN54_V2_TurnOnDisplayPart(void)
|
||||
{
|
||||
EPD_1IN54_V2_SendCommand(0x22);
|
||||
EPD_1IN54_V2_SendData(0xFF);
|
||||
EPD_1IN54_V2_SendData(0xcF);
|
||||
EPD_1IN54_V2_SendCommand(0x20);
|
||||
EPD_1IN54_V2_ReadBusy();
|
||||
}
|
||||
|
||||
static void EPD_1IN54_V2_Lut(UBYTE *lut)
|
||||
{
|
||||
EPD_1IN54_V2_SendCommand(0x32);
|
||||
for(UBYTE i=0; i<153; i++)
|
||||
EPD_1IN54_V2_SendData(lut[i]);
|
||||
EPD_1IN54_V2_ReadBusy();
|
||||
}
|
||||
|
||||
static void EPD_1IN54_V2_SetLut(UBYTE *lut)
|
||||
{
|
||||
EPD_1IN54_V2_Lut(lut);
|
||||
|
||||
EPD_1IN54_V2_SendCommand(0x3f);
|
||||
EPD_1IN54_V2_SendData(lut[153]);
|
||||
|
||||
EPD_1IN54_V2_SendCommand(0x03);
|
||||
EPD_1IN54_V2_SendData(lut[154]);
|
||||
|
||||
EPD_1IN54_V2_SendCommand(0x04);
|
||||
EPD_1IN54_V2_SendData(lut[155]);
|
||||
EPD_1IN54_V2_SendData(lut[156]);
|
||||
EPD_1IN54_V2_SendData(lut[157]);
|
||||
|
||||
EPD_1IN54_V2_SendCommand(0x2c);
|
||||
EPD_1IN54_V2_SendData(lut[158]);
|
||||
}
|
||||
|
||||
static void EPD_1IN54_V2_SetWindows(UWORD Xstart, UWORD Ystart, UWORD Xend, UWORD Yend)
|
||||
{
|
||||
EPD_1IN54_V2_SendCommand(0x44); // SET_RAM_X_ADDRESS_START_END_POSITION
|
||||
EPD_1IN54_V2_SendData((Xstart>>3) & 0xFF);
|
||||
EPD_1IN54_V2_SendData((Xend>>3) & 0xFF);
|
||||
|
||||
EPD_1IN54_V2_SendCommand(0x45); // SET_RAM_Y_ADDRESS_START_END_POSITION
|
||||
EPD_1IN54_V2_SendData(Ystart & 0xFF);
|
||||
EPD_1IN54_V2_SendData((Ystart >> 8) & 0xFF);
|
||||
EPD_1IN54_V2_SendData(Yend & 0xFF);
|
||||
EPD_1IN54_V2_SendData((Yend >> 8) & 0xFF);
|
||||
}
|
||||
|
||||
static void EPD_1IN54_V2_SetCursor(UWORD Xstart, UWORD Ystart)
|
||||
{
|
||||
EPD_1IN54_V2_SendCommand(0x4E); // SET_RAM_X_ADDRESS_COUNTER
|
||||
EPD_1IN54_V2_SendData(Xstart & 0xFF);
|
||||
|
||||
EPD_1IN54_V2_SendCommand(0x4F); // SET_RAM_Y_ADDRESS_COUNTER
|
||||
EPD_1IN54_V2_SendData(Ystart & 0xFF);
|
||||
EPD_1IN54_V2_SendData((Ystart >> 8) & 0xFF);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
function : Initialize the e-Paper register
|
||||
parameter:
|
||||
|
|
@ -134,15 +249,7 @@ void EPD_1IN54_V2_Init(void)
|
|||
EPD_1IN54_V2_SendCommand(0x11); //data entry mode
|
||||
EPD_1IN54_V2_SendData(0x01);
|
||||
|
||||
EPD_1IN54_V2_SendCommand(0x44); //set Ram-X address start/end position
|
||||
EPD_1IN54_V2_SendData(0x00);
|
||||
EPD_1IN54_V2_SendData(0x18); //0x0C-->(18+1)*8=200
|
||||
|
||||
EPD_1IN54_V2_SendCommand(0x45); //set Ram-Y address start/end position
|
||||
EPD_1IN54_V2_SendData(0xC7); //0xC7-->(199+1)=200
|
||||
EPD_1IN54_V2_SendData(0x00);
|
||||
EPD_1IN54_V2_SendData(0x00);
|
||||
EPD_1IN54_V2_SendData(0x00);
|
||||
EPD_1IN54_V2_SetWindows(0, EPD_1IN54_V2_HEIGHT-1, EPD_1IN54_V2_WIDTH-1, 0);
|
||||
|
||||
EPD_1IN54_V2_SendCommand(0x3C); //BorderWavefrom
|
||||
EPD_1IN54_V2_SendData(0x01);
|
||||
|
|
@ -154,12 +261,41 @@ void EPD_1IN54_V2_Init(void)
|
|||
EPD_1IN54_V2_SendData(0XB1);
|
||||
EPD_1IN54_V2_SendCommand(0x20);
|
||||
|
||||
EPD_1IN54_V2_SendCommand(0x4E); // set RAM x address count to 0;
|
||||
EPD_1IN54_V2_SendData(0x00);
|
||||
EPD_1IN54_V2_SendCommand(0x4F); // set RAM y address count to 0X199;
|
||||
EPD_1IN54_V2_SendData(0xC7);
|
||||
EPD_1IN54_V2_SendData(0x00);
|
||||
EPD_1IN54_V2_SetCursor(0, EPD_1IN54_V2_HEIGHT-1);
|
||||
EPD_1IN54_V2_ReadBusy();
|
||||
|
||||
EPD_1IN54_V2_SetLut(WF_Full_1IN54);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
function : Initialize the e-Paper register (Partial display)
|
||||
parameter:
|
||||
******************************************************************************/
|
||||
void EPD_1IN54_V2_Init_Partial(void)
|
||||
{
|
||||
EPD_1IN54_V2_Reset();
|
||||
EPD_1IN54_V2_ReadBusy();
|
||||
|
||||
EPD_1IN54_V2_SetLut(WF_PARTIAL_1IN54_1);
|
||||
EPD_1IN54_V2_SendCommand(0x37);
|
||||
EPD_1IN54_V2_SendData(0x00);
|
||||
EPD_1IN54_V2_SendData(0x00);
|
||||
EPD_1IN54_V2_SendData(0x00);
|
||||
EPD_1IN54_V2_SendData(0x00);
|
||||
EPD_1IN54_V2_SendData(0x00);
|
||||
EPD_1IN54_V2_SendData(0x40);
|
||||
EPD_1IN54_V2_SendData(0x00);
|
||||
EPD_1IN54_V2_SendData(0x00);
|
||||
EPD_1IN54_V2_SendData(0x00);
|
||||
EPD_1IN54_V2_SendData(0x00);
|
||||
|
||||
EPD_1IN54_V2_SendCommand(0x3C); //BorderWavefrom
|
||||
EPD_1IN54_V2_SendData(0x80);
|
||||
|
||||
EPD_1IN54_V2_SendCommand(0x22);
|
||||
EPD_1IN54_V2_SendData(0xc0);
|
||||
EPD_1IN54_V2_SendCommand(0x20);
|
||||
EPD_1IN54_V2_ReadBusy();
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
|
|
@ -178,6 +314,12 @@ void EPD_1IN54_V2_Clear(void)
|
|||
EPD_1IN54_V2_SendData(0XFF);
|
||||
}
|
||||
}
|
||||
EPD_1IN54_V2_SendCommand(0x26);
|
||||
for (UWORD j = 0; j < Height; j++) {
|
||||
for (UWORD i = 0; i < Width; i++) {
|
||||
EPD_1IN54_V2_SendData(0XFF);
|
||||
}
|
||||
}
|
||||
EPD_1IN54_V2_TurnOnDisplay();
|
||||
}
|
||||
|
||||
|
|
@ -240,13 +382,6 @@ void EPD_1IN54_V2_DisplayPart(UBYTE *Image)
|
|||
UWORD Width, Height;
|
||||
Width = (EPD_1IN54_V2_WIDTH % 8 == 0)? (EPD_1IN54_V2_WIDTH / 8 ): (EPD_1IN54_V2_WIDTH / 8 + 1);
|
||||
Height = EPD_1IN54_V2_HEIGHT;
|
||||
|
||||
DEV_Digital_Write(EPD_RST_PIN, 0);
|
||||
DEV_Delay_ms(10);
|
||||
DEV_Digital_Write(EPD_RST_PIN, 1);
|
||||
DEV_Delay_ms(10);
|
||||
EPD_1IN54_V2_SendCommand(0x3C); //BorderWavefrom
|
||||
EPD_1IN54_V2_SendData(0x80);
|
||||
|
||||
UDOUBLE Addr = 0;
|
||||
EPD_1IN54_V2_SendCommand(0x24);
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@
|
|||
#define EPD_1IN54_V2_HEIGHT 200
|
||||
|
||||
void EPD_1IN54_V2_Init(void);
|
||||
void EPD_1IN54_V2_Init_Partial(void);
|
||||
void EPD_1IN54_V2_Clear(void);
|
||||
void EPD_1IN54_V2_Display(UBYTE *Image);
|
||||
void EPD_1IN54_V2_DisplayPartBaseImage(UBYTE *Image);
|
||||
|
|
|
|||
|
|
@ -54,6 +54,29 @@ UBYTE _WF_PARTIAL_2IN9[159] =
|
|||
0x22,0x17,0x41,0xB0,0x32,0x36,
|
||||
};
|
||||
|
||||
UBYTE WS_20_30[159] =
|
||||
{
|
||||
0x80, 0x66, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x40, 0x0, 0x0, 0x0,
|
||||
0x10, 0x66, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x20, 0x0, 0x0, 0x0,
|
||||
0x80, 0x66, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x40, 0x0, 0x0, 0x0,
|
||||
0x10, 0x66, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x20, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x14, 0x8, 0x0, 0x0, 0x0, 0x0, 0x1,
|
||||
0xA, 0xA, 0x0, 0xA, 0xA, 0x0, 0x1,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x14, 0x8, 0x0, 0x1, 0x0, 0x0, 0x1,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x0, 0x0, 0x0,
|
||||
0x22, 0x17, 0x41, 0x0, 0x32, 0x36
|
||||
};
|
||||
|
||||
/******************************************************************************
|
||||
function : Software reset
|
||||
parameter:
|
||||
|
|
@ -111,15 +134,31 @@ void EPD_2IN9_V2_ReadBusy(void)
|
|||
Debug("e-Paper busy release\r\n");
|
||||
}
|
||||
|
||||
static void EPD_2IN9_V2_LUT(void)
|
||||
static void EPD_2IN9_V2_LUT(UBYTE *lut)
|
||||
{
|
||||
UBYTE count;
|
||||
EPD_2IN9_V2_SendCommand(0x32);
|
||||
for(count=0; count<153; count++)
|
||||
EPD_2IN9_V2_SendData(_WF_PARTIAL_2IN9[count]);
|
||||
EPD_2IN9_V2_SendData(lut[count]);
|
||||
EPD_2IN9_V2_ReadBusy();
|
||||
}
|
||||
|
||||
static void EPD_2IN9_V2_LUT_by_host(UBYTE *lut)
|
||||
{
|
||||
EPD_2IN9_V2_LUT((UBYTE *)lut); //lut
|
||||
EPD_2IN9_V2_SendCommand(0x3f);
|
||||
EPD_2IN9_V2_SendData(*(lut+153));
|
||||
EPD_2IN9_V2_SendCommand(0x03); // gate voltage
|
||||
EPD_2IN9_V2_SendData(*(lut+154));
|
||||
EPD_2IN9_V2_SendCommand(0x04); // source voltage
|
||||
EPD_2IN9_V2_SendData(*(lut+155)); // VSH
|
||||
EPD_2IN9_V2_SendData(*(lut+156)); // VSH2
|
||||
EPD_2IN9_V2_SendData(*(lut+157)); // VSL
|
||||
EPD_2IN9_V2_SendCommand(0x2c); // VCOM
|
||||
EPD_2IN9_V2_SendData(*(lut+158));
|
||||
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
function : Turn On Display
|
||||
parameter:
|
||||
|
|
@ -127,7 +166,7 @@ parameter:
|
|||
static void EPD_2IN9_V2_TurnOnDisplay(void)
|
||||
{
|
||||
EPD_2IN9_V2_SendCommand(0x22); //Display Update Control
|
||||
EPD_2IN9_V2_SendData(0xF7);
|
||||
EPD_2IN9_V2_SendData(0xc7);
|
||||
EPD_2IN9_V2_SendCommand(0x20); //Activate Display Update Sequence
|
||||
EPD_2IN9_V2_ReadBusy();
|
||||
}
|
||||
|
|
@ -194,18 +233,20 @@ void EPD_2IN9_V2_Init(void)
|
|||
|
||||
EPD_2IN9_V2_SetWindows(0, 0, EPD_2IN9_V2_WIDTH-1, EPD_2IN9_V2_HEIGHT-1);
|
||||
|
||||
EPD_2IN9_V2_SendCommand(0x3C); //BorderWavefrom
|
||||
EPD_2IN9_V2_SendData(0x05);
|
||||
// EPD_2IN9_V2_SendCommand(0x3C); //BorderWavefrom
|
||||
// EPD_2IN9_V2_SendData(0x05);
|
||||
|
||||
EPD_2IN9_V2_SendCommand(0x21); // Display update control
|
||||
EPD_2IN9_V2_SendData(0x00);
|
||||
EPD_2IN9_V2_SendData(0x80);
|
||||
|
||||
EPD_2IN9_V2_SendCommand(0x18); //Read built-in temperature sensor
|
||||
EPD_2IN9_V2_SendData(0x80);
|
||||
// EPD_2IN9_V2_SendCommand(0x18); //Read built-in temperature sensor
|
||||
// EPD_2IN9_V2_SendData(0x80);
|
||||
|
||||
EPD_2IN9_V2_SetCursor(0, 0);
|
||||
EPD_2IN9_V2_ReadBusy();
|
||||
|
||||
EPD_2IN9_V2_LUT_by_host(WS_20_30);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
|
|
@ -261,11 +302,11 @@ void EPD_2IN9_V2_Display_Partial(UBYTE *Image)
|
|||
|
||||
//Reset
|
||||
DEV_Digital_Write(EPD_RST_PIN, 0);
|
||||
DEV_Delay_ms(5);
|
||||
DEV_Delay_ms(2);
|
||||
DEV_Digital_Write(EPD_RST_PIN, 1);
|
||||
DEV_Delay_ms(10);
|
||||
DEV_Delay_ms(2);
|
||||
|
||||
EPD_2IN9_V2_LUT();
|
||||
EPD_2IN9_V2_LUT(_WF_PARTIAL_2IN9);
|
||||
EPD_2IN9_V2_SendCommand(0x37);
|
||||
EPD_2IN9_V2_SendData(0x00);
|
||||
EPD_2IN9_V2_SendData(0x00);
|
||||
|
|
|
|||
|
|
@ -31,6 +31,60 @@
|
|||
#include "EPD_7in5_V2.h"
|
||||
#include "Debug.h"
|
||||
|
||||
UBYTE Voltage_Frame_7IN5_V2[]={
|
||||
0x6, 0x3F, 0x3F, 0x11, 0x24, 0x7, 0x17,
|
||||
};
|
||||
|
||||
UBYTE LUT_VCOM_7IN5_V2[]={
|
||||
0x0, 0xF, 0xF, 0x0, 0x0, 0x1,
|
||||
0x0, 0xF, 0x1, 0xF, 0x1, 0x2,
|
||||
0x0, 0xF, 0xF, 0x0, 0x0, 0x1,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
};
|
||||
|
||||
UBYTE LUT_WW_7IN5_V2[]={
|
||||
0x10, 0xF, 0xF, 0x0, 0x0, 0x1,
|
||||
0x84, 0xF, 0x1, 0xF, 0x1, 0x2,
|
||||
0x20, 0xF, 0xF, 0x0, 0x0, 0x1,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
};
|
||||
|
||||
UBYTE LUT_BW_7IN5_V2[]={
|
||||
0x10, 0xF, 0xF, 0x0, 0x0, 0x1,
|
||||
0x84, 0xF, 0x1, 0xF, 0x1, 0x2,
|
||||
0x20, 0xF, 0xF, 0x0, 0x0, 0x1,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
};
|
||||
|
||||
UBYTE LUT_WB_7IN5_V2[]={
|
||||
0x80, 0xF, 0xF, 0x0, 0x0, 0x1,
|
||||
0x84, 0xF, 0x1, 0xF, 0x1, 0x2,
|
||||
0x40, 0xF, 0xF, 0x0, 0x0, 0x1,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
};
|
||||
|
||||
UBYTE LUT_BB_7IN5_V2[]={
|
||||
0x80, 0xF, 0xF, 0x0, 0x0, 0x1,
|
||||
0x84, 0xF, 0x1, 0xF, 0x1, 0x2,
|
||||
0x40, 0xF, 0xF, 0x0, 0x0, 0x1,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
};
|
||||
|
||||
/******************************************************************************
|
||||
function : Software reset
|
||||
parameter:
|
||||
|
|
@ -89,6 +143,30 @@ static void EPD_WaitUntilIdle(void)
|
|||
|
||||
}
|
||||
|
||||
static void EPD_7IN5_V2_LUT(UBYTE* lut_vcom, UBYTE* lut_ww, UBYTE* lut_bw, UBYTE* lut_wb, UBYTE* lut_bb)
|
||||
{
|
||||
UBYTE count;
|
||||
|
||||
EPD_SendCommand(0x20); //VCOM
|
||||
for(count=0; count<60; count++)
|
||||
EPD_SendData(lut_vcom[count]);
|
||||
|
||||
EPD_SendCommand(0x21); //LUTBW
|
||||
for(count=0; count<60; count++)
|
||||
EPD_SendData(lut_ww[count]);
|
||||
|
||||
EPD_SendCommand(0x22); //LUTBW
|
||||
for(count=0; count<60; count++)
|
||||
EPD_SendData(lut_bw[count]);
|
||||
|
||||
EPD_SendCommand(0x23); //LUTWB
|
||||
for(count=0; count<60; count++)
|
||||
EPD_SendData(lut_wb[count]);
|
||||
|
||||
EPD_SendCommand(0x24); //LUTBB
|
||||
for(count=0; count<60; count++)
|
||||
EPD_SendData(lut_bb[count]);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
function : Turn On Display
|
||||
|
|
@ -109,18 +187,60 @@ UBYTE EPD_7IN5_V2_Init(void)
|
|||
{
|
||||
EPD_Reset();
|
||||
|
||||
EPD_SendCommand(0x01); //POWER SETTING
|
||||
EPD_SendData(0x07);
|
||||
EPD_SendData(0x07); //VGH=20V,VGL=-20V
|
||||
EPD_SendData(0x3f); //VDH=15V
|
||||
EPD_SendData(0x3f); //VDL=-15V
|
||||
// EPD_SendCommand(0x01); //POWER SETTING
|
||||
// EPD_SendData(0x07);
|
||||
// EPD_SendData(0x07); //VGH=20V,VGL=-20V
|
||||
// EPD_SendData(0x3f); //VDH=15V
|
||||
// EPD_SendData(0x3f); //VDL=-15V
|
||||
|
||||
// EPD_SendCommand(0x04); //POWER ON
|
||||
// DEV_Delay_ms(100);
|
||||
// EPD_WaitUntilIdle();
|
||||
|
||||
// EPD_SendCommand(0X00); //PANNEL SETTING
|
||||
// EPD_SendData(0x1F); //KW-3f KWR-2F BWROTP 0f BWOTP 1f
|
||||
|
||||
// EPD_SendCommand(0x61); //tres
|
||||
// EPD_SendData(0x03); //source 800
|
||||
// EPD_SendData(0x20);
|
||||
// EPD_SendData(0x01); //gate 480
|
||||
// EPD_SendData(0xE0);
|
||||
|
||||
// EPD_SendCommand(0X15);
|
||||
// EPD_SendData(0x00);
|
||||
|
||||
// EPD_SendCommand(0X50); //VCOM AND DATA INTERVAL SETTING
|
||||
// EPD_SendData(0x10);
|
||||
// EPD_SendData(0x07);
|
||||
|
||||
// EPD_SendCommand(0X60); //TCON SETTING
|
||||
// EPD_SendData(0x22);
|
||||
|
||||
EPD_SendCommand(0x01); // power setting
|
||||
EPD_SendData(0x17); // 1-0=11: internal power
|
||||
EPD_SendData(*(Voltage_Frame_7IN5_V2+6)); // VGH&VGL
|
||||
EPD_SendData(*(Voltage_Frame_7IN5_V2+1)); // VSH
|
||||
EPD_SendData(*(Voltage_Frame_7IN5_V2+2)); // VSL
|
||||
EPD_SendData(*(Voltage_Frame_7IN5_V2+3)); // VSHR
|
||||
|
||||
EPD_SendCommand(0x82); // VCOM DC Setting
|
||||
EPD_SendData(*(Voltage_Frame_7IN5_V2+4)); // VCOM
|
||||
|
||||
EPD_SendCommand(0x06); // Booster Setting
|
||||
EPD_SendData(0x27);
|
||||
EPD_SendData(0x27);
|
||||
EPD_SendData(0x2F);
|
||||
EPD_SendData(0x17);
|
||||
|
||||
EPD_SendCommand(0x30); // OSC Setting
|
||||
EPD_SendData(*(Voltage_Frame_7IN5_V2+0)); // 2-0=100: N=4 ; 5-3=111: M=7 ; 3C=50Hz 3A=100HZ
|
||||
|
||||
EPD_SendCommand(0x04); //POWER ON
|
||||
DEV_Delay_ms(100);
|
||||
EPD_WaitUntilIdle();
|
||||
|
||||
EPD_SendCommand(0X00); //PANNEL SETTING
|
||||
EPD_SendData(0x1F); //KW-3f KWR-2F BWROTP 0f BWOTP 1f
|
||||
EPD_SendData(0x3F); //KW-3f KWR-2F BWROTP 0f BWOTP 1f
|
||||
|
||||
EPD_SendCommand(0x61); //tres
|
||||
EPD_SendData(0x03); //source 800
|
||||
|
|
@ -133,11 +253,19 @@ UBYTE EPD_7IN5_V2_Init(void)
|
|||
|
||||
EPD_SendCommand(0X50); //VCOM AND DATA INTERVAL SETTING
|
||||
EPD_SendData(0x10);
|
||||
EPD_SendData(0x07);
|
||||
EPD_SendData(0x00);
|
||||
|
||||
EPD_SendCommand(0X60); //TCON SETTING
|
||||
EPD_SendData(0x22);
|
||||
|
||||
EPD_SendCommand(0x65); // Resolution setting
|
||||
EPD_SendData(0x00);
|
||||
EPD_SendData(0x00);//800*480
|
||||
EPD_SendData(0x00);
|
||||
EPD_SendData(0x00);
|
||||
|
||||
EPD_7IN5_V2_LUT(LUT_VCOM_7IN5_V2, LUT_WW_7IN5_V2, LUT_BW_7IN5_V2, LUT_WB_7IN5_V2, LUT_BB_7IN5_V2);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -23,4 +23,5 @@
|
|||
2020-12-09:添加新程序2.9inch V2 e-Paper例程。
|
||||
2020-12-09:添加新程序5.83inch V2 e-Paper例程。
|
||||
2020-12-25:添加新程序4.01inch (F) e-Paper例程。
|
||||
2021-02-22:添加新程序2.7inch B V2 e-Paper例程。
|
||||
2021-02-22:添加新程序2.7inch B V2 e-Paper例程。
|
||||
2021-07-19: 1.54V2、2.13V3、2.9V2、7.5V2程序均采用外部波形,并提升了刷新速度
|
||||
|
|
@ -22,4 +22,5 @@
|
|||
2020-12-09: Added new program 2.9inch V2 e-Paper routine.
|
||||
2020-12-09: Added new program 5.83inch V2 e-Paper routine.
|
||||
2020-12-25: Added new program 4.01inch (F) e-Paper routine.
|
||||
2021-02-22: Added new program 2.7inch B V2 e-Paper routine.
|
||||
2021-02-22: Added new program 2.7inch B V2 e-Paper routine.
|
||||
2021-07-19: 1.54v2, 2.13v3, 2.9v2, and 7.5v2 programs all use external waveforms and have improved refresh speed.
|
||||