b39bd6b6f5
- Simplified app registration with a C++ wrapper for the TactilityC. - Rename the various app classes from `Application` to more specific names like `Calculator` etc.
35 lines
712 B
C++
35 lines
712 B
C++
#pragma once
|
|
|
|
#include <TactilityCpp/App.h>
|
|
|
|
#include <tt_app.h>
|
|
#include <tt_mutex.h>
|
|
#include <tt_timer.h>
|
|
|
|
#include <lvgl.h>
|
|
#include <vector>
|
|
|
|
class Gpio final : public App {
|
|
|
|
std::vector<lv_obj_t*> pinWidgets;
|
|
std::vector<bool> pinStates;
|
|
TimerHandle timer;
|
|
MutexHandle mutex;
|
|
|
|
static lv_obj_t* createGpioRowWrapper(lv_obj_t* parent);
|
|
static void onTimer(void* parameter);
|
|
|
|
public:
|
|
|
|
void onCreate(AppHandle app) override;
|
|
void onDestroy(AppHandle app) override;
|
|
void onShow(AppHandle context, lv_obj_t* parent) override;
|
|
void onHide(AppHandle context) override;
|
|
|
|
void startTask();
|
|
void stopTask();
|
|
|
|
void updatePinStates();
|
|
void updatePinWidgets();
|
|
};
|