Hi, I faced with weird behavior if you write negative number
Here is a pool_request with test to reproduce the behavior
Long story short, highest bits get overwritten by new bits.
I assume it may happens because in this line .to_u8() is called after bit range checks, but I'm not sure.
To fix it in our app, we started convert types to unsigned before calling .write(bit_len, val) - and then it works properly