summaryrefslogtreecommitdiff
path: root/src/touchhandler/TouchHandler.h
diff options
context:
space:
mode:
authorRiku Isokoski <riksu9000@gmail.com>2021-07-15 11:11:27 (GMT)
committerRiku Isokoski <riksu9000@gmail.com>2021-07-15 11:11:27 (GMT)
commitfe64176e7b8a0a7a9df733701d08762b60c2511f (patch)
treed5ef31d626486c85fd046bbeeb22af845315079d /src/touchhandler/TouchHandler.h
parent57b339707861c5688f5d432f1506a99df6bb0fce (diff)
New touch handler, with issues
Diffstat (limited to 'src/touchhandler/TouchHandler.h')
-rw-r--r--src/touchhandler/TouchHandler.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/touchhandler/TouchHandler.h b/src/touchhandler/TouchHandler.h
new file mode 100644
index 0000000..7999e00
--- /dev/null
+++ b/src/touchhandler/TouchHandler.h
@@ -0,0 +1,45 @@
+#pragma once
+#include "drivers/Cst816s.h"
+#include "systemtask/SystemTask.h"
+#include <FreeRTOS.h>
+#include <task.h>
+
+namespace Pinetime {
+ namespace Components {
+ class LittleVgl;
+ }
+ namespace Drivers {
+ class Cst816S;
+ }
+ namespace System {
+ class SystemTask;
+ }
+ namespace Controllers {
+ class TouchHandler {
+ public:
+ explicit TouchHandler(Drivers::Cst816S&, Components::LittleVgl&);
+ void CancelTap();
+ void Register(Pinetime::System::SystemTask* systemTask);
+ void Start();
+ void WakeUp();
+ uint8_t GetX() const {
+ return x;
+ }
+ uint8_t GetY() const {
+ return y;
+ }
+ Drivers::Cst816S::Gestures GestureGet();
+ private:
+ static void Process(void* instance);
+ void Work();
+ Pinetime::System::SystemTask* systemTask = nullptr;
+ TaskHandle_t taskHandle;
+ Pinetime::Drivers::Cst816S& touchPanel;
+ Pinetime::Components::LittleVgl& lvgl;
+ Pinetime::Drivers::Cst816S::Gestures gesture;
+ Pinetime::Drivers::Cst816S::Gestures prevGesture;
+ bool isCancelled = false;
+ uint8_t x, y;
+ };
+ }
+}