From a7042687c1502a334b163b7fdf751832161e83d6 Mon Sep 17 00:00:00 2001 From: Brandon Ibach Date: Sun, 28 Sep 2025 06:58:42 -0400 Subject: [PATCH] [spi] fix SPI interface selection on ESP32-S2 and -S3 (#10732) (#10766) --- esphome/components/spi/__init__.py | 3 --- tests/components/spi/test.esp32-s3-ard.yaml | 13 +++++++++++++ 2 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 tests/components/spi/test.esp32-s3-ard.yaml diff --git a/esphome/components/spi/__init__.py b/esphome/components/spi/__init__.py index 894c6d1878..d803ee66dc 100644 --- a/esphome/components/spi/__init__.py +++ b/esphome/components/spi/__init__.py @@ -276,9 +276,6 @@ def get_spi_interface(index): return ["&SPI", "&SPI1"][index] if index == 0: return "&SPI" - # Following code can't apply to C2, H2 or 8266 since they have only one SPI - if get_target_variant() in (VARIANT_ESP32S3, VARIANT_ESP32S2): - return "new SPIClass(FSPI)" return "new SPIClass(HSPI)" diff --git a/tests/components/spi/test.esp32-s3-ard.yaml b/tests/components/spi/test.esp32-s3-ard.yaml new file mode 100644 index 0000000000..e4d4f20586 --- /dev/null +++ b/tests/components/spi/test.esp32-s3-ard.yaml @@ -0,0 +1,13 @@ +spi: + - id: three_spi + interface: spi3 + clk_pin: + number: 47 + mosi_pin: + number: 40 + - id: hw_spi + interface: hardware + clk_pin: + number: 0 + miso_pin: + number: 41