1
0
Fork 0

Added PMW3320 driver (#19543)

This commit is contained in:
Vladislav Marchenko 2023-04-03 08:57:19 +06:00 committed by GitHub
parent 162d6156d3
commit 9a68472da8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 355 additions and 1 deletions

View file

@ -50,6 +50,28 @@ const pointing_device_driver_t pointing_device_driver = {
};
// clang-format on
#elif defined(POINTING_DEVICE_DRIVER_pmw3320)
report_mouse_t pmw3320_get_report(report_mouse_t mouse_report) {
report_pmw3320_t data = pmw3320_read_burst();
if (data.dx != 0 || data.dy != 0) {
pd_dprintf("Raw ] X: %d, Y: %d\n", data.dx, data.dy);
mouse_report.x = (mouse_xy_report_t)data.dx;
mouse_report.y = (mouse_xy_report_t)data.dy;
}
return mouse_report;
}
// clang-format off
const pointing_device_driver_t pointing_device_driver = {
.init = pmw3320_init,
.get_report = pmw3320_get_report,
.set_cpi = pmw3320_set_cpi,
.get_cpi = pmw3320_get_cpi,
};
// clang-format on
#elif defined(POINTING_DEVICE_DRIVER_adns9800)
report_mouse_t adns9800_get_report_driver(report_mouse_t mouse_report) {