2020-09-03

This commit is contained in:
wangkg 2020-09-04 15:30:45 +08:00
commit 751a9fb93f
570 changed files with 50854 additions and 16474 deletions

View file

@ -64,22 +64,22 @@ int EPD_1in54c_test(void)
Paint_DrawLine(20, 10, 70, 60, BLACK, DOT_PIXEL_1X1, LINE_STYLE_SOLID);
Paint_DrawLine(70, 10, 20, 60, BLACK, DOT_PIXEL_1X1, LINE_STYLE_SOLID);
Paint_DrawRectangle(20, 10, 70, 60, BLACK, DOT_PIXEL_1X1, DRAW_FILL_EMPTY);
Paint_DrawRectangle(85, 10, 130, 60, BLACK, DOT_PIXEL_1X1, DRAW_FILL_FULL);
Paint_DrawRectangle(85, 10, 135, 60, BLACK, DOT_PIXEL_1X1, DRAW_FILL_FULL);
Paint_SelectImage(YellowImage);
Paint_Clear(WHITE);
Paint_DrawPoint(5, 40, BLACK, DOT_PIXEL_3X3, DOT_STYLE_DFT);
Paint_DrawPoint(5, 55, BLACK, DOT_PIXEL_4X4, DOT_STYLE_DFT);
Paint_DrawLine(170, 15, 170, 55, BLACK, DOT_PIXEL_1X1, LINE_STYLE_DOTTED);
Paint_DrawLine(150, 35, 190, 35, BLACK, DOT_PIXEL_1X1, LINE_STYLE_DOTTED);
Paint_DrawLine(45, 10, 45, 60, BLACK, DOT_PIXEL_1X1, LINE_STYLE_DOTTED);
Paint_DrawLine(20, 35, 70, 35, BLACK, DOT_PIXEL_1X1, LINE_STYLE_DOTTED);
Paint_DrawCircle(45, 35, 15, BLACK, DOT_PIXEL_1X1, DRAW_FILL_EMPTY);
Paint_DrawCircle(105, 30, 15, BLACK, DOT_PIXEL_1X1, DRAW_FILL_FULL);
Paint_DrawCircle(110, 35, 15, BLACK, DOT_PIXEL_1X1, DRAW_FILL_FULL);
Paint_DrawString_EN(5, 70, "waveshare", &Font20, BLACK, WHITE);
Paint_DrawNum(5, 95, 123456789, &Font20, BLACK, WHITE);
Paint_DrawString_CN(5, 120,"ÄãºÃabc", &Font12CN, BLACK, WHITE);
EPD_1IN54C_Display(BlackImage, YellowImage);
DEV_Delay_ms(2000);
DEV_Delay_ms(5000);
#endif
#if 1 //show image for array
@ -91,7 +91,7 @@ int EPD_1in54c_test(void)
Paint_DrawBitMap(gImage_1in54c_Yellow);
EPD_1IN54C_Display(BlackImage, YellowImage);
DEV_Delay_ms(2000);
DEV_Delay_ms(5000);
#endif
printf("Clear...\r\n");

View file

@ -65,7 +65,7 @@ int EPD_2in13_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);
@ -97,7 +97,7 @@ int EPD_2in13_V2_test(void)
DEV_Delay_ms(2000);
#endif
#if 0 //Partial refresh, example shows time
#if 1 //Partial refresh, example shows time
printf("Partial refresh\r\n");
EPD_2IN13_V2_Init(EPD_2IN13_V2_FULL);
EPD_2IN13_V2_DisplayPartBaseImage(BlackImage);

View file

