Files
pi-dashboard/components/dashboard_ui/dashboard_ui.h

49 lines
1.3 KiB
C
Raw Normal View History

2026-02-15 04:15:30 +09:00
#ifndef DASHBOARD_UI_H
#define DASHBOARD_UI_H
#include "ws_client.h"
#include "lvgl.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* Create the full dashboard UI. Must be called with LVGL lock held.
*/
void dashboard_ui_create(void);
/**
* Update Pi server stats display. LVGL lock must be held by caller.
*/
void dashboard_ui_update_stats(const pi_stats_t *stats);
/**
* Update local sensor readings. LVGL lock must be held by caller.
*/
2026-02-16 14:39:21 +09:00
void dashboard_ui_update_local(float temp, float humidity, uint8_t battery, bool charging, float voltage);
2026-02-15 04:15:30 +09:00
/**
2026-02-15 18:13:53 +09:00
* Update clock and date display. LVGL lock must be held by caller.
* weekday: 0=Sun, 1=Mon, ..., 6=Sat
2026-02-15 04:15:30 +09:00
*/
2026-02-15 18:13:53 +09:00
void dashboard_ui_update_time(int h, int m, int s, int year, int month, int day, int weekday);
2026-02-15 04:15:30 +09:00
/**
* Update connection status indicators. LVGL lock must be held by caller.
* ip_str: IP address string when connected, "Connecting..." during reconnect, "N/A" when disconnected
*/
void dashboard_ui_update_connection(ws_state_t ws_state, bool wifi_connected, const char *ip_str);
2026-02-15 21:46:18 +09:00
/**
* Update the status image widget. LVGL lock must be held by caller.
* @param dsc Image descriptor (1-bit monochrome, 120x120)
*/
void dashboard_ui_update_status_image(const lv_img_dsc_t *dsc);
2026-02-15 04:15:30 +09:00
#ifdef __cplusplus
}
#endif
#endif