bitbybit 2.0.0

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;

#[bitfield(u32, default = 0)]
struct Test {}

fn main() {
    let t = Test::DEFAULT;
    assert_eq!(0, t.raw_value);

    let t = Test::new_with_raw_value(45);
    assert_eq!(45, t.raw_value);
}