@ -28,21 +28,21 @@
#
******************************************************************************/
#include "EPD_Test.h"
#include "EPD_2IN13B_V2.h"
#include "EPD_2IN13B_V3.h"
int EPD_2in13b_V2_test(void)
int EPD_2in13b_V3_test(void)
{
printf("EPD_2IN13B_V2_test Demo\r\n");
printf("EPD_2IN13B_V3_test Demo\r\n");
DEV_Module_Init();
printf("e-Paper Init and Clear...\r\n");
EPD_2IN13B_V2_Init();
EPD_2IN13B_V2_Clear();
EPD_2IN13B_V3_Init();
EPD_2IN13B_V3_Clear();
DEV_Delay_ms(500);
//Create a new image cache named IMAGE_BW and fill it with white
UBYTE *BlackImage, *RYImage; // Red or Yellow
UWORD Imagesize = ((EPD_2IN13B_V2_WIDTH % 8 == 0)? (EPD_2IN13B_V2_WIDTH / 8 ): (EPD_2IN13B_V2_WIDTH / 8 + 1)) * EPD_2IN13B_V2_HEIGHT;
UWORD Imagesize = ((EPD_2IN13B_V3_WIDTH % 8 == 0)? (EPD_2IN13B_V3_WIDTH / 8 ): (EPD_2IN13B_V3_WIDTH / 8 + 1)) * EPD_2IN13B_V3_HEIGHT;
if((BlackImage = (UBYTE *)malloc(Imagesize)) == NULL) {
printf("Failed to apply for black memory...\r\n");
return -1;
@ -52,8 +52,8 @@ int EPD_2in13b_V2_test(void)
return -1;
}
printf("NewImage:BlackImage and RYImage\r\n");
Paint_NewImage(BlackImage, EPD_2IN13B_V2_WIDTH, EPD_2IN13B_V2_HEIGHT, 270, WHITE);
Paint_NewImage(RYImage, EPD_2IN13B_V2_WIDTH, EPD_2IN13B_V2_HEIGHT, 270, WHITE);
Paint_NewImage(BlackImage, EPD_2IN13B_V3_WIDTH, EPD_2IN13B_V3_HEIGHT, 270, WHITE);
Paint_NewImage(RYImage, EPD_2IN13B_V3_WIDTH, EPD_2IN13B_V3_HEIGHT, 270, WHITE);
//Select Image
Paint_SelectImage(BlackImage);
@ -63,9 +63,9 @@ int EPD_2in13b_V2_test(void)
#if 1 // show image for array
printf("show image for array\r\n");
// EPD_2IN13B_V2_Display(gImage_2in13b_b, gImage_2in13b_r);
// EPD_2IN13B_V3_Display(gImage_2in13b_b, gImage_2in13b_r);
EPD_2IN13B_V2_Display(gImage_2in13c_b, gImage_2in13c_y);
EPD_2IN13B_V3_Display(gImage_2in13c_b, gImage_2in13c_y);
DEV_Delay_ms(2000);
#endif
@ -97,15 +97,15 @@ int EPD_2in13b_V2_test(void)
Paint_DrawNum(5, 50, 987654321, &Font16, WHITE, RED);
printf("EPD_Display\r\n");
EPD_2IN13B_V2_Display(BlackImage, RYImage);
EPD_2IN13B_V3_Display(BlackImage, RYImage);
DEV_Delay_ms(2000);
#endif
printf("Clear...\r\n");
EPD_2IN13B_V2_Clear();
EPD_2IN13B_V3_Clear();
printf("Goto Sleep...\r\n");
EPD_2IN13B_V2_Sleep();
EPD_2IN13B_V3_Sleep();
free(BlackImage);
free(RYImage);
BlackImage = NULL;

View file

@ -0,0 +1,160 @@
/*****************************************************************************
* | File : EPD_2IN66_test.c
* | Author : Waveshare team
* | Function : 2.66inch e-paper test demo
* | Info :
*----------------
* | This version: V1.0
* | Date : 2020-07-29
* | Info :
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documnetation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
******************************************************************************/
#include "EPD_Test.h"
#include "EPD_2in66.h"
int EPD_2in66_test(void)
{
printf("EPD_2IN66_test Demo\r\n");
if(DEV_Module_Init()!=0){
return -1;
}
printf("e-Paper Init and Clear...\r\n");
EPD_2IN66_Init();
EPD_2IN66_Clear();
DEV_Delay_ms(500);
//Create a new image cache
UBYTE *BlackImage;
/* you have to edit the startup_stm32fxxx.s file and set a big enough heap size */
UWORD Imagesize = ((EPD_2IN66_WIDTH % 8 == 0)? (EPD_2IN66_WIDTH / 8 ): (EPD_2IN66_WIDTH / 8 + 1)) * EPD_2IN66_HEIGHT;
if((BlackImage = (UBYTE *)malloc(Imagesize)) == NULL) {
printf("Failed to apply for black memory...\r\n");
return -1;
}
printf("Paint_NewImage\r\n");
Paint_NewImage(BlackImage, EPD_2IN66_WIDTH, EPD_2IN66_HEIGHT, 270, WHITE);
#if 1 //show image for array
printf("show image for array\r\n");
Paint_SelectImage(BlackImage);
Paint_Clear(WHITE);
Paint_DrawBitMap(gImage_2in66);
EPD_2IN66_Display(BlackImage);
DEV_Delay_ms(2000);
#endif
#if 1 // Drawing on the image
//1.Select Image
Paint_SelectImage(BlackImage);
Paint_Clear(WHITE);
// 2.Drawing on the image
printf("Drawing:BlackImage\r\n");
Paint_DrawPoint(10, 80, BLACK, DOT_PIXEL_1X1, DOT_STYLE_DFT);
Paint_DrawPoint(10, 90, BLACK, DOT_PIXEL_2X2, DOT_STYLE_DFT);
Paint_DrawPoint(10, 100, BLACK, DOT_PIXEL_3X3, DOT_STYLE_DFT);
Paint_DrawLine(20, 70, 70, 120, BLACK, DOT_PIXEL_1X1, LINE_STYLE_SOLID);
Paint_DrawLine(70, 70, 20, 120, BLACK, DOT_PIXEL_1X1, LINE_STYLE_SOLID);
Paint_DrawRectangle(20, 70, 70, 120, BLACK, DOT_PIXEL_1X1, DRAW_FILL_EMPTY);
Paint_DrawRectangle(80, 70, 130, 120, BLACK, DOT_PIXEL_1X1, DRAW_FILL_FULL);
Paint_DrawCircle(45, 95, 20, BLACK, DOT_PIXEL_1X1, DRAW_FILL_EMPTY);
Paint_DrawCircle(105, 95, 20, WHITE, DOT_PIXEL_1X1, DRAW_FILL_FULL);
Paint_DrawLine(85, 95, 125, 95, BLACK, DOT_PIXEL_1X1, LINE_STYLE_DOTTED);
Paint_DrawLine(105, 75, 105, 115, BLACK, DOT_PIXEL_1X1, LINE_STYLE_DOTTED);
Paint_DrawString_EN(10, 0, "waveshare", &Font16, BLACK, WHITE);
Paint_DrawString_EN(10, 20, "hello world", &Font12, WHITE, BLACK);
Paint_DrawNum(10, 33, 123456789, &Font12, BLACK, WHITE);
Paint_DrawNum(10, 50, 987654321, &Font16, WHITE, BLACK);
Paint_DrawString_CN(130, 0,"ÄãºÃabc", &Font12CN, BLACK, WHITE);
Paint_DrawString_CN(130, 20, "΢ѩµç×Ó", &Font24CN, WHITE, BLACK);
EPD_2IN66_Display(BlackImage);
DEV_Delay_ms(4000);
#endif
#if 1 //partial refresh, show time
printf("EPD_2IN66_DisplayPart\r\n");
EPD_2IN66_Init_Partial();
Paint_SelectImage(BlackImage);
PAINT_TIME sPaint_time; //time struct
sPaint_time.Hour = 12;
sPaint_time.Min = 34;
sPaint_time.Sec = 56;
UWORD num = 10;
for (;;) {
sPaint_time.Sec = sPaint_time.Sec + 1;
if (sPaint_time.Sec == 60) {
sPaint_time.Min = sPaint_time.Min + 1;
sPaint_time.Sec = 0;
if (sPaint_time.Min == 60) {
sPaint_time.Hour = sPaint_time.Hour + 1;
sPaint_time.Min = 0;
if (sPaint_time.Hour == 24) {
sPaint_time.Hour = 0;
sPaint_time.Min = 0;
sPaint_time.Sec = 0;
}
}
}
Paint_ClearWindows(180, 100, 296, 152, WHITE);
Paint_DrawTime(180, 110, &sPaint_time, &Font20, WHITE, BLACK);
num = num - 1;
if(num == 0) {
break;
}
printf("Part refresh...\r\n");
EPD_2IN66_Display(BlackImage);
DEV_Delay_ms(500);
}
EPD_2IN66_Clear();
#endif
printf("Clear...\r\n");
EPD_2IN66_Init();
EPD_2IN66_Clear();
printf("Goto Sleep...\r\n");
EPD_2IN66_Sleep();
free(BlackImage);
BlackImage = NULL;
// close 5V
printf("close 5V, Module enters 0 power consumption ...\r\n");
DEV_Module_Exit();
return 0;
}

View file

@ -5,7 +5,7 @@
* | Info :
*----------------
* | This version: V1.0
* | Date : 2019-06-12
* | Date : 2020-07-03
* | Info :
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
@ -64,7 +64,7 @@ int EPD_2in9b_V2_test(void)
#if 1 // show image for array
printf("show image for array\r\n");
EPD_2IN9B_V2_Display(gImage_2in9bc_b, gImage_2in9bc_ry);
DEV_Delay_ms(2000);
DEV_Delay_ms(5000);
#endif
#if 1 // Drawing on the image
@ -97,12 +97,12 @@ int EPD_2in9b_V2_test(void)
printf("EPD_Display\r\n");
EPD_2IN9B_V2_Display(BlackImage, RYImage);
DEV_Delay_ms(2000);
DEV_Delay_ms(5000);
#endif
// clear EPD
printf("Clear...\r\n");
EPD_2IN9B_V2_Clear();
//deep sleep mode, free heap ram
printf("Goto Sleep...\r\n");
EPD_2IN9B_V2_Sleep();
free(BlackImage);

View file

@ -0,0 +1,161 @@
/*****************************************************************************
* | File : EPD_3IN7_test.c
* | Author : Waveshare team
* | Function : 3.7inch e-paper test demo
* | Info :
*----------------
* | This version: V1.0
* | Date : 2020-07-17
* | Info :
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documnetation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
******************************************************************************/
#include "EPD_Test.h"
#include "EPD_3in7.h"
int EPD_3in7_test(void)
{
printf("EPD_3IN7_test Demo\r\n");
if(DEV_Module_Init()!=0){
return -1;
}
printf("e-Paper Init and Clear...\r\n");
EPD_3IN7_4Gray_Init();
EPD_3IN7_4Gray_Clear();
DEV_Delay_ms(500);
//Create a new image cache
UBYTE *BlackImage;
/* you have to edit the startup_stm32fxxx.s file and set a big enough heap size */
UWORD Imagesize = ((EPD_3IN7_WIDTH % 4 == 0)? (EPD_3IN7_WIDTH / 4 ): (EPD_3IN7_WIDTH / 4 + 1)) * EPD_3IN7_HEIGHT;
if((BlackImage = (UBYTE *)malloc(Imagesize)) == NULL) {
printf("Failed to apply for black memory...\r\n");
return -1;
}
printf("Paint_NewImage\r\n");
Paint_NewImage(BlackImage, EPD_3IN7_WIDTH, EPD_3IN7_HEIGHT, 270, WHITE);
Paint_SetScale(4);
Paint_Clear(WHITE);
#if 1 //show image for array
printf("show image for array\r\n");
Paint_SelectImage(BlackImage);
Paint_SetScale(4);
Paint_Clear(WHITE);
Paint_DrawBitMap(gImage_3in7);
EPD_3IN7_4Gray_Display(BlackImage);
DEV_Delay_ms(4000);
#endif
#if 1 // Drawing on the image, partial display
//1.Select Image
printf("SelectImage:BlackImage\r\n");
Paint_SelectImage(BlackImage);
Paint_SetScale(4);
Paint_Clear(WHITE);
// 2.Drawing on the image
printf("Drawing:BlackImage\r\n");
Paint_DrawPoint(10, 80, BLACK, DOT_PIXEL_1X1, DOT_STYLE_DFT);
Paint_DrawPoint(10, 90, BLACK, DOT_PIXEL_2X2, DOT_STYLE_DFT);
Paint_DrawPoint(10, 100, BLACK, DOT_PIXEL_3X3, DOT_STYLE_DFT);
Paint_DrawLine(20, 70, 70, 120, BLACK, DOT_PIXEL_1X1, LINE_STYLE_SOLID);
Paint_DrawLine(70, 70, 20, 120, BLACK, DOT_PIXEL_1X1, LINE_STYLE_SOLID);
Paint_DrawRectangle(20, 70, 70, 120, BLACK, DOT_PIXEL_1X1, DRAW_FILL_EMPTY);
Paint_DrawRectangle(80, 70, 130, 120, BLACK, DOT_PIXEL_1X1, DRAW_FILL_FULL);
Paint_DrawCircle(45, 95, 20, BLACK, DOT_PIXEL_1X1, DRAW_FILL_EMPTY);
Paint_DrawCircle(105, 95, 20, WHITE, DOT_PIXEL_1X1, DRAW_FILL_FULL);
Paint_DrawLine(85, 95, 125, 95, BLACK, DOT_PIXEL_1X1, LINE_STYLE_DOTTED);
Paint_DrawLine(105, 75, 105, 115, BLACK, DOT_PIXEL_1X1, LINE_STYLE_DOTTED);
Paint_DrawString_EN(10, 0, "waveshare", &Font16, BLACK, WHITE);
Paint_DrawString_EN(10, 20, "hello world", &Font12, WHITE, BLACK);
Paint_DrawNum(10, 33, 123456789, &Font12, BLACK, WHITE);
Paint_DrawNum(10, 50, 987654321, &Font16, WHITE, BLACK);
Paint_DrawString_EN(10, 150, "GRAY1 with black background", &Font24, BLACK, GRAY1);
Paint_DrawString_EN(10, 175, "GRAY2 with white background", &Font24, WHITE, GRAY2);
Paint_DrawString_EN(10, 200, "GRAY3 with white background", &Font24, WHITE, GRAY3);
Paint_DrawString_EN(10, 225, "GRAY4 with white background", &Font24, WHITE, GRAY4);
printf("EPD_Display\r\n");
EPD_3IN7_4Gray_Display(BlackImage);
DEV_Delay_ms(4000);
#endif
#if 1 // partial update, just 1 Gray mode
EPD_3IN7_1Gray_Init(); //init 1 Gray mode
EPD_3IN7_1Gray_Clear();
Paint_SelectImage(BlackImage);
Paint_SetScale(2);
Paint_Clear(WHITE);
printf("show time, partial update, just 1 Gary mode\r\n");
PAINT_TIME sPaint_time;
sPaint_time.Hour = 12;
sPaint_time.Min = 34;
sPaint_time.Sec = 56;
UBYTE num = 10;
for (;;) {
sPaint_time.Sec = sPaint_time.Sec + 1;
if (sPaint_time.Sec == 60) {
sPaint_time.Min = sPaint_time.Min + 1;
sPaint_time.Sec = 0;
if (sPaint_time.Min == 60) {
sPaint_time.Hour = sPaint_time.Hour + 1;
sPaint_time.Min = 0;
if (sPaint_time.Hour == 24) {
sPaint_time.Hour = 0;
sPaint_time.Min = 0;
sPaint_time.Sec = 0;
}
}
}
Paint_ClearWindows(300, 0, 479, 80, WHITE);
Paint_DrawTime(300, 20, &sPaint_time, &Font20, WHITE, BLACK);
num = num - 1;
if(num == 0) {
break;
}
printf("Part refresh...\r\n");
EPD_3IN7_1Gray_Display(BlackImage);
// EPD_3IN7_1Gray_Display_Part(BlackImage, 0, 0, 279, 180);
DEV_Delay_ms(500);
}
#endif
EPD_3IN7_4Gray_Init();
printf("Clear...\r\n");
EPD_3IN7_4Gray_Clear();
// Sleep & close 5V
printf("Goto Sleep...\r\n");
EPD_3IN7_Sleep();
free(BlackImage);
BlackImage = NULL;
printf("close 5V, Module enters 0 power consumption ...\r\n");
DEV_Module_Exit();
return 0;
}

View file

@ -0,0 +1,110 @@
/*****************************************************************************
* | File : EPD_5in65f_test.c
* | Author : Waveshare team
* | Function : 5.83inch F e-paper test demo
* | Info :
*----------------
* | This version: V1.0
* | Date : 2020-07-07
* | Info :
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documnetation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
******************************************************************************/
#include "EPD_5in65f.h"
#include "EPD_Test.h"
int EPD_5in65f_test(void)
{
printf("EPD_5in65F_test Demo\r\n");
if(DEV_Module_Init()!=0){
return -1;
}
printf("e-Paper Init and Clear...\r\n");
EPD_5IN65F_Init();
EPD_5IN65F_Clear(EPD_5IN65F_WHITE);
DEV_Delay_ms(100);
UBYTE *BlackImage;
/* you have to edit the startup_stm32fxxx.s file and set a big enough heap size */
UDOUBLE Imagesize = ((EPD_5IN65F_WIDTH % 2 == 0)? (EPD_5IN65F_WIDTH / 2 ): (EPD_5IN65F_WIDTH / 2 + 1)) * EPD_5IN65F_HEIGHT;
Imagesize = Imagesize/4;
printf("Not enough memory, only part of the window is displayed\r\n");
printf("Imagesize %d\r\n",Imagesize);
if((BlackImage = (UBYTE *)malloc(Imagesize)) == NULL) {
printf("Failed to apply for black memory...\r\n");
return -1;
}
Paint_NewImage(BlackImage, EPD_5IN65F_WIDTH/2, EPD_5IN65F_HEIGHT/2, 0, EPD_5IN65F_WHITE);
Paint_SetScale(7);
#if 0
EPD_5IN65F_Display_part(gImage_5in65f, 204, 153, 192, 143);
DEV_Delay_ms(5000);
#endif
#if 1
Paint_Clear(EPD_5IN65F_GREEN);
printf("Drawing:BlackImage\r\n");
Paint_DrawPoint(10, 80, BLACK, DOT_PIXEL_1X1, DOT_STYLE_DFT);
Paint_DrawPoint(10, 90, BLACK, DOT_PIXEL_2X2, DOT_STYLE_DFT);
Paint_DrawPoint(10, 100, BLACK, DOT_PIXEL_3X3, DOT_STYLE_DFT);
Paint_DrawLine(20, 70, 70, 120, BLACK, DOT_PIXEL_1X1, LINE_STYLE_SOLID);
Paint_DrawLine(70, 70, 20, 120, BLACK, DOT_PIXEL_1X1, LINE_STYLE_SOLID);
Paint_DrawRectangle(20, 70, 70, 120, BLACK, DOT_PIXEL_1X1, DRAW_FILL_EMPTY);
Paint_DrawRectangle(80, 70, 130, 120, BLACK, DOT_PIXEL_1X1, DRAW_FILL_FULL);
Paint_DrawCircle(45, 95, 20, BLACK, DOT_PIXEL_1X1, DRAW_FILL_EMPTY);
Paint_DrawCircle(105, 95, 20, WHITE, DOT_PIXEL_1X1, DRAW_FILL_FULL);
Paint_DrawLine(85, 95, 125, 95, BLACK, DOT_PIXEL_1X1, LINE_STYLE_DOTTED);
Paint_DrawLine(105, 75, 105, 115, BLACK, DOT_PIXEL_1X1, LINE_STYLE_DOTTED);
Paint_DrawString_EN(10, 0, "waveshare", &Font16, BLACK, WHITE);
Paint_DrawString_EN(10, 20, "hello world", &Font12, WHITE, BLACK);
Paint_DrawNum(10, 33, 123456789, &Font12, BLACK, WHITE);
Paint_DrawNum(10, 50, 987654321, &Font16, WHITE, BLACK);
Paint_DrawString_CN(10, 120, "ÄãºÃabc", &Font12CN, EPD_5IN65F_BLACK, WHITE);
Paint_DrawString_CN(10, 140, "ÄãºÃabc", &Font12CN, EPD_5IN65F_GREEN, WHITE);
Paint_DrawString_CN(10, 160, "ÄãºÃabc", &Font12CN, EPD_5IN65F_BLUE, WHITE);
Paint_DrawString_CN(10, 180, "ÄãºÃabc", &Font12CN, EPD_5IN65F_RED, WHITE);
Paint_DrawString_CN(10, 200, "ÄãºÃabc", &Font12CN, EPD_5IN65F_ORANGE, WHITE);
Paint_DrawString_CN(150, 0, "΢ѩµç×Ó", &Font24CN, WHITE, BLACK);
Paint_DrawString_CN(150, 40, "΢ѩµç×Ó", &Font24CN, EPD_5IN65F_GREEN, BLACK);
Paint_DrawString_CN(150, 80, "΢ѩµç×Ó", &Font24CN, EPD_5IN65F_BLUE, BLACK);
Paint_DrawString_CN(150, 120, "΢ѩµç×Ó", &Font24CN, EPD_5IN65F_RED, BLACK);
Paint_DrawString_CN(150, 160, "΢ѩµç×Ó", &Font24CN, EPD_5IN65F_YELLOW, BLACK);
EPD_5IN65F_Display_part(BlackImage, 0, 0, 300, 224);
DEV_Delay_ms(5000);
#endif
printf("e-Paper Clear...\r\n");
EPD_5IN65F_Clear(EPD_5IN65F_WHITE);
DEV_Delay_ms(1000);
EPD_5IN65F_Sleep();
free(BlackImage);
BlackImage = NULL;
// close 5V
printf("close 5V, Module enters 0 power consumption ...\r\n");
DEV_Module_Exit();
return 0;
}

View file

@ -0,0 +1,143 @@
/*****************************************************************************
* | File : EPD_5in83b_V2_test.c
* | Author : Waveshare team
* | Function : 5.83inch B V2 e-paper test demo
* | Info :
*----------------
* | This version: V1.0
* | Date : 2020-07-04
* | Info :
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documnetation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
******************************************************************************/
#include "EPD_Test.h"
#include "EPD_5in83b_V2.h"
#include "ImageData.h"
int EPD_5in83b_V2_test(void)
{
printf("EPD_5in83b_V2_test Demo\r\n");
DEV_Module_Init();
printf("e-Paper Init and Clear...\r\n");
EPD_5IN83B_V2_Init();
EPD_5IN83B_V2_Clear();
DEV_Delay_ms(500);
//Create a new image cache named IMAGE_BW and fill it with white
UBYTE *BlackImage;
UWORD Imagesize = ((EPD_5IN83B_V2_WIDTH % 8 == 0)? (EPD_5IN83B_V2_WIDTH / 8 ): (EPD_5IN83B_V2_WIDTH / 8 + 1)) * EPD_5IN83B_V2_HEIGHT;
if((BlackImage = (UBYTE *)malloc(Imagesize / 4)) == NULL) {
printf("Failed to apply for black memory...\r\n");
return -1;
}
printf("NewImage:BlackImage and RYImage\r\n");
Paint_NewImage(BlackImage, EPD_5IN83B_V2_WIDTH, EPD_5IN83B_V2_HEIGHT, 0, WHITE);
#if 1
EPD_5IN83B_V2_Display(gImage_5in83b_V2_b, gImage_5in83b_V2_r);
DEV_Delay_ms(5000);
#endif
#if 1 // Drawing on the image
/*Horizontal screen*/
//1.Draw black image
printf("Drawing on the image \r\n");
Paint_Clear(WHITE);
Paint_DrawPoint(10, 80, BLACK, DOT_PIXEL_1X1, DOT_STYLE_DFT);
Paint_DrawPoint(10, 90, BLACK, DOT_PIXEL_2X2, DOT_STYLE_DFT);
Paint_DrawPoint(10, 100, BLACK, DOT_PIXEL_3X3, DOT_STYLE_DFT);
Paint_DrawPoint(10, 110, BLACK, DOT_PIXEL_3X3, DOT_STYLE_DFT);
Paint_DrawLine(20, 70, 70, 120, BLACK, DOT_PIXEL_1X1, LINE_STYLE_SOLID);
Paint_DrawLine(70, 70, 20, 120, BLACK, DOT_PIXEL_1X1, LINE_STYLE_SOLID);
Paint_DrawRectangle(20, 70, 70, 120, BLACK, DOT_PIXEL_1X1, DRAW_FILL_EMPTY);
Paint_DrawRectangle(80, 70, 130, 120, BLACK, DOT_PIXEL_1X1, DRAW_FILL_FULL);
Paint_DrawString_EN(10, 0, "waveshare", &Font16, BLACK, WHITE);
Paint_DrawString_CN(130, 20, "΢ѩµç×Ó", &Font24CN, WHITE, BLACK);
Paint_DrawNum(10, 50, 987654321, &Font16, WHITE, BLACK);
EPD_5IN83B_V2_DisplayPicture(BlackImage,0);
Paint_Clear(WHITE);
EPD_5IN83B_V2_DisplayPicture(BlackImage,1);
Paint_Clear(WHITE);
Paint_DrawCircle(160, 95, 20, BLACK, DOT_PIXEL_1X1, DRAW_FILL_EMPTY);
Paint_DrawCircle(210, 95, 20, BLACK, DOT_PIXEL_1X1, DRAW_FILL_FULL);
Paint_DrawLine(85, 95, 125, 95, BLACK, DOT_PIXEL_1X1, LINE_STYLE_DOTTED);
Paint_DrawLine(105, 75, 105, 115, BLACK, DOT_PIXEL_1X1, LINE_STYLE_DOTTED);
Paint_DrawString_CN(130, 0,"ÄãºÃabc", &Font12CN, BLACK, WHITE);
Paint_DrawString_EN(10, 20, "hello world", &Font12, WHITE, BLACK);
Paint_DrawNum(10, 33, 123456789, &Font12, BLACK, WHITE);
EPD_5IN83B_V2_DisplayPicture(BlackImage,2);
Paint_Clear(WHITE);
EPD_5IN83B_V2_DisplayPicture(BlackImage,3);
//2.Draw red image
Paint_Clear(WHITE);
EPD_5IN83B_V2_DisplayPicture(BlackImage,4);
Paint_Clear(WHITE);
Paint_DrawPoint(10, 80, BLACK, DOT_PIXEL_1X1, DOT_STYLE_DFT);
Paint_DrawPoint(10, 90, BLACK, DOT_PIXEL_2X2, DOT_STYLE_DFT);
Paint_DrawPoint(10, 100, BLACK, DOT_PIXEL_3X3, DOT_STYLE_DFT);
Paint_DrawPoint(10, 110, BLACK, DOT_PIXEL_3X3, DOT_STYLE_DFT);
Paint_DrawLine(20, 70, 70, 120, BLACK, DOT_PIXEL_1X1, LINE_STYLE_SOLID);
Paint_DrawLine(70, 70, 20, 120, BLACK, DOT_PIXEL_1X1, LINE_STYLE_SOLID);
Paint_DrawRectangle(20, 70, 70, 120, BLACK, DOT_PIXEL_1X1, DRAW_FILL_EMPTY);
Paint_DrawRectangle(80, 70, 130, 120, BLACK, DOT_PIXEL_1X1, DRAW_FILL_FULL);
Paint_DrawString_EN(10, 0, "waveshare", &Font16, BLACK, WHITE);
Paint_DrawString_CN(130, 20, "΢ѩµç×Ó", &Font24CN, WHITE, BLACK);
Paint_DrawNum(10, 50, 987654321, &Font16, WHITE, BLACK);
EPD_5IN83B_V2_DisplayPicture(BlackImage,5);
Paint_Clear(WHITE);
EPD_5IN83B_V2_DisplayPicture(BlackImage,6);
Paint_Clear(WHITE);
Paint_DrawCircle(160, 95, 20, BLACK, DOT_PIXEL_1X1, DRAW_FILL_EMPTY);
Paint_DrawCircle(210, 95, 20, BLACK, DOT_PIXEL_1X1, DRAW_FILL_FULL);
Paint_DrawLine(85, 95, 125, 95, BLACK, DOT_PIXEL_1X1, LINE_STYLE_DOTTED);
Paint_DrawLine(105, 75, 105, 115, BLACK, DOT_PIXEL_1X1, LINE_STYLE_DOTTED);
Paint_DrawString_CN(130, 0,"ÄãºÃabc", &Font12CN, BLACK, WHITE);
Paint_DrawString_EN(10, 20, "hello world", &Font12, WHITE, BLACK);
Paint_DrawNum(10, 33, 123456789, &Font12, BLACK, WHITE);
printf("EPD_Display\r\n");
EPD_5IN83B_V2_DisplayPicture(BlackImage,7);
DEV_Delay_ms(15000);
#endif
printf("Clear...\r\n");
EPD_5IN83B_V2_Clear();
printf("Goto Sleep...\r\n");
EPD_5IN83B_V2_Sleep();
free(BlackImage);
BlackImage = NULL;
// close 5V
printf("close 5V, Module enters 0 power consumption ...\r\n");
DEV_Module_Exit();
return 0;
}

View file

@ -55,14 +55,21 @@ int EPD_2in9d_test(void);
int EPD_2in13_test(void);
int EPD_2in13_V2_test(void);
int EPD_2in13bc_test(void);
int EPD_2in13b_V2_test(void);
int EPD_2in13b_V3_test(void);
int EPD_2in13d_test(void);
int EPD_2in66_test(void);
int EPD_3in7_test(void);
int EPD_4in2_test(void);
int EPD_4in2bc_test(void);
int EPD_5in65f_test(void);
int EPD_5in83_test(void);
int EPD_5in83bc_test(void);
int EPD_5in83b_V2_test(void);
int EPD_7in5_test(void);
int EPD_7in5_V2_test(void);

File diff suppressed because it is too large Load diff

View file

@ -56,14 +56,22 @@ extern const unsigned char gImage_2in13c_b[];
extern const unsigned char gImage_2in13c_y[];
extern const unsigned char gImage_2in13d[];
extern const unsigned char gImage_2in66[];
extern const unsigned char gImage_3in7[]; //4 Gray
extern const unsigned char gImage_4in2[];
extern const unsigned char gImage_4in2_4Gray[];
extern const unsigned char gImage_4in2bc_b[];
extern const unsigned char gImage_4in2bc_ry[];
extern const unsigned char gImage_5in65f[];//192*143
extern const unsigned char gImage_5in83[];
extern const unsigned char gImage_5in83bc_b[];
extern const unsigned char gImage_5in83bc_ry[];
extern const unsigned char gImage_5in83b_V2_b[];
extern const unsigned char gImage_5in83b_V2_r[];
extern const unsigned char gImage_7in5[];
extern const unsigned char gImage_7in5_V2[];