mirror of
https://github.com/esphome/esphome.git
synced 2026-10-06 19:06:37 +00:00
[ethernet] Add spi_id option to attach SPI chips to a shared spi bus
SPI ethernet chips always initialized their own SPI host, so they could not coexist with other peripherals on the same physical pins. Boards like the M5Stack CoreS3 put the LCD, SD slot, and expansion bus on one multi-drop SPI bus, so attaching an ethernet base there was impossible. With spi_id set, the ethernet component skips spi_bus_initialize() and adds its device to the referenced hardware spi bus instead; the pins and host come from that bus. Without spi_id, behavior is unchanged.
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
ethernet:
|
||||
type: W5500
|
||||
spi_id: spi_bus
|
||||
cs_pin: 5
|
||||
interrupt_pin: 36
|
||||
reset_pin: 22
|
||||
clock_speed: 10Mhz
|
||||
manual_ip:
|
||||
static_ip: 192.168.178.56
|
||||
gateway: 192.168.178.1
|
||||
subnet: 255.255.255.0
|
||||
domain: .local
|
||||
mac_address: "02:AA:BB:CC:DD:01"
|
||||
on_connect:
|
||||
- logger.log: "Ethernet connected!"
|
||||
on_disconnect:
|
||||
- logger.log: "Ethernet disconnected!"
|
||||
@@ -0,0 +1,3 @@
|
||||
packages:
|
||||
spi: !include ../../test_build_components/common/spi/esp32-idf.yaml
|
||||
ethernet: !include common-w5500-spi-id.yaml
|
||||
Reference in New Issue
Block a user