1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-13 16:52:18 +01:00
This commit is contained in:
J. Nick Koston
2025-09-04 12:32:52 -05:00
parent e866ae0f50
commit ee090c7c38
2 changed files with 0 additions and 14 deletions

View File

@@ -28,22 +28,12 @@ void PCF8574Component::dump_config() {
ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL);
} }
} }
bool PCF8574Component::digital_read(uint8_t pin) {
// Call the base class method
return this->CachedGpioExpander::digital_read(pin);
}
bool PCF8574Component::digital_read_hw(uint8_t pin) { bool PCF8574Component::digital_read_hw(uint8_t pin) {
return this->read_gpio_() ? (this->input_mask_ & (1 << pin)) : false; return this->read_gpio_() ? (this->input_mask_ & (1 << pin)) : false;
} }
bool PCF8574Component::digital_read_cache(uint8_t pin) { return this->input_mask_ & (1 << pin); } bool PCF8574Component::digital_read_cache(uint8_t pin) { return this->input_mask_ & (1 << pin); }
void PCF8574Component::digital_write(uint8_t pin, bool value) {
// Call the base class method
this->CachedGpioExpander::digital_write(pin, value);
}
void PCF8574Component::digital_write_hw(uint8_t pin, bool value) { void PCF8574Component::digital_write_hw(uint8_t pin, bool value) {
if (value) { if (value) {
this->output_mask_ |= (1 << pin); this->output_mask_ |= (1 << pin);

View File

@@ -22,10 +22,6 @@ class PCF8574Component : public Component,
void setup() override; void setup() override;
/// Invalidate cache at start of each loop /// Invalidate cache at start of each loop
void loop() override; void loop() override;
/// Helper function to read the value of a pin.
bool digital_read(uint8_t pin);
/// Helper function to write the value of a pin.
void digital_write(uint8_t pin, bool value);
/// Helper function to set the pin mode of a pin. /// Helper function to set the pin mode of a pin.
void pin_mode(uint8_t pin, gpio::Flags flags); void pin_mode(uint8_t pin, gpio::Flags flags);