]> git.donarmstrong.com Git - qmk_firmware.git/blob - quantum/quantum.h
Merge branch 'master' of https://github.com/jackhumbert/qmk_firmware
[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
19 #include "action_layer.h"
20 #include "eeconfig.h"
21 #include <stddef.h>
22 #include "bootloader.h"
23 #include "timer.h"
24 #include "config_common.h"
25 #include "led.h"
26 #include "action_util.h"
27 #include <stdlib.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         #include "process_midi.h"
39 #endif
40
41 #ifdef AUDIO_ENABLE
42         #include "audio.h"
43         #include "process_music.h"
44 #endif
45
46 #ifndef DISABLE_LEADER
47         #include "process_leader.h"
48 #endif
49
50 #define DISABLE_CHORDING
51 #ifndef DISABLE_CHORDING
52         #include "process_chording.h"
53 #endif
54
55 #ifdef UNICODE_ENABLE
56         #include "process_unicode.h"
57 #endif
58
59 #include "process_tap_dance.h"
60
61 #define SEND_STRING(str) send_string(PSTR(str))
62 void send_string(const char *str);
63
64 // For tri-layer
65 void update_tri_layer(uint8_t layer1, uint8_t layer2, uint8_t layer3);
66
67 void tap_random_base64(void);
68
69 #define IS_LAYER_ON(layer)  (layer_state & (1UL << (layer)))
70 #define IS_LAYER_OFF(layer) (~layer_state & (1UL << (layer)))
71
72 void matrix_init_kb(void);
73 void matrix_scan_kb(void);
74 void matrix_init_user(void);
75 void matrix_scan_user(void);
76 bool process_action_kb(keyrecord_t *record);
77 bool process_record_kb(uint16_t keycode, keyrecord_t *record);
78 bool process_record_user(uint16_t keycode, keyrecord_t *record);
79
80 void startup_user(void);
81 void shutdown_user(void);
82
83 #ifdef BACKLIGHT_ENABLE
84 void backlight_init_ports(void);
85
86 #ifdef BACKLIGHT_BREATHING
87 void breathing_enable(void);
88 void breathing_pulse(void);
89 void breathing_disable(void);
90 void breathing_self_disable(void);
91 void breathing_toggle(void);
92 bool is_breathing(void);
93
94 void breathing_defaults(void);
95 void breathing_intensity_default(void);
96 void breathing_speed_default(void);
97 void breathing_speed_set(uint8_t value);
98 void breathing_speed_inc(uint8_t value);
99 void breathing_speed_dec(uint8_t value);
100 #endif
101
102 #endif
103
104 void led_set_user(uint8_t usb_led);
105 void led_set_kb(uint8_t usb_led);
106
107 #endif