-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature: API to set a range of bits using offset and length #30
Comments
The But adding such a method would be quite simple. The hardest thing will be finding a name for this methods. Any suggestions ? |
So I'm using
Finding a good name is indeed hard here. A few ideas:
Also maybe there is a better name than |
The intended use of this crates is really to use the The current implementation of I didn't try it, but But if you find that this crates works better for you and adding that method is useful for you, I can do that. |
I recently used
bitfield
in a project where I found the API passing MSB and LSB a bit cumbersome: https://github.com/gfroerli/firmware/pull/82/files#diff-8ba2aa3932cb35175d51de283952144c82bcf45eef54f18f72f199650929ee80R24It would have been more intuitive for me to pass a
bit_offset
and abit_length
: Like that:output.set_bit_range(*bit_index, Self::SIZE, self.0);
Would you consider adding such an API to this crate or do you think the idea is rubbish? 😉
The text was updated successfully, but these errors were encountered: