# waveshare_epd **Repository Path**: xingguangk/waveshare_epd ## Basic Information - **Project Name**: waveshare_epd - **Description**: 适用于微雪电子墨水屏的独立c语言驱动库(由Deepseek-v4-Pro编写) - **Primary Language**: C - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-07-18 - **Last Updated**: 2026-07-18 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Waveshare e-Paper C Library 纯 C 语言 Waveshare 电子墨水屏驱动库,零外部依赖,支持 2.13" ~ 7.5" 全系列屏幕。 ## 特性 - **纯 C 实现** — 无 Python/Pillow 依赖 - **零外部依赖** — 仅需 gcc + make + pigpio - **全系列支持** — 覆盖 40+ 款 Waveshare e-Paper 屏幕 - **静态库** — 编译为 `libwaveshare_epd.a`,方便集成 - **GPIO 直驱** — 通过 pigpio 库直接控制 SPI 和 GPIO > ⚠️ 本驱动仅在 2.13inch e-Paper V4 上做过测试,其它型号屏幕未经测试。 ## 快速开始 ```bash # 编译静态库 make # 编译 demo 程序(需连接墨水屏) make demo # 清理 make clean ``` ## 目录结构 ``` waveshare_epd/ ├── include/ # 公共头文件 │ ├── waveshare_epd.h # umbrella header │ └── epd_common.h # 通用结构与宏 ├── src/ │ ├── hal/ # 硬件抽象层(SPI/GPIO/延时) │ │ ├── hal.c │ │ └── hal.h │ └── drivers/ # 各型号屏幕驱动 │ ├── epd2in13_V4.c # 2.13" V4 │ ├── epd7in5_V2.c # 7.5" V2 │ └── ... # 40+ 驱动 ├── app/ │ └── demo.c # 示例程序 └── Makefile ``` ## API 概览 ```c #include "waveshare_epd.h" EPD epd; EPD_2in13_V4_Init(&epd); // 初始化屏幕 EPD_2in13_V4_Clear(&epd, EPD_WHITE); // 清屏 EPD_2in13_V4_Display(&epd, buf); // 全刷显示 EPD_2in13_V4_DisplayPartial(&epd, buf); // 局刷显示 EPD_2in13_V4_Sleep(&epd); // 休眠 ``` ## 使用方法 在你的项目中引用本库: ```makefile # 假设 waveshare_epd 在 ../waveshare_epd LIB_DIR = ../waveshare_epd CFLAGS += -I$(LIB_DIR)/include LDFLAGS += -L$(LIB_DIR)/lib -lwaveshare_epd -lpigpio -lpthread -lm ``` ## 依赖 - **编译时**: gcc, make, pigpio 开发库 (`sudo apt install pigpio`) - **运行时**: pigpio 守护进程 (`sudo pigpiod`) ## 许可证 MIT License