7 static const char *
const TAG =
"pcf8574";
10 ESP_LOGCONFIG(TAG,
"Setting up PCF8574...");
12 ESP_LOGE(TAG,
"PCF8574 not available under 0x%02X", this->
address_);
21 ESP_LOGCONFIG(TAG,
"PCF8574:");
23 ESP_LOGCONFIG(TAG,
" Is PCF8575: %s", YESNO(this->
pcf8575_));
25 ESP_LOGE(TAG,
"Communication with PCF8574 failed!");
59 this->
input_mask_ = (uint16_t(data[1]) << 8) | (uint16_t(data[0]) << 0);
80 value |= ~this->mode_mask_;
101 snprintf(buffer,
sizeof(buffer),
"%u via PCF8574", pin_);
uint16_t mode_mask_
Mask for the pin mode - 1 means output, 0 means input.
void dump_config() override
void pin_mode(uint8_t pin, gpio::Flags flags)
Helper function to set the pin mode of a pin.
uint16_t input_mask_
The state read in read_gpio_ - 1 means HIGH, 0 means LOW.
void status_set_warning(const char *message="unspecified")
void pin_mode(gpio::Flags flags) override
bool digital_read() override
optional< std::array< uint8_t, N > > read_bytes_raw()
bool digital_read(uint8_t pin)
Helper function to read the value of a pin.
ErrorCode write(const uint8_t *data, size_t len, bool stop=true)
writes an array of bytes to a device using an I2CBus
No error found during execution of method.
void status_clear_warning()
std::string dump_summary() const override
uint16_t output_mask_
The mask to write as output state - 1 means HIGH, 0 means LOW.
float get_setup_priority() const override
uint8_t address_
store the address of the device on the bus
virtual void mark_failed()
Mark this component as failed.
const float IO
For components that represent GPIO pins like PCF8573.
bool pcf8575_
TRUE->16-channel PCF8575, FALSE->8-channel PCF8574.
void setup() override
Check i2c availability and setup masks.
Implementation of SPI Controller mode.
void digital_write(bool value) override
void digital_write(uint8_t pin, bool value)
Helper function to write the value of a pin.