
//////////////////////////////////////////////////////////////////////////////////
//EASTRISING TECHNOLOGY CO,.LTD.
//www.buydisplay.com
// Module    : ER-EPD3.52-1   180*384 dots
// Create    : JAVEN
// Date      : 2025-12-17
//               GND  GND
//               VCC  3.3V
//               SCLK PG12
//               MOSI PD5（MOSI）
//               RES  PD4
//               DC   PD15
//               CS   PD1
//               BUSY PE8

//******************************************************************************/



#include "delay.h"
#include "usart.h"
#include "EPD_GUI.h"
#include "Pic.h"


u8 ImageBW[17280];

int main()
{
  float num=12.05;
  delay_init();
  uart_init(115200);
  EPD_GPIOInit();

  Paint_NewImage(ImageBW,EPD_W,EPD_H,0,WHITE);    //创建画布
  Paint_Clear(WHITE); 
  /************************全刷************************/
  EPD_Init();
  EPD_ShowFourColorPicture(0,0,384,180,gImage_1);
  EPD_Display(ImageBW);
  EPD_Update();
  EPD_DeepSleep();
  Paint_Clear(WHITE);
  delay_ms(1000);
  delay_ms(1000);
  delay_ms(1000);
    
  EPD_Init();
  EPD_ShowFourColorPicture(0,0,384,180,gImage_2);
  EPD_Display(ImageBW);
  EPD_Update();
  EPD_DeepSleep();
  Paint_Clear(WHITE);
  delay_ms(1000);
  delay_ms(1000);
  delay_ms(1000);
  EPD_Init(); 
  EPD_ShowString(80,0,"Welcome to 3.52-inch E-paper",16,BLACK,WHITE);  
  EPD_ShowString(90,20,"with 384 x 180 resolution",16,RED,WHITE);
  EPD_ShowString(110,40,"www.buydisplay.com",16,YELLOW,WHITE);
  EPD_DrawLine(0,60,EPD_H-1,60,BLACK);
  EPD_DrawRectangle(24,78,64,118,BLACK,0);
  EPD_DrawRectangle(98,78,138,119,BLACK,1);
  EPD_ShowWatch(138,74,num,4,2,48,RED,WHITE);
  EPD_DrawCircle(295,100,25,BLACK,0);
  EPD_DrawCircle(345,100,25,BLACK,1);
  EPD_ShowChinese(88,136,"深圳旭日东方科技",16,BLACK);
  EPD_DrawRectangle(0,0,EPD_H-1,EPD_W-1,BLACK,0);
  EPD_Display(ImageBW);
  EPD_Update();
  EPD_DeepSleep();
  Paint_Clear(WHITE);
  delay_ms(1000);
  delay_ms(1000);
  delay_ms(1000);
  EPD_Init();
  while(1)
  {
    EPD_Display_Fill(WHITE);
    EPD_Update();
    EPD_DeepSleep();
  }
}

