Refactor SPI configuration: Update display and touchscreen SPI settings for improved clarity and functionality
This commit is contained in:
@@ -42,16 +42,22 @@ wifi:
|
|||||||
|
|
||||||
captive_portal:
|
captive_portal:
|
||||||
|
|
||||||
# SPI for display and touchscreen
|
# SPI for display and touchscreen (CYD uses two separate SPI buses)
|
||||||
spi:
|
spi:
|
||||||
clk_pin: GPIO14
|
- id: tft_spi
|
||||||
mosi_pin: GPIO13
|
clk_pin: GPIO14
|
||||||
miso_pin: GPIO12
|
mosi_pin: GPIO13
|
||||||
|
miso_pin: GPIO12
|
||||||
|
- id: touch_spi
|
||||||
|
clk_pin: GPIO25
|
||||||
|
mosi_pin: GPIO32
|
||||||
|
miso_pin: GPIO39
|
||||||
|
|
||||||
# ILI9341 Display (2.8" 320x240)
|
# ILI9341 Display (2.8" 320x240)
|
||||||
display:
|
display:
|
||||||
- platform: ili9xxx
|
- platform: ili9xxx
|
||||||
model: ili9341
|
model: ili9341
|
||||||
|
spi_id: tft_spi
|
||||||
cs_pin: GPIO15
|
cs_pin: GPIO15
|
||||||
dc_pin: GPIO2
|
dc_pin: GPIO2
|
||||||
data_rate: 40MHz
|
data_rate: 40MHz
|
||||||
@@ -98,6 +104,7 @@ display:
|
|||||||
# XPT2046 Touchscreen
|
# XPT2046 Touchscreen
|
||||||
touchscreen:
|
touchscreen:
|
||||||
- platform: xpt2046
|
- platform: xpt2046
|
||||||
|
spi_id: touch_spi
|
||||||
cs_pin: GPIO33
|
cs_pin: GPIO33
|
||||||
interrupt_pin: GPIO36
|
interrupt_pin: GPIO36
|
||||||
calibration:
|
calibration:
|
||||||
@@ -246,4 +253,4 @@ text_sensor:
|
|||||||
on_value:
|
on_value:
|
||||||
then:
|
then:
|
||||||
- lambda: 'id(fan_state) = (x == "on");'
|
- lambda: 'id(fan_state) = (x == "on");'
|
||||||
- lambda: 'id(all_state) = id(light1_state) && id(light2_state) && id(fan_state);'
|
- lambda: 'id(all_state) = id(light1_state) && id(light2_state) && id(fan_state);'
|
||||||
Reference in New Issue
Block a user