{
Epaper_Write_Data(*datas);
datas++;
}
EPD_Part_Update();
}
void EPD_DeepSleep(void)
{
Epaper_Write_Command(0x10); //enter deep sleep
Epaper_Write_Data(0x01);
driver_delay_xms(100);
}
/////////////////////////////////Single display////////////////////////////////////////////////
void EPD_WhiteScreen_White(void)
{
unsigned int i,k;
Epaper_Write_Command(0x24); //write RAM for black(0)/white (1)
for(k=0;k<250;k++)
{
for(i=0;i<25;i++)
{
Epaper_Write_Data(0xff);
}
}
EPD_Update();
}
/////////////////////////////////////TIME///////////////////////////////////////////////////
void EPD_Dis_Part_myself(unsigned int x_startA,unsigned int y_startA,const unsigned char * datasA,
unsigned int x_startB,unsigned int y_startB,const unsigned char * datasB,
unsigned int x_startC,unsigned int y_startC,const unsigned char * datasC,
unsigned int x_startD,unsigned int y_startD,const unsigned char * datasD,
unsigned int x_startE,unsigned int y_startE,const unsigned char * datasE,
unsigned int PART_COLUMN,unsigned int PART_LINE
)
{
unsigned int i;
unsigned int x_end,y_start1,y_start2,y_end1,y_end2;
//Data A////////////////////////////
x_startA=x_startA/8;//Convert to byte
x_end=x_startA+PART_LINE/8-1;
y_start1=0;
y_start2=y_startA-1;
if(y_startA>=256)
{
y_start1=y_start2/256;
y_start2=y_start2%256;
}
y_end1=0;
y_end2=y_startA+PART_COLUMN-1;
if(y_end2>=256)
{
y_end1=y_end2/256;
y_end2=y_end2%256;
}
// Add hardware reset to prevent background color change
EPD_W21_RST_0; // Module reset
driver_delay_xms(100);//At least 10ms delay
EPD_W21_RST_1;
driver_delay_xms(100); //At least 10ms delay
//Lock the border to prevent flashing
Epaper_Write_Command(0x3C); //BorderWavefrom,
Epaper_Write_Data(0x80);
//
Epaper_Write_Command(0x44); // set RAM x address start/end, in page 35
Epaper_Write_Data(x_startA); // RAM x address start at 00h;
Epaper_Write_Data(x_end); // RAM x address end at 0fh(15+1)*8->128
Epaper_Write_Command(0x45); // set RAM y address start/end, in page 35
Epaper_Write_Data(y_start2); // RAM y address start at 0127h;
Epaper_Write_Data(y_start1); // RAM y address start at 0127h;
Epaper_Write_Data(y_end2); // RAM y address end at 00h;
Epaper_Write_Data(y_end1);
Epaper_Write_Command(0x4E); // set RAM x address count to 0;
Epaper_Write_Data(x_startA);
Epaper_Write_Command(0x4F); // set RAM y address count to 0X127;
Epaper_Write_Data(y_start2);
Epaper_Write_Data(y_start1);
Epaper_Write_Command(0x24); //Write Black and White image to RAM
for(i=0;i
{
Epaper_Write_Data(*datasA);
datasA++;
}
//Data B/////////////////////////////////////
x_startB=x_startB/8;//Convert to byte
x_end=x_startB+PART_LINE/8-1;
y_start1=0;
y_start2=y_startB-1;
if(y_startB>=256)
{
y_start1=y_start2/256;
y_start2=y_start2%256;
}
y_end1=0;
y_end2=y_startB+PART_COLUMN-1;
if(y_end2>=256)
{
y_end1=y_end2/256;
y_end2=y_end2%256;
}
Epaper_Write_Command(0x44); // set RAM x address start/end, in page 35
Epaper_Write_Data(x_startB); // RAM x address start at 00h;
Epaper_Write_Data(x_end); // RAM x address end at 0fh(15+1)*8->128
Epaper_Write_Command(0x45); // set RAM y address start/end, in page 35
Epaper_Write_Data(y_start2); // RAM y address start at 0127h;
Epaper_Write_Data(y_start1); // RAM y address start at 0127h;
Epaper_Write_Data(y_end2); // RAM y address end at 00h;
Epaper_Write_Data(y_end1);
Epaper_Write_Command(0x4E); // set RAM x address count to 0;
Epaper_Write_Data(x_startB);
Epaper_Write_Command(0x4F); // set RAM y address count to 0X127;
Epaper_Write_Data(y_start2);
Epaper_Write_Data(y_start1);
Epaper_Write_Command(0x24); //Write Black and White image to RAM
for(i=0;i
{
Epaper_Write_Data(*datasB);
datasB++;
}
//Data C//////////////////////////////////////
x_startC=x_startC/8;//Convert to byte
x_end=x_startC+PART_LINE/8-1;
y_start1=0;
y_start2=y_startC-1;
if(y_startC>=256)
{
y_start1=y_start2/256;
y_start2=y_start2%256;
}
y_end1=0;
y_end2=y_startC+PART_COLUMN-1;
if(y_end2>=256)
{
y_end1=y_end2/256;
y_end2=y_end2%256;
}
Epaper_Write_Command(0x44); // set RAM x address start/end, in page 35
Epaper_Write_Data(x_startC); // RAM x address start at 00h;
Epaper_Write_Data(x_end); // RAM x address end at 0fh(15+1)*8->128
Epaper_Write_Command(0x45); // set RAM y address start/end, in page 35
Epaper_Write_Data(y_start2); // RAM y address start at 0127h;
Epaper_Write_Data(y_start1); // RAM y address start at 0127h;
Epaper_Write_Data(y_end2); // RAM y address end at 00h;
Epaper_Write_Data(y_end1);
Epaper_Write_Command(0x4E); // set RAM x address count to 0;
Epaper_Write_Data(x_startC);
Epaper_Write_Command(0x4F); // set RAM y address count to 0X127;
Epaper_Write_Data(y_start2);
Epaper_Write_Data(y_start1);
Epaper_Write_Command(0x24); //Write Black and White image to RAM
for(i=0;i
{
Epaper_Write_Data(*datasC);
datasC++;
}
//Data D//////////////////////////////////////
x_startD=x_startD/8;//Convert to byte
x_end=x_startD+PART_LINE/8-1;
y_start1=0;
y_start2=y_startD-1;
if(y_startD>=256)
{
y_start1=y_start2/256;
y_start2=y_start2%256;
}
y_end1=0;
y_end2=y_startD+PART_COLUMN-1;
if(y_end2>=256)
{
y_end1=y_end2/256;
y_end2=y_end2%256;
}
Epaper_Write_Command(0x44); // set RAM x address start/end, in page 35
Epaper_Write_Data(x_startD); // RAM x address start at 00h;
Epaper_Write_Data(x_end); // RAM x address end at 0fh(15+1)*8->128
Epaper_Write_Command(0x45); // set RAM y address start/end, in page 35
Epaper_Write_Data(y_start2); // RAM y address start at 0127h;
Epaper_Write_Data(y_start1); // RAM y address start at 0127h;
Epaper_Write_Data(y_end2); // RAM y address end at 00h;
Epaper_Write_Data(y_end1);
Epaper_Write_Command(0x4E); // set RAM x address count to 0;
Epaper_Write_Data(x_startD);
Epaper_Write_Command(0x4F); // set RAM y address count to 0X127;
Epaper_Write_Data(y_start2);
Epaper_Write_Data(y_start1);
Epaper_Write_Command(0x24); //Write Black and White image to RAM
for(i=0;i
{
Epaper_Write_Data(*datasD);
datasD++;
}
//Data E//////////////////////////////////////
x_startE=x_startE/8;//Convert to byte
x_end=x_startE+PART_LINE/8-1;
y_start1=0;
y_start2=y_startE-1;
if(y_startE>=256)
{
y_start1=y_start2/256;
y_start2=y_start2%256;
}
y_end1=0;
y_end2=y_startE+PART_COLUMN-1;
if(y_end2>=256)
{
y_end1=y_end2/256;
y_end2=y_end2%256;
}
Epaper_Write_Command(0x44); // set RAM x address start/end, in page 35
Epaper_Write_Data(x_startE); // RAM x address start at 00h;
Epaper_Write_Data(x_end); // RAM x address end at 0fh(15+1)*8->128
Epaper_Write_Command(0x45); // set RAM y address start/end, in page 35
Epaper_Write_Data(y_start2); // RAM y address start at 0127h;
Epaper_Write_Data(y_start1); // RAM y address start at 0127h;
Epaper_Write_Data(y_end2); // RAM y address end at 00h;
Epaper_Write_Data(y_end1);
Epaper_Write_Command(0x4E); // set RAM x address count to 0;
Epaper_Write_Data(x_startE);
Epaper_Write_Command(0x4F); // set RAM y address count to 0X127;
Epaper_Write_Data(y_start2);
Epaper_Write_Data(y_start1);
Epaper_Write_Command(0x24); //Write Black and White image to RAM
for(i=0;i
{
Epaper_Write_Data(*datasE);
datasE++;
}
EPD_Part_Update();
}
2.2、显示结果如图2.3所示
时间有限先到这里,后续有时间再整理上传蓝牙温度检测报警相关的经验,感谢益登科技给我们试用的机会。