lufa.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*
  2. * Copyright 2012 Jun Wako <wakojun@gmail.com>
  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. #pragma once
  34. #include <avr/io.h>
  35. #include <avr/wdt.h>
  36. #include <avr/power.h>
  37. #include <avr/interrupt.h>
  38. #include <stdbool.h>
  39. #include <string.h>
  40. #include <LUFA/Version.h>
  41. #include <LUFA/Drivers/USB/USB.h>
  42. #include "host.h"
  43. #ifdef __cplusplus
  44. extern "C" {
  45. #endif
  46. extern host_driver_t lufa_driver;
  47. #ifdef __cplusplus
  48. }
  49. #endif
  50. #ifdef API_ENABLE
  51. # include "api.h"
  52. #endif
  53. #ifdef API_SYSEX_ENABLE
  54. # include "api_sysex.h"
  55. // Allocate space for encoding overhead.
  56. // The header and terminator are not stored to save a few bytes of precious ram
  57. # define MIDI_SYSEX_BUFFER (API_SYSEX_MAX_SIZE + API_SYSEX_MAX_SIZE / 7 + (API_SYSEX_MAX_SIZE % 7 ? 1 : 0))
  58. #endif