ESPHome  2024.9.2
mcp23xxx_base.cpp
Go to the documentation of this file.
1 #include "mcp23xxx_base.h"
2 #include "esphome/core/log.h"
3 
4 namespace esphome {
5 namespace mcp23xxx_base {
6 
8 
9 void MCP23XXXGPIOPin::setup() { pin_mode(flags_); }
10 void MCP23XXXGPIOPin::pin_mode(gpio::Flags flags) { this->parent_->pin_mode(this->pin_, flags); }
11 bool MCP23XXXGPIOPin::digital_read() { return this->parent_->digital_read(this->pin_) != this->inverted_; }
12 void MCP23XXXGPIOPin::digital_write(bool value) { this->parent_->digital_write(this->pin_, value != this->inverted_); }
13 std::string MCP23XXXGPIOPin::dump_summary() const {
14  char buffer[32];
15  snprintf(buffer, sizeof(buffer), "%u via MCP23XXX", pin_);
16  return buffer;
17 }
18 
19 } // namespace mcp23xxx_base
20 } // namespace esphome
void pin_mode(gpio::Flags flags) override
void digital_write(bool value) override
const uint32_t flags
Definition: stm32flash.h:85
std::string dump_summary() const override
virtual void pin_mode(uint8_t pin, gpio::Flags flags)
const float IO
For components that represent GPIO pins like PCF8573.
Definition: component.cpp:17
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7
float get_setup_priority() const override