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.

lufa.h 2.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /*
  2. * Copyright 2012 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. #ifndef _LUFA_H_
  34. #define _LUFA_H_
  35. #include <avr/io.h>
  36. #include <avr/wdt.h>
  37. #include <avr/power.h>
  38. #include <avr/interrupt.h>
  39. #include <stdbool.h>
  40. #include <string.h>
  41. #include <LUFA/Version.h>
  42. #include <LUFA/Drivers/USB/USB.h>
  43. #include "host.h"
  44. #ifdef __cplusplus
  45. extern "C" {
  46. #endif
  47. extern host_driver_t lufa_driver;
  48. #ifdef __cplusplus
  49. }
  50. #endif
  51. /* extra report structure */
  52. typedef struct {
  53. uint8_t report_id;
  54. uint16_t usage;
  55. } __attribute__ ((packed)) report_extra_t;
  56. #if LUFA_VERSION_INTEGER < 0x120730
  57. /* old API 120219 */
  58. #define ENDPOINT_CONFIG(epnum, eptype, epdir, epsize, epbank) Endpoint_ConfigureEndpoint(epnum, eptype, epdir, epsize, epbank)
  59. #else
  60. /* new API >= 120730 */
  61. #define ENDPOINT_BANK_SINGLE 1
  62. #define ENDPOINT_BANK_DOUBLE 2
  63. #define ENDPOINT_CONFIG(epnum, eptype, epdir, epsize, epbank) Endpoint_ConfigureEndpoint((epdir) | (epnum) , eptype, epsize, epbank)
  64. #endif
  65. #endif