PCB版本自动识别

This commit is contained in:
tpu
2025-05-20 11:57:11 +08:00
parent fd66dd548b
commit 9cdc84c7c5
3 changed files with 26 additions and 1 deletions

View File

@@ -356,6 +356,26 @@ void epd_screen_clean(int mode)
/******************************************************************************/
int epd_detect(void)
{
int retv = 0;
epd_hw_open();
epd_reset(1);
epd_cmd(0x12); // SWRESET
if(epd_busy()){
epd_wait();
retv = 1;
}
epd_hw_close();
return retv;
}
/******************************************************************************/
#if 0
void epd_test(void)

View File

@@ -54,6 +54,7 @@ void epd_sleep(void);
void epd_window(int x1, int y1, int x2, int y2);
void epd_screen_update(void);
void epd_screen_clean(int mode);
int epd_detect(void);
extern u8 lut_p[];

View File

@@ -180,7 +180,11 @@ void user_app_init(void)
clock_interval = 60; // 60s
adv_state = 0;
fspi_config(0x00030605);
epd_hw_init(0x23200700, 0x05210006, 104, 212, ROTATE_3); // for 2.13 board BW
epd_hw_init(0x23200700, 0x05210006, 104, 212, ROTATE_3); // 2.13黑白屏6个测试点
if(epd_detect()==0){
epd_hw_init(0x23111000, 0x07210120, 104, 212, ROTATE_3); // 2.13黑白屏5个测试点
}
selflash(otp_boot);