Keyboard firmwares for Atmel AVR and Cortex-M
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

USBEndpoints.h 2.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /* Copyright (c) 2010-2011 mbed.org, MIT License
  2. *
  3. * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
  4. * and associated documentation files (the "Software"), to deal in the Software without
  5. * restriction, including without limitation the rights to use, copy, modify, merge, publish,
  6. * distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the
  7. * Software is furnished to do so, subject to the following conditions:
  8. *
  9. * The above copyright notice and this permission notice shall be included in all copies or
  10. * substantial portions of the Software.
  11. *
  12. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
  13. * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  14. * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  15. * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  16. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  17. */
  18. #ifndef USBENDPOINTS_H
  19. #define USBENDPOINTS_H
  20. /* SETUP packet size */
  21. #define SETUP_PACKET_SIZE (8)
  22. /* Options flags for configuring endpoints */
  23. #define DEFAULT_OPTIONS (0)
  24. #define SINGLE_BUFFERED (1U << 0)
  25. #define ISOCHRONOUS (1U << 1)
  26. #define RATE_FEEDBACK_MODE (1U << 2) /* Interrupt endpoints only */
  27. /* Endpoint transfer status, for endpoints > 0 */
  28. typedef enum {
  29. EP_COMPLETED, /* Transfer completed */
  30. EP_PENDING, /* Transfer in progress */
  31. EP_INVALID, /* Invalid parameter */
  32. EP_STALLED, /* Endpoint stalled */
  33. } EP_STATUS;
  34. /* Include configuration for specific target */
  35. #if defined(TARGET_LPC1768) || defined(TARGET_LPC2368) || defined(TARGET_LPC4088) || defined(TARGET_LPC4088_DM)
  36. #include "USBEndpoints_LPC17_LPC23.h"
  37. #elif defined(TARGET_LPC11UXX) || defined(TARGET_LPC1347) || defined (TARGET_LPC11U6X) || defined (TARGET_LPC1549)
  38. #include "USBEndpoints_LPC11U.h"
  39. #elif defined(TARGET_KL25Z) | defined(TARGET_KL43Z) | defined(TARGET_KL46Z) | defined(TARGET_K20D50M) | defined(TARGET_K64F) | defined(TARGET_K22F) | defined(TARGET_TEENSY3_1)
  40. #include "USBEndpoints_KL25Z.h"
  41. #elif defined (TARGET_STM32F4)
  42. #include "USBEndpoints_STM32F4.h"
  43. #elif defined (TARGET_RZ_A1H)
  44. #include "USBEndpoints_RZ_A1H.h"
  45. #elif defined(TARGET_Maxim)
  46. #include "USBEndpoints_Maxim.h"
  47. #else
  48. #error "Unknown target type"
  49. #endif
  50. #endif