11 ESP_LOGE(TAG,
"PCF8574 not available under 0x%02X", this->
address_);
21 this->
mode_mask_ = ~this->configured_input_pins_;
75 value |= ~this->mode_mask_;
void mark_failed()
Mark this component as failed.
bool status_comm_result(bool ok)
Clears the warning when ok, else sets it with message (default "Communication failed"); returns ok.
void setup_interrupt_pin_()
InternalGPIOPin * interrupt_pin_
void enable_polling_loop_()
Call from pin_mode() for an input pin: without an interrupt pin the loop polls instead.
ErrorCode write(const uint8_t *data, size_t len) const
writes an array of bytes to a device using an I2CBus
optional< std::array< uint8_t, N > > read_bytes_raw()
uint8_t address_
store the address of the device on the bus
uint16_t input_mask_
The state read in read_gpio_ - 1 means HIGH, 0 means LOW.
void setup() override
Check i2c availability and setup masks.
uint16_t mode_mask_
Mask for the pin mode - 1 means output, 0 means input.
uint16_t output_mask_
The mask to write as output state - 1 means HIGH, 0 means LOW.
void digital_write_hw(uint8_t pin, bool value) override
void pin_mode(uint8_t pin, gpio::Flags flags)
Helper function to set the pin mode of a pin.
void dump_config() override
bool digital_read_cache(uint8_t pin) override
bool pcf8575_
TRUE->16-channel PCF8575, FALSE->8-channel PCF8574.
bool digital_read_hw(uint8_t pin) override
@ ERROR_OK
No error found during execution of method.
ESPHOME_LOG_TAG(TAG, "pcf8574")
ESPHOME_ALWAYS_INLINE constexpr void assign_bits(T &value, std::type_identity_t< T > mask, bool on)
Set the bits of mask in value when on is true, clear them otherwise.
constexpr T encode_value_le(const uint8_t *bytes)
Encode a value from its constituent bytes (from least to most significant) in an array with length si...