8 static const char *
const TAG =
"mcp23016";
11 ESP_LOGCONFIG(TAG,
"Setting up MCP23016...");
27 uint8_t bit = pin % 8;
31 return value & (1 << bit);
59 uint8_t bit = pin % 8;
60 uint8_t reg_value = 0;
70 reg_value |= 1 << bit;
72 reg_value &= ~(1 << bit);
90 snprintf(buffer,
sizeof(buffer),
"%u via MCP23016", pin_);
void pin_mode(uint8_t pin, gpio::Flags flags)
bool read_byte(uint8_t a_register, uint8_t *data, bool stop=true)
bool write_reg_(uint8_t reg, uint8_t value)
void digital_write(bool value) override
I2CRegister reg(uint8_t a_register)
calls the I2CRegister constructor
std::string dump_summary() const override
void digital_write(uint8_t pin, bool value)
bool digital_read(uint8_t pin)
void pin_mode(gpio::Flags flags) override
bool read_reg_(uint8_t reg, uint8_t *value)
const float HARDWARE
For components that deal with hardware and are very important like GPIO switch.
bool write_byte(uint8_t a_register, uint8_t data, bool stop=true)
virtual void mark_failed()
Mark this component as failed.
Implementation of SPI Controller mode.
float get_setup_priority() const override
void update_reg_(uint8_t pin, bool pin_value, uint8_t reg_a)
bool digital_read() override