Trackball rewrite (#600)

- Implement generic trackball settings
- Refactor T-Deck trackball driver into generic driver at `Drivers/gpio-trackball-module`
- Automatically bind/unbind trackball devices with LVGL
- Automatically load settings for trackball devices on boot
This commit is contained in:
Ken Van Hoeylandt
2026-07-30 13:38:19 +02:00
committed by GitHub
parent de6fc3b346
commit c729e8340f
39 changed files with 1194 additions and 666 deletions
@@ -0,0 +1,24 @@
// SPDX-License-Identifier: Apache-2.0
#include <tactility/device.h>
#include <tactility/drivers/trackball.h>
#include <tactility/error.h>
#define TRACKBALL_DRIVER_API(driver) ((struct TrackballApi*)driver->api)
extern "C" {
error_t trackball_read_delta(Device* device, int32_t* out_dx, int32_t* out_dy) {
const auto* driver = device_get_driver(device);
return TRACKBALL_DRIVER_API(driver)->read_delta(device, out_dx, out_dy);
}
error_t trackball_get_button_pressed(Device* device, bool* out_pressed) {
const auto* driver = device_get_driver(device);
return TRACKBALL_DRIVER_API(driver)->get_button_pressed(device, out_pressed);
}
const DeviceType TRACKBALL_TYPE {
.name = "trackball"
};
}