Ken Van Hoeylandt c87200a80d
Project restructuring (fixes macOS builds) (#198)
- Create `Include/` folder for all main projects
- Fix some issues here and there (found while moving things)
- All includes are now in `Tactility/` subfolder and must be included with that prefix. This fixes issues with clashing POSIX headers (e.g. `<semaphore.h>` versus Tactility's `Semaphore.h`)
2025-02-01 18:13:20 +01:00

33 lines
758 B
C++

#pragma once
#include <Tactility/hal/Touch.h>
#include <Tactility/TactilityCore.h>
#include "ft6x36/FT6X36.h"
class Core2Touch : public tt::hal::Touch {
private:
lv_indev_t* _Nullable deviceHandle = nullptr;
FT6X36 driver = FT6X36(I2C_NUM_0, GPIO_NUM_39);
tt::Thread driverThread;
bool interruptDriverThread = false;
tt::Mutex mutex;
lv_point_t lastPoint = { .x = 0, .y = 0 };
lv_indev_state_t lastState = LV_INDEV_STATE_RELEASED;
bool shouldInterruptDriverThread();
public:
Core2Touch();
bool start(lv_display_t* display) override;
bool stop() override;
void readLast(lv_indev_data_t* data);
lv_indev_t* _Nullable getLvglIndev() override { return deviceHandle; }
void driverThreadMain();
};