mirror of
https://github.com/qmk/qmk_firmware.git
synced 2024-11-30 23:15:51 +00:00
Generate API docs from source code comments (#2491)
* Generate api docs from source code * Add a bunch of doxygen comments * more doxygen comments * Add the in-progress api docs * script to generate docs from travis * Add doc generation to the travis job * make travis_docs.sh commit the work it does * make sure the docs script exits cleanly
This commit is contained in:
parent
f0932a8716
commit
7c9d5ace14
1
.gitignore
vendored
1
.gitignore
vendored
@ -23,6 +23,7 @@ quantum/version.h
|
|||||||
.idea/
|
.idea/
|
||||||
CMakeLists.txt
|
CMakeLists.txt
|
||||||
cmake-build-debug
|
cmake-build-debug
|
||||||
|
doxygen/
|
||||||
.DS_STORE
|
.DS_STORE
|
||||||
/util/wsl_downloaded
|
/util/wsl_downloaded
|
||||||
/util/win_downloaded
|
/util/win_downloaded
|
||||||
|
@ -15,11 +15,13 @@ before_install:
|
|||||||
install:
|
install:
|
||||||
- tar -zxf avr8-gnu-toolchain-3.5.4.1709-linux.any.x86_64.tar.gz
|
- tar -zxf avr8-gnu-toolchain-3.5.4.1709-linux.any.x86_64.tar.gz
|
||||||
- export PATH="$PATH:$TRAVIS_BUILD_DIR/avr8-gnu-toolchain-linux_x86_64/bin"
|
- export PATH="$PATH:$TRAVIS_BUILD_DIR/avr8-gnu-toolchain-linux_x86_64/bin"
|
||||||
|
- npm install -g moxygen
|
||||||
before_script:
|
before_script:
|
||||||
- avr-gcc --version
|
- avr-gcc --version
|
||||||
script:
|
script:
|
||||||
- make test:all AUTOGEN=false
|
- make test:all AUTOGEN=false
|
||||||
- bash util/travis_build.sh
|
- bash util/travis_build.sh
|
||||||
|
- bash util/travis_docs.sh
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
packages:
|
packages:
|
||||||
@ -30,6 +32,7 @@ addons:
|
|||||||
- libnewlib-arm-none-eabi
|
- libnewlib-arm-none-eabi
|
||||||
- diffutils
|
- diffutils
|
||||||
- dos2unix
|
- dos2unix
|
||||||
|
- doxygen
|
||||||
after_success:
|
after_success:
|
||||||
bash util/travis_compiled_push.sh
|
bash util/travis_compiled_push.sh
|
||||||
notifications:
|
notifications:
|
||||||
|
266
Doxyfile
Normal file
266
Doxyfile
Normal file
@ -0,0 +1,266 @@
|
|||||||
|
# Doxyfile 1.8.14
|
||||||
|
|
||||||
|
# This file describes the settings to be used by the documentation system
|
||||||
|
# doxygen (www.doxygen.org) for qmk_firmware (github.com/qmk/qmk_firmware)
|
||||||
|
#
|
||||||
|
# All text after a double hash (##) is considered a comment and is placed in
|
||||||
|
# front of the TAG it is preceding.
|
||||||
|
#
|
||||||
|
# All text after a single hash (#) is considered a comment and will be ignored.
|
||||||
|
# The format is:
|
||||||
|
# TAG = value [value, ...]
|
||||||
|
# For lists, items can also be appended using:
|
||||||
|
# TAG += value [value, ...]
|
||||||
|
# Values that contain spaces should be placed between quotes (\" \").
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# Project related configuration options
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
DOXYFILE_ENCODING = UTF-8
|
||||||
|
PROJECT_NAME = "QMK Firmware"
|
||||||
|
PROJECT_NUMBER = https://github.com/qmk/qmk_firmware
|
||||||
|
PROJECT_BRIEF = "Keyboard controller firmware for Atmel AVR and ARM USB families"
|
||||||
|
OUTPUT_DIRECTORY = doxygen
|
||||||
|
ALLOW_UNICODE_NAMES = NO
|
||||||
|
OUTPUT_LANGUAGE = English
|
||||||
|
BRIEF_MEMBER_DESC = YES
|
||||||
|
REPEAT_BRIEF = YES
|
||||||
|
ABBREVIATE_BRIEF = "The $name class" \
|
||||||
|
"The $name widget" \
|
||||||
|
"The $name file" \
|
||||||
|
is \
|
||||||
|
provides \
|
||||||
|
specifies \
|
||||||
|
contains \
|
||||||
|
represents \
|
||||||
|
a \
|
||||||
|
an \
|
||||||
|
the
|
||||||
|
ALWAYS_DETAILED_SEC = NO
|
||||||
|
INLINE_INHERITED_MEMB = NO
|
||||||
|
FULL_PATH_NAMES = YES
|
||||||
|
STRIP_FROM_PATH =
|
||||||
|
STRIP_FROM_INC_PATH =
|
||||||
|
SHORT_NAMES = NO
|
||||||
|
JAVADOC_AUTOBRIEF = NO
|
||||||
|
QT_AUTOBRIEF = NO
|
||||||
|
MULTILINE_CPP_IS_BRIEF = NO
|
||||||
|
INHERIT_DOCS = YES
|
||||||
|
SEPARATE_MEMBER_PAGES = NO
|
||||||
|
TAB_SIZE = 4
|
||||||
|
ALIASES =
|
||||||
|
TCL_SUBST =
|
||||||
|
OPTIMIZE_OUTPUT_FOR_C = YES
|
||||||
|
OPTIMIZE_OUTPUT_JAVA = NO
|
||||||
|
OPTIMIZE_FOR_FORTRAN = NO
|
||||||
|
OPTIMIZE_OUTPUT_VHDL = NO
|
||||||
|
EXTENSION_MAPPING =
|
||||||
|
MARKDOWN_SUPPORT = YES
|
||||||
|
TOC_INCLUDE_HEADINGS = 2
|
||||||
|
AUTOLINK_SUPPORT = YES
|
||||||
|
BUILTIN_STL_SUPPORT = NO
|
||||||
|
CPP_CLI_SUPPORT = NO
|
||||||
|
SIP_SUPPORT = NO
|
||||||
|
IDL_PROPERTY_SUPPORT = YES
|
||||||
|
DISTRIBUTE_GROUP_DOC = NO
|
||||||
|
GROUP_NESTED_COMPOUNDS = NO
|
||||||
|
SUBGROUPING = YES
|
||||||
|
INLINE_GROUPED_CLASSES = NO
|
||||||
|
INLINE_SIMPLE_STRUCTS = NO
|
||||||
|
TYPEDEF_HIDES_STRUCT = NO
|
||||||
|
LOOKUP_CACHE_SIZE = 0
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# Build related configuration options
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
EXTRACT_ALL = NO
|
||||||
|
EXTRACT_PRIVATE = NO
|
||||||
|
EXTRACT_PACKAGE = NO
|
||||||
|
EXTRACT_STATIC = NO
|
||||||
|
EXTRACT_LOCAL_CLASSES = YES
|
||||||
|
EXTRACT_LOCAL_METHODS = NO
|
||||||
|
EXTRACT_ANON_NSPACES = NO
|
||||||
|
HIDE_UNDOC_MEMBERS = NO
|
||||||
|
HIDE_UNDOC_CLASSES = NO
|
||||||
|
HIDE_FRIEND_COMPOUNDS = NO
|
||||||
|
HIDE_IN_BODY_DOCS = NO
|
||||||
|
INTERNAL_DOCS = NO
|
||||||
|
CASE_SENSE_NAMES = NO
|
||||||
|
HIDE_SCOPE_NAMES = YES
|
||||||
|
HIDE_COMPOUND_REFERENCE= NO
|
||||||
|
SHOW_INCLUDE_FILES = YES
|
||||||
|
SHOW_GROUPED_MEMB_INC = NO
|
||||||
|
FORCE_LOCAL_INCLUDES = NO
|
||||||
|
INLINE_INFO = YES
|
||||||
|
SORT_MEMBER_DOCS = YES
|
||||||
|
SORT_BRIEF_DOCS = NO
|
||||||
|
SORT_MEMBERS_CTORS_1ST = NO
|
||||||
|
SORT_GROUP_NAMES = NO
|
||||||
|
SORT_BY_SCOPE_NAME = NO
|
||||||
|
STRICT_PROTO_MATCHING = NO
|
||||||
|
GENERATE_TODOLIST = YES
|
||||||
|
GENERATE_TESTLIST = YES
|
||||||
|
GENERATE_BUGLIST = YES
|
||||||
|
GENERATE_DEPRECATEDLIST= YES
|
||||||
|
ENABLED_SECTIONS =
|
||||||
|
MAX_INITIALIZER_LINES = 30
|
||||||
|
SHOW_USED_FILES = YES
|
||||||
|
SHOW_FILES = YES
|
||||||
|
SHOW_NAMESPACES = YES
|
||||||
|
FILE_VERSION_FILTER =
|
||||||
|
LAYOUT_FILE =
|
||||||
|
CITE_BIB_FILES =
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# Configuration options related to warning and progress messages
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
QUIET = NO
|
||||||
|
WARNINGS = YES
|
||||||
|
WARN_IF_UNDOCUMENTED = YES
|
||||||
|
WARN_IF_DOC_ERROR = YES
|
||||||
|
WARN_NO_PARAMDOC = NO
|
||||||
|
WARN_AS_ERROR = NO
|
||||||
|
WARN_FORMAT = "$file:$line: $text"
|
||||||
|
WARN_LOGFILE =
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# Configuration options related to the input files
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
INPUT = tmk_core quantum drivers
|
||||||
|
INPUT_ENCODING = UTF-8
|
||||||
|
FILE_PATTERNS = *.c \
|
||||||
|
*.cc \
|
||||||
|
*.cxx \
|
||||||
|
*.cpp \
|
||||||
|
*.c++ \
|
||||||
|
*.h \
|
||||||
|
*.hh \
|
||||||
|
*.hxx \
|
||||||
|
*.hpp \
|
||||||
|
*.h++
|
||||||
|
RECURSIVE = YES
|
||||||
|
EXCLUDE =
|
||||||
|
EXCLUDE_SYMLINKS = NO
|
||||||
|
EXCLUDE_PATTERNS =
|
||||||
|
EXCLUDE_SYMBOLS =
|
||||||
|
EXAMPLE_PATH =
|
||||||
|
EXAMPLE_PATTERNS = *
|
||||||
|
EXAMPLE_RECURSIVE = NO
|
||||||
|
IMAGE_PATH =
|
||||||
|
INPUT_FILTER =
|
||||||
|
FILTER_PATTERNS =
|
||||||
|
FILTER_SOURCE_FILES = NO
|
||||||
|
FILTER_SOURCE_PATTERNS =
|
||||||
|
USE_MDFILE_AS_MAINPAGE =
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# Configuration options related to source browsing
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
SOURCE_BROWSER = YES
|
||||||
|
INLINE_SOURCES = NO
|
||||||
|
STRIP_CODE_COMMENTS = YES
|
||||||
|
REFERENCED_BY_RELATION = NO
|
||||||
|
REFERENCES_RELATION = NO
|
||||||
|
REFERENCES_LINK_SOURCE = YES
|
||||||
|
SOURCE_TOOLTIPS = YES
|
||||||
|
USE_HTAGS = NO
|
||||||
|
VERBATIM_HEADERS = YES
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# Configuration options related to the alphabetical class index
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
ALPHABETICAL_INDEX = YES
|
||||||
|
COLS_IN_ALPHA_INDEX = 5
|
||||||
|
IGNORE_PREFIX =
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# Configuration options related to disabled outputs
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
GENERATE_HTML = NO
|
||||||
|
GENERATE_LATEX = NO
|
||||||
|
GENERATE_RTF = NO
|
||||||
|
GENERATE_MAN = NO
|
||||||
|
GENERATE_DOCBOOK = NO
|
||||||
|
GENERATE_AUTOGEN_DEF = NO
|
||||||
|
GENERATE_PERLMOD = NO
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# Configuration options related to the XML output
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
GENERATE_XML = YES
|
||||||
|
XML_OUTPUT = xml
|
||||||
|
XML_PROGRAMLISTING = YES
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# Configuration options related to the preprocessor
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
ENABLE_PREPROCESSING = YES
|
||||||
|
MACRO_EXPANSION = NO
|
||||||
|
EXPAND_ONLY_PREDEF = NO
|
||||||
|
SEARCH_INCLUDES = YES
|
||||||
|
INCLUDE_PATH =
|
||||||
|
INCLUDE_FILE_PATTERNS =
|
||||||
|
PREDEFINED =
|
||||||
|
EXPAND_AS_DEFINED =
|
||||||
|
SKIP_FUNCTION_MACROS = YES
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# Configuration options related to external references
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
TAGFILES =
|
||||||
|
GENERATE_TAGFILE =
|
||||||
|
ALLEXTERNALS = NO
|
||||||
|
EXTERNAL_GROUPS = YES
|
||||||
|
EXTERNAL_PAGES = YES
|
||||||
|
PERL_PATH = /usr/bin/perl
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# Configuration options related to the dot tool
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
CLASS_DIAGRAMS = YES
|
||||||
|
MSCGEN_PATH =
|
||||||
|
DIA_PATH =
|
||||||
|
HIDE_UNDOC_RELATIONS = YES
|
||||||
|
HAVE_DOT = NO
|
||||||
|
DOT_NUM_THREADS = 0
|
||||||
|
DOT_FONTNAME = Helvetica
|
||||||
|
DOT_FONTSIZE = 10
|
||||||
|
DOT_FONTPATH =
|
||||||
|
CLASS_GRAPH = YES
|
||||||
|
COLLABORATION_GRAPH = YES
|
||||||
|
GROUP_GRAPHS = YES
|
||||||
|
UML_LOOK = NO
|
||||||
|
UML_LIMIT_NUM_FIELDS = 10
|
||||||
|
TEMPLATE_RELATIONS = NO
|
||||||
|
INCLUDE_GRAPH = YES
|
||||||
|
INCLUDED_BY_GRAPH = YES
|
||||||
|
CALL_GRAPH = NO
|
||||||
|
CALLER_GRAPH = NO
|
||||||
|
GRAPHICAL_HIERARCHY = YES
|
||||||
|
DIRECTORY_GRAPH = YES
|
||||||
|
DOT_IMAGE_FORMAT = png
|
||||||
|
INTERACTIVE_SVG = NO
|
||||||
|
DOT_PATH =
|
||||||
|
DOTFILE_DIRS =
|
||||||
|
MSCFILE_DIRS =
|
||||||
|
DIAFILE_DIRS =
|
||||||
|
PLANTUML_JAR_PATH =
|
||||||
|
PLANTUML_CFG_FILE =
|
||||||
|
PLANTUML_INCLUDE_PATH =
|
||||||
|
DOT_GRAPH_MAX_NODES = 50
|
||||||
|
MAX_DOT_GRAPH_DEPTH = 0
|
||||||
|
DOT_TRANSPARENT = NO
|
||||||
|
DOT_MULTI_TARGETS = NO
|
||||||
|
GENERATE_LEGEND = YES
|
||||||
|
DOT_CLEANUP = YES
|
@ -87,3 +87,12 @@
|
|||||||
|
|
||||||
* Other Topics
|
* Other Topics
|
||||||
* [Using Eclipse with QMK](eclipse.md)
|
* [Using Eclipse with QMK](eclipse.md)
|
||||||
|
|
||||||
|
* QMK API (In Progress)
|
||||||
|
* [Defines](api_defines.md)
|
||||||
|
* [Input Callback Reg](api_input_callback_reg.md)
|
||||||
|
* [Midi Device](api_midi_device.md)
|
||||||
|
* [Midi Device Setup Process](api_midi_device_setup_process.md)
|
||||||
|
* [Midi Util](api_midi_util.md)
|
||||||
|
* [Send Functions](api_send_functions.md)
|
||||||
|
* [Sysex Tools](api_sysex_tools.md)
|
||||||
|
78
docs/api_defines.md
Normal file
78
docs/api_defines.md
Normal file
@ -0,0 +1,78 @@
|
|||||||
|
# group `defines` {#group__defines}
|
||||||
|
|
||||||
|
## Summary
|
||||||
|
|
||||||
|
Members | Descriptions
|
||||||
|
--------------------------------|---------------------------------------------
|
||||||
|
`define `[`SYSEX_BEGIN`](#group__defines_1ga1a3c39bb790dda8a368c4247caabcf79) |
|
||||||
|
`define `[`SYSEX_END`](#group__defines_1ga753706d1d28e6f96d7caf1973e80feed) |
|
||||||
|
`define `[`MIDI_STATUSMASK`](#group__defines_1gab78a1c818a5f5dab7a8946543f126c69) |
|
||||||
|
`define `[`MIDI_CHANMASK`](#group__defines_1ga239edc0a6f8405d3a8f2804f1590b909) |
|
||||||
|
`define `[`MIDI_CC`](#group__defines_1ga45f116a1daab76b3c930c2cecfaef215) |
|
||||||
|
`define `[`MIDI_NOTEON`](#group__defines_1gafd416f27bf3590868c0c1f55c30be4c7) |
|
||||||
|
`define `[`MIDI_NOTEOFF`](#group__defines_1gabed24bea2d989fd655e2ef2ad0765adc) |
|
||||||
|
`define `[`MIDI_AFTERTOUCH`](#group__defines_1ga3a322d8cfd53576a2e167c1840551b0f) |
|
||||||
|
`define `[`MIDI_PITCHBEND`](#group__defines_1gabcc799504e8064679bca03f232223af4) |
|
||||||
|
`define `[`MIDI_PROGCHANGE`](#group__defines_1gaefb3f1595ffbb9db66b46c2c919a3d42) |
|
||||||
|
`define `[`MIDI_CHANPRESSURE`](#group__defines_1gaeb3281cc7fcd0daade8ed3d2dfc33dbe) |
|
||||||
|
`define `[`MIDI_CLOCK`](#group__defines_1gafa5e4e295aafd15ab7893344599b3b89) |
|
||||||
|
`define `[`MIDI_TICK`](#group__defines_1ga3b99408ff864613765d4c3c2ceb52aa7) |
|
||||||
|
`define `[`MIDI_START`](#group__defines_1ga8233631c85823aa546f932ad8975caa4) |
|
||||||
|
`define `[`MIDI_CONTINUE`](#group__defines_1gab24430f0081e27215b0da84dd0ee745c) |
|
||||||
|
`define `[`MIDI_STOP`](#group__defines_1ga3af9271d4b1f0d22904a0b055f48cf62) |
|
||||||
|
`define `[`MIDI_ACTIVESENSE`](#group__defines_1gacd88ed42dba52bb4b2052c5656362677) |
|
||||||
|
`define `[`MIDI_RESET`](#group__defines_1ga02947f30ca62dc332fdeb10c5868323b) |
|
||||||
|
`define `[`MIDI_TC_QUARTERFRAME`](#group__defines_1gaaa072f33590e236d1bfd8f28e833ae31) |
|
||||||
|
`define `[`MIDI_SONGPOSITION`](#group__defines_1ga412f6ed33a2150051374bee334ee1705) |
|
||||||
|
`define `[`MIDI_SONGSELECT`](#group__defines_1gafcab254838b028365ae0259729e72c4e) |
|
||||||
|
`define `[`MIDI_TUNEREQUEST`](#group__defines_1ga8100b907b8c0a84e58b1c53dcd9bd795) |
|
||||||
|
`define `[`SYSEX_EDUMANUFID`](#group__defines_1ga5ef855ed955b00a2239ca16afbeb164f) |
|
||||||
|
|
||||||
|
## Members
|
||||||
|
|
||||||
|
#### `define `[`SYSEX_BEGIN`](#group__defines_1ga1a3c39bb790dda8a368c4247caabcf79) {#group__defines_1ga1a3c39bb790dda8a368c4247caabcf79}
|
||||||
|
|
||||||
|
#### `define `[`SYSEX_END`](#group__defines_1ga753706d1d28e6f96d7caf1973e80feed) {#group__defines_1ga753706d1d28e6f96d7caf1973e80feed}
|
||||||
|
|
||||||
|
#### `define `[`MIDI_STATUSMASK`](#group__defines_1gab78a1c818a5f5dab7a8946543f126c69) {#group__defines_1gab78a1c818a5f5dab7a8946543f126c69}
|
||||||
|
|
||||||
|
#### `define `[`MIDI_CHANMASK`](#group__defines_1ga239edc0a6f8405d3a8f2804f1590b909) {#group__defines_1ga239edc0a6f8405d3a8f2804f1590b909}
|
||||||
|
|
||||||
|
#### `define `[`MIDI_CC`](#group__defines_1ga45f116a1daab76b3c930c2cecfaef215) {#group__defines_1ga45f116a1daab76b3c930c2cecfaef215}
|
||||||
|
|
||||||
|
#### `define `[`MIDI_NOTEON`](#group__defines_1gafd416f27bf3590868c0c1f55c30be4c7) {#group__defines_1gafd416f27bf3590868c0c1f55c30be4c7}
|
||||||
|
|
||||||
|
#### `define `[`MIDI_NOTEOFF`](#group__defines_1gabed24bea2d989fd655e2ef2ad0765adc) {#group__defines_1gabed24bea2d989fd655e2ef2ad0765adc}
|
||||||
|
|
||||||
|
#### `define `[`MIDI_AFTERTOUCH`](#group__defines_1ga3a322d8cfd53576a2e167c1840551b0f) {#group__defines_1ga3a322d8cfd53576a2e167c1840551b0f}
|
||||||
|
|
||||||
|
#### `define `[`MIDI_PITCHBEND`](#group__defines_1gabcc799504e8064679bca03f232223af4) {#group__defines_1gabcc799504e8064679bca03f232223af4}
|
||||||
|
|
||||||
|
#### `define `[`MIDI_PROGCHANGE`](#group__defines_1gaefb3f1595ffbb9db66b46c2c919a3d42) {#group__defines_1gaefb3f1595ffbb9db66b46c2c919a3d42}
|
||||||
|
|
||||||
|
#### `define `[`MIDI_CHANPRESSURE`](#group__defines_1gaeb3281cc7fcd0daade8ed3d2dfc33dbe) {#group__defines_1gaeb3281cc7fcd0daade8ed3d2dfc33dbe}
|
||||||
|
|
||||||
|
#### `define `[`MIDI_CLOCK`](#group__defines_1gafa5e4e295aafd15ab7893344599b3b89) {#group__defines_1gafa5e4e295aafd15ab7893344599b3b89}
|
||||||
|
|
||||||
|
#### `define `[`MIDI_TICK`](#group__defines_1ga3b99408ff864613765d4c3c2ceb52aa7) {#group__defines_1ga3b99408ff864613765d4c3c2ceb52aa7}
|
||||||
|
|
||||||
|
#### `define `[`MIDI_START`](#group__defines_1ga8233631c85823aa546f932ad8975caa4) {#group__defines_1ga8233631c85823aa546f932ad8975caa4}
|
||||||
|
|
||||||
|
#### `define `[`MIDI_CONTINUE`](#group__defines_1gab24430f0081e27215b0da84dd0ee745c) {#group__defines_1gab24430f0081e27215b0da84dd0ee745c}
|
||||||
|
|
||||||
|
#### `define `[`MIDI_STOP`](#group__defines_1ga3af9271d4b1f0d22904a0b055f48cf62) {#group__defines_1ga3af9271d4b1f0d22904a0b055f48cf62}
|
||||||
|
|
||||||
|
#### `define `[`MIDI_ACTIVESENSE`](#group__defines_1gacd88ed42dba52bb4b2052c5656362677) {#group__defines_1gacd88ed42dba52bb4b2052c5656362677}
|
||||||
|
|
||||||
|
#### `define `[`MIDI_RESET`](#group__defines_1ga02947f30ca62dc332fdeb10c5868323b) {#group__defines_1ga02947f30ca62dc332fdeb10c5868323b}
|
||||||
|
|
||||||
|
#### `define `[`MIDI_TC_QUARTERFRAME`](#group__defines_1gaaa072f33590e236d1bfd8f28e833ae31) {#group__defines_1gaaa072f33590e236d1bfd8f28e833ae31}
|
||||||
|
|
||||||
|
#### `define `[`MIDI_SONGPOSITION`](#group__defines_1ga412f6ed33a2150051374bee334ee1705) {#group__defines_1ga412f6ed33a2150051374bee334ee1705}
|
||||||
|
|
||||||
|
#### `define `[`MIDI_SONGSELECT`](#group__defines_1gafcab254838b028365ae0259729e72c4e) {#group__defines_1gafcab254838b028365ae0259729e72c4e}
|
||||||
|
|
||||||
|
#### `define `[`MIDI_TUNEREQUEST`](#group__defines_1ga8100b907b8c0a84e58b1c53dcd9bd795) {#group__defines_1ga8100b907b8c0a84e58b1c53dcd9bd795}
|
||||||
|
|
||||||
|
#### `define `[`SYSEX_EDUMANUFID`](#group__defines_1ga5ef855ed955b00a2239ca16afbeb164f) {#group__defines_1ga5ef855ed955b00a2239ca16afbeb164f}
|
||||||
|
|
169
docs/api_input_callback_reg.md
Normal file
169
docs/api_input_callback_reg.md
Normal file
@ -0,0 +1,169 @@
|
|||||||
|
# group `input_callback_reg` {#group__input__callback__reg}
|
||||||
|
|
||||||
|
These are the functions you use to register your input callbacks.
|
||||||
|
|
||||||
|
The functions are called when the appropriate midi message is matched on the associated device's input.
|
||||||
|
|
||||||
|
## Summary
|
||||||
|
|
||||||
|
Members | Descriptions
|
||||||
|
--------------------------------|---------------------------------------------
|
||||||
|
`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.
|
||||||
|
`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.
|
||||||
|
`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.
|
||||||
|
`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.
|
||||||
|
`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.
|
||||||
|
`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.
|
||||||
|
`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.
|
||||||
|
`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.
|
||||||
|
`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.
|
||||||
|
`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.
|
||||||
|
`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.
|
||||||
|
`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.
|
||||||
|
`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.
|
||||||
|
`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.
|
||||||
|
`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.
|
||||||
|
|
||||||
|
## Members
|
||||||
|
|
||||||
|
#### `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}
|
||||||
|
|
||||||
|
Register a control change message (cc) callback.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
* `device` the device associate with
|
||||||
|
|
||||||
|
* `func` the callback function to register
|
||||||
|
|
||||||
|
#### `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}
|
||||||
|
|
||||||
|
Register a note on callback.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
* `device` the device associate with
|
||||||
|
|
||||||
|
* `func` the callback function to register
|
||||||
|
|
||||||
|
#### `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}
|
||||||
|
|
||||||
|
Register a note off callback.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
* `device` the device associate with
|
||||||
|
|
||||||
|
* `func` the callback function to register
|
||||||
|
|
||||||
|
#### `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}
|
||||||
|
|
||||||
|
Register an after touch callback.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
* `device` the device associate with
|
||||||
|
|
||||||
|
* `func` the callback function to register
|
||||||
|
|
||||||
|
#### `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}
|
||||||
|
|
||||||
|
Register a pitch bend callback.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
* `device` the device associate with
|
||||||
|
|
||||||
|
* `func` the callback function to register
|
||||||
|
|
||||||
|
#### `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}
|
||||||
|
|
||||||
|
Register a song position callback.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
* `device` the device associate with
|
||||||
|
|
||||||
|
* `func` the callback function to register
|
||||||
|
|
||||||
|
#### `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}
|
||||||
|
|
||||||
|
Register a program change callback.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
* `device` the device associate with
|
||||||
|
|
||||||
|
* `func` the callback function to register
|
||||||
|
|
||||||
|
#### `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}
|
||||||
|
|
||||||
|
Register a channel pressure callback.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
* `device` the device associate with
|
||||||
|
|
||||||
|
* `func` the callback function to register
|
||||||
|
|
||||||
|
#### `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}
|
||||||
|
|
||||||
|
Register a song select callback.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
* `device` the device associate with
|
||||||
|
|
||||||
|
* `func` the callback function to register
|
||||||
|
|
||||||
|
#### `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}
|
||||||
|
|
||||||
|
Register a tc quarter frame callback.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
* `device` the device associate with
|
||||||
|
|
||||||
|
* `func` the callback function to register
|
||||||
|
|
||||||
|
#### `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}
|
||||||
|
|
||||||
|
Register a realtime callback.
|
||||||
|
|
||||||
|
The callback will be called for all of the real time message types.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
* `device` the device associate with
|
||||||
|
|
||||||
|
* `func` the callback function to register
|
||||||
|
|
||||||
|
#### `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}
|
||||||
|
|
||||||
|
Register a tune request callback.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
* `device` the device associate with
|
||||||
|
|
||||||
|
* `func` the callback function to register
|
||||||
|
|
||||||
|
#### `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}
|
||||||
|
|
||||||
|
Register a sysex callback.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
* `device` the device associate with
|
||||||
|
|
||||||
|
* `func` the callback function to register
|
||||||
|
|
||||||
|
#### `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}
|
||||||
|
|
||||||
|
Register fall through callback.
|
||||||
|
|
||||||
|
This 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.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
* `device` the device associate with
|
||||||
|
|
||||||
|
* `func` the callback function to register
|
||||||
|
|
||||||
|
#### `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}
|
||||||
|
|
||||||
|
Register a catch all callback.
|
||||||
|
|
||||||
|
If registered, the catch all callback is called for every message that is matched, even if a more specific or the fallthrough callback is registered.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
* `device` the device associate with
|
||||||
|
|
||||||
|
* `func` the callback function to register
|
||||||
|
|
143
docs/api_midi_device.md
Normal file
143
docs/api_midi_device.md
Normal file
@ -0,0 +1,143 @@
|
|||||||
|
# group `midi_device` {#group__midi__device}
|
||||||
|
|
||||||
|
You use the functions when you are implementing your own midi device.
|
||||||
|
|
||||||
|
You 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
|
||||||
|
|
||||||
|
You use the midi_device_input to process input data from the device and pass it through the device's associated callbacks.
|
||||||
|
|
||||||
|
You 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
|
||||||
|
|
||||||
|
## Summary
|
||||||
|
|
||||||
|
Members | Descriptions
|
||||||
|
--------------------------------|---------------------------------------------
|
||||||
|
`define `[`MIDI_INPUT_QUEUE_LENGTH`](#group__midi__device_1ga4aaa419caebdca2bbdfc1331e79781a8) |
|
||||||
|
`enum `[`input_state_t`](#group__midi__device_1gac203e877d3df4275ceb8e7180a61f621) |
|
||||||
|
`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.
|
||||||
|
`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.
|
||||||
|
`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.
|
||||||
|
`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.
|
||||||
|
|
||||||
|
## Members
|
||||||
|
|
||||||
|
#### `define `[`MIDI_INPUT_QUEUE_LENGTH`](#group__midi__device_1ga4aaa419caebdca2bbdfc1331e79781a8) {#group__midi__device_1ga4aaa419caebdca2bbdfc1331e79781a8}
|
||||||
|
|
||||||
|
#### `enum `[`input_state_t`](#group__midi__device_1gac203e877d3df4275ceb8e7180a61f621) {#group__midi__device_1gac203e877d3df4275ceb8e7180a61f621}
|
||||||
|
|
||||||
|
Values | Descriptions
|
||||||
|
--------------------------------|---------------------------------------------
|
||||||
|
IDLE |
|
||||||
|
ONE_BYTE_MESSAGE |
|
||||||
|
TWO_BYTE_MESSAGE |
|
||||||
|
THREE_BYTE_MESSAGE |
|
||||||
|
SYSEX_MESSAGE |
|
||||||
|
|
||||||
|
#### `public void `[`midi_device_input`](#group__midi__device_1gad8d3db8eb35d9cfa51ef036a0a9d70db)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t cnt,uint8_t * input)` {#group__midi__device_1gad8d3db8eb35d9cfa51ef036a0a9d70db}
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
* `device` the midi device to associate the input with
|
||||||
|
|
||||||
|
* `cnt` the number of bytes you are processing
|
||||||
|
|
||||||
|
* `input` the bytes to process
|
||||||
|
|
||||||
|
#### `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}
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
* `device` the midi device to associate this callback with
|
||||||
|
|
||||||
|
* `send_func` the callback function that will do the sending
|
||||||
|
|
||||||
|
#### `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}
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
* `device` the midi device to associate this callback with
|
||||||
|
|
||||||
|
* `midi_no_byte_func_t` the actual callback function
|
||||||
|
|
||||||
|
# struct `_midi_device` {#struct__midi__device}
|
||||||
|
|
||||||
|
This structure represents the input and output functions and processing data for a midi device.
|
||||||
|
|
||||||
|
A device can represent an actual physical device [serial port, usb port] or something virtual. You should not need to modify this structure directly.
|
||||||
|
|
||||||
|
## Summary
|
||||||
|
|
||||||
|
Members | Descriptions
|
||||||
|
--------------------------------|---------------------------------------------
|
||||||
|
`public midi_var_byte_func_t `[`send_func`](docs/api_midi_device.md#struct__midi__device_1a25d4c94b4bbccd5b98f1032b469f3ff9) |
|
||||||
|
`public midi_three_byte_func_t `[`input_cc_callback`](docs/api_midi_device.md#struct__midi__device_1a6da5236c1bc73877728df92d213a78d1) |
|
||||||
|
`public midi_three_byte_func_t `[`input_noteon_callback`](docs/api_midi_device.md#struct__midi__device_1aa10b15cf1a7fb825a5df0d2abbe34a1c) |
|
||||||
|
`public midi_three_byte_func_t `[`input_noteoff_callback`](docs/api_midi_device.md#struct__midi__device_1aaf290043078534d3a5a0ea4c840eba84) |
|
||||||
|
`public midi_three_byte_func_t `[`input_aftertouch_callback`](docs/api_midi_device.md#struct__midi__device_1acb0b4901c545cec4b28b126f2d8c315f) |
|
||||||
|
`public midi_three_byte_func_t `[`input_pitchbend_callback`](docs/api_midi_device.md#struct__midi__device_1a305fea672caeb996f2233bf8cd2bef18) |
|
||||||
|
`public midi_three_byte_func_t `[`input_songposition_callback`](docs/api_midi_device.md#struct__midi__device_1a5f3f13638b3fef3fc561ed1bf301d586) |
|
||||||
|
`public midi_two_byte_func_t `[`input_progchange_callback`](docs/api_midi_device.md#struct__midi__device_1adaf1da617c9a10a9dcad00ab1959d3da) |
|
||||||
|
`public midi_two_byte_func_t `[`input_chanpressure_callback`](docs/api_midi_device.md#struct__midi__device_1ab7ca2925c539915d43974eff604d85f7) |
|
||||||
|
`public midi_two_byte_func_t `[`input_songselect_callback`](docs/api_midi_device.md#struct__midi__device_1a89bed8a5a55376120cfc0a62b42f057f) |
|
||||||
|
`public midi_two_byte_func_t `[`input_tc_quarterframe_callback`](docs/api_midi_device.md#struct__midi__device_1ad9813e75d22e284f9f65a907d20600f0) |
|
||||||
|
`public midi_one_byte_func_t `[`input_realtime_callback`](docs/api_midi_device.md#struct__midi__device_1a9448eba4afb7e43650434748db3777be) |
|
||||||
|
`public midi_one_byte_func_t `[`input_tunerequest_callback`](docs/api_midi_device.md#struct__midi__device_1a0cb8fd53e00cf1d4202d4fa04d038e8d) |
|
||||||
|
`public midi_sysex_func_t `[`input_sysex_callback`](docs/api_midi_device.md#struct__midi__device_1afff9a0ce641762aaef24c1e6953ec9a2) |
|
||||||
|
`public midi_var_byte_func_t `[`input_fallthrough_callback`](docs/api_midi_device.md#struct__midi__device_1abb974ec6d734001b4a0e370f292be503) |
|
||||||
|
`public midi_var_byte_func_t `[`input_catchall_callback`](docs/api_midi_device.md#struct__midi__device_1aae0d535129d4fd650edc98eb3f7584f8) |
|
||||||
|
`public midi_no_byte_func_t `[`pre_input_process_callback`](docs/api_midi_device.md#struct__midi__device_1aeb0bb8923d66c23d874e177dc4265754) |
|
||||||
|
`public uint8_t `[`input_buffer`](docs/api_midi_device.md#struct__midi__device_1a7c5684857d6af4ebc4dc12da27bd6b2a) |
|
||||||
|
`public input_state_t `[`input_state`](docs/api_midi_device.md#struct__midi__device_1a69a687d2d1c449ec15a11c07a5722e39) |
|
||||||
|
`public uint16_t `[`input_count`](docs/api_midi_device.md#struct__midi__device_1a68dea8e7b6151e89c85c95caa612ee5d) |
|
||||||
|
`public uint8_t `[`input_queue_data`](docs/api_midi_device.md#struct__midi__device_1ada41de021135dc423abedcbb30f366ff) |
|
||||||
|
`public `[`byteQueue_t`](#structbyte_queue__t)` `[`input_queue`](#struct__midi__device_1a49c8538a8a02193c58e28a56eb695d8f) |
|
||||||
|
|
||||||
|
## Members
|
||||||
|
|
||||||
|
#### `public midi_var_byte_func_t `[`send_func`](docs/api_midi_device.md#struct__midi__device_1a25d4c94b4bbccd5b98f1032b469f3ff9) {#struct__midi__device_1a25d4c94b4bbccd5b98f1032b469f3ff9}
|
||||||
|
|
||||||
|
#### `public midi_three_byte_func_t `[`input_cc_callback`](docs/api_midi_device.md#struct__midi__device_1a6da5236c1bc73877728df92d213a78d1) {#struct__midi__device_1a6da5236c1bc73877728df92d213a78d1}
|
||||||
|
|
||||||
|
#### `public midi_three_byte_func_t `[`input_noteon_callback`](docs/api_midi_device.md#struct__midi__device_1aa10b15cf1a7fb825a5df0d2abbe34a1c) {#struct__midi__device_1aa10b15cf1a7fb825a5df0d2abbe34a1c}
|
||||||
|
|
||||||
|
#### `public midi_three_byte_func_t `[`input_noteoff_callback`](docs/api_midi_device.md#struct__midi__device_1aaf290043078534d3a5a0ea4c840eba84) {#struct__midi__device_1aaf290043078534d3a5a0ea4c840eba84}
|
||||||
|
|
||||||
|
#### `public midi_three_byte_func_t `[`input_aftertouch_callback`](docs/api_midi_device.md#struct__midi__device_1acb0b4901c545cec4b28b126f2d8c315f) {#struct__midi__device_1acb0b4901c545cec4b28b126f2d8c315f}
|
||||||
|
|
||||||
|
#### `public midi_three_byte_func_t `[`input_pitchbend_callback`](docs/api_midi_device.md#struct__midi__device_1a305fea672caeb996f2233bf8cd2bef18) {#struct__midi__device_1a305fea672caeb996f2233bf8cd2bef18}
|
||||||
|
|
||||||
|
#### `public midi_three_byte_func_t `[`input_songposition_callback`](docs/api_midi_device.md#struct__midi__device_1a5f3f13638b3fef3fc561ed1bf301d586) {#struct__midi__device_1a5f3f13638b3fef3fc561ed1bf301d586}
|
||||||
|
|
||||||
|
#### `public midi_two_byte_func_t `[`input_progchange_callback`](docs/api_midi_device.md#struct__midi__device_1adaf1da617c9a10a9dcad00ab1959d3da) {#struct__midi__device_1adaf1da617c9a10a9dcad00ab1959d3da}
|
||||||
|
|
||||||
|
#### `public midi_two_byte_func_t `[`input_chanpressure_callback`](docs/api_midi_device.md#struct__midi__device_1ab7ca2925c539915d43974eff604d85f7) {#struct__midi__device_1ab7ca2925c539915d43974eff604d85f7}
|
||||||
|
|
||||||
|
#### `public midi_two_byte_func_t `[`input_songselect_callback`](docs/api_midi_device.md#struct__midi__device_1a89bed8a5a55376120cfc0a62b42f057f) {#struct__midi__device_1a89bed8a5a55376120cfc0a62b42f057f}
|
||||||
|
|
||||||
|
#### `public midi_two_byte_func_t `[`input_tc_quarterframe_callback`](docs/api_midi_device.md#struct__midi__device_1ad9813e75d22e284f9f65a907d20600f0) {#struct__midi__device_1ad9813e75d22e284f9f65a907d20600f0}
|
||||||
|
|
||||||
|
#### `public midi_one_byte_func_t `[`input_realtime_callback`](docs/api_midi_device.md#struct__midi__device_1a9448eba4afb7e43650434748db3777be) {#struct__midi__device_1a9448eba4afb7e43650434748db3777be}
|
||||||
|
|
||||||
|
#### `public midi_one_byte_func_t `[`input_tunerequest_callback`](docs/api_midi_device.md#struct__midi__device_1a0cb8fd53e00cf1d4202d4fa04d038e8d) {#struct__midi__device_1a0cb8fd53e00cf1d4202d4fa04d038e8d}
|
||||||
|
|
||||||
|
#### `public midi_sysex_func_t `[`input_sysex_callback`](docs/api_midi_device.md#struct__midi__device_1afff9a0ce641762aaef24c1e6953ec9a2) {#struct__midi__device_1afff9a0ce641762aaef24c1e6953ec9a2}
|
||||||
|
|
||||||
|
#### `public midi_var_byte_func_t `[`input_fallthrough_callback`](docs/api_midi_device.md#struct__midi__device_1abb974ec6d734001b4a0e370f292be503) {#struct__midi__device_1abb974ec6d734001b4a0e370f292be503}
|
||||||
|
|
||||||
|
#### `public midi_var_byte_func_t `[`input_catchall_callback`](docs/api_midi_device.md#struct__midi__device_1aae0d535129d4fd650edc98eb3f7584f8) {#struct__midi__device_1aae0d535129d4fd650edc98eb3f7584f8}
|
||||||
|
|
||||||
|
#### `public midi_no_byte_func_t `[`pre_input_process_callback`](docs/api_midi_device.md#struct__midi__device_1aeb0bb8923d66c23d874e177dc4265754) {#struct__midi__device_1aeb0bb8923d66c23d874e177dc4265754}
|
||||||
|
|
||||||
|
#### `public uint8_t `[`input_buffer`](docs/api_midi_device.md#struct__midi__device_1a7c5684857d6af4ebc4dc12da27bd6b2a) {#struct__midi__device_1a7c5684857d6af4ebc4dc12da27bd6b2a}
|
||||||
|
|
||||||
|
#### `public input_state_t `[`input_state`](docs/api_midi_device.md#struct__midi__device_1a69a687d2d1c449ec15a11c07a5722e39) {#struct__midi__device_1a69a687d2d1c449ec15a11c07a5722e39}
|
||||||
|
|
||||||
|
#### `public uint16_t `[`input_count`](docs/api_midi_device.md#struct__midi__device_1a68dea8e7b6151e89c85c95caa612ee5d) {#struct__midi__device_1a68dea8e7b6151e89c85c95caa612ee5d}
|
||||||
|
|
||||||
|
#### `public uint8_t `[`input_queue_data`](docs/api_midi_device.md#struct__midi__device_1ada41de021135dc423abedcbb30f366ff) {#struct__midi__device_1ada41de021135dc423abedcbb30f366ff}
|
||||||
|
|
||||||
|
#### `public `[`byteQueue_t`](#structbyte_queue__t)` `[`input_queue`](#struct__midi__device_1a49c8538a8a02193c58e28a56eb695d8f) {#struct__midi__device_1a49c8538a8a02193c58e28a56eb695d8f}
|
||||||
|
|
31
docs/api_midi_device_setup_process.md
Normal file
31
docs/api_midi_device_setup_process.md
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
# group `midi_device_setup_process` {#group__midi__device__setup__process}
|
||||||
|
|
||||||
|
These are method that you must use to initialize and run a device.
|
||||||
|
|
||||||
|
## Summary
|
||||||
|
|
||||||
|
Members | Descriptions
|
||||||
|
--------------------------------|---------------------------------------------
|
||||||
|
`public void `[`midi_device_init`](#group__midi__device__setup__process_1gaf29deddc94ea98a59daa0bde1aefd9d9)`(`[`MidiDevice`](#struct__midi__device)` * device)` | Initialize a device.
|
||||||
|
`public void `[`midi_device_process`](#group__midi__device__setup__process_1gaa3d5993d0e998a1b59bbf5ab9c7b492b)`(`[`MidiDevice`](#struct__midi__device)` * device)` | Process input data.
|
||||||
|
|
||||||
|
## Members
|
||||||
|
|
||||||
|
#### `public void `[`midi_device_init`](#group__midi__device__setup__process_1gaf29deddc94ea98a59daa0bde1aefd9d9)`(`[`MidiDevice`](#struct__midi__device)` * device)` {#group__midi__device__setup__process_1gaf29deddc94ea98a59daa0bde1aefd9d9}
|
||||||
|
|
||||||
|
Initialize a device.
|
||||||
|
|
||||||
|
You must call this before using the device in question.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
* `device` the device to initialize
|
||||||
|
|
||||||
|
#### `public void `[`midi_device_process`](#group__midi__device__setup__process_1gaa3d5993d0e998a1b59bbf5ab9c7b492b)`(`[`MidiDevice`](#struct__midi__device)` * device)` {#group__midi__device__setup__process_1gaa3d5993d0e998a1b59bbf5ab9c7b492b}
|
||||||
|
|
||||||
|
Process input data.
|
||||||
|
|
||||||
|
This method drives the input processing, you must call this method frequently if you expect to have your input callbacks called.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
* `device` the device to process
|
||||||
|
|
54
docs/api_midi_util.md
Normal file
54
docs/api_midi_util.md
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
# group `midi_util` {#group__midi__util}
|
||||||
|
|
||||||
|
## Summary
|
||||||
|
|
||||||
|
Members | Descriptions
|
||||||
|
--------------------------------|---------------------------------------------
|
||||||
|
`enum `[`midi_packet_length_t`](#group__midi__util_1gae29ff56aee2b430ffe53933b97e5e79e) | An enumeration of the possible packet length values.
|
||||||
|
`public bool `[`midi_is_statusbyte`](#group__midi__util_1ga12e3b42ff9cbb4b4f2bc455fc8743ee5)`(uint8_t theByte)` | Test to see if the byte given is a status byte.
|
||||||
|
`public bool `[`midi_is_realtime`](#group__midi__util_1gad2f52c363e34a8000d80c983c324e2d7)`(uint8_t theByte)` | Test to see if the byte given is a realtime message.
|
||||||
|
`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.
|
||||||
|
|
||||||
|
## Members
|
||||||
|
|
||||||
|
#### `enum `[`midi_packet_length_t`](#group__midi__util_1gae29ff56aee2b430ffe53933b97e5e79e) {#group__midi__util_1gae29ff56aee2b430ffe53933b97e5e79e}
|
||||||
|
|
||||||
|
Values | Descriptions
|
||||||
|
--------------------------------|---------------------------------------------
|
||||||
|
UNDEFINED |
|
||||||
|
ONE |
|
||||||
|
TWO |
|
||||||
|
THREE |
|
||||||
|
|
||||||
|
An enumeration of the possible packet length values.
|
||||||
|
|
||||||
|
#### `public bool `[`midi_is_statusbyte`](#group__midi__util_1ga12e3b42ff9cbb4b4f2bc455fc8743ee5)`(uint8_t theByte)` {#group__midi__util_1ga12e3b42ff9cbb4b4f2bc455fc8743ee5}
|
||||||
|
|
||||||
|
Test to see if the byte given is a status byte.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
* `theByte` the byte to test
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
true if the byte given is a midi status byte
|
||||||
|
|
||||||
|
#### `public bool `[`midi_is_realtime`](#group__midi__util_1gad2f52c363e34a8000d80c983c324e2d7)`(uint8_t theByte)` {#group__midi__util_1gad2f52c363e34a8000d80c983c324e2d7}
|
||||||
|
|
||||||
|
Test to see if the byte given is a realtime message.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
* `theByte` the byte to test
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
true if it is a realtime message, false otherwise
|
||||||
|
|
||||||
|
#### `public `[`midi_packet_length_t`](#group__midi__util_1gae29ff56aee2b430ffe53933b97e5e79e)` `[`midi_packet_length`](#group__midi__util_1gaa168b43af6ae9de0debce1625e4b8175)`(uint8_t status)` {#group__midi__util_1gaa168b43af6ae9de0debce1625e4b8175}
|
||||||
|
|
||||||
|
Find the length of the packet associated with the status byte given.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
* `status` the status byte
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
the length of the packet, will return UNDEFINED if the byte is not a status byte or if it is a sysex status byte
|
||||||
|
|
241
docs/api_send_functions.md
Normal file
241
docs/api_send_functions.md
Normal file
@ -0,0 +1,241 @@
|
|||||||
|
# group `send_functions` {#group__send__functions}
|
||||||
|
|
||||||
|
These are the functions you use to send midi data through a device.
|
||||||
|
|
||||||
|
## Summary
|
||||||
|
|
||||||
|
Members | Descriptions
|
||||||
|
--------------------------------|---------------------------------------------
|
||||||
|
`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.
|
||||||
|
`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.
|
||||||
|
`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.
|
||||||
|
`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.
|
||||||
|
`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.
|
||||||
|
`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.
|
||||||
|
`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.
|
||||||
|
`public void `[`midi_send_clock`](#group__send__functions_1ga4e1b11a7cdb0875f6e03ce7c79c581aa)`(`[`MidiDevice`](#struct__midi__device)` * device)` | Send a clock message via the given device.
|
||||||
|
`public void `[`midi_send_tick`](#group__send__functions_1ga2b43c7d433d940c5b907595aac947972)`(`[`MidiDevice`](#struct__midi__device)` * device)` | Send a tick message via the given device.
|
||||||
|
`public void `[`midi_send_start`](#group__send__functions_1ga1569749a8d58ccc56789289d7c7245cc)`(`[`MidiDevice`](#struct__midi__device)` * device)` | Send a start message via the given device.
|
||||||
|
`public void `[`midi_send_continue`](#group__send__functions_1gaed5dc29d754a27372e89ab8bc20ee120)`(`[`MidiDevice`](#struct__midi__device)` * device)` | Send a continue message via the given device.
|
||||||
|
`public void `[`midi_send_stop`](#group__send__functions_1ga026e1a620276cb653ac501aa0d12a988)`(`[`MidiDevice`](#struct__midi__device)` * device)` | Send a stop message via the given device.
|
||||||
|
`public void `[`midi_send_activesense`](#group__send__functions_1ga9b6e4c6ce4719d2604187b325620db37)`(`[`MidiDevice`](#struct__midi__device)` * device)` | Send an active sense message via the given device.
|
||||||
|
`public void `[`midi_send_reset`](#group__send__functions_1ga3671e39a6d93ca9568fc493001af1b1b)`(`[`MidiDevice`](#struct__midi__device)` * device)` | Send a reset message via the given device.
|
||||||
|
`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.
|
||||||
|
`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.
|
||||||
|
`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.
|
||||||
|
`public void `[`midi_send_tunerequest`](#group__send__functions_1ga8db6c7e04d48e4d2266dd59118ca0656)`(`[`MidiDevice`](#struct__midi__device)` * device)` | Send a tune request message via the given device.
|
||||||
|
`public void `[`midi_send_byte`](#group__send__functions_1ga857e85eb90b288385642d4d991e09881)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t b)` | Send a byte via the given device.
|
||||||
|
`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.
|
||||||
|
`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.
|
||||||
|
|
||||||
|
## Members
|
||||||
|
|
||||||
|
#### `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}
|
||||||
|
|
||||||
|
Send a control change message (cc) via the given device.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
* `device` the device to use for sending
|
||||||
|
|
||||||
|
* `chan` the channel to send on, 0-15
|
||||||
|
|
||||||
|
* `num` the cc num
|
||||||
|
|
||||||
|
* `val` the value of that cc num
|
||||||
|
|
||||||
|
#### `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}
|
||||||
|
|
||||||
|
Send a note on message via the given device.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
* `device` the device to use for sending
|
||||||
|
|
||||||
|
* `chan` the channel to send on, 0-15
|
||||||
|
|
||||||
|
* `num` the note number
|
||||||
|
|
||||||
|
* `vel` the note velocity
|
||||||
|
|
||||||
|
#### `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}
|
||||||
|
|
||||||
|
Send a note off message via the given device.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
* `device` the device to use for sending
|
||||||
|
|
||||||
|
* `chan` the channel to send on, 0-15
|
||||||
|
|
||||||
|
* `num` the note number
|
||||||
|
|
||||||
|
* `vel` the note velocity
|
||||||
|
|
||||||
|
#### `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}
|
||||||
|
|
||||||
|
Send an after touch message via the given device.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
* `device` the device to use for sending
|
||||||
|
|
||||||
|
* `chan` the channel to send on, 0-15
|
||||||
|
|
||||||
|
* `note_num` the note number
|
||||||
|
|
||||||
|
* `amt` the after touch amount
|
||||||
|
|
||||||
|
#### `public void `[`midi_send_pitchbend`](#group__send__functions_1gae5a4a1e71611e7534be80af9ce3d3491)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t chan,int16_t amt)` {#group__send__functions_1gae5a4a1e71611e7534be80af9ce3d3491}
|
||||||
|
|
||||||
|
Send a pitch bend message via the given device.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
* `device` the device to use for sending
|
||||||
|
|
||||||
|
* `chan` the channel to send on, 0-15
|
||||||
|
|
||||||
|
* `amt` the bend amount range: -8192..8191, 0 means no bend
|
||||||
|
|
||||||
|
#### `public void `[`midi_send_programchange`](#group__send__functions_1ga7b15588ef25e5e1ff09c2afc3151ce86)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t chan,uint8_t num)` {#group__send__functions_1ga7b15588ef25e5e1ff09c2afc3151ce86}
|
||||||
|
|
||||||
|
Send a program change message via the given device.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
* `device` the device to use for sending
|
||||||
|
|
||||||
|
* `chan` the channel to send on, 0-15
|
||||||
|
|
||||||
|
* `num` the program to change to
|
||||||
|
|
||||||
|
#### `public void `[`midi_send_channelpressure`](#group__send__functions_1gaf23e69fdf812e89c0036f51f88ab2e1b)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t chan,uint8_t amt)` {#group__send__functions_1gaf23e69fdf812e89c0036f51f88ab2e1b}
|
||||||
|
|
||||||
|
Send a channel pressure message via the given device.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
* `device` the device to use for sending
|
||||||
|
|
||||||
|
* `chan` the channel to send on, 0-15
|
||||||
|
|
||||||
|
* `amt` the amount of channel pressure
|
||||||
|
|
||||||
|
#### `public void `[`midi_send_clock`](#group__send__functions_1ga4e1b11a7cdb0875f6e03ce7c79c581aa)`(`[`MidiDevice`](#struct__midi__device)` * device)` {#group__send__functions_1ga4e1b11a7cdb0875f6e03ce7c79c581aa}
|
||||||
|
|
||||||
|
Send a clock message via the given device.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
* `device` the device to use for sending
|
||||||
|
|
||||||
|
#### `public void `[`midi_send_tick`](#group__send__functions_1ga2b43c7d433d940c5b907595aac947972)`(`[`MidiDevice`](#struct__midi__device)` * device)` {#group__send__functions_1ga2b43c7d433d940c5b907595aac947972}
|
||||||
|
|
||||||
|
Send a tick message via the given device.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
* `device` the device to use for sending
|
||||||
|
|
||||||
|
#### `public void `[`midi_send_start`](#group__send__functions_1ga1569749a8d58ccc56789289d7c7245cc)`(`[`MidiDevice`](#struct__midi__device)` * device)` {#group__send__functions_1ga1569749a8d58ccc56789289d7c7245cc}
|
||||||
|
|
||||||
|
Send a start message via the given device.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
* `device` the device to use for sending
|
||||||
|
|
||||||
|
#### `public void `[`midi_send_continue`](#group__send__functions_1gaed5dc29d754a27372e89ab8bc20ee120)`(`[`MidiDevice`](#struct__midi__device)` * device)` {#group__send__functions_1gaed5dc29d754a27372e89ab8bc20ee120}
|
||||||
|
|
||||||
|
Send a continue message via the given device.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
* `device` the device to use for sending
|
||||||
|
|
||||||
|
#### `public void `[`midi_send_stop`](#group__send__functions_1ga026e1a620276cb653ac501aa0d12a988)`(`[`MidiDevice`](#struct__midi__device)` * device)` {#group__send__functions_1ga026e1a620276cb653ac501aa0d12a988}
|
||||||
|
|
||||||
|
Send a stop message via the given device.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
* `device` the device to use for sending
|
||||||
|
|
||||||
|
#### `public void `[`midi_send_activesense`](#group__send__functions_1ga9b6e4c6ce4719d2604187b325620db37)`(`[`MidiDevice`](#struct__midi__device)` * device)` {#group__send__functions_1ga9b6e4c6ce4719d2604187b325620db37}
|
||||||
|
|
||||||
|
Send an active sense message via the given device.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
* `device` the device to use for sending
|
||||||
|
|
||||||
|
#### `public void `[`midi_send_reset`](#group__send__functions_1ga3671e39a6d93ca9568fc493001af1b1b)`(`[`MidiDevice`](#struct__midi__device)` * device)` {#group__send__functions_1ga3671e39a6d93ca9568fc493001af1b1b}
|
||||||
|
|
||||||
|
Send a reset message via the given device.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
* `device` the device to use for sending
|
||||||
|
|
||||||
|
#### `public void `[`midi_send_tcquarterframe`](#group__send__functions_1ga5b85639910eec280bb744c934d0fd45a)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t time)` {#group__send__functions_1ga5b85639910eec280bb744c934d0fd45a}
|
||||||
|
|
||||||
|
Send a tc quarter frame message via the given device.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
* `device` the device to use for sending
|
||||||
|
|
||||||
|
* `time` the time of this quarter frame, range 0..16383
|
||||||
|
|
||||||
|
#### `public void `[`midi_send_songposition`](#group__send__functions_1gab1c9eeef3b57a8cd2e6128d18e85eb7f)`(`[`MidiDevice`](#struct__midi__device)` * device,uint16_t pos)` {#group__send__functions_1gab1c9eeef3b57a8cd2e6128d18e85eb7f}
|
||||||
|
|
||||||
|
Send a song position message via the given device.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
* `device` the device to use for sending
|
||||||
|
|
||||||
|
* `pos` the song position
|
||||||
|
|
||||||
|
#### `public void `[`midi_send_songselect`](#group__send__functions_1ga42de7838ba70d949af9a50f9facc3c50)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t song)` {#group__send__functions_1ga42de7838ba70d949af9a50f9facc3c50}
|
||||||
|
|
||||||
|
Send a song select message via the given device.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
* `device` the device to use for sending
|
||||||
|
|
||||||
|
* `song` the song to select
|
||||||
|
|
||||||
|
#### `public void `[`midi_send_tunerequest`](#group__send__functions_1ga8db6c7e04d48e4d2266dd59118ca0656)`(`[`MidiDevice`](#struct__midi__device)` * device)` {#group__send__functions_1ga8db6c7e04d48e4d2266dd59118ca0656}
|
||||||
|
|
||||||
|
Send a tune request message via the given device.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
* `device` the device to use for sending
|
||||||
|
|
||||||
|
#### `public void `[`midi_send_byte`](#group__send__functions_1ga857e85eb90b288385642d4d991e09881)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t b)` {#group__send__functions_1ga857e85eb90b288385642d4d991e09881}
|
||||||
|
|
||||||
|
Send a byte via the given device.
|
||||||
|
|
||||||
|
This 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.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
* `device` the device to use for sending
|
||||||
|
|
||||||
|
* `b` the byte to send
|
||||||
|
|
||||||
|
#### `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}
|
||||||
|
|
||||||
|
Send up to 3 bytes of data.
|
||||||
|
|
||||||
|
% 4 is applied to count so that you can use this to pass sysex through
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
* `device` the device to use for sending
|
||||||
|
|
||||||
|
* `count` the count of bytes to send, %4 is applied
|
||||||
|
|
||||||
|
* `byte0` the first byte
|
||||||
|
|
||||||
|
* `byte1` the second byte, ignored if cnt % 4 != 2
|
||||||
|
|
||||||
|
* `byte2` the third byte, ignored if cnt % 4 != 3
|
||||||
|
|
||||||
|
#### `public void `[`midi_send_array`](#group__send__functions_1ga245243cb1da18d2cea18d4b18d846ead)`(`[`MidiDevice`](#struct__midi__device)` * device,uint16_t count,uint8_t * array)` {#group__send__functions_1ga245243cb1da18d2cea18d4b18d846ead}
|
||||||
|
|
||||||
|
Send an array of formatted midi data.
|
||||||
|
|
||||||
|
Can be used for sysex.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
* `device` the device to use for sending
|
||||||
|
|
||||||
|
* `count` the count of bytes to send
|
||||||
|
|
||||||
|
* `array` the array of bytes
|
||||||
|
|
61
docs/api_sysex_tools.md
Normal file
61
docs/api_sysex_tools.md
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
# group `sysex_tools` {#group__sysex__tools}
|
||||||
|
|
||||||
|
## Summary
|
||||||
|
|
||||||
|
Members | Descriptions
|
||||||
|
--------------------------------|---------------------------------------------
|
||||||
|
`public uint16_t `[`sysex_encoded_length`](#group__sysex__tools_1ga061e5607030412d6e62e2390d8013f0a)`(uint16_t decoded_length)` | Compute the length of a message after it is encoded.
|
||||||
|
`public uint16_t `[`sysex_decoded_length`](#group__sysex__tools_1ga121fc227d3acc1c0ea08c9a5c26fa3b0)`(uint16_t encoded_length)` | Compute the length of a message after it is decoded.
|
||||||
|
`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.
|
||||||
|
`public uint16_t `[`sysex_decode`](#group__sysex__tools_1gaaad1d9ba2d5eca709a0ab4ba40662229)`(uint8_t * decoded,const uint8_t * source,uint16_t length)` | Decode encoded data.
|
||||||
|
|
||||||
|
## Members
|
||||||
|
|
||||||
|
#### `public uint16_t `[`sysex_encoded_length`](#group__sysex__tools_1ga061e5607030412d6e62e2390d8013f0a)`(uint16_t decoded_length)` {#group__sysex__tools_1ga061e5607030412d6e62e2390d8013f0a}
|
||||||
|
|
||||||
|
Compute the length of a message after it is encoded.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
* `decoded_length` The length, in bytes, of the message to encode.
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
The length, in bytes, of the message after encodeing.
|
||||||
|
|
||||||
|
#### `public uint16_t `[`sysex_decoded_length`](#group__sysex__tools_1ga121fc227d3acc1c0ea08c9a5c26fa3b0)`(uint16_t encoded_length)` {#group__sysex__tools_1ga121fc227d3acc1c0ea08c9a5c26fa3b0}
|
||||||
|
|
||||||
|
Compute the length of a message after it is decoded.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
* `encoded_length` The length, in bytes, of the encoded message.
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
The length, in bytes, of the message after it is decoded.
|
||||||
|
|
||||||
|
#### `public uint16_t `[`sysex_encode`](#group__sysex__tools_1ga54d77f8d32f92a6f329daefa2b314742)`(uint8_t * encoded,const uint8_t * source,uint16_t length)` {#group__sysex__tools_1ga54d77f8d32f92a6f329daefa2b314742}
|
||||||
|
|
||||||
|
Encode data so that it can be transmitted safely in a sysex message.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
* `encoded` The output data buffer, must be at least sysex_encoded_length(length) bytes long.
|
||||||
|
|
||||||
|
* `source` The input buffer of data to be encoded.
|
||||||
|
|
||||||
|
* `length` The number of bytes from the input buffer to encode.
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
number of bytes encoded.
|
||||||
|
|
||||||
|
#### `public uint16_t `[`sysex_decode`](#group__sysex__tools_1gaaad1d9ba2d5eca709a0ab4ba40662229)`(uint8_t * decoded,const uint8_t * source,uint16_t length)` {#group__sysex__tools_1gaaad1d9ba2d5eca709a0ab4ba40662229}
|
||||||
|
|
||||||
|
Decode encoded data.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
* `decoded` The output data buffer, must be at least sysex_decoded_length(length) bytes long.
|
||||||
|
|
||||||
|
* `source` The input buffer of data to be decoded.
|
||||||
|
|
||||||
|
* `length` The number of bytes from the input buffer to decode.
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
number of bytes decoded.
|
||||||
|
|
32
doxygen-todo
Normal file
32
doxygen-todo
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
tmk_core/protocol
|
||||||
|
tmk_core/protocol/bluefruit
|
||||||
|
tmk_core/protocol/chibios
|
||||||
|
tmk_core/protocol/iwrap
|
||||||
|
tmk_core/protocol/lufa
|
||||||
|
tmk_core/protocol/mbed
|
||||||
|
tmk_core/protocol/midi
|
||||||
|
tmk_core/protocol/midi/bytequeue
|
||||||
|
tmk_core/protocol/midi/Config
|
||||||
|
tmk_core/protocol/pjrc
|
||||||
|
tmk_core/protocol/usb_hid
|
||||||
|
tmk_core/protocol/vusb
|
||||||
|
tmk_core/tool
|
||||||
|
tmk_core/tool/chibios
|
||||||
|
quantum
|
||||||
|
quantum/api
|
||||||
|
quantum/audio
|
||||||
|
quantum/keymap_extras
|
||||||
|
quantum/process_keycode
|
||||||
|
quantum/serial_link
|
||||||
|
quantum/serial_link/protocol
|
||||||
|
quantum/serial_link/system
|
||||||
|
quantum/serial_link/tests
|
||||||
|
quantum/tools
|
||||||
|
quantum/visualizer
|
||||||
|
quantum/visualizer/resources
|
||||||
|
drivers
|
||||||
|
drivers/avr
|
||||||
|
drivers/ugfx
|
||||||
|
drivers/ugfx/gdisp
|
||||||
|
drivers/ugfx/gdisp/is31fl3731c
|
||||||
|
drivers/ugfx/gdisp/st7565
|
@ -44,6 +44,10 @@ int retro_tapping_counter = 0;
|
|||||||
#include <fauxclicky.h>
|
#include <fauxclicky.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/** \brief Called to execute an action.
|
||||||
|
*
|
||||||
|
* FIXME: Needs documentation.
|
||||||
|
*/
|
||||||
void action_exec(keyevent_t event)
|
void action_exec(keyevent_t event)
|
||||||
{
|
{
|
||||||
if (!IS_NOEVENT(event)) {
|
if (!IS_NOEVENT(event)) {
|
||||||
@ -95,6 +99,10 @@ void action_exec(keyevent_t event)
|
|||||||
bool swap_hands = false;
|
bool swap_hands = false;
|
||||||
bool swap_held = false;
|
bool swap_held = false;
|
||||||
|
|
||||||
|
/** \brief Process Hand Swap
|
||||||
|
*
|
||||||
|
* FIXME: Needs documentation.
|
||||||
|
*/
|
||||||
void process_hand_swap(keyevent_t *event) {
|
void process_hand_swap(keyevent_t *event) {
|
||||||
static swap_state_row_t swap_state[MATRIX_ROWS];
|
static swap_state_row_t swap_state[MATRIX_ROWS];
|
||||||
|
|
||||||
@ -134,7 +142,10 @@ bool process_record_quantum(keyrecord_t *record) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifndef NO_ACTION_TAPPING
|
#ifndef NO_ACTION_TAPPING
|
||||||
// Allows for handling tap-hold actions immediately instead of waiting for TAPPING_TERM or another keypress.
|
/** \brief Allows for handling tap-hold actions immediately instead of waiting for TAPPING_TERM or another keypress.
|
||||||
|
*
|
||||||
|
* FIXME: Needs documentation.
|
||||||
|
*/
|
||||||
void process_record_tap_hint(keyrecord_t *record)
|
void process_record_tap_hint(keyrecord_t *record)
|
||||||
{
|
{
|
||||||
action_t action = layer_switch_get_action(record->event.key);
|
action_t action = layer_switch_get_action(record->event.key);
|
||||||
@ -154,6 +165,10 @@ void process_record_tap_hint(keyrecord_t *record)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/** \brief Take a key event (key press or key release) and processes it.
|
||||||
|
*
|
||||||
|
* FIXME: Needs documentation.
|
||||||
|
*/
|
||||||
void process_record(keyrecord_t *record)
|
void process_record(keyrecord_t *record)
|
||||||
{
|
{
|
||||||
if (IS_NOEVENT(record->event)) { return; }
|
if (IS_NOEVENT(record->event)) { return; }
|
||||||
@ -172,6 +187,10 @@ void process_record(keyrecord_t *record)
|
|||||||
process_action(record, action);
|
process_action(record, action);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Take an action and processes it.
|
||||||
|
*
|
||||||
|
* FIXME: Needs documentation.
|
||||||
|
*/
|
||||||
void process_action(keyrecord_t *record, action_t action)
|
void process_action(keyrecord_t *record, action_t action)
|
||||||
{
|
{
|
||||||
keyevent_t event = record->event;
|
keyevent_t event = record->event;
|
||||||
@ -674,8 +693,9 @@ void process_action(keyrecord_t *record, action_t action)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/** \brief Utilities for actions. (FIXME: Needs better description)
|
||||||
* Utilities for actions.
|
*
|
||||||
|
* FIXME: Needs documentation.
|
||||||
*/
|
*/
|
||||||
void register_code(uint8_t code)
|
void register_code(uint8_t code)
|
||||||
{
|
{
|
||||||
@ -755,6 +775,10 @@ void register_code(uint8_t code)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Utilities for actions. (FIXME: Needs better description)
|
||||||
|
*
|
||||||
|
* FIXME: Needs documentation.
|
||||||
|
*/
|
||||||
void unregister_code(uint8_t code)
|
void unregister_code(uint8_t code)
|
||||||
{
|
{
|
||||||
if (code == KC_NO) {
|
if (code == KC_NO) {
|
||||||
@ -810,6 +834,10 @@ void unregister_code(uint8_t code)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Utilities for actions. (FIXME: Needs better description)
|
||||||
|
*
|
||||||
|
* FIXME: Needs documentation.
|
||||||
|
*/
|
||||||
void register_mods(uint8_t mods)
|
void register_mods(uint8_t mods)
|
||||||
{
|
{
|
||||||
if (mods) {
|
if (mods) {
|
||||||
@ -818,6 +846,10 @@ void register_mods(uint8_t mods)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Utilities for actions. (FIXME: Needs better description)
|
||||||
|
*
|
||||||
|
* FIXME: Needs documentation.
|
||||||
|
*/
|
||||||
void unregister_mods(uint8_t mods)
|
void unregister_mods(uint8_t mods)
|
||||||
{
|
{
|
||||||
if (mods) {
|
if (mods) {
|
||||||
@ -826,12 +858,20 @@ void unregister_mods(uint8_t mods)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Utilities for actions. (FIXME: Needs better description)
|
||||||
|
*
|
||||||
|
* FIXME: Needs documentation.
|
||||||
|
*/
|
||||||
void clear_keyboard(void)
|
void clear_keyboard(void)
|
||||||
{
|
{
|
||||||
clear_mods();
|
clear_mods();
|
||||||
clear_keyboard_but_mods();
|
clear_keyboard_but_mods();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Utilities for actions. (FIXME: Needs better description)
|
||||||
|
*
|
||||||
|
* FIXME: Needs documentation.
|
||||||
|
*/
|
||||||
void clear_keyboard_but_mods(void)
|
void clear_keyboard_but_mods(void)
|
||||||
{
|
{
|
||||||
clear_weak_mods();
|
clear_weak_mods();
|
||||||
@ -848,6 +888,10 @@ void clear_keyboard_but_mods(void)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Utilities for actions. (FIXME: Needs better description)
|
||||||
|
*
|
||||||
|
* FIXME: Needs documentation.
|
||||||
|
*/
|
||||||
bool is_tap_key(keypos_t key)
|
bool is_tap_key(keypos_t key)
|
||||||
{
|
{
|
||||||
action_t action = layer_switch_get_action(key);
|
action_t action = layer_switch_get_action(key);
|
||||||
@ -880,14 +924,19 @@ bool is_tap_key(keypos_t key)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/** \brief Debug print (FIXME: Needs better description)
|
||||||
* debug print
|
*
|
||||||
|
* FIXME: Needs documentation.
|
||||||
*/
|
*/
|
||||||
void debug_event(keyevent_t event)
|
void debug_event(keyevent_t event)
|
||||||
{
|
{
|
||||||
dprintf("%04X%c(%u)", (event.key.row<<8 | event.key.col), (event.pressed ? 'd' : 'u'), event.time);
|
dprintf("%04X%c(%u)", (event.key.row<<8 | event.key.col), (event.pressed ? 'd' : 'u'), event.time);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Debug print (FIXME: Needs better description)
|
||||||
|
*
|
||||||
|
* FIXME: Needs documentation.
|
||||||
|
*/
|
||||||
void debug_record(keyrecord_t record)
|
void debug_record(keyrecord_t record)
|
||||||
{
|
{
|
||||||
debug_event(record.event);
|
debug_event(record.event);
|
||||||
@ -896,6 +945,10 @@ void debug_record(keyrecord_t record)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Debug print (FIXME: Needs better description)
|
||||||
|
*
|
||||||
|
* FIXME: Needs documentation.
|
||||||
|
*/
|
||||||
void debug_action(action_t action)
|
void debug_action(action_t action)
|
||||||
{
|
{
|
||||||
switch (action.kind.id) {
|
switch (action.kind.id) {
|
||||||
|
@ -17,10 +17,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
#ifndef ACTION_CODE_H
|
#ifndef ACTION_CODE_H
|
||||||
#define ACTION_CODE_H
|
#define ACTION_CODE_H
|
||||||
|
|
||||||
/* Action codes
|
/** \brief Action codes
|
||||||
* ============
|
|
||||||
* 16bit code: action_kind(4bit) + action_parameter(12bit)
|
|
||||||
*
|
*
|
||||||
|
* 16bit code: action_kind(4bit) + action_parameter(12bit)
|
||||||
*
|
*
|
||||||
* Key Actions(00xx)
|
* Key Actions(00xx)
|
||||||
* -----------------
|
* -----------------
|
||||||
@ -38,7 +37,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
* 001r|mods|0000 00xx (reserved)
|
* 001r|mods|0000 00xx (reserved)
|
||||||
* 001r|mods| keycode Modifiers with Tap Key(Dual role)
|
* 001r|mods| keycode Modifiers with Tap Key(Dual role)
|
||||||
*
|
*
|
||||||
*
|
|
||||||
* Other Keys(01xx)
|
* Other Keys(01xx)
|
||||||
* ----------------
|
* ----------------
|
||||||
* ACT_USAGE(0100): TODO: Not needed?
|
* ACT_USAGE(0100): TODO: Not needed?
|
||||||
@ -47,17 +45,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
* 0100|10| usage(10) (reserved)
|
* 0100|10| usage(10) (reserved)
|
||||||
* 0100|11| usage(10) (reserved)
|
* 0100|11| usage(10) (reserved)
|
||||||
*
|
*
|
||||||
*
|
|
||||||
* ACT_MOUSEKEY(0101): TODO: Merge these two actions to conserve space?
|
* ACT_MOUSEKEY(0101): TODO: Merge these two actions to conserve space?
|
||||||
* 0101|xxxx| keycode Mouse key
|
* 0101|xxxx| keycode Mouse key
|
||||||
*
|
*
|
||||||
* ACT_SWAP_HANDS(0110):
|
* ACT_SWAP_HANDS(0110):
|
||||||
* 0110|xxxx| keycode Swap hands (keycode on tap, or options)
|
* 0110|xxxx| keycode Swap hands (keycode on tap, or options)
|
||||||
*
|
*
|
||||||
*
|
|
||||||
* 0111|xxxx xxxx xxxx (reserved)
|
* 0111|xxxx xxxx xxxx (reserved)
|
||||||
*
|
*
|
||||||
*
|
|
||||||
* Layer Actions(10xx)
|
* Layer Actions(10xx)
|
||||||
* -------------------
|
* -------------------
|
||||||
* ACT_LAYER(1000):
|
* ACT_LAYER(1000):
|
||||||
@ -84,7 +79,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
* 101E|LLLL|1111 xxxx Reserved (0xF5-FF)
|
* 101E|LLLL|1111 xxxx Reserved (0xF5-FF)
|
||||||
* ELLLL: layer 0-31(E: extra bit for layer 16-31)
|
* ELLLL: layer 0-31(E: extra bit for layer 16-31)
|
||||||
*
|
*
|
||||||
*
|
|
||||||
* Extensions(11xx)
|
* Extensions(11xx)
|
||||||
* ----------------
|
* ----------------
|
||||||
* ACT_MACRO(1100):
|
* ACT_MACRO(1100):
|
||||||
@ -126,7 +120,7 @@ enum action_kind_id {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/* Action Code Struct
|
/** \brief Action Code Struct
|
||||||
*
|
*
|
||||||
* NOTE:
|
* NOTE:
|
||||||
* In avr-gcc bit field seems to be assigned from LSB(bit0) to MSB(bit15).
|
* In avr-gcc bit field seems to be assigned from LSB(bit0) to MSB(bit15).
|
||||||
@ -198,10 +192,9 @@ typedef union {
|
|||||||
#define ACTION(kind, param) ((kind)<<12 | (param))
|
#define ACTION(kind, param) ((kind)<<12 | (param))
|
||||||
|
|
||||||
|
|
||||||
/*
|
/** \brief Key Actions
|
||||||
* Key Actions
|
*
|
||||||
*/
|
* Mod bits: 43210
|
||||||
/* Mod bits: 43210
|
|
||||||
* bit 0 ||||+- Control
|
* bit 0 ||||+- Control
|
||||||
* bit 1 |||+-- Shift
|
* bit 1 |||+-- Shift
|
||||||
* bit 2 ||+--- Alt
|
* bit 2 ||+--- Alt
|
||||||
@ -230,8 +223,7 @@ enum mods_codes {
|
|||||||
#define ACTION_MODS_TAP_TOGGLE(mods) ACTION(ACT_MODS_TAP, ((mods)&0x1f)<<8 | MODS_TAP_TOGGLE)
|
#define ACTION_MODS_TAP_TOGGLE(mods) ACTION(ACT_MODS_TAP, ((mods)&0x1f)<<8 | MODS_TAP_TOGGLE)
|
||||||
|
|
||||||
|
|
||||||
/*
|
/** \brief Other Keys
|
||||||
* Other Keys
|
|
||||||
*/
|
*/
|
||||||
enum usage_pages {
|
enum usage_pages {
|
||||||
PAGE_SYSTEM,
|
PAGE_SYSTEM,
|
||||||
@ -243,20 +235,25 @@ enum usage_pages {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/** \brief Layer Actions
|
||||||
* Layer Actions
|
|
||||||
*/
|
*/
|
||||||
enum layer_param_on {
|
enum layer_param_on {
|
||||||
ON_PRESS = 1,
|
ON_PRESS = 1,
|
||||||
ON_RELEASE = 2,
|
ON_RELEASE = 2,
|
||||||
ON_BOTH = 3,
|
ON_BOTH = 3,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/** \brief Layer Actions
|
||||||
|
*/
|
||||||
enum layer_param_bit_op {
|
enum layer_param_bit_op {
|
||||||
OP_BIT_AND = 0,
|
OP_BIT_AND = 0,
|
||||||
OP_BIT_OR = 1,
|
OP_BIT_OR = 1,
|
||||||
OP_BIT_XOR = 2,
|
OP_BIT_XOR = 2,
|
||||||
OP_BIT_SET = 3,
|
OP_BIT_SET = 3,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/** \brief Layer Actions
|
||||||
|
*/
|
||||||
enum layer_param_tap_op {
|
enum layer_param_tap_op {
|
||||||
OP_TAP_TOGGLE = 0xF0,
|
OP_TAP_TOGGLE = 0xF0,
|
||||||
OP_ON_OFF,
|
OP_ON_OFF,
|
||||||
@ -296,8 +293,7 @@ enum layer_param_tap_op {
|
|||||||
#define ACTION_DEFAULT_LAYER_BIT_SET(part, bits) ACTION_LAYER_BITOP(OP_BIT_SET, (part), (bits), 0)
|
#define ACTION_DEFAULT_LAYER_BIT_SET(part, bits) ACTION_LAYER_BITOP(OP_BIT_SET, (part), (bits), 0)
|
||||||
|
|
||||||
|
|
||||||
/*
|
/** \brief Extensions
|
||||||
* Extensions
|
|
||||||
*/
|
*/
|
||||||
enum backlight_opt {
|
enum backlight_opt {
|
||||||
BACKLIGHT_INCREASE = 0,
|
BACKLIGHT_INCREASE = 0,
|
||||||
|
@ -11,16 +11,23 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/*
|
/** \brief Default Layer State
|
||||||
* Default Layer State
|
|
||||||
*/
|
*/
|
||||||
uint32_t default_layer_state = 0;
|
uint32_t default_layer_state = 0;
|
||||||
|
|
||||||
|
/** \brief Default Layer State Set At Keyboard Level
|
||||||
|
*
|
||||||
|
* FIXME: Needs docs
|
||||||
|
*/
|
||||||
__attribute__((weak))
|
__attribute__((weak))
|
||||||
uint32_t default_layer_state_set_kb(uint32_t state) {
|
uint32_t default_layer_state_set_kb(uint32_t state) {
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Default Layer State Set
|
||||||
|
*
|
||||||
|
* FIXME: Needs docs
|
||||||
|
*/
|
||||||
static void default_layer_state_set(uint32_t state)
|
static void default_layer_state_set(uint32_t state)
|
||||||
{
|
{
|
||||||
state = default_layer_state_set_kb(state);
|
state = default_layer_state_set_kb(state);
|
||||||
@ -31,25 +38,45 @@ static void default_layer_state_set(uint32_t state)
|
|||||||
clear_keyboard_but_mods(); // To avoid stuck keys
|
clear_keyboard_but_mods(); // To avoid stuck keys
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Default Layer Print
|
||||||
|
*
|
||||||
|
* FIXME: Needs docs
|
||||||
|
*/
|
||||||
void default_layer_debug(void)
|
void default_layer_debug(void)
|
||||||
{
|
{
|
||||||
dprintf("%08lX(%u)", default_layer_state, biton32(default_layer_state));
|
dprintf("%08lX(%u)", default_layer_state, biton32(default_layer_state));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Default Layer Set
|
||||||
|
*
|
||||||
|
* FIXME: Needs docs
|
||||||
|
*/
|
||||||
void default_layer_set(uint32_t state)
|
void default_layer_set(uint32_t state)
|
||||||
{
|
{
|
||||||
default_layer_state_set(state);
|
default_layer_state_set(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef NO_ACTION_LAYER
|
#ifndef NO_ACTION_LAYER
|
||||||
|
/** \brief Default Layer Or
|
||||||
|
*
|
||||||
|
* FIXME: Needs docs
|
||||||
|
*/
|
||||||
void default_layer_or(uint32_t state)
|
void default_layer_or(uint32_t state)
|
||||||
{
|
{
|
||||||
default_layer_state_set(default_layer_state | state);
|
default_layer_state_set(default_layer_state | state);
|
||||||
}
|
}
|
||||||
|
/** \brief Default Layer And
|
||||||
|
*
|
||||||
|
* FIXME: Needs docs
|
||||||
|
*/
|
||||||
void default_layer_and(uint32_t state)
|
void default_layer_and(uint32_t state)
|
||||||
{
|
{
|
||||||
default_layer_state_set(default_layer_state & state);
|
default_layer_state_set(default_layer_state & state);
|
||||||
}
|
}
|
||||||
|
/** \brief Default Layer Xor
|
||||||
|
*
|
||||||
|
* FIXME: Needs docs
|
||||||
|
*/
|
||||||
void default_layer_xor(uint32_t state)
|
void default_layer_xor(uint32_t state)
|
||||||
{
|
{
|
||||||
default_layer_state_set(default_layer_state ^ state);
|
default_layer_state_set(default_layer_state ^ state);
|
||||||
@ -58,21 +85,32 @@ void default_layer_xor(uint32_t state)
|
|||||||
|
|
||||||
|
|
||||||
#ifndef NO_ACTION_LAYER
|
#ifndef NO_ACTION_LAYER
|
||||||
/*
|
/** \brief Keymap Layer State
|
||||||
* Keymap Layer State
|
|
||||||
*/
|
*/
|
||||||
uint32_t layer_state = 0;
|
uint32_t layer_state = 0;
|
||||||
|
|
||||||
|
/** \brief Layer state set user
|
||||||
|
*
|
||||||
|
* FIXME: Needs docs
|
||||||
|
*/
|
||||||
__attribute__((weak))
|
__attribute__((weak))
|
||||||
uint32_t layer_state_set_user(uint32_t state) {
|
uint32_t layer_state_set_user(uint32_t state) {
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Layer state set keyboard
|
||||||
|
*
|
||||||
|
* FIXME: Needs docs
|
||||||
|
*/
|
||||||
__attribute__((weak))
|
__attribute__((weak))
|
||||||
uint32_t layer_state_set_kb(uint32_t state) {
|
uint32_t layer_state_set_kb(uint32_t state) {
|
||||||
return layer_state_set_user(state);
|
return layer_state_set_user(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Layer state set
|
||||||
|
*
|
||||||
|
* FIXME: Needs docs
|
||||||
|
*/
|
||||||
void layer_state_set(uint32_t state)
|
void layer_state_set(uint32_t state)
|
||||||
{
|
{
|
||||||
state = layer_state_set_kb(state);
|
state = layer_state_set_kb(state);
|
||||||
@ -83,54 +121,98 @@ void layer_state_set(uint32_t state)
|
|||||||
clear_keyboard_but_mods(); // To avoid stuck keys
|
clear_keyboard_but_mods(); // To avoid stuck keys
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Layer clear
|
||||||
|
*
|
||||||
|
* FIXME: Needs docs
|
||||||
|
*/
|
||||||
void layer_clear(void)
|
void layer_clear(void)
|
||||||
{
|
{
|
||||||
layer_state_set(0);
|
layer_state_set(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Layer state is
|
||||||
|
*
|
||||||
|
* FIXME: Needs docs
|
||||||
|
*/
|
||||||
bool layer_state_is(uint8_t layer)
|
bool layer_state_is(uint8_t layer)
|
||||||
{
|
{
|
||||||
return layer_state_cmp(layer_state, layer);
|
return layer_state_cmp(layer_state, layer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Layer state compare
|
||||||
|
*
|
||||||
|
* FIXME: Needs docs
|
||||||
|
*/
|
||||||
bool layer_state_cmp(uint32_t cmp_layer_state, uint8_t layer) {
|
bool layer_state_cmp(uint32_t cmp_layer_state, uint8_t layer) {
|
||||||
if (!cmp_layer_state) { return layer == 0; }
|
if (!cmp_layer_state) { return layer == 0; }
|
||||||
return (cmp_layer_state & (1UL<<layer)) != 0;
|
return (cmp_layer_state & (1UL<<layer)) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Layer move
|
||||||
|
*
|
||||||
|
* FIXME: Needs docs
|
||||||
|
*/
|
||||||
void layer_move(uint8_t layer)
|
void layer_move(uint8_t layer)
|
||||||
{
|
{
|
||||||
layer_state_set(1UL<<layer);
|
layer_state_set(1UL<<layer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Layer on
|
||||||
|
*
|
||||||
|
* FIXME: Needs docs
|
||||||
|
*/
|
||||||
void layer_on(uint8_t layer)
|
void layer_on(uint8_t layer)
|
||||||
{
|
{
|
||||||
layer_state_set(layer_state | (1UL<<layer));
|
layer_state_set(layer_state | (1UL<<layer));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Layer off
|
||||||
|
*
|
||||||
|
* FIXME: Needs docs
|
||||||
|
*/
|
||||||
void layer_off(uint8_t layer)
|
void layer_off(uint8_t layer)
|
||||||
{
|
{
|
||||||
layer_state_set(layer_state & ~(1UL<<layer));
|
layer_state_set(layer_state & ~(1UL<<layer));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Layer invert
|
||||||
|
*
|
||||||
|
* FIXME: Needs docs
|
||||||
|
*/
|
||||||
void layer_invert(uint8_t layer)
|
void layer_invert(uint8_t layer)
|
||||||
{
|
{
|
||||||
layer_state_set(layer_state ^ (1UL<<layer));
|
layer_state_set(layer_state ^ (1UL<<layer));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Layer or
|
||||||
|
*
|
||||||
|
* FIXME: Needs docs
|
||||||
|
*/
|
||||||
void layer_or(uint32_t state)
|
void layer_or(uint32_t state)
|
||||||
{
|
{
|
||||||
layer_state_set(layer_state | state);
|
layer_state_set(layer_state | state);
|
||||||
}
|
}
|
||||||
|
/** \brief Layer and
|
||||||
|
*
|
||||||
|
* FIXME: Needs docs
|
||||||
|
*/
|
||||||
void layer_and(uint32_t state)
|
void layer_and(uint32_t state)
|
||||||
{
|
{
|
||||||
layer_state_set(layer_state & state);
|
layer_state_set(layer_state & state);
|
||||||
}
|
}
|
||||||
|
/** \brief Layer xor
|
||||||
|
*
|
||||||
|
* FIXME: Needs docs
|
||||||
|
*/
|
||||||
void layer_xor(uint32_t state)
|
void layer_xor(uint32_t state)
|
||||||
{
|
{
|
||||||
layer_state_set(layer_state ^ state);
|
layer_state_set(layer_state ^ state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Layer debug printing
|
||||||
|
*
|
||||||
|
* FIXME: Needs docs
|
||||||
|
*/
|
||||||
void layer_debug(void)
|
void layer_debug(void)
|
||||||
{
|
{
|
||||||
dprintf("%08lX(%u)", layer_state, biton32(layer_state));
|
dprintf("%08lX(%u)", layer_state, biton32(layer_state));
|
||||||
@ -172,7 +254,8 @@ uint8_t read_source_layers_cache(keypos_t key)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/** \brief Store or get action (FIXME: Needs better summary)
|
||||||
|
*
|
||||||
* Make sure the action triggered when the key is released is the same
|
* Make sure the action triggered when the key is released is the same
|
||||||
* one as the one triggered on press. It's important for the mod keys
|
* one as the one triggered on press. It's important for the mod keys
|
||||||
* when the layer is switched after the down event but before the up
|
* 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)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/** \brief Layer switch get layer
|
||||||
|
*
|
||||||
|
* FIXME: Needs docs
|
||||||
|
*/
|
||||||
int8_t layer_switch_get_layer(keypos_t key)
|
int8_t layer_switch_get_layer(keypos_t key)
|
||||||
{
|
{
|
||||||
#ifndef NO_ACTION_LAYER
|
#ifndef NO_ACTION_LAYER
|
||||||
@ -224,6 +311,10 @@ int8_t layer_switch_get_layer(keypos_t key)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Layer switch get layer
|
||||||
|
*
|
||||||
|
* FIXME: Needs docs
|
||||||
|
*/
|
||||||
action_t layer_switch_get_action(keypos_t key)
|
action_t layer_switch_get_action(keypos_t key)
|
||||||
{
|
{
|
||||||
return action_for_key(layer_switch_get_layer(key), key);
|
return action_for_key(layer_switch_get_layer(key), key);
|
||||||
|
@ -29,6 +29,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
#ifndef NO_ACTION_MACRO
|
#ifndef NO_ACTION_MACRO
|
||||||
|
|
||||||
#define MACRO_READ() (macro = MACRO_GET(macro_p++))
|
#define MACRO_READ() (macro = MACRO_GET(macro_p++))
|
||||||
|
/** \brief Action Macro Play
|
||||||
|
*
|
||||||
|
* FIXME: Needs doc
|
||||||
|
*/
|
||||||
void action_macro_play(const macro_t *macro_p)
|
void action_macro_play(const macro_t *macro_p)
|
||||||
{
|
{
|
||||||
macro_t macro = END;
|
macro_t macro = END;
|
||||||
|
@ -36,6 +36,10 @@ static void debug_tapping_key(void);
|
|||||||
static void debug_waiting_buffer(void);
|
static void debug_waiting_buffer(void);
|
||||||
|
|
||||||
|
|
||||||
|
/** \brief Action Tapping Process
|
||||||
|
*
|
||||||
|
* FIXME: Needs doc
|
||||||
|
*/
|
||||||
void action_tapping_process(keyrecord_t record)
|
void action_tapping_process(keyrecord_t record)
|
||||||
{
|
{
|
||||||
if (process_tapping(&record)) {
|
if (process_tapping(&record)) {
|
||||||
@ -70,7 +74,7 @@ void action_tapping_process(keyrecord_t record)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Tapping
|
/** \brief Tapping
|
||||||
*
|
*
|
||||||
* Rule: Tap key is typed(pressed and released) within TAPPING_TERM.
|
* Rule: Tap key is typed(pressed and released) within TAPPING_TERM.
|
||||||
* (without interfering by typing other key)
|
* (without interfering by typing other key)
|
||||||
@ -289,8 +293,9 @@ bool process_tapping(keyrecord_t *keyp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/** \brief Waiting buffer enq
|
||||||
* Waiting buffer
|
*
|
||||||
|
* FIXME: Needs docs
|
||||||
*/
|
*/
|
||||||
bool waiting_buffer_enq(keyrecord_t record)
|
bool waiting_buffer_enq(keyrecord_t record)
|
||||||
{
|
{
|
||||||
@ -310,12 +315,20 @@ bool waiting_buffer_enq(keyrecord_t record)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Waiting buffer clear
|
||||||
|
*
|
||||||
|
* FIXME: Needs docs
|
||||||
|
*/
|
||||||
void waiting_buffer_clear(void)
|
void waiting_buffer_clear(void)
|
||||||
{
|
{
|
||||||
waiting_buffer_head = 0;
|
waiting_buffer_head = 0;
|
||||||
waiting_buffer_tail = 0;
|
waiting_buffer_tail = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Waiting buffer typed
|
||||||
|
*
|
||||||
|
* FIXME: Needs docs
|
||||||
|
*/
|
||||||
bool waiting_buffer_typed(keyevent_t event)
|
bool waiting_buffer_typed(keyevent_t event)
|
||||||
{
|
{
|
||||||
for (uint8_t i = waiting_buffer_tail; i != waiting_buffer_head; i = (i + 1) % WAITING_BUFFER_SIZE) {
|
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)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Waiting buffer has anykey pressed
|
||||||
|
*
|
||||||
|
* FIXME: Needs docs
|
||||||
|
*/
|
||||||
__attribute__((unused))
|
__attribute__((unused))
|
||||||
bool waiting_buffer_has_anykey_pressed(void)
|
bool waiting_buffer_has_anykey_pressed(void)
|
||||||
{
|
{
|
||||||
@ -335,7 +352,10 @@ bool waiting_buffer_has_anykey_pressed(void)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* scan buffer for tapping */
|
/** \brief Scan buffer for tapping
|
||||||
|
*
|
||||||
|
* FIXME: Needs docs
|
||||||
|
*/
|
||||||
void waiting_buffer_scan_tap(void)
|
void waiting_buffer_scan_tap(void)
|
||||||
{
|
{
|
||||||
// tapping already is settled
|
// tapping already is settled
|
||||||
@ -359,14 +379,19 @@ void waiting_buffer_scan_tap(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/** \brief Tapping key debug print
|
||||||
* debug print
|
*
|
||||||
|
* FIXME: Needs docs
|
||||||
*/
|
*/
|
||||||
static void debug_tapping_key(void)
|
static void debug_tapping_key(void)
|
||||||
{
|
{
|
||||||
debug("TAPPING_KEY="); debug_record(tapping_key); debug("\n");
|
debug("TAPPING_KEY="); debug_record(tapping_key); debug("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Waiting buffer debug print
|
||||||
|
*
|
||||||
|
* FIXME: Needs docs
|
||||||
|
*/
|
||||||
static void debug_waiting_buffer(void)
|
static void debug_waiting_buffer(void)
|
||||||
{
|
{
|
||||||
debug("{ ");
|
debug("{ ");
|
||||||
|
@ -67,12 +67,12 @@ bool has_oneshot_mods_timed_out(void) {
|
|||||||
|
|
||||||
/* oneshot layer */
|
/* oneshot layer */
|
||||||
#ifndef NO_ACTION_ONESHOT
|
#ifndef NO_ACTION_ONESHOT
|
||||||
/* oneshot_layer_data bits
|
/** \brief oneshot_layer_data bits
|
||||||
* LLLL LSSS
|
* LLLL LSSS
|
||||||
* where:
|
* where:
|
||||||
* L => are layer bits
|
* L => are layer bits
|
||||||
* S => oneshot state bits
|
* S => oneshot state bits
|
||||||
*/
|
*/
|
||||||
static int8_t oneshot_layer_data = 0;
|
static int8_t oneshot_layer_data = 0;
|
||||||
|
|
||||||
inline uint8_t get_oneshot_layer(void) { return oneshot_layer_data >> 3; }
|
inline uint8_t get_oneshot_layer(void) { return oneshot_layer_data >> 3; }
|
||||||
@ -86,7 +86,10 @@ inline bool has_oneshot_layer_timed_out() {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Oneshot layer */
|
/** \brief Set oneshot layer
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
void set_oneshot_layer(uint8_t layer, uint8_t state)
|
void set_oneshot_layer(uint8_t layer, uint8_t state)
|
||||||
{
|
{
|
||||||
oneshot_layer_data = layer << 3 | state;
|
oneshot_layer_data = layer << 3 | state;
|
||||||
@ -95,12 +98,20 @@ void set_oneshot_layer(uint8_t layer, uint8_t state)
|
|||||||
oneshot_layer_time = timer_read();
|
oneshot_layer_time = timer_read();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
/** \brief Reset oneshot layer
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
void reset_oneshot_layer(void) {
|
void reset_oneshot_layer(void) {
|
||||||
oneshot_layer_data = 0;
|
oneshot_layer_data = 0;
|
||||||
#if (defined(ONESHOT_TIMEOUT) && (ONESHOT_TIMEOUT > 0))
|
#if (defined(ONESHOT_TIMEOUT) && (ONESHOT_TIMEOUT > 0))
|
||||||
oneshot_layer_time = 0;
|
oneshot_layer_time = 0;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
/** \brief Clear oneshot layer
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
void clear_oneshot_layer_state(oneshot_fullfillment_t state)
|
void clear_oneshot_layer_state(oneshot_fullfillment_t state)
|
||||||
{
|
{
|
||||||
uint8_t start_state = oneshot_layer_data;
|
uint8_t start_state = oneshot_layer_data;
|
||||||
@ -112,12 +123,20 @@ void clear_oneshot_layer_state(oneshot_fullfillment_t state)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/** \brief Is oneshot layer active
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
bool is_oneshot_layer_active(void)
|
bool is_oneshot_layer_active(void)
|
||||||
{
|
{
|
||||||
return get_oneshot_layer_state();
|
return get_oneshot_layer_state();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/** \brief Send keyboard report
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
void send_keyboard_report(void) {
|
void send_keyboard_report(void) {
|
||||||
keyboard_report->mods = real_mods;
|
keyboard_report->mods = real_mods;
|
||||||
keyboard_report->mods |= weak_mods;
|
keyboard_report->mods |= weak_mods;
|
||||||
@ -140,29 +159,90 @@ void send_keyboard_report(void) {
|
|||||||
host_keyboard_send(keyboard_report);
|
host_keyboard_send(keyboard_report);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* modifier */
|
/** \brief Get mods
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
uint8_t get_mods(void) { return real_mods; }
|
uint8_t get_mods(void) { return real_mods; }
|
||||||
|
/** \brief add mods
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
void add_mods(uint8_t mods) { real_mods |= mods; }
|
void add_mods(uint8_t mods) { real_mods |= mods; }
|
||||||
|
/** \brief del mods
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
void del_mods(uint8_t mods) { real_mods &= ~mods; }
|
void del_mods(uint8_t mods) { real_mods &= ~mods; }
|
||||||
|
/** \brief set mods
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
void set_mods(uint8_t mods) { real_mods = mods; }
|
void set_mods(uint8_t mods) { real_mods = mods; }
|
||||||
|
/** \brief clear mods
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
void clear_mods(void) { real_mods = 0; }
|
void clear_mods(void) { real_mods = 0; }
|
||||||
|
|
||||||
/* weak modifier */
|
/** \brief get weak mods
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
uint8_t get_weak_mods(void) { return weak_mods; }
|
uint8_t get_weak_mods(void) { return weak_mods; }
|
||||||
|
/** \brief add weak mods
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
void add_weak_mods(uint8_t mods) { weak_mods |= mods; }
|
void add_weak_mods(uint8_t mods) { weak_mods |= mods; }
|
||||||
|
/** \brief del weak mods
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
void del_weak_mods(uint8_t mods) { weak_mods &= ~mods; }
|
void del_weak_mods(uint8_t mods) { weak_mods &= ~mods; }
|
||||||
|
/** \brief set weak mods
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
void set_weak_mods(uint8_t mods) { weak_mods = mods; }
|
void set_weak_mods(uint8_t mods) { weak_mods = mods; }
|
||||||
|
/** \brief clear weak mods
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
void clear_weak_mods(void) { weak_mods = 0; }
|
void clear_weak_mods(void) { weak_mods = 0; }
|
||||||
|
|
||||||
/* macro modifier */
|
/* macro modifier */
|
||||||
|
/** \brief get macro mods
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
uint8_t get_macro_mods(void) { return macro_mods; }
|
uint8_t get_macro_mods(void) { return macro_mods; }
|
||||||
|
/** \brief add macro mods
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
void add_macro_mods(uint8_t mods) { macro_mods |= mods; }
|
void add_macro_mods(uint8_t mods) { macro_mods |= mods; }
|
||||||
|
/** \brief del macro mods
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
void del_macro_mods(uint8_t mods) { macro_mods &= ~mods; }
|
void del_macro_mods(uint8_t mods) { macro_mods &= ~mods; }
|
||||||
|
/** \brief set macro mods
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
void set_macro_mods(uint8_t mods) { macro_mods = mods; }
|
void set_macro_mods(uint8_t mods) { macro_mods = mods; }
|
||||||
|
/** \brief clear macro mods
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
void clear_macro_mods(void) { macro_mods = 0; }
|
void clear_macro_mods(void) { macro_mods = 0; }
|
||||||
|
|
||||||
/* Oneshot modifier */
|
|
||||||
#ifndef NO_ACTION_ONESHOT
|
#ifndef NO_ACTION_ONESHOT
|
||||||
|
/** \brief set oneshot mods
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
void set_oneshot_mods(uint8_t mods)
|
void set_oneshot_mods(uint8_t mods)
|
||||||
{
|
{
|
||||||
oneshot_mods = mods;
|
oneshot_mods = mods;
|
||||||
@ -170,6 +250,10 @@ void set_oneshot_mods(uint8_t mods)
|
|||||||
oneshot_time = timer_read();
|
oneshot_time = timer_read();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
/** \brief clear oneshot mods
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
void clear_oneshot_mods(void)
|
void clear_oneshot_mods(void)
|
||||||
{
|
{
|
||||||
oneshot_mods = 0;
|
oneshot_mods = 0;
|
||||||
@ -177,14 +261,19 @@ void clear_oneshot_mods(void)
|
|||||||
oneshot_time = 0;
|
oneshot_time = 0;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
/** \brief get oneshot mods
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
uint8_t get_oneshot_mods(void)
|
uint8_t get_oneshot_mods(void)
|
||||||
{
|
{
|
||||||
return oneshot_mods;
|
return oneshot_mods;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/** \brief inspect keyboard state
|
||||||
* inspect keyboard state
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
*/
|
*/
|
||||||
uint8_t has_anymod(void)
|
uint8_t has_anymod(void)
|
||||||
{
|
{
|
||||||
|
@ -13,12 +13,11 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* Bootloader Size in *bytes*
|
/** \brief Bootloader Size in *bytes*
|
||||||
*
|
*
|
||||||
* AVR Boot section size are defined by setting BOOTSZ fuse in fact. Consult with your MCU datasheet.
|
* AVR Boot section size are defined by setting BOOTSZ fuse in fact. Consult with your MCU datasheet.
|
||||||
* Note that 'Word'(2 bytes) size and address are used in datasheet while TMK uses 'Byte'.
|
* Note that 'Word'(2 bytes) size and address are used in datasheet while TMK uses 'Byte'.
|
||||||
*
|
*
|
||||||
*
|
|
||||||
* Size of Bootloaders in bytes:
|
* Size of Bootloaders in bytes:
|
||||||
* Atmel DFU loader(ATmega32U4) 4096
|
* Atmel DFU loader(ATmega32U4) 4096
|
||||||
* Atmel DFU loader(AT90USB128) 8192
|
* Atmel DFU loader(AT90USB128) 8192
|
||||||
@ -28,10 +27,8 @@
|
|||||||
* Teensy halfKay(ATmega32U4) 512
|
* Teensy halfKay(ATmega32U4) 512
|
||||||
* Teensy++ halfKay(AT90USB128) 1024
|
* Teensy++ halfKay(AT90USB128) 1024
|
||||||
*
|
*
|
||||||
*
|
|
||||||
* AVR Boot section is located at the end of Flash memory like the followings.
|
* AVR Boot section is located at the end of Flash memory like the followings.
|
||||||
*
|
*
|
||||||
*
|
|
||||||
* byte Atmel/LUFA(ATMega32u4) byte Atmel(AT90SUB128)
|
* byte Atmel/LUFA(ATMega32u4) byte Atmel(AT90SUB128)
|
||||||
* 0x0000 +---------------+ 0x00000 +---------------+
|
* 0x0000 +---------------+ 0x00000 +---------------+
|
||||||
* | | | |
|
* | | | |
|
||||||
@ -57,7 +54,6 @@
|
|||||||
* | Bootloader | 512B | Bootloader | 1KB
|
* | Bootloader | 512B | Bootloader | 1KB
|
||||||
* 0x7FFF +---------------+ 0x1FFFF +---------------+
|
* 0x7FFF +---------------+ 0x1FFFF +---------------+
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define FLASH_SIZE (FLASHEND + 1L)
|
#define FLASH_SIZE (FLASHEND + 1L)
|
||||||
|
|
||||||
#if !defined(BOOTLOADER_SIZE)
|
#if !defined(BOOTLOADER_SIZE)
|
||||||
@ -69,14 +65,17 @@
|
|||||||
#define BOOT_SIZE_1024 0b010
|
#define BOOT_SIZE_1024 0b010
|
||||||
#define BOOT_SIZE_2048 0b000
|
#define BOOT_SIZE_2048 0b000
|
||||||
|
|
||||||
/*
|
/** \brief Entering the Bootloader via Software
|
||||||
* Entering the Bootloader via Software
|
*
|
||||||
* http://www.fourwalledcubicle.com/files/LUFA/Doc/120730/html/_page__software_bootloader_start.html
|
* http://www.fourwalledcubicle.com/files/LUFA/Doc/120730/html/_page__software_bootloader_start.html
|
||||||
*/
|
*/
|
||||||
#define BOOTLOADER_RESET_KEY 0xB007B007
|
#define BOOTLOADER_RESET_KEY 0xB007B007
|
||||||
uint32_t reset_key __attribute__ ((section (".noinit")));
|
uint32_t reset_key __attribute__ ((section (".noinit")));
|
||||||
|
|
||||||
/* initialize MCU status by watchdog reset */
|
/** \brief initialize MCU status by watchdog reset
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
void bootloader_jump(void) {
|
void bootloader_jump(void) {
|
||||||
|
|
||||||
#if !defined(BOOTLOADER_SIZE)
|
#if !defined(BOOTLOADER_SIZE)
|
||||||
|
@ -18,6 +18,10 @@
|
|||||||
*/
|
*/
|
||||||
#define SLEEP_LED_TIMER_TOP F_CPU/(256*64)
|
#define SLEEP_LED_TIMER_TOP F_CPU/(256*64)
|
||||||
|
|
||||||
|
/** \brief Sleep LED initialization
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
void sleep_led_init(void)
|
void sleep_led_init(void)
|
||||||
{
|
{
|
||||||
/* Timer1 setup */
|
/* Timer1 setup */
|
||||||
@ -33,18 +37,30 @@ void sleep_led_init(void)
|
|||||||
SREG = sreg;
|
SREG = sreg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Sleep LED enable
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
void sleep_led_enable(void)
|
void sleep_led_enable(void)
|
||||||
{
|
{
|
||||||
/* Enable Compare Match Interrupt */
|
/* Enable Compare Match Interrupt */
|
||||||
TIMSK1 |= _BV(OCIE1A);
|
TIMSK1 |= _BV(OCIE1A);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Sleep LED disable
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
void sleep_led_disable(void)
|
void sleep_led_disable(void)
|
||||||
{
|
{
|
||||||
/* Disable Compare Match Interrupt */
|
/* Disable Compare Match Interrupt */
|
||||||
TIMSK1 &= ~_BV(OCIE1A);
|
TIMSK1 &= ~_BV(OCIE1A);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Sleep LED toggle
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
void sleep_led_toggle(void)
|
void sleep_led_toggle(void)
|
||||||
{
|
{
|
||||||
/* Disable Compare Match Interrupt */
|
/* Disable Compare Match Interrupt */
|
||||||
@ -52,7 +68,8 @@ void sleep_led_toggle(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Breathing Sleep LED brighness(PWM On period) table
|
/** \brief Breathing Sleep LED brighness(PWM On period) table
|
||||||
|
*
|
||||||
* (64[steps] * 4[duration]) / 64[PWM periods/s] = 4 second breath cycle
|
* (64[steps] * 4[duration]) / 64[PWM periods/s] = 4 second breath cycle
|
||||||
*
|
*
|
||||||
* http://www.wolframalpha.com/input/?i=%28sin%28+x%2F64*pi%29**8+*+255%2C+x%3D0+to+63
|
* http://www.wolframalpha.com/input/?i=%28sin%28+x%2F64*pi%29**8+*+255%2C+x%3D0+to+63
|
||||||
|
@ -41,6 +41,10 @@ __asm__ __volatile__ ( \
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
/** \brief Suspend idle
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
void suspend_idle(uint8_t time)
|
void suspend_idle(uint8_t time)
|
||||||
{
|
{
|
||||||
cli();
|
cli();
|
||||||
@ -52,7 +56,8 @@ void suspend_idle(uint8_t time)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifndef NO_SUSPEND_POWER_DOWN
|
#ifndef NO_SUSPEND_POWER_DOWN
|
||||||
/* Power down MCU with watchdog timer
|
/** \brief Power down MCU with watchdog timer
|
||||||
|
*
|
||||||
* wdto: watchdog timer timeout defined in <avr/wdt.h>
|
* wdto: watchdog timer timeout defined in <avr/wdt.h>
|
||||||
* WDTO_15MS
|
* WDTO_15MS
|
||||||
* WDTO_30MS
|
* WDTO_30MS
|
||||||
@ -67,6 +72,10 @@ void suspend_idle(uint8_t time)
|
|||||||
*/
|
*/
|
||||||
static uint8_t wdt_timeout = 0;
|
static uint8_t wdt_timeout = 0;
|
||||||
|
|
||||||
|
/** \brief Power down
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
static void power_down(uint8_t wdto)
|
static void power_down(uint8_t wdto)
|
||||||
{
|
{
|
||||||
#ifdef PROTOCOL_LUFA
|
#ifdef PROTOCOL_LUFA
|
||||||
@ -111,6 +120,10 @@ static void power_down(uint8_t wdto)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/** \brief Suspend power down
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
void suspend_power_down(void)
|
void suspend_power_down(void)
|
||||||
{
|
{
|
||||||
#ifndef NO_SUSPEND_POWER_DOWN
|
#ifndef NO_SUSPEND_POWER_DOWN
|
||||||
@ -131,7 +144,10 @@ bool suspend_wakeup_condition(void)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// run immediately after wakeup
|
/** \brief run immediately after wakeup
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
void suspend_wakeup_init(void)
|
void suspend_wakeup_init(void)
|
||||||
{
|
{
|
||||||
// clear keyboard state
|
// clear keyboard state
|
||||||
|
@ -27,6 +27,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
// NOTE: union { uint32_t timer32; struct { uint16_t dummy; uint16_t timer16; }}
|
// NOTE: union { uint32_t timer32; struct { uint16_t dummy; uint16_t timer16; }}
|
||||||
volatile uint32_t timer_count;
|
volatile uint32_t timer_count;
|
||||||
|
|
||||||
|
/** \brief timer initialization
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
void timer_init(void)
|
void timer_init(void)
|
||||||
{
|
{
|
||||||
#if TIMER_PRESCALER == 1
|
#if TIMER_PRESCALER == 1
|
||||||
@ -60,6 +64,10 @@ void timer_init(void)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief timer clear
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
inline
|
inline
|
||||||
void timer_clear(void)
|
void timer_clear(void)
|
||||||
{
|
{
|
||||||
@ -68,6 +76,10 @@ void timer_clear(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief timer read
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
inline
|
inline
|
||||||
uint16_t timer_read(void)
|
uint16_t timer_read(void)
|
||||||
{
|
{
|
||||||
@ -80,6 +92,10 @@ uint16_t timer_read(void)
|
|||||||
return (t & 0xFFFF);
|
return (t & 0xFFFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief timer read32
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
inline
|
inline
|
||||||
uint32_t timer_read32(void)
|
uint32_t timer_read32(void)
|
||||||
{
|
{
|
||||||
@ -92,6 +108,10 @@ uint32_t timer_read32(void)
|
|||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief timer elapsed
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
inline
|
inline
|
||||||
uint16_t timer_elapsed(uint16_t last)
|
uint16_t timer_elapsed(uint16_t last)
|
||||||
{
|
{
|
||||||
@ -104,6 +124,10 @@ uint16_t timer_elapsed(uint16_t last)
|
|||||||
return TIMER_DIFF_16((t & 0xFFFF), last);
|
return TIMER_DIFF_16((t & 0xFFFF), last);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief timer elapsed32
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
inline
|
inline
|
||||||
uint32_t timer_elapsed32(uint32_t last)
|
uint32_t timer_elapsed32(uint32_t last)
|
||||||
{
|
{
|
||||||
|
@ -21,6 +21,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
|
|
||||||
backlight_config_t backlight_config;
|
backlight_config_t backlight_config;
|
||||||
|
|
||||||
|
/** \brief Backlight initialization
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
void backlight_init(void)
|
void backlight_init(void)
|
||||||
{
|
{
|
||||||
/* check signature */
|
/* check signature */
|
||||||
@ -34,6 +38,10 @@ void backlight_init(void)
|
|||||||
backlight_set(backlight_config.enable ? backlight_config.level : 0);
|
backlight_set(backlight_config.enable ? backlight_config.level : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Backlight increase
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
void backlight_increase(void)
|
void backlight_increase(void)
|
||||||
{
|
{
|
||||||
if(backlight_config.level < BACKLIGHT_LEVELS)
|
if(backlight_config.level < BACKLIGHT_LEVELS)
|
||||||
@ -46,6 +54,10 @@ void backlight_increase(void)
|
|||||||
backlight_set(backlight_config.level);
|
backlight_set(backlight_config.level);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Backlight decrease
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
void backlight_decrease(void)
|
void backlight_decrease(void)
|
||||||
{
|
{
|
||||||
if(backlight_config.level > 0)
|
if(backlight_config.level > 0)
|
||||||
@ -58,6 +70,10 @@ void backlight_decrease(void)
|
|||||||
backlight_set(backlight_config.level);
|
backlight_set(backlight_config.level);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Backlight toggle
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
void backlight_toggle(void)
|
void backlight_toggle(void)
|
||||||
{
|
{
|
||||||
backlight_config.enable ^= 1;
|
backlight_config.enable ^= 1;
|
||||||
@ -68,6 +84,10 @@ void backlight_toggle(void)
|
|||||||
backlight_set(backlight_config.enable ? backlight_config.level : 0);
|
backlight_set(backlight_config.enable ? backlight_config.level : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Backlight step through levels
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
void backlight_step(void)
|
void backlight_step(void)
|
||||||
{
|
{
|
||||||
backlight_config.level++;
|
backlight_config.level++;
|
||||||
@ -81,6 +101,10 @@ void backlight_step(void)
|
|||||||
backlight_set(backlight_config.level);
|
backlight_set(backlight_config.level);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Backlight set level
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
void backlight_level(uint8_t level)
|
void backlight_level(uint8_t level)
|
||||||
{
|
{
|
||||||
if (level > BACKLIGHT_LEVELS)
|
if (level > BACKLIGHT_LEVELS)
|
||||||
@ -91,6 +115,10 @@ void backlight_level(uint8_t level)
|
|||||||
backlight_set(backlight_config.level);
|
backlight_set(backlight_config.level);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Get backlight level
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
uint8_t get_backlight_level(void)
|
uint8_t get_backlight_level(void)
|
||||||
{
|
{
|
||||||
return backlight_config.level;
|
return backlight_config.level;
|
||||||
|
@ -12,6 +12,10 @@
|
|||||||
|
|
||||||
keymap_config_t keymap_config;
|
keymap_config_t keymap_config;
|
||||||
|
|
||||||
|
/** \brief Bootmagic
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
void bootmagic(void)
|
void bootmagic(void)
|
||||||
{
|
{
|
||||||
/* check signature */
|
/* check signature */
|
||||||
@ -102,6 +106,10 @@ void bootmagic(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Scan Keycode
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
static bool scan_keycode(uint8_t keycode)
|
static bool scan_keycode(uint8_t keycode)
|
||||||
{
|
{
|
||||||
for (uint8_t r = 0; r < MATRIX_ROWS; r++) {
|
for (uint8_t r = 0; r < MATRIX_ROWS; r++) {
|
||||||
@ -117,6 +125,10 @@ static bool scan_keycode(uint8_t keycode)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Bootmagic Scan Keycode
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
bool bootmagic_scan_keycode(uint8_t keycode)
|
bool bootmagic_scan_keycode(uint8_t keycode)
|
||||||
{
|
{
|
||||||
if (!scan_keycode(BOOTMAGIC_KEY_SALT)) return false;
|
if (!scan_keycode(BOOTMAGIC_KEY_SALT)) return false;
|
||||||
|
@ -2,6 +2,8 @@
|
|||||||
#define BOOTMAGIC_H
|
#define BOOTMAGIC_H
|
||||||
|
|
||||||
|
|
||||||
|
/* FIXME: Add special doxygen comments for defines here. */
|
||||||
|
|
||||||
/* bootmagic salt key */
|
/* bootmagic salt key */
|
||||||
#ifndef BOOTMAGIC_KEY_SALT
|
#ifndef BOOTMAGIC_KEY_SALT
|
||||||
#define BOOTMAGIC_KEY_SALT KC_SPACE
|
#define BOOTMAGIC_KEY_SALT KC_SPACE
|
||||||
|
@ -13,11 +13,19 @@ extern uint32_t __ram0_end__;
|
|||||||
#define MAGIC_ADDR (unsigned long*)(SYMVAL(__ram0_end__) - 4)
|
#define MAGIC_ADDR (unsigned long*)(SYMVAL(__ram0_end__) - 4)
|
||||||
|
|
||||||
|
|
||||||
|
/** \brief Jump to the bootloader
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
void bootloader_jump(void) {
|
void bootloader_jump(void) {
|
||||||
*MAGIC_ADDR = BOOTLOADER_MAGIC; // set magic flag => reset handler will jump into boot loader
|
*MAGIC_ADDR = BOOTLOADER_MAGIC; // set magic flag => reset handler will jump into boot loader
|
||||||
NVIC_SystemReset();
|
NVIC_SystemReset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Enter bootloader mode if requested
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
void enter_bootloader_mode_if_requested(void) {
|
void enter_bootloader_mode_if_requested(void) {
|
||||||
unsigned long* check = MAGIC_ADDR;
|
unsigned long* check = MAGIC_ADDR;
|
||||||
if(*check == BOOTLOADER_MAGIC) {
|
if(*check == BOOTLOADER_MAGIC) {
|
||||||
|
@ -79,6 +79,10 @@
|
|||||||
#define EEESIZE 0x39
|
#define EEESIZE 0x39
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/** \brief eeprom initialization
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
void eeprom_initialize(void)
|
void eeprom_initialize(void)
|
||||||
{
|
{
|
||||||
uint32_t count=0;
|
uint32_t count=0;
|
||||||
@ -111,6 +115,10 @@ void eeprom_initialize(void)
|
|||||||
|
|
||||||
#define FlexRAM ((uint8_t *)0x14000000)
|
#define FlexRAM ((uint8_t *)0x14000000)
|
||||||
|
|
||||||
|
/** \brief eeprom read byte
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
uint8_t eeprom_read_byte(const uint8_t *addr)
|
uint8_t eeprom_read_byte(const uint8_t *addr)
|
||||||
{
|
{
|
||||||
uint32_t offset = (uint32_t)addr;
|
uint32_t offset = (uint32_t)addr;
|
||||||
@ -119,6 +127,10 @@ uint8_t eeprom_read_byte(const uint8_t *addr)
|
|||||||
return FlexRAM[offset];
|
return FlexRAM[offset];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief eeprom read word
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
uint16_t eeprom_read_word(const uint16_t *addr)
|
uint16_t eeprom_read_word(const uint16_t *addr)
|
||||||
{
|
{
|
||||||
uint32_t offset = (uint32_t)addr;
|
uint32_t offset = (uint32_t)addr;
|
||||||
@ -127,6 +139,10 @@ uint16_t eeprom_read_word(const uint16_t *addr)
|
|||||||
return *(uint16_t *)(&FlexRAM[offset]);
|
return *(uint16_t *)(&FlexRAM[offset]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief eeprom read dword
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
uint32_t eeprom_read_dword(const uint32_t *addr)
|
uint32_t eeprom_read_dword(const uint32_t *addr)
|
||||||
{
|
{
|
||||||
uint32_t offset = (uint32_t)addr;
|
uint32_t offset = (uint32_t)addr;
|
||||||
@ -135,6 +151,10 @@ uint32_t eeprom_read_dword(const uint32_t *addr)
|
|||||||
return *(uint32_t *)(&FlexRAM[offset]);
|
return *(uint32_t *)(&FlexRAM[offset]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief eeprom read block
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
void eeprom_read_block(void *buf, const void *addr, uint32_t len)
|
void eeprom_read_block(void *buf, const void *addr, uint32_t len)
|
||||||
{
|
{
|
||||||
uint32_t offset = (uint32_t)addr;
|
uint32_t offset = (uint32_t)addr;
|
||||||
@ -148,11 +168,19 @@ void eeprom_read_block(void *buf, const void *addr, uint32_t len)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief eeprom is ready
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
int eeprom_is_ready(void)
|
int eeprom_is_ready(void)
|
||||||
{
|
{
|
||||||
return (FTFL->FCNFG & FTFL_FCNFG_EEERDY) ? 1 : 0;
|
return (FTFL->FCNFG & FTFL_FCNFG_EEERDY) ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief flexram wait
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
static void flexram_wait(void)
|
static void flexram_wait(void)
|
||||||
{
|
{
|
||||||
while (!(FTFL->FCNFG & FTFL_FCNFG_EEERDY)) {
|
while (!(FTFL->FCNFG & FTFL_FCNFG_EEERDY)) {
|
||||||
@ -160,6 +188,10 @@ static void flexram_wait(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief eeprom_write_byte
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
void eeprom_write_byte(uint8_t *addr, uint8_t value)
|
void eeprom_write_byte(uint8_t *addr, uint8_t value)
|
||||||
{
|
{
|
||||||
uint32_t offset = (uint32_t)addr;
|
uint32_t offset = (uint32_t)addr;
|
||||||
@ -172,6 +204,10 @@ void eeprom_write_byte(uint8_t *addr, uint8_t value)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief eeprom write word
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
void eeprom_write_word(uint16_t *addr, uint16_t value)
|
void eeprom_write_word(uint16_t *addr, uint16_t value)
|
||||||
{
|
{
|
||||||
uint32_t offset = (uint32_t)addr;
|
uint32_t offset = (uint32_t)addr;
|
||||||
@ -199,6 +235,10 @@ void eeprom_write_word(uint16_t *addr, uint16_t value)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief eeprom write dword
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
void eeprom_write_dword(uint32_t *addr, uint32_t value)
|
void eeprom_write_dword(uint32_t *addr, uint32_t value)
|
||||||
{
|
{
|
||||||
uint32_t offset = (uint32_t)addr;
|
uint32_t offset = (uint32_t)addr;
|
||||||
@ -242,6 +282,10 @@ void eeprom_write_dword(uint32_t *addr, uint32_t value)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief eeprom write block
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
void eeprom_write_block(const void *buf, void *addr, uint32_t len)
|
void eeprom_write_block(const void *buf, void *addr, uint32_t len)
|
||||||
{
|
{
|
||||||
uint32_t offset = (uint32_t)addr;
|
uint32_t offset = (uint32_t)addr;
|
||||||
|
@ -12,11 +12,19 @@
|
|||||||
#include "suspend.h"
|
#include "suspend.h"
|
||||||
#include "wait.h"
|
#include "wait.h"
|
||||||
|
|
||||||
|
/** \brief suspend idle
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
void suspend_idle(uint8_t time) {
|
void suspend_idle(uint8_t time) {
|
||||||
// TODO: this is not used anywhere - what units is 'time' in?
|
// TODO: this is not used anywhere - what units is 'time' in?
|
||||||
wait_ms(time);
|
wait_ms(time);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief suspend power down
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
void suspend_power_down(void) {
|
void suspend_power_down(void) {
|
||||||
// TODO: figure out what to power down and how
|
// TODO: figure out what to power down and how
|
||||||
// shouldn't power down TPM/FTM if we want a breathing LED
|
// shouldn't power down TPM/FTM if we want a breathing LED
|
||||||
@ -28,6 +36,10 @@ void suspend_power_down(void) {
|
|||||||
wait_ms(17);
|
wait_ms(17);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief suspend wakeup condition
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
__attribute__ ((weak)) void matrix_power_up(void) {}
|
__attribute__ ((weak)) void matrix_power_up(void) {}
|
||||||
__attribute__ ((weak)) void matrix_power_down(void) {}
|
__attribute__ ((weak)) void matrix_power_down(void) {}
|
||||||
bool suspend_wakeup_condition(void)
|
bool suspend_wakeup_condition(void)
|
||||||
@ -41,7 +53,11 @@ bool suspend_wakeup_condition(void)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// run immediately after wakeup
|
/** \brief suspend wakeup condition
|
||||||
|
*
|
||||||
|
* run immediately after wakeup
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
void suspend_wakeup_init(void)
|
void suspend_wakeup_init(void)
|
||||||
{
|
{
|
||||||
// clear keyboard state
|
// clear keyboard state
|
||||||
|
@ -18,6 +18,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
#ifndef COMMAND_H
|
#ifndef COMMAND_H
|
||||||
#define COMMAND
|
#define COMMAND
|
||||||
|
|
||||||
|
/* FIXME: Add doxygen comments for the behavioral defines in here. */
|
||||||
|
|
||||||
/* TODO: Refactoring */
|
/* TODO: Refactoring */
|
||||||
typedef enum { ONESHOT, CONSOLE, MOUSEKEY } command_state_t;
|
typedef enum { ONESHOT, CONSOLE, MOUSEKEY } command_state_t;
|
||||||
extern command_state_t command_state;
|
extern command_state_t command_state;
|
||||||
|
@ -3,6 +3,10 @@
|
|||||||
#include "eeprom.h"
|
#include "eeprom.h"
|
||||||
#include "eeconfig.h"
|
#include "eeconfig.h"
|
||||||
|
|
||||||
|
/** \brief eeconfig initialization
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
void eeconfig_init(void)
|
void eeconfig_init(void)
|
||||||
{
|
{
|
||||||
eeprom_update_word(EECONFIG_MAGIC, EECONFIG_MAGIC_NUMBER);
|
eeprom_update_word(EECONFIG_MAGIC, EECONFIG_MAGIC_NUMBER);
|
||||||
@ -24,36 +28,88 @@ void eeconfig_init(void)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief eeconfig enable
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
void eeconfig_enable(void)
|
void eeconfig_enable(void)
|
||||||
{
|
{
|
||||||
eeprom_update_word(EECONFIG_MAGIC, EECONFIG_MAGIC_NUMBER);
|
eeprom_update_word(EECONFIG_MAGIC, EECONFIG_MAGIC_NUMBER);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief eeconfig disable
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
void eeconfig_disable(void)
|
void eeconfig_disable(void)
|
||||||
{
|
{
|
||||||
eeprom_update_word(EECONFIG_MAGIC, 0xFFFF);
|
eeprom_update_word(EECONFIG_MAGIC, 0xFFFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief eeconfig is enabled
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
bool eeconfig_is_enabled(void)
|
bool eeconfig_is_enabled(void)
|
||||||
{
|
{
|
||||||
return (eeprom_read_word(EECONFIG_MAGIC) == EECONFIG_MAGIC_NUMBER);
|
return (eeprom_read_word(EECONFIG_MAGIC) == EECONFIG_MAGIC_NUMBER);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief eeconfig read debug
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
uint8_t eeconfig_read_debug(void) { return eeprom_read_byte(EECONFIG_DEBUG); }
|
uint8_t eeconfig_read_debug(void) { return eeprom_read_byte(EECONFIG_DEBUG); }
|
||||||
|
/** \brief eeconfig update debug
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
void eeconfig_update_debug(uint8_t val) { eeprom_update_byte(EECONFIG_DEBUG, val); }
|
void eeconfig_update_debug(uint8_t val) { eeprom_update_byte(EECONFIG_DEBUG, val); }
|
||||||
|
|
||||||
|
/** \brief eeconfig read default layer
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
uint8_t eeconfig_read_default_layer(void) { return eeprom_read_byte(EECONFIG_DEFAULT_LAYER); }
|
uint8_t eeconfig_read_default_layer(void) { return eeprom_read_byte(EECONFIG_DEFAULT_LAYER); }
|
||||||
|
/** \brief eeconfig update default layer
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
void eeconfig_update_default_layer(uint8_t val) { eeprom_update_byte(EECONFIG_DEFAULT_LAYER, val); }
|
void eeconfig_update_default_layer(uint8_t val) { eeprom_update_byte(EECONFIG_DEFAULT_LAYER, val); }
|
||||||
|
|
||||||
|
/** \brief eeconfig read keymap
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
uint8_t eeconfig_read_keymap(void) { return eeprom_read_byte(EECONFIG_KEYMAP); }
|
uint8_t eeconfig_read_keymap(void) { return eeprom_read_byte(EECONFIG_KEYMAP); }
|
||||||
|
/** \brief eeconfig update keymap
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
void eeconfig_update_keymap(uint8_t val) { eeprom_update_byte(EECONFIG_KEYMAP, val); }
|
void eeconfig_update_keymap(uint8_t val) { eeprom_update_byte(EECONFIG_KEYMAP, val); }
|
||||||
|
|
||||||
#ifdef BACKLIGHT_ENABLE
|
#ifdef BACKLIGHT_ENABLE
|
||||||
|
/** \brief eeconfig read backlight
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
uint8_t eeconfig_read_backlight(void) { return eeprom_read_byte(EECONFIG_BACKLIGHT); }
|
uint8_t eeconfig_read_backlight(void) { return eeprom_read_byte(EECONFIG_BACKLIGHT); }
|
||||||
|
/** \brief eeconfig update backlight
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
void eeconfig_update_backlight(uint8_t val) { eeprom_update_byte(EECONFIG_BACKLIGHT, val); }
|
void eeconfig_update_backlight(uint8_t val) { eeprom_update_byte(EECONFIG_BACKLIGHT, val); }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef AUDIO_ENABLE
|
#ifdef AUDIO_ENABLE
|
||||||
|
/** \brief eeconfig read audio
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
uint8_t eeconfig_read_audio(void) { return eeprom_read_byte(EECONFIG_AUDIO); }
|
uint8_t eeconfig_read_audio(void) { return eeprom_read_byte(EECONFIG_AUDIO); }
|
||||||
|
/** \brief eeconfig update audio
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
void eeconfig_update_audio(uint8_t val) { eeprom_update_byte(EECONFIG_AUDIO, val); }
|
void eeconfig_update_audio(uint8_t val) { eeprom_update_byte(EECONFIG_AUDIO, val); }
|
||||||
#endif
|
#endif
|
||||||
|
@ -117,19 +117,35 @@ static inline bool has_ghost_in_row(uint8_t row, matrix_row_t rowdata)
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/** \brief matrix_setup
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
__attribute__ ((weak))
|
__attribute__ ((weak))
|
||||||
void matrix_setup(void) {
|
void matrix_setup(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief keyboard_setup
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
void keyboard_setup(void) {
|
void keyboard_setup(void) {
|
||||||
matrix_setup();
|
matrix_setup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief is_keyboard_master
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
__attribute__((weak))
|
__attribute__((weak))
|
||||||
bool is_keyboard_master(void) {
|
bool is_keyboard_master(void) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief keyboard_init
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
void keyboard_init(void) {
|
void keyboard_init(void) {
|
||||||
timer_init();
|
timer_init();
|
||||||
matrix_init();
|
matrix_init();
|
||||||
@ -167,8 +183,16 @@ void keyboard_init(void) {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/** \brief Keyboard task: Do keyboard routine jobs
|
||||||
* Do keyboard routine jobs: scan matrix, light LEDs, ...
|
*
|
||||||
|
* Do routine keyboard jobs:
|
||||||
|
*
|
||||||
|
* * scan matrix
|
||||||
|
* * handle mouse movements
|
||||||
|
* * run visualizer code
|
||||||
|
* * handle midi commands
|
||||||
|
* * light LEDs
|
||||||
|
*
|
||||||
* This is repeatedly called as fast as possible.
|
* This is repeatedly called as fast as possible.
|
||||||
*/
|
*/
|
||||||
void keyboard_task(void)
|
void keyboard_task(void)
|
||||||
@ -274,6 +298,10 @@ MATRIX_LOOP_END:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief keyboard set leds
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
void keyboard_set_leds(uint8_t leds)
|
void keyboard_set_leds(uint8_t leds)
|
||||||
{
|
{
|
||||||
if (debug_keyboard) { debug("keyboard_set_led: "); debug_hex8(leds); debug("\n"); }
|
if (debug_keyboard) { debug("keyboard_set_led: "); debug_hex8(leds); debug("\n"); }
|
||||||
|
@ -22,6 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
#ifndef KEYCODE_H
|
#ifndef KEYCODE_H
|
||||||
#define KEYCODE_H
|
#define KEYCODE_H
|
||||||
|
|
||||||
|
/* FIXME: Add doxygen comments here */
|
||||||
|
|
||||||
#define IS_ERROR(code) (KC_ROLL_OVER <= (code) && (code) <= KC_UNDEFINED)
|
#define IS_ERROR(code) (KC_ROLL_OVER <= (code) && (code) <= KC_UNDEFINED)
|
||||||
#define IS_ANY(code) (KC_A <= (code) && (code) <= 0xFF)
|
#define IS_ANY(code) (KC_A <= (code) && (code) <= 0xFF)
|
||||||
|
@ -19,6 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
#define LED_H
|
#define LED_H
|
||||||
#include "stdint.h"
|
#include "stdint.h"
|
||||||
|
|
||||||
|
/* FIXME: Add doxygen comments here. */
|
||||||
|
|
||||||
/* keyboard LEDs */
|
/* keyboard LEDs */
|
||||||
#define USB_LED_NUM_LOCK 0
|
#define USB_LED_NUM_LOCK 0
|
||||||
|
@ -14,6 +14,10 @@
|
|||||||
|
|
||||||
keymap_config_t keymap_config;
|
keymap_config_t keymap_config;
|
||||||
|
|
||||||
|
/** \brief Magic
|
||||||
|
*
|
||||||
|
* FIXME: Needs doc
|
||||||
|
*/
|
||||||
void magic(void)
|
void magic(void)
|
||||||
{
|
{
|
||||||
/* check signature */
|
/* check signature */
|
||||||
|
@ -20,6 +20,10 @@
|
|||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
|
/** \brief has_anykey
|
||||||
|
*
|
||||||
|
* FIXME: Needs doc
|
||||||
|
*/
|
||||||
uint8_t has_anykey(report_keyboard_t* keyboard_report)
|
uint8_t has_anykey(report_keyboard_t* keyboard_report)
|
||||||
{
|
{
|
||||||
uint8_t cnt = 0;
|
uint8_t cnt = 0;
|
||||||
@ -30,6 +34,10 @@ uint8_t has_anykey(report_keyboard_t* keyboard_report)
|
|||||||
return cnt;
|
return cnt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief get_first_key
|
||||||
|
*
|
||||||
|
* FIXME: Needs doc
|
||||||
|
*/
|
||||||
uint8_t get_first_key(report_keyboard_t* keyboard_report)
|
uint8_t get_first_key(report_keyboard_t* keyboard_report)
|
||||||
{
|
{
|
||||||
#ifdef NKRO_ENABLE
|
#ifdef NKRO_ENABLE
|
||||||
@ -54,6 +62,10 @@ uint8_t get_first_key(report_keyboard_t* keyboard_report)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief add key byte
|
||||||
|
*
|
||||||
|
* FIXME: Needs doc
|
||||||
|
*/
|
||||||
void add_key_byte(report_keyboard_t* keyboard_report, uint8_t code)
|
void add_key_byte(report_keyboard_t* keyboard_report, uint8_t code)
|
||||||
{
|
{
|
||||||
#ifdef USB_6KRO_ENABLE
|
#ifdef USB_6KRO_ENABLE
|
||||||
@ -120,6 +132,10 @@ void add_key_byte(report_keyboard_t* keyboard_report, uint8_t code)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief del key byte
|
||||||
|
*
|
||||||
|
* FIXME: Needs doc
|
||||||
|
*/
|
||||||
void del_key_byte(report_keyboard_t* keyboard_report, uint8_t code)
|
void del_key_byte(report_keyboard_t* keyboard_report, uint8_t code)
|
||||||
{
|
{
|
||||||
#ifdef USB_6KRO_ENABLE
|
#ifdef USB_6KRO_ENABLE
|
||||||
@ -157,6 +173,10 @@ void del_key_byte(report_keyboard_t* keyboard_report, uint8_t code)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef NKRO_ENABLE
|
#ifdef NKRO_ENABLE
|
||||||
|
/** \brief add key bit
|
||||||
|
*
|
||||||
|
* FIXME: Needs doc
|
||||||
|
*/
|
||||||
void add_key_bit(report_keyboard_t* keyboard_report, uint8_t code)
|
void add_key_bit(report_keyboard_t* keyboard_report, uint8_t code)
|
||||||
{
|
{
|
||||||
if ((code>>3) < KEYBOARD_REPORT_BITS) {
|
if ((code>>3) < KEYBOARD_REPORT_BITS) {
|
||||||
@ -166,6 +186,10 @@ void add_key_bit(report_keyboard_t* keyboard_report, uint8_t code)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief del key bit
|
||||||
|
*
|
||||||
|
* FIXME: Needs doc
|
||||||
|
*/
|
||||||
void del_key_bit(report_keyboard_t* keyboard_report, uint8_t code)
|
void del_key_bit(report_keyboard_t* keyboard_report, uint8_t code)
|
||||||
{
|
{
|
||||||
if ((code>>3) < KEYBOARD_REPORT_BITS) {
|
if ((code>>3) < KEYBOARD_REPORT_BITS) {
|
||||||
@ -176,6 +200,10 @@ void del_key_bit(report_keyboard_t* keyboard_report, uint8_t code)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/** \brief add key to report
|
||||||
|
*
|
||||||
|
* FIXME: Needs doc
|
||||||
|
*/
|
||||||
void add_key_to_report(report_keyboard_t* keyboard_report, uint8_t key)
|
void add_key_to_report(report_keyboard_t* keyboard_report, uint8_t key)
|
||||||
{
|
{
|
||||||
#ifdef NKRO_ENABLE
|
#ifdef NKRO_ENABLE
|
||||||
@ -187,6 +215,10 @@ void add_key_to_report(report_keyboard_t* keyboard_report, uint8_t key)
|
|||||||
add_key_byte(keyboard_report, key);
|
add_key_byte(keyboard_report, key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief del key from report
|
||||||
|
*
|
||||||
|
* FIXME: Needs doc
|
||||||
|
*/
|
||||||
void del_key_from_report(report_keyboard_t* keyboard_report, uint8_t key)
|
void del_key_from_report(report_keyboard_t* keyboard_report, uint8_t key)
|
||||||
{
|
{
|
||||||
#ifdef NKRO_ENABLE
|
#ifdef NKRO_ENABLE
|
||||||
@ -198,6 +230,10 @@ void del_key_from_report(report_keyboard_t* keyboard_report, uint8_t key)
|
|||||||
del_key_byte(keyboard_report, key);
|
del_key_byte(keyboard_report, key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief clear key from report
|
||||||
|
*
|
||||||
|
* FIXME: Needs doc
|
||||||
|
*/
|
||||||
void clear_keys_from_report(report_keyboard_t* keyboard_report)
|
void clear_keys_from_report(report_keyboard_t* keyboard_report)
|
||||||
{
|
{
|
||||||
// not clear mods
|
// not clear mods
|
||||||
|
@ -141,6 +141,10 @@ USB_ClassInfo_CDC_Device_t cdc_device =
|
|||||||
|
|
||||||
#ifdef RAW_ENABLE
|
#ifdef RAW_ENABLE
|
||||||
|
|
||||||
|
/** \brief Raw HID Send
|
||||||
|
*
|
||||||
|
* FIXME: Needs doc
|
||||||
|
*/
|
||||||
void raw_hid_send( uint8_t *data, uint8_t length )
|
void raw_hid_send( uint8_t *data, uint8_t length )
|
||||||
{
|
{
|
||||||
// TODO: implement variable size packet
|
// TODO: implement variable size packet
|
||||||
@ -172,6 +176,10 @@ void raw_hid_send( uint8_t *data, uint8_t length )
|
|||||||
Endpoint_SelectEndpoint(ep);
|
Endpoint_SelectEndpoint(ep);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Raw HID Receive
|
||||||
|
*
|
||||||
|
* FIXME: Needs doc
|
||||||
|
*/
|
||||||
__attribute__ ((weak))
|
__attribute__ ((weak))
|
||||||
void raw_hid_receive( uint8_t *data, uint8_t length )
|
void raw_hid_receive( uint8_t *data, uint8_t length )
|
||||||
{
|
{
|
||||||
@ -180,6 +188,10 @@ void raw_hid_receive( uint8_t *data, uint8_t length )
|
|||||||
// so users can opt to not handle data coming in.
|
// so users can opt to not handle data coming in.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Raw HID Task
|
||||||
|
*
|
||||||
|
* FIXME: Needs doc
|
||||||
|
*/
|
||||||
static void raw_hid_task(void)
|
static void raw_hid_task(void)
|
||||||
{
|
{
|
||||||
// Create a temporary buffer to hold the read in data from the host
|
// Create a temporary buffer to hold the read in data from the host
|
||||||
@ -218,6 +230,10 @@ static void raw_hid_task(void)
|
|||||||
* Console
|
* Console
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
#ifdef CONSOLE_ENABLE
|
#ifdef CONSOLE_ENABLE
|
||||||
|
/** \brief Console Task
|
||||||
|
*
|
||||||
|
* FIXME: Needs doc
|
||||||
|
*/
|
||||||
static void Console_Task(void)
|
static void Console_Task(void)
|
||||||
{
|
{
|
||||||
/* Device must be connected and configured for the task to run */
|
/* Device must be connected and configured for the task to run */
|
||||||
@ -282,6 +298,10 @@ static void Console_Task(void)
|
|||||||
* 2) EVENT_USB_Device_Reset
|
* 2) EVENT_USB_Device_Reset
|
||||||
* 3) EVENT_USB_Device_Wake
|
* 3) EVENT_USB_Device_Wake
|
||||||
*/
|
*/
|
||||||
|
/** \brief Event USB Device Connect
|
||||||
|
*
|
||||||
|
* FIXME: Needs doc
|
||||||
|
*/
|
||||||
void EVENT_USB_Device_Connect(void)
|
void EVENT_USB_Device_Connect(void)
|
||||||
{
|
{
|
||||||
print("[C]");
|
print("[C]");
|
||||||
@ -293,6 +313,10 @@ void EVENT_USB_Device_Connect(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Event USB Device Connect
|
||||||
|
*
|
||||||
|
* FIXME: Needs doc
|
||||||
|
*/
|
||||||
void EVENT_USB_Device_Disconnect(void)
|
void EVENT_USB_Device_Disconnect(void)
|
||||||
{
|
{
|
||||||
print("[D]");
|
print("[D]");
|
||||||
@ -307,11 +331,19 @@ void EVENT_USB_Device_Disconnect(void)
|
|||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Event USB Device Connect
|
||||||
|
*
|
||||||
|
* FIXME: Needs doc
|
||||||
|
*/
|
||||||
void EVENT_USB_Device_Reset(void)
|
void EVENT_USB_Device_Reset(void)
|
||||||
{
|
{
|
||||||
print("[R]");
|
print("[R]");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Event USB Device Connect
|
||||||
|
*
|
||||||
|
* FIXME: Needs doc
|
||||||
|
*/
|
||||||
void EVENT_USB_Device_Suspend()
|
void EVENT_USB_Device_Suspend()
|
||||||
{
|
{
|
||||||
print("[S]");
|
print("[S]");
|
||||||
@ -320,6 +352,10 @@ void EVENT_USB_Device_Suspend()
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Event USB Device Connect
|
||||||
|
*
|
||||||
|
* FIXME: Needs doc
|
||||||
|
*/
|
||||||
void EVENT_USB_Device_WakeUp()
|
void EVENT_USB_Device_WakeUp()
|
||||||
{
|
{
|
||||||
print("[W]");
|
print("[W]");
|
||||||
@ -342,7 +378,11 @@ static bool console_flush = false;
|
|||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
// called every 1ms
|
/** \brief Event USB Device Start Of Frame
|
||||||
|
*
|
||||||
|
* FIXME: Needs doc
|
||||||
|
* called every 1ms
|
||||||
|
*/
|
||||||
void EVENT_USB_Device_StartOfFrame(void)
|
void EVENT_USB_Device_StartOfFrame(void)
|
||||||
{
|
{
|
||||||
static uint8_t count;
|
static uint8_t count;
|
||||||
@ -356,11 +396,12 @@ void EVENT_USB_Device_StartOfFrame(void)
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/** Event handler for the USB_ConfigurationChanged event.
|
/** \brief Event handler for the USB_ConfigurationChanged event.
|
||||||
|
*
|
||||||
* This is fired when the host sets the current configuration of the USB device after enumeration.
|
* This is fired when the host sets the current configuration of the USB device after enumeration.
|
||||||
*
|
*
|
||||||
* ATMega32u2 supports dual bank(ping-pong mode) only on endpoint 3 and 4,
|
* ATMega32u2 supports dual bank(ping-pong mode) only on endpoint 3 and 4,
|
||||||
* it is safe to use singl bank for all endpoints.
|
* it is safe to use single bank for all endpoints.
|
||||||
*/
|
*/
|
||||||
void EVENT_USB_Device_ConfigurationChanged(void)
|
void EVENT_USB_Device_ConfigurationChanged(void)
|
||||||
{
|
{
|
||||||
@ -418,7 +459,7 @@ void EVENT_USB_Device_ConfigurationChanged(void)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/* FIXME: Expose this table in the docs somehow
|
||||||
Appendix G: HID Request Support Requirements
|
Appendix G: HID Request Support Requirements
|
||||||
|
|
||||||
The following table enumerates the requests that need to be supported by various types of HID class devices.
|
The 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
|
|||||||
Non-Boot Keybrd Required Optional Required Required Optional Optional
|
Non-Boot Keybrd Required Optional Required Required Optional Optional
|
||||||
Other Device Required Optional Optional Optional Optional Optional
|
Other Device Required Optional Optional Optional Optional Optional
|
||||||
*/
|
*/
|
||||||
/** Event handler for the USB_ControlRequest event.
|
/** \brief Event handler for the USB_ControlRequest event.
|
||||||
|
*
|
||||||
* This is fired before passing along unhandled control requests to the library for processing internally.
|
* This is fired before passing along unhandled control requests to the library for processing internally.
|
||||||
*/
|
*/
|
||||||
void EVENT_USB_Device_ControlRequest(void)
|
void EVENT_USB_Device_ControlRequest(void)
|
||||||
@ -546,11 +588,19 @@ void EVENT_USB_Device_ControlRequest(void)
|
|||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Host driver
|
* Host driver
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
/** \brief Keyboard LEDs
|
||||||
|
*
|
||||||
|
* FIXME: Needs doc
|
||||||
|
*/
|
||||||
static uint8_t keyboard_leds(void)
|
static uint8_t keyboard_leds(void)
|
||||||
{
|
{
|
||||||
return keyboard_led_stats;
|
return keyboard_led_stats;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Send Keyboard
|
||||||
|
*
|
||||||
|
* FIXME: Needs doc
|
||||||
|
*/
|
||||||
static void send_keyboard(report_keyboard_t *report)
|
static void send_keyboard(report_keyboard_t *report)
|
||||||
{
|
{
|
||||||
uint8_t timeout = 255;
|
uint8_t timeout = 255;
|
||||||
@ -613,6 +663,10 @@ static void send_keyboard(report_keyboard_t *report)
|
|||||||
keyboard_report_sent = *report;
|
keyboard_report_sent = *report;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Send Mouse
|
||||||
|
*
|
||||||
|
* FIXME: Needs doc
|
||||||
|
*/
|
||||||
static void send_mouse(report_mouse_t *report)
|
static void send_mouse(report_mouse_t *report)
|
||||||
{
|
{
|
||||||
#ifdef MOUSE_ENABLE
|
#ifdef MOUSE_ENABLE
|
||||||
@ -657,6 +711,10 @@ static void send_mouse(report_mouse_t *report)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Send System
|
||||||
|
*
|
||||||
|
* FIXME: Needs doc
|
||||||
|
*/
|
||||||
static void send_system(uint16_t data)
|
static void send_system(uint16_t data)
|
||||||
{
|
{
|
||||||
uint8_t timeout = 255;
|
uint8_t timeout = 255;
|
||||||
@ -678,6 +736,10 @@ static void send_system(uint16_t data)
|
|||||||
Endpoint_ClearIN();
|
Endpoint_ClearIN();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Send Consumer
|
||||||
|
*
|
||||||
|
* FIXME: Needs doc
|
||||||
|
*/
|
||||||
static void send_consumer(uint16_t data)
|
static void send_consumer(uint16_t data)
|
||||||
{
|
{
|
||||||
uint8_t timeout = 255;
|
uint8_t timeout = 255;
|
||||||
@ -739,6 +801,10 @@ static void send_consumer(uint16_t data)
|
|||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
#ifdef CONSOLE_ENABLE
|
#ifdef CONSOLE_ENABLE
|
||||||
#define SEND_TIMEOUT 5
|
#define SEND_TIMEOUT 5
|
||||||
|
/** \brief Send Char
|
||||||
|
*
|
||||||
|
* FIXME: Needs doc
|
||||||
|
*/
|
||||||
int8_t sendchar(uint8_t c)
|
int8_t sendchar(uint8_t c)
|
||||||
{
|
{
|
||||||
// Not wait once timeouted.
|
// Not wait once timeouted.
|
||||||
@ -842,18 +908,30 @@ bool recv_midi_packet(MIDI_EventPacket_t* const event) {
|
|||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|
||||||
#ifdef VIRTSER_ENABLE
|
#ifdef VIRTSER_ENABLE
|
||||||
|
/** \brief Virtual Serial Init
|
||||||
|
*
|
||||||
|
* FIXME: Needs doc
|
||||||
|
*/
|
||||||
void virtser_init(void)
|
void virtser_init(void)
|
||||||
{
|
{
|
||||||
cdc_device.State.ControlLineStates.DeviceToHost = CDC_CONTROL_LINE_IN_DSR ;
|
cdc_device.State.ControlLineStates.DeviceToHost = CDC_CONTROL_LINE_IN_DSR ;
|
||||||
CDC_Device_SendControlLineStateChange(&cdc_device);
|
CDC_Device_SendControlLineStateChange(&cdc_device);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Virtual Serial Receive
|
||||||
|
*
|
||||||
|
* FIXME: Needs doc
|
||||||
|
*/
|
||||||
void virtser_recv(uint8_t c) __attribute__ ((weak));
|
void virtser_recv(uint8_t c) __attribute__ ((weak));
|
||||||
void virtser_recv(uint8_t c)
|
void virtser_recv(uint8_t c)
|
||||||
{
|
{
|
||||||
// Ignore by default
|
// Ignore by default
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Virtual Serial Task
|
||||||
|
*
|
||||||
|
* FIXME: Needs doc
|
||||||
|
*/
|
||||||
void virtser_task(void)
|
void virtser_task(void)
|
||||||
{
|
{
|
||||||
uint16_t count = CDC_Device_BytesReceived(&cdc_device);
|
uint16_t count = CDC_Device_BytesReceived(&cdc_device);
|
||||||
@ -864,6 +942,10 @@ void virtser_task(void)
|
|||||||
virtser_recv(ch);
|
virtser_recv(ch);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/** \brief Virtual Serial Send
|
||||||
|
*
|
||||||
|
* FIXME: Needs doc
|
||||||
|
*/
|
||||||
void virtser_send(const uint8_t byte)
|
void virtser_send(const uint8_t byte)
|
||||||
{
|
{
|
||||||
uint8_t timeout = 255;
|
uint8_t timeout = 255;
|
||||||
@ -896,6 +978,10 @@ void virtser_send(const uint8_t byte)
|
|||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* main
|
* main
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
/** \brief Setup MCU
|
||||||
|
*
|
||||||
|
* FIXME: Needs doc
|
||||||
|
*/
|
||||||
static void setup_mcu(void)
|
static void setup_mcu(void)
|
||||||
{
|
{
|
||||||
/* Disable watchdog if enabled by bootloader/fuses */
|
/* Disable watchdog if enabled by bootloader/fuses */
|
||||||
@ -909,6 +995,10 @@ static void setup_mcu(void)
|
|||||||
CLKPR = (0 << CLKPS3) | (0 << CLKPS2) | (0 << CLKPS1) | (0 << CLKPS0);
|
CLKPR = (0 << CLKPS3) | (0 << CLKPS2) | (0 << CLKPS1) | (0 << CLKPS0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Setup USB
|
||||||
|
*
|
||||||
|
* FIXME: Needs doc
|
||||||
|
*/
|
||||||
static void setup_usb(void)
|
static void setup_usb(void)
|
||||||
{
|
{
|
||||||
// Leonardo needs. Without this USB device is not recognized.
|
// Leonardo needs. Without this USB device is not recognized.
|
||||||
@ -921,6 +1011,10 @@ static void setup_usb(void)
|
|||||||
print_set_sendchar(sendchar);
|
print_set_sendchar(sendchar);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Main
|
||||||
|
*
|
||||||
|
* FIXME: Needs doc
|
||||||
|
*/
|
||||||
int main(void) __attribute__ ((weak));
|
int main(void) __attribute__ ((weak));
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
|
@ -20,15 +20,27 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
|
|
||||||
uint8_t desired_output = OUTPUT_DEFAULT;
|
uint8_t desired_output = OUTPUT_DEFAULT;
|
||||||
|
|
||||||
|
/** \brief Set Output
|
||||||
|
*
|
||||||
|
* FIXME: Needs doc
|
||||||
|
*/
|
||||||
void set_output(uint8_t output) {
|
void set_output(uint8_t output) {
|
||||||
set_output_user(output);
|
set_output_user(output);
|
||||||
desired_output = output;
|
desired_output = output;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Set Output User
|
||||||
|
*
|
||||||
|
* FIXME: Needs doc
|
||||||
|
*/
|
||||||
__attribute__((weak))
|
__attribute__((weak))
|
||||||
void set_output_user(uint8_t output) {
|
void set_output_user(uint8_t output) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Auto Detect Output
|
||||||
|
*
|
||||||
|
* FIXME: Needs doc
|
||||||
|
*/
|
||||||
uint8_t auto_detect_output(void) {
|
uint8_t auto_detect_output(void) {
|
||||||
if (USB_DeviceState == DEVICE_STATE_Configured) {
|
if (USB_DeviceState == DEVICE_STATE_Configured) {
|
||||||
return OUTPUT_USB;
|
return OUTPUT_USB;
|
||||||
@ -47,6 +59,10 @@ uint8_t auto_detect_output(void) {
|
|||||||
return OUTPUT_NONE;
|
return OUTPUT_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Where To Send
|
||||||
|
*
|
||||||
|
* FIXME: Needs doc
|
||||||
|
*/
|
||||||
uint8_t where_to_send(void) {
|
uint8_t where_to_send(void) {
|
||||||
if (desired_output == OUTPUT_AUTO) {
|
if (desired_output == OUTPUT_AUTO) {
|
||||||
return auto_detect_output();
|
return auto_detect_output();
|
||||||
|
31
util/generate_api_docs.sh
Executable file
31
util/generate_api_docs.sh
Executable file
@ -0,0 +1,31 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -x
|
||||||
|
|
||||||
|
if ! doxygen -v 2>&1 > /dev/null; then
|
||||||
|
echo "doxygen not found! Please install it!"
|
||||||
|
exit 1
|
||||||
|
elif ! moxygen -V 2>&1 > /dev/null; then
|
||||||
|
echo -n "moxygen not found! Would you like to install it? [y/n] "
|
||||||
|
read ANSWER
|
||||||
|
case $ANSWER in
|
||||||
|
y|Y|yes|YES|Yes)
|
||||||
|
npm install -g moxygen
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -e Doxyfile ]; then
|
||||||
|
echo "Error: You must run this from the top-level qmk_firmware directory!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Generate the doxygen XML files
|
||||||
|
rm -rf doxygen
|
||||||
|
doxygen Doxyfile
|
||||||
|
|
||||||
|
# Generate the moxygen Markdown files
|
||||||
|
moxygen -a -g -o docs/api_%s.md doxygen/xml
|
@ -1,26 +1,13 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
TRAVIS_BRANCH="${TRAVIS_BRANCH:master}"
|
|
||||||
TRAVIS_PULL_REQUEST="${TRAVIS_PULL_REQUEST:false}"
|
|
||||||
TRAVIS_COMMIT_MESSAGE="${TRAVIS_COMMIT_MESSAGE:-none}"
|
|
||||||
TRAVIS_COMMIT_RANGE="${TRAVIS_COMMIT_RANGE:-HEAD~1..HEAD}"
|
|
||||||
|
|
||||||
set -o errexit -o nounset
|
set -o errexit -o nounset
|
||||||
|
|
||||||
|
source util/travis_push.sh
|
||||||
rev=$(git rev-parse --short HEAD)
|
rev=$(git rev-parse --short HEAD)
|
||||||
|
|
||||||
if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" == "false" ]] ; then
|
if ! [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" == "false" ]] ; then
|
||||||
|
exit 0
|
||||||
git config --global user.name "QMK Bot"
|
fi
|
||||||
git config --global user.email "hello@qmk.fm"
|
|
||||||
|
|
||||||
openssl aes-256-cbc -K $encrypted_b0ee987fd0fc_key -iv $encrypted_b0ee987fd0fc_iv -in secrets.tar.enc -out secrets.tar -d
|
|
||||||
tar xvf secrets.tar
|
|
||||||
|
|
||||||
chmod 600 id_rsa_qmk_firmware
|
|
||||||
chmod 600 id_rsa_qmk.fm
|
|
||||||
eval `ssh-agent -s`
|
|
||||||
ssh-add id_rsa_qmk_firmware
|
|
||||||
|
|
||||||
# convert to unix line-endings
|
# convert to unix line-endings
|
||||||
git checkout master
|
git checkout master
|
||||||
@ -28,8 +15,7 @@ git diff --diff-filter=M --name-only -n 1 -z ${TRAVIS_COMMIT_RANGE} | xargs -0 d
|
|||||||
git diff --diff-filter=M --name-only -n 1 -z ${TRAVIS_COMMIT_RANGE} | xargs -0 git add
|
git diff --diff-filter=M --name-only -n 1 -z ${TRAVIS_COMMIT_RANGE} | xargs -0 git add
|
||||||
git commit -m "convert to unix line-endings [skip ci]" && git push git@github.com:qmk/qmk_firmware.git master
|
git commit -m "convert to unix line-endings [skip ci]" && git push git@github.com:qmk/qmk_firmware.git master
|
||||||
|
|
||||||
increment_version ()
|
increment_version () {
|
||||||
{
|
|
||||||
declare -a part=( ${1//\./ } )
|
declare -a part=( ${1//\./ } )
|
||||||
part[2]=$((part[2] + 1))
|
part[2]=$((part[2] + 1))
|
||||||
new="${part[*]}"
|
new="${part[*]}"
|
||||||
@ -76,7 +62,4 @@ if [[ "$TRAVIS_COMMIT_MESSAGE" != *"[skip build]"* ]] ; then
|
|||||||
git add -A
|
git add -A
|
||||||
git commit -m "generated from qmk/qmk_firmware@${rev}"
|
git commit -m "generated from qmk/qmk_firmware@${rev}"
|
||||||
git push git@github.com:qmk/qmk.fm.git
|
git push git@github.com:qmk/qmk.fm.git
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
||||||
fi
|
fi
|
14
util/travis_docs.sh
Normal file
14
util/travis_docs.sh
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
source util/travis_push.sh
|
||||||
|
|
||||||
|
if [[ "$TRAVIS_COMMIT_MESSAGE" != *"[skip docs]"* ]] ; then
|
||||||
|
if git diff --name-only ${TRAVIS_COMMIT_RANGE} | grep -e '^quantum/' -e '^tmk_core/' -e '^docs/api_.*'; then
|
||||||
|
echo "Generating API docs..."
|
||||||
|
rm -rf doxygen
|
||||||
|
doxygen Doxyfile
|
||||||
|
moxygen -a -g -o -q docs/api_%s.md doxygen/xml
|
||||||
|
git add docs/api_*
|
||||||
|
git commit -m'autogenerated api docs for ${TRAVIS_COMMIT_RANGE}' || true
|
||||||
|
fi
|
||||||
|
fi
|
17
util/travis_push.sh
Normal file
17
util/travis_push.sh
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
# Use this by sourcing it in your script.
|
||||||
|
|
||||||
|
TRAVIS_BRANCH="${TRAVIS_BRANCH:master}"
|
||||||
|
TRAVIS_PULL_REQUEST="${TRAVIS_PULL_REQUEST:false}"
|
||||||
|
TRAVIS_COMMIT_MESSAGE="${TRAVIS_COMMIT_MESSAGE:-none}"
|
||||||
|
TRAVIS_COMMIT_RANGE="${TRAVIS_COMMIT_RANGE:-HEAD~1..HEAD}"
|
||||||
|
|
||||||
|
git config --global user.name "QMK Bot"
|
||||||
|
git config --global user.email "hello@qmk.fm"
|
||||||
|
|
||||||
|
openssl aes-256-cbc -K $encrypted_b0ee987fd0fc_key -iv $encrypted_b0ee987fd0fc_iv -in secrets.tar.enc -out secrets.tar -d
|
||||||
|
tar xvf secrets.tar
|
||||||
|
|
||||||
|
chmod 600 id_rsa_qmk_firmware
|
||||||
|
chmod 600 id_rsa_qmk.fm
|
||||||
|
eval `ssh-agent -s`
|
||||||
|
ssh-add id_rsa_qmk_firmware
|
Loading…
Reference in New Issue
Block a user