1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-03 18:42:23 +01:00

[spi] fix SPI interface selection on ESP32-S2 and -S3 (#10732) (#10766)

This commit is contained in:
Brandon Ibach
2025-09-28 06:58:42 -04:00
committed by GitHub
parent 0d2d18c198
commit a7042687c1
2 changed files with 13 additions and 3 deletions

View File

@@ -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)"

View File

@@ -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