sipeed / bl602-hal

Hardware Abstract Layer for BL602 RISC-V WiFi + BLE SoC in embedded Rust
Other
74 stars 14 forks source link

Use sealed traits instead of unsafe markers on traits #45

Closed 9names closed 8 months ago

9names commented 1 year ago

Uses the sealed trait pattern from https://rust-lang.github.io/api-guidelines/future-proofing.html

i2c and spi traits are well constrained already, haven't worked out the correct syntax for serial. it's probably overkill, since you can't construct a uart without uart pins, and they are already constrained.

[edit] Decided not to seal uart trait due to above