Public Access
Driver (components/el512/el512_panel.*, ESP-IDF only): - DMA ring of 8 x 4 lines (17 KB) refilled from the I2S EOF interrupt (IRAM) instead of a 142 KB full-frame stream; ~107 KB heap freed. - 256-entry lookup table encodes 8 pixels per step. - Back buffer + displayed buffer, swapped at the start of a frame. - PlatformIO builds it via lib_extra_dirs (EL512Core); lib/EL512 keeps the Adafruit GFX front end. ESPHome external component (platform: el512): - DisplayBuffer with optional ENABLE / _LOWPWR pins, set_enabled(), set_low_power(), helper functions for page lambdas. - still_alive_page: plays the Portal end-credits show, then returns to the previous page. Still Alive engine moved to components/el512/still_alive.* with a built-in 5x7 font (from Adafruit GFX, BSD); the PlatformIO demo uses the same code. The importer writes components/el512/still_alive_data.h and stops at 200 s (--until-ms), matching the hand-trimmed data. esphome/el512-panel.yaml: 8 pages (clock, forecast, agenda, dashboard, now playing, Plex, solar, Still Alive), page select, rotation, display and low-power switches, message text. home_assistant/packages/el512_panel.yaml: helper template sensors for forecast, agenda, now playing and Plex streams. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
67 lines
2.5 KiB
Python
67 lines
2.5 KiB
Python
from esphome import pins
|
|
import esphome.codegen as cg
|
|
from esphome.components import display
|
|
import esphome.config_validation as cv
|
|
from esphome.const import CONF_ID, CONF_LAMBDA, CONF_PAGES
|
|
|
|
from . import el512_ns
|
|
|
|
DEPENDENCIES = ["esp32"]
|
|
|
|
CONF_VCLK_PIN = "vclk_pin"
|
|
CONF_VID_PIN = "vid_pin"
|
|
CONF_TVID_PIN = "tvid_pin"
|
|
CONF_HS_PIN = "hs_pin"
|
|
CONF_VS_PIN = "vs_pin"
|
|
CONF_ENABLE_PIN = "enable_pin"
|
|
CONF_LOW_POWER_PIN = "low_power_pin"
|
|
CONF_STILL_ALIVE_PAGE = "still_alive_page"
|
|
|
|
EL512Display = el512_ns.class_("EL512Display", display.DisplayBuffer)
|
|
|
|
# The signals are routed through the GPIO matrix, so any output-capable GPIO
|
|
# works; the defaults are the wiring in include/pins.h.
|
|
CONFIG_SCHEMA = cv.All(
|
|
display.FULL_DISPLAY_SCHEMA.extend(
|
|
{
|
|
cv.GenerateID(): cv.declare_id(EL512Display),
|
|
cv.Optional(CONF_VCLK_PIN, default=18): pins.internal_gpio_output_pin_number,
|
|
cv.Optional(CONF_VID_PIN, default=19): pins.internal_gpio_output_pin_number,
|
|
cv.Optional(CONF_TVID_PIN, default=21): pins.internal_gpio_output_pin_number,
|
|
cv.Optional(CONF_HS_PIN, default=22): pins.internal_gpio_output_pin_number,
|
|
cv.Optional(CONF_VS_PIN, default=23): pins.internal_gpio_output_pin_number,
|
|
cv.Optional(CONF_ENABLE_PIN): pins.internal_gpio_output_pin_number,
|
|
cv.Optional(CONF_LOW_POWER_PIN): pins.internal_gpio_output_pin_number,
|
|
# Page (from `pages:`) that plays the Portal end-credits show; its
|
|
# lambda should call it.draw_still_alive() via id(...).
|
|
cv.Optional(CONF_STILL_ALIVE_PAGE): cv.use_id(display.DisplayPage),
|
|
}
|
|
).extend(cv.polling_component_schema("1s")),
|
|
cv.has_at_most_one_key(CONF_PAGES, CONF_LAMBDA),
|
|
)
|
|
|
|
|
|
async def to_code(config):
|
|
var = cg.new_Pvariable(config[CONF_ID])
|
|
await display.register_display(var, config)
|
|
|
|
cg.add(
|
|
var.set_pins(
|
|
config[CONF_VCLK_PIN],
|
|
config[CONF_VID_PIN],
|
|
config[CONF_TVID_PIN],
|
|
config[CONF_HS_PIN],
|
|
config[CONF_VS_PIN],
|
|
config.get(CONF_ENABLE_PIN, -1),
|
|
config.get(CONF_LOW_POWER_PIN, -1),
|
|
)
|
|
)
|
|
if CONF_STILL_ALIVE_PAGE in config:
|
|
page = await cg.get_variable(config[CONF_STILL_ALIVE_PAGE])
|
|
cg.add(var.set_still_alive_page(page))
|
|
if CONF_LAMBDA in config:
|
|
lambda_ = await cg.process_lambda(
|
|
config[CONF_LAMBDA], [(display.DisplayRef, "it")], return_type=cg.void
|
|
)
|
|
cg.add(var.set_writer(lambda_))
|