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.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. #ifndef _LUFA_H_
  28. #define _LUFA_H_
  29. /* Includes: */
  30. #include <avr/io.h>
  31. #include <avr/wdt.h>
  32. #include <avr/power.h>
  33. #include <avr/interrupt.h>
  34. #include <stdbool.h>
  35. #include <string.h>
  36. #include "Descriptors.h"
  37. #include <LUFA/Version.h>
  38. #include <LUFA/Drivers/USB/USB.h>
  39. #include <LUFA/Drivers/Board/Joystick.h>
  40. #include <LUFA/Drivers/Board/LEDs.h>
  41. #include <LUFA/Drivers/Board/Buttons.h>
  42. /* Macros: */
  43. /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
  44. #define LEDMASK_USB_NOTREADY LEDS_LED1
  45. /** LED mask for the library LED driver, to indicate that the USB interface is enumerating. */
  46. #define LEDMASK_USB_ENUMERATING (LEDS_LED2 | LEDS_LED3)
  47. /** LED mask for the library LED driver, to indicate that the USB interface is ready. */
  48. #define LEDMASK_USB_READY (LEDS_LED2 | LEDS_LED4)
  49. /** LED mask for the library LED driver, to indicate that an error has occurred in the USB interface. */
  50. #define LEDMASK_USB_ERROR (LEDS_LED1 | LEDS_LED3)
  51. /* Function Prototypes: */
  52. void SetupHardware(void);
  53. void Keyboard_ProcessLEDReport(const uint8_t LEDStatus);
  54. void Keyboard_HID_Task(void);
  55. void Generic_HID_Task(void);
  56. void EVENT_USB_Device_Connect(void);
  57. void EVENT_USB_Device_Disconnect(void);
  58. void EVENT_USB_Device_ConfigurationChanged(void);
  59. void EVENT_USB_Device_ControlRequest(void);
  60. void EVENT_USB_Device_StartOfFrame(void);
  61. void Keyboard_send(USB_KeyboardReport_Data_t report);
  62. #endif