Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SPI: Make some validation failures give more useful messages. #6413

Merged
merged 6 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions esphome/components/spi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,9 @@ def get_spi_interface(index):
*sum(get_hw_interface_list(), ["software", "hardware", "any"]),
lower=True,
),
cv.Optional(CONF_DATA_PINS): cv.invalid(
"'data_pins' should be used with 'type: quad' only"
),
}
),
cv.has_at_least_one_key(CONF_MISO_PIN, CONF_MOSI_PIN),
Expand All @@ -287,6 +290,12 @@ def get_spi_interface(index):
*sum(get_hw_interface_list(), ["hardware"]),
lower=True,
),
cv.Optional(CONF_MISO_PIN): cv.invalid(
"'miso_pin' should not be used with quad SPI"
),
cv.Optional(CONF_MOSI_PIN): cv.invalid(
"'mosi_pin' should not be used with quad SPI"
),
}
),
cv.only_on([PLATFORM_ESP32]),
Expand Down
9 changes: 5 additions & 4 deletions tests/components/xpt2046/test.esp32-c3-idf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ touchscreen:
display: xpt_display
update_interval: 50ms
threshold: 400
calibration_x_min: 3860
calibration_x_max: 280
calibration_y_min: 340
calibration_y_max: 3860
calibration:
x_min: 3860
x_max: 280
y_min: 340
y_max: 3860
on_touch:
- logger.log:
format: Touch at (%d, %d)
Expand Down
9 changes: 5 additions & 4 deletions tests/components/xpt2046/test.esp32-c3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ touchscreen:
display: xpt_display
update_interval: 50ms
threshold: 400
calibration_x_min: 3860
calibration_x_max: 280
calibration_y_min: 340
calibration_y_max: 3860
calibration:
x_min: 3860
x_max: 280
y_min: 340
y_max: 3860
on_touch:
- logger.log:
format: Touch at (%d, %d)
Expand Down
9 changes: 5 additions & 4 deletions tests/components/xpt2046/test.esp32-idf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ touchscreen:
display: xpt_display
update_interval: 50ms
threshold: 400
calibration_x_min: 3860
calibration_x_max: 280
calibration_y_min: 340
calibration_y_max: 3860
calibration:
x_min: 3860
x_max: 280
y_min: 340
y_max: 3860
on_touch:
- logger.log:
format: Touch at (%d, %d)
Expand Down
9 changes: 5 additions & 4 deletions tests/components/xpt2046/test.esp32.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ touchscreen:
display: xpt_display
update_interval: 50ms
threshold: 400
calibration_x_min: 3860
calibration_x_max: 280
calibration_y_min: 340
calibration_y_max: 3860
calibration:
x_min: 3860
x_max: 280
y_min: 340
y_max: 3860
on_touch:
- logger.log:
format: Touch at (%d, %d)
Expand Down
9 changes: 5 additions & 4 deletions tests/components/xpt2046/test.esp8266.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ touchscreen:
display: xpt_display
update_interval: 50ms
threshold: 400
calibration_x_min: 3860
calibration_x_max: 280
calibration_y_min: 340
calibration_y_max: 3860
calibration:
x_min: 3860
x_max: 280
y_min: 340
y_max: 3860
on_touch:
- logger.log:
format: Touch at (%d, %d)
Expand Down
9 changes: 5 additions & 4 deletions tests/components/xpt2046/test.rp2040.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ touchscreen:
display: xpt_display
update_interval: 50ms
threshold: 400
calibration_x_min: 3860
calibration_x_max: 280
calibration_y_min: 340
calibration_y_max: 3860
calibration:
x_min: 3860
x_max: 280
y_min: 340
y_max: 3860
on_touch:
- logger.log:
format: Touch at (%d, %d)
Expand Down