From 9cdc84c7c5d663db7070361a3d69a6b652df3b0f Mon Sep 17 00:00:00 2001 From: tpu Date: Tue, 20 May 2025 11:57:11 +0800 Subject: [PATCH] =?UTF-8?q?PCB=E7=89=88=E6=9C=AC=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E8=AF=86=E5=88=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/epd/epd.c | 20 ++++++++++++++++++++ src/epd/epd.h | 1 + src/user_peripheral.c | 6 +++++- 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/epd/epd.c b/src/epd/epd.c index 1577f05..0c983e1 100644 --- a/src/epd/epd.c +++ b/src/epd/epd.c @@ -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) diff --git a/src/epd/epd.h b/src/epd/epd.h index 04b300f..b068c9e 100644 --- a/src/epd/epd.h +++ b/src/epd/epd.h @@ -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[]; diff --git a/src/user_peripheral.c b/src/user_peripheral.c index 76c5f31..c61eede 100644 --- a/src/user_peripheral.c +++ b/src/user_peripheral.c @@ -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);