todd-herbert / heltec-eink-modules

Third-party Arduino Library for Heltec E-Ink displays
21 stars 4 forks source link

Driver code for Wireless Paper LCMEN2R13EFC1 module eink display. #13

Closed HapCoderWei closed 6 months ago

HapCoderWei commented 6 months ago

Hi, thanks for your work. I have found the wireless paper module LCMEN2R13EFC1 eink display driver command, actually it's for the HINK-E0213A162-FPC-A0 eink display. The sample code is use the epd2in13bc-demo.ino file in this address: https://www.waveshare.net/w/upload/d/d5/E-Paper_ESP8266_Driver_Board_Code.7z And need to do some small hack. Just delete the 0x61 Reg cmd and data, which is set the RESOLUTION_SETTING. If add this register config, the eink display will not respond to the code, which is confusing...

And the total init func is like this:

/******************************************************************************
function :  Initialize the e-Paper register
parameter:
******************************************************************************/
void EPD_2IN13BC_Init(void)
{
    EPD_2IN13BC_Reset();

    EPD_2IN13BC_SendCommand(0x06); // BOOSTER_SOFT_START
    EPD_2IN13BC_SendData(0x17);
    EPD_2IN13BC_SendData(0x17);
    EPD_2IN13BC_SendData(0x17);

    EPD_2IN13BC_SendCommand(0x04); // POWER_ON
    EPD_2IN13BC_ReadBusy();

    EPD_2IN13BC_SendCommand(0x00); // PANEL_SETTING
    EPD_2IN13BC_SendData(0x8F);  // origin code
    // EPD_2IN13BC_SendData(0x0F);
    // EPD_2IN13BC_SendData(0x09);

    EPD_2IN13BC_SendCommand(0x50); // VCOM_AND_DATA_INTERVAL_SETTING
    EPD_2IN13BC_SendData(0xF0);  // origin code is 0xF0
    // EPD_2IN13BC_SendCommand(0x61); // RESOLUTION_SETTING
    // EPD_2IN13BC_SendData(EPD_2IN13BC_WIDTH); // width: 104
    // EPD_2IN13BC_SendData(EPD_2IN13BC_HEIGHT >> 8); // height: 212
    // EPD_2IN13BC_SendData(EPD_2IN13BC_HEIGHT & 0xFF);
}

Other functions don't need to modify, and works out of box.