aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore3
-rw-r--r--.travis.yml3
-rw-r--r--Doxyfile266
-rw-r--r--docs/_summary.md9
-rw-r--r--docs/api_defines.md78
-rw-r--r--docs/api_input_callback_reg.md169
-rw-r--r--docs/api_midi_device.md143
-rw-r--r--docs/api_midi_device_setup_process.md31
-rw-r--r--docs/api_midi_util.md54
-rw-r--r--docs/api_send_functions.md241
-rw-r--r--docs/api_sysex_tools.md61
-rw-r--r--doxygen-todo32
-rw-r--r--tmk_core/common/action.c63
-rw-r--r--tmk_core/common/action_code.h34
-rw-r--r--tmk_core/common/action_layer.c101
-rw-r--r--tmk_core/common/action_macro.c4
-rw-r--r--tmk_core/common/action_tapping.c37
-rw-r--r--tmk_core/common/action_util.c113
-rw-r--r--tmk_core/common/avr/bootloader.c15
-rw-r--r--tmk_core/common/avr/sleep_led.c19
-rw-r--r--tmk_core/common/avr/suspend.c20
-rw-r--r--tmk_core/common/avr/timer.c24
-rw-r--r--tmk_core/common/backlight.c28
-rw-r--r--tmk_core/common/bootmagic.c14
-rw-r--r--tmk_core/common/bootmagic.h2
-rw-r--r--tmk_core/common/chibios/bootloader.c8
-rw-r--r--tmk_core/common/chibios/eeprom.c44
-rw-r--r--tmk_core/common/chibios/suspend.c18
-rw-r--r--tmk_core/common/command.h4
-rw-r--r--tmk_core/common/eeconfig.c56
-rw-r--r--tmk_core/common/keyboard.c32
-rw-r--r--tmk_core/common/keycode.h1
-rw-r--r--tmk_core/common/led.h3
-rw-r--r--tmk_core/common/magic.c4
-rw-r--r--tmk_core/common/report.c36
-rw-r--r--tmk_core/protocol/lufa/lufa.c106
-rw-r--r--tmk_core/protocol/lufa/outputselect.c16
-rwxr-xr-xutil/generate_api_docs.sh31
-rw-r--r--util/travis_compiled_push.sh35
-rw-r--r--util/travis_docs.sh14
-rw-r--r--util/travis_push.sh17
41 files changed, 1892 insertions, 97 deletions
diff --git a/.gitignore b/.gitignore
index a8dd97eff..971e90453 100644
--- a/.gitignore
+++ b/.gitignore
@@ -23,6 +23,7 @@ quantum/version.h
23.idea/ 23.idea/
24CMakeLists.txt 24CMakeLists.txt
25cmake-build-debug 25cmake-build-debug
26doxygen/
26.DS_STORE 27.DS_STORE
27/util/wsl_downloaded 28/util/wsl_downloaded
28/util/win_downloaded 29/util/win_downloaded
@@ -65,4 +66,4 @@ util/Win_Check_Output.txt
65# things travis sees 66# things travis sees
66secrets.tar 67secrets.tar
67id_rsa_* 68id_rsa_*
68/.vs \ No newline at end of file 69/.vs
diff --git a/.travis.yml b/.travis.yml
index 125e8f333..7ff4060ab 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -15,11 +15,13 @@ before_install:
15install: 15install:
16 - tar -zxf avr8-gnu-toolchain-3.5.4.1709-linux.any.x86_64.tar.gz 16 - tar -zxf avr8-gnu-toolchain-3.5.4.1709-linux.any.x86_64.tar.gz
17 - export PATH="$PATH:$TRAVIS_BUILD_DIR/avr8-gnu-toolchain-linux_x86_64/bin" 17 - export PATH="$PATH:$TRAVIS_BUILD_DIR/avr8-gnu-toolchain-linux_x86_64/bin"
18 - npm install -g moxygen
18before_script: 19before_script:
19 - avr-gcc --version 20 - avr-gcc --version
20script: 21script:
21- make test:all AUTOGEN=false 22- make test:all AUTOGEN=false
22- bash util/travis_build.sh 23- bash util/travis_build.sh
24- bash util/travis_docs.sh
23addons: 25addons:
24 apt: 26 apt:
25 packages: 27 packages:
@@ -30,6 +32,7 @@ addons:
30 - libnewlib-arm-none-eabi 32 - libnewlib-arm-none-eabi
31 - diffutils 33 - diffutils
32 - dos2unix 34 - dos2unix
35 - doxygen
33after_success: 36after_success:
34 bash util/travis_compiled_push.sh 37 bash util/travis_compiled_push.sh
35notifications: 38notifications:
diff --git a/Doxyfile b/Doxyfile
new file mode 100644
index 000000000..218d77b4d
--- /dev/null
+++ b/Doxyfile
@@ -0,0 +1,266 @@
1# Doxyfile 1.8.14
2
3# This file describes the settings to be used by the documentation system
4# doxygen (www.doxygen.org) for qmk_firmware (github.com/qmk/qmk_firmware)
5#
6# All text after a double hash (##) is considered a comment and is placed in
7# front of the TAG it is preceding.
8#
9# All text after a single hash (#) is considered a comment and will be ignored.
10# The format is:
11# TAG = value [value, ...]
12# For lists, items can also be appended using:
13# TAG += value [value, ...]
14# Values that contain spaces should be placed between quotes (\" \").
15
16#---------------------------------------------------------------------------
17# Project related configuration options
18#---------------------------------------------------------------------------
19
20DOXYFILE_ENCODING = UTF-8
21PROJECT_NAME = "QMK Firmware"
22PROJECT_NUMBER = https://github.com/qmk/qmk_firmware
23PROJECT_BRIEF = "Keyboard controller firmware for Atmel AVR and ARM USB families"
24OUTPUT_DIRECTORY = doxygen
25ALLOW_UNICODE_NAMES = NO
26OUTPUT_LANGUAGE = English
27BRIEF_MEMBER_DESC = YES
28REPEAT_BRIEF = YES
29ABBREVIATE_BRIEF = "The $name class" \
30 "The $name widget" \
31 "The $name file" \
32 is \
33 provides \
34 specifies \
35 contains \
36 represents \
37 a \
38 an \
39 the
40ALWAYS_DETAILED_SEC = NO
41INLINE_INHERITED_MEMB = NO
42FULL_PATH_NAMES = YES
43STRIP_FROM_PATH =
44STRIP_FROM_INC_PATH =
45SHORT_NAMES = NO
46JAVADOC_AUTOBRIEF = NO
47QT_AUTOBRIEF = NO
48MULTILINE_CPP_IS_BRIEF = NO
49INHERIT_DOCS = YES
50SEPARATE_MEMBER_PAGES = NO
51TAB_SIZE = 4
52ALIASES =
53TCL_SUBST =
54OPTIMIZE_OUTPUT_FOR_C = YES
55OPTIMIZE_OUTPUT_JAVA = NO
56OPTIMIZE_FOR_FORTRAN = NO
57OPTIMIZE_OUTPUT_VHDL = NO
58EXTENSION_MAPPING =
59MARKDOWN_SUPPORT = YES
60TOC_INCLUDE_HEADINGS = 2
61AUTOLINK_SUPPORT = YES
62BUILTIN_STL_SUPPORT = NO
63CPP_CLI_SUPPORT = NO
64SIP_SUPPORT = NO
65IDL_PROPERTY_SUPPORT = YES
66DISTRIBUTE_GROUP_DOC = NO
67GROUP_NESTED_COMPOUNDS = NO
68SUBGROUPING = YES
69INLINE_GROUPED_CLASSES = NO
70INLINE_SIMPLE_STRUCTS = NO
71TYPEDEF_HIDES_STRUCT = NO
72LOOKUP_CACHE_SIZE = 0
73
74#---------------------------------------------------------------------------
75# Build related configuration options
76#---------------------------------------------------------------------------
77
78EXTRACT_ALL = NO
79EXTRACT_PRIVATE = NO
80EXTRACT_PACKAGE = NO
81EXTRACT_STATIC = NO
82EXTRACT_LOCAL_CLASSES = YES
83EXTRACT_LOCAL_METHODS = NO
84EXTRACT_ANON_NSPACES = NO
85HIDE_UNDOC_MEMBERS = NO
86HIDE_UNDOC_CLASSES = NO
87HIDE_FRIEND_COMPOUNDS = NO
88HIDE_IN_BODY_DOCS = NO
89INTERNAL_DOCS = NO
90CASE_SENSE_NAMES = NO
91HIDE_SCOPE_NAMES = YES
92HIDE_COMPOUND_REFERENCE= NO
93SHOW_INCLUDE_FILES = YES
94SHOW_GROUPED_MEMB_INC = NO
95FORCE_LOCAL_INCLUDES = NO
96INLINE_INFO = YES
97SORT_MEMBER_DOCS = YES
98SORT_BRIEF_DOCS = NO
99SORT_MEMBERS_CTORS_1ST = NO
100SORT_GROUP_NAMES = NO
101SORT_BY_SCOPE_NAME = NO
102STRICT_PROTO_MATCHING = NO
103GENERATE_TODOLIST = YES
104GENERATE_TESTLIST = YES
105GENERATE_BUGLIST = YES
106GENERATE_DEPRECATEDLIST= YES
107ENABLED_SECTIONS =
108MAX_INITIALIZER_LINES = 30
109SHOW_USED_FILES = YES
110SHOW_FILES = YES
111SHOW_NAMESPACES = YES
112FILE_VERSION_FILTER =
113LAYOUT_FILE =
114CITE_BIB_FILES =
115
116#---------------------------------------------------------------------------
117# Configuration options related to warning and progress messages
118#---------------------------------------------------------------------------
119
120QUIET = NO
121WARNINGS = YES
122WARN_IF_UNDOCUMENTED = YES
123WARN_IF_DOC_ERROR = YES
124WARN_NO_PARAMDOC = NO
125WARN_AS_ERROR = NO
126WARN_FORMAT = "$file:$line: $text"
127WARN_LOGFILE =
128
129#---------------------------------------------------------------------------
130# Configuration options related to the input files
131#---------------------------------------------------------------------------
132
133INPUT = tmk_core quantum drivers
134INPUT_ENCODING = UTF-8
135FILE_PATTERNS = *.c \
136 *.cc \
137 *.cxx \
138 *.cpp \
139 *.c++ \
140 *.h \
141 *.hh \
142 *.hxx \
143 *.hpp \
144 *.h++
145RECURSIVE = YES
146EXCLUDE =
147EXCLUDE_SYMLINKS = NO
148EXCLUDE_PATTERNS =
149EXCLUDE_SYMBOLS =
150EXAMPLE_PATH =
151EXAMPLE_PATTERNS = *
152EXAMPLE_RECURSIVE = NO
153IMAGE_PATH =
154INPUT_FILTER =
155FILTER_PATTERNS =
156FILTER_SOURCE_FILES = NO
157FILTER_SOURCE_PATTERNS =
158USE_MDFILE_AS_MAINPAGE =
159
160#---------------------------------------------------------------------------
161# Configuration options related to source browsing
162#---------------------------------------------------------------------------
163
164SOURCE_BROWSER = YES
165INLINE_SOURCES = NO
166STRIP_CODE_COMMENTS = YES
167REFERENCED_BY_RELATION = NO
168REFERENCES_RELATION = NO
169REFERENCES_LINK_SOURCE = YES
170SOURCE_TOOLTIPS = YES
171USE_HTAGS = NO
172VERBATIM_HEADERS = YES
173
174#---------------------------------------------------------------------------
175# Configuration options related to the alphabetical class index
176#---------------------------------------------------------------------------
177
178ALPHABETICAL_INDEX = YES
179COLS_IN_ALPHA_INDEX = 5
180IGNORE_PREFIX =
181
182#---------------------------------------------------------------------------
183# Configuration options related to disabled outputs
184#---------------------------------------------------------------------------
185
186GENERATE_HTML = NO
187GENERATE_LATEX = NO
188GENERATE_RTF = NO
189GENERATE_MAN = NO
190GENERATE_DOCBOOK = NO
191GENERATE_AUTOGEN_DEF = NO
192GENERATE_PERLMOD = NO
193
194#---------------------------------------------------------------------------
195# Configuration options related to the XML output
196#---------------------------------------------------------------------------
197
198GENERATE_XML = YES
199XML_OUTPUT = xml
200XML_PROGRAMLISTING = YES
201
202#---------------------------------------------------------------------------
203# Configuration options related to the preprocessor
204#---------------------------------------------------------------------------
205
206ENABLE_PREPROCESSING = YES
207MACRO_EXPANSION = NO
208EXPAND_ONLY_PREDEF = NO
209SEARCH_INCLUDES = YES
210INCLUDE_PATH =
211INCLUDE_FILE_PATTERNS =
212PREDEFINED =
213EXPAND_AS_DEFINED =
214SKIP_FUNCTION_MACROS = YES
215
216#---------------------------------------------------------------------------
217# Configuration options related to external references
218#---------------------------------------------------------------------------
219
220TAGFILES =
221GENERATE_TAGFILE =
222ALLEXTERNALS = NO
223EXTERNAL_GROUPS = YES
224EXTERNAL_PAGES = YES
225PERL_PATH = /usr/bin/perl
226
227#---------------------------------------------------------------------------
228# Configuration options related to the dot tool
229#---------------------------------------------------------------------------
230
231CLASS_DIAGRAMS = YES
232MSCGEN_PATH =
233DIA_PATH =
234HIDE_UNDOC_RELATIONS = YES
235HAVE_DOT = NO
236DOT_NUM_THREADS = 0
237DOT_FONTNAME = Helvetica
238DOT_FONTSIZE = 10
239DOT_FONTPATH =
240CLASS_GRAPH = YES
241COLLABORATION_GRAPH = YES
242GROUP_GRAPHS = YES
243UML_LOOK = NO
244UML_LIMIT_NUM_FIELDS = 10
245TEMPLATE_RELATIONS = NO
246INCLUDE_GRAPH = YES
247INCLUDED_BY_GRAPH = YES
248CALL_GRAPH = NO
249CALLER_GRAPH = NO
250GRAPHICAL_HIERARCHY = YES
251DIRECTORY_GRAPH = YES
252DOT_IMAGE_FORMAT = png
253INTERACTIVE_SVG = NO
254DOT_PATH =
255DOTFILE_DIRS =
256MSCFILE_DIRS =
257DIAFILE_DIRS =
258PLANTUML_JAR_PATH =
259PLANTUML_CFG_FILE =
260PLANTUML_INCLUDE_PATH =
261DOT_GRAPH_MAX_NODES = 50
262MAX_DOT_GRAPH_DEPTH = 0
263DOT_TRANSPARENT = NO
264DOT_MULTI_TARGETS = NO
265GENERATE_LEGEND = YES
266DOT_CLEANUP = YES
diff --git a/docs/_summary.md b/docs/_summary.md
index 50d9a37ae..e7a32959e 100644
--- a/docs/_summary.md
+++ b/docs/_summary.md
@@ -87,3 +87,12 @@
87 87
88* Other Topics 88* Other Topics
89 * [Using Eclipse with QMK](eclipse.md) 89 * [Using Eclipse with QMK](eclipse.md)
90
91* QMK API (In Progress)
92 * [Defines](api_defines.md)
93 * [Input Callback Reg](api_input_callback_reg.md)
94 * [Midi Device](api_midi_device.md)
95 * [Midi Device Setup Process](api_midi_device_setup_process.md)
96 * [Midi Util](api_midi_util.md)
97 * [Send Functions](api_send_functions.md)
98 * [Sysex Tools](api_sysex_tools.md)
diff --git a/docs/api_defines.md b/docs/api_defines.md
new file mode 100644
index 000000000..fdcb55358
--- /dev/null
+++ b/docs/api_defines.md
@@ -0,0 +1,78 @@
1# group `defines` {#group__defines}
2
3## Summary
4
5 Members | Descriptions
6--------------------------------|---------------------------------------------
7`define `[`SYSEX_BEGIN`](#group__defines_1ga1a3c39bb790dda8a368c4247caabcf79) |
8`define `[`SYSEX_END`](#group__defines_1ga753706d1d28e6f96d7caf1973e80feed) |
9`define `[`MIDI_STATUSMASK`](#group__defines_1gab78a1c818a5f5dab7a8946543f126c69) |
10`define `[`MIDI_CHANMASK`](#group__defines_1ga239edc0a6f8405d3a8f2804f1590b909) |
11`define `[`MIDI_CC`](#group__defines_1ga45f116a1daab76b3c930c2cecfaef215) |
12`define `[`MIDI_NOTEON`](#group__defines_1gafd416f27bf3590868c0c1f55c30be4c7) |
13`define `[`MIDI_NOTEOFF`](#group__defines_1gabed24bea2d989fd655e2ef2ad0765adc) |
14`define `[`MIDI_AFTERTOUCH`](#group__defines_1ga3a322d8cfd53576a2e167c1840551b0f) |
15`define `[`MIDI_PITCHBEND`](#group__defines_1gabcc799504e8064679bca03f232223af4) |
16`define `[`MIDI_PROGCHANGE`](#group__defines_1gaefb3f1595ffbb9db66b46c2c919a3d42) |
17`define `[`MIDI_CHANPRESSURE`](#group__defines_1gaeb3281cc7fcd0daade8ed3d2dfc33dbe) |
18`define `[`MIDI_CLOCK`](#group__defines_1gafa5e4e295aafd15ab7893344599b3b89) |
19`define `[`MIDI_TICK`](#group__defines_1ga3b99408ff864613765d4c3c2ceb52aa7) |
20`define `[`MIDI_START`](#group__defines_1ga8233631c85823aa546f932ad8975caa4) |
21`define `[`MIDI_CONTINUE`](#group__defines_1gab24430f0081e27215b0da84dd0ee745c) |
22`define `[`MIDI_STOP`](#group__defines_1ga3af9271d4b1f0d22904a0b055f48cf62) |
23`define `[`MIDI_ACTIVESENSE`](#group__defines_1gacd88ed42dba52bb4b2052c5656362677) |
24`define `[`MIDI_RESET`](#group__defines_1ga02947f30ca62dc332fdeb10c5868323b) |
25`define `[`MIDI_TC_QUARTERFRAME`](#group__defines_1gaaa072f33590e236d1bfd8f28e833ae31) |
26`define `[`MIDI_SONGPOSITION`](#group__defines_1ga412f6ed33a2150051374bee334ee1705) |
27`define `[`MIDI_SONGSELECT`](#group__defines_1gafcab254838b028365ae0259729e72c4e) |
28`define `[`MIDI_TUNEREQUEST`](#group__defines_1ga8100b907b8c0a84e58b1c53dcd9bd795) |
29`define `[`SYSEX_EDUMANUFID`](#group__defines_1ga5ef855ed955b00a2239ca16afbeb164f) |
30
31## Members
32
33#### `define `[`SYSEX_BEGIN`](#group__defines_1ga1a3c39bb790dda8a368c4247caabcf79) {#group__defines_1ga1a3c39bb790dda8a368c4247caabcf79}
34
35#### `define `[`SYSEX_END`](#group__defines_1ga753706d1d28e6f96d7caf1973e80feed) {#group__defines_1ga753706d1d28e6f96d7caf1973e80feed}
36
37#### `define `[`MIDI_STATUSMASK`](#group__defines_1gab78a1c818a5f5dab7a8946543f126c69) {#group__defines_1gab78a1c818a5f5dab7a8946543f126c69}
38
39#### `define `[`MIDI_CHANMASK`](#group__defines_1ga239edc0a6f8405d3a8f2804f1590b909) {#group__defines_1ga239edc0a6f8405d3a8f2804f1590b909}
40
41#### `define `[`MIDI_CC`](#group__defines_1ga45f116a1daab76b3c930c2cecfaef215) {#group__defines_1ga45f116a1daab76b3c930c2cecfaef215}
42
43#### `define `[`MIDI_NOTEON`](#group__defines_1gafd416f27bf3590868c0c1f55c30be4c7) {#group__defines_1gafd416f27bf3590868c0c1f55c30be4c7}
44
45#### `define `[`MIDI_NOTEOFF`](#group__defines_1gabed24bea2d989fd655e2ef2ad0765adc) {#group__defines_1gabed24bea2d989fd655e2ef2ad0765adc}
46
47#### `define `[`MIDI_AFTERTOUCH`](#group__defines_1ga3a322d8cfd53576a2e167c1840551b0f) {#group__defines_1ga3a322d8cfd53576a2e167c1840551b0f}
48
49#### `define `[`MIDI_PITCHBEND`](#group__defines_1gabcc799504e8064679bca03f232223af4) {#group__defines_1gabcc799504e8064679bca03f232223af4}
50
51#### `define `[`MIDI_PROGCHANGE`](#group__defines_1gaefb3f1595ffbb9db66b46c2c919a3d42) {#group__defines_1gaefb3f1595ffbb9db66b46c2c919a3d42}
52
53#### `define `[`MIDI_CHANPRESSURE`](#group__defines_1gaeb3281cc7fcd0daade8ed3d2dfc33dbe) {#group__defines_1gaeb3281cc7fcd0daade8ed3d2dfc33dbe}
54
55#### `define `[`MIDI_CLOCK`](#group__defines_1gafa5e4e295aafd15ab7893344599b3b89) {#group__defines_1gafa5e4e295aafd15ab7893344599b3b89}
56
57#### `define `[`MIDI_TICK`](#group__defines_1ga3b99408ff864613765d4c3c2ceb52aa7) {#group__defines_1ga3b99408ff864613765d4c3c2ceb52aa7}
58
59#### `define `[`MIDI_START`](#group__defines_1ga8233631c85823aa546f932ad8975caa4) {#group__defines_1ga8233631c85823aa546f932ad8975caa4}
60
61#### `define `[`MIDI_CONTINUE`](#group__defines_1gab24430f0081e27215b0da84dd0ee745c) {#group__defines_1gab24430f0081e27215b0da84dd0ee745c}
62
63#### `define `[`MIDI_STOP`](#group__defines_1ga3af9271d4b1f0d22904a0b055f48cf62) {#group__defines_1ga3af9271d4b1f0d22904a0b055f48cf62}
64
65#### `define `[`MIDI_ACTIVESENSE`](#group__defines_1gacd88ed42dba52bb4b2052c5656362677) {#group__defines_1gacd88ed42dba52bb4b2052c5656362677}
66
67#### `define `[`MIDI_RESET`](#group__defines_1ga02947f30ca62dc332fdeb10c5868323b) {#group__defines_1ga02947f30ca62dc332fdeb10c5868323b}
68
69#### `define `[`MIDI_TC_QUARTERFRAME`](#group__defines_1gaaa072f33590e236d1bfd8f28e833ae31) {#group__defines_1gaaa072f33590e236d1bfd8f28e833ae31}
70
71#### `define `[`MIDI_SONGPOSITION`](#group__defines_1ga412f6ed33a2150051374bee334ee1705) {#group__defines_1ga412f6ed33a2150051374bee334ee1705}
72
73#### `define `[`MIDI_SONGSELECT`](#group__defines_1gafcab254838b028365ae0259729e72c4e) {#group__defines_1gafcab254838b028365ae0259729e72c4e}
74
75#### `define `[`MIDI_TUNEREQUEST`](#group__defines_1ga8100b907b8c0a84e58b1c53dcd9bd795) {#group__defines_1ga8100b907b8c0a84e58b1c53dcd9bd795}
76
77#### `define `[`SYSEX_EDUMANUFID`](#group__defines_1ga5ef855ed955b00a2239ca16afbeb164f) {#group__defines_1ga5ef855ed955b00a2239ca16afbeb164f}
78
diff --git a/docs/api_input_callback_reg.md b/docs/api_input_callback_reg.md
new file mode 100644
index 000000000..4ea132a83
--- /dev/null
+++ b/docs/api_input_callback_reg.md
@@ -0,0 +1,169 @@
1# group `input_callback_reg` {#group__input__callback__reg}
2
3These are the functions you use to register your input callbacks.
4
5The functions are called when the appropriate midi message is matched on the associated device's input.
6
7## Summary
8
9 Members | Descriptions
10--------------------------------|---------------------------------------------
11`public void `[`midi_register_cc_callback`](#group__input__callback__reg_1ga64ab672abbbe393c9c4a83110c8df718)`(`[`MidiDevice`](#struct__midi__device)` * device,midi_three_byte_func_t func)` | Register a control change message (cc) callback.
12`public void `[`midi_register_noteon_callback`](#group__input__callback__reg_1ga3962f276c17618923f1152779552103e)`(`[`MidiDevice`](#struct__midi__device)` * device,midi_three_byte_func_t func)` | Register a note on callback.
13`public void `[`midi_register_noteoff_callback`](#group__input__callback__reg_1gac847b66051bd6d53b762958be0ec4c6d)`(`[`MidiDevice`](#struct__midi__device)` * device,midi_three_byte_func_t func)` | Register a note off callback.
14`public void `[`midi_register_aftertouch_callback`](#group__input__callback__reg_1gaa95bc901bd9edff956a667c9a69dd01f)`(`[`MidiDevice`](#struct__midi__device)` * device,midi_three_byte_func_t func)` | Register an after touch callback.
15`public void `[`midi_register_pitchbend_callback`](#group__input__callback__reg_1ga071a28f02ba14f53de219be70ebd9a48)`(`[`MidiDevice`](#struct__midi__device)` * device,midi_three_byte_func_t func)` | Register a pitch bend callback.
16`public void `[`midi_register_songposition_callback`](#group__input__callback__reg_1gaf2adfd79637f3553d8f26deb1ca22ed6)`(`[`MidiDevice`](#struct__midi__device)` * device,midi_three_byte_func_t func)` | Register a song position callback.
17`public void `[`midi_register_progchange_callback`](#group__input__callback__reg_1gae6ba1a35a4cde9bd15dd42f87401d127)`(`[`MidiDevice`](#struct__midi__device)` * device,midi_two_byte_func_t func)` | Register a program change callback.
18`public void `[`midi_register_chanpressure_callback`](#group__input__callback__reg_1ga39b31f1f4fb93917ce039b958f21b4f5)`(`[`MidiDevice`](#struct__midi__device)` * device,midi_two_byte_func_t func)` | Register a channel pressure callback.
19`public void `[`midi_register_songselect_callback`](#group__input__callback__reg_1gaf9aafc76a2dc4b9fdbb4106cbda6ce72)`(`[`MidiDevice`](#struct__midi__device)` * device,midi_two_byte_func_t func)` | Register a song select callback.
20`public void `[`midi_register_tc_quarterframe_callback`](#group__input__callback__reg_1ga0a119fada2becc628cb15d753b257e6e)`(`[`MidiDevice`](#struct__midi__device)` * device,midi_two_byte_func_t func)` | Register a tc quarter frame callback.
21`public void `[`midi_register_realtime_callback`](#group__input__callback__reg_1ga764f440e857b89084b1a07f9da2ff93a)`(`[`MidiDevice`](#struct__midi__device)` * device,midi_one_byte_func_t func)` | Register a realtime callback.
22`public void `[`midi_register_tunerequest_callback`](#group__input__callback__reg_1gae40ff3ce20bda79fef87da24b8321cb1)`(`[`MidiDevice`](#struct__midi__device)` * device,midi_one_byte_func_t func)` | Register a tune request callback.
23`public void `[`midi_register_sysex_callback`](#group__input__callback__reg_1ga63ce9631b025785c1848d0122d4c4c48)`(`[`MidiDevice`](#struct__midi__device)` * device,midi_sysex_func_t func)` | Register a sysex callback.
24`public void `[`midi_register_fallthrough_callback`](#group__input__callback__reg_1ga7ed189164aa9682862b3181153afbd94)`(`[`MidiDevice`](#struct__midi__device)` * device,midi_var_byte_func_t func)` | Register fall through callback.
25`public void `[`midi_register_catchall_callback`](#group__input__callback__reg_1ga9dbfed568d047a6cd05708f11fe39e99)`(`[`MidiDevice`](#struct__midi__device)` * device,midi_var_byte_func_t func)` | Register a catch all callback.
26
27## Members
28
29#### `public void `[`midi_register_cc_callback`](#group__input__callback__reg_1ga64ab672abbbe393c9c4a83110c8df718)`(`[`MidiDevice`](#struct__midi__device)` * device,midi_three_byte_func_t func)` {#group__input__callback__reg_1ga64ab672abbbe393c9c4a83110c8df718}
30
31Register a control change message (cc) callback.
32
33#### Parameters
34* `device` the device associate with
35
36* `func` the callback function to register
37
38#### `public void `[`midi_register_noteon_callback`](#group__input__callback__reg_1ga3962f276c17618923f1152779552103e)`(`[`MidiDevice`](#struct__midi__device)` * device,midi_three_byte_func_t func)` {#group__input__callback__reg_1ga3962f276c17618923f1152779552103e}
39
40Register a note on callback.
41
42#### Parameters
43* `device` the device associate with
44
45* `func` the callback function to register
46
47#### `public void `[`midi_register_noteoff_callback`](#group__input__callback__reg_1gac847b66051bd6d53b762958be0ec4c6d)`(`[`MidiDevice`](#struct__midi__device)` * device,midi_three_byte_func_t func)` {#group__input__callback__reg_1gac847b66051bd6d53b762958be0ec4c6d}
48
49Register a note off callback.
50
51#### Parameters
52* `device` the device associate with
53
54* `func` the callback function to register
55
56#### `public void `[`midi_register_aftertouch_callback`](#group__input__callback__reg_1gaa95bc901bd9edff956a667c9a69dd01f)`(`[`MidiDevice`](#struct__midi__device)` * device,midi_three_byte_func_t func)` {#group__input__callback__reg_1gaa95bc901bd9edff956a667c9a69dd01f}
57
58Register an after touch callback.
59
60#### Parameters
61* `device` the device associate with
62
63* `func` the callback function to register
64
65#### `public void `[`midi_register_pitchbend_callback`](#group__input__callback__reg_1ga071a28f02ba14f53de219be70ebd9a48)`(`[`MidiDevice`](#struct__midi__device)` * device,midi_three_byte_func_t func)` {#group__input__callback__reg_1ga071a28f02ba14f53de219be70ebd9a48}
66
67Register a pitch bend callback.
68
69#### Parameters
70* `device` the device associate with
71
72* `func` the callback function to register
73
74#### `public void `[`midi_register_songposition_callback`](#group__input__callback__reg_1gaf2adfd79637f3553d8f26deb1ca22ed6)`(`[`MidiDevice`](#struct__midi__device)` * device,midi_three_byte_func_t func)` {#group__input__callback__reg_1gaf2adfd79637f3553d8f26deb1ca22ed6}
75
76Register a song position callback.
77
78#### Parameters
79* `device` the device associate with
80
81* `func` the callback function to register
82
83#### `public void `[`midi_register_progchange_callback`](#group__input__callback__reg_1gae6ba1a35a4cde9bd15dd42f87401d127)`(`[`MidiDevice`](#struct__midi__device)` * device,midi_two_byte_func_t func)` {#group__input__callback__reg_1gae6ba1a35a4cde9bd15dd42f87401d127}
84
85Register a program change callback.
86
87#### Parameters
88* `device` the device associate with
89
90* `func` the callback function to register
91
92#### `public void `[`midi_register_chanpressure_callback`](#group__input__callback__reg_1ga39b31f1f4fb93917ce039b958f21b4f5)`(`[`MidiDevice`](#struct__midi__device)` * device,midi_two_byte_func_t func)` {#group__input__callback__reg_1ga39b31f1f4fb93917ce039b958f21b4f5}
93
94Register a channel pressure callback.
95
96#### Parameters
97* `device` the device associate with
98
99* `func` the callback function to register
100
101#### `public void `[`midi_register_songselect_callback`](#group__input__callback__reg_1gaf9aafc76a2dc4b9fdbb4106cbda6ce72)`(`[`MidiDevice`](#struct__midi__device)` * device,midi_two_byte_func_t func)` {#group__input__callback__reg_1gaf9aafc76a2dc4b9fdbb4106cbda6ce72}
102
103Register a song select callback.
104
105#### Parameters
106* `device` the device associate with
107
108* `func` the callback function to register
109
110#### `public void `[`midi_register_tc_quarterframe_callback`](#group__input__callback__reg_1ga0a119fada2becc628cb15d753b257e6e)`(`[`MidiDevice`](#struct__midi__device)` * device,midi_two_byte_func_t func)` {#group__input__callback__reg_1ga0a119fada2becc628cb15d753b257e6e}
111
112Register a tc quarter frame callback.
113
114#### Parameters
115* `device` the device associate with
116
117* `func` the callback function to register
118
119#### `public void `[`midi_register_realtime_callback`](#group__input__callback__reg_1ga764f440e857b89084b1a07f9da2ff93a)`(`[`MidiDevice`](#struct__midi__device)` * device,midi_one_byte_func_t func)` {#group__input__callback__reg_1ga764f440e857b89084b1a07f9da2ff93a}
120
121Register a realtime callback.
122
123The callback will be called for all of the real time message types.
124
125#### Parameters
126* `device` the device associate with
127
128* `func` the callback function to register
129
130#### `public void `[`midi_register_tunerequest_callback`](#group__input__callback__reg_1gae40ff3ce20bda79fef87da24b8321cb1)`(`[`MidiDevice`](#struct__midi__device)` * device,midi_one_byte_func_t func)` {#group__input__callback__reg_1gae40ff3ce20bda79fef87da24b8321cb1}
131
132Register a tune request callback.
133
134#### Parameters
135* `device` the device associate with
136
137* `func` the callback function to register
138
139#### `public void `[`midi_register_sysex_callback`](#group__input__callback__reg_1ga63ce9631b025785c1848d0122d4c4c48)`(`[`MidiDevice`](#struct__midi__device)` * device,midi_sysex_func_t func)` {#group__input__callback__reg_1ga63ce9631b025785c1848d0122d4c4c48}
140
141Register a sysex callback.
142
143#### Parameters
144* `device` the device associate with
145
146* `func` the callback function to register
147
148#### `public void `[`midi_register_fallthrough_callback`](#group__input__callback__reg_1ga7ed189164aa9682862b3181153afbd94)`(`[`MidiDevice`](#struct__midi__device)` * device,midi_var_byte_func_t func)` {#group__input__callback__reg_1ga7ed189164aa9682862b3181153afbd94}
149
150Register fall through callback.
151
152This is only called if a more specific callback is not matched and called. For instance, if you don't register a note on callback but you get a note on message the fall through callback will be called, if it is registered.
153
154#### Parameters
155* `device` the device associate with
156
157* `func` the callback function to register
158
159#### `public void `[`midi_register_catchall_callback`](#group__input__callback__reg_1ga9dbfed568d047a6cd05708f11fe39e99)`(`[`MidiDevice`](#struct__midi__device)` * device,midi_var_byte_func_t func)` {#group__input__callback__reg_1ga9dbfed568d047a6cd05708f11fe39e99}
160
161Register a catch all callback.
162
163If registered, the catch all callback is called for every message that is matched, even if a more specific or the fallthrough callback is registered.
164
165#### Parameters
166* `device` the device associate with
167
168* `func` the callback function to register
169
diff --git a/docs/api_midi_device.md b/docs/api_midi_device.md
new file mode 100644
index 000000000..5b57abd45
--- /dev/null
+++ b/docs/api_midi_device.md
@@ -0,0 +1,143 @@
1# group `midi_device` {#group__midi__device}
2
3You use the functions when you are implementing your own midi device.
4
5You set a send function to actually send bytes via your device, this method is called when you call a send function with this device, for instance midi_send_cc
6
7You use the midi_device_input to process input data from the device and pass it through the device's associated callbacks.
8
9You use the midi_device_set_pre_input_process_func if you want to have a function called at the beginning of the device's process function, generally to poll for input and pass that into midi_device_input
10
11## Summary
12
13 Members | Descriptions
14--------------------------------|---------------------------------------------
15`define `[`MIDI_INPUT_QUEUE_LENGTH`](#group__midi__device_1ga4aaa419caebdca2bbdfc1331e79781a8) |
16`enum `[`input_state_t`](#group__midi__device_1gac203e877d3df4275ceb8e7180a61f621) |
17`public void `[`midi_device_input`](#group__midi__device_1gad8d3db8eb35d9cfa51ef036a0a9d70db)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t cnt,uint8_t * input)` | Process input bytes. This function parses bytes and calls the appropriate callbacks associated with the given device. You use this function if you are creating a custom device and you want to have midi input.
18`public void `[`midi_device_set_send_func`](#group__midi__device_1ga59f5a46bdd4452f186cc73d9e96d4673)`(`[`MidiDevice`](#struct__midi__device)` * device,midi_var_byte_func_t send_func)` | Set the callback function that will be used for sending output data bytes. This is only used if you're creating a custom device. You'll most likely want the callback function to disable interrupts so that you can call the various midi send functions without worrying about locking.
19`public void `[`midi_device_set_pre_input_process_func`](#group__midi__device_1ga4de0841b87c04fc23cb56b6451f33b69)`(`[`MidiDevice`](#struct__midi__device)` * device,midi_no_byte_func_t pre_process_func)` | Set a callback which is called at the beginning of the midi_device_process call. This can be used to poll for input data and send the data through the midi_device_input function. You'll probably only use this if you're creating a custom device.
20`struct `[`_midi_device`](docs/api_midi_device.md#struct__midi__device) | This structure represents the input and output functions and processing data for a midi device.
21
22## Members
23
24#### `define `[`MIDI_INPUT_QUEUE_LENGTH`](#group__midi__device_1ga4aaa419caebdca2bbdfc1331e79781a8) {#group__midi__device_1ga4aaa419caebdca2bbdfc1331e79781a8}
25
26#### `enum `[`input_state_t`](#group__midi__device_1gac203e877d3df4275ceb8e7180a61f621) {#group__midi__device_1gac203e877d3df4275ceb8e7180a61f621}
27
28 Values | Descriptions
29--------------------------------|---------------------------------------------
30IDLE |
31ONE_BYTE_MESSAGE |
32TWO_BYTE_MESSAGE |
33THREE_BYTE_MESSAGE |
34SYSEX_MESSAGE |
35
36#### `public void `[`midi_device_input`](#group__midi__device_1gad8d3db8eb35d9cfa51ef036a0a9d70db)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t cnt,uint8_t * input)` {#group__midi__device_1gad8d3db8eb35d9cfa51ef036a0a9d70db}
37
38Process input bytes. This function parses bytes and calls the appropriate callbacks associated with the given device. You use this function if you are creating a custom device and you want to have midi input.
39
40#### Parameters
41* `device` the midi device to associate the input with
42
43* `cnt` the number of bytes you are processing
44
45* `input` the bytes to process
46
47#### `public void `[`midi_device_set_send_func`](#group__midi__device_1ga59f5a46bdd4452f186cc73d9e96d4673)`(`[`MidiDevice`](#struct__midi__device)` * device,midi_var_byte_func_t send_func)` {#group__midi__device_1ga59f5a46bdd4452f186cc73d9e96d4673}
48
49Set the callback function that will be used for sending output data bytes. This is only used if you're creating a custom device. You'll most likely want the callback function to disable interrupts so that you can call the various midi send functions without worrying about locking.
50
51#### Parameters
52* `device` the midi device to associate this callback with
53
54* `send_func` the callback function that will do the sending
55
56#### `public void `[`midi_device_set_pre_input_process_func`](#group__midi__device_1ga4de0841b87c04fc23cb56b6451f33b69)`(`[`MidiDevice`](#struct__midi__device)` * device,midi_no_byte_func_t pre_process_func)` {#group__midi__device_1ga4de0841b87c04fc23cb56b6451f33b69}
57
58Set a callback which is called at the beginning of the midi_device_process call. This can be used to poll for input data and send the data through the midi_device_input function. You'll probably only use this if you're creating a custom device.
59
60#### Parameters
61* `device` the midi device to associate this callback with
62
63* `midi_no_byte_func_t` the actual callback function
64
65# struct `_midi_device` {#struct__midi__device}
66
67This structure represents the input and output functions and processing data for a midi device.
68
69A device can represent an actual physical device [serial port, usb port] or something virtual. You should not need to modify this structure directly.
70
71## Summary
72
73 Members | Descriptions
74--------------------------------|---------------------------------------------
75`public midi_var_byte_func_t `[`send_func`](docs/api_midi_device.md#struct__midi__device_1a25d4c94b4bbccd5b98f1032b469f3ff9) |
76`public midi_three_byte_func_t `[`input_cc_callback`](docs/api_midi_device.md#struct__midi__device_1a6da5236c1bc73877728df92d213a78d1) |
77`public midi_three_byte_func_t `[`input_noteon_callback`](docs/api_midi_device.md#struct__midi__device_1aa10b15cf1a7fb825a5df0d2abbe34a1c) |
78`public midi_three_byte_func_t `[`input_noteoff_callback`](docs/api_midi_device.md#struct__midi__device_1aaf290043078534d3a5a0ea4c840eba84) |
79`public midi_three_byte_func_t `[`input_aftertouch_callback`](docs/api_midi_device.md#struct__midi__device_1acb0b4901c545cec4b28b126f2d8c315f) |
80`public midi_three_byte_func_t `[`input_pitchbend_callback`](docs/api_midi_device.md#struct__midi__device_1a305fea672caeb996f2233bf8cd2bef18) |
81`public midi_three_byte_func_t `[`input_songposition_callback`](docs/api_midi_device.md#struct__midi__device_1a5f3f13638b3fef3fc561ed1bf301d586) |
82`public midi_two_byte_func_t `[`input_progchange_callback`](docs/api_midi_device.md#struct__midi__device_1adaf1da617c9a10a9dcad00ab1959d3da) |
83`public midi_two_byte_func_t `[`input_chanpressure_callback`](docs/api_midi_device.md#struct__midi__device_1ab7ca2925c539915d43974eff604d85f7) |
84`public midi_two_byte_func_t `[`input_songselect_callback`](docs/api_midi_device.md#struct__midi__device_1a89bed8a5a55376120cfc0a62b42f057f) |
85`public midi_two_byte_func_t `[`input_tc_quarterframe_callback`](docs/api_midi_device.md#struct__midi__device_1ad9813e75d22e284f9f65a907d20600f0) |
86`public midi_one_byte_func_t `[`input_realtime_callback`](docs/api_midi_device.md#struct__midi__device_1a9448eba4afb7e43650434748db3777be) |
87`public midi_one_byte_func_t `[`input_tunerequest_callback`](docs/api_midi_device.md#struct__midi__device_1a0cb8fd53e00cf1d4202d4fa04d038e8d) |
88`public midi_sysex_func_t `[`input_sysex_callback`](docs/api_midi_device.md#struct__midi__device_1afff9a0ce641762aaef24c1e6953ec9a2) |
89`public midi_var_byte_func_t `[`input_fallthrough_callback`](docs/api_midi_device.md#struct__midi__device_1abb974ec6d734001b4a0e370f292be503) |
90`public midi_var_byte_func_t `[`input_catchall_callback`](docs/api_midi_device.md#struct__midi__device_1aae0d535129d4fd650edc98eb3f7584f8) |
91`public midi_no_byte_func_t `[`pre_input_process_callback`](docs/api_midi_device.md#struct__midi__device_1aeb0bb8923d66c23d874e177dc4265754) |
92`public uint8_t `[`input_buffer`](docs/api_midi_device.md#struct__midi__device_1a7c5684857d6af4ebc4dc12da27bd6b2a) |
93`public input_state_t `[`input_state`](docs/api_midi_device.md#struct__midi__device_1a69a687d2d1c449ec15a11c07a5722e39) |
94`public uint16_t `[`input_count`](docs/api_midi_device.md#struct__midi__device_1a68dea8e7b6151e89c85c95caa612ee5d) |
95`public uint8_t `[`input_queue_data`](docs/api_midi_device.md#struct__midi__device_1ada41de021135dc423abedcbb30f366ff) |
96`public `[`byteQueue_t`](#structbyte_queue__t)` `[`input_queue`](#struct__midi__device_1a49c8538a8a02193c58e28a56eb695d8f) |
97
98## Members
99
100#### `public midi_var_byte_func_t `[`send_func`](docs/api_midi_device.md#struct__midi__device_1a25d4c94b4bbccd5b98f1032b469f3ff9) {#struct__midi__device_1a25d4c94b4bbccd5b98f1032b469f3ff9}
101
102#### `public midi_three_byte_func_t `[`input_cc_callback`](docs/api_midi_device.md#struct__midi__device_1a6da5236c1bc73877728df92d213a78d1) {#struct__midi__device_1a6da5236c1bc73877728df92d213a78d1}
103
104#### `public midi_three_byte_func_t `[`input_noteon_callback`](docs/api_midi_device.md#struct__midi__device_1aa10b15cf1a7fb825a5df0d2abbe34a1c) {#struct__midi__device_1aa10b15cf1a7fb825a5df0d2abbe34a1c}
105
106#### `public midi_three_byte_func_t `[`input_noteoff_callback`](docs/api_midi_device.md#struct__midi__device_1aaf290043078534d3a5a0ea4c840eba84) {#struct__midi__device_1aaf290043078534d3a5a0ea4c840eba84}
107
108#### `public midi_three_byte_func_t `[`input_aftertouch_callback`](docs/api_midi_device.md#struct__midi__device_1acb0b4901c545cec4b28b126f2d8c315f) {#struct__midi__device_1acb0b4901c545cec4b28b126f2d8c315f}
109
110#### `public midi_three_byte_func_t `[`input_pitchbend_callback`](docs/api_midi_device.md#struct__midi__device_1a305fea672caeb996f2233bf8cd2bef18) {#struct__midi__device_1a305fea672caeb996f2233bf8cd2bef18}
111
112#### `public midi_three_byte_func_t `[`input_songposition_callback`](docs/api_midi_device.md#struct__midi__device_1a5f3f13638b3fef3fc561ed1bf301d586) {#struct__midi__device_1a5f3f13638b3fef3fc561ed1bf301d586}
113
114#### `public midi_two_byte_func_t `[`input_progchange_callback`](docs/api_midi_device.md#struct__midi__device_1adaf1da617c9a10a9dcad00ab1959d3da) {#struct__midi__device_1adaf1da617c9a10a9dcad00ab1959d3da}
115
116#### `public midi_two_byte_func_t `[`input_chanpressure_callback`](docs/api_midi_device.md#struct__midi__device_1ab7ca2925c539915d43974eff604d85f7) {#struct__midi__device_1ab7ca2925c539915d43974eff604d85f7}
117
118#### `public midi_two_byte_func_t `[`input_songselect_callback`](docs/api_midi_device.md#struct__midi__device_1a89bed8a5a55376120cfc0a62b42f057f) {#struct__midi__device_1a89bed8a5a55376120cfc0a62b42f057f}
119
120#### `public midi_two_byte_func_t `[`input_tc_quarterframe_callback`](docs/api_midi_device.md#struct__midi__device_1ad9813e75d22e284f9f65a907d20600f0) {#struct__midi__device_1ad9813e75d22e284f9f65a907d20600f0}
121
122#### `public midi_one_byte_func_t `[`input_realtime_callback`](docs/api_midi_device.md#struct__midi__device_1a9448eba4afb7e43650434748db3777be) {#struct__midi__device_1a9448eba4afb7e43650434748db3777be}
123
124#### `public midi_one_byte_func_t `[`input_tunerequest_callback`](docs/api_midi_device.md#struct__midi__device_1a0cb8fd53e00cf1d4202d4fa04d038e8d) {#struct__midi__device_1a0cb8fd53e00cf1d4202d4fa04d038e8d}
125
126#### `public midi_sysex_func_t `[`input_sysex_callback`](docs/api_midi_device.md#struct__midi__device_1afff9a0ce641762aaef24c1e6953ec9a2) {#struct__midi__device_1afff9a0ce641762aaef24c1e6953ec9a2}
127
128#### `public midi_var_byte_func_t `[`input_fallthrough_callback`](docs/api_midi_device.md#struct__midi__device_1abb974ec6d734001b4a0e370f292be503) {#struct__midi__device_1abb974ec6d734001b4a0e370f292be503}
129
130#### `public midi_var_byte_func_t `[`input_catchall_callback`](docs/api_midi_device.md#struct__midi__device_1aae0d535129d4fd650edc98eb3f7584f8) {#struct__midi__device_1aae0d535129d4fd650edc98eb3f7584f8}
131
132#### `public midi_no_byte_func_t `[`pre_input_process_callback`](docs/api_midi_device.md#struct__midi__device_1aeb0bb8923d66c23d874e177dc4265754) {#struct__midi__device_1aeb0bb8923d66c23d874e177dc4265754}
133
134#### `public uint8_t `[`input_buffer`](docs/api_midi_device.md#struct__midi__device_1a7c5684857d6af4ebc4dc12da27bd6b2a) {#struct__midi__device_1a7c5684857d6af4ebc4dc12da27bd6b2a}
135
136#### `public input_state_t `[`input_state`](docs/api_midi_device.md#struct__midi__device_1a69a687d2d1c449ec15a11c07a5722e39) {#struct__midi__device_1a69a687d2d1c449ec15a11c07a5722e39}
137
138#### `public uint16_t `[`input_count`](docs/api_midi_device.md#struct__midi__device_1a68dea8e7b6151e89c85c95caa612ee5d) {#struct__midi__device_1a68dea8e7b6151e89c85c95caa612ee5d}
139
140#### `public uint8_t `[`input_queue_data`](docs/api_midi_device.md#struct__midi__device_1ada41de021135dc423abedcbb30f366ff) {#struct__midi__device_1ada41de021135dc423abedcbb30f366ff}
141
142#### `public `[`byteQueue_t`](#structbyte_queue__t)` `[`input_queue`](#struct__midi__device_1a49c8538a8a02193c58e28a56eb695d8f) {#struct__midi__device_1a49c8538a8a02193c58e28a56eb695d8f}
143
diff --git a/docs/api_midi_device_setup_process.md b/docs/api_midi_device_setup_process.md
new file mode 100644
index 000000000..ae82197c5
--- /dev/null
+++ b/docs/api_midi_device_setup_process.md
@@ -0,0 +1,31 @@
1# group `midi_device_setup_process` {#group__midi__device__setup__process}
2
3These are method that you must use to initialize and run a device.
4
5## Summary
6
7 Members | Descriptions
8--------------------------------|---------------------------------------------
9`public void `[`midi_device_init`](#group__midi__device__setup__process_1gaf29deddc94ea98a59daa0bde1aefd9d9)`(`[`MidiDevice`](#struct__midi__device)` * device)` | Initialize a device.
10`public void `[`midi_device_process`](#group__midi__device__setup__process_1gaa3d5993d0e998a1b59bbf5ab9c7b492b)`(`[`MidiDevice`](#struct__midi__device)` * device)` | Process input data.
11
12## Members
13
14#### `public void `[`midi_device_init`](#group__midi__device__setup__process_1gaf29deddc94ea98a59daa0bde1aefd9d9)`(`[`MidiDevice`](#struct__midi__device)` * device)` {#group__midi__device__setup__process_1gaf29deddc94ea98a59daa0bde1aefd9d9}
15
16Initialize a device.
17
18You must call this before using the device in question.
19
20#### Parameters
21* `device` the device to initialize
22
23#### `public void `[`midi_device_process`](#group__midi__device__setup__process_1gaa3d5993d0e998a1b59bbf5ab9c7b492b)`(`[`MidiDevice`](#struct__midi__device)` * device)` {#group__midi__device__setup__process_1gaa3d5993d0e998a1b59bbf5ab9c7b492b}
24
25Process input data.
26
27This method drives the input processing, you must call this method frequently if you expect to have your input callbacks called.
28
29#### Parameters
30* `device` the device to process
31
diff --git a/docs/api_midi_util.md b/docs/api_midi_util.md
new file mode 100644
index 000000000..97821bd18
--- /dev/null
+++ b/docs/api_midi_util.md
@@ -0,0 +1,54 @@
1# group `midi_util` {#group__midi__util}
2
3## Summary
4
5 Members | Descriptions
6--------------------------------|---------------------------------------------
7`enum `[`midi_packet_length_t`](#group__midi__util_1gae29ff56aee2b430ffe53933b97e5e79e) | An enumeration of the possible packet length values.
8`public bool `[`midi_is_statusbyte`](#group__midi__util_1ga12e3b42ff9cbb4b4f2bc455fc8743ee5)`(uint8_t theByte)` | Test to see if the byte given is a status byte.
9`public bool `[`midi_is_realtime`](#group__midi__util_1gad2f52c363e34a8000d80c983c324e2d7)`(uint8_t theByte)` | Test to see if the byte given is a realtime message.
10`public `[`midi_packet_length_t`](#group__midi__util_1gae29ff56aee2b430ffe53933b97e5e79e)` `[`midi_packet_length`](#group__midi__util_1gaa168b43af6ae9de0debce1625e4b8175)`(uint8_t status)` | Find the length of the packet associated with the status byte given.
11
12## Members
13
14#### `enum `[`midi_packet_length_t`](#group__midi__util_1gae29ff56aee2b430ffe53933b97e5e79e) {#group__midi__util_1gae29ff56aee2b430ffe53933b97e5e79e}
15
16 Values | Descriptions
17--------------------------------|---------------------------------------------
18UNDEFINED |
19ONE |
20TWO |
21THREE |
22
23An enumeration of the possible packet length values.
24
25#### `public bool `[`midi_is_statusbyte`](#group__midi__util_1ga12e3b42ff9cbb4b4f2bc455fc8743ee5)`(uint8_t theByte)` {#group__midi__util_1ga12e3b42ff9cbb4b4f2bc455fc8743ee5}
26
27Test to see if the byte given is a status byte.
28
29#### Parameters
30* `theByte` the byte to test
31
32#### Returns
33true if the byte given is a midi status byte
34
35#### `public bool `[`midi_is_realtime`](#group__midi__util_1gad2f52c363e34a8000d80c983c324e2d7)`(uint8_t theByte)` {#group__midi__util_1gad2f52c363e34a8000d80c983c324e2d7}
36
37Test to see if the byte given is a realtime message.
38
39#### Parameters
40* `theByte` the byte to test
41
42#### Returns
43true if it is a realtime message, false otherwise
44
45#### `public `[`midi_packet_length_t`](#group__midi__util_1gae29ff56aee2b430ffe53933b97e5e79e)` `[`midi_packet_length`](#group__midi__util_1gaa168b43af6ae9de0debce1625e4b8175)`(uint8_t status)` {#group__midi__util_1gaa168b43af6ae9de0debce1625e4b8175}
46
47Find the length of the packet associated with the status byte given.
48
49#### Parameters
50* `status` the status byte
51
52#### Returns
53the length of the packet, will return UNDEFINED if the byte is not a status byte or if it is a sysex status byte
54
diff --git a/docs/api_send_functions.md b/docs/api_send_functions.md
new file mode 100644
index 000000000..b33150800
--- /dev/null
+++ b/docs/api_send_functions.md
@@ -0,0 +1,241 @@
1# group `send_functions` {#group__send__functions}
2
3These are the functions you use to send midi data through a device.
4
5## Summary
6
7 Members | Descriptions
8--------------------------------|---------------------------------------------
9`public void `[`midi_send_cc`](#group__send__functions_1gaaf884811c92df405ca8fe1a00082f960)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t chan,uint8_t num,uint8_t val)` | Send a control change message (cc) via the given device.
10`public void `[`midi_send_noteon`](#group__send__functions_1ga467bcf46dbf03ec269ce565b46bc2775)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t chan,uint8_t num,uint8_t vel)` | Send a note on message via the given device.
11`public void `[`midi_send_noteoff`](#group__send__functions_1gaedb7d8805425eef5d47d57ddcb4c7a49)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t chan,uint8_t num,uint8_t vel)` | Send a note off message via the given device.
12`public void `[`midi_send_aftertouch`](#group__send__functions_1ga0014847571317a0e34b2ef46a6bc584f)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t chan,uint8_t note_num,uint8_t amt)` | Send an after touch message via the given device.
13`public void `[`midi_send_pitchbend`](#group__send__functions_1gae5a4a1e71611e7534be80af9ce3d3491)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t chan,int16_t amt)` | Send a pitch bend message via the given device.
14`public void `[`midi_send_programchange`](#group__send__functions_1ga7b15588ef25e5e1ff09c2afc3151ce86)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t chan,uint8_t num)` | Send a program change message via the given device.
15`public void `[`midi_send_channelpressure`](#group__send__functions_1gaf23e69fdf812e89c0036f51f88ab2e1b)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t chan,uint8_t amt)` | Send a channel pressure message via the given device.
16`public void `[`midi_send_clock`](#group__send__functions_1ga4e1b11a7cdb0875f6e03ce7c79c581aa)`(`[`MidiDevice`](#struct__midi__device)` * device)` | Send a clock message via the given device.
17`public void `[`midi_send_tick`](#group__send__functions_1ga2b43c7d433d940c5b907595aac947972)`(`[`MidiDevice`](#struct__midi__device)` * device)` | Send a tick message via the given device.
18`public void `[`midi_send_start`](#group__send__functions_1ga1569749a8d58ccc56789289d7c7245cc)`(`[`MidiDevice`](#struct__midi__device)` * device)` | Send a start message via the given device.
19`public void `[`midi_send_continue`](#group__send__functions_1gaed5dc29d754a27372e89ab8bc20ee120)`(`[`MidiDevice`](#struct__midi__device)` * device)` | Send a continue message via the given device.
20`public void `[`midi_send_stop`](#group__send__functions_1ga026e1a620276cb653ac501aa0d12a988)`(`[`MidiDevice`](#struct__midi__device)` * device)` | Send a stop message via the given device.
21`public void `[`midi_send_activesense`](#group__send__functions_1ga9b6e4c6ce4719d2604187b325620db37)`(`[`MidiDevice`](#struct__midi__device)` * device)` | Send an active sense message via the given device.
22`public void `[`midi_send_reset`](#group__send__functions_1ga3671e39a6d93ca9568fc493001af1b1b)`(`[`MidiDevice`](#struct__midi__device)` * device)` | Send a reset message via the given device.
23`public void `[`midi_send_tcquarterframe`](#group__send__functions_1ga5b85639910eec280bb744c934d0fd45a)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t time)` | Send a tc quarter frame message via the given device.
24`public void `[`midi_send_songposition`](#group__send__functions_1gab1c9eeef3b57a8cd2e6128d18e85eb7f)`(`[`MidiDevice`](#struct__midi__device)` * device,uint16_t pos)` | Send a song position message via the given device.
25`public void `[`midi_send_songselect`](#group__send__functions_1ga42de7838ba70d949af9a50f9facc3c50)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t song)` | Send a song select message via the given device.
26`public void `[`midi_send_tunerequest`](#group__send__functions_1ga8db6c7e04d48e4d2266dd59118ca0656)`(`[`MidiDevice`](#struct__midi__device)` * device)` | Send a tune request message via the given device.
27`public void `[`midi_send_byte`](#group__send__functions_1ga857e85eb90b288385642d4d991e09881)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t b)` | Send a byte via the given device.
28`public void `[`midi_send_data`](#group__send__functions_1ga36e2f2e45369d911b76969361679054b)`(`[`MidiDevice`](#struct__midi__device)` * device,uint16_t count,uint8_t byte0,uint8_t byte1,uint8_t byte2)` | Send up to 3 bytes of data.
29`public void `[`midi_send_array`](#group__send__functions_1ga245243cb1da18d2cea18d4b18d846ead)`(`[`MidiDevice`](#struct__midi__device)` * device,uint16_t count,uint8_t * array)` | Send an array of formatted midi data.
30
31## Members
32
33#### `public void `[`midi_send_cc`](#group__send__functions_1gaaf884811c92df405ca8fe1a00082f960)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t chan,uint8_t num,uint8_t val)` {#group__send__functions_1gaaf884811c92df405ca8fe1a00082f960}
34
35Send a control change message (cc) via the given device.
36
37#### Parameters
38* `device` the device to use for sending
39
40* `chan` the channel to send on, 0-15
41
42* `num` the cc num
43
44* `val` the value of that cc num
45
46#### `public void `[`midi_send_noteon`](#group__send__functions_1ga467bcf46dbf03ec269ce565b46bc2775)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t chan,uint8_t num,uint8_t vel)` {#group__send__functions_1ga467bcf46dbf03ec269ce565b46bc2775}
47
48Send a note on message via the given device.
49
50#### Parameters
51* `device` the device to use for sending
52
53* `chan` the channel to send on, 0-15
54
55* `num` the note number
56
57* `vel` the note velocity
58
59#### `public void `[`midi_send_noteoff`](#group__send__functions_1gaedb7d8805425eef5d47d57ddcb4c7a49)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t chan,uint8_t num,uint8_t vel)` {#group__send__functions_1gaedb7d8805425eef5d47d57ddcb4c7a49}
60
61Send a note off message via the given device.
62
63#### Parameters
64* `device` the device to use for sending
65
66* `chan` the channel to send on, 0-15
67
68* `num` the note number
69
70* `vel` the note velocity
71
72#### `public void `[`midi_send_aftertouch`](#group__send__functions_1ga0014847571317a0e34b2ef46a6bc584f)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t chan,uint8_t note_num,uint8_t amt)` {#group__send__functions_1ga0014847571317a0e34b2ef46a6bc584f}
73
74Send an after touch message via the given device.
75
76#### Parameters
77* `device` the device to use for sending
78
79* `chan` the channel to send on, 0-15
80
81* `note_num` the note number
82
83* `amt` the after touch amount
84
85#### `public void `[`midi_send_pitchbend`](#group__send__functions_1gae5a4a1e71611e7534be80af9ce3d3491)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t chan,int16_t amt)` {#group__send__functions_1gae5a4a1e71611e7534be80af9ce3d3491}
86
87Send a pitch bend message via the given device.
88
89#### Parameters
90* `device` the device to use for sending
91
92* `chan` the channel to send on, 0-15
93
94* `amt` the bend amount range: -8192..8191, 0 means no bend
95
96#### `public void `[`midi_send_programchange`](#group__send__functions_1ga7b15588ef25e5e1ff09c2afc3151ce86)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t chan,uint8_t num)` {#group__send__functions_1ga7b15588ef25e5e1ff09c2afc3151ce86}
97
98Send a program change message via the given device.
99
100#### Parameters
101* `device` the device to use for sending
102
103* `chan` the channel to send on, 0-15
104
105* `num` the program to change to
106
107#### `public void `[`midi_send_channelpressure`](#group__send__functions_1gaf23e69fdf812e89c0036f51f88ab2e1b)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t chan,uint8_t amt)` {#group__send__functions_1gaf23e69fdf812e89c0036f51f88ab2e1b}
108
109Send a channel pressure message via the given device.
110
111#### Parameters
112* `device` the device to use for sending
113
114* `chan` the channel to send on, 0-15
115
116* `amt` the amount of channel pressure
117
118#### `public void `[`midi_send_clock`](#group__send__functions_1ga4e1b11a7cdb0875f6e03ce7c79c581aa)`(`[`MidiDevice`](#struct__midi__device)` * device)` {#group__send__functions_1ga4e1b11a7cdb0875f6e03ce7c79c581aa}
119
120Send a clock message via the given device.
121
122#### Parameters
123* `device` the device to use for sending
124
125#### `public void `[`midi_send_tick`](#group__send__functions_1ga2b43c7d433d940c5b907595aac947972)`(`[`MidiDevice`](#struct__midi__device)` * device)` {#group__send__functions_1ga2b43c7d433d940c5b907595aac947972}
126
127Send a tick message via the given device.
128
129#### Parameters
130* `device` the device to use for sending
131
132#### `public void `[`midi_send_start`](#group__send__functions_1ga1569749a8d58ccc56789289d7c7245cc)`(`[`MidiDevice`](#struct__midi__device)` * device)` {#group__send__functions_1ga1569749a8d58ccc56789289d7c7245cc}
133
134Send a start message via the given device.
135
136#### Parameters
137* `device` the device to use for sending
138
139#### `public void `[`midi_send_continue`](#group__send__functions_1gaed5dc29d754a27372e89ab8bc20ee120)`(`[`MidiDevice`](#struct__midi__device)` * device)` {#group__send__functions_1gaed5dc29d754a27372e89ab8bc20ee120}
140
141Send a continue message via the given device.
142
143#### Parameters
144* `device` the device to use for sending
145
146#### `public void `[`midi_send_stop`](#group__send__functions_1ga026e1a620276cb653ac501aa0d12a988)`(`[`MidiDevice`](#struct__midi__device)` * device)` {#group__send__functions_1ga026e1a620276cb653ac501aa0d12a988}
147
148Send a stop message via the given device.
149
150#### Parameters
151* `device` the device to use for sending
152
153#### `public void `[`midi_send_activesense`](#group__send__functions_1ga9b6e4c6ce4719d2604187b325620db37)`(`[`MidiDevice`](#struct__midi__device)` * device)` {#group__send__functions_1ga9b6e4c6ce4719d2604187b325620db37}
154
155Send an active sense message via the given device.
156
157#### Parameters
158* `device` the device to use for sending
159
160#### `public void `[`midi_send_reset`](#group__send__functions_1ga3671e39a6d93ca9568fc493001af1b1b)`(`[`MidiDevice`](#struct__midi__device)` * device)` {#group__send__functions_1ga3671e39a6d93ca9568fc493001af1b1b}
161
162Send a reset message via the given device.
163
164#### Parameters
165* `device` the device to use for sending
166
167#### `public void `[`midi_send_tcquarterframe`](#group__send__functions_1ga5b85639910eec280bb744c934d0fd45a)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t time)` {#group__send__functions_1ga5b85639910eec280bb744c934d0fd45a}
168
169Send a tc quarter frame message via the given device.
170
171#### Parameters
172* `device` the device to use for sending
173
174* `time` the time of this quarter frame, range 0..16383
175
176#### `public void `[`midi_send_songposition`](#group__send__functions_1gab1c9eeef3b57a8cd2e6128d18e85eb7f)`(`[`MidiDevice`](#struct__midi__device)` * device,uint16_t pos)` {#group__send__functions_1gab1c9eeef3b57a8cd2e6128d18e85eb7f}
177
178Send a song position message via the given device.
179
180#### Parameters
181* `device` the device to use for sending
182
183* `pos` the song position
184
185#### `public void `[`midi_send_songselect`](#group__send__functions_1ga42de7838ba70d949af9a50f9facc3c50)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t song)` {#group__send__functions_1ga42de7838ba70d949af9a50f9facc3c50}
186
187Send a song select message via the given device.
188
189#### Parameters
190* `device` the device to use for sending
191
192* `song` the song to select
193
194#### `public void `[`midi_send_tunerequest`](#group__send__functions_1ga8db6c7e04d48e4d2266dd59118ca0656)`(`[`MidiDevice`](#struct__midi__device)` * device)` {#group__send__functions_1ga8db6c7e04d48e4d2266dd59118ca0656}
195
196Send a tune request message via the given device.
197
198#### Parameters
199* `device` the device to use for sending
200
201#### `public void `[`midi_send_byte`](#group__send__functions_1ga857e85eb90b288385642d4d991e09881)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t b)` {#group__send__functions_1ga857e85eb90b288385642d4d991e09881}
202
203Send a byte via the given device.
204
205This is a generic method for sending data via the given midi device. This would be useful for sending sysex data or messages that are not implemented in this API, if there are any. Please contact the author if you find some so we can add them.
206
207#### Parameters
208* `device` the device to use for sending
209
210* `b` the byte to send
211
212#### `public void `[`midi_send_data`](#group__send__functions_1ga36e2f2e45369d911b76969361679054b)`(`[`MidiDevice`](#struct__midi__device)` * device,uint16_t count,uint8_t byte0,uint8_t byte1,uint8_t byte2)` {#group__send__functions_1ga36e2f2e45369d911b76969361679054b}
213
214Send up to 3 bytes of data.
215
216% 4 is applied to count so that you can use this to pass sysex through
217
218#### Parameters
219* `device` the device to use for sending
220
221* `count` the count of bytes to send, %4 is applied
222
223* `byte0` the first byte
224
225* `byte1` the second byte, ignored if cnt % 4 != 2
226
227* `byte2` the third byte, ignored if cnt % 4 != 3
228
229#### `public void `[`midi_send_array`](#group__send__functions_1ga245243cb1da18d2cea18d4b18d846ead)`(`[`MidiDevice`](#struct__midi__device)` * device,uint16_t count,uint8_t * array)` {#group__send__functions_1ga245243cb1da18d2cea18d4b18d846ead}
230
231Send an array of formatted midi data.
232
233Can be used for sysex.
234
235#### Parameters
236* `device` the device to use for sending
237
238* `count` the count of bytes to send
239
240* `array` the array of bytes
241
diff --git a/docs/api_sysex_tools.md b/docs/api_sysex_tools.md
new file mode 100644
index 000000000..55dbe9e16
--- /dev/null
+++ b/docs/api_sysex_tools.md
@@ -0,0 +1,61 @@
1# group `sysex_tools` {#group__sysex__tools}
2
3## Summary
4
5 Members | Descriptions
6--------------------------------|---------------------------------------------
7`public uint16_t `[`sysex_encoded_length`](#group__sysex__tools_1ga061e5607030412d6e62e2390d8013f0a)`(uint16_t decoded_length)` | Compute the length of a message after it is encoded.
8`public uint16_t `[`sysex_decoded_length`](#group__sysex__tools_1ga121fc227d3acc1c0ea08c9a5c26fa3b0)`(uint16_t encoded_length)` | Compute the length of a message after it is decoded.
9`public uint16_t `[`sysex_encode`](#group__sysex__tools_1ga54d77f8d32f92a6f329daefa2b314742)`(uint8_t * encoded,const uint8_t * source,uint16_t length)` | Encode data so that it can be transmitted safely in a sysex message.
10`public uint16_t `[`sysex_decode`](#group__sysex__tools_1gaaad1d9ba2d5eca709a0ab4ba40662229)`(uint8_t * decoded,const uint8_t * source,uint16_t length)` | Decode encoded data.
11
12## Members
13
14#### `public uint16_t `[`sysex_encoded_length`](#group__sysex__tools_1ga061e5607030412d6e62e2390d8013f0a)`(uint16_t decoded_length)` {#group__sysex__tools_1ga061e5607030412d6e62e2390d8013f0a}
15
16Compute the length of a message after it is encoded.
17
18#### Parameters
19* `decoded_length` The length, in bytes, of the message to encode.
20
21#### Returns
22The length, in bytes, of the message after encodeing.
23
24#### `public uint16_t `[`sysex_decoded_length`](#group__sysex__tools_1ga121fc227d3acc1c0ea08c9a5c26fa3b0)`(uint16_t encoded_length)` {#group__sysex__tools_1ga121fc227d3acc1c0ea08c9a5c26fa3b0}
25
26Compute the length of a message after it is decoded.
27
28#### Parameters
29* `encoded_length` The length, in bytes, of the encoded message.
30
31#### Returns
32The length, in bytes, of the message after it is decoded.
33
34#### `public uint16_t `[`sysex_encode`](#group__sysex__tools_1ga54d77f8d32f92a6f329daefa2b314742)`(uint8_t * encoded,const uint8_t * source,uint16_t length)` {#group__sysex__tools_1ga54d77f8d32f92a6f329daefa2b314742}
35
36Encode data so that it can be transmitted safely in a sysex message.
37
38#### Parameters
39* `encoded` The output data buffer, must be at least sysex_encoded_length(length) bytes long.
40
41* `source` The input buffer of data to be encoded.
42
43* `length` The number of bytes from the input buffer to encode.
44
45#### Returns
46number of bytes encoded.
47
48#### `public uint16_t `[`sysex_decode`](#group__sysex__tools_1gaaad1d9ba2d5eca709a0ab4ba40662229)`(uint8_t * decoded,const uint8_t * source,uint16_t length)` {#group__sysex__tools_1gaaad1d9ba2d5eca709a0ab4ba40662229}
49
50Decode encoded data.
51
52#### Parameters
53* `decoded` The output data buffer, must be at least sysex_decoded_length(length) bytes long.
54
55* `source` The input buffer of data to be decoded.
56
57* `length` The number of bytes from the input buffer to decode.
58
59#### Returns
60number of bytes decoded.
61
diff --git a/doxygen-todo b/doxygen-todo
new file mode 100644
index 000000000..d5ae84058
--- /dev/null
+++ b/doxygen-todo
@@ -0,0 +1,32 @@
1tmk_core/protocol
2tmk_core/protocol/bluefruit
3tmk_core/protocol/chibios
4tmk_core/protocol/iwrap
5tmk_core/protocol/lufa
6tmk_core/protocol/mbed
7tmk_core/protocol/midi
8tmk_core/protocol/midi/bytequeue
9tmk_core/protocol/midi/Config
10tmk_core/protocol/pjrc
11tmk_core/protocol/usb_hid
12tmk_core/protocol/vusb
13tmk_core/tool
14tmk_core/tool/chibios
15quantum
16quantum/api
17quantum/audio
18quantum/keymap_extras
19quantum/process_keycode
20quantum/serial_link
21quantum/serial_link/protocol
22quantum/serial_link/system
23quantum/serial_link/tests
24quantum/tools
25quantum/visualizer
26quantum/visualizer/resources
27drivers
28drivers/avr
29drivers/ugfx
30drivers/ugfx/gdisp
31drivers/ugfx/gdisp/is31fl3731c
32drivers/ugfx/gdisp/st7565
diff --git a/tmk_core/common/action.c b/tmk_core/common/action.c
index 33d920554..fff834791 100644
--- a/tmk_core/common/action.c
+++ b/tmk_core/common/action.c
@@ -44,6 +44,10 @@ int retro_tapping_counter = 0;
44#include <fauxclicky.h> 44#include <fauxclicky.h>
45#endif 45#endif
46 46
47/** \brief Called to execute an action.
48 *
49 * FIXME: Needs documentation.
50 */
47void action_exec(keyevent_t event) 51void action_exec(keyevent_t event)
48{ 52{
49 if (!IS_NOEVENT(event)) { 53 if (!IS_NOEVENT(event)) {
@@ -95,6 +99,10 @@ void action_exec(keyevent_t event)
95bool swap_hands = false; 99bool swap_hands = false;
96bool swap_held = false; 100bool swap_held = false;
97 101
102/** \brief Process Hand Swap
103 *
104 * FIXME: Needs documentation.
105 */
98void process_hand_swap(keyevent_t *event) { 106void process_hand_swap(keyevent_t *event) {
99 static swap_state_row_t swap_state[MATRIX_ROWS]; 107 static swap_state_row_t swap_state[MATRIX_ROWS];
100 108
@@ -134,7 +142,10 @@ bool process_record_quantum(keyrecord_t *record) {
134} 142}
135 143
136#ifndef NO_ACTION_TAPPING 144#ifndef NO_ACTION_TAPPING
137// Allows for handling tap-hold actions immediately instead of waiting for TAPPING_TERM or another keypress. 145/** \brief Allows for handling tap-hold actions immediately instead of waiting for TAPPING_TERM or another keypress.
146 *
147 * FIXME: Needs documentation.
148 */
138void process_record_tap_hint(keyrecord_t *record) 149void process_record_tap_hint(keyrecord_t *record)
139{ 150{
140 action_t action = layer_switch_get_action(record->event.key); 151 action_t action = layer_switch_get_action(record->event.key);
@@ -154,6 +165,10 @@ void process_record_tap_hint(keyrecord_t *record)
154} 165}
155#endif 166#endif
156 167
168/** \brief Take a key event (key press or key release) and processes it.
169 *
170 * FIXME: Needs documentation.
171 */
157void process_record(keyrecord_t *record) 172void process_record(keyrecord_t *record)
158{ 173{
159 if (IS_NOEVENT(record->event)) { return; } 174 if (IS_NOEVENT(record->event)) { return; }
@@ -172,6 +187,10 @@ void process_record(keyrecord_t *record)
172 process_action(record, action); 187 process_action(record, action);
173} 188}
174 189
190/** \brief Take an action and processes it.
191 *
192 * FIXME: Needs documentation.
193 */
175void process_action(keyrecord_t *record, action_t action) 194void process_action(keyrecord_t *record, action_t action)
176{ 195{
177 keyevent_t event = record->event; 196 keyevent_t event = record->event;
@@ -674,8 +693,9 @@ void process_action(keyrecord_t *record, action_t action)
674 693
675 694
676 695
677/* 696/** \brief Utilities for actions. (FIXME: Needs better description)
678 * Utilities for actions. 697 *
698 * FIXME: Needs documentation.
679 */ 699 */
680void register_code(uint8_t code) 700void register_code(uint8_t code)
681{ 701{
@@ -755,6 +775,10 @@ void register_code(uint8_t code)
755 } 775 }
756} 776}
757 777
778/** \brief Utilities for actions. (FIXME: Needs better description)
779 *
780 * FIXME: Needs documentation.
781 */
758void unregister_code(uint8_t code) 782void unregister_code(uint8_t code)
759{ 783{
760 if (code == KC_NO) { 784 if (code == KC_NO) {
@@ -810,6 +834,10 @@ void unregister_code(uint8_t code)
810 } 834 }
811} 835}
812 836
837/** \brief Utilities for actions. (FIXME: Needs better description)
838 *
839 * FIXME: Needs documentation.
840 */
813void register_mods(uint8_t mods) 841void register_mods(uint8_t mods)
814{ 842{
815 if (mods) { 843 if (mods) {
@@ -818,6 +846,10 @@ void register_mods(uint8_t mods)
818 } 846 }
819} 847}
820 848
849/** \brief Utilities for actions. (FIXME: Needs better description)
850 *
851 * FIXME: Needs documentation.
852 */
821void unregister_mods(uint8_t mods) 853void unregister_mods(uint8_t mods)
822{ 854{
823 if (mods) { 855 if (mods) {
@@ -826,12 +858,20 @@ void unregister_mods(uint8_t mods)
826 } 858 }
827} 859}
828 860
861/** \brief Utilities for actions. (FIXME: Needs better description)
862 *
863 * FIXME: Needs documentation.
864 */
829void clear_keyboard(void) 865void clear_keyboard(void)
830{ 866{
831 clear_mods(); 867 clear_mods();
832 clear_keyboard_but_mods(); 868 clear_keyboard_but_mods();
833} 869}
834 870
871/** \brief Utilities for actions. (FIXME: Needs better description)
872 *
873 * FIXME: Needs documentation.
874 */
835void clear_keyboard_but_mods(void) 875void clear_keyboard_but_mods(void)
836{ 876{
837 clear_weak_mods(); 877 clear_weak_mods();
@@ -848,6 +888,10 @@ void clear_keyboard_but_mods(void)
848#endif 888#endif
849} 889}
850 890
891/** \brief Utilities for actions. (FIXME: Needs better description)
892 *
893 * FIXME: Needs documentation.
894 */
851bool is_tap_key(keypos_t key) 895bool is_tap_key(keypos_t key)
852{ 896{
853 action_t action = layer_switch_get_action(key); 897 action_t action = layer_switch_get_action(key);
@@ -880,14 +924,19 @@ bool is_tap_key(keypos_t key)
880} 924}
881 925
882 926
883/* 927/** \brief Debug print (FIXME: Needs better description)
884 * debug print 928 *
929 * FIXME: Needs documentation.
885 */ 930 */
886void debug_event(keyevent_t event) 931void debug_event(keyevent_t event)
887{ 932{
888 dprintf("%04X%c(%u)", (event.key.row<<8 | event.key.col), (event.pressed ? 'd' : 'u'), event.time); 933 dprintf("%04X%c(%u)", (event.key.row<<8 | event.key.col), (event.pressed ? 'd' : 'u'), event.time);
889} 934}
890 935
936/** \brief Debug print (FIXME: Needs better description)
937 *
938 * FIXME: Needs documentation.
939 */
891void debug_record(keyrecord_t record) 940void debug_record(keyrecord_t record)
892{ 941{
893 debug_event(record.event); 942 debug_event(record.event);
@@ -896,6 +945,10 @@ void debug_record(keyrecord_t record)
896#endif 945#endif
897} 946}
898 947
948/** \brief Debug print (FIXME: Needs better description)
949 *
950 * FIXME: Needs documentation.
951 */
899void debug_action(action_t action) 952void debug_action(action_t action)
900{ 953{
901 switch (action.kind.id) { 954 switch (action.kind.id) {
diff --git a/tmk_core/common/action_code.h b/tmk_core/common/action_code.h
index fe2735b97..d836b7a8a 100644
--- a/tmk_core/common/action_code.h
+++ b/tmk_core/common/action_code.h
@@ -17,10 +17,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
17#ifndef ACTION_CODE_H 17#ifndef ACTION_CODE_H
18#define ACTION_CODE_H 18#define ACTION_CODE_H
19 19
20/* Action codes 20/** \brief Action codes
21 * ============
22 * 16bit code: action_kind(4bit) + action_parameter(12bit)
23 * 21 *
22 * 16bit code: action_kind(4bit) + action_parameter(12bit)
24 * 23 *
25 * Key Actions(00xx) 24 * Key Actions(00xx)
26 * ----------------- 25 * -----------------
@@ -38,7 +37,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
38 * 001r|mods|0000 00xx (reserved) 37 * 001r|mods|0000 00xx (reserved)
39 * 001r|mods| keycode Modifiers with Tap Key(Dual role) 38 * 001r|mods| keycode Modifiers with Tap Key(Dual role)
40 * 39 *
41 *
42 * Other Keys(01xx) 40 * Other Keys(01xx)
43 * ---------------- 41 * ----------------
44 * ACT_USAGE(0100): TODO: Not needed? 42 * ACT_USAGE(0100): TODO: Not needed?
@@ -47,17 +45,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
47 * 0100|10| usage(10) (reserved) 45 * 0100|10| usage(10) (reserved)
48 * 0100|11| usage(10) (reserved) 46 * 0100|11| usage(10) (reserved)
49 * 47 *
50 *
51 * ACT_MOUSEKEY(0101): TODO: Merge these two actions to conserve space? 48 * ACT_MOUSEKEY(0101): TODO: Merge these two actions to conserve space?
52 * 0101|xxxx| keycode Mouse key 49 * 0101|xxxx| keycode Mouse key
53 * 50 *
54 * ACT_SWAP_HANDS(0110): 51 * ACT_SWAP_HANDS(0110):
55 * 0110|xxxx| keycode Swap hands (keycode on tap, or options) 52 * 0110|xxxx| keycode Swap hands (keycode on tap, or options)
56 * 53 *
57 *
58 * 0111|xxxx xxxx xxxx (reserved) 54 * 0111|xxxx xxxx xxxx (reserved)
59 * 55 *
60 *
61 * Layer Actions(10xx) 56 * Layer Actions(10xx)
62 * ------------------- 57 * -------------------
63 * ACT_LAYER(1000): 58 * ACT_LAYER(1000):
@@ -84,7 +79,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
84 * 101E|LLLL|1111 xxxx Reserved (0xF5-FF) 79 * 101E|LLLL|1111 xxxx Reserved (0xF5-FF)
85 * ELLLL: layer 0-31(E: extra bit for layer 16-31) 80 * ELLLL: layer 0-31(E: extra bit for layer 16-31)
86 * 81 *
87 *
88 * Extensions(11xx) 82 * Extensions(11xx)
89 * ---------------- 83 * ----------------
90 * ACT_MACRO(1100): 84 * ACT_MACRO(1100):
@@ -126,7 +120,7 @@ enum action_kind_id {
126}; 120};
127 121
128 122
129/* Action Code Struct 123/** \brief Action Code Struct
130 * 124 *
131 * NOTE: 125 * NOTE:
132 * In avr-gcc bit field seems to be assigned from LSB(bit0) to MSB(bit15). 126 * In avr-gcc bit field seems to be assigned from LSB(bit0) to MSB(bit15).
@@ -198,10 +192,9 @@ typedef union {
198#define ACTION(kind, param) ((kind)<<12 | (param)) 192#define ACTION(kind, param) ((kind)<<12 | (param))
199 193
200 194
201/* 195/** \brief Key Actions
202 * Key Actions 196 *
203 */ 197 * Mod bits: 43210
204/* Mod bits: 43210
205 * bit 0 ||||+- Control 198 * bit 0 ||||+- Control
206 * bit 1 |||+-- Shift 199 * bit 1 |||+-- Shift
207 * bit 2 ||+--- Alt 200 * bit 2 ||+--- Alt
@@ -230,8 +223,7 @@ enum mods_codes {
230#define ACTION_MODS_TAP_TOGGLE(mods) ACTION(ACT_MODS_TAP, ((mods)&0x1f)<<8 | MODS_TAP_TOGGLE) 223#define ACTION_MODS_TAP_TOGGLE(mods) ACTION(ACT_MODS_TAP, ((mods)&0x1f)<<8 | MODS_TAP_TOGGLE)
231 224
232 225
233/* 226/** \brief Other Keys
234 * Other Keys
235 */ 227 */
236enum usage_pages { 228enum usage_pages {
237 PAGE_SYSTEM, 229 PAGE_SYSTEM,
@@ -243,20 +235,25 @@ enum usage_pages {
243 235
244 236
245 237
246/* 238/** \brief Layer Actions
247 * Layer Actions
248 */ 239 */
249enum layer_param_on { 240enum layer_param_on {
250 ON_PRESS = 1, 241 ON_PRESS = 1,
251 ON_RELEASE = 2, 242 ON_RELEASE = 2,
252 ON_BOTH = 3, 243 ON_BOTH = 3,
253}; 244};
245
246/** \brief Layer Actions
247 */
254enum layer_param_bit_op { 248enum layer_param_bit_op {
255 OP_BIT_AND = 0, 249 OP_BIT_AND = 0,
256 OP_BIT_OR = 1, 250 OP_BIT_OR = 1,
257 OP_BIT_XOR = 2, 251 OP_BIT_XOR = 2,
258 OP_BIT_SET = 3, 252 OP_BIT_SET = 3,
259}; 253};
254
255/** \brief Layer Actions
256 */
260enum layer_param_tap_op { 257enum layer_param_tap_op {
261 OP_TAP_TOGGLE = 0xF0, 258 OP_TAP_TOGGLE = 0xF0,
262 OP_ON_OFF, 259 OP_ON_OFF,
@@ -296,8 +293,7 @@ enum layer_param_tap_op {
296#define ACTION_DEFAULT_LAYER_BIT_SET(part, bits) ACTION_LAYER_BITOP(OP_BIT_SET, (part), (bits), 0) 293#define ACTION_DEFAULT_LAYER_BIT_SET(part, bits) ACTION_LAYER_BITOP(OP_BIT_SET, (part), (bits), 0)
297 294
298 295
299/* 296/** \brief Extensions
300 * Extensions
301 */ 297 */
302enum backlight_opt { 298enum backlight_opt {
303 BACKLIGHT_INCREASE = 0, 299 BACKLIGHT_INCREASE = 0,
diff --git a/tmk_core/common/action_layer.c b/tmk_core/common/action_layer.c
index 22331376a..f3cd381ab 100644
--- a/tmk_core/common/action_layer.c
+++ b/tmk_core/common/action_layer.c
@@ -11,16 +11,23 @@
11#endif 11#endif
12 12
13 13
14/* 14/** \brief Default Layer State
15 * Default Layer State
16 */ 15 */
17uint32_t default_layer_state = 0; 16uint32_t default_layer_state = 0;
18 17
18/** \brief Default Layer State Set At Keyboard Level
19 *
20 * FIXME: Needs docs
21 */
19__attribute__((weak)) 22__attribute__((weak))
20uint32_t default_layer_state_set_kb(uint32_t state) { 23uint32_t default_layer_state_set_kb(uint32_t state) {
21 return state; 24 return state;
22} 25}
23 26
27/** \brief Default Layer State Set
28 *
29 * FIXME: Needs docs
30 */
24static void default_layer_state_set(uint32_t state) 31static void default_layer_state_set(uint32_t state)
25{ 32{
26 state = default_layer_state_set_kb(state); 33 state = default_layer_state_set_kb(state);
@@ -31,25 +38,45 @@ static void default_layer_state_set(uint32_t state)
31 clear_keyboard_but_mods(); // To avoid stuck keys 38 clear_keyboard_but_mods(); // To avoid stuck keys
32} 39}
33 40
41/** \brief Default Layer Print
42 *
43 * FIXME: Needs docs
44 */
34void default_layer_debug(void) 45void default_layer_debug(void)
35{ 46{
36 dprintf("%08lX(%u)", default_layer_state, biton32(default_layer_state)); 47 dprintf("%08lX(%u)", default_layer_state, biton32(default_layer_state));
37} 48}
38 49
50/** \brief Default Layer Set
51 *
52 * FIXME: Needs docs
53 */
39void default_layer_set(uint32_t state) 54void default_layer_set(uint32_t state)
40{ 55{
41 default_layer_state_set(state); 56 default_layer_state_set(state);
42} 57}
43 58
44#ifndef NO_ACTION_LAYER 59#ifndef NO_ACTION_LAYER
60/** \brief Default Layer Or
61 *
62 * FIXME: Needs docs
63 */
45void default_layer_or(uint32_t state) 64void default_layer_or(uint32_t state)
46{ 65{
47 default_layer_state_set(default_layer_state | state); 66 default_layer_state_set(default_layer_state | state);
48} 67}
68/** \brief Default Layer And
69 *
70 * FIXME: Needs docs
71 */
49void default_layer_and(uint32_t state) 72void default_layer_and(uint32_t state)
50{ 73{
51 default_layer_state_set(default_layer_state & state); 74 default_layer_state_set(default_layer_state & state);
52} 75}
76/** \brief Default Layer Xor
77 *
78 * FIXME: Needs docs
79 */
53void default_layer_xor(uint32_t state) 80void default_layer_xor(uint32_t state)
54{ 81{
55 default_layer_state_set(default_layer_state ^ state); 82 default_layer_state_set(default_layer_state ^ state);
@@ -58,21 +85,32 @@ void default_layer_xor(uint32_t state)
58 85
59 86
60#ifndef NO_ACTION_LAYER 87#ifndef NO_ACTION_LAYER
61/* 88/** \brief Keymap Layer State
62 * Keymap Layer State
63 */ 89 */
64uint32_t layer_state = 0; 90uint32_t layer_state = 0;
65 91
92/** \brief Layer state set user
93 *
94 * FIXME: Needs docs
95 */
66__attribute__((weak)) 96__attribute__((weak))
67uint32_t layer_state_set_user(uint32_t state) { 97uint32_t layer_state_set_user(uint32_t state) {
68 return state; 98 return state;
69} 99}
70 100
101/** \brief Layer state set keyboard
102 *
103 * FIXME: Needs docs
104 */
71__attribute__((weak)) 105__attribute__((weak))
72uint32_t layer_state_set_kb(uint32_t state) { 106uint32_t layer_state_set_kb(uint32_t state) {
73 return layer_state_set_user(state); 107 return layer_state_set_user(state);
74} 108}
75 109
110/** \brief Layer state set
111 *
112 * FIXME: Needs docs
113 */
76void layer_state_set(uint32_t state) 114void layer_state_set(uint32_t state)
77{ 115{
78 state = layer_state_set_kb(state); 116 state = layer_state_set_kb(state);
@@ -83,54 +121,98 @@ void layer_state_set(uint32_t state)
83 clear_keyboard_but_mods(); // To avoid stuck keys 121 clear_keyboard_but_mods(); // To avoid stuck keys
84} 122}
85 123
124/** \brief Layer clear
125 *
126 * FIXME: Needs docs
127 */
86void layer_clear(void) 128void layer_clear(void)
87{ 129{
88 layer_state_set(0); 130 layer_state_set(0);
89} 131}
90 132
133/** \brief Layer state is
134 *
135 * FIXME: Needs docs
136 */
91bool layer_state_is(uint8_t layer) 137bool layer_state_is(uint8_t layer)
92{ 138{
93 return layer_state_cmp(layer_state, layer); 139 return layer_state_cmp(layer_state, layer);
94} 140}
95 141
142/** \brief Layer state compare
143 *
144 * FIXME: Needs docs
145 */
96bool layer_state_cmp(uint32_t cmp_layer_state, uint8_t layer) { 146bool layer_state_cmp(uint32_t cmp_layer_state, uint8_t layer) {
97 if (!cmp_layer_state) { return layer == 0; } 147 if (!cmp_layer_state) { return layer == 0; }
98 return (cmp_layer_state & (1UL<<layer)) != 0; 148 return (cmp_layer_state & (1UL<<layer)) != 0;
99} 149}
100 150
151/** \brief Layer move
152 *
153 * FIXME: Needs docs
154 */
101void layer_move(uint8_t layer) 155void layer_move(uint8_t layer)
102{ 156{
103 layer_state_set(1UL<<layer); 157 layer_state_set(1UL<<layer);
104} 158}
105 159
160/** \brief Layer on
161 *
162 * FIXME: Needs docs
163 */
106void layer_on(uint8_t layer) 164void layer_on(uint8_t layer)
107{ 165{
108 layer_state_set(layer_state | (1UL<<layer)); 166 layer_state_set(layer_state | (1UL<<layer));
109} 167}
110 168
169/** \brief Layer off
170 *
171 * FIXME: Needs docs
172 */
111void layer_off(uint8_t layer) 173void layer_off(uint8_t layer)
112{ 174{
113 layer_state_set(layer_state & ~(1UL<<layer)); 175 layer_state_set(layer_state & ~(1UL<<layer));
114} 176}
115 177
178/** \brief Layer invert
179 *
180 * FIXME: Needs docs
181 */
116void layer_invert(uint8_t layer) 182void layer_invert(uint8_t layer)
117{ 183{
118 layer_state_set(layer_state ^ (1UL<<layer)); 184 layer_state_set(layer_state ^ (1UL<<layer));
119} 185}
120 186
187/** \brief Layer or
188 *
189 * FIXME: Needs docs
190 */
121void layer_or(uint32_t state) 191void layer_or(uint32_t state)
122{ 192{
123 layer_state_set(layer_state | state); 193 layer_state_set(layer_state | state);
124} 194}
195/** \brief Layer and
196 *
197 * FIXME: Needs docs
198 */
125void layer_and(uint32_t state) 199void layer_and(uint32_t state)
126{ 200{
127 layer_state_set(layer_state & state); 201 layer_state_set(layer_state & state);
128} 202}
203/** \brief Layer xor
204 *
205 * FIXME: Needs docs
206 */
129void layer_xor(uint32_t state) 207void layer_xor(uint32_t state)
130{ 208{
131 layer_state_set(layer_state ^ state); 209 layer_state_set(layer_state ^ state);
132} 210}
133 211
212/** \brief Layer debug printing
213 *
214 * FIXME: Needs docs
215 */
134void layer_debug(void) 216void layer_debug(void)
135{ 217{
136 dprintf("%08lX(%u)", layer_state, biton32(layer_state)); 218 dprintf("%08lX(%u)", layer_state, biton32(layer_state));
@@ -172,7 +254,8 @@ uint8_t read_source_layers_cache(keypos_t key)
172} 254}
173#endif 255#endif
174 256
175/* 257/** \brief Store or get action (FIXME: Needs better summary)
258 *
176 * Make sure the action triggered when the key is released is the same 259 * Make sure the action triggered when the key is released is the same
177 * one as the one triggered on press. It's important for the mod keys 260 * one as the one triggered on press. It's important for the mod keys
178 * when the layer is switched after the down event but before the up 261 * when the layer is switched after the down event but before the up
@@ -201,6 +284,10 @@ action_t store_or_get_action(bool pressed, keypos_t key)
201} 284}
202 285
203 286
287/** \brief Layer switch get layer
288 *
289 * FIXME: Needs docs
290 */
204int8_t layer_switch_get_layer(keypos_t key) 291int8_t layer_switch_get_layer(keypos_t key)
205{ 292{
206#ifndef NO_ACTION_LAYER 293#ifndef NO_ACTION_LAYER
@@ -224,6 +311,10 @@ int8_t layer_switch_get_layer(keypos_t key)
224#endif 311#endif
225} 312}
226 313
314/** \brief Layer switch get layer
315 *
316 * FIXME: Needs docs
317 */
227action_t layer_switch_get_action(keypos_t key) 318action_t layer_switch_get_action(keypos_t key)
228{ 319{
229 return action_for_key(layer_switch_get_layer(key), key); 320 return action_for_key(layer_switch_get_layer(key), key);
diff --git a/tmk_core/common/action_macro.c b/tmk_core/common/action_macro.c
index 7726b1190..12bef2958 100644
--- a/tmk_core/common/action_macro.c
+++ b/tmk_core/common/action_macro.c
@@ -29,6 +29,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
29#ifndef NO_ACTION_MACRO 29#ifndef NO_ACTION_MACRO
30 30
31#define MACRO_READ() (macro = MACRO_GET(macro_p++)) 31#define MACRO_READ() (macro = MACRO_GET(macro_p++))
32/** \brief Action Macro Play
33 *
34 * FIXME: Needs doc
35 */
32void action_macro_play(const macro_t *macro_p) 36void action_macro_play(const macro_t *macro_p)
33{ 37{
34 macro_t macro = END; 38 macro_t macro = END;
diff --git a/tmk_core/common/action_tapping.c b/tmk_core/common/action_tapping.c
index 6280c6c36..8adf013e1 100644
--- a/tmk_core/common/action_tapping.c
+++ b/tmk_core/common/action_tapping.c
@@ -36,6 +36,10 @@ static void debug_tapping_key(void);
36static void debug_waiting_buffer(void); 36static void debug_waiting_buffer(void);
37 37
38 38
39/** \brief Action Tapping Process
40 *
41 * FIXME: Needs doc
42 */
39void action_tapping_process(keyrecord_t record) 43void action_tapping_process(keyrecord_t record)
40{ 44{
41 if (process_tapping(&record)) { 45 if (process_tapping(&record)) {
@@ -70,7 +74,7 @@ void action_tapping_process(keyrecord_t record)
70} 74}
71 75
72 76
73/* Tapping 77/** \brief Tapping
74 * 78 *
75 * Rule: Tap key is typed(pressed and released) within TAPPING_TERM. 79 * Rule: Tap key is typed(pressed and released) within TAPPING_TERM.
76 * (without interfering by typing other key) 80 * (without interfering by typing other key)
@@ -289,8 +293,9 @@ bool process_tapping(keyrecord_t *keyp)
289} 293}
290 294
291 295
292/* 296/** \brief Waiting buffer enq
293 * Waiting buffer 297 *
298 * FIXME: Needs docs
294 */ 299 */
295bool waiting_buffer_enq(keyrecord_t record) 300bool waiting_buffer_enq(keyrecord_t record)
296{ 301{
@@ -310,12 +315,20 @@ bool waiting_buffer_enq(keyrecord_t record)
310 return true; 315 return true;
311} 316}
312 317
318/** \brief Waiting buffer clear
319 *
320 * FIXME: Needs docs
321 */
313void waiting_buffer_clear(void) 322void waiting_buffer_clear(void)
314{ 323{
315 waiting_buffer_head = 0; 324 waiting_buffer_head = 0;
316 waiting_buffer_tail = 0; 325 waiting_buffer_tail = 0;
317} 326}
318 327
328/** \brief Waiting buffer typed
329 *
330 * FIXME: Needs docs
331 */
319bool waiting_buffer_typed(keyevent_t event) 332bool waiting_buffer_typed(keyevent_t event)
320{ 333{
321 for (uint8_t i = waiting_buffer_tail; i != waiting_buffer_head; i = (i + 1) % WAITING_BUFFER_SIZE) { 334 for (uint8_t i = waiting_buffer_tail; i != waiting_buffer_head; i = (i + 1) % WAITING_BUFFER_SIZE) {
@@ -326,6 +339,10 @@ bool waiting_buffer_typed(keyevent_t event)
326 return false; 339 return false;
327} 340}
328 341
342/** \brief Waiting buffer has anykey pressed
343 *
344 * FIXME: Needs docs
345 */
329__attribute__((unused)) 346__attribute__((unused))
330bool waiting_buffer_has_anykey_pressed(void) 347bool waiting_buffer_has_anykey_pressed(void)
331{ 348{
@@ -335,7 +352,10 @@ bool waiting_buffer_has_anykey_pressed(void)
335 return false; 352 return false;
336} 353}
337 354
338/* scan buffer for tapping */ 355/** \brief Scan buffer for tapping
356 *
357 * FIXME: Needs docs
358 */
339void waiting_buffer_scan_tap(void) 359void waiting_buffer_scan_tap(void)
340{ 360{
341 // tapping already is settled 361 // tapping already is settled
@@ -359,14 +379,19 @@ void waiting_buffer_scan_tap(void)
359} 379}
360 380
361 381
362/* 382/** \brief Tapping key debug print
363 * debug print 383 *
384 * FIXME: Needs docs
364 */ 385 */
365static void debug_tapping_key(void) 386static void debug_tapping_key(void)
366{ 387{
367 debug("TAPPING_KEY="); debug_record(tapping_key); debug("\n"); 388 debug("TAPPING_KEY="); debug_record(tapping_key); debug("\n");
368} 389}
369 390
391/** \brief Waiting buffer debug print
392 *
393 * FIXME: Needs docs
394 */
370static void debug_waiting_buffer(void) 395static void debug_waiting_buffer(void)
371{ 396{
372 debug("{ "); 397 debug("{ ");
diff --git a/tmk_core/common/action_util.c b/tmk_core/common/action_util.c
index 148162a51..afd4ae8b2 100644
--- a/tmk_core/common/action_util.c
+++ b/tmk_core/common/action_util.c
@@ -67,12 +67,12 @@ bool has_oneshot_mods_timed_out(void) {
67 67
68/* oneshot layer */ 68/* oneshot layer */
69#ifndef NO_ACTION_ONESHOT 69#ifndef NO_ACTION_ONESHOT
70/* oneshot_layer_data bits 70/** \brief oneshot_layer_data bits
71* LLLL LSSS 71 * LLLL LSSS
72* where: 72 * where:
73* L => are layer bits 73 * L => are layer bits
74* S => oneshot state bits 74 * S => oneshot state bits
75*/ 75 */
76static int8_t oneshot_layer_data = 0; 76static int8_t oneshot_layer_data = 0;
77 77
78inline uint8_t get_oneshot_layer(void) { return oneshot_layer_data >> 3; } 78inline uint8_t get_oneshot_layer(void) { return oneshot_layer_data >> 3; }
@@ -86,7 +86,10 @@ inline bool has_oneshot_layer_timed_out() {
86} 86}
87#endif 87#endif
88 88
89/* Oneshot layer */ 89/** \brief Set oneshot layer
90 *
91 * FIXME: needs doc
92 */
90void set_oneshot_layer(uint8_t layer, uint8_t state) 93void set_oneshot_layer(uint8_t layer, uint8_t state)
91{ 94{
92 oneshot_layer_data = layer << 3 | state; 95 oneshot_layer_data = layer << 3 | state;
@@ -95,12 +98,20 @@ void set_oneshot_layer(uint8_t layer, uint8_t state)
95 oneshot_layer_time = timer_read(); 98 oneshot_layer_time = timer_read();
96#endif 99#endif
97} 100}
101/** \brief Reset oneshot layer
102 *
103 * FIXME: needs doc
104 */
98void reset_oneshot_layer(void) { 105void reset_oneshot_layer(void) {
99 oneshot_layer_data = 0; 106 oneshot_layer_data = 0;
100#if (defined(ONESHOT_TIMEOUT) && (ONESHOT_TIMEOUT > 0)) 107#if (defined(ONESHOT_TIMEOUT) && (ONESHOT_TIMEOUT > 0))
101 oneshot_layer_time = 0; 108 oneshot_layer_time = 0;
102#endif 109#endif
103} 110}
111/** \brief Clear oneshot layer
112 *
113 * FIXME: needs doc
114 */
104void clear_oneshot_layer_state(oneshot_fullfillment_t state) 115void clear_oneshot_layer_state(oneshot_fullfillment_t state)
105{ 116{
106 uint8_t start_state = oneshot_layer_data; 117 uint8_t start_state = oneshot_layer_data;
@@ -112,12 +123,20 @@ void clear_oneshot_layer_state(oneshot_fullfillment_t state)
112#endif 123#endif
113 } 124 }
114} 125}
126/** \brief Is oneshot layer active
127 *
128 * FIXME: needs doc
129 */
115bool is_oneshot_layer_active(void) 130bool is_oneshot_layer_active(void)
116{ 131{
117 return get_oneshot_layer_state(); 132 return get_oneshot_layer_state();
118} 133}
119#endif 134#endif
120 135
136/** \brief Send keyboard report
137 *
138 * FIXME: needs doc
139 */
121void send_keyboard_report(void) { 140void send_keyboard_report(void) {
122 keyboard_report->mods = real_mods; 141 keyboard_report->mods = real_mods;
123 keyboard_report->mods |= weak_mods; 142 keyboard_report->mods |= weak_mods;
@@ -140,29 +159,90 @@ void send_keyboard_report(void) {
140 host_keyboard_send(keyboard_report); 159 host_keyboard_send(keyboard_report);
141} 160}
142 161
143/* modifier */ 162/** \brief Get mods
163 *
164 * FIXME: needs doc
165 */
144uint8_t get_mods(void) { return real_mods; } 166uint8_t get_mods(void) { return real_mods; }
167/** \brief add mods
168 *
169 * FIXME: needs doc
170 */
145void add_mods(uint8_t mods) { real_mods |= mods; } 171void add_mods(uint8_t mods) { real_mods |= mods; }
172/** \brief del mods
173 *
174 * FIXME: needs doc
175 */
146void del_mods(uint8_t mods) { real_mods &= ~mods; } 176void del_mods(uint8_t mods) { real_mods &= ~mods; }
177/** \brief set mods
178 *
179 * FIXME: needs doc
180 */
147void set_mods(uint8_t mods) { real_mods = mods; } 181void set_mods(uint8_t mods) { real_mods = mods; }
182/** \brief clear mods
183 *
184 * FIXME: needs doc
185 */
148void clear_mods(void) { real_mods = 0; } 186void clear_mods(void) { real_mods = 0; }
149 187
150/* weak modifier */ 188/** \brief get weak mods
189 *
190 * FIXME: needs doc
191 */
151uint8_t get_weak_mods(void) { return weak_mods; } 192uint8_t get_weak_mods(void) { return weak_mods; }
193/** \brief add weak mods
194 *
195 * FIXME: needs doc
196 */
152void add_weak_mods(uint8_t mods) { weak_mods |= mods; } 197void add_weak_mods(uint8_t mods) { weak_mods |= mods; }
198/** \brief del weak mods
199 *
200 * FIXME: needs doc
201 */
153void del_weak_mods(uint8_t mods) { weak_mods &= ~mods; } 202void del_weak_mods(uint8_t mods) { weak_mods &= ~mods; }
203/** \brief set weak mods
204 *
205 * FIXME: needs doc
206 */
154void set_weak_mods(uint8_t mods) { weak_mods = mods; } 207void set_weak_mods(uint8_t mods) { weak_mods = mods; }
208/** \brief clear weak mods
209 *
210 * FIXME: needs doc
211 */
155void clear_weak_mods(void) { weak_mods = 0; } 212void clear_weak_mods(void) { weak_mods = 0; }
156 213
157/* macro modifier */ 214/* macro modifier */
215/** \brief get macro mods
216 *
217 * FIXME: needs doc
218 */
158uint8_t get_macro_mods(void) { return macro_mods; } 219uint8_t get_macro_mods(void) { return macro_mods; }
220/** \brief add macro mods
221 *
222 * FIXME: needs doc
223 */
159void add_macro_mods(uint8_t mods) { macro_mods |= mods; } 224void add_macro_mods(uint8_t mods) { macro_mods |= mods; }
225/** \brief del macro mods
226 *
227 * FIXME: needs doc
228 */
160void del_macro_mods(uint8_t mods) { macro_mods &= ~mods; } 229void del_macro_mods(uint8_t mods) { macro_mods &= ~mods; }
230/** \brief set macro mods
231 *
232 * FIXME: needs doc
233 */
161void set_macro_mods(uint8_t mods) { macro_mods = mods; } 234void set_macro_mods(uint8_t mods) { macro_mods = mods; }
235/** \brief clear macro mods
236 *
237 * FIXME: needs doc
238 */
162void clear_macro_mods(void) { macro_mods = 0; } 239void clear_macro_mods(void) { macro_mods = 0; }
163 240
164/* Oneshot modifier */
165#ifndef NO_ACTION_ONESHOT 241#ifndef NO_ACTION_ONESHOT
242/** \brief set oneshot mods
243 *
244 * FIXME: needs doc
245 */
166void set_oneshot_mods(uint8_t mods) 246void set_oneshot_mods(uint8_t mods)
167{ 247{
168 oneshot_mods = mods; 248 oneshot_mods = mods;
@@ -170,6 +250,10 @@ void set_oneshot_mods(uint8_t mods)
170 oneshot_time = timer_read(); 250 oneshot_time = timer_read();
171#endif 251#endif
172} 252}
253/** \brief clear oneshot mods
254 *
255 * FIXME: needs doc
256 */
173void clear_oneshot_mods(void) 257void clear_oneshot_mods(void)
174{ 258{
175 oneshot_mods = 0; 259 oneshot_mods = 0;
@@ -177,14 +261,19 @@ void clear_oneshot_mods(void)
177 oneshot_time = 0; 261 oneshot_time = 0;
178#endif 262#endif
179} 263}
264/** \brief get oneshot mods
265 *
266 * FIXME: needs doc
267 */
180uint8_t get_oneshot_mods(void) 268uint8_t get_oneshot_mods(void)
181{ 269{
182 return oneshot_mods; 270 return oneshot_mods;
183} 271}
184#endif 272#endif
185 273
186/* 274/** \brief inspect keyboard state
187 * inspect keyboard state 275 *
276 * FIXME: needs doc
188 */ 277 */
189uint8_t has_anymod(void) 278uint8_t has_anymod(void)
190{ 279{
diff --git a/tmk_core/common/avr/bootloader.c b/tmk_core/common/avr/bootloader.c
index ee150817c..d89c8d768 100644
--- a/tmk_core/common/avr/bootloader.c
+++ b/tmk_core/common/avr/bootloader.c
@@ -13,12 +13,11 @@
13#endif 13#endif
14 14
15 15
16/* Bootloader Size in *bytes* 16/** \brief Bootloader Size in *bytes*
17 * 17 *
18 * AVR Boot section size are defined by setting BOOTSZ fuse in fact. Consult with your MCU datasheet. 18 * AVR Boot section size are defined by setting BOOTSZ fuse in fact. Consult with your MCU datasheet.
19 * Note that 'Word'(2 bytes) size and address are used in datasheet while TMK uses 'Byte'. 19 * Note that 'Word'(2 bytes) size and address are used in datasheet while TMK uses 'Byte'.
20 * 20 *
21 *
22 * Size of Bootloaders in bytes: 21 * Size of Bootloaders in bytes:
23 * Atmel DFU loader(ATmega32U4) 4096 22 * Atmel DFU loader(ATmega32U4) 4096
24 * Atmel DFU loader(AT90USB128) 8192 23 * Atmel DFU loader(AT90USB128) 8192
@@ -28,10 +27,8 @@
28 * Teensy halfKay(ATmega32U4) 512 27 * Teensy halfKay(ATmega32U4) 512
29 * Teensy++ halfKay(AT90USB128) 1024 28 * Teensy++ halfKay(AT90USB128) 1024
30 * 29 *
31 *
32 * AVR Boot section is located at the end of Flash memory like the followings. 30 * AVR Boot section is located at the end of Flash memory like the followings.
33 * 31 *
34 *
35 * byte Atmel/LUFA(ATMega32u4) byte Atmel(AT90SUB128) 32 * byte Atmel/LUFA(ATMega32u4) byte Atmel(AT90SUB128)
36 * 0x0000 +---------------+ 0x00000 +---------------+ 33 * 0x0000 +---------------+ 0x00000 +---------------+
37 * | | | | 34 * | | | |
@@ -57,7 +54,6 @@
57 * | Bootloader | 512B | Bootloader | 1KB 54 * | Bootloader | 512B | Bootloader | 1KB
58 * 0x7FFF +---------------+ 0x1FFFF +---------------+ 55 * 0x7FFF +---------------+ 0x1FFFF +---------------+
59 */ 56 */
60
61#define FLASH_SIZE (FLASHEND + 1L) 57#define FLASH_SIZE (FLASHEND + 1L)
62 58
63#if !defined(BOOTLOADER_SIZE) 59#if !defined(BOOTLOADER_SIZE)
@@ -69,14 +65,17 @@
69#define BOOT_SIZE_1024 0b010 65#define BOOT_SIZE_1024 0b010
70#define BOOT_SIZE_2048 0b000 66#define BOOT_SIZE_2048 0b000
71 67
72/* 68/** \brief Entering the Bootloader via Software
73 * Entering the Bootloader via Software 69 *
74 * http://www.fourwalledcubicle.com/files/LUFA/Doc/120730/html/_page__software_bootloader_start.html 70 * http://www.fourwalledcubicle.com/files/LUFA/Doc/120730/html/_page__software_bootloader_start.html
75 */ 71 */
76#define BOOTLOADER_RESET_KEY 0xB007B007 72#define BOOTLOADER_RESET_KEY 0xB007B007
77uint32_t reset_key __attribute__ ((section (".noinit"))); 73uint32_t reset_key __attribute__ ((section (".noinit")));
78 74
79/* initialize MCU status by watchdog reset */ 75/** \brief initialize MCU status by watchdog reset
76 *
77 * FIXME: needs doc
78 */
80void bootloader_jump(void) { 79void bootloader_jump(void) {
81 80
82 #if !defined(BOOTLOADER_SIZE) 81 #if !defined(BOOTLOADER_SIZE)
diff --git a/tmk_core/common/avr/sleep_led.c b/tmk_core/common/avr/sleep_led.c
index dab3eb0f3..0cb774c81 100644
--- a/tmk_core/common/avr/sleep_led.c
+++ b/tmk_core/common/avr/sleep_led.c
@@ -18,6 +18,10 @@
18 */ 18 */
19#define SLEEP_LED_TIMER_TOP F_CPU/(256*64) 19#define SLEEP_LED_TIMER_TOP F_CPU/(256*64)
20 20
21/** \brief Sleep LED initialization
22 *
23 * FIXME: needs doc
24 */
21void sleep_led_init(void) 25void sleep_led_init(void)
22{ 26{
23 /* Timer1 setup */ 27 /* Timer1 setup */
@@ -33,18 +37,30 @@ void sleep_led_init(void)
33 SREG = sreg; 37 SREG = sreg;
34} 38}
35 39
40/** \brief Sleep LED enable
41 *
42 * FIXME: needs doc
43 */
36void sleep_led_enable(void) 44void sleep_led_enable(void)
37{ 45{
38 /* Enable Compare Match Interrupt */ 46 /* Enable Compare Match Interrupt */
39 TIMSK1 |= _BV(OCIE1A); 47 TIMSK1 |= _BV(OCIE1A);
40} 48}
41 49
50/** \brief Sleep LED disable
51 *
52 * FIXME: needs doc
53 */
42void sleep_led_disable(void) 54void sleep_led_disable(void)
43{ 55{
44 /* Disable Compare Match Interrupt */ 56 /* Disable Compare Match Interrupt */
45 TIMSK1 &= ~_BV(OCIE1A); 57 TIMSK1 &= ~_BV(OCIE1A);
46} 58}
47 59
60/** \brief Sleep LED toggle
61 *
62 * FIXME: needs doc
63 */
48void sleep_led_toggle(void) 64void sleep_led_toggle(void)
49{ 65{
50 /* Disable Compare Match Interrupt */ 66 /* Disable Compare Match Interrupt */
@@ -52,7 +68,8 @@ void sleep_led_toggle(void)
52} 68}
53 69
54 70
55/* Breathing Sleep LED brighness(PWM On period) table 71/** \brief Breathing Sleep LED brighness(PWM On period) table
72 *
56 * (64[steps] * 4[duration]) / 64[PWM periods/s] = 4 second breath cycle 73 * (64[steps] * 4[duration]) / 64[PWM periods/s] = 4 second breath cycle
57 * 74 *
58 * http://www.wolframalpha.com/input/?i=%28sin%28+x%2F64*pi%29**8+*+255%2C+x%3D0+to+63 75 * http://www.wolframalpha.com/input/?i=%28sin%28+x%2F64*pi%29**8+*+255%2C+x%3D0+to+63
diff --git a/tmk_core/common/avr/suspend.c b/tmk_core/common/avr/suspend.c
index 213f03f6f..4cdd6a420 100644
--- a/tmk_core/common/avr/suspend.c
+++ b/tmk_core/common/avr/suspend.c
@@ -41,6 +41,10 @@ __asm__ __volatile__ ( \
41) 41)
42 42
43 43
44/** \brief Suspend idle
45 *
46 * FIXME: needs doc
47 */
44void suspend_idle(uint8_t time) 48void suspend_idle(uint8_t time)
45{ 49{
46 cli(); 50 cli();
@@ -52,7 +56,8 @@ void suspend_idle(uint8_t time)
52} 56}
53 57
54#ifndef NO_SUSPEND_POWER_DOWN 58#ifndef NO_SUSPEND_POWER_DOWN
55/* Power down MCU with watchdog timer 59/** \brief Power down MCU with watchdog timer
60 *
56 * wdto: watchdog timer timeout defined in <avr/wdt.h> 61 * wdto: watchdog timer timeout defined in <avr/wdt.h>
57 * WDTO_15MS 62 * WDTO_15MS
58 * WDTO_30MS 63 * WDTO_30MS
@@ -67,6 +72,10 @@ void suspend_idle(uint8_t time)
67 */ 72 */
68static uint8_t wdt_timeout = 0; 73static uint8_t wdt_timeout = 0;
69 74
75/** \brief Power down
76 *
77 * FIXME: needs doc
78 */
70static void power_down(uint8_t wdto) 79static void power_down(uint8_t wdto)
71{ 80{
72#ifdef PROTOCOL_LUFA 81#ifdef PROTOCOL_LUFA
@@ -111,6 +120,10 @@ static void power_down(uint8_t wdto)
111} 120}
112#endif 121#endif
113 122
123/** \brief Suspend power down
124 *
125 * FIXME: needs doc
126 */
114void suspend_power_down(void) 127void suspend_power_down(void)
115{ 128{
116#ifndef NO_SUSPEND_POWER_DOWN 129#ifndef NO_SUSPEND_POWER_DOWN
@@ -131,7 +144,10 @@ bool suspend_wakeup_condition(void)
131 return false; 144 return false;
132} 145}
133 146
134// run immediately after wakeup 147/** \brief run immediately after wakeup
148 *
149 * FIXME: needs doc
150 */
135void suspend_wakeup_init(void) 151void suspend_wakeup_init(void)
136{ 152{
137 // clear keyboard state 153 // clear keyboard state
diff --git a/tmk_core/common/avr/timer.c b/tmk_core/common/avr/timer.c
index 369015200..b7d4f060e 100644
--- a/tmk_core/common/avr/timer.c
+++ b/tmk_core/common/avr/timer.c
@@ -27,6 +27,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
27// NOTE: union { uint32_t timer32; struct { uint16_t dummy; uint16_t timer16; }} 27// NOTE: union { uint32_t timer32; struct { uint16_t dummy; uint16_t timer16; }}
28volatile uint32_t timer_count; 28volatile uint32_t timer_count;
29 29
30/** \brief timer initialization
31 *
32 * FIXME: needs doc
33 */
30void timer_init(void) 34void timer_init(void)
31{ 35{
32#if TIMER_PRESCALER == 1 36#if TIMER_PRESCALER == 1
@@ -60,6 +64,10 @@ void timer_init(void)
60#endif 64#endif
61} 65}
62 66
67/** \brief timer clear
68 *
69 * FIXME: needs doc
70 */
63inline 71inline
64void timer_clear(void) 72void timer_clear(void)
65{ 73{
@@ -68,6 +76,10 @@ void timer_clear(void)
68 } 76 }
69} 77}
70 78
79/** \brief timer read
80 *
81 * FIXME: needs doc
82 */
71inline 83inline
72uint16_t timer_read(void) 84uint16_t timer_read(void)
73{ 85{
@@ -80,6 +92,10 @@ uint16_t timer_read(void)
80 return (t & 0xFFFF); 92 return (t & 0xFFFF);
81} 93}
82 94
95/** \brief timer read32
96 *
97 * FIXME: needs doc
98 */
83inline 99inline
84uint32_t timer_read32(void) 100uint32_t timer_read32(void)
85{ 101{
@@ -92,6 +108,10 @@ uint32_t timer_read32(void)
92 return t; 108 return t;
93} 109}
94 110
111/** \brief timer elapsed
112 *
113 * FIXME: needs doc
114 */
95inline 115inline
96uint16_t timer_elapsed(uint16_t last) 116uint16_t timer_elapsed(uint16_t last)
97{ 117{
@@ -104,6 +124,10 @@ uint16_t timer_elapsed(uint16_t last)
104 return TIMER_DIFF_16((t & 0xFFFF), last); 124 return TIMER_DIFF_16((t & 0xFFFF), last);
105} 125}
106 126
127/** \brief timer elapsed32
128 *
129 * FIXME: needs doc
130 */
107inline 131inline
108uint32_t timer_elapsed32(uint32_t last) 132uint32_t timer_elapsed32(uint32_t last)
109{ 133{
diff --git a/tmk_core/common/backlight.c b/tmk_core/common/backlight.c
index 12f75b38a..3e29aacc4 100644
--- a/tmk_core/common/backlight.c
+++ b/tmk_core/common/backlight.c
@@ -21,6 +21,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
21 21
22backlight_config_t backlight_config; 22backlight_config_t backlight_config;
23 23
24/** \brief Backlight initialization
25 *
26 * FIXME: needs doc
27 */
24void backlight_init(void) 28void backlight_init(void)
25{ 29{
26 /* check signature */ 30 /* check signature */
@@ -34,6 +38,10 @@ void backlight_init(void)
34 backlight_set(backlight_config.enable ? backlight_config.level : 0); 38 backlight_set(backlight_config.enable ? backlight_config.level : 0);
35} 39}
36 40
41/** \brief Backlight increase
42 *
43 * FIXME: needs doc
44 */
37void backlight_increase(void) 45void backlight_increase(void)
38{ 46{
39 if(backlight_config.level < BACKLIGHT_LEVELS) 47 if(backlight_config.level < BACKLIGHT_LEVELS)
@@ -46,6 +54,10 @@ void backlight_increase(void)
46 backlight_set(backlight_config.level); 54 backlight_set(backlight_config.level);
47} 55}
48 56
57/** \brief Backlight decrease
58 *
59 * FIXME: needs doc
60 */
49void backlight_decrease(void) 61void backlight_decrease(void)
50{ 62{
51 if(backlight_config.level > 0) 63 if(backlight_config.level > 0)
@@ -58,6 +70,10 @@ void backlight_decrease(void)
58 backlight_set(backlight_config.level); 70 backlight_set(backlight_config.level);
59} 71}
60 72
73/** \brief Backlight toggle
74 *
75 * FIXME: needs doc
76 */
61void backlight_toggle(void) 77void backlight_toggle(void)
62{ 78{
63 backlight_config.enable ^= 1; 79 backlight_config.enable ^= 1;
@@ -68,6 +84,10 @@ void backlight_toggle(void)
68 backlight_set(backlight_config.enable ? backlight_config.level : 0); 84 backlight_set(backlight_config.enable ? backlight_config.level : 0);
69} 85}
70 86
87/** \brief Backlight step through levels
88 *
89 * FIXME: needs doc
90 */
71void backlight_step(void) 91void backlight_step(void)
72{ 92{
73 backlight_config.level++; 93 backlight_config.level++;
@@ -81,6 +101,10 @@ void backlight_step(void)
81 backlight_set(backlight_config.level); 101 backlight_set(backlight_config.level);
82} 102}
83 103
104/** \brief Backlight set level
105 *
106 * FIXME: needs doc
107 */
84void backlight_level(uint8_t level) 108void backlight_level(uint8_t level)
85{ 109{
86 if (level > BACKLIGHT_LEVELS) 110 if (level > BACKLIGHT_LEVELS)
@@ -91,6 +115,10 @@ void backlight_level(uint8_t level)
91 backlight_set(backlight_config.level); 115 backlight_set(backlight_config.level);
92} 116}
93 117
118/** \brief Get backlight level
119 *
120 * FIXME: needs doc
121 */
94uint8_t get_backlight_level(void) 122uint8_t get_backlight_level(void)
95{ 123{
96 return backlight_config.level; 124 return backlight_config.level;
diff --git a/tmk_core/common/bootmagic.c b/tmk_core/common/bootmagic.c
index 2c6bcbae5..9f79fb8ee 100644
--- a/tmk_core/common/bootmagic.c
+++ b/tmk_core/common/bootmagic.c
@@ -12,6 +12,10 @@
12 12
13keymap_config_t keymap_config; 13keymap_config_t keymap_config;
14 14
15/** \brief Bootmagic
16 *
17 * FIXME: needs doc
18 */
15void bootmagic(void) 19void bootmagic(void)
16{ 20{
17 /* check signature */ 21 /* check signature */
@@ -102,6 +106,10 @@ void bootmagic(void)
102 } 106 }
103} 107}
104 108
109/** \brief Scan Keycode
110 *
111 * FIXME: needs doc
112 */
105static bool scan_keycode(uint8_t keycode) 113static bool scan_keycode(uint8_t keycode)
106{ 114{
107 for (uint8_t r = 0; r < MATRIX_ROWS; r++) { 115 for (uint8_t r = 0; r < MATRIX_ROWS; r++) {
@@ -117,9 +125,13 @@ static bool scan_keycode(uint8_t keycode)
117 return false; 125 return false;
118} 126}
119 127
128/** \brief Bootmagic Scan Keycode
129 *
130 * FIXME: needs doc
131 */
120bool bootmagic_scan_keycode(uint8_t keycode) 132bool bootmagic_scan_keycode(uint8_t keycode)
121{ 133{
122 if (!scan_keycode(BOOTMAGIC_KEY_SALT)) return false; 134 if (!scan_keycode(BOOTMAGIC_KEY_SALT)) return false;
123 135
124 return scan_keycode(keycode); 136 return scan_keycode(keycode);
125} \ No newline at end of file 137}
diff --git a/tmk_core/common/bootmagic.h b/tmk_core/common/bootmagic.h
index 8f6618f4b..f3ea6a24d 100644
--- a/tmk_core/common/bootmagic.h
+++ b/tmk_core/common/bootmagic.h
@@ -2,6 +2,8 @@
2#define BOOTMAGIC_H 2#define BOOTMAGIC_H
3 3
4 4
5/* FIXME: Add special doxygen comments for defines here. */
6
5/* bootmagic salt key */ 7/* bootmagic salt key */
6#ifndef BOOTMAGIC_KEY_SALT 8#ifndef BOOTMAGIC_KEY_SALT
7#define BOOTMAGIC_KEY_SALT KC_SPACE 9#define BOOTMAGIC_KEY_SALT KC_SPACE
diff --git a/tmk_core/common/chibios/bootloader.c b/tmk_core/common/chibios/bootloader.c
index 2dd3ade34..f9895237b 100644
--- a/tmk_core/common/chibios/bootloader.c
+++ b/tmk_core/common/chibios/bootloader.c
@@ -13,11 +13,19 @@ extern uint32_t __ram0_end__;
13#define MAGIC_ADDR (unsigned long*)(SYMVAL(__ram0_end__) - 4) 13#define MAGIC_ADDR (unsigned long*)(SYMVAL(__ram0_end__) - 4)
14 14
15 15
16/** \brief Jump to the bootloader
17 *
18 * FIXME: needs doc
19 */
16void bootloader_jump(void) { 20void bootloader_jump(void) {
17 *MAGIC_ADDR = BOOTLOADER_MAGIC; // set magic flag => reset handler will jump into boot loader 21 *MAGIC_ADDR = BOOTLOADER_MAGIC; // set magic flag => reset handler will jump into boot loader
18 NVIC_SystemReset(); 22 NVIC_SystemReset();
19} 23}
20 24
25/** \brief Enter bootloader mode if requested
26 *
27 * FIXME: needs doc
28 */
21void enter_bootloader_mode_if_requested(void) { 29void enter_bootloader_mode_if_requested(void) {
22 unsigned long* check = MAGIC_ADDR; 30 unsigned long* check = MAGIC_ADDR;
23 if(*check == BOOTLOADER_MAGIC) { 31 if(*check == BOOTLOADER_MAGIC) {
diff --git a/tmk_core/common/chibios/eeprom.c b/tmk_core/common/chibios/eeprom.c
index 5ff8ee86f..9061b790c 100644
--- a/tmk_core/common/chibios/eeprom.c
+++ b/tmk_core/common/chibios/eeprom.c
@@ -79,6 +79,10 @@
79 #define EEESIZE 0x39 79 #define EEESIZE 0x39
80#endif 80#endif
81 81
82/** \brief eeprom initialization
83 *
84 * FIXME: needs doc
85 */
82void eeprom_initialize(void) 86void eeprom_initialize(void)
83{ 87{
84 uint32_t count=0; 88 uint32_t count=0;
@@ -111,6 +115,10 @@ void eeprom_initialize(void)
111 115
112#define FlexRAM ((uint8_t *)0x14000000) 116#define FlexRAM ((uint8_t *)0x14000000)
113 117
118/** \brief eeprom read byte
119 *
120 * FIXME: needs doc
121 */
114uint8_t eeprom_read_byte(const uint8_t *addr) 122uint8_t eeprom_read_byte(const uint8_t *addr)
115{ 123{
116 uint32_t offset = (uint32_t)addr; 124 uint32_t offset = (uint32_t)addr;
@@ -119,6 +127,10 @@ uint8_t eeprom_read_byte(const uint8_t *addr)
119 return FlexRAM[offset]; 127 return FlexRAM[offset];
120} 128}
121 129
130/** \brief eeprom read word
131 *
132 * FIXME: needs doc
133 */
122uint16_t eeprom_read_word(const uint16_t *addr) 134uint16_t eeprom_read_word(const uint16_t *addr)
123{ 135{
124 uint32_t offset = (uint32_t)addr; 136 uint32_t offset = (uint32_t)addr;
@@ -127,6 +139,10 @@ uint16_t eeprom_read_word(const uint16_t *addr)
127 return *(uint16_t *)(&FlexRAM[offset]); 139 return *(uint16_t *)(&FlexRAM[offset]);
128} 140}
129 141
142/** \brief eeprom read dword
143 *
144 * FIXME: needs doc
145 */
130uint32_t eeprom_read_dword(const uint32_t *addr) 146uint32_t eeprom_read_dword(const uint32_t *addr)
131{ 147{
132 uint32_t offset = (uint32_t)addr; 148 uint32_t offset = (uint32_t)addr;
@@ -135,6 +151,10 @@ uint32_t eeprom_read_dword(const uint32_t *addr)
135 return *(uint32_t *)(&FlexRAM[offset]); 151 return *(uint32_t *)(&FlexRAM[offset]);
136} 152}
137 153
154/** \brief eeprom read block
155 *
156 * FIXME: needs doc
157 */
138void eeprom_read_block(void *buf, const void *addr, uint32_t len) 158void eeprom_read_block(void *buf, const void *addr, uint32_t len)
139{ 159{
140 uint32_t offset = (uint32_t)addr; 160 uint32_t offset = (uint32_t)addr;
@@ -148,11 +168,19 @@ void eeprom_read_block(void *buf, const void *addr, uint32_t len)
148 } 168 }
149} 169}
150 170
171/** \brief eeprom is ready
172 *
173 * FIXME: needs doc
174 */
151int eeprom_is_ready(void) 175int eeprom_is_ready(void)
152{ 176{
153 return (FTFL->FCNFG & FTFL_FCNFG_EEERDY) ? 1 : 0; 177 return (FTFL->FCNFG & FTFL_FCNFG_EEERDY) ? 1 : 0;
154} 178}
155 179
180/** \brief flexram wait
181 *
182 * FIXME: needs doc
183 */
156static void flexram_wait(void) 184static void flexram_wait(void)
157{ 185{
158 while (!(FTFL->FCNFG & FTFL_FCNFG_EEERDY)) { 186 while (!(FTFL->FCNFG & FTFL_FCNFG_EEERDY)) {
@@ -160,6 +188,10 @@ static void flexram_wait(void)
160 } 188 }
161} 189}
162 190
191/** \brief eeprom_write_byte
192 *
193 * FIXME: needs doc
194 */
163void eeprom_write_byte(uint8_t *addr, uint8_t value) 195void eeprom_write_byte(uint8_t *addr, uint8_t value)
164{ 196{
165 uint32_t offset = (uint32_t)addr; 197 uint32_t offset = (uint32_t)addr;
@@ -172,6 +204,10 @@ void eeprom_write_byte(uint8_t *addr, uint8_t value)
172 } 204 }
173} 205}
174 206
207/** \brief eeprom write word
208 *
209 * FIXME: needs doc
210 */
175void eeprom_write_word(uint16_t *addr, uint16_t value) 211void eeprom_write_word(uint16_t *addr, uint16_t value)
176{ 212{
177 uint32_t offset = (uint32_t)addr; 213 uint32_t offset = (uint32_t)addr;
@@ -199,6 +235,10 @@ void eeprom_write_word(uint16_t *addr, uint16_t value)
199#endif 235#endif
200} 236}
201 237
238/** \brief eeprom write dword
239 *
240 * FIXME: needs doc
241 */
202void eeprom_write_dword(uint32_t *addr, uint32_t value) 242void eeprom_write_dword(uint32_t *addr, uint32_t value)
203{ 243{
204 uint32_t offset = (uint32_t)addr; 244 uint32_t offset = (uint32_t)addr;
@@ -242,6 +282,10 @@ void eeprom_write_dword(uint32_t *addr, uint32_t value)
242#endif 282#endif
243} 283}
244 284
285/** \brief eeprom write block
286 *
287 * FIXME: needs doc
288 */
245void eeprom_write_block(const void *buf, void *addr, uint32_t len) 289void eeprom_write_block(const void *buf, void *addr, uint32_t len)
246{ 290{
247 uint32_t offset = (uint32_t)addr; 291 uint32_t offset = (uint32_t)addr;
diff --git a/tmk_core/common/chibios/suspend.c b/tmk_core/common/chibios/suspend.c
index 7c3c75387..32ef773e2 100644
--- a/tmk_core/common/chibios/suspend.c
+++ b/tmk_core/common/chibios/suspend.c
@@ -12,11 +12,19 @@
12#include "suspend.h" 12#include "suspend.h"
13#include "wait.h" 13#include "wait.h"
14 14
15/** \brief suspend idle
16 *
17 * FIXME: needs doc
18 */
15void suspend_idle(uint8_t time) { 19void suspend_idle(uint8_t time) {
16 // TODO: this is not used anywhere - what units is 'time' in? 20 // TODO: this is not used anywhere - what units is 'time' in?
17 wait_ms(time); 21 wait_ms(time);
18} 22}
19 23
24/** \brief suspend power down
25 *
26 * FIXME: needs doc
27 */
20void suspend_power_down(void) { 28void suspend_power_down(void) {
21 // TODO: figure out what to power down and how 29 // TODO: figure out what to power down and how
22 // shouldn't power down TPM/FTM if we want a breathing LED 30 // shouldn't power down TPM/FTM if we want a breathing LED
@@ -28,6 +36,10 @@ void suspend_power_down(void) {
28 wait_ms(17); 36 wait_ms(17);
29} 37}
30 38
39/** \brief suspend wakeup condition
40 *
41 * FIXME: needs doc
42 */
31__attribute__ ((weak)) void matrix_power_up(void) {} 43__attribute__ ((weak)) void matrix_power_up(void) {}
32__attribute__ ((weak)) void matrix_power_down(void) {} 44__attribute__ ((weak)) void matrix_power_down(void) {}
33bool suspend_wakeup_condition(void) 45bool suspend_wakeup_condition(void)
@@ -41,7 +53,11 @@ bool suspend_wakeup_condition(void)
41 return false; 53 return false;
42} 54}
43 55
44// run immediately after wakeup 56/** \brief suspend wakeup condition
57 *
58 * run immediately after wakeup
59 * FIXME: needs doc
60 */
45void suspend_wakeup_init(void) 61void suspend_wakeup_init(void)
46{ 62{
47 // clear keyboard state 63 // clear keyboard state
diff --git a/tmk_core/common/command.h b/tmk_core/common/command.h
index a729e4b1e..d9d89ba0f 100644
--- a/tmk_core/common/command.h
+++ b/tmk_core/common/command.h
@@ -18,6 +18,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
18#ifndef COMMAND_H 18#ifndef COMMAND_H
19#define COMMAND 19#define COMMAND
20 20
21/* FIXME: Add doxygen comments for the behavioral defines in here. */
22
21/* TODO: Refactoring */ 23/* TODO: Refactoring */
22typedef enum { ONESHOT, CONSOLE, MOUSEKEY } command_state_t; 24typedef enum { ONESHOT, CONSOLE, MOUSEKEY } command_state_t;
23extern command_state_t command_state; 25extern command_state_t command_state;
@@ -154,4 +156,4 @@ bool command_proc(uint8_t code);
154#define XMAGIC_KC(key) KC_##key 156#define XMAGIC_KC(key) KC_##key
155#define MAGIC_KC(key) XMAGIC_KC(key) 157#define MAGIC_KC(key) XMAGIC_KC(key)
156 158
157#endif \ No newline at end of file 159#endif
diff --git a/tmk_core/common/eeconfig.c b/tmk_core/common/eeconfig.c
index e2eb4a38e..91c18e2e6 100644
--- a/tmk_core/common/eeconfig.c
+++ b/tmk_core/common/eeconfig.c
@@ -3,6 +3,10 @@
3#include "eeprom.h" 3#include "eeprom.h"
4#include "eeconfig.h" 4#include "eeconfig.h"
5 5
6/** \brief eeconfig initialization
7 *
8 * FIXME: needs doc
9 */
6void eeconfig_init(void) 10void eeconfig_init(void)
7{ 11{
8 eeprom_update_word(EECONFIG_MAGIC, EECONFIG_MAGIC_NUMBER); 12 eeprom_update_word(EECONFIG_MAGIC, EECONFIG_MAGIC_NUMBER);
@@ -24,36 +28,88 @@ void eeconfig_init(void)
24#endif 28#endif
25} 29}
26 30
31/** \brief eeconfig enable
32 *
33 * FIXME: needs doc
34 */
27void eeconfig_enable(void) 35void eeconfig_enable(void)
28{ 36{
29 eeprom_update_word(EECONFIG_MAGIC, EECONFIG_MAGIC_NUMBER); 37 eeprom_update_word(EECONFIG_MAGIC, EECONFIG_MAGIC_NUMBER);
30} 38}
31 39
40/** \brief eeconfig disable
41 *
42 * FIXME: needs doc
43 */
32void eeconfig_disable(void) 44void eeconfig_disable(void)
33{ 45{
34 eeprom_update_word(EECONFIG_MAGIC, 0xFFFF); 46 eeprom_update_word(EECONFIG_MAGIC, 0xFFFF);
35} 47}
36 48
49/** \brief eeconfig is enabled
50 *
51 * FIXME: needs doc
52 */
37bool eeconfig_is_enabled(void) 53bool eeconfig_is_enabled(void)
38{ 54{
39 return (eeprom_read_word(EECONFIG_MAGIC) == EECONFIG_MAGIC_NUMBER); 55 return (eeprom_read_word(EECONFIG_MAGIC) == EECONFIG_MAGIC_NUMBER);
40} 56}
41 57
58/** \brief eeconfig read debug
59 *
60 * FIXME: needs doc
61 */
42uint8_t eeconfig_read_debug(void) { return eeprom_read_byte(EECONFIG_DEBUG); } 62uint8_t eeconfig_read_debug(void) { return eeprom_read_byte(EECONFIG_DEBUG); }
63/** \brief eeconfig update debug
64 *
65 * FIXME: needs doc
66 */
43void eeconfig_update_debug(uint8_t val) { eeprom_update_byte(EECONFIG_DEBUG, val); } 67void eeconfig_update_debug(uint8_t val) { eeprom_update_byte(EECONFIG_DEBUG, val); }
44 68
69/** \brief eeconfig read default layer
70 *
71 * FIXME: needs doc
72 */
45uint8_t eeconfig_read_default_layer(void) { return eeprom_read_byte(EECONFIG_DEFAULT_LAYER); } 73uint8_t eeconfig_read_default_layer(void) { return eeprom_read_byte(EECONFIG_DEFAULT_LAYER); }
74/** \brief eeconfig update default layer
75 *
76 * FIXME: needs doc
77 */
46void eeconfig_update_default_layer(uint8_t val) { eeprom_update_byte(EECONFIG_DEFAULT_LAYER, val); } 78void eeconfig_update_default_layer(uint8_t val) { eeprom_update_byte(EECONFIG_DEFAULT_LAYER, val); }
47 79
80/** \brief eeconfig read keymap
81 *
82 * FIXME: needs doc
83 */
48uint8_t eeconfig_read_keymap(void) { return eeprom_read_byte(EECONFIG_KEYMAP); } 84uint8_t eeconfig_read_keymap(void) { return eeprom_read_byte(EECONFIG_KEYMAP); }
85/** \brief eeconfig update keymap
86 *
87 * FIXME: needs doc
88 */
49void eeconfig_update_keymap(uint8_t val) { eeprom_update_byte(EECONFIG_KEYMAP, val); } 89void eeconfig_update_keymap(uint8_t val) { eeprom_update_byte(EECONFIG_KEYMAP, val); }
50 90
51#ifdef BACKLIGHT_ENABLE 91#ifdef BACKLIGHT_ENABLE
92/** \brief eeconfig read backlight
93 *
94 * FIXME: needs doc
95 */
52uint8_t eeconfig_read_backlight(void) { return eeprom_read_byte(EECONFIG_BACKLIGHT); } 96uint8_t eeconfig_read_backlight(void) { return eeprom_read_byte(EECONFIG_BACKLIGHT); }
97/** \brief eeconfig update backlight
98 *
99 * FIXME: needs doc
100 */
53void eeconfig_update_backlight(uint8_t val) { eeprom_update_byte(EECONFIG_BACKLIGHT, val); } 101void eeconfig_update_backlight(uint8_t val) { eeprom_update_byte(EECONFIG_BACKLIGHT, val); }
54#endif 102#endif
55 103
56#ifdef AUDIO_ENABLE 104#ifdef AUDIO_ENABLE
105/** \brief eeconfig read audio
106 *
107 * FIXME: needs doc
108 */
57uint8_t eeconfig_read_audio(void) { return eeprom_read_byte(EECONFIG_AUDIO); } 109uint8_t eeconfig_read_audio(void) { return eeprom_read_byte(EECONFIG_AUDIO); }
110/** \brief eeconfig update audio
111 *
112 * FIXME: needs doc
113 */
58void eeconfig_update_audio(uint8_t val) { eeprom_update_byte(EECONFIG_AUDIO, val); } 114void eeconfig_update_audio(uint8_t val) { eeprom_update_byte(EECONFIG_AUDIO, val); }
59#endif 115#endif
diff --git a/tmk_core/common/keyboard.c b/tmk_core/common/keyboard.c
index 001fb00ce..4eff764e2 100644
--- a/tmk_core/common/keyboard.c
+++ b/tmk_core/common/keyboard.c
@@ -117,19 +117,35 @@ static inline bool has_ghost_in_row(uint8_t row, matrix_row_t rowdata)
117 117
118#endif 118#endif
119 119
120/** \brief matrix_setup
121 *
122 * FIXME: needs doc
123 */
120__attribute__ ((weak)) 124__attribute__ ((weak))
121void matrix_setup(void) { 125void matrix_setup(void) {
122} 126}
123 127
128/** \brief keyboard_setup
129 *
130 * FIXME: needs doc
131 */
124void keyboard_setup(void) { 132void keyboard_setup(void) {
125 matrix_setup(); 133 matrix_setup();
126} 134}
127 135
136/** \brief is_keyboard_master
137 *
138 * FIXME: needs doc
139 */
128__attribute__((weak)) 140__attribute__((weak))
129bool is_keyboard_master(void) { 141bool is_keyboard_master(void) {
130 return true; 142 return true;
131} 143}
132 144
145/** \brief keyboard_init
146 *
147 * FIXME: needs doc
148 */
133void keyboard_init(void) { 149void keyboard_init(void) {
134 timer_init(); 150 timer_init();
135 matrix_init(); 151 matrix_init();
@@ -167,8 +183,16 @@ void keyboard_init(void) {
167#endif 183#endif
168} 184}
169 185
170/* 186/** \brief Keyboard task: Do keyboard routine jobs
171 * Do keyboard routine jobs: scan matrix, light LEDs, ... 187 *
188 * Do routine keyboard jobs:
189 *
190 * * scan matrix
191 * * handle mouse movements
192 * * run visualizer code
193 * * handle midi commands
194 * * light LEDs
195 *
172 * This is repeatedly called as fast as possible. 196 * This is repeatedly called as fast as possible.
173 */ 197 */
174void keyboard_task(void) 198void keyboard_task(void)
@@ -274,6 +298,10 @@ MATRIX_LOOP_END:
274 } 298 }
275} 299}
276 300
301/** \brief keyboard set leds
302 *
303 * FIXME: needs doc
304 */
277void keyboard_set_leds(uint8_t leds) 305void keyboard_set_leds(uint8_t leds)
278{ 306{
279 if (debug_keyboard) { debug("keyboard_set_led: "); debug_hex8(leds); debug("\n"); } 307 if (debug_keyboard) { debug("keyboard_set_led: "); debug_hex8(leds); debug("\n"); }
diff --git a/tmk_core/common/keycode.h b/tmk_core/common/keycode.h
index e7e09e098..734c9fbff 100644
--- a/tmk_core/common/keycode.h
+++ b/tmk_core/common/keycode.h
@@ -22,6 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
22#ifndef KEYCODE_H 22#ifndef KEYCODE_H
23#define KEYCODE_H 23#define KEYCODE_H
24 24
25/* FIXME: Add doxygen comments here */
25 26
26#define IS_ERROR(code) (KC_ROLL_OVER <= (code) && (code) <= KC_UNDEFINED) 27#define IS_ERROR(code) (KC_ROLL_OVER <= (code) && (code) <= KC_UNDEFINED)
27#define IS_ANY(code) (KC_A <= (code) && (code) <= 0xFF) 28#define IS_ANY(code) (KC_A <= (code) && (code) <= 0xFF)
diff --git a/tmk_core/common/led.h b/tmk_core/common/led.h
index 61c971c10..c16305129 100644
--- a/tmk_core/common/led.h
+++ b/tmk_core/common/led.h
@@ -19,6 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
19#define LED_H 19#define LED_H
20#include "stdint.h" 20#include "stdint.h"
21 21
22/* FIXME: Add doxygen comments here. */
22 23
23/* keyboard LEDs */ 24/* keyboard LEDs */
24#define USB_LED_NUM_LOCK 0 25#define USB_LED_NUM_LOCK 0
@@ -40,4 +41,4 @@ void led_init_ports(void);
40} 41}
41#endif 42#endif
42 43
43#endif \ No newline at end of file 44#endif
diff --git a/tmk_core/common/magic.c b/tmk_core/common/magic.c
index 49617a3d1..714acc0f5 100644
--- a/tmk_core/common/magic.c
+++ b/tmk_core/common/magic.c
@@ -14,6 +14,10 @@
14 14
15keymap_config_t keymap_config; 15keymap_config_t keymap_config;
16 16
17/** \brief Magic
18 *
19 * FIXME: Needs doc
20 */
17void magic(void) 21void magic(void)
18{ 22{
19 /* check signature */ 23 /* check signature */
diff --git a/tmk_core/common/report.c b/tmk_core/common/report.c
index 4b25f4428..eb3b44312 100644
--- a/tmk_core/common/report.c
+++ b/tmk_core/common/report.c
@@ -20,6 +20,10 @@
20#include "debug.h" 20#include "debug.h"
21#include "util.h" 21#include "util.h"
22 22
23/** \brief has_anykey
24 *
25 * FIXME: Needs doc
26 */
23uint8_t has_anykey(report_keyboard_t* keyboard_report) 27uint8_t has_anykey(report_keyboard_t* keyboard_report)
24{ 28{
25 uint8_t cnt = 0; 29 uint8_t cnt = 0;
@@ -30,6 +34,10 @@ uint8_t has_anykey(report_keyboard_t* keyboard_report)
30 return cnt; 34 return cnt;
31} 35}
32 36
37/** \brief get_first_key
38 *
39 * FIXME: Needs doc
40 */
33uint8_t get_first_key(report_keyboard_t* keyboard_report) 41uint8_t get_first_key(report_keyboard_t* keyboard_report)
34{ 42{
35#ifdef NKRO_ENABLE 43#ifdef NKRO_ENABLE
@@ -54,6 +62,10 @@ uint8_t get_first_key(report_keyboard_t* keyboard_report)
54#endif 62#endif
55} 63}
56 64
65/** \brief add key byte
66 *
67 * FIXME: Needs doc
68 */
57void add_key_byte(report_keyboard_t* keyboard_report, uint8_t code) 69void add_key_byte(report_keyboard_t* keyboard_report, uint8_t code)
58{ 70{
59#ifdef USB_6KRO_ENABLE 71#ifdef USB_6KRO_ENABLE
@@ -120,6 +132,10 @@ void add_key_byte(report_keyboard_t* keyboard_report, uint8_t code)
120#endif 132#endif
121} 133}
122 134
135/** \brief del key byte
136 *
137 * FIXME: Needs doc
138 */
123void del_key_byte(report_keyboard_t* keyboard_report, uint8_t code) 139void del_key_byte(report_keyboard_t* keyboard_report, uint8_t code)
124{ 140{
125#ifdef USB_6KRO_ENABLE 141#ifdef USB_6KRO_ENABLE
@@ -157,6 +173,10 @@ void del_key_byte(report_keyboard_t* keyboard_report, uint8_t code)
157} 173}
158 174
159#ifdef NKRO_ENABLE 175#ifdef NKRO_ENABLE
176/** \brief add key bit
177 *
178 * FIXME: Needs doc
179 */
160void add_key_bit(report_keyboard_t* keyboard_report, uint8_t code) 180void add_key_bit(report_keyboard_t* keyboard_report, uint8_t code)
161{ 181{
162 if ((code>>3) < KEYBOARD_REPORT_BITS) { 182 if ((code>>3) < KEYBOARD_REPORT_BITS) {
@@ -166,6 +186,10 @@ void add_key_bit(report_keyboard_t* keyboard_report, uint8_t code)
166 } 186 }
167} 187}
168 188
189/** \brief del key bit
190 *
191 * FIXME: Needs doc
192 */
169void del_key_bit(report_keyboard_t* keyboard_report, uint8_t code) 193void del_key_bit(report_keyboard_t* keyboard_report, uint8_t code)
170{ 194{
171 if ((code>>3) < KEYBOARD_REPORT_BITS) { 195 if ((code>>3) < KEYBOARD_REPORT_BITS) {
@@ -176,6 +200,10 @@ void del_key_bit(report_keyboard_t* keyboard_report, uint8_t code)
176} 200}
177#endif 201#endif
178 202
203/** \brief add key to report
204 *
205 * FIXME: Needs doc
206 */
179void add_key_to_report(report_keyboard_t* keyboard_report, uint8_t key) 207void add_key_to_report(report_keyboard_t* keyboard_report, uint8_t key)
180{ 208{
181#ifdef NKRO_ENABLE 209#ifdef NKRO_ENABLE
@@ -187,6 +215,10 @@ void add_key_to_report(report_keyboard_t* keyboard_report, uint8_t key)
187 add_key_byte(keyboard_report, key); 215 add_key_byte(keyboard_report, key);
188} 216}
189 217
218/** \brief del key from report
219 *
220 * FIXME: Needs doc
221 */
190void del_key_from_report(report_keyboard_t* keyboard_report, uint8_t key) 222void del_key_from_report(report_keyboard_t* keyboard_report, uint8_t key)
191{ 223{
192#ifdef NKRO_ENABLE 224#ifdef NKRO_ENABLE
@@ -198,6 +230,10 @@ void del_key_from_report(report_keyboard_t* keyboard_report, uint8_t key)
198 del_key_byte(keyboard_report, key); 230 del_key_byte(keyboard_report, key);
199} 231}
200 232
233/** \brief clear key from report
234 *
235 * FIXME: Needs doc
236 */
201void clear_keys_from_report(report_keyboard_t* keyboard_report) 237void clear_keys_from_report(report_keyboard_t* keyboard_report)
202{ 238{
203 // not clear mods 239 // not clear mods
diff --git a/tmk_core/protocol/lufa/lufa.c b/tmk_core/protocol/lufa/lufa.c
index a1cab98a6..cb918d3dc 100644
--- a/tmk_core/protocol/lufa/lufa.c
+++ b/tmk_core/protocol/lufa/lufa.c
@@ -141,6 +141,10 @@ USB_ClassInfo_CDC_Device_t cdc_device =
141 141
142#ifdef RAW_ENABLE 142#ifdef RAW_ENABLE
143 143
144/** \brief Raw HID Send
145 *
146 * FIXME: Needs doc
147 */
144void raw_hid_send( uint8_t *data, uint8_t length ) 148void raw_hid_send( uint8_t *data, uint8_t length )
145{ 149{
146 // TODO: implement variable size packet 150 // TODO: implement variable size packet
@@ -172,6 +176,10 @@ void raw_hid_send( uint8_t *data, uint8_t length )
172 Endpoint_SelectEndpoint(ep); 176 Endpoint_SelectEndpoint(ep);
173} 177}
174 178
179/** \brief Raw HID Receive
180 *
181 * FIXME: Needs doc
182 */
175__attribute__ ((weak)) 183__attribute__ ((weak))
176void raw_hid_receive( uint8_t *data, uint8_t length ) 184void raw_hid_receive( uint8_t *data, uint8_t length )
177{ 185{
@@ -180,6 +188,10 @@ void raw_hid_receive( uint8_t *data, uint8_t length )
180 // so users can opt to not handle data coming in. 188 // so users can opt to not handle data coming in.
181} 189}
182 190
191/** \brief Raw HID Task
192 *
193 * FIXME: Needs doc
194 */
183static void raw_hid_task(void) 195static void raw_hid_task(void)
184{ 196{
185 // Create a temporary buffer to hold the read in data from the host 197 // Create a temporary buffer to hold the read in data from the host
@@ -218,6 +230,10 @@ static void raw_hid_task(void)
218 * Console 230 * Console
219 ******************************************************************************/ 231 ******************************************************************************/
220#ifdef CONSOLE_ENABLE 232#ifdef CONSOLE_ENABLE
233/** \brief Console Task
234 *
235 * FIXME: Needs doc
236 */
221static void Console_Task(void) 237static void Console_Task(void)
222{ 238{
223 /* Device must be connected and configured for the task to run */ 239 /* Device must be connected and configured for the task to run */
@@ -282,6 +298,10 @@ static void Console_Task(void)
282 * 2) EVENT_USB_Device_Reset 298 * 2) EVENT_USB_Device_Reset
283 * 3) EVENT_USB_Device_Wake 299 * 3) EVENT_USB_Device_Wake
284*/ 300*/
301/** \brief Event USB Device Connect
302 *
303 * FIXME: Needs doc
304 */
285void EVENT_USB_Device_Connect(void) 305void EVENT_USB_Device_Connect(void)
286{ 306{
287 print("[C]"); 307 print("[C]");
@@ -293,6 +313,10 @@ void EVENT_USB_Device_Connect(void)
293 } 313 }
294} 314}
295 315
316/** \brief Event USB Device Connect
317 *
318 * FIXME: Needs doc
319 */
296void EVENT_USB_Device_Disconnect(void) 320void EVENT_USB_Device_Disconnect(void)
297{ 321{
298 print("[D]"); 322 print("[D]");
@@ -307,11 +331,19 @@ void EVENT_USB_Device_Disconnect(void)
307*/ 331*/
308} 332}
309 333
334/** \brief Event USB Device Connect
335 *
336 * FIXME: Needs doc
337 */
310void EVENT_USB_Device_Reset(void) 338void EVENT_USB_Device_Reset(void)
311{ 339{
312 print("[R]"); 340 print("[R]");
313} 341}
314 342
343/** \brief Event USB Device Connect
344 *
345 * FIXME: Needs doc
346 */
315void EVENT_USB_Device_Suspend() 347void EVENT_USB_Device_Suspend()
316{ 348{
317 print("[S]"); 349 print("[S]");
@@ -320,6 +352,10 @@ void EVENT_USB_Device_Suspend()
320#endif 352#endif
321} 353}
322 354
355/** \brief Event USB Device Connect
356 *
357 * FIXME: Needs doc
358 */
323void EVENT_USB_Device_WakeUp() 359void EVENT_USB_Device_WakeUp()
324{ 360{
325 print("[W]"); 361 print("[W]");
@@ -342,7 +378,11 @@ static bool console_flush = false;
342 } \ 378 } \
343} while (0) 379} while (0)
344 380
345// called every 1ms 381/** \brief Event USB Device Start Of Frame
382 *
383 * FIXME: Needs doc
384 * called every 1ms
385 */
346void EVENT_USB_Device_StartOfFrame(void) 386void EVENT_USB_Device_StartOfFrame(void)
347{ 387{
348 static uint8_t count; 388 static uint8_t count;
@@ -356,11 +396,12 @@ void EVENT_USB_Device_StartOfFrame(void)
356 396
357#endif 397#endif
358 398
359/** Event handler for the USB_ConfigurationChanged event. 399/** \brief Event handler for the USB_ConfigurationChanged event.
400 *
360 * This is fired when the host sets the current configuration of the USB device after enumeration. 401 * This is fired when the host sets the current configuration of the USB device after enumeration.
361 * 402 *
362 * ATMega32u2 supports dual bank(ping-pong mode) only on endpoint 3 and 4, 403 * ATMega32u2 supports dual bank(ping-pong mode) only on endpoint 3 and 4,
363 * it is safe to use singl bank for all endpoints. 404 * it is safe to use single bank for all endpoints.
364 */ 405 */
365void EVENT_USB_Device_ConfigurationChanged(void) 406void EVENT_USB_Device_ConfigurationChanged(void)
366{ 407{
@@ -418,7 +459,7 @@ void EVENT_USB_Device_ConfigurationChanged(void)
418#endif 459#endif
419} 460}
420 461
421/* 462/* FIXME: Expose this table in the docs somehow
422Appendix G: HID Request Support Requirements 463Appendix G: HID Request Support Requirements
423 464
424The following table enumerates the requests that need to be supported by various types of HID class devices. 465The following table enumerates the requests that need to be supported by various types of HID class devices.
@@ -431,7 +472,8 @@ Boot Keyboard Required Optional Required Required Required Requ
431Non-Boot Keybrd Required Optional Required Required Optional Optional 472Non-Boot Keybrd Required Optional Required Required Optional Optional
432Other Device Required Optional Optional Optional Optional Optional 473Other Device Required Optional Optional Optional Optional Optional
433*/ 474*/
434/** Event handler for the USB_ControlRequest event. 475/** \brief Event handler for the USB_ControlRequest event.
476 *
435 * This is fired before passing along unhandled control requests to the library for processing internally. 477 * This is fired before passing along unhandled control requests to the library for processing internally.
436 */ 478 */
437void EVENT_USB_Device_ControlRequest(void) 479void EVENT_USB_Device_ControlRequest(void)
@@ -546,11 +588,19 @@ void EVENT_USB_Device_ControlRequest(void)
546/******************************************************************************* 588/*******************************************************************************
547 * Host driver 589 * Host driver
548 ******************************************************************************/ 590 ******************************************************************************/
591/** \brief Keyboard LEDs
592 *
593 * FIXME: Needs doc
594 */
549static uint8_t keyboard_leds(void) 595static uint8_t keyboard_leds(void)
550{ 596{
551 return keyboard_led_stats; 597 return keyboard_led_stats;
552} 598}
553 599
600/** \brief Send Keyboard
601 *
602 * FIXME: Needs doc
603 */
554static void send_keyboard(report_keyboard_t *report) 604static void send_keyboard(report_keyboard_t *report)
555{ 605{
556 uint8_t timeout = 255; 606 uint8_t timeout = 255;
@@ -612,7 +662,11 @@ static void send_keyboard(report_keyboard_t *report)
612 662
613 keyboard_report_sent = *report; 663 keyboard_report_sent = *report;
614} 664}
615 665
666/** \brief Send Mouse
667 *
668 * FIXME: Needs doc
669 */
616static void send_mouse(report_mouse_t *report) 670static void send_mouse(report_mouse_t *report)
617{ 671{
618#ifdef MOUSE_ENABLE 672#ifdef MOUSE_ENABLE
@@ -657,6 +711,10 @@ static void send_mouse(report_mouse_t *report)
657#endif 711#endif
658} 712}
659 713
714/** \brief Send System
715 *
716 * FIXME: Needs doc
717 */
660static void send_system(uint16_t data) 718static void send_system(uint16_t data)
661{ 719{
662 uint8_t timeout = 255; 720 uint8_t timeout = 255;
@@ -678,6 +736,10 @@ static void send_system(uint16_t data)
678 Endpoint_ClearIN(); 736 Endpoint_ClearIN();
679} 737}
680 738
739/** \brief Send Consumer
740 *
741 * FIXME: Needs doc
742 */
681static void send_consumer(uint16_t data) 743static void send_consumer(uint16_t data)
682{ 744{
683 uint8_t timeout = 255; 745 uint8_t timeout = 255;
@@ -739,6 +801,10 @@ static void send_consumer(uint16_t data)
739 ******************************************************************************/ 801 ******************************************************************************/
740#ifdef CONSOLE_ENABLE 802#ifdef CONSOLE_ENABLE
741#define SEND_TIMEOUT 5 803#define SEND_TIMEOUT 5
804/** \brief Send Char
805 *
806 * FIXME: Needs doc
807 */
742int8_t sendchar(uint8_t c) 808int8_t sendchar(uint8_t c)
743{ 809{
744 // Not wait once timeouted. 810 // Not wait once timeouted.
@@ -842,18 +908,30 @@ bool recv_midi_packet(MIDI_EventPacket_t* const event) {
842 ******************************************************************************/ 908 ******************************************************************************/
843 909
844#ifdef VIRTSER_ENABLE 910#ifdef VIRTSER_ENABLE
911/** \brief Virtual Serial Init
912 *
913 * FIXME: Needs doc
914 */
845void virtser_init(void) 915void virtser_init(void)
846{ 916{
847 cdc_device.State.ControlLineStates.DeviceToHost = CDC_CONTROL_LINE_IN_DSR ; 917 cdc_device.State.ControlLineStates.DeviceToHost = CDC_CONTROL_LINE_IN_DSR ;
848 CDC_Device_SendControlLineStateChange(&cdc_device); 918 CDC_Device_SendControlLineStateChange(&cdc_device);
849} 919}
850 920
921/** \brief Virtual Serial Receive
922 *
923 * FIXME: Needs doc
924 */
851void virtser_recv(uint8_t c) __attribute__ ((weak)); 925void virtser_recv(uint8_t c) __attribute__ ((weak));
852void virtser_recv(uint8_t c) 926void virtser_recv(uint8_t c)
853{ 927{
854 // Ignore by default 928 // Ignore by default
855} 929}
856 930
931/** \brief Virtual Serial Task
932 *
933 * FIXME: Needs doc
934 */
857void virtser_task(void) 935void virtser_task(void)
858{ 936{
859 uint16_t count = CDC_Device_BytesReceived(&cdc_device); 937 uint16_t count = CDC_Device_BytesReceived(&cdc_device);
@@ -864,6 +942,10 @@ void virtser_task(void)
864 virtser_recv(ch); 942 virtser_recv(ch);
865 } 943 }
866} 944}
945/** \brief Virtual Serial Send
946 *
947 * FIXME: Needs doc
948 */
867void virtser_send(const uint8_t byte) 949void virtser_send(const uint8_t byte)
868{ 950{
869 uint8_t timeout = 255; 951 uint8_t timeout = 255;
@@ -896,6 +978,10 @@ void virtser_send(const uint8_t byte)
896/******************************************************************************* 978/*******************************************************************************
897 * main 979 * main
898 ******************************************************************************/ 980 ******************************************************************************/
981/** \brief Setup MCU
982 *
983 * FIXME: Needs doc
984 */
899static void setup_mcu(void) 985static void setup_mcu(void)
900{ 986{
901 /* Disable watchdog if enabled by bootloader/fuses */ 987 /* Disable watchdog if enabled by bootloader/fuses */
@@ -909,6 +995,10 @@ static void setup_mcu(void)
909 CLKPR = (0 << CLKPS3) | (0 << CLKPS2) | (0 << CLKPS1) | (0 << CLKPS0); 995 CLKPR = (0 << CLKPS3) | (0 << CLKPS2) | (0 << CLKPS1) | (0 << CLKPS0);
910} 996}
911 997
998/** \brief Setup USB
999 *
1000 * FIXME: Needs doc
1001 */
912static void setup_usb(void) 1002static void setup_usb(void)
913{ 1003{
914 // Leonardo needs. Without this USB device is not recognized. 1004 // Leonardo needs. Without this USB device is not recognized.
@@ -921,6 +1011,10 @@ static void setup_usb(void)
921 print_set_sendchar(sendchar); 1011 print_set_sendchar(sendchar);
922} 1012}
923 1013
1014/** \brief Main
1015 *
1016 * FIXME: Needs doc
1017 */
924int main(void) __attribute__ ((weak)); 1018int main(void) __attribute__ ((weak));
925int main(void) 1019int main(void)
926{ 1020{
diff --git a/tmk_core/protocol/lufa/outputselect.c b/tmk_core/protocol/lufa/outputselect.c
index 0df5d3b75..42de80612 100644
--- a/tmk_core/protocol/lufa/outputselect.c
+++ b/tmk_core/protocol/lufa/outputselect.c
@@ -20,15 +20,27 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
20 20
21uint8_t desired_output = OUTPUT_DEFAULT; 21uint8_t desired_output = OUTPUT_DEFAULT;
22 22
23/** \brief Set Output
24 *
25 * FIXME: Needs doc
26 */
23void set_output(uint8_t output) { 27void set_output(uint8_t output) {
24 set_output_user(output); 28 set_output_user(output);
25 desired_output = output; 29 desired_output = output;
26} 30}
27 31
32/** \brief Set Output User
33 *
34 * FIXME: Needs doc
35 */
28__attribute__((weak)) 36__attribute__((weak))
29void set_output_user(uint8_t output) { 37void set_output_user(uint8_t output) {
30} 38}
31 39
40/** \brief Auto Detect Output
41 *
42 * FIXME: Needs doc
43 */
32uint8_t auto_detect_output(void) { 44uint8_t auto_detect_output(void) {
33 if (USB_DeviceState == DEVICE_STATE_Configured) { 45 if (USB_DeviceState == DEVICE_STATE_Configured) {
34 return OUTPUT_USB; 46 return OUTPUT_USB;
@@ -47,6 +59,10 @@ uint8_t auto_detect_output(void) {
47 return OUTPUT_NONE; 59 return OUTPUT_NONE;
48} 60}
49 61
62/** \brief Where To Send
63 *
64 * FIXME: Needs doc
65 */
50uint8_t where_to_send(void) { 66uint8_t where_to_send(void) {
51 if (desired_output == OUTPUT_AUTO) { 67 if (desired_output == OUTPUT_AUTO) {
52 return auto_detect_output(); 68 return auto_detect_output();
diff --git a/util/generate_api_docs.sh b/util/generate_api_docs.sh
new file mode 100755
index 000000000..8d7ec3101
--- /dev/null
+++ b/util/generate_api_docs.sh
@@ -0,0 +1,31 @@
1#!/bin/bash
2
3set -x
4
5if ! doxygen -v 2>&1 > /dev/null; then
6 echo "doxygen not found! Please install it!"
7 exit 1
8elif ! moxygen -V 2>&1 > /dev/null; then
9 echo -n "moxygen not found! Would you like to install it? [y/n] "
10 read ANSWER
11 case $ANSWER in
12 y|Y|yes|YES|Yes)
13 npm install -g moxygen
14 ;;
15 *)
16 exit 1
17 ;;
18 esac
19fi
20
21if [ ! -e Doxyfile ]; then
22 echo "Error: You must run this from the top-level qmk_firmware directory!"
23 exit 1
24fi
25
26# Generate the doxygen XML files
27rm -rf doxygen
28doxygen Doxyfile
29
30# Generate the moxygen Markdown files
31moxygen -a -g -o docs/api_%s.md doxygen/xml
diff --git a/util/travis_compiled_push.sh b/util/travis_compiled_push.sh
index b3554b507..6be124122 100644
--- a/util/travis_compiled_push.sh
+++ b/util/travis_compiled_push.sh
@@ -1,26 +1,13 @@
1#!/bin/bash 1#!/bin/bash
2 2
3TRAVIS_BRANCH="${TRAVIS_BRANCH:master}"
4TRAVIS_PULL_REQUEST="${TRAVIS_PULL_REQUEST:false}"
5TRAVIS_COMMIT_MESSAGE="${TRAVIS_COMMIT_MESSAGE:-none}"
6TRAVIS_COMMIT_RANGE="${TRAVIS_COMMIT_RANGE:-HEAD~1..HEAD}"
7
8set -o errexit -o nounset 3set -o errexit -o nounset
9 4
5source util/travis_push.sh
10rev=$(git rev-parse --short HEAD) 6rev=$(git rev-parse --short HEAD)
11 7
12if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" == "false" ]] ; then 8if ! [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" == "false" ]] ; then
13 9 exit 0
14git config --global user.name "QMK Bot" 10fi
15git config --global user.email "hello@qmk.fm"
16
17openssl aes-256-cbc -K $encrypted_b0ee987fd0fc_key -iv $encrypted_b0ee987fd0fc_iv -in secrets.tar.enc -out secrets.tar -d
18tar xvf secrets.tar
19
20chmod 600 id_rsa_qmk_firmware
21chmod 600 id_rsa_qmk.fm
22eval `ssh-agent -s`
23ssh-add id_rsa_qmk_firmware
24 11
25# convert to unix line-endings 12# convert to unix line-endings
26git checkout master 13git checkout master
@@ -28,12 +15,11 @@ git diff --diff-filter=M --name-only -n 1 -z ${TRAVIS_COMMIT_RANGE} | xargs -0 d
28git diff --diff-filter=M --name-only -n 1 -z ${TRAVIS_COMMIT_RANGE} | xargs -0 git add 15git diff --diff-filter=M --name-only -n 1 -z ${TRAVIS_COMMIT_RANGE} | xargs -0 git add
29git commit -m "convert to unix line-endings [skip ci]" && git push git@github.com:qmk/qmk_firmware.git master 16git commit -m "convert to unix line-endings [skip ci]" && git push git@github.com:qmk/qmk_firmware.git master
30 17
31increment_version () 18increment_version () {
32{ 19 declare -a part=( ${1//\./ } )
33 declare -a part=( ${1//\./ } ) 20 part[2]=$((part[2] + 1))
34 part[2]=$((part[2] + 1)) 21 new="${part[*]}"
35 new="${part[*]}" 22 echo -e "${new// /.}"
36 echo -e "${new// /.}"
37} 23}
38 24
39git diff --name-only -n 1 ${TRAVIS_COMMIT_RANGE} 25git diff --name-only -n 1 ${TRAVIS_COMMIT_RANGE}
@@ -76,7 +62,4 @@ if [[ "$TRAVIS_COMMIT_MESSAGE" != *"[skip build]"* ]] ; then
76 git add -A 62 git add -A
77 git commit -m "generated from qmk/qmk_firmware@${rev}" 63 git commit -m "generated from qmk/qmk_firmware@${rev}"
78 git push git@github.com:qmk/qmk.fm.git 64 git push git@github.com:qmk/qmk.fm.git
79
80fi 65fi
81
82fi \ No newline at end of file
diff --git a/util/travis_docs.sh b/util/travis_docs.sh
new file mode 100644
index 000000000..ec553952c
--- /dev/null
+++ b/util/travis_docs.sh
@@ -0,0 +1,14 @@
1#!/bin/bash
2
3source util/travis_push.sh
4
5if [[ "$TRAVIS_COMMIT_MESSAGE" != *"[skip docs]"* ]] ; then
6 if git diff --name-only ${TRAVIS_COMMIT_RANGE} | grep -e '^quantum/' -e '^tmk_core/' -e '^docs/api_.*'; then
7 echo "Generating API docs..."
8 rm -rf doxygen
9 doxygen Doxyfile
10 moxygen -a -g -o -q docs/api_%s.md doxygen/xml
11 git add docs/api_*
12 git commit -m'autogenerated api docs for ${TRAVIS_COMMIT_RANGE}' || true
13 fi
14fi
diff --git a/util/travis_push.sh b/util/travis_push.sh
new file mode 100644
index 000000000..7eea88b14
--- /dev/null
+++ b/util/travis_push.sh
@@ -0,0 +1,17 @@
1# Use this by sourcing it in your script.
2
3TRAVIS_BRANCH="${TRAVIS_BRANCH:master}"
4TRAVIS_PULL_REQUEST="${TRAVIS_PULL_REQUEST:false}"
5TRAVIS_COMMIT_MESSAGE="${TRAVIS_COMMIT_MESSAGE:-none}"
6TRAVIS_COMMIT_RANGE="${TRAVIS_COMMIT_RANGE:-HEAD~1..HEAD}"
7
8git config --global user.name "QMK Bot"
9git config --global user.email "hello@qmk.fm"
10
11openssl aes-256-cbc -K $encrypted_b0ee987fd0fc_key -iv $encrypted_b0ee987fd0fc_iv -in secrets.tar.enc -out secrets.tar -d
12tar xvf secrets.tar
13
14chmod 600 id_rsa_qmk_firmware
15chmod 600 id_rsa_qmk.fm
16eval `ssh-agent -s`
17ssh-add id_rsa_qmk_firmware