1 #include <bitfield/bitfield.h>
3 float bitfield_parse_float(uint64_t data, uint8_t bit_offset, uint8_t bit_size,
4 float factor, float offset) {
5 uint64_t raw = get_bit_field(data, bit_offset,
7 return raw * factor + offset;
10 bool bitfield_parse_bool(uint64_t data, uint8_t bit_offset, uint8_t bit_size,
11 float factor, float offset) {
12 float value = bitfield_parse_float(data, bit_offset, bit_size, factor, offset);
13 return value == 0.0 ? false : true;