diff options
| author | Luke Hoersten <[email protected]> | 2026-06-13 22:35:21 -0500 |
|---|---|---|
| committer | Luke Hoersten <[email protected]> | 2026-06-13 22:35:21 -0500 |
| commit | 965f88596f8c1272a8c60f2aa0fd2a5ab88c9025 (patch) | |
| tree | 449b8736cadb940e2a1be0fa031b4b63c623b993 /main/app_main.c | |
| parent | 4756daedaefd18919e96fadaabc7f1a00b383b4c (diff) | |
M3: display driver (Pi-style DSI panel: TC358762 + ATTINY MCU)
display.{h,c} brings up the Hosyond 5\" 800x480 panel via the Raspberry
Pi 7\" touchscreen architecture:
- I2C init to the panel-side MCU at 0x45 (Pi 7\" register map ported
from drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c).
- POWERON write + 120ms settle.
- ESP32-P4 MIPI-DSI bring-up in DPI video mode: 2-lane, 480 Mbps,
800x480 @ 60Hz, RGB565, canonical Pi 7\" timings (HSW=18/HBP=20/HFP=62,
VSW=4/VBP=27/VFP=18, 30 MHz pixel clock).
- Gamma-corrected (^2.2) PWM brightness via REG_PWM (0x86).
- display_sleep / display_wake hooks for M6.
- display_fill() and display_test_pattern() (8 vertical color bars)
for M3 acceptance and reuse by M8 local screens.
app_main calls display_init() as best-effort — if the panel isn't
attached or wiring is wrong, the rest of the firmware (Ethernet, mDNS,
/state) keeps running. On success it paints the test pattern.
Pin assignments (PIN_I2C_SDA=7, PIN_I2C_SCL=8) match Waveshare's
bundled-panel BSP convention but are flagged TODO until the user's
specific FPC adapter wiring is confirmed.
main/CMakeLists.txt: add driver, esp_driver_i2c, esp_lcd to REQUIRES.
Build verified clean against ESP-IDF 5.4 for target esp32p4. M3
acceptance (color bars on screen) cannot be verified without a
flashed board + connected panel.
Diffstat (limited to 'main/app_main.c')
| -rw-r--r-- | main/app_main.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/main/app_main.c b/main/app_main.c index 9389642..c3c12c0 100644 --- a/main/app_main.c +++ b/main/app_main.c @@ -1,3 +1,4 @@ +#include "display.h" #include "http_api.h" #include "mdns_service.h" #include "net_eth.h" @@ -29,7 +30,15 @@ void app_main(void) ESP_ERROR_CHECK(mdns_service_start()); ESP_ERROR_CHECK(http_api_start()); - // TODO M3: MIPI-DSI panel init (800x480 IPS, default portrait 480x800) + // Display is best-effort during bring-up: a missing/miswired panel must + // not kill networking + /state. M3 acceptance: show a test pattern. + if (display_init() == ESP_OK) { + display_test_pattern(); + ESP_LOGI(TAG, "display up — test pattern on screen"); + } else { + ESP_LOGW(TAG, "display init failed — continuing without panel"); + } + // TODO M4: /config persistence (NVS) + GET /config + POST /config // TODO M5: /frame JPEG decode -> framebuffer // TODO M6: POST /state + idle timer |
