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.

descriptor.h 3.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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 Keyboard_Interface;
  40. USB_HID_Descriptor_HID_t Keyboard_HID;
  41. USB_Descriptor_Endpoint_t Keyboard_INEndpoint;
  42. // Mouse HID Interface
  43. USB_Descriptor_Interface_t Mouse_Interface;
  44. USB_HID_Descriptor_HID_t Mouse_HID;
  45. USB_Descriptor_Endpoint_t Mouse_INEndpoint;
  46. // Console HID Interface
  47. USB_Descriptor_Interface_t Console_Interface;
  48. USB_HID_Descriptor_HID_t Console_HID;
  49. USB_Descriptor_Endpoint_t Console_INEndpoint;
  50. USB_Descriptor_Endpoint_t Console_OUTEndpoint;
  51. // Extra HID Interface
  52. USB_Descriptor_Interface_t Extra_Interface;
  53. USB_HID_Descriptor_HID_t Extra_HID;
  54. USB_Descriptor_Endpoint_t Extra_INEndpoint;
  55. } USB_Descriptor_Configuration_t;
  56. /* nubmer of interfaces */
  57. #define TOTAL_INTERFACES 4
  58. /* index of interface */
  59. #define KEYBOARD_INTERFACE 0
  60. #define MOUSE_INTERFACE 1
  61. #define CONSOLE_INTERFACE 2
  62. #define EXTRA_INTERFACE 3
  63. // Endopoint number and size
  64. #define KEYBOARD_IN_EPNUM 1
  65. #define MOUSE_IN_EPNUM 2
  66. #define CONSOLE_IN_EPNUM 3
  67. #define CONSOLE_OUT_EPNUM 4
  68. #define EXTRA_IN_EPNUM 5
  69. #define KEYBOARD_EPSIZE 8
  70. #define MOUSE_EPSIZE 8
  71. #define CONSOLE_EPSIZE 8
  72. #define EXTRA_EPSIZE 8
  73. uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
  74. const uint8_t wIndex,
  75. const void** const DescriptorAddress)
  76. ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
  77. #endif