device-driver
device-driver copied to clipboard
Feature request: Strict mode
A way to say to the macro that I do not want a fallible interface for register decoding (enums). So if it can detect that an fallible interface would be generated it should scream at me, or maybe a trait error. :)
The infallible interface would also be nice if it could be related to the bit size, e.g. a 2 bit field that is linked to a 4 variant enum (or less + FromPrimitive implemented). Then it is known that the entire value span is well defined.
I was playing around a little, and the following crate gave a lot of good underlying support for enums (and a lot more): https://docs.rs/modular-bitfield