feat: v1.0.0 收尾 — 五芯片 DTR/RTS、类型声明、示例、CI
test / test (push) Canceled after 0s

- CP210x / FTDI / PL2303 补齐 setSignals()(编码与各自初始化序列一致)
- 新增 index.d.ts(TypeScript 类型声明)、examples/minimal.html(最小接入示例)
- 新增 .gitea/workflows/ci.yml(push 时跑离线单测)、.gitattributes(强制 LF)、CHANGELOG.md
- package.json 补 repository / homepage / bugs / types / engines
- 单测 16 项全部通过:node test/driver.test.mjs
This commit is contained in:
2026-09-23 00:41:29 +08:00
parent f02c0b06b8
commit 6c5e647c8a
9 changed files with 271 additions and 10 deletions
+12
View File
@@ -53,6 +53,18 @@ npx serve . # 或 python -m http.server 8080
# 手机访问 https 地址;安卓上建议用 cloudflared/ngrok 暴露本地端口
```
## 仓库结构
| 文件 | 说明 |
|---|---|
| ch340-webusb.js | 核心驱动(UMD:script 标签直接引,也可 require / import) |
| ch340-serial-shim.js | navigator.serial 垫片(安卓零改动接入) |
| ch340-test.html | 测试台(连接 / 收发 / HEX / DTR-RTS / 回环自测) |
| examples/minimal.html | 最小接入示例 |
| index.d.ts | TypeScript 类型声明 |
| docs/ch34x-registers.md | 寄存器与控制传输说明 |
| test/driver.test.mjs | 离线单测(mock USBDevice,无需硬件) |
## API
| 成员 | 说明 |