Add ESP32-S3 support in NeoPixelBus component (#4114)

* Add ESP32-S3 support in NeoPixelBus component

* Update NeoPixelBus version in platformio.ini
This commit is contained in:
Russell Cloran 2023-03-08 14:35:40 -08:00 committed by Jesse Hills
parent fb5eb57345
commit 2bed5b18c1
No known key found for this signature in database
GPG key ID: BEAAE804EFD8E83A
3 changed files with 6 additions and 5 deletions

View file

@ -13,8 +13,8 @@ from esphome.const import (
from esphome.components.esp32 import get_esp32_variant from esphome.components.esp32 import get_esp32_variant
from esphome.components.esp32.const import ( from esphome.components.esp32.const import (
VARIANT_ESP32, VARIANT_ESP32,
VARIANT_ESP32S2,
VARIANT_ESP32C3, VARIANT_ESP32C3,
VARIANT_ESP32S2,
VARIANT_ESP32S3, VARIANT_ESP32S3,
) )
from esphome.core import CORE from esphome.core import CORE
@ -58,9 +58,9 @@ SPI_SPEEDS = [40e6, 20e6, 10e6, 5e6, 2e6, 1e6, 500e3]
def _esp32_rmt_default_channel(): def _esp32_rmt_default_channel():
return { return {
VARIANT_ESP32C3: 1,
VARIANT_ESP32S2: 1, VARIANT_ESP32S2: 1,
VARIANT_ESP32S3: 1, VARIANT_ESP32S3: 1,
VARIANT_ESP32C3: 1,
}.get(get_esp32_variant(), 6) }.get(get_esp32_variant(), 6)
@ -71,9 +71,9 @@ def _validate_esp32_rmt_channel(value):
value = cv.int_(value) value = cv.int_(value)
variant_channels = { variant_channels = {
VARIANT_ESP32: [0, 1, 2, 3, 4, 5, 6, 7, CHANNEL_DYNAMIC], VARIANT_ESP32: [0, 1, 2, 3, 4, 5, 6, 7, CHANNEL_DYNAMIC],
VARIANT_ESP32C3: [0, 1, CHANNEL_DYNAMIC],
VARIANT_ESP32S2: [0, 1, 2, 3, CHANNEL_DYNAMIC], VARIANT_ESP32S2: [0, 1, 2, 3, CHANNEL_DYNAMIC],
VARIANT_ESP32S3: [0, 1, 2, 3, CHANNEL_DYNAMIC], VARIANT_ESP32S3: [0, 1, 2, 3, CHANNEL_DYNAMIC],
VARIANT_ESP32C3: [0, 1, CHANNEL_DYNAMIC],
} }
variant = get_esp32_variant() variant = get_esp32_variant()
if variant not in variant_channels: if variant not in variant_channels:

View file

@ -17,6 +17,7 @@ from esphome.const import (
from esphome.components.esp32 import get_esp32_variant from esphome.components.esp32 import get_esp32_variant
from esphome.components.esp32.const import ( from esphome.components.esp32.const import (
VARIANT_ESP32C3, VARIANT_ESP32C3,
VARIANT_ESP32S3,
) )
from esphome.core import CORE from esphome.core import CORE
from ._methods import ( from ._methods import (
@ -96,7 +97,7 @@ def _choose_default_method(config):
config[CONF_METHOD] = _validate_method(METHOD_BIT_BANG) config[CONF_METHOD] = _validate_method(METHOD_BIT_BANG)
if CORE.is_esp32: if CORE.is_esp32:
if get_esp32_variant() == VARIANT_ESP32C3: if get_esp32_variant() in (VARIANT_ESP32C3, VARIANT_ESP32S3):
config[CONF_METHOD] = _validate_method(METHOD_ESP32_RMT) config[CONF_METHOD] = _validate_method(METHOD_ESP32_RMT)
else: else:
config[CONF_METHOD] = _validate_method(METHOD_ESP32_I2S) config[CONF_METHOD] = _validate_method(METHOD_ESP32_I2S)

View file

@ -34,7 +34,7 @@ build_flags =
[common] [common]
lib_deps = lib_deps =
esphome/noise-c@0.1.4 ; api esphome/noise-c@0.1.4 ; api
makuna/NeoPixelBus@2.6.9 ; neopixelbus makuna/NeoPixelBus@2.7.3 ; neopixelbus
esphome/Improv@1.2.3 ; improv_serial / esp32_improv esphome/Improv@1.2.3 ; improv_serial / esp32_improv
bblanchon/ArduinoJson@6.18.5 ; json bblanchon/ArduinoJson@6.18.5 ; json
wjtje/qr-code-generator-library@1.7.0 ; qr_code wjtje/qr-code-generator-library@1.7.0 ; qr_code