Struct bitmask_t

Struct Documentation

struct bitmask_t

Bit mask structure for bitwise operations on 8-bits registers.

Public Functions

explicit bitmask_t(uint8_t b, uint8_t m)
explicit bitmask_t(uint8_t b)
explicit bitmask_t(const regbit_t &rb)
bitmask_t()
bitmask_t(const bitmask_t &bm)
bitmask_t &operator=(const bitmask_t &bm)
bitmask_t &operator=(const regbit_t &rb)
inline uint8_t extract(uint8_t value) const

Extracts the field value from the register value

inline uint8_t set_to(uint8_t reg, uint8_t value = 0xFF) const

Performs a bitwise OR between the register value and the field value

inline uint8_t clear_from(uint8_t reg, uint8_t value = 0xFF) const

Performs a bitwise NEG-AND between the register value and the field value

inline uint8_t replace(uint8_t reg, uint8_t value) const

Replace the field value within the register value

int bitcount() const

Returns the number of bits in the field

Public Members

uint8_t bit
uint8_t mask