Keyboard firmwares for Atmel AVR and Cortex-M
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

report.h 2.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /*
  2. Copyright 2011 Jun Wako <[email protected]>
  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. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. */
  14. #ifndef REPORT_H
  15. #define REPORT_H
  16. #include <stdint.h>
  17. /* report id */
  18. #define REPORT_ID_MOUSE 1
  19. #define REPORT_ID_SYSTEM 2
  20. #define REPORT_ID_CONSUMER 3
  21. /* mouse buttons */
  22. #define MOUSE_BTN1 (1<<0)
  23. #define MOUSE_BTN2 (1<<1)
  24. #define MOUSE_BTN3 (1<<2)
  25. #define MOUSE_BTN4 (1<<3)
  26. #define MOUSE_BTN5 (1<<4)
  27. // Consumer Page(0x0C)
  28. // following are supported by Windows: http://msdn.microsoft.com/en-us/windows/hardware/gg463372.aspx
  29. #define AUDIO_MUTE 0x00E2
  30. #define AUDIO_VOL_UP 0x00E9
  31. #define AUDIO_VOL_DOWN 0x00EA
  32. #define TRANSPORT_NEXT_TRACK 0x00B5
  33. #define TRANSPORT_PREV_TRACK 0x00B6
  34. #define TRANSPORT_STOP 0x00B7
  35. #define TRANSPORT_PLAY_PAUSE 0x00CD
  36. #define AL_CC_CONFIG 0x0183
  37. #define AL_EMAIL 0x018A
  38. #define AL_CALCULATOR 0x0192
  39. #define AL_LOCAL_BROWSER 0x0194
  40. #define AC_SEARCH 0x0221
  41. #define AC_HOME 0x0223
  42. #define AC_BACK 0x0224
  43. #define AC_FORWARD 0x0225
  44. #define AC_STOP 0x0226
  45. #define AC_REFRESH 0x0227
  46. #define AC_BOOKMARKS 0x022A
  47. // supplement for Bluegiga iWRAP HID(not supported by Windows?)
  48. #define AL_LOCK 0x019E
  49. #define TRANSPORT_RECORD 0x00B2
  50. #define TRANSPORT_REWIND 0x00B4
  51. #define TRANSPORT_EJECT 0x00B8
  52. #define AC_MINIMIZE 0x0206
  53. // Generic Desktop Page(0x01)
  54. #define SYSTEM_POWER_DOWN 0x0081
  55. #define SYSTEM_SLEEP 0x0082
  56. #define SYSTEM_WAKE_UP 0x0083
  57. // key report size(NKRO or boot mode)
  58. #if defined(HOST_PJRC)
  59. # include "usb.h"
  60. # if defined(KBD2_REPORT_KEYS) && KBD2_REPORT_KEYS > KBD_REPORT_KEYS
  61. # define REPORT_KEYS KBD2_REPORT_KEYS
  62. # else
  63. # define REPORT_KEYS KBD_REPORT_KEYS
  64. # endif
  65. #else
  66. # define REPORT_KEYS 6
  67. #endif
  68. typedef struct {
  69. uint8_t mods;
  70. uint8_t rserved;
  71. uint8_t keys[REPORT_KEYS];
  72. } __attribute__ ((packed)) report_keyboard_t;
  73. typedef struct {
  74. uint8_t buttons;
  75. int8_t x;
  76. int8_t y;
  77. int8_t v;
  78. int8_t h;
  79. } __attribute__ ((packed)) report_mouse_t;
  80. #endif