wcampbell0x2a / bintex

Create bytefield latex digrams with the use of rust proc-macros and deku
Apache License 2.0
4 stars 0 forks source link

Support multi-line bit protocols #2

Open wcampbell0x2a opened 3 years ago

wcampbell0x2a commented 3 years ago

Support the following struct:

#[derive(BinTex)]
#[bintex(bit_width = 8)]
struct Example {
    #[bintex(bits = "12")]
    a: u8,
    #[bintex(bits = "6")]
    b: u8,
}

As a bonus feature, this could also use the \bitbox[bltr] bottom,left,top,right notation for not having lines between fields.

Other examples:

The following has the u32 = 32 bits, which would fill 4-8 bit levels

#[derive(BinTex)]
#[bintex(bit_width = "8")]
struct Testing {
    #[deku(bits = "4")]
    a: u8,
    #[deku(bits = "4")]
    b: u8,
    c: u32,
}