/* * radar_ui.h -- LVGL radar presentation layer for proxalarm (unified) * * SPDX-License-Identifier: GPL-2.0-or-later * * Renders the proximity alarm radar display on the H2's 320x240 LCD. * Maps abstract grid coordinates from proxvec onto the physical * framebuffer, draws range rings, target blips, a rotating sweep * line, and alarm overlays. * * This layer is completely independent of the RF/DSP and kinematics * layers -- it only knows about proxvec_target_t and LVGL draw calls. * * LVGL canvas radar display with rotating sweep, range rings, and * target blips rendered over the H2's 320x240 framebuffer. */ #ifndef RADAR_UI_H #define RADAR_UI_H #include "lvgl/lvgl.h" #include "proxvec.h" /* ------------------------------------------------------------------ */ /* Display layout constants */ /* ------------------------------------------------------------------ */ /* All pixel values are derived from h2_ui.h H2_LCD_WIDTH/HEIGHT. * Recompute if the panel changes. The radar circle is inscribed * in the smaller dimension minus a margin for the status bar. */ #define RADAR_UI_MARGIN_BOTTOM 24 /* px reserved for status bar */ #define RADAR_UI_RING_COUNT 4 /* concentric range rings */ /* Alarm flash configuration */ #define RADAR_UI_FLASH_PERIOD_MS 400 /* full on/off cycle */ /* Sweep animation */ #define RADAR_UI_SWEEP_SPEED 4 /* degrees per tick (LVGL tick ~5ms) */ /* ------------------------------------------------------------------ */ /* Public API */ /* ------------------------------------------------------------------ */ /* Create the radar LVGL screen objects (canvas, labels, etc.). * Call once after LVGL init; call radar_ui_destroy() to clean up. */ void radar_ui_init(void); /* Redraw the radar display with the latest target data. * Call once per update cycle (typically every BLE scan interval). */ void radar_ui_refresh(const proxvec_target_t *targets, int count, int alarm_count); /* Enable/disable the alarm flash overlay (called by proxalarm main * loop when proxvec_get_alarm_count() transitions 0 -> N). */ void radar_ui_set_alarm_flash(int enabled); /* Set the user-visible sensitivity label text. */ void radar_ui_set_sensitivity_label(const char *text); /* Set the user-visible source label ("BLE" / "WIFI" / "SIM"). */ void radar_ui_set_source_label(const char *text); /* Destroy all LVGL objects created by radar_ui_init(). */ void radar_ui_destroy(void); #endif /* RADAR_UI_H */