pointing_device_drivers.c 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514
  1. /* Copyright 2017 Joshua Broekhuijsen <snipeye+qmk@gmail.com>
  2. * Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
  3. * Copyright 2021 Dasky (@daskygit)
  4. *
  5. * This program is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, either version 2 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #include "pointing_device.h"
  19. #include "pointing_device_internal.h"
  20. #include "debug.h"
  21. #include "wait.h"
  22. #include "timer.h"
  23. #include <stddef.h>
  24. #define CONSTRAIN_HID(amt) ((amt) < INT8_MIN ? INT8_MIN : ((amt) > INT8_MAX ? INT8_MAX : (amt)))
  25. #define CONSTRAIN_HID_XY(amt) ((amt) < XY_REPORT_MIN ? XY_REPORT_MIN : ((amt) > XY_REPORT_MAX ? XY_REPORT_MAX : (amt)))
  26. // get_report functions should probably be moved to their respective drivers.
  27. #if defined(POINTING_DEVICE_DRIVER_adns5050)
  28. report_mouse_t adns5050_get_report(report_mouse_t mouse_report) {
  29. report_adns5050_t data = adns5050_read_burst();
  30. if (data.dx != 0 || data.dy != 0) {
  31. pd_dprintf("Raw ] X: %d, Y: %d\n", data.dx, data.dy);
  32. mouse_report.x = (mouse_xy_report_t)data.dx;
  33. mouse_report.y = (mouse_xy_report_t)data.dy;
  34. }
  35. return mouse_report;
  36. }
  37. // clang-format off
  38. const pointing_device_driver_t pointing_device_driver = {
  39. .init = adns5050_init,
  40. .get_report = adns5050_get_report,
  41. .set_cpi = adns5050_set_cpi,
  42. .get_cpi = adns5050_get_cpi,
  43. };
  44. // clang-format on
  45. #elif defined(POINTING_DEVICE_DRIVER_pmw3320)
  46. report_mouse_t pmw3320_get_report(report_mouse_t mouse_report) {
  47. report_pmw3320_t data = pmw3320_read_burst();
  48. if (data.dx != 0 || data.dy != 0) {
  49. pd_dprintf("Raw ] X: %d, Y: %d\n", data.dx, data.dy);
  50. mouse_report.x = (mouse_xy_report_t)data.dx;
  51. mouse_report.y = (mouse_xy_report_t)data.dy;
  52. }
  53. return mouse_report;
  54. }
  55. // clang-format off
  56. const pointing_device_driver_t pointing_device_driver = {
  57. .init = pmw3320_init,
  58. .get_report = pmw3320_get_report,
  59. .set_cpi = pmw3320_set_cpi,
  60. .get_cpi = pmw3320_get_cpi,
  61. };
  62. // clang-format on
  63. #elif defined(POINTING_DEVICE_DRIVER_adns9800)
  64. report_mouse_t adns9800_get_report_driver(report_mouse_t mouse_report) {
  65. report_adns9800_t sensor_report = adns9800_get_report();
  66. mouse_report.x = CONSTRAIN_HID_XY(sensor_report.x);
  67. mouse_report.y = CONSTRAIN_HID_XY(sensor_report.y);
  68. return mouse_report;
  69. }
  70. // clang-format off
  71. const pointing_device_driver_t pointing_device_driver = {
  72. .init = adns9800_init,
  73. .get_report = adns9800_get_report_driver,
  74. .set_cpi = adns9800_set_cpi,
  75. .get_cpi = adns9800_get_cpi
  76. };
  77. // clang-format on
  78. #elif defined(POINTING_DEVICE_DRIVER_analog_joystick)
  79. report_mouse_t analog_joystick_get_report(report_mouse_t mouse_report) {
  80. report_analog_joystick_t data = analog_joystick_read();
  81. pd_dprintf("Raw ] X: %d, Y: %d\n", data.x, data.y);
  82. mouse_report.x = data.x;
  83. mouse_report.y = data.y;
  84. mouse_report.buttons = pointing_device_handle_buttons(mouse_report.buttons, data.button, POINTING_DEVICE_BUTTON1);
  85. return mouse_report;
  86. }
  87. // clang-format off
  88. const pointing_device_driver_t pointing_device_driver = {
  89. .init = analog_joystick_init,
  90. .get_report = analog_joystick_get_report,
  91. .set_cpi = NULL,
  92. .get_cpi = NULL
  93. };
  94. // clang-format on
  95. #elif defined(POINTING_DEVICE_DRIVER_azoteq_iqs5xx)
  96. static i2c_status_t azoteq_iqs5xx_init_status = 1;
  97. void azoteq_iqs5xx_init(void) {
  98. i2c_init();
  99. azoteq_iqs5xx_wake();
  100. azoteq_iqs5xx_reset_suspend(true, false, true);
  101. wait_ms(100);
  102. azoteq_iqs5xx_wake();
  103. if (azoteq_iqs5xx_get_product() != AZOTEQ_IQS5XX_UNKNOWN) {
  104. azoteq_iqs5xx_setup_resolution();
  105. azoteq_iqs5xx_init_status = azoteq_iqs5xx_set_report_rate(AZOTEQ_IQS5XX_REPORT_RATE, AZOTEQ_IQS5XX_ACTIVE, false);
  106. azoteq_iqs5xx_init_status |= azoteq_iqs5xx_set_event_mode(false, false);
  107. azoteq_iqs5xx_init_status |= azoteq_iqs5xx_set_reati(true, false);
  108. # if defined(AZOTEQ_IQS5XX_ROTATION_90)
  109. azoteq_iqs5xx_init_status |= azoteq_iqs5xx_set_xy_config(false, true, true, true, false);
  110. # elif defined(AZOTEQ_IQS5XX_ROTATION_180)
  111. azoteq_iqs5xx_init_status |= azoteq_iqs5xx_set_xy_config(true, true, false, true, false);
  112. # elif defined(AZOTEQ_IQS5XX_ROTATION_270)
  113. azoteq_iqs5xx_init_status |= azoteq_iqs5xx_set_xy_config(true, false, true, true, false);
  114. # else
  115. azoteq_iqs5xx_init_status |= azoteq_iqs5xx_set_xy_config(false, false, false, true, false);
  116. # endif
  117. azoteq_iqs5xx_init_status |= azoteq_iqs5xx_set_gesture_config(true);
  118. wait_ms(AZOTEQ_IQS5XX_REPORT_RATE + 1);
  119. }
  120. };
  121. report_mouse_t azoteq_iqs5xx_get_report(report_mouse_t mouse_report) {
  122. report_mouse_t temp_report = {0};
  123. static uint8_t previous_button_state = 0;
  124. static uint8_t read_error_count = 0;
  125. if (azoteq_iqs5xx_init_status == I2C_STATUS_SUCCESS) {
  126. azoteq_iqs5xx_base_data_t base_data = {0};
  127. # if !defined(POINTING_DEVICE_MOTION_PIN)
  128. azoteq_iqs5xx_wake();
  129. # endif
  130. i2c_status_t status = azoteq_iqs5xx_get_base_data(&base_data);
  131. bool ignore_movement = false;
  132. if (status == I2C_STATUS_SUCCESS) {
  133. // pd_dprintf("IQS5XX - previous cycle time: %d \n", base_data.previous_cycle_time);
  134. read_error_count = 0;
  135. if (base_data.gesture_events_0.single_tap || base_data.gesture_events_0.press_and_hold) {
  136. pd_dprintf("IQS5XX - Single tap/hold.\n");
  137. temp_report.buttons = pointing_device_handle_buttons(temp_report.buttons, true, POINTING_DEVICE_BUTTON1);
  138. } else if (base_data.gesture_events_1.two_finger_tap) {
  139. pd_dprintf("IQS5XX - Two finger tap.\n");
  140. temp_report.buttons = pointing_device_handle_buttons(temp_report.buttons, true, POINTING_DEVICE_BUTTON2);
  141. } else if (base_data.gesture_events_0.swipe_x_neg) {
  142. pd_dprintf("IQS5XX - X-.\n");
  143. temp_report.buttons = pointing_device_handle_buttons(temp_report.buttons, true, POINTING_DEVICE_BUTTON4);
  144. ignore_movement = true;
  145. } else if (base_data.gesture_events_0.swipe_x_pos) {
  146. pd_dprintf("IQS5XX - X+.\n");
  147. temp_report.buttons = pointing_device_handle_buttons(temp_report.buttons, true, POINTING_DEVICE_BUTTON5);
  148. ignore_movement = true;
  149. } else if (base_data.gesture_events_0.swipe_y_neg) {
  150. pd_dprintf("IQS5XX - Y-.\n");
  151. temp_report.buttons = pointing_device_handle_buttons(temp_report.buttons, true, POINTING_DEVICE_BUTTON6);
  152. ignore_movement = true;
  153. } else if (base_data.gesture_events_0.swipe_y_pos) {
  154. pd_dprintf("IQS5XX - Y+.\n");
  155. temp_report.buttons = pointing_device_handle_buttons(temp_report.buttons, true, POINTING_DEVICE_BUTTON3);
  156. ignore_movement = true;
  157. } else if (base_data.gesture_events_1.zoom) {
  158. if (AZOTEQ_IQS5XX_COMBINE_H_L_BYTES(base_data.x.h, base_data.x.l) < 0) {
  159. pd_dprintf("IQS5XX - Zoom out.\n");
  160. temp_report.buttons = pointing_device_handle_buttons(temp_report.buttons, true, POINTING_DEVICE_BUTTON7);
  161. } else if (AZOTEQ_IQS5XX_COMBINE_H_L_BYTES(base_data.x.h, base_data.x.l) > 0) {
  162. pd_dprintf("IQS5XX - Zoom in.\n");
  163. temp_report.buttons = pointing_device_handle_buttons(temp_report.buttons, true, POINTING_DEVICE_BUTTON8);
  164. }
  165. } else if (base_data.gesture_events_1.scroll) {
  166. pd_dprintf("IQS5XX - Scroll.\n");
  167. temp_report.h = CONSTRAIN_HID(AZOTEQ_IQS5XX_COMBINE_H_L_BYTES(base_data.x.h, base_data.x.l));
  168. temp_report.v = CONSTRAIN_HID(AZOTEQ_IQS5XX_COMBINE_H_L_BYTES(base_data.y.h, base_data.y.l));
  169. }
  170. if (base_data.number_of_fingers == 1 && !ignore_movement) {
  171. temp_report.x = CONSTRAIN_HID_XY(AZOTEQ_IQS5XX_COMBINE_H_L_BYTES(base_data.x.h, base_data.x.l));
  172. temp_report.y = CONSTRAIN_HID_XY(AZOTEQ_IQS5XX_COMBINE_H_L_BYTES(base_data.y.h, base_data.y.l));
  173. }
  174. previous_button_state = temp_report.buttons;
  175. } else {
  176. if (read_error_count > 10) {
  177. read_error_count = 0;
  178. previous_button_state = 0;
  179. } else {
  180. read_error_count++;
  181. }
  182. temp_report.buttons = previous_button_state;
  183. pd_dprintf("IQS5XX - get report failed: %d \n", status);
  184. }
  185. } else {
  186. pd_dprintf("IQS5XX - Init failed: %d \n", azoteq_iqs5xx_init_status);
  187. }
  188. return temp_report;
  189. }
  190. // clang-format off
  191. const pointing_device_driver_t pointing_device_driver = {
  192. .init = azoteq_iqs5xx_init,
  193. .get_report = azoteq_iqs5xx_get_report,
  194. .set_cpi = azoteq_iqs5xx_set_cpi,
  195. .get_cpi = azoteq_iqs5xx_get_cpi
  196. };
  197. // clang-format on
  198. #elif defined(POINTING_DEVICE_DRIVER_cirque_pinnacle_i2c) || defined(POINTING_DEVICE_DRIVER_cirque_pinnacle_spi)
  199. # ifdef POINTING_DEVICE_GESTURES_CURSOR_GLIDE_ENABLE
  200. static bool cursor_glide_enable = true;
  201. static cursor_glide_context_t glide = {.config = {
  202. .coef = 102, /* Good default friction coef */
  203. .interval = 10, /* 100sps */
  204. .trigger_px = 10, /* Default threshold in case of hover, set to 0 if you'd like */
  205. }};
  206. void cirque_pinnacle_enable_cursor_glide(bool enable) {
  207. cursor_glide_enable = enable;
  208. }
  209. void cirque_pinnacle_configure_cursor_glide(float trigger_px) {
  210. glide.config.trigger_px = trigger_px;
  211. }
  212. # endif
  213. # if CIRQUE_PINNACLE_POSITION_MODE
  214. # ifdef POINTING_DEVICE_AUTO_MOUSE_ENABLE
  215. static bool is_touch_down;
  216. bool auto_mouse_activation(report_mouse_t mouse_report) {
  217. return is_touch_down || mouse_report.x != 0 || mouse_report.y != 0 || mouse_report.h != 0 || mouse_report.v != 0 || mouse_report.buttons;
  218. }
  219. # endif
  220. report_mouse_t cirque_pinnacle_get_report(report_mouse_t mouse_report) {
  221. uint16_t scale = cirque_pinnacle_get_scale();
  222. pinnacle_data_t touchData = cirque_pinnacle_read_data();
  223. mouse_xy_report_t report_x = 0, report_y = 0;
  224. static uint16_t x = 0, y = 0, last_scale = 0;
  225. # if defined(CIRQUE_PINNACLE_TAP_ENABLE)
  226. mouse_report.buttons = pointing_device_handle_buttons(mouse_report.buttons, false, POINTING_DEVICE_BUTTON1);
  227. # endif
  228. # ifdef POINTING_DEVICE_GESTURES_CURSOR_GLIDE_ENABLE
  229. cursor_glide_t glide_report = {0};
  230. if (cursor_glide_enable) {
  231. glide_report = cursor_glide_check(&glide);
  232. }
  233. # endif
  234. if (!touchData.valid) {
  235. # ifdef POINTING_DEVICE_GESTURES_CURSOR_GLIDE_ENABLE
  236. if (cursor_glide_enable && glide_report.valid) {
  237. report_x = glide_report.dx;
  238. report_y = glide_report.dy;
  239. goto mouse_report_update;
  240. }
  241. # endif
  242. return mouse_report;
  243. }
  244. if (touchData.touchDown) {
  245. pd_dprintf("cirque_pinnacle touchData x=%4d y=%4d z=%2d\n", touchData.xValue, touchData.yValue, touchData.zValue);
  246. }
  247. # ifdef POINTING_DEVICE_AUTO_MOUSE_ENABLE
  248. is_touch_down = touchData.touchDown;
  249. # endif
  250. // Scale coordinates to arbitrary X, Y resolution
  251. cirque_pinnacle_scale_data(&touchData, scale, scale);
  252. if (!cirque_pinnacle_gestures(&mouse_report, touchData)) {
  253. if (last_scale && scale == last_scale && x && y && touchData.xValue && touchData.yValue) {
  254. report_x = CONSTRAIN_HID_XY((int16_t)(touchData.xValue - x));
  255. report_y = CONSTRAIN_HID_XY((int16_t)(touchData.yValue - y));
  256. }
  257. x = touchData.xValue;
  258. y = touchData.yValue;
  259. last_scale = scale;
  260. # ifdef POINTING_DEVICE_GESTURES_CURSOR_GLIDE_ENABLE
  261. if (cursor_glide_enable) {
  262. if (touchData.touchDown) {
  263. cursor_glide_update(&glide, report_x, report_y, touchData.zValue);
  264. } else if (!glide_report.valid) {
  265. glide_report = cursor_glide_start(&glide);
  266. if (glide_report.valid) {
  267. report_x = glide_report.dx;
  268. report_y = glide_report.dy;
  269. }
  270. }
  271. }
  272. # endif
  273. }
  274. # ifdef POINTING_DEVICE_GESTURES_CURSOR_GLIDE_ENABLE
  275. mouse_report_update:
  276. # endif
  277. mouse_report.x = report_x;
  278. mouse_report.y = report_y;
  279. return mouse_report;
  280. }
  281. uint16_t cirque_pinnacle_get_cpi(void) {
  282. return CIRQUE_PINNACLE_PX_TO_INCH(cirque_pinnacle_get_scale());
  283. }
  284. void cirque_pinnacle_set_cpi(uint16_t cpi) {
  285. cirque_pinnacle_set_scale(CIRQUE_PINNACLE_INCH_TO_PX(cpi));
  286. }
  287. // clang-format off
  288. const pointing_device_driver_t pointing_device_driver = {
  289. .init = cirque_pinnacle_init,
  290. .get_report = cirque_pinnacle_get_report,
  291. .set_cpi = cirque_pinnacle_set_cpi,
  292. .get_cpi = cirque_pinnacle_get_cpi
  293. };
  294. // clang-format on
  295. # else
  296. report_mouse_t cirque_pinnacle_get_report(report_mouse_t mouse_report) {
  297. pinnacle_data_t touchData = cirque_pinnacle_read_data();
  298. // Scale coordinates to arbitrary X, Y resolution
  299. cirque_pinnacle_scale_data(&touchData, cirque_pinnacle_get_scale(), cirque_pinnacle_get_scale());
  300. if (touchData.valid) {
  301. mouse_report.buttons = touchData.buttons;
  302. mouse_report.x = CONSTRAIN_HID_XY(touchData.xDelta);
  303. mouse_report.y = CONSTRAIN_HID_XY(touchData.yDelta);
  304. mouse_report.v = touchData.wheelCount;
  305. }
  306. return mouse_report;
  307. }
  308. // clang-format off
  309. const pointing_device_driver_t pointing_device_driver = {
  310. .init = cirque_pinnacle_init,
  311. .get_report = cirque_pinnacle_get_report,
  312. .set_cpi = cirque_pinnacle_set_scale,
  313. .get_cpi = cirque_pinnacle_get_scale
  314. };
  315. // clang-format on
  316. # endif
  317. #elif defined(POINTING_DEVICE_DRIVER_paw3204)
  318. report_mouse_t paw3204_get_report(report_mouse_t mouse_report) {
  319. report_paw3204_t data = paw3204_read();
  320. if (data.isMotion) {
  321. pd_dprintf("Raw ] X: %d, Y: %d\n", data.x, data.y);
  322. mouse_report.x = data.x;
  323. mouse_report.y = data.y;
  324. }
  325. return mouse_report;
  326. }
  327. const pointing_device_driver_t pointing_device_driver = {
  328. .init = paw3204_init,
  329. .get_report = paw3204_get_report,
  330. .set_cpi = paw3204_set_cpi,
  331. .get_cpi = paw3204_get_cpi,
  332. };
  333. #elif defined(POINTING_DEVICE_DRIVER_pimoroni_trackball)
  334. mouse_xy_report_t pimoroni_trackball_adapt_values(clamp_range_t* offset) {
  335. if (*offset > XY_REPORT_MAX) {
  336. *offset -= XY_REPORT_MAX;
  337. return (mouse_xy_report_t)XY_REPORT_MAX;
  338. } else if (*offset < XY_REPORT_MIN) {
  339. *offset += XY_REPORT_MAX;
  340. return (mouse_xy_report_t)XY_REPORT_MIN;
  341. } else {
  342. mouse_xy_report_t temp_return = *offset;
  343. *offset = 0;
  344. return temp_return;
  345. }
  346. }
  347. report_mouse_t pimoroni_trackball_get_report(report_mouse_t mouse_report) {
  348. static uint16_t debounce = 0;
  349. static uint8_t error_count = 0;
  350. pimoroni_data_t pimoroni_data = {0};
  351. static clamp_range_t x_offset = 0, y_offset = 0;
  352. if (error_count < PIMORONI_TRACKBALL_ERROR_COUNT) {
  353. i2c_status_t status = read_pimoroni_trackball(&pimoroni_data);
  354. if (status == I2C_STATUS_SUCCESS) {
  355. error_count = 0;
  356. if (!(pimoroni_data.click & 128)) {
  357. mouse_report.buttons = pointing_device_handle_buttons(mouse_report.buttons, false, POINTING_DEVICE_BUTTON1);
  358. if (!debounce) {
  359. x_offset += pimoroni_trackball_get_offsets(pimoroni_data.right, pimoroni_data.left, PIMORONI_TRACKBALL_SCALE);
  360. y_offset += pimoroni_trackball_get_offsets(pimoroni_data.down, pimoroni_data.up, PIMORONI_TRACKBALL_SCALE);
  361. mouse_report.x = pimoroni_trackball_adapt_values(&x_offset);
  362. mouse_report.y = pimoroni_trackball_adapt_values(&y_offset);
  363. } else {
  364. debounce--;
  365. }
  366. } else {
  367. mouse_report.buttons = pointing_device_handle_buttons(mouse_report.buttons, true, POINTING_DEVICE_BUTTON1);
  368. debounce = PIMORONI_TRACKBALL_DEBOUNCE_CYCLES;
  369. }
  370. } else {
  371. error_count++;
  372. }
  373. }
  374. return mouse_report;
  375. }
  376. // clang-format off
  377. const pointing_device_driver_t pointing_device_driver = {
  378. .init = pimoroni_trackball_device_init,
  379. .get_report = pimoroni_trackball_get_report,
  380. .set_cpi = pimoroni_trackball_set_cpi,
  381. .get_cpi = pimoroni_trackball_get_cpi
  382. };
  383. // clang-format on
  384. #elif defined(POINTING_DEVICE_DRIVER_pmw3360) || defined(POINTING_DEVICE_DRIVER_pmw3389)
  385. static void pmw33xx_init_wrapper(void) {
  386. pmw33xx_init(0);
  387. }
  388. static void pmw33xx_set_cpi_wrapper(uint16_t cpi) {
  389. pmw33xx_set_cpi(0, cpi);
  390. }
  391. static uint16_t pmw33xx_get_cpi_wrapper(void) {
  392. return pmw33xx_get_cpi(0);
  393. }
  394. report_mouse_t pmw33xx_get_report(report_mouse_t mouse_report) {
  395. pmw33xx_report_t report = pmw33xx_read_burst(0);
  396. static bool in_motion = false;
  397. if (report.motion.b.is_lifted) {
  398. return mouse_report;
  399. }
  400. if (!report.motion.b.is_motion) {
  401. in_motion = false;
  402. return mouse_report;
  403. }
  404. if (!in_motion) {
  405. in_motion = true;
  406. pd_dprintf("PWM3360 (0): starting motion\n");
  407. }
  408. mouse_report.x = CONSTRAIN_HID_XY(report.delta_x);
  409. mouse_report.y = CONSTRAIN_HID_XY(report.delta_y);
  410. return mouse_report;
  411. }
  412. // clang-format off
  413. const pointing_device_driver_t pointing_device_driver = {
  414. .init = pmw33xx_init_wrapper,
  415. .get_report = pmw33xx_get_report,
  416. .set_cpi = pmw33xx_set_cpi_wrapper,
  417. .get_cpi = pmw33xx_get_cpi_wrapper
  418. };
  419. // clang-format on
  420. #else
  421. __attribute__((weak)) void pointing_device_driver_init(void) {}
  422. __attribute__((weak)) report_mouse_t pointing_device_driver_get_report(report_mouse_t mouse_report) {
  423. return mouse_report;
  424. }
  425. __attribute__((weak)) uint16_t pointing_device_driver_get_cpi(void) {
  426. return 0;
  427. }
  428. __attribute__((weak)) void pointing_device_driver_set_cpi(uint16_t cpi) {}
  429. // clang-format off
  430. const pointing_device_driver_t pointing_device_driver = {
  431. .init = pointing_device_driver_init,
  432. .get_report = pointing_device_driver_get_report,
  433. .get_cpi = pointing_device_driver_get_cpi,
  434. .set_cpi = pointing_device_driver_set_cpi
  435. };
  436. // clang-format on
  437. #endif