Refactor LVGL code into kernel module (#472)

* **New Features**
  * Added a standalone LVGL module and enabled LVGL support in the simulator for richer local UI testing.

* **Refactor**
  * HAL and LVGL split into distinct modules; startup and device attach/detach flows reorganized for clearer lifecycle management.
  * Public APIs tightened with clearer nullability/documentation.

* **Bug Fixes**
  * More consistent LVGL start/stop and device attach/detach behavior for improved stability.
This commit is contained in:
Ken Van Hoeylandt
2026-02-01 22:57:45 +01:00
committed by GitHub
parent 3fe1dc0312
commit 9f721e6655
135 changed files with 1553 additions and 667 deletions
+6 -5
View File
@@ -44,7 +44,8 @@ public:
virtual void onDestroy(AppContext& appContext) {}
virtual void onShow(AppContext& appContext, lv_obj_t* parent) {}
virtual void onHide(AppContext& appContext) {}
virtual void onResult(AppContext& appContext, LaunchId launchId, Result result, std::unique_ptr<Bundle> _Nullable resultData) {}
/** resultData could be null */
virtual void onResult(AppContext& appContext, LaunchId launchId, Result result, std::unique_ptr<Bundle> resultData) {}
Mutex& getMutex() { return mutex; }
@@ -81,9 +82,9 @@ std::shared_ptr<App> create() { return std::shared_ptr<T>(new T); }
/**
* @brief Start an app
* @param[in] id application name or id
* @param[in] parameters optional parameters to pass onto the application
* @param[in] parameters optional parameters to pass onto the application. can be nullptr.
*/
LaunchId start(const std::string& id, std::shared_ptr<const Bundle> _Nullable parameters = nullptr);
LaunchId start(const std::string& id, std::shared_ptr<const Bundle> parameters = nullptr);
/** @brief Stop the currently showing app. Show the previous app if any app was still running. */
void stop();
@@ -103,10 +104,10 @@ void stopAll(const std::string& id);
bool isRunning(const std::string& id);
/** @return the currently running app context (it is only ever null before the splash screen is shown) */
std::shared_ptr<AppContext> _Nullable getCurrentAppContext();
std::shared_ptr<AppContext> getCurrentAppContext();
/** @return the currently running app (it is only ever null before the splash screen is shown) */
std::shared_ptr<App> _Nullable getCurrentApp();
std::shared_ptr<App> getCurrentApp();
bool install(const std::string& path);
@@ -18,7 +18,7 @@ bool removeAppManifest(const std::string& id);
* @param[in] id the manifest id
* @return the application manifest if it was found
*/
_Nullable std::shared_ptr<AppManifest> findAppManifestById(const std::string& id);
std::shared_ptr<AppManifest> findAppManifestById(const std::string& id);
/** @return a list of all registered apps. This includes user and system apps. */
std::vector<std::shared_ptr<AppManifest>> getAppManifests();
+18 -12
View File
@@ -8,20 +8,26 @@ namespace tt::app {
typedef void* (*CreateData)();
typedef void (*DestroyData)(void* data);
typedef void (*OnCreate)(void* appContext, void* _Nullable data);
typedef void (*OnDestroy)(void* appContext, void* _Nullable data);
typedef void (*OnShow)(void* appContext, void* _Nullable data, lv_obj_t* parent);
typedef void (*OnHide)(void* appContext, void* _Nullable data);
typedef void (*OnResult)(void* appContext, void* _Nullable data, LaunchId launchId, Result result, Bundle* resultData);
/** data is nullable */
typedef void (*OnCreate)(void* appContext, void* data);
/** data is nullable */
typedef void (*OnDestroy)(void* appContext, void* data);
/** data is nullable */
typedef void (*OnShow)(void* appContext, void* data, lv_obj_t* parent);
/** data is nullable */
typedef void (*OnHide)(void* appContext, void* data);
/** data is nullable, resultData is nullable. */
typedef void (*OnResult)(void* appContext, void* data, LaunchId launchId, Result result, Bundle* resultData);
/** All fields are nullable */
void setElfAppParameters(
CreateData _Nullable createData,
DestroyData _Nullable destroyData,
OnCreate _Nullable onCreate,
OnDestroy _Nullable onDestroy,
OnShow _Nullable onShow,
OnHide _Nullable onHide,
OnResult _Nullable onResult
CreateData createData,
DestroyData destroyData,
OnCreate onCreate,
OnDestroy onDestroy,
OnShow onShow,
OnHide onHide,
OnResult onResult
);
std::shared_ptr<App> createElfApp(const std::shared_ptr<AppManifest>& manifest);