rust-embedded / svd2rust

Generate Rust register maps (`struct`s) from SVD files
Apache License 2.0
675 stars 147 forks source link

generic REG in field writers #731

Closed burrbull closed 1 year ago

burrbull commented 1 year ago

should fix #705

burrbull commented 1 year ago

cc @kaizensparc

burrbull commented 1 year ago

This PR does 2 breaking things:

  1. It reverts #465 which had been added wrappers around W<REG> and R<REG. It was done first of all to improve documentation, but instead requires additional implementation of From, Deref, DerefMut. It also adds several restriction, one of which blocked to do second action. Instead of this to make documentaion cleaner I just add additional hidden level of type aliases WRaw and RRaw.
  2. Now REG parameter of FieldWriter is generic in implementations (like already done for offset parameter). This makes possible to import of derived field writer without any additional implementation and makes code (and documentation) for derived FieldReader and FieldWriter much more similar each other.

cc @rust-embedded/tools

bors[bot] commented 1 year ago

Configuration problem: bors.toml: not found