- Library targets
embedded-hal1.0 inno_stdenvironments; keep APIs allocator-free and resilient to HAL timing quirks. - Supported controllers/adapters: HD44780 variants (PCF8574T, Adafruit MCP23008, dual-controller), AiP31068, and ST7032i. Each has dedicated hardware and action layers—reuse those abstractions instead of bypassing them.
- Error paths must use
CharacterDisplayError; extend the enum only when the behaviour is externally observable.
- Touch both the high-level facade in
src/lib.rsand the appropriate driver module when introducing a new capability. - Maintain compatibility with optional features (
defmt,ufmt). Ensure new code compiles when these features are disabled. - Respect existing timing expectations; use the provided delays rather than busy waits or sleeping loops.
- Unit tests are mandatory for every behavioural change. Extend the existing
embedded-hal-mockbased tests to cover new I²C transactions, timing assumptions, and failure paths. - When fixing a bug, first reproduce it with a failing unit test, then implement the fix. Do not remove tests without a replacement.
- Run
cargo testin the root crate before handing off any change set. If tests cannot run in your environment, explain why and supply the commands you attempted.
- Rust 2021 edition,
#![no_std]defaults; avoid introducingstddependencies outside guarded test modules. - Keep files ASCII unless you have a strong reason otherwise. Use descriptive method names and prefer small, composable helper functions.
- Document non-obvious hardware interactions with short comments; do not duplicate datasheet prose.
- All new logic has unit-test coverage.
-
cargo fmt,cargo clippy --no-deps, andcargo testsucceed (note any exceptions). - Public API changes are documented in doc comments and, if user-visible, in
CHANGELOG.md. - Verify no accidental regressions in multi-controller addressing or buffer bounds.