device-driver icon indicating copy to clipboard operation
device-driver copied to clipboard

Feature request: Strict mode

Open korken89 opened this issue 3 years ago • 1 comments

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.

korken89 avatar May 01 '21 17:05 korken89

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

korken89 avatar May 09 '21 17:05 korken89