Keyboard firmwares for Atmel AVR and Cortex-M
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

descriptor.h 5.3KB

Squashed 'tmk_core/' changes from 8da1898..e5f9940 e5f9940 Merge commit '1bc3dd200b023cecf063a0cb3ba347f77f6d759d' into core_update da03c50 Add note for L/R side bit being ignored e80f3c1 Add in basic documentation for Macro system 35e8a76 core: Swap position of PEQL and PENT in unimap 00751f1 Merge pull request #406 from 39aldo39/patch-1 e50d7de V-USB remote wakeup 4340997 core: Fix typo in definition AC_g 958144d core: Debug print for system and consumer keys e7e1030 core: Fix sleep_led 0866323 core: Change matrix_init and matrix_print 0dbf73d core: Add matrix_clear() and default impl. 3202ca3 core: Add suspend mode options 4cda3aa core: Fix suspend/wake for converters #386 4e15247 core: LUFA_DEBUG_SUART for serial debug b9cf8e7 core: Fix mechanical locking supoort #390 12aa0fd Merge branch 'nemith-master' fccb3fa core: Fix OPT_DEFS for mbed build 2e2d2c8 Merge branch 'master' of github.com:leizzer/tmk_keyboard f1d3634 Change .gitignore for ChibiOS 3aab802 core: Fix build config in protocol.mk 5e43da0 core: Add short names in unimap 7a56998 core: Fix dfu wait in rules.mk 6d9c500 Merge branch 'mediakey-fix' 08382ac core: Fix 'make dfu' message 78cb04e Fix OS X Recognizing keyboard as Mouse/Tablet a114714 core: 'make dfu' waits for bootloader to start d0a8f13 core: Fix unimap UNIMAP_NO case e17abef core: Change lufa NKRO report size 16 to 32 bytes 375b20f core: Fix common.mk for build options 394fdff core: Fix unimap layout comment 912326c core: Add unimap support 00f4011 core: Fix doc/keymap.md for new keymap framework ddbd7b4 core: Add default implemenation of keymap read 671cacc core: action codes are action_t struct now b4fdb27 core: Change chibios repo directory names 7daed10 core: Fix keycode.txt 90399d7 core: Fix USB remote wakeup on ATmega32U2 #361 3677e84 usb_usb: Add multiple keyboard support 54d5b26 core: Fix Logical Maximum in report descriptor bd0d372 core: Fix LUFA report descriptor 95327b5 Merge pull request #355 from papodaca/XT 62bf548 core: change API of adb.c to accept device address 3097c9e Fix function name in host.h 836e209 Merge branch 'core_split_160522' 3918ea2 Merge commit '20b787fc1284176834cbe7ca2134e4b36bec5828' 7f87b11 core: Add comment of register 3 of ADB ef6478a core: Add adb_host_talk() 5c665b4 update macro names in bluefruit 4f2c5bf Merge commit '71381457fa1311dfa0b58ba882a96db740640871' 53a9c08 Merge pull request #321 from njbair/master f08a656 core: Fix media/consumer keys d526de8 Clean up wording in keymap example 0bb3dbb Clarify layer precedence d915c75 clarify layer documentation 72070d4 ps2_usb: Fix for VUSB configuration 170e2dc Mostly working. Is unstable, will emit bad codes after a while. c8e45b5 core: Actionmap support aabaa24 Codes appear to be detected correctly, the break codes are broken. git-subtree-dir: tmk_core git-subtree-split: e5f994033cbc8700745ac0c6d12772820492eed0
7年前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. /*
  2. * Copyright 2012,2013 Jun Wako <[email protected]>
  3. * This file is based on:
  4. * LUFA-120219/Demos/Device/Lowlevel/KeyboardMouse
  5. * LUFA-120219/Demos/Device/Lowlevel/GenericHID
  6. */
  7. /*
  8. LUFA Library
  9. Copyright (C) Dean Camera, 2012.
  10. dean [at] fourwalledcubicle [dot] com
  11. www.lufa-lib.org
  12. */
  13. /*
  14. Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com)
  15. Copyright 2010 Denver Gingerich (denver [at] ossguy [dot] com)
  16. Permission to use, copy, modify, distribute, and sell this
  17. software and its documentation for any purpose is hereby granted
  18. without fee, provided that the above copyright notice appear in
  19. all copies and that both that the copyright notice and this
  20. permission notice and warranty disclaimer appear in supporting
  21. documentation, and that the name of the author not be used in
  22. advertising or publicity pertaining to distribution of the
  23. software without specific, written prior permission.
  24. The author disclaim all warranties with regard to this
  25. software, including all implied warranties of merchantability
  26. and fitness. In no event shall the author be liable for any
  27. special, indirect or consequential damages or any damages
  28. whatsoever resulting from loss of use, data or profits, whether
  29. in an action of contract, negligence or other tortious action,
  30. arising out of or in connection with the use or performance of
  31. this software.
  32. */
  33. /** \file
  34. *
  35. * Header file for Descriptors.c.
  36. */
  37. #ifndef _DESCRIPTORS_H_
  38. #define _DESCRIPTORS_H_
  39. #include <LUFA/Drivers/USB/USB.h>
  40. #include <avr/pgmspace.h>
  41. typedef struct
  42. {
  43. USB_Descriptor_Configuration_Header_t Config;
  44. // Keyboard HID Interface
  45. USB_Descriptor_Interface_t Keyboard_Interface;
  46. USB_HID_Descriptor_HID_t Keyboard_HID;
  47. USB_Descriptor_Endpoint_t Keyboard_INEndpoint;
  48. #ifdef MOUSE_ENABLE
  49. // Mouse HID Interface
  50. USB_Descriptor_Interface_t Mouse_Interface;
  51. USB_HID_Descriptor_HID_t Mouse_HID;
  52. USB_Descriptor_Endpoint_t Mouse_INEndpoint;
  53. #endif
  54. #ifdef EXTRAKEY_ENABLE
  55. // Extrakey HID Interface
  56. USB_Descriptor_Interface_t Extrakey_Interface;
  57. USB_HID_Descriptor_HID_t Extrakey_HID;
  58. USB_Descriptor_Endpoint_t Extrakey_INEndpoint;
  59. #endif
  60. #ifdef CONSOLE_ENABLE
  61. // Console HID Interface
  62. USB_Descriptor_Interface_t Console_Interface;
  63. USB_HID_Descriptor_HID_t Console_HID;
  64. USB_Descriptor_Endpoint_t Console_INEndpoint;
  65. USB_Descriptor_Endpoint_t Console_OUTEndpoint;
  66. #endif
  67. #ifdef NKRO_ENABLE
  68. // NKRO HID Interface
  69. USB_Descriptor_Interface_t NKRO_Interface;
  70. USB_HID_Descriptor_HID_t NKRO_HID;
  71. USB_Descriptor_Endpoint_t NKRO_INEndpoint;
  72. #endif
  73. } USB_Descriptor_Configuration_t;
  74. /* index of interface */
  75. #define KEYBOARD_INTERFACE 0
  76. #ifdef MOUSE_ENABLE
  77. # define MOUSE_INTERFACE (KEYBOARD_INTERFACE + 1)
  78. #else
  79. # define MOUSE_INTERFACE KEYBOARD_INTERFACE
  80. #endif
  81. #ifdef EXTRAKEY_ENABLE
  82. # define EXTRAKEY_INTERFACE (MOUSE_INTERFACE + 1)
  83. #else
  84. # define EXTRAKEY_INTERFACE MOUSE_INTERFACE
  85. #endif
  86. #ifdef CONSOLE_ENABLE
  87. # define CONSOLE_INTERFACE (EXTRAKEY_INTERFACE + 1)
  88. #else
  89. # define CONSOLE_INTERFACE EXTRAKEY_INTERFACE
  90. #endif
  91. #ifdef NKRO_ENABLE
  92. # define NKRO_INTERFACE (CONSOLE_INTERFACE + 1)
  93. #else
  94. # define NKRO_INTERFACE CONSOLE_INTERFACE
  95. #endif
  96. /* nubmer of interfaces */
  97. #define TOTAL_INTERFACES (NKRO_INTERFACE + 1)
  98. // Endopoint number and size
  99. #define KEYBOARD_IN_EPNUM 1
  100. #ifdef MOUSE_ENABLE
  101. # define MOUSE_IN_EPNUM (KEYBOARD_IN_EPNUM + 1)
  102. #else
  103. # define MOUSE_IN_EPNUM KEYBOARD_IN_EPNUM
  104. #endif
  105. #ifdef EXTRAKEY_ENABLE
  106. # define EXTRAKEY_IN_EPNUM (MOUSE_IN_EPNUM + 1)
  107. #else
  108. # define EXTRAKEY_IN_EPNUM MOUSE_IN_EPNUM
  109. #endif
  110. #ifdef CONSOLE_ENABLE
  111. # define CONSOLE_IN_EPNUM (EXTRAKEY_IN_EPNUM + 1)
  112. # define CONSOLE_OUT_EPNUM (EXTRAKEY_IN_EPNUM + 1)
  113. //# define CONSOLE_OUT_EPNUM (EXTRAKEY_IN_EPNUM + 2)
  114. #else
  115. # define CONSOLE_OUT_EPNUM EXTRAKEY_IN_EPNUM
  116. #endif
  117. #ifdef NKRO_ENABLE
  118. # define NKRO_IN_EPNUM (CONSOLE_OUT_EPNUM + 1)
  119. # if defined(__AVR_ATmega32U2__) && NKRO_IN_EPNUM > 4
  120. # error "Endpoints are not available enough to support all functions. Remove some in Makefile.(MOUSEKEY, EXTRAKEY, CONSOLE, NKRO)"
  121. # endif
  122. #endif
  123. #define KEYBOARD_EPSIZE 8
  124. #define MOUSE_EPSIZE 8
  125. #define EXTRAKEY_EPSIZE 8
  126. #define CONSOLE_EPSIZE 32
  127. #define NKRO_EPSIZE 32
  128. uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
  129. const uint8_t wIndex,
  130. const void** const DescriptorAddress)
  131. ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
  132. /* new API */
  133. #if LUFA_VERSION_INTEGER < 0x140302
  134. #undef VERSION_BCD
  135. #define VERSION_BCD(Major, Minor, Revision) \
  136. CPU_TO_LE16( ((Major & 0xFF) << 8) | \
  137. ((Minor & 0x0F) << 4) | \
  138. (Revision & 0x0F) )
  139. #endif
  140. #endif