logo

qmk_firmware

custom branch of QMK firmware git clone https://anongit.hacktivis.me/git/qmk_firmware.git

usb_descriptor_common.h (1860B)


  1. /* Copyright 2020 Nick Brassel (tzarc)
  2. *
  3. * This program is free software: you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License as published by
  5. * the Free Software Foundation, either version 2 of the License, or
  6. * (at your option) any later version.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU General Public License
  14. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. */
  16. #pragma once
  17. // Prefix string literal with L for descriptors
  18. #define USBCONCAT(a, b) a##b
  19. #define USBSTR(s) USBCONCAT(L, s)
  20. #define HID_VALUE_16(v) ((uint8_t)(v & 0xFF)), ((uint8_t)(v >> 8))
  21. /////////////////////
  22. // RAW Usage page and ID configuration
  23. #ifndef RAW_USAGE_PAGE
  24. # define RAW_USAGE_PAGE 0xFF60
  25. #endif
  26. #ifndef RAW_USAGE_ID
  27. # define RAW_USAGE_ID 0x61
  28. #endif
  29. /////////////////////
  30. // Hires Scroll Defaults
  31. #ifdef POINTING_DEVICE_HIRES_SCROLL_ENABLE
  32. # ifdef POINTING_DEVICE_HIRES_SCROLL_MULTIPLIER
  33. # if POINTING_DEVICE_HIRES_SCROLL_MULTIPLIER > 127 || POINTING_DEVICE_HIRES_SCROLL_MULTIPLIER < 1
  34. # error "POINTING_DEVICE_HIRES_SCROLL_MULTIPLIER must be between 1 and 127, inclusive!"
  35. # endif
  36. # else
  37. # define POINTING_DEVICE_HIRES_SCROLL_MULTIPLIER 120
  38. # endif
  39. # ifdef POINTING_DEVICE_HIRES_SCROLL_EXPONENT
  40. # if POINTING_DEVICE_HIRES_SCROLL_EXPONENT > 127 || POINTING_DEVICE_HIRES_SCROLL_EXPONENT < 0
  41. # error "POINTING_DEVICE_HIRES_SCROLL_EXPONENT must be between 0 and 127, inclusive!"
  42. # endif
  43. # else
  44. # define POINTING_DEVICE_HIRES_SCROLL_EXPONENT 0
  45. # endif
  46. #endif