bitbybit 2.0.1

Efficient implementation of bit-fields where several numbers are packed within a larger number and bit-enums. Useful for drivers, so it works in no_std environments
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use bitbybit::bitfield;

// No issues with the private internal field value when a field is named value.
#[bitfield(u32, default = 0x0, debug)]
pub struct Data {
    #[bit(15, rw)]
    dparity: bool,
    #[bits(0..=7, rw)]
    value: u8,
}

pub fn main() {}