quantum.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. /* Copyright 2016-2017 Erez Zukerman, Jack Humbert
  2. *
  3. * This program is free software: you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License as published by
  5. * the Free Software Foundation, either version 2 of the License, or
  6. * (at your option) any later version.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU General Public License
  14. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. */
  16. #ifndef QUANTUM_H
  17. #define QUANTUM_H
  18. #if defined(__AVR__)
  19. #include <avr/pgmspace.h>
  20. #include <avr/io.h>
  21. #include <avr/interrupt.h>
  22. #endif
  23. #include "wait.h"
  24. #include "matrix.h"
  25. #include "keymap.h"
  26. #ifdef BACKLIGHT_ENABLE
  27. #include "backlight.h"
  28. #endif
  29. #ifdef RGBLIGHT_ENABLE
  30. #include "rgblight.h"
  31. #endif
  32. #include "action_layer.h"
  33. #include "eeconfig.h"
  34. #include <stddef.h>
  35. #include "bootloader.h"
  36. #include "timer.h"
  37. #include "config_common.h"
  38. #include "led.h"
  39. #include "action_util.h"
  40. #include <stdlib.h>
  41. #include "print.h"
  42. extern uint32_t default_layer_state;
  43. #ifndef NO_ACTION_LAYER
  44. extern uint32_t layer_state;
  45. #endif
  46. #ifdef MIDI_ENABLE
  47. #include <lufa.h>
  48. #ifdef MIDI_ADVANCED
  49. #include "process_midi.h"
  50. #endif
  51. #endif // MIDI_ENABLE
  52. #ifdef AUDIO_ENABLE
  53. #include "process_audio.h"
  54. #endif
  55. #if defined(AUDIO_ENABLE) || (defined(MIDI_ENABLE) && defined(MIDI_BASIC))
  56. #include "process_music.h"
  57. #endif
  58. #ifndef DISABLE_LEADER
  59. #include "process_leader.h"
  60. #endif
  61. #define DISABLE_CHORDING
  62. #ifndef DISABLE_CHORDING
  63. #include "process_chording.h"
  64. #endif
  65. #ifdef UNICODE_ENABLE
  66. #include "process_unicode.h"
  67. #endif
  68. #ifdef UCIS_ENABLE
  69. #include "process_ucis.h"
  70. #endif
  71. #ifdef UNICODEMAP_ENABLE
  72. #include "process_unicodemap.h"
  73. #endif
  74. #include "process_tap_dance.h"
  75. #ifdef PRINTING_ENABLE
  76. #include "process_printer.h"
  77. #endif
  78. #ifdef COMBO_ENABLE
  79. #include "process_combo.h"
  80. #endif
  81. #define SEND_STRING(str) send_string(PSTR(str))
  82. void send_string(const char *str);
  83. // For tri-layer
  84. void update_tri_layer(uint8_t layer1, uint8_t layer2, uint8_t layer3);
  85. void tap_random_base64(void);
  86. #define IS_LAYER_ON(layer) (layer_state & (1UL << (layer)))
  87. #define IS_LAYER_OFF(layer) (~layer_state & (1UL << (layer)))
  88. void matrix_init_kb(void);
  89. void matrix_scan_kb(void);
  90. void matrix_init_user(void);
  91. void matrix_scan_user(void);
  92. bool process_action_kb(keyrecord_t *record);
  93. bool process_record_kb(uint16_t keycode, keyrecord_t *record);
  94. bool process_record_user(uint16_t keycode, keyrecord_t *record);
  95. void reset_keyboard(void);
  96. void startup_user(void);
  97. void shutdown_user(void);
  98. void register_code16 (uint16_t code);
  99. void unregister_code16 (uint16_t code);
  100. #ifdef BACKLIGHT_ENABLE
  101. void backlight_init_ports(void);
  102. void backlight_task(void);
  103. #ifdef BACKLIGHT_BREATHING
  104. void breathing_enable(void);
  105. void breathing_pulse(void);
  106. void breathing_disable(void);
  107. void breathing_self_disable(void);
  108. void breathing_toggle(void);
  109. bool is_breathing(void);
  110. void breathing_defaults(void);
  111. void breathing_intensity_default(void);
  112. void breathing_speed_default(void);
  113. void breathing_speed_set(uint8_t value);
  114. void breathing_speed_inc(uint8_t value);
  115. void breathing_speed_dec(uint8_t value);
  116. #endif
  117. #endif
  118. void send_dword(uint32_t number);
  119. void send_word(uint16_t number);
  120. void send_byte(uint8_t number);
  121. void send_nibble(uint8_t number);
  122. uint16_t hex_to_keycode(uint8_t hex);
  123. void led_set_user(uint8_t usb_led);
  124. void led_set_kb(uint8_t usb_led);
  125. void api_send_unicode(uint32_t unicode);
  126. #endif