]> git.donarmstrong.com Git - qmk_firmware.git/blob - quantum/quantum.h
Merge pull request #1112 from newsboytko/newsboytko/midi-keycodes
[qmk_firmware.git] / quantum / quantum.h
1 #ifndef QUANTUM_H
2 #define QUANTUM_H
3
4 #if defined(__AVR__)
5 #include <avr/pgmspace.h>
6 #include <avr/io.h>
7 #include <avr/interrupt.h>
8 #endif
9 #include "wait.h"
10 #include "matrix.h"
11 #include "keymap.h"
12 #ifdef BACKLIGHT_ENABLE
13     #include "backlight.h"
14 #endif
15 #ifdef RGBLIGHT_ENABLE
16   #include "rgblight.h"
17 #endif
18 #include "action_layer.h"
19 #include "eeconfig.h"
20 #include <stddef.h>
21 #include "bootloader.h"
22 #include "timer.h"
23 #include "config_common.h"
24 #include "led.h"
25 #include "action_util.h"
26 #include <stdlib.h>
27 #include "print.h"
28
29
30 extern uint32_t default_layer_state;
31
32 #ifndef NO_ACTION_LAYER
33         extern uint32_t layer_state;
34 #endif
35
36 #ifdef MIDI_ENABLE
37         #include <lufa.h>
38 #ifdef MIDI_ADVANCED
39         #include "process_midi.h"
40 #endif
41 #endif // MIDI_ENABLE
42
43 #ifdef AUDIO_ENABLE
44         #include "process_audio.h"
45 #endif
46
47 #if defined(AUDIO_ENABLE) || (defined(MIDI_ENABLE) && defined(MIDI_BASIC))
48         #include "process_music.h"
49 #endif
50
51 #ifndef DISABLE_LEADER
52         #include "process_leader.h"
53 #endif
54
55 #define DISABLE_CHORDING
56 #ifndef DISABLE_CHORDING
57         #include "process_chording.h"
58 #endif
59
60 #ifdef UNICODE_ENABLE
61         #include "process_unicode.h"
62 #endif
63
64 #ifdef UCIS_ENABLE
65         #include "process_ucis.h"
66 #endif
67
68 #ifdef UNICODEMAP_ENABLE
69         #include "process_unicodemap.h"
70 #endif
71
72 #include "process_tap_dance.h"
73
74 #ifdef PRINTING_ENABLE
75         #include "process_printer.h"
76 #endif
77
78 #ifdef COMBO_ENABLE
79         #include "process_combo.h"
80 #endif
81
82 #define SEND_STRING(str) send_string(PSTR(str))
83 void send_string(const char *str);
84
85 // For tri-layer
86 void update_tri_layer(uint8_t layer1, uint8_t layer2, uint8_t layer3);
87
88 void tap_random_base64(void);
89
90 #define IS_LAYER_ON(layer)  (layer_state & (1UL << (layer)))
91 #define IS_LAYER_OFF(layer) (~layer_state & (1UL << (layer)))
92
93 void matrix_init_kb(void);
94 void matrix_scan_kb(void);
95 void matrix_init_user(void);
96 void matrix_scan_user(void);
97 bool process_action_kb(keyrecord_t *record);
98 bool process_record_kb(uint16_t keycode, keyrecord_t *record);
99 bool process_record_user(uint16_t keycode, keyrecord_t *record);
100
101 void reset_keyboard(void);
102
103 void startup_user(void);
104 void shutdown_user(void);
105
106 void register_code16 (uint16_t code);
107 void unregister_code16 (uint16_t code);
108
109 #ifdef BACKLIGHT_ENABLE
110 void backlight_init_ports(void);
111 void backlight_task(void);
112
113 #ifdef BACKLIGHT_BREATHING
114 void breathing_enable(void);
115 void breathing_pulse(void);
116 void breathing_disable(void);
117 void breathing_self_disable(void);
118 void breathing_toggle(void);
119 bool is_breathing(void);
120
121 void breathing_defaults(void);
122 void breathing_intensity_default(void);
123 void breathing_speed_default(void);
124 void breathing_speed_set(uint8_t value);
125 void breathing_speed_inc(uint8_t value);
126 void breathing_speed_dec(uint8_t value);
127 #endif
128
129 #endif
130 void send_dword(uint32_t number);
131 void send_word(uint16_t number);
132 void send_byte(uint8_t number);
133 void send_nibble(uint8_t number);
134 uint16_t hex_to_keycode(uint8_t hex);
135
136 void led_set_user(uint8_t usb_led);
137 void led_set_kb(uint8_t usb_led);
138
139 void api_send_unicode(uint32_t unicode);
140
141 #endif