01-检查清单

检查清单(Checklist)

译文 · 基于 The Embedded Rust Book

HAL 设计模式检查清单

原文链接: https://doc.rust-lang.org/stable/embedded-book/design-patterns/hal/checklist.html

  • 命名 (crate 符合 Rust 命名约定)
  • 互操作性 (crate 能与其它库功能良好协作)
  • 可预测性 (crate 能写出易读且行为与外观一致的代码)
    • 使用构造函数而非扩展 trait(C-CTOR)
  • GPIO 接口 (GPIO 接口遵循统一模式)
    • 引脚类型默认为零大小类型(C-ZST-PIN)
    • 引脚类型提供擦除引脚与端口的方法(C-ERASED-PIN)
    • 引脚状态应编码为类型参数(C-PIN-STATE)
最后修改 August 11, 2026: 更新 (70a5af133)