1
0
mirror of https://github.com/esphome/esphome.git synced 2025-06-15 06:46:59 +02:00

[esp32_rmt] Add variant validation for use_dma (#8897)

This commit is contained in:
Jonathan Swoboda 2025-06-10 22:00:59 -04:00 committed by GitHub
parent b579bbf03b
commit ad37f103fa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
16 changed files with 53 additions and 17 deletions

View File

@ -131,7 +131,9 @@ CONFIG_SCHEMA = cv.All(
esp32_idf=192,
esp32_s2_idf=192,
esp32_s3_idf=192,
esp32_p4_idf=192,
esp32_c3_idf=96,
esp32_c5_idf=96,
esp32_c6_idf=96,
esp32_h2_idf=96,
): cv.All(only_with_new_rmt_driver, cv.int_range(min=2)),
@ -140,7 +142,9 @@ CONFIG_SCHEMA = cv.All(
cv.Optional(CONF_IS_RGBW, default=False): cv.boolean,
cv.Optional(CONF_IS_WRGB, default=False): cv.boolean,
cv.Optional(CONF_USE_DMA): cv.All(
esp32.only_on_variant(supported=[esp32.const.VARIANT_ESP32S3]),
esp32.only_on_variant(
supported=[esp32.const.VARIANT_ESP32S3, esp32.const.VARIANT_ESP32P4]
),
cv.only_with_esp_idf,
cv.boolean,
),

View File

@ -1,6 +1,6 @@
from esphome import pins
import esphome.codegen as cg
from esphome.components import esp32_rmt, remote_base
from esphome.components import esp32, esp32_rmt, remote_base
import esphome.config_validation as cv
from esphome.const import (
CONF_BUFFER_SIZE,
@ -128,7 +128,9 @@ CONFIG_SCHEMA = remote_base.validate_triggers(
esp32_idf=192,
esp32_s2_idf=192,
esp32_s3_idf=192,
esp32_p4_idf=192,
esp32_c3_idf=96,
esp32_c5_idf=96,
esp32_c6_idf=96,
esp32_h2_idf=96,
): cv.All(cv.only_with_esp_idf, cv.int_range(min=2)),
@ -139,7 +141,13 @@ CONFIG_SCHEMA = remote_base.validate_triggers(
CONF_RECEIVE_SYMBOLS,
esp32_idf=192,
): cv.All(cv.only_with_esp_idf, cv.int_range(min=2)),
cv.Optional(CONF_USE_DMA): cv.All(cv.only_with_esp_idf, cv.boolean),
cv.Optional(CONF_USE_DMA): cv.All(
esp32.only_on_variant(
supported=[esp32.const.VARIANT_ESP32S3, esp32.const.VARIANT_ESP32P4]
),
cv.only_with_esp_idf,
cv.boolean,
),
}
).extend(cv.COMPONENT_SCHEMA)
)

View File

@ -1,6 +1,6 @@
from esphome import automation, pins
import esphome.codegen as cg
from esphome.components import esp32_rmt, remote_base
from esphome.components import esp32, esp32_rmt, remote_base
import esphome.config_validation as cv
from esphome.const import (
CONF_CARRIER_DUTY_PERCENT,
@ -45,13 +45,21 @@ CONFIG_SCHEMA = cv.Schema(
cv.only_on_esp32, cv.only_with_arduino, cv.int_range(min=1, max=255)
),
cv.Optional(CONF_EOT_LEVEL): cv.All(cv.only_with_esp_idf, cv.boolean),
cv.Optional(CONF_USE_DMA): cv.All(cv.only_with_esp_idf, cv.boolean),
cv.Optional(CONF_USE_DMA): cv.All(
esp32.only_on_variant(
supported=[esp32.const.VARIANT_ESP32S3, esp32.const.VARIANT_ESP32P4]
),
cv.only_with_esp_idf,
cv.boolean,
),
cv.SplitDefault(
CONF_RMT_SYMBOLS,
esp32_idf=64,
esp32_s2_idf=64,
esp32_s3_idf=48,
esp32_p4_idf=48,
esp32_c3_idf=48,
esp32_c5_idf=48,
esp32_c6_idf=48,
esp32_h2_idf=48,
): cv.All(cv.only_with_esp_idf, cv.int_range(min=2)),

View File

@ -2,4 +2,5 @@ substitutions:
pin1: GPIO13
pin2: GPIO14
<<: !include common-ard.yaml
packages:
common: !include common-ard.yaml

View File

@ -2,4 +2,5 @@ substitutions:
pin1: GPIO3
pin2: GPIO4
<<: !include common-ard.yaml
packages:
common: !include common-ard.yaml

View File

@ -2,4 +2,5 @@ substitutions:
pin1: GPIO3
pin2: GPIO4
<<: !include common-idf.yaml
packages:
common: !include common-idf.yaml

View File

@ -2,4 +2,5 @@ substitutions:
pin1: GPIO13
pin2: GPIO14
<<: !include common-idf.yaml
packages:
common: !include common-idf.yaml

View File

@ -0,0 +1,12 @@
substitutions:
pin1: GPIO3
pin2: GPIO4
packages:
common: !include common-idf.yaml
light:
- id: !extend led_strip1
use_dma: "true"
- id: !extend led_strip2
use_dma: "false"

View File

@ -7,7 +7,6 @@ remote_receiver:
filter_symbols: ${filter_symbols}
receive_symbols: ${receive_symbols}
rmt_symbols: ${rmt_symbols}
use_dma: ${use_dma}
<<: !include common-actions.yaml
binary_sensor:

View File

@ -4,7 +4,6 @@ substitutions:
filter_symbols: "2"
receive_symbols: "4"
rmt_symbols: "64"
use_dma: "true"
packages:
common: !include esp32-common-idf.yaml

View File

@ -4,7 +4,6 @@ substitutions:
filter_symbols: "2"
receive_symbols: "4"
rmt_symbols: "64"
use_dma: "true"
packages:
common: !include esp32-common-idf.yaml

View File

@ -4,7 +4,10 @@ substitutions:
filter_symbols: "2"
receive_symbols: "4"
rmt_symbols: "64"
use_dma: "true"
packages:
common: !include esp32-common-idf.yaml
remote_receiver:
- id: !extend rcvr
use_dma: "true"

View File

@ -4,7 +4,6 @@ remote_transmitter:
carrier_duty_percent: 50%
clock_resolution: ${clock_resolution}
rmt_symbols: ${rmt_symbols}
use_dma: ${use_dma}
packages:
buttons: !include common-buttons.yaml

View File

@ -2,7 +2,6 @@ substitutions:
pin: GPIO2
clock_resolution: "2000000"
rmt_symbols: "64"
use_dma: "true"
packages:
common: !include esp32-common-idf.yaml

View File

@ -2,7 +2,6 @@ substitutions:
pin: GPIO2
clock_resolution: "2000000"
rmt_symbols: "64"
use_dma: "true"
packages:
common: !include esp32-common-idf.yaml

View File

@ -2,7 +2,10 @@ substitutions:
pin: GPIO38
clock_resolution: "2000000"
rmt_symbols: "64"
use_dma: "true"
packages:
common: !include esp32-common-idf.yaml
remote_transmitter:
- id: !extend xmitr
use_dma: "true"