honeycomb.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #pragma once
  2. #define HONEYCOMB_H
  3. #include "quantum.h"
  4. #include "matrix.h"
  5. #include "backlight.h"
  6. #include <stddef.h>
  7. #define RED_LED_OFF() writePinHigh(F6)
  8. #define RED_LED_ON() writePinLow(F6)
  9. #define BLU_LED_OFF() writePinHigh(F5)
  10. #define BLU_LED_ON() writePinLow(F5)
  11. #define GRN_LED_OFF() writePinHigh(D1)
  12. #define GRN_LED_ON() writePinLow(D1)
  13. #define SET_LED_OFF (RED_LED_OFF(); GRN_LED_OFF(); BLU_LED_OFF(); )
  14. #define SET_LED_RED (RED_LED_ON(); GRN_LED_OFF(); BLU_LED_OFF(); )
  15. #define SET_LED_BLUE (RED_LED_OFF(); GRN_LED_OFF(); BLU_LED_ON(); )
  16. #define SET_LED_GREEN (RED_LED_OFF(); GRN_LED_ON(); BLU_LED_OFF(); )
  17. #define SET_LED_YELLOW (RED_LED_ON(); GRN_LED_ON(); BLU_LED_OFF(); )
  18. #define SET_LED_MAGENTA (RED_LED_ON(); GRN_LED_OFF(); BLU_LED_ON(); )
  19. #define SET_LED_CYAN (RED_LED_OFF(); GRN_LED_ON(); BLU_LED_ON(); )
  20. #define SET_LED_WHITE (RED_LED_ON(); GRN_LED_ON(); BLU_LED_ON(); )
  21. // This a shortcut to help you visually see your layout.
  22. // The first section contains all of the arguements
  23. // The second converts the arguments into a two-dimensional array
  24. #define LAYOUT( \
  25. k13, k14, k15, k16, \
  26. k09, k10, k11, k12, \
  27. k05, k06, k07, k08, \
  28. k01, k02, k03, k04 \
  29. ) \
  30. { \
  31. { k01, k02, k03, k04, k05, k06, k07, k08, k09, k10, k11, k12, k13, k14, k15, k16 } \
  32. }