macro_rules! bits {
($val:expr, $low:tt : $hi:tt) => { ... };
}
Expand description
Extract a range of bits from a value.
Syntax: bits!(val, lowbit:hibit);
#[macro_use]
extern crate bitutils;
let bits = bits!(0b0101000u8, 3:5);
assert_eq!(bits, 0b101);