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.

Descriptors.h 2.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /*
  2. LUFA Library
  3. Copyright (C) Dean Camera, 2012.
  4. dean [at] fourwalledcubicle [dot] com
  5. www.lufa-lib.org
  6. */
  7. /*
  8. Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com)
  9. Copyright 2010 Denver Gingerich (denver [at] ossguy [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 disclaim 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. #include <LUFA/Drivers/USB/USB.h>
  34. #include <avr/pgmspace.h>
  35. typedef struct
  36. {
  37. USB_Descriptor_Configuration_Header_t Config;
  38. // Keyboard HID Interface
  39. USB_Descriptor_Interface_t HID1_KeyboardInterface;
  40. USB_HID_Descriptor_HID_t HID1_KeyboardHID;
  41. USB_Descriptor_Endpoint_t HID1_ReportINEndpoint;
  42. USB_Descriptor_Endpoint_t HID1_ReportOUTEndpoint;
  43. // Mouse HID Interface
  44. USB_Descriptor_Interface_t HID2_MouseInterface;
  45. USB_HID_Descriptor_HID_t HID2_MouseHID;
  46. USB_Descriptor_Endpoint_t HID2_ReportINEndpoint;
  47. // Generic HID Interface
  48. USB_Descriptor_Interface_t HID3_GenericInterface;
  49. USB_HID_Descriptor_HID_t HID3_GenericHID;
  50. USB_Descriptor_Endpoint_t HID3_ReportINEndpoint;
  51. USB_Descriptor_Endpoint_t HID3_ReportOUTEndpoint;
  52. } USB_Descriptor_Configuration_t;
  53. // Endopoint number/size
  54. #define KEYBOARD_IN_EPNUM 1
  55. #define KEYBOARD_OUT_EPNUM 2
  56. #define MOUSE_IN_EPNUM 3
  57. #define GENERIC_IN_EPNUM 4
  58. #define GENERIC_OUT_EPNUM 5
  59. #define HID_EPSIZE 8
  60. #define GENERIC_EPSIZE 8
  61. #define GENERIC_REPORT_SIZE 8
  62. uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
  63. const uint8_t wIndex,
  64. const void** const DescriptorAddress)
  65. ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
  66. #endif