Files
homeassistant_espscreen/components/smart_display/partitions.py
T
Xandrossian 9857cc3bda
CI / checks (push) Successful in 12m50s
CI / firmware (add-on) (push) Successful in 18m19s
CI / firmware (min_version) (push) Successful in 17m55s
Add the Elecrow CrowPanel 7.0" as a third board, and take the packages and the add-on from Gitea (0.2.93)
A board file for the Elecrow CrowPanel 7.0" (DIS08070H, ESP32-S3-WROOM-1-N4R8): 800x480 through mipi_rgb, GT911 on the
ESP32-S3's USB pins (elecrow_usb_phy.h frees them, behind a flag only this board sets), the Guition's vertical sizes
across a wider page, no rotation. Its 4 MB of flash take the CYD's budget: a partition table of the component's
(smart_display: partitions: 4mb_wide_slots, 1,984 KB slots), the icon fonts at 2 bits a pixel and the TLS client only
bring the firmware to 1,865,440 bytes, 91.8 % of a slot, with camera images kept. docs/ELECROW.md has the numbers and
the trade.

The add-on reads a large board's name from the type sensor's value, the editor offers the board under New screen and
draws the wide preview, tools/check.sh builds it with the budget, render_topbar and capture_ui take the panel's size.
Firmware 0.2.79; the CYD image is unchanged (1,633,760 bytes).

This fork builds from gittea.trippedonmy.name/Xandrossian/homeassistant_espscreen: the packages, the fonts, the
component and the add-on repository point there instead of GitHub.
2026-09-20 23:18:01 -07:00

24 lines
1.4 KiB
Python

"""Partition tables a board file can ask for with `smart_display: partitions:` (firmware 0.2.79).
ESPHome's own table for 4 MB of flash keeps 448 KB for NVS and gives the two update slots 1,792 KB each. The screen's
preferences take a few KB of NVS (ESP-IDF's own two-slot example keeps 16 KB), and the Elecrow CrowPanel 7.0" needs
the room: its firmware is the Guition's, which does not fit 1,792 KB. The tables live here, as text, because a board
file over GitHub cannot carry a file of its own; __init__.py hands the chosen one to ESPHome as the build's
partitions.csv. A table never changes once a screen is flashed with it: an update over Wi-Fi writes into the other slot
of the table the screen has, and only a USB install lays the flash out anew.
"""
# 4 MB as two update slots of 0x1F0000 bytes, the largest 64 KB-aligned pair that fits, and 64 KB of NVS at the end;
# otadata and phy_init where ESPHome puts them. Offsets are explicit so the table is the same on every build.
TABLES = {
'4mb_wide_slots': """\
# ESP Screens: 4 MB ESP32-S3 with two update slots of 1,984 KB (components/smart_display/partitions.py).
# Name, Type, SubType, Offset, Size
otadata, data, ota, 0x9000, 0x2000
phy_init, data, phy, 0xB000, 0x1000
app0, app, ota_0, 0x10000, 0x1F0000
app1, app, ota_1, 0x200000, 0x1F0000
nvs, data, nvs, 0x3F0000, 0x10000
""",
}