trackball_mini.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /* Copyright 2021 Colin Lam (Ploopy Corporation)
  2. * Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
  3. * Copyright 2019 Sunjun Kim
  4. * Copyright 2019 Hiroyuki Okada
  5. *
  6. * This program is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. #pragma once
  20. #include "quantum.h"
  21. #include "adns5050.h"
  22. #include "analog.h"
  23. #include "opt_encoder.h"
  24. #include "pointing_device.h"
  25. // Sensor defs
  26. #define OPT_ENC1 F0
  27. #define OPT_ENC2 F4
  28. #define OPT_ENC1_MUX 0
  29. #define OPT_ENC2_MUX 4
  30. void process_mouse(report_mouse_t* mouse_report);
  31. void process_mouse_user(report_mouse_t* mouse_report, int16_t x, int16_t y);
  32. void process_wheel(report_mouse_t* mouse_report);
  33. void process_wheel_user(report_mouse_t* mouse_report, int16_t h, int16_t v);
  34. #define LAYOUT(BL, BM, BR, BF, BB) \
  35. { {BL, BM, BR, BF, BB}, }
  36. typedef union {
  37. uint32_t raw;
  38. struct {
  39. uint8_t dpi_config;
  40. };
  41. } keyboard_config_t;
  42. extern keyboard_config_t keyboard_config;
  43. enum ploopy_keycodes {
  44. DPI_CONFIG = SAFE_RANGE,
  45. PLOOPY_SAFE_RANGE,
  46. };