ESPHome 2026.11.0-dev
Loading...
Searching...
No Matches
esphome::GPIOPin Class Referenceabstract

#include <gpio_pin.h>

Inheritance diagram for esphome::GPIOPin:
esphome::esp32::ESP32InternalGPIOPin esphome::esp8266::ESP8266GPIOPin esphome::gpio_expander::ExpanderGPIOPin< Parent > esphome::host::HostGPIOPin esphome::libretiny::ArduinoInternalGPIOPin esphome::mcp23xxx_base::MCP23XXXGPIOPin< N > esphome::pcm5122::PCM5122GPIOPin esphome::rp2::RP2GPIOPin esphome::sn74hc165::SN74HC165GPIOPin esphome::sn74hc595::SN74HC595GPIOPin esphome::spi::NullPin esphome::weikai::WeikaiGPIOPin esphome::zephyr::ZephyrGPIOPin

Public Member Functions

virtual void setup ()=0
 
virtual void pin_mode (gpio::Flags flags)=0
 
virtual gpio::Flags get_flags () const =0
 Retrieve GPIO pin flags.
 
virtual bool digital_read ()=0
 
virtual void digital_write (bool value)=0
 
virtual size_t dump_summary (char *buffer, size_t len) const
 Write a summary of this pin to the provided buffer.
 
virtual bool is_internal ()
 Only the platform pin class behind the InternalGPIOPin alias may return true: callers static_cast to InternalGPIOPin on it.
 
bool get_hold () const
 
virtual bool is_held () const
 
bool get_hold () const
 
bool is_held () const
 

Detailed Description

Definition at line 61 of file gpio_pin.h.

Member Function Documentation

◆ digital_read()

◆ digital_write()

◆ dump_summary()

size_t esphome::GPIOPin::dump_summary ( char * buffer,
size_t len ) const
inlinevirtual

Write a summary of this pin to the provided buffer.

Parameters
bufferThe buffer to write to
lenThe size of the buffer (must be > 0)
Returns
The number of characters that would be written (excluding null terminator), which may exceed len-1 if truncation occurred (snprintf semantics)

Reimplemented in esphome::esp32::ESP32InternalGPIOPin, esphome::esp8266::ESP8266GPIOPin, esphome::gpio_expander::ExpanderGPIOPin< Parent >, esphome::host::HostGPIOPin, esphome::libretiny::ArduinoInternalGPIOPin, esphome::mcp23xxx_base::MCP23XXXGPIOPin< N >, esphome::pcm5122::PCM5122GPIOPin, esphome::rp2::RP2GPIOPin, esphome::sn74hc165::SN74HC165GPIOPin, esphome::sn74hc595::SN74HC595GPIOPin, esphome::spi::NullPin, esphome::weikai::WeikaiGPIOPin, and esphome::zephyr::ZephyrGPIOPin.

Definition at line 126 of file gpio_pin.h.

◆ get_flags()

◆ get_hold() [1/2]

bool esphome::GPIOPin::get_hold ( ) const
inline

Definition at line 89 of file gpio_pin.h.

◆ get_hold() [2/2]

bool esphome::GPIOPin::get_hold ( ) const
inline

Definition at line 92 of file gpio_pin.h.

◆ is_held() [1/2]

virtual bool esphome::GPIOPin::is_held ( ) const
inlinevirtual

Reimplemented in esphome::esp32::ESP32InternalGPIOPin.

Definition at line 90 of file gpio_pin.h.

◆ is_held() [2/2]

bool esphome::GPIOPin::is_held ( ) const
inline

Definition at line 93 of file gpio_pin.h.

◆ is_internal()

virtual bool esphome::GPIOPin::is_internal ( )
inlinevirtual

Only the platform pin class behind the InternalGPIOPin alias may return true: callers static_cast to InternalGPIOPin on it.

Reimplemented in esphome::esp32::ESP32InternalGPIOPin, esphome::esp8266::ESP8266GPIOPin, esphome::host::HostGPIOPin, esphome::libretiny::ArduinoInternalGPIOPin, esphome::rp2::RP2GPIOPin, and esphome::zephyr::ZephyrGPIOPin.

Definition at line 87 of file gpio_pin.h.

◆ pin_mode()

◆ setup()


The documentation for this class was generated from the following file: