template<class T, unsigned int BitI, unsigned int Nbits>
struct microstrain::BitfieldMemberN< T, BitI, Nbits >
A class which represents part of a bitfield.
This is used to store the range of bits, to avoid repeating them in get/set function implementations and other situations.
Usage would typically be like this:
using Part1Bits = BitfieldMemberItoJ<uint16_t, 0, 12>;
using Part2Bits = BitfieldMemberItoJ<uint8_t, 12, 16>;
void setPart1(uint16_t p1) { Part1Bits::set(m_value, p1); }
void setPart2(uint16_t p2) { Part2Bits::set(m_value, p2); }
uint16_t m_value;
- Template Parameters
-
T | Type of the bitfield member. Must be integral or a non-scoped enum. |
BitI | The 0-based index of the first bit used to represent this value. |
Nbits | Number of bits in the field used to represent this value. |