Skip to content

Commit

Permalink
update EPD_4IN2_Init
Browse files Browse the repository at this point in the history
  • Loading branch information
tsl0922 committed Dec 10, 2024
1 parent 0cd65f6 commit 9da59d1
Showing 1 changed file with 26 additions and 27 deletions.
53 changes: 26 additions & 27 deletions EPD/EPD_4in2.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,41 +182,40 @@ function : Initialize the e-Paper register
void EPD_4IN2_Init(void)
{
EPD_4IN2_Reset();
EPD_4IN2_SendCommand(0x01); //POWER SETTING
EPD_4IN2_SendData (0x03);
EPD_4IN2_SendData (0x00);
EPD_4IN2_SendData (0x2b);
EPD_4IN2_SendData (0x2b);

EPD_4IN2_SendCommand(0x06); //boost soft start
EPD_4IN2_SendData (0x17); //A
EPD_4IN2_SendData (0x17); //B
EPD_4IN2_SendData (0x17); //C

EPD_4IN2_SendCommand(0x04);
EPD_4IN2_SendCommand(0x01); // POWER SETTING
EPD_4IN2_SendData (0x03); // VDS_EN, VDG_EN internal
EPD_4IN2_SendData (0x00); // VCOM_HV, VGHL_LV=16V
EPD_4IN2_SendData (0x2b); // VDH=11V
EPD_4IN2_SendData (0x2b); // VDL=11V

EPD_4IN2_SendCommand(0x06); // boost soft start
EPD_4IN2_SendData (0x17); // A
EPD_4IN2_SendData (0x17); // B
EPD_4IN2_SendData (0x17); // C

EPD_4IN2_SendCommand(0x04); // POWER ON
EPD_4IN2_ReadBusy();

EPD_4IN2_SendCommand(0x00); //panel setting
EPD_4IN2_SendData(0xbf); //KW-bf KWR-2F BWROTP 0f BWOTP 1f

EPD_4IN2_SendCommand(0x00); // panel setting
EPD_4IN2_SendData(0x3f); // 300x400 B/W mode, LUT set by register

EPD_4IN2_SendCommand(0x30);
EPD_4IN2_SendData (0x3c); // 3A 100HZ 29 150Hz 39 200HZ 31 171HZ

EPD_4IN2_SendCommand(0x61); //resolution setting
EPD_4IN2_SendData (0x01);
EPD_4IN2_SendData (0x90); //400
EPD_4IN2_SendData (0x01); //300
EPD_4IN2_SendData (0x2c);
EPD_4IN2_SendCommand(0x30); // PLL setting (clock frequency)
EPD_4IN2_SendData (0x3c); // 3c=50HZ 3a=100HZ 29=150Hz 39=200HZ 31=171HZ

EPD_4IN2_SendCommand(0x61); // resolution setting
EPD_4IN2_SendData (EPD_4IN2_WIDTH / 256);
EPD_4IN2_SendData (EPD_4IN2_WIDTH % 256);
EPD_4IN2_SendData (EPD_4IN2_HEIGHT / 256);
EPD_4IN2_SendData (EPD_4IN2_HEIGHT % 256);

EPD_4IN2_SendCommand(0x82); //vcom_DC setting
EPD_4IN2_SendData (0x12);
EPD_4IN2_SendCommand(0x82); // vcom_DC setting
EPD_4IN2_SendData (0x12); // -0.1 + 18 * -0.05 = -1.0V

EPD_4IN2_SendCommand(0X50);
EPD_4IN2_SendData(0x97);
EPD_4IN2_SendCommand(0x50); // VCOM AND DATA INTERVAL SETTING
EPD_4IN2_SendData(0x97); // WBmode:VBDF 17|D7 VBDW 97 VBDB 57 WBRmode:VBDF F7 VBDW 77 VBDB 37 VBDR B7

EPD_4IN2_SetLut();
EPD_4IN2_SetLut();
}

/******************************************************************************
Expand Down

0 comments on commit 9da59d1

Please sign in to comment.