26 const T pin_mask = (1 << (pin %
BANK_SIZE));
A class to cache the read state of a GPIO expander.
static constexpr uint8_t BITS_PER_BYTE
virtual void digital_write_hw(T pin, bool value)=0
Call component low level function to write GPIO state to device.
static constexpr uint8_t BANK_SIZE
bool digital_read(T pin)
Read the state of the given pin.
virtual bool digital_read_cache(T pin)=0
Call component read function from internal cache.
static constexpr size_t CACHE_SIZE_BYTES
void digital_write(T pin, bool value)
void reset_pin_cache_()
Invalidate cache. This function should be called in component loop().
T read_cache_valid_[BANKS]
virtual bool digital_read_hw(T pin)=0
Call component low level function to read GPIO state from device.
static constexpr size_t BANKS