BLE ESL Board Design
openwch/ch592 SDK/HDK and WCH MounRiver Studio or the SDK's GCC-compatible project structure. Start from an official CH592 BLE example and retain its vendor BLE library/linker script.DCDC_ENABLE path.C
#include "CH59x_common.h" #define EPD_CS_LOW() GPIOA_ResetBits(GPIO_Pin_12) #define EPD_CS_HIGH() GPIOA_SetBits(GPIO_Pin_12) #define EPD_PWR_ON() GPIOA_SetBits(GPIO_Pin_9) #define EPD_PWR_OFF() GPIOA_ResetBits(GPIO_Pin_9) #define EPD_DC_DATA() GPIOB_SetBits(GPIO_Pin_7) #define EPD_DC_CMD() GPIOB_ResetBits(GPIO_Pin_7) #define EPD_RST_HIGH() GPIOB_SetBits(GPIO_Pin_4) #define EPD_RST_LOW() GPIOB_ResetBits(GPIO_Pin_4) #define EPD_BUSY() GPIOB_ReadPortPin(GPIO_Pin_22) static void epd_write(uint8_t value, int data) { if (data) EPD_DC_DATA(); else EPD_DC_CMD(); EPD_CS_LOW(); /* Confirm the exact official SDK SPI0 transmit identifier from the selected example; do not substitute an invented API. */ // SPI0_MasterSendByte(value); EPD_CS_HIGH(); } int main(void) { SetSysClock(CLK_SOURCE_PLL_60MHz); /* Keep SDK DCDC/clock calls aligned with the checked-out SDK revision. */ EPD_CS_HIGH(); EPD_RST_HIGH(); EPD_PWR_OFF(); while (1) { __WFI(); } }
Toolchain
Final Pin Map
Startup Sequence
Starter Skeleton