29 bool get(uint16_t bitIndex)
const {
39 void set(uint16_t bitIndex) {
61 void set(uint16_t bitIndex,
bool state) {
62 state ?
set(bitIndex) :
clear(bitIndex);
75 ERROR(F(
"Error: index out of bounds (")
95 const uint8_t &
getByte(uint16_t byteIndex)
const {
118 void setByte(uint16_t byteIndex, uint8_t value) {
119 buffer[byteIndex] = value;
#define BEGIN_AH_NAMESPACE
A class for arrays of bits.
void set(uint16_t bitIndex)
Set the value of the given bit to 1.
uint8_t getBufferMask(uint16_t bitIndex) const
uint8_t & getByte(uint16_t byteIndex)
Get the byte at the given index.
uint16_t safeIndex(uint16_t byteIndex) const
Check the given byte index, and return it if it is within the bounds of the array,...
void setByte(uint16_t byteIndex, uint8_t value)
Set the byte at the given index.
uint8_t getBufferBit(uint16_t bitIndex) const
uint16_t getBufferLength() const
Get the buffer length in bytes.
const uint8_t & getByte(uint16_t byteIndex) const
Get the byte at the given index.
uint8_t buffer[bufferLength]
void clear(uint16_t bitIndex)
Clear the value of the given bit to 0.
uint16_t getBufferIndex(uint16_t bitIndex) const
void set(uint16_t bitIndex, bool state)
Set the value of the given bit to the given state.
static constexpr uint16_t bufferLength
bool get(uint16_t bitIndex) const
Get the value of the given bit.
#define ERROR(msg, errc)
Print the error message and error code, and stop the execution if FATAL_ERRORS are enabled.