ESPHome 2026.11.0-dev
Loading...
Searching...
No Matches
gpio.h
Go to the documentation of this file.
1#pragma once
3
4// Each platform has exactly one internal pin class, so InternalGPIOPin is an alias for
5// it instead of an abstract base class: calls through the alias are direct and can be inlined.
6#if defined(USE_ESP32)
8namespace esphome {
10}
11#elif defined(USE_ESP8266)
13namespace esphome {
14using InternalGPIOPin = esp8266::ESP8266GPIOPin;
15}
16#elif defined(USE_LIBRETINY)
18namespace esphome {
19using InternalGPIOPin = libretiny::ArduinoInternalGPIOPin;
20}
21#elif defined(USE_RP2)
23namespace esphome {
24using InternalGPIOPin = rp2::RP2GPIOPin;
25}
26#elif defined(USE_HOST)
28namespace esphome {
29using InternalGPIOPin = host::HostGPIOPin;
30}
31#elif defined(USE_ZEPHYR)
33namespace esphome {
34using InternalGPIOPin = zephyr::ZephyrGPIOPin;
35}
36#else
37#error "gpio.h: no internal pin class for this platform"
38#endif
39
40namespace esphome {
41static_assert(InternalGPIOPinContract<InternalGPIOPin>,
42 "The platform's internal pin class is missing part of the InternalGPIOPin surface "
43 "(esphome/core/gpio_pin.h)");
44} // namespace esphome
esp32::ESP32InternalGPIOPin InternalGPIOPin
Definition gpio.h:9