mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-02-18 10:53:17 +00:00
- `DisplayDevice` improvements related `DisplayDriver` - Replaced incorrect usage of `spiBusHandle` with `spiHostDevice` in all SPI display devices - Disabled `DisplayDriver` support for RGB displays for now - Updated `GraphicsDemo` project for the above changes - TactilityC improvements: - created `tt_hal_device_find()` - created `tt_hal_display_*` - created `tt_hal_touch_*` - created `tt_lvgl_*` - export `tt_app_*` calls
29 lines
646 B
C++
29 lines
646 B
C++
#pragma once
|
|
|
|
#include <cassert>
|
|
#include <tt_hal_touch.h>
|
|
|
|
/**
|
|
* Wrapper for tt_hal_touch_driver_*
|
|
*/
|
|
class TouchDriver {
|
|
|
|
TouchDriverHandle handle = nullptr;
|
|
|
|
public:
|
|
|
|
explicit TouchDriver(DeviceId id) {
|
|
assert(tt_hal_touch_driver_supported(id));
|
|
handle = tt_hal_touch_driver_alloc(id);
|
|
assert(handle != nullptr);
|
|
}
|
|
|
|
~TouchDriver() {
|
|
tt_hal_touch_driver_free(handle);
|
|
}
|
|
|
|
bool getTouchedPoints(uint16_t* x, uint16_t* y, uint16_t* strength, uint8_t* count, uint8_t maxCount) const {
|
|
return tt_hal_touch_driver_get_touched_points(handle, x, y, strength, count, maxCount);
|
|
}
|
|
};
|