From 516c5a5383cc909ac5364c53326f9e6d7b0a6c23 Mon Sep 17 00:00:00 2001 From: lamauny Date: Sat, 31 May 2025 10:34:25 +0200 Subject: [PATCH 1/2] Add support to LN882X family --- all_automations.json | 1 + components/index.rst | 1 + components/libretiny.rst | 14 ++++++++++- images/ln882x.svg | 53 ++++++++++++++++++++++++++++++++++++++++ index.rst | 2 +- 5 files changed, 69 insertions(+), 2 deletions(-) create mode 100644 images/ln882x.svg diff --git a/all_automations.json b/all_automations.json index 191870f6e6..eac8a7ec71 100644 --- a/all_automations.json +++ b/all_automations.json @@ -496,6 +496,7 @@ "esp32", "esp8266", "host", + "ln882x", "max6956", "mcp23016", "mcp23xxx", diff --git a/components/index.rst b/components/index.rst index e93ddf8db9..eaed90e145 100644 --- a/components/index.rst +++ b/components/index.rst @@ -35,6 +35,7 @@ Supported Microcontrollers RP2040, components/rp2040, rp2040.svg BK72xx, components/libretiny, bk72xx.svg RTL87xx, components/libretiny, rtl87xx.svg + LN882x, components/libretiny, ln882x.svg Host, components/host, host.svg, dark-invert Microcontroller Peripherals diff --git a/components/libretiny.rst b/components/libretiny.rst index 2d91c83256..414faa884e 100644 --- a/components/libretiny.rst +++ b/components/libretiny.rst @@ -10,6 +10,7 @@ It provides support for the following microcontrollers, commonly used in Tuya de - **BK72xx**: BK7231T, BK7231N - **RTL87xx**: RTL8710BN, RTL8710BX +- **LN882x**: LN882HKI Since different microcontrollers are supported, you need to include the appropriate ESPHome component, depending on which processor your device has. @@ -26,6 +27,9 @@ Refer to `LibreTiny/Boards `__ to find yo rtl87xx: board: generic-rtl8710bn-2mb-788k + # Example configuration entry for LN882x + ln882x: + board: generic-ln882hki Configuration variables: ------------------------ @@ -50,7 +54,7 @@ Configuration variables: - :ref:`Advanced options ` - **family** (*Optional*, string): The family of LibreTiny-supported microcontrollers that is used on this board. - One of ``bk7231n``, ``bk7231t``, ``rtl8710b``, ``rtl8720c``, ``bk7251``, ``bk7231q``. + One of ``bk7231n``, ``bk7231t``, ``rtl8710b``, ``rtl8720c``, ``bk7251``, ``bk7231q``, ``ln882hki``. Defaults to the variant that is detected from the board, if a board that's unknown to ESPHome is used, this option is mandatory. **It's recommended not to include this option**. @@ -77,6 +81,7 @@ Here are a few useful links: - `Flashing BK72xx by UART `__ - `Flashing RTL8710B by UART `__ +- `Flashing LN882x by UART `__ - `UPK2ESPHome `__ - generating ESPHome YAML automatically, from Cloudcutter profiles or Kickstart firmware (also BK72xx only) GPIO Pin Numbering @@ -109,6 +114,13 @@ Some notes about the pins on RTL8710BN/BX: - ``TX2 (PA30)`` is additionally used to determine the boot mode on startup (similar to ESP32). Pulling it LOW on startup will enter "download mode". +Some notes about the pins on LN882H: + +- ``TX0 (PA2)`` and ``RX0 (PA3)`` are used for flashing the firmware, + as well as the default :doc:`/components/logger` UART port. +- ``BOOT1 (PA9)`` is additionally used to determine the boot mode on startup (similar to ESP32). + Pulling it LOW on startup will enter "download mode". + Example configuration entries using various naming styles: .. code-block:: yaml diff --git a/images/ln882x.svg b/images/ln882x.svg new file mode 100644 index 0000000000..46db6690e6 --- /dev/null +++ b/images/ln882x.svg @@ -0,0 +1,53 @@ + + + + + + + LN882x + + diff --git a/index.rst b/index.rst index b8ae2426bb..e26504a0f6 100644 --- a/index.rst +++ b/index.rst @@ -182,7 +182,7 @@ Which microcontrollers does ESPHome support?
Others
-

Realtek RTL87xx and Beken BK72xx chips are supported.

+

Realtek RTL87xx and Beken BK72xx and LN882H chips are supported.

From c42e3dff7700547976937aa0d4c62f759a88da3c Mon Sep 17 00:00:00 2001 From: lamauny Date: Sat, 31 May 2025 10:39:05 +0200 Subject: [PATCH 2/2] missing blank line --- components/libretiny.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/components/libretiny.rst b/components/libretiny.rst index 414faa884e..0c69920ff7 100644 --- a/components/libretiny.rst +++ b/components/libretiny.rst @@ -30,6 +30,7 @@ Refer to `LibreTiny/Boards `__ to find yo # Example configuration entry for LN882x ln882x: board: generic-ln882hki + Configuration variables: ------------------------