1 /* Copyright 2016-2017 Erez Zukerman, Jack Humbert
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.
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.
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/>.
20 #include <avr/pgmspace.h>
22 #include <avr/interrupt.h>
27 #ifdef BACKLIGHT_ENABLE
28 #include "backlight.h"
30 #ifdef RGBLIGHT_ENABLE
33 #include "action_layer.h"
36 #include "bootloader.h"
38 #include "config_common.h"
40 #include "action_util.h"
45 extern uint32_t default_layer_state;
47 #ifndef NO_ACTION_LAYER
48 extern uint32_t layer_state;
54 #include "process_midi.h"
59 #include "process_audio.h"
62 #if defined(AUDIO_ENABLE) || (defined(MIDI_ENABLE) && defined(MIDI_BASIC))
63 #include "process_music.h"
66 #ifndef DISABLE_LEADER
67 #include "process_leader.h"
70 #define DISABLE_CHORDING
71 #ifndef DISABLE_CHORDING
72 #include "process_chording.h"
76 #include "process_unicode.h"
80 #include "process_ucis.h"
83 #ifdef UNICODEMAP_ENABLE
84 #include "process_unicodemap.h"
87 #include "process_tap_dance.h"
89 #ifdef PRINTING_ENABLE
90 #include "process_printer.h"
94 #include "process_combo.h"
97 #define SEND_STRING(str) send_string(PSTR(str))
98 void send_string(const char *str);
101 void update_tri_layer(uint8_t layer1, uint8_t layer2, uint8_t layer3);
103 void tap_random_base64(void);
105 #define IS_LAYER_ON(layer) (layer_state & (1UL << (layer)))
106 #define IS_LAYER_OFF(layer) (~layer_state & (1UL << (layer)))
108 void matrix_init_kb(void);
109 void matrix_scan_kb(void);
110 void matrix_init_user(void);
111 void matrix_scan_user(void);
112 bool process_action_kb(keyrecord_t *record);
113 bool process_record_kb(uint16_t keycode, keyrecord_t *record);
114 bool process_record_user(uint16_t keycode, keyrecord_t *record);
116 void reset_keyboard(void);
118 void startup_user(void);
119 void shutdown_user(void);
121 void register_code16 (uint16_t code);
122 void unregister_code16 (uint16_t code);
124 #ifdef BACKLIGHT_ENABLE
125 void backlight_init_ports(void);
126 void backlight_task(void);
128 #ifdef BACKLIGHT_BREATHING
129 void breathing_enable(void);
130 void breathing_pulse(void);
131 void breathing_disable(void);
132 void breathing_self_disable(void);
133 void breathing_toggle(void);
134 bool is_breathing(void);
136 void breathing_defaults(void);
137 void breathing_intensity_default(void);
138 void breathing_speed_default(void);
139 void breathing_speed_set(uint8_t value);
140 void breathing_speed_inc(uint8_t value);
141 void breathing_speed_dec(uint8_t value);
145 void send_dword(uint32_t number);
146 void send_word(uint16_t number);
147 void send_byte(uint8_t number);
148 void send_nibble(uint8_t number);
149 uint16_t hex_to_keycode(uint8_t hex);
151 void led_set_user(uint8_t usb_led);
152 void led_set_kb(uint8_t usb_led);
154 void api_send_unicode(uint32_t unicode);