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