Files
tactility_apps/Apps/MystifyDemo/main/Include/drivers/TouchDriver.h
T
Ken Van Hoeylandt 4f635d38e3 Updates for removal of deprecated HAL (#37)
Update all apps to replace deprecated LVGL code and to use the new kernel APIs.
2026-07-26 12:47:03 +02:00

29 lines
694 B
C++

#pragma once
#include <tactility/device.h>
#include <tactility/drivers/pointer.h>
/**
* Wrapper for pointer_* device driver functions
*/
class TouchDriver {
struct Device* device;
public:
explicit TouchDriver(struct Device* device) : device(device) {
device_get(device);
}
~TouchDriver() {
device_put(device);
}
bool getTouchedPoints(uint16_t* x, uint16_t* y, uint16_t* strength, uint8_t* count, uint8_t maxCount) const {
// Poll without blocking: perform one read attempt, then report whatever is cached.
pointer_read_data(device, 0);
return pointer_get_touched_points(device, x, y, strength, count, maxCount);
}
};