13static constexpr uint8_t PIN_COUNT = 40;
15static constexpr uint8_t BANK_COUNT = PIN_COUNT / 8;
20 void setup()
override;
Base for expanders that cache reads per loop. With an interrupt pin the cache stays valid until INT f...
This Class provides the methods to read/write bytes from/to an i2c device.
I2CRegister reg(uint8_t a_register)
calls the I2CRegister constructor
bool write_all_banks_(uint8_t reg, uint8_t value)
uint8_t output_[BANK_COUNT]
The output state per bank - 1 means HIGH, 0 means LOW.
bool read_bank_(uint8_t bank)
uint8_t config_[BANK_COUNT]
The pin config per bank - 1 means OUTPUT, 0 means INPUT.
void pin_mode(uint8_t pin, gpio::Flags flags)
uint8_t mask_[BANK_COUNT]
Which pins may pull INT low - 1 means masked, matching the chip.
bool digital_read_cache(uint8_t pin) override
uint8_t input_[BANK_COUNT]
The input pin states per bank - 1 means HIGH, 0 means LOW.
void dump_config() override
bool write_bank_(uint8_t reg, uint8_t bank, uint8_t value)
void digital_write_hw(uint8_t pin, bool value) override
bool digital_read_hw(uint8_t pin) override
ESPHOME_EXPANDER_PIN_SUMMARY_DECL(esphome::pca9505::PCA9505Component)