Keyboard firmwares for Atmel AVR and Cortex-M
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /*
  2. LUFA Library
  3. Copyright (C) Dean Camera, 2014.
  4. dean [at] fourwalledcubicle [dot] com
  5. www.lufa-lib.org
  6. */
  7. /*
  8. Copyright 2010 Denver Gingerich (denver [at] ossguy [dot] com)
  9. Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
  10. Permission to use, copy, modify, distribute, and sell this
  11. software and its documentation for any purpose is hereby granted
  12. without fee, provided that the above copyright notice appear in
  13. all copies and that both that the copyright notice and this
  14. permission notice and warranty disclaimer appear in supporting
  15. documentation, and that the name of the author not be used in
  16. advertising or publicity pertaining to distribution of the
  17. software without specific, written prior permission.
  18. The author disclaims all warranties with regard to this
  19. software, including all implied warranties of merchantability
  20. and fitness. In no event shall the author be liable for any
  21. special, indirect or consequential damages or any damages
  22. whatsoever resulting from loss of use, data or profits, whether
  23. in an action of contract, negligence or other tortious action,
  24. arising out of or in connection with the use or performance of
  25. this software.
  26. */
  27. /** \file
  28. *
  29. * Header file for Descriptors.c.
  30. */
  31. #ifndef _DESCRIPTORS_H_
  32. #define _DESCRIPTORS_H_
  33. /* Includes: */
  34. #include <avr/pgmspace.h>
  35. #include <LUFA/Drivers/USB/USB.h>
  36. #include "Config/AppConfig.h"
  37. /* Type Defines: */
  38. /** Type define for the device configuration descriptor structure. This must be defined in the
  39. * application code, as the configuration descriptor contains several sub-descriptors which
  40. * vary between devices, and which describe the device's usage to the host.
  41. */
  42. typedef struct
  43. {
  44. USB_Descriptor_Configuration_Header_t Config; /**< Configuration descriptor header structure */
  45. // Keyboard HID Interface
  46. USB_Descriptor_Interface_t HID_Interface; /**< Keyboard interface descriptor */
  47. USB_HID_Descriptor_HID_t HID_KeyboardHID; /**< Keyboard HID descriptor */
  48. USB_Descriptor_Endpoint_t HID_ReportINEndpoint; /**< Keyboard key report endpoint descriptor */
  49. } USB_Descriptor_Configuration_t;
  50. /** Enum for the device interface descriptor IDs within the device. Each interface descriptor
  51. * should have a unique ID index associated with it, which can be used to refer to the
  52. * interface from other descriptors.
  53. */
  54. enum InterfaceDescriptors_t
  55. {
  56. INTERFACE_ID_Keyboard = 0, /**< Keyboard interface descriptor ID */
  57. };
  58. /** Enum for the device string descriptor IDs within the device. Each string descriptor should
  59. * have a unique ID index associated with it, which can be used to refer to the string from
  60. * other descriptors.
  61. */
  62. enum StringDescriptors_t
  63. {
  64. STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */
  65. STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
  66. STRING_ID_Product = 2, /**< Product string ID */
  67. };
  68. /* Macros: */
  69. /** Endpoint address of the keyboard key press reporting endpoint. */
  70. #define KEYBOARD_EPADDR (ENDPOINT_DIR_IN | 1)
  71. /** Size of the keyboard report endpoints, in bytes. */
  72. #define KEYBOARD_EPSIZE 8
  73. /* Function Prototypes: */
  74. uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
  75. const uint8_t wIndex,
  76. const void** const DescriptorAddress)
  77. ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
  78. #endif