5 namespace mcp23x17_base {
7 static const char *
const TAG =
"mcp23x17_base";
10 uint8_t bit = pin % 8;
14 return value & (1 << bit);
41 switch (interrupt_mode) {
63 uint8_t bit = pin % 8;
64 uint8_t reg_value = 0;
70 this->
read_reg(reg_addr, ®_value);
74 reg_value |= 1 << bit;
76 reg_value &= ~(1 << bit);
void digital_write(uint8_t pin, bool value) override
void update_reg(uint8_t pin, bool pin_value, uint8_t reg_a) override
virtual bool write_reg(uint8_t reg, uint8_t value)
bool digital_read(uint8_t pin) override
virtual bool read_reg(uint8_t reg, uint8_t *value)
Implementation of SPI Controller mode.
void pin_interrupt_mode(uint8_t pin, mcp23xxx_base::MCP23XXXInterruptMode interrupt_mode) override
void pin_mode(uint8_t pin, gpio::Flags flags) override