#include <SPI.h>
#include "EPD_drive.h"
#include "EPD_drive_gpio.h"
#include "Display_Lib.h"

WaveShare_EPD EPD = WaveShare_EPD();
void setup() {
  // put your setup code here, to run once:
   pinMode(CS,OUTPUT);
   pinMode(DC,OUTPUT);
   pinMode(RST,OUTPUT);
   pinMode(BUSY,INPUT);
   
  Serial.begin(115200);
  SPI.beginTransaction(SPISettings(2000000, MSBFIRST, SPI_MODE0));
  SPI.begin();
  
  Serial.println("------------Clear full screen-----------------");
  EPD.Dis_Clear_full();
  
  //2.display init
  EPD.EPD_init_Part();
  driver_delay_xms(DELAYTIME);

  //Clear screen
  Serial.println("--------------Clear part screen------------");
  EPD.Dis_Clear_part();
  driver_delay_xms(DELAYTIME);
  
  //String
 EPD.Dis_String(120, 30, "hello world",12);
 EPD.Dis_String(90, 42, "i am an epaper display",12);
 driver_delay_xms(DELAYTIME);
}

void loop() {
  // put your main code here, to run repeatedly:

}
