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.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  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. Permission to use, copy, modify, distribute, and sell this
  10. software and its documentation for any purpose is hereby granted
  11. without fee, provided that the above copyright notice appear in
  12. all copies and that both that the copyright notice and this
  13. permission notice and warranty disclaimer appear in supporting
  14. documentation, and that the name of the author not be used in
  15. advertising or publicity pertaining to distribution of the
  16. software without specific, written prior permission.
  17. The author disclaim all warranties with regard to this
  18. software, including all implied warranties of merchantability
  19. and fitness. In no event shall the author be liable for any
  20. special, indirect or consequential damages or any damages
  21. whatsoever resulting from loss of use, data or profits, whether
  22. in an action of contract, negligence or other tortious action,
  23. arising out of or in connection with the use or performance of
  24. this software.
  25. */
  26. /** \file
  27. * \brief LUFA Custom Board LED Hardware Driver (Template)
  28. *
  29. * This is a stub driver header file, for implementing custom board
  30. * layout hardware with compatible LUFA board specific drivers. If
  31. * the library is configured to use the BOARD_USER board mode, this
  32. * driver file should be completed and copied into the "/Board/" folder
  33. * inside the application's folder.
  34. *
  35. * This stub is for the board-specific component of the LUFA LEDs driver,
  36. * for the LEDs (up to four) mounted on most development boards.
  37. */
  38. #ifndef __LEDS_USER_H__
  39. #define __LEDS_USER_H__
  40. /* Includes: */
  41. // TODO: Add any required includes here
  42. /* Enable C linkage for C++ Compilers: */
  43. #if defined(__cplusplus)
  44. extern "C" {
  45. #endif
  46. /* Preprocessor Checks: */
  47. #if !defined(__INCLUDE_FROM_LEDS_H)
  48. #error Do not include this file directly. Include LUFA/Drivers/Board/LEDS.h instead.
  49. #endif
  50. /* Public Interface - May be used in end-application: */
  51. /* Macros: */
  52. /** LED mask for the first LED on the board. */
  53. #define LEDS_LED1 // TODO: Add mask for first board LED here
  54. /** LED mask for the second LED on the board. */
  55. #define LEDS_LED2 // TODO: Add mask for second board LED here
  56. /** LED mask for the third LED on the board. */
  57. #define LEDS_LED3 // TODO: Add mask for third board LED here
  58. /** LED mask for the fourth LED on the board. */
  59. #define LEDS_LED4 // TODO: Add mask for fourth board LED here
  60. /** LED mask for all the LEDs on the board. */
  61. #define LEDS_ALL_LEDS (LEDS_LED1 | LEDS_LED2 | LEDS_LED3 | LEDS_LED4)
  62. /** LED mask for none of the board LEDs. */
  63. #define LEDS_NO_LEDS 0
  64. /* Inline Functions: */
  65. #if !defined(__DOXYGEN__)
  66. static inline void LEDs_Init(void)
  67. {
  68. // TODO: Add code to initialize LED port pins as outputs here
  69. }
  70. static inline void LEDs_Disable(void)
  71. {
  72. // TODO: Clear the LED port pins as high impedance inputs here
  73. }
  74. static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask)
  75. {
  76. // TODO: Add code to turn on LEDs given in the LEDMask mask here, leave others as-is
  77. }
  78. static inline void LEDs_TurnOffLEDs(const uint8_t LEDMask)
  79. {
  80. // TODO: Add code to turn off LEDs given in the LEDMask mask here, leave others as-is
  81. }
  82. static inline void LEDs_SetAllLEDs(const uint8_t LEDMask)
  83. {
  84. // TODO: Add code to turn on only LEDs given in the LEDMask mask here, all others off
  85. }
  86. static inline void LEDs_ChangeLEDs(const uint8_t LEDMask, const uint8_t ActiveMask)
  87. {
  88. // TODO: Add code to set the Leds in the given LEDMask to the status given in ActiveMask here
  89. }
  90. static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)
  91. {
  92. // TODO: Add code to toggle the Leds in the given LEDMask, ignoring all others
  93. }
  94. static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;
  95. static inline uint8_t LEDs_GetLEDs(void)
  96. {
  97. // TODO: Add code to return the current LEDs status' here which can be masked against LED_LED* macros
  98. }
  99. #endif
  100. /* Disable C linkage for C++ Compilers: */
  101. #if defined(__cplusplus)
  102. }
  103. #endif
  104. #endif