ESPHome 2026.11.0-dev
Loading...
Searching...
No Matches
pi4ioe5v6408.h
Go to the documentation of this file.
1#pragma once
2
7#include "esphome/core/hal.h"
8
9namespace esphome::pi4ioe5v6408 {
11 public i2c::I2CDevice {
12 public:
14
15 void setup() override;
16 void pin_mode(uint8_t pin, gpio::Flags flags);
17
18 void dump_config() override;
19
21 void set_reset(bool reset) { this->reset_ = reset; }
22
23 protected:
24 bool digital_read_hw(uint8_t pin) override;
25 bool digital_read_cache(uint8_t pin) override;
26 void digital_write_hw(uint8_t pin, bool value) override;
27
29 uint8_t mode_mask_{0x00};
31 uint8_t output_mask_{0x00};
33 uint8_t input_mask_{0x00};
35 uint8_t pull_enable_mask_{0x00};
37 uint8_t pull_up_down_mask_{0x00};
38
39 bool reset_{true};
40
41 bool read_gpio_modes_();
42 bool write_gpio_modes_();
43 bool read_gpio_outputs_();
44};
45
47
48} // namespace esphome::pi4ioe5v6408
49
Base for expanders that cache reads per loop. With an interrupt pin the cache stays valid until INT f...
This Class provides the methods to read/write bytes from/to an i2c device.
Definition i2c.h:144
uint8_t pull_enable_mask_
The mask to write as input buffer state - 1 means enabled, 0 means disabled.
uint8_t output_mask_
The mask to write as output state - 1 means HIGH, 0 means LOW.
uint8_t pull_up_down_mask_
The mask to write as pullup state - 1 means pullup, 0 means pulldown.
bool digital_read_cache(uint8_t pin) override
void digital_write_hw(uint8_t pin, bool value) override
uint8_t input_mask_
The state read in digital_read_hw - 1 means HIGH, 0 means LOW.
uint8_t mode_mask_
Mask for the pin mode - 1 means output, 0 means input.
void pin_mode(uint8_t pin, gpio::Flags flags)
void set_reset(bool reset)
Indicate if the component should reset the state during setup.
uint16_t flags
uint16_t reset
Definition ina226.h:5
ESPHOME_EXPANDER_PIN_SUMMARY_DECL(esphome::pi4ioe5v6408::PI4IOE5V6408Component